From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 2/6] drm/i915: add gen-specific runtime suspend/resume functions Date: Thu, 20 Mar 2014 14:59:29 +0200 Message-ID: <1395320369.17233.5.camel@intelbox> References: <1394233957-3904-1-git-send-email-przanoni@gmail.com> <1394233957-3904-3-git-send-email-przanoni@gmail.com> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1116685174==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id A37AC6E05D for ; Thu, 20 Mar 2014 05:59:32 -0700 (PDT) In-Reply-To: <1394233957-3904-3-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org --===============1116685174== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-+gkpicLPRbG0o+R3f5mO" --=-+gkpicLPRbG0o+R3f5mO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2014-03-07 at 20:12 -0300, Paulo Zanoni wrote: > From: Paulo Zanoni >=20 > We're adding runtime suspend support to more platforms, so organize > the code in a way that all a new platform needs to do is to add its > own gen-specific functions. Also rename the i915_ functions to intel_ > to make it clear that it's the top level one, not something that just > runs on i915 platforms. >=20 > Signed-off-by: Paulo Zanoni Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/i915_drv.c | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_= drv.c > index 74f7a91..f75d776 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -832,7 +832,23 @@ static int i915_pm_poweroff(struct device *dev) > return i915_drm_freeze(drm_dev); > } > =20 > -static int i915_runtime_suspend(struct device *device) > +static void hsw_runtime_suspend(struct drm_i915_private *dev_priv) > +{ > + struct drm_device *dev =3D dev_priv->dev; > + > + if (HAS_PC8(dev)) > + hsw_enable_pc8(dev_priv); > +} > + > +static void hsw_runtime_resume(struct drm_i915_private *dev_priv) > +{ > + struct drm_device *dev =3D dev_priv->dev; > + > + if (HAS_PC8(dev)) > + hsw_disable_pc8(dev_priv); > +} > + > +static int intel_runtime_suspend(struct device *device) > { > struct pci_dev *pdev =3D to_pci_dev(device); > struct drm_device *dev =3D pci_get_drvdata(pdev); > @@ -843,8 +859,8 @@ static int i915_runtime_suspend(struct device *device= ) > =20 > DRM_DEBUG_KMS("Suspending device\n"); > =20 > - if (HAS_PC8(dev)) > - hsw_enable_pc8(dev_priv); > + if (IS_HASWELL(dev)) > + hsw_runtime_suspend(dev_priv); > =20 > i915_gem_release_all_mmaps(dev_priv); > =20 > @@ -864,7 +880,7 @@ static int i915_runtime_suspend(struct device *device= ) > return 0; > } > =20 > -static int i915_runtime_resume(struct device *device) > +static int intel_runtime_resume(struct device *device) > { > struct pci_dev *pdev =3D to_pci_dev(device); > struct drm_device *dev =3D pci_get_drvdata(pdev); > @@ -877,8 +893,8 @@ static int i915_runtime_resume(struct device *device) > intel_opregion_notify_adapter(dev, PCI_D0); > dev_priv->pm.suspended =3D false; > =20 > - if (HAS_PC8(dev)) > - hsw_disable_pc8(dev_priv); > + if (IS_HASWELL(dev)) > + hsw_runtime_resume(dev_priv); > =20 > DRM_DEBUG_KMS("Device resumed\n"); > return 0; > @@ -891,8 +907,8 @@ static const struct dev_pm_ops i915_pm_ops =3D { > .thaw =3D i915_pm_thaw, > .poweroff =3D i915_pm_poweroff, > .restore =3D i915_pm_resume, > - .runtime_suspend =3D i915_runtime_suspend, > - .runtime_resume =3D i915_runtime_resume, > + .runtime_suspend =3D intel_runtime_suspend, > + .runtime_resume =3D intel_runtime_resume, > }; > =20 > static const struct vm_operations_struct i915_gem_vm_ops =3D { --=-+gkpicLPRbG0o+R3f5mO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJTKuYxAAoJEORIIAnNuWDF1KYH/iTDN8ooJeIUU+NUXbIIITfb X5O/MWUcl9XFL/VS4/TZEpV7eLQ0Ujc6iwYXFVdmjFqxzRdVIFKfbnVX5iJplQ5D gnMbDDXomq90ELKDZ+XtyK88ElgYeJwI4r+mXHFFcXo48hFpZ1eTCfnznhgIgBxz pLP/oyjieX1rsoTHr9/yFLv6LasMX4OMnSTb43UH3gjFq6n/JVTcO3RKZ0ukRGQ4 8xgbtcM15wZQxSmwNftXMZyjK9cAo1jso02MF/4s5SejftEzdQwCCSX0hVYnHlsm fwTB3+zAu1BOfId/Y+/cHPxGc+oh982FSex9s17YvwogVFy8+yvJRvfjOkWtiUc= =+hR8 -----END PGP SIGNATURE----- --=-+gkpicLPRbG0o+R3f5mO-- --===============1116685174== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1116685174==--