summaryrefslogtreecommitdiff
path: root/driver/xf86-video-voodoo
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-03-07 10:43:23 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-03-07 10:43:23 +0000
commitc1ed48f9ed87e00c792d7651a47593e46985537c (patch)
tree0f4cad6489d3678ee5329e1187e66a32d130007b /driver/xf86-video-voodoo
parente5bc58a371dc8c1189e7816f5a3f63b8ac699945 (diff)
update to xf86-video-voodoo 1.2.1
Diffstat (limited to 'driver/xf86-video-voodoo')
-rw-r--r--driver/xf86-video-voodoo/configure.ac2
-rw-r--r--driver/xf86-video-voodoo/src/voodoo.h2
-rw-r--r--driver/xf86-video-voodoo/src/voodoo_dga.c2
-rw-r--r--driver/xf86-video-voodoo/src/voodoo_driver.c20
-rw-r--r--driver/xf86-video-voodoo/src/voodoo_hardware.c57
-rw-r--r--driver/xf86-video-voodoo/src/voodoo_pcirename.h6
6 files changed, 66 insertions, 23 deletions
diff --git a/driver/xf86-video-voodoo/configure.ac b/driver/xf86-video-voodoo/configure.ac
index b7cc28cb8..ff6c1a5d8 100644
--- a/driver/xf86-video-voodoo/configure.ac
+++ b/driver/xf86-video-voodoo/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-voodoo],
- 1.2.0,
+ 1.2.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-voodoo)
diff --git a/driver/xf86-video-voodoo/src/voodoo.h b/driver/xf86-video-voodoo/src/voodoo.h
index 750c42b1f..4f97a8ac6 100644
--- a/driver/xf86-video-voodoo/src/voodoo.h
+++ b/driver/xf86-video-voodoo/src/voodoo.h
@@ -13,7 +13,7 @@ typedef struct {
CloseScreenProcPtr CloseScreen; /* Wrapped Close */
XAAInfoRecPtr AccelInfoRec; /* Cached Accel rec for close */
Bool Blanked;
- Bool OnAtExit;
+ Bool PassThrough; /* Set to restore pass through on exit */
EntityInfoPtr pEnt;
OptionInfoPtr Options;
diff --git a/driver/xf86-video-voodoo/src/voodoo_dga.c b/driver/xf86-video-voodoo/src/voodoo_dga.c
index 6f1f9257a..9d088a752 100644
--- a/driver/xf86-video-voodoo/src/voodoo_dga.c
+++ b/driver/xf86-video-voodoo/src/voodoo_dga.c
@@ -42,13 +42,11 @@
#include "micmap.h"
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Version.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86cmap.h"
#include "shadowfb.h"
#include "vgaHW.h"
-#include "xf86DDC.h"
#include "xf86RAC.h"
#include "xf86Resources.h"
#include "compiler.h"
diff --git a/driver/xf86-video-voodoo/src/voodoo_driver.c b/driver/xf86-video-voodoo/src/voodoo_driver.c
index 5ad741e03..282254342 100644
--- a/driver/xf86-video-voodoo/src/voodoo_driver.c
+++ b/driver/xf86-video-voodoo/src/voodoo_driver.c
@@ -47,15 +47,15 @@
#include "fb.h"
#include "mibank.h"
#include "micmap.h"
+#include "mipointer.h"
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Version.h"
+#include "xorgVersion.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86cmap.h"
#include "shadowfb.h"
#include "vgaHW.h"
-#include "xf86DDC.h"
#include "xf86RAC.h"
#include "xf86Resources.h"
#include "compiler.h"
@@ -110,12 +110,14 @@ _X_EXPORT DriverRec VOODOO = {
typedef enum {
OPTION_NOACCEL,
- OPTION_SHADOW_FB
+ OPTION_SHADOW_FB,
+ OPTION_PASS_THROUGH,
} VoodooOpts;
static const OptionInfoRec VoodooOptions[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_PASS_THROUGH,"PassThrough", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -162,7 +164,7 @@ static XF86ModuleVersionInfo voodooVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
VOODOO_MAJOR_VERSION, VOODOO_MINOR_VERSION, VOODOO_PATCHLEVEL,
ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
@@ -436,6 +438,9 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
pVoo->Accel = 0;
}
+ if (xf86ReturnOptValBool(pVoo->Options, OPTION_PASS_THROUGH, FALSE))
+ pVoo->PassThrough = 1;
+
if (xf86ReturnOptValBool(pVoo->Options, OPTION_NOACCEL, FALSE)) {
pVoo->ShadowFB = 1;
pVoo->Accel = 0;
@@ -544,6 +549,7 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Set the current mode to the first in the list */
+ xf86SetCrtcForModes(pScrn, 0);
pScrn->currentMode = pScrn->modes;
/* Do some checking, we will not support a virtual framebuffer larger than
@@ -914,8 +920,10 @@ VoodooRestore(ScrnInfoPtr pScrn, Bool Closing)
pVoo = VoodooPTR(pScrn);
pVoo->Blanked = TRUE;
- if (!Closing || !(pVoo->OnAtExit))
- VoodooBlank(pVoo);
+ if (!Closing)
+ VoodooBlank(pVoo);
+ if (Closing && pVoo->PassThrough)
+ VoodooRestorePassThrough(pVoo);
}
static void
diff --git a/driver/xf86-video-voodoo/src/voodoo_hardware.c b/driver/xf86-video-voodoo/src/voodoo_hardware.c
index 82efaf38b..d988b331e 100644
--- a/driver/xf86-video-voodoo/src/voodoo_hardware.c
+++ b/driver/xf86-video-voodoo/src/voodoo_hardware.c
@@ -43,13 +43,11 @@
#include "micmap.h"
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Version.h"
#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86cmap.h"
#include "shadowfb.h"
#include "vgaHW.h"
-#include "xf86DDC.h"
#include "xf86RAC.h"
#include "xf86Resources.h"
#include "xaa.h"
@@ -65,6 +63,24 @@
#include "mipict.h"
#include "dixstruct.h"
+#include <unistd.h>
+
+
+#if 0
+static void VoodooReadWriteBank(ScreenPtr pScreen, int bank);
+#endif
+static Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op,
+ CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, int alphaType,
+ CARD8 *alphaPtr, int alphaPitch, int width, int height, int flags);
+static void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
+ int dstx, int dsty, int srcx, int srcy, int width, int height);
+static Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
+ int texType, CARD8 *texPtr, int texPitch, int width, int height,
+ int flags);
+static void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn,
+ int dstx, int dsty, int srcx, int srcy, int width, int height);
+
+
static int debug = 0;
/*
@@ -669,6 +685,17 @@ int VoodooHardwareInit(VoodooPtr pVoo)
}
/*
+ * Voodoo exit logic
+ */
+
+void VoodooRestorePassThrough(VoodooPtr pVoo)
+{
+ pci_enable(pVoo, 1, 0, 0);
+ mmio32_w(pVoo, 0x210, 0);
+ pci_enable(pVoo, 0, 0, 1);
+}
+
+/*
* Copiers for Voodoo1
*
* Voodoo1 has no CPU to screen blit, and also lacks SGRAM fill
@@ -814,7 +841,8 @@ void VoodooWriteBank(ScreenPtr pScreen, int bank)
mmio32_w(pVoo, 0x114, pVoo->lfbMode);
}
-void VoodooReadWriteBank(ScreenPtr pScreen, int bank)
+#if 0
+static void VoodooReadWriteBank(ScreenPtr pScreen, int bank)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
VoodooPtr pVoo = VoodooPTR(pScrn);
@@ -832,6 +860,7 @@ void VoodooReadWriteBank(ScreenPtr pScreen, int bank)
}
mmio32_w(pVoo, 0x114, pVoo->lfbMode);
}
+#endif
/*
* We normally want to load all four rop variants at once so
@@ -951,6 +980,9 @@ static void Voodoo2SetupForSolidFill(ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
+ if (debug)
+ ErrorF("Setup for solid fill colour %04X, rop %d, Mask %04X.\n",
+ color, rop, planemask);
Voodoo2Setup2D(pVoo);
mmio32_w_chuck(pVoo, 0x2EC, ropxlate[rop]); /* rop */
mmio32_w_chuck(pVoo, 0x2F0, color); /* fg color */
@@ -961,6 +993,8 @@ static void Voodoo2SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
int w, int h)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
+ if (debug)
+ ErrorF("Fill (%d, %d) for (%d, %d)\n", x, y, w, h);
wait_idle(pVoo);
mmio32_w_chuck(pVoo, 0x2E4, (y<<16) | x); /* Dst x,y */
/* Set size and fire */
@@ -1183,9 +1217,9 @@ static void Voodoo2DisableClipping(ScrnInfoPtr pScrn)
*/
-Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op, CARD16 red,
- CARD16 green, CARD16 blue, CARD16 alpha, int alphaType, CARD8 *alphaPtr,
- int alphaPitch, int width, int height, int flags)
+static Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op,
+ CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, int alphaType,
+ CARD8 *alphaPtr, int alphaPitch, int width, int height, int flags)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
@@ -1210,7 +1244,8 @@ Bool VoodooSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int op, CARD16 red
return TRUE;
}
-void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int dstx, int dsty, int srcx, int srcy, int width, int height)
+static void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
+ int dstx, int dsty, int srcx, int srcy, int width, int height)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
/* 32bit LFB write mode */
@@ -1258,8 +1293,9 @@ void VoodooSubsequentCPUToScreenAlphaTexture(ScrnInfoPtr pScrn, int dstx, int ds
mmio32_w(pVoo, 0x10C, 0);
}
-Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op, int texType,
- CARD8 *texPtr, int texPitch, int width, int height, int flags)
+static Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
+ int texType, CARD8 *texPtr, int texPitch, int width, int height,
+ int flags)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
@@ -1283,7 +1319,8 @@ Bool VoodooSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op, int texType,
return TRUE;
}
-void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn, int dstx, int dsty, int srcx, int srcy, int width, int height)
+static void VoodooSubsequentCPUToScreenTexture(ScrnInfoPtr pScrn,
+ int dstx, int dsty, int srcx, int srcy, int width, int height)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
/* 32bit LFB write mode */
diff --git a/driver/xf86-video-voodoo/src/voodoo_pcirename.h b/driver/xf86-video-voodoo/src/voodoo_pcirename.h
index c93988a21..de113b9d8 100644
--- a/driver/xf86-video-voodoo/src/voodoo_pcirename.h
+++ b/driver/xf86-video-voodoo/src/voodoo_pcirename.h
@@ -26,8 +26,8 @@
* library. The main purpose being to facilitate source code compatibility.
*/
-#ifndef TRIDENTPCIRENAME_H
-#define TRIDENTPCIRENAME_H
+#ifndef VOODOOPCIRENAME_H
+#define VOODOOPCIRENAME_H
enum region_type {
REGION_MEM,
@@ -119,4 +119,4 @@ typedef struct pci_device *pciVideoPtr;
#endif /* XSERVER_LIBPCIACCESS */
-#endif /* TRIDENTPCIRENAME_H */
+#endif /* VOODOOPCIRENAME_H */