[PATCH 2/2] drm/edid: Add option to forcibly correct EDID checksums

Adam Jackson ajax at redhat.com
Mon Apr 26 12:03:36 PDT 2010


So much broken hardware, so few bullets.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 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=<bool> [DRM]
+			Forcibly correct EDID checksum errors. Default is off.
+
 	edid_threshold=<int> [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



More information about the dri-devel mailing list