From: Sivapiriyan Kumarasamy <[email protected]>

[Why]
There is a bug when determining if link training should be retried when
HPD is low in dp_verify_link_cap_with_retries.

[How]
Correctly, fail dp_verify_link_cap_with_retries without retry when
HPD is low.

Change-Id: I6fbf64c28f0aac96252a508715a806927fb86d63
Signed-off-by: Sivapiriyan Kumarasamy <[email protected]>
Reviewed-by: Wenjing Liu <[email protected]>
Acked-by: Abdoulaye Berthe <[email protected]>
Acked-by: Bhawanpreet Lakha <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 701b73926616..5a0c3384c16b 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1656,11 +1656,14 @@ bool dp_verify_link_cap_with_retries(
 
        for (i = 0; i < attempts; i++) {
                int fail_count = 0;
-               enum dc_connection_type type;
+               enum dc_connection_type type = dc_connection_none;
 
                memset(&link->verified_link_cap, 0,
                                sizeof(struct dc_link_settings));
-               if (!dc_link_detect_sink(link, &type)) {
+               if (!dc_link_detect_sink(link, &type) || type == 
dc_connection_none) {
+                       link->verified_link_cap.lane_count = LANE_COUNT_ONE;
+                       link->verified_link_cap.link_rate = LINK_RATE_LOW;
+                       link->verified_link_cap.link_spread = 
LINK_SPREAD_DISABLED;
                        break;
                } else if (dp_verify_link_cap(link,
                                &link->reported_link_cap,
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to