summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gem_exec_store.c18
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);
}