drm/amd/display: Skip DPIA-specific DP LL automation flag for non-DPIA links
authorGeorge Shen <george.shen@amd.com>
Fri, 1 Dec 2023 13:25:09 +0000 (06:25 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2023 20:22:33 +0000 (15:22 -0500)
[Why]
The is_automated flag logic only applies to USB4 DPIA links during DP LL
compliance test automation. The flag should not be set for non-DPIA
cases.

[How]
Add check for DPIA link endpoint type before setting the flag. Also,
rename is_automated to skip_fallback_on_link_loss for clarity.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c

index e8c1599ab18a7deabeb4c549ca3d9a9161d96975..6ee4db8c054840343f04eeeecb96b32aa2173a6e 100644 (file)
@@ -1541,7 +1541,13 @@ struct dc_link {
        bool is_dig_mapping_flexible;
        bool hpd_status; /* HPD status of link without physical HPD pin. */
        bool is_hpd_pending; /* Indicates a new received hpd */
-       bool is_automated; /* Indicates automated testing */
+
+       /* USB4 DPIA links skip verifying link cap, instead performing the fallback method
+        * for every link training. This is incompatible with DP LL compliance automation,
+        * which expects the same link settings to be used every retry on a link loss.
+        * This flag is used to skip the fallback when link loss occurs during automation.
+        */
+       bool skip_fallback_on_link_loss;
 
        bool edp_sink_present;
 
index 0c00e94e90b1d598fd1442fe46cd7629c821e779..ae271c830c9aaf0fce823a53d96f689eceb7e898 100644 (file)
@@ -265,7 +265,7 @@ void dp_handle_link_loss(struct dc_link *link)
 
        for (i = count - 1; i >= 0; i--) {
                // Always use max settings here for DP 1.4a LL Compliance CTS
-               if (link->is_automated) {
+               if (link->skip_fallback_on_link_loss) {
                        pipes[i]->link_config.dp_link_settings.lane_count =
                                        link->verified_link_cap.lane_count;
                        pipes[i]->link_config.dp_link_settings.link_rate =
@@ -404,7 +404,9 @@ bool dp_handle_hpd_rx_irq(struct dc_link *link,
 
        if (hpd_irq_dpcd_data.bytes.device_service_irq.bits.AUTOMATED_TEST) {
                // Workaround for DP 1.4a LL Compliance CTS as USB4 has to share encoders unlike DP and USBC
-               link->is_automated = true;
+               if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
+                       link->skip_fallback_on_link_loss = true;
+
                device_service_clear.bits.AUTOMATED_TEST = 1;
                core_link_write_dpcd(
                        link,
index 4f4e899e5c46dc29dad7f267b43ae33a9786bfe1..e8dda44b23cb29aa3ec2686b6656bd044c194606 100644 (file)
@@ -811,7 +811,7 @@ static enum link_training_result dpia_training_eq_transparent(
                        /* Take into consideration corner case for DP 1.4a LL Compliance CTS as USB4
                         * has to share encoders unlike DP and USBC
                         */
-                       if (dp_is_interlane_aligned(dpcd_lane_status_updated) || (link->is_automated && retries_eq)) {
+                       if (dp_is_interlane_aligned(dpcd_lane_status_updated) || (link->skip_fallback_on_link_loss && retries_eq)) {
                                result =  LINK_TRAINING_SUCCESS;
                                break;
                        }
@@ -1037,7 +1037,7 @@ enum link_training_result dpia_perform_link_training(
         */
        if (result == LINK_TRAINING_SUCCESS) {
                fsleep(5000);
-               if (!link->is_automated)
+               if (!link->skip_fallback_on_link_loss)
                        result = dp_check_link_loss_status(link, &lt_settings);
        } else if (result == LINK_TRAINING_ABORT)
                dpia_training_abort(link, &lt_settings, repeater_id);