From 9b3a34e1c5ee47d7afc4e7f4d7fa9c60cd7edb98 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Apr 2012 16:11:52 +0100 Subject: [PATCH] drm/i915/dp: Debug mode rates --- drivers/gpu/drm/i915/intel_dp.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 110552f..98e7c3c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -669,7 +669,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, { struct drm_device *dev = encoder->dev; struct intel_dp *intel_dp = enc_to_intel_dp(encoder); - int lane_count, clock; + int lane_count, clock, mode_rate; int max_lane_count = intel_dp_max_lane_count(intel_dp); int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0; int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24; @@ -686,12 +686,16 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, mode->clock = intel_dp->panel_fixed_mode->clock; } + mode_rate = intel_dp_link_required(mode->clock, bpp); + DRM_DEBUG_KMS("dp link requires bw=%d for clock=%d and bpp=%d\n", + mode_rate, mode->clock, bpp); for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { for (clock = 0; clock <= max_clock; clock++) { int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); - if (intel_dp_link_required(mode->clock, bpp) - <= link_avail) { + DRM_DEBUG_KMS("max-data-rate for clock %d nad %d lanes: %d\n", + bws[clock], lane_count); + if (mode_rate <= link_avail) { intel_dp->link_bw = bws[clock]; intel_dp->lane_count = lane_count; adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); -- 1.7.9.1