diff mbox series

drm/radeon: Delay Connector detecting when HPD singals is unstable

Message ID 20240509085758.123046-1-oushixiong@kylinos.cn (mailing list archive)
State New, archived
Headers show
Series drm/radeon: Delay Connector detecting when HPD singals is unstable | expand

Commit Message

oushixiong May 9, 2024, 8:57 a.m. UTC
From: Shixiong Ou <oushixiong@kylinos.cn>

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>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Alex Deucher May 9, 2024, 5:24 p.m. UTC | #1
On Thu, May 9, 2024 at 4:58 AM oushixiong <oushixiong@kylinos.cn> wrote:
>
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> 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>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_connectors.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index b84b58926106..cf0114ca59a4 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index b84b58926106..cf0114ca59a4 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -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);