mirror of
https://github.com/X11Libre/xf86-video-sis.git
synced 2026-03-24 01:25:01 +00:00
drop SIS_NEED_MAP_IOP code paths
This is known to be broken and never had been activated, so not needed anymore. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis/-/merge_requests/11>
This commit is contained in:
committed by
Alan Coopersmith
parent
2ecda6541e
commit
07a8549e05
17
src/sis.h
17
src/sis.h
@@ -110,20 +110,13 @@
|
||||
#define SIS_USE_BIOS_SCRATCH
|
||||
#endif
|
||||
|
||||
/* SIS_NEED_MAP_IOP: Map i/o port area to virtual memory? */
|
||||
/* List of architectures likely to be incomplete */
|
||||
/* This is BROKEN, see comment in sis_driver.c */
|
||||
#undef SIS_NEED_MAP_IOP
|
||||
|
||||
/* SISUSEDEVPORT: Used on architectures without direct inX/outX access. In this case,
|
||||
* we use read()/write() to /dev/port. LINUX ONLY! (How can this be done on *BSD?)
|
||||
*/
|
||||
#undef SISUSEDEVPORT
|
||||
#if defined(SIS_LINUX) && (defined(__arm32__) || defined(__mips__))
|
||||
#ifndef SIS_NEED_MAP_IOP
|
||||
#define SISUSEDEVPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Our #includes: Require the arch/platform dependent #defines above */
|
||||
|
||||
@@ -860,12 +853,6 @@ typedef struct {
|
||||
vidCopyFunc SiSFastVidCopy, SiSFastMemCopy;
|
||||
vidCopyFunc SiSFastVidCopyFrom, SiSFastMemCopyFrom;
|
||||
unsigned int CPUFlags;
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
CARD32 IOPAddress; /* I/O port physical address */
|
||||
void *IOPBase; /* I/O port linear address */
|
||||
UShort MapCountIOPBase; /* map/unmap queue counter */
|
||||
Bool forceUnmapIOPBase; /* ignore counter and unmap */
|
||||
#endif
|
||||
} SISEntRec, *SISEntPtr;
|
||||
#endif
|
||||
|
||||
@@ -1307,10 +1294,6 @@ typedef struct {
|
||||
ExtensionEntry *SiSCtrlExtEntry;
|
||||
char devsectname[32];
|
||||
Bool SCLogQuiet;
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
CARD32 IOPAddress; /* I/O port physical address */
|
||||
void *IOPBase; /* I/O port linear address */
|
||||
#endif
|
||||
#ifdef SISMERGED
|
||||
Bool MergedFB, MergedFBAuto;
|
||||
SiSScrn2Rel CRT2Position;
|
||||
|
||||
145
src/sis_driver.c
145
src/sis_driver.c
@@ -3206,38 +3206,6 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
PCI_DEV_FUNC(pSiS->PciInfo));
|
||||
#endif
|
||||
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
/********************************************/
|
||||
/* THIS IS BROKEN AND WON'T WORK */
|
||||
/* Reasons: */
|
||||
/* 1) MIPS and ARM have no i/o ports but */
|
||||
/* use memory mapped i/o only. The inX/outX */
|
||||
/* macros in compiler.h are smart enough to */
|
||||
/* add "IOPortBase" to the port number, but */
|
||||
/* "IOPortBase" is never initialized. */
|
||||
/* 2) IOPortBase is declared in compiler.h */
|
||||
/* itself. So until somebody fixes all */
|
||||
/* modules that #include compiler.h to set */
|
||||
/* IOPortBase, vga support for MIPS and ARM */
|
||||
/* is unusable. */
|
||||
/* (In this driver this is solvable because */
|
||||
/* we have our own vgaHW routines. However, */
|
||||
/* we use /dev/port for now instead.) */
|
||||
/********************************************/
|
||||
pSiS->IOPAddress = pSiS->PciInfo->ioBase[2];
|
||||
if(!SISMapIOPMem(pScrn)) {
|
||||
SISErrorLog(pScrn, "Could not map I/O port area at 0x%x\n", pSiS->IOPAddress);
|
||||
goto my_error_0;
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I/O port area mapped to %p, size 128\n", pSiS->IOPBase);
|
||||
#if defined(__mips__) || defined(__arm32__)
|
||||
/* inX/outX macros on these use IOPortBase as offset */
|
||||
/* This is entirely skrewed. */
|
||||
IOPortBase = (unsigned int)pSiS->IOPBase;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set up i/o port access (for non-x86) */
|
||||
#ifdef SISUSEDEVPORT
|
||||
if((sisdevport = open("/dev/port", O_RDWR, 0)) == -1) {
|
||||
@@ -6917,105 +6885,6 @@ my_error_0:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map I/O port area for non-PC platforms
|
||||
*/
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
static Bool
|
||||
SISMapIOPMem(ScrnInfoPtr pScrn)
|
||||
{
|
||||
SISPtr pSiS = SISPTR(pScrn);
|
||||
#ifdef SISDUALHEAD
|
||||
SISEntPtr pSiSEnt = pSiS->entityPrivate;
|
||||
|
||||
if(pSiS->DualHeadMode) {
|
||||
pSiSEnt->MapCountIOPBase++;
|
||||
if(!(pSiSEnt->IOPBase)) {
|
||||
/* Only map if not mapped previously */
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
pSiSEnt->IOPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
|
||||
pSiS->PciTag, pSiS->IOPAddress, 128);
|
||||
#else
|
||||
{
|
||||
void **result = (void **)&pSiSEnt->IOPBase;
|
||||
int err = pci_device_map_range(pSiS->PciInfo,
|
||||
pSiS->IOPAddress,
|
||||
128,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
result);
|
||||
|
||||
if (err) {
|
||||
xf86DrvMsg (pScrn->scrnIndex, X_ERROR,
|
||||
"Unable to map IO aperture. %s (%d)\n",
|
||||
strerror (err), err);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
pSiS->IOPBase = pSiSEnt->IOPBase;
|
||||
} else
|
||||
#endif
|
||||
#ifndef XSERVER_LIBPCIACCESS
|
||||
pSiS->IOPBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
|
||||
pSiS->PciTag, pSiS->IOPAddress, 128);
|
||||
#else
|
||||
{
|
||||
void **result = (void **)&pSiS->IOPBase;
|
||||
int err = pci_device_map_range(pSiS->PciInfo,
|
||||
pSiS->IOPAddress,
|
||||
128,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE,
|
||||
result);
|
||||
|
||||
if (err) {
|
||||
xf86DrvMsg (pScrn->scrnIndex, X_ERROR,
|
||||
"Unable to map IO aperture. %s (%d)\n",
|
||||
strerror (err), err);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(pSiS->IOPBase == NULL) {
|
||||
SISErrorLog(pScrn, "Could not map I/O port area\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
SISUnmapIOPMem(ScrnInfoPtr pScrn)
|
||||
{
|
||||
SISPtr pSiS = SISPTR(pScrn);
|
||||
#ifdef SISDUALHEAD
|
||||
SISEntPtr pSiSEnt = pSiS->entityPrivate;;
|
||||
#endif
|
||||
|
||||
/* In dual head mode, we must not unmap if the other head still
|
||||
* assumes memory as mapped
|
||||
*/
|
||||
#ifdef SISDUALHEAD
|
||||
if(pSiS->DualHeadMode) {
|
||||
if(pSiSEnt->MapCountIOPBase) {
|
||||
pSiSEnt->MapCountIOPBase--;
|
||||
if((pSiSEnt->MapCountIOPBase == 0) || (pSiSEnt->forceUnmapIOPBase)) {
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiSEnt->IOPBase, 2048);
|
||||
pSiSEnt->IOPBase = NULL;
|
||||
pSiSEnt->MapCountIOPBase = 0;
|
||||
pSiSEnt->forceUnmapIOPBase = FALSE;
|
||||
}
|
||||
pSiS->IOPBase = NULL;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pSiS->IOPBase, 2048);
|
||||
pSiS->IOPBase = NULL;
|
||||
#ifdef SISDUALHEAD
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Map the framebuffer and MMIO memory
|
||||
*/
|
||||
@@ -9945,20 +9814,6 @@ static void
|
||||
SISFreeScreen(FREE_SCREEN_ARGS_DECL)
|
||||
{
|
||||
SCRN_INFO_PTR(arg);
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
SISPtr pSiS = SISPTR(pScrn);
|
||||
|
||||
if(pSiS) {
|
||||
#ifdef SISDUALHEAD
|
||||
SISEntPtr pSiSEnt = pSiS->entityPrivate;
|
||||
if(pSiSEnt) {
|
||||
pSiSEnt->forceUnmapIOPBase = TRUE;
|
||||
}
|
||||
#endif
|
||||
SISUnmapIOPMem(pScrn);
|
||||
}
|
||||
#endif
|
||||
|
||||
SISFreeRec(pScrn);
|
||||
}
|
||||
|
||||
|
||||
@@ -1584,10 +1584,6 @@ static ModeStatus SISValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
|
||||
/* Internally used functions */
|
||||
static Bool SISMapMem(ScrnInfoPtr pScrn);
|
||||
static Bool SISUnmapMem(ScrnInfoPtr pScrn);
|
||||
#ifdef SIS_NEED_MAP_IOP
|
||||
static Bool SISMapIOPMem(ScrnInfoPtr pScrn);
|
||||
static Bool SISUnmapIOPMem(ScrnInfoPtr pScrn);
|
||||
#endif
|
||||
static void SISSave(ScrnInfoPtr pScrn);
|
||||
static void SISRestore(ScrnInfoPtr pScrn);
|
||||
static Bool SISModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
|
||||
|
||||
Reference in New Issue
Block a user