From a153f95393515c11a76f87145d91e2fa4f1ff568 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 20 Jun 2016 21:50:07 +0100 Subject: 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 --- tests/prime_vgem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/prime_vgem.c') 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); -- cgit v1.2.3