aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-21 11:08:41 -0400
committerJani Nikula <jani.nikula@intel.com>2015-10-13 09:54:19 -0400
commit40a24488f5250d63341e74b9994159afc4589606 (patch)
tree02c2dcd75d39a6585c77ceb40274794b6cd73096
parente797e4b71777877b19b50e3d736331c947ccffe7 (diff)
drm/i915: Flush pipecontrol post-sync writes
In order to flush the results from in-batch pipecontrol writes (used for example in glQuery) before declaring the batch complete (and so declaring the query results coherent), we need to set the FlushEnable bit in our flushing pipecontrol. The FlushEnable bit "waits until all previous writes of immediate data from post-sync circles are complete before executing the next command". I get GPU hangs on byt without flushing these writes (running ue4). piglit has examples where the flush is required for correct rendering. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c1
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 7412caedcf7f..29dd4488dc49 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1659,6 +1659,7 @@ static int gen8_emit_flush_render(struct drm_i915_gem_request *request,
1659 if (flush_domains) { 1659 if (flush_domains) {
1660 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 1660 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
1661 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 1661 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
1662 flags |= PIPE_CONTROL_FLUSH_ENABLE;
1662 } 1663 }
1663 1664
1664 if (invalidate_domains) { 1665 if (invalidate_domains) {
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 6e6b8db996ef..61b451fbd09e 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -347,6 +347,7 @@ gen7_render_ring_flush(struct drm_i915_gem_request *req,
347 if (flush_domains) { 347 if (flush_domains) {
348 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 348 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
349 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 349 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
350 flags |= PIPE_CONTROL_FLUSH_ENABLE;
350 } 351 }
351 if (invalidate_domains) { 352 if (invalidate_domains) {
352 flags |= PIPE_CONTROL_TLB_INVALIDATE; 353 flags |= PIPE_CONTROL_TLB_INVALIDATE;
@@ -418,6 +419,7 @@ gen8_render_ring_flush(struct drm_i915_gem_request *req,
418 if (flush_domains) { 419 if (flush_domains) {
419 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 420 flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
420 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 421 flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
422 flags |= PIPE_CONTROL_FLUSH_ENABLE;
421 } 423 }
422 if (invalidate_domains) { 424 if (invalidate_domains) {
423 flags |= PIPE_CONTROL_TLB_INVALIDATE; 425 flags |= PIPE_CONTROL_TLB_INVALIDATE;