The patch titled
fbdev: Resurrect hooks to get EDID from firmware
has been added to the -mm tree. Its filename is
fbdev-resurrect-hooks-to-get-edid-from-firmware.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
fbdev-add-fbset-a-support.patch
vesafb-add-blanking-support.patch
fbdev-resurrect-hooks-to-get-edid-from-firmware.patch
savagefb-driver-updates.patch
nvidiafb-fallback-to-firmware-edid.patch
fbdev-fix-greater-than-1-bit-monochrome-color-handling.patch
fbcon-saner-16-color-to-4-color-conversion.patch
console-fix-buffer-copy-on-vc-resize.patch
radeonfb_old-fix-broken-link.patch
fbdev-update-framebuffer-feature-list.patch
From: "Antonino A. Daplas" <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
arch/i386/boot/video.S | 2 +-
drivers/video/fbmon.c | 35 ++++++++++++++++++++++++++++++++++-
include/linux/fb.h | 4 +++-
3 files changed, 38 insertions(+), 3 deletions(-)
diff -puN
arch/i386/boot/video.S~fbdev-resurrect-hooks-to-get-edid-from-firmware
arch/i386/boot/video.S
---
devel/arch/i386/boot/video.S~fbdev-resurrect-hooks-to-get-edid-from-firmware
2005-08-21 21:53:51.000000000 -0700
+++ devel-akpm/arch/i386/boot/video.S 2005-08-21 21:53:51.000000000 -0700
@@ -1949,7 +1949,7 @@ store_edid:
movw $0x4f15, %ax # do VBE/DDC
movw $0x01, %bx
movw $0x00, %cx
- movw $0x01, %dx
+ movw $0x00, %dx
movw $0x140, %di
int $0x10
diff -puN drivers/video/fbmon.c~fbdev-resurrect-hooks-to-get-edid-from-firmware
drivers/video/fbmon.c
--- devel/drivers/video/fbmon.c~fbdev-resurrect-hooks-to-get-edid-from-firmware
2005-08-21 21:53:51.000000000 -0700
+++ devel-akpm/drivers/video/fbmon.c 2005-08-21 21:53:51.000000000 -0700
@@ -29,6 +29,7 @@
#include <linux/tty.h>
#include <linux/fb.h>
#include <linux/module.h>
+#include <video/edid.h>
#ifdef CONFIG_PPC_OF
#include <linux/pci.h>
#include <asm/prom.h>
@@ -1251,9 +1252,41 @@ int fb_validate_mode(const struct fb_var
-EINVAL : 0;
}
+#if defined(__i386__)
+#include <linux/pci.h>
+
+/*
+ * We need to ensure that the EDID block is only returned for
+ * the primary graphics adapter.
+ */
+
+const unsigned char *fb_firmware_edid(struct device *device)
+{
+ struct pci_dev *dev = NULL;
+ struct resource *res = NULL;
+ unsigned char *edid = NULL;
+
+ if (device)
+ dev = to_pci_dev(device);
+
+ if (dev)
+ res = &dev->resource[PCI_ROM_RESOURCE];
+
+ if (res && res->flags & IORESOURCE_ROM_SHADOW)
+ edid = edid_info.dummy;
+
+ return edid;
+}
+#else
+const unsigned char *fb_firmware_edid(struct device *device)
+{
+ return NULL;
+}
+#endif /* _i386_ */
+
EXPORT_SYMBOL(fb_parse_edid);
EXPORT_SYMBOL(fb_edid_to_monspecs);
-
+EXPORT_SYMBOL(fb_firmware_edid);
EXPORT_SYMBOL(fb_get_mode);
EXPORT_SYMBOL(fb_validate_mode);
EXPORT_SYMBOL(fb_destroy_modedb);
diff -puN include/linux/fb.h~fbdev-resurrect-hooks-to-get-edid-from-firmware
include/linux/fb.h
--- devel/include/linux/fb.h~fbdev-resurrect-hooks-to-get-edid-from-firmware
2005-08-21 21:53:51.000000000 -0700
+++ devel-akpm/include/linux/fb.h 2005-08-21 21:53:51.000000000 -0700
@@ -859,7 +859,9 @@ extern int fb_get_mode(int flags, u32 va
extern int fb_validate_mode(const struct fb_var_screeninfo *var,
struct fb_info *info);
extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);
-extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs
*specs);
+extern const unsigned char *fb_firmware_edid(struct device *device);
+extern void fb_edid_to_monspecs(unsigned char *edid,
+ struct fb_monspecs *specs);
extern void fb_destroy_modedb(struct fb_videomode *modedb);
/* drivers/video/modedb.c */
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html