drm/i915: fix display power sw state reporting
Subsystems (2)
PATCH 1/1 drm/i915: fix display power sw state reporting
Atm, we refcount both power domains and power wells and intel_display_power_enabled_sw() returns the power domain refcount. What the callers are really interested in though is the sw state of the underlying power wells. Due to this we will report incorrectly that a given power domain is off if its power wells were enabled via another power domain, for example POWER_DOMAIN_INIT which enables all power wells.
As a fix return instead the state based on the refcount of all power wells included in the passed in power domain.
References: https://bugs.freedesktop.org/show_bug.cgi?id=79505
References: https://bugs.freedesktop.org/show_bug.cgi?id=79038
--- drivers/gpu/drm/i915/intel_pm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +16 -1
@@ -5805,10 +5805,25 @@ bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, enum intel_display_power_domain domain) {struct i915_power_domains *power_domains; +struct i915_power_well *power_well; +bool is_enabled; +int i; + +if (dev_priv->pm.suspended) +return false; power_domains = &dev_priv->power_domains; + is_enabled = true; +for_each_power_well_rev (i, power_well,BIT (domain), power_domains) { +if (power_well->always_on) +continue ; -return power_domains->domain_use_count[domain]; +if (!power_well->count) { + is_enabled = false; +break ; + } + } +return is_enabled; } bool intel_display_power_enabled(struct drm_i915_private *dev_priv,
Signature · 1 line
1.8.4
Quoted 8 lines · Imre Deak
Atm, we refcount both power domains and power wells and
intel_display_power_enabled_sw()returns the power domain refcount. What the callers are really interested in though is the sw state of the underlying power wells. Due to this we will report incorrectly that a given power domain is off if its power wells were enabled via another power domain, for examplePOWER_DOMAIN_INITwhich enables all power wells.
Quoted 7 lines
As a fix return instead the state based on the refcount of all power wells included in the passed in power domain.
References: https://bugs.freedesktop.org/show_bug.cgi?id=79505
References: https://bugs.freedesktop.org/show_bug.cgi?id=79038Reported-by Chris Wilson <[email protected]>Signed-off-by Imre Deak <[email protected]>
--
Damien
Quoted 42 lines
--- drivers/gpu/drm/i915/intel_pm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_pm.c +16
-1@@ -5805,10 +5805,25 @@ bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, enum intel_display_power_domain domain) {struct i915_power_domains *power_domains; +struct i915_power_well *power_well; +bool is_enabled; +int i; + +if (dev_priv->pm.suspended) +return false; power_domains = &dev_priv->power_domains; + is_enabled = true; +for_each_power_well_rev (i, power_well,BIT (domain), power_domains) { +if (power_well->always_on) +continue ; -return power_domains->domain_use_count[domain]; +if (!power_well->count) { + is_enabled = false; +break ; + } + } +return is_enabled; } bool intel_display_power_enabled(struct drm_i915_private *dev_priv,Signature · 6 lines
1.8.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx