diff mbox

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

Message ID 1308241154-6830-3-git-send-email-jbarnes@virtuousgeek.org
State New, archived
Headers show

Commit Message

Jesse Barnes June 16, 2011, 4:19 p.m. UTC
Use the blit ring for submitting flips since the render ring doesn't
generate flip complete interrupts.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

Comments

Ben Widawsky June 16, 2011, 6:54 p.m. UTC | #1
On Thu, Jun 16, 2011 at 09:19:14AM -0700, Jesse Barnes wrote:
> Use the blit ring for submitting flips since the render ring doesn't
> generate flip complete interrupts.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 37e74e9..e842ed9 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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.
> +	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];


Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Jesse Barnes June 16, 2011, 7:17 p.m. UTC | #2
On Thu, 16 Jun 2011 11:54:50 -0700
Ben Widawsky <ben@bwidawsk.net> wrote:

> On Thu, Jun 16, 2011 at 09:19:14AM -0700, Jesse Barnes wrote:
> > Use the blit ring for submitting flips since the render ring doesn't
> > generate flip complete interrupts.
> > 
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c |   30 ++++++++++++++++++++++++++++++
> >  1 files changed, 30 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 37e74e9..e842ed9 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -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.
> > +	struct intel_ring_buffer *ring = &dev_priv->ring[BCS];

Oh yeah, good call.  Will update with comments.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 37e74e9..e842ed9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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;
 	}
 }