Hi Jean,<br><br><div class="gmail_quote">On Wed, Aug 29, 2012 at 6:44 AM, Jean Delvare <span dir="ltr"><<a href="mailto:jdelvare@suse.de" target="_blank">jdelvare@suse.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Sorry for breaking message threading but I was not included in<br>
iterations 3 and 4 of this patch.<br>
<br>
Random comments about v4:<br>
<div><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<br>
> 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>
> @@ -264,7 +266,12 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter,<br>
> unsigned char *buf,<br>
> */<br>
> do {<br>
> struct i2c_msg msgs[] = {<br>
> - {<br>
> + { /*set segment pointer */<br>
> + .addr = DDC_SEGMENT_ADDR,<br>
> + .flags = segment ? 0 : I2C_M_IGNORE_NAK,<br>
<br>
</div>I don't get the idea. If segment == 0, this message is never sent, so the<br>
value of field flags doesn't matter. So flags will always be 0 when this<br>
message is sent, so it can be hard-coded.<br>
<br></blockquote><div>Agreed. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But from previous discussions my understanding was an agreement on always<br>
using I2C_M_IGNORE_NAK for improved compatibility. So I2C_M_IGNORE_NAK<br>
should be hard-coded, not 0?<br>
<div></div></blockquote><div>After discussion,daniel had asked for a seprate patch for the flags modification.</div><div>Will upload that later. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
> + .len = 1,<br>
> + .buf = &segment,<br>
> + }, {<br>
> .addr = DDC_ADDR,<br>
> .flags = 0,<br>
> .len = 1,<br>
> @@ -276,15 +283,22 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter,<br>
> unsigned char *buf,<br>
> .buf = buf,<br>
> }<br>
> };<br>
> - ret = i2c_transfer(adapter, msgs, 2);<br>
> + /* Avoid sending the segment addr to not upset non-compliant ddc<br>
> + * monitors.<br>
> + */<br>
<br>
</div>s/segment addr/segment/, plus it's abot E-DCC compliance as I understand it,<br>
not DDC.<br>
<div><br>
> + if (!segment)<br>
> + ret = i2c_transfer(adapter, &msgs[1], xfers);<br>
> + else<br>
> + ret = i2c_transfer(adapter, msgs, xfers);<br>
> +<br>
<br>
</div>This can be written:<br>
<br>
ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers);<br>
<br>
Which is more compact and, I suspect, faster.<br>
<div><br></div></blockquote><div>Agreed. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
> 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>
<br>
</div>Other than this, your code looks reasonable, not so different from what<br>
I submitted 8 months ago actually. But ISTU you can test the code with<br>
real hardware while I couldn't.<br>
<br></blockquote><div>Your patch never checked for the 3 message transfer complete, it checked only 2.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With the changes above applied, you can add:<br>
<br>
Reviewed-by: Jean Delvare <<a href="mailto:jdelvare@suse.de" target="_blank">jdelvare@suse.de</a>><br>
<span><font color="#888888"><br></font></span></blockquote><div>Will add your review comments in patch set 5 and your reviewed tag.</div><div> </div><div>Thanks & Regards,</div><div>Shirish S </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><font color="#888888">
--<br>
Jean Delvare<br>
Suse L3<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>