[Intel-gfx] [PATCH 04/16] drm/i915: unify legacy S3 suspend and S4 freeze handlers

Imre Deak imre.deak at intel.com
Thu Sep 11 14:39:41 CEST 2014


On Thu, 2014-09-11 at 11:00 +0200, Daniel Vetter wrote:
> On Wed, Sep 10, 2014 at 06:16:57PM +0300, Imre Deak wrote:
> > i915_suspend() is called from the DRM legacy S3 suspend/S4 freeze paths
> > and the switcheroo suspend path. For switcheroo we only ever need to
> > perform a full suspend (PM_EVENT_SUSPEND) and for the DRM legacy path
> > we can handle the S4 freeze (PM_EVENT_FREEZE) the same way as S3
> > suspend. The only difference atm between suspend and freeze is that
> > during freeze we don't disable the PCI device, but there is no reason
> > why we can't do so. So unify the two cases to reduce complexity.
> > 
> > Note that for the DRM legacy case the thaw event is not handled, so
> > we disable the display before creating the hibernation image and it
> > won't get re-enabled until reboot. We could fix this leaving the
> > display enabled for the image creation/writing (if we care enough
> > about UMS), but this can be done as a follow-up.
> 
> UMS doesn't even get compiled any more, please don't try to fix it ;-)

Ok. That reference above to UMS was only for a future possible fix, but
then we can ignore it. There are some UMS (aka legacy s/r) related
changes/fixes in this patchset too, but they are done alongside the
switcheroo fixes, since in the end the two things are handled the same
way.

--Imre

> My plan is to garbage-collect it all around when 3.17 is out the door.
> -Daniel
> 
> > 
> > Signed-off-by: Imre Deak <imre.deak at intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 7fa34bd..bf4ff5e 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -648,11 +648,9 @@ int i915_suspend(struct drm_device *dev, pm_message_t state)
> >  	if (error)
> >  		return error;
> >  
> > -	if (state.event == PM_EVENT_SUSPEND) {
> > -		/* Shut down the device */
> > -		pci_disable_device(dev->pdev);
> > -		pci_set_power_state(dev->pdev, PCI_D3hot);
> > -	}
> > +	/* Shut down the device */
> > +	pci_disable_device(dev->pdev);
> > +	pci_set_power_state(dev->pdev, PCI_D3hot);
> >  
> >  	return 0;
> >  }
> > -- 
> > 1.8.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20140911/473c68f0/attachment.sig>


More information about the Intel-gfx mailing list