summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-07-11 20:38:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-07-11 20:41:25 +0100
commitf796d9958b2b85696b572a4c686c758eb0323c2b (patch)
treeb46956f60e0fc58728d314625398bf3c85c3e8ec /tests
parentcfc692232898d435b8fbfc7a69fda382ffc83315 (diff)
igt/gem_tiled_swapping: Speed up slightly
The exercise is moving tiled objects in and out of swap. They are moved en-block and we test them all, therefore we can randomly test different bytes from each buffer to have reasonable coverage of all tiles. This shifts the bulk of the work from checking the tiled bo to kswapd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_tiled_swapping.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index 86c79f2d..add0c5ad 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -107,10 +107,8 @@ check_bo(int fd, uint32_t handle)
/* Check the target bo's contents. */
data = gem_mmap(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
- for (j = 0; j < WIDTH*HEIGHT; j++)
- igt_assert_f(data[j] == j,
- "mismatch at %i: %i\n",
- j, data[j]);
+ j = rand() % (WIDTH * HEIGHT);
+ igt_assert_f(data[j] == j, "mismatch at %i: %i\n", j, data[j]);
munmap(data, LINEAR_DWORDS);
}