drop hacks for ancient pre-libpciaccess Xservers

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-18 15:31:09 +01:00
parent 382f1c4e77
commit cf83d1892f
4 changed files with 2 additions and 133 deletions

View File

@@ -54,20 +54,8 @@ AC_ARG_WITH(xorg-module-dir,
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18 xproto fontsproto $REQUIRED_MODULES])
# Checks for libraries.
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
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

@@ -185,9 +185,6 @@ typedef struct neoRec
{
int NeoChipset;
pciVideoPtr PciInfo;
#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
#endif
EntityInfoPtr pEnt;
NEOACLRec Accel;
unsigned long NeoMMIOAddr;

View File

@@ -487,9 +487,6 @@ NEOProbe(DriverPtr drv, int flags)
}
/* PCI BUS */
#ifndef XSERVER_LIBPCIACCESS
if (xf86GetPciVideoInfo() )
#endif
{
numUsed = xf86MatchPciInstances(NEO_NAME, PCI_VENDOR_NEOMAGIC,
NEOChipsets, NEOPCIchipsets,
@@ -589,20 +586,12 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
/* This is the general case */
for (i = 0; i<pScrn->numEntities; i++) {
nPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
#ifndef XSERVER_LIBPCIACCESS
if (nPtr->pEnt->resources) return FALSE;
#endif
nPtr->NeoChipset = nPtr->pEnt->chipset;
pScrn->chipset = (char *)xf86TokenToString(NEOChipsets,
nPtr->pEnt->chipset);
/* This driver can handle PCI buses */
if (nPtr->pEnt->location.type == BUS_PCI) {
nPtr->PciInfo = xf86GetPciInfoForEntity(nPtr->pEnt->index);
#ifndef XSERVER_LIBPCIACCESS
nPtr->PciTag = pciTag(nPtr->PciInfo->bus,
nPtr->PciInfo->device,
nPtr->PciInfo->func);
#endif
}
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chipset is a ");
@@ -1073,12 +1062,6 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
nPtr->NeoMMIOAddr2);
}
}
#ifndef XSERVER_LIBPCIACCESS
/* XXX What about VGA resources in OPERATING mode? */
if (xf86RegisterResources(nPtr->pEnt->index, NULL, ResExclusive))
RETURN;
#endif
}
else
RETURN;
@@ -1339,9 +1322,6 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
NEOACLPtr nAcl;
VisualPtr visual;
int allocatebase, freespace, currentaddr;
#ifndef XSERVER_LIBPCIACCESS
unsigned int racflag = RAC_FB;
#endif
unsigned char *FBStart;
int height, width, displayWidth;
@@ -1575,14 +1555,6 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
#ifndef XSERVER_LIBPCIACCESS
racflag |= RAC_COLORMAP;
if (nPtr->NeoHWCursorInitialized)
racflag |= RAC_CURSOR;
pScrn->racIoFlags = pScrn->racMemFlags = racflag;
#endif
NEOInitVideo(pScreen);
pScreen->SaveScreen = NEOSaveScreen;
@@ -1820,20 +1792,6 @@ neoMapMem(ScrnInfoPtr pScrn)
if (!nPtr->noMMIO) {
if (nPtr->pEnt->location.type == BUS_PCI){
#ifndef XSERVER_LIBPCIACCESS
nPtr->NeoMMIOBase =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
nPtr->PciTag, nPtr->NeoMMIOAddr,
0x200000L);
if (nPtr->NeoMMIOAddr2 != 0){
nPtr->NeoMMIOBase2 =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
nPtr->PciTag, nPtr->NeoMMIOAddr2,
0x100000L);
}
#else
void** result = (void**)&nPtr->NeoMMIOBase;
int err = pci_device_map_range(nPtr->PciInfo,
nPtr->NeoMMIOAddr,
@@ -1854,7 +1812,6 @@ neoMapMem(ScrnInfoPtr pScrn)
if (err)
return FALSE;
}
#endif
} else
#ifdef VIDMEM_MMIO
nPtr->NeoMMIOBase =
@@ -1867,14 +1824,6 @@ neoMapMem(ScrnInfoPtr pScrn)
}
if (nPtr->pEnt->location.type == BUS_PCI)
#ifndef XSERVER_LIBPCIACCESS
nPtr->NeoFbBase =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
nPtr->PciTag,
(unsigned long)nPtr->NeoLinearAddr,
nPtr->NeoFbMapSize);
#else
{
void** result = (void**)&nPtr->NeoFbBase;
int err = pci_device_map_range(nPtr->PciInfo,
@@ -1886,7 +1835,6 @@ neoMapMem(ScrnInfoPtr pScrn)
if (err)
return FALSE;
}
#endif
else
#ifdef VIDMEM_FRAMEBUFFER
nPtr->NeoFbBase =
@@ -1908,30 +1856,13 @@ neoUnmapMem(ScrnInfoPtr pScrn)
{
NEOPtr nPtr = NEOPTR(pScrn);
#ifndef XSERVER_LIBPCIACCESS
if (nPtr->NeoMMIOBase)
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)nPtr->NeoMMIOBase,
0x200000L);
#else
if (nPtr->NeoMMIOBase)
pci_device_unmap_range(nPtr->PciInfo, (pointer)nPtr->NeoMMIOBase, 0x200000L);
#endif
nPtr->NeoMMIOBase = NULL;
#ifndef XSERVER_LIBPCIACCESS
if (nPtr->NeoMMIOBase2)
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)nPtr->NeoMMIOBase2,
0x100000L);
#else
if (nPtr->NeoMMIOBase2)
pci_device_unmap_range(nPtr->PciInfo, (pointer)nPtr->NeoMMIOBase2, 0x100000L);
#endif
nPtr->NeoMMIOBase2 = NULL;
#ifndef XSERVER_LIBPCIACCESS
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)nPtr->NeoFbBase,
nPtr->NeoFbMapSize);
#else
pci_device_unmap_range(nPtr->PciInfo, (pointer)nPtr->NeoFbBase, nPtr->NeoFbMapSize);
#endif
nPtr->NeoFbBase = NULL;
return TRUE;

View File

@@ -34,51 +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)
@@ -117,6 +72,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 /* NEOPCIRENAME_H */