From 17519d2970cd3dfef40ee45f36a08b56058387e5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Jul 27 2009 05:17:15 +0000 Subject: - rebase to latest release (will do release with VGA bits later) - libpciaccess-boot-vga.patch: add boot vga patch from upstream --- diff --git a/.cvsignore b/.cvsignore index 90ad6ce..46199da 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -libpciaccess-0.10.tar.bz2 +libpciaccess-0.10.6.tar.bz2 diff --git a/libpciaccess-boot-vga.patch b/libpciaccess-boot-vga.patch new file mode 100644 index 0000000..2f94ecd --- /dev/null +++ b/libpciaccess-boot-vga.patch @@ -0,0 +1,99 @@ +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 2008-05-22 09:35:04.000000000 +1000 ++++ libpciaccess-0.10.6/include/pciaccess.h 2009-07-27 15:10:14.000000000 +1000 +@@ -50,6 +50,8 @@ struct pci_slot_match; + extern "C" { + #endif + ++int pci_device_is_boot_vga(struct pci_device *dev); ++ + int pci_device_read_rom(struct pci_device *dev, void *buffer); + + int __deprecated pci_device_map_region(struct pci_device *dev, +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 2008-11-19 14:11:59.000000000 +1000 ++++ libpciaccess-0.10.6/src/common_interface.c 2009-07-27 15:10:14.000000000 +1000 +@@ -108,6 +108,20 @@ pci_device_read_rom( struct pci_device * + return (pci_sys->methods->read_rom)( dev, buffer ); + } + ++/** ++ * Probe a PCI (VGA) device to determine if its the boot VGA device ++ * ++ * \param dev Device whose VGA status to query ++ * \return ++ * Zero if not the boot VGA, 1 if the boot VGA. ++ */ ++int ++pci_device_is_boot_vga( struct pci_device * dev ) ++{ ++ if (!pci_sys->methods->boot_vga) ++ return 0; ++ return pci_sys->methods->boot_vga( dev ); ++} + + /** + * Probe a PCI device to learn information about the device. +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-07-27 15:10:00.000000000 +1000 ++++ libpciaccess-0.10.6/src/linux_sysfs.c 2009-07-27 15:10:14.000000000 +1000 +@@ -77,6 +77,8 @@ static int pci_device_linux_sysfs_write( + const void * data, pciaddr_t offset, pciaddr_t size, + pciaddr_t * bytes_written ); + ++static int pci_device_linux_sysfs_boot_vga( struct pci_device * dev ); ++ + static const struct pci_system_methods linux_sysfs_methods = { + .destroy = pci_device_linux_sysfs_destroy, + .destroy_device = NULL, +@@ -90,6 +92,7 @@ static const struct pci_system_methods l + + .fill_capabilities = pci_fill_capabilities_generic, + .enable = pci_device_linux_sysfs_enable, ++ .boot_vga = pci_device_linux_sysfs_boot_vga, + }; + + #define SYS_BUS_PCI "/sys/bus/pci/devices" +@@ -730,3 +733,31 @@ static void pci_device_linux_sysfs_enabl + write( fd, "1", 1 ); + close(fd); + } ++ ++static int pci_device_linux_sysfs_boot_vga(struct pci_device *dev) ++{ ++ char name[256]; ++ char reply[3]; ++ int fd, bytes_read; ++ int ret = 0; ++ ++ snprintf( name, 255, "%s/%04x:%02x:%02x.%1u/boot_vga", ++ SYS_BUS_PCI, ++ dev->domain, ++ dev->bus, ++ dev->dev, ++ dev->func ); ++ ++ fd = open( name, O_RDONLY ); ++ if (fd == -1) ++ return 0; ++ ++ bytes_read = read(fd, reply, 1); ++ if (bytes_read != 1) ++ goto out; ++ if (reply[0] == '1') ++ ret = 1; ++out: ++ close(fd); ++ return ret; ++} +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 2008-10-16 08:35:53.000000000 +1000 ++++ libpciaccess-0.10.6/src/pciaccess_private.h 2009-07-27 15:10:14.000000000 +1000 +@@ -60,6 +60,7 @@ struct pci_system_methods { + + int (*fill_capabilities)( struct pci_device * dev ); + void (*enable)( struct pci_device *dev ); ++ int (*boot_vga)( struct pci_device *dev ); + }; + + struct pci_device_mapping { diff --git a/libpciaccess.spec b/libpciaccess.spec index 580eb07..2dae494 100644 --- a/libpciaccess.spec +++ b/libpciaccess.spec @@ -41,7 +41,6 @@ Development package for libpciaccess. %setup -q -n %{name}-%{version} %patch0 -p1 -b .cache %patch2 -p1 -b .rom-size -exit %patch3 -p1 -b .bootvga %build diff --git a/make-libpciaccess-snapshot.sh b/make-libpciaccess-snapshot.sh index 52dce73..f20bf69 100755 --- a/make-libpciaccess-snapshot.sh +++ b/make-libpciaccess-snapshot.sh @@ -1,5 +1,5 @@ #!/bin/sh -n + DATE=$( date +%Y%m%d ) DIRNAME=libpciaccess REV=${1:-master} @@ -32,4 +32,4 @@ sed -i -e "s/^%define gitdate.*/%define gitdate $DATE/" \ -e "/%changelog/ a $msg" \ libpciaccess.spec -make new-sources FILES=$DIRNAME-$DATE.tar.bz2 \ No newline at end of file +make new-sources FILES=$DIRNAME-$DATE.tar.bz2 diff --git a/sources b/sources index c2fc684..67aa391 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -617bebf31e5685c83f935009aeae5f38 libpciaccess-0.10.5.tar.bz2 +ba25eb7582f69428648e8c67564d68e5 libpciaccess-0.10.6.tar.bz2