aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmon.c')
-rw-r--r--drivers/video/fbmon.c39
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
316static void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomode *mode) 317static 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
1265const 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
1283const unsigned char *fb_firmware_edid(struct device *device)
1284{
1285 return NULL;
1286}
1287#endif /* _i386_ */
1288
1254EXPORT_SYMBOL(fb_parse_edid); 1289EXPORT_SYMBOL(fb_parse_edid);
1255EXPORT_SYMBOL(fb_edid_to_monspecs); 1290EXPORT_SYMBOL(fb_edid_to_monspecs);
1256 1291EXPORT_SYMBOL(fb_firmware_edid);
1257EXPORT_SYMBOL(fb_get_mode); 1292EXPORT_SYMBOL(fb_get_mode);
1258EXPORT_SYMBOL(fb_validate_mode); 1293EXPORT_SYMBOL(fb_validate_mode);
1259EXPORT_SYMBOL(fb_destroy_modedb); 1294EXPORT_SYMBOL(fb_destroy_modedb);