summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-01-21 15:46:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-01-21 15:49:00 +0000
commit1689580e85210d8eef23937062911bba6a344997 (patch)
tree7f931b185b984f8c79dc590a10d2d9f69d4165ff /tests
parent610ec44183cd17104d45ed51cf190bed03e4a8b1 (diff)
igt/gem_ringfill: Restore secure dispatch for ctg/ilk
Cantiga, Ironlake had early ppgtt hw and so marked MI_STORE_DATA_IMM as a privileged command, even when ppgtt is not enabled. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_ringfill.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index 4d7f7cef..e47dbbb5 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -101,6 +101,9 @@ static int setup_execbuf(int fd,
execbuf->buffers_ptr = to_user_pointer(obj);
execbuf->flags = ring | (1 << 11) | (1 << 12);
+ if (gen > 3 && gen < 6)
+ execbuf->flags |= I915_EXEC_SECURE;
+
obj[0].handle = gem_create(fd, 4096);
gem_write(fd, obj[0].handle, 0, &bbe, sizeof(bbe));
execbuf->buffer_count = 1;
@@ -135,6 +138,8 @@ static int setup_execbuf(int fd,
*b++ = offset;
*b++ = offset >> 32;
} else if (gen >= 4) {
+ if (gen < 6)
+ b[-1] |= 1 << 22;
*b++ = 0;
*b++ = offset;
reloc[i].offset += sizeof(*batch);
@@ -244,18 +249,29 @@ igt_main
{ NULL }
}, *m;
const struct intel_execution_engine *e;
+ bool master = false;
int fd;
- igt_fixture
+ 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_require(drmSetMaster(fd) == 0);
+ master = true;
+ }
+ }
for (m = modes; m->suffix; m++) {
for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("%s%s%s",
m->basic && !e->exec_id ? "basic-" : "",
e->name,
- m->suffix)
+ m->suffix) {
+ igt_skip_on(m->flags & NEWFD && master);
run_test(fd, e->exec_id | e->flags, m->flags);
+ }
}
}