From: Wang Jiang <[email protected]> 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 <[email protected]> --- 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
