[igt-dev] [i-g-t] lib/gem_submission: Remove __gem_execbuf call

Tejas Upadhyay tejaskumarx.surendrakumar.upadhyay at intel.com
Thu Apr 8 06:52:31 UTC 2021


After reloc support got dropped on GEN12/12+, lot of tests are
reporting failures which should be skipped using check
gem_has_relocations(). The problem is lot of those failures are
due to direct __gem_execbuf() call where we cant put gem_has_
relocations check to skip the test in case platform does not
support reason being it also calls __gem_execbuf which creates
never ending loop. Thus to avoid looping, call __gem_execbuf()
inside gem_has_relocations() is replaced with direct ioctl call.

Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay at intel.com>
---
 lib/i915/gem_submission.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
index 051f9d04..50a8ae11 100644
--- a/lib/i915/gem_submission.c
+++ b/lib/i915/gem_submission.c
@@ -422,8 +422,14 @@ bool gem_has_relocations(int i915)
 		.buffer_count = 1,
 	};
 	bool has_relocs;
+	int err = 0;
+
+	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)) {
+		err = -errno;
+		igt_assume(err != 0);
+	}
 
-	has_relocs = __gem_execbuf(i915, &execbuf) == -ENOENT;
+	has_relocs = err == -ENOENT;
 	gem_close(i915, obj.handle);
 
 	return has_relocs;
-- 
2.30.0



More information about the igt-dev mailing list