diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/savage_accel.c | 16 | ||||
-rw-r--r-- | src/savage_bci.h | 7 | ||||
-rw-r--r-- | src/savage_dri.c | 96 |
3 files changed, 49 insertions, 70 deletions
diff --git a/src/savage_accel.c b/src/savage_accel.c index af86b40..ea79817 100644 --- a/src/savage_accel.c +++ b/src/savage_accel.c @@ -478,8 +478,8 @@ void SavageSetGBD_Twister(ScrnInfoPtr pScrn) if (psav->Chipset == S3_SAVAGE4) { bci_enable = BCI_ENABLE; - tile16 = TILE_FORMAT_DESTINATION16; - tile32 = TILE_FORMAT_DESTINATION32; + tile16 = TILE_FORMAT_16BPP; + tile32 = TILE_FORMAT_32BPP; } else { bci_enable = BCI_ENABLE_TWISTER; tile16 = TILE_DESTINATION; @@ -645,8 +645,8 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn) int bci_enable, tile16, tile32; bci_enable = BCI_ENABLE; - tile16 = TILE_FORMAT_DESTINATION16; - tile32 = TILE_FORMAT_DESTINATION32; + tile16 = TILE_FORMAT_16BPP; + tile32 = TILE_FORMAT_32BPP; /* following is the enable case */ @@ -676,14 +676,6 @@ void SavageSetGBD_M7(ScrnInfoPtr pScrn) OUTREG16(SEQ_ADDRESS_REG,SELECT_IGA1); - /* - * load ps1 active registers as determined by MM81C0/81C4 - * load ps2 active registers as determined by MM81B0/81B4 - */ - OUTREG8(CRT_ADDRESS_REG,0x65); - byte = INREG8(CRT_DATA_REG) | 0x03; - OUTREG8(CRT_DATA_REG,byte); - #if 0 /* Set primary stream to bank 0 */ OUTREG8(CRT_ADDRESS_REG, MEMORY_CTRL0_REG);/* CRCA */ diff --git a/src/savage_bci.h b/src/savage_bci.h index 4874be7..9b0fc21 100644 --- a/src/savage_bci.h +++ b/src/savage_bci.h @@ -19,14 +19,13 @@ #define TILE_FORMAT_LINEAR 0 #define TILE_TEXTURE 2 #define TILE_DESTINATION 1 -#define TILE_FORMAT_DESTINATION16 2 -#define TILE_FORMAT_DESTINATION32 3 +#define TILE_FORMAT_16BPP 2 +#define TILE_FORMAT_32BPP 3 /* BD - BCI enable */ /* savage4, MX, IX, 3D */ #define BCI_ENABLE 8 -/* twister, prosavage */ -/* not sure which one supersavage fits into */ +/* twister, prosavage, DDR, supersavage, 2000 */ #define BCI_ENABLE_TWISTER 0 #define S3_BIG_ENDIAN 4 diff --git a/src/savage_dri.c b/src/savage_dri.c index ab874f7..50211f5 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -1239,6 +1239,7 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) SAVAGEDRIPtr pSAVAGEDRI = (SAVAGEDRIPtr)psav->pDRIInfo->devPrivate; int i; unsigned int TileStride; + unsigned int zTileStride; if ( !psav->pDRIInfo ) @@ -1296,24 +1297,30 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) pSAVAGEDRI->frontPitch = pSAVAGEDRIServer->frontPitch; pSAVAGEDRI->IsfrontTiled = psav->bTiled; /* AGD: was 0 */ + if(pSAVAGEDRI->cpp==2) + TileStride = (pSAVAGEDRI->width+63)&(~63); + else + TileStride = (pSAVAGEDRI->width+31)&(~31); + + if(pSAVAGEDRI->zpp==2) + zTileStride = (pSAVAGEDRI->width+63)&(~63); + else + zTileStride = (pSAVAGEDRI->width+31)&(~31); + if(pSAVAGEDRI->IsfrontTiled) { - if(pSAVAGEDRI->cpp==2) - TileStride = (pSAVAGEDRI->width+63)&(~63); - else - TileStride = (pSAVAGEDRI->width+31)&(~31); - if ((psav->Chipset == S3_TWISTER) || (psav->Chipset == S3_PROSAVAGE) || (psav->Chipset == S3_PROSAVAGEDDR) || (psav->Chipset == S3_SUPERSAVAGE)) { - pSAVAGEDRI->frontBitmapDesc = 0x10000000 | /* block write disabled */ + pSAVAGEDRI->frontBitmapDesc = BCI_BD_BW_DISABLE | /* block write disabled */ (1<<24) | /* destination tile format */ (pScrn->bitsPerPixel<<16) | /* bpp */ TileStride; /* stride */ + pSAVAGEDRI->frontPitch = TileStride; } else { - pSAVAGEDRI->frontBitmapDesc = 0x10000000 | /* block write disabled */ + pSAVAGEDRI->frontBitmapDesc = BCI_BD_BW_DISABLE | /* block write disabled */ ((pSAVAGEDRI->cpp==2)? BCI_BD_TILE_16:BCI_BD_TILE_32) | /*16/32 bpp tile format */ (pScrn->bitsPerPixel<<16) | /* bpp */ @@ -1323,70 +1330,51 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) } else { - pSAVAGEDRI->frontBitmapDesc = 0x10000000 | /* AGD: block write should be disabled: was 0x00000000 */ + pSAVAGEDRI->frontBitmapDesc = BCI_BD_BW_DISABLE | /* AGD: block write should be disabled: was 0x00000000 */ pScrn->bitsPerPixel<<16 | pSAVAGEDRI->width; } - pSAVAGEDRI->backOffset = pSAVAGEDRIServer->backOffset; - pSAVAGEDRI->backbufferSize = pSAVAGEDRIServer->backbufferSize; - pSAVAGEDRI->backbuffer = psav->FrameBufferBase + - pSAVAGEDRI->backOffset; - pSAVAGEDRI->backPitch = pSAVAGEDRIServer->backPitch; - { - if(pSAVAGEDRI->cpp==2) - TileStride = (pSAVAGEDRI->width+63)&(~63); - else - TileStride = (pSAVAGEDRI->width+31)&(~31); - if ((psav->Chipset == S3_TWISTER) || (psav->Chipset == S3_PROSAVAGE) || (psav->Chipset == S3_PROSAVAGEDDR) - || (psav->Chipset == S3_SUPERSAVAGE)) /* AGD: supersavage may work like savage4/MX/IX, I just don't know. */ - { /* It's here since the 2D driver sets it up like prosavage */ - pSAVAGEDRI->backBitmapDesc = 0x10000000 | + || (psav->Chipset == S3_SUPERSAVAGE)) + { + pSAVAGEDRI->backBitmapDesc = BCI_BD_BW_DISABLE | (1<<24) | (pScrn->bitsPerPixel<<16) | TileStride; + pSAVAGEDRI->depthBitmapDesc = BCI_BD_BW_DISABLE | + (1<<24) | + (pScrn->bitsPerPixel<<16) | + zTileStride; } else { - pSAVAGEDRI->backBitmapDesc = 0x10000000 | + pSAVAGEDRI->backBitmapDesc = BCI_BD_BW_DISABLE | ((pSAVAGEDRI->cpp==2)? BCI_BD_TILE_16:BCI_BD_TILE_32) | (pScrn->bitsPerPixel<<16) | TileStride; + pSAVAGEDRI->depthBitmapDesc = BCI_BD_BW_DISABLE | + ((pSAVAGEDRI->zpp==2)? + BCI_BD_TILE_16:BCI_BD_TILE_32) | + (pScrn->bitsPerPixel<<16) | + zTileStride; } } + pSAVAGEDRI->backOffset = pSAVAGEDRIServer->backOffset; + pSAVAGEDRI->backbufferSize = pSAVAGEDRIServer->backbufferSize; + pSAVAGEDRI->backbuffer = psav->FrameBufferBase + + pSAVAGEDRI->backOffset; + pSAVAGEDRI->backPitch = pSAVAGEDRIServer->backPitch; + pSAVAGEDRI->depthOffset = pSAVAGEDRIServer->depthOffset; pSAVAGEDRI->depthbufferSize = pSAVAGEDRIServer->depthbufferSize; pSAVAGEDRI->depthbuffer = psav->FrameBufferBase + pSAVAGEDRI->depthOffset; pSAVAGEDRI->depthPitch = pSAVAGEDRIServer->depthPitch; - { - if(pSAVAGEDRI->zpp==2) - TileStride = (pSAVAGEDRI->width+63)&(~63); - else - TileStride = (pSAVAGEDRI->width+31)&(~31); - - if ((psav->Chipset == S3_TWISTER) - || (psav->Chipset == S3_PROSAVAGE) - || (psav->Chipset == S3_PROSAVAGEDDR) - || (psav->Chipset == S3_SUPERSAVAGE)) - { - pSAVAGEDRI->depthBitmapDesc = 0x10000000 | - (1<<24) | - (pScrn->bitsPerPixel<<16) | - TileStride; - } else { - pSAVAGEDRI->depthBitmapDesc = 0x10000000 | - ((pSAVAGEDRI->zpp==2)? - BCI_BD_TILE_16:BCI_BD_TILE_32) | - (pScrn->bitsPerPixel<<16) | - TileStride; - } - } pSAVAGEDRI->textureOffset = pSAVAGEDRIServer->textureOffset; pSAVAGEDRI->textures = psav->FrameBufferBase + @@ -1439,16 +1427,16 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) || (psav->Chipset == S3_SAVAGE3D)) { if(pSAVAGEDRI->cpp == 2) { - value |= ((psav->l3DDelta / 4) >> 5) << 24; /* I assume psav->l3DDelta for 3D */ + value |= ((psav->l3DDelta / 4) >> 5) << 24; value |= 2<<30; } else { - value |= ((psav->l3DDelta / 4) >> 5) << 24; /* I assume psav->l3DDelta for 3D */ + value |= ((psav->l3DDelta / 4) >> 5) << 24; value |= 3<<30; } - OUTREG(0x48C40, value|(pSAVAGEDRI->frontOffset) ); /* front */ - OUTREG(0x48C44, value|(pSAVAGEDRI->backOffset) ); /* back */ - OUTREG(0x48C48, value|(pSAVAGEDRI->depthOffset) ); /* depth */ + 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 { if(pSAVAGEDRI->cpp == 2) { @@ -1459,9 +1447,9 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen ) value |= 3<<30; } - OUTREG(0x48C40, value|(pSAVAGEDRI->frontOffset >> 5) ); /* front */ - OUTREG(0x48C44, value|(pSAVAGEDRI->backOffset >> 5) ); /* back */ - OUTREG(0x48C48, value|(pSAVAGEDRI->depthOffset >> 5) ); /* depth */ + OUTREG(TILED_SURFACE_REGISTER_0, value|(pSAVAGEDRI->frontOffset >> 5) ); /* front */ + OUTREG(TILED_SURFACE_REGISTER_1, value|(pSAVAGEDRI->backOffset >> 5) ); /* back */ + OUTREG(TILED_SURFACE_REGISTER_2, value|(pSAVAGEDRI->depthOffset >> 5) ); /* depth */ } } |