drop support for ancient pre-libpciaccess code pathes

The Xserver's PCI handling is entirely based on libpciaccess for about
two decades now, building w/o it isn't possible anymore. The symbol
XSERVER_LIBPCIACCESS historically had been a just for the transition
period, so drivers could still compile with even older Xservers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-10 12:17:01 +01:00
committed by Enrico Weigelt
parent 72f64f1920
commit e2ac2877e7
4 changed files with 3 additions and 75 deletions

View File

@@ -71,18 +71,12 @@ AC_CHECK_FUNCS([strlcat strlcpy timingsafe_memcmp])
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
CPPFLAGS="$SAVE_CPPFLAGS"
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
fi
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
AC_SUBST([moduledir])

View File

@@ -17,10 +17,7 @@ typedef struct {
OptionInfoPtr Options;
Bool Voodoo2; /* Set if Voodoo2 */
pciVideoPtr PciInfo; /* PCI data */
#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
#endif
struct pci_device *PciInfo; /* PCI data */
CARD32 PhysBase;
CARD32 Width; /* Current width */

View File

@@ -234,9 +234,6 @@ VoodooProbe(DriverPtr drv, int flags)
}
/* PCI BUS */
#ifndef XSERVER_LIBPCIACCESS
if (xf86GetPciVideoInfo() )
#endif
{
numUsed = xf86MatchPciInstances(VOODOO_NAME, PCI_VENDOR_3DFX,
VoodooChipsets, VoodooPCIChipsets,
@@ -372,9 +369,6 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
pVoo->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pVoo->PciInfo = xf86GetPciInfoForEntity(pVoo->pEnt->index);
#ifndef XSERVER_LIBPCIACCESS
pVoo->PciTag = pciTag(pVoo->PciInfo->bus, pVoo->PciInfo->device, pVoo->PciInfo->func);
#endif
/* Collect all of the relevant option flags (fill in pScrn->options) */
xf86CollectOptions(pScrn, NULL);
@@ -424,13 +418,6 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
/* MMIO at 0 , FB at 4Mb, Texture at 8Mb */
pVoo->PhysBase = PCI_REGION_BASE(pVoo->PciInfo, 0, REGION_MEM) + 0x400000;
#ifndef XSERVER_LIBPCIACCESS
pVoo->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVoo->PciTag,
pVoo->PciInfo->memBase[0], 0x400000);
pVoo->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVoo->PciTag,
pVoo->PciInfo->memBase[0] + 0x400000, 0x400000);
#else
{
void** result = (void**)&pVoo->MMIO;
int err = pci_device_map_range(pVoo->PciInfo,
@@ -453,7 +440,6 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
if (err)
return FALSE;
}
#endif
VoodooHardwareInit(pVoo);
/*

View File

@@ -34,53 +34,6 @@ enum region_type {
REGION_IO
};
#ifndef XSERVER_LIBPCIACCESS
/* pciVideoPtr */
#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor)
#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType)
#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->chipRev)
#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor)
#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard)
#define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus, \
(_pcidev)->device, \
(_pcidev)->func)
#define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus)
#define PCI_DEV_DEV(_pcidev) ((_pcidev)->device)
#define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func)
/* pciConfigPtr */
#define PCI_CFG_TAG(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->tag)
#define PCI_CFG_BUS(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->busnum)
#define PCI_CFG_DEV(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->devnum)
#define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum)
/* region addr: xfree86 uses different fields for memory regions and I/O ports */
#define PCI_REGION_BASE(_pcidev, _b, _type) \
(((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \
: (_pcidev)->ioBase[(_b)])
/* region size: xfree86 uses the log2 of the region size,
* but with zero meaning no region, not size of one XXX */
#define PCI_REGION_SIZE(_pcidev, _b) \
(((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0)
/* read/write PCI configuration space */
#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
*(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset))
#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
*(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset))
#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value))
#else /* XSERVER_LIBPCIACCESS */
typedef struct pci_device *pciVideoPtr;
#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id)
#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->device_id)
#define PCI_DEV_REVISION(_pcidev) ((_pcidev)->revision)
@@ -117,6 +70,4 @@ typedef struct pci_device *pciVideoPtr;
#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
pci_device_cfg_write_u32((_pcidev), (_value), (_offset))
#endif /* XSERVER_LIBPCIACCESS */
#endif /* VOODOOPCIRENAME_H */