@@ -28,7 +28,6 @@
*/
#include <linux/fb.h>
#include <linux/module.h>
-#include <linux/pci.h>
#include <linux/slab.h>
#include <video/edid.h>
#include <video/of_videomode.h>
@@ -1482,31 +1481,21 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info)
}
#if defined(CONFIG_FIRMWARE_EDID) && defined(CONFIG_X86)
-
-/*
- * 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)
+const unsigned char *fb_firmware_edid(struct fb_info *info)
{
- 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)
+ /*
+ * We need to ensure that the EDID block is only
+ * returned for the primary graphics adapter.
+ */
+ if (fb_is_primary_device(info))
edid = edid_info.dummy;
return edid;
}
#else
-const unsigned char *fb_firmware_edid(struct device *device)
+const unsigned char *fb_firmware_edid(struct fb_info *info)
{
return NULL;
}
@@ -161,7 +161,7 @@ int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn)
if (conn < par->ddc_num) {
edid = fb_ddc_read(&par->chan[conn].adapter);
} else {
- const u8 *e = fb_firmware_edid(info->device);
+ const u8 *e = fb_firmware_edid(info);
if (e != NULL) {
DPRINTK("i810-i2c: Getting EDID from BIOS\n");
@@ -1024,7 +1024,7 @@ static int 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);
+ const u8 *edid_s = fb_firmware_edid(dinfo->info);
u8 *edid_d = NULL;
if (edid_s) {
@@ -159,7 +159,7 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
if (!edid && conn == 1) {
/* try to get from firmware */
- const u8 *e = fb_firmware_edid(info->device);
+ const u8 *e = fb_firmware_edid(info);
if (e != NULL)
edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL);
@@ -227,7 +227,7 @@ int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid)
if (!edid) {
/* try to get from firmware */
- const u8 *e = fb_firmware_edid(info->device);
+ const u8 *e = fb_firmware_edid(info);
if (e)
edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL);
@@ -761,7 +761,7 @@ extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
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 const unsigned char *fb_firmware_edid(struct device *device);
+extern const unsigned char *fb_firmware_edid(struct fb_info *info);
extern void fb_edid_to_monspecs(unsigned char *edid,
struct fb_monspecs *specs);
extern void fb_destroy_modedb(struct fb_videomode *modedb);
Detect the primary VGA device with fb_is_primary_device() in the implementation of fb_firmware_edid(). Remove the existing code. Adapt the function to receive an instance of struct fb_info and update all callers. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Helge Deller <deller@gmx.de> Cc: Antonino Daplas <adaplas@gmail.com> Cc: Maik Broemme <mbroemme@libmpq.org> Cc: Randy Dunlap <rdunlap@infradead.org> --- drivers/video/fbdev/core/fbmon.c | 25 +++++++---------------- drivers/video/fbdev/i810/i810-i2c.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 2 +- drivers/video/fbdev/nvidia/nv_i2c.c | 2 +- drivers/video/fbdev/savage/savagefb-i2c.c | 2 +- include/linux/fb.h | 2 +- 6 files changed, 12 insertions(+), 23 deletions(-)