summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_dp_mst.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-12-17 18:23:34 +0300
committerAlex Deucher <alexander.deucher@amd.com>2015-12-22 00:39:02 +0300
commit092c96a8ab9d1bd60ada2ed385cc364ce084180e (patch)
tree5d54ecac3886f9f3eee6444b71b22220c75a601a /drivers/gpu/drm/radeon/radeon_dp_mst.c
parent41869c1c7fe583dec932eb3d87de2e010b30a737 (diff)
downloadlinux-092c96a8ab9d1bd60ada2ed385cc364ce084180e.tar.xz
drm/radeon: fix dp link rate selection (v2)
Need to properly handle the max link rate in the dpcd. This prevents some cases where 5.4 Ghz is selected when it shouldn't be. v2: simplify logic, add array bounds check Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_dp_mst.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_dp_mst.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index 744f5c49c664..b431c9c2b247 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -525,11 +525,17 @@ static bool radeon_mst_mode_fixup(struct drm_encoder *encoder,
drm_mode_set_crtcinfo(adjusted_mode, 0);
{
struct radeon_connector_atom_dig *dig_connector;
+ int ret;
dig_connector = mst_enc->connector->con_priv;
- dig_connector->dp_lane_count = drm_dp_max_lane_count(dig_connector->dpcd);
- dig_connector->dp_clock = radeon_dp_get_max_link_rate(&mst_enc->connector->base,
- dig_connector->dpcd);
+ ret = radeon_dp_get_dp_link_config(&mst_enc->connector->base,
+ dig_connector->dpcd, adjusted_mode->clock,
+ &dig_connector->dp_lane_count,
+ &dig_connector->dp_clock);
+ if (ret) {
+ dig_connector->dp_lane_count = 0;
+ dig_connector->dp_clock = 0;
+ }
DRM_DEBUG_KMS("dig clock %p %d %d\n", dig_connector,
dig_connector->dp_lane_count, dig_connector->dp_clock);
}