summaryrefslogtreecommitdiff
path: root/tests/i915/i915_suspend.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-03-24 14:11:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-03-25 07:28:56 +0000
commit3d325bb211d8cd84c6862c9945185a937395cb44 (patch)
tree60f69ecdfc113b305acc474766d943f1b1f625c2 /tests/i915/i915_suspend.c
parente65d6656673b8ee68100032161579f0609475f1e (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/i915_suspend.c')
-rw-r--r--tests/i915/i915_suspend.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c
index 0d49fdcb..17c68cc1 100644
--- a/tests/i915/i915_suspend.c
+++ b/tests/i915/i915_suspend.c
@@ -58,17 +58,21 @@ test_fence_restore(int fd, bool tiled2untiled, bool hibernate)
/* Access the buffer objects in the order we want to have the laid out. */
ptr1 = gem_mmap__gtt(fd, handle1, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+ gem_set_domain(fd, handle1, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr1[i] = i;
ptr_tiled = gem_mmap__gtt(fd, handle_tiled, OBJECT_SIZE,
PROT_READ | PROT_WRITE);
+ gem_set_domain(fd, handle_tiled,
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
if (tiled2untiled)
gem_set_tiling(fd, handle_tiled, I915_TILING_X, 2048);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr_tiled[i] = i;
ptr2 = gem_mmap__gtt(fd, handle2, OBJECT_SIZE, PROT_READ | PROT_WRITE);
+ gem_set_domain(fd, handle2, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr2[i] = i;