diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-04 12:39:21 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-04 15:29:47 -0400 |
commit | cb1793ce921c7e073f9055847a5bc868ab84244c (patch) | |
tree | 80421609c52f0c1a209b1bdf20790bb8b2889214 /drivers/gpu/drm/i915/intel_dp.c | |
parent | 71244653a8fb0f46bc12ae421f1d5f72af6a75da (diff) |
drm/i915: don't chnage the original mode in dp_mode_fixup
We should only frob adjusted_mode. This is in preparation of
a massive patch by Laurent Pinchart to make the mode argument
const.
After the previous two prep patches the only thing left is to clean up
things a bit. I've opted to pass in an adjust_mode param to
dp_adjust_dithering because that way we can be sure to avoid
duplicating this logic between mode_valid and mode_fixup - which was
the cause behind a dp link bw calculation bug in the past.
Also mark the mode argument of pch_panel_fitting const.
v2: Split up the mode->clock => adjusted_mode->clock change,
as suggested by Chris Wilson.
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 90cb39e89e61..6538c46fe959 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -234,7 +234,7 @@ intel_dp_max_data_rate(int max_link_clock, int max_lanes) | |||
234 | static bool | 234 | static bool |
235 | intel_dp_adjust_dithering(struct intel_dp *intel_dp, | 235 | intel_dp_adjust_dithering(struct intel_dp *intel_dp, |
236 | struct drm_display_mode *mode, | 236 | struct drm_display_mode *mode, |
237 | struct drm_display_mode *adjusted_mode) | 237 | bool adjust_mode) |
238 | { | 238 | { |
239 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); | 239 | int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); |
240 | int max_lanes = intel_dp_max_lane_count(intel_dp); | 240 | int max_lanes = intel_dp_max_lane_count(intel_dp); |
@@ -248,8 +248,8 @@ intel_dp_adjust_dithering(struct intel_dp *intel_dp, | |||
248 | if (mode_rate > max_rate) | 248 | if (mode_rate > max_rate) |
249 | return false; | 249 | return false; |
250 | 250 | ||
251 | if (adjusted_mode) | 251 | if (adjust_mode) |
252 | adjusted_mode->private_flags | 252 | mode->private_flags |
253 | |= INTEL_MODE_DP_FORCE_6BPC; | 253 | |= INTEL_MODE_DP_FORCE_6BPC; |
254 | 254 | ||
255 | return true; | 255 | return true; |
@@ -272,7 +272,7 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
272 | return MODE_PANEL; | 272 | return MODE_PANEL; |
273 | } | 273 | } |
274 | 274 | ||
275 | if (!intel_dp_adjust_dithering(intel_dp, mode, NULL)) | 275 | if (!intel_dp_adjust_dithering(intel_dp, mode, false)) |
276 | return MODE_CLOCK_HIGH; | 276 | return MODE_CLOCK_HIGH; |
277 | 277 | ||
278 | if (mode->clock < 10000) | 278 | if (mode->clock < 10000) |
@@ -712,14 +712,14 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
712 | mode, adjusted_mode); | 712 | mode, adjusted_mode); |
713 | } | 713 | } |
714 | 714 | ||
715 | if (mode->flags & DRM_MODE_FLAG_DBLCLK) | 715 | if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) |
716 | return false; | 716 | return false; |
717 | 717 | ||
718 | DRM_DEBUG_KMS("DP link computation with max lane count %i " | 718 | DRM_DEBUG_KMS("DP link computation with max lane count %i " |
719 | "max bw %02x pixel clock %iKHz\n", | 719 | "max bw %02x pixel clock %iKHz\n", |
720 | max_lane_count, bws[max_clock], adjusted_mode->clock); | 720 | max_lane_count, bws[max_clock], adjusted_mode->clock); |
721 | 721 | ||
722 | if (!intel_dp_adjust_dithering(intel_dp, adjusted_mode, adjusted_mode)) | 722 | if (!intel_dp_adjust_dithering(intel_dp, adjusted_mode, true)) |
723 | return false; | 723 | return false; |
724 | 724 | ||
725 | bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; | 725 | bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; |