Linux 4.18.10
[linux/fpc-iii.git] / arch / x86 / video / fbdev.c
blob9fd24846d0943628c565f20fccebb4062a019592
1 /*
2 * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
8 */
9 #include <linux/fb.h>
10 #include <linux/pci.h>
11 #include <linux/module.h>
12 #include <linux/vgaarb.h>
14 int fb_is_primary_device(struct fb_info *info)
16 struct device *device = info->device;
17 struct pci_dev *default_device = vga_default_device();
18 struct pci_dev *pci_dev;
19 struct resource *res;
21 if (!device || !dev_is_pci(device))
22 return 0;
24 pci_dev = to_pci_dev(device);
26 if (default_device) {
27 if (pci_dev == default_device)
28 return 1;
29 return 0;
32 res = pci_dev->resource + PCI_ROM_RESOURCE;
34 if (res->flags & IORESOURCE_ROM_SHADOW)
35 return 1;
37 return 0;
39 EXPORT_SYMBOL(fb_is_primary_device);
40 MODULE_LICENSE("GPL");