Commit 7ca1ac13 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Remove spll_refcount for hsw

SPLL would be a reference clock we could potentially share,
especially if we want to use the SSC mode. But currently we
don't, so let's rip out this complexity for a simpler conversion
to the new display pll framework.
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8cc3e169
...@@ -229,7 +229,6 @@ void intel_link_compute_m_n(int bpp, int nlanes, ...@@ -229,7 +229,6 @@ void intel_link_compute_m_n(int bpp, int nlanes,
struct intel_link_m_n *m_n); struct intel_link_m_n *m_n);
struct intel_ddi_plls { struct intel_ddi_plls {
int spll_refcount;
int wrpll1_refcount; int wrpll1_refcount;
int wrpll2_refcount; int wrpll2_refcount;
}; };
......
...@@ -394,14 +394,11 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc) ...@@ -394,14 +394,11 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
switch (intel_crtc->ddi_pll_sel) { switch (intel_crtc->ddi_pll_sel) {
case PORT_CLK_SEL_SPLL: case PORT_CLK_SEL_SPLL:
plls->spll_refcount--; DRM_DEBUG_KMS("Disabling SPLL\n");
if (plls->spll_refcount == 0) { val = I915_READ(SPLL_CTL);
DRM_DEBUG_KMS("Disabling SPLL\n"); WARN_ON(!(val & SPLL_PLL_ENABLE));
val = I915_READ(SPLL_CTL); I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
WARN_ON(!(val & SPLL_PLL_ENABLE)); POSTING_READ(SPLL_CTL);
I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
POSTING_READ(SPLL_CTL);
}
break; break;
case PORT_CLK_SEL_WRPLL1: case PORT_CLK_SEL_WRPLL1:
plls->wrpll1_refcount--; plls->wrpll1_refcount--;
...@@ -425,7 +422,6 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc) ...@@ -425,7 +422,6 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
break; break;
} }
WARN(plls->spll_refcount < 0, "Invalid SPLL refcount\n");
WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n"); WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n");
WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n"); WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n");
...@@ -821,16 +817,9 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc) ...@@ -821,16 +817,9 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc)
} }
} else if (type == INTEL_OUTPUT_ANALOG) { } else if (type == INTEL_OUTPUT_ANALOG) {
if (plls->spll_refcount == 0) { DRM_DEBUG_KMS("Using SPLL on pipe %c\n",
DRM_DEBUG_KMS("Using SPLL on pipe %c\n", pipe_name(pipe));
pipe_name(pipe)); intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL;
plls->spll_refcount++;
intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL;
} else {
DRM_ERROR("SPLL already in use\n");
return false;
}
} else { } else {
WARN(1, "Invalid DDI encoder type %d\n", type); WARN(1, "Invalid DDI encoder type %d\n", type);
return false; return false;
...@@ -869,13 +858,13 @@ void intel_ddi_pll_enable(struct intel_crtc *crtc) ...@@ -869,13 +858,13 @@ void intel_ddi_pll_enable(struct intel_crtc *crtc)
return; return;
case PORT_CLK_SEL_SPLL: case PORT_CLK_SEL_SPLL:
pll_name = "SPLL";
reg = SPLL_CTL;
refcount = plls->spll_refcount;
new_val = SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz | new_val = SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz |
SPLL_PLL_SSC; SPLL_PLL_SSC;
break; WARN(I915_READ(SPLL_CTL) & enable_bit, "SPLL already enabled\n");
I915_WRITE(SPLL_CTL, new_val);
POSTING_READ(SPLL_CTL);
udelay(20);
return;
case PORT_CLK_SEL_WRPLL1: case PORT_CLK_SEL_WRPLL1:
case PORT_CLK_SEL_WRPLL2: case PORT_CLK_SEL_WRPLL2:
if (crtc->ddi_pll_sel == PORT_CLK_SEL_WRPLL1) { if (crtc->ddi_pll_sel == PORT_CLK_SEL_WRPLL1) {
...@@ -1188,7 +1177,6 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev) ...@@ -1188,7 +1177,6 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
enum pipe pipe; enum pipe pipe;
struct intel_crtc *intel_crtc; struct intel_crtc *intel_crtc;
dev_priv->ddi_plls.spll_refcount = 0;
dev_priv->ddi_plls.wrpll1_refcount = 0; dev_priv->ddi_plls.wrpll1_refcount = 0;
dev_priv->ddi_plls.wrpll2_refcount = 0; dev_priv->ddi_plls.wrpll2_refcount = 0;
...@@ -1205,9 +1193,6 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev) ...@@ -1205,9 +1193,6 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
pipe); pipe);
switch (intel_crtc->ddi_pll_sel) { switch (intel_crtc->ddi_pll_sel) {
case PORT_CLK_SEL_SPLL:
dev_priv->ddi_plls.spll_refcount++;
break;
case PORT_CLK_SEL_WRPLL1: case PORT_CLK_SEL_WRPLL1:
dev_priv->ddi_plls.wrpll1_refcount++; dev_priv->ddi_plls.wrpll1_refcount++;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment