aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-28 03:48:42 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-28 15:06:25 -0400
commit97f209bcfc0c5db08d9badf8cbafd489f22a6e44 (patch)
tree941bafd5b138df165195359973ad24b878469ef2 /drivers/gpu/drm/i915/intel_ringbuffer.c
parenta8b0bbabf756bfb45a712b823ba41f5c95f85589 (diff)
drm/i915: "Flush Me Harder" required on gen6+
The prep to remove the flushing list in commit cc889e0f6ce6a63c62db17d702ecfed86d58083f Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Wed Jun 13 20:45:19 2012 +0200 drm/i915: disable flushing_list/gpu_write_list causes quite some decent regressions. We can fix this by setting the CS_STALL bit to ensure that the following seqno write happens only after the cache flush has completed. But only do that when the caller actually wants the flush (and not also when we invalidate caches before starting the next batch). I've looked through all our ancient scrolls about gen6+ pipe control workarounds, and this seems to be indeed a legal combination: We're allowed to set the CS_STALL bit when we flush the render cache (which we do). While yelling at this code, also pass back the return value from intel_emit_post_sync_nonzero_flush properly. v2: Instead of emitting more pipe controls, set the CS_STALL bit on the write flush as suggested by Chris Wilson. It seems to work, too. Cc: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51436 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51429 Tested-by: Lu Hua <huax.lu@intel.com> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index f30a53a8917e..dce4d1a492a8 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -219,7 +219,9 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring,
219 int ret; 219 int ret;
220 220
221 /* Force SNB workarounds for PIPE_CONTROL flushes */ 221 /* Force SNB workarounds for PIPE_CONTROL flushes */
222 intel_emit_post_sync_nonzero_flush(ring); 222 ret = intel_emit_post_sync_nonzero_flush(ring);
223 if (ret)
224 return ret;
223 225
224 /* Just flush everything. Experiments have shown that reducing the 226 /* Just flush everything. Experiments have shown that reducing the
225 * number of bits based on the write domains has little performance 227 * number of bits based on the write domains has little performance
@@ -233,6 +235,12 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring,
233 flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE; 235 flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE;
234 flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE; 236 flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE;
235 flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE; 237 flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE;
238 /*
239 * Ensure that any following seqno writes only happen when the render
240 * cache is indeed flushed (but only if the caller actually wants that).
241 */
242 if (flush_domains)
243 flags |= PIPE_CONTROL_CS_STALL;
236 244
237 ret = intel_ring_begin(ring, 6); 245 ret = intel_ring_begin(ring, 6);
238 if (ret) 246 if (ret)