From: Ville Syrjälä Date: Thu, 16 Oct 2014 18:27:31 +0000 (+0300) Subject: drm/i915: Don't initialize power seqeuencer delays more than once X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=81ddbc69992a1f29aeb2a5b183e5228cc7c49caf;p=linux-beck.git drm/i915: Don't initialize power seqeuencer delays more than once Since we read the current power seqeuncer delays from the registers (as well as looking at the vbt and spec values) we may end up corrupting delays we already initialized when we switch to another pipe and the power seqeuncer there has different values currently in the registers. So make sure we only initialize the delays once even if intel_dp_init_panel_power_sequencer() gets called multiple times. There was some discussion in the review about when exactly we need to unlock the pps. Quoting Bspec: "If this bit is not a zero, it activates the register write protect and writes to those registers will be ignored unless the write protect key value is set in the panel sequencing control register." Signed-off-by: Ville Syrjälä Reviewed-by: Imre Deak [danvet: Add Bspec quote per review discussion between Imre and Ville.] Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 269403154751..e1894cea44cc 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4733,6 +4733,10 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev, lockdep_assert_held(&dev_priv->pps_mutex); + /* already initialized? */ + if (final->t11_t12 != 0) + return; + if (HAS_PCH_SPLIT(dev)) { pp_ctrl_reg = PCH_PP_CONTROL; pp_on_reg = PCH_PP_ON_DELAYS;