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:04:56 +01:00
parent dfac8545b9
commit f3d98022a0
5 changed files with 3 additions and 133 deletions

View File

@@ -59,20 +59,8 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18 xproto >= 7.0.22 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_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

View File

@@ -215,12 +215,7 @@ typedef struct _ASTPortPrivRec{
typedef struct _ASTRec {
EntityInfoPtr pEnt;
#ifndef XSERVER_LIBPCIACCESS
pciVideoPtr PciInfo;
PCITAG PciTag;
#else
struct pci_device *PciInfo;
#endif
struct pci_device *PciInfo;
OptionInfoPtr Options;
DisplayModePtr ModePtr;

View File

@@ -224,16 +224,6 @@ ASTProbe(DriverPtr drv, int flags)
return FALSE;
}
#ifndef XSERVER_LIBPCIACCESS
/*
* This probing is just checking the PCI data the server already
* collected.
*/
if (xf86GetPciVideoInfo() == NULL) {
return FALSE;
}
#endif
numUsed = xf86MatchPciInstances(AST_NAME, PCI_VENDOR_AST,
ASTChipsets, ASTPciChipsets,
devSections, numDevSections,
@@ -251,7 +241,6 @@ ASTProbe(DriverPtr drv, int flags)
for (i = 0; i < numUsed; i++) {
ScrnInfoPtr pScrn = NULL;
#ifdef XSERVER_LIBPCIACCESS
{
struct pci_device *pPci = xf86GetPciInfoForEntity(usedChips[i]);
@@ -266,7 +255,6 @@ ASTProbe(DriverPtr drv, int flags)
return FALSE;
}
}
#endif
/* Allocate new ScrnInfoRec and claim the slot */
if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
@@ -378,11 +366,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
if (pEnt->location.type != BUS_PCI)
return FALSE;
#ifndef XSERVER_LIBPCIACCESS
if (xf86RegisterResources(pEnt->index, 0, ResExclusive))
return FALSE;
#endif
#if !(defined(__sparc__)) && !(defined(__mips__))
/* The vgahw module should be loaded here when needed */
if (!xf86LoadSubModule(pScrn, "vgahw"))
@@ -436,10 +419,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->progClock = TRUE;
pScrn->rgbBits = 6;
pScrn->monitor = pScrn->confScreen->monitor; /* should be initialized before set gamma */
#ifndef XSERVER_LIBPCIACCESS
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
pScrn->racIoFlags = RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
#endif
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
@@ -473,10 +452,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
pAST = ASTPTR(pScrn);
pAST->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pAST->PciInfo = xf86GetPciInfoForEntity(pAST->pEnt->index);
#ifndef XSERVER_LIBPCIACCESS
pAST->PciTag = pciTag(pAST->PciInfo->bus, pAST->PciInfo->device,
pAST->PciInfo->func);
#endif
/* Process the options
* pScrn->confScreen, pScrn->display, pScrn->monitor, pScrn->numEntities,
@@ -746,12 +721,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
}
#endif
#ifndef XSERVER_LIBPCIACCESS
/* We won't be using the VGA access after the probe */
xf86SetOperatingState(resVgaIo, pAST->pEnt->index, ResUnusedOpr);
xf86SetOperatingState(resVgaMem, pAST->pEnt->index, ResDisableOpr);
#endif
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 /* ASTPCIRENAME_H */

View File

@@ -53,11 +53,6 @@ ASTMapMem(ScrnInfoPtr pScrn)
{
ASTRecPtr pAST = ASTPTR(pScrn);
#ifndef XSERVER_LIBPCIACCESS
pAST->FBVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
pAST->PciTag,
pAST->FBPhysAddr, pAST->FbMapSize);
#else
{
void** result = (void**)&pAST->FBVirtualAddr;
int err = pci_device_map_range(pAST->PciInfo,
@@ -70,7 +65,6 @@ ASTMapMem(ScrnInfoPtr pScrn)
if (err)
return FALSE;
}
#endif
if (!pAST->FBVirtualAddr)
return FALSE;
@@ -83,12 +77,7 @@ ASTUnmapMem(ScrnInfoPtr pScrn)
{
ASTRecPtr pAST = ASTPTR(pScrn);
#ifndef XSERVER_LIBPCIACCESS
xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->FBVirtualAddr,
pAST->FbMapSize);
#else
pci_device_unmap_range(pAST->PciInfo, pAST->FBVirtualAddr, pAST->FbMapSize);
#endif
pAST->FBVirtualAddr = 0;
@@ -99,21 +88,7 @@ Bool
ASTMapMMIO(ScrnInfoPtr pScrn)
{
ASTRecPtr pAST = ASTPTR(pScrn);
#ifndef XSERVER_LIBPCIACCESS
int mmioFlags;
#if !defined(__alpha__)
mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
#else
mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE;
#endif
pAST->MMIOVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
pAST->PciTag,
pAST->MMIOPhysAddr, pAST->MMIOMapSize);
#else
{
void** result = (void**)&pAST->MMIOVirtualAddr;
int err = pci_device_map_range(pAST->PciInfo,
@@ -126,7 +101,6 @@ ASTMapMMIO(ScrnInfoPtr pScrn)
return FALSE;
}
#endif
if (!pAST->MMIOVirtualAddr)
return FALSE;
@@ -137,15 +111,6 @@ void
ASTUnmapMMIO(ScrnInfoPtr pScrn)
{
ASTRecPtr pAST = ASTPTR(pScrn);
#ifndef XSERVER_LIBPCIACCESS
xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->MMIOVirtualAddr,
pAST->MMIOMapSize);
#else
pci_device_unmap_range(pAST->PciInfo, pAST->MMIOVirtualAddr, pAST->MMIOMapSize);
#endif
pAST->MMIOVirtualAddr = 0;
}