diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-02 17:33:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-02 17:33:37 -0400 |
commit | eb1574270a6de8fb8d31ffc3b021e30df0afcda3 (patch) | |
tree | d154ba369f222f5108ed1a2462d815d7faadc2e5 /drivers/gpu/drm/i915/intel_dp.c | |
parent | aac10aaa8cc65a6fef6f5bc7d0b96035b0225a61 (diff) | |
parent | 69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff) |
Merge 3.4-rc5 into driver-core-next
This was done to resolve a merge issue with the init/main.c file.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 110552ff302c..4b637919f74f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -219,14 +219,38 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes) | |||
219 | return (max_link_clock * max_lanes * 8) / 10; | 219 | return (max_link_clock * max_lanes * 8) / 10; |
220 | } | 220 | } |
221 | 221 | ||
222 | static bool | ||
223 | intel_dp_adjust_dithering(struct intel_dp *intel_dp, | ||
224 | struct drm_display_mode *mode, | ||
225 | struct drm_display_mode *adjusted_mode) | ||
226 | { | ||
227 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); | ||
228 | int max_lanes = intel_dp_max_lane_count(intel_dp); | ||
229 | int max_rate, mode_rate; | ||
230 | |||
231 | mode_rate = intel_dp_link_required(mode->clock, 24); | ||
232 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); | ||
233 | |||
234 | if (mode_rate > max_rate) { | ||
235 | mode_rate = intel_dp_link_required(mode->clock, 18); | ||
236 | if (mode_rate > max_rate) | ||
237 | return false; | ||
238 | |||
239 | if (adjusted_mode) | ||
240 | adjusted_mode->private_flags | ||
241 | |= INTEL_MODE_DP_FORCE_6BPC; | ||
242 | |||
243 | return true; | ||
244 | } | ||
245 | |||
246 | return true; | ||
247 | } | ||
248 | |||
222 | static int | 249 | static int |
223 | intel_dp_mode_valid(struct drm_connector *connector, | 250 | intel_dp_mode_valid(struct drm_connector *connector, |
224 | struct drm_display_mode *mode) | 251 | struct drm_display_mode *mode) |
225 | { | 252 | { |
226 | struct intel_dp *intel_dp = intel_attached_dp(connector); | 253 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
227 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); | ||
228 | int max_lanes = intel_dp_max_lane_count(intel_dp); | ||
229 | int max_rate, mode_rate; | ||
230 | 254 | ||
231 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { | 255 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { |
232 | if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) | 256 | if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) |
@@ -236,16 +260,8 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
236 | return MODE_PANEL; | 260 | return MODE_PANEL; |
237 | } | 261 | } |
238 | 262 | ||
239 | mode_rate = intel_dp_link_required(mode->clock, 24); | 263 | if (!intel_dp_adjust_dithering(intel_dp, mode, NULL)) |
240 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); | 264 | return MODE_CLOCK_HIGH; |
241 | |||
242 | if (mode_rate > max_rate) { | ||
243 | mode_rate = intel_dp_link_required(mode->clock, 18); | ||
244 | if (mode_rate > max_rate) | ||
245 | return MODE_CLOCK_HIGH; | ||
246 | else | ||
247 | mode->private_flags |= INTEL_MODE_DP_FORCE_6BPC; | ||
248 | } | ||
249 | 265 | ||
250 | if (mode->clock < 10000) | 266 | if (mode->clock < 10000) |
251 | return MODE_CLOCK_LOW; | 267 | return MODE_CLOCK_LOW; |
@@ -672,7 +688,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
672 | int lane_count, clock; | 688 | int lane_count, clock; |
673 | int max_lane_count = intel_dp_max_lane_count(intel_dp); | 689 | int max_lane_count = intel_dp_max_lane_count(intel_dp); |
674 | int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0; | 690 | int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0; |
675 | int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; | 691 | int bpp; |
676 | static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 }; | 692 | static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 }; |
677 | 693 | ||
678 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { | 694 | if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) { |
@@ -686,6 +702,11 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
686 | mode->clock = intel_dp->panel_fixed_mode->clock; | 702 | mode->clock = intel_dp->panel_fixed_mode->clock; |
687 | } | 703 | } |
688 | 704 | ||
705 | if (!intel_dp_adjust_dithering(intel_dp, mode, adjusted_mode)) | ||
706 | return false; | ||
707 | |||
708 | bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; | ||
709 | |||
689 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { | 710 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { |
690 | for (clock = 0; clock <= max_clock; clock++) { | 711 | for (clock = 0; clock <= max_clock; clock++) { |
691 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); | 712 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); |