diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-25 13:06:12 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-25 13:10:36 -0400 |
commit | 7b0cfee1a24efdfe0235bac62e53f686fe8a8e24 (patch) | |
tree | eeeb8cc3bf7be5ec0e54b7c4f3808ef88ecca012 /drivers/gpu/drm/drm_edid.c | |
parent | 9756fe38d10b2bf90c81dc4d2f17d5632e135364 (diff) | |
parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) |
Merge tag 'v3.5-rc4' into drm-intel-next-queued
I want to merge the "no more fake agp on gen6+" patches into
drm-intel-next (well, the last pieces). But a patch in 3.5-rc4 also
adds a new use of dev->agp. Hence the backmarge to sort this out, for
otherwise drm-intel-next merged into Linus' tree would conflict in the
relevant code, things would compile but nicely OOPS at driver load :(
Conflicts in this merge are just simple cases of "both branches
changed/added lines at the same place". The only tricky part is to
keep the order correct wrt the unwind code in case of errors in
intel_ringbuffer.c (and the MI_DISPLAY_FLIP #defines in i915_reg.h
together, obviously).
Conflicts:
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_ringbuffer.c
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index c3b5139eba7f..5873e481e5d2 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/export.h> | 33 | #include <linux/module.h> |
34 | #include "drmP.h" | 34 | #include "drmP.h" |
35 | #include "drm_edid.h" | 35 | #include "drm_edid.h" |
36 | #include "drm_edid_modes.h" | 36 | #include "drm_edid_modes.h" |
@@ -149,6 +149,10 @@ int drm_edid_header_is_valid(const u8 *raw_edid) | |||
149 | } | 149 | } |
150 | EXPORT_SYMBOL(drm_edid_header_is_valid); | 150 | EXPORT_SYMBOL(drm_edid_header_is_valid); |
151 | 151 | ||
152 | static int edid_fixup __read_mostly = 6; | ||
153 | module_param_named(edid_fixup, edid_fixup, int, 0400); | ||
154 | MODULE_PARM_DESC(edid_fixup, | ||
155 | "Minimum number of valid EDID header bytes (0-8, default 6)"); | ||
152 | 156 | ||
153 | /* | 157 | /* |
154 | * Sanity check the EDID block (base or extension). Return 0 if the block | 158 | * Sanity check the EDID block (base or extension). Return 0 if the block |
@@ -160,10 +164,13 @@ bool drm_edid_block_valid(u8 *raw_edid, int block) | |||
160 | u8 csum = 0; | 164 | u8 csum = 0; |
161 | struct edid *edid = (struct edid *)raw_edid; | 165 | struct edid *edid = (struct edid *)raw_edid; |
162 | 166 | ||
167 | if (edid_fixup > 8 || edid_fixup < 0) | ||
168 | edid_fixup = 6; | ||
169 | |||
163 | if (block == 0) { | 170 | if (block == 0) { |
164 | int score = drm_edid_header_is_valid(raw_edid); | 171 | int score = drm_edid_header_is_valid(raw_edid); |
165 | if (score == 8) ; | 172 | if (score == 8) ; |
166 | else if (score >= 6) { | 173 | else if (score >= edid_fixup) { |
167 | DRM_DEBUG("Fixing EDID header, your hardware may be failing\n"); | 174 | DRM_DEBUG("Fixing EDID header, your hardware may be failing\n"); |
168 | memcpy(raw_edid, edid_header, sizeof(edid_header)); | 175 | memcpy(raw_edid, edid_header, sizeof(edid_header)); |
169 | } else { | 176 | } else { |
@@ -603,7 +610,7 @@ static bool | |||
603 | drm_monitor_supports_rb(struct edid *edid) | 610 | drm_monitor_supports_rb(struct edid *edid) |
604 | { | 611 | { |
605 | if (edid->revision >= 4) { | 612 | if (edid->revision >= 4) { |
606 | bool ret; | 613 | bool ret = false; |
607 | drm_for_each_detailed_block((u8 *)edid, is_rb, &ret); | 614 | drm_for_each_detailed_block((u8 *)edid, is_rb, &ret); |
608 | return ret; | 615 | return ret; |
609 | } | 616 | } |