Fix botched xf86-video-neomagic 1.2.1 merge.

This commit is contained in:
matthieu 2008-09-14 21:47:55 +00:00
parent 2252cd2bcd
commit 87909c0e13
11 changed files with 71 additions and 22 deletions

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h,v 1.23tsi Exp $ */
/*
* The original Precision Insight driver for
@ -37,6 +36,9 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <string.h>
#include "neo_pcirename.h"
/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"
@ -201,7 +203,9 @@ typedef struct neoRec
{
int NeoChipset;
pciVideoPtr PciInfo;
#ifndef XSERVER_LIBPCIACCESS
PCITAG PciTag;
#endif
EntityInfoPtr pEnt;
XAAInfoRecPtr AccelInfoRec;
NEOACLRec Accel;

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2070.c,v 1.4 2002/04/04 14:05:44 eich Exp $ */
/*
* The original Precision Insight driver for

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2090.c,v 1.6 2002/04/04 14:05:44 eich Exp $ */
/*
* The original Precision Insight driver for

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2097.c,v 1.11 2002/10/30 12:52:21 alanh Exp $ */
/*
* The original Precision Insight driver for

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c,v 1.19tsi Exp $ */
/*
* The original Precision Insight driver for
* XFree86 v.3.3 has been sponsored by Red Hat.

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c,v 1.3 2002/01/25 21:56:05 tsi Exp $ */
/*
* The original Precision Insight driver for

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_cursor.c,v 1.8 2001/10/28 03:33:42 tsi Exp $ */
/*
* The original Precision Insight driver for

View File

@ -21,7 +21,6 @@
*
* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_dga.c,v 1.4 2001/10/01 13:44:07 eich Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"

View File

@ -30,7 +30,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright 2002 Shigehiro Nomura
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.74 2003/12/31 05:07:30 dawes Exp $ */
/*
* The original Precision Insight driver for
@ -84,7 +83,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "xf86cmap.h"
#include "fb.h"
#include "fbpseudocolor.h"
/* Needed by Resources Access Control (RAC) */
#include "xf86RAC.h"
@ -158,9 +156,9 @@ static int neoFindMode(int xres, int yres, int depth);
#define NEO_NAME "NEOMAGIC"
#define NEO_DRIVER_NAME "neomagic"
#define NEO_MAJOR_VERSION 1
#define NEO_MINOR_VERSION 1
#define NEO_PATCHLEVEL 1
#define NEO_MAJOR_VERSION PACKAGE_VERSION_MAJOR
#define NEO_MINOR_VERSION PACKAGE_VERSION_MINOR
#define NEO_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
/*
* This is intentionally screen-independent. It indicates the binding
@ -612,7 +610,10 @@ NEOProbe(DriverPtr drv, int flags)
}
/* PCI BUS */
if (xf86GetPciVideoInfo() ) {
#ifndef XSERVER_LIBPCIACCESS
if (xf86GetPciVideoInfo() )
#endif
{
numUsed = xf86MatchPciInstances(NEO_NAME, PCI_VENDOR_NEOMAGIC,
NEOChipsets, NEOPCIchipsets,
devSections,numDevSections,
@ -778,9 +779,11 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
/* This driver can handle ISA and 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 ");
@ -1221,7 +1224,7 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
if (nPtr->pEnt->location.type == BUS_PCI) {
if (!nPtr->NeoLinearAddr) {
nPtr->NeoLinearAddr = nPtr->PciInfo->memBase[0];
nPtr->NeoLinearAddr = PCI_REGION_BASE(nPtr->PciInfo, 0, REGION_MEM);
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"FB base address is set at 0x%lX.\n",
nPtr->NeoLinearAddr);
@ -1241,8 +1244,8 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags)
case NM2230:
case NM2360:
case NM2380:
nPtr->NeoMMIOAddr = nPtr->PciInfo->memBase[1];
nPtr->NeoMMIOAddr2 = nPtr->PciInfo->memBase[2];
nPtr->NeoMMIOAddr = PCI_REGION_BASE(nPtr->PciInfo, 1, REGION_MEM);
nPtr->NeoMMIOAddr2 = PCI_REGION_BASE(nPtr->PciInfo, 2, REGION_MEM);
break;
}
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
@ -1806,9 +1809,6 @@ NEOScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
if (pScrn->depth == 16)
xxSetup(pScreen,8, pScrn->depth, NULL, nPtr->accelSync); /*@!@*/
racflag |= RAC_COLORMAP;
if (nPtr->NeoHWCursorInitialized)
racflag |= RAC_CURSOR;
@ -2057,6 +2057,8 @@ neoMapMem(ScrnInfoPtr pScrn)
if (!nPtr->noLinear) {
if (!nPtr->noMMIO) {
if (nPtr->pEnt->location.type == BUS_PCI){
#ifndef XSERVER_LIBPCIACCESS
nPtr->NeoMMIOBase =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
nPtr->PciTag, nPtr->NeoMMIOAddr,
@ -2067,6 +2069,29 @@ neoMapMem(ScrnInfoPtr pScrn)
nPtr->PciTag, nPtr->NeoMMIOAddr2,
0x100000L);
}
#else
void** result = (void**)&nPtr->NeoMMIOBase;
int err = pci_device_map_range(nPtr->PciInfo,
nPtr->NeoMMIOAddr,
0x200000L,
PCI_DEV_MAP_FLAG_WRITABLE,
result);
if (err)
return FALSE;
if (nPtr->NeoMMIOAddr2 != 0){
result = (void**)&nPtr->NeoMMIOBase2;
err = pci_device_map_range(nPtr->PciInfo,
nPtr->NeoMMIOAddr2,
0x100000L,
PCI_DEV_MAP_FLAG_WRITABLE,
result);
if (err)
return FALSE;
}
#endif
} else
nPtr->NeoMMIOBase =
xf86MapVidMem(pScrn->scrnIndex,
@ -2077,11 +2102,26 @@ 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,
nPtr->NeoLinearAddr,
nPtr->NeoFbMapSize,
PCI_DEV_MAP_FLAG_WRITABLE |
PCI_DEV_MAP_FLAG_WRITE_COMBINE,
result);
if (err)
return FALSE;
}
#endif
else
nPtr->NeoFbBase =
xf86MapVidMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
@ -2106,16 +2146,30 @@ neoUnmapMem(ScrnInfoPtr pScrn)
NEOPtr nPtr = NEOPTR(pScrn);
if (!nPtr->noLinear) {
#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;

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_i2c.c,v 1.4 2002/09/16 18:05:58 eich Exp $ */
/*
* The original Precision Insight driver for

View File

@ -22,7 +22,6 @@ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**********************************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_macros.h,v 1.1 1999/04/17 07:06:27 dawes Exp $ */
/*
* The original Precision Insight driver for