mirror of
https://github.com/X11Libre/xf86-video-s3virge.git
synced 2026-03-24 01:24:29 +00:00
drop hacks for ancient pre-libpciaccess Xservers
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
17
configure.ac
17
configure.ac
@@ -61,21 +61,8 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
|
||||
# Obtain compiler/linker options for the driver dependencies
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18 xproto fontsproto $REQUIRED_MODULES])
|
||||
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1])
|
||||
|
||||
# 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])
|
||||
|
||||
|
||||
@@ -272,9 +272,6 @@ typedef struct tagS3VRec {
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
/* PCI info vars. */
|
||||
pciVideoPtr PciInfo;
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
PCITAG PciTag;
|
||||
#endif
|
||||
/* Chip info, set using PCI */
|
||||
/* above. */
|
||||
int Chipset;
|
||||
|
||||
@@ -305,13 +305,8 @@ static unsigned char *find_bios_string(S3VPtr ps3v, int BIOSbase,
|
||||
|
||||
if (!init) {
|
||||
init = 1;
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86ReadDomainMemory(ps3v->PciTag, BIOSbase, BIOS_BSIZE, bios) != BIOS_BSIZE)
|
||||
return NULL;
|
||||
#else
|
||||
if (pci_device_read_rom(ps3v->PciInfo, bios))
|
||||
return NULL;
|
||||
#endif
|
||||
if ((bios[0] != 0x55) || (bios[1] != 0xaa))
|
||||
return NULL;
|
||||
}
|
||||
@@ -403,12 +398,6 @@ S3VProbe(DriverPtr drv, int flags)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (xf86GetPciVideoInfo() == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
numUsed = xf86MatchPciInstances(S3VIRGE_NAME, PCI_S3_VENDOR_ID,
|
||||
S3VChipsets, S3VPciChipsets, devSections,
|
||||
numDevSections, drv, &usedChips);
|
||||
@@ -772,14 +761,6 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (pEnt->resources) {
|
||||
free(pEnt);
|
||||
S3VFreeRec(pScrn);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USE_INT10
|
||||
if (xf86LoadSubModule(pScrn, "int10")) {
|
||||
xf86Int10InfoPtr pInt;
|
||||
@@ -795,11 +776,6 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
}
|
||||
|
||||
ps3v->PciInfo = xf86GetPciInfoForEntity(pEnt->index);
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
xf86RegisterResources(pEnt->index,NULL,ResNone);
|
||||
xf86SetOperatingState(resVgaIo, pEnt->index, ResUnusedOpr);
|
||||
xf86SetOperatingState(resVgaMem, pEnt->index, ResDisableOpr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the Chipset and ChipRev, allowing config file entries to
|
||||
@@ -851,11 +827,6 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset);
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
ps3v->PciTag = pciTag(ps3v->PciInfo->bus, ps3v->PciInfo->device,
|
||||
ps3v->PciInfo->func);
|
||||
#endif
|
||||
|
||||
/* Handle XVideo after we know chipset, so we can give an */
|
||||
/* intelligent comment about support */
|
||||
if (xf86IsOptionSet(ps3v->Options, OPTION_XVIDEO))
|
||||
@@ -2137,17 +2108,6 @@ S3VMapMem(ScrnInfoPtr pScrn)
|
||||
/* so that we can use registers map */
|
||||
/* structure - see newmmio.h */
|
||||
/* around 0x10000 from MemBase */
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
ps3v->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, ps3v->PciTag,
|
||||
PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) + S3_NEWMMIO_REGBASE,
|
||||
S3_NEWMMIO_REGSIZE);
|
||||
|
||||
ps3v->MapBaseDense = xf86MapPciMem(pScrn->scrnIndex,
|
||||
VIDMEM_MMIO_32BIT,
|
||||
ps3v->PciTag,
|
||||
PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM) + S3_NEWMMIO_REGBASE,
|
||||
0x8000);
|
||||
#else
|
||||
{
|
||||
void** result = (void**)&ps3v->MapBase;
|
||||
int err = pci_device_map_range(ps3v->PciInfo,
|
||||
@@ -2160,7 +2120,6 @@ S3VMapMem(ScrnInfoPtr pScrn)
|
||||
return FALSE;
|
||||
}
|
||||
ps3v->MapBaseDense = ps3v->MapBase;
|
||||
#endif
|
||||
|
||||
if( !ps3v->MapBase ) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -2169,12 +2128,6 @@ S3VMapMem(ScrnInfoPtr pScrn)
|
||||
}
|
||||
/* Map the framebuffer */
|
||||
if (ps3v->videoRambytes) { /* not set in PreInit() */
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
ps3v->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
|
||||
ps3v->PciTag, PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM),
|
||||
ps3v->videoRambytes );
|
||||
|
||||
#else
|
||||
{
|
||||
void** result = (void**)&ps3v->FBBase;
|
||||
int err = pci_device_map_range(ps3v->PciInfo,
|
||||
@@ -2187,7 +2140,6 @@ S3VMapMem(ScrnInfoPtr pScrn)
|
||||
if (err)
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( !ps3v->FBBase ) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
@@ -2246,24 +2198,11 @@ S3VUnmapMem(ScrnInfoPtr pScrn)
|
||||
ps3v->PrimaryVidMapped = FALSE;
|
||||
}
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->MapBase,
|
||||
S3_NEWMMIO_REGSIZE);
|
||||
#else
|
||||
pci_device_unmap_range(ps3v->PciInfo, ps3v->MapBase,
|
||||
S3_NEWMMIO_REGSIZE);
|
||||
#endif
|
||||
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
if (ps3v->FBBase)
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->FBBase,
|
||||
ps3v->videoRambytes);
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)ps3v->MapBaseDense,
|
||||
0x8000);
|
||||
#else
|
||||
pci_device_unmap_range(ps3v->PciInfo, ps3v->FBBase,
|
||||
ps3v->videoRambytes);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 /* CIRPCIRENAME_H */
|
||||
|
||||
Reference in New Issue
Block a user