Skip to content

Commit cdf99f6

Browse files
alexdeucherDinh Nguyen
authored andcommitted
drm/radeon/dp: add back special handling for NUTMEG
[ Upstream commit c8213a6 ] When I fixed the dp rate selection in: 092c96a 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: Christian König <[email protected]> Reviewed-by: Ken Wang <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Tested-by: Ken Moffat <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent eeb0cff commit cdf99f6

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

drivers/gpu/drm/radeon/atombios_dp.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,27 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector,
314314
unsigned max_lane_num = drm_dp_max_lane_count(dpcd);
315315
unsigned lane_num, i, max_pix_clock;
316316

317-
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
318-
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
319-
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
317+
if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
318+
ENCODER_OBJECT_ID_NUTMEG) {
319+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
320+
max_pix_clock = (lane_num * 270000 * 8) / bpp;
320321
if (max_pix_clock >= pix_clock) {
321322
*dp_lanes = lane_num;
322-
*dp_rate = link_rates[i];
323+
*dp_rate = 270000;
323324
return 0;
324325
}
325326
}
327+
} else {
328+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
329+
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
330+
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
331+
if (max_pix_clock >= pix_clock) {
332+
*dp_lanes = lane_num;
333+
*dp_rate = link_rates[i];
334+
return 0;
335+
}
336+
}
337+
}
326338
}
327339

328340
return -EINVAL;

0 commit comments

Comments
 (0)