aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-25 15:01:47 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-10 16:04:37 -0400
commit7ca1ac135bc4d566e460230133ff959bb1bfcf88 (patch)
tree12de4a2d85e099eda0b466a95dc8fae7ea034296 /drivers/gpu
parent8cc3e169a606ab9577a333a2017cb1acf75668e3 (diff)
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: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c41
2 files changed, 13 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 41191f11af60..a1650d0ba6af 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -229,7 +229,6 @@ void intel_link_compute_m_n(int bpp, int nlanes,
229 struct intel_link_m_n *m_n); 229 struct intel_link_m_n *m_n);
230 230
231struct intel_ddi_plls { 231struct intel_ddi_plls {
232 int spll_refcount;
233 int wrpll1_refcount; 232 int wrpll1_refcount;
234 int wrpll2_refcount; 233 int wrpll2_refcount;
235}; 234};
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 6cc79c83772c..bd8b1ebe8fa2 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -394,14 +394,11 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
394 394
395 switch (intel_crtc->ddi_pll_sel) { 395 switch (intel_crtc->ddi_pll_sel) {
396 case PORT_CLK_SEL_SPLL: 396 case PORT_CLK_SEL_SPLL:
397 plls->spll_refcount--; 397 DRM_DEBUG_KMS("Disabling SPLL\n");
398 if (plls->spll_refcount == 0) { 398 val = I915_READ(SPLL_CTL);
399 DRM_DEBUG_KMS("Disabling SPLL\n"); 399 WARN_ON(!(val & SPLL_PLL_ENABLE));
400 val = I915_READ(SPLL_CTL); 400 I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
401 WARN_ON(!(val & SPLL_PLL_ENABLE)); 401 POSTING_READ(SPLL_CTL);
402 I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
403 POSTING_READ(SPLL_CTL);
404 }
405 break; 402 break;
406 case PORT_CLK_SEL_WRPLL1: 403 case PORT_CLK_SEL_WRPLL1:
407 plls->wrpll1_refcount--; 404 plls->wrpll1_refcount--;
@@ -425,7 +422,6 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
425 break; 422 break;
426 } 423 }
427 424
428 WARN(plls->spll_refcount < 0, "Invalid SPLL refcount\n");
429 WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n"); 425 WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n");
430 WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n"); 426 WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n");
431 427
@@ -821,16 +817,9 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc)
821 } 817 }
822 818
823 } else if (type == INTEL_OUTPUT_ANALOG) { 819 } else if (type == INTEL_OUTPUT_ANALOG) {
824 if (plls->spll_refcount == 0) { 820 DRM_DEBUG_KMS("Using SPLL on pipe %c\n",
825 DRM_DEBUG_KMS("Using SPLL on pipe %c\n", 821 pipe_name(pipe));
826 pipe_name(pipe)); 822 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL;
827 plls->spll_refcount++;
828 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL;
829 } else {
830 DRM_ERROR("SPLL already in use\n");
831 return false;
832 }
833
834 } else { 823 } else {
835 WARN(1, "Invalid DDI encoder type %d\n", type); 824 WARN(1, "Invalid DDI encoder type %d\n", type);
836 return false; 825 return false;
@@ -869,13 +858,13 @@ void intel_ddi_pll_enable(struct intel_crtc *crtc)
869 return; 858 return;
870 859
871 case PORT_CLK_SEL_SPLL: 860 case PORT_CLK_SEL_SPLL:
872 pll_name = "SPLL";
873 reg = SPLL_CTL;
874 refcount = plls->spll_refcount;
875 new_val = SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz | 861 new_val = SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz |
876 SPLL_PLL_SSC; 862 SPLL_PLL_SSC;
877 break; 863 WARN(I915_READ(SPLL_CTL) & enable_bit, "SPLL already enabled\n");
878 864 I915_WRITE(SPLL_CTL, new_val);
865 POSTING_READ(SPLL_CTL);
866 udelay(20);
867 return;
879 case PORT_CLK_SEL_WRPLL1: 868 case PORT_CLK_SEL_WRPLL1:
880 case PORT_CLK_SEL_WRPLL2: 869 case PORT_CLK_SEL_WRPLL2:
881 if (crtc->ddi_pll_sel == PORT_CLK_SEL_WRPLL1) { 870 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 enum pipe pipe; 1177 enum pipe pipe;
1189 struct intel_crtc *intel_crtc; 1178 struct intel_crtc *intel_crtc;
1190 1179
1191 dev_priv->ddi_plls.spll_refcount = 0;
1192 dev_priv->ddi_plls.wrpll1_refcount = 0; 1180 dev_priv->ddi_plls.wrpll1_refcount = 0;
1193 dev_priv->ddi_plls.wrpll2_refcount = 0; 1181 dev_priv->ddi_plls.wrpll2_refcount = 0;
1194 1182
@@ -1205,9 +1193,6 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
1205 pipe); 1193 pipe);
1206 1194
1207 switch (intel_crtc->ddi_pll_sel) { 1195 switch (intel_crtc->ddi_pll_sel) {
1208 case PORT_CLK_SEL_SPLL:
1209 dev_priv->ddi_plls.spll_refcount++;
1210 break;
1211 case PORT_CLK_SEL_WRPLL1: 1196 case PORT_CLK_SEL_WRPLL1:
1212 dev_priv->ddi_plls.wrpll1_refcount++; 1197 dev_priv->ddi_plls.wrpll1_refcount++;
1213 break; 1198 break;