summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.com>2007-03-06 02:28:33 -0500
committerAlex Deucher <alex@botch2.com>2007-03-06 02:28:33 -0500
commitee7c53ae2b6e167dd4d6e813bc565e991f6b73e3 (patch)
treeb2f76ae44f9497b738475c45eaa4105b32cbf77b
parent3e2d370e291f5f222de88075f1f285446cca0569 (diff)
small exa fix ups, remove an errant comment
-rw-r--r--src/savage_driver.c3
-rw-r--r--src/savage_exa.c74
2 files changed, 40 insertions, 37 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 25694da..2c51770 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -4159,9 +4159,6 @@ void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, int *indicies,
}
static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1,
-
- /* Make sure linear addressing is enabled after the BIOS call. */
- /* Note that we must use an I/O port to do this. */
int min_n2, int max_n2, long freq_min,
long freq_max, unsigned int *mdiv,
unsigned int *ndiv, unsigned int *r)
diff --git a/src/savage_exa.c b/src/savage_exa.c
index 8e6da38..59412ef 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -95,29 +95,30 @@ static int SavageGetCopyROP(int rop) {
}
-static int SavageGetCopyROP_PM(int rop) {
+static int SavageGetSolidROP(int rop) {
- int ALUCopyROP_PM[16] =
+ int ALUSolidROP[16] =
{
- 0x00, /*ROP_0*/ /* not used */
- 0x75, /*ROP_DSPnoa*/
- 0x45, /*ROP_DPSnaon*/
- 0xCA, /*ROP_DPSDxax*/
- 0xD5, /*ROP_DPSana*/
- 0xAA, /*ROP_D*/ /* not used */
- 0x6A, /*ROP_DPSax*/
- 0xEA, /*ROP_DPSao*/
- 0x15, /*ROP_DPSaon*/
- 0x95, /*ROP_DPSaxn*/
- 0x55, /*ROP_Dn*/ /* not used */
- 0xD5, /*ROP_DPSanan*/
- 0x2E, /*ROP_PSDPxox*/ /* is that correct ? */
- 0xBA, /*ROP_DPSnao*/
- 0x75, /*ROP_DSPnoan*/
- 0xFF, /*ROP_1*/ /* not used */
+ /* GXclear */ 0x00, /* 0 */
+ /* GXand */ 0xA0, /* src AND dst */
+ /* GXandReverse */ 0x50, /* src AND NOT dst */
+ /* GXcopy */ 0xF0, /* src */
+ /* GXandInverted*/ 0x0A, /* NOT src AND dst */
+ /* GXnoop */ 0xAA, /* dst */
+ /* GXxor */ 0x5A, /* src XOR dst */
+ /* GXor */ 0xFA, /* src OR dst */
+ /* GXnor */ 0x05, /* NOT src AND NOT dst */
+ /* GXequiv */ 0xA5, /* NOT src XOR dst */
+ /* GXinvert */ 0x55, /* NOT dst */
+ /* GXorReverse */ 0xF5, /* src OR NOT dst */
+ /* GXcopyInverted*/ 0x0F, /* NOT src */
+ /* GXorInverted */ 0xAF, /* NOT src OR dst */
+ /* GXnand */ 0x5F, /* NOT src OR NOT dst */
+ /* GXset */ 0xFF, /* 1 */
+
};
- return (ALUCopyROP_PM[rop]);
+ return (ALUSolidROP[rop]);
}
@@ -171,14 +172,14 @@ SavageEXAInit(ScreenPtr pScreen)
if (psav->Chipset == S3_SAVAGE2000 ||
psav->Chipset == S3_SUPERSAVAGE) {
- psav->EXADriverPtr->pixmapOffsetAlign = 128; /* octword */
+ psav->EXADriverPtr->pixmapOffsetAlign = 16; /* octword */
} else {
- psav->EXADriverPtr->pixmapOffsetAlign = 64; /* qword */
+ psav->EXADriverPtr->pixmapOffsetAlign = 8; /* quadword */
}
/* engine has 12 bit coordinates */
- psav->EXADriverPtr->maxX = 4095;
- psav->EXADriverPtr->maxY = 4095;
+ psav->EXADriverPtr->maxX = 4096;
+ psav->EXADriverPtr->maxY = 4096;
/* Sync */
psav->EXADriverPtr->WaitMarker = SavageEXASync;
@@ -282,7 +283,7 @@ SavagePrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
| BCI_CMD_DEST_PBD_NEW | BCI_CMD_SRC_SOLID
| BCI_CMD_SEND_COLOR;
- BCI_CMD_SET_ROP( cmd, SavageGetCopyROP(alu) );
+ BCI_CMD_SET_ROP( cmd, SavageGetSolidROP(alu) );
psav->pbd_offset = exaGetPixmapOffset(pPixmap);
psav->pbd_high = SavageSetBD(psav, pPixmap);
@@ -412,18 +413,19 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
SavagePtr psav = SAVPTR(pScrn);
BCI_GET_PTR;
- int i, j, dwords, Bpp;
+ int i, j, dwords, queue, Bpp;
unsigned int cmd;
CARD32 * srcp;
Bpp = pDst->drawable.bitsPerPixel / 8;
- dwords = ((w * Bpp) + 3) >> 2;
+ dwords = (((w * Bpp) + 3) >> 2) * h;
psav->sbd_offset = exaGetPixmapOffset(pDst);
psav->sbd_high = SavageSetBD(psav, pDst);
cmd = BCI_CMD_RECT
| BCI_CMD_RECT_XP | BCI_CMD_RECT_YP
+ | BCI_CMD_CLIP_LR
| BCI_CMD_DEST_SBD_NEW
| BCI_CMD_SRC_COLOR; /* host color data */
@@ -442,17 +444,21 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
BCI_SEND(BCI_X_Y(x, y));
BCI_SEND(BCI_W_H(w, h));
- for (i = 0; i < h; i++) {
- srcp = (CARD32 *)src;
- BCI_RESET;
- for (j = dwords; j > 0; j--) {
- CARD32 dw = *srcp;
- BCI_SEND(dw);
- srcp++;
+ srcp = (CARD32 *)src;
+ queue = 120 * 1024;
+ while (dwords) {
+ if (queue < 4) {
+ BCI_RESET;
+ queue = 120 * 1024;
}
- src += src_pitch;
+ BCI_SEND(*srcp);
+ queue -= 4;
+ dwords--;
+ srcp++;
}
+ exaWaitSync(pDst->drawable.pScreen);
+
return TRUE;
}