diff mbox

drm/i915: Take modeset locks around intel_modeset_setup_hw_state()

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

Commit Message

Ville Syrjälä Dec. 2, 2013, 9:08 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Some lower level things get angry if we don't have modeset locks
during intel_modeset_setup_hw_state(). Actually the resume and
lid_notify codepaths alreday hold the locks, but the init codepath
doesn't, so fix that.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
Totally untested, but looks correct to me.

 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul Bolle Dec. 2, 2013, 10 a.m. UTC | #1
On Mon, 2013-12-02 at 11:08 +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Some lower level things get angry if we don't have modeset locks
> during intel_modeset_setup_hw_state(). Actually the resume and
> lid_notify codepaths alreday hold the locks, but the init codepath
> doesn't, so fix that.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> Totally untested, but looks correct to me.

I assume I need to test this, on top of 7c063c725987 ("drm/i915: take
mode config lock around crtc disable at suspend"), to see if this makes
the WARNING that I currently see at boot go away?


Paul Bolle

>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 080f6fd..114db51 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11046,7 +11046,9 @@ void intel_modeset_gem_init(struct drm_device *dev)
>  
>  	intel_setup_overlay(dev);
>  
> +	drm_modeset_lock_all(dev);
>  	intel_modeset_setup_hw_state(dev, false);
> +	drm_modeset_unlock_all(dev);
>  }
>  
>  void intel_modeset_cleanup(struct drm_device *dev)
Ville Syrjälä Dec. 2, 2013, 12:12 p.m. UTC | #2
On Mon, Dec 02, 2013 at 11:00:29AM +0100, Paul Bolle wrote:
> On Mon, 2013-12-02 at 11:08 +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Some lower level things get angry if we don't have modeset locks
> > during intel_modeset_setup_hw_state(). Actually the resume and
> > lid_notify codepaths alreday hold the locks, but the init codepath
> > doesn't, so fix that.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > Totally untested, but looks correct to me.
> 
> I assume I need to test this, on top of 7c063c725987 ("drm/i915: take
> mode config lock around crtc disable at suspend"), to see if this makes
> the WARNING that I currently see at boot go away?

Yeah that would be nice.

> Paul Bolle
> 
> >  drivers/gpu/drm/i915/intel_display.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 080f6fd..114db51 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11046,7 +11046,9 @@ void intel_modeset_gem_init(struct drm_device *dev)
> >  
> >  	intel_setup_overlay(dev);
> >  
> > +	drm_modeset_lock_all(dev);
> >  	intel_modeset_setup_hw_state(dev, false);
> > +	drm_modeset_unlock_all(dev);
> >  }
> >  
> >  void intel_modeset_cleanup(struct drm_device *dev)
Paul Bolle Dec. 2, 2013, 6:01 p.m. UTC | #3
On Mon, 2013-12-02 at 14:12 +0200, Ville Syrjälä wrote:
> On Mon, Dec 02, 2013 at 11:00:29AM +0100, Paul Bolle wrote: 
> > I assume I need to test this, on top of 7c063c725987 ("drm/i915: take
> > mode config lock around crtc disable at suspend"), to see if this makes
> > the WARNING that I currently see at boot go away?
> 
> Yeah that would be nice.

A grand total of one boot suggests that this patch really makes the
v3.13+ WARNING go away at boot too. Should I test more thoroughly?


Paul Bolle
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 080f6fd..114db51 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11046,7 +11046,9 @@  void intel_modeset_gem_init(struct drm_device *dev)
 
 	intel_setup_overlay(dev);
 
+	drm_modeset_lock_all(dev);
 	intel_modeset_setup_hw_state(dev, false);
+	drm_modeset_unlock_all(dev);
 }
 
 void intel_modeset_cleanup(struct drm_device *dev)