Commit 475666d4f80f148a091fa20257fe2381223d3c62

Authored by Antonino A. Daplas
Committed by Linus Torvalds
1 parent 9127fa2859

[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>

Showing 1 changed file with 17 additions and 1 deletions Side-by-side Diff

drivers/video/fbmon.c
... ... @@ -827,7 +827,7 @@
827 827 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
828 828 {
829 829 unsigned char *block;
830   - int i;
  830 + int i, found = 0;
831 831  
832 832 if (edid == NULL)
833 833 return;
... ... @@ -869,6 +869,22 @@
869 869 get_monspecs(edid, specs);
870 870  
871 871 specs->modedb = fb_create_modedb(edid, &specs->modedb_len);
  872 +
  873 + /*
  874 + * Workaround for buggy EDIDs that sets that the first
  875 + * detailed timing is preferred but has not detailed
  876 + * timing specified
  877 + */
  878 + for (i = 0; i < specs->modedb_len; i++) {
  879 + if (specs->modedb[i].flag & FB_MODE_IS_DETAILED) {
  880 + found = 1;
  881 + break;
  882 + }
  883 + }
  884 +
  885 + if (!found)
  886 + specs->misc &= ~FB_MISC_1ST_DETAIL;
  887 +
872 888 DPRINTK("========================================\n");
873 889 }
874 890