diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2014-05-27 13:48:05 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-06-02 10:25:09 -0400 |
commit | 3b6d9fd23e015b5397c438fd3cd74147d2c805b6 (patch) | |
tree | b7750fa33a36fb474068e92636895dd20e4c8cc6 | |
parent | af5d36539dfe043f1cf0f8b7334d6bb12cd14e75 (diff) |
drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices
Only DCE5+ asics support DP 1.2.
Noticed by ArtForz on IRC.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_dp.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 330f8df65b09..225f6c66effa 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
@@ -291,6 +291,19 @@ static int dp_get_max_dp_pix_clock(int link_rate, | |||
291 | 291 | ||
292 | /***** radeon specific DP functions *****/ | 292 | /***** radeon specific DP functions *****/ |
293 | 293 | ||
294 | static int radeon_dp_get_max_link_rate(struct drm_connector *connector, | ||
295 | u8 dpcd[DP_DPCD_SIZE]) | ||
296 | { | ||
297 | int max_link_rate; | ||
298 | |||
299 | if (radeon_connector_is_dp12_capable(connector)) | ||
300 | max_link_rate = min(drm_dp_max_link_rate(dpcd), 540000); | ||
301 | else | ||
302 | max_link_rate = min(drm_dp_max_link_rate(dpcd), 270000); | ||
303 | |||
304 | return max_link_rate; | ||
305 | } | ||
306 | |||
294 | /* First get the min lane# when low rate is used according to pixel clock | 307 | /* First get the min lane# when low rate is used according to pixel clock |
295 | * (prefer low rate), second check max lane# supported by DP panel, | 308 | * (prefer low rate), second check max lane# supported by DP panel, |
296 | * if the max lane# < low rate lane# then use max lane# instead. | 309 | * if the max lane# < low rate lane# then use max lane# instead. |
@@ -300,7 +313,7 @@ static int radeon_dp_get_dp_lane_number(struct drm_connector *connector, | |||
300 | int pix_clock) | 313 | int pix_clock) |
301 | { | 314 | { |
302 | int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector)); | 315 | int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector)); |
303 | int max_link_rate = drm_dp_max_link_rate(dpcd); | 316 | int max_link_rate = radeon_dp_get_max_link_rate(connector, dpcd); |
304 | int max_lane_num = drm_dp_max_lane_count(dpcd); | 317 | int max_lane_num = drm_dp_max_lane_count(dpcd); |
305 | int lane_num; | 318 | int lane_num; |
306 | int max_dp_pix_clock; | 319 | int max_dp_pix_clock; |
@@ -338,7 +351,7 @@ static int radeon_dp_get_dp_link_clock(struct drm_connector *connector, | |||
338 | return 540000; | 351 | return 540000; |
339 | } | 352 | } |
340 | 353 | ||
341 | return drm_dp_max_link_rate(dpcd); | 354 | return radeon_dp_get_max_link_rate(connector, dpcd); |
342 | } | 355 | } |
343 | 356 | ||
344 | static u8 radeon_dp_encoder_service(struct radeon_device *rdev, | 357 | static u8 radeon_dp_encoder_service(struct radeon_device *rdev, |