Re: [PATCH 07/16] drm/i915: fix S4 suspend while switcheroo state is off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-10-21 at 15:41 +0300, Ville Syrjälä wrote:
> On Wed, Sep 10, 2014 at 06:17:00PM +0300, Imre Deak wrote:
> > If the device is suspended already through the switcheroo interface we
> > shouldn't suspend it again. We have the corresponding check for S3
> > suspend already, add it for S4 freeze and poweroff too.
> > 
> > Note that there is still the problem that the resume path should also
> > check for the switcheroo-off state and keep the device disabled or in
> > case of S4 disable it. That is a separate issue, which is not addressed
> > in this patchset.
> 
> That's about RESUME/RESTORE I take it.
> 
> But what about .thaw()? I think simply adding the same check to .thaw()
> would work out just fine since it's always called after .freeze() for
> THAW/RECOVER.

Yes, the check is missing from there too (actually by the end of the
patchset THAW/RESUME/RESTORE are handled the same way). I didn't want to
fix up that part in this patchset, since I thought avoiding RESTORE in
case DRM_SWITCH_POWER_OFF is set is not enough during S4, we have to
actually disable the device if it was enabled. But thinking about it
again that seems to be not true, since before RESTORE FREEZE is called
in the loader kernel, which leaves the device in a disabled state.

So I can put the check to .thaw too (.suspend by the end of the
patchset), but it'd be easier to do it on top of this patchset if that's
ok.

--Imre

> 
> > 
> > Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index ca74d6d..a3addc2 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -994,6 +994,9 @@ static int i915_pm_freeze(struct device *dev)
> >  		return -ENODEV;
> >  	}
> >  
> > +	if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
> > +		return 0;
> > +
> >  	return i915_drm_freeze(drm_dev);
> >  }
> >  
> > @@ -1003,6 +1006,9 @@ static int i915_pm_freeze_late(struct device *dev)
> >  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> >  	struct drm_i915_private *dev_priv = drm_dev->dev_private;
> >  
> > +	if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
> > +		return 0;
> > +
> >  	return intel_suspend_complete(dev_priv);
> >  }
> >  
> > @@ -1027,6 +1033,9 @@ static int i915_pm_poweroff(struct device *dev)
> >  	struct pci_dev *pdev = to_pci_dev(dev);
> >  	struct drm_device *drm_dev = pci_get_drvdata(pdev);
> >  
> > +	if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
> > +		return 0;
> > +
> >  	return i915_drm_freeze(drm_dev);
> >  }
> >  
> > -- 
> > 1.8.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 


_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux