diff options
author | Jani Nikula <jani.nikula@intel.com> | 2021-01-20 12:18:31 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2021-01-21 13:26:13 +0200 |
commit | 97b70144b2502a86ba536924b3b937ba4928f6c4 (patch) | |
tree | a38e951c502a0f1f93e8b7efea1216aa5d15098d /drivers/gpu | |
parent | 7c553f8b5a7dcf45f7a06da23b45e431aafbbdba (diff) | |
download | linux-97b70144b2502a86ba536924b3b937ba4928f6c4.tar.bz2 |
drm/i915/pps: refactor init abstractions
Once you realize there is no need to hold the pps mutex when calling
pps_init_timestamps() in intel_pps_init(), we can reuse
intel_pps_encoder_reset() which has the same code.
Since intel_dp_pps_init() is only called from one place now, move it
inline to remove one "init" function altogether.
Finally, remove some initialization from
vlv_initial_power_sequencer_setup() and do it in the caller to highlight
the similarity, not the difference, in the platforms.
v2: Fix comment (Anshuman)
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210120101834.19813-1-jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_pps.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 58eff6289d12..da6ee0b52741 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -305,9 +305,6 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp) dig_port->base.base.base.id, dig_port->base.base.name, pipe_name(intel_dp->pps_pipe)); - - pps_init_delays(intel_dp); - pps_init_registers(intel_dp, false); } void intel_pps_reset_all(struct drm_i915_private *dev_priv) @@ -1342,20 +1339,9 @@ static void pps_init_registers(struct intel_dp *intel_dp, bool force_disable_vdd (intel_de_read(dev_priv, regs.pp_ctrl) & BXT_POWER_CYCLE_DELAY_MASK)); } -static void intel_dp_pps_init(struct intel_dp *intel_dp) -{ - struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); - - if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { - vlv_initial_power_sequencer_setup(intel_dp); - } else { - pps_init_delays(intel_dp); - pps_init_registers(intel_dp, false); - } -} - void intel_pps_encoder_reset(struct intel_dp *intel_dp) { + struct drm_i915_private *i915 = dp_to_i915(intel_dp); intel_wakeref_t wakeref; if (!intel_dp_is_edp(intel_dp)) @@ -1363,23 +1349,24 @@ void intel_pps_encoder_reset(struct intel_dp *intel_dp) with_intel_pps_lock(intel_dp, wakeref) { /* - * Reinit the power sequencer, in case BIOS did something nasty - * with it. + * Reinit the power sequencer also on the resume path, in case + * BIOS did something nasty with it. */ - intel_dp_pps_init(intel_dp); + if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) + vlv_initial_power_sequencer_setup(intel_dp); + + pps_init_delays(intel_dp); + pps_init_registers(intel_dp, false); + intel_pps_vdd_sanitize(intel_dp); } } void intel_pps_init(struct intel_dp *intel_dp) { - intel_wakeref_t wakeref; - INIT_DELAYED_WORK(&intel_dp->panel_vdd_work, edp_panel_vdd_work); - with_intel_pps_lock(intel_dp, wakeref) { - pps_init_timestamps(intel_dp); - intel_dp_pps_init(intel_dp); - intel_pps_vdd_sanitize(intel_dp); - } + pps_init_timestamps(intel_dp); + + intel_pps_encoder_reset(intel_dp); } |