All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] tests: Use igt_device_set_master
@ 2017-12-08 18:11 Chris Wilson
  2017-12-08 20:14 ` ✗ Fi.CI.BAT: warning for " Patchwork
  2017-12-11  9:36 ` [PATCH igt] " Joonas Lahtinen
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2017-12-08 18:11 UTC (permalink / raw)
  To: intel-gfx

A few tests only require DRM_MASTER privileges for a subset of gen or
tests, and so open the device as normal and conditionally call
drmSetMaster. Translate these over to using igt_device_set_master(),
which includes a bit more debugging for when it fails.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_nop.c    | 3 ++-
 tests/gem_exec_params.c | 6 ++++--
 tests/gem_exec_store.c  | 3 ++-
 tests/gem_ringfill.c    | 3 ++-
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index b5f158078..668dcb949 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -26,6 +26,7 @@
  */
 
 #include "igt.h"
+#include "igt_device.h"
 #include "igt_rand.h"
 #include "igt_sysfs.h"
 
@@ -710,7 +711,7 @@ igt_main
 
 	igt_subtest("headless") {
 		/* Requires master for changing display modes */
-		igt_require(drmSetMaster(device) == 0);
+		igt_device_set_master(device);
 		headless(device, handle);
 	}
 
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
index 5b72072b2..e1c48b408 100644
--- a/tests/gem_exec_params.c
+++ b/tests/gem_exec_params.c
@@ -26,6 +26,8 @@
  */
 
 #include "igt.h"
+#include "igt_device.h"
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -341,10 +343,10 @@ igt_main
 	}
 
 	igt_subtest("secure-non-master") {
-		do_or_die(drmDropMaster(fd));
+		igt_device_drop_master(fd);
 		execbuf.flags = I915_EXEC_RENDER | I915_EXEC_SECURE;
 		RUN_FAIL(EPERM);
-		do_or_die(drmSetMaster(fd));
+		igt_device_set_master(fd);
 		igt_assert(drmIoctl(fd,
 				    DRM_IOCTL_I915_GEM_EXECBUFFER2,
 				    &execbuf) == 0);
diff --git a/tests/gem_exec_store.c b/tests/gem_exec_store.c
index 545a4b561..31a2c0967 100644
--- a/tests/gem_exec_store.c
+++ b/tests/gem_exec_store.c
@@ -28,6 +28,7 @@
  */
 
 #include "igt.h"
+#include "igt_device.h"
 #include "igt_gt.h"
 #include <strings.h>
 
@@ -320,7 +321,7 @@ igt_main
 
 		gen = print_welcome(fd);
 		if (gen > 3 && gen < 6) /* ctg and ilk need secure batches */
-			igt_require(drmSetMaster(fd) == 0);
+			igt_device_set_master(fd);
 
 		igt_require_gem(fd);
 		igt_require(gem_can_store_dword(fd, 0));
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index 84cd49c19..c3376a675 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -32,6 +32,7 @@
  */
 
 #include "igt.h"
+#include "igt_device.h"
 #include "igt_gt.h"
 #include "igt_vgem.h"
 
@@ -360,7 +361,7 @@ igt_main
 		igt_require(gem_can_store_dword(fd, 0));
 		gen = intel_gen(intel_get_drm_devid(fd));
 		if (gen > 3 && gen < 6) { /* ctg and ilk need secure batches */
-			igt_require(drmSetMaster(fd) == 0);
+			igt_device_set_master(fd);
 			master = true;
 		}
 
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-11  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 18:11 [PATCH igt] tests: Use igt_device_set_master Chris Wilson
2017-12-08 20:14 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-12-11  9:36 ` [PATCH igt] " Joonas Lahtinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.