From: Adam Jackson Subject: [PATCH 2/2] drm/edid: Add option to forcibly correct EDID checksums Date: Mon, 26 Apr 2010 15:03:36 -0400 Message-ID: <1272308616-7886-2-git-send-email-ajax@redhat.com> References: <1272308616-7886-1-git-send-email-ajax@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D5649E764 for ; Mon, 26 Apr 2010 12:03:39 -0700 (PDT) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3QJ3cZj027827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Apr 2010 15:03:39 -0400 Received: from localhost.localdomain (ihatethathostname.lab.bos.redhat.com [10.16.43.238]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3QJ3bjs003750 for ; Mon, 26 Apr 2010 15:03:38 -0400 In-Reply-To: <1272308616-7886-1-git-send-email-ajax@redhat.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: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org So much broken hardware, so few bullets. Signed-off-by: Adam Jackson --- Documentation/kernel-parameters.txt | 3 +++ drivers/gpu/drm/drm_edid.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 17d50d2..5814331 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -713,6 +713,9 @@ and is between 256 and 4096 characters. It is defined in the file edd= [EDD] Format: {"off" | "on" | "skip[mbr]"} + edid_force_checksum= [DRM] + Forcibly correct EDID checksum errors. Default is off. + edid_threshold= [DRM] Set the minimum number of bytes of an EDID header that must be valid, out of 8. The default is 6. diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 6a1b5a3..55b498e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -66,6 +66,10 @@ static unsigned int edid_threshold = 6; MODULE_PARM_DESC(edid_threshold, "EDID header fixup threshold (default: 6)"); module_param_named(edid_threshold, edid_threshold, int, 0600); +static bool edid_force_checksum = 0; +MODULE_PARM_DESC(edid_force_checksum, "Forcibly correct EDID checksum"); +module_param_named(edid_force_checksum, edid_force_checksum, int, 0600); + #define LEVEL_DMT 0 #define LEVEL_GTF 1 #define LEVEL_GTF2 2 @@ -149,8 +153,12 @@ drm_edid_block_valid(u8 *raw_edid) for (i = 0; i < EDID_LENGTH; i++) csum += raw_edid[i]; if (csum) { - DRM_ERROR("EDID checksum is invalid, remainder is %d\n", csum); - goto bad; + if (edid_force_checksum) { + raw_edid[0x7f] -= csum; + } else { + DRM_ERROR("EDID checksum is invalid (%d)\n", csum); + goto bad; + } } /* per-block-type checks */ -- 1.7.0.1