drm/amd/display: Fix dongle_caps containing stale information.
authorDavid Galiffi <david.galiffi@amd.com>
Sat, 21 Sep 2019 00:20:23 +0000 (20:20 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Oct 2019 00:34:27 +0000 (19:34 -0500)
[WHY]

During detection:
function: get_active_converter_info populates link->dpcd_caps.dongle_caps
only when dpcd_rev >= DPCD_REV_11 and DWN_STRM_PORTX_TYPE is
DOWN_STREAM_DETAILED_HDMI or DOWN_STREAM_DETAILED_DP_PLUS_PLUS.
Otherwise, it is not cleared, and stale information remains.

During mode validation:
function: dp_active_dongle_validate_timing reads
link->dpcd_caps.dongle_caps->dongle_type to determine the maximum
pixel clock to support. This information is now stale and no longer
valid.

[HOW]
dp_active_dongle_validate_timing should be using
link->dpcd_caps->dongle_type instead.

Signed-off-by: David Galiffi <david.galiffi@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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_dp.c

index 46c4fff3f627e44cc9c9189bb35b2f5649915361..25bce56216cd304d3225f9c40220846b859182da 100644 (file)
@@ -2256,7 +2256,7 @@ static bool dp_active_dongle_validate_timing(
                break;
        }
 
-       if (dongle_caps->dongle_type != DISPLAY_DONGLE_DP_HDMI_CONVERTER ||
+       if (dpcd_caps->dongle_type != DISPLAY_DONGLE_DP_HDMI_CONVERTER ||
                dongle_caps->extendedCapValid == false)
                return true;
 
index aae204141c6038772bc3362047fa8f6aa27343c8..0f59b68aa4c245e0d7cc4b18150ddb53c741a663 100644 (file)
@@ -2575,6 +2575,7 @@ static void get_active_converter_info(
        uint8_t data, struct dc_link *link)
 {
        union dp_downstream_port_present ds_port = { .byte = data };
+       memset(&link->dpcd_caps.dongle_caps, 0, sizeof(link->dpcd_caps.dongle_caps));
 
        /* decode converter info*/
        if (!ds_port.fields.PORT_PRESENT) {