aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-06-16 10:05:18 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2017-06-16 11:54:05 -0400
commit071750e550af46b5d3a84ad56c2a108c3e136284 (patch)
treeec159c420fa0dfbd916edbb8d49c951d7052521b
parent507d977ff965682a925ffe479c95136680fcb77b (diff)
drm/i915: Disable EXEC_OBJECT_ASYNC when doing relocations
If we write a relocation into the buffer, we require our own implicit synchronisation added after the start of the execbuf, outside of the user's control. As we may end up clflushing, or doing the patch itself on the GPU, asynchronously we need to look at the implicit serialisation on obj->resv and hence need to disable EXEC_OBJECT_ASYNC for this object. If the user does trigger a stall for relocations, we make sure the stall is complete enough so that the batch is not submitted before we complete those relocations. Fixes: 77ae9957897d ("drm/i915: Enable userspace to opt-out of implicit fencing") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index d7154688eba9..9c3f6c40270f 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -699,6 +699,16 @@ eb_relocate_entry(struct i915_vma *vma,
699 return -EINVAL; 699 return -EINVAL;
700 } 700 }
701 701
702 /*
703 * If we write into the object, we need to force the synchronisation
704 * barrier, either with an asynchronous clflush or if we executed the
705 * patching using the GPU (though that should be serialised by the
706 * timeline). To be completely sure, and since we are required to
707 * do relocations we are already stalling, disable the user's opt
708 * of our synchronisation.
709 */
710 vma->exec_entry->flags &= ~EXEC_OBJECT_ASYNC;
711
702 ret = relocate_entry(vma->obj, reloc, &eb->reloc_cache, target_offset); 712 ret = relocate_entry(vma->obj, reloc, &eb->reloc_cache, target_offset);
703 if (ret) 713 if (ret)
704 return ret; 714 return ret;