drm/amd/display: Fix wrong resolution with DP/VGA adapter
authorIlya <Ilya.Bakoulin@amd.com>
Thu, 10 Feb 2022 16:09:33 +0000 (11:09 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Feb 2022 19:22:03 +0000 (14:22 -0500)
commit10a9accd4842e6098cc27d79d43d7542254003bc
treedd8197a1380d55be8e766a5c060ec40225b54c2e
parent3e6084aee08b108f5cc489be46c68ba56b13e52e
drm/amd/display: Fix wrong resolution with DP/VGA adapter

[Why]
Hotplugging the VGA side of some DP/VGA adapters caused the display to
light up with the wrong (non-native) resolution.

This is caused by the adapter misbehaving by reporting the wrong number
of downstream ports when the VGA side is unplugged (reports 1 instead of
0), but only if the SINK_COUNT DPCD register is read more than once.

[How]
To work around the adapter behavior, remove the sink if link is
detected, but EDID cannot be read.

Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Ilya <Ilya.Bakoulin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c