dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Increase the HDMI HPD disconnect filter time
@ 2026-10-08  7:31 2564278112
  2026-10-08  7:38 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: 2564278112 @ 2026-10-08  7:31 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, amd-gfx
  Cc: Dmytro Laktyushkin, Roman Li, Wenjing Liu, Tom Chung,
	Dillon Varone, Alex Hung, Lu Yao, dri-devel, linux-kernel,
	Wang Jiang

From: Wang Jiang <jiangwang@kylinos.cn>

The HPD filter programmed for the DVI/HDMI link types uses 100ms for a
disconnect, which is shorter than the HPD low period that some sinks
generate while they reconfigure, for example when the video mode changes
or when the audio infoframe is updated. Such a sink is then reported as
unplugged and plugged back in, so the connector is torn down and
re-probed for nothing.

Raise the disconnect filter to 800ms for the DVI/HDMI link types,
including HDMI FRL. The delay is written to DC_HPD_TOGGLE_FILT_CNTL in
10ms units inside an 8-bit field, so 800ms is encoded as 80, and the
filter runs in hardware, so there is no CPU cost. The connect filter is
left at 500ms. A genuine unplug keeps HPD low, so the only cost is that
the event is reported up to 800ms later.

The DP branch above already tunes its filter values empirically to hide
a bouncing HPD, and link_factory.c notes that a badly programmed GPIO
makes HPD not "rise or drain fast enough, leading to bounces".

Signed-off-by: Wang Jiang <jiangwang@kylinos.cn>
---
 drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
index cfb5ef0523a7..2b38ddaaaa4b 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_hpd.c
@@ -82,8 +82,12 @@ bool program_hpd_filter(const struct dc_link *link)
 	case SIGNAL_TYPE_HDMI_TYPE_A:
 	case SIGNAL_TYPE_HDMI_FRL:
 		/* Program hpd filter */
+		/* Some HDMI/DVI sinks drive HPD low for a few hundred ms while
+		 * they reconfigure; 100ms is not enough to hide that bounce,
+		 * which is then reported as a fake unplug/plug pair.
+		 */
 		delay_on_connect_in_ms = 500;
-		delay_on_disconnect_in_ms = 100;
+		delay_on_disconnect_in_ms = 800;
 		break;
 	case SIGNAL_TYPE_DISPLAY_PORT:
 	case SIGNAL_TYPE_DISPLAY_PORT_MST:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-08  7:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08  7:31 [PATCH] drm/amd/display: Increase the HDMI HPD disconnect filter time 2564278112
2026-10-08  7:38 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox