All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 2/6] drm/i915: add gen-specific runtime suspend/resume functions
Date: Thu, 20 Mar 2014 14:59:29 +0200	[thread overview]
Message-ID: <1395320369.17233.5.camel@intelbox> (raw)
In-Reply-To: <1394233957-3904-3-git-send-email-przanoni@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3005 bytes --]

On Fri, 2014-03-07 at 20:12 -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> 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.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 32 ++++++++++++++++++++++++--------
>  1 file changed, 24 insertions(+), 8 deletions(-)
> 
> 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);
>  }
>  
> -static int i915_runtime_suspend(struct device *device)
> +static void hsw_runtime_suspend(struct drm_i915_private *dev_priv)
> +{
> +	struct drm_device *dev = 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 = dev_priv->dev;
> +
> +	if (HAS_PC8(dev))
> +		hsw_disable_pc8(dev_priv);
> +}
> +
> +static int intel_runtime_suspend(struct device *device)
>  {
>  	struct pci_dev *pdev = to_pci_dev(device);
>  	struct drm_device *dev = pci_get_drvdata(pdev);
> @@ -843,8 +859,8 @@ static int i915_runtime_suspend(struct device *device)
>  
>  	DRM_DEBUG_KMS("Suspending device\n");
>  
> -	if (HAS_PC8(dev))
> -		hsw_enable_pc8(dev_priv);
> +	if (IS_HASWELL(dev))
> +		hsw_runtime_suspend(dev_priv);
>  
>  	i915_gem_release_all_mmaps(dev_priv);
>  
> @@ -864,7 +880,7 @@ static int i915_runtime_suspend(struct device *device)
>  	return 0;
>  }
>  
> -static int i915_runtime_resume(struct device *device)
> +static int intel_runtime_resume(struct device *device)
>  {
>  	struct pci_dev *pdev = to_pci_dev(device);
>  	struct drm_device *dev = 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 = false;
>  
> -	if (HAS_PC8(dev))
> -		hsw_disable_pc8(dev_priv);
> +	if (IS_HASWELL(dev))
> +		hsw_runtime_resume(dev_priv);
>  
>  	DRM_DEBUG_KMS("Device resumed\n");
>  	return 0;
> @@ -891,8 +907,8 @@ static const struct dev_pm_ops i915_pm_ops = {
>  	.thaw = i915_pm_thaw,
>  	.poweroff = i915_pm_poweroff,
>  	.restore = i915_pm_resume,
> -	.runtime_suspend = i915_runtime_suspend,
> -	.runtime_resume = i915_runtime_resume,
> +	.runtime_suspend = intel_runtime_suspend,
> +	.runtime_resume = intel_runtime_resume,
>  };
>  
>  static const struct vm_operations_struct i915_gem_vm_ops = {


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2014-03-20 12:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 23:12 [PATCH 0/6] SNB/BDW runtime PM Paulo Zanoni
2014-03-07 23:12 ` [PATCH 1/6] drm/i915: kill dev_priv->pm.regsave Paulo Zanoni
2014-03-20 12:58   ` Imre Deak
2014-04-01 20:54     ` Paulo Zanoni
2014-03-07 23:12 ` [PATCH 2/6] drm/i915: add gen-specific runtime suspend/resume functions Paulo Zanoni
2014-03-20 12:59   ` Imre Deak [this message]
2014-03-07 23:12 ` [PATCH 3/6] drm/i915: add SNB runtime PM support Paulo Zanoni
2014-04-01 15:34   ` Imre Deak
2014-04-01 21:17     ` Paulo Zanoni
2014-03-07 23:12 ` [PATCH 4/6] drm/i915: remove HAS_PC8 check Paulo Zanoni
2014-03-20 13:29   ` Imre Deak
2014-03-07 23:12 ` [PATCH 5/6] drm/i915: BDW needs D_COMP writes through MCHBAR Paulo Zanoni
2014-04-01 15:49   ` Imre Deak
2014-03-07 23:12 ` [PATCH 6/6] drm/i915: add BDW runtime PM support Paulo Zanoni
2014-04-01 15:51   ` Imre Deak
2014-04-01 21:35     ` Daniel Vetter
2014-04-01 16:21 ` [PATCH 0/6] SNB/BDW runtime PM Imre Deak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395320369.17233.5.camel@intelbox \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=przanoni@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.