summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-05-29 08:49:08 (GMT)
committerDave Airlie <airlied@linux.ie>2006-05-29 08:49:08 (GMT)
commit56e004e5435c008728b1444b51d757da2e098976 (patch)
tree2c68226e34c739e1802aa07166ae0161ce72eb23 /drivers/video
parent080a416802153dbbb20ab4f4fa1225867096d071 (diff)
downloadlinux-56e004e5435c008728b1444b51d757da2e098976.tar.xz
intelfb: use firmware EDID for mode database
Use firmware EDID for the driver's private mode database. Signed-off-by: Antonino Daplas <adaplas@pol.net> Cc: Sylvain Meyer <sylvain.meyer@worldonline.fr> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/intelfb/intelfbdrv.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 65059ba3..dfe2abc 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -132,6 +132,7 @@
#include "intelfb.h"
#include "intelfbhw.h"
+#include "../edid.h"
static void __devinit get_initial_mode(struct intelfb_info *dinfo);
static void update_dinfo(struct intelfb_info *dinfo,
@@ -1031,13 +1032,42 @@ intelfb_init_var(struct intelfb_info *dinfo)
sizeof(struct fb_var_screeninfo));
msrc = 5;
} else {
+ const u8 *edid_s = fb_firmware_edid(&dinfo->pdev->dev);
+ u8 *edid_d = NULL;
+
+ if (edid_s) {
+ edid_d = kmalloc(128, GFP_KERNEL);
+
+ if (edid_d) {
+ memcpy(edid_d, edid_s, 128);
+ fb_edid_to_monspecs(edid_d,
+ &dinfo->info->monspecs);
+ kfree(edid_d);
+ }
+ }
+
if (mode) {
+ printk("intelfb: Looking for mode in private "
+ "database\n");
msrc = fb_find_mode(var, dinfo->info, mode,
- vesa_modes, VESA_MODEDB_SIZE,
+ dinfo->info->monspecs.modedb,
+ dinfo->info->monspecs.modedb_len,
NULL, 0);
- if (msrc)
- msrc |= 8;
+
+ if (msrc && msrc > 1) {
+ printk("intelfb: No mode in private database, "
+ "intelfb: looking for mode in global "
+ "database ");
+ msrc = fb_find_mode(var, dinfo->info, mode,
+ vesa_modes,
+ VESA_MODEDB_SIZE, NULL, 0);
+
+ if (msrc)
+ msrc |= 8;
+ }
+
}
+
if (!msrc) {
msrc = fb_find_mode(var, dinfo->info, PREFERRED_MODE,
vesa_modes, VESA_MODEDB_SIZE,