diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 44 |
2 files changed, 26 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 19004557c868..61575f67a626 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -1554,17 +1554,14 @@ skl_ddi_pll_select(struct intel_crtc *intel_crtc, | |||
1554 | DPLL_CFGCR2_PDIV(wrpll_params.pdiv) | | 1554 | DPLL_CFGCR2_PDIV(wrpll_params.pdiv) | |
1555 | wrpll_params.central_freq; | 1555 | wrpll_params.central_freq; |
1556 | } else if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT) { | 1556 | } else if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT) { |
1557 | struct drm_encoder *encoder = &intel_encoder->base; | 1557 | switch (crtc_state->port_clock / 2) { |
1558 | struct intel_dp *intel_dp = enc_to_intel_dp(encoder); | 1558 | case 81000: |
1559 | |||
1560 | switch (intel_dp->link_bw) { | ||
1561 | case DP_LINK_BW_1_62: | ||
1562 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_810, 0); | 1559 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_810, 0); |
1563 | break; | 1560 | break; |
1564 | case DP_LINK_BW_2_7: | 1561 | case 135000: |
1565 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_1350, 0); | 1562 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_1350, 0); |
1566 | break; | 1563 | break; |
1567 | case DP_LINK_BW_5_4: | 1564 | case 270000: |
1568 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_2700, 0); | 1565 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_2700, 0); |
1569 | break; | 1566 | break; |
1570 | } | 1567 | } |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 32663b1933f1..ef345d56f5cd 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -48,28 +48,28 @@ | |||
48 | #define INTEL_DP_RESOLUTION_FAILSAFE (3 << INTEL_DP_RESOLUTION_SHIFT_MASK) | 48 | #define INTEL_DP_RESOLUTION_FAILSAFE (3 << INTEL_DP_RESOLUTION_SHIFT_MASK) |
49 | 49 | ||
50 | struct dp_link_dpll { | 50 | struct dp_link_dpll { |
51 | int link_bw; | 51 | int clock; |
52 | struct dpll dpll; | 52 | struct dpll dpll; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static const struct dp_link_dpll gen4_dpll[] = { | 55 | static const struct dp_link_dpll gen4_dpll[] = { |
56 | { DP_LINK_BW_1_62, | 56 | { 162000, |
57 | { .p1 = 2, .p2 = 10, .n = 2, .m1 = 23, .m2 = 8 } }, | 57 | { .p1 = 2, .p2 = 10, .n = 2, .m1 = 23, .m2 = 8 } }, |
58 | { DP_LINK_BW_2_7, | 58 | { 270000, |
59 | { .p1 = 1, .p2 = 10, .n = 1, .m1 = 14, .m2 = 2 } } | 59 | { .p1 = 1, .p2 = 10, .n = 1, .m1 = 14, .m2 = 2 } } |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static const struct dp_link_dpll pch_dpll[] = { | 62 | static const struct dp_link_dpll pch_dpll[] = { |
63 | { DP_LINK_BW_1_62, | 63 | { 162000, |
64 | { .p1 = 2, .p2 = 10, .n = 1, .m1 = 12, .m2 = 9 } }, | 64 | { .p1 = 2, .p2 = 10, .n = 1, .m1 = 12, .m2 = 9 } }, |
65 | { DP_LINK_BW_2_7, | 65 | { 270000, |
66 | { .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8 } } | 66 | { .p1 = 1, .p2 = 10, .n = 2, .m1 = 14, .m2 = 8 } } |
67 | }; | 67 | }; |
68 | 68 | ||
69 | static const struct dp_link_dpll vlv_dpll[] = { | 69 | static const struct dp_link_dpll vlv_dpll[] = { |
70 | { DP_LINK_BW_1_62, | 70 | { 162000, |
71 | { .p1 = 3, .p2 = 2, .n = 5, .m1 = 3, .m2 = 81 } }, | 71 | { .p1 = 3, .p2 = 2, .n = 5, .m1 = 3, .m2 = 81 } }, |
72 | { DP_LINK_BW_2_7, | 72 | { 270000, |
73 | { .p1 = 2, .p2 = 2, .n = 1, .m1 = 2, .m2 = 27 } } | 73 | { .p1 = 2, .p2 = 2, .n = 1, .m1 = 2, .m2 = 27 } } |
74 | }; | 74 | }; |
75 | 75 | ||
@@ -83,11 +83,11 @@ static const struct dp_link_dpll chv_dpll[] = { | |||
83 | * m2 is stored in fixed point format using formula below | 83 | * m2 is stored in fixed point format using formula below |
84 | * (m2_int << 22) | m2_fraction | 84 | * (m2_int << 22) | m2_fraction |
85 | */ | 85 | */ |
86 | { DP_LINK_BW_1_62, /* m2_int = 32, m2_fraction = 1677722 */ | 86 | { 162000, /* m2_int = 32, m2_fraction = 1677722 */ |
87 | { .p1 = 4, .p2 = 2, .n = 1, .m1 = 2, .m2 = 0x819999a } }, | 87 | { .p1 = 4, .p2 = 2, .n = 1, .m1 = 2, .m2 = 0x819999a } }, |
88 | { DP_LINK_BW_2_7, /* m2_int = 27, m2_fraction = 0 */ | 88 | { 270000, /* m2_int = 27, m2_fraction = 0 */ |
89 | { .p1 = 4, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } }, | 89 | { .p1 = 4, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } }, |
90 | { DP_LINK_BW_5_4, /* m2_int = 27, m2_fraction = 0 */ | 90 | { 540000, /* m2_int = 27, m2_fraction = 0 */ |
91 | { .p1 = 2, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } } | 91 | { .p1 = 2, .p2 = 1, .n = 1, .m1 = 2, .m2 = 0x6c00000 } } |
92 | }; | 92 | }; |
93 | 93 | ||
@@ -1130,7 +1130,7 @@ intel_dp_connector_unregister(struct intel_connector *intel_connector) | |||
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | static void | 1132 | static void |
1133 | skl_edp_set_pll_config(struct intel_crtc_state *pipe_config, int link_clock) | 1133 | skl_edp_set_pll_config(struct intel_crtc_state *pipe_config) |
1134 | { | 1134 | { |
1135 | u32 ctrl1; | 1135 | u32 ctrl1; |
1136 | 1136 | ||
@@ -1142,7 +1142,7 @@ skl_edp_set_pll_config(struct intel_crtc_state *pipe_config, int link_clock) | |||
1142 | pipe_config->dpll_hw_state.cfgcr2 = 0; | 1142 | pipe_config->dpll_hw_state.cfgcr2 = 0; |
1143 | 1143 | ||
1144 | ctrl1 = DPLL_CTRL1_OVERRIDE(SKL_DPLL0); | 1144 | ctrl1 = DPLL_CTRL1_OVERRIDE(SKL_DPLL0); |
1145 | switch (link_clock / 2) { | 1145 | switch (pipe_config->port_clock / 2) { |
1146 | case 81000: | 1146 | case 81000: |
1147 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_810, | 1147 | ctrl1 |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_810, |
1148 | SKL_DPLL0); | 1148 | SKL_DPLL0); |
@@ -1176,19 +1176,19 @@ skl_edp_set_pll_config(struct intel_crtc_state *pipe_config, int link_clock) | |||
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | static void | 1178 | static void |
1179 | hsw_dp_set_ddi_pll_sel(struct intel_crtc_state *pipe_config, int link_bw) | 1179 | hsw_dp_set_ddi_pll_sel(struct intel_crtc_state *pipe_config) |
1180 | { | 1180 | { |
1181 | memset(&pipe_config->dpll_hw_state, 0, | 1181 | memset(&pipe_config->dpll_hw_state, 0, |
1182 | sizeof(pipe_config->dpll_hw_state)); | 1182 | sizeof(pipe_config->dpll_hw_state)); |
1183 | 1183 | ||
1184 | switch (link_bw) { | 1184 | switch (pipe_config->port_clock / 2) { |
1185 | case DP_LINK_BW_1_62: | 1185 | case 81000: |
1186 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_810; | 1186 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_810; |
1187 | break; | 1187 | break; |
1188 | case DP_LINK_BW_2_7: | 1188 | case 135000: |
1189 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_1350; | 1189 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_1350; |
1190 | break; | 1190 | break; |
1191 | case DP_LINK_BW_5_4: | 1191 | case 270000: |
1192 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_2700; | 1192 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_LCPLL_2700; |
1193 | break; | 1193 | break; |
1194 | } | 1194 | } |
@@ -1245,7 +1245,7 @@ intel_dp_source_rates(struct drm_device *dev, const int **source_rates) | |||
1245 | 1245 | ||
1246 | static void | 1246 | static void |
1247 | intel_dp_set_clock(struct intel_encoder *encoder, | 1247 | intel_dp_set_clock(struct intel_encoder *encoder, |
1248 | struct intel_crtc_state *pipe_config, int link_bw) | 1248 | struct intel_crtc_state *pipe_config) |
1249 | { | 1249 | { |
1250 | struct drm_device *dev = encoder->base.dev; | 1250 | struct drm_device *dev = encoder->base.dev; |
1251 | const struct dp_link_dpll *divisor = NULL; | 1251 | const struct dp_link_dpll *divisor = NULL; |
@@ -1267,7 +1267,7 @@ intel_dp_set_clock(struct intel_encoder *encoder, | |||
1267 | 1267 | ||
1268 | if (divisor && count) { | 1268 | if (divisor && count) { |
1269 | for (i = 0; i < count; i++) { | 1269 | for (i = 0; i < count; i++) { |
1270 | if (link_bw == divisor[i].link_bw) { | 1270 | if (pipe_config->port_clock == divisor[i].clock) { |
1271 | pipe_config->dpll = divisor[i].dpll; | 1271 | pipe_config->dpll = divisor[i].dpll; |
1272 | pipe_config->clock_set = true; | 1272 | pipe_config->clock_set = true; |
1273 | break; | 1273 | break; |
@@ -1544,13 +1544,13 @@ found: | |||
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | if (IS_SKYLAKE(dev) && is_edp(intel_dp)) | 1546 | if (IS_SKYLAKE(dev) && is_edp(intel_dp)) |
1547 | skl_edp_set_pll_config(pipe_config, common_rates[clock]); | 1547 | skl_edp_set_pll_config(pipe_config); |
1548 | else if (IS_BROXTON(dev)) | 1548 | else if (IS_BROXTON(dev)) |
1549 | /* handled in ddi */; | 1549 | /* handled in ddi */; |
1550 | else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) | 1550 | else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) |
1551 | hsw_dp_set_ddi_pll_sel(pipe_config, intel_dp->link_bw); | 1551 | hsw_dp_set_ddi_pll_sel(pipe_config); |
1552 | else | 1552 | else |
1553 | intel_dp_set_clock(encoder, pipe_config, intel_dp->link_bw); | 1553 | intel_dp_set_clock(encoder, pipe_config); |
1554 | 1554 | ||
1555 | return true; | 1555 | return true; |
1556 | } | 1556 | } |