From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Tygier Subject: [PATCH] DRM: ignore invalid EDID extensions Date: Tue, 21 Sep 2010 23:02:27 +0100 Message-ID: <4C992B73.5040605@yahoo.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by gabe.freedesktop.org (Postfix) with ESMTP id 71DBA9E7F3 for ; Tue, 21 Sep 2010 15:02:31 -0700 (PDT) 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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Currently an invalid EDID extension will cause the whole EDID to be considered invalid. Instead just drop the extension, and return the valid base block. The base block is modified to not claim to have extensions, and update the checksum. For my EIZO S2242W the base block is fine, but the extension block is all zeros. Without this patch I get no X and no VTs. Signed-off-by: Sam Tygier --- drivers/gpu/drm/drm_edid.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f87bf10..5ade343 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -285,6 +285,15 @@ carp: dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n", drm_get_connector_name(connector), j); + /* Invalid extension, so set block[0x7e] to zero, and return + * the base block */ + block[EDID_LENGTH-1] += block[0x7e]; + block[0x7e] = 0; + new = krealloc(block, EDID_LENGTH, GFP_KERNEL); + if (!new) + goto out; + block = new; + return block; out: kfree(block); return NULL; -- 1.7.1