diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-28 16:21:17 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-28 16:22:43 +0000 |
commit | 89f81e039636c1fe8a4df846c769bbab7de609dc (patch) | |
tree | 71997c6fd04125c8d927c4ec3a1275b8ef62c213 /tests/gem_softpin.c | |
parent | 3ec8b1d28e8d5ac924bd8f2e28baa31445bc5279 (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>
Diffstat (limited to 'tests/gem_softpin.c')
-rw-r--r-- | tests/gem_softpin.c | 19 |
1 files changed, 9 insertions, 10 deletions
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++) |