lib: Add read/write direction support for dmabuf synchronisation

Allow read-only synchronisation on dmabuf mmaps, useful to allow
concurrent read-read testing between the CPU and GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2016-02-25 21:43:01 +00:00
parent 925e5e1cae
commit aed69b56d4
5 changed files with 21 additions and 15 deletions
+4 -4
View File
@@ -365,10 +365,10 @@ dmabuf_set_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val)
uint32_t *v;
int size;
prime_sync_start(dmabuf->fd);
prime_sync_start(dmabuf->fd, true);
for (v = dmabuf->map, size = b->size; size--; v++)
*v = val;
prime_sync_end(dmabuf->fd);
prime_sync_end(dmabuf->fd, true);
}
static void
@@ -378,10 +378,10 @@ dmabuf_cmp_bo(struct buffers *b, drm_intel_bo *bo, uint32_t val)
uint32_t *v;
int size;
prime_sync_start(dmabuf->fd);
prime_sync_start(dmabuf->fd, false);
for (v = dmabuf->map, size = b->size; size--; v++)
igt_assert_eq_u32(*v, val);
prime_sync_end(dmabuf->fd);
prime_sync_end(dmabuf->fd, false);
}
static void