[Intel-gfx] [PATCH 07/16] drm/i915: fix S4 suspend while switcheroo state is off
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Oct 21 14:41:53 CEST 2014
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.
>
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
> 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
More information about the Intel-gfx
mailing list