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

Bug#499501: xserver-xorg-core: does not detect video devices anymore (kfreebsd-amd64)



IMHO, it is a wrong way of testing. It should be changed as follows.
Should I file a separate bug report against libpciaccess ?

I'll try to get the patch applied upstream.

There is one more place to extend, please try to accept
attached patch, cleaner patch,

Petr
diff --git a/configure.ac b/configure.ac
index 67b18f4..1f41f30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,14 @@ if test "x$have_mtrr_h" = xyes; then
     AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
 fi
 
+dnl check for the pci_io.pi_sel.pc_domain
+AC_CHECK_MEMBER([struct pci_io.pi_sel.pc_domain],
+               [AC_DEFINE(HAVE_PCI_IO_PC_DOMAIN,1,[Have the pci_io.pi_sel.pc_domain member.])],
+               [],
+               [ #include <sys/types.h>
+                 #include <sys/pciio.h>
+               ])
+
 AC_SUBST(PCIACCESS_CFLAGS)
 AC_SUBST(PCIACCESS_LIBS)
 		  
diff --git a/src/common_init.c b/src/common_init.c
index ff24183..8a12691 100644
--- a/src/common_init.c
+++ b/src/common_init.c
@@ -54,7 +54,7 @@ pci_system_init( void )
     
 #ifdef linux
     err = pci_system_linux_sysfs_create();
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
     err = pci_system_freebsd_create();
 #elif defined(__OpenBSD__)
     err = pci_system_openbsd_create();
diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c
index 4b8f7ba..352cac7 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -43,12 +43,6 @@
 #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"
 
@@ -168,7 +162,7 @@ pci_device_freebsd_read( struct pci_device * dev, void * data,
 {
     struct pci_io io;
 
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
     io.pi_sel.pc_domain = dev->domain;
 #endif
     io.pi_sel.pc_bus = dev->bus;
@@ -208,7 +202,7 @@ pci_device_freebsd_write( struct pci_device * dev, const void * data,
 {
     struct pci_io io;
 
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
     io.pi_sel.pc_domain = dev->domain;
 #endif
     io.pi_sel.pc_bus = dev->bus;
@@ -488,7 +482,7 @@ pci_system_freebsd_create( void )
     for ( i = 0; i < pciconfio.num_matches; i++ ) {
 	struct pci_conf *p = &pciconf[ i ];
 
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
 	pci_sys->devices[ i ].base.domain = p->pc_sel.pc_domain;
 #else
 	pci_sys->devices[ i ].base.domain = 0;

Reply to: