Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: fix DP mode validation

Switch the order of the loops to walk the rates on the top
so we exhaust all DP 1.1 rate/lane combinations before trying
DP 1.2 rate/lane combos.

This avoids selecting rates that are supported by the monitor,
but not the connector leading to valid modes getting rejected.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=95206

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

+2 -2
+2 -2
drivers/gpu/drm/radeon/atombios_dp.c
··· 326 326 } 327 327 } 328 328 } else { 329 - for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) { 330 - for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) { 329 + for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) { 330 + for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) { 331 331 max_pix_clock = (lane_num * link_rates[i] * 8) / bpp; 332 332 if (max_pix_clock >= pix_clock) { 333 333 *dp_lanes = lane_num;