diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-10 05:18:10 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-14 03:47:45 -0400 |
commit | 7d54a904285b6e780291b91a518267bec5591913 (patch) | |
tree | d1bd3c4afdefdca718fd2fa2e93dadf4b1671a62 /drivers | |
parent | 35a38556d900b9cb5dfa2529c93944b847f8a8a4 (diff) |
drm/i915: Apply post-sync write for pipe control invalidates
When invalidating the TLBs it is documentated as requiring a post-sync
write. Failure to do so seems to result in a GPU hang.
Exposure to this hang on IVB seems to be a result of removing the extra
stalls required for SNB pipecontrol workarounds:
commit 6c6cf5aa9c583478b19e23149feaa92d01fb8c2d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jul 20 18:02:28 2012 +0100
drm/i915: Only apply the SNB pipe control w/a to gen6
Note: Manually switch the pipe_control cmd to 4 dwords to avoid a
(silent) functional conflict with -next. This way will get a loud (but
conflict with next (since the scratch_addr has been deleted there).
Reported-and-tested-by: yex.tian@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53322
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: added note about merge conflict with -next.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 414af1e2973b..e2a73b38abe9 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -227,31 +227,36 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring, | |||
227 | * number of bits based on the write domains has little performance | 227 | * number of bits based on the write domains has little performance |
228 | * impact. | 228 | * impact. |
229 | */ | 229 | */ |
230 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; | 230 | if (flush_domains) { |
231 | flags |= PIPE_CONTROL_TLB_INVALIDATE; | 231 | flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; |
232 | flags |= PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE; | 232 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; |
233 | flags |= PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE; | 233 | /* |
234 | flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; | 234 | * Ensure that any following seqno writes only happen |
235 | flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE; | 235 | * when the render cache is indeed flushed. |
236 | flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE; | 236 | */ |
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; | 237 | flags |= PIPE_CONTROL_CS_STALL; |
238 | } | ||
239 | if (invalidate_domains) { | ||
240 | flags |= PIPE_CONTROL_TLB_INVALIDATE; | ||
241 | flags |= PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE; | ||
242 | flags |= PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE; | ||
243 | flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE; | ||
244 | flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE; | ||
245 | flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE; | ||
246 | /* | ||
247 | * TLB invalidate requires a post-sync write. | ||
248 | */ | ||
249 | flags |= PIPE_CONTROL_QW_WRITE; | ||
250 | } | ||
244 | 251 | ||
245 | ret = intel_ring_begin(ring, 6); | 252 | ret = intel_ring_begin(ring, 4); |
246 | if (ret) | 253 | if (ret) |
247 | return ret; | 254 | return ret; |
248 | 255 | ||
249 | intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(5)); | 256 | intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4)); |
250 | intel_ring_emit(ring, flags); | 257 | intel_ring_emit(ring, flags); |
251 | intel_ring_emit(ring, scratch_addr | PIPE_CONTROL_GLOBAL_GTT); | 258 | intel_ring_emit(ring, scratch_addr | PIPE_CONTROL_GLOBAL_GTT); |
252 | intel_ring_emit(ring, 0); /* lower dword */ | 259 | intel_ring_emit(ring, 0); |
253 | intel_ring_emit(ring, 0); /* uppwer dword */ | ||
254 | intel_ring_emit(ring, MI_NOOP); | ||
255 | intel_ring_advance(ring); | 260 | intel_ring_advance(ring); |
256 | 261 | ||
257 | return 0; | 262 | return 0; |