summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-02-10 21:43:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-02-12 21:13:09 +0000
commitf8d6fa4fa04103b027430f960f2c55d24c4a9600 (patch)
tree435fe9ae9d4a6603c0ef6ed8f4cf0558bcca7a5f /tests
parent80abd583985507cab3824100a6999dee8ec11cfc (diff)
igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
On ctg/ilk, for whatever reason, MI_STORE_DWORD is a privileged operation so we must request a SECURE batch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_capture.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/gem_exec_capture.c b/tests/gem_exec_capture.c
index a73ece5d..aa80d59d 100644
--- a/tests/gem_exec_capture.c
+++ b/tests/gem_exec_capture.c
@@ -22,6 +22,7 @@
*/
#include "igt.h"
+#include "igt_device.h"
#include "igt_sysfs.h"
#define LOCAL_OBJECT_CAPTURE (1 << 7)
@@ -141,6 +142,8 @@ static void capture(int fd, int dir, unsigned ring)
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.buffer_count = ARRAY_SIZE(obj);
execbuf.flags = ring;
+ if (gen > 3 && gen < 6)
+ execbuf.flags |= I915_EXEC_SECURE;
gem_execbuf(fd, &execbuf);
/* Wait for the request to start */
@@ -182,7 +185,14 @@ igt_main
igt_skip_on_simulation();
igt_fixture {
+ int gen;
+
fd = drm_open_driver(DRIVER_INTEL);
+
+ gen = intel_gen(intel_get_drm_devid(fd));
+ if (gen > 3 && gen < 6) /* ctg and ilk need secure batches */
+ igt_device_set_master(fd);
+
igt_require_gem(fd);
gem_require_mmap_wc(fd);
igt_require(has_capture(fd));