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>
/* 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);
}