- Add support for default vga arb device selection

- Update libpciaccess VGA arb code for newer kernel API
This commit is contained in:
Dave Airlie 2009-08-03 06:05:24 +00:00
parent dc71c21f80
commit af0cce255c

View File

@ -1,6 +1,6 @@
diff -up libpciaccess-0.10.6/src/common_interface.c.da libpciaccess-0.10.6/src/common_interface.c
--- libpciaccess-0.10.6/src/common_interface.c.da 2009-08-03 09:57:13.000000000 +1000
+++ libpciaccess-0.10.6/src/common_interface.c 2009-08-03 09:57:21.000000000 +1000
--- libpciaccess-0.10.6/src/common_interface.c.da 2009-08-03 15:54:43.000000000 +1000
+++ libpciaccess-0.10.6/src/common_interface.c 2009-08-03 15:54:54.000000000 +1000
@@ -124,6 +124,21 @@ pci_device_is_boot_vga( struct pci_devic
}
@ -24,8 +24,8 @@ diff -up libpciaccess-0.10.6/src/common_interface.c.da libpciaccess-0.10.6/src/c
*
* Probes a PCI device to learn various information about the device. Before
diff -up /dev/null libpciaccess-0.10.6/src/common_vgaarb_stub.c
--- /dev/null 2009-08-03 09:43:13.273251881 +1000
+++ libpciaccess-0.10.6/src/common_vgaarb_stub.c 2009-08-03 09:57:21.000000000 +1000
--- /dev/null 2009-08-03 15:36:43.267252950 +1000
+++ libpciaccess-0.10.6/src/common_vgaarb_stub.c 2009-08-03 15:54:54.000000000 +1000
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2009 Tiago Vignatti
@ -101,8 +101,8 @@ diff -up /dev/null libpciaccess-0.10.6/src/common_vgaarb_stub.c
+ return 0;
+}
diff -up libpciaccess-0.10.6/src/linux_sysfs.c.da libpciaccess-0.10.6/src/linux_sysfs.c
--- libpciaccess-0.10.6/src/linux_sysfs.c.da 2009-08-03 09:57:13.000000000 +1000
+++ libpciaccess-0.10.6/src/linux_sysfs.c 2009-08-03 09:57:21.000000000 +1000
--- libpciaccess-0.10.6/src/linux_sysfs.c.da 2009-08-03 15:54:43.000000000 +1000
+++ libpciaccess-0.10.6/src/linux_sysfs.c 2009-08-03 15:54:54.000000000 +1000
@@ -78,6 +78,7 @@ static int pci_device_linux_sysfs_write(
pciaddr_t * bytes_written );
@ -143,9 +143,9 @@ diff -up libpciaccess-0.10.6/src/linux_sysfs.c.da libpciaccess-0.10.6/src/linux_
+ return 1;
+}
diff -up /dev/null libpciaccess-0.10.6/src/common_vgaarb.c
--- /dev/null 2009-08-03 09:43:13.273251881 +1000
+++ libpciaccess-0.10.6/src/common_vgaarb.c 2009-08-03 09:57:21.000000000 +1000
@@ -0,0 +1,314 @@
--- /dev/null 2009-08-03 15:36:43.267252950 +1000
+++ libpciaccess-0.10.6/src/common_vgaarb.c 2009-08-03 15:54:54.000000000 +1000
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2007 Paulo R. Zanoni, Tiago Vignatti
+ * 2009 Tiago Vignatti
@ -460,9 +460,18 @@ diff -up /dev/null libpciaccess-0.10.6/src/common_vgaarb.c
+
+ 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;
+}
diff -up libpciaccess-0.10.6/src/Makefile.am.da libpciaccess-0.10.6/src/Makefile.am
--- libpciaccess-0.10.6/src/Makefile.am.da 2009-04-18 15:01:36.000000000 +1000
+++ libpciaccess-0.10.6/src/Makefile.am 2009-08-03 09:57:21.000000000 +1000
+++ libpciaccess-0.10.6/src/Makefile.am 2009-08-03 15:54:54.000000000 +1000
@@ -45,6 +45,12 @@ if SOLARIS
OS_SUPPORT = solx_devfs.c pci_tools.h
endif
@ -485,8 +494,8 @@ diff -up libpciaccess-0.10.6/src/Makefile.am.da libpciaccess-0.10.6/src/Makefile
INCLUDES = -I$(top_srcdir)/include
diff -up libpciaccess-0.10.6/src/pciaccess_private.h.da libpciaccess-0.10.6/src/pciaccess_private.h
--- libpciaccess-0.10.6/src/pciaccess_private.h.da 2009-08-03 09:57:13.000000000 +1000
+++ libpciaccess-0.10.6/src/pciaccess_private.h 2009-08-03 09:57:21.000000000 +1000
--- libpciaccess-0.10.6/src/pciaccess_private.h.da 2009-08-03 15:54:43.000000000 +1000
+++ libpciaccess-0.10.6/src/pciaccess_private.h 2009-08-03 15:54:54.000000000 +1000
@@ -61,6 +61,7 @@ struct pci_system_methods {
int (*fill_capabilities)( struct pci_device * dev );
void (*enable)( struct pci_device *dev );
@ -507,8 +516,8 @@ diff -up libpciaccess-0.10.6/src/pciaccess_private.h.da libpciaccess-0.10.6/src/
extern struct pci_system * pci_sys;
diff -up libpciaccess-0.10.6/include/pciaccess.h.da libpciaccess-0.10.6/include/pciaccess.h
--- libpciaccess-0.10.6/include/pciaccess.h.da 2009-08-03 09:57:13.000000000 +1000
+++ libpciaccess-0.10.6/include/pciaccess.h 2009-08-03 09:57:21.000000000 +1000
--- libpciaccess-0.10.6/include/pciaccess.h.da 2009-08-03 15:54:43.000000000 +1000
+++ libpciaccess-0.10.6/include/pciaccess.h 2009-08-03 15:54:54.000000000 +1000
@@ -21,6 +21,31 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
@ -562,7 +571,7 @@ diff -up libpciaccess-0.10.6/include/pciaccess.h.da libpciaccess-0.10.6/include/
};
@@ -449,4 +481,26 @@ struct pci_pcmcia_bridge_info {
@@ -449,4 +481,28 @@ struct pci_pcmcia_bridge_info {
};
@ -587,5 +596,7 @@ diff -up libpciaccess-0.10.6/include/pciaccess.h.da libpciaccess-0.10.6/include/
+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 */