Skip to contentSkip to conversation

IVB page flipping fixes (hopefully final)

PATCH In review Jesse Barnes 6 participants 12 messages Jun 16, 2011 – Jun 23, 2011

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

This set addresses comments from Dan and Chris, namely:
- pin & fence the new fb on the correct ring for IVB
- cleanup gen2/3 wait code by putting it in gen2/3 wait functions
- remove dead code
- fix a race in the split code with the interrupt handler and flip pending

Thanks,
Jesse

#1 lore raw

PATCH 1/2 drm/i915: split page flip queueing into per-chipset functions

This makes things a little clearer and prevents us from running old code on a new chipset that may not be supported.

---
 drivers/gpu/drm/i915/i915_drv.h      |    3 +
 drivers/gpu/drm/i915/intel_display.c |  269 +++++++++++++++++++++++-----------
 2 files changed, 189 insertions(+), 83 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -0
index f63ee16..eddabf6 100644
@@ -211,6 +211,9 @@ struct drm_i915_display_funcs {
 	void (*fdi_link_train)(struct drm_crtc *crtc);
 	void (*init_clock_gating)(struct drm_device *dev);
 	void (*init_pch_clock_gating)(struct drm_device *dev);
+	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
+			  struct drm_framebuffer *fb,
+			  struct drm_i915_gem_object *obj);
 	/* clock updates for mode set */
 	/* cursor updates */
 	/* render clock increase/decrease */
drivers/gpu/drm/i915/intel_display.c +186 -83

317 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 2/2 drm/i915: add Ivy Bridge page flip support

In reply to Jesse Barnes

Use the blit ring for submitting flips since the render ring doesn't generate flip complete interrupts.

---
 drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +30 -0
index 37e74e9..e842ed9 100644
@@ -6412,6 +6412,33 @@ out:
 	return ret;
 }
 
+static int intel_gen7_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
+	if (ret)
+		goto out;
+
+	ret = intel_ring_begin(ring, 4);
+	if (ret)
+		goto out;
+
+	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
+	intel_ring_emit(ring, (fb->pitch | obj->tiling_mode));
+	intel_ring_emit(ring, (obj->gtt_offset));
+	intel_ring_emit(ring, (MI_NOOP));
+	intel_ring_advance(ring);
+out:
+	return ret;
+}
+
 static int intel_default_queue_flip(struct drm_device *dev,
 				    struct drm_crtc *crtc,
 				    struct drm_framebuffer *fb,
@@ -7759,6 +7786,9 @@ static void intel_init_display(struct drm_device *dev)
 	case 6:
 		dev_priv->display.queue_flip = intel_gen6_queue_flip;
 		break;
+	case 7:
+		dev_priv->display.queue_flip = intel_gen7_queue_flip;
+		break;
 	}
 }
 
Signature · 1 line
1.7.4.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] drm/i915: add Ivy Bridge page flip support

Quoted 13 lines · Jesse Barnes

Use the blit ring for submitting flips since the render ring doesn't generate flip complete interrupts.

---
 drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 37e74e9..e842ed9 100644

drivers/gpu/drm/i915/intel_display.c out: · line 6421

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +7 -0
@@ -6412,6 +6412,33 @@ out:
 	return ret;
 }
 
+static int intel_gen7_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

Could you put the bit about why you chose the blitter ring here.

drivers/gpu/drm/i915/intel_display.c out: · line 6422

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
#5 lore raw

Re: [PATCH 2/2] drm/i915: add Ivy Bridge page flip support

Quoted 25 lines · On Thu, 16 Jun 2011 11:54:50 -0700 Ben Widawsky <[email protected]> wrote:
Quoted 13 lines · Jesse Barnes

Use the blit ring for submitting flips since the render ring doesn't generate flip complete interrupts.

---
 drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 37e74e9..e842ed9 100644

drivers/gpu/drm/i915/intel_display.c out: · line 6421

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +7 -0
@@ -6412,6 +6412,33 @@ out:
 	return ret;
 }
 
+static int intel_gen7_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

