]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Add debug option for replay ESD recovery
authorWei-Guang Li <wei-guang.li@amd.com>
Wed, 6 May 2026 12:32:33 +0000 (20:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 15:45:41 +0000 (11:45 -0400)
[Why&How]
Add a new debug option "enable_replay_esd_recovery" to control whether
to enable the replay ESD recovery feature.

Reviewed-by: Robin Chen <robin.chen@amd.com>
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Wei-Guang Li <wei-guang.li@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@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

index d0b6fad65bc0618faa1c524bc643af6ae5d9b099..a356cf4faa1df963e45657c45add8f3ad97c868a 100644 (file)
@@ -1220,6 +1220,7 @@ struct dc_debug_options {
        bool enable_otg_frame_sync_pwa;
        unsigned int min_deep_sleep_dcfclk_khz;
        unsigned int force_odm2to1_for_edp_pixclk_mhz;
+       bool enable_replay_esd_recovery;
 };
 
 
index f9e0ba24d401a98f7f6bad8681c3371fd79bb352..54ce768ae6ad97ac3033b9224cf3b6c80fd44080 100644 (file)
@@ -312,12 +312,14 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link, bool *need_re_enabl
                }
        }
 
-       if (!link->replay_settings.replay_allow_active &&
-           replay_sink_status.bits.SINK_DEVICE_REPLAY_STATUS == 0x7) {
-           /* If sink device replay status is 0x7 and replay is disabled,
-            * it means sink is in a bad state and link retraining is needed to recover
-            */
-           *replay_esd_detection_needed = true;
+       if (link->ctx->dc->debug.enable_replay_esd_recovery) {
+               if (!link->replay_settings.replay_allow_active &&
+                   replay_sink_status.bits.SINK_DEVICE_REPLAY_STATUS == 0x7) {
+                   /* If sink device replay status is 0x7 and replay is disabled,
+                    * it means sink is in a bad state and link retraining is needed to recover
+                    */
+                   *replay_esd_detection_needed = true;
+               }
        }
 }