aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-22 16:56:43 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-22 16:56:43 -0400
commit397fe15715ef1457d89f52666d0e249eb5eae64c (patch)
tree7948bc52fa7ac208ddf2d1261e5c485dbb25ae52 /drivers/gpu/drm/i915/intel_dp.c
parent3b5c662e8f536ca47396116de82f08d771727076 (diff)
drm: extract drm_dp_max_lane_count helper
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Dave Airlie <airlied@gmail.com> 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.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f7b7bfc455e2..e0b91cb75d63 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -125,19 +125,6 @@ intel_edp_target_clock(struct intel_encoder *intel_encoder,
125} 125}
126 126
127static int 127static int
128intel_dp_max_lane_count(struct intel_dp *intel_dp)
129{
130 int max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f;
131 switch (max_lane_count) {
132 case 1: case 2: case 4:
133 break;
134 default:
135 max_lane_count = 4;
136 }
137 return max_lane_count;
138}
139
140static int
141intel_dp_max_link_bw(struct intel_dp *intel_dp) 128intel_dp_max_link_bw(struct intel_dp *intel_dp)
142{ 129{
143 int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE]; 130 int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
@@ -197,7 +184,7 @@ intel_dp_adjust_dithering(struct intel_dp *intel_dp,
197 bool adjust_mode) 184 bool adjust_mode)
198{ 185{
199 int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp)); 186 int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp));
200 int max_lanes = intel_dp_max_lane_count(intel_dp); 187 int max_lanes = drm_dp_max_lane_count(intel_dp->dpcd);
201 int max_rate, mode_rate; 188 int max_rate, mode_rate;
202 189
203 mode_rate = intel_dp_link_required(mode->clock, 24); 190 mode_rate = intel_dp_link_required(mode->clock, 24);
@@ -699,7 +686,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
699 struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 686 struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
700 struct intel_connector *intel_connector = intel_dp->attached_connector; 687 struct intel_connector *intel_connector = intel_dp->attached_connector;
701 int lane_count, clock; 688 int lane_count, clock;
702 int max_lane_count = intel_dp_max_lane_count(intel_dp); 689 int max_lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
703 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;
704 int bpp, mode_rate; 691 int bpp, mode_rate;
705 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 };