Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use safe alignment in fast-copy raw
Date: Tue, 22 Feb 2022 13:33:50 -0800	[thread overview]
Message-ID: <871qzu7fi9.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20220221084123.22684-1-zbigniew.kempczynski@intel.com>

On Mon, 21 Feb 2022 00:41:23 -0800, Zbigniew Kempczyński wrote:
>
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index e5666cd4f..23055855b 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -990,13 +990,14 @@ void igt_blitter_fast_copy__raw(int fd,
>	uint32_t dword0, dword1;
>	uint32_t src_pitch, dst_pitch;
>	uint64_t batch_offset, src_offset, dst_offset;
> +	uint64_t align = gem_detect_safe_alignment(fd);
>	int i = 0;
>
>	batch_handle = gem_create(fd, 4096);
>	if (ahnd) {
> -		src_offset = get_offset(ahnd, src_handle, src_size, 0);
> -		dst_offset = get_offset(ahnd, dst_handle, dst_size, 0);
> -		batch_offset = get_offset(ahnd, batch_handle, 4096, 0);
> +		src_offset = get_offset(ahnd, src_handle, src_size, align);
> +		dst_offset = get_offset(ahnd, dst_handle, dst_size, align);
> +		batch_offset = get_offset(ahnd, batch_handle, 4096, align);

Is it possible to modify the allocator so that say '0' (or alternatively
-1ULL) denotes the "default" alignment? And the default alignment will the
safe_alignment which can be stored as part of the allocator itself?

This will avoid having to pass this safe_alignment in a large number of
IGT's. If some IGT's want to override the default alignment they can always
do so. Thoughts?

  parent reply	other threads:[~2022-02-22 21:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  8:41 [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use safe alignment in fast-copy raw Zbigniew Kempczyński
2022-02-21  9:28 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-02-21 10:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-02-22 21:33 ` Dixit, Ashutosh [this message]
2022-02-23 10:34   ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qzu7fi9.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox