diff options
author | Imre Deak <imre.deak@intel.com> | 2014-06-02 07:21:10 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-05 02:52:45 -0400 |
commit | b8c000d9bf23e7c1155ef421f595d1cbc25262da (patch) | |
tree | cce738abf1cdefc4c6f0dae0b985365803661853 | |
parent | 4b0e333ee1100e621c5530d368a3029d41131214 (diff) |
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
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index f6fd86a17174..8bbd4f910663 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -5572,10 +5572,25 @@ bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, | |||
5572 | enum intel_display_power_domain domain) | 5572 | enum intel_display_power_domain domain) |
5573 | { | 5573 | { |
5574 | struct i915_power_domains *power_domains; | 5574 | struct i915_power_domains *power_domains; |
5575 | struct i915_power_well *power_well; | ||
5576 | bool is_enabled; | ||
5577 | int i; | ||
5578 | |||
5579 | if (dev_priv->pm.suspended) | ||
5580 | return false; | ||
5575 | 5581 | ||
5576 | power_domains = &dev_priv->power_domains; | 5582 | power_domains = &dev_priv->power_domains; |
5583 | is_enabled = true; | ||
5584 | for_each_power_well_rev(i, power_well, BIT(domain), power_domains) { | ||
5585 | if (power_well->always_on) | ||
5586 | continue; | ||
5577 | 5587 | ||
5578 | return power_domains->domain_use_count[domain]; | 5588 | if (!power_well->count) { |
5589 | is_enabled = false; | ||
5590 | break; | ||
5591 | } | ||
5592 | } | ||
5593 | return is_enabled; | ||
5579 | } | 5594 | } |
5580 | 5595 | ||
5581 | bool intel_display_power_enabled(struct drm_i915_private *dev_priv, | 5596 | bool intel_display_power_enabled(struct drm_i915_private *dev_priv, |