drm/i915 invalidate indirect state pointers at end of ring exec

This is required by the spec, and without this some 3D programs will
hang after resume from RC6 we enable that.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>

authored by

Zou Nan hai and committed by
Eric Anholt
1cafd347 e78d73b1

+17
+7
drivers/gpu/drm/i915/i915_dma.c
··· 499 } 500 } 501 502 i915_emit_breadcrumb(dev); 503 504 return 0;
··· 499 } 500 } 501 502 + 503 + if (IS_G4X(dev) || IS_IRONLAKE(dev)) { 504 + BEGIN_LP_RING(2); 505 + OUT_RING(MI_FLUSH | MI_NO_WRITE_FLUSH | MI_INVALIDATE_ISP); 506 + OUT_RING(MI_NOOP); 507 + ADVANCE_LP_RING(); 508 + } 509 i915_emit_breadcrumb(dev); 510 511 return 0;
+1
drivers/gpu/drm/i915/i915_reg.h
··· 170 #define MI_NO_WRITE_FLUSH (1 << 2) 171 #define MI_SCENE_COUNT (1 << 3) /* just increment scene count */ 172 #define MI_END_SCENE (1 << 4) /* flush binner and incr scene count */ 173 #define MI_BATCH_BUFFER_END MI_INSTR(0x0a, 0) 174 #define MI_REPORT_HEAD MI_INSTR(0x07, 0) 175 #define MI_OVERLAY_FLIP MI_INSTR(0x11,0)
··· 170 #define MI_NO_WRITE_FLUSH (1 << 2) 171 #define MI_SCENE_COUNT (1 << 3) /* just increment scene count */ 172 #define MI_END_SCENE (1 << 4) /* flush binner and incr scene count */ 173 + #define MI_INVALIDATE_ISP (1 << 5) /* invalidate indirect state pointers */ 174 #define MI_BATCH_BUFFER_END MI_INSTR(0x0a, 0) 175 #define MI_REPORT_HEAD MI_INSTR(0x07, 0) 176 #define MI_OVERLAY_FLIP MI_INSTR(0x11,0)
+9
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 535 intel_ring_advance(dev, ring); 536 } 537 538 /* XXX breadcrumb */ 539 return 0; 540 } 541
··· 535 intel_ring_advance(dev, ring); 536 } 537 538 + if (IS_G4X(dev) || IS_IRONLAKE(dev)) { 539 + intel_ring_begin(dev, ring, 2); 540 + intel_ring_emit(dev, ring, MI_FLUSH | 541 + MI_NO_WRITE_FLUSH | 542 + MI_INVALIDATE_ISP ); 543 + intel_ring_emit(dev, ring, MI_NOOP); 544 + intel_ring_advance(dev, ring); 545 + } 546 /* XXX breadcrumb */ 547 + 548 return 0; 549 } 550