Skip to contentSkip to conversation

drm/edid: Make the header fixup threshold tunable

PATCH New Adam Jackson 1 participant 1 message May 30, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/edid: Make the header fixup threshold tunable

6 bytes seems to be a reasonable default so far, but for the desperate it's worth exposing this.

Bugzilla: https://bugzilla.redhat.com/582559

---
 drivers/gpu/drm/drm_edid.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/gpu/drm/drm_edid.c +8 -1
index 608bddf..1c28018 100644
@@ -144,6 +144,10 @@ int drm_edid_header_is_valid(const u8 *raw_edid)
 }
 EXPORT_SYMBOL(drm_edid_header_is_valid);
 
+static int edid_fixup __read_mostly = 6;
+module_param_named(edid_fixup, edid_fixup, int, 0400);
+MODULE_PARM_DESC(edid_fixup,
+		 "Minimum number of valid EDID header bytes (0-8, default 6)");
 
 /*
  * Sanity check the EDID block (base or extension).  Return 0 if the block
@@ -155,10 +159,13 @@ bool drm_edid_block_valid(u8 *raw_edid, int block)
 	u8 csum = 0;
 	struct edid *edid = (struct edid *)raw_edid;
 
+	if (edid_fixup > 8 || edid_fixup < 0)
+		edid_fixup = 6;
+
 	if (block == 0) {
 		int score = drm_edid_header_is_valid(raw_edid);
 		if (score == 8) ;
-		else if (score >= 6) {
+		else if (score >= edid_fixup) {
 			DRM_DEBUG("Fixing EDID header, your hardware may be failing\n");
 			memcpy(raw_edid, edid_header, sizeof(edid_header));
 		} else {
Signature · 1 line
1.7.7.6