Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Fix PIPE_CONTROL DW/QW write through global GTT on IVB+

The bit controlling whether PIPE_CONTROL DW/QW write targets
the global GTT or PPGTT moved moved from DW 2 bit 2 to
DW 1 bit 24 on IVB.

I verified on IVB that the fix is in fact effective. Without the fix
none of the scratch writes actually landed in the pipe control page.
With the fix the writes show up correctly.

v2: move PIPE_CONTROL_GLOBAL_GTT_IVB setup to where other flags are set

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Ville Syrjälä and committed by
Daniel Vetter
b9e1faa7 4f7dfb67

+3 -1
+1
drivers/gpu/drm/i915/i915_reg.h
··· 308 308 #define DISPLAY_PLANE_A (0<<20) 309 309 #define DISPLAY_PLANE_B (1<<20) 310 310 #define GFX_OP_PIPE_CONTROL(len) ((0x3<<29)|(0x3<<27)|(0x2<<24)|(len-2)) 311 + #define PIPE_CONTROL_GLOBAL_GTT_IVB (1<<24) /* gen7+ */ 311 312 #define PIPE_CONTROL_CS_STALL (1<<20) 312 313 #define PIPE_CONTROL_TLB_INVALIDATE (1<<18) 313 314 #define PIPE_CONTROL_QW_WRITE (1<<14)
+2 -1
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 318 318 * TLB invalidate requires a post-sync write. 319 319 */ 320 320 flags |= PIPE_CONTROL_QW_WRITE; 321 + flags |= PIPE_CONTROL_GLOBAL_GTT_IVB; 321 322 322 323 /* Workaround: we must issue a pipe_control with CS-stall bit 323 324 * set before a pipe_control command that has the state cache ··· 332 331 333 332 intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4)); 334 333 intel_ring_emit(ring, flags); 335 - intel_ring_emit(ring, scratch_addr | PIPE_CONTROL_GLOBAL_GTT); 334 + intel_ring_emit(ring, scratch_addr); 336 335 intel_ring_emit(ring, 0); 337 336 intel_ring_advance(ring); 338 337