[igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use safe alignment in fast-copy raw
Dixit, Ashutosh
ashutosh.dixit at intel.com
Tue Feb 22 21:33:50 UTC 2022
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?
More information about the igt-dev
mailing list