aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ddi.c
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2015-01-15 07:55:23 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 03:50:49 -0500
commit190f68c5e93076662944b395fe08c3dc547e6920 (patch)
tree3fee6f911e137e74b4972985483e12f6f6b5f43d /drivers/gpu/drm/i915/intel_ddi.c
parent2d112de7db9d2cb0bd43f67120acd6c028bb60e8 (diff)
drm/i915: Pass new_config down do crtc_compute_clock
This reduces the number of direct users of crtc->new_config, opening up the possibilty of removing it altogether. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 7de71ee3b9d1..fe6f0c870ca1 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -909,6 +909,7 @@ hsw_ddi_calculate_wrpll(int clock /* in Hz */,
909 909
910static bool 910static bool
911hsw_ddi_pll_select(struct intel_crtc *intel_crtc, 911hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
912 struct intel_crtc_state *crtc_state,
912 struct intel_encoder *intel_encoder, 913 struct intel_encoder *intel_encoder,
913 int clock) 914 int clock)
914{ 915{
@@ -923,16 +924,16 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
923 WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) | 924 WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) |
924 WRPLL_DIVIDER_POST(p); 925 WRPLL_DIVIDER_POST(p);
925 926
926 intel_crtc->new_config->dpll_hw_state.wrpll = val; 927 crtc_state->dpll_hw_state.wrpll = val;
927 928
928 pll = intel_get_shared_dpll(intel_crtc); 929 pll = intel_get_shared_dpll(intel_crtc, crtc_state);
929 if (pll == NULL) { 930 if (pll == NULL) {
930 DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n", 931 DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n",
931 pipe_name(intel_crtc->pipe)); 932 pipe_name(intel_crtc->pipe));
932 return false; 933 return false;
933 } 934 }
934 935
935 intel_crtc->new_config->ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id); 936 crtc_state->ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id);
936 } 937 }
937 938
938 return true; 939 return true;
@@ -1095,6 +1096,7 @@ found:
1095 1096
1096static bool 1097static bool
1097skl_ddi_pll_select(struct intel_crtc *intel_crtc, 1098skl_ddi_pll_select(struct intel_crtc *intel_crtc,
1099 struct intel_crtc_state *crtc_state,
1098 struct intel_encoder *intel_encoder, 1100 struct intel_encoder *intel_encoder,
1099 int clock) 1101 int clock)
1100{ 1102{
@@ -1144,11 +1146,11 @@ skl_ddi_pll_select(struct intel_crtc *intel_crtc,
1144 } else /* eDP */ 1146 } else /* eDP */
1145 return true; 1147 return true;
1146 1148
1147 intel_crtc->new_config->dpll_hw_state.ctrl1 = ctrl1; 1149 crtc_state->dpll_hw_state.ctrl1 = ctrl1;
1148 intel_crtc->new_config->dpll_hw_state.cfgcr1 = cfgcr1; 1150 crtc_state->dpll_hw_state.cfgcr1 = cfgcr1;
1149 intel_crtc->new_config->dpll_hw_state.cfgcr2 = cfgcr2; 1151 crtc_state->dpll_hw_state.cfgcr2 = cfgcr2;
1150 1152
1151 pll = intel_get_shared_dpll(intel_crtc); 1153 pll = intel_get_shared_dpll(intel_crtc, crtc_state);
1152 if (pll == NULL) { 1154 if (pll == NULL) {
1153 DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n", 1155 DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n",
1154 pipe_name(intel_crtc->pipe)); 1156 pipe_name(intel_crtc->pipe));
@@ -1156,7 +1158,7 @@ skl_ddi_pll_select(struct intel_crtc *intel_crtc,
1156 } 1158 }
1157 1159
1158 /* shared DPLL id 0 is DPLL 1 */ 1160 /* shared DPLL id 0 is DPLL 1 */
1159 intel_crtc->new_config->ddi_pll_sel = pll->id + 1; 1161 crtc_state->ddi_pll_sel = pll->id + 1;
1160 1162
1161 return true; 1163 return true;
1162} 1164}
@@ -1168,17 +1170,20 @@ skl_ddi_pll_select(struct intel_crtc *intel_crtc,
1168 * For private DPLLs, compute_config() should do the selection for us. This 1170 * For private DPLLs, compute_config() should do the selection for us. This
1169 * function should be folded into compute_config() eventually. 1171 * function should be folded into compute_config() eventually.
1170 */ 1172 */
1171bool intel_ddi_pll_select(struct intel_crtc *intel_crtc) 1173bool intel_ddi_pll_select(struct intel_crtc *intel_crtc,
1174 struct intel_crtc_state *crtc_state)
1172{ 1175{
1173 struct drm_device *dev = intel_crtc->base.dev; 1176 struct drm_device *dev = intel_crtc->base.dev;
1174 struct intel_encoder *intel_encoder = 1177 struct intel_encoder *intel_encoder =
1175 intel_ddi_get_crtc_new_encoder(intel_crtc); 1178 intel_ddi_get_crtc_new_encoder(intel_crtc);
1176 int clock = intel_crtc->new_config->port_clock; 1179 int clock = crtc_state->port_clock;
1177 1180
1178 if (IS_SKYLAKE(dev)) 1181 if (IS_SKYLAKE(dev))
1179 return skl_ddi_pll_select(intel_crtc, intel_encoder, clock); 1182 return skl_ddi_pll_select(intel_crtc, crtc_state,
1183 intel_encoder, clock);
1180 else 1184 else
1181 return hsw_ddi_pll_select(intel_crtc, intel_encoder, clock); 1185 return hsw_ddi_pll_select(intel_crtc, crtc_state,
1186 intel_encoder, clock);
1182} 1187}
1183 1188
1184void intel_ddi_set_pipe_settings(struct drm_crtc *crtc) 1189void intel_ddi_set_pipe_settings(struct drm_crtc *crtc)