drm/amd/display: allow diags to skip initial link training
authorTony Cheng <tony.cheng@amd.com>
Wed, 11 Jul 2018 19:31:24 +0000 (15:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Jul 2018 20:15:14 +0000 (15:15 -0500)
[why]
diag specify what the full config and is only concerned about pass/fail at the end

having inter-op code like verifiying we can actually train at reported link rate
slows down diag test and add complexity we don't need

[how]
add dc_debug option to skip capability link trianing

also  remove hbr in function name as verify is not specific to hbr

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Ken Chalmers <ken.chalmers@amd.com>
Acked-by: Leo Li <sunpeng.li@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
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h

index a4429c90c60c4ac8a6ca2e952bd0821c915891f1..388a0635c38d5fb9f72bc846e9ff2b6d98b799d2 100644 (file)
@@ -760,7 +760,7 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
                                 */
 
                                /* deal with non-mst cases */
-                               dp_hbr_verify_link_cap(link, &link->reported_link_cap);
+                               dp_verify_link_cap(link, &link->reported_link_cap);
                        }
 
                        /* HDMI-DVI Dongle */
index 474cd3e0175210777664d44ea9a754334809eb1a..b8e6db4382ec0e01b3e2f58e861bde1900f46187 100644 (file)
@@ -1086,7 +1086,7 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link)
        return max_link_cap;
 }
 
-bool dp_hbr_verify_link_cap(
+bool dp_verify_link_cap(
        struct dc_link *link,
        struct dc_link_settings *known_limit_link_setting)
 {
@@ -1101,6 +1101,11 @@ bool dp_hbr_verify_link_cap(
        enum clock_source_id dp_cs_id = CLOCK_SOURCE_ID_EXTERNAL;
        enum link_training_result status;
 
+       if (link->dc->debug.skip_detection_link_training) {
+               link->verified_link_cap = *known_limit_link_setting;
+               return true;
+       }
+
        success = false;
        skip_link_training = false;
 
index ceb4c37258936271ce662e7a675d5024b424ffcd..5e2a2acb5ad688150284989a0c54afc2052db82f 100644 (file)
@@ -258,6 +258,7 @@ struct dc_debug {
        bool avoid_vbios_exec_table;
        bool scl_reset_length10;
        bool hdmi20_disable;
+       bool skip_detection_link_training;
 
        struct {
                uint32_t ltFailCount;
index 2f783c6500842452b63f290d9c8688ff4c5f7e17..697b5ee738451dd10fd4f5bb0002f659fbeade18 100644 (file)
@@ -33,7 +33,7 @@ struct dc_link;
 struct dc_stream_state;
 struct dc_link_settings;
 
-bool dp_hbr_verify_link_cap(
+bool dp_verify_link_cap(
        struct dc_link *link,
        struct dc_link_settings *known_limit_link_setting);