mirror of
https://github.com/X11Libre/xf86-video-tdfx.git
synced 2026-03-24 01:25:15 +00:00
Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`
`git diff -w` & `git diff -b` show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-tdfx/-/merge_requests/12>
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
9c3289870a
commit
2ddb7ae0bd
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,8 +71,8 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-video-tdfx
|
||||
# Add & Override patterns for xf86-video-tdfx
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
#
|
||||
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
|
||||
|
||||
26
src/tdfx.h
26
src/tdfx.h
@@ -135,17 +135,17 @@ extern void FillPrivateDRI(TDFXPtr pTDFX, TDFXDRIPtr pTDFXDRI);
|
||||
#include "xf86Cursor.h"
|
||||
#include "compat-api.h"
|
||||
|
||||
typedef void (*TDFXWriteIndexedByteFunc)(TDFXPtr pTDFX, int addr,
|
||||
typedef void (*TDFXWriteIndexedByteFunc)(TDFXPtr pTDFX, int addr,
|
||||
char index, char value);
|
||||
typedef char (*TDFXReadIndexedByteFunc)(TDFXPtr pTDFX, int addr,
|
||||
typedef char (*TDFXReadIndexedByteFunc)(TDFXPtr pTDFX, int addr,
|
||||
char index);
|
||||
typedef void (*TDFXWriteWordFunc)(TDFXPtr pTDFX, int addr, int value);
|
||||
typedef int (*TDFXReadWordFunc)(TDFXPtr pTDFX, int addr);
|
||||
typedef void (*TDFXWriteChipIndexedByteFunc)(TDFXPtr pTDFX, int chip,
|
||||
typedef void (*TDFXWriteChipIndexedByteFunc)(TDFXPtr pTDFX, int chip,
|
||||
int addr, char index, char value);
|
||||
typedef char (*TDFXReadChipIndexedByteFunc)(TDFXPtr pTDFX, int chip,
|
||||
typedef char (*TDFXReadChipIndexedByteFunc)(TDFXPtr pTDFX, int chip,
|
||||
int addr, char index);
|
||||
typedef void (*TDFXWriteChipWordFunc)(TDFXPtr pTDFX, int chip,
|
||||
typedef void (*TDFXWriteChipWordFunc)(TDFXPtr pTDFX, int chip,
|
||||
int addr, int value);
|
||||
typedef int (*TDFXReadChipWordFunc)(TDFXPtr pTDFX, int chip,
|
||||
int addr);
|
||||
@@ -275,8 +275,8 @@ typedef struct _TDFXRec {
|
||||
FBAreaPtr offscreenYUVBuf;
|
||||
int offscreenYUVBufWidth;
|
||||
int offscreenYUVBufHeight;
|
||||
|
||||
/* This is a small register shadow. I'm only shadowing
|
||||
|
||||
/* This is a small register shadow. I'm only shadowing
|
||||
* sst2dDstFmt
|
||||
* sst2dSrcFmt
|
||||
* If a real register shadow is ever needed we should probably
|
||||
@@ -358,16 +358,16 @@ extern void TDFXNeedSync(ScrnInfoPtr pScrn);
|
||||
extern void TDFXCheckSync(ScrnInfoPtr pScrn);
|
||||
extern void TDFXFirstSync(ScrnInfoPtr pScrn);
|
||||
|
||||
extern void TDFXSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir,
|
||||
extern void TDFXSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir,
|
||||
int ydir, int rop,
|
||||
unsigned int planemask,
|
||||
unsigned int planemask,
|
||||
int trans_color);
|
||||
extern void TDFXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int srcX,
|
||||
int srcY, int dstX, int dstY,
|
||||
extern void TDFXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int srcX,
|
||||
int srcY, int dstX, int dstY,
|
||||
int w, int h);
|
||||
extern void TDFXSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
|
||||
extern void TDFXSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
|
||||
unsigned int planemask);
|
||||
extern void TDFXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
|
||||
extern void TDFXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
|
||||
int w, int h);
|
||||
|
||||
extern void TDFXSelectBuffer(TDFXPtr pTDFX, int which);
|
||||
|
||||
@@ -102,7 +102,7 @@ void
|
||||
TDFXSetLFBConfig(TDFXPtr pTDFX) {
|
||||
if (pTDFX->ChipType<=PCI_CHIP_VOODOO3) {
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
unsigned int lfbmode;
|
||||
unsigned int lfbmode;
|
||||
lfbmode=TDFXReadLongMMIO(pTDFX, SST_3D_LFBMODE);
|
||||
|
||||
lfbmode&=~BIT(12); /* 0 bit 12 is byte swizzle */
|
||||
@@ -113,7 +113,7 @@ TDFXSetLFBConfig(TDFXPtr pTDFX) {
|
||||
TDFXWriteLongMMIO(pTDFX, SST_3D_LFBMODE, lfbmode);
|
||||
#endif
|
||||
TDFXWriteLongMMIO(pTDFX, LFBMEMORYCONFIG, (pTDFX->backOffset>>12) |
|
||||
SST_RAW_LFB_ADDR_STRIDE_4K |
|
||||
SST_RAW_LFB_ADDR_STRIDE_4K |
|
||||
((pTDFX->stride+127)/128)<<SST_RAW_LFB_TILE_STRIDE_SHIFT);
|
||||
} else {
|
||||
int chip;
|
||||
@@ -128,7 +128,7 @@ TDFXSetLFBConfig(TDFXPtr pTDFX) {
|
||||
lg2TileAperturePitch += 1, TileAperturePitch <<= 1);
|
||||
for (chip=0; chip<pTDFX->numChips; chip++) {
|
||||
TDFXWriteChipLongMMIO(pTDFX, chip, LFBMEMORYCONFIG, (bits&0x1FFF) |
|
||||
SST_RAW_LFB_ADDR_STRIDE(lg2TileAperturePitch) |
|
||||
SST_RAW_LFB_ADDR_STRIDE(lg2TileAperturePitch) |
|
||||
((bits&0x6000)<<10) |
|
||||
((stride+127)/128)<<SST_RAW_LFB_TILE_STRIDE_SHIFT);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ static void TDFXSendNOPNoProp(ScrnInfoPtr pScrn)
|
||||
pTDFX=TDFXPTR(pScrn);
|
||||
TDFXMakeRoomNoProp(pTDFX, 1);
|
||||
TDFXWriteLongMMIO(pTDFX, SST_2D_COMMAND, SST_2D_NOP);
|
||||
}
|
||||
}
|
||||
|
||||
void TDFXSync(ScrnInfoPtr pScrn)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "tdfx.h"
|
||||
#include "vgaHW.h"
|
||||
|
||||
static Bool TDFX_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
static Bool TDFX_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
|
||||
int *, int *, int *);
|
||||
static Bool TDFX_SetMode(ScrnInfoPtr, DGAModePtr);
|
||||
static int TDFX_GetViewport(ScrnInfoPtr);
|
||||
@@ -76,19 +76,19 @@ TDFXDGAInit(ScreenPtr pScreen)
|
||||
currentMode->imageHeight = pTDFX->pixmapCacheLinesMax;
|
||||
currentMode->pixmapWidth = currentMode->imageWidth;
|
||||
currentMode->pixmapHeight = currentMode->imageHeight;
|
||||
currentMode->maxViewportX = currentMode->imageWidth -
|
||||
currentMode->maxViewportX = currentMode->imageWidth -
|
||||
currentMode->viewportWidth;
|
||||
/* this might need to get clamped to some maximum */
|
||||
currentMode->maxViewportY = currentMode->imageHeight -
|
||||
currentMode->viewportHeight;
|
||||
|
||||
|
||||
pMode = pMode->next;
|
||||
if (pMode == firstMode) break;
|
||||
}
|
||||
|
||||
|
||||
pTDFX->DGAModes = modes;
|
||||
|
||||
return DGAInit(pScreen, &TDFX_DGAFuncs, modes, num);
|
||||
|
||||
return DGAInit(pScreen, &TDFX_DGAFuncs, modes, num);
|
||||
}
|
||||
|
||||
static Bool
|
||||
@@ -114,11 +114,11 @@ TDFX_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
|
||||
|
||||
TDFXSwitchMode(pScrn, pMode->mode);
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFX_GetViewport(ScrnInfoPtr pScrn)
|
||||
{
|
||||
TDFXPtr pTDFX = TDFXPTR(pScrn);
|
||||
@@ -126,7 +126,7 @@ TDFX_GetViewport(ScrnInfoPtr pScrn)
|
||||
return pTDFX->DGAViewportStatus;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
TDFX_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
|
||||
{
|
||||
TDFXPtr pTDFX = TDFXPTR(pScrn);
|
||||
@@ -138,12 +138,12 @@ TDFX_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
|
||||
while(hwp->readST01(hwp) & 0x08);
|
||||
while(!(hwp->readST01(hwp) & 0x08));
|
||||
|
||||
pTDFX->DGAViewportStatus = 0;
|
||||
pTDFX->DGAViewportStatus = 0;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static Bool
|
||||
TDFX_OpenFramebuffer(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
char **name,
|
||||
unsigned char **mem,
|
||||
int *size,
|
||||
|
||||
@@ -346,7 +346,7 @@ TDFXDRITransitionTo2d(ScreenPtr pScreen)
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
TDFXPtr pTDFX = TDFXPTR(pScrn);
|
||||
|
||||
xf86FreeOffscreenArea(pTDFX->reservedArea);
|
||||
xf86FreeOffscreenArea(pTDFX->reservedArea);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -372,7 +372,7 @@ TDFXDRITransitionTo3d(ScreenPtr pScreen)
|
||||
}
|
||||
|
||||
xf86PurgeUnlockedOffscreenAreas(pScreen);
|
||||
|
||||
|
||||
pArea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
|
||||
pTDFX->pixmapCacheLinesMin,
|
||||
pScrn->displayWidth, NULL, NULL, NULL);
|
||||
|
||||
@@ -133,7 +133,7 @@ static ModeStatus TDFXValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
|
||||
static void TDFXBlockHandler(BLOCKHANDLER_ARGS_DECL);
|
||||
|
||||
/* Switch to various Display Power Management System levels */
|
||||
static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
|
||||
static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
|
||||
int PowerManagermentMode, int flags);
|
||||
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
@@ -280,7 +280,7 @@ tdfxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
||||
/*
|
||||
* TDFXGetRec and TDFXFreeRec --
|
||||
*
|
||||
* Private data for the driver is stored in the screen structure.
|
||||
* Private data for the driver is stored in the screen structure.
|
||||
* These two functions create and destroy that private data.
|
||||
*
|
||||
*/
|
||||
@@ -307,7 +307,7 @@ TDFXFreeRec(ScrnInfoPtr pScrn) {
|
||||
*
|
||||
* Returns the string name for the driver based on the chipset. In this
|
||||
* case it will always be an TDFX, so we can return a static string.
|
||||
*
|
||||
*
|
||||
*/
|
||||
static void
|
||||
TDFXIdentify(int flags) {
|
||||
@@ -410,7 +410,7 @@ TDFXProbe(DriverPtr drv, int flags)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
Since these Probing is just checking the PCI data the server already
|
||||
collected.
|
||||
*/
|
||||
@@ -465,12 +465,12 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
|
||||
TDFXTRACE("TDFXCountRam start\n");
|
||||
vmemSize=0;
|
||||
if (pTDFX->PIOBase[0]) {
|
||||
CARD32
|
||||
CARD32
|
||||
partSize, /* size of SGRAM chips in Mbits */
|
||||
nChips, /* # chips of SDRAM/SGRAM */
|
||||
banks, /* Number of banks of chips */
|
||||
dramInit0_strap,
|
||||
dramInit1_strap,
|
||||
dramInit0_strap,
|
||||
dramInit1_strap,
|
||||
dramInit1,
|
||||
miscInit1;
|
||||
|
||||
@@ -486,19 +486,19 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
|
||||
dramInit1 |= 2<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT;
|
||||
dramInit1 |= SST_SGRAM_CLK_NODELAY;
|
||||
dramInit1 |= SST_DRAM_REFRESH_EN;
|
||||
dramInit1 |= (0x18 << SST_DRAM_REFRESH_VALUE_SHIFT) & SST_DRAM_REFRESH_VALUE;
|
||||
dramInit1 |= (0x18 << SST_DRAM_REFRESH_VALUE_SHIFT) & SST_DRAM_REFRESH_VALUE;
|
||||
dramInit1 &= ~SST_MCTL_TYPE_SDRAM;
|
||||
dramInit1 |= dramInit1_strap;
|
||||
|
||||
/* Some information about the timing register (for later debugging) */
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"DRAMINIT1 read 0x%x, programming 0x%lx (not Banshee)\n",
|
||||
pTDFX->readLong(pTDFX, DRAMINIT1), (unsigned long)dramInit1);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Here we don't whack the timing register on the Banshee boards as the
|
||||
* BIOS has done a perfectly good job. As Banshee boards were made by
|
||||
* different manufacturers we don't touch this, but carry on whacking it
|
||||
* different manufacturers we don't touch this, but carry on whacking it
|
||||
* for Voodoo3 and Voodoo5 boards, as we've never had a problem with them.
|
||||
* I guess this could be removed for all boards as we probably shouldn't
|
||||
* be doing this to the V3/V5 boards too.
|
||||
@@ -514,7 +514,7 @@ TDFXCountRam(ScrnInfoPtr pScrn) {
|
||||
vmemSize = 16;
|
||||
} else {
|
||||
nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS) == 0) ? 4 : 8;
|
||||
|
||||
|
||||
if ( (dramInit0_strap & SST_SGRAM_TYPE) == SST_SGRAM_TYPE_8MBIT ) {
|
||||
partSize = 8;
|
||||
} else if ( (dramInit0_strap & SST_SGRAM_TYPE) == SST_SGRAM_TYPE_16MBIT) {
|
||||
@@ -580,9 +580,9 @@ TDFXFindChips(ScrnInfoPtr pScrn, pciVideoPtr match)
|
||||
pTDFX->numChips=0;
|
||||
pTDFX->ChipType=match->chipType;
|
||||
for (ppPci = xf86GetPciVideoInfo(); *ppPci != NULL; ppPci++) {
|
||||
if ((*ppPci)->bus == match->bus &&
|
||||
if ((*ppPci)->bus == match->bus &&
|
||||
(*ppPci)->device == match->device) {
|
||||
pTDFX->PciTag[pTDFX->numChips] = pciTag((*ppPci)->bus,
|
||||
pTDFX->PciTag[pTDFX->numChips] = pciTag((*ppPci)->bus,
|
||||
(*ppPci)->device,
|
||||
(*ppPci)->func);
|
||||
pTDFX->PIOBase[pTDFX->numChips] =
|
||||
@@ -747,7 +747,7 @@ static xf86MonPtr doTDFXDDC(ScrnInfoPtr pScrn)
|
||||
*
|
||||
*/
|
||||
static Bool
|
||||
TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
{
|
||||
TDFXPtr pTDFX;
|
||||
ClockRangePtr clockRanges;
|
||||
@@ -803,17 +803,17 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
if (xf86LoadSubModule(pScrn, "int10")) {
|
||||
xf86Int10InfoPtr pInt;
|
||||
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Softbooting the board (through the int10 interface).\n");
|
||||
pInt = xf86InitInt10(pTDFX->pEnt->index);
|
||||
if (!pInt)
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
|
||||
"Softbooting the board failed.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Softbooting the board succeeded.\n");
|
||||
xf86FreeInt10(pInt);
|
||||
}
|
||||
@@ -836,7 +836,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* We don't need VGA resources during OPERATING state. However I'm
|
||||
* not sure if they are disabled.
|
||||
*/
|
||||
@@ -844,8 +844,8 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
/* Is VGA memory disabled during OPERATING state? */
|
||||
xf86SetOperatingState(resVgaMem, pTDFX->pEnt->index, ResUnusedOpr);
|
||||
/*
|
||||
* I'm sure we don't need to set these. All resources
|
||||
/*
|
||||
* I'm sure we don't need to set these. All resources
|
||||
* for these operations are exclusive.
|
||||
*/
|
||||
if (pTDFX->usePIO) {
|
||||
@@ -867,8 +867,8 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
case 24:
|
||||
break;
|
||||
default:
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Given depth (%d) is not supported by tdfx driver\n",
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"Given depth (%d) is not supported by tdfx driver\n",
|
||||
pScrn->depth);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -919,7 +919,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pTDFX->pEnt->device->chipID);
|
||||
} else {
|
||||
from = X_PROBED;
|
||||
pScrn->chipset = (char *)xf86TokenToString(TDFXChipsets,
|
||||
pScrn->chipset = (char *)xf86TokenToString(TDFXChipsets,
|
||||
DEVICE_ID(match));
|
||||
}
|
||||
if (pTDFX->pEnt->device->chipRev >= 0) {
|
||||
@@ -937,7 +937,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
pTDFX->LinearAddr[0] = PCI_MEM_BASE(match, 1);
|
||||
from = X_PROBED;
|
||||
} else {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||
"No valid FB address in PCI config space\n");
|
||||
TDFXFreeRec(pScrn);
|
||||
return FALSE;
|
||||
@@ -993,7 +993,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
/* Since we can do gamma correction, we call xf86SetGamma */
|
||||
{
|
||||
Gamma zeros = {0.0, 0.0, 0.0};
|
||||
|
||||
|
||||
if (!xf86SetGamma(pScrn, zeros)) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
default:
|
||||
clockRanges->interlaceAllowed = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
clockRanges->doubleScanAllowed = TRUE;
|
||||
|
||||
/*
|
||||
@@ -1145,7 +1145,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
|
||||
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
|
||||
pScrn->display->modes, clockRanges,
|
||||
0, 320, 2048, 16*pScrn->bitsPerPixel,
|
||||
0, 320, 2048, 16*pScrn->bitsPerPixel,
|
||||
200, 2047,
|
||||
pScrn->display->virtualX, pScrn->display->virtualY,
|
||||
availableMem, LOOKUP_BEST_REFRESH);
|
||||
@@ -1243,7 +1243,7 @@ TDFXMapMem(ScrnInfoPtr pScrn)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
err = pci_device_map_range(pTDFX->PciInfo[0],
|
||||
pTDFX->LinearAddr[0],
|
||||
@@ -1257,8 +1257,8 @@ TDFXMapMem(ScrnInfoPtr pScrn)
|
||||
}
|
||||
#else
|
||||
for (i=0; i<pTDFX->numChips; i++) {
|
||||
pTDFX->MMIOBase[i] = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
|
||||
pTDFX->PciTag[i],
|
||||
pTDFX->MMIOBase[i] = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
|
||||
pTDFX->PciTag[i],
|
||||
pTDFX->MMIOAddr[i],
|
||||
TDFXIOMAPSIZE);
|
||||
|
||||
@@ -1299,7 +1299,7 @@ TDFXUnmapMem(ScrnInfoPtr pScrn)
|
||||
pTDFX->FbBase = NULL;
|
||||
#else
|
||||
for (i=0; i<pTDFX->numChips; i++) {
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pTDFX->MMIOBase[i],
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pTDFX->MMIOBase[i],
|
||||
TDFXIOMAPSIZE);
|
||||
pTDFX->MMIOBase[i]=0;
|
||||
}
|
||||
@@ -1434,7 +1434,7 @@ TDFXSave(ScrnInfoPtr pScrn)
|
||||
}
|
||||
|
||||
static void
|
||||
DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg,
|
||||
DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg,
|
||||
Bool restoreFonts) {
|
||||
TDFXPtr pTDFX;
|
||||
vgaHWPtr hwp;
|
||||
@@ -1578,7 +1578,7 @@ SetupVidPLL(ScrnInfoPtr pScrn, DisplayModePtr mode) {
|
||||
tdfxReg->vidcfg|=SST_VIDEO_2X_MODE_EN;
|
||||
}
|
||||
tdfxReg->vidpll=CalcPLL(freq, &f_out, 0);
|
||||
TDFXTRACEREG("Vid PLL freq=%d f_out=%d reg=%x\n", freq, f_out,
|
||||
TDFXTRACEREG("Vid PLL freq=%d f_out=%d reg=%x\n", freq, f_out,
|
||||
tdfxReg->vidpll);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1612,7 +1612,7 @@ TDFXInitVGA(ScrnInfoPtr pScrn)
|
||||
tdfxReg->clip0max = tdfxReg->clip1max = pTDFX->maxClip;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static Bool
|
||||
TDFXSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
|
||||
@@ -1651,7 +1651,7 @@ TDFXSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
|
||||
|
||||
/* Handle the higher resolution modes */
|
||||
tdfxReg->ExtVga[0] = (ht&0x100)>>8 | (hd&0x100)>>6 | (hbs&0x100)>>4 |
|
||||
(hbe&0x40)>>1 | (hss&0x100)>>2 | (hse&0x20)<<2;
|
||||
(hbe&0x40)>>1 | (hss&0x100)>>2 | (hse&0x20)<<2;
|
||||
|
||||
tdfxReg->ExtVga[1] = (vt&0x400)>>10 | (vd&0x400)>>8 | (vbs&0x400)>>6 |
|
||||
(vbe&0x400)>>4;
|
||||
@@ -1672,8 +1672,8 @@ TDFXSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) {
|
||||
} else
|
||||
tdfxReg->vidcfg&=~SST_INTERLACE;
|
||||
|
||||
TDFXTRACEREG("cpp=%d Hdisplay=%d Vdisplay=%d stride=%d screensize=%x\n",
|
||||
pTDFX->cpp, mode->HDisplay, mode->VDisplay, tdfxReg->stride,
|
||||
TDFXTRACEREG("cpp=%d Hdisplay=%d Vdisplay=%d stride=%d screensize=%x\n",
|
||||
pTDFX->cpp, mode->HDisplay, mode->VDisplay, tdfxReg->stride,
|
||||
tdfxReg->screensize);
|
||||
|
||||
return TRUE;
|
||||
@@ -1728,7 +1728,7 @@ TDFXModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||
mode->CrtcHBlankEnd=hbe;
|
||||
mode->CrtcHTotal=ht;
|
||||
mode->CrtcHSkew=hskew;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TDFXDRI
|
||||
if (pTDFX->directRenderingEnabled) {
|
||||
@@ -1829,7 +1829,7 @@ calcBufferStride(int xres, Bool tiled, int cpp)
|
||||
if (tiled == TRUE) {
|
||||
/* Calculate tile width stuff */
|
||||
strideInTiles = (xres+TILE_WIDTH-1)/TILE_WIDTH;
|
||||
|
||||
|
||||
return strideInTiles*cpp*TILE_WIDTH;
|
||||
} else {
|
||||
return xres*cpp;
|
||||
@@ -1844,7 +1844,7 @@ calcBufferHeightInTiles(int yres)
|
||||
|
||||
/* Calculate tile height stuff */
|
||||
heightInTiles = yres >> 5;
|
||||
|
||||
|
||||
if (yres & (TILE_HEIGHT - 1))
|
||||
heightInTiles++;
|
||||
|
||||
@@ -1866,7 +1866,7 @@ calcBufferSize(int xres, int yres, Bool tiled, int cpp)
|
||||
}
|
||||
|
||||
bufSize = stride * height;
|
||||
|
||||
|
||||
return bufSize;
|
||||
|
||||
} /* calcBufferSize */
|
||||
@@ -2032,7 +2032,7 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
pTDFX->stride = pScrn->displayWidth*pTDFX->cpp;
|
||||
|
||||
/* enough to do DVD */
|
||||
pTDFX->pixmapCacheLinesMin = ((720*480*pTDFX->cpp) +
|
||||
pTDFX->pixmapCacheLinesMin = ((720*480*pTDFX->cpp) +
|
||||
pTDFX->stride - 1)/pTDFX->stride;
|
||||
|
||||
if (pTDFX->ChipType > PCI_CHIP_VOODOO3) {
|
||||
@@ -2058,11 +2058,11 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
|
||||
scanlines = (pTDFX->backOffset - pTDFX->fbOffset) / pTDFX->stride;
|
||||
if(pTDFX->ChipType < PCI_CHIP_VOODOO4) {
|
||||
if (scanlines > 2047)
|
||||
if (scanlines > 2047)
|
||||
scanlines = 2047;
|
||||
} else {
|
||||
/* MaxClip seems to have only 12 bits => 0->4095 */
|
||||
if (scanlines > 4095)
|
||||
if (scanlines > 4095)
|
||||
scanlines = 4095;
|
||||
}
|
||||
|
||||
@@ -2073,10 +2073,10 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
* pTDFX->pixmapCacheLinesMin when pTDFX->texSize < 0. DRI is disabled
|
||||
* in that case, so pTDFX->pixmapCacheLinesMin isn't used when that's true.
|
||||
*/
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Minimum %d, Maximum %d lines of offscreen memory available\n",
|
||||
pTDFX->pixmapCacheLinesMin, pTDFX->pixmapCacheLinesMax);
|
||||
|
||||
|
||||
MemBox.y1 = 0;
|
||||
MemBox.x1 = 0;
|
||||
MemBox.x2 = pScrn->displayWidth;
|
||||
@@ -2097,7 +2097,7 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
return FALSE;
|
||||
|
||||
miSetPixmapDepths ();
|
||||
|
||||
|
||||
#ifdef TDFXDRI
|
||||
/*
|
||||
* Setup DRI after visuals have been established, but before fbScreenInit
|
||||
@@ -2117,7 +2117,7 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
case 16:
|
||||
case 24:
|
||||
case 32:
|
||||
if (!fbScreenInit(pScreen, pTDFX->FbBase+pTDFX->fbOffset,
|
||||
if (!fbScreenInit(pScreen, pTDFX->FbBase+pTDFX->fbOffset,
|
||||
pScrn->virtualX, pScrn->virtualY,
|
||||
pScrn->xDpi, pScrn->yDpi,
|
||||
pScrn->displayWidth, pScrn->bitsPerPixel))
|
||||
@@ -2202,10 +2202,10 @@ TDFXScreenInit(ScreenPtr pScreen, int argc, char **argv) {
|
||||
* DRICloseScreen isn't called thru a wrapper but explicitly
|
||||
* in of TDFXCloseScreen() before the rest is unwrapped
|
||||
*/
|
||||
|
||||
|
||||
#ifdef TDFXDRI
|
||||
if (pTDFX->directRenderingEnabled) {
|
||||
/* Now that mi, fb, drm and others have done their thing,
|
||||
/* Now that mi, fb, drm and others have done their thing,
|
||||
* complete the DRI setup.
|
||||
*/
|
||||
pTDFX->directRenderingEnabled = TDFXDRIFinishScreenInit(pScreen);
|
||||
@@ -2241,7 +2241,7 @@ TDFXAdjustFrame(ScrnInfoPtr pScrn, int x, int y) {
|
||||
y += pScrn->virtualY - 1;
|
||||
|
||||
tdfxReg = &pTDFX->ModeReg;
|
||||
if(pTDFX->ShowCache && y && pScrn->vtSema)
|
||||
if(pTDFX->ShowCache && y && pScrn->vtSema)
|
||||
y += pScrn->virtualY - 1;
|
||||
tdfxReg->startaddr = pTDFX->fbOffset+y*pTDFX->stride+(x*pTDFX->cpp);
|
||||
TDFXTRACE("TDFXAdjustFrame to x=%d y=%d offset=%d\n", x, y, tdfxReg->startaddr);
|
||||
@@ -2353,7 +2353,7 @@ TDFXValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) {
|
||||
TDFXPtr pTDFX;
|
||||
|
||||
TDFXTRACE("TDFXValidMode start\n");
|
||||
if ((mode->HDisplay>2048) || (mode->VDisplay>1536))
|
||||
if ((mode->HDisplay>2048) || (mode->VDisplay>1536))
|
||||
return MODE_BAD;
|
||||
/* Banshee doesn't support interlace, but Voodoo 3 and higher do. */
|
||||
pTDFX = TDFXPTR(pScrn);
|
||||
@@ -2417,7 +2417,7 @@ TDFXSaveScreen(ScreenPtr pScreen, int mode)
|
||||
TDFXBlankScreen(pScrn, unblank);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
TDFXBlockHandler(BLOCKHANDLER_ARGS_DECL)
|
||||
@@ -2435,7 +2435,7 @@ TDFXBlockHandler(BLOCKHANDLER_ARGS_DECL)
|
||||
}
|
||||
|
||||
static void
|
||||
TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
|
||||
TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode,
|
||||
int flags) {
|
||||
TDFXPtr pTDFX;
|
||||
int dacmode, state=0;
|
||||
|
||||
@@ -39,7 +39,7 @@ TDFXCursorInit(ScreenPtr pScreen)
|
||||
infoPtr->MaxWidth = 64;
|
||||
infoPtr->MaxHeight = 64;
|
||||
|
||||
infoPtr->Flags =
|
||||
infoPtr->Flags =
|
||||
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
|
||||
HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
|
||||
#endif
|
||||
@@ -74,7 +74,7 @@ static unsigned int TDFXSwap(TDFXPtr pTDFX, unsigned int val) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
static void
|
||||
TDFXLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
|
||||
{
|
||||
TDFXPtr pTDFX;
|
||||
@@ -138,7 +138,7 @@ TDFXSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
|
||||
}
|
||||
|
||||
static Bool
|
||||
TDFXUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||
TDFXUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
|
||||
{
|
||||
ScrnInfoPtr pScrn;
|
||||
TDFXPtr pTDFX;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
Memory layout of card is as follows:
|
||||
|
||||
000000-00ffff: VGA memory
|
||||
010000-013fff: Cursor
|
||||
010000-013fff: Cursor
|
||||
011000-xxxxxx: Fifo (Min of CMDFIFO pages)
|
||||
xxxxxx- A-1 : Front Buffer (framebuffer)
|
||||
A - B-1 : Pixmap Cache (framebuffer)
|
||||
@@ -33,7 +33,7 @@
|
||||
void TDFXWriteFifo_24(TDFXPtr pTDFX, int val) {
|
||||
*pTDFX->fifoPtr++ = val;
|
||||
}
|
||||
|
||||
|
||||
void TDFXWriteFifo_16(TDFXPtr pTDFX, int val) {
|
||||
*pTDFX->fifoPtr++ = BE_WSWAP32(val);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ void TDFXSendNOPFifo2D(ScrnInfoPtr pScrn)
|
||||
TDFXAllocateSlots(pTDFX, 2);
|
||||
SET_PKT2_HEADER(SSTCP_COMMAND);
|
||||
WRITE_FIFO(pTDFX, SST_2D_COMMAND, SST_2D_NOP|SST_2D_GO);
|
||||
}
|
||||
}
|
||||
|
||||
void TDFXSendNOPFifo(ScrnInfoPtr pScrn)
|
||||
{
|
||||
@@ -88,11 +88,11 @@ static void InstallFifo(ScrnInfoPtr pScrn)
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_AMAX0, pTDFX->fifoOffset-4);
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_DEPTH0, 0);
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_HOLECNT0, 0);
|
||||
if (pTDFX->ChipType == PCI_CHIP_BANSHEE)
|
||||
if (pTDFX->ChipType == PCI_CHIP_BANSHEE)
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_FIFOTHRESH, (0x9<<5) | 0x2);
|
||||
else
|
||||
else
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_FIFOTHRESH, (0xf<<5) | 0x8);
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_BASESIZE0, ((pTDFX->fifoSize>>12)-1) |
|
||||
TDFXWriteLongMMIO(pTDFX, SST_FIFO_BASESIZE0, ((pTDFX->fifoSize>>12)-1) |
|
||||
SST_EN_CMDFIFO);
|
||||
/* Set the internal state */
|
||||
pTDFX->fifoRead = pTDFX->fifoBase;
|
||||
@@ -132,7 +132,7 @@ static void TDFXResetFifo(ScrnInfoPtr pScrn)
|
||||
|
||||
/*
|
||||
There are two steps to fully syncing the board:
|
||||
|
||||
|
||||
1) Send a NOP, which waits for any commands in progress
|
||||
2) Read the status register for 3 consecutive non-busy
|
||||
|
||||
@@ -222,7 +222,7 @@ void TDFXShutdownFifo(ScreenPtr pScreen)
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32
|
||||
static uint32
|
||||
GetReadPtr(TDFXPtr pTDFX)
|
||||
{
|
||||
uint32 read_ptr, dummy;
|
||||
@@ -252,13 +252,13 @@ void TDFXSwapContextFifo(ScreenPtr pScreen)
|
||||
pTDFX->fifoRead = pTDFX->fifoPtr;
|
||||
if (pTDFX->fifoRead>pTDFX->fifoPtr)
|
||||
pTDFX->fifoSlots = pTDFX->fifoRead-pTDFX->fifoPtr-1-8;
|
||||
else
|
||||
else
|
||||
pTDFX->fifoSlots = pTDFX->fifoEnd-pTDFX->fifoPtr-8;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
static void
|
||||
TDFXMakeSpace(TDFXPtr pTDFX, uint32 slots)
|
||||
{
|
||||
uint32 slots_available;
|
||||
@@ -281,7 +281,7 @@ TDFXMakeSpace(TDFXPtr pTDFX, uint32 slots)
|
||||
do {
|
||||
pTDFX->fifoRead = (uint32*)(pTDFX->FbBase + GetReadPtr(pTDFX));
|
||||
}
|
||||
while (pTDFX->fifoRead>pTDFX->fifoPtr ||
|
||||
while (pTDFX->fifoRead>pTDFX->fifoPtr ||
|
||||
pTDFX->fifoRead == pTDFX->fifoBase);
|
||||
/*
|
||||
** Put a jump command in command fifo to wrap to the beginning.
|
||||
@@ -329,7 +329,7 @@ TDFXMakeSpace(TDFXPtr pTDFX, uint32 slots)
|
||||
pTDFX->fifoSlots = slots_available-slots;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
TDFXAllocateSlots(TDFXPtr pTDFX, int slots)
|
||||
{
|
||||
#ifdef TDFX_DEBUG_FIFO
|
||||
|
||||
@@ -44,7 +44,7 @@ typedef char int8;
|
||||
cmdCnt=n; \
|
||||
TDFXAllocateSlots(p, (n)+1); \
|
||||
while (0)
|
||||
#define TDFXWriteLong(p, a, v)
|
||||
#define TDFXWriteLong(p, a, v)
|
||||
do { \
|
||||
if (lastAddr & a<lastAddr) \
|
||||
ErrorF("TDFXWriteLong not ordered\n"); \
|
||||
@@ -110,7 +110,7 @@ void TDFXSendNOPFifo2D(ScrnInfoPtr pScreen);
|
||||
do { \
|
||||
*pTDFX->fifoMirrorPtr++ = _val; \
|
||||
*pTDFX->fifoPtr++ = _val; \
|
||||
} while(0)
|
||||
} while(0)
|
||||
#else
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
#define WRITE_FIFO(ptr, loc, _val) \
|
||||
@@ -121,7 +121,7 @@ void TDFXSendNOPFifo2D(ScrnInfoPtr pScreen);
|
||||
#define WRITE_FIFO(ptr, loc, _val) \
|
||||
do { \
|
||||
*pTDFX->fifoPtr++ = _val; \
|
||||
} while(0)
|
||||
} while(0)
|
||||
#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
|
||||
#endif /* DEBUG_FIFO */
|
||||
|
||||
@@ -169,8 +169,8 @@ void TDFXSendNOPFifo2D(ScrnInfoPtr pScreen);
|
||||
/*
|
||||
** These are used to select a register mask for use with
|
||||
** command fifo packet type 4. The defines represent an
|
||||
** offset register from the base register.
|
||||
** e.g. R5 = baseReg + 5, R0 = baseReg etc..
|
||||
** offset register from the base register.
|
||||
** e.g. R5 = baseReg + 5, R0 = baseReg etc..
|
||||
*/
|
||||
#define R0 (1 << 0)
|
||||
#define R1 (1 << 1)
|
||||
|
||||
@@ -29,7 +29,7 @@ Bool TDFXDisableSLI(TDFXPtr pTDFX)
|
||||
CFG_INIT_ENABLE, i);
|
||||
|
||||
PCI_READ_LONG(v, CFG_SLI_LFB_CTRL, i);
|
||||
PCI_WRITE_LONG(v & ~(CFG_SLI_LFB_CPU_WR_EN | CFG_SLI_LFB_DPTCH_WR_EN |
|
||||
PCI_WRITE_LONG(v & ~(CFG_SLI_LFB_CPU_WR_EN | CFG_SLI_LFB_DPTCH_WR_EN |
|
||||
CFG_SLI_RD_EN),
|
||||
CFG_SLI_LFB_CTRL, i);
|
||||
#ifdef H3VDD
|
||||
@@ -138,9 +138,9 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
SST_PCI_DISABLE_IO | SST_PCI_DISABLE_MEM |
|
||||
(5<<SST_PCI_RETRY_INTERVAL_SHIFT));
|
||||
v=pTDFX->readChipLong(pTDFX, i, TMUGBEINIT);
|
||||
pTDFX->writeChipLong(pTDFX, i, TMUGBEINIT,
|
||||
pTDFX->writeChipLong(pTDFX, i, TMUGBEINIT,
|
||||
(v&~(SST_AA_CLK_DELAY | SST_AA_CLK_INVERT)) |
|
||||
(AACLKOUTDEL<<SST_AA_CLK_DELAY_SHIFT) |
|
||||
(AACLKOUTDEL<<SST_AA_CLK_DELAY_SHIFT) |
|
||||
SST_AA_CLK_INVERT);
|
||||
|
||||
if (pTDFX->numChips>1) {
|
||||
@@ -156,7 +156,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
} else {
|
||||
PCI_READ_LONG(v, CFG_INIT_ENABLE, i);
|
||||
|
||||
v = (v & ~CFG_SNOOP_MEMBASE0) | CFG_SNOOP_EN |
|
||||
v = (v & ~CFG_SNOOP_MEMBASE0) | CFG_SNOOP_EN |
|
||||
CFG_SNOOP_MEMBASE0_EN | CFG_SNOOP_MEMBASE1_EN |
|
||||
CFG_SNOOP_SLAVE | CFG_SNOOP_FBIINIT_WR_EN |
|
||||
(((pTDFX->MMIOAddr[0]>>22)&0x3ff)<<CFG_SNOOP_MEMBASE0_SHIFT) |
|
||||
@@ -242,7 +242,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
dwFormat|=CFG_AA_LFB_RD_DIVIDE_BY_4;
|
||||
/* These are wrong, because we don't know where the secondary buffers
|
||||
are located */
|
||||
pTDFX->writeChipLong(pTDFX, i, CFG_AA_LFB_CTRL,
|
||||
pTDFX->writeChipLong(pTDFX, i, CFG_AA_LFB_CTRL,
|
||||
(pScrn->videoRam<<10 /* 2nd buf */ << CFG_AA_BASEADDR_SHIFT) |
|
||||
CFG_AA_LFB_CPU_WR_EN | CFG_AA_LFB_DPTCH_WR_EN |
|
||||
CFG_AA_LFB_RD_EN | dwFormat |
|
||||
@@ -273,7 +273,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
}
|
||||
if (pTDFX->numChips==1 && aaSamples) {
|
||||
/* 1 chip 2 AA */
|
||||
PCI_WRITE_LONG(CFG_ENHANCED_VIDEO_EN |
|
||||
PCI_WRITE_LONG(CFG_ENHANCED_VIDEO_EN |
|
||||
CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY |
|
||||
CFG_VIDEO_OTHERMUX_SEL_PIPE<<CFG_VIDEO_OTHERMUX_SEL_FALSE_SHIFT |
|
||||
CFG_DIVIDE_VIDEO_BY_2,
|
||||
@@ -290,7 +290,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
!sliAnalog) {
|
||||
/* 2 chips 4 digital AA */
|
||||
if (!i) {
|
||||
PCI_WRITE_LONG(CFG_ENHANCED_VIDEO_EN |
|
||||
PCI_WRITE_LONG(CFG_ENHANCED_VIDEO_EN |
|
||||
CFG_VIDEO_LOCALMUX_DESKTOP_PLUS_OVERLAY |
|
||||
(CFG_VIDEO_OTHERMUX_SEL_PIPE_PLUS_AAFIFO <<
|
||||
CFG_VIDEO_OTHERMUX_SEL_TRUE_SHIFT) |
|
||||
@@ -400,7 +400,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
PCI_WRITE_LONG((((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_FETCH_SHIFT) |
|
||||
(0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) |
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_CRT_SHIFT) |
|
||||
(0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT),
|
||||
CFG_VIDEO_CTRL1, i);
|
||||
@@ -419,7 +419,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
PCI_WRITE_LONG((((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_FETCH_SHIFT) |
|
||||
((i<<sliLinesLog2) << CFG_SLI_COMPAREMASK_FETCH_SHIFT) |
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_CRT_SHIFT) |
|
||||
((i<<sliLinesLog2) <<
|
||||
CFG_SLI_COMPAREMASK_CRT_SHIFT),
|
||||
@@ -538,7 +538,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
PCI_WRITE_LONG((((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_FETCH_SHIFT) |
|
||||
(0x0 << CFG_SLI_COMPAREMASK_FETCH_SHIFT) |
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_CRT_SHIFT) |
|
||||
(0x0 << CFG_SLI_COMPAREMASK_CRT_SHIFT),
|
||||
CFG_VIDEO_CTRL1, i);
|
||||
@@ -556,7 +556,7 @@ Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples)
|
||||
PCI_WRITE_LONG((((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_FETCH_SHIFT) |
|
||||
((i<<sliLinesLog2) << CFG_SLI_COMPAREMASK_FETCH_SHIFT) |
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
(((pTDFX->numChips-1)<<sliLinesLog2) <<
|
||||
CFG_SLI_RENDERMASK_CRT_SHIFT) |
|
||||
((i<<sliLinesLog2) << CFG_SLI_COMPAREMASK_CRT_SHIFT),
|
||||
CFG_VIDEO_CTRL1, i);
|
||||
|
||||
@@ -81,7 +81,7 @@ static XF86VideoEncodingRec TextureEncoding[] =
|
||||
{ 0, "XV_IMAGE", 1024, 1024, {1, 1} }
|
||||
};
|
||||
|
||||
static XF86VideoFormatRec OverlayFormats[] =
|
||||
static XF86VideoFormatRec OverlayFormats[] =
|
||||
{
|
||||
{8, TrueColor}, {8, DirectColor}, {8, PseudoColor},
|
||||
{8, GrayScale}, {8, StaticGray}, {8, StaticColor},
|
||||
@@ -89,7 +89,7 @@ static XF86VideoFormatRec OverlayFormats[] =
|
||||
{15, DirectColor}, {16, DirectColor}, {24, DirectColor}
|
||||
};
|
||||
|
||||
static XF86VideoFormatRec TextureFormats[] =
|
||||
static XF86VideoFormatRec TextureFormats[] =
|
||||
{
|
||||
{15, TrueColor}, {16, TrueColor}, {24, TrueColor}
|
||||
};
|
||||
@@ -131,7 +131,7 @@ void TDFXInitVideo(ScreenPtr pScreen)
|
||||
/* The hardware can't convert YUV->8 bit color */
|
||||
if(pTDFX->cpp == 1)
|
||||
return;
|
||||
|
||||
|
||||
if (!pTDFX->TextureXvideo) {
|
||||
/* Offscreen support for Overlay only */
|
||||
TDFXInitOffscreenImages(pScreen);
|
||||
@@ -150,10 +150,10 @@ void TDFXInitVideo(ScreenPtr pScreen)
|
||||
num_adaptors = 1;
|
||||
adaptors = &newAdaptor;
|
||||
} else {
|
||||
newAdaptors =
|
||||
newAdaptors =
|
||||
malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
|
||||
if(newAdaptors) {
|
||||
memcpy(newAdaptors, adaptors, num_adaptors *
|
||||
memcpy(newAdaptors, adaptors, num_adaptors *
|
||||
sizeof(XF86VideoAdaptorPtr));
|
||||
newAdaptors[num_adaptors] = newAdaptor;
|
||||
adaptors = newAdaptors;
|
||||
@@ -200,7 +200,7 @@ TDFXAllocAdaptor(ScrnInfoPtr pScrn, int numberPorts)
|
||||
pPriv->colorKey = pTDFX->videoKey;
|
||||
pPriv->videoStatus = 0;
|
||||
pPriv->filterQuality = 1;
|
||||
|
||||
|
||||
return adapt;
|
||||
}
|
||||
|
||||
@@ -383,22 +383,22 @@ TDFXGetPortAttributeOverlay(
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXSetPortAttributeTexture(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
Atom attribute,
|
||||
INT32 value,
|
||||
INT32 value,
|
||||
pointer data
|
||||
) {
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXGetPortAttributeTexture(
|
||||
ScrnInfoPtr pScrn,
|
||||
ScrnInfoPtr pScrn,
|
||||
Atom attribute,
|
||||
INT32 *value,
|
||||
INT32 *value,
|
||||
pointer data
|
||||
){
|
||||
return Success;
|
||||
@@ -416,7 +416,7 @@ TDFXQueryBestSize(
|
||||
){
|
||||
if(vid_w > drw_w) drw_w = vid_w;
|
||||
if(vid_h > drw_h) drw_h = vid_h;
|
||||
|
||||
|
||||
*p_w = drw_w;
|
||||
*p_h = drw_h;
|
||||
}
|
||||
@@ -597,28 +597,28 @@ YUVPlanarToPacked (ScrnInfoPtr pScrn,
|
||||
TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1);
|
||||
|
||||
/* IDLE until the copy finished, timeout for safety */
|
||||
for (count = 0; count < 1000; count++)
|
||||
for (count = 0; count < 1000; count++)
|
||||
if (!((TDFXReadLongMMIO(pTDFX, STATUS) & SST_BUSY)))
|
||||
break;
|
||||
|
||||
/* Restore trashed registers */
|
||||
TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, yuvBaseAddr);
|
||||
TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride);
|
||||
TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride);
|
||||
|
||||
/* Wait for it to happen */
|
||||
TDFXSendNOPFifo2D(pScrn);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
TDFXPutImageTexture(
|
||||
ScrnInfoPtr pScrn,
|
||||
short src_x, short src_y,
|
||||
static int
|
||||
TDFXPutImageTexture(
|
||||
ScrnInfoPtr pScrn,
|
||||
short src_x, short src_y,
|
||||
short drw_x, short drw_y,
|
||||
short src_w, short src_h,
|
||||
short src_w, short src_h,
|
||||
short drw_w, short drw_h,
|
||||
int id, unsigned char* buf,
|
||||
short width, short height,
|
||||
int id, unsigned char* buf,
|
||||
short width, short height,
|
||||
Bool sync,
|
||||
RegionPtr clipBoxes, pointer data,
|
||||
DrawablePtr pDraw
|
||||
@@ -661,9 +661,9 @@ TDFXPutImageTexture(
|
||||
pbox = REGION_RECTS(clipBoxes); nbox > 0; nbox--, pbox++)
|
||||
{
|
||||
TDFXScreenToScreenYUVStretchBlit (pScrn,
|
||||
SRC_X1 + SCALEX(pbox->x1 - drw_x),
|
||||
SRC_X1 + SCALEX(pbox->x1 - drw_x),
|
||||
SRC_Y1 + SCALEY(pbox->y1 - drw_y),
|
||||
SRC_X1 + SCALEX(pbox->x2 - drw_x),
|
||||
SRC_X1 + SCALEX(pbox->x2 - drw_x),
|
||||
SRC_Y1 + SCALEY(pbox->y2 - drw_y),
|
||||
pbox->x1, pbox->y1,
|
||||
pbox->x2, pbox->y2);
|
||||
@@ -752,7 +752,7 @@ Then we or in 0x320:
|
||||
11
|
||||
109876543210
|
||||
320 = 001100100000
|
||||
|
||||
|
||||
bit 11=0: Do not bypass clut (colour lookup) for overlay
|
||||
bit 10=0: Do not bypass clut for desktop
|
||||
bit 9=1: use video-in buffer address as overlay start
|
||||
@@ -801,7 +801,7 @@ TDFXDisplayVideoOverlay(
|
||||
|
||||
dudx = (src_w << 20) / drw_w;
|
||||
/* subtract 1 to eliminate garbage on last line */
|
||||
dvdy = (( src_h - 1 )<< 20) / drw_h;
|
||||
dvdy = (( src_h - 1 )<< 20) / drw_h;
|
||||
|
||||
offset += ((left >> 16) & ~1) << 1;
|
||||
left = (left & 0x0001ffff) << 3;
|
||||
@@ -1115,11 +1115,11 @@ typedef struct {
|
||||
Bool isOn;
|
||||
} OffscreenPrivRec, * OffscreenPrivPtr;
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXAllocateSurface(
|
||||
ScrnInfoPtr pScrn,
|
||||
int id,
|
||||
unsigned short w,
|
||||
unsigned short w,
|
||||
unsigned short h,
|
||||
XF86SurfacePtr surface
|
||||
){
|
||||
@@ -1162,7 +1162,7 @@ TDFXAllocateSurface(
|
||||
pPriv->isOn = FALSE;
|
||||
|
||||
surface->pScrn = pScrn;
|
||||
surface->id = id;
|
||||
surface->id = id;
|
||||
surface->pitches[0] = pitch;
|
||||
surface->offsets[0] = pTDFX->fbOffset + (linear->offset * bpp);
|
||||
surface->devPrivate.ptr = (pointer)pPriv;
|
||||
@@ -1170,7 +1170,7 @@ TDFXAllocateSurface(
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXStopSurface(
|
||||
XF86SurfacePtr surface
|
||||
){
|
||||
@@ -1187,7 +1187,7 @@ TDFXStopSurface(
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXFreeSurface(
|
||||
XF86SurfacePtr surface
|
||||
){
|
||||
@@ -1209,7 +1209,7 @@ TDFXGetSurfaceAttribute(
|
||||
Atom attribute,
|
||||
INT32 *value
|
||||
){
|
||||
return TDFXGetPortAttributeOverlay(pScrn, attribute, value,
|
||||
return TDFXGetPortAttributeOverlay(pScrn, attribute, value,
|
||||
(pointer)(GET_PORT_PRIVATE(pScrn)));
|
||||
}
|
||||
|
||||
@@ -1219,16 +1219,16 @@ TDFXSetSurfaceAttribute(
|
||||
Atom attribute,
|
||||
INT32 value
|
||||
){
|
||||
return TDFXSetPortAttributeOverlay(pScrn, attribute, value,
|
||||
return TDFXSetPortAttributeOverlay(pScrn, attribute, value,
|
||||
(pointer)(GET_PORT_PRIVATE(pScrn)));
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
TDFXDisplaySurface(
|
||||
XF86SurfacePtr surface,
|
||||
short src_x, short src_y,
|
||||
short src_x, short src_y,
|
||||
short drw_x, short drw_y,
|
||||
short src_w, short src_h,
|
||||
short src_w, short src_h,
|
||||
short drw_w, short drw_h,
|
||||
RegionPtr clipBoxes
|
||||
){
|
||||
@@ -1249,7 +1249,7 @@ TDFXDisplaySurface(
|
||||
dstBox.y1 = drw_y;
|
||||
dstBox.y2 = drw_y + drw_h;
|
||||
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes,
|
||||
if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes,
|
||||
surface->width, surface->height))
|
||||
{
|
||||
return Success;
|
||||
@@ -1260,7 +1260,7 @@ TDFXDisplaySurface(
|
||||
dstBox.y1 -= pScrn->frameY0;
|
||||
dstBox.y2 -= pScrn->frameY0;
|
||||
|
||||
TDFXDisplayVideoOverlay(pScrn, surface->id, surface->offsets[0],
|
||||
TDFXDisplayVideoOverlay(pScrn, surface->id, surface->offsets[0],
|
||||
surface->width, surface->height, surface->pitches[0],
|
||||
x1, y1, x2, &dstBox, src_w, src_h, drw_w, drw_h);
|
||||
|
||||
@@ -1269,7 +1269,7 @@ TDFXDisplaySurface(
|
||||
pPriv->isOn = TRUE;
|
||||
/* we've prempted the XvImage stream so set its free timer */
|
||||
if(portPriv->videoStatus & CLIENT_VIDEO_ON) {
|
||||
REGION_EMPTY(pScrn->pScreen, &portPriv->clip);
|
||||
REGION_EMPTY(pScrn->pScreen, &portPriv->clip);
|
||||
UpdateCurrentTime();
|
||||
portPriv->videoStatus = FREE_TIMER;
|
||||
portPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
|
||||
@@ -1279,7 +1279,7 @@ TDFXDisplaySurface(
|
||||
return Success;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
TDFXInitOffscreenImages(ScreenPtr pScreen)
|
||||
{
|
||||
XF86OffscreenImagePtr offscreenImages;
|
||||
@@ -1289,7 +1289,7 @@ TDFXInitOffscreenImages(ScreenPtr pScreen)
|
||||
return;
|
||||
|
||||
offscreenImages[0].image = &OverlayImages[0];
|
||||
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
|
||||
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
|
||||
VIDEO_CLIP_TO_VIEWPORT;
|
||||
offscreenImages[0].alloc_surface = TDFXAllocateSurface;
|
||||
offscreenImages[0].free_surface = TDFXFreeSurface;
|
||||
@@ -1301,6 +1301,6 @@ TDFXInitOffscreenImages(ScreenPtr pScreen)
|
||||
offscreenImages[0].max_height = 2048;
|
||||
offscreenImages[0].num_attributes = 2;
|
||||
offscreenImages[0].attributes = OverlayAttributes;
|
||||
|
||||
|
||||
xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
#define CFG_SLI_COMPAREMASK_FETCH (0xFF<<CFG_SLI_COMPAREMASK_FETCH_SHIFT)
|
||||
#define CFG_SLI_RENDERMASK_CRT_SHIFT 16
|
||||
#define CFG_SLI_RENDERMASK_CRT (0xFF<<CFG_SLI_RENDERMASK_CRT_SHIFT)
|
||||
#define CFG_SLI_COMPAREMASK_CRT_SHIFT 24
|
||||
#define CFG_SLI_COMPAREMASK_CRT_SHIFT 24
|
||||
#define CFG_SLI_COMPAREMASK_CRT (0xFF<<CFG_SLI_COMPAREMASK_CRT_SHIFT)
|
||||
|
||||
/* CFG_VIDEO_CTRL2 */
|
||||
@@ -353,7 +353,7 @@
|
||||
#define CFG_SLI_LFB_RENDERMASK (0xFF<<CFG_SLI_LFB_RENDERMASK_SHIFT)
|
||||
#define CFG_SLI_LFB_COMPAREMASK_SHIFT 8
|
||||
#define CFG_SLI_LFB_COMPAREMASK (0xFF<<CFG_SLI_LFB_COMPAREMASK_SHIFT)
|
||||
#define CFG_SLI_LFB_SCANMASK_SHIFT 16
|
||||
#define CFG_SLI_LFB_SCANMASK_SHIFT 16
|
||||
#define CFG_SLI_LFB_SCANMASK (0xFF<<CFG_SLI_LFB_SCANMASK_SHIFT)
|
||||
#define CFG_SLI_LFB_NUMCHIPS_LOG2_SHIFT 24
|
||||
#define CFG_SLI_LFB_NUMCHIPS_LOG2 (0x3<<CFG_SLI_LFB_NUMCHIPS_LOG2_SHIFT)
|
||||
@@ -385,7 +385,7 @@
|
||||
#define CFG_VGA_VSYNC_OFFSET (0x1ff<<CFG_VGA_VSYNC_OFFSET_SHIFT)
|
||||
#define CFG_VGA_VSYNC_OFFSET_PIXELS_SHIFT 0
|
||||
#define CFG_VGA_VSYNC_OFFSET_CHARS_SHIFT 3
|
||||
#define CFG_VGA_VSYNC_OFFSET_HXTRA_SHIFT 6
|
||||
#define CFG_VGA_VSYNC_OFFSET_HXTRA_SHIFT 6
|
||||
#define CFG_HOTPLUG_SHIFT 9
|
||||
#define CFG_HOTPLUG_TRISTATE (0x0<<CFG_HOTPLUG_SHIFT)
|
||||
#define CFG_HOTPLUG_DRIVE0 (0x2<<CFG_HOTPLUG_SHIFT)
|
||||
@@ -397,7 +397,7 @@
|
||||
#define SLICTL_3D_RENDERMASK (0xFF<<SLICTL_3D_RENDERMASK_SHIFT)
|
||||
#define SLICTL_3D_COMPAREMASK_SHIFT 8
|
||||
#define SLICTL_3D_COMPAREMASK (0xFF<<SLICTL_3D_COMPAREMASK_SHIFT)
|
||||
#define SLICTL_3D_SCANMASK_SHIFT 16
|
||||
#define SLICTL_3D_SCANMASK_SHIFT 16
|
||||
#define SLICTL_3D_SCANMASK (0xFF<<SLICTL_3D_SCANMASK_SHIFT)
|
||||
#define SLICTL_3D_NUMCHIPS_LOG2_SHIFT 24
|
||||
#define SLICTL_3D_NUMCHIPS_LOG2 (0x3<<SLICTL_3D_NUMCHIPS_LOG2_SHIFT)
|
||||
|
||||
Reference in New Issue
Block a user