diff options
author | wiz <wiz@pkgsrc.org> | 2012-07-14 23:42:12 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2012-07-14 23:42:12 +0000 |
commit | e2ebec5cc19081ebde6da45dc05655c1ff37eb86 (patch) | |
tree | c4713be3703e11e345fef2db864832a2059035f5 /sysutils/libpciaccess | |
parent | cc72bf7375718f5f19bdc0c4b56c9db73721a1d1 (diff) | |
download | pkgsrc-e2ebec5cc19081ebde6da45dc05655c1ff37eb86.tar.gz |
Update to 0.13.1. Update patch-ac (netbsd_pci.c) using current version
of the file from xsrc.
meta-pkgs/modular-xorg still builds.
Changes:
0.12.0:
pciaccess 0.12.0 release, contains a fix for a major MTRR issue from Thomas,
along with a use after free, generic x86 backend, a few vgaarb fixes, and
some packaging magic.
Alan Coopersmith (3):
Update Sun license notices to current X.Org standard form
Delay allocation of agp_info so we don't leak it on prior errors
Let libtool handle library flags for scanpci on Solaris
Dave Airlie (2):
pciaccess: fix use after free.
libpciaccess 0.12.0 - bump version for release
Gaetan Nadon (2):
config: remove the pkgconfig pc.in file from EXTRA_DIST
config: update AC_PREREQ statement to 2.60
Julien Cristau (1):
COPYING: add Red Hat's copyright notice
Samuel Thibault (1):
libpciaccess x86 backend
Thomas Hellstrom (1):
Fix long standing MTRR bug.
Tiago Vignatti (2):
vgaarb: decode should send new information to the kernel
vgaarb: read back vga count when setting new decoding
0.12.1:
This bug fix release corrects a couple bugs in the device probing code,
as well as providing various build configuration improvements.
Alan Coopersmith (4):
Sun's copyrights belong to Oracle now
config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
libpciaccess 0.12.1
Bryce Harrington (1):
Fix detection of multi-function cards
Gaetan Nadon (8):
config: upgrade AC_DEFINE_DIR to AX_DEFINE_DIR
config: provide a makefile for scanpci dev tool
scanpci.c: remove offending whitespace as reported by git diff
config: provide a makefile for scanpci man pages
config: replace INCLUDES, which is deprecated, with AM_CPPFLAGS
include: add a Makefile to install and distribute header file
config: use LDADD to obtain appropriate dependencies
config: replace deprecated AC_HELP_STRING with AS_HELP_STRING
Jesse Barnes (1):
Revert "Don't try to use bogus bridge data"
0.13.0:
Adam Jackson (1):
linux: Don't use /dev/port
Alan Coopersmith (3):
Solaris: reorder functions to remove need for lots of static prototypes
Close pci.ids file when bailing out because realloc failed
solx_devfs.c: fix gcc warnings about casting away const when reading data
Daniel Drake (1):
delete_io_handle: fix deletion of last handle
Henry Zhao (1):
Solaris: improve support for sparc platform
Jeremy Huddleston (1):
configure.ac: Bump to 0.13
Mark Kettenis (3):
OpenBSD: Indicate that devices need access to legacy VGA resources.
Add VGA Arbiter support for OpenBSD.
OpenBSD: Implement map_legacy and legacy_io
Mathias Krause (1):
Use correct type for pci_id file accessor functions
0.13.1:
Adam Jackson (2):
Use O_CLOEXEC for internal file descriptors
linux: Fix out[bwl] macros on non-I/O architectures
Julien Cristau (1):
Bump to 0.13.1
Matthieu Herrb (1):
Fix pci_io_handle allocation routines.
Thordur Bjornsson (1):
Fix openbsd_pci.c:pci_device_vgaarb_set_target();
Diffstat (limited to 'sysutils/libpciaccess')
-rw-r--r-- | sysutils/libpciaccess/Makefile | 5 | ||||
-rw-r--r-- | sysutils/libpciaccess/distinfo | 12 | ||||
-rw-r--r-- | sysutils/libpciaccess/patches/patch-aa | 12 | ||||
-rw-r--r-- | sysutils/libpciaccess/patches/patch-ac | 132 |
4 files changed, 88 insertions, 73 deletions
diff --git a/sysutils/libpciaccess/Makefile b/sysutils/libpciaccess/Makefile index 6141c0b2dbc..4db10ed9ee0 100644 --- a/sysutils/libpciaccess/Makefile +++ b/sysutils/libpciaccess/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.11 2012/01/21 12:09:03 shattered Exp $ +# $NetBSD: Makefile,v 1.12 2012/07/14 23:42:12 wiz Exp $ # -DISTNAME= libpciaccess-0.11.0 -PKGREVISION= 1 +DISTNAME= libpciaccess-0.13.1 CATEGORIES= sysutils x11 MASTER_SITES= ${MASTER_SITE_XORG:=lib/} EXTRACT_SUFX= .tar.bz2 diff --git a/sysutils/libpciaccess/distinfo b/sysutils/libpciaccess/distinfo index 074d608192d..d0536273b31 100644 --- a/sysutils/libpciaccess/distinfo +++ b/sysutils/libpciaccess/distinfo @@ -1,7 +1,7 @@ -$NetBSD: distinfo,v 1.13 2011/05/09 15:26:16 taca Exp $ +$NetBSD: distinfo,v 1.14 2012/07/14 23:42:12 wiz Exp $ -SHA1 (libpciaccess-0.11.0.tar.bz2) = bcebba8b8441af151b59b63e8e91e66133b64158 -RMD160 (libpciaccess-0.11.0.tar.bz2) = 7d579f024e543c97cceb47c204d395e4097becf2 -Size (libpciaccess-0.11.0.tar.bz2) = 295639 bytes -SHA1 (patch-aa) = 6bb844c0696c8a86c6033605339e82da34164bdc -SHA1 (patch-ac) = c2df07d306203f3236e3a79caf4eedc5104d6f78 +SHA1 (libpciaccess-0.13.1.tar.bz2) = ae4dcf27a1b52c6a1fd90b21165fbaecae34e8ac +RMD160 (libpciaccess-0.13.1.tar.bz2) = 2e4c94bd782e98d360664cc0ce3d5ad2d1b0045c +Size (libpciaccess-0.13.1.tar.bz2) = 352351 bytes +SHA1 (patch-aa) = 090e2dd9d811fc56354d5387cc51fb2b1b4a2820 +SHA1 (patch-ac) = b1ce055ff9c0b60ffd9c337eb78ef471065a5f4d diff --git a/sysutils/libpciaccess/patches/patch-aa b/sysutils/libpciaccess/patches/patch-aa index d0ca9696cb8..0c767cc4ec0 100644 --- a/sysutils/libpciaccess/patches/patch-aa +++ b/sysutils/libpciaccess/patches/patch-aa @@ -1,8 +1,10 @@ -$NetBSD: patch-aa,v 1.5 2011/02/14 21:34:05 drochner Exp $ +$NetBSD: patch-aa,v 1.6 2012/07/14 23:42:13 wiz Exp $ ---- configure.ac.orig 2009-12-14 21:35:07.000000000 +0000 +Check for libpci and mtrr headers on NetBSD. + +--- configure.ac.orig 2012-04-09 17:04:39.000000000 +0000 +++ configure.ac -@@ -74,11 +74,11 @@ case $host_os in +@@ -77,11 +77,11 @@ case $host_os in ;; *netbsd*) case $host in @@ -17,9 +19,9 @@ $NetBSD: patch-aa,v 1.5 2011/02/14 21:34:05 drochner Exp $ ;; esac netbsd=yes -@@ -100,7 +100,20 @@ AM_CONDITIONAL(SOLARIS, [test "x$solaris +@@ -109,7 +109,20 @@ AC_SYS_LARGEFILE - AC_SYS_LARGEFILE + AC_CHECK_HEADERS([err.h]) +if test "x$netbsd" = xyes; then +AC_CHECK_LIB([pci], [pcibus_conf_read], diff --git a/sysutils/libpciaccess/patches/patch-ac b/sysutils/libpciaccess/patches/patch-ac index ce0eeb02fa2..9cf6d14030d 100644 --- a/sysutils/libpciaccess/patches/patch-ac +++ b/sysutils/libpciaccess/patches/patch-ac @@ -1,6 +1,8 @@ -$NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ +$NetBSD: patch-ac,v 1.11 2012/07/14 23:42:13 wiz Exp $ ---- src/netbsd_pci.c.orig 2009-02-17 00:10:20.000000000 +0000 +Improve NetBSD support. From Michael Lorenz <macallan@NetBSD.org>. + +--- src/netbsd_pci.c.orig 2012-04-09 17:02:57.000000000 +0000 +++ src/netbsd_pci.c @@ -1,6 +1,7 @@ /* @@ -10,7 +12,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above -@@ -20,12 +21,26 @@ +@@ -20,8 +21,13 @@ #include <sys/mman.h> #include <sys/types.h> @@ -19,30 +21,17 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ +#ifdef HAVE_MTRR #include <machine/sysarch.h> #include <machine/mtrr.h> -+#ifdef _X86_SYSARCH_L -+#define netbsd_set_mtrr(mr, num) _X86_SYSARCH_L(set_mtrr)((mr), (num)) -+#else -+#ifdef __i386__ -+#define netbsd_set_mtrr(mr, num) i386_set_mtrr((mr), (num)) -+#endif -+#ifdef __amd64__ -+#define netbsd_set_mtrr(mr, num) x86_64_set_mtrr((mr), (num)) -+#endif -+#endif ++#define netbsd_set_mtrr(mr, num) _X86_SYSARCH_L(set_mtrr)(mr, num) +#endif -+#include <dev/pci/pcidevs.h> #include <dev/pci/pciio.h> #include <dev/pci/pcireg.h> --#include <dev/pci/pcidevs.h> - - #include <errno.h> - #include <fcntl.h> -@@ -35,126 +50,162 @@ +@@ -35,126 +41,152 @@ #include <unistd.h> +#include <pci.h> ++#include <dev/wscons/wsconsio.h> + #include "pciaccess.h" #include "pciaccess_private.h" @@ -158,37 +147,25 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + struct mtrr m; + int n = 1; +#endif -+ int prot, fd, ret = 0; ++ int prot, ret = 0; -- if ((fd = open("/dev/mem", O_RDWR)) == -1) +- if ((fd = open("/dev/mem", O_RDWR | O_CLOEXEC)) == -1) - return errno; + prot = PROT_READ; if (map->flags & PCI_DEV_MAP_FLAG_WRITABLE) prot |= PROT_WRITE; +- +- map->memory = mmap(NULL, map->size, prot, MAP_SHARED, +- fd, map->base); + map->memory = mmap(NULL, (size_t)map->size, prot, MAP_SHARED, + buses[dev->domain].fd, (off_t)map->base); -+ if (map->memory == MAP_FAILED) { -+ fd = open("/dev/mem", O_RDWR); -+ if (fd == -1) -+ return errno; -+ map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, -+ (off_t)map->base); -+ if (map->memory == MAP_FAILED) { -+ ret = errno; -+ close(fd); -+ return ret; -+ } -+ close(fd); -+ } + if (map->memory == MAP_FAILED) + return errno; -- map->memory = mmap(NULL, map->size, prot, MAP_SHARED, -- fd, map->base); -- if (map->memory == MAP_FAILED) -- return errno; +#ifdef HAVE_MTRR + memset(&m, 0, sizeof(m)); - ++ /* No need to set an MTRR if it's the default mode. */ if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) || (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) { @@ -265,7 +242,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ return pci_device_generic_unmap_range(dev, map); } -@@ -163,25 +214,23 @@ static int +@@ -163,25 +195,23 @@ static int pci_device_netbsd_read(struct pci_device *dev, void *data, pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_read) { @@ -300,7 +277,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ offset += toread; data = (char *)data + toread; -@@ -196,25 +245,23 @@ static int +@@ -196,25 +226,23 @@ static int pci_device_netbsd_write(struct pci_device *dev, const void *data, pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_written) { @@ -321,7 +298,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + reg = (u_int)offset; + memcpy(&val, data, 4); -- if (ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, &io) == -1) +- if (ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, &io) == -1) + if ((pcibus_conf_write(buses[dev->domain].fd, + (unsigned int)dev->bus, (unsigned int)dev->dev, + (unsigned int)dev->func, reg, val)) == -1) @@ -333,7 +310,47 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ size -= 4; *bytes_written += 4; } -@@ -225,7 +272,11 @@ pci_device_netbsd_write(struct pci_devic +@@ -222,10 +250,51 @@ pci_device_netbsd_write(struct pci_devic + return 0; + } + ++static int ++pci_device_netbsd_boot_vga(struct pci_device *dev) ++{ ++ int ret; ++ struct wsdisplayio_bus_id busid; ++ int fd; ++ ++ fd = open("/dev/ttyE0", O_RDONLY); ++ if (fd == -1) { ++ fprintf(stderr, "failed to open /dev/ttyE0: %s\n", ++ strerror(errno)); ++ return 0; ++ } ++ ++ ret = ioctl(fd, WSDISPLAYIO_GET_BUSID, &busid); ++ close(fd); ++ if (ret == -1) { ++ fprintf(stderr, "ioctl WSDISPLAYIO_GET_BUSID failed: %s\n", ++ strerror(errno)); ++ return 0; ++ } ++ ++ if (busid.bus_type != WSDISPLAYIO_BUS_PCI) ++ return 0; ++ ++ if (busid.ubus.pci.domain != dev->domain) ++ return 0; ++ if (busid.ubus.pci.bus != dev->bus) ++ return 0; ++ if (busid.ubus.pci.device != dev->dev) ++ return 0; ++ if (busid.ubus.pci.function != dev->func) ++ return 0; ++ ++ return 1; ++} ++ static void pci_system_netbsd_destroy(void) { @@ -346,7 +363,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ free(pci_sys); pci_sys = NULL; } -@@ -233,17 +284,34 @@ pci_system_netbsd_destroy(void) +@@ -233,17 +302,34 @@ pci_system_netbsd_destroy(void) static int pci_device_netbsd_probe(struct pci_device *device) { @@ -384,7 +401,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ if (err) return err; -@@ -254,16 +322,16 @@ pci_device_netbsd_probe(struct pci_devic +@@ -254,16 +340,16 @@ pci_device_netbsd_probe(struct pci_devic region = device->regions; for (bar = PCI_MAPREG_START; bar < PCI_MAPREG_END; bar += sizeof(uint32_t), region++) { @@ -405,7 +422,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_IO) { region->is_IO = 1; -@@ -286,66 +354,188 @@ pci_device_netbsd_probe(struct pci_devic +@@ -286,66 +372,185 @@ pci_device_netbsd_probe(struct pci_devic bar += sizeof(uint32_t); @@ -473,7 +490,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + pciaddr_t rom_base; + size_t rom_size; + uint32_t bios_val, command_val; -+ int pci_rom, memfd; ++ int pci_rom; + + if (((priv->base.device_class >> 16) & 0xff) != PCI_CLASS_DISPLAY || + ((priv->base.device_class >> 8) & 0xff) != PCI_SUBCLASS_DISPLAY_VGA) @@ -519,23 +536,19 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + } + } + -+ fprintf(stderr, "Using rom_base = 0x%lx (pci_rom=%d)\n", (long)rom_base, -+ pci_rom); -+ memfd = open("/dev/mem", O_RDONLY); -+ if (memfd == -1) -+ return errno; ++ fprintf(stderr, "Using rom_base = 0x%lx 0x%lx (pci_rom=%d)\n", ++ (long)rom_base, (long)rom_size, pci_rom); + -+ bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, memfd, (off_t)rom_base); ++ bios = mmap(NULL, rom_size, PROT_READ, MAP_SHARED, buses[dev->domain].fd, ++ (off_t)rom_base); + if (bios == MAP_FAILED) { + int serrno = errno; -+ close(memfd); + return serrno; + } + + memcpy(buffer, bios, rom_size); + + munmap(bios, rom_size); -+ close(memfd); + + if (pci_rom) { + if ((command_val & PCI_COMMAND_MEM_ENABLE) == 0) { @@ -575,7 +588,8 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + .unmap_range = pci_device_netbsd_unmap_range, + .read = pci_device_netbsd_read, + .write = pci_device_netbsd_write, -+ .fill_capabilities = pci_fill_capabilities_generic ++ .fill_capabilities = pci_fill_capabilities_generic, ++ .boot_vga = pci_device_netbsd_boot_vga, }; int @@ -586,7 +600,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ + int bus, dev, func, ndevs, nfuncs, domain, pcifd; uint32_t reg; - -- pcifd = open("/dev/pci0", O_RDWR); +- pcifd = open("/dev/pci0", O_RDWR | O_CLOEXEC); - if (pcifd == -1) - return ENXIO; + char netbsd_devname[32]; @@ -622,7 +636,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ ®) != 0) continue; if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID || -@@ -355,37 +545,43 @@ pci_system_netbsd_create(void) +@@ -355,37 +560,43 @@ pci_system_netbsd_create(void) ndevs++; } } @@ -675,7 +689,7 @@ $NetBSD: patch-ac,v 1.10 2011/05/09 15:26:16 taca Exp $ continue; device->base.device_class = -@@ -393,8 +589,8 @@ pci_system_netbsd_create(void) +@@ -393,8 +604,8 @@ pci_system_netbsd_create(void) PCI_SUBCLASS(reg) << 8; device->base.revision = PCI_REVISION(reg); |