summaryrefslogtreecommitdiff
path: root/driver/xf86-video-neomagic
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-09-14 21:47:56 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-09-14 21:47:56 +0000
commit162bd6f0e68ae2722e1d4691ebde1dd405b7cde5 (patch)
treeaf410260beff66b4b34d6f5221354ab7abec7b72 /driver/xf86-video-neomagic
parent5c382e94ac4d446fe0d8555fa8181544180dc5ce (diff)
Fix botched xf86-video-neomagic 1.2.1 merge.
Diffstat (limited to 'driver/xf86-video-neomagic')
-rw-r--r--driver/xf86-video-neomagic/src/neo.h6
-rw-r--r--driver/xf86-video-neomagic/src/neo_2070.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_2090.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_2097.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_2200.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_bank.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_cursor.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_dga.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_driver.c78
-rw-r--r--driver/xf86-video-neomagic/src/neo_i2c.c1
-rw-r--r--driver/xf86-video-neomagic/src/neo_macros.h1
11 files changed, 71 insertions, 22 deletions
diff --git a/driver/xf86-video-neomagic/src/neo.h b/driver/xf86-video-neomagic/src/neo.h
index 23f2c7c35..c4127924e 100644
--- a/driver/xf86-video-neomagic/src/neo.h
+++ b/driver/xf86-video-neomagic/src/neo.h
@@ -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;
diff --git a/driver/xf86-video-neomagic/src/neo_2070.c b/driver/xf86-video-neomagic/src/neo_2070.c
index c308d708e..007a30465 100644
--- a/driver/xf86-video-neomagic/src/neo_2070.c
+++ b/driver/xf86-video-neomagic/src/neo_2070.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_2090.c b/driver/xf86-video-neomagic/src/neo_2090.c
index 5bdda372c..45f34ddb0 100644
--- a/driver/xf86-video-neomagic/src/neo_2090.c
+++ b/driver/xf86-video-neomagic/src/neo_2090.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_2097.c b/driver/xf86-video-neomagic/src/neo_2097.c
index 6cc54dfaf..ed9014ce3 100644
--- a/driver/xf86-video-neomagic/src/neo_2097.c
+++ b/driver/xf86-video-neomagic/src/neo_2097.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_2200.c b/driver/xf86-video-neomagic/src/neo_2200.c
index 781280435..78b3367c8 100644
--- a/driver/xf86-video-neomagic/src/neo_2200.c
+++ b/driver/xf86-video-neomagic/src/neo_2200.c
@@ -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.
diff --git a/driver/xf86-video-neomagic/src/neo_bank.c b/driver/xf86-video-neomagic/src/neo_bank.c
index d59fb5b69..ec014cea0 100644
--- a/driver/xf86-video-neomagic/src/neo_bank.c
+++ b/driver/xf86-video-neomagic/src/neo_bank.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_cursor.c b/driver/xf86-video-neomagic/src/neo_cursor.c
index bf7e98074..c52452736 100644
--- a/driver/xf86-video-neomagic/src/neo_cursor.c
+++ b/driver/xf86-video-neomagic/src/neo_cursor.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_dga.c b/driver/xf86-video-neomagic/src/neo_dga.c
index 6220d46d4..4227da694 100644
--- a/driver/xf86-video-neomagic/src/neo_dga.c
+++ b/driver/xf86-video-neomagic/src/neo_dga.c
@@ -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"
diff --git a/driver/xf86-video-neomagic/src/neo_driver.c b/driver/xf86-video-neomagic/src/neo_driver.c
index 1fca1f55d..31e47f022 100644
--- a/driver/xf86-video-neomagic/src/neo_driver.c
+++ b/driver/xf86-video-neomagic/src/neo_driver.c
@@ -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;
diff --git a/driver/xf86-video-neomagic/src/neo_i2c.c b/driver/xf86-video-neomagic/src/neo_i2c.c
index a06b9f97d..82d1f2a46 100644
--- a/driver/xf86-video-neomagic/src/neo_i2c.c
+++ b/driver/xf86-video-neomagic/src/neo_i2c.c
@@ -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
diff --git a/driver/xf86-video-neomagic/src/neo_macros.h b/driver/xf86-video-neomagic/src/neo_macros.h
index abc08f100..4dc79ec21 100644
--- a/driver/xf86-video-neomagic/src/neo_macros.h
+++ b/driver/xf86-video-neomagic/src/neo_macros.h
@@ -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