Could you put the bit about why you chose the blitter ring here.

Quoted 1 line

drivers/gpu/drm/i915/intel_display.c out: · line 6422

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];

Oh yeah, good call. Will update with comments.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#6 lore raw

Re: [PATCH 2/2] drm/i915: add Ivy Bridge page flip support

In reply to Ben Widawsky

Updated with comment.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 1 line

From 41bdb7457beb023faa0d465f483ab793ba8896e1 Mon Sep 17 00:00:00 2001

From: Jesse Barnes <[email protected]>
Date: Tue, 14 Jun 2011 11:08:03 -0700
Subject: [PATCH] drm/i915: add Ivy Bridge page flip support

Use the blit ring for submitting flips since the render ring doesn't generate flip complete interrupts.

---
 drivers/gpu/drm/i915/intel_display.c |   36 ++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +36 -0
index 37e74e9..9446f4e 100644
@@ -6412,6 +6412,39 @@ out:
 	return ret;
 }
 
+/*
+ * On gen7 we currently use the blit ring because (in early silicon at least)
+ * the render ring doesn't give us interrpts for page flip completion, which
+ * means clients will hang after the first flip is queued.  Fortunately the
+ * blit ring generates interrupts properly, so use it instead.
+ */
+static int intel_gen7_queue_flip(struct drm_device *dev,
+				 struct drm_crtc *crtc,
+				 struct drm_framebuffer *fb,
+				 struct drm_i915_gem_object *obj)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
+	int ret;
+
+	ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
+	if (ret)
+		goto out;
+
+	ret = intel_ring_begin(ring, 4);
+	if (ret)
+		goto out;
+
+	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
+	intel_ring_emit(ring, (fb->pitch | obj->tiling_mode));
+	intel_ring_emit(ring, (obj->gtt_offset));
+	intel_ring_emit(ring, (MI_NOOP));
+	intel_ring_advance(ring);
+out:
+	return ret;
+}
+
 static int intel_default_queue_flip(struct drm_device *dev,
 				    struct drm_crtc *crtc,
 				    struct drm_framebuffer *fb,
@@ -7759,6 +7792,9 @@ static void intel_init_display(struct drm_device *dev)
 	case 6:
 		dev_priv->display.queue_flip = intel_gen6_queue_flip;
 		break;
+	case 7:
+		dev_priv->display.queue_flip = intel_gen7_queue_flip;
+		break;
 	}
 }
 
Signature · 1 line
1.7.4.1
#7 lore raw

Re: [PATCH 2/2] drm/i915: add Ivy Bridge page flip support

Am Donnerstag, den 16.06.2011, 12:18 -0700 schrieb Jesse Barnes:

Quoted 23 lines

Updated with comment.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 1 line

From 41bdb7457beb023faa0d465f483ab793ba8896e1 Mon Sep 17 00:00:00 2001

From: Jesse Barnes <[email protected]>
Date: Tue, 14 Jun 2011 11:08:03 -0700
Subject: [PATCH] drm/i915: add Ivy Bridge page flip support

Use the blit ring for submitting flips since the render ring doesn't generate flip complete interrupts.

---
 drivers/gpu/drm/i915/intel_display.c |   36 ++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 37e74e9..9446f4e 100644

drivers/gpu/drm/i915/intel_display.c out: · line 6417

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -6412,6 +6412,39 @@ out:
 	return ret;
 }
 
+/*
+ * On gen7 we currently use the blit ring because (in early silicon at least)
+ * the render ring doesn't give us interrpts for page flip completion, which

inter*u*pts

drivers/gpu/drm/i915/intel_display.c out: · line 6420

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
+ * means clients will hang after the first flip is queued.  Fortunately the
+ * blit ring generates interrupts properly, so use it instead.
+ */

[…]

Thanks,

Paul

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

Reviewed-by
#9 lore raw
In reply to Jesse Barnes
Quoted 8 lines · Jesse Barnes

