Skip to contentSkip to conversation

drm/i915: Print the pipe control page GTT address

PATCH Applied [email protected] 3 participants 4 messages Feb 12, 2013 – Feb 13, 2013

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

PATCH 1/2 drm/i915: Print the pipe control page GTT address

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

We already print the HWS addresses during init, so do the same for the pipe control page. Reduces guesswork when looking at hex addresses later.

---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_ringbuffer.c +3 -0
index 00525ff..9b8b058 100644
@@ -467,6 +467,9 @@ init_pipe_control(struct intel_ring_buffer *ring)
 	if (pc->cpu_page == NULL)
 		goto err_unpin;
 
+	DRM_DEBUG_DRIVER("%s pipe control offset: 0x%08x\n",
+			 ring->name, pc->gtt_offset);
+
 	pc->obj = obj;
 	ring->private = pc;
 	return 0;
Signature · 6 lines
1.7.12.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 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.

TODO: need to test on IVB actually and make sure things don't explode.

---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
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 -2
index 9b8b058..f397bd7 100644
@@ -330,8 +330,8 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
 		return ret;
 
 	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, flags | PIPE_CONTROL_GLOBAL_GTT_IVB);
+	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
#2 lore raw

Re: [PATCH 2/2] drm/i915: Fix PIPE_CONTROL DW/QW write through global GTT on IVB+

Quoted 32 lines · On Tue, Feb 12, 2013 at 10:01:39PM +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.

TODO: need to test on IVB actually and make sure things don't explode.

---
 drivers/gpu/drm/i915/i915_reg.h         | 1 +
 drivers/gpu/drm/i915/intel_ringbuffer.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
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 +0 -0
index 9b8b058..f397bd7 100644

drivers/gpu/drm/i915/intel_ringbuffer.c gen7_render_ring_flush(struct intel_ring_buffer *ring, · line 337

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.c +2 -2
@@ -330,8 +330,8 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring,
 		return ret;
 
 	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, flags | PIPE_CONTROL_GLOBAL_GTT_IVB);
+	intel_ring_emit(ring, scratch_addr);
 	intel_ring_emit(ring, 0);
 	intel_ring_advance(ring);
 

In the fashion of my favorite maintainer... bikeshed!
Can you move the PIPE_CONTROL_GLOBAL_GTT_IVB up to where we set CS_STALL (or really anywhere else). That way we have a consistent way of setting flags, ie. dword2

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
In reply to [email protected]
Quoted 7 lines · On Tue, Feb 12, 2013 at 10:01:38PM +0200, [email protected] wrote:

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

We already print the HWS addresses during init, so do the same for the pipe control page. Reduces guesswork when looking at hex addresses later.

Queued for -next, thanks for the patch. I'll hold off on patch 2 until the report from the bomb squad is in ...
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch