]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/radeon: Delay Connector detecting when HPD singals is unstable
authorShixiong Ou <oushixiong@kylinos.cn>
Thu, 9 May 2024 08:57:58 +0000 (16:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 19:44:38 +0000 (15:44 -0400)
In some causes, HPD signals will jitter when plugging in
or unplugging HDMI.

Rescheduling the hotplug work for a second when EDID may still be
readable but HDP is disconnected, and fixes this issue.

Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_connectors.c

index b84b58926106a47f08016b43f5db02576f3040e0..cf0114ca59a439bcebd5f763c1ebb8f7dec780f7 100644 (file)
@@ -1267,6 +1267,16 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
                        goto exit;
                }
        }
+
+       if (dret && radeon_connector->hpd.hpd != RADEON_HPD_NONE &&
+           !radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) &&
+           connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) {
+               DRM_DEBUG_KMS("EDID is readable when HPD disconnected\n");
+               schedule_delayed_work(&rdev->hotplug_work, msecs_to_jiffies(1000));
+               ret = connector_status_disconnected;
+               goto exit;
+       }
+
        if (dret) {
                radeon_connector->detected_by_load = false;
                radeon_connector_free_edid(connector);