aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-09-09 16:04:34 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:59 -0400
commit5e518d7672dea4cd7c60871e40d0490c52f01d13 (patch)
treea97dc33b2ce9a0553fb6b9b3206ee7674ae4d06a
parent53eed4ec8bcd8701b9135859ec46b10a0d88ba25 (diff)
[PATCH] fbdev: Resurrect hooks to get EDID from firmware
For the i386, code is already present in video.S that gets the EDID from the video BIOS. Make this visible so drivers can also use this data as fallback when i2c does not work. To ensure that the EDID block is returned for the primary graphics adapter only, by check if the IORESOURCE_ROM_SHADOW flag is set. 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--arch/i386/boot/video.S2
-rw-r--r--arch/i386/kernel/setup.c1
-rw-r--r--drivers/video/fbmon.c35
-rw-r--r--include/linux/fb.h4
4 files changed, 39 insertions, 3 deletions
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 02bf625a681b..92f669470142 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -1949,7 +1949,7 @@ store_edid:
1949 movw $0x4f15, %ax # do VBE/DDC 1949 movw $0x4f15, %ax # do VBE/DDC
1950 movw $0x01, %bx 1950 movw $0x01, %bx
1951 movw $0x00, %cx 1951 movw $0x00, %cx
1952 movw $0x01, %dx 1952 movw $0x00, %dx
1953 movw $0x140, %di 1953 movw $0x140, %di
1954 int $0x10 1954 int $0x10
1955 1955
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index a659d274914c..fa0c69eb937a 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -139,6 +139,7 @@ struct sys_desc_table_struct {
139 unsigned char table[0]; 139 unsigned char table[0];
140}; 140};
141struct edid_info edid_info; 141struct edid_info edid_info;
142EXPORT_SYMBOL_GPL(edid_info);
142struct ist_info ist_info; 143struct ist_info ist_info;
143#if defined(CONFIG_X86_SPEEDSTEP_SMI) || \ 144#if defined(CONFIG_X86_SPEEDSTEP_SMI) || \
144 defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE) 145 defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index c2718bb94949..791bec3d672a 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>
@@ -1251,9 +1252,41 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info)
1251 -EINVAL : 0; 1252 -EINVAL : 0;
1252} 1253}
1253 1254
1255#if defined(__i386__)
1256#include <linux/pci.h>
1257
1258/*
1259 * We need to ensure that the EDID block is only returned for
1260 * the primary graphics adapter.
1261 */
1262
1263const unsigned char *fb_firmware_edid(struct device *device)
1264{
1265 struct pci_dev *dev = NULL;
1266 struct resource *res = NULL;
1267 unsigned char *edid = NULL;
1268
1269 if (device)
1270 dev = to_pci_dev(device);
1271
1272 if (dev)
1273 res = &dev->resource[PCI_ROM_RESOURCE];
1274
1275 if (res && res->flags & IORESOURCE_ROM_SHADOW)
1276 edid = edid_info.dummy;
1277
1278 return edid;
1279}
1280#else
1281const unsigned char *fb_firmware_edid(struct device *device)
1282{
1283 return NULL;
1284}
1285#endif /* _i386_ */
1286
1254EXPORT_SYMBOL(fb_parse_edid); 1287EXPORT_SYMBOL(fb_parse_edid);
1255EXPORT_SYMBOL(fb_edid_to_monspecs); 1288EXPORT_SYMBOL(fb_edid_to_monspecs);
1256 1289EXPORT_SYMBOL(fb_firmware_edid);
1257EXPORT_SYMBOL(fb_get_mode); 1290EXPORT_SYMBOL(fb_get_mode);
1258EXPORT_SYMBOL(fb_validate_mode); 1291EXPORT_SYMBOL(fb_validate_mode);
1259EXPORT_SYMBOL(fb_destroy_modedb); 1292EXPORT_SYMBOL(fb_destroy_modedb);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 70da819df0f5..e3e16f43b1bb 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -859,7 +859,9 @@ extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
859extern int fb_validate_mode(const struct fb_var_screeninfo *var, 859extern int fb_validate_mode(const struct fb_var_screeninfo *var,
860 struct fb_info *info); 860 struct fb_info *info);
861extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); 861extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);
862extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); 862extern const unsigned char *fb_firmware_edid(struct device *device);
863extern void fb_edid_to_monspecs(unsigned char *edid,
864 struct fb_monspecs *specs);
863extern void fb_destroy_modedb(struct fb_videomode *modedb); 865extern void fb_destroy_modedb(struct fb_videomode *modedb);
864 866
865/* drivers/video/modedb.c */ 867/* drivers/video/modedb.c */