diff options
-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; |