From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 07/16] drm/i915: fix S4 suspend while switcheroo state is off Date: Tue, 21 Oct 2014 15:41:53 +0300 Message-ID: <20141021124153.GE4284@intel.com> References: <1410362229-814-1-git-send-email-imre.deak@intel.com> <1410362229-814-8-git-send-email-imre.deak@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 04ED18987C for ; Tue, 21 Oct 2014 05:41:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1410362229-814-8-git-send-email-imre.deak@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Imre Deak Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 > --- > 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 =3D=3D 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 =3D pci_get_drvdata(pdev); > struct drm_i915_private *dev_priv =3D drm_dev->dev_private; > = > + if (drm_dev->switch_power_state =3D=3D 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 =3D to_pci_dev(dev); > struct drm_device *drm_dev =3D pci_get_drvdata(pdev); > = > + if (drm_dev->switch_power_state =3D=3D DRM_SWITCH_POWER_OFF) > + return 0; > + > return i915_drm_freeze(drm_dev); > } > = > -- = > 1.8.4 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC