summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-06-20 21:50:07 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-06-20 21:54:00 +0100
commita153f95393515c11a76f87145d91e2fa4f1ff568 (patch)
tree945f16171db94a9312678c32c11b04ccafc63af3 /tests
parent5020029c1907fd2d999d34cfcba3704d8bbcea13 (diff)
igt/prime_vgem: Insert a WCB flush between distinct mmappings
Since we use distinct WC addresses for the same page, we need to flush the WCB after the write in order to see it from the other mmaping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/prime_vgem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 6ccadcbd..86e25256 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -119,15 +119,18 @@ static void test_gtt(int vgem, int i915)
igt_assert_eq(ptr[1024*i], ~i);
munmap(ptr, scratch.size);
-
ptr = vgem_mmap(vgem, &scratch, PROT_WRITE);
gtt = gem_mmap__gtt(i915, handle, scratch.size, PROT_WRITE);
+#if defined(__x86_64__)
for (i = 0; i < 1024; i++) {
gtt[1024*i] = i;
+ __builtin_ia32_sfence();
igt_assert_eq(ptr[1024*i], i);
ptr[1024*i] = ~i;
+ __builtin_ia32_sfence();
igt_assert_eq(gtt[1024*i], ~i);
}
+#endif
munmap(gtt, scratch.size);
munmap(ptr, scratch.size);