Skip to contentSkip to conversation

drm/bridge: inno-hdmi: reset DDC segment pointer per I2C transfer

PATCH In review Dominique Belhachemi 2 participants 5 messages May 28 – Sep 28

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: inno-hdmi: reset DDC segment pointer per I2C transfer

The segment_addr and ddc_addr fields need to be reset per I2C transfer to avoid stale values. The reset wasn't required on simple displays with only one segment, but modern displays with two or more segments end up with corrupt EDIDs.

This was found on a StarFive VisionFive 2 SBC.

---
 drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +4 -0
index 5fa533a4eb342..297be02bbd58d 100644
@@ -989,6 +989,10 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
 
 	mutex_lock(&i2c->lock);
 
+	/* Reset segment_addr and ddc_addr at the start of every I2C transfer */
+	i2c->ddc_addr = 0;
+	i2c->segment_addr = 0;
+
 	/* Clear the EDID interrupt flag and unmute the interrupt */
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);
Signature · 1 line
2.53.0
#1 lore raw
Quoted 19 lines · Dominique Belhachemi

The segment_addr and ddc_addr fields need to be reset per I2C transfer to avoid stale values. The reset wasn't required on simple displays with only one segment, but modern displays with two or more segments end up with corrupt EDIDs.

This was found on a StarFive VisionFive 2 SBC.

---
 drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +0 -0
index 5fa533a4eb342..297be02bbd58d 100644
@@ -989,6 +989,10 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
 

drivers/gpu/drm/bridge/inno-hdmi.c static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,

Quoted 10 lines
drivers/gpu/drm/bridge/inno-hdmi.c +4 -1
        mutex_lock(&i2c->lock);
 
+       /* Reset segment_addr and ddc_addr at the start of every I2C transfer */
+       i2c->ddc_addr = 0;
+       i2c->segment_addr = 0;
+
        /* Clear the EDID interrupt flag and unmute the interrupt */
        hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
        hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);
--

Hi, Is there anything else I can provide to get this merged?

Thanks
-Dominique

Reviewed-by on v1 1/1
#2 lore raw
In reply to Dominique Belhachemi
Quoted 17 lines · Dominique Belhachemi

The segment_addr and ddc_addr fields need to be reset per I2C transfer to avoid stale values. The reset wasn't required on simple displays with only one segment, but modern displays with two or more segments end up with corrupt EDIDs.

This was found on a StarFive VisionFive 2 SBC.

---
 drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +0 -0
index 5fa533a4eb342..297be02bbd58d 100644

drivers/gpu/drm/bridge/inno-hdmi.c static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap, · line 998

Quoted 10 lines
drivers/gpu/drm/bridge/inno-hdmi.c +4 -0
@@ -989,6 +989,10 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
 
 	mutex_lock(&i2c->lock);
 
+	/* Reset segment_addr and ddc_addr at the start of every I2C transfer */
+	i2c->ddc_addr = 0;
+	i2c->segment_addr = 0;
+
 	/* Clear the EDID interrupt flag and unmute the interrupt */
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);
#3 lore raw
Quoted 23 lines · Michal Wilczynski
Quoted 20 lines · Dominique Belhachemi

The segment_addr and ddc_addr fields need to be reset per I2C transfer to avoid stale values. The reset wasn't required on simple displays with only one segment, but modern displays with two or more segments end up with corrupt EDIDs.

This was found on a StarFive VisionFive 2 SBC.

---
 drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +0 -0
index 5fa533a4eb342..297be02bbd58d 100644
@@ -989,6 +989,10 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
 
 	mutex_lock(&i2c->lock);
 
Quoted 9 lines

drivers/gpu/drm/bridge/inno-hdmi.c static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap, · line 998

Quoted 7 lines
drivers/gpu/drm/bridge/inno-hdmi.c +4 -0
+	/* Reset segment_addr and ddc_addr at the start of every I2C transfer */
+	i2c->ddc_addr = 0;
+	i2c->segment_addr = 0;
+
 	/* Clear the EDID interrupt flag and unmute the interrupt */
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
 	hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);

I was also told that there were some changes in the MAINTAINERS file regarding this patch and some core people may be missing e.g Luca and Maxime.

It would be best to resend with updated list of maintainers.

Best regards,

Signature · 1 line
Michal Wilczynski <[email protected]>
#4 lore raw
Quoted 37 lines · Michal Wilczynski
Quoted 23 lines · Michal Wilczynski
Quoted 20 lines · Dominique Belhachemi

The segment_addr and ddc_addr fields need to be reset per I2C transfer to avoid stale values. The reset wasn't required on simple displays with only one segment, but modern displays with two or more segments end up with corrupt EDIDs.

This was found on a StarFive VisionFive 2 SBC.

---
 drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +0 -0
index 5fa533a4eb342..297be02bbd58d 100644
@@ -989,6 +989,10 @@ static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap,
 
     mutex_lock(&i2c->lock);
 
Quoted 9 lines

drivers/gpu/drm/bridge/inno-hdmi.c static int inno_hdmi_i2c_xfer(struct i2c_adapter *adap, · line 998

Quoted 7 lines
drivers/gpu/drm/bridge/inno-hdmi.c +4 -0
+    /* Reset segment_addr and ddc_addr at the start of every I2C transfer */
+    i2c->ddc_addr = 0;
+    i2c->segment_addr = 0;
+
     /* Clear the EDID interrupt flag and unmute the interrupt */
     hdmi_writeb(hdmi, HDMI_INTERRUPT_MASK1, m_INT_EDID_READY);
     hdmi_writeb(hdmi, HDMI_INTERRUPT_STATUS1, m_INT_EDID_READY);
Quoted 6 lines

I was also told that there were some changes in the MAINTAINERS file regarding this patch and some core people may be missing e.g Luca and Maxime.

It would be best to resend with updated list of maintainers.

Thanks Michal, I am adding them to Cc.

Best
-Dominique