[igt-dev] [PATCH i-g-t 4/4] tests/i915/api_intel_allocator: Fixed start alignment

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Dec 19 07:52:17 UTC 2022


On Wed, Dec 14, 2022 at 08:29:44AM +0100, Dominik Karol Piatkowski wrote:
> On some platforms it may be required to use aligned start address.
> 
> Signed-off-by: Dominik Karol Piatkowski <dominik.karol.piatkowski at intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> ---
>  tests/i915/api_intel_allocator.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index cf401176..c9fe881c 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -50,6 +50,7 @@ static void alloc_simple(int fd)
>  	igt_assert(!freed);
>  
>  	intel_allocator_get_address_range(ahnd, &start, &end);
> +	start = ALIGN(start, gem_detect_safe_alignment(fd));

Is this patch is necessary? According to patches 1/4 and 2/4 I think
start in allocator is already aligned, so intel_allocator_get_address_range()
should set &start and &end accordingly.

--
Zbigniew

>  	offset0 = intel_allocator_alloc(ahnd, 1, end - start, 0);
>  	offset1 = __intel_allocator_alloc(ahnd, 2, 4096, 0, ALLOC_STRATEGY_NONE);
>  	igt_assert(offset1 == ALLOC_INVALID_ADDRESS);
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list