summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-02 14:49:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-02 14:58:00 +0100
commit6862b33d50f771538f439691c1f9c10e7bc01630 (patch)
treefdb8091c8bdddfeeba85532a7b04acc7a09250c2 /tests
parent47825918733b3761f640ec9e1b8743da0932de9f (diff)
igt/gem_exec_flush: Move assertions out of interruptible loops
Since the value in the bo may be altered by the test, we only want to repeat phases of the test to avoid breaking the test itself. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_flush.c66
1 files changed, 35 insertions, 31 deletions
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index a579a788..d32c32dd 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -164,51 +164,55 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
gem_execbuf(fd, &execbuf);
- igt_interruptible(flags & INTERRUPTIBLE) {
- if (flags & SET_DOMAIN) {
+ if (flags & SET_DOMAIN) {
+ igt_interruptible(flags & INTERRUPTIBLE)
gem_set_domain(fd, obj[0].handle,
I915_GEM_DOMAIN_GTT,
(flags & WRITE) ? I915_GEM_DOMAIN_GTT : 0);
- if (xor)
- igt_assert_eq_u32(map[i], i ^ 0xffffffff);
- else
- igt_assert_eq_u32(map[i], i);
+ if (xor)
+ igt_assert_eq_u32(map[i], i ^ 0xffffffff);
+ else
+ igt_assert_eq_u32(map[i], i);
- if (flags & WRITE)
- map[i] = 0xdeadbeef;
- } else if (flags & KERNEL) {
- uint32_t val;
+ if (flags & WRITE)
+ map[i] = 0xdeadbeef;
+ } else if (flags & KERNEL) {
+ uint32_t val;
- gem_read(fd, obj[0].handle, i*sizeof(uint32_t),
+ igt_interruptible(flags & INTERRUPTIBLE)
+ gem_read(fd, obj[0].handle,
+ i*sizeof(uint32_t),
&val, sizeof(val));
- if (xor)
- igt_assert_eq_u32(val, i ^ 0xffffffff);
- else
- igt_assert_eq_u32(val, i);
+ if (xor)
+ igt_assert_eq_u32(val, i ^ 0xffffffff);
+ else
+ igt_assert_eq_u32(val, i);
- if (flags & WRITE) {
- val = 0xdeadbeef;
- gem_write(fd, obj[0].handle, i*sizeof(uint32_t),
+ if (flags & WRITE) {
+ val = 0xdeadbeef;
+ igt_interruptible(flags & INTERRUPTIBLE)
+ gem_write(fd, obj[0].handle,
+ i*sizeof(uint32_t),
&val, sizeof(val));
- }
- } else {
+ }
+ } else {
+ igt_interruptible(flags & INTERRUPTIBLE)
gem_sync(fd, obj[0].handle);
- if (!(flags & COHERENT) && !gem_has_llc(fd))
- igt_clflush_range(&map[i], sizeof(map[i]));
+ if (!(flags & COHERENT) && !gem_has_llc(fd))
+ igt_clflush_range(&map[i], sizeof(map[i]));
- if (xor)
- igt_assert_eq_u32(map[i], i ^ 0xffffffff);
- else
- igt_assert_eq_u32(map[i], i);
+ if (xor)
+ igt_assert_eq_u32(map[i], i ^ 0xffffffff);
+ else
+ igt_assert_eq_u32(map[i], i);
- if (flags & WRITE) {
- map[i] = 0xdeadbeef;
- if (!(flags & COHERENT))
- igt_clflush_range(&map[i], sizeof(map[i]));
- }
+ if (flags & WRITE) {
+ map[i] = 0xdeadbeef;
+ if (!(flags & COHERENT))
+ igt_clflush_range(&map[i], sizeof(map[i]));
}
}
}