From patchwork Sat Mar 5 14:56:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 613281 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p26Aeer9016843 for ; Sun, 6 Mar 2011 10:41:01 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAB669EB72 for ; Sun, 6 Mar 2011 02:40:40 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 06 Mar 2011 10:41:01 +0000 (UTC) X-Greylist: delayed 2056 seconds by postgrey-1.31 at gabe; Sat, 05 Mar 2011 07:30:41 PST Received: from bu3sch.de (80-190-117-144.ip-home.de [80.190.117.144]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D29F9E7F4 for ; Sat, 5 Mar 2011 07:30:41 -0800 (PST) Received: by bu3sch.de with esmtpsa (Exim 4.69) (envelope-from ) id 1Pvsu9-0003Ny-3a; Sat, 05 Mar 2011 15:56:25 +0100 Subject: drm_get_edid i2c failure From: Michael Buesch To: David Airlie Date: Sat, 05 Mar 2011 15:56:20 +0100 Message-ID: <1299336980.2123.14.camel@marge> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-Mailman-Approved-At: Sun, 06 Mar 2011 02:38:47 -0800 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Index: linux-2.6.37/drivers/gpu/drm/drm_edid.c =================================================================== --- linux-2.6.37.orig/drivers/gpu/drm/drm_edid.c 2011-03-05 13:09:17.001960834 +0100 +++ linux-2.6.37/drivers/gpu/drm/drm_edid.c 2011-03-05 13:11:34.974194354 +0100 @@ -343,9 +343,16 @@ struct edid *drm_get_edid(struct drm_con struct i2c_adapter *adapter) { struct edid *edid = NULL; + unsigned int tries; - if (drm_probe_ddc(adapter)) - edid = (struct edid *)drm_do_get_edid(connector, adapter); + for (tries = 0; tries < 20; tries++) { + if (drm_probe_ddc(adapter)) + edid = (struct edid *)drm_do_get_edid(connector, adapter); + if (edid) + break; + } + if (tries > 0 && tries < 20) + printk(KERN_INFO "drm_get_edid(): Succeed after %u tries\n", tries); connector->display_info.raw_edid = (char *)edid;