<div class="gmail_quote">On Thu, Oct 13, 2011 at 17:34, Adam Jackson <span dir="ltr"><<a href="mailto:ajax@redhat.com">ajax@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Thu, 2011-10-13 at 15:11 -0300, Eugeni Dodonov wrote:<br>
<br>
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c<br>
> index d98cee6..b3a6eda 100644<br>
> --- a/drivers/gpu/drm/i915/intel_i2c.c<br>
> +++ b/drivers/gpu/drm/i915/intel_i2c.c<br>
> @@ -470,3 +470,45 @@ void intel_teardown_gmbus(struct drm_device *dev)<br>
> kfree(dev_priv->gmbus);<br>
> dev_priv->gmbus = NULL;<br>
> }<br>
> +<br>
> +/**<br>
> + * intel_drm_get_valid_edid - gets edid from existent adapters only<br>
> + * @connector: DRM connector device to use<br>
> + * @adapter: i2c adapter<br>
> + *<br>
> + * Verifies if the i2c adapter is responding to our queries before<br>
> + * attempting to do proper communication with it. If it does,<br>
> + * retreive the EDID with help of drm_get_edid<br>
> + */<br>
> +struct edid *<br>
> +intel_drm_get_valid_edid(struct drm_connector *connector,<br>
> + struct i2c_adapter *adapter)<br>
> +{<br>
> + int ret;<br>
> + u8 out_buf[] = { 0x0, 0x0};<br>
> + u8 buf[2];<br>
> + struct i2c_msg msgs[] = {<br>
> + {<br>
> + .addr = 0x50,<br>
> + .flags = 0,<br>
> + .len = 1,<br>
> + .buf = out_buf,<br>
> + },<br>
> + {<br>
> + .addr = 0x50,<br>
> + .flags = I2C_M_RD,<br>
> + .len = 1,<br>
> + .buf = buf,<br>
> + }<br>
> + };<br>
> +<br>
> + /* We just check for -ENXIO - drm_get_edid checks if the transfer<br>
> + * works and manages the remaining parts of the EDID */<br>
> + ret = i2c_transfer(adapter, msgs, 2);<br>
<br>
</div></div>This seems like it should be the implementation body of drm_probe_ddc,<br>
and like that function should be EXPORT_SYMBOL()'d. Other people want<br>
to do zero-length reads too, you know.<br>
<br>
- ajax<br>
</blockquote></div><br>My other patch in the previous series (<a href="http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg05828.html">http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg05828.html</a>) did exactly that, but it haven't received any comments, and there was one report saying that it decreased the detection timing on a radeon card. I don't have any to test, so I prefer to focus on Intel ones (which I have) :).<br>
<br clear="all"><br>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>