[PATCH v7 13/23] drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon May 18 11:47:48 PDT 2026
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The CEC physical address is no longer set when the connector status is `connector_status_unknown`, breaking CEC functionality for displays with unreliable HPD.
- [High] Unconditional EDID read over I2C in `detect()` ignores the `force` parameter, causing severe performance degradation and I2C spam.
--
commit d5d270011a2b02f003218ae7b96f62fae2b447e9
Author: Jonas Karlman <jonas at kwiboo.se>
drm: bridge: dw_hdmi: Use dw_hdmi_connector_status_update()
This commit updates the dw-hdmi connector to fetch EDID and update CEC
physical addresses during detect and force functions rather than in get_modes.
It aims to ensure userspace always has access to the latest read EDID.
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
[ ... ]
> @@ -2473,36 +2473,36 @@ dw_hdmi_connector_status_update(struct dw_hdmi *hdmi,
[ ... ]
> drm_edid = dw_hdmi_edid_read(hdmi, connector);
> drm_edid_connector_update(connector, drm_edid);
> drm_edid_free(drm_edid);
>
> - cec_notifier_set_phys_addr(hdmi->cec_notifier,
> - connector->display_info.source_physical_address);
> + if (status == connector_status_connected)
> + cec_notifier_set_phys_addr(hdmi->cec_notifier,
> + connector->display_info.source_physical_address);
> }
Does this break CEC functionality for displays with unreliable HPD?
By guarding the cec_notifier_set_phys_addr() call with a check for
connector_status_connected, the CEC physical address update is skipped if the
status evaluates to connector_status_unknown.
Previously, this was called unconditionally after a successful EDID read,
which allowed CEC to work even when HPD was unreliable.
> static enum drm_connector_status
> dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
> {
> - struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
> - connector);
> + struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector);
> enum drm_connector_status status;
>
> status = dw_hdmi_detect(hdmi);
>
> - if (status == connector_status_disconnected)
> - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);
> + dw_hdmi_connector_status_update(hdmi, connector, status);
Will this cause performance issues by performing unconditional I2C EDID reads
on every detect call?
The dw_hdmi_connector_status_update() function reads the EDID over I2C unless
the status is disconnected, but this completely ignores the force parameter
passed to detect. If a system-wide hotplug event occurs on another port,
drm_helper_hpd_irq_event() will call detect with force=false on all HPD-capable
connectors.
Could this trigger an unnecessary 20-50ms I2C EDID read here, spamming the I2C
bus and blocking the shared KMS system workqueue?
>
> return status;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260518180206.2480119-1-jonas@kwiboo.se?part=13
More information about the linux-amlogic
mailing list