On Wed, Dec 16, 2015 at 03:53:32PM +0200, Imre Deak wrote:
> Currently we get a permanent RPM reference if the platform doesn't
> support RPM, but this is implicit via the dependency of the power well
> functionality on RPM the RPM support, see
> sanitize_disable_power_well_option(). Make things more explicit by
> taking an RPM reference only for the purpose of keeping RPM disabled.
> This provides better documentation and safety against future changes
> that would break the above dependency.
> 
> v2:
> - fix intel_runtime_pm_get vs. intel_runtime_pm_put in
>   intel_power_domains_fini()
> 
> Suggested-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
> Signed-off-by: Imre Deak <imre.d...@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrj...@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c 
> b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index cee54ea..c35f12c 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -1992,6 +1992,13 @@ void intel_power_domains_fini(struct drm_i915_private 
> *dev_priv)
>       /* Remove the refcount we took to keep power well support disabled. */
>       if (!i915.disable_power_well)
>               intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
> +
> +     /*
> +      * Remove the refcount we took in intel_runtime_pm_enable() in case
> +      * the platform doesn't support runtime PM.
> +      */
> +     if (!HAS_RUNTIME_PM(dev_priv))
> +             intel_runtime_pm_put(dev_priv);
>  }
>  
>  static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
> @@ -2305,6 +2312,9 @@ void intel_runtime_pm_enable(struct drm_i915_private 
> *dev_priv)
>       struct drm_device *dev = dev_priv->dev;
>       struct device *device = &dev->pdev->dev;
>  
> +     if (!HAS_RUNTIME_PM(dev_priv))
> +             intel_runtime_pm_get(dev_priv);
> +
>       pm_runtime_set_autosuspend_delay(device, 10000); /* 10s */
>       pm_runtime_mark_last_busy(device);
>       pm_runtime_use_autosuspend(device);
> -- 
> 2.5.0

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to