HDMI cannot read the edid from the monitor

HDMIout connected to an old monitor or HDMI to DVI connected to a DVI monitor cannot display. This type of problem is that the i2c under HDMI does not communicate successfully with the monitor and cannot read the device’s EDID

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 906f0f628c2a..992c744dd99a 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -72,7 +72,7 @@ static const unsigned int dw_hdmi_cable[] = {
     EXTCON_DISP_HDMI,
     EXTCON_NONE,
 };
-
+#define USE_CUS_EDID 1
 /*
  * Recommended N and Expected CTS Values in FRL Mode in chapter 9.2.2
  * of HDMI Specification 2.1.

@@ -2263,7 +2269,18 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
     void *data = hdmi->plat_data->phy_data;
     struct drm_property_blob *edid_blob_ptr = connector->edid_blob_ptr;
     int i, ret = 0;
-
+#if USE_CUS_EDID
+    unsigned char cus_edid[] = {
+        0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x33,0x19,0x16,0x25,0x4C,0x39,0x34,0x33,
+        0x23,0x15,0x01,0x03,0x81,0x40,0x28,0x78,0x3A,0x8D,0x85,0xAD,0x4F,0x35,0xB1,0x25,
+        0x0E,0x50,0x54,0xA5,0x4B,0x00,0x71,0x4F,0x81,0x00,0x81,0x80,0xA9,0x40,0xD1,0x00,
+        0xD1,0x40,0x01,0x01,0x01,0x01,0x09,0x33,0x80,0x41,0x70,0x38,0x11,0x40,0x18,0x10,
+        0x22,0x00,0x81,0x91,0x21,0x00,0x00,0x1A,0x00,0x00,0x00,0xFF,0x00,0x50,0x48,0x35,
+        0x4E,0x59,0x31,0x39,0x31,0x33,0x34,0x39,0x4C,0x0A,0x00,0x00,0x00,0xFC,0x2E,0x4C,
+        0x58,0x59,0x31,0x39,0x32,0x30,0x58,0x31,0x30,0x38,0x30,0x0A,0x00,0x00,0x00,0xFD,
+        0x00,0x31,0x56,0x1D,0x71,0x1C,0x00,0x0A,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x49
+    };
+#endif    
     if (hdmi->plat_data->right && hdmi->plat_data->right->next_bridge) {
         struct drm_bridge *bridge = hdmi->plat_data->right->next_bridge;

@@ -2290,10 +2308,24 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
             return -ENOMEM;
         memcpy(edid, edid_blob_ptr->data, edid_blob_ptr->length);
     } else {;
         edid = drm_get_edid(connector, hdmi->ddc);
         hdmi->hdcp_caps = dw_hdmi_qp_hdcp_capable(hdmi);
     }
-
+#if USE_CUS_EDID    
+        if(edid){
+            dev_info(hdmi->dev, "==== get edid \n");
+        }    
+        else{
+            dev_info(hdmi->dev, "==== failed edid to set cus_edid !\n");
+            kfree(edid);
+            edid = kmalloc(512, GFP_KERNEL);
+            if (!edid)
+                return -ENOMEM;
+            memset(edid, 0, 512);
+            memcpy(edid,cus_edid,128);
+        }    
+#endif    
     if (edid) {
         dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n",
             edid->width_cm, edid->height_cm);


This is a patch that attempts to fix EDID and can solve the problem



From the hardware waveform, the cause of the problem is that SDA is pulled low and no STOP signal is generated