Skip to contentSkip to conversation

drm/i915: Fix MI_DISPLAY_FLIP plane select offset on Ivybridge.

PATCH In review Kenneth Graunke 3 participants 12 messages Jun 7, 2011 – Jun 8, 2011

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

PATCH 1/3 drm/i915: Fix MI_DISPLAY_FLIP plane select offset on Ivybridge.

According to BSpec volume 1c.4 section 3.2.9, Display (Plane) Select is now at bits 21:19 instead of 21:20.

---
 drivers/gpu/drm/i915/intel_display.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_display.c +10 -1
index 81a9059..60b2941 100644
@@ -6390,7 +6390,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 		break;
 
 	case 6:
-	case 7:
 		OUT_RING(MI_DISPLAY_FLIP |
 			 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
 		OUT_RING(fb->pitch | obj->tiling_mode);
@@ -6400,6 +6399,16 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 		pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
 		OUT_RING(pf | pipesrc);
 		break;
+
+	case 7:
+		OUT_RING(MI_DISPLAY_FLIP | (intel_crtc->plane << 19));
+		OUT_RING(fb->pitch | obj->tiling_mode);
+		OUT_RING(obj->gtt_offset);
+
+		pf = I915_READ(PF_CTL(pipe)) & PF_ENABLE;
+		pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
+		OUT_RING(pf | pipesrc);
+		break;
 	}
 	ADVANCE_LP_RING();
 
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 2/3 drm/i915: Remove HAS_BLT/HAS_BSD checks from ivybridge_irq_postinstall.

Ivybridge has BLT and BSD rings, so there's no need to check.

---
 drivers/gpu/drm/i915/i915_irq.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +2 -4
index b9fafe3..6a2b7f4 100644
@@ -1841,10 +1841,8 @@ int ivybridge_irq_postinstall(struct drm_device *dev)
 	u32 hotplug_mask;
 
 	DRM_INIT_WAITQUEUE(&dev_priv->ring[RCS].irq_queue);
-	if (HAS_BSD(dev))
-		DRM_INIT_WAITQUEUE(&dev_priv->ring[VCS].irq_queue);
-	if (HAS_BLT(dev))
-		DRM_INIT_WAITQUEUE(&dev_priv->ring[BCS].irq_queue);
+	DRM_INIT_WAITQUEUE(&dev_priv->ring[VCS].irq_queue);
+	DRM_INIT_WAITQUEUE(&dev_priv->ring[BCS].irq_queue);
 
 	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
 	dev_priv->irq_mask = ~display_mask;
Signature · 1 line
1.7.4.4
#3 lore raw

Re: [PATCH 2/3] drm/i915: Remove HAS_BLT/HAS_BSD checks from ivybridge_irq_postinstall.

In reply to Kenneth Graunke
Quoted 1 line · Kenneth Graunke

Ivybridge has BLT and BSD rings, so there's no need to check.

Right, I've been trying to move this code into the ring init... -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#4 lore raw

PATCH 3/3 drm/i915: Enable GPU reset on Ivybridge.

In reply to Kenneth Graunke

According to the hardware documentation, GDRST is exactly the same as on Sandybridge. So simply enable the existing code.

---
 drivers/gpu/drm/i915/i915_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 0defd42..b641a64 100644
@@ -577,6 +577,7 @@ int i915_reset(struct drm_device *dev, u8 flags)
 	if (get_seconds() - dev_priv->last_gpu_reset < 5) {
 		DRM_ERROR("GPU hanging too fast, declaring wedged!\n");
 	} else switch (INTEL_INFO(dev)->gen) {
+	case 7:
 	case 6:
 		ret = gen6_do_reset(dev, flags);
 		break;
Signature · 1 line
1.7.4.4
Reviewed-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] drm/i915: Enable GPU reset on Ivybridge.

Quoted 2 lines · Kenneth Graunke

According to the hardware documentation, GDRST is exactly the same as on Sandybridge. So simply enable the existing code.

Signature · 1 line
[email protected]

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

#6 lore raw
In reply to Kenneth Graunke
Quoted 4 lines · Kenneth Graunke

According to BSpec volume 1c.4 section 3.2.9, Display (Plane) Select is now at bits 21:19 instead of 21:20.

I will note that the docs have an obvious bug -- 21:8 are 'reserved' on IVB while 21:19 are 'Display (Plane) Select'. I trust you've actually tried this on hardware and noticed that it works better now?

