From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [Intel-gfx] [PATCH 1/2] drm: give up on edid retries when i2c bus is not responding Date: Mon, 16 Jan 2012 21:33:26 +0100 Message-ID: <20120116203326.GJ3627@phenom.ffwll.local> References: <1325763269-7245-1-git-send-email-eugeni.dodonov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1325763269-7245-1-git-send-email-eugeni.dodonov@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Eugeni Dodonov , Dave Airlie Cc: intel-gfx@lists.freedesktop.org, DRI Development List-Id: dri-devel@lists.freedesktop.org Hi Dave, Is it ok if I merge this through my -next tree? Otherwise please consider merging this for 3.4. Yours, Daniel On Thu, Jan 05, 2012 at 09:34:28AM -0200, Eugeni Dodonov wrote: > This allows to avoid talking to a non-responding bus repeatedly until we > finally timeout after 15 attempts. We can do this by catching the -ENXIO > error, provided by i2c_algo_bit:bit_doAddress call. > > Within the bit_doAddress we already try 3 times to get the edid data, so > if the routine tells us that bus is not responding, it is mostly pointless > to keep re-trying those attempts over and over again until we reach final > number of retries. > > This change should fix https://bugs.freedesktop.org/show_bug.cgi?id=41059 > and improve overall edid detection timing by 10-30% in most cases, and by > a much larger margin in case of phantom outputs (up to 30x in one worst > case). > > Timing results for i915-powered machines for 'time xrandr' command: > Machine 1: from 0.840s to 0.290s > Machine 2: from 0.315s to 0.280s > Machine 3: from +/- 4s to 0.184s > > Timing results for HD5770 with 'time xrandr' command: > Machine 4: from 3.210s to 1.060s > > Reviewed-by: Chris Wilson > Reviewed-by: Keith Packard > Tested-by: Sean Finney > Tested-by: Soren Hansen > Tested-by: Hernando Torque > Tested-by: Mike Lothian > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41059 > Signed-off-by: Eugeni Dodonov > --- > drivers/gpu/drm/drm_edid.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index 3e927ce..fb6c26c 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -266,6 +266,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf, > } > }; > ret = i2c_transfer(adapter, msgs, 2); > + if (ret == -ENXIO) { > + DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n", > + adapter->name); > + break; > + } > } while (ret != 2 && --retries); > > return ret == 2 ? 0 : -1; > -- > 1.7.8 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48