[kernel/f17] Backport edid header fixup threashold patch from Adam Jackson (rhbz 582559)

Josh Boyer jwboyer at fedoraproject.org
Fri Jun 8 13:23:06 UTC 2012


commit 2cd576ed87cf0d5873d79210453a4645744bf0c6
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Fri Jun 8 09:22:28 2012 -0400

    Backport edid header fixup threashold patch from Adam Jackson (rhbz 582559)

 ...d-Make-the-header-fixup-threshold-tunable.patch |   60 ++++++++++++++++++++
 kernel.spec                                        |    7 ++-
 2 files changed, 66 insertions(+), 1 deletions(-)
---
diff --git a/drm-edid-Make-the-header-fixup-threshold-tunable.patch b/drm-edid-Make-the-header-fixup-threshold-tunable.patch
new file mode 100644
index 0000000..0743f8b
--- /dev/null
+++ b/drm-edid-Make-the-header-fixup-threshold-tunable.patch
@@ -0,0 +1,60 @@
+From b6e2dca9522bfe0f5d54051b00c2ffd11fbf3204 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Wed, 30 May 2012 16:42:39 -0400
+Subject: [PATCH] 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.
+
+[airlied: change include to module.h for this]
+
+Bugzilla: https://bugzilla.redhat.com/582559
+Signed-off-by: Adam Jackson <ajax at redhat.com>
+Signed-off-by: Dave Airlie <airlied at redhat.com>
+---
+ drivers/gpu/drm/drm_edid.c |   12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
+index 5a18b0d..0a407dbc 100644
+--- a/drivers/gpu/drm/drm_edid.c
++++ b/drivers/gpu/drm/drm_edid.c
+@@ -30,7 +30,7 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/i2c.h>
+-#include <linux/export.h>
++#include <linux/module.h>
+ #include "drmP.h"
+ #include "drm_edid.h"
+ #include "drm_edid_modes.h"
+@@ -145,6 +145,11 @@ 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
+  * doesn't check out, or 1 if it's valid.
+@@ -155,10 +160,13 @@ bool drm_edid_block_valid(u8 *raw_edid)
+ 	u8 csum = 0;
+ 	struct edid *edid = (struct edid *)raw_edid;
+ 
++	if (edid_fixup > 8 || edid_fixup < 0)
++		edid_fixup = 6;
++
+ 	if (raw_edid[0] == 0x00) {
+ 		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 {
+-- 
+1.7.10.2
+
diff --git a/kernel.spec b/kernel.spec
index 6cd899d..357af26 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -54,7 +54,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 2
+%global baserelease 3
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -675,6 +675,7 @@ Patch1555: fix_xen_guest_on_old_EC2.patch
 # DRM
 #atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch
 Patch1800: drm-vgem.patch
+Patch1810: drm-edid-Make-the-header-fixup-threshold-tunable.patch
 
 # nouveau + drm fixes
 # intel drm is all merged upstream
@@ -1405,6 +1406,7 @@ ApplyPatch fix_xen_guest_on_old_EC2.patch
 # DRM core
 #ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch
 ApplyPatch drm-vgem.patch
+ApplyPatch drm-edid-Make-the-header-fixup-threshold-tunable.patch
 
 # Nouveau DRM
 
@@ -2336,6 +2338,9 @@ fi
 #    '-'      |  |
 #              '-'
 %changelog
+* Fri Jun 08 2012 Josh Boyer <jwboyer at redhat.com>
+- Backport edid header fixup threashold patch from Adam Jackson (rhbz 582559)
+
 * Wed Jun 06 2012 Dennis Gilmore <dennis at ausil.us> 3.4.1-2
 - add patch from calxeda to enable the highbank kernel to boot
 - on real hardware


More information about the scm-commits mailing list