diff options
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | hw/xfree86/common/Makefile.am | 9 | ||||
-rw-r--r-- | hw/xfree86/common/xf86.h | 10 | ||||
-rw-r--r-- | hw/xfree86/common/xf86AutoConfig.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Bus.c | 18 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Configure.c | 6 | ||||
-rw-r--r-- | hw/xfree86/common/xf86DPMS.c | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 7 | ||||
-rw-r--r-- | hw/xfree86/common/xf86fbBus.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86str.h | 7 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Cursors.c | 1 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/Makefile.am | 5 | ||||
-rwxr-xr-x | hw/xfree86/sdksyms.sh | 10 | ||||
-rw-r--r-- | include/xorg-config.h.in | 3 |
15 files changed, 74 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index 2edeb4da0..004c08de5 100644 --- a/configure.ac +++ b/configure.ac @@ -638,6 +638,7 @@ AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build X AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes]) +AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes]) dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) @@ -1573,6 +1574,9 @@ if test "x$XORG" = xyes; then xorg_bus_bsdpci=no xorg_bus_sparc=no + AC_MSG_CHECKING([whether to build Xorg PCI functions]) + if test "x$PCI" = xyes; then + PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" @@ -1589,6 +1593,9 @@ if test "x$XORG" = xyes; then xorg_bus_sparc="yes" ;; esac + fi + AC_MSG_RESULT([$PCI]) + dnl =================================================================== dnl ==================== end of PCI configuration ===================== dnl =================================================================== @@ -1768,6 +1775,7 @@ if test "x$XORG" = xyes; then AC_SUBST([abi_extension]) fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) +AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes]) AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index 23ddb5c34..a27372103 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -1,5 +1,10 @@ noinst_LTLIBRARIES = libcommon.la +if XORG_BUS_PCI +PCI_SOURCES = xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \ + xf86VGAarbiterPriv.h +endif + if XORG_BUS_SPARC SBUS_SOURCES = xf86sbusBus.c endif @@ -19,7 +24,7 @@ endif RANDRSOURCES = xf86RandR.c -BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) +BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes @@ -33,7 +38,7 @@ AM_LDFLAGS = -r libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ xf86Cursor.c $(DGASOURCES) xf86DPMS.c \ xf86Events.c xf86Globals.c xf86AutoConfig.c \ - xf86Option.c xf86Init.c xf86VGAarbiter.c \ + xf86Option.c xf86Init.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ xf86Mode.c xorgHelper.c \ diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index da9287bd4..3185baf3a 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -92,6 +92,7 @@ extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ #ifndef _NO_XF86_PROTOTYPES /* PCI related */ +#ifdef XSERVER_LIBPCIACCESS #include <pciaccess.h> extern _X_EXPORT Bool pciSlotClaimed; @@ -118,6 +119,15 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,PciChipsets *p_chip, void *dummy, EntityProc init, EntityProc enter, EntityProc leave, pointer private); +#else +#define xf86VGAarbiterInit() do {} while (0) +#define xf86VGAarbiterFini() do {} while (0) +#define xf86VGAarbiterLock(x) do {} while (0) +#define xf86VGAarbiterUnlock(x) do {} while (0) +#define xf86VGAarbiterScrnInit(x) do {} while (0) +#define xf86VGAarbiterDeviceDecodes() do {} while (0) +#define xf86VGAarbiterWrapFunctions() do {} while (0) +#endif /* xf86Bus.c */ diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 5c6e7210c..7fc6518d3 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -255,9 +255,9 @@ listPossibleVideoDrivers(char *matches[], int nmatches) matches[i++] = xnfstrdup(sbusDriver); } #endif - +#ifdef XSERVER_LIBPCIACCESS i = xf86PciMatchDriver(matches, nmatches); - +#endif /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 8749a2981..c665a2019 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -47,8 +47,9 @@ #define XF86_OS_PRIVS #include "xf86_OSproc.h" +#ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" - +#endif /* Entity data */ EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */ int xf86NumEntities = 0; @@ -75,7 +76,7 @@ Bool xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) { Bool foundScreen = FALSE; - +#ifdef XSERVER_LIBPCIACCESS if (drv->PciProbe != NULL) { if (xf86DoConfigure && xf86DoConfigurePass1) { assert(detect_only); @@ -86,7 +87,7 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) foundScreen = xf86PciProbeDev(drv); } } - +#endif if (!foundScreen && (drv->Probe != NULL)) { xf86Msg( X_WARNING, "Falling back to old probe method for %s\n", drv->driverName); @@ -195,7 +196,9 @@ xf86BusConfig(void) void xf86BusProbe(void) { +#ifdef XSERVER_LIBPCIACCESS xf86PciProbe(); +#endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) xf86SbusProbe(); #endif @@ -504,9 +507,14 @@ xf86PostProbe(void) { int i; - if (fbSlotClaimed && (pciSlotClaimed + if (fbSlotClaimed && ( #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) - || sbusSlotClaimed + sbusSlotClaimed || +#endif +#ifdef XSERVER_LIBPCIACCESS + pciSlotClaimed +#else + TRUE #endif )) FatalError("Cannot run in framebuffer mode. Please specify busIDs " diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index f8c1b6567..5c46152b2 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2398,7 +2398,7 @@ xf86HandleConfigFile(Bool autoconfig) } xf86ProcessOptions(-1, xf86ConfigLayout.options, LayoutOptions); - +#ifdef XSERVER_LIBPCIACCESS if ((scanptr = xf86GetOptValString(LayoutOptions, LAYOUT_ISOLATEDEVICE))) { ; /* IsolateDevice specified; overrides SingleCard */ } else { @@ -2413,7 +2413,7 @@ xf86HandleConfigFile(Bool autoconfig) } else xf86PciIsolateDevice(scanptr); } - +#endif /* Now process everything else */ if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){ ErrorF ("Problem when converting the config data structures\n"); diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index ab0751507..99b8b48d7 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -87,9 +87,11 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int /* Check for duplicates */ for (i = 0; i < nDevToConfig; i++) { switch (bus) { +#ifdef XSERVER_LIBPCIACCESS case BUS_PCI: ret = xf86PciConfigure(busData, DevToConfig[i].pVideo); - break; + break; +#endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: ret = xf86SbusConfigure(busData, DevToConfig[i].sVideo); @@ -118,10 +120,12 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int for (j = 0; (DevToConfig[i].GDev.driver[j] = tolower(driver[j])); j++); switch (bus) { +#ifdef XSERVER_LIBPCIACCESS case BUS_PCI: xf86PciConfigureNewDev(busData, DevToConfig[i].pVideo, &DevToConfig[i].GDev, &chipset); break; +#endif #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: xf86SbusConfigureNewDev(busData, DevToConfig[i].sVideo, diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c index cd025dca4..613c7cf73 100644 --- a/hw/xfree86/common/xf86DPMS.c +++ b/hw/xfree86/common/xf86DPMS.c @@ -42,8 +42,9 @@ #include <X11/extensions/dpmsconst.h> #include "dpmsproc.h" #endif +#ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" - +#endif #ifdef DPMSExtension static DevPrivateKeyRec DPMSKeyRec; diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 350918dfe..74e0bc220 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -78,7 +78,9 @@ #include "picturestr.h" #include "xf86Bus.h" +#ifdef XSERVER_LIBPCIACCESS #include "xf86VGAarbiter.h" +#endif #include "globals.h" #include "xserver-properties.h" @@ -88,7 +90,6 @@ #endif #include <hotplug.h> - #ifdef XF86PM void (*xf86OSPMClose)(void) = NULL; #endif @@ -1355,6 +1356,7 @@ ddxProcessArgument(int argc, char **argv, int i) xf86DoShowOptions = TRUE; return 1; } +#ifdef XSERVER_LIBPCIACCESS if (!strcmp(argv[i], "-isolateDevice")) { CHECK_FOR_REQUIRED_ARGUMENT(); @@ -1364,6 +1366,7 @@ ddxProcessArgument(int argc, char **argv, int i) xf86PciIsolateDevice(argv[i]); return 2; } +#endif /* Notice cmdline xkbdir, but pass to dix as well */ if (!strcmp(argv[i], "-xkbdir")) { @@ -1432,7 +1435,9 @@ ddxUseMsg(void) #endif ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); +#ifdef XSERVER_LIBPCIACCESS ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); +#endif ErrorF("-version show the server version\n"); ErrorF("-showDefaultModulePath show the server default module path\n"); ErrorF("-showDefaultLibPath show the server default library path\n"); diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c index 059e378e3..45929804f 100644 --- a/hw/xfree86/common/xf86fbBus.c +++ b/hw/xfree86/common/xf86fbBus.c @@ -54,8 +54,10 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) EntityPtr p; int num; +#ifdef XSERVER_LIBPCIACCESS if (pciSlotClaimed) return -1; +#endif #if defined(__sparc__) || defined (__sparc64__) if (sbusSlotClaimed) return -1; diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 43e9d1d35..e2ca55875 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -41,9 +41,6 @@ #include "colormapst.h" #include "xf86Module.h" #include "xf86Opt.h" -#include "xf86Pci.h" - -#include <pciaccess.h> /** * Integer type that is of the size of the addressable memory (machine size). @@ -309,6 +306,8 @@ typedef struct { struct _SymTabRec; struct _PciChipsets; +struct pci_device; + typedef struct _DriverRec { int driverVersion; char * driverName; @@ -350,8 +349,6 @@ typedef enum { BUS_last /* Keep last */ } BusType; -struct pci_device; - typedef struct { int fbNum; } SbusBusId; diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 4a03428ea..669da0d5b 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -33,6 +33,7 @@ #include <string.h> #include <stdio.h> +#include <X11/Xarch.h> #include "xf86.h" #include "xf86DDC.h" #include "xf86Crtc.h" diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index 16c10213c..e09d4d21f 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -1,7 +1,10 @@ noinst_LTLIBRARIES = libbus.la sdk_HEADERS = xf86Pci.h -PCI_SOURCES = Pci.c Pci.h +PCI_SOURCES = +if XORG_BUS_PCI +PCI_SOURCES += Pci.c Pci.h +endif if XORG_BUS_BSDPCI PCI_SOURCES += bsd_pci.c diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index 1755f0233..b8e7023f3 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -120,14 +120,16 @@ cat > sdksyms.c << EOF #include "xf86.h" #include "xf86Module.h" #include "xf86Opt.h" -#include "xf86PciInfo.h" +#ifdef XSERVER_LIBPCIACCESS + #include "xf86PciInfo.h" + #include "xf86VGAarbiter.h" +#endif #include "xf86Priv.h" #include "xf86Privstr.h" #include "xf86cmap.h" #include "xf86fbman.h" #include "xf86str.h" #include "xf86Xinput.h" -#include "xf86VGAarbiter.h" #include "xisb.h" #if XV # include "xf86xv.h" @@ -172,7 +174,9 @@ cat > sdksyms.c << EOF /* hw/xfree86/os-support/bus/Makefile.am */ -#include "xf86Pci.h" +#ifdef XSERVER_LIBPCIACCESS +# include "xf86Pci.h" +#endif #if defined(__sparc__) || defined(__sparc) # include "xf86Sbus.h" #endif diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in index 33bf908d0..6b9230f3c 100644 --- a/include/xorg-config.h.in +++ b/include/xorg-config.h.in @@ -127,4 +127,7 @@ /* Build with libdrm support */ #undef WITH_LIBDRM +/* Use libpciaccess */ +#undef XSERVER_LIBPCIACCESS + #endif /* _XORG_CONFIG_H_ */ |