Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
awilliam
GitHub Repository: awilliam/linux-vfio
Path: blob/master/arch/x86/video/fbdev.c
10820 views
1
/*
2
* Copyright (C) 2007 Antonino Daplas <[email protected]>
3
*
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.
7
*
8
*/
9
#include <linux/fb.h>
10
#include <linux/pci.h>
11
12
int fb_is_primary_device(struct fb_info *info)
13
{
14
struct device *device = info->device;
15
struct pci_dev *pci_dev = NULL;
16
struct resource *res = NULL;
17
int retval = 0;
18
19
if (device)
20
pci_dev = to_pci_dev(device);
21
22
if (pci_dev)
23
res = &pci_dev->resource[PCI_ROM_RESOURCE];
24
25
if (res && res->flags & IORESOURCE_ROM_SHADOW)
26
retval = 1;
27
28
return retval;
29
}
30
EXPORT_SYMBOL(fb_is_primary_device);
31
MODULE_LICENSE("GPL");
32
33