diff mbox

Bug#622993: every 10s I get "[drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid ..."

Message ID 6090341.IquQv0jnHJ@luna (mailing list archive)
State New, archived
Headers show

Commit Message

Lisandro Damián Nicanor Pérez Meyer Feb. 17, 2014, 3:39 a.m. UTC
(Sorry if I'm spawning a very old thread here).

After all this time I have been patching my kernels to workaround [0][1]

[0] <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624549>
[1] <https://bugs.freedesktop.org/show_bug.cgi?id=37040>

Some time ago I found [2] and today I finally solved the problem.

[2] <http://www.blaicher.com/2012/06/howto-fixing-a-broken-edid-eeprom-with-a-bus-pirate-v4/>

Some stuff I learned: the kernel does ignores checksums mismatches by 8... in 
the positive side! My mismatch was exactly -1, ie, 255.

I have been modifying the original patch to workaround this since 2011. I'm 
attaching my last patch in case someone else needs it. It does adds a kernel 
parameter to ignore edid mismatches.

Kinds regards, Lisandro.
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 830f750..773c5d0 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1018,6 +1018,9 @@  bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid)
 		}
 	}
 
+	if (!drm_edid_strict)
+        return 1;
+
 	for (i = 0; i < EDID_LENGTH; i++)
 		csum += raw_edid[i];
 	if (csum) {
@@ -2021,7 +2024,7 @@  do_inferred_modes(struct detailed_timing *timing, void *c)
 	closure->modes += drm_dmt_modes_for_range(closure->connector,
 						  closure->edid,
 						  timing);
-	
+
 	if (!version_greater(closure->edid, 1, 1))
 		return; /* GTF not defined yet */
 
@@ -2258,7 +2261,7 @@  do_cvt_mode(struct detailed_timing *timing, void *c)
 
 static int
 add_cvt_modes(struct drm_connector *connector, struct edid *edid)
-{	
+{
 	struct detailed_mode_closure closure = {
 		connector, edid, 0, 0, 0
 	};
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 39d8645..487a6ef 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -49,6 +49,9 @@  EXPORT_SYMBOL(drm_vblank_offdelay);
 unsigned int drm_timestamp_precision = 20;  /* Default to 20 usecs. */
 EXPORT_SYMBOL(drm_timestamp_precision);
 
+int drm_edid_strict = 1;   /* 0 to disable strict edid conformance */
+EXPORT_SYMBOL(drm_edid_strict);
+
 /*
  * Default to use monotonic timestamps for wait-for-vblank and page-flip
  * complete events.
@@ -63,12 +66,14 @@  MODULE_PARM_DESC(rnodes, "Enable experimental render nodes API");
 MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs]");
 MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]");
 MODULE_PARM_DESC(timestamp_monotonic, "Use monotonic timestamps");
+MODULE_PARM_DESC(edid_strict, "Strict EDID checks (0 = disable)");
 
 module_param_named(debug, drm_debug, int, 0600);
 module_param_named(rnodes, drm_rnodes, int, 0600);
 module_param_named(vblankoffdelay, drm_vblank_offdelay, int, 0600);
 module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600);
 module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600);
+module_param_named(edid_strict, drm_edid_strict, int, 0600);
 
 struct idr drm_minors_idr;
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index b46fb45..b86d239 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1462,6 +1462,7 @@  extern unsigned int drm_rnodes;
 extern unsigned int drm_vblank_offdelay;
 extern unsigned int drm_timestamp_precision;
 extern unsigned int drm_timestamp_monotonic;
+extern int drm_edid_strict;
 
 extern struct class *drm_class;
 extern struct dentry *drm_debugfs_root;