This set addresses comments from Dan and Chris, namely:
- pin& fence the new fb on the correct ring for IVB
- cleanup gen2/3 wait code by putting it in gen2/3 wait functions
- remove dead code
- fix a race in the split code with the interrupt handler and flip pending

Thanks,
Jesse

#10 lore raw
In reply to Jesse Barnes

Hi Jesse,
With your these two patches: http://lists.freedesktop.org/archives/intel-gfx/2011-June/011014.html It indeed fixed three bugs(#38362, #38392, #38393) on IvyBridge, but it also caused a regression(bug #38428) and another issue is with the patched kernel, the piglit cases' passrate dropped a lot, it changed from 2372(400)/3020 to 1682(397)/3020. The format is PASS(Not Supported)/Total. Though I find some crashed cases can't be reproduced when tested separately now. I will have an investigate on it. It is better if you could have some idea of the relation between the patch and piglit tests. Thanks.

Best regards
zhaojian

Quoted 21 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jesse Barnes
Sent: Friday, June 17, 2011 12:19 AM
To: [email protected]
Subject: [Intel-gfx] IVB page flipping fixes (hopefully final)

This set addresses comments from Dan and Chris, namely:
- pin & fence the new fb on the correct ring for IVB
- cleanup gen2/3 wait code by putting it in gen2/3 wait functions
- remove dead code
- fix a race in the split code with the interrupt handler and flip pending

Thanks,
Jesse

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

#11 lore raw

The issue(the patch may bring regression to piglit test) can't be reproduced now both with new code and old code, so maybe we can make the patch into our kernel tree.
The details:
I did some retest with newer commit in Mesa master and Xserver in 1.10 branch and run the piglit test without glean cases(because it will cost a long time, about 370 cases), the passrate were about 2101(288)/2643 with compiz enabled. (it's 2103(288)/2645 with compiz disabled). On ogles2 conformance side, there will be a lot of GPU hangs when enabled compiz.(compiz can't start without Jesse's patch) When disabled compiz, its passrate will return to 1194/1198 both with and without the patch in Kernel.

Commit info:

Libdrm:         (master)2.4.26
Mesa:           (master)8875dd58719b978283e89acf04422a4eaf9b021d
Xserver:                (server-1.10-branch)xorg-server-1.10.2.901-2-g9fab8b475de99848866c07bde962a5f6ed01b987
Xf86_video_intel:               (master)2.15.0-125-g8fb98e22a63a4354b049ace7870abb6406541c28
Cairo:          (master)441f9c5037dd32464bd87e21108b702c0a3c508a
Libva:          (master)20574567f32a6ad9f46665a4ced5725df42355f1
Kernel:         (drm-intel-fixes)6a574b5b9b186e28abd3e571dfd1700c5220b510 + Jesse's patch 
Quoted 48 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Zhao, Jian J
Sent: Monday, June 20, 2011 11:15 PM
To: Jesse Barnes
Cc: [email protected]
Subject: Re: [Intel-gfx] IVB page flipping fixes (hopefully final)

Hi Jesse,
With your these two patches:
http://lists.freedesktop.org/archives/intel-gfx/2011-June/011014.html It indeed fixed three bugs(#38362, #38392, #38393) on IvyBridge, but it also caused a regression(bug #38428) and another issue is with the patched kernel, the piglit cases' passrate dropped a lot, it changed from 2372(400)/3020 to 1682(397)/3020. The format is PASS(Not Supported)/Total. Though I find some crashed cases can't be reproduced when tested separately now. I will have an investigate on it. It is better if you could have some idea of the relation between the patch and piglit tests. Thanks.

Best regards
zhaojian

Quoted 14 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jesse Barnes
Sent: Friday, June 17, 2011 12:19 AM
To: [email protected]
Subject: [Intel-gfx] IVB page flipping fixes (hopefully final)

This set addresses comments from Dan and Chris, namely:
- pin & fence the new fb on the correct ring for IVB
- cleanup gen2/3 wait code by putting it in gen2/3 wait functions
- remove dead code
- fix a race in the split code with the interrupt handler and flip pending

Quoted 7 lines

Thanks,
Jesse

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

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