Hello Dave,<div><br></div><div>My patch-set for adding support for 4 block EDID is now reviewed and ready.</div><div>Please let me know if you want any further clarification</div><div><br></div><div>Regards,</div><div>Shirish S<br>
<br><div class="gmail_quote">On Thu, Aug 30, 2012 at 12:04 AM, Shirish S <span dir="ltr"><<a href="mailto:s.shirish@samsung.com" target="_blank">s.shirish@samsung.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The current logic for probing ddc is limited to<br>
2 blocks (256 bytes), this patch adds support<br>
for the 4 block (512) data.<br>
<br>
To do this, a single 8-bit segment index is<br>
passed to the display via the I2C address 30h.<br>
Data from the selected segment is then immediately<br>
read via the regular DDC2 address using a repeated<br>
I2C 'START' signal.<br>
<br>
Signed-off-by: Shirish S <<a href="mailto:s.shirish@samsung.com" target="_blank">s.shirish@samsung.com</a>><br>
Reviewed-by: Jean Delvare <<a href="mailto:jdelvare@suse.de" target="_blank">jdelvare@suse.de</a>><br>
Reviewed-by: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch" target="_blank">daniel.vetter@ffwll.ch</a>><br>
Reviewed-by: Ville Syrjala <<a href="mailto:ville.syrjala@linux.intel.com" target="_blank">ville.syrjala@linux.intel.com</a>><br>
---<br>
<div> drivers/gpu/drm/drm_edid.c |   19 ++++++++++++++++---<br>
 1 files changed, 16 insertions(+), 3 deletions(-)<br>
<br>
</div>diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c<br>
index bcc4725..7f62de5 100644<br>
--- a/drivers/gpu/drm/drm_edid.c<br>
+++ b/drivers/gpu/drm/drm_edid.c<br>
@@ -254,6 +254,8 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,<br>
                      int block, int len)<br>
 {<br>
        unsigned char start = block * EDID_LENGTH;<br>
+       unsigned char segment = block >> 1;<br>
+       unsigned char xfers = segment ? 3 : 2;<br>
        int ret, retries = 5;<br>
<br>
        /* The core i2c driver will automatically retry the transfer if the<br>
@@ -265,6 +267,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,<br>
        do {<br>
                struct i2c_msg msgs[] = {<br>
                        {<br>
+                               .addr   = DDC_SEGMENT_ADDR,<br>
+                               .flags  = 0,<br>
+                               .len    = 1,<br>
+                               .buf    = &segment,<br>
+                       }, {<br>
                                .addr   = DDC_ADDR,<br>
                                .flags  = 0,<br>
                                .len    = 1,<br>
@@ -276,15 +283,21 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,<br>
                                .buf    = buf,<br>
                        }<br>
                };<br>
-               ret = i2c_transfer(adapter, msgs, 2);<br>
+<br>
+       /*<br>
+        * Avoid sending the segment addr to not upset non-compliant ddc<br>
+        * monitors.<br>
+        */<br>
+               ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers);<br>
+<br>
                if (ret == -ENXIO) {<br>
                        DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n",<br>
                                        adapter->name);<br>
                        break;<br>
                }<br>
-       } while (ret != 2 && --retries);<br>
+       } while (ret != xfers && --retries);<br>
<br>
-       return ret == 2 ? 0 : -1;<br>
+       return ret == xfers ? 0 : -1;<br>
 }<br>
<br>
 static bool drm_edid_is_zero(u8 *in_edid, int length)<br>
<span><font color="#888888">--<br>
1.7.0.4<br>
</font></span><div><div><br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br></div>