[PATCH 19/24] drm/i915: Do not enable all power wells when display is disabled

José Roberto de Souza jose.souza at intel.com
Tue Sep 11 01:09:52 UTC 2018


POWER_DOMAIN_INIT is used when doing driver initialization or cleanup
because driver will touch a lot of registers and using
POWER_DOMAIN_INIT as a shortcut to power on or down every power well.

So here skiping the call to the functions that actually power on or
down power wells when domain is POWER_DOMAIN_INIT and display is
disabled but it still grabs and releases the runtime pm reference
to guarantee that hardware will be powered during initialization.

This patch plus the changes in the previous patches is enough to not
enable any power well when display is disabled, the only exception is
POWER_DOMAIN_GT_IRQ that is used by gem to inhibits DC power savings
while using GT.

Signed-off-by: José Roberto de Souza <jose.souza 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 331a4a06a9f4..43b7bcb92ae0 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -1518,6 +1518,9 @@ __intel_display_power_get_domain(struct drm_i915_private *dev_priv,
 	struct i915_power_domains *power_domains = &dev_priv->power_domains;
 	struct i915_power_well *power_well;
 
+	WARN_ON(!INTEL_INFO(dev_priv)->num_pipes &&
+		domain != POWER_DOMAIN_GT_IRQ);
+
 	for_each_power_domain_well(dev_priv, power_well, BIT_ULL(domain))
 		intel_power_well_get(dev_priv, power_well);
 
@@ -1543,6 +1546,9 @@ void intel_display_power_get(struct drm_i915_private *dev_priv,
 
 	intel_runtime_pm_get(dev_priv);
 
+	if (domain == POWER_DOMAIN_INIT && !INTEL_INFO(dev_priv)->num_pipes)
+		return;
+
 	mutex_lock(&power_domains->lock);
 
 	__intel_display_power_get_domain(dev_priv, domain);
@@ -1603,6 +1609,9 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
 	struct i915_power_domains *power_domains;
 	struct i915_power_well *power_well;
 
+	if (domain == POWER_DOMAIN_INIT && !INTEL_INFO(dev_priv)->num_pipes)
+		goto end;
+
 	power_domains = &dev_priv->power_domains;
 
 	mutex_lock(&power_domains->lock);
@@ -1617,6 +1626,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
 
 	mutex_unlock(&power_domains->lock);
 
+end:
 	intel_runtime_pm_put(dev_priv);
 }
 
-- 
2.18.0



More information about the Intel-gfx-trybot mailing list