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-savage/-/merge_requests/15>
This commit is contained in:
Alan Coopersmith
2025-08-20 17:14:16 -07:00
parent 678a7687ac
commit 6649deaaf6
22 changed files with 501 additions and 501 deletions

4
.gitignore vendored
View File

@@ -71,8 +71,8 @@ core
*.tar.bz2
*.tar.gz
#
# Add & Override patterns for xf86-video-savage
# Add & Override patterns for xf86-video-savage
#
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
#

View File

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

View File

@@ -55,5 +55,5 @@ savage_drv_la_SOURCES += \
savage_hwmc.c \
savage_dri.c \
savage_dri.h \
savage_dripriv.h
savage_dripriv.h
endif

View File

@@ -6,13 +6,13 @@
*/
/*
* The accel file for the Savage driver.
*
* The accel file for the Savage driver.
*
* Created 20/03/97 by Sebastien Marineau for 3.3.6
* Modified 17-Nov-2000 by Tim Roberts for 4.0.1
* Modified Feb-2004 by Alex Deucher - integrating DRI support
* Modified 2005-2006 by Alex Deucher - adding exa support
* Revision:
* Revision:
*
*/
@@ -121,7 +121,7 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn)
OUTREG(0x812C, ~0); /* enable all read planes */
OUTREG16(0x8134, 0x27);
OUTREG16(0x8136, 0x07);
switch( psav->Chipset ) {
case S3_SAVAGE3D:
@@ -224,7 +224,7 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn)
/* correctly. This needs to get resolved. */
SavageSetGBD(pScrn);
}
}
void
SavageSetGBD(ScrnInfoPtr pScrn)
@@ -243,7 +243,7 @@ SavageSetGBD(ScrnInfoPtr pScrn)
*/
if ((!psav->bDisableTile) && ((pScrn->bitsPerPixel == 16) || (pScrn->bitsPerPixel == 32))) {
/* tileing in 16/32 BPP */
psav->bTiled = TRUE;
psav->bTiled = TRUE;
psav->lDelta = ((psav->lDelta + 127) >> 7) << 7;
if (S3_SAVAGE3D_SERIES(psav->Chipset))
@@ -252,7 +252,7 @@ SavageSetGBD(ScrnInfoPtr pScrn)
psav->ulAperturePitch = GetTileAperturePitch2000(pScrn->virtualX,
pScrn->bitsPerPixel,
psav->lDelta);
else
else
psav->ulAperturePitch = GetTileAperturePitch(pScrn->virtualX,pScrn->bitsPerPixel);
/* Use the aperture for linear screen */
@@ -261,7 +261,7 @@ SavageSetGBD(ScrnInfoPtr pScrn)
psav->bTiled = FALSE;
/* 32: Alignment for nontiled mode */
psav->lDelta = ((psav->lDelta + 31) >> 5) << 5;
psav->ulAperturePitch = psav->lDelta;
psav->ulAperturePitch = psav->lDelta;
}
psav->Bpp = pScrn->bitsPerPixel >> 3;
@@ -281,7 +281,7 @@ SavageSetGBD(ScrnInfoPtr pScrn)
/*
* Initialization per GX-3.
*
*
* 1. MM48C18 - Disable BCI.
* 2. MM48C0C - Enable updating shadow status
* and initialize shadow memory address.
@@ -308,11 +308,11 @@ SavageSetGBD(ScrnInfoPtr pScrn)
SavageSetGBD_3D(pScrn);
break;
case S3_SAVAGE_MX:
SavageSetGBD_M7(pScrn);
SavageSetGBD_M7(pScrn);
break;
case S3_SAVAGE4:
case S3_TWISTER:
case S3_PROSAVAGE:
case S3_PROSAVAGE:
case S3_PROSAVAGEDDR:
SavageSetGBD_Twister(pScrn);
break;
@@ -412,7 +412,7 @@ void SavageSetGBD_Twister(ScrnInfoPtr pScrn)
/*
* Global Bitmap Descriptor Register MM816C - twister/prosavage
* bit 24~25: tile format
* 00: linear
* 00: linear
* 01: destination tiling format
* 10: texture tiling format
* 11: reserved
@@ -423,7 +423,7 @@ void SavageSetGBD_Twister(ScrnInfoPtr pScrn)
/*
* Global Bitmap Descriptor Register MM816C - savage4
* bit 24~25: tile format
* 00: linear
* 00: linear
* 01: reserved
* 10: 16 bpp tiles
* 11: 32 bpp tiles
@@ -574,7 +574,7 @@ void SavageSetGBD_3D(ScrnInfoPtr pScrn)
/*
* Global Bitmap Descriptor Register MM816C
* bit 24~25: tile format
* 00: linear
* 00: linear
* 01: reserved
* 10: 16 bpp tiles
* 11: 32 bpp tiles
@@ -670,27 +670,27 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
* are used to control the primary streams
*/
if (psav->IsPrimary) {
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
} else if (psav->IsSecondary) {
/* IGA 2 */
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA2_READS_WRITES);
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA1);
} else {
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
/* IGA 2 */
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA2_READS_WRITES);
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
OUTREG8(CRT_DATA_REG,byte);
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA1);
}
/* Set primary stream to bank 0 */
@@ -711,7 +711,7 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
OUTREG32(PRI_STREAM2_FBUF_ADDR0,pScrn->fbOffset & 0x7fffff);
OUTREG32(PRI_STREAM2_FBUF_ADDR1,pScrn->fbOffset & 0x7fffff);
}
/*
* Program Primary Stream Stride Register.
*
@@ -836,16 +836,16 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
ulTmp = ((psav->lDelta / 2) >> 6) << 24;
if (psav->IsSecondary)
OUTREG32(TILED_SURFACE_REGISTER_1,ulTmp | TILED_SURF_BPP16 | pScrn->fbOffset);
else
else
OUTREG32(TILED_SURFACE_REGISTER_0,ulTmp | TILED_SURF_BPP16 | pScrn->fbOffset);
}
else if (pScrn->bitsPerPixel == 32) {
psav->GlobalBD.bd1.HighPart.ResBWTile = tile32;/* 32 bit */
ulTmp = ((psav->lDelta / 4) >> 5) << 24;
if (psav->IsSecondary)
OUTREG32(TILED_SURFACE_REGISTER_1,ulTmp | TILED_SURF_BPP32 | pScrn->fbOffset);
else
else
OUTREG32(TILED_SURFACE_REGISTER_0,ulTmp | TILED_SURF_BPP32 | pScrn->fbOffset);
}
@@ -853,7 +853,7 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn)
/* HW uses width */
psav->GlobalBD.bd1.HighPart.Stride = (unsigned short)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
/*
@@ -909,26 +909,26 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
* are used to control the primary streams
*/
if (psav->IsPrimary) {
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
} else if (psav->IsSecondary) {
/* IGA 2 */
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA2_READS_WRITES);
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA1);
} else {
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
/* IGA 2 */
OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA2_READS_WRITES);
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
@@ -939,7 +939,7 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
* load ps1 active registers as determined by MM81C0/81C4
* load ps2 active registers as determined by MM81B0/81B4
*/
OUTREG8(CRT_ADDRESS_REG,0x65);
OUTREG8(CRT_ADDRESS_REG,0x65);
byte = INREG8(CRT_DATA_REG) | 0x03;
OUTREG8(CRT_DATA_REG,byte);
@@ -988,7 +988,7 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
(((psav->lDelta * 2) << 16) & 0x3FFF0000)
| 0x80000000 | (psav->lDelta & 0x00001fff));
}
} else if (pScrn->bitsPerPixel == 32) {
if (psav->IsPrimary) {
OUTREG32(PRI_STREAM_STRIDE,
@@ -1027,7 +1027,7 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
if (!psav->IsSecondary)
/* bit 28:block write disable */
OUTREG32(S3_GLB_BD_HIGH, bci_enable | S3_BD64 | 0x10000000);
OUTREG32(S3_GLB_BD_HIGH, bci_enable | S3_BD64 | 0x10000000);
/* CR50, bit 7,6,0 = 111, Use GBD.*/
OUTREG8(CRT_ADDRESS_REG,0x50);
@@ -1048,16 +1048,16 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
ulTmp = (((pScrn->virtualX + 0x3f) & 0x0000ffc0) >> 6) << 20;
if (psav->IsSecondary)
OUTREG32(TILED_SURFACE_REGISTER_1,ulTmp | TILED_SURF_BPP16 | (pScrn->fbOffset>>6));
else
else
OUTREG32(TILED_SURFACE_REGISTER_0,ulTmp | TILED_SURF_BPP16 | (pScrn->fbOffset>>6));
}
else if (pScrn->bitsPerPixel == 32) {
psav->GlobalBD.bd1.HighPart.ResBWTile = tile32;/* tile format destination */
ulTmp = (((pScrn->virtualX + 0x1f) & 0x0000ffe0) >> 5) << 20;
ulTmp = (((pScrn->virtualX + 0x1f) & 0x0000ffe0) >> 5) << 20;
if (psav->IsSecondary)
OUTREG32(TILED_SURFACE_REGISTER_1,ulTmp | TILED_SURF_BPP32 | (pScrn->fbOffset>>6));
else
else
OUTREG32(TILED_SURFACE_REGISTER_0,ulTmp | TILED_SURF_BPP32 | (pScrn->fbOffset>>6));
}
@@ -1065,7 +1065,7 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
/* HW uses width */
psav->GlobalBD.bd1.HighPart.Stride = (unsigned short)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
/*
* CR31, bit 0 = 0, Disable address offset bits(CR6A_6-0).
@@ -1079,7 +1079,7 @@ void SavageSetGBD_PM(ScrnInfoPtr pScrn)
if (!psav->IsSecondary) {
/* program the GBD and SBDs */
OUTREG32(S3_GLB_BD_LOW,psav->GlobalBD.bd2.LoPart );
OUTREG32(S3_GLB_BD_HIGH,(psav->GlobalBD.bd2.HiPart
OUTREG32(S3_GLB_BD_HIGH,(psav->GlobalBD.bd2.HiPart
| bci_enable | S3_LITTLE_ENDIAN | S3_BD64));
OUTREG32(S3_PRI_BD_LOW,psav->GlobalBD.bd2.LoPart);
OUTREG32(S3_PRI_BD_HIGH,psav->GlobalBD.bd2.HiPart);
@@ -1141,7 +1141,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
OUTREG32(PRI_STREAM2_STRIDE,
(0x80000000 |((psav->lDelta << 4) & 0x7ff0)));
}
/*
* CR67_3:
* = 1 stream processor MMIO address and stride register
@@ -1150,7 +1150,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
* are used to control the primary streams
*/
OUTREG8(CRT_ADDRESS_REG,0x67);
OUTREG8(CRT_ADDRESS_REG,0x67);
byte = INREG8(CRT_DATA_REG) | 0x08;
OUTREG8(CRT_DATA_REG,byte);
@@ -1158,7 +1158,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
OUTREG32(0x812C, 0xFFFFFFFFL);
/* bit 28:block write disable */
OUTREG32(S3_GLB_BD_HIGH, bci_enable | S3_BD64 | 0x10000000);
OUTREG32(S3_GLB_BD_HIGH, bci_enable | S3_BD64 | 0x10000000);
/* CR50, bit 7,6,0 = 111, Use GBD.*/
OUTREG8(CRT_ADDRESS_REG,0x50);
@@ -1187,8 +1187,8 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
OUTREG32(PRI_STREAM2_STRIDE, ((ulTmp >> 19) & 0x03f0) | 0x80000000);
}
else if (pScrn->bitsPerPixel == 32) {
psav->GlobalBD.bd1.HighPart.ResBWTile = tile32;/* tile format destination */
ulTmp = (((pScrn->virtualX + 0x1f) & 0x0000ffe0) >> 5) << 23;
psav->GlobalBD.bd1.HighPart.ResBWTile = tile32;/* tile format destination */
ulTmp = (((pScrn->virtualX + 0x1f) & 0x0000ffe0) >> 5) << 23;
OUTREG32(TILED_SURFACE_REGISTER_0,ulTmp | TILED_SURF_BPP32_2000 | ulYRange);
ulTmp |= (TILED_SURF_BPP32_2000 | ulYRange);
OUTREG32(PRI_STREAM_STRIDE, ((ulTmp >> 19) & 0x03f0) | 0x80000000);
@@ -1199,7 +1199,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
/* HW uses width */
psav->GlobalBD.bd1.HighPart.Stride = (unsigned short)(psav->lDelta / (pScrn->bitsPerPixel >> 3));
psav->GlobalBD.bd1.HighPart.Bpp = (unsigned char) (pScrn->bitsPerPixel);
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
psav->GlobalBD.bd1.Offset = pScrn->fbOffset;
/*
* CR31, bit 0 = 0, Disable address offset bits(CR6A_6-0).
@@ -1212,7 +1212,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
/* program the GBD and SBDs */
OUTREG32(S3_GLB_BD_LOW,psav->GlobalBD.bd2.LoPart );
OUTREG32(S3_GLB_BD_HIGH,(psav->GlobalBD.bd2.HiPart
OUTREG32(S3_GLB_BD_HIGH,(psav->GlobalBD.bd2.HiPart
| bci_enable | S3_LITTLE_ENDIAN | S3_BD64));
OUTREG32(S3_PRI_BD_LOW,psav->GlobalBD.bd2.LoPart);
OUTREG32(S3_PRI_BD_HIGH,psav->GlobalBD.bd2.HiPart);
@@ -1227,7 +1227,7 @@ void SavageSetGBD_2000(ScrnInfoPtr pScrn)
/* Acceleration init function, sets up pointers to our accelerated functions */
Bool
Bool
SavageInitAccel(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -1338,7 +1338,7 @@ SavageInitAccel(ScreenPtr pScreen)
if ((psav->Chipset == S3_TWISTER)
|| (psav->Chipset == S3_PROSAVAGE)
|| (psav->Chipset == S3_PROSAVAGEDDR)
|| (psav->Chipset == S3_SUPERSAVAGE)) {
|| (psav->Chipset == S3_SUPERSAVAGE)) {
pSAVAGEDRIServer->frontBitmapDesc =
BCI_BD_BW_DISABLE | /* block write disabled */
(1<<24) | /* destination tile format */
@@ -1387,8 +1387,8 @@ SavageInitAccel(ScreenPtr pScreen)
else
{
psav->hwmcSize = (10*1024+512)*1024; /* HWMC needs 10MB FB */
psav->hwmcOffset = (psav->videoRambytes - 0x2000 - psav->hwmcSize) &
~SAVAGE_BUFFER_ALIGN;
psav->hwmcOffset = (psav->videoRambytes - 0x2000 - psav->hwmcSize) &
~SAVAGE_BUFFER_ALIGN;
if (psav->hwmcOffset < bufferSize) {
/* If hwmc buffer will lay in on-screen buffer. */
psav->hwmcSize = 0;
@@ -1396,11 +1396,11 @@ SavageInitAccel(ScreenPtr pScreen)
}
}
/* CR48438: Title: "Lots of garbage appear on the background when
/* CR48438: Title: "Lots of garbage appear on the background when
* drag the DVD player XINE window at 1024x768 or higher mode."
* hwmc used xserver's memory, now xserver will get less memory.
* Both 3D and hwmc's memory usage are considered now.
*/
*/
psav->cyMemory = pSAVAGEDRIServer->backOffset / widthBytes - 1;
if (psav->cyMemory > 0x7FFF) {
psav->cyMemory = 0x7FFF;
@@ -1441,7 +1441,7 @@ SavageInitAccel(ScreenPtr pScreen)
psav->cobSize - /*COB*/
0x200000;
}
}
if (psav->useEXA)
@@ -1526,10 +1526,10 @@ writescan( unsigned long scan, unsigned long color )
videobuffer += scan * gpScrn->displayWidth * gpScrn->bitsPerPixel >> 3;
for( i = gpScrn->displayWidth; --i; ) {
switch( gpScrn->bitsPerPixel ) {
case 8:
*videobuffer++ = color;
case 8:
*videobuffer++ = color;
break;
case 16:
case 16:
*(CARD16 *)videobuffer = color;
videobuffer += 2;
break;

View File

@@ -9,8 +9,8 @@
/*
* High 8 bit of primary bitmap descriptor 2 register.
* Bits 25-24: Tile Format 00 = Linear ; 10 = 16 bits; 11 = 32 bits (Savage4)
* 00 = Linear ; 01 = Tile; 10 = Texture tiling format/ Destination Tiling format
* 11 = Reserved/Destination tiling format.
* 00 = Linear ; 01 = Tile; 10 = Texture tiling format/ Destination Tiling format
* 11 = Reserved/Destination tiling format.
*/
@@ -32,7 +32,7 @@
#define S3_BD64 1
/* Global Bitmap Descriptor */
#define S3_BCI_GLB_BD_LOW 0x8168
#define S3_BCI_GLB_BD_HIGH 0x816C

View File

@@ -49,7 +49,7 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
/*
* Read/write to the DAC via MMIO
* Read/write to the DAC via MMIO
*/
#define inCRReg(reg) (VGAHWPTR(pScrn))->readCrtc( VGAHWPTR(pScrn), reg )
@@ -57,8 +57,8 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
#define inSRReg(reg) (VGAHWPTR(pScrn))->readSeq( VGAHWPTR(pScrn), reg )
#define outSRReg(reg, val) (VGAHWPTR(pScrn))->writeSeq( VGAHWPTR(pScrn), reg, val )
/*
* certain HW cursor operations seem
/*
* certain HW cursor operations seem
* to require a delay to prevent lockups.
*/
#define waitHSync(n) { \
@@ -67,7 +67,7 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
while (inStatus1() & 0x01){};\
while (!(inStatus1() & 0x01)){};\
} \
}
}
#define MAX_CURS 64
/*
@@ -76,7 +76,7 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg);
* the HW cursor position.
*/
Bool
Bool
SavageHWCursorInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -84,7 +84,7 @@ SavageHWCursorInit(ScreenPtr pScreen)
xf86CursorInfoPtr infoPtr;
infoPtr = xf86CreateCursorInfoRec();
if(!infoPtr)
if(!infoPtr)
return FALSE;
psav->CursorInfoRec = infoPtr;
@@ -97,11 +97,11 @@ SavageHWCursorInit(ScreenPtr pScreen)
HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
HARDWARE_CURSOR_INVERT_MASK;
/*
* With streams engine the Cursor seems to be ALWAYS TrueColor
* With streams engine the Cursor seems to be ALWAYS TrueColor
*except at least the Savage4
*/
if (psav->Chipset != S3_SAVAGE4)
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->SetCursorColors = SavageSetCursorColors;
infoPtr->SetCursorPosition = SavageSetCursorPosition;
@@ -189,7 +189,7 @@ SavageLoadCursorImage(
static void
SavageSetCursorPosition(
ScrnInfoPtr pScrn,
int x,
int x,
int y)
{
SavagePtr psav = SAVPTR(pScrn);
@@ -253,7 +253,7 @@ SavageSetCursorPosition(
}
static void
static void
SavageSetCursorColors(
ScrnInfoPtr pScrn,
int bg,
@@ -281,7 +281,7 @@ SavageSetCursorColors(
outCRReg(0x4b, bg >> 8);
outCRReg(0x4b, bg >> 16);
SelectIGA1();
} else {
} else {
/* Reset the cursor color stack pointer */
inCRReg(0x45);
/* Write low, mid, high bytes - foreground */

View File

@@ -39,7 +39,7 @@ in this Software without prior written authorization from the XFree86 Project.
Bool SavageDGAInit(ScreenPtr pScreen);
static Bool Savage_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool Savage_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
int *, int *, int *);
static Bool Savage_SetMode(ScrnInfoPtr, DGAModePtr);
static int Savage_GetViewport(ScrnInfoPtr);
@@ -164,7 +164,7 @@ SECOND_PASS:
"SavageDGAInit 1 imgHgt=%d, stride=%d\n",
mode->imageHeight,
mode->bytesPerScanline );
goto SECOND_PASS;
} else {
mode->bytesPerScanline = ((pScrn->displayWidth + 15) & ~15) * Bpp;
@@ -180,7 +180,7 @@ SECOND_PASS:
"SavageDGAInit 2 imgHgt=%d, stride=%d\n",
mode->imageHeight,
mode->bytesPerScanline );
}
}
pMode = pMode->next;
if(pMode == firstMode)
@@ -193,7 +193,7 @@ SECOND_PASS:
Bool
SavageDGAInit(ScreenPtr pScreen)
{
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
SavagePtr psav = SAVPTR(pScrn);
DGAModePtr modes = NULL;
@@ -202,40 +202,40 @@ SavageDGAInit(ScreenPtr pScreen)
xf86ErrorFVerb(DGATRACE, " SavageDGAInit\n");
/* 8 */
modes = SavageSetupDGAMode (pScrn, modes, &num, 8, 8,
modes = SavageSetupDGAMode (pScrn, modes, &num, 8, 8,
(pScrn->bitsPerPixel == 8),
(pScrn->bitsPerPixel != 8) ? 0 : pScrn->displayWidth,
0, 0, 0, PseudoColor);
/* 15 */
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 15,
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 15,
(pScrn->bitsPerPixel == 16),
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
0x7c00, 0x03e0, 0x001f, TrueColor);
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 15,
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 15,
(pScrn->bitsPerPixel == 16),
(pScrn->depth != 15) ? 0 : pScrn->displayWidth,
0x7c00, 0x03e0, 0x001f, DirectColor);
/* 16 */
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 16,
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 16,
(pScrn->bitsPerPixel == 16),
(pScrn->depth != 16) ? 0 : pScrn->displayWidth,
0xf800, 0x07e0, 0x001f, TrueColor);
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 16,
modes = SavageSetupDGAMode (pScrn, modes, &num, 16, 16,
(pScrn->bitsPerPixel == 16),
(pScrn->depth != 16) ? 0 : pScrn->displayWidth,
0xf800, 0x07e0, 0x001f, DirectColor);
/* 24-in-32 */
modes = SavageSetupDGAMode (pScrn, modes, &num, 32, 24,
modes = SavageSetupDGAMode (pScrn, modes, &num, 32, 24,
(pScrn->bitsPerPixel == 32),
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
0xff0000, 0x00ff00, 0x0000ff, TrueColor);
modes = SavageSetupDGAMode (pScrn, modes, &num, 32, 24,
modes = SavageSetupDGAMode (pScrn, modes, &num, 32, 24,
(pScrn->bitsPerPixel == 32),
(pScrn->bitsPerPixel != 32) ? 0 : pScrn->displayWidth,
0xff0000, 0x00ff00, 0x0000ff, DirectColor);
@@ -243,7 +243,7 @@ SavageDGAInit(ScreenPtr pScreen)
psav->numDGAModes = num;
psav->DGAModes = modes;
return DGAInit(pScreen, &Savage_DGAFuncs, modes, num);
return DGAInit(pScreen, &Savage_DGAFuncs, modes, num);
}
@@ -290,7 +290,7 @@ Savage_SetMode(
pScrn->bitsPerPixel = pMode->bitsPerPixel;
pScrn->depth = pMode->depth;
pScrn->displayWidth = pMode->bytesPerScanline /
pScrn->displayWidth = pMode->bytesPerScanline /
(pMode->bitsPerPixel >> 3);
SavageSwitchMode(pScrn, pMode->mode);
@@ -301,7 +301,7 @@ Savage_SetMode(
}
static int
static int
Savage_GetViewport(
ScrnInfoPtr pScrn
){
@@ -310,10 +310,10 @@ Savage_GetViewport(
}
static void
static void
Savage_SetViewport(
ScrnInfoPtr pScrn,
int x, int y,
ScrnInfoPtr pScrn,
int x, int y,
int flags
){
SavagePtr psav = SAVPTR(pScrn);
@@ -323,9 +323,9 @@ Savage_SetViewport(
}
static Bool
static Bool
Savage_OpenFramebuffer(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
char **name,
unsigned char **mem,
int *size,

View File

@@ -64,13 +64,13 @@ void SAVAGEDRIMoveBuffers( WindowPtr pParent, DDXPointRec ptOldOrg,
/* almost the same besides set src/desc to */
/* Primary Bitmap Description */
static void
static void
SAVAGEDRISetupForScreenToScreenCopy(
ScrnInfoPtr pScrn, int xdir, int ydir,
int rop, unsigned planemask, int transparency_color);
static void
static void
SAVAGEDRISubsequentScreenToScreenCopy(
ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2,
int w, int h);
@@ -770,7 +770,7 @@ static void SAVAGEDRISetupTiledSurfaceRegs( SavagePtr psav )
{
SAVAGEDRIPtr pSAVAGEDRI = (SAVAGEDRIPtr)psav->pDRIInfo->devPrivate;
unsigned int value = 0;
OUTREG(0x850C,(INREG(0x850C) | 0x00008000)); /* AGD: I don't think this does anything on 3D/MX/IX */
/* maybe savage4 too... */
if ((psav->Chipset == S3_SAVAGE_MX) /* 3D/MX/IX seem to set up the tile stride differently */
@@ -784,7 +784,7 @@ static void SAVAGEDRISetupTiledSurfaceRegs( SavagePtr psav )
value |= 3<<30;
}
OUTREG(TILED_SURFACE_REGISTER_0, value|(pSAVAGEDRI->frontOffset) ); /* front */
OUTREG(TILED_SURFACE_REGISTER_0, value|(pSAVAGEDRI->frontOffset) ); /* front */
OUTREG(TILED_SURFACE_REGISTER_1, value|(pSAVAGEDRI->backOffset) ); /* back */
OUTREG(TILED_SURFACE_REGISTER_2, value|(pSAVAGEDRI->depthOffset) ); /* depth */
} else {
@@ -882,19 +882,19 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen )
pSAVAGEDRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers]pSAVAGEDRIServer:\n" );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] reserved_map_agpstart:0x%08x\n",pSAVAGEDRIServer->reserved_map_agpstart);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] reserved_map_agpstart:0x%08x\n",pSAVAGEDRIServer->reserved_map_agpstart);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] reserved_map_idx:0x%08x\n",pSAVAGEDRIServer->reserved_map_idx);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] sarea_priv_offset:0x%08x\n",pSAVAGEDRIServer->sarea_priv_offset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] chipset:0x%08x\n",pSAVAGEDRIServer->chipset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] sgram:0x%08x\n",pSAVAGEDRIServer->sgram);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontbufferSize:0x%08x\n",pSAVAGEDRIServer->frontbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontOffset:0x%08x\n",pSAVAGEDRIServer->frontOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontbufferSize:0x%08x\n",pSAVAGEDRIServer->frontbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontOffset:0x%08x\n",pSAVAGEDRIServer->frontOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontPitch:0x%08x\n",pSAVAGEDRIServer->frontPitch);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backbufferSize:0x%08x\n",pSAVAGEDRIServer->backbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backOffset:0x%08x\n",pSAVAGEDRIServer->backOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backbufferSize:0x%08x\n",pSAVAGEDRIServer->backbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backOffset:0x%08x\n",pSAVAGEDRIServer->backOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backPitch:0x%08x\n",pSAVAGEDRIServer->backPitch);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthbufferSize:0x%08x\n",pSAVAGEDRIServer->depthbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthOffset:0x%08x\n",pSAVAGEDRIServer->depthOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthbufferSize:0x%08x\n",pSAVAGEDRIServer->depthbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthOffset:0x%08x\n",pSAVAGEDRIServer->depthOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthPitch:0x%08x\n",pSAVAGEDRIServer->depthPitch);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureOffset:0x%08x\n",pSAVAGEDRIServer->textureOffset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureSize:0x%08x\n",pSAVAGEDRIServer->textureSize);
@@ -921,13 +921,13 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen )
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] agpTextures:size:0x%08x\n",pSAVAGEDRIServer->agpTextures.size);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] apgTextures:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->agpTextures.map);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logAgpTextureGranularity:0x%08x\n",pSAVAGEDRIServer->logAgpTextureGranularity);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] logAgpTextureGranularity:0x%08x\n",pSAVAGEDRIServer->logAgpTextureGranularity);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:handle:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->cmdDma.handle);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:offset:0x%08x\n",pSAVAGEDRIServer->cmdDma.offset);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:size:0x%08x\n",pSAVAGEDRIServer->cmdDma.size);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] cmdDma:map:0x%08lx\n",(unsigned long)pSAVAGEDRIServer->cmdDma.map);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers]pSAVAGEDRI:\n" );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] chipset:0x%08x\n",pSAVAGEDRI->chipset );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] width:0x%08x\n",pSAVAGEDRI->width );
@@ -940,13 +940,13 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen )
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] bufferSize:%u\n",pSAVAGEDRI->bufferSize );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontbufferSize:0x%08x\n",pSAVAGEDRI->frontbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontbufferSize:0x%08x\n",pSAVAGEDRI->frontbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] frontOffset:0x%08x\n",pSAVAGEDRI->frontOffset );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backbufferSize:0x%08x\n",pSAVAGEDRI->backbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backbufferSize:0x%08x\n",pSAVAGEDRI->backbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] backOffset:0x%08x\n",pSAVAGEDRI->backOffset );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthbufferSize:0x%08x\n",pSAVAGEDRI->depthbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthbufferSize:0x%08x\n",pSAVAGEDRI->depthbufferSize);
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] depthOffset:0x%08x\n",pSAVAGEDRI->depthOffset );
xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[junkers] textureOffset:0x%08x\n",pSAVAGEDRI->textureOffset );
@@ -1008,13 +1008,13 @@ void SAVAGEDRICloseScreen( ScreenPtr pScreen )
}
if ( pSAVAGEDRIServer->agpXVideo.map ) {
drmUnmap( pSAVAGEDRIServer->agpXVideo.map,
drmUnmap( pSAVAGEDRIServer->agpXVideo.map,
pSAVAGEDRIServer->agpXVideo.size );
pSAVAGEDRIServer->agpXVideo.map = NULL;
}
if ( pSAVAGEDRIServer->agpTextures.map ) {
drmUnmap( pSAVAGEDRIServer->agpTextures.map,
drmUnmap( pSAVAGEDRIServer->agpTextures.map,
pSAVAGEDRIServer->agpTextures.size );
pSAVAGEDRIServer->agpTextures.map = NULL;
}
@@ -1271,10 +1271,10 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
exaMarkSync(pScreen);
}
static void
static void
SAVAGEDRISetupForScreenToScreenCopy(
ScrnInfoPtr pScrn,
int xdir,
int xdir,
int ydir,
int rop,
unsigned planemask,
@@ -1296,7 +1296,7 @@ SAVAGEDRISetupForScreenToScreenCopy(
}
static void
static void
SAVAGEDRISubsequentScreenToScreenCopy(
ScrnInfoPtr pScrn,
int x1,
@@ -1325,7 +1325,7 @@ SAVAGEDRISubsequentScreenToScreenCopy(
psav->WaitQueue(psav,6);
BCI_SEND(psav->SavedBciCmd);
if (psav->SavedBgColor != -1)
if (psav->SavedBgColor != -1)
BCI_SEND(psav->SavedBgColor);
BCI_SEND(BCI_X_Y(x1, y1));
BCI_SEND(BCI_X_Y(x2, y2));
@@ -1366,7 +1366,7 @@ SAVAGEDRIOpenFullScreen(ScreenPtr pScreen)
{
WidthinTiles = (pSAVAGEDRI->width+31)>>5;
TileStride = (pSAVAGEDRI->width+31)&(~31);
}
}
/* set primary stream stride */
{

View File

@@ -41,7 +41,7 @@ typedef struct {
unsigned int sarea_priv_offset;
unsigned int bufferSize; /* size of DMA buffers */
unsigned int frontbufferSize;
unsigned int frontOffset;

View File

@@ -28,7 +28,7 @@
/**
* \file savage_driver.c
*
*
* \author Tim Roberts <timr@probo.com>
* \author Ani Joshi <ajoshi@unixbox.com>
*
@@ -138,7 +138,7 @@ extern ScrnInfoPtr gpScrn;
#ifdef TRACEON
#define TRACE(prms) ErrorF prms
#else
#define TRACE(prms)
#define TRACE(prms)
#endif
int gSavageEntityIndex = -1;
@@ -395,7 +395,7 @@ static SavageEntPtr SavageEntPriv(ScrnInfoPtr pScrn)
/*
* I'd rather have these wait macros be inline, but S3 has made it
* I'd rather have these wait macros be inline, but S3 has made it
* darned near impossible. The bit fields are in a different place in
* all three families, the status register has a different address in the
* three families, and even the idle vs busy sense flipped in the Sav2K.
@@ -407,7 +407,7 @@ ResetBCI2K( SavagePtr psav )
CARD32 cob = INREG( 0x48c18 );
/* if BCI is enabled and BCI is busy... */
if(
if(
(cob & 0x00000008) &&
! (ALT_STATUS_WORD0 & 0x00200000)
)
@@ -659,7 +659,7 @@ static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid)
static void SavageIdentify(int flags)
{
xf86PrintChipsets("SAVAGE",
xf86PrintChipsets("SAVAGE",
"driver (version " SAVAGE_DRIVER_VERSION ") for S3 Savage chipsets",
SavageChips);
}
@@ -775,7 +775,7 @@ static Bool SavageProbe(DriverPtr drv, int flags)
for (i=0; i<numUsed; i++) {
EntityInfoPtr pEnt = xf86GetEntityInfo(usedChips[i]);;
ScrnInfoPtr pScrn = xf86ConfigPciEntity(NULL, 0, usedChips[i],
NULL, RES_SHARED_VGA,
NULL, RES_SHARED_VGA,
NULL, NULL, NULL, NULL);
if (pScrn != NULL) {
@@ -808,7 +808,7 @@ static Bool SavageProbe(DriverPtr drv, int flags)
psav->Chipset = LookupChipID(SavagePciChipsets,
pEnt->device->chipID);
} else {
psav->Chipset = LookupChipID(SavagePciChipsets,
psav->Chipset = LookupChipID(SavagePciChipsets,
psav->PciInfo->chipType);
}
}
@@ -925,7 +925,7 @@ SavageModesAdd(DisplayModePtr Modes, DisplayModePtr Additions)
while (Mode->next)
Mode = Mode->next;
Mode->next = Additions;
Additions->prev = Mode;
}
@@ -944,7 +944,7 @@ SavageAddPanelMode(ScrnInfoPtr pScrn)
Mode->type = M_T_DRIVER | M_T_PREFERRED;
pScrn->monitor->Modes = SavageModesAdd(pScrn->monitor->Modes, Mode);
if ((pScrn->monitor->nHsync == 0) &&
if ((pScrn->monitor->nHsync == 0) &&
(pScrn->monitor->nVrefresh == 0)) {
if (!Mode->HSync)
Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal);
@@ -987,9 +987,9 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
cr6b = hwp->readCrtc( hwp, 0x6b );
panelX = (hwp->readSeq(hwp, 0x61) +
panelX = (hwp->readSeq(hwp, 0x61) +
((hwp->readSeq(hwp, 0x66) & 0x02) << 7) + 1) * 8;
panelY = hwp->readSeq(hwp, 0x69) +
panelY = hwp->readSeq(hwp, 0x69) +
((hwp->readSeq(hwp, 0x6e) & 0x70) << 4) + 1;
@@ -997,7 +997,7 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
* for LCD panels of various sizes. I thought I copied the formula
* from the BIOS, but many users have informed me of my folly.
*
* Instead, I'll abandon any attempt to automatically limit the
* Instead, I'll abandon any attempt to automatically limit the
* clock, and add an LCDClock option to XF86Config. Some day,
* I should come back to this.
*/
@@ -1016,7 +1016,7 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
}
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"%dx%d %s LCD panel detected %s\n",
"%dx%d %s LCD panel detected %s\n",
panelX, panelY, sTechnology,
cr6b & ActiveLCD ? "and active" : "but not active");
@@ -1027,7 +1027,7 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"- Limiting video mode to %dx%d\n",
panelX, panelY );
psav->PanelX = panelX;
psav->PanelY = panelY;
@@ -1129,9 +1129,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
if(
if(
(pScrn->bitsPerPixel != requiredBpp) &&
(pScrn->bitsPerPixel != altBpp)
(pScrn->bitsPerPixel != altBpp)
) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Depth %d must specify %d bpp; %d was given\n",
@@ -1220,7 +1220,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->rotate = 1;
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 24
xf86DisableRandR();
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
"Rotating screen clockwise"
"- acceleration and RandR disabled\n");
#else
@@ -1245,7 +1245,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
} else {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid"
"value for Option \"Rotate\"\n", s);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Valid options are \"CW\" or \"CCW\"\n");
}
}
@@ -1268,7 +1268,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
}
if ((s = xf86GetOptValString(psav->Options, OPTION_OVERLAY))) {
if (psav->shadowFB) {
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
"Option \"Overlay\" not supported with shadowFB\n");
@@ -1305,7 +1305,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex,X_INFO,"%i/%i Overlay enabled\n",
pScrn->depth,psav->overlayDepth);
psav->primStreamBpp = 8;
}
}
}
}
@@ -1341,7 +1341,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->LCDClock = 0.0;
if( xf86GetOptValFreq( psav->Options, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) )
xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
xf86DrvMsg( pScrn->scrnIndex, X_CONFIG,
"Option: LCDClock %1.2f MHz\n", psav->LCDClock );
if( xf86GetOptValBool( psav->Options, OPTION_SHADOW_STATUS, &psav->ShadowStatus)) {
@@ -1602,7 +1602,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
from = X_DEFAULT;
psav->agpMode = SAVAGE_DEFAULT_AGP_MODE;
psav->agpSize = 16;
if (xf86GetOptValInteger(psav->Options,
OPTION_AGP_MODE, &(psav->agpMode))) {
if (psav->agpMode < 1) {
@@ -1611,7 +1611,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if (psav->agpMode > SAVAGE_MAX_AGP_MODE) {
psav->agpMode = SAVAGE_MAX_AGP_MODE;
}
if ((psav->agpMode > 2) &&
if ((psav->agpMode > 2) &&
(psav->Chipset == S3_SAVAGE3D ||
psav->Chipset == S3_SAVAGE_MX))
psav->agpMode = 2; /* old savages only support 2x */
@@ -1735,13 +1735,13 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
case S3_SUPERSAVAGE:
psav->HasCRTC2 = TRUE;
break;
default:
default:
psav->HasCRTC2 = FALSE;
}
if ((psav->IsSecondary || psav->IsPrimary) && !psav->UseBIOS) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "BIOS currently required for Dualhead mode setting.\n");
return FALSE;
return FALSE;
}
if (psav->IsSecondary &&
@@ -1816,7 +1816,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
break;
case S3_SAVAGE4:
/*
/*
* The Savage4 has one ugly special case to consider. On
* systems with 4 banks of 2Mx32 SDRAM, the BIOS says 4MB
* when it really means 8MB. Why do it the same when you
@@ -1851,7 +1851,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->videoRambytes = pScrn->videoRam * 1024;
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"probed videoram: %dk\n",
pScrn->videoRam);
} else {
@@ -1881,7 +1881,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->videoRambytes = pScrn->videoRam * 1024;
}
/*
* If we're running with acceleration, compute the command overflow
* buffer location. The command overflow buffer must END at a
@@ -1891,11 +1891,11 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
if (psav->NoAccel) {
psav->cobIndex = 0;
psav->cobSize = 0;
}
}
else if( ((S3_SAVAGE4_SERIES(psav->Chipset)) ||
(S3_SUPERSAVAGE == psav->Chipset)) && psav->disableCOB ) {
/*
* The Savage4 and ProSavage have COB coherency bugs which render
* The Savage4 and ProSavage have COB coherency bugs which render
* the buffer useless.
*/
/*
@@ -1907,7 +1907,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->bciThresholdHi = 32;
psav->bciThresholdLo = 0;
} else {
/* We use 128kB for the COB on all other chips. */
/* We use 128kB for the COB on all other chips. */
psav->cobSize = 0x20000;
if (S3_SAVAGE3D_SERIES(psav->Chipset) ||
psav->Chipset == S3_SAVAGE2000) {
@@ -1933,15 +1933,15 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->CursorKByte = (psav->videoRambytes >> 10) - 4;
psav->endfb = (psav->CursorKByte << 10) - 1;
psav->videoRambytes *= 2;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Using %dk of videoram for primary head\n",
pScrn->videoRam);
}
if(psav->IsSecondary)
{
{
pScrn->videoRam /= 2;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Using %dk of videoram for secondary head\n",
pScrn->videoRam);
}
@@ -1965,7 +1965,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
/* check for DVI/flat panel */
dvi = FALSE;
if (psav->Chipset == S3_SAVAGE4) {
unsigned char sr30 = 0x00;
unsigned char sr30 = 0x00;
VGAOUT8(0x3c4, 0x30);
/* clear bit 1 */
VGAOUT8(0x3c5, VGAIN8(0x3c5) & ~0x02);
@@ -1984,11 +1984,11 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
} else {
psav->DisplayType = MT_CRT;
}
if (psav->IsSecondary)
psav->DisplayType = MT_CRT;
/* Do the DDC dance. */
/* Do the DDC dance. */
SavageDoDDC(pScrn);
/* set up ramdac max clock - might be altered by SavageGetPanelInfo */
@@ -2039,7 +2039,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->ModeTable = SavageGetBIOSModeTable( psav, psav->primStreamBpp );
if( !psav->ModeTable || !psav->ModeTable->NumModes ) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to fetch any BIOS modes. Disabling BIOS.\n");
psav->UseBIOS = FALSE;
}
@@ -2053,12 +2053,12 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
psav->ModeTable->NumModes);
for(
i = 0, pmt = psav->ModeTable->Modes;
i < psav->ModeTable->NumModes;
i = 0, pmt = psav->ModeTable->Modes;
i < psav->ModeTable->NumModes;
i++, pmt++ )
{
int j;
ErrorF( " [%03x] %d x %d",
ErrorF( " [%03x] %d x %d",
pmt->VesaMode, pmt->Width, pmt->Height );
for( j = 0; j < pmt->RefreshCount; j++ )
{
@@ -2080,9 +2080,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->ClockMulFactor = 1.0;
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges, NULL,
pScrn->display->modes, clockRanges, NULL,
256, 2048, 16 * pScrn->bitsPerPixel,
128, 2048,
128, 2048,
pScrn->virtualX, pScrn->virtualY,
psav->videoRambytes, LOOKUP_BEST_REFRESH);
@@ -2125,8 +2125,8 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
.minorversion = 0
};
int errmaj, errmin;
if( !LoadSubModule(pScrn->module, modName,
if( !LoadSubModule(pScrn->module, modName,
NULL, NULL, NULL, &req, &errmaj, &errmin) ) {
LoaderErrorMsg(NULL, modName, errmaj, errmin);
SavageFreeRec(pScrn);
@@ -2190,7 +2190,7 @@ static Bool SavageEnterVT(ScrnInfoPtr pScrn)
if(SavageModeInit(pScrn, pScrn->currentMode)) {
/* some BIOSes seem to enable HW cursor on PM resume */
if (!SAVPTR(pScrn)->hwc_on)
SavageHideCursor( pScrn );
SavageHideCursor( pScrn );
return TRUE;
}
@@ -2415,7 +2415,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
vgaIOBase = hwp->IOBase;
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
TRACE(("SavageWriteMode(%x)\n", restore->mode));
#ifdef SAVAGEDRI
@@ -2432,7 +2432,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
return;
}
if( Entering &&
if( Entering &&
(!S3_SAVAGE_MOBILE_SERIES(psav->Chipset) || (psav->ForceInit))
)
SavageInitialize2DEngine(pScrn);
@@ -2481,7 +2481,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
/* Enable gamma correction, set CLUT to 8 bit */
VGAOUT8(0x3c4, 0x1b);
if( (pScrn->bitsPerPixel == 32) && !psav->DGAactive
if( (pScrn->bitsPerPixel == 32) && !psav->DGAactive
&& ! psav->FBStart2nd )
VGAOUT8(0x3c5, 0x18 );
else
@@ -2541,7 +2541,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
}
}
if( (psav->Chipset != S3_SAVAGE2000) &&
if( (psav->Chipset != S3_SAVAGE2000) &&
!S3_SAVAGE_MOBILE_SERIES(psav->Chipset) )
VGAOUT16(vgaCRIndex, (cr79 << 8) | 0x79);
@@ -2584,7 +2584,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
}
/* set the correct clock for some BIOSes */
VGAOUT8(VGA_MISC_OUT_W,
VGAOUT8(VGA_MISC_OUT_W,
VGAIN8(VGA_MISC_OUT_R) | 0x0C);
/* Some BIOSes turn on clock doubling on non-doubled modes */
if (pScrn->bitsPerPixel < 24) {
@@ -2756,7 +2756,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
VGAOUT8(0x3c4, 0x08);
VGAOUT8(0x3c5, 0x06);
/* Restore extended sequencer regs for MCLK. SR10 == 255 indicates that
/* Restore extended sequencer regs for MCLK. SR10 == 255 indicates that
* we should leave the default SR10 and SR11 values there.
*/
if (restore->SR10 != 255) {
@@ -2877,7 +2877,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
+ psav->PciInfo->regions[0].base_addr;
psav->FbRegion.base = psav->PciInfo->regions[1].base_addr;
#else
psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4
psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4
+ psav->PciInfo->memBase[0];
psav->FbRegion.base = psav->PciInfo->memBase[1];
#endif
@@ -2893,7 +2893,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
? (0x01000000 * 2) : (0x01000000 * 5);
if ((psav->Chipset == S3_SUPERSAVAGE)
if ((psav->Chipset == S3_SUPERSAVAGE)
|| (psav->Chipset == S3_SAVAGE2000)) {
#ifdef XSERVER_LIBPCIACCESS
psav->ApertureRegion.base = psav->PciInfo->regions[2].base_addr;
@@ -2916,7 +2916,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
| PCI_DEV_MAP_FLAG_WRITE_COMBINE),
& psav->FbRegion.memory);
#else
psav->FbRegion.memory =
psav->FbRegion.memory =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
psav->PciTag, psav->FbRegion.base,
psav->FbRegion.size);
@@ -2942,7 +2942,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
| PCI_DEV_MAP_FLAG_WRITE_COMBINE),
& psav->ApertureRegion.memory);
#else
psav->ApertureRegion.memory =
psav->ApertureRegion.memory =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
psav->PciTag, psav->ApertureRegion.base,
psav->ApertureRegion.size);
@@ -2967,7 +2967,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
(PCI_DEV_MAP_FLAG_WRITABLE),
& psav->MmioRegion.memory);
#else
psav->MmioRegion.memory =
psav->MmioRegion.memory =
xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
psav->PciTag, psav->MmioRegion.base,
psav->MmioRegion.size);
@@ -3070,7 +3070,7 @@ static Bool SavageCheckAvailableRamFor3D(ScrnInfoPtr pScrn)
tiledBufferSize; /* depth buffer */
xf86DrvMsg(pScrn->scrnIndex,X_INFO,
"%d kB of Videoram needed for 3D; %d kB of Videoram available\n",
"%d kB of Videoram needed for 3D; %d kB of Videoram available\n",
RamNeededFor3D/1024, psav->videoRambytes/1024);
if (RamNeededFor3D <= psav->videoRambytes) {
@@ -3130,12 +3130,12 @@ static void SavageInitShadowStatus(ScrnInfoPtr pScrn)
SavageInitStatus(pScrn);
if( psav->ShadowStatus ) {
psav->ShadowPhysical =
psav->ShadowPhysical =
psav->FbRegion.base + psav->CursorKByte*1024 + 4096 - 32;
psav->ShadowVirtual = (CARD32 *)
(psav->FBBase + psav->CursorKByte*1024 + 4096 - 32);
xf86DrvMsg( pScrn->scrnIndex, X_PROBED,
"Shadow area physical %08lx, linear %p\n",
psav->ShadowPhysical, (void *)psav->ShadowVirtual );
@@ -3163,10 +3163,10 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
psav = SAVPTR(pScrn);
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (!psav->pVbe)
psav->pVbe = VBEInit(NULL, pEnt->index);
SavageEnableMMIO(pScrn);
if (!SavageMapMem(pScrn))
@@ -3207,11 +3207,11 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
"Dual-head configuration is not working with "
"DRI at present.\n");
} else if (/*!psav->bTiled*/psav->bDisableTile) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Direct Rendering requires a tiled framebuffer -- "
"Set Option \"DisableTile\" \"false\"\n");
} else if (psav->cobSize == 0) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Direct Rendering requires the COB -- "
"Set Option \"DisableCOB\" \"false\"\n");
} else if (((psav->Chipset == S3_TWISTER)
@@ -3240,7 +3240,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
}
} else
psav->directRenderingEnabled = FALSE;
if(psav->directRenderingEnabled) {
xf86DrvMsg(pScrn->scrnIndex,X_CONFIG,"DRI is enabled\n");
}
@@ -3263,12 +3263,12 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
if (!miSetVisualTypes(pScrn->depth, visual,
pScrn->rgbBits, pScrn->defaultVisual))
return FALSE;
if (psav->FBStart2nd) {/* we have overlay */
if (psav->FBStart2nd) {/* we have overlay */
visual = psav->overlayDepth > 8 ? TrueColorMask :
miGetDefaultVisualMask(DEPTH_BPP(psav->overlayDepth));
if (!miSetVisualTypes(psav->overlayDepth, visual,
psav->overlayDepth > 8 ? 8 : 6,
psav->overlayDepth > 8 ? 8 : 6,
pScrn->defaultVisual))
return FALSE;
}
@@ -3295,7 +3295,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
visual->redMask = pScrn->mask.red;
visual->greenMask = pScrn->mask.green;
visual->blueMask = pScrn->mask.blue;
} else if (visual->offsetRed > 8
} else if (visual->offsetRed > 8
|| visual->offsetGreen > 8
|| visual->offsetBlue > 8) {
/*
@@ -3304,7 +3304,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
*/
int tmp;
int c_s = 0;
tmp = visual->offsetBlue;
visual->offsetBlue = visual->offsetRed;
visual->offsetRed = tmp;
@@ -3362,7 +3362,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
if (psav->shadowFB) {
RefreshAreaFuncPtr refreshArea = SavageRefreshArea;
if(psav->rotate) {
if (!psav->PointerMoved) {
psav->PointerMoved = pScrn->PointerMoved;
@@ -3376,7 +3376,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
case 32: refreshArea = SavageRefreshArea32; break;
}
}
ShadowFBInit(pScreen, refreshArea);
}
@@ -3385,7 +3385,7 @@ static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv)
colormapFlags = CMAP_RELOAD_ON_MODE_SWITCH
| ((psav->FBStart2nd) ? 0 : CMAP_PALETTED_TRUECOLOR);
if (psav->Chipset == S3_SAVAGE4) {
if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, SavageLoadPaletteSavage4,
NULL, colormapFlags ))
@@ -3497,15 +3497,15 @@ static int SavageInternalScreenInit(ScreenPtr pScreen)
psav->ulAperturePitch / (pScrn->bitsPerPixel >> 3), /*displayWidth,*/
pScrn->bitsPerPixel);
} else {
} else {
FbOverlayScrPrivPtr pScrPriv;
int Depth2nd = DEPTH_2ND(pScrn);
if (!fbSetupScreen (pScreen, FBStart, width, height,
if (!fbSetupScreen (pScreen, FBStart, width, height,
pScrn->xDpi, pScrn->yDpi, displayWidth, 8))
return FALSE;
if (pScrn->depth == 8) {
ret = fbOverlayFinishScreenInit (pScreen, FBStart,
psav->FBStart2nd, width,
ret = fbOverlayFinishScreenInit (pScreen, FBStart,
psav->FBStart2nd, width,
height,pScrn->xDpi, pScrn->yDpi,
displayWidth,displayWidth,
8, DEPTH_BPP(Depth2nd),
@@ -3514,8 +3514,8 @@ static int SavageInternalScreenInit(ScreenPtr pScreen)
pScrPriv->layer[0].key = pScrn->colorKey;
} else {
ret = fbOverlayFinishScreenInit (pScreen, psav->FBStart2nd,
FBStart,
width, height,pScrn->xDpi,
FBStart,
width, height,pScrn->xDpi,
pScrn->yDpi,
displayWidth,displayWidth,
DEPTH_BPP(Depth2nd), 8,
@@ -3600,7 +3600,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
vgaCRIndex = vgaIOBase + 4;
vgaCRReg = vgaIOBase + 5;
TRACE(("SavageModeInit(%dx%d, %dkHz)\n",
TRACE(("SavageModeInit(%dx%d, %dkHz)\n",
mode->HDisplay, mode->VDisplay, mode->Clock));
if (psav->IsSecondary) {
@@ -3644,7 +3644,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
new->CR67 = 0x00; /* 8bpp, 1 pixel/clock */
break;
case 15:
if(
if(
S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
((psav->Chipset == S3_SAVAGE2000) && (dclk >= 230000))
)
@@ -3653,7 +3653,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
new->CR67 = 0x20; /* 15bpp, 1 pixels/clock */
break;
case 16:
if(
if(
S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
((psav->Chipset == S3_SAVAGE2000) && (dclk >= 230000))
)
@@ -3683,7 +3683,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
}
if( !new->mode ) {
/*
/*
* Either BIOS use is disabled, or we failed to find a suitable
* match. Fall back to traditional register-crunching.
*/
@@ -3714,7 +3714,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
/* set 8-bit CLUT */
new->SR1B |= 0x10;
new->CR43 = new->CR45 = new->CR65 = 0x00;
VGAOUT8(vgaCRIndex, 0x40);
@@ -3776,7 +3776,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
j = (vganew->CRTC[0] + ((i & 0x01) << 8) +
vganew->CRTC[4] + ((i & 0x10) << 4) + 1) / 2;
if (j - (vganew->CRTC[4] + ((i & 0x10) << 4)) < 4) {
if (vganew->CRTC[4] + ((i & 0x10) << 4) + 4 <=
if (vganew->CRTC[4] + ((i & 0x10) << 4) + 4 <=
vganew->CRTC[0] + ((i & 0x01) << 8))
j = vganew->CRTC[4] + ((i & 0x10) << 4) + 4;
else
@@ -3825,7 +3825,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
new->CR33 = 0x00;
else
new->CR33 = 0x08;
vganew->CRTC[0x17] = 0xeb;
new->CR67 |= 1;
@@ -3894,7 +3894,7 @@ static Bool SavageCloseScreen(ScreenPtr pScreen)
}
if (pScrn->vtSema) {
if (psav->FBStart2nd)
if (psav->FBStart2nd)
SavageStreamsOff(pScrn);
SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr, FALSE);
SavageResetStreams(pScrn);
@@ -3947,7 +3947,7 @@ SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2)
{
SavagePtr psav = SAVPTR(pScrn);
int address=0,top=0,left=0,tile_height,tile_size;
TRACE(("SavageDoAdjustFrame(%d,%d,%d)\n", x, y, crtc2));
if (psav->Chipset == S3_SAVAGE2000) {
@@ -3980,7 +3980,7 @@ SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2)
if (!crtc2) {
OUTREG32(PRI_STREAM_FBUF_ADDR0, address & 0xFFFFFFFC);
OUTREG32(PRI_STREAM_FBUF_ADDR1, address & 0xFFFFFFFC);/* IGA1 */
} else {
} else {
OUTREG32(PRI_STREAM2_FBUF_ADDR0, address & 0xFFFFFFFC);/* IGA2 */
OUTREG32(PRI_STREAM2_FBUF_ADDR1, address & 0xFFFFFFFC);
}
@@ -4022,7 +4022,7 @@ Bool SavageSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (psav->IsPrimary) {
DevUnion* pPriv;
SavageEntPtr pSavEnt;
pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
gSavageEntityIndex);
pSavEnt = pPriv->ptr;
SavageModeInit(pSavEnt->pSecondaryScrn, pSavEnt->pSecondaryScrn->currentMode);
@@ -4114,7 +4114,7 @@ void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
byte = VGAIN8(0x3c5);
VGAOUT8(0x3c5, (byte & ~0x03) | 0x02); /* CLUT 2 */
}
for (i=0; i<numColors; i++) {
index = indices[i];
if (index == pScrn->colorKey) updateKey = index;
@@ -4150,9 +4150,9 @@ SavageUpdateKey(ScrnInfoPtr pScrn, int r, int g, int b)
ul = 1;
ol = 0;
}
if (!(pScreen = pScrn->pScreen)
if (!(pScreen = pScrn->pScreen)
|| !psav->FBStart2nd
|| !(pScrOvlPriv = fbOverlayGetScrPriv(pScreen)))
|| !(pScrOvlPriv = fbOverlayGetScrPriv(pScreen)))
return;
key = ((Shift(r,psav->overlay.redShift) & psav->overlay.redMask)
| (Shift(g,psav->overlay.greenShift) & psav->overlay.greenMask)
@@ -4176,7 +4176,7 @@ void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, int *indices,
for (int n = 0; n < numColors; n++) {
if (!(inStatus1() & 0x08))
VerticalRetraceWait();
VerticalRetraceWait();
index = indices[n];
VGAOUT8(0x3c8, index);
VGAOUT8(0x3c9, colors[index].red);
@@ -4306,7 +4306,7 @@ void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout,
case S3_SAVAGE2000:
success = (ALT_STATUS_WORD0 & 0x008fffff) == 0;
break;
}
}
if(!success) {
usleep(10000);
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -4450,11 +4450,11 @@ SavageDDC1Read(ScrnInfoPtr pScrn)
SavagePtr psav = SAVPTR(pScrn);
UnLockExtRegs();
VerticalRetraceWait();
InI2CREG(tmp,psav->I2CPort);
return ((unsigned int) (tmp & 0x08));
}
@@ -4550,7 +4550,7 @@ SavageResetStreams(ScrnInfoPtr pScrn)
case S3_SAVAGE3D:
case S3_SAVAGE4:
case S3_TWISTER:
case S3_PROSAVAGE:
case S3_PROSAVAGE:
case S3_PROSAVAGEDDR:
OUTREG32(PRI_STREAM_STRIDE,0);
OUTREG32(PRI_STREAM_FBUF_ADDR0,0);

View File

@@ -109,7 +109,7 @@ typedef struct _server{
unsigned int frontPitch;
unsigned int frontbufferSize;
unsigned int frontBitmapDesc;
unsigned int backOffset;
unsigned int backPitch;
unsigned int backbufferSize;
@@ -161,13 +161,13 @@ typedef struct
Bool TvOn;
ScrnInfoPtr pSecondaryScrn;
ScrnInfoPtr pPrimaryScrn;
} SavageEntRec, *SavageEntPtr;
#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)
@@ -178,8 +178,8 @@ typedef struct
#define OUTREG8(addr,val) MMIO_OUT8(psav->MapBase, addr, val)
#define OUTREG16(addr,val) MMIO_OUT16(psav->MapBase, addr, val)
#define OUTREG32(addr,val) MMIO_OUT32(psav->MapBase, addr, val)
#define INREG(addr) INREG32(addr)
#define OUTREG(addr,val) OUTREG32(addr,val)
#define INREG(addr) INREG32(addr)
#define OUTREG(addr,val) OUTREG32(addr,val)
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
#define B_O16(x) (x)
@@ -280,9 +280,9 @@ typedef union _BMPDESC {
typedef struct _StatInfo {
int origMode;
int pageCnt;
int pageCnt;
pointer statBuf;
int realSeg;
int realSeg;
int realOff;
} StatInfoRec,*StatInfoPtr;
@@ -516,7 +516,7 @@ typedef struct _Savage {
SavageMonitorType DisplayType;
/* DuoView stuff */
Bool HasCRTC2; /* MX, IX, Supersavage */
Bool IsSecondary; /* second Screen */
Bool IsSecondary; /* second Screen */
Bool IsPrimary; /* first Screen */
EntityInfoPtr pEnt;
@@ -608,7 +608,7 @@ SavageModeTablePtr SavageGetBIOSModeTable( SavagePtr psav, int iDepth );
ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refresh,
unsigned int *vesaMode,unsigned int *newRefresh);
unsigned short SavageGetBIOSModes(
unsigned short SavageGetBIOSModes(
SavagePtr psav,
VbeInfoBlock *vbe,
int iDepth,

View File

@@ -115,9 +115,9 @@ typedef struct _drm_savage_sarea {
*/
unsigned int setup[28]; /* 3D context registers */
drm_savage_server_regs_t server_state;
unsigned int dirty;
unsigned int vertsize; /* vertext size */
/* The current cliprects, or a subset thereof.

View File

@@ -1,8 +1,8 @@
/*
* The exa accel file for the Savage driver.
*
* The exa accel file for the Savage driver.
*
* Created 2005-2006 by Alex Deucher
* Revision:
* Revision:
*
*/
@@ -74,7 +74,7 @@ static int SavageGetSolidROP(int rop) {
return (ALUSolidROP[rop]);
}
Bool
Bool
SavageEXAInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -97,10 +97,10 @@ SavageEXAInit(ScreenPtr pScreen)
if (psav->bTiled) {
if (pScrn->bitsPerPixel == 16) {
psav->EXADriverPtr->offScreenBase =
psav->EXADriverPtr->offScreenBase =
((pScrn->virtualX+63)/64)*((pScrn->virtualY+15)/16) * 2048;
} else {
psav->EXADriverPtr->offScreenBase =
psav->EXADriverPtr->offScreenBase =
((pScrn->virtualX+31)/32)*((pScrn->virtualY+15)/16) * 2048;
}
} else {
@@ -381,14 +381,14 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
#ifdef SAVAGEDRI
/* Test for conditions for AGP Mastered Image Transfer (MIT). AGP memory
needs to be available, the XVideo AGP needs to be enabled, the
needs to be available, the XVideo AGP needs to be enabled, the
framebuffer destination must be a multiple of 32 bytes, and the source
pitch must span the entirety of the destination pitch. This last
condition allows the code to consider this upload as equivalent to a
pitch must span the entirety of the destination pitch. This last
condition allows the code to consider this upload as equivalent to a
plain memcpy() call. */
dst_pitch = exaGetPixmapPitch(pDst);
dst_yoffset = exaGetPixmapOffset(pDst) + y * dst_pitch;
agp_possible =
agp_possible =
(!psav->IsPCI && psav->drmFD > 0 && psav->DRIServerInfo != NULL &&
psav->DRIServerInfo->agpXVideo.size > 0 &&
x == 0 && src_pitch == dst_pitch && w * Bpp == dst_pitch &&
@@ -396,7 +396,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
if (agp_possible) {
SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
if (pSAVAGEDRIServer->agpXVideo.map != NULL ||
if (pSAVAGEDRIServer->agpXVideo.map != NULL ||
0 <= drmMap( psav->drmFD,
pSAVAGEDRIServer->agpXVideo.handle,
pSAVAGEDRIServer->agpXVideo.size,
@@ -404,12 +404,12 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
unsigned char * agpMap = pSAVAGEDRIServer->agpXVideo.map;
unsigned int agpOffset = drmAgpBase(psav->drmFD) + pSAVAGEDRIServer->agpXVideo.offset;
unsigned int bytesTotal = dst_pitch * h;
unsigned int bytesTotal = dst_pitch * h;
while (bytesTotal > 0) {
unsigned int bytesTransfer =
(bytesTotal > pSAVAGEDRIServer->agpXVideo.size)
? pSAVAGEDRIServer->agpXVideo.size
unsigned int bytesTransfer =
(bytesTotal > pSAVAGEDRIServer->agpXVideo.size)
? pSAVAGEDRIServer->agpXVideo.size
: bytesTotal;
unsigned int qwordsTransfer = bytesTransfer >> 3;
@@ -424,7 +424,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
BCI_SEND(BCI_SET_REGISTER | BCI_SET_REGISTER_COUNT(1) | 0x50);
BCI_SEND(0x00000002 | ((qwordsTransfer - 1) << 3)); /* Select MIT, sysmem to framebuffer */
/* I want to wait here for any reads from AGP memory and any
/* I want to wait here for any reads from AGP memory and any
framebuffer writes performed by the MIT to stop. */
BCI_SEND(0xC0000000 | ((0x08 | 0x01) << 16));

View File

@@ -43,7 +43,7 @@
#include "dixstruct.h"
#include "fourcc.h"
#define SAVAGE_MAX_SURFACES 5
#define SAVAGE_MAX_SURFACES 5
#define SAVAGE_MAX_SUBPICTURES 1
#define XVMC_IDCT_8BIT 0x80000000
@@ -85,7 +85,7 @@ typedef struct {
} SAVAGEXvMCCreateContextRec;
static int yv12_subpicture_index_list[1] =
static int yv12_subpicture_index_list[1] =
{
FOURCC_IA44
};
@@ -95,10 +95,10 @@ static XF86MCImageIDList yv12_subpicture_list =
1,
yv12_subpicture_index_list
};
static XF86MCSurfaceInfoRec savage_YV12_mpg2_surface =
{
FOURCC_YV12,
FOURCC_YV12,
XVMC_CHROMA_FORMAT_420,
0,
720,
@@ -110,7 +110,7 @@ static XF86MCSurfaceInfoRec savage_YV12_mpg2_surface =
&yv12_subpicture_list
};
static XF86MCSurfaceInfoPtr ppSI[1] =
static XF86MCSurfaceInfoPtr ppSI[1] =
{
(XF86MCSurfaceInfoPtr)&savage_YV12_mpg2_surface,
};
@@ -123,14 +123,14 @@ static XF86ImagePtr savage_subpicture_list[1] =
(XF86ImagePtr)&ia44_subpicture,
};
/* Fill in the device dependent adaptor record.
/* Fill in the device dependent adaptor record.
* This is named "SAVAGE Video Overlay" because this code falls under the
* XV extension, the name must match or it won't be used.
*
* Surface and Subpicture - see above
* Function pointers to functions below
*/
static XF86MCAdaptorRec pAdapt =
static XF86MCAdaptorRec pAdapt =
{
"Savage Streams Engine", /* name */
1, /* num_surfaces */
@@ -145,7 +145,7 @@ static XF86MCAdaptorRec pAdapt =
(xf86XvMCDestroySubpictureProcPtr)SAVAGEXvMCDestroySubpicture
};
static XF86MCAdaptorPtr ppAdapt[1] =
static XF86MCAdaptorPtr ppAdapt[1] =
{
(XF86MCAdaptorPtr)&pAdapt
};
@@ -157,10 +157,10 @@ static XF86MCAdaptorPtr ppAdapt[1] =
* Initialize the hardware motion compensation extension for this
* hardware. The initialization routines want the address of the pointers
* to the structures, not the address of the structures. This means we
* allocate (or create static?) the pointer memory and pass that
* allocate (or create static?) the pointer memory and pass that
* address. This seems a little convoluted.
*
* We need to allocate memory for the device depended adaptor record.
* We need to allocate memory for the device depended adaptor record.
* This is what holds the pointers to all our device functions.
*
* We need to map the overlay registers into the drm.
@@ -171,11 +171,11 @@ static XF86MCAdaptorPtr ppAdapt[1] =
* Screen pointer
*
* Outputs:
* None, this calls the device independent screen initialization
* None, this calls the device independent screen initialization
* function.
*
* Revisions:
*
*
**************************************************************************/
Bool SAVAGEInitMC(ScreenPtr pScreen)
{
@@ -189,7 +189,7 @@ Bool SAVAGEInitMC(ScreenPtr pScreen)
/* Clear the Surface Allocation */
for(i=0; i<SAVAGE_MAX_SURFACES; i++) {
pSAVAGE->surfaceAllocation[i] = 0;
}
}
if(pSAVAGE->hwmcSize == 0)
{
@@ -203,11 +203,11 @@ Bool SAVAGEInitMC(ScreenPtr pScreen)
if(drmAddMap(pSAVAGE->drmFD, offset, pSAVAGE->hwmcSize,
DRM_FRAME_BUFFER, 0, &pSAVAGEDriPriv->xvmcSurfHandle) < 0)
{
xf86DrvMsg(X_ERROR, pScrn->scrnIndex,
"SAVAGEInitMC: Cannot add map to drm!\n");
return FALSE;
}
}
return xf86XvMCScreenInit(pScreen, 1, ppAdapt);
}
@@ -305,7 +305,7 @@ int SAVAGEXvMCCreateSurface (ScrnInfoPtr pScrn, XvMCSurfacePtr pSurf,
SavagePtr pSAVAGE = SAVPTR(pScrn);
int i;
/* This size is used for flip, mixer, subpicture and palette buffers*/
unsigned int offset = ((786*576*2 + 2048)*5 + 2048) & 0xfffff800;
unsigned int offset = ((786*576*2 + 2048)*5 + 2048) & 0xfffff800;
*priv = (long *)calloc(2,sizeof(long));
@@ -348,7 +348,7 @@ int SAVAGEXvMCCreateSubpicture (ScrnInfoPtr pScrn, XvMCSubpicturePtr pSubp,
*num_priv = 1;
for(i = SAVAGE_MAX_SURFACES; i < SAVAGE_MAX_SURFACES + SAVAGE_MAX_SUBPICTURES; i++) {
for(i = SAVAGE_MAX_SURFACES; i < SAVAGE_MAX_SURFACES + SAVAGE_MAX_SUBPICTURES; i++) {
if(!pSAVAGE->surfaceAllocation[i]) {
pSAVAGE->surfaceAllocation[i] = pSubp->subpicture_id;
(*priv)[0] = ( 576*1024 * i);

View File

@@ -59,11 +59,11 @@ SavageI2CGetBits(I2CBusPtr b, int *clock, int *data)
*clock = reg & 0x4;
*data = reg & 0x8;
/*ErrorF("SavageI2CGetBits: %d %d\n", *clock, *data); */
}
Bool
Bool
SavageI2CInit(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);

View File

@@ -24,7 +24,7 @@
#define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) \
||(chip==S3_PROSAVAGEDDR))
/* Chip tags. These are used to group the adapters into
/* Chip tags. These are used to group the adapters into
* related families.
*/
@@ -45,18 +45,18 @@ enum S3CHIPTAGS {
#define BIOS_BASE 0xc0000
#define SAVAGE_NEWMMIO_REGBASE_S3 0x1000000 /* 16MB */
#define SAVAGE_NEWMMIO_REGBASE_S4 0x0000000
#define SAVAGE_NEWMMIO_REGBASE_S4 0x0000000
#define SAVAGE_NEWMMIO_REGSIZE 0x0080000 /* 512kb */
#define SAVAGE_NEWMMIO_VGABASE 0x8000
#define BASE_FREQ 14.31818
#define BASE_FREQ 14.31818
#define FIFO_CONTROL_REG 0x8200
#define MIU_CONTROL_REG 0x8204
#define STREAMS_TIMEOUT_REG 0x8208
#define MISC_TIMEOUT_REG 0x820c
#define ADVANCED_FUNC_CTRL 0x850C
#define ADVANCED_FUNC_CTRL 0x850C
/*
* CR/SR registers MMIO offset
@@ -172,7 +172,7 @@ do { \
#define TILED_SURFACE_REGISTER_2 0x48c48
#define TILED_SURFACE_REGISTER_3 0x48c4c
#define TILED_SURFACE_REGISTER_4 0x48c50
#define TILED_SURF_BPP4 0x00000000 /* bits 31-30=00 for 4 bits/pixel */
#define TILED_SURF_BPP8 0x40000000 /* bits 31-30=01 for 8 bits/pixel */
#define TILED_SURF_BPP16 0x80000000 /* bits 31-30=10 for 16 bits/pixel */
@@ -186,11 +186,11 @@ do { \
* the "2D" is partly to set this apart from "BLOCK_WRITE_DISABLE"
* constant used for bitmap descriptor
*/
#define DISABLE_BLOCK_WRITE_2D 0x10
#define DISABLE_BLOCK_WRITE_2D 0x10
#define BLOCK_WRITE_DISABLE 0x0
/* CR31[0] set = Enable 8MB display memory through 64K window at A0000H. */
#define ENABLE_CPUA_BASE_A0000 0x01
#define ENABLE_CPUA_BASE_A0000 0x01
/* Constants for CR69. */
@@ -216,10 +216,10 @@ do { \
/*
* unprotect CRTC[0-7]
* CR11_7 = 0: Writing to all CRT Controller registers enabled
* = 1: Writing to all bits of CR0~CR7 except CR7_4 disabled
*/
* unprotect CRTC[0-7]
* CR11_7 = 0: Writing to all CRT Controller registers enabled
* = 1: Writing to all bits of CR0~CR7 except CR7_4 disabled
*/
#define UnProtectCRTC() \
do { \
unsigned char byte; \
@@ -228,12 +228,12 @@ do { \
OUTREG16(CRT_ADDRESS_REG,byte << 8 | 0x11); \
} while (0)
/*
* unlock extended regs
* CR38:unlock CR20~CR3F
* CR39:unlock CR40~CRFF
* SR08:unlock SR09~SRFF
*/
/*
* unlock extended regs
* CR38:unlock CR20~CR3F
* CR39:unlock CR40~CRFF
* SR08:unlock SR09~SRFF
*/
#define UnLockExtRegs() \
do { \
OUTREG16(CRT_ADDRESS_REG,0X4838); \
@@ -254,7 +254,7 @@ do { \
} while (0)
/*
* Jiayo Hsu, Mar 21, 2002
* Jiayo Hsu, Mar 21, 2002
* modify this to scalable schema, because different chips have different regs,
* besides add in patch code for Paramount(SuperSavage) from 2K
*/
@@ -273,7 +273,7 @@ do { \
OUTREG8(CRT_DATA_REG, a); \
OUTREG8(CRT_DATA_REG, a); \
} while (0)
#define HZEXP_COMP_1 0x54
#define HZEXP_BORDER 0x58
#define HZEXP_FACTOR_IGA1 0x59

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 1999,2000 The XFree86 Project Inc.
Copyright (c) 1999,2000 The XFree86 Project Inc.
based on code written by Mark Vojkovich <markv@valinux.com>
*/
@@ -19,14 +19,14 @@ SavageRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
SavagePtr psav = SAVPTR(pScrn);
int width, height, Bpp, FBPitch;
unsigned char *src, *dst;
Bpp = pScrn->bitsPerPixel >> 3;
FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
while(num--) {
width = (pbox->x2 - pbox->x1) * Bpp;
height = pbox->y2 - pbox->y1;
src = psav->ShadowPtr + (pbox->y1 * psav->ShadowPitch) +
src = psav->ShadowPtr + (pbox->y1 * psav->ShadowPitch) +
(pbox->x1 * Bpp);
dst = psav->FBStart + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
@@ -35,10 +35,10 @@ SavageRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
dst += FBPitch;
src += psav->ShadowPitch;
}
pbox++;
}
}
}
void
@@ -76,11 +76,11 @@ SavageRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = (y2 - y1) >> 2; /* in dwords */
if(psav->rotate == 1) {
dstPtr = psav->FBStart +
dstPtr = psav->FBStart +
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
srcPtr = psav->ShadowPtr + ((1 - y2) * srcPitch) + pbox->x1;
} else {
dstPtr = psav->FBStart +
dstPtr = psav->FBStart +
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
srcPtr = psav->ShadowPtr + (y1 * srcPitch) + pbox->x2 - 1;
}
@@ -90,8 +90,8 @@ SavageRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
dst = (CARD32*)dstPtr;
count = height;
while(count--) {
*(dst++) = src[0] | (src[srcPitch] << 8) |
(src[srcPitch * 2] << 16) |
*(dst++) = src[0] | (src[srcPitch] << 8) |
(src[srcPitch * 2] << 16) |
(src[srcPitch * 3] << 24);
src += srcPitch * 4;
}
@@ -101,7 +101,7 @@ SavageRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
pbox++;
}
}
}
void
@@ -122,14 +122,14 @@ SavageRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = (y2 - y1) >> 1; /* in dwords */
if(psav->rotate == 1) {
dstPtr = (CARD16*)psav->FBStart +
dstPtr = (CARD16*)psav->FBStart +
(pbox->x1 * dstPitch) + pScrn->virtualX - y2;
srcPtr = (CARD16*)psav->ShadowPtr +
srcPtr = (CARD16*)psav->ShadowPtr +
((1 - y2) * srcPitch) + pbox->x1;
} else {
dstPtr = (CARD16*)psav->FBStart +
dstPtr = (CARD16*)psav->FBStart +
((pScrn->virtualY - pbox->x2) * dstPitch) + y1;
srcPtr = (CARD16*)psav->ShadowPtr +
srcPtr = (CARD16*)psav->ShadowPtr +
(y1 * srcPitch) + pbox->x2 - 1;
}
@@ -169,11 +169,11 @@ SavageRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = (y2 - y1) >> 2; /* blocks of 3 dwords */
if(psav->rotate == 1) {
dstPtr = psav->FBStart +
dstPtr = psav->FBStart +
(pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3);
srcPtr = psav->ShadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3);
} else {
dstPtr = psav->FBStart +
dstPtr = psav->FBStart +
((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3);
srcPtr = psav->ShadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3;
}
@@ -184,18 +184,18 @@ SavageRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
count = height;
while(count--) {
dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) |
(src[srcPitch] << 24);
(src[srcPitch] << 24);
dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) |
(src[srcPitch * 2] << 16) |
(src[(srcPitch * 2) + 1] << 24);
(src[(srcPitch * 2) + 1] << 24);
dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) |
(src[(srcPitch * 3) + 1] << 16) |
(src[(srcPitch * 3) + 2] << 24);
(src[(srcPitch * 3) + 2] << 24);
dst += 3;
src += srcPitch * 4;
}
srcPtr += psav->rotate * 3;
dstPtr += dstPitch;
dstPtr += dstPitch;
}
pbox++;
@@ -217,14 +217,14 @@ SavageRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
height = pbox->y2 - pbox->y1;
if(psav->rotate == 1) {
dstPtr = (CARD32*)psav->FBStart +
dstPtr = (CARD32*)psav->FBStart +
(pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2;
srcPtr = (CARD32*)psav->ShadowPtr +
srcPtr = (CARD32*)psav->ShadowPtr +
((1 - pbox->y2) * srcPitch) + pbox->x1;
} else {
dstPtr = (CARD32*)psav->FBStart +
dstPtr = (CARD32*)psav->FBStart +
((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1;
srcPtr = (CARD32*)psav->ShadowPtr +
srcPtr = (CARD32*)psav->ShadowPtr +
(pbox->y1 * srcPitch) + pbox->x2 - 1;
}

View File

@@ -75,7 +75,7 @@ SavageInitSecondaryStreamOld(ScrnInfoPtr pScrn)
OUTREG(SSTREAM_STRIDE_REG, pitch);
OUTREG(SSTREAM_WINDOW_START_REG, OS_XY(0,0));
OUTREG(SSTREAM_WINDOW_SIZE_REG,
OUTREG(SSTREAM_WINDOW_SIZE_REG,
OS_WH(pScrn->displayWidth, pScrn->virtualY));
pitch = (pitch + 7) / 8;
@@ -141,7 +141,7 @@ SavageInitSecondaryStream(ScrnInfoPtr pScrn)
if( S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
(psav->Chipset == S3_SAVAGE2000) )
SavageInitSecondaryStreamNew(pScrn);
else
else
SavageInitSecondaryStreamOld(pScrn);
}
@@ -172,7 +172,7 @@ void SavageInitStreamsOld(ScrnInfoPtr pScrn)
case 16: format = 5 << 24; break;
case 24: format = 7 << 24; break;
}
OUTREG(PSTREAM_FBSIZE_REG,
OUTREG(PSTREAM_FBSIZE_REG,
pScrn->virtualY * pScrn->virtualX * (pScrn->bitsPerPixel >> 3));
}
@@ -212,9 +212,9 @@ void SavageInitStreamsNew(ScrnInfoPtr pScrn)
xf86ErrorFVerb(STREAMS_TRACE, "SavageInitStreams\n" );
if ( S3_SAVAGE_MOBILE_SERIES(psav->Chipset) &&
if ( S3_SAVAGE_MOBILE_SERIES(psav->Chipset) &&
(psav->DisplayType == MT_LCD) &&
!psav->CrtOnly &&
!psav->CrtOnly &&
!psav->TvOn )
{
OverlayParamInit( pScrn );
@@ -397,7 +397,7 @@ void PatchEnableSPofPanel(ScrnInfoPtr pScrn)
OUTREG8(CRT_ADDRESS_REG,0x65);
OUTREG8(CRT_DATA_REG,INREG8(CRT_DATA_REG)|0xC0);
if (pScrn->bitsPerPixel == 8) {
OUTREG32(PSTREAM_CONTROL_REG,0x00000000);
} else {
@@ -479,13 +479,13 @@ static void InitStreamsForExpansion(ScrnInfoPtr pScrn)
psav->YExp1 = YExpansion >> 16;
psav->YExp2 = YExpansion & 0xFFFF;
psav->displayXoffset =
psav->displayXoffset =
((PanelSizeX - (psav->XExp1 * ViewPortWidth) / psav->XExp2) / 2 + 7) & 0xfff8;
psav->displayYoffset =
psav->displayYoffset =
((PanelSizeY - (psav->YExp1 * ViewPortHeight) / psav->YExp2) / 2);
}
void
void
SavageStreamsOn(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
@@ -514,7 +514,7 @@ SavageStreamsOn(ScrnInfoPtr pScrn)
if (psav->IsSecondary) {
SelectIGA2();
/* Wait for VBLANK. */
/* Wait for VBLANK. */
VerticalRetraceWait();
/* Fire up streams! */
VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
@@ -524,7 +524,7 @@ SavageStreamsOn(ScrnInfoPtr pScrn)
OUTREG( SEC_STREAM2_COLOR_CONVERT2, 0x00039F9A );
OUTREG( SEC_STREAM2_COLOR_CONVERT3, 0x01F1547E );
} else if (psav->IsPrimary) {
/* Wait for VBLANK. */
/* Wait for VBLANK. */
VerticalRetraceWait();
/* Fire up streams! */
VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
@@ -533,7 +533,7 @@ SavageStreamsOn(ScrnInfoPtr pScrn)
OUTREG( SEC_STREAM_COLOR_CONVERT2, 0x00039F9A );
OUTREG( SEC_STREAM_COLOR_CONVERT3, 0x01F1547E );
} else {
/* Wait for VBLANK. */
/* Wait for VBLANK. */
VerticalRetraceWait();
/* Fire up streams! */
VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
@@ -549,7 +549,7 @@ SavageStreamsOn(ScrnInfoPtr pScrn)
jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAM1;
/* Wait for VBLANK. */
/* Wait for VBLANK. */
VerticalRetraceWait();
/* Fire up streams! */
VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );

View File

@@ -78,12 +78,12 @@
#define H_Mask (((1L << 11) - 1) << H_Shift)
#define W_Shift 16
#define W_Mask (((1L << 11) - 1) << W_Shift)
#define Y_Shift 0
#define Y_Mask (((1L << 11) - 1) << Y_Shift)
#define X_Shift 16
#define X_Mask (((1L << 11) - 1) << X_Shift)
#define XY(x,y) ((((x+1)<<X_Shift)&X_Mask) | (((y+1)<<Y_Shift)&Y_Mask))
#define WH(w,h) ((((w-1)<<W_Shift)&W_Mask) | (((h)<<H_Shift)&H_Mask))
@@ -92,7 +92,7 @@
#define HSCALING(w0,w1) ((((unsigned int)(((double)w0/(double)w1) * (1 << 15))) \
<< HSCALING_Shift) \
& HSCALING_Mask)
#define VSCALING_Shift 0
#define VSCALING_Mask (((1L << 20)-1) << VSCALING_Shift)
#define VSCALING(h0,h1) ((((unsigned int) (((double)h0/(double)h1) * (1 << 15))) \

View File

@@ -9,7 +9,7 @@
#define iabs(a) ((int)(a)>0?(a):(-(a)))
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
#define B_O16(x) (x)
#define B_O16(x) (x)
#define B_O32(x) (x)
#else
#define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8))
@@ -63,7 +63,7 @@ SavageSetVESAModeCrtc1(SavagePtr psav, int n, int refresh)
xf86Msg(X_INFO,"SavageSetVESAModeCrtc1:mode=0x%x,refresh=%dHZ\n",n,refresh);
SavageClearVM86Regs(psav->pVbe->pInt10);
/* set active displays. */
psav->pVbe->pInt10->ax = S3_EXTBIOS_INFO;
psav->pVbe->pInt10->bx = S3_SET_ACTIVE_DISP;
@@ -72,9 +72,9 @@ SavageSetVESAModeCrtc1(SavagePtr psav, int n, int refresh)
else
psav->pVbe->pInt10->cx = 0x83; /* lcd, crt, duoview */
xf86ExecX86int10(psav->pVbe->pInt10);
SavageClearVM86Regs(psav->pVbe->pInt10);
/* Establish the refresh rate for this mode. */
psav->pVbe->pInt10->ax = S3_EXTBIOS_INFO;
psav->pVbe->pInt10->bx = S3_SET_REFRESH;
@@ -86,11 +86,11 @@ SavageSetVESAModeCrtc1(SavagePtr psav, int n, int refresh)
OUTREG8 (SEQ_ADDRESS_REG,0x01);
byte = INREG8(SEQ_DATA_REG) | 0x20;
OUTREG8(SEQ_DATA_REG,byte);
psav->pVbe->pInt10->ax = BIOS_SET_VBE_MODE;
psav->pVbe->pInt10->bx = n;
xf86ExecX86int10(psav->pVbe->pInt10);
}
void
@@ -102,7 +102,7 @@ SavageSetVESAModeCrtc2( SavagePtr psav, int n, int refresh )
SavageClearVM86Regs(psav->pVbe->pInt10);
UnLockExtRegs();
psav->pVbe->pInt10->ax = S3_EXTBIOS_INFO;
psav->pVbe->pInt10->bx = S3_ALT_SET_ACTIVE_DISP;
if (psav->TvOn)
@@ -254,8 +254,8 @@ SavageGetBIOSModeTable( SavagePtr psav, int iDepth )
nModes = SavageGetBIOSModes( psav, vbe, iDepth, NULL );
pTable = (SavageModeTablePtr)
calloc( 1, sizeof(SavageModeTableRec) +
pTable = (SavageModeTablePtr)
calloc( 1, sizeof(SavageModeTableRec) +
(nModes-1) * sizeof(SavageModeEntry) );
if( pTable ) {
pTable->NumModes = nModes;
@@ -269,7 +269,7 @@ SavageGetBIOSModeTable( SavagePtr psav, int iDepth )
unsigned short
SavageGetBIOSModes(
SavageGetBIOSModes(
SavagePtr psav,
VbeInfoBlock *vbe,
int iDepth,
@@ -288,14 +288,14 @@ SavageGetBIOSModes(
return 0;
}
vmib = (struct vbe_mode_info_block *) vbeLinear;
for (mode_list = vbe->VideoModePtr; *mode_list != 0xffff; mode_list++) {
/*
* This is a HACK to work around what I believe is a BUG in the
* Toshiba Satellite BIOSes in 08/2000 and 09/2000. The BIOS
* table for 1024x600 says it has six refresh rates, when in fact
* it only has 3. When I ask for rate #4, the BIOS goes into an
* it only has 3. When I ask for rate #4, the BIOS goes into an
* infinite loop until the user interrupts it, usually by pressing
* Ctrl-Alt-F1. For now, we'll just punt everything with a VESA
* number greater than or equal to 0200.
@@ -316,7 +316,7 @@ SavageGetBIOSModes(
xf86ExecX86int10( psav->pVbe->pInt10 );
if(
if(
(vmib->bits_per_pixel == iDepth) &&
(
(vmib->memory_model == VBE_MODEL_256) ||
@@ -338,7 +338,7 @@ SavageGetBIOSModes(
s3vModeTable->Width = vmib->x_resolution;
s3vModeTable->Height = vmib->y_resolution;
s3vModeTable->VesaMode = *mode_list;
/* Query the refresh rates at this mode. */
psav->pVbe->pInt10->cx = *mode_list;
@@ -351,7 +351,7 @@ SavageGetBIOSModes(
if( s3vModeTable->RefreshRate )
{
s3vModeTable->RefreshRate = (unsigned char *)
realloc(
realloc(
s3vModeTable->RefreshRate,
(iRefresh+8) * sizeof(unsigned char)
);
@@ -359,7 +359,7 @@ SavageGetBIOSModes(
else
{
s3vModeTable->RefreshRate = (unsigned char *)
calloc(
calloc(
(iRefresh+8),
sizeof(unsigned char)
);
@@ -392,13 +392,13 @@ ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refres
{
SavageModeEntryPtr pmt;
Bool found = FALSE;
SavagePtr psav = SAVPTR(pScrn);
SavagePtr psav = SAVPTR(pScrn);
int i,j;
unsigned int chosenVesaMode = 0;
unsigned int chosenRefresh = 0;
/* Scan through our BIOS list to locate the closest valid mode. */
/*
* If we ever break 4GHz clocks on video boards, we'll need to
* change this.
@@ -406,11 +406,11 @@ ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refres
* now we use VRefresh directly,instead of by calculating from dot clock
*/
for( i = 0, pmt = psav->ModeTable->Modes;
for( i = 0, pmt = psav->ModeTable->Modes;
i < psav->ModeTable->NumModes;
i++, pmt++ )
{
if( (pmt->Width == width) &&
if( (pmt->Width == width) &&
(pmt->Height == height) )
{
int jDelta = 99;
@@ -444,11 +444,11 @@ ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refres
if( found ) {
/* Success: we found a match in the BIOS. */
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"Chose mode %x at %dHz.\n", chosenVesaMode, chosenRefresh );
return MODE_OK;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
"No suitable BIOS mode found for %dx%d %dHz.\n",
width, height, refresh);
return MODE_NOMODE;

View File

@@ -33,7 +33,7 @@ This software has NO WARRANTY. Use it at your own risk.
*
* e.g. used by Trio3D, GX-3
*************************************************************************/
#define S3_GET_SVGA_BUF 0x0000
#define S3_SAVE_SVGA_STATE 0x0001
#define S3_RESTORE_SVGA_STATE 0x0002

View File

@@ -58,15 +58,15 @@ static int SavageSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer);
static int SavageGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer);
static void SavageQueryBestSize(ScrnInfoPtr, Bool,
short, short, short, short, unsigned int *, unsigned int *, pointer);
static int SavagePutImage( ScrnInfoPtr,
static int SavagePutImage( ScrnInfoPtr,
short, short, short, short, short, short, short, short,
int, unsigned char*, short, short, Bool, RegionPtr, pointer,
DrawablePtr);
static int SavageQueryImageAttributes(ScrnInfoPtr,
static int SavageQueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
static void SavageFreeMemory(ScrnInfoPtr pScrn, void *mem_struct);
void SavageResetVideo(ScrnInfoPtr pScrn);
void SavageResetVideo(ScrnInfoPtr pScrn);
static void SavageSetColorKeyOld(ScrnInfoPtr pScrn);
static void SavageSetColorKeyNew(ScrnInfoPtr pScrn);
@@ -82,7 +82,7 @@ static void (*SavageInitStreams)(ScrnInfoPtr pScrn) = NULL;
static void SavageDisplayVideoOld(
ScrnInfoPtr pScrn, int id, int offset,
short width, short height, int pitch,
short width, short height, int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -90,7 +90,7 @@ static void SavageDisplayVideoOld(
);
static void SavageDisplayVideoNew(
ScrnInfoPtr pScrn, int id, int offset,
short width, short height, int pitch,
short width, short height, int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -98,7 +98,7 @@ static void SavageDisplayVideoNew(
);
static void SavageDisplayVideo2000(
ScrnInfoPtr pScrn, int id, int offset,
short width, short height, int pitch,
short width, short height, int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -106,7 +106,7 @@ static void SavageDisplayVideo2000(
);
static void (*SavageDisplayVideo)(
ScrnInfoPtr pScrn, int id, int offset,
short width, short height, int pitch,
short width, short height, int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -134,7 +134,7 @@ static XF86VideoEncodingRec DummyEncoding[1] =
#define NUM_FORMATS 5
static XF86VideoFormatRec Formats[NUM_FORMATS] =
static XF86VideoFormatRec Formats[NUM_FORMATS] =
{
{8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
};
@@ -214,7 +214,7 @@ static XF86ImageRec Images[] =
XvPacked,
3,
0, 0, 0, 0 ,
8, 8, 8,
8, 8, 8,
2, 4, 4,
1, 1, 1,
{'Y','U','Y','V',
@@ -300,7 +300,7 @@ unsigned int GetBlendForFourCC2000( int id )
void savageOUTREG( SavagePtr psav, unsigned long offset, unsigned long value )
{
ErrorF( "MMIO %08lx, was %08lx, want %08lx,",
ErrorF( "MMIO %08lx, was %08lx, want %08lx,",
offset, (unsigned long)MMIO_IN32( psav->MapBase, offset ), value );
MMIO_OUT32( psav->MapBase, offset, value );
ErrorF( " now %08lx\n", (unsigned long)MMIO_IN32( psav->MapBase, offset ) );
@@ -356,7 +356,7 @@ void SavageInitVideo(ScreenPtr pScreen)
newAdaptors = /* need to free this someplace */
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;
@@ -403,31 +403,31 @@ void SavageSetColorKeyOld(ScrnInfoPtr pScrn)
0x00000000 | (pPriv->colorKey & 0xFF) );
break;
case 15:
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
0x05000000 | (red<<19) | (green<<11) | (blue<<3) );
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
0x00000000 | (red<<19) | (green<<11) | (blue<<3) );
break;
case 16:
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
0x16000000 | (red<<19) | (green<<10) | (blue<<3) );
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
0x00020002 | (red<<19) | (green<<10) | (blue<<3) );
break;
case 24:
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
OUTREG( COL_CHROMA_KEY_CONTROL_REG,
0x17000000 | (red<<16) | (green<<8) | (blue) );
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
0x00000000 | (red<<16) | (green<<8) | (blue) );
break;
}
}
/* We use destination colorkey */
OUTREG( BLEND_CONTROL_REG, 0x05000000 );
}
}
void SavageSetColorKeyNew(ScrnInfoPtr pScrn)
void SavageSetColorKeyNew(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
SavagePortPrivPtr pPriv = psav->adaptor->pPortPrivates[0].ptr;
@@ -458,17 +458,17 @@ void SavageSetColorKeyNew(ScrnInfoPtr pScrn)
switch (pScrn->depth) {
case 8:
if (psav->IsSecondary) {
OUTREG( SEC_STREAM2_CKEY_LOW,
OUTREG( SEC_STREAM2_CKEY_LOW,
0x47000000 | (pPriv->colorKey & 0xFF) );
OUTREG( SEC_STREAM2_CKEY_UPPER,
0x47000000 | (pPriv->colorKey & 0xFF) );
} else if (psav->IsPrimary) {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (pPriv->colorKey & 0xFF) );
OUTREG( SEC_STREAM_CKEY_UPPER,
0x47000000 | (pPriv->colorKey & 0xFF) );
} else {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (pPriv->colorKey & 0xFF) );
OUTREG( SEC_STREAM_CKEY_UPPER,
0x47000000 | (pPriv->colorKey & 0xFF) );
@@ -476,59 +476,59 @@ void SavageSetColorKeyNew(ScrnInfoPtr pScrn)
break;
case 15:
if (psav->IsSecondary) {
OUTREG( SEC_STREAM2_CKEY_LOW,
OUTREG( SEC_STREAM2_CKEY_LOW,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
OUTREG( SEC_STREAM2_CKEY_UPPER,
OUTREG( SEC_STREAM2_CKEY_UPPER,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
} else if (psav->IsPrimary) {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
} else {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
}
break;
case 16:
if (psav->IsSecondary) {
OUTREG( SEC_STREAM2_CKEY_LOW,
OUTREG( SEC_STREAM2_CKEY_LOW,
0x46000000 | (red<<19) | (green<<10) | (blue<<3) );
OUTREG( SEC_STREAM2_CKEY_UPPER,
OUTREG( SEC_STREAM2_CKEY_UPPER,
0x46020002 | (red<<19) | (green<<10) | (blue<<3) );
} else if (psav->IsPrimary) {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x46000000 | (red<<19) | (green<<10) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x46020002 | (red<<19) | (green<<10) | (blue<<3) );
} else {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x46000000 | (red<<19) | (green<<10) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x46020002 | (red<<19) | (green<<10) | (blue<<3) );
}
break;
case 24:
if (psav->IsSecondary) {
OUTREG( SEC_STREAM2_CKEY_LOW,
OUTREG( SEC_STREAM2_CKEY_LOW,
0x47000000 | (red<<16) | (green<<8) | (blue) );
OUTREG( SEC_STREAM2_CKEY_UPPER,
OUTREG( SEC_STREAM2_CKEY_UPPER,
0x47000000 | (red<<16) | (green<<8) | (blue) );
} else if (psav->IsPrimary) {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (red<<16) | (green<<8) | (blue) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x47000000 | (red<<16) | (green<<8) | (blue) );
} else {
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (red<<16) | (green<<8) | (blue) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
0x47000000 | (red<<16) | (green<<8) | (blue) );
}
break;
}
}
/* We assume destination colorkey */
if (psav->IsSecondary) {
@@ -541,7 +541,7 @@ void SavageSetColorKeyNew(ScrnInfoPtr pScrn)
}
}
void SavageSetColorKey2000(ScrnInfoPtr pScrn)
void SavageSetColorKey2000(ScrnInfoPtr pScrn)
{
SavagePtr psav = SAVPTR(pScrn);
SavagePortPrivPtr pPriv = psav->adaptor->pPortPrivates[0].ptr;
@@ -561,30 +561,30 @@ void SavageSetColorKey2000(ScrnInfoPtr pScrn)
else {
switch (pScrn->depth) {
case 8:
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (pPriv->colorKey & 0xFF) );
OUTREG( SEC_STREAM_CKEY_UPPER,
(pPriv->colorKey & 0xFF) );
break;
case 15:
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x45000000 | (red<<19) | (green<<11) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
(red<<19) | (green<<11) | (blue<<3) );
break;
case 16:
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x46000000 | (red<<19) | (green<<10) | (blue<<3) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
(red<<19) | (green<<10) | (blue<<3) );
break;
case 24:
OUTREG( SEC_STREAM_CKEY_LOW,
OUTREG( SEC_STREAM_CKEY_LOW,
0x47000000 | (red<<16) | (green<<8) | (blue) );
OUTREG( SEC_STREAM_CKEY_UPPER,
OUTREG( SEC_STREAM_CKEY_UPPER,
(red<<16) | (green<<8) | (blue) );
break;
}
}
/* We assume destination colorkey */
OUTREG( BLEND_CONTROL, INREG(BLEND_CONTROL) | (8 << 2));
@@ -599,7 +599,7 @@ void SavageSetColorOld( ScrnInfoPtr pScrn )
xf86ErrorFVerb(XVTRACE, "bright %d, contrast %d, saturation %d, hue %d\n",
pPriv->brightness, (int)pPriv->contrast, (int)pPriv->saturation, pPriv->hue );
if(
if(
(psav->videoFourCC == FOURCC_RV15) ||
(psav->videoFourCC == FOURCC_RV16)
)
@@ -614,10 +614,10 @@ void SavageSetColorOld( ScrnInfoPtr pScrn )
unsigned long hs1 = ((long)(sat * cos(hue))) & 0x1f;
unsigned long hs2 = ((long)(sat * sin(hue))) & 0x1f;
OUTREG( COLOR_ADJUSTMENT_REG,
OUTREG( COLOR_ADJUSTMENT_REG,
0x80008000 |
(pPriv->brightness + 128) |
((pPriv->contrast & 0xf8) << (12-7)) |
((pPriv->contrast & 0xf8) << (12-7)) |
(hs1 << 16) |
(hs2 << 24)
);
@@ -760,7 +760,7 @@ void SavageSetColor2000( ScrnInfoPtr pScrn )
brightness = pPriv->brightness * 200 / 750 - 200;
else
brightness = (pPriv->brightness - 750) * 200 / (10000 - 750);
dkb = 128 * (brightness - (k * pPriv->contrast * yb / 10000.0) + 0.5);
dkb = 128 * (brightness - (k * pPriv->contrast * yb / 10000.0) + 0.5);
if (dkb < 0)
dkb -= 0.5;
else
@@ -788,14 +788,14 @@ void SavageSetColor2000( ScrnInfoPtr pScrn )
OUTREG( SEC_STREAM_COLOR_CONVERT3_2000, assembly4 );
}
void SavageResetVideo(ScrnInfoPtr pScrn)
void SavageResetVideo(ScrnInfoPtr pScrn)
{
xf86ErrorFVerb(XVTRACE,"SavageResetVideo\n");
SavageSetColor( pScrn );
SavageSetColorKey( pScrn );
}
static XF86VideoAdaptorPtr
static XF86VideoAdaptorPtr
SavageSetupImageVideo(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -844,10 +844,10 @@ SavageSetupImageVideo(ScreenPtr pScreen)
/* interpolation option only available on "old" streams */
xvInterpolation = MAKE_ATOM("XV_VERTICAL_INTERPOLATION");
pPriv->colorKey =
(1 << pScrn->offset.red) |
pPriv->colorKey =
(1 << pScrn->offset.red) |
(1 << pScrn->offset.green) |
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
(((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue);
pPriv->videoStatus = 0;
pPriv->brightness = 0;
pPriv->contrast = 128;
@@ -866,24 +866,24 @@ SavageSetupImageVideo(ScreenPtr pScreen)
}
/* SavageClipVideo -
/* SavageClipVideo -
Takes the dst box in standard X BoxRec form (top and left
edges inclusive, bottom and right exclusive). The new dst
box is returned. The source boundaries are given (x1, y1
inclusive, x2, y2 exclusive) and returned are the new source
box is returned. The source boundaries are given (x1, y1
inclusive, x2, y2 exclusive) and returned are the new source
boundaries in 16.16 fixed point.
*/
static void
SavageClipVideo(
BoxPtr dst,
INT32 *x1,
INT32 *x2,
INT32 *y1,
BoxPtr dst,
INT32 *x1,
INT32 *x2,
INT32 *y1,
INT32 *y2,
BoxPtr extents, /* extents of the clip region */
INT32 width,
INT32 width,
INT32 height
){
INT32 vscale, hscale, delta;
@@ -898,22 +898,22 @@ SavageClipVideo(
diff = extents->x1 - dst->x1;
if(diff > 0) {
dst->x1 = extents->x1;
*x1 += diff * hscale;
*x1 += diff * hscale;
}
diff = dst->x2 - extents->x2;
if(diff > 0) {
dst->x2 = extents->x2;
*x2 -= diff * hscale;
*x2 -= diff * hscale;
}
diff = extents->y1 - dst->y1;
if(diff > 0) {
dst->y1 = extents->y1;
*y1 += diff * vscale;
*y1 += diff * vscale;
}
diff = dst->y2 - extents->y2;
if(diff > 0) {
dst->y2 = extents->y2;
*y2 -= diff * vscale;
*y2 -= diff * vscale;
}
if(*x1 < 0) {
@@ -938,9 +938,9 @@ SavageClipVideo(
dst->y2 -= diff;
*y2 -= diff * vscale;
}
}
}
static void
static void
SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
{
SavagePortPrivPtr pPriv = (SavagePortPrivPtr)data;
@@ -950,7 +950,7 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
xf86ErrorFVerb(XVTRACE,"SavageStopVideo\n");
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
if(shutdown) {
SavageStreamsOff( pScrn );
@@ -959,7 +959,7 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
if (pPriv->agpBufferMap != NULL) {
SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
/* agpXVideo is reused to implement UploadToScreen in EXA */
/* agpXVideo is reused to implement UploadToScreen in EXA */
if (!psav->useEXA) {
drmUnmap(pPriv->agpBufferMap, pSAVAGEDRIServer->agpXVideo.size);
pSAVAGEDRIServer->agpXVideo.map = NULL;
@@ -987,11 +987,11 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
}
}
static int
static int
SavageSetPortAttribute(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Atom attribute,
INT32 value,
INT32 value,
pointer data
){
SavagePortPrivPtr pPriv = (SavagePortPrivPtr)data;
@@ -1001,8 +1001,8 @@ SavageSetPortAttribute(
pPriv->colorKey = value;
if( psav->videoFlags & VF_STREAMS_ON)
SavageSetColorKey( pScrn );
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
}
REGION_EMPTY(pScrn->pScreen, &pPriv->clip);
}
else if( attribute == xvBrightness) {
if((value < -128) || (value > 127))
return BadValue;
@@ -1045,11 +1045,11 @@ SavageSetPortAttribute(
return Success;
}
static int
static int
SavageGetPortAttribute(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Atom attribute,
INT32 *value,
INT32 *value,
pointer data
){
SavagePortPrivPtr pPriv = (SavagePortPrivPtr)data;
@@ -1077,24 +1077,24 @@ SavageGetPortAttribute(
return Success;
}
static void
static void
SavageQueryBestSize(
ScrnInfoPtr pScrn,
ScrnInfoPtr pScrn,
Bool motion,
short vid_w, short vid_h,
short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h,
short vid_w, short vid_h,
short drw_w, short drw_h,
unsigned int *p_w, unsigned int *p_h,
pointer data
){
/* What are the real limits for the Savage? */
*p_w = drw_w;
*p_h = drw_h;
*p_h = drw_h;
if(*p_w > 16384) *p_w = 16384;
}
/* SavageCopyPlanarDataBCI() causes artifacts on the screen when used on savage4.
/* SavageCopyPlanarDataBCI() causes artifacts on the screen when used on savage4.
* It's probably something with the BCI. Maybe we need a waitforidle() or
* something...
*/
@@ -1126,12 +1126,12 @@ SavageCopyPlanarDataBCI(
/* copy Y planar */
memcpy(planarPtr, srcY, srcPitch * h);
/* copy V planar */
/* copy V planar */
planarPtr = planarPtr + srcPitch * h;
memcpy(planarPtr, srcV, srcPitch2 * (h>>1));
/* copy U planar */
planarPtr = planarPtr + srcPitch2 * (h>>1);
planarPtr = planarPtr + srcPitch2 * (h>>1);
memcpy(planarPtr, srcU, srcPitch2 * (h>>1));
memType = isAGP ? 3 : 0;
@@ -1141,7 +1141,7 @@ SavageCopyPlanarDataBCI(
* and reformat the data during the transfer
* a. program BCI51 to specify the source information
* b. program BCI52 to specify the destination information
* c. program BCI53 to specify the source dimensions
* c. program BCI53 to specify the source dimensions
* d. program BCI54 to specify the destination dimensions
* e. (if the data is in YCbCr420 format)program BCI55,BCI56,BCI57 to
* locations of the Y,Cb,and Cr data
@@ -1349,10 +1349,10 @@ SavageSetBlend(ScrnInfoPtr pScrn, int id)
psav->blendBase = GetBlendForFourCC2000( id );
xf86ErrorFVerb(XVTRACE+1,"Format %4.4s, blend is %08x\n", (char*)&id, psav->blendBase );
if (id != FOURCC_YV12)
OUTREG( BLEND_CONTROL,
OUTREG( BLEND_CONTROL,
((psav->blendBase << 24) | (8 << 2) /*| 0x20000000*/));
else
OUTREG( BLEND_CONTROL,
else
OUTREG( BLEND_CONTROL,
((psav->blendBase << 24) | (8 << 2) /*| 0x10000000*/));
}
@@ -1365,7 +1365,7 @@ SavageDisplayVideoOld(
int id,
int offset,
short width, short height,
int pitch,
int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -1437,7 +1437,7 @@ SavageDisplayVideoOld(
ssControl |= HDSCALE_64;
scalratio = HSCALING(2,1);
}
} else
} else
scalratio = HSCALING(src_w,drw_w);
ssControl |= src_w;
@@ -1496,7 +1496,7 @@ SavageDisplayVideoOld(
VGAOUT8(vgaCRIndex, 0x93);
if (psav->bTiled && (( drw_h > src_h) || (drw_w > src_w)))
VGAOUT8(vgaCRReg, pitch | 0xf);
else
else
VGAOUT8(vgaCRReg, pitch);
}
}
@@ -1507,7 +1507,7 @@ SavageDisplayVideoNew(
int id,
int offset,
short width, short height,
int pitch,
int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -1538,7 +1538,7 @@ SavageDisplayVideoNew(
if ( S3_SAVAGE_MOBILE_SERIES(psav->Chipset) &&
(psav->DisplayType == MT_LCD) &&
!psav->CrtOnly &&
!psav->TvOn)
!psav->TvOn)
{
drw_w = (drw_w * psav->XExp1) / psav->XExp2 + 1;
drw_h = (drw_h * psav->YExp1) / psav->YExp2 + 1;
@@ -1553,22 +1553,22 @@ SavageDisplayVideoNew(
}
if (psav->IsSecondary) {
OUTREG(SEC_STREAM2_HSCALING,
OUTREG(SEC_STREAM2_HSCALING,
((src_w&0xfff)<<20) | ((65536 * src_w / drw_w) & 0x1FFFF ));
/* BUGBUG need to add 00040000 if src stride > 2048 */
OUTREG(SEC_STREAM2_VSCALING,
OUTREG(SEC_STREAM2_VSCALING,
((src_h&0xfff)<<20) | ((65536 * src_h / drw_h) & 0x1FFFF ));
} else if (psav->IsPrimary) {
OUTREG(SEC_STREAM_HSCALING,
OUTREG(SEC_STREAM_HSCALING,
((src_w&0xfff)<<20) | ((65536 * src_w / drw_w) & 0x1FFFF ));
/* BUGBUG need to add 00040000 if src stride > 2048 */
OUTREG(SEC_STREAM_VSCALING,
OUTREG(SEC_STREAM_VSCALING,
((src_h&0xfff)<<20) | ((65536 * src_h / drw_h) & 0x1FFFF ));
} else {
OUTREG(SEC_STREAM_HSCALING,
OUTREG(SEC_STREAM_HSCALING,
((src_w&0xfff)<<20) | ((65536 * src_w / drw_w) & 0x1FFFF ));
/* BUGBUG need to add 00040000 if src stride > 2048 */
OUTREG(SEC_STREAM_VSCALING,
OUTREG(SEC_STREAM_VSCALING,
((src_h&0xfff)<<20) | ((65536 * src_h / drw_h) & 0x1FFFF ));
}
@@ -1578,25 +1578,25 @@ SavageDisplayVideoNew(
*/
if (psav->IsSecondary) {
OUTREG(SEC_STREAM2_FBUF_ADDR0, (offset + (x1>>15))
OUTREG(SEC_STREAM2_FBUF_ADDR0, (offset + (x1>>15))
& (0x7ffffff & ~BASE_PAD));
OUTREG(SEC_STREAM2_STRIDE_LPB, pitch & 0xfff );
OUTREG(SEC_STREAM2_WINDOW_START, ((dstBox->x1+1) << 16) | (dstBox->y1+1) );
OUTREG(SEC_STREAM2_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
OUTREG(SEC_STREAM2_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
| (dstBox->y2 - dstBox->y1) );
} else if (psav->IsPrimary) {
OUTREG(SEC_STREAM_FBUF_ADDR0, (offset + (x1>>15))
OUTREG(SEC_STREAM_FBUF_ADDR0, (offset + (x1>>15))
& (0x7ffffff & ~BASE_PAD));
OUTREG(SEC_STREAM_STRIDE, pitch & 0xfff );
OUTREG(SEC_STREAM_WINDOW_START, ((dstBox->x1+1) << 16) | (dstBox->y1+1) );
OUTREG(SEC_STREAM_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
OUTREG(SEC_STREAM_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
| (dstBox->y2 - dstBox->y1) );
} else {
OUTREG(SEC_STREAM_FBUF_ADDR0, (offset + (x1>>15))
OUTREG(SEC_STREAM_FBUF_ADDR0, (offset + (x1>>15))
& (0x7ffffff & ~BASE_PAD));
OUTREG(SEC_STREAM_STRIDE, pitch & 0xfff );
OUTREG(SEC_STREAM_WINDOW_START, ((dstBox->x1+1) << 16) | (dstBox->y1+1) );
OUTREG(SEC_STREAM_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
OUTREG(SEC_STREAM_WINDOW_SZ, ((dstBox->x2-dstBox->x1) << 16)
| (dstBox->y2 - dstBox->y1) );
}
@@ -1622,7 +1622,7 @@ SavageDisplayVideo2000(
int id,
int offset,
short width, short height,
int pitch,
int pitch,
int x1, int y1, int x2, int y2,
BoxPtr dstBox,
short src_w, short src_h,
@@ -1648,7 +1648,7 @@ SavageDisplayVideo2000(
else
OUTREG(SEC_STREAM_SRC_START_2000, SRCSTART(x1, y1));
OUTREG(SEC_STREAM_SRC_SIZE_2000,
OUTREG(SEC_STREAM_SRC_SIZE_2000,
SRCSIZE((dstBox->x2-dstBox->x1), (dstBox->y2-dstBox->y1)));
if( src_w > drw_w )
@@ -1673,7 +1673,7 @@ SavageDisplayVideo2000(
OUTREG(SEC_STREAM_FBUF_ADDR0, (addr0) & (0x3fffff & ~BASE_PAD));
OUTREG(SEC_STREAM_WINDOW_START, XY_2000(dstBox->x1,dstBox->y1));
OUTREG(SEC_STREAM_WINDOW_SZ,
OUTREG(SEC_STREAM_WINDOW_SZ,
WH_2000((dstBox->x2-dstBox->x1),(dstBox->y2-dstBox->y1)));
OUTREG(SEC_STREAM_STRIDE, pitch & 0xfff);
}
@@ -1684,15 +1684,15 @@ SavageFillKeyHelper(DrawablePtr pDraw, uint32_t colorKey, RegionPtr clipBoxes)
xf86XVFillKeyHelperDrawable(pDraw, colorKey, clipBoxes);
}
static int
SavagePutImage(
ScrnInfoPtr pScrn,
short src_x, short src_y,
static int
SavagePutImage(
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
@@ -1723,7 +1723,7 @@ SavagePutImage(
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
SavageClipVideo(&dstBox, &x1, &x2, &y1, &y2,
SavageClipVideo(&dstBox, &x1, &x2, &y1, &y2,
REGION_EXTENTS(pScreen, clipBoxes), width, height);
drw_w = dstBox.x2 - dstBox.x1;
@@ -1765,7 +1765,7 @@ SavagePutImage(
default:
srcPitch = (width << 1);
break;
}
}
/* Calculate required memory for all planar frames */
planarFrameSize = 0;
@@ -1779,7 +1779,7 @@ SavagePutImage(
#ifdef SAVAGEDRI
if (!pPriv->tried_agp && !psav->IsPCI && psav->drmFD > 0 && psav->DRIServerInfo != NULL) {
SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
pPriv->tried_agp = TRUE;
if (pSAVAGEDRIServer->agpXVideo.size >= max(new_size, planarFrameSize)) {
if (pSAVAGEDRIServer->agpXVideo.map == NULL &&
@@ -1800,7 +1800,7 @@ SavagePutImage(
/* This situation is expected if AGPforXv is disabled, otherwise report. */
if (pSAVAGEDRIServer->agpXVideo.size > 0) {
xf86DrvMsg( pScreen->myNum, X_ERROR,
"[agp] XVideo: not enough space in buffer (got %ld bytes, required %d bytes).\n",
"[agp] XVideo: not enough space in buffer (got %ld bytes, required %d bytes).\n",
(long int)pSAVAGEDRIServer->agpXVideo.size, max(new_size, planarFrameSize));
}
pPriv->agpBufferMap = NULL;
@@ -1857,9 +1857,9 @@ SavagePutImage(
/* Using copy to AGP memory */
SavageCopyPlanarDataBCI(
pScrn,
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
dst_start,
pPriv->agpBufferMap,
pPriv->agpBase + pPriv->agpBufferOffset,
@@ -1870,9 +1870,9 @@ SavagePutImage(
/* Using ordinary copy to framebuffer */
SavageCopyPlanarDataBCI(
pScrn,
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
dst_start,
(unsigned char *)psav->FBBase + pPriv->video_planarbuf,
pPriv->video_planarbuf,
@@ -1880,9 +1880,9 @@ SavagePutImage(
}
} else {
SavageCopyPlanarData(
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
buf + (top * srcPitch) + (left >> 1),
buf + offsetV,
buf + offsetU,
dst_start, srcPitch, srcPitch2, dstPitch, nlines, npixels);
}
break;
@@ -1895,7 +1895,7 @@ SavagePutImage(
nlines = ((y2 + 0xffff) >> 16) - top;
SavageCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
break;
}
}
/* We need to enable the video before we draw the chroma color.
Otherwise, we get blue flashes. */
@@ -1916,11 +1916,11 @@ SavagePutImage(
return Success;
}
static int
static int
SavageQueryImageAttributes(
ScrnInfoPtr pScrn,
int id,
unsigned short *w, unsigned short *h,
ScrnInfoPtr pScrn,
int id,
unsigned short *w, unsigned short *h,
int *pitches, int *offsets
){
int size, tmp;
@@ -1975,11 +1975,11 @@ typedef struct {
Bool isOn;
} OffscreenPrivRec, * OffscreenPrivPtr;
static int
static int
SavageAllocateSurface(
ScrnInfoPtr pScrn,
int id,
unsigned short w,
unsigned short w,
unsigned short h,
XF86SurfacePtr surface
){
@@ -2022,7 +2022,7 @@ SavageAllocateSurface(
pPriv->isOn = FALSE;
surface->pScrn = pScrn;
surface->id = id;
surface->id = id;
surface->pitches[0] = pitch;
surface->offsets[0] = offset; /*area->box.y1 * fbpitch;*/
surface->devPrivate.ptr = (pointer)pPriv;
@@ -2030,7 +2030,7 @@ SavageAllocateSurface(
return Success;
}
static int
static int
SavageStopSurface(
XF86SurfacePtr surface
){
@@ -2045,7 +2045,7 @@ SavageStopSurface(
return Success;
}
static int
static int
SavageFreeSurface(
XF86SurfacePtr surface
){
@@ -2068,7 +2068,7 @@ SavageGetSurfaceAttribute(
Atom attribute,
INT32 *value
){
return SavageGetPortAttribute(pScrn, attribute, value,
return SavageGetPortAttribute(pScrn, attribute, value,
(pointer)(GET_PORT_PRIVATE(pScrn)));
}
@@ -2078,16 +2078,16 @@ SavageSetSurfaceAttribute(
Atom attribute,
INT32 value
){
return SavageSetPortAttribute(pScrn, attribute, value,
return SavageSetPortAttribute(pScrn, attribute, value,
(pointer)(GET_PORT_PRIVATE(pScrn)));
}
static int
static int
SavageDisplaySurface(
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
){
@@ -2109,8 +2109,8 @@ SavageDisplaySurface(
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
SavageClipVideo(&dstBox, &x1, &x2, &y1, &y2,
REGION_EXTENTS(pScreen, clipBoxes),
SavageClipVideo(&dstBox, &x1, &x2, &y1, &y2,
REGION_EXTENTS(pScreen, clipBoxes),
surface->width, surface->height);
if((x1 >= x2) || (y1 >= y2))
@@ -2121,7 +2121,7 @@ SavageDisplaySurface(
dstBox.y1 -= pScrn->frameY0;
dstBox.y2 -= pScrn->frameY0;
SavageDisplayVideo(pScrn, surface->id, surface->offsets[0],
SavageDisplayVideo(pScrn, surface->id, surface->offsets[0],
surface->width, surface->height, surface->pitches[0],
x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h);
@@ -2132,7 +2132,7 @@ SavageDisplaySurface(
return Success;
}
static void
static void
SavageInitOffscreenImages(ScreenPtr pScreen)
{
XF86OffscreenImagePtr offscreenImages;
@@ -2148,7 +2148,7 @@ SavageInitOffscreenImages(ScreenPtr pScreen)
}
offscreenImages[0].image = &Images[0];
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES |
VIDEO_CLIP_TO_VIEWPORT;
offscreenImages[0].alloc_surface = SavageAllocateSurface;
offscreenImages[0].free_surface = SavageFreeSurface;