update to xf86-video-voodoo 1.2.1

This commit is contained in:
matthieu 2009-03-07 10:43:22 +00:00
parent e79dad5d64
commit 3248493b22
6 changed files with 66 additions and 23 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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"

View File

@ -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

View File

@ -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;
/*
@ -668,6 +684,17 @@ int VoodooHardwareInit(VoodooPtr pVoo)
return 0;
}
/*
* 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
*
@ -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 */

View File

@ -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 */