diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-25 09:09:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-25 09:14:29 +0100 |
commit | c7f6ecc258b3787bb428f0f7e3a0e3a34ac9f46f (patch) | |
tree | 8ea782ffe11067f8fefd9004d698107d3e262f19 | |
parent | bca3ab2275283a3fc28f6129700d1c7b32e57312 (diff) |
igt/gem_concurrent_blit: Limit number of reads for dmabufs
vgem provides WC mmap on its dmabufs, so reading and comparing these is
slow. We can employ a similar w/a to the other WC mmaps (i.e. mmap__gtt
or mmap__wc) and only check one pixel per page. This will speed up those
tests, but I don't know if it makes detecting coherency issues more or
less likely. :|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/gem_concurrent_all.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index 3cf5998f..76aecd2a 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -387,12 +387,12 @@ static void dmabuf_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { struct dmabuf *dmabuf = bo->virtual; - uint32_t *v; - int size; + uint32_t *v = dmabuf->map; + int y; prime_sync_start(dmabuf->fd, true); - for (v = dmabuf->map, size = b->npixels; size--; v++) - *v = val; + for (y = 0; y < b->height; y++) + v[pixel(y, b->width)] = val; prime_sync_end(dmabuf->fd, true); } @@ -400,12 +400,12 @@ static void dmabuf_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val) { struct dmabuf *dmabuf = bo->virtual; - uint32_t *v; - int size; + uint32_t *v = dmabuf->map; + int y; prime_sync_start(dmabuf->fd, false); - for (v = dmabuf->map, size = b->npixels; size--; v++) - igt_assert_eq_u32(*v, val); + for (y = 0; y < b->height; y++) + igt_assert_eq_u32(v[pixel(y, b->width)], val); prime_sync_end(dmabuf->fd, false); } |