drivers/gpu/drm/i915/intel_display.c static int intel_crtc_page_flip(struct drm_crtc *crtc, · line 6410

Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9 -0
+
+	case 7:
+		OUT_RING(MI_DISPLAY_FLIP | (intel_crtc->plane << 19));
+		OUT_RING(fb->pitch | obj->tiling_mode);
+		OUT_RING(obj->gtt_offset);
+
+		pf = I915_READ(PF_CTL(pipe)) & PF_ENABLE;
+		pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff;
+		OUT_RING(pf | pipesrc);

What's this last DWORD supposed to be for? The IVB spec says length should be '1' and there should be only 3 DWORDS in this command.

Signature · 1 line
[email protected]

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

#7 lore raw
Quoted 8 lines · Keith Packard
Quoted 4 lines · Kenneth Graunke

According to BSpec volume 1c.4 section 3.2.9, Display (Plane) Select is now at bits 21:19 instead of 21:20.

I will note that the docs have an obvious bug -- 21:8 are 'reserved' on IVB while 21:19 are 'Display (Plane) Select'.

In the latest version of the Render Engine Command Streamer chapter, 18:8 are 'reserved' on IVB. Perhaps you have an old copy?

Apparently MI_DISPLAY_FLIP also exists in the Blitter Engine on IVB. I suspect we actually need to use that, but I haven't tried to yet.

Quoted 2 lines

I trust you've actually
tried this on hardware and noticed that it works better now?

No, actually...page flips are still broken. I suspect this patch is necessary but insufficient. Feel free to hold off on merging it.

Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+
+	case 7:
+		OUT_RING(MI_DISPLAY_FLIP | (intel_crtc->plane<<  19));
+		OUT_RING(fb->pitch | obj->tiling_mode);
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static int intel_crtc_page_flip(struct drm_crtc *crtc, · line 6410

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5 -0
+		OUT_RING(obj->gtt_offset);
+
+		pf = I915_READ(PF_CTL(pipe))&  PF_ENABLE;
+		pipesrc = I915_READ(PIPESRC(pipe))&  0x0fff0fff;
+		OUT_RING(pf | pipesrc);

What's this last DWORD supposed to be for? The IVB spec says length should be '1' and there should be only 3 DWORDS in this command.

Good question. My reading of the docs say that it should be 3 DWORDs on SNB as well; this code was directly lifted from "case 6" above (save the first line).

--Kenneth

#8 lore raw
Quoted 2 lines · Kenneth Graunke

In the latest version of the Render Engine Command Streamer chapter, 18:8 are 'reserved' on IVB. Perhaps you have an old copy?

Yeah, I haven't sync'd for a week or so.

Quoted 5 lines

Apparently MI_DISPLAY_FLIP also exists in the Blitter Engine on IVB. I suspect we actually need to use that, but I haven't tried to yet.

No, actually...page flips are still broken. I suspect this patch is necessary but insufficient. Feel free to hold off on merging it.

Sounds like a bit more testing and fixing is required; I'll leave things alone until we know how to make it work.

Quoted 3 lines

Good question. My reading of the docs say that it should be 3 DWORDs on SNB as well; this code was directly lifted from "case 6" above (save the first line).

Might be interesting to see if page flipping works when we send the command correctly :-)

Signature · 1 line
[email protected]

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

#9 lore raw
In reply to Kenneth Graunke
Quoted 7 lines · Kenneth Graunke
Quoted 2 lines · Keith Packard

What's this last DWORD supposed to be for? The IVB spec says length should be '1' and there should be only 3 DWORDS in this command.

Good question. My reading of the docs say that it should be 3 DWORDs on SNB as well; this code was directly lifted from "case 6" above (save the first line).

In my ancient copy of the specs, MI_DISPLAY_FLIP is 4 dwords, with this last dword for programming the panel-fitter and pipesrc. And it also says that command is applicable to IVB, but as I said it is an ancient copy.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#10 lore raw
Quoted 9 lines · Chris Wilson
Quoted 7 lines · Kenneth Graunke
Quoted 2 lines · Keith Packard

What's this last DWORD supposed to be for? The IVB spec says length should be '1' and there should be only 3 DWORDS in this command.

Good question. My reading of the docs say that it should be 3 DWORDs on SNB as well; this code was directly lifted from "case 6" above (save the first line).

Quoted 5 lines

In my ancient copy of the specs, MI_DISPLAY_FLIP is 4 dwords, with this last dword for programming the panel-fitter and pipesrc. And it also says that command is applicable to IVB, but as I said it is an ancient copy.
-Chris

That's correct. SNB /does/ include a 4th DWord as you describe---newer specs got mangled and lost that info, somehow. Argh.

IVB does only use three DWords, so the last OUT_RING should be nixed. Removing that does change the behavior, but doesn't yet make it work.

Thanks!
--Kenneth

#11 lore raw
Quoted 2 lines · Kenneth Graunke

IVB does only use three DWords, so the last OUT_RING should be nixed. Removing that does change the behavior, but doesn't yet make it work.

Note you can't just drop it since we need to keep the quadword alignment, so shrink the command and add a trailing nop. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre