From 06c0372c3a1b45005eb6d50406f77f4e93f1de1e Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 12 Mar 2008 21:45:37 +0100 Subject: [PATCH] OpenBSD support for libpciaccess. xserver and libpciaccess both need to open /dev/xf86, which can only be opened once. I implemented pci_system_init_dev_mem() like Ian suggested. This requires some minor changes to the BSD-specific os-support code. Since pci_system_init_dev_mem() is a no-op on FreeBSD this should be no problem. --- hw/xfree86/os-support/bsd/i386_video.c | 3 +++ hw/xfree86/os-support/bus/bsd_pci.c | 2 ++ hw/xfree86/utils/ioport/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index 0dcff6631..7e4a4d2a3 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_video.c @@ -212,6 +212,9 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->mapMem = mapVidMem; pVidMem->unmapMem = unmapVidMem; + if (useDevMem) + pci_system_init_dev_mem(devMemFd); + #ifdef HAS_MTRR_SUPPORT if (useDevMem) { if (cleanMTRR()) { diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c index bceb1087f..57ad09b6a 100644 --- a/hw/xfree86/os-support/bus/bsd_pci.c +++ b/hw/xfree86/os-support/bus/bsd_pci.c @@ -81,4 +81,6 @@ bsdPciInit(void) { pciNumBuses = 1; pciBusInfo[0] = &bsd_pci; + + xf86InitVidMem(); } diff --git a/hw/xfree86/utils/ioport/Makefile.am b/hw/xfree86/utils/ioport/Makefile.am index c1f9453a8..12f861372 100644 --- a/hw/xfree86/utils/ioport/Makefile.am +++ b/hw/xfree86/utils/ioport/Makefile.am @@ -37,7 +37,7 @@ ioport_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) ioport_LDADD = \ ../../os-support/libxorgos.la \ ../../dummylib/libdummy-nonserver.a \ - ${UTILS_SYS_LIBS} + ${UTILS_SYS_LIBS} ${PCIACCESS_LIBS} ioport_SOURCES = \