[igt-dev] [PATCH i-g-t] igt/gem_exec_fence: Skip parallel* tests if I915_PARAM_HAS_EXEC_SUBMIT_FENCE is not defined

Antonio Argenziano antonio.argenziano at intel.com
Wed Feb 14 21:34:24 UTC 2018


Have has_submit_fence return false if the paramter it is looking for is
not defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104284
Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>

Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/gem_exec_fence.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/gem_exec_fence.c b/tests/gem_exec_fence.c
index bd7b1263..60410e70 100644
--- a/tests/gem_exec_fence.c
+++ b/tests/gem_exec_fence.c
@@ -694,17 +694,21 @@ static void test_fence_flip(int i915)
 
 static bool has_submit_fence(int fd)
 {
+#ifndef I915_PARAM_HAS_EXEC_SUBMIT_FENCE
+	return false;
+#else
 	struct drm_i915_getparam gp;
 	int value = 0;
 
 	memset(&gp, 0, sizeof(gp));
-	gp.param = 50; /* I915_PARAM_HAS_EXEC_SUBMIT_FENCE */
+	gp.param = I915_PARAM_HAS_EXEC_SUBMIT_FENCE;
 	gp.value = &value;
 
 	ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp));
 	errno = 0;
 
 	return value;
+#endif
 }
 
 static bool has_syncobj(int fd)
@@ -720,7 +724,7 @@ static bool exec_has_fence_array(int fd)
 	int value = 0;
 
 	memset(&gp, 0, sizeof(gp));
-	gp.param = 49; /* I915_PARAM_HAS_EXEC_FENCE_ARRAY */
+	gp.param = I915_PARAM_HAS_EXEC_FENCE_ARRAY;
 	gp.value = &value;
 
 	ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp));
-- 
2.14.2



More information about the igt-dev mailing list