summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-01-28 16:21:17 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-01-28 16:22:43 +0000
commit89f81e039636c1fe8a4df846c769bbab7de609dc (patch)
tree71997c6fd04125c8d927c4ec3a1275b8ef62c213
parent3ec8b1d28e8d5ac924bd8f2e28baa31445bc5279 (diff)
igt: More MI_STORE_DWORD fixes for gen5
A few other tests I have updated recently to use MI_STORE_DWORD also need the magic bit for gen4/5. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_cs_prefetch.c5
-rw-r--r--tests/gem_exec_reloc.c6
-rw-r--r--tests/gem_softpin.c19
3 files changed, 14 insertions, 16 deletions
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index 2cdf422a..6d690456 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -62,7 +62,7 @@ static void setup(int fd, int gen, struct shadow *shadow)
shadow->handle = gem_create(fd, 4096);
i = 0;
- buf[i++] = MI_STORE_DWORD_IMM;
+ buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
if (gen >= 8) {
buf[i++] = BATCH_SIZE - sizeof(uint32_t);
buf[i++] = 0;
@@ -71,7 +71,6 @@ static void setup(int fd, int gen, struct shadow *shadow)
buf[i++] = BATCH_SIZE - sizeof(uint32_t);
} else {
buf[i-1]--;
- buf[i-1] |= 1 << 22;
buf[i++] = BATCH_SIZE - sizeof(uint32_t);
}
buf[i++] = MI_BATCH_BUFFER_END;
@@ -125,7 +124,7 @@ static void test_ring(unsigned ring)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.flags = ring;
- if (gen < 4)
+ if (gen < 6)
execbuf.flags |= I915_EXEC_SECURE;
for (i = 0; i < count; i++) {
diff --git a/tests/gem_exec_reloc.c b/tests/gem_exec_reloc.c
index 140192d9..449f1abd 100644
--- a/tests/gem_exec_reloc.c
+++ b/tests/gem_exec_reloc.c
@@ -52,7 +52,7 @@ static void write_dword(int fd,
obj[1].handle = gem_create(fd, 4096);
i = 0;
- buf[i++] = MI_STORE_DWORD_IMM;
+ buf[i++] = MI_STORE_DWORD_IMM | (gen < 6 ? 1<<22 : 0);
if (gen >= 8) {
buf[i++] = target_offset;
buf[i++] = target_offset >> 32;
@@ -61,7 +61,6 @@ static void write_dword(int fd,
buf[i++] = target_offset;
} else {
buf[i-1]--;
- buf[i-1] |= 1 << 22;
buf[i++] = target_offset;
}
buf[i++] = value;
@@ -84,6 +83,7 @@ static void write_dword(int fd,
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.buffer_count = 2;
+ execbuf.flags = I915_EXEC_SECURE;
gem_execbuf(fd, &execbuf);
gem_close(fd, obj[1].handle);
}
@@ -211,7 +211,7 @@ igt_main
int fd = -1;
igt_fixture
- fd = drm_open_driver(DRIVER_INTEL);
+ fd = drm_open_driver_master(DRIVER_INTEL);
for (size = 4096; size <= 4ull*1024*1024*1024; size <<= 1) {
igt_subtest_f("mmap-%u", find_last_set(size) - 1)
diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c
index f9e88fd8..1b3d9d3d 100644
--- a/tests/gem_softpin.c
+++ b/tests/gem_softpin.c
@@ -402,7 +402,7 @@ static void test_noreloc(int fd)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)object;
execbuf.buffer_count = 1;
- if (gen < 4)
+ if (gen < 6)
execbuf.flags |= I915_EXEC_SECURE;
gem_execbuf(fd, &execbuf);
gem_close(fd, object[0].handle);
@@ -424,17 +424,16 @@ static void test_noreloc(int fd)
gem_set_domain(fd, object[i].handle,
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
for (i = 0; i < ARRAY_SIZE(object) - 1; i++) {
- *b++ = MI_STORE_DWORD_IMM;
- if (gen < 8) {
- if (gen < 4) {
- b[-1]--;
- b[-1] |= 1 << 22;
- } else
- *b++ = 0;
+ *b++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
+ if (gen >= 8) {
+ *b++ = object[i].offset;
+ *b++ = object[i].offset >> 32;
+ } else if (gen >= 4) {
+ *b++ = 0;
*b++ = object[i].offset;
} else {
+ b[-1]--;
*b++ = object[i].offset;
- *b++ = object[i].offset >> 32;
}
*b++ = i;
}
@@ -451,7 +450,7 @@ static void test_noreloc(int fd)
uint32_t val;
gem_read(fd, object[i].handle, 0, &val, sizeof(val));
- igt_assert_eq(val, (object[i].offset - offset)/ size);
+ igt_assert_eq(val, (object[i].offset - offset)/size);
}
}
for (i = 0; i < ARRAY_SIZE(object); i++)