drm/bridge/dw-hdmi: HDMI Hotplug Detection Issue on i.MX8MP

Derouiche, Oualid oualid.derouiche at kontron.de
Thu Aug 7 07:24:45 UTC 2025


Dear Linux DRM Maintainers,

I hope this message finds you well.

I'm currently troubleshooting an HDMI hot-plug detection issue and would greatly appreciate any insights or suggestions you might have. Below is a brief description of the problem:

Platform: i.MX8MP 
Driver: fsl,imx8mp-hdmi

We're experiencing a bad behavior with certain monitors (specifically Terra monitors). On initial boot, when the HDMI cable is already connected, the correct resolution is applied. However, if the cable is unplugged and then reconnected, the resolution is incorrect, and EDID is not being read. (please see attached Log). After several reconnection attempts, the correct resolution is eventually applied.

Log1 - With Failure

imx8mp-dw-hdmi 32fd8000.hdmi: EVENT=plugin
[ 2602.231703] imx8mp-dw-hdmi 32fd8000.hdmi: read_hpd result: 1
[ 2602.231714] imx-lcdif 32fc6000.display-controller: [drm:check_connector_changed] [CONNECTOR:35:HDMI-A-1] status updated from disconnected to connected
[ 2602.231735] imx-lcdif 32fc6000.display-controller: [drm:check_connector_changed] [CONNECTOR:35:HDMI-A-1] Changed epoch counter 37 => 38
[ 2602.231751] [drm:drm_mode_object_get] OBJ ID: 35 (2)
[ 2602.231765] imx-lcdif 32fc6000.display-controller: [drm:drm_sysfs_connector_hotplug_event] [CONNECTOR:35:HDMI-A-1] generating connector hotplug event
[ 2602.231815] imx-lcdif 32fc6000.display-controller: [drm:drm_fb_helper_hotplug_event.part.0] 
[ 2602.231827] [drm:drm_client_modeset_probe] 
[ 2602.231836] [drm:drm_mode_object_get] OBJ ID: 35 (3)
[ 2602.231848] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:35:HDMI-A-1]
[ 2602.231942] i2c i2c-1: <i2c_imx_xfer_common> transfer message: 0
[ 2602.231951] i2c i2c-1: <i2c_imx_write> write slave address: addr=0xa0
[ 2602.231996] i2c i2c-1: <i2c_imx_trx_complete> TRX complete
[ 2602.232004] i2c i2c-1: <i2c_imx_acked> No ACK
[ 2602.232015] i2c i2c-1: <i2c_imx_xfer_common> exit with: error: -6
[ 2602.232025] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter 30a30000.i2c
[ 2602.232037] imx8mp-dw-hdmi 32fd8000.hdmi: failed to get edid
[ 2602.232043] drm_add_override_edid_modes
[ 2602.232057] drm_add_modes_noedid

Log2 - work correctly

[  209.462094] imx8mp-dw-hdmi 32fd8000.hdmi: EVENT=plugin
[  209.464913] imx8mp-dw-hdmi 32fd8000.hdmi: read_hpd result: 1
[  209.464927] imx-lcdif 32fc6000.display-controller: [drm:check_connector_changed] [CONNECTOR:35:HDMI-A-1] status updated from disconnected to connected
[  209.472468] imx-lcdif 32fc6000.display-controller: [drm:check_connector_changed] [CONNECTOR:35:HDMI-A-1] Changed epoch counter 15 => 16
[  209.472484] [drm:drm_mode_object_get] OBJ ID: 35 (2)
[  209.472516] imx-lcdif 32fc6000.display-controller: [drm:drm_sysfs_connector_hotplug_event] [CONNECTOR:35:HDMI-A-1] generating connector hotplug event
[  209.472577] imx-lcdif 32fc6000.display-controller: [drm:drm_fb_helper_hotplug_event.part.0] 
[  209.472588] [drm:drm_client_modeset_probe] 
[  209.472597] [drm:drm_mode_object_get] OBJ ID: 35 (3)
[  209.472608] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:35:HDMI-A-1]
[  209.472711] i2c i2c-1: <i2c_imx_xfer_common> transfer message: 0
[  209.482814] i2c i2c-1: <i2c_imx_write> write slave address: addr=0xa0
[  209.482881] i2c i2c-1: <i2c_imx_trx_complete> TRX complete
[  209.482890] i2c i2c-1: <i2c_imx_acked> ACK received
[  209.482896] i2c i2c-1: <i2c_imx_write> write data
[  209.482902] i2c i2c-1: <i2c_imx_write> write byte: B0=0x0
[  209.482946] i2c i2c-1: <i2c_imx_trx_complete> TRX complete
[  209.482953] i2c i2c-1: <i2c_imx_acked> ACK received
[  209.482959] i2c i2c-1: <i2c_imx_xfer_common> repeated start


It seems to be a timing-related problem between the EDID read via ddc and HPD signal handling, a workaround by adding a 100 ms delay to the dw_hdmi_phy_read_hpd() function resolves the issue (please see attached).

Patch1

--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1686,8 +1686,13 @@ static void dw_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data)
enum drm_connector_status dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi,
                                               void *data)
{
-       return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD ?
+       enum drm_connector_status stat = hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD ?
                connector_status_connected : connector_status_disconnected;
+
+       if (stat == connector_status_connected)
+               msleep(100);
+
+       return stat;
}
EXPORT_SYMBOL_GPL(dw_hdmi_phy_read_hpd);

it work also with the following : 

Patch2

--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -587,6 +587,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
                              drm_mode_prune_invalid(dev, &connector->modes, false);
                              goto exit;
               }
+             
+             /*need some delay before reading the EDID somehow the I2C sink slave controller in same monitor are late */
+             set_current_state(TASK_INTERRUPTIBLE);
+             schedule_timeout(msecs_to_jiffies(10));

                count = drm_helper_probe_get_modes(connector);

-- 

I've also tried applying different patches from the following series (https://patchwork.kernel.org/project/dri-devel/cover/20240908132823.3308029-1-jonas@kwiboo.se/), but unfortunately it did not resolve the issue.

I'd appreciate any hint or any guidance on what a proper, upstream-compatible solution might look like , I don't think this workaround will be a proper one.
Thank you in advance for your time and support. I look forward to your feedback.

Best Regards
Oualid



More information about the dri-devel mailing list