aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-25 15:01:54 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-10 16:07:49 -0400
commitde7cfc635e4ce20ded5ca4e40328386d9ba81922 (patch)
tree1a63c05a50336e2406f8fc3f3e4ed9e50e80b48a
parent728e29d7f1edb7b0951a8c7a0201adf12bf9d867 (diff)
drm/i915: Move ddi_pll_sel into the pipe config
Just boring sed job for preparation. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> [imre: rebased on patchset version w/o pch/crt/fdi refactoring] Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c34
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h5
2 files changed, 20 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index fa1effca82aa..c96bc3b6c3d0 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -277,8 +277,8 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
277 I915_WRITE(_FDI_RXA_CTL, rx_ctl_val); 277 I915_WRITE(_FDI_RXA_CTL, rx_ctl_val);
278 278
279 /* Configure Port Clock Select */ 279 /* Configure Port Clock Select */
280 I915_WRITE(PORT_CLK_SEL(PORT_E), intel_crtc->ddi_pll_sel); 280 I915_WRITE(PORT_CLK_SEL(PORT_E), intel_crtc->config.ddi_pll_sel);
281 WARN_ON(intel_crtc->ddi_pll_sel != PORT_CLK_SEL_SPLL); 281 WARN_ON(intel_crtc->config.ddi_pll_sel != PORT_CLK_SEL_SPLL);
282 282
283 /* Start the training iterating through available voltages and emphasis, 283 /* Start the training iterating through available voltages and emphasis,
284 * testing each value twice. */ 284 * testing each value twice. */
@@ -393,7 +393,7 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
393 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 393 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
394 uint32_t val; 394 uint32_t val;
395 395
396 switch (intel_crtc->ddi_pll_sel) { 396 switch (intel_crtc->config.ddi_pll_sel) {
397 case PORT_CLK_SEL_WRPLL1: 397 case PORT_CLK_SEL_WRPLL1:
398 plls->wrpll1_refcount--; 398 plls->wrpll1_refcount--;
399 if (plls->wrpll1_refcount == 0) { 399 if (plls->wrpll1_refcount == 0) {
@@ -419,7 +419,7 @@ void intel_ddi_put_crtc_pll(struct drm_crtc *crtc)
419 WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n"); 419 WARN(plls->wrpll1_refcount < 0, "Invalid WRPLL1 refcount\n");
420 WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n"); 420 WARN(plls->wrpll2_refcount < 0, "Invalid WRPLL2 refcount\n");
421 421
422 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_NONE; 422 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_NONE;
423} 423}
424 424
425#define LC_FREQ 2700 425#define LC_FREQ 2700
@@ -754,13 +754,13 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc)
754 754
755 switch (intel_dp->link_bw) { 755 switch (intel_dp->link_bw) {
756 case DP_LINK_BW_1_62: 756 case DP_LINK_BW_1_62:
757 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_LCPLL_810; 757 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_LCPLL_810;
758 break; 758 break;
759 case DP_LINK_BW_2_7: 759 case DP_LINK_BW_2_7:
760 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_LCPLL_1350; 760 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_LCPLL_1350;
761 break; 761 break;
762 case DP_LINK_BW_5_4: 762 case DP_LINK_BW_5_4:
763 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_LCPLL_2700; 763 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_LCPLL_2700;
764 break; 764 break;
765 default: 765 default:
766 DRM_ERROR("Link bandwidth %d unsupported\n", 766 DRM_ERROR("Link bandwidth %d unsupported\n",
@@ -804,16 +804,16 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc)
804 804
805 if (reg == WRPLL_CTL1) { 805 if (reg == WRPLL_CTL1) {
806 plls->wrpll1_refcount++; 806 plls->wrpll1_refcount++;
807 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_WRPLL1; 807 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_WRPLL1;
808 } else { 808 } else {
809 plls->wrpll2_refcount++; 809 plls->wrpll2_refcount++;
810 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_WRPLL2; 810 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_WRPLL2;
811 } 811 }
812 812
813 } else if (type == INTEL_OUTPUT_ANALOG) { 813 } else if (type == INTEL_OUTPUT_ANALOG) {
814 DRM_DEBUG_KMS("Using SPLL on pipe %c\n", 814 DRM_DEBUG_KMS("Using SPLL on pipe %c\n",
815 pipe_name(pipe)); 815 pipe_name(pipe));
816 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_SPLL; 816 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_SPLL;
817 } else { 817 } else {
818 WARN(1, "Invalid DDI encoder type %d\n", type); 818 WARN(1, "Invalid DDI encoder type %d\n", type);
819 return false; 819 return false;
@@ -841,10 +841,10 @@ void intel_ddi_pll_enable(struct intel_crtc *crtc)
841 BUILD_BUG_ON(enable_bit != SPLL_PLL_ENABLE); 841 BUILD_BUG_ON(enable_bit != SPLL_PLL_ENABLE);
842 BUILD_BUG_ON(enable_bit != WRPLL_PLL_ENABLE); 842 BUILD_BUG_ON(enable_bit != WRPLL_PLL_ENABLE);
843 843
844 switch (crtc->ddi_pll_sel) { 844 switch (crtc->config.ddi_pll_sel) {
845 case PORT_CLK_SEL_WRPLL1: 845 case PORT_CLK_SEL_WRPLL1:
846 case PORT_CLK_SEL_WRPLL2: 846 case PORT_CLK_SEL_WRPLL2:
847 if (crtc->ddi_pll_sel == PORT_CLK_SEL_WRPLL1) { 847 if (crtc->config.ddi_pll_sel == PORT_CLK_SEL_WRPLL1) {
848 pll_name = "WRPLL1"; 848 pll_name = "WRPLL1";
849 reg = WRPLL_CTL1; 849 reg = WRPLL_CTL1;
850 refcount = plls->wrpll1_refcount; 850 refcount = plls->wrpll1_refcount;
@@ -1161,14 +1161,14 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev)
1161 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 1161 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
1162 1162
1163 if (!intel_crtc->active) { 1163 if (!intel_crtc->active) {
1164 intel_crtc->ddi_pll_sel = PORT_CLK_SEL_NONE; 1164 intel_crtc->config.ddi_pll_sel = PORT_CLK_SEL_NONE;
1165 continue; 1165 continue;
1166 } 1166 }
1167 1167
1168 intel_crtc->ddi_pll_sel = intel_ddi_get_crtc_pll(dev_priv, 1168 intel_crtc->config.ddi_pll_sel = intel_ddi_get_crtc_pll(dev_priv,
1169 pipe); 1169 pipe);
1170 1170
1171 switch (intel_crtc->ddi_pll_sel) { 1171 switch (intel_crtc->config.ddi_pll_sel) {
1172 case PORT_CLK_SEL_WRPLL1: 1172 case PORT_CLK_SEL_WRPLL1:
1173 dev_priv->ddi_plls.wrpll1_refcount++; 1173 dev_priv->ddi_plls.wrpll1_refcount++;
1174 break; 1174 break;
@@ -1224,8 +1224,8 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
1224 intel_edp_panel_on(intel_dp); 1224 intel_edp_panel_on(intel_dp);
1225 } 1225 }
1226 1226
1227 WARN_ON(crtc->ddi_pll_sel == PORT_CLK_SEL_NONE); 1227 WARN_ON(crtc->config.ddi_pll_sel == PORT_CLK_SEL_NONE);
1228 I915_WRITE(PORT_CLK_SEL(port), crtc->ddi_pll_sel); 1228 I915_WRITE(PORT_CLK_SEL(port), crtc->config.ddi_pll_sel);
1229 1229
1230 if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { 1230 if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {
1231 struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 1231 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 41c83ea588f1..0c12558050ea 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -307,6 +307,9 @@ struct intel_crtc_config {
307 /* Selected dpll when shared or DPLL_ID_PRIVATE. */ 307 /* Selected dpll when shared or DPLL_ID_PRIVATE. */
308 enum intel_dpll_id shared_dpll; 308 enum intel_dpll_id shared_dpll;
309 309
310 /* PORT_CLK_SEL for DDI ports. */
311 uint32_t ddi_pll_sel;
312
310 /* Actual register state of the dpll, for shared dpll cross-checking. */ 313 /* Actual register state of the dpll, for shared dpll cross-checking. */
311 struct intel_dpll_hw_state dpll_hw_state; 314 struct intel_dpll_hw_state dpll_hw_state;
312 315
@@ -399,8 +402,6 @@ struct intel_crtc {
399 struct intel_crtc_config *new_config; 402 struct intel_crtc_config *new_config;
400 bool new_enabled; 403 bool new_enabled;
401 404
402 uint32_t ddi_pll_sel;
403
404 /* reset counter value when the last flip was submitted */ 405 /* reset counter value when the last flip was submitted */
405 unsigned int reset_counter; 406 unsigned int reset_counter;
406 407