summaryrefslogtreecommitdiff
path: root/tests/gem_cs_prefetch.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-01-22 17:25:08 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-01-22 17:26:33 +0000
commitfbb0f636bd8ac898145b52961f5f7996f01ddc08 (patch)
treedf676ce712673f2ff09f608412f3557685ef4076 /tests/gem_cs_prefetch.c
parent4a3a8263427db6e1d2779a092ab6fc035e8aca3f (diff)
igt: Fix use MI_STORE_DATA_IMM on gen3
For the older gen, MI_STORE_DATA_IMM is a privileged command so we need to set the "secure" batch flag, and we also need to instruct the command to use the GTT virtual address. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_cs_prefetch.c')
-rw-r--r--tests/gem_cs_prefetch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index 72c9c13d..2cd565aa 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -45,10 +45,10 @@ struct shadow {
uint32_t handle;
struct drm_i915_gem_relocation_entry reloc;
};
+int gen;
static void setup(int fd, struct shadow *shadow)
{
- int gen = intel_gen(intel_get_drm_devid(fd));
uint32_t *cpu;
int i = 0;
@@ -66,6 +66,7 @@ static void setup(int fd, struct shadow *shadow)
cpu[i++] = BATCH_SIZE - sizeof(uint32_t);
} else {
cpu[i-1]--;
+ cpu[i-1] |= 1 << 22;
cpu[i++] = BATCH_SIZE - sizeof(uint32_t);
}
cpu[i++] = MI_BATCH_BUFFER_END;
@@ -98,6 +99,8 @@ static uint32_t new_batch(int fd, struct shadow *shadow)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)gem_exec;
execbuf.buffer_count = 2;
+ if (gen < 4)
+ execbuf.flags |= I915_EXEC_SECURE;
gem_execbuf(fd, &execbuf);
@@ -129,7 +132,8 @@ igt_simple_main
igt_skip_on_simulation();
- fd = drm_open_driver(DRIVER_INTEL);
+ fd = drm_open_driver_master(DRIVER_INTEL);
+ gen = intel_gen(intel_get_drm_devid(fd));
setup(fd, &shadow);
count = gem_aperture_size(fd) / BATCH_SIZE;