diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-24 14:11:16 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-25 07:28:56 +0000 |
commit | 3d325bb211d8cd84c6862c9945185a937395cb44 (patch) | |
tree | 60f69ecdfc113b305acc474766d943f1b1f625c2 /tests/i915/gem_mmap_gtt.c | |
parent | e65d6656673b8ee68100032161579f0609475f1e (diff) |
i915: Mark up some forgotten set-domain
It is the user's responsibility to manage their domains. In libdrm, when
you mmap a pointer, it calls set-domain automatically, but igt requires
the caller to manage it explicitly, so do so. The vast majority already
do correct manage the domain as they use the pointer into the mmap, just
a few have been missed over the years.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_mmap_gtt.c')
-rw-r--r-- | tests/i915/gem_mmap_gtt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c index 9a00f4ea..639de190 100644 --- a/tests/i915/gem_mmap_gtt.c +++ b/tests/i915/gem_mmap_gtt.c @@ -179,6 +179,7 @@ test_read_write(int fd, enum test_read_write order) handle = gem_create(fd, OBJECT_SIZE); ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); if (order == READ_BEFORE_WRITE) { val = *(uint32_t *)ptr; @@ -202,9 +203,10 @@ test_read_write2(int fd, enum test_read_write order) handle = gem_create(fd, OBJECT_SIZE); r = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ); - w = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); + gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); + if (order == READ_BEFORE_WRITE) { val = *(uint32_t *)r; *(uint32_t *)w = val; |