diff mbox

[2/7] drm/i915: Don't enable cursors or sprites for fbdev

Message ID 1368006922-24957-3-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä May 8, 2013, 9:55 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Check if the CRTC framebuffer matches the fbdev helper's framebuffer,
and if it does, doen't enable cursors/sprites.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Daniel Vetter May 24, 2013, 9:20 a.m. UTC | #1
On Wed, May 08, 2013 at 12:55:17PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Check if the CRTC framebuffer matches the fbdev helper's framebuffer,
> and if it does, doen't enable cursors/sprites.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

This one here had conflicts. But it also feels redundant with patch 3,
since that one should make sure that we won't ever have a cursor/sprite
stuck around forever.

Of course it's a bit ugly since the cursor might flash shortly, but for
now I'll brush that off with our lack of atomic modesetting.

Or did I miss something subtly?
-Daniel
> ---
>  drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 94d6604..cfe2803 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3264,12 +3264,23 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc)
>  	}
>  }
>  
> +static bool fbdev_active_on_crtc(const struct drm_crtc *crtc)
> +{
> +	const struct drm_i915_private *dev_priv = crtc->dev->dev_private;
> +
> +	return dev_priv->fbdev && dev_priv->fbdev->helper.fb == crtc->fb;
> +}
> +
>  static void intel_enable_planes(struct drm_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->dev;
>  	enum pipe pipe = to_intel_crtc(crtc)->pipe;
>  	struct intel_plane *intel_plane;
>  
> +	/* don't enable sprite planes for fbdev */
> +	if (fbdev_active_on_crtc(crtc))
> +		return;
> +
>  	list_for_each_entry(intel_plane, &dev->mode_config.plane_list, base.head)
>  		if (intel_plane->pipe == pipe)
>  			intel_plane_restore(&intel_plane->base);
> @@ -6522,6 +6533,10 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
>  	u32 base, pos;
>  	bool visible;
>  
> +	/* don't enable cursors for fbdev */
> +	if (on && fbdev_active_on_crtc(crtc))
> +		return;
> +
>  	pos = 0;
>  
>  	if (on && crtc->enabled && crtc->fb) {
> -- 
> 1.8.1.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä May 24, 2013, 9:38 a.m. UTC | #2
On Fri, May 24, 2013 at 11:20:21AM +0200, Daniel Vetter wrote:
> On Wed, May 08, 2013 at 12:55:17PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Check if the CRTC framebuffer matches the fbdev helper's framebuffer,
> > and if it does, doen't enable cursors/sprites.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> This one here had conflicts. But it also feels redundant with patch 3,
> since that one should make sure that we won't ever have a cursor/sprite
> stuck around forever.
> 
> Of course it's a bit ugly since the cursor might flash shortly, but for
> now I'll brush that off with our lack of atomic modesetting.
> 
> Or did I miss something subtly?

My initial idea was to avoid the flashing.

However, now that I think about it a bit more, we do call set_config
from the fb_helper set_par/pan_display hooks, which could then end up
enabling sprites/cursors w/ fbdev. So either we need to keep this patch,
or maybe provide custom set_par/pan_display to turn off
sprites/cursors as well.



> -Daniel
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 94d6604..cfe2803 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -3264,12 +3264,23 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc)
> >  	}
> >  }
> >  
> > +static bool fbdev_active_on_crtc(const struct drm_crtc *crtc)
> > +{
> > +	const struct drm_i915_private *dev_priv = crtc->dev->dev_private;
> > +
> > +	return dev_priv->fbdev && dev_priv->fbdev->helper.fb == crtc->fb;
> > +}
> > +
> >  static void intel_enable_planes(struct drm_crtc *crtc)
> >  {
> >  	struct drm_device *dev = crtc->dev;
> >  	enum pipe pipe = to_intel_crtc(crtc)->pipe;
> >  	struct intel_plane *intel_plane;
> >  
> > +	/* don't enable sprite planes for fbdev */
> > +	if (fbdev_active_on_crtc(crtc))
> > +		return;
> > +
> >  	list_for_each_entry(intel_plane, &dev->mode_config.plane_list, base.head)
> >  		if (intel_plane->pipe == pipe)
> >  			intel_plane_restore(&intel_plane->base);
> > @@ -6522,6 +6533,10 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
> >  	u32 base, pos;
> >  	bool visible;
> >  
> > +	/* don't enable cursors for fbdev */
> > +	if (on && fbdev_active_on_crtc(crtc))
> > +		return;
> > +
> >  	pos = 0;
> >  
> >  	if (on && crtc->enabled && crtc->fb) {
> > -- 
> > 1.8.1.5
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 94d6604..cfe2803 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3264,12 +3264,23 @@  static void ironlake_pfit_enable(struct intel_crtc *crtc)
 	}
 }
 
+static bool fbdev_active_on_crtc(const struct drm_crtc *crtc)
+{
+	const struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+
+	return dev_priv->fbdev && dev_priv->fbdev->helper.fb == crtc->fb;
+}
+
 static void intel_enable_planes(struct drm_crtc *crtc)
 {
 	struct drm_device *dev = crtc->dev;
 	enum pipe pipe = to_intel_crtc(crtc)->pipe;
 	struct intel_plane *intel_plane;
 
+	/* don't enable sprite planes for fbdev */
+	if (fbdev_active_on_crtc(crtc))
+		return;
+
 	list_for_each_entry(intel_plane, &dev->mode_config.plane_list, base.head)
 		if (intel_plane->pipe == pipe)
 			intel_plane_restore(&intel_plane->base);
@@ -6522,6 +6533,10 @@  static void intel_crtc_update_cursor(struct drm_crtc *crtc,
 	u32 base, pos;
 	bool visible;
 
+	/* don't enable cursors for fbdev */
+	if (on && fbdev_active_on_crtc(crtc))
+		return;
+
 	pos = 0;
 
 	if (on && crtc->enabled && crtc->fb) {