[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libpciaccess: Changes to 'upstream-unstable'



 ChangeLog           |   98 ----------------------------------------------------
 Makefile.am         |   10 +++++
 configure.ac        |    2 -
 include/pciaccess.h |   14 +++----
 src/freebsd_pci.c   |   67 ++++++++++++++++++++++++-----------
 src/scanpci.c       |    5 ++
 6 files changed, 69 insertions(+), 127 deletions(-)

New commits:
commit ceda00d33fbf3d491e3f7e53302acd2b8b74a305
Author: James Cloos <cloos@jhcloos.com>
Date:   Thu Dec 6 16:38:51 2007 -0500

    Replace static ChangeLog with dist-hook to generate from git log

diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index f5b2497..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,98 +0,0 @@
-2006-05-09  Ian Romanick  <idr@us.ibm.com>
-
-	* src/linux_sysfs.c: (pci_device_linux_sysfs_probe):
-	Fix foolish endianess bug.
-
-	* src/Makefile.am:
-	Bump to version 0.4.1.
-
-2006-04-12  Ian Romanick  <idr@us.ibm.com>
-
-	* configure.ac:
-	* src/Makefile.am:
-	Bump to version 0.4.0.
-
-	* include/pciaccess.h:
-	Add multiple-inclusion protection.
-
-	* src/common_interface.c: (pci_device_cfg_write_bits):
-	Add new function to write masked bits to PCI config space.
-	This mirrors functionality currently available in X.org that is slated
-	to be removed.
-
-	* src/common_iterator.c: (pci_slot_match_iterator_create),
-	(pci_id_match_iterator_create), (pci_iterator_destroy),
-	(pci_device_next), (pci_device_find_by_slot):
-	Gut old regex based search mechanism with a new mechanism that is
-	modeled after the Linux kernel.  In addition to searching for
-	devices by device / vendor ID, it is possible to search for devices
-	by their domain / bus / slot / function.
-
-	* src/linux_sysfs.c: (pci_device_linux_sysfs_read_rom),
-	(pci_device_linux_sysfs_map_region),
-	(pci_device_linux_sysfs_unmap_region):
-	Fix serious bugs in the reading of ROMs and in the unmapping of
-	regions.  The main point is that the map routine depens on the
-	pci_mem_region::memory pointer being non-NULL only when the region
-	is mapped.  Therefore, the unmap routine should set it to NULL after
-	unmapping.
-
-	* src/scanpci.c: (main):
-	Update to use new search API.
-
-2006-03-27  Ian Romanick  <idr@us.ibm.com>
-
-	* Makefile.am:
-	Remove src/pcils.c and src/Makefile.foo.  Add src/scanpci.c.
-
-	* configure.ac:
-	* src/Makefile.am:
-	Bump version to 0.3.0.
-
-	* include/pciaccess.h:
-	* src/common_device_name.c: (pci_get_strings):
-	Replace pci_get_name with pci_get_strings.  This function
-	matches the functionality provided by the Xorg scanpci module
-	almost identically.
-
-2006-03-24  Ian D. Romanick  <idr@us.ibm.com>
-
-	* src/Makefile.foo: Drop from CVS.
-
-2006-03-20  Kristian Høgsberg  <krh@redhat.com>
-
-	* src/Makefile.am (noinst_PROGRAMS): Add scanpci as a noinst target.
-	* src/Makefile.in: Drop from CVS.
-
-2006-03-17  Ian D. Romanick  <idr@us.ibm.com>
-
-	* configure.ac, src/common_device_name.c
-	Added configure option (--with-pciids-path) to set the default
-	place to look for the pci.ids file.
-
-2006-03-16  Ian D. Romanick  <idr@us.ibm.com>
-
-	* src/pcils.c, src/scanpci.c, src/Makefile.foo
-	Made pcils more like XFree86's scanpci utility than lspci.  Changed
-	the name of the source file from pcils.c to scanpci.c.  Eventually
-	this will be it's own project somewhere else (or it will whither and
-	die).
-
-2006-03-15  Ian D. Romanick  <idr@us.ibm.com>
-
-	* First round of autotools madness.
-
-2006-02-24  Ian D. Romanick  <idr@us.ibm.com>
-
-	* common_device_name.c, pciaccess.h, pcils.c:
-	Add interfaces for querying the device, vendor, subdevice, and
-	subvendor name strings from pci.ids.
-
-2006-02-20  Ian D. Romanick  <idr@us.ibm.com>
-
-	* common_agp.c:
-	Removed this file.  It was an old version of what became
-	common_capability.c.
-
-	* common_capability.c:
-	Fixed an issue with AGP rate detection for AGP3 devices.
diff --git a/Makefile.am b/Makefile.am
index bf7eb7d..214721b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,3 +27,13 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = pciaccess.pc
 
 EXTRA_DIST = pciaccess.pc.in autogen.sh src/scanpci.c
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+	(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog

commit e392082abb5696c8837224da86cc0af4f21d7010
Author: Matthias Hopf <mhopf@suse.de>
Date:   Tue Oct 23 15:19:36 2007 +0200

    Bit-fields have to have type _Bool, signed int, or unsigned int.
    
    ISO/IEC 9899:1999 (E), 6.7.2.1 Structure and union specifiers, (4).
    _Bool is only supported for C99 and up, and 1-bit signed types don't make
    sense -> unsigned int.

diff --git a/include/pciaccess.h b/include/pciaccess.h
index 4bd3672..dcc0122 100644
--- a/include/pciaccess.h
+++ b/include/pciaccess.h
@@ -368,13 +368,13 @@ struct pci_agp_info {
      */
     uint8_t    rates;
 
-    uint8_t    fast_writes:1;       /**< Are fast-writes supported? */
-    uint8_t    addr64:1;
-    uint8_t    htrans:1;
-    uint8_t    gart64:1;
-    uint8_t    coherent:1;
-    uint8_t    sideband:1;          /**< Is side-band addressing supported? */
-    uint8_t    isochronus:1;
+    unsigned int    fast_writes:1;  /**< Are fast-writes supported? */
+    unsigned int    addr64:1;
+    unsigned int    htrans:1;
+    unsigned int    gart64:1;
+    unsigned int    coherent:1;
+    unsigned int    sideband:1;     /**< Is side-band addressing supported? */
+    unsigned int    isochronus:1;
 
     uint8_t    async_req_size;
     uint8_t    calibration_cycle_timing;

commit 5b9ca552a17de37bbac84f0cf5b4430d108e576c
Author: Ian Romanick <idr@us.ibm.com>
Date:   Thu Oct 18 15:59:14 2007 -0700

    Update bug reporting link.

diff --git a/configure.ac b/configure.ac
index 86f56ef..8e53427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ dnl refers to ${prefix}.  Thus we have to use `eval' twice.
 
 AC_PREREQ([2.57])
 
-AC_INIT(libpciaccess, 0.10.0, [none yet], libpciaccess)
+AC_INIT(libpciaccess, 0.10.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess)
 AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE
 

commit 57a942b3cca314a56735e0a4198cac2f25b653dd
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 10 15:20:51 2007 -0700

    FreeBSD: for 64-bit BARs, skip the resource slot used for the upper 32 bits.
    
    This gets us the same resource numbering as on Linux.

diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index bf41f63..0c7cf61 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -397,9 +397,10 @@ pci_device_freebsd_probe( struct pci_device * dev )
     bar = 0x10;
     for (i = 0; i < pci_device_freebsd_get_num_regions( dev ); i++) {
 	pci_device_freebsd_get_region_info( dev, i, bar );
-	if (dev->regions[i].is_64)
+	if (dev->regions[i].is_64) {
 	    bar += 0x08;
-	else
+	    i++;
+	} else
 	    bar += 0x04;
     }
 

commit 127ae628a2090bb00df81adce831b8b031d3b4a8
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 10 14:55:45 2007 -0700

    FreeBSD: Don't try to unset an MTRR if we didn't set it.

diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index e51b9c5..bf41f63 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -135,20 +135,26 @@ pci_device_freebsd_unmap_range( struct pci_device *dev,
     struct mem_range_op mro;
     int fd;
 
-    fd = open("/dev/mem", O_RDWR);
-    if (fd != -1) {
-	mrd.mr_base = map->base;
-	mrd.mr_len = map->size;
-	strncpy(mrd.mr_owner, "pciaccess", sizeof(mrd.mr_owner));
-	mrd.mr_flags = MDF_UNCACHEABLE;
-	mro.mo_desc = &mrd;
-	mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
-
-	if (ioctl(fd, MEMRANGE_SET, &mro)) {
-	    fprintf(stderr, "failed to unset mtrr: %s\n", strerror(errno));
+    if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) ||
+	(map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE))
+    {
+	fd = open("/dev/mem", O_RDWR);
+	if (fd != -1) {
+	    mrd.mr_base = map->base;
+	    mrd.mr_len = map->size;
+	    strncpy(mrd.mr_owner, "pciaccess", sizeof(mrd.mr_owner));
+	    mrd.mr_flags = MDF_UNCACHEABLE;
+	    mro.mo_desc = &mrd;
+	    mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
+
+	    if (ioctl(fd, MEMRANGE_SET, &mro)) {
+		fprintf(stderr, "failed to unset mtrr: %s\n", strerror(errno));
+	    }
+
+	    close(fd);
+	} else {
+	    fprintf(stderr, "Failed to open /dev/mem\n");
 	}
-
-	close(fd);
     }
 
     return pci_device_generic_unmap_range(dev, map);

commit 28fea32f987a74d365d01bc5870a8bce1c393d59
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 10 14:32:38 2007 -0700

    Add domain output to scanpci.

diff --git a/src/scanpci.c b/src/scanpci.c
index eb6e94f..c8a6adf 100644
--- a/src/scanpci.c
+++ b/src/scanpci.c
@@ -61,7 +61,10 @@ print_pci_device( struct pci_device * dev, int verbose )
 	dev_name = "Device unknown";
     }
 
-    printf("\npci bus 0x%04x cardnum 0x%02x function 0x%02x:"
+    printf("\npci ");
+    if (dev->domain != 0)
+	printf("domain 0x%04x ", dev->domain);
+    printf("bus 0x%04x cardnum 0x%02x function 0x%02x:"
 	   " vendor 0x%04x device 0x%04x\n",
 	   dev->bus, 
 	   dev->dev,

commit 393145db90578d7d598fccf949b249217066a67c
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 10 14:32:09 2007 -0700

    FreeBSD: Add support for multiple PCI domains.

diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index b703936..e51b9c5 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -38,10 +38,17 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/pciio.h>
 #include <sys/mman.h>
 #include <sys/memrange.h>
 
+#if __FreeBSD_version >= 700053
+#define DOMAIN_SUPPORT 1
+#else
+#define DOMAIN_SUPPORT 0
+#endif
+
 #include "pciaccess.h"
 #include "pciaccess_private.h"
 
@@ -154,6 +161,9 @@ pci_device_freebsd_read( struct pci_device * dev, void * data,
 {
     struct pci_io io;
 
+#if DOMAIN_SUPPORT
+    io.pi_sel.pc_domain = dev->domain;
+#endif
     io.pi_sel.pc_bus = dev->bus;
     io.pi_sel.pc_dev = dev->dev;
     io.pi_sel.pc_func = dev->func;
@@ -191,6 +201,9 @@ pci_device_freebsd_write( struct pci_device * dev, const void * data,
 {
     struct pci_io io;
 
+#if DOMAIN_SUPPORT
+    io.pi_sel.pc_domain = dev->domain;
+#endif
     io.pi_sel.pc_bus = dev->bus;
     io.pi_sel.pc_dev = dev->dev;
     io.pi_sel.pc_func = dev->func;
@@ -467,7 +480,11 @@ pci_system_freebsd_create( void )
     for ( i = 0; i < pciconfio.num_matches; i++ ) {
 	struct pci_conf *p = &pciconf[ i ];
 
-	pci_sys->devices[ i ].base.domain = 0; /* XXX */
+#if DOMAIN_SUPPORT
+	pci_sys->devices[ i ].base.domain = p->pc_sel.pc_domain;
+#else
+	pci_sys->devices[ i ].base.domain = 0;
+#endif
 	pci_sys->devices[ i ].base.bus = p->pc_sel.pc_bus;
 	pci_sys->devices[ i ].base.dev = p->pc_sel.pc_dev;
 	pci_sys->devices[ i ].base.func = p->pc_sel.pc_func;

commit 7d809e149b59f22e24723db7360a4c38a9145b45
Author: Eric Anholt <eric@anholt.net>
Date:   Tue Oct 9 12:13:49 2007 -0700

    FreeBSD: Fix unmap_range to return an error value.

diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index be934a8..b703936 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -120,7 +120,7 @@ pci_device_freebsd_map_range(struct pci_device *dev,
     return err;
 }
 
-static void
+static int
 pci_device_freebsd_unmap_range( struct pci_device *dev,
 				struct pci_device_mapping *map )
 {
@@ -144,7 +144,7 @@ pci_device_freebsd_unmap_range( struct pci_device *dev,
 	close(fd);
     }
 
-    pci_device_generic_unmap_range(dev, map);
+    return pci_device_generic_unmap_range(dev, map);
 }
 
 static int

commit 042735df2aa5846fcabfd74c5f73877132728b25
Author: Eric Anholt <eric@anholt.net>
Date:   Tue Oct 9 12:12:34 2007 -0700

    FreeBSD: don't set the MTRR if it's the default mode (uncacheable).

diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index 84a0a78..be934a8 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -108,8 +108,11 @@ pci_device_freebsd_map_range(struct pci_device *dev,
     mro.mo_desc = &mrd;
     mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
 
-    if (ioctl(fd, MEMRANGE_SET, &mro)) {
-	fprintf(stderr, "failed to set mtrr: %s\n", strerror(errno));
+    /* No need to set an MTRR if it's the default mode. */
+    if (mrd.mr_flags != MDF_UNCACHEABLE) {
+	if (ioctl(fd, MEMRANGE_SET, &mro)) {
+	    fprintf(stderr, "failed to set mtrr: %s\n", strerror(errno));
+	}
     }
 
     close(fd);


Reply to: