summaryrefslogtreecommitdiff
path: root/tests/gem_exec_flush.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-04-13 08:36:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-04-13 10:10:57 +0100
commita6138b66e454d8b6f3e0b469e579f4692aeb3092 (patch)
tree01c7b467aae79902467a0f9694bf493038bdd55d /tests/gem_exec_flush.c
parent4186a2d0e3e200663c2aa999b725e2fa77b49bf8 (diff)
igt/gem_exec_flush: Use DOMAIN_WC for access via gem_mmap__wc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_flush.c')
-rw-r--r--tests/gem_exec_flush.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index 5982c712..7534532d 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -134,8 +134,8 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
igt_assert(flags & COHERENT);
map = gem_mmap__wc(fd, obj[0].handle, 0, 4096, PROT_WRITE);
gem_set_domain(fd, obj[0].handle,
- I915_GEM_DOMAIN_GTT,
- I915_GEM_DOMAIN_GTT);
+ I915_GEM_DOMAIN_WC,
+ I915_GEM_DOMAIN_WC);
} else {
snoop = flags & COHERENT;
gem_set_caching(fd, obj[0].handle, snoop);
@@ -149,8 +149,8 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
map[i] = 0xabcdabcd;
gem_set_domain(fd, obj[0].handle,
- I915_GEM_DOMAIN_GTT,
- I915_GEM_DOMAIN_GTT);
+ I915_GEM_DOMAIN_WC,
+ I915_GEM_DOMAIN_WC);
/* Prepara a mappable binding to prevent pread mighrating */
if (!snoop) {
@@ -177,7 +177,7 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
ptr = gem_mmap__wc(fd, obj[1].handle, 0, 64*1024,
PROT_WRITE | PROT_READ);
gem_set_domain(fd, obj[1].handle,
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
memset(reloc0, 0, sizeof(reloc0));
for (i = 0; i < 1024; i++) {
@@ -211,7 +211,7 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
ptr = gem_mmap__wc(fd, obj[2].handle, 0, 64*1024,
PROT_WRITE | PROT_READ);
gem_set_domain(fd, obj[2].handle,
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
memset(reloc1, 0, sizeof(reloc1));
for (i = 0; i < 1024; i++) {
@@ -263,7 +263,7 @@ overwrite:
gem_execbuf(fd, &execbuf);
if (flags & SET_DOMAIN) {
- unsigned domain = flags & WC ? I915_GEM_DOMAIN_GTT : I915_GEM_DOMAIN_CPU;
+ unsigned domain = flags & WC ? I915_GEM_DOMAIN_WC : I915_GEM_DOMAIN_CPU;
igt_while_interruptible(flags & INTERRUPTIBLE)
gem_set_domain(fd, obj[0].handle,
domain, (flags & WRITE) ? domain : 0);
@@ -450,6 +450,10 @@ static void batch(int fd, unsigned ring, int nchild, int timeout,
break;
case BATCH_WC:
+ gem_set_domain(fd, obj[1].handle,
+ I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
+ break;
+
case BATCH_GTT:
gem_set_domain(fd, obj[1].handle,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);