[igt-dev] [i-g-t 1/2] tests/kms_cursor_legacy: Add Spin support for XE

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Jun 19 08:57:59 UTC 2023


To support the SPIN tests for XE, just need to fix the allocator
handle, since the same spin apis works for both i915 & XE.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_cursor_legacy.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index f7a6202cf..1f0f3b7e6 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -595,7 +595,10 @@ static void basic_flip_cursor(igt_display_t *display,
 	if (flags & BASIC_BUSY)
 	{
 		igt_require_intel(display->drm_fd);
-		ahnd = get_reloc_ahnd(display->drm_fd, 0);
+
+		ahnd = is_i915_device(display->drm_fd) ?
+			get_reloc_ahnd(display->drm_fd, 0) :
+			intel_allocator_open(display->drm_fd, 0, INTEL_ALLOCATOR_RELOC);
 	}
 
 	if (mode >= flip_test_atomic)
@@ -1505,7 +1508,9 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 	igt_output_t *output;
 	igt_plane_t *cursor;
 
-	ahnd = get_reloc_ahnd(display->drm_fd, 0);
+	ahnd = is_i915_device(display->drm_fd) ?
+		get_reloc_ahnd(display->drm_fd, 0) :
+		intel_allocator_open(display->drm_fd, 0, INTEL_ALLOCATOR_RELOC);
 
 	if (atomic)
 		igt_require(display->is_atomic);
-- 
2.40.0



More information about the igt-dev mailing list