diff options
author | Mika Kuoppala <mika.kuoppala@intel.com> | 2017-05-23 17:38:37 +0300 |
---|---|---|
committer | Mika Kuoppala <mika.kuoppala@intel.com> | 2017-05-23 17:42:27 +0300 |
commit | 4384031229b47335b3eee89cf731a9a54d19e322 (patch) | |
tree | 4360ea12c88ed560d9003e4b8849e576e3c3353d | |
parent | 79a77b47f65c95d66109476422d09b7576ade0f6 (diff) |
tests/gem_exec_store: Verify all readsstore_dword
Verify all reads and report the offsets to observe
address patterns.
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
-rw-r--r-- | tests/gem_exec_store.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/gem_exec_store.c b/tests/gem_exec_store.c index f624c78a..d0bb5750 100644 --- a/tests/gem_exec_store.c +++ b/tests/gem_exec_store.c @@ -154,6 +154,7 @@ static void store_cachelines(int fd, unsigned ring, unsigned int flags) #define NCACHELINES (4096/64) uint32_t *batch; int i; + unsigned long writes = 0, reads_verified = 0; if (flags & HANG) hang_ring(fd, ring); @@ -204,6 +205,8 @@ static void store_cachelines(int fd, unsigned ring, unsigned int flags) } batch[++i] = n | ~n << 16; i++; + + writes++; } batch[i++] = MI_BATCH_BUFFER_END; igt_assert(i < 4096 / sizeof(*batch)); @@ -211,16 +214,29 @@ static void store_cachelines(int fd, unsigned ring, unsigned int flags) gem_execbuf(fd, &execbuf); for (unsigned n = 0; n < NCACHELINES; n++) { + const int oi = n % (execbuf.buffer_count - 1); uint32_t result; + bool read_ok; gem_read(fd, reloc[n].target_handle, reloc[n].delta, &result, sizeof(result)); - igt_assert_eq_u32(result, n | ~n << 16); + read_ok = result == (n | ~n << 16); + if (read_ok) + reads_verified++; + + igt_info("%d: 0x%x %s 0x%x, addr 0x%llx\n", + n, + result, + read_ok ? "==" : "!=", + (n | ~n << 16), + obj[oi].offset); } for (unsigned n = 0; n < execbuf.buffer_count; n++) gem_close(fd, obj[n].handle); + + igt_assert_eq(writes, reads_verified); igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } |