Commit 9a9ef3ed authored by Alex Deucher's avatar Alex Deucher Committed by Tim Gardner

drm/radeon/dp: add back special handling for NUTMEG

BugLink: http://bugs.launchpad.net/bugs/1600092

When I fixed the dp rate selection in:
092c96a8
drm/radeon: fix dp link rate selection (v2)
I accidently dropped the special handling for NUTMEG
DP bridge chips.  They require a fixed link rate.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarKen Wang <Qingqing.Wang@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Tested-by: default avatarKen Moffat <zarniwhoop@ntlworld.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
(cherry picked from commit c8213a63)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 09a079ef
...@@ -315,6 +315,17 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector, ...@@ -315,6 +315,17 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector,
unsigned max_lane_num = drm_dp_max_lane_count(dpcd); unsigned max_lane_num = drm_dp_max_lane_count(dpcd);
unsigned lane_num, i, max_pix_clock; unsigned lane_num, i, max_pix_clock;
if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
ENCODER_OBJECT_ID_NUTMEG) {
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
max_pix_clock = (lane_num * 270000 * 8) / bpp;
if (max_pix_clock >= pix_clock) {
*dp_lanes = lane_num;
*dp_rate = 270000;
return 0;
}
}
} else {
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) { for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) { for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp; max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
...@@ -325,6 +336,7 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector, ...@@ -325,6 +336,7 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector,
} }
} }
} }
}
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment