aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorSatheeshakrishna M <satheeshakrishna.m@intel.com>2014-11-13 09:55:17 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-14 05:18:30 -0500
commit96b7dfb785f55b4bbe75e3c6673e2482d2955ad5 (patch)
tree3a7067f9a1cbf8a3f33904ba87b7bcd8372190de /drivers/gpu/drm/i915/intel_display.c
parent540e732c8e2d90a18c9a7798451c2cdf78b9acb6 (diff)
drm/i915/skl: Query DPLL attached to port on SKL
Modify the implementation to query DPLL attached to a SKL port. v2: Rebase on top of the run-time PM on DPMS series (Damien) v3: Modified as per review comments from Paulo Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Satheeshakrishna M <satheeshakrishna.m@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index eac54c6db11f..c34d0883b251 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7960,6 +7960,30 @@ static int haswell_crtc_compute_clock(struct intel_crtc *crtc)
7960 return 0; 7960 return 0;
7961} 7961}
7962 7962
7963static void skylake_get_ddi_pll(struct drm_i915_private *dev_priv,
7964 enum port port,
7965 struct intel_crtc_config *pipe_config)
7966{
7967 u32 temp;
7968
7969 temp = I915_READ(DPLL_CTRL2) & DPLL_CTRL2_DDI_CLK_SEL_MASK(port);
7970 pipe_config->ddi_pll_sel = temp >> (port * 3 + 1);
7971
7972 switch (pipe_config->ddi_pll_sel) {
7973 case SKL_DPLL1:
7974 pipe_config->shared_dpll = DPLL_ID_SKL_DPLL1;
7975 break;
7976 case SKL_DPLL2:
7977 pipe_config->shared_dpll = DPLL_ID_SKL_DPLL2;
7978 break;
7979 case SKL_DPLL3:
7980 pipe_config->shared_dpll = DPLL_ID_SKL_DPLL3;
7981 break;
7982 default:
7983 WARN(1, "Unknown DPLL programmed\n");
7984 }
7985}
7986
7963static void haswell_get_ddi_pll(struct drm_i915_private *dev_priv, 7987static void haswell_get_ddi_pll(struct drm_i915_private *dev_priv,
7964 enum port port, 7988 enum port port,
7965 struct intel_crtc_config *pipe_config) 7989 struct intel_crtc_config *pipe_config)
@@ -7989,7 +8013,10 @@ static void haswell_get_ddi_port_state(struct intel_crtc *crtc,
7989 8013
7990 port = (tmp & TRANS_DDI_PORT_MASK) >> TRANS_DDI_PORT_SHIFT; 8014 port = (tmp & TRANS_DDI_PORT_MASK) >> TRANS_DDI_PORT_SHIFT;
7991 8015
7992 haswell_get_ddi_pll(dev_priv, port, pipe_config); 8016 if (IS_SKYLAKE(dev))
8017 skylake_get_ddi_pll(dev_priv, port, pipe_config);
8018 else
8019 haswell_get_ddi_pll(dev_priv, port, pipe_config);
7993 8020
7994 if (pipe_config->shared_dpll >= 0) { 8021 if (pipe_config->shared_dpll >= 0) {
7995 pll = &dev_priv->shared_dplls[pipe_config->shared_dpll]; 8022 pll = &dev_priv->shared_dplls[pipe_config->shared_dpll];