drm/amd/display: Correct DPCD revision for eDP v1.4
authorZhan Liu <zhan.liu@amd.com>
Wed, 5 May 2021 21:44:46 +0000 (17:44 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 May 2021 02:39:25 +0000 (22:39 -0400)
[Why]
eDP version and DPCD revision are different. Per VESA
spec, "The DPCD revision for eDP v1.4 is 13h".

SUPPORTED_LINK_RATES is valid since eDP v1.4 (DPCD_REV_13).

[How]
Correct DPCD_REV for eDP v1.4.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com>
Acked-by: Stylon Wang <stylon.wang@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_dp.c

index 9071277a9acf7430a98cbe6f8c7ab99d1a0d3c93..85c3608a92cf044f03c0179b2b5dcd6d78bc7ca9 100644 (file)
@@ -2577,7 +2577,11 @@ bool decide_edp_link_settings(struct dc_link *link, struct dc_link_settings *lin
        struct dc_link_settings current_link_setting;
        uint32_t link_bw;
 
-       if (link->dpcd_caps.dpcd_rev.raw < DPCD_REV_14 ||
+       /*
+        * edp_supported_link_rates_count is only valid for eDP v1.4 or higher.
+        * Per VESA eDP spec, "The DPCD revision for eDP v1.4 is 13h"
+        */
+       if (link->dpcd_caps.dpcd_rev.raw < DPCD_REV_13 ||
                        link->dpcd_caps.edp_supported_link_rates_count == 0) {
                *link_setting = link->verified_link_cap;
                return true;
@@ -4000,7 +4004,11 @@ void detect_edp_sink_caps(struct dc_link *link)
        link->dpcd_caps.edp_supported_link_rates_count = 0;
        memset(supported_link_rates, 0, sizeof(supported_link_rates));
 
-       if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_14 &&
+       /*
+        * edp_supported_link_rates_count is only valid for eDP v1.4 or higher.
+        * Per VESA eDP spec, "The DPCD revision for eDP v1.4 is 13h"
+        */
+       if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_13 &&
                        (link->dc->debug.optimize_edp_link_rate ||
                        link->reported_link_cap.link_rate == LINK_RATE_UNKNOWN)) {
                // Read DPCD 00010h - 0001Fh 16 bytes at one shot