ChangeLog | 307 ++++++++++++++++++++++++++++++ configure.ac | 10 debian/changelog | 8 debian/libpciaccess0.shlibs | 1 debian/libpciaccess0.symbols | 10 debian/patches/pciaccess-hurd-hack.diff | 10 debian/rules | 2 include/pciaccess.h | 58 +++++ src/Makefile.am | 9 src/common_bridge.c | 4 src/common_device_name.c | 2 src/common_interface.c | 29 ++ src/common_vgaarb.c | 324 ++++++++++++++++++++++++++++++++ src/common_vgaarb_stub.c | 79 +++++++ src/linux_sysfs.c | 57 +++++ src/pciaccess_private.h | 6 16 files changed, 906 insertions(+), 10 deletions(-)
New commits: commit a0ebb3e46edd2c2b02e79a481c81aa07fbebcf5f Author: Julien Cristau <jcris...@debian.org> Date: Sun Sep 13 21:02:46 2009 +0200 Update shlibs and symbols file. diff --git a/debian/changelog b/debian/changelog index b666f9a..f98178d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ libpciaccess (0.10.8-1) UNRELEASED; urgency=low * New upstream release. * Refresh pciaccess-hurd-hack.diff. + * Update shlibs and symbols file. -- Julien Cristau <jcris...@debian.org> Sun, 13 Sep 2009 20:54:37 +0200 diff --git a/debian/libpciaccess0.shlibs b/debian/libpciaccess0.shlibs deleted file mode 100644 index 213a640..0000000 --- a/debian/libpciaccess0.shlibs +++ /dev/null @@ -1 +0,0 @@ -libpciaccess 0 libpciaccess0 (>= 0.10.2) diff --git a/debian/libpciaccess0.symbols b/debian/libpciaccess0.symbols index f36b279..618a695 100644 --- a/debian/libpciaccess0.symbols +++ b/debian/libpciaccess0.symbols @@ -12,6 +12,14 @@ libpciaccess.so.0 libpciaccess0 #MINVER# pci_device_pr...@base 0 pci_device_cfg_wr...@base 0 pci_device_unmap_reg...@base 0 + pci_device_vgaarb_deco...@base 0.10.7 + pci_device_vgaarb_f...@base 0.10.7 + pci_device_vgaarb_get_i...@base 0.10.7 + pci_device_vgaarb_i...@base 0.10.7 + pci_device_vgaarb_l...@base 0.10.7 + pci_device_vgaarb_set_tar...@base 0.10.7 + pci_device_vgaarb_tryl...@base 0.10.7 + pci_device_vgaarb_unl...@base 0.10.7 pci_device_cfg_read_...@base 0 pci_device_get_device_n...@base 0 pci_device_find_by_s...@base 0 @@ -33,4 +41,6 @@ libpciaccess.so.0 libpciaccess0 #MINVER# pci_device_get_bridge_bu...@base 0 pci_device_cfg_write_b...@base 0 pci_device_get_vendor_n...@base 0 + pci_device_has_kernel_dri...@base 0.10.7 + pci_device_is_boot_...@base 0.10.7 pci_device_cfg_r...@base 0 diff --git a/debian/rules b/debian/rules index 3ec1062..672d359 100755 --- a/debian/rules +++ b/debian/rules @@ -83,7 +83,7 @@ binary-arch: build install dh_strip #--dbg-package=$(PACKAGE)-dbg dh_compress dh_fixperms - dh_makeshlibs + dh_makeshlibs -- -V'libpciaccess0 (>= 0.10.7)' dh_shlibdeps dh_installdeb dh_gencontrol commit 30d9b264c891a75f78b1488817016d5c555a92a4 Author: Julien Cristau <jcris...@debian.org> Date: Sun Sep 13 20:57:11 2009 +0200 Refresh pciaccess-hurd-hack.diff. diff --git a/debian/changelog b/debian/changelog index 826daa1..b666f9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ libpciaccess (0.10.8-1) UNRELEASED; urgency=low * New upstream release. + * Refresh pciaccess-hurd-hack.diff. -- Julien Cristau <jcris...@debian.org> Sun, 13 Sep 2009 20:54:37 +0200 diff --git a/debian/patches/pciaccess-hurd-hack.diff b/debian/patches/pciaccess-hurd-hack.diff index 80e0fa8..a278712 100644 --- a/debian/patches/pciaccess-hurd-hack.diff +++ b/debian/patches/pciaccess-hurd-hack.diff @@ -9,8 +9,8 @@ Index: libpciaccess/src/Makefile.am =================================================================== --- libpciaccess.orig/src/Makefile.am +++ libpciaccess/src/Makefile.am -@@ -45,6 +45,10 @@ - OS_SUPPORT = solx_devfs.c pci_tools.h +@@ -51,6 +51,10 @@ + VGA_ARBITER = common_vgaarb_stub.c endif +if GNU @@ -24,7 +24,7 @@ Index: libpciaccess/configure.ac =================================================================== --- libpciaccess.orig/configure.ac +++ libpciaccess/configure.ac -@@ -81,6 +81,9 @@ +@@ -89,6 +89,9 @@ solaris=yes PCIACCESS_LIBS="$PCIACCESS_LIBS -ldevinfo" ;; @@ -34,7 +34,7 @@ Index: libpciaccess/configure.ac esac AM_CONDITIONAL(LINUX, [test "x$linux" = xyes]) -@@ -88,6 +91,7 @@ +@@ -96,6 +99,7 @@ AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes]) AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes]) AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes]) @@ -59,7 +59,7 @@ Index: libpciaccess/src/pciaccess_private.h =================================================================== --- libpciaccess.orig/src/pciaccess_private.h +++ libpciaccess/src/pciaccess_private.h -@@ -140,3 +140,4 @@ +@@ -146,3 +146,4 @@ extern int pci_system_openbsd_create( void ); extern void pci_system_openbsd_init_dev_mem( int ); extern int pci_system_solx_devfs_create( void ); commit c62793a7df39019c0e848b0cdcebc4a84681fe57 Author: Julien Cristau <jcris...@debian.org> Date: Sun Sep 13 20:55:59 2009 +0200 Bump changelogs diff --git a/ChangeLog b/ChangeLog index 582f4be..a83fd4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,310 @@ +commit 312cde3c2f3530b031134cfb53a8a54731f02b1b +Author: Dave Airlie <airl...@redhat.com> +Date: Mon Aug 31 09:14:16 2009 +1000 + + pciaccess: bump to 0.10.8 + +commit 566a67767e9fea463c24421d99dc12db590a7b5f +Author: Thomas Klausner <w...@netbsd.org> +Date: Mon Aug 31 09:13:27 2009 +1000 + + pciaccess: fix vga arb stubs + +commit d062dd78baeb28ef2cc59f4fb4a7d82ecd5adf60 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Aug 28 11:29:00 2009 +1000 + + libpciaccess: bump to 0.10.7 for vga arb interface addition + +commit 81b4705525bdf82d75f5b3c740c53fa4a866d9c3 +Merge: f514852 2f997f9 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Aug 28 11:25:15 2009 +1000 + + Merge branch 'vga' + +commit 2f997f90c8d0b54baab85285703550e8df28325e +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Aug 28 11:24:53 2009 +1000 + + vgaarb: update stub interface + +commit b229acdfd10fd61f46d8e711910b5c1bdb727857 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Aug 28 11:21:11 2009 +1000 + + Revert "vgaarb: delete stub functions" + + This reverts commit b7fd4d06890d801aae93fe1a1af7ab110fd388fd. + +commit e70767cb2e574f8544a04903eea3afee33345eea +Author: Tiago Vignatti <tiago.vigna...@nokia.com> +Date: Wed Aug 26 11:14:03 2009 +0300 + + Revert "vgaarb: fix pci_device_vgaarb_get_info() return value." + + This reverts commit ef8aca5da46155e9ea0d1227215921ad9ce59150. + +commit f5148525d546015c12b703a768b5e6c3726446a3 +Merge: 7636348 ef8aca5 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Aug 21 13:27:11 2009 +1000 + + Merge remote branch 'origin/vga-arbiter' + +commit ef8aca5da46155e9ea0d1227215921ad9ce59150 +Author: Tiago Vignatti <tiago.vigna...@nokia.com> +Date: Sun Aug 16 19:11:15 2009 +0300 + + vgaarb: fix pci_device_vgaarb_get_info() return value. + + Signed-off-by: Tiago Vignatti <tiago.vigna...@nokia.com> + +commit 25be96885671d22ee3f932769d72cf3a31f355ee +Author: Tiago Vignatti <tiago.vigna...@nokia.com> +Date: Sun Aug 16 19:09:35 2009 +0300 + + vgaarb: fix indentation and remove trailing white spaces + + Signed-off-by: Tiago Vignatti <tiago.vigna...@nokia.com> + +commit b7fd4d06890d801aae93fe1a1af7ab110fd388fd +Author: Tiago Vignatti <tiago.vigna...@nokia.com> +Date: Sun Aug 16 18:59:21 2009 +0300 + + vgaarb: delete stub functions + + Such stub functions is already with API outdated. Moreover, if some operating + system doesn't have arbiter's implementation then the app can set some + autoconf tricks like "ifdef HAVE_PCI_DEVICE_VGAARB_INIT". + + Signed-off-by: Tiago Vignatti <tiago.vigna...@nokia.com> + +commit 76363486864b325b8f156ece35736ddb64c4e697 +Author: Julien Cristau <jcris...@debian.org> +Date: Sun Aug 9 11:28:38 2009 +0200 + + Silence compiler warning about pci_id_file_open definition + + src/common_device_name.c:59: warning: function declaration isn't a prototype + src/common_device_name.c: In function 'pci_id_file_open': + src/common_device_name.c:59: warning: old-style function definition + +commit 4eac0173588ab9ef67fcadb47b531abb114aa0a7 +Author: Julien Cristau <jcris...@debian.org> +Date: Sat Aug 8 18:12:08 2009 +0200 + + configure.ac: fix help text for the linux-rom-fallback option + + LINUX_ROM defaults to no, fix the help text to reflect that + + Signed-off-by: Julien Cristau <jcris...@debian.org> + +commit e9f2db8b867cba8d91a040a0db9be56099fba680 +Merge: 706201e dedd31b +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Aug 6 09:43:08 2009 +1000 + + Merge branch 'master' into vga-arbiter + +commit dedd31b3bcdeea12955bf565b8e3f2a9d3c66057 +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Aug 6 09:39:01 2009 +1000 + + pciaccess: make linux rom reading fallback optional + + On kernels which have ROM files, the boot VGA rom file + will contain the 0xc0000 file anyways. If another card + is missing a rom file there is no need for this. + + This is fallback is disabled by default, on the premise + that distro shipping this new a pciaccess will be running + on kernels with working rom support which is been upstream + for a long time + +commit 706201e900b5664ea35ec498784590275b98c23a +Merge: 57cf6f1 8aa06cf +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Aug 6 09:42:06 2009 +1000 + + Merge branch 'master' into vga-arbiter + +commit 8aa06cf7ef5e88c53bf6778336ba1a6036b16cc0 +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Aug 6 09:39:01 2009 +1000 + + pciaccess: make linux rom reading fallback optional + + On kernels which have ROM files, the boot VGA rom file + will contain the 0xc0000 file anyways. If another card + is missing a rom file there is no need for this. + + This is fallback is disabled by default, on the premise + that distro shipping this new a pciaccess will be running + on kernels with working rom support which is been upstream + for a long time + +commit 57cf6f1f428ab73fb2a88c39c694e7d14c2c96c6 +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Aug 6 09:39:01 2009 +1000 + + pciaccess: make linux rom reading fallback optional + + On kernels which have ROM files, the boot VGA rom file + will contain the 0xc0000 file anyways. If another card + is missing a rom file there is no need for this. + + This is fallback is disabled by default, on the premise + that distro shipping this new a pciaccess will be running + on kernels with working rom support which is been upstream + for a long time + +commit 7b7999a302c70f1ad9a5c8fc7517e24ab95c3a95 +Author: Dave Airlie <airl...@redhat.com> +Date: Mon Aug 3 12:43:26 2009 +1000 + + vgaarb: add vga count + resource accessor + +commit 3a6c1be79c05517cfddbce88157bb352237058ab +Author: Dave Airlie <airl...@redhat.com> +Date: Mon Aug 3 09:39:22 2009 +1000 + + vgaarb: more api changes + cleanup + + add a comma for ease of parsing, + use hex on the interface in both directions instead of hex on one + and decimal on the other + +commit e5127339c6c48ae6f63f9dc841a94fe960d11496 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Jul 31 16:15:55 2009 +1000 + + vgaarb: change API to target taking a device + lock/unlock not taking one + + working on the target device - a target device of NULL + reselects the target that existed when we started. + + this is mainly to allow a udev posting tool to return to the + state of what happened before it ran. + +commit 0596c559af5ca277a069b04a6402d21724464cda +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Jul 31 15:34:32 2009 +1000 + + vgaarb: add support for targetting default device + +commit 453928b8485bc7beff69996abe12628efc09405f +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Jul 31 11:17:21 2009 +1000 + + vgaarb: clean up debug output + +commit d22d7c0d5e48d130c89282514e378819e0b98636 +Merge: e360c11 2bda5b7 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Jul 31 11:16:16 2009 +1000 + + Merge remote branch 'main/master' into vga-arbiter + +commit e360c11c37a219534bfd7266caf163870dddced0 +Author: Dave Airlie <airl...@redhat.com> +Date: Mon Jul 20 13:26:41 2009 +1000 + + vgaarb: fixup api for new count reporting + decodes interface was wrong. + + decodes is a information setting interface so it takes new decodes + and sends them to the kernel + +commit 5d1bdf0cb51c19efd6e2b2c0a463ace9443c48d9 +Author: Dave Airlie <airl...@redhat.com> +Date: Thu Jul 16 15:36:30 2009 +1000 + + add support for finding if something has a kernel driver + +commit 2bda5b733bb12854760750c08138db95e77aea0c +Author: Jesse Barnes <jbar...@virtuousgeek.org> +Date: Tue Jun 30 15:24:45 2009 -0700 + + Don't try to use bogus bridge data + + If, for whatever reason, we weren't able to read bridge data (therefore + leaving bridge.pci or bridge.pcmcia empty), we shouldn't try to look at + the bus data inside the pci/pcmcia struct. + +commit 9ae22c87743c624bda593a1ef4bd4eca01c65655 +Author: Dave Airlie <airl...@redhat.com> +Date: Fri Jun 5 09:32:10 2009 +1000 + + vgaarb: fixup api and decode rsrc. + + This fixes up the API and stores the vga arb fd in the sys_pci structure, + instead of hiding it in a random dev struct. + + It also reads back after setting the target and works out the decodes. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit 9ae66143550a6aee25d9a9620c5bebf93fa196e5 +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Thu May 14 17:30:17 2009 -0300 + + Comment typo. + +commit 6ae00a992714639fd725efd8817dca69b28276c8 +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Thu May 14 17:28:05 2009 -0300 + + Reorganize the code. + +commit 6ef4e7aebfd2b83e2346e9f8f4ef3c890a6ea73d +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Thu May 14 03:42:56 2009 -0300 + + Fix typo in vgaarb stubs. + +commit 18a186804bc4e496a392cb31003cef25798f6c7b +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Thu May 14 03:40:25 2009 -0300 + + Delete vga_arb_rec. + +commit 812ad80018d49f6e4f1be8256d86488690c3ba52 +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Wed May 13 18:31:09 2009 -0300 + + vgaarb: a bunch of clean ups to fit in libpciaccess style. + +commit b77b0fc3fbacc46d55998889f09326d1233339fc +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Wed May 13 17:55:31 2009 -0300 + + vgaarb: make it compile. + +commit 67af888bcc5667eadf1e9e9bf15305f742416daf +Author: Tiago Vignatti <vigna...@freedesktop.org> +Date: Wed May 13 17:44:46 2009 -0300 + + Import libvgaaccess (VGA Arbiter) implementation from C3SL repository: + http://git.c3sl.ufpr.br/ + +commit 8ba6b02ecfa5b03bbf2807e8262bb1253a026493 +Author: Aaron Plattner <aplatt...@nvidia.com> +Date: Fri May 1 15:04:19 2009 -0700 + + Don't try to write boot_vga since that fails with EACCES + +commit b2838fb61c3542f107014b285cbda097acae1e12 +Author: Dave Airlie <airl...@redhat.com> +Date: Wed Mar 4 15:55:11 2009 +1000 + + pciaccess: provide a method to detect if a device is boot VGA + + When the linux kernel exposes this information, we can use this interface + in the X server to detect whether the kernel believes the device we + are looking at is the boot VGA device. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + commit f14c6cd626273bd2f8b102ff661d11926619a99b Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Fri Apr 24 16:32:12 2009 -0700 diff --git a/debian/changelog b/debian/changelog index d4d22dd..826daa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libpciaccess (0.10.8-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Julien Cristau <jcris...@debian.org> Sun, 13 Sep 2009 20:54:37 +0200 + libpciaccess (0.10.6-2) unstable; urgency=low * Apply patch from Samuel Thibault to tinker with I/O ports on systems commit 312cde3c2f3530b031134cfb53a8a54731f02b1b Author: Dave Airlie <airl...@redhat.com> Date: Mon Aug 31 09:14:16 2009 +1000 pciaccess: bump to 0.10.8 diff --git a/configure.ac b/configure.ac index 403c120..05d5b67 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(libpciaccess, 0.10.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess) +AC_INIT(libpciaccess, 0.10.8, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index c06959e..4dd7a5f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,7 +66,7 @@ INCLUDES = -I$(top_srcdir)/include libpciaccess_la_LIBADD = @PCIACCESS_LIBS@ -libpciaccess_la_LDFLAGS = -version-number 0:10:7 -no-undefined +libpciaccess_la_LDFLAGS = -version-number 0:10:8 -no-undefined libpciaccessincludedir = $(includedir) libpciaccessinclude_HEADERS = \ commit 566a67767e9fea463c24421d99dc12db590a7b5f Author: Thomas Klausner <w...@netbsd.org> Date: Mon Aug 31 09:13:27 2009 +1000 pciaccess: fix vga arb stubs diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c index 764733b..9394273 100644 --- a/src/common_vgaarb_stub.c +++ b/src/common_vgaarb_stub.c @@ -67,7 +67,7 @@ pci_device_vgaarb_trylock(void) } int -pci_device_vgaarb_unlock(void); +pci_device_vgaarb_unlock(void) { return 0; } commit d062dd78baeb28ef2cc59f4fb4a7d82ecd5adf60 Author: Dave Airlie <airl...@redhat.com> Date: Fri Aug 28 11:29:00 2009 +1000 libpciaccess: bump to 0.10.7 for vga arb interface addition diff --git a/configure.ac b/configure.ac index 34470eb..403c120 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(libpciaccess, 0.10.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess) +AC_INIT(libpciaccess, 0.10.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0de6894..c06959e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,7 +66,7 @@ INCLUDES = -I$(top_srcdir)/include libpciaccess_la_LIBADD = @PCIACCESS_LIBS@ -libpciaccess_la_LDFLAGS = -version-number 0:10:2 -no-undefined +libpciaccess_la_LDFLAGS = -version-number 0:10:7 -no-undefined libpciaccessincludedir = $(includedir) libpciaccessinclude_HEADERS = \ commit 2f997f90c8d0b54baab85285703550e8df28325e Author: Dave Airlie <airl...@redhat.com> Date: Fri Aug 28 11:24:53 2009 +1000 vgaarb: update stub interface diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c index 5fc5dfe..764733b 100644 --- a/src/common_vgaarb_stub.c +++ b/src/common_vgaarb_stub.c @@ -28,46 +28,52 @@ #include "pciaccess.h" int -pci_device_vgaarb_init(struct pci_device *dev) +pci_device_vgaarb_init(void) { #ifdef DEBUG fprintf(stderr, "%s: You're using VGA arbiter stub functions!\n", __FUNCTION__); #endif - return 0; + return -1; } void -pci_device_vgaarb_fini(struct pci_device *dev) +pci_device_vgaarb_fini(void) { } int pci_device_vgaarb_set_target(struct pci_device *dev) { - return 0; + return -1; } int -pci_device_vgaarb_decodes(struct pci_device *dev) +pci_device_vgaarb_decodes(int new_vga_rsrc) { - return 0; + return -1; } int -pci_device_vgaarb_lock(struct pci_device *dev) +pci_device_vgaarb_lock(void) { - return 0; + return -1; } int -pci_device_vgaarb_trylock(struct pci_device *dev) +pci_device_vgaarb_trylock(void) { - return 0; + return -1; } int -pci_device_vgaarb_unlock(struct pci_device *dev) +pci_device_vgaarb_unlock(void); { return 0; } + +int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, + int *rsrc_decodes) +{ + return -1; +} commit b229acdfd10fd61f46d8e711910b5c1bdb727857 Author: Dave Airlie <airl...@redhat.com> Date: Fri Aug 28 11:21:11 2009 +1000 Revert "vgaarb: delete stub functions" This reverts commit b7fd4d06890d801aae93fe1a1af7ab110fd388fd. diff --git a/src/Makefile.am b/src/Makefile.am index c7be653..0de6894 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,8 @@ endif if LINUX VGA_ARBITER = common_vgaarb.c +else +VGA_ARBITER = common_vgaarb_stub.c endif libpciaccess_la_SOURCES = common_bridge.c \ diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c new file mode 100644 index 0000000..5fc5dfe --- /dev/null +++ b/src/common_vgaarb_stub.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2009 Tiago Vignatti + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include <stdio.h> +#include "pciaccess.h" + +int +pci_device_vgaarb_init(struct pci_device *dev) +{ +#ifdef DEBUG + fprintf(stderr, "%s: You're using VGA arbiter stub functions!\n", + __FUNCTION__); +#endif + return 0; +} + +void +pci_device_vgaarb_fini(struct pci_device *dev) +{ +} + +int +pci_device_vgaarb_set_target(struct pci_device *dev) +{ + return 0; +} + +int +pci_device_vgaarb_decodes(struct pci_device *dev) +{ + return 0; +} + +int +pci_device_vgaarb_lock(struct pci_device *dev) +{ + return 0; +} + +int +pci_device_vgaarb_trylock(struct pci_device *dev) +{ + return 0; +} + +int +pci_device_vgaarb_unlock(struct pci_device *dev) +{ + return 0; +} commit e70767cb2e574f8544a04903eea3afee33345eea Author: Tiago Vignatti <tiago.vigna...@nokia.com> Date: Wed Aug 26 11:14:03 2009 +0300 Revert "vgaarb: fix pci_device_vgaarb_get_info() return value." This reverts commit ef8aca5da46155e9ea0d1227215921ad9ce59150. diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c index b7ef021..a40b064 100644 --- a/src/common_vgaarb.c +++ b/src/common_vgaarb.c @@ -317,7 +317,7 @@ int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc { *vga_count = pci_sys->vga_count; if (!dev) - return -1; + return 0; *rsrc_decodes = dev->vgaarb_rsrc; return 0; commit ef8aca5da46155e9ea0d1227215921ad9ce59150 Author: Tiago Vignatti <tiago.vigna...@nokia.com> Date: Sun Aug 16 19:11:15 2009 +0300 vgaarb: fix pci_device_vgaarb_get_info() return value. Signed-off-by: Tiago Vignatti <tiago.vigna...@nokia.com> diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c index a40b064..b7ef021 100644 --- a/src/common_vgaarb.c +++ b/src/common_vgaarb.c @@ -317,7 +317,7 @@ int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc { *vga_count = pci_sys->vga_count; if (!dev) - return 0; + return -1; *rsrc_decodes = dev->vgaarb_rsrc; return 0; commit 25be96885671d22ee3f932769d72cf3a31f355ee Author: Tiago Vignatti <tiago.vigna...@nokia.com> Date: Sun Aug 16 19:09:35 2009 +0300 vgaarb: fix indentation and remove trailing white spaces Signed-off-by: Tiago Vignatti <tiago.vigna...@nokia.com> diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c index 89cc0ce..a40b064 100644 --- a/src/common_vgaarb.c +++ b/src/common_vgaarb.c @@ -47,21 +47,21 @@ parse_string_to_decodes_rsrc(char *input, int *vga_count, struct pci_slot_match tok = strtok_r(input,",",&input_sp); if (!tok) - goto fail; + goto fail; strncpy(tmp, input, 15); tmp[15] = 0; tok = strtok_r(tmp,":",&count_sp); if (!tok) - goto fail; + goto fail; tok = strtok_r(NULL, ":",&count_sp); if (!tok) - goto fail; + goto fail; *vga_count = strtoul(tok, NULL, 10); if (*vga_count == LONG_MAX) - goto fail; + goto fail; #ifdef DEBUG fprintf(stderr,"vga count is %d\n", *vga_count); @@ -69,51 +69,51 @@ parse_string_to_decodes_rsrc(char *input, int *vga_count, struct pci_slot_match tok = strtok_r(NULL, ",",&input_sp); if (!tok) - goto fail; + goto fail; if (match) { - strncpy(tmp, tok, 32); - tmp[31] = 0; - tok = strtok_r(tmp, ":", &pci_sp); - if (!tok) - goto fail; - tok = strtok_r(NULL, ":", &pci_sp); - if (!tok) - goto fail; - match->domain = strtoul(tok, NULL, 16); - - tok = strtok_r(NULL, ":", &pci_sp); - if (!tok) - goto fail; - match->bus = strtoul(tok, NULL, 16); - - tok = strtok_r(NULL, ".", &pci_sp); - if (!tok) - goto fail; - match->dev = strtoul(tok, NULL, 16); - - tok = strtok_r(NULL, ".", &pci_sp); - if (!tok) - goto fail; - match->func = strtoul(tok, NULL, 16); + strncpy(tmp, tok, 32); + tmp[31] = 0; + tok = strtok_r(tmp, ":", &pci_sp); + if (!tok) + goto fail; + tok = strtok_r(NULL, ":", &pci_sp); + if (!tok) + goto fail; + match->domain = strtoul(tok, NULL, 16); + + tok = strtok_r(NULL, ":", &pci_sp); + if (!tok) + goto fail; + match->bus = strtoul(tok, NULL, 16); + + tok = strtok_r(NULL, ".", &pci_sp); + if (!tok) + goto fail; + match->dev = strtoul(tok, NULL, 16); + + tok = strtok_r(NULL, ".", &pci_sp); + if (!tok) + goto fail; + match->func = strtoul(tok, NULL, 16); } tok = strtok_r(NULL, ",",&input_sp); if (!tok) - goto fail; + goto fail; tok = strtok_r(tok, "=", &input_sp); if (!tok) - goto fail; + goto fail; tok = strtok_r(NULL, "=", &input_sp); if (!tok) - goto fail; + goto fail; if (!strncmp(tok, "io+mem", 6)) - return VGA_ARB_RSRC_LEGACY_IO | VGA_ARB_RSRC_LEGACY_MEM; + return VGA_ARB_RSRC_LEGACY_IO | VGA_ARB_RSRC_LEGACY_MEM; if (!strncmp(tok, "io", 2)) - return VGA_ARB_RSRC_LEGACY_IO; + return VGA_ARB_RSRC_LEGACY_IO; if (!strncmp(tok, "mem", 3)) - return VGA_ARB_RSRC_LEGACY_MEM; + return VGA_ARB_RSRC_LEGACY_MEM; fail: return VGA_ARB_RSRC_NONE; } @@ -130,14 +130,14 @@ pci_device_vgaarb_init(void) ret = read(pci_sys->vgaarb_fd, buf, BUFSIZE); if (ret <= 0) - return -1; + return -1; memset(&match, 0xff, sizeof(match)); /* need to find the device to go back to and what it was decoding */ rsrc = parse_string_to_decodes_rsrc(buf, &pci_sys->vga_count, &match); - + pci_sys->vga_default_dev = pci_device_find_by_slot(match.domain, match.bus, match.dev, match.func); - + if (pci_sys->vga_default_dev) pci_sys->vga_default_dev->vgaarb_rsrc = rsrc; return 0; @@ -219,20 +219,20 @@ pci_device_vgaarb_set_target(struct pci_device *dev) int ret; if (!dev) - dev = pci_sys->vga_default_dev; + dev = pci_sys->vga_default_dev; if (!dev) - return -1; + return -1; len = snprintf(buf, BUFSIZE, "target PCI:%04x:%02x:%02x.%x", dev->domain, dev->bus, dev->dev, dev->func); ret = vgaarb_write(pci_sys->vgaarb_fd, buf, len); if (ret) - return ret; + return ret; ret = read(pci_sys->vgaarb_fd, buf, BUFSIZE); if (ret <= 0) - return -1; + return -1; dev->vgaarb_rsrc = parse_string_to_decodes_rsrc(buf, &pci_sys->vga_count, NULL); pci_sys->vga_target = dev; @@ -248,9 +248,9 @@ pci_device_vgaarb_decodes(int new_vgaarb_rsrc) struct pci_device *dev = pci_sys->vga_target; if (!dev) - return -1; + return -1; if (dev->vgaarb_rsrc == new_vgaarb_rsrc) - return 0; + return 0; len = snprintf(buf, BUFSIZE, "decodes %s", rsrc_to_str(dev->vgaarb_rsrc)); ret = vgaarb_write(pci_sys->vgaarb_fd, buf, len); @@ -285,7 +285,7 @@ pci_device_vgaarb_trylock(void) struct pci_device *dev = pci_sys->vga_target; if (!dev) - return -1; + return -1; if (dev->vgaarb_rsrc == 0 || pci_sys->vga_count == 1) return 0; @@ -303,7 +303,7 @@ pci_device_vgaarb_unlock(void) struct pci_device *dev = pci_sys->vga_target; if (!dev) - return -1; + return -1; if (dev->vgaarb_rsrc == 0 || pci_sys->vga_count == 1) return 0; @@ -317,7 +317,8 @@ int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc { *vga_count = pci_sys->vga_count; if (!dev) - return 0; + return 0; + *rsrc_decodes = dev->vgaarb_rsrc; - return 0; + return 0; } commit b7fd4d06890d801aae93fe1a1af7ab110fd388fd Author: Tiago Vignatti <tiago.vigna...@nokia.com> Date: Sun Aug 16 18:59:21 2009 +0300 vgaarb: delete stub functions Such stub functions is already with API outdated. Moreover, if some operating -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org