]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/pps: Reuse POWER_DOMAIN_DISPLAY_CORE in pps_{lock, unlock}
authorAnshuman Gupta <anshuman.gupta@intel.com>
Thu, 7 Jan 2021 11:25:00 +0000 (16:55 +0530)
committerJani Nikula <jani.nikula@intel.com>
Fri, 8 Jan 2021 16:29:49 +0000 (18:29 +0200)
We need a power_domain wakeref in pps_{lock,unlock} to prevent
a race while resetting pps state in intel_power_sequencer_reset().

intel_power_sequencer_reset() need a pps_mutex to access pps_pipe
but it can't grab pps_mutex due to deadlock with power_well
functions are called while holding pps_mutex.
intel_power_sequencer_reset() is called by power_well function
associated with legacy platforms like vlv and chv therefore re-use
the POWER_DOMAIN_DISPLAY_CORE power domain, which only used
by vlv and chv display power domain.

This will avoids the unnecessary noise of unrelated power wells
in pps_{lock,unlock}.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210107112500.16216-1-anshuman.gupta@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 8a00e609085f8c84487b1cb38871b6a502d4b2f9..4f190a82d4ad43eb57e888fbea9604dcb532deb1 100644 (file)
@@ -895,9 +895,7 @@ pps_lock(struct intel_dp *intel_dp)
         * See intel_power_sequencer_reset() why we need
         * a power domain reference here.
         */
-       wakeref = intel_display_power_get(dev_priv,
-                                         intel_aux_power_domain(dp_to_dig_port(intel_dp)));
-
+       wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_DISPLAY_CORE);
        mutex_lock(&dev_priv->pps_mutex);
 
        return wakeref;
@@ -909,9 +907,7 @@ pps_unlock(struct intel_dp *intel_dp, intel_wakeref_t wakeref)
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
 
        mutex_unlock(&dev_priv->pps_mutex);
-       intel_display_power_put(dev_priv,
-                               intel_aux_power_domain(dp_to_dig_port(intel_dp)),
-                               wakeref);
+       intel_display_power_put(dev_priv, POWER_DOMAIN_DISPLAY_CORE, wakeref);
        return 0;
 }