[PATCH 1/2] drm/bridge: dw-hdmi: use connector->display_info for HDMI and audio detection
From: Gianfranco Mariotti
Date: Wed Dec 02 2026 - 19:03:54 EST
Currently dw-hdmi only updates hdmi->sink_is_hdmi and
hdmi->sink_has_audio inside dw_hdmi_edid_read() using the deprecated
drm_edid_raw(), drm_detect_hdmi_monitor(), and drm_detect_monitor_audio()
helpers.
This has three issues:
1. When chained to a standalone display-connector (e.g. hdmi-connector
with its own ddc-i2c-bus), drm_bridge_connector reads EDID through the
downstream connector bridge and populates connector->display_info,
bypassing dw_hdmi_edid_read() and leaving sink_is_hdmi and
sink_has_audio false even for HDMI monitors.
2. When an EDID override or firmware EDID is active,
connector->display_info reflects the overridden EDID while
dw_hdmi_edid_read() may not run.
3. When an EDID read fails after a previous HDMI monitor was unplugged,
dw_hdmi_edid_read() returns NULL without clearing the stale flags,
whereas drm_edid_connector_update(connector, NULL) resets
connector->display_info.
Resolve the FIXME in dw_hdmi_edid_read() by latching
connector->display_info.is_hdmi and connector->display_info.has_audio in
dw_hdmi_bridge_atomic_enable() under hdmi->mutex before calling
dw_hdmi_update_power(). Capturing them in .atomic_enable() (rather than
in dw_hdmi_setup()) also avoids racing with connector->display_info
updates and preserves the cached HDMI/audio flags across transient
hotplug unplug/replug cycles handled inside dw_hdmi_irq() before
userspace re-reads EDID.
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@xxxxxxxxx>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index d63cd7a9f243b..e24fd67264ce1 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2471,7 +2471,6 @@ static const struct drm_edid *dw_hdmi_edid_read(struct dw_hdmi *hdmi,
struct drm_connector *connector)
{
const struct drm_edid *drm_edid;
- const struct edid *edid;
if (!hdmi->ddc)
return NULL;
@@ -2482,19 +2481,6 @@ static const struct drm_edid *dw_hdmi_edid_read(struct dw_hdmi *hdmi,
return NULL;
}
- /*
- * FIXME: This should use connector->display_info.is_hdmi and
- * connector->display_info.has_audio from a path that has read the EDID
- * and called drm_edid_connector_update().
- */
- edid = drm_edid_raw(drm_edid);
-
- dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",
- edid->width_cm, edid->height_cm);
-
- hdmi->sink_is_hdmi = drm_detect_hdmi_monitor(edid);
- hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
-
return drm_edid;
}
@@ -3006,10 +2992,14 @@ static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge,
connector = drm_atomic_get_new_connector_for_encoder(state,
bridge->encoder);
+ if (WARN_ON(!connector))
+ return;
mutex_lock(&hdmi->mutex);
hdmi->disabled = false;
hdmi->curr_conn = connector;
+ hdmi->sink_is_hdmi = connector->display_info.is_hdmi;
+ hdmi->sink_has_audio = connector->display_info.has_audio;
dw_hdmi_update_power(hdmi);
dw_hdmi_update_phy_mask(hdmi);
handle_plugged_change(hdmi, true);
--
2.25.1