aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2017-10-19 09:37:14 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2017-10-27 11:45:36 -0400
commitf49b44ab84035b0f9c1808770684432bb6804328 (patch)
tree9f4246b46689057c6a13966a6d806099e1c5aa47 /drivers
parent3a6d84e677d4e5a6366437b7007e6a2f97aba9d1 (diff)
drm/i915: Start using output_types for DPLL selection
encoder->type is not realiable for DP/HDMI so let's switch the DPLL selection over to using output_types. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171019133721.11794-4-ville.syrjala@linux.intel.com Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_dpll_mgr.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
index 897fffe1ecd8..a83bf1c38e05 100644
--- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
@@ -813,15 +813,11 @@ hsw_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
813 memset(&crtc_state->dpll_hw_state, 0, 813 memset(&crtc_state->dpll_hw_state, 0,
814 sizeof(crtc_state->dpll_hw_state)); 814 sizeof(crtc_state->dpll_hw_state));
815 815
816 if (encoder->type == INTEL_OUTPUT_HDMI) { 816 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) {
817 pll = hsw_ddi_hdmi_get_dpll(clock, crtc, crtc_state); 817 pll = hsw_ddi_hdmi_get_dpll(clock, crtc, crtc_state);
818 818 } else if (intel_crtc_has_dp_encoder(crtc_state)) {
819 } else if (encoder->type == INTEL_OUTPUT_DP ||
820 encoder->type == INTEL_OUTPUT_DP_MST ||
821 encoder->type == INTEL_OUTPUT_EDP) {
822 pll = hsw_ddi_dp_get_dpll(encoder, clock); 819 pll = hsw_ddi_dp_get_dpll(encoder, clock);
823 820 } else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_ANALOG)) {
824 } else if (encoder->type == INTEL_OUTPUT_ANALOG) {
825 if (WARN_ON(crtc_state->port_clock / 2 != 135000)) 821 if (WARN_ON(crtc_state->port_clock / 2 != 135000))
826 return NULL; 822 return NULL;
827 823
@@ -1369,15 +1365,13 @@ skl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
1369 1365
1370 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state)); 1366 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state));
1371 1367
1372 if (encoder->type == INTEL_OUTPUT_HDMI) { 1368 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) {
1373 bret = skl_ddi_hdmi_pll_dividers(crtc, crtc_state, clock); 1369 bret = skl_ddi_hdmi_pll_dividers(crtc, crtc_state, clock);
1374 if (!bret) { 1370 if (!bret) {
1375 DRM_DEBUG_KMS("Could not get HDMI pll dividers.\n"); 1371 DRM_DEBUG_KMS("Could not get HDMI pll dividers.\n");
1376 return NULL; 1372 return NULL;
1377 } 1373 }
1378 } else if (encoder->type == INTEL_OUTPUT_DP || 1374 } else if (intel_crtc_has_dp_encoder(crtc_state)) {
1379 encoder->type == INTEL_OUTPUT_DP_MST ||
1380 encoder->type == INTEL_OUTPUT_EDP) {
1381 bret = skl_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state); 1375 bret = skl_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state);
1382 if (!bret) { 1376 if (!bret) {
1383 DRM_DEBUG_KMS("Could not set DP dpll HW state.\n"); 1377 DRM_DEBUG_KMS("Could not set DP dpll HW state.\n");
@@ -1388,7 +1382,7 @@ skl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
1388 return NULL; 1382 return NULL;
1389 } 1383 }
1390 1384
1391 if (encoder->type == INTEL_OUTPUT_EDP) 1385 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP))
1392 pll = intel_find_shared_dpll(crtc, crtc_state, 1386 pll = intel_find_shared_dpll(crtc, crtc_state,
1393 DPLL_ID_SKL_DPLL0, 1387 DPLL_ID_SKL_DPLL0,
1394 DPLL_ID_SKL_DPLL0); 1388 DPLL_ID_SKL_DPLL0);
@@ -1812,14 +1806,12 @@ bxt_get_dpll(struct intel_crtc *crtc,
1812 struct intel_shared_dpll *pll; 1806 struct intel_shared_dpll *pll;
1813 int i, clock = crtc_state->port_clock; 1807 int i, clock = crtc_state->port_clock;
1814 1808
1815 if (encoder->type == INTEL_OUTPUT_HDMI && 1809 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) &&
1816 !bxt_ddi_hdmi_set_dpll_hw_state(crtc, crtc_state, clock, 1810 !bxt_ddi_hdmi_set_dpll_hw_state(crtc, crtc_state, clock,
1817 &dpll_hw_state)) 1811 &dpll_hw_state))
1818 return NULL; 1812 return NULL;
1819 1813
1820 if ((encoder->type == INTEL_OUTPUT_DP || 1814 if (intel_crtc_has_dp_encoder(crtc_state) &&
1821 encoder->type == INTEL_OUTPUT_EDP ||
1822 encoder->type == INTEL_OUTPUT_DP_MST) &&
1823 !bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state)) 1815 !bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state))
1824 return NULL; 1816 return NULL;
1825 1817
@@ -1828,7 +1820,7 @@ bxt_get_dpll(struct intel_crtc *crtc,
1828 1820
1829 crtc_state->dpll_hw_state = dpll_hw_state; 1821 crtc_state->dpll_hw_state = dpll_hw_state;
1830 1822
1831 if (encoder->type == INTEL_OUTPUT_DP_MST) { 1823 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
1832 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base); 1824 struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
1833 1825
1834 intel_dig_port = intel_mst->primary; 1826 intel_dig_port = intel_mst->primary;
@@ -2345,15 +2337,13 @@ cnl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
2345 2337
2346 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state)); 2338 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state));
2347 2339
2348 if (encoder->type == INTEL_OUTPUT_HDMI) { 2340 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) {
2349 bret = cnl_ddi_hdmi_pll_dividers(crtc, crtc_state, clock); 2341 bret = cnl_ddi_hdmi_pll_dividers(crtc, crtc_state, clock);
2350 if (!bret) { 2342 if (!bret) {
2351 DRM_DEBUG_KMS("Could not get HDMI pll dividers.\n"); 2343 DRM_DEBUG_KMS("Could not get HDMI pll dividers.\n");
2352 return NULL; 2344 return NULL;
2353 } 2345 }
2354 } else if (encoder->type == INTEL_OUTPUT_DP || 2346 } else if (intel_crtc_has_dp_encoder(crtc_state)) {
2355 encoder->type == INTEL_OUTPUT_DP_MST ||
2356 encoder->type == INTEL_OUTPUT_EDP) {
2357 bret = cnl_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state); 2347 bret = cnl_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state);
2358 if (!bret) { 2348 if (!bret) {
2359 DRM_DEBUG_KMS("Could not set DP dpll HW state.\n"); 2349 DRM_DEBUG_KMS("Could not set DP dpll HW state.\n");
@@ -2361,8 +2351,8 @@ cnl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
2361 } 2351 }
2362 crtc_state->dpll_hw_state = dpll_hw_state; 2352 crtc_state->dpll_hw_state = dpll_hw_state;
2363 } else { 2353 } else {
2364 DRM_DEBUG_KMS("Skip DPLL setup for encoder %d\n", 2354 DRM_DEBUG_KMS("Skip DPLL setup for output_types 0x%x\n",
2365 encoder->type); 2355 crtc_state->output_types);
2366 return NULL; 2356 return NULL;
2367 } 2357 }
2368 2358