diff options
author | Dave Airlie <airlied@redhat.com> | 2009-08-03 12:43:26 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-08-03 15:54:25 +1000 |
commit | 7b7999a302c70f1ad9a5c8fc7517e24ab95c3a95 (patch) | |
tree | 585f0b9cd655a5ee89762d0d60ea4653b3b79ba0 | |
parent | 3a6c1be79c05517cfddbce88157bb352237058ab (diff) |
vgaarb: add vga count + resource accessor
-rw-r--r-- | include/pciaccess.h | 2 | ||||
-rw-r--r-- | src/common_vgaarb.c | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/pciaccess.h b/include/pciaccess.h index 71c831e..067954f 100644 --- a/include/pciaccess.h +++ b/include/pciaccess.h @@ -502,5 +502,7 @@ int pci_device_vgaarb_decodes (int new_vga_rsrc); int pci_device_vgaarb_lock (void); int pci_device_vgaarb_trylock (void); int pci_device_vgaarb_unlock (void); +/* return the current device count + resource decodes for the device */ +int pci_device_vgaarb_get_info (struct pci_device *dev, int *vga_count, int *rsrc_decodes); #endif /* PCIACCESS_H */ diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c index 1978ce3..89cc0ce 100644 --- a/src/common_vgaarb.c +++ b/src/common_vgaarb.c @@ -312,3 +312,12 @@ pci_device_vgaarb_unlock(void) return vgaarb_write(pci_sys->vgaarb_fd, buf, len); } + +int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc_decodes) +{ + *vga_count = pci_sys->vga_count; + if (!dev) + return 0; + *rsrc_decodes = dev->vgaarb_rsrc; + return 0; +} |