Skip to contentSkip to conversation

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

PATCH Applied [email protected] 3 participants 5 messages Feb 14, 2013 – Feb 20, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Ville Syrjälä <[email protected]>

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

---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index d7542cd..69a95c6 100644
@@ -308,6 +308,7 @@
 #define   DISPLAY_PLANE_A           (0<<20)
 #define   DISPLAY_PLANE_B           (1<<20)
 #define GFX_OP_PIPE_CONTROL(len)	((0x3<<29)|(0x3<<27)|(0x2<<24)|(len-2))
+#define   PIPE_CONTROL_GLOBAL_GTT_IVB			(1<<24) /* gen7+ */
 #define   PIPE_CONTROL_CS_STALL				(1<<20)
 #define   PIPE_CONTROL_TLB_INVALIDATE			(1<<18)
 #define   PIPE_CONTROL_QW_WRITE				(1<<14)
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -1
index 9b8b058..1d5d613 100644
@@ -318,6 +318,7 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
 		 * TLB invalidate requires a post-sync write.
 		 */
 		flags |= PIPE_CONTROL_QW_WRITE;
+		flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
 
 		/* Workaround: we must issue a pipe_control with CS-stall bit
 		 * set before a pipe_control command that has the state cache
@@ -331,7 +332,7 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
 
 	intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4));
 	intel_ring_emit(ring, flags);
-	intel_ring_emit(ring, scratch_addr | PIPE_CONTROL_GLOBAL_GTT);
+	intel_ring_emit(ring, scratch_addr);
 	intel_ring_emit(ring, 0);
 	intel_ring_advance(ring);
 
Signature · 6 lines
1.7.12.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · On Thu, Feb 14, 2013 at 09:53:51PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 7 lines

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

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 7 lines · Ben Widawsky
Quoted 6 lines · On Thu, Feb 14, 2013 at 09:53:51PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 8 lines
Quoted 7 lines

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

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
In reply to Ben Widawsky
Quoted 11 lines · Ben Widawsky
Quoted 10 lines · On Thu, Feb 14, 2013 at 09:53:51PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 5 lines
Quoted 3 lines

v2: move PIPE_CONTROL_GLOBAL_GTT_IVB setup to where other flags are set

Reading the bspec again... do we want to set bit 21?

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 12 lines · Ben Widawsky
Quoted 11 lines · Ben Widawsky
Quoted 10 lines · On Thu, Feb 14, 2013 at 09:53:51PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

v2: move PIPE_CONTROL_GLOBAL_GTT_IVB setup to where other flags are set

Reading the bspec again... do we want to set bit 21?

I don't think we want to do that. The scratch address we're using here is a proper GTT address, not an index into the HWS page.

I have no idea why we're not using the HSW page here as well. I couldn't dig out any reason from the commit logs either. Anyone?

Signature · 2 lines
Ville Syrjälä
Intel OTC