Looks like a CC to dri-devel got forgotten originally, so forwarding it properly.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Eugeni Dodonov</b> <span dir="ltr"><<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>></span><br>
Date: Thu, Jan 5, 2012 at 09:34<br>Subject: [Intel-gfx] [PATCH 1/2] drm: give up on edid retries when i2c bus is not responding<br>To: <a href="mailto:intel-gfx@lists.freedesktop.org">intel-gfx@lists.freedesktop.org</a><br>
Cc: Eugeni Dodonov <<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>><br><br><br>This allows to avoid talking to a non-responding bus repeatedly until we<br>
finally timeout after 15 attempts. We can do this by catching the -ENXIO<br>
error, provided by i2c_algo_bit:bit_doAddress call.<br>
<br>
Within the bit_doAddress we already try 3 times to get the edid data, so<br>
if the routine tells us that bus is not responding, it is mostly pointless<br>
to keep re-trying those attempts over and over again until we reach final<br>
number of retries.<br>
<br>
This change should fix <a href="https://bugs.freedesktop.org/show_bug.cgi?id=41059" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=41059</a><br>
and improve overall edid detection timing by 10-30% in most cases, and by<br>
a much larger margin in case of phantom outputs (up to 30x in one worst<br>
case).<br>
<br>
Timing results for i915-powered machines for 'time xrandr' command:<br>
Machine 1: from 0.840s to 0.290s<br>
Machine 2: from 0.315s to 0.280s<br>
Machine 3: from +/- 4s to 0.184s<br>
<br>
Timing results for HD5770 with 'time xrandr' command:<br>
Machine 4: from 3.210s to 1.060s<br>
<br>
Reviewed-by: Chris Wilson <<a href="mailto:chris@hchris-wilson.co.uk">chris@hchris-wilson.co.uk</a>><br>
Reviewed-by: Keith Packard <<a href="mailto:keithp@keithp.com">keithp@keithp.com</a>><br>
Tested-by: Sean Finney <<a href="mailto:seanius@seanius.net">seanius@seanius.net</a>><br>
Tested-by: Soren Hansen <<a href="mailto:soren@linux2go.dk">soren@linux2go.dk</a>><br>
Tested-by: Hernando Torque <<a href="mailto:sirius@sonnenkinder.org">sirius@sonnenkinder.org</a>><br>
Tested-by: Mike Lothian <<a href="mailto:mike@fireburn.co.uk">mike@fireburn.co.uk</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=41059" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=41059</a><br>
Signed-off-by: Eugeni Dodonov <<a href="mailto:eugeni.dodonov@intel.com">eugeni.dodonov@intel.com</a>><br>
---<br>
drivers/gpu/drm/drm_edid.c | 5 +++++<br>
1 files changed, 5 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c<br>
index 3e927ce..fb6c26c 100644<br>
--- a/drivers/gpu/drm/drm_edid.c<br>
+++ b/drivers/gpu/drm/drm_edid.c<br>
@@ -266,6 +266,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,<br>
}<br>
};<br>
ret = i2c_transfer(adapter, msgs, 2);<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>
<br>
return ret == 2 ? 0 : -1;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.8<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</font></span></div><br><br clear="all"><br>-- <br>Eugeni Dodonov<a href="http://eugeni.dodonov.net/" target="_blank"><br></a><br>