[igt-dev] [i-g-t] lib/gem_execbuf_wr: Add gem_has_relocations check

Tejas Upadhyay tejaskumarx.surendrakumar.upadhyay at intel.com
Wed Apr 7 09:38:57 UTC 2021


Check if relocation and execbuf ioctls are supported on
respective platform or not. This will mark it skip instead
of misleading fail if relocations are not supported.

Gitlab#3276

Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay at intel.com>
---
 lib/ioctl_wrappers.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 4440004c..465da0bc 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -57,6 +57,7 @@
 #include "igt_sysfs.h"
 #include "config.h"
 #include "i915/gem_mman.h"
+#include "i915/gem_submission.h"
 
 #ifdef HAVE_VALGRIND
 #include <valgrind/valgrind.h>
@@ -636,6 +637,9 @@ void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
 {
 	int err = 0;
+
+	/* Check if relocations is supported with execbuffer2 */
+	igt_require(gem_has_relocations(fd));
 	if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2_WR, execbuf)) {
 		err = -errno;
 		igt_assume(err != 0);
-- 
2.30.0



More information about the igt-dev mailing list