diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-02 16:08:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-02 16:10:18 +0100 |
commit | 22e6157d383c5fe1115ed05aab3909c77feb8856 (patch) | |
tree | 80059c8ae94b79d910cf0a62fdd7c64f689d7994 /tests | |
parent | cf07aa2fc6a50b2fd2ff8bd2d0953818bee33690 (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_exec_flush.c | 11 |
1 files changed, 8 insertions, 3 deletions
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); |