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

Dominik Karol Piatkowski dominik.karol.piatkowski at intel.com
Wed Dec 14 07:29:44 UTC 2022


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));
 	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