summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-02-17 18:14:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-02-19 21:24:23 +0000
commitc12b1f87adc4c568b21cc6ed9076b94bea46b010 (patch)
tree49efdc0bd7e2d5e626c3fe989da6bd5a209c214c
parent092273f6b66c301f12efcb49f54d667c46ad6592 (diff)
i915/gem_exec_schedule: Switch back to gem_set_domain()
The write hazard lies extend also to the cache-dirty tracking; as we purposefully do not tell the kernel we are writing to the bo, it fails to note the CPU cache as dirty and so the gem_read() may not sufficiently flush the caches prior to reading back from the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
-rw-r--r--tests/i915/gem_exec_schedule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
index 59102b6b..a9383000 100644
--- a/tests/i915/gem_exec_schedule.c
+++ b/tests/i915/gem_exec_schedule.c
@@ -54,7 +54,8 @@ uint32_t __sync_read_u32(int fd, uint32_t handle, uint64_t offset)
{
uint32_t value;
- gem_sync(fd, handle); /* No write hazard lies! */
+ gem_set_domain(fd, handle, /* No write hazard lies! */
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
gem_read(fd, handle, offset, &value, sizeof(value));
return value;
@@ -63,7 +64,8 @@ uint32_t __sync_read_u32(int fd, uint32_t handle, uint64_t offset)
static inline
void __sync_read_u32_count(int fd, uint32_t handle, uint32_t *dst, uint64_t size)
{
- gem_sync(fd, handle); /* No write hazard lies! */
+ gem_set_domain(fd, handle, /* No write hazard lies! */
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
gem_read(fd, handle, 0, dst, size);
}