From 22e6157d383c5fe1115ed05aab3909c77feb8856 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 2 May 2016 16:08:46 +0100 Subject: igt/gem_exec_flush: Immediately repeat the same cacheline When looking at a pair of GPU writes, where we want to make sure that the clean cacheline is invalidated automatically, we want to reuse that cacheline whilst we know it remains valid (i.e. repeat the test using a new value to the same location). Signed-off-by: Chris Wilson --- tests/gem_exec_flush.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c index d32c32dd..326cafa7 100644 --- a/tests/gem_exec_flush.c +++ b/tests/gem_exec_flush.c @@ -151,17 +151,17 @@ static void run(int fd, unsigned ring, int nchild, int timeout, munmap(ptr, 64*1024); igt_timeout(timeout) { - bool xor = (cycles >> 10) & 1; + bool xor = false; int idx = cycles++ % 1024; /* Inspect a different cacheline each iteration */ i = 16 * (idx % 64) + (idx / 64); - obj[1].relocs_ptr = (uintptr_t)&reloc0[i]; obj[2].relocs_ptr = (uintptr_t)&reloc1[i]; execbuf.batch_start_offset = 64*i; - execbuf.buffer_count = 2 + xor; +overwrite: + execbuf.buffer_count = 2 + xor; gem_execbuf(fd, &execbuf); if (flags & SET_DOMAIN) { @@ -215,6 +215,11 @@ static void run(int fd, unsigned ring, int nchild, int timeout, igt_clflush_range(&map[i], sizeof(map[i])); } } + + if (!xor) { + xor= true; + goto overwrite; + } } igt_info("Child[%d]: %lu cycles\n", child, cycles); -- cgit v1.2.3