mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915: Disable unused power wells left enabled by BIOS
Make sure all unused power wells left enabled by BIOS get disabled during driver loading and system resume. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5028 Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220202104249.2680843-1-imre.deak@intel.com
This commit is contained in:
parent
377c675f3c
commit
d946bc44aa
3 changed files with 34 additions and 0 deletions
|
@ -10664,6 +10664,8 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
|
|||
}
|
||||
|
||||
intel_display_power_put(dev_priv, POWER_DOMAIN_INIT, wakeref);
|
||||
|
||||
intel_power_domains_sanitize_state(dev_priv);
|
||||
}
|
||||
|
||||
void intel_display_resume(struct drm_device *dev)
|
||||
|
|
|
@ -6213,6 +6213,37 @@ void intel_power_domains_driver_remove(struct drm_i915_private *i915)
|
|||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_power_domains_sanitize_state - sanitize power domains state
|
||||
* @i915: i915 device instance
|
||||
*
|
||||
* Sanitize the power domains state during driver loading and system resume.
|
||||
* The function will disable all display power wells that BIOS has enabled
|
||||
* without a user for it (any user for a power well has taken a reference
|
||||
* on it by the time this function is called, after the state of all the
|
||||
* pipe, encoder, etc. HW resources have been sanitized).
|
||||
*/
|
||||
void intel_power_domains_sanitize_state(struct drm_i915_private *i915)
|
||||
{
|
||||
struct i915_power_domains *power_domains = &i915->power_domains;
|
||||
struct i915_power_well *power_well;
|
||||
|
||||
mutex_lock(&power_domains->lock);
|
||||
|
||||
for_each_power_well_reverse(i915, power_well) {
|
||||
if (power_well->desc->always_on || power_well->count ||
|
||||
!power_well->desc->ops->is_enabled(i915, power_well))
|
||||
continue;
|
||||
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"BIOS left unused %s power well enabled, disabling it\n",
|
||||
power_well->desc->name);
|
||||
intel_power_well_disable(i915, power_well);
|
||||
}
|
||||
|
||||
mutex_unlock(&power_domains->lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_power_domains_enable - enable toggling of display power wells
|
||||
* @i915: i915 device instance
|
||||
|
|
|
@ -218,6 +218,7 @@ void intel_power_domains_disable(struct drm_i915_private *dev_priv);
|
|||
void intel_power_domains_suspend(struct drm_i915_private *dev_priv,
|
||||
enum i915_drm_suspend_mode);
|
||||
void intel_power_domains_resume(struct drm_i915_private *dev_priv);
|
||||
void intel_power_domains_sanitize_state(struct drm_i915_private *dev_priv);
|
||||
|
||||
void intel_display_power_suspend_late(struct drm_i915_private *i915);
|
||||
void intel_display_power_resume_early(struct drm_i915_private *i915);
|
||||
|
|
Loading…
Reference in a new issue