OSDN Git Service

drm/i915: Initialize CHV digital lock detect threshold
authorVijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Thu, 5 Mar 2015 14:02:06 +0000 (19:32 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 17 Mar 2015 21:30:13 +0000 (22:30 +0100)
Initialize lock detect threshold and select coarse threshold for the
case where M2 fraction division is disabled.

v2: Split the changes into multiple smaller patches (Ville)
v3: Clear out the old bits before we modify those bits as RMW (Ville)
v4: Reset coarse threshold when M2 fraction is enabled (Ville)

Signed-off-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>
Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c

index 17b662f..4c64f17 100644 (file)
@@ -1046,6 +1046,7 @@ enum skl_disp_power_wells {
 #define _CHV_PLL_DW9_CH0               0x8024
 #define _CHV_PLL_DW9_CH1               0x81A4
 #define  DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT             1 /* 3 bits */
+#define  DPIO_CHV_INT_LOCK_THRESHOLD_MASK              (7 << 1)
 #define  DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE        1 /* 1: coarse & 0 : fine  */
 #define CHV_PLL_DW9(ch) _PIPE(ch, _CHV_PLL_DW9_CH0, _CHV_PLL_DW9_CH1)
 
index 8676cb8..2eea258 100644 (file)
@@ -6207,6 +6207,15 @@ static void chv_prepare_pll(struct intel_crtc *crtc,
                dpio_val |= DPIO_CHV_FRAC_DIV_EN;
        vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW3(port), dpio_val);
 
+       /* Program digital lock detect threshold */
+       dpio_val = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW9(port));
+       dpio_val &= ~(DPIO_CHV_INT_LOCK_THRESHOLD_MASK |
+                                       DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE);
+       dpio_val |= (0x5 << DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT);
+       if (!bestm2_frac)
+               dpio_val |= DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE;
+       vlv_dpio_write(dev_priv, pipe, CHV_PLL_DW9(port), dpio_val);
+
        /* Loop filter */
        refclk = i9xx_get_refclk(crtc, 0);
        loopfilter = 5 << DPIO_CHV_PROP_COEFF_SHIFT |