[Intel-gfx] [PATCH 4.1/10] drm/i915: get a permanent RPM reference on platforms w/o RPM support

Imre Deak imre.deak at intel.com
Wed Dec 16 05:49:11 PST 2015


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.

Suggested-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Imre Deak <imre.deak at 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..d7f765a 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_get(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



More information about the Intel-gfx mailing list