Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310109
b: refs/heads/master
c: 47819ba
h: refs/heads/master
i:
  310107: 52d25bd
v: v3
  • Loading branch information
Adam Jackson authored and Dave Airlie committed Jun 1, 2012
1 parent 4e1f8ac commit 6426872
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b00147d9f2ba137ce74b66b768a8312be0b6781
refs/heads/master: 47819ba234d41465b76f179ba674ff549255a5d2
11 changes: 9 additions & 2 deletions trunk/drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -149,6 +149,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
Expand All @@ -160,10 +164,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 {
Expand Down

0 comments on commit 6426872

Please sign in to comment.