Initial revision

parents
.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v 1.6 2002/05/14 20:19:51 alanh Exp $
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH SAVAGE __drivermansuffix__ __vendorversion__
.SH NAME
savage \- S3 Savage video driver
.SH SYNOPSIS
.nf
.B "Section \*qDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qsavage\*q"
\ \ ...
.B EndSection
.fi
.SH DESCRIPTION
.B savage
is an XFree86 driver for the S3 Savage family video accelerator chips. The
.B savage
driver supports PCI and AGP boards with the following chips:
.TP 16
.BI Savage3D
(8a20 and 8a21)
.TP 16
.B Savage4
(8a22)
.TP 16
.B Savage2000
(9102)
.TP 16
.B Savage/MX
(8c10 and 8c11)
.TP 16
.B Savage/IX
(8c12 and 8c13)
.TP 16
.B ProSavage PM133
(8a25)
.TP 16
.B ProSavage KM133
(8a26)
.TP 16
.B Twister (ProSavage PN133)
(8d01)
.TP 16
.B TwisterK (ProSavage KN133)
(8d02)
.TP 16
.B ProSavage DDR
(8d03)
.TP 16
.B ProSavage DDR-K
(8d04)
.SH CONFIGURATION DETAILS
Please refer to XF86Config(__filemansuffix__) for general configuration
details. This section only covers configuration details specific to this
driver.
.PP
The following driver
.B Options
are supported:
.TP
.BI "Option \*qHWCursor\*q \*q" boolean \*q
.TP
.BI "Option \*qSWCursor\*q \*q" boolean \*q
These two options interact to specify hardware or software cursor. If the
SWCursor option is specified, any HWCursor setting is ignored. Thus, either
\*qHWCursor off\*q or \*qSWCursor on\*q will force the use of the software
cursor. On Savage/MX and Savage/IX chips which are connected to LCDs, a
software cursor will be forced, because the Savage hardware cursor does not
correctly track the automatic panel expansion feature.
Default: hardware cursor.
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
Disable or enable acceleration. Default: acceleration is enabled.
.TP
.BI "Option \*qRotate\*q \*qCW\*q"
.TP
.BI "Option \*qRotate\*q \*qCCW\*q"
Rotate the desktop 90 degrees clockwise or counterclockwise. This option
forces the ShadowFB option on, and disables acceleration.
Default: no rotation.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. See
shadowfb(__drivermansuffix__) for further information. This option
disables acceleration. Default: off.
.TP
.BI "Option \*qLCDClock\*q \*q" frequency \*q
Override the maximum dot clock. Some LCD panels produce incorrect results if
they are driven at too fast of a frequency. If UseBIOS is on, the BIOS will
usually restrict the clock to the correct range. If not, it might be
necessary to override it here. The
.B frequency
parameter may be specified as an integer in Hz (135750000), or with
standard suffixes like "k", "kHz", "M", or "MHz" (as in 135.75MHz).
.TP
.BI "Option \*qUseBIOS\*q \*q" boolean \*q
Enable or disable use of the video BIOS to change modes. Ordinarily, the
.B savage
driver tries to use the video BIOS to do mode switches. This generally
produces the best results with the mobile chips (/MX and /IX), since the BIOS
knows how to handle the critical but unusual timing requirements of the
various LCD panels supported by the chip. To do this, the driver searches
through the BIOS mode list, looking for the mode which most closely matches
the XF86Config mode line. Some purists find this scheme objectionable. If
you would rather have the
.B savage
driver use your mode line timing exactly, turn off the UseBios option.
Default: on (use the BIOS).
.TP
.BI "Option \*qShadowStatus\*q \q*" boolean \*q
Enables the use of a shadow status register. There is a chip bug in the
Savage graphics engine that can cause a bus lock when reading the engine
status register under heavy load, such as when scrolling text or dragging
windows. The bug affects about 4% of all Savage users. If your system
hangs regularly while scrolling text or dragging windows, try turning this
option on. This uses an alternate method of reading the engine status
which is slightly more expensive, but avoids the problem. Default: off
(use normal status register).
.SH FILES
savage_drv.o
.SH "SEE ALSO"
XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
.SH AUTHORS
Authors include Tim Roberts (timr@probo.com) and Ani Joshi (ajoshi@unixbox.com)
for the 4.0 version, and Tim Roberts and S. Marineau for the 3.3 driver from
which this was derived.
This diff is collapsed.
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_bci.h,v 1.4 2002/10/02 20:39:54 alanh Exp $ */
#ifndef _S3BCI_H_
#define _S3BCI_H_
#define REVERSE_BYTE_ORDER32(dword) {\
unsigned int temp; \
dword = (temp & 0xFF) << 24; \
dword |= (temp & 0xFF00) << 8; \
dword |= (temp & 0xFF0000) >> 8; \
dword |= (temp & 0xFF000000) >> 24; }
#define BCI_GET_PTR volatile unsigned int * bci_ptr = (unsigned int *) psav->BciMem
#define BCI_RESET bci_ptr = (unsigned int *) psav->BciMem
#define BCI_SEND(dw) (*bci_ptr++ = (unsigned int)(dw))
#define BCI_CMD_NOP 0x40000000
#define BCI_CMD_RECT 0x48000000
#define BCI_CMD_RECT_XP 0x01000000
#define BCI_CMD_RECT_YP 0x02000000
#define BCI_CMD_SCANLINE 0x50000000
#define BCI_CMD_LINE 0x5C000000
#define BCI_CMD_LINE_LAST_PIXEL 0x58000000
#define BCI_CMD_BYTE_TEXT 0x63000000
#define BCI_CMD_NT_BYTE_TEXT 0x67000000
#define BCI_CMD_BIT_TEXT 0x6C000000
#define BCI_CMD_GET_ROP(cmd) (((cmd) >> 16) & 0xFF)
#define BCI_CMD_SET_ROP(cmd, rop) ((cmd) |= ((rop & 0xFF) << 16))
#define BCI_CMD_SEND_COLOR 0x00008000
#define BCI_CMD_CLIP_NONE 0x00000000
#define BCI_CMD_CLIP_CURRENT 0x00002000
#define BCI_CMD_CLIP_LR 0x00004000
#define BCI_CMD_CLIP_NEW 0x00006000
#define BCI_CMD_DEST_GBD 0x00000000
#define BCI_CMD_DEST_PBD 0x00000800
#define BCI_CMD_DEST_PBD_NEW 0x00000C00
#define BCI_CMD_DEST_SBD 0x00001000
#define BCI_CMD_DEST_SBD_NEW 0x00001400
#define BCI_CMD_SRC_TRANSPARENT 0x00000200
#define BCI_CMD_SRC_SOLID 0x00000000
#define BCI_CMD_SRC_GBD 0x00000020
#define BCI_CMD_SRC_COLOR 0x00000040
#define BCI_CMD_SRC_MONO 0x00000060
#define BCI_CMD_SRC_PBD_COLOR 0x00000080
#define BCI_CMD_SRC_PBD_MONO 0x000000A0
#define BCI_CMD_SRC_PBD_COLOR_NEW 0x000000C0
#define BCI_CMD_SRC_PBD_MONO_NEW 0x000000E0
#define BCI_CMD_SRC_SBD_COLOR 0x00000100
#define BCI_CMD_SRC_SBD_MONO 0x00000120
#define BCI_CMD_SRC_SBD_COLOR_NEW 0x00000140
#define BCI_CMD_SRC_SBD_MONO_NEW 0x00000160
#define BCI_CMD_PAT_TRANSPARENT 0x00000010
#define BCI_CMD_PAT_NONE 0x00000000
#define BCI_CMD_PAT_COLOR 0x00000002
#define BCI_CMD_PAT_MONO 0x00000003
#define BCI_CMD_PAT_PBD_COLOR 0x00000004
#define BCI_CMD_PAT_PBD_MONO 0x00000005
#define BCI_CMD_PAT_PBD_COLOR_NEW 0x00000006
#define BCI_CMD_PAT_PBD_MONO_NEW 0x00000007
#define BCI_CMD_PAT_SBD_COLOR 0x00000008
#define BCI_CMD_PAT_SBD_MONO 0x00000009
#define BCI_CMD_PAT_SBD_COLOR_NEW 0x0000000A
#define BCI_CMD_PAT_SBD_MONO_NEW 0x0000000B
#define BCI_BD_BW_DISABLE 0x10000000
#define BCI_BD_TILE_MASK 0x03000000
#define BCI_BD_TILE_NONE 0x00000000
#define BCI_BD_TILE_16 0x02000000
#define BCI_BD_TILE_32 0x04000000
#define BCI_BD_GET_BPP(bd) (((bd) >> 16) & 0xFF)
#define BCI_BD_SET_BPP(bd, bpp) ((bd) |= (((bpp) & 0xFF) << 16))
#define BCI_BD_GET_STRIDE(bd) ((bd) & 0xFFFF)
#define BCI_BD_SET_STRIDE(bd, st) ((bd) |= ((st) & 0xFFFF))
#define BCI_W_H(w, h) ((((h) << 16) | (w)) & 0x0FFF0FFF)
#define BCI_X_Y(x, y) ((((y) << 16) | (x)) & 0x0FFF0FFF)
#define BCI_X_W(x, y) ((((w) << 16) | (x)) & 0x0FFF0FFF)
#define BCI_CLIP_LR(l, r) ((((r) << 16) | (l)) & 0x0FFF0FFF)
#define BCI_CLIP_TL(t, l) ((((t) << 16) | (l)) & 0x0FFF0FFF)
#define BCI_CLIP_BR(b, r) ((((b) << 16) | (r)) & 0x0FFF0FFF)
#define BCI_LINE_X_Y(x, y) (((y) << 16) | ((x) & 0xFFFF))
#define BCI_LINE_STEPS(diag, axi) (((axi) << 16) | ((diag) & 0xFFFF))
#define BCI_LINE_MISC(maj, ym, xp, yp, err) \
(((maj) & 0x1FFF) | \
((ym) ? 1<<13 : 0) | \
((xp) ? 1<<14 : 0) | \
((yp) ? 1<<15 : 0) | \
((err) << 16))
#endif /* _S3BCI_H_ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v 1.9 2003/01/18 15:22:29 eich Exp $ */
/*
* Hardware cursor support for S3 Savage 4.0 driver. Taken with
* very few changes from the s3virge cursor file.
*
* S. Marineau, 19/04/97.
* Modified by Amancio Hasty and Jon Tombs
* Ported to 4.0 by Tim Roberts.
*/
#include "savage_driver.h"
static void SavageLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src);
static void SavageSetCursorPosition(ScrnInfoPtr pScrn, int x, int y);
static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
/*
* Read/write to the DAC via MMIO
*/
#define inCRReg(reg) (VGAHWPTR(pScrn))->readCrtc( VGAHWPTR(pScrn), reg )
#define outCRReg(reg, val) (VGAHWPTR(pScrn))->writeCrtc( VGAHWPTR(pScrn), reg, val )
#define inSRReg(reg) (VGAHWPTR(pScrn))->readSeq( VGAHWPTR(pScrn), reg )
#define outSRReg(reg, val) (VGAHWPTR(pScrn))->writeSeq( VGAHWPTR(pScrn), reg, val )
#define inStatus1() (VGAHWPTR(pScrn))->readST01( VGAHWPTR(pScrn) )
/*
* certain HW cursor operations seem
* to require a delay to prevent lockups.
*/
#define waitHSync(n) { \
int num = n; \
while (num--) { \
while ((inStatus1()) & 0x01){};\
while (!(inStatus1()) & 0x01){};\
} \
}
#define MAX_CURS 64
/*
* Disable HW Cursor on stretched LCDs. We don't know how to
* detect if display is stretched. Therefore we cannot rescale
* the HW cursor position.
*/
static Bool
SavageUseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
{
ScrnInfoPtr pScrn = xf86Screens[pScr->myNum];
SavagePtr psav = SAVPTR(pScrn);
if (psav->PanelX != pScrn->currentMode->HDisplay
|| psav->PanelY != pScrn->currentMode->VDisplay) {
/* BIT 1 : CRT is active, BIT 2 : LCD is active */
unsigned char cr6d = inCRReg( 0x6d );
if (cr6d & 0x02)
return FALSE;
}
return TRUE;
}
Bool
SavageHWCursorInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
SavagePtr psav = SAVPTR(pScrn);
xf86CursorInfoPtr infoPtr;
infoPtr = xf86CreateCursorInfoRec();
if(!infoPtr)
return FALSE;
psav->CursorInfoRec = infoPtr;
infoPtr->MaxWidth = MAX_CURS;
infoPtr->MaxHeight = MAX_CURS;
infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 |
HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK |
HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
HARDWARE_CURSOR_INVERT_MASK;
/*
* The /MX family is apparently unique among the Savages, in that
* the cursor color is always straight RGB. The rest of the Savages
* use palettized values at 8-bit when not clock doubled.
*/
if(
((psav->Chipset != S3_SAVAGE4)
&& (inSRReg(0x18) & 0x80) && (inSRReg(0x15) & 0x50) )
||
S3_SAVAGE_MOBILE_SERIES(psav->Chipset)
)
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->SetCursorColors = SavageSetCursorColors;
infoPtr->SetCursorPosition = SavageSetCursorPosition;
infoPtr->LoadCursorImage = SavageLoadCursorImage;
infoPtr->HideCursor = SavageHideCursor;
infoPtr->ShowCursor = SavageShowCursor;
if ((S3_SAVAGE_MOBILE_SERIES(psav->Chipset)
|| (psav->Chipset == S3_PROSAVAGE)) && !psav->CrtOnly)
infoPtr->UseHWCursor = SavageUseHWCursor;
else
infoPtr->UseHWCursor = NULL;
if( !psav->CursorKByte )
psav->CursorKByte = pScrn->videoRam - 4;
return xf86InitCursor(pScreen, infoPtr);
}
void
SavageShowCursor(ScrnInfoPtr pScrn)
{
/* Turn cursor on. */
outCRReg( 0x45, inCRReg(0x45) | 0x01 );
SAVPTR(pScrn)->hwc_on = TRUE;
}
void
SavageHideCursor(ScrnInfoPtr pScrn)
{
/* Turn cursor off. */
if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) )
{
waitHSync(5);
}
outCRReg( 0x45, inCRReg(0x45) & 0xfe );
SAVPTR(pScrn)->hwc_on = FALSE;
}
static void
SavageLoadCursorImage(
ScrnInfoPtr pScrn,
unsigned char* src)
{
SavagePtr psav = SAVPTR(pScrn);
/* Set cursor location in frame buffer. */
outCRReg( 0x4d, (0xff & psav->CursorKByte));
outCRReg( 0x4c, (0xff00 & psav->CursorKByte) >> 8);
/* Upload the cursor image to the frame buffer. */
memcpy(psav->FBBase + psav->CursorKByte * 1024, src, 1024);
if( S3_SAVAGE4_SERIES( psav->Chipset ) ) {
/*
* Bug in Savage4 Rev B requires us to do an MMIO read after
* loading the cursor.
*/
volatile unsigned int i = ALT_STATUS_WORD0;
(void)i; /* Not to be optimised out */
}
}
static void
SavageSetCursorPosition(
ScrnInfoPtr pScrn,
int x,
int y)
{
unsigned char xoff, yoff;
if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) )
{
waitHSync(5);
}
/* adjust for frame buffer base address granularity */
if (pScrn->bitsPerPixel == 8)
x += ((pScrn->frameX0) & 3);
else if (pScrn->bitsPerPixel == 16)
x += ((pScrn->frameX0) & 1);
else if (pScrn->bitsPerPixel == 32)
x += ((pScrn->frameX0+2) & 3) - 2;
/*
* Make these even when used. There is a bug/feature on at least
* some chipsets that causes a "shadow" of the cursor in interlaced
* mode. Making this even seems to have no visible effect, so just
* do it for the generic case.
*/
if (x < 0) {
xoff = ((-x) & 0xFE);
x = 0;
} else {
xoff = 0;
}
if (y < 0) {
yoff = ((-y) & 0xFE);
y = 0;
} else {
yoff = 0;
}
/* This is the recomended order to move the cursor */
outCRReg( 0x46, (x & 0xff00)>>8 );
outCRReg( 0x47, (x & 0xff) );
outCRReg( 0x49, (y & 0xff) );
outCRReg( 0x4e, xoff );
outCRReg( 0x4f, yoff );
outCRReg( 0x48, (y & 0xff00)>>8 );
}
static void
SavageSetCursorColors(
ScrnInfoPtr pScrn,
int bg,
int fg)
{
SavagePtr psav = SAVPTR(pScrn);
Bool bNeedExtra = FALSE;
/* Clock doubled modes need an extra cursor stack write. */
bNeedExtra =
(psav->CursorInfoRec->Flags & HARDWARE_CURSOR_TRUECOLOR_AT_8BPP);
if(
S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
(pScrn->depth == 24) ||
((pScrn->depth == 8) && bNeedExtra)
)
{
/* Do it straight, full 24 bit color. */
/* Reset the cursor color stack pointer */
inCRReg(0x45);
/* Write low, mid, high bytes - foreground */
outCRReg(0x4a, fg);
outCRReg(0x4a, fg >> 8);
outCRReg(0x4a, fg >> 16);
/* Reset the cursor color stack pointer */
inCRReg(0x45);
/* Write low, mid, high bytes - background */
outCRReg(0x4b, bg);
outCRReg(0x4b, bg >> 8);
outCRReg(0x4b, bg >> 16);
return;
}
else if( (pScrn->depth == 15) || (pScrn->depth == 16) )
{
if (pScrn->depth == 15) {
fg = ((fg & 0xf80000) >> 9) |
((fg & 0xf800) >> 6) |
((fg & 0xf8) >> 3);
bg = ((bg & 0xf80000) >> 9) |
((bg & 0xf800) >> 6) |
((bg & 0xf8) >> 3);
} else {
fg = ((fg & 0xf80000) >> 8) |
((fg & 0xfc00) >> 5) |
((fg & 0xf8) >> 3);
bg = ((bg & 0xf80000) >> 8) |
((bg & 0xfc00) >> 5) |
((bg & 0xf8) >> 3);
}
/* Reset the cursor color stack pointer */
inCRReg( 0x45 );
outCRReg( 0x4a, fg );
outCRReg( 0x4a, fg>>8 );
if( bNeedExtra )
{
outCRReg( 0x4a, fg );
outCRReg( 0x4a, fg>>8 );
}
/* Reset the cursor color stack pointer */
inCRReg( 0x45 );
outCRReg( 0x4b, bg );
outCRReg( 0x4b, bg>>8 );
if( bNeedExtra )
{
outCRReg( 0x4b, bg );
outCRReg( 0x4b, bg>>8 );
}
}
else if( pScrn->depth == 8 )
{
/* Reset the cursor color stack pointer */
inCRReg(0x45);
/* Write foreground */
outCRReg(0x4a, fg);
outCRReg(0x4a, fg);
/* Reset the cursor color stack pointer */
inCRReg(0x45);
/* Write background */
outCRReg(0x4b, bg);
outCRReg(0x4b, bg);
}
}
This diff is collapsed.
This diff is collapsed.
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.16 2003/01/18 15:22:30 eich Exp $ */
#ifndef SAVAGE_VGAHWMMIO_H
#define SAVAGE_VGAHWMMIO_H
#include "xf86_ansic.h"
#include "compiler.h"
#include "vgaHW.h"
#include "xf86.h"
#include "xf86Resources.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
#include "xf86_OSproc.h"
#include "xf86Cursor.h"
#include "mipointer.h"
#include "micmap.h"
#include "fb.h"
#include "xf86cmap.h"
#include "vbe.h"
#include "xaa.h"
#include "xf86xv.h"
#include "savage_regs.h"
#define VGAIN8(addr) MMIO_IN8(psav->MapBase+0x8000, addr)
#define VGAIN16(addr) MMIO_IN16(psav->MapBase+0x8000, addr)
#define VGAIN(addr) MMIO_IN32(psav->MapBase+0x8000, addr)
#define VGAOUT8(addr,val) MMIO_OUT8(psav->MapBase+0x8000, addr, val)
#define VGAOUT16(addr,val) MMIO_OUT16(psav->MapBase+0x8000, addr, val)
#define VGAOUT(addr,val) MMIO_OUT32(psav->MapBase+0x8000, addr, val)
#define INREG(addr) MMIO_IN32(psav->MapBase, addr)
#define OUTREG(addr,val) MMIO_OUT32(psav->MapBase, addr, val)
#define INREG16(addr) MMIO_IN16(psav->MapBase, addr)
#define OUTREG16(addr,val) MMIO_OUT16(psav->MapBase, addr, val)
#define SAVAGE_CRT_ON 1
#define SAVAGE_LCD_ON 2
#define SAVAGE_TV_ON 4
typedef struct _S3VMODEENTRY {
unsigned short Width;
unsigned short Height;
unsigned short VesaMode;
unsigned char RefreshCount;
unsigned char * RefreshRate;
} SavageModeEntry, *SavageModeEntryPtr;
typedef struct _S3VMODETABLE {
unsigned short NumModes;
SavageModeEntry Modes[1];
} SavageModeTableRec, *SavageModeTablePtr;
typedef struct {
unsigned int mode, refresh;
unsigned char SR08, SR0E, SR0F;
unsigned char SR10, SR11, SR12, SR13, SR15, SR18, SR1B, SR29, SR30;
unsigned char SR54[8];
unsigned char Clock;
unsigned char CR31, CR32, CR33, CR34, CR36, CR3A, CR3B, CR3C;
unsigned char CR40, CR41, CR42, CR43, CR45;
unsigned char CR50, CR51, CR53, CR55, CR58, CR5B, CR5D, CR5E;
unsigned char CR60, CR63, CR65, CR66, CR67, CR68, CR69, CR6D, CR6F;
unsigned char CR86, CR88;
unsigned char CR90, CR91, CRB0;
unsigned int STREAMS[22]; /* yuck, streams regs */
unsigned int MMPR0, MMPR1, MMPR2, MMPR3;
} SavageRegRec, *SavageRegPtr;
typedef struct _Savage {
SavageRegRec SavedReg;
SavageRegRec ModeReg;
xf86CursorInfoPtr CursorInfoRec;
Bool ModeStructInit;
Bool NeedSTREAMS;
Bool STREAMSRunning;
int Bpp, Bpl, ScissB;
unsigned PlaneMask;
I2CBusPtr I2C;
int videoRambytes;
int videoRamKbytes;
int MemOffScreen;
CARD32 CursorKByte;
/* These are physical addresses. */
unsigned long FrameBufferBase;
unsigned long MmioBase;
unsigned long ShadowPhysical;
/* These are linear addresses. */
unsigned char* MapBase;
unsigned char* BciMem;
unsigned char* MapBaseDense;
unsigned char* FBBase;
unsigned char* FBStart;
CARD32 volatile * ShadowVirtual;
Bool PrimaryVidMapped;
int dacSpeedBpp;
int minClock, maxClock;
int HorizScaleFactor;
int MCLK, REFCLK, LCDclk;
double refclk_fact;
int GEResetCnt;
/* Here are all the Options */
OptionInfoPtr Options;
Bool ShowCache;
Bool pci_burst;
Bool NoPCIRetry;
Bool fifo_conservative;
Bool fifo_moderate;
Bool fifo_aggressive;
Bool hwcursor;
Bool hwc_on;
Bool NoAccel;
Bool shadowFB;
Bool UseBIOS;
int rotate;
double LCDClock;
Bool ShadowStatus;
Bool CrtOnly;
Bool TvOn;
Bool PAL;
Bool ForceInit;
int iDevInfo;
int iDevInfoPrim;
int PanelX; /* panel width */
int PanelY; /* panel height */
int iResX; /* crtc X display */
int iResY; /* crtc Y display */
int XFactor; /* overlay X factor */
int YFactor; /* overlay Y factor */
int displayXoffset; /* overlay X offset */
int displayYoffset; /* overlay Y offset */
int XExpansion; /* expansion factor in x */
int XExp1;
int XExp2;
int YExpansion; /* expansion factor in x */
int YExp1;
int YExp2;
int cxScreen;
int TVSizeX;
int TVSizeY;
CloseScreenProcPtr CloseScreen;
pciVideoPtr PciInfo;
PCITAG PciTag;
int Chipset;
int ChipId;
int ChipRev;
vbeInfoPtr pVbe;
int EntityIndex;
int ShadowCounter;
int vgaIOBase; /* 3b0 or 3d0 */
/* The various Savage wait handlers. */
int (*WaitQueue)(struct _Savage *, int);
int (*WaitIdle)(struct _Savage *);
int (*WaitIdleEmpty)(struct _Savage *);
/* Support for shadowFB and rotation */
unsigned char * ShadowPtr;
int ShadowPitch;
void (*PointerMoved)(int index, int x, int y);
/* Support for XAA acceleration */
XAAInfoRecPtr AccelInfoRec;
xRectangle Rect;
unsigned int SavedBciCmd;
unsigned int SavedFgColor;
unsigned int SavedBgColor;
unsigned int SavedSbdOffset;
unsigned int SavedSbd;
/* Support for Int10 processing */
xf86Int10InfoPtr pInt10;
SavageModeTablePtr ModeTable;
/* Support for the Savage command overflow buffer. */
unsigned long cobIndex; /* size index */
unsigned long cobSize; /* size in bytes */
unsigned long cobOffset; /* offset in frame buffer */
/* Support for DGA */
int numDGAModes;
DGAModePtr DGAModes;
Bool DGAactive;
int DGAViewportStatus;
/* Support for XVideo */
unsigned int videoFlags;
unsigned int blendBase;
int videoFourCC;
XF86VideoAdaptorPtr adaptor;
int VideoZoomMax;
int dwBCIWait2DIdle;
XF86OffscreenImagePtr offscreenImages;
} SavageRec, *SavagePtr;
/* Video flags. */
#define VF_STREAMS_ON 0x0001
#define SAVPTR(p) ((SavagePtr)((p)->driverPrivate))
/* Make the names of these externals driver-unique */
#define gpScrn savagegpScrn
#define myOUTREG savageOUTREG
#define readdw savagereaddw
#define readfb savagereadfb
#define writedw savagewritedw
#define writefb savagewritefb
#define writescan savagewritescan
/* Prototypes. */
extern void SavageCommonCalcClock(long freq, int min_m, int min_n1,
int max_n1, int min_n2, int max_n2,
long freq_min, long freq_max,