Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307091
b: refs/heads/master
c: 8867408
h: refs/heads/master
i:
  307089: 592d815
  307087: 3a6dd9b
v: v3
  • Loading branch information
Matthew Garrett authored and Dave Airlie committed Apr 24, 2012
1 parent 3f50619 commit 8bc5e79
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fbe8c7c3ebfed2059a6597322bb0dbc4d96feb5
refs/heads/master: 88674088d10ca2538b2efd2559f6620ade8ec373
20 changes: 15 additions & 5 deletions trunk/arch/x86/video/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,34 @@
#include <linux/fb.h>
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/vgaarb.h>

int fb_is_primary_device(struct fb_info *info)
{
struct device *device = info->device;
struct pci_dev *pci_dev = NULL;
struct pci_dev *default_device = vga_default_device();
struct resource *res = NULL;
int retval = 0;

if (device)
pci_dev = to_pci_dev(device);

if (pci_dev)
res = &pci_dev->resource[PCI_ROM_RESOURCE];
if (!pci_dev)
return 0;

if (default_device) {
if (pci_dev == default_device)
return 1;
else
return 0;
}

res = &pci_dev->resource[PCI_ROM_RESOURCE];

if (res && res->flags & IORESOURCE_ROM_SHADOW)
retval = 1;
return 1;

return retval;
return 0;
}
EXPORT_SYMBOL(fb_is_primary_device);
MODULE_LICENSE("GPL");

0 comments on commit 8bc5e79

Please sign in to comment.