summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-11-07 01:00:46 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 07:53:51 -0800
commit475666d4f80f148a091fa20257fe2381223d3c62 (patch)
tree87c64e09e2d6e26b56eb04d20de4236da4bcb812
parent9127fa28595093a146fc3e2c937747e014e4bfa2 (diff)
[PATCH] fbdev: Workaround for buggy EDID blocks
Some EDID blocks set the flag "prefer first detailed timing" without providing any detailed timing at all. Clear this flag if the block does not provide detailed timings. Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/video/fbmon.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 713226cdf3c..442a52d1091 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -827,7 +827,7 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
{
unsigned char *block;
- int i;
+ int i, found = 0;
if (edid == NULL)
return;
@@ -869,6 +869,22 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
get_monspecs(edid, specs);
specs->modedb = fb_create_modedb(edid, &specs->modedb_len);
+
+ /*
+ * Workaround for buggy EDIDs that sets that the first
+ * detailed timing is preferred but has not detailed
+ * timing specified
+ */
+ for (i = 0; i < specs->modedb_len; i++) {
+ if (specs->modedb[i].flag & FB_MODE_IS_DETAILED) {
+ found = 1;
+ break;
+ }
+ }
+
+ if (!found)
+ specs->misc &= ~FB_MISC_1ST_DETAIL;
+
DPRINTK("========================================\n");
}