summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.com>2007-03-21 02:14:16 -0400
committerAlex Deucher <alex@botch2.com>2007-03-21 02:14:16 -0400
commit675ff8177852732c6e9d52464f34d5fe867ac67e (patch)
tree185dcda9a9fad9bf52eba16577051a44b7ac05c5
parentee7c53ae2b6e167dd4d6e813bc565e991f6b73e3 (diff)
Get Solid() working again
You have to send color EVERY time.
-rw-r--r--src/savage_bci.h6
-rw-r--r--src/savage_exa.c36
2 files changed, 28 insertions, 14 deletions
diff --git a/src/savage_bci.h b/src/savage_bci.h
index 833a55d..410925d 100644
--- a/src/savage_bci.h
+++ b/src/savage_bci.h
@@ -118,6 +118,12 @@
#define BCI_SET_REGISTER_COUNT(count) ((count) << 16)
#define BCI_BITPLANE_WRITE_MASK 0xD7
#define BCI_BITPLANE_READ_MASK 0xD8
+#define BCI_GBD_1 0xE0
+#define BCI_GBD_2 0xE1
+#define BCI_PBD_1 0xE2
+#define BCI_PBD_2 0xE3
+#define BCI_SBD_1 0xE4
+#define BCI_SBD_2 0xE5
#define BCI_W_H(w, h) ((((h) << 16) | (w)) & 0x0FFF0FFF)
#define BCI_X_Y(x, y) ((((y) << 16) | (x)) & 0x0FFF0FFF)
diff --git a/src/savage_exa.c b/src/savage_exa.c
index 59412ef..80cd58e 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -197,11 +197,11 @@ SavageEXAInit(ScreenPtr pScreen)
/* Composite not implemented yet */
/* savage3d series only have one tmu */
-#if 1
+#if 0
/* host data blit */
psav->EXADriverPtr->UploadToScreen = SavageUploadToScreen;
#endif
-#if 1
+#if 0
psav->EXADriverPtr->DownloadFromScreen = SavageDownloadFromScreen;
#endif
@@ -273,17 +273,22 @@ SavagePrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
{
ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
SavagePtr psav = SAVPTR(pScrn);
- int cmd;
+ int cmd, rop;
BCI_GET_PTR;
- /*ErrorF("in preparesolid\n");*/
+ /* HW seems to ignore alpha */
+ if (pPixmap->drawable.bitsPerPixel == 32)
+ return FALSE;
cmd = BCI_CMD_RECT
| BCI_CMD_RECT_XP | BCI_CMD_RECT_YP
- | BCI_CMD_DEST_PBD_NEW | BCI_CMD_SRC_SOLID
+ | BCI_CMD_DEST_PBD /*BCI_CMD_DEST_PBD_NEW*/
+ | BCI_CMD_SRC_SOLID
| BCI_CMD_SEND_COLOR;
-
- BCI_CMD_SET_ROP( cmd, SavageGetSolidROP(alu) );
+
+ rop = SavageGetSolidROP(alu);
+
+ BCI_CMD_SET_ROP( cmd, rop );
psav->pbd_offset = exaGetPixmapOffset(pPixmap);
psav->pbd_high = SavageSetBD(psav, pPixmap);
@@ -291,17 +296,18 @@ SavagePrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
psav->SavedBciCmd = cmd;
psav->SavedFgColor = fg;
- psav->WaitQueue(psav,6);
+ psav->WaitQueue(psav,5);
BCI_SEND(BCI_SET_REGISTER
| BCI_SET_REGISTER_COUNT(1)
| BCI_BITPLANE_WRITE_MASK);
BCI_SEND(planemask);
- BCI_SEND(psav->SavedBciCmd);
+ BCI_SEND(BCI_SET_REGISTER
+ | BCI_SET_REGISTER_COUNT(2)
+ | BCI_PBD_1);
BCI_SEND(psav->pbd_offset);
BCI_SEND(psav->pbd_high);
- BCI_SEND(psav->SavedFgColor);
return TRUE;
}
@@ -314,11 +320,13 @@ SavageSolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
int w = x2 - x1;
int h = y2 - y1;
BCI_GET_PTR;
-
- if( !w || !h )
- return;
- psav->WaitQueue(psav,2);
+ /* yes, it has to be done this way... */
+ psav->WaitQueue(psav,4);
+ BCI_SEND(psav->SavedBciCmd);
+ /*BCI_SEND(psav->pbd_offset);
+ BCI_SEND(psav->pbd_high);*/
+ BCI_SEND(psav->SavedFgColor);
BCI_SEND(BCI_X_Y(x1, y1));
BCI_SEND(BCI_W_H(w, h));