diff options
Diffstat (limited to 'drivers/video/fbmon.c')
-rw-r--r-- | drivers/video/fbmon.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c index c2718bb94949..713226cdf3c6 100644 --- a/drivers/video/fbmon.c +++ b/drivers/video/fbmon.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
30 | #include <linux/fb.h> | 30 | #include <linux/fb.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <video/edid.h> | ||
32 | #ifdef CONFIG_PPC_OF | 33 | #ifdef CONFIG_PPC_OF |
33 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
34 | #include <asm/prom.h> | 35 | #include <asm/prom.h> |
@@ -313,11 +314,13 @@ static int edid_is_monitor_block(unsigned char *block) | |||
313 | return 0; | 314 | return 0; |
314 | } | 315 | } |
315 | 316 | ||
316 | static void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomode *mode) | 317 | static void calc_mode_timings(int xres, int yres, int refresh, |
318 | struct fb_videomode *mode) | ||
317 | { | 319 | { |
318 | struct fb_var_screeninfo var; | 320 | struct fb_var_screeninfo var; |
319 | struct fb_info info; | 321 | struct fb_info info; |
320 | 322 | ||
323 | memset(&var, 0, sizeof(struct fb_var_screeninfo)); | ||
321 | var.xres = xres; | 324 | var.xres = xres; |
322 | var.yres = yres; | 325 | var.yres = yres; |
323 | fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, | 326 | fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, |
@@ -1251,9 +1254,41 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info) | |||
1251 | -EINVAL : 0; | 1254 | -EINVAL : 0; |
1252 | } | 1255 | } |
1253 | 1256 | ||
1257 | #if defined(__i386__) | ||
1258 | #include <linux/pci.h> | ||
1259 | |||
1260 | /* | ||
1261 | * We need to ensure that the EDID block is only returned for | ||
1262 | * the primary graphics adapter. | ||
1263 | */ | ||
1264 | |||
1265 | const unsigned char *fb_firmware_edid(struct device *device) | ||
1266 | { | ||
1267 | struct pci_dev *dev = NULL; | ||
1268 | struct resource *res = NULL; | ||
1269 | unsigned char *edid = NULL; | ||
1270 | |||
1271 | if (device) | ||
1272 | dev = to_pci_dev(device); | ||
1273 | |||
1274 | if (dev) | ||
1275 | res = &dev->resource[PCI_ROM_RESOURCE]; | ||
1276 | |||
1277 | if (res && res->flags & IORESOURCE_ROM_SHADOW) | ||
1278 | edid = edid_info.dummy; | ||
1279 | |||
1280 | return edid; | ||
1281 | } | ||
1282 | #else | ||
1283 | const unsigned char *fb_firmware_edid(struct device *device) | ||
1284 | { | ||
1285 | return NULL; | ||
1286 | } | ||
1287 | #endif /* _i386_ */ | ||
1288 | |||
1254 | EXPORT_SYMBOL(fb_parse_edid); | 1289 | EXPORT_SYMBOL(fb_parse_edid); |
1255 | EXPORT_SYMBOL(fb_edid_to_monspecs); | 1290 | EXPORT_SYMBOL(fb_edid_to_monspecs); |
1256 | 1291 | EXPORT_SYMBOL(fb_firmware_edid); | |
1257 | EXPORT_SYMBOL(fb_get_mode); | 1292 | EXPORT_SYMBOL(fb_get_mode); |
1258 | EXPORT_SYMBOL(fb_validate_mode); | 1293 | EXPORT_SYMBOL(fb_validate_mode); |
1259 | EXPORT_SYMBOL(fb_destroy_modedb); | 1294 | EXPORT_SYMBOL(fb_destroy_modedb); |