configure.ac | 2 man/savage.man | 19 +++++- src/savage_bci.h | 6 ++ src/savage_driver.c | 101 ++++++++++++++++++++++++++++++------ src/savage_driver.h | 8 +- src/savage_exa.c | 142 ++++++++++++++++++++++++++++++++++------------------ 6 files changed, 202 insertions(+), 76 deletions(-)
New commits: commit bf5e2a5d33fbab07bc3606927c58a3a04a5c9b1e Author: Julien Cristau <[EMAIL PROTECTED]> Date: Fri Aug 17 03:25:48 2007 +0200 Include <unistd.h> to get a declaration for usleep() diff --git a/src/savage_driver.c b/src/savage_driver.c index c56edf1..ab91bc4 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -39,6 +39,8 @@ #include "config.h" #endif +#include <unistd.h> + #include "xf86RAC.h" #include "shadowfb.h" commit 83f3db97b107a84d79e21c64039328c05095719e Author: Alex Deucher <[EMAIL PROTECTED]> Date: Thu Aug 16 20:45:12 2007 -0400 update for 2.1.3 release diff --git a/configure.ac b/configure.ac index 6566a57..42d447a 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-savage], - 2.1.2, + 2.1.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-savage) commit 1f6258c7f4c4073de0bdd72f06c1e94bb6895c73 Author: Brice Goglin <[EMAIL PROTECTED]> Date: Tue Aug 7 09:54:47 2007 +0200 Define SAVAGE_VERSION* using PACKAGE_VERSION* diff --git a/src/savage_driver.h b/src/savage_driver.h index 247dedb..06b3689 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -178,10 +178,10 @@ typedef struct #define SAVAGE_TV_ON 4 #define SAVAGE_DRIVER_NAME "savage" -#define SAVAGE_DRIVER_VERSION "2.1.2" -#define SAVAGE_VERSION_MAJOR 2 -#define SAVAGE_VERSION_MINOR 1 -#define SAVAGE_PATCHLEVEL 2 +#define SAVAGE_DRIVER_VERSION PACKAGE_VERSION +#define SAVAGE_VERSION_MAJOR PACKAGE_VERSION_MAJOR +#define SAVAGE_VERSION_MINOR PACKAGE_VERSION_MINOR +#define SAVAGE_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL #define SAVAGE_VERSION ((SAVAGE_VERSION_MAJOR << 24) | \ (SAVAGE_VERSION_MINOR << 16) | \ SAVAGE_PATCHLEVEL) commit b706ffe07fc61281d2dea406f828418f42e3da85 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Thu Jul 12 00:03:13 2007 -0400 Unmap mem before freeing driverPrivate diff --git a/src/savage_driver.c b/src/savage_driver.c index 84b9fcd..c56edf1 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -766,9 +766,9 @@ static void SavageFreeRec(ScrnInfoPtr pScrn) TRACE(( "SavageFreeRec(%x)\n", pScrn->driverPrivate )); if (!pScrn->driverPrivate) return; + SavageUnmapMem(pScrn, 1); xfree(pScrn->driverPrivate); pScrn->driverPrivate = NULL; - SavageUnmapMem(pScrn, 1); } commit fab88bce3b9f19918bbf1a2b0f57d34113c8381f Author: Alex Deucher <[EMAIL PROTECTED]> Date: Wed Jul 11 23:40:51 2007 -0400 Add panel native mode automatically. Based on Henry Zhao's code from nv diff --git a/src/savage_driver.c b/src/savage_driver.c index 98ea08e..84b9fcd 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -936,6 +936,63 @@ static void SavageDoDDC(ScrnInfoPtr pScrn) } } +/* Copied from ddc/Property.c via nv */ +static DisplayModePtr +SavageModesAdd(DisplayModePtr Modes, DisplayModePtr Additions) +{ + if (!Modes) { + if (Additions) + return Additions; + else + return NULL; + } + + if (Additions) { + DisplayModePtr Mode = Modes; + + while (Mode->next) + Mode = Mode->next; + + Mode->next = Additions; + Additions->prev = Mode; + } + + return Modes; +} + +/* borrowed from nv */ +static void +SavageAddPanelMode(ScrnInfoPtr pScrn) +{ + SavagePtr psav= SAVPTR(pScrn); + DisplayModePtr Mode = NULL; + + Mode = xf86CVTMode(psav->PanelX, psav->PanelY, 60.00, TRUE, FALSE); + Mode->type = M_T_DRIVER | M_T_PREFERRED; + pScrn->monitor->Modes = SavageModesAdd(pScrn->monitor->Modes, Mode); + + if ((pScrn->monitor->nHsync == 0) && + (pScrn->monitor->nVrefresh == 0)) { + if (!Mode->HSync) + Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); + if (!Mode->VRefresh) + Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / + ((float) (Mode->HTotal * Mode->VTotal)); + + if (Mode->HSync < pScrn->monitor->hsync[0].lo) + pScrn->monitor->hsync[0].lo = Mode->HSync; + if (Mode->HSync > pScrn->monitor->hsync[0].hi) + pScrn->monitor->hsync[0].hi = Mode->HSync; + if (Mode->VRefresh < pScrn->monitor->vrefresh[0].lo) + pScrn->monitor->vrefresh[0].lo = Mode->VRefresh; + if (Mode->VRefresh > pScrn->monitor->vrefresh[0].hi) + pScrn->monitor->vrefresh[0].hi = Mode->VRefresh; + + pScrn->monitor->nHsync = 1; + pScrn->monitor->nVrefresh = 1; + } +} + static void SavageGetPanelInfo(ScrnInfoPtr pScrn) { SavagePtr psav= SAVPTR(pScrn); @@ -1952,6 +2009,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) if(psav->DisplayType == MT_LCD) { SavageGetPanelInfo(pScrn); + SavageAddPanelMode(pScrn); } #if 0 commit b126b204d3465700e8c6a1fcc4770f322c8bb7db Author: Tormod Volden <[EMAIL PROTECTED]> Date: Wed Jul 11 21:25:30 2007 -0400 Add "DRI" option to enable/disable DRI support fixes bug 10746 diff --git a/man/savage.man b/man/savage.man index 9e8dd27..e5d3d27 100644 --- a/man/savage.man +++ b/man/savage.man @@ -221,6 +221,10 @@ on an AGP card the AGP bus speed is not set and no AGP aperture is allocated. This implies .BI DmaType \*qPCI\*q. +.TP +.BI "Option \*qDRI\*q \*q" boolean \*q +Enable DRI support. This option allows you to enable or disable the DRI. +Default: \*qon\*q (enable DRI). .SH FILES savage_drv.o .SH "SEE ALSO" diff --git a/src/savage_driver.c b/src/savage_driver.c index 1ed7782..98ea08e 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -245,6 +245,7 @@ typedef enum { ,OPTION_DMA_MODE ,OPTION_AGP_MODE ,OPTION_AGP_SIZE + ,OPTION_DRI } SavageOpts; @@ -277,6 +278,7 @@ static const OptionInfoRec SavageOptions[] = { OPTION_DMA_MODE, "DmaMode", OPTV_ANYSTR, {0}, FALSE }, { OPTION_AGP_MODE, "AGPMode", OPTV_INTEGER, {0}, FALSE }, { OPTION_AGP_SIZE, "AGPSize", OPTV_INTEGER, {0}, FALSE }, + { OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE }, #endif { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -3120,8 +3122,12 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, vgaHWBlankScreen(pScrn, TRUE); #ifdef XF86DRI - if (psav->IsSecondary) { - psav->directRenderingEnabled = FALSE; + if (!xf86ReturnOptValBool(psav->Options, OPTION_DRI, TRUE)) { + psav->directRenderingEnabled = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Direct rendering forced off\n"); + } else if (psav->IsSecondary) { + psav->directRenderingEnabled = FALSE; } else if (xf86IsEntityShared(psav->pEnt->index)) { /* Xinerama has sync problem with DRI, disable it for now */ psav->directRenderingEnabled = FALSE; commit 90692b3a123861ca02100f86b4c80f070fd4196d Author: Alex Deucher <[EMAIL PROTECTED]> Date: Wed Jul 11 21:07:47 2007 -0400 fix segfault in SavageDoAdjustFrame() on server 1.3 tracked down by Tormod Volden, fixes bug 10934 diff --git a/src/savage_driver.c b/src/savage_driver.c index 27cf8ad..1ed7782 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3911,7 +3911,6 @@ void SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2) { SavagePtr psav = SAVPTR(pScrn); - DisplayModePtr currentMode = pScrn->currentMode; int address=0,top=0,left=0,tile_height,tile_size; TRACE(("SavageDoAdjustFrame(%d,%d,%x)\n", x, y, flags)); @@ -3942,15 +3941,6 @@ SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2) address += pScrn->fbOffset; - /* - * because we align the viewport to the width and height of one tile - * we should update the locate of frame - */ - pScrn->frameX0 = left; - pScrn->frameY0 = top; - pScrn->frameX1 = left + currentMode->HDisplay - 1; - pScrn->frameY1 = top + currentMode->VDisplay - 1; - if (psav->Chipset == S3_SAVAGE_MX) { if (!crtc2) { OUTREG32(PRI_STREAM_FBUF_ADDR0, address & 0xFFFFFFFC); commit 7832dcd82046238d5accb55468c65241f0edc6d0 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Wed Jul 11 21:01:03 2007 -0400 fix console corruption due to invalid shadow status tracked down by Tormod Volden, fixes bug 11237 diff --git a/src/savage_driver.c b/src/savage_driver.c index 6ffe772..27cf8ad 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3834,6 +3834,8 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen) #ifdef XF86DRI if (psav->directRenderingEnabled) { SAVAGEDRICloseScreen(pScreen); + /* reset shadow values */ + SavageInitShadowStatus(pScrn); psav->directRenderingEnabled=FALSE; } #endif commit 8dd310538df11cc5ff4e8e84920218b819bbae47 Author: David Nusinow <[EMAIL PROTECTED]> Date: Wed Jul 11 20:00:25 2007 -0400 disable randr when savage rotation is enabled fixes bug 7899 diff --git a/man/savage.man b/man/savage.man index 721c6b8..9e8dd27 100644 --- a/man/savage.man +++ b/man/savage.man @@ -95,13 +95,18 @@ possibly unstable. The default is .BI "Option \*qRotate\*q \*qCW\*q" .TP .BI "Option \*qRotate\*q \*qCCW\*q" -Rotate the desktop 90 degrees clockwise or counterclockwise. This option -forces the ShadowFB option on, and disables acceleration. +Rotate the desktop 90 degrees clockwise or counterclockwise. +This option forces the ShadowFB option on, and disables acceleration and +the RandR extension. Default: no rotation. .TP .BI "Option \*qShadowFB\*q \*q" boolean \*q -Enable or disable use of the shadow framebuffer layer. This option -disables acceleration. Default: off. +Enable or disable use of the shadow framebuffer layer. +.\" See +.\" .BR shadowfb (__drivermansuffix__) +.\" for further information. +This option disables acceleration. +Default: off. .TP .BI "Option \*qLCDClock\*q \*q" frequency \*q Override the maximum dot clock. Some LCD panels produce incorrect results if diff --git a/src/savage_driver.c b/src/savage_driver.c index 2c51770..6ffe772 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -1165,15 +1165,23 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) if ((s = xf86GetOptValString(psav->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ + /* RandR is disabled when the Rotate option is used (does + * not work well together and scrambles the screen) */ + psav->shadowFB = TRUE; psav->rotate = 1; + xf86DisableRandR(); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Rotating screen clockwise - acceleration disabled\n"); + "Rotating screen clockwise" + "- acceleration and RandR disabled\n"); } else if(!xf86NameCmp(s, "CCW")) { psav->shadowFB = TRUE; psav->rotate = -1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen" - "counter clockwise - acceleration disabled\n"); + xf86DisableRandR(); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Rotating screen counter clockwise" + " - acceleration and RandR disabled\n"); + } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" "value for Option \"Rotate\"\n", s); commit 4b2a0ad8f15e7b11f7c8251fb032b9df4f07ce96 Author: Nate Bargmann <[EMAIL PROTECTED]> Date: Sat May 5 13:35:02 2007 +0200 Fixed a markup error. diff --git a/man/savage.man b/man/savage.man index 935b0fc..721c6b8 100644 --- a/man/savage.man +++ b/man/savage.man @@ -80,7 +80,7 @@ Default: hardware cursor. .TP .BI "Option \*qNoAccel\*q \*q" boolean \*q Disable or enable acceleration. Default: acceleration is enabled. -TP +.TP .BI "Option \*qAccelMethod\*q \*q" "string" \*q Chooses between available acceleration architectures. Valid options are .B XAA commit ff0ee0420bd7c0c1be5bf97e8764f3e974ff5887 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Mon Apr 2 17:32:02 2007 -0400 final odds and ends for exa I still get blue for solids that should be grey for certain things (firefox status and navigation bars, certain mouse overs, etc.) diff --git a/src/savage_exa.c b/src/savage_exa.c index 80cd58e..aa6905a 100644 --- a/src/savage_exa.c +++ b/src/savage_exa.c @@ -197,7 +197,7 @@ SavageEXAInit(ScreenPtr pScreen) /* Composite not implemented yet */ /* savage3d series only have one tmu */ -#if 0 +#if 1 /* host data blit */ psav->EXADriverPtr->UploadToScreen = SavageUploadToScreen; #endif @@ -283,10 +283,40 @@ SavagePrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) cmd = BCI_CMD_RECT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_PBD /*BCI_CMD_DEST_PBD_NEW*/ - | BCI_CMD_SRC_SOLID - | BCI_CMD_SEND_COLOR; + | BCI_CMD_SRC_SOLID; + +#if 0 + if (alu == 3 /*GXcopy*/) { + if (fg == 0) + alu = 0 /*GXclear*/; + else if (fg == planemask) + alu = 15 /*GXset*/; + } + if (EXA_PM_IS_SOLID(&pPixmap->drawable, planemask)) { + if (!((alu == 5 /*GXnoop*/) || (alu == 15 /*GXset*/) || (alu == 0 /*GXclear*/) || (alu == 10 /*GXinvert*/))) + cmd |= BCI_CMD_SEND_COLOR; + rop = SavageGetCopyROP(alu); + } else { + switch(alu) { + case 5 /*GXnoop*/: + break; + case 15 /*GXset*/: + case 0 /*GXclear*/: + case 10 /*GXinvert*/: + cmd |= BCI_CMD_SEND_COLOR; + fg = planemask; + break; + default: + cmd |= BCI_CMD_SEND_COLOR; + break; + } + rop = SavageGetSolidROP(alu); + } +#else + cmd |= BCI_CMD_SEND_COLOR; rop = SavageGetSolidROP(alu); +#endif BCI_CMD_SET_ROP( cmd, rop ); @@ -326,6 +356,10 @@ SavageSolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) BCI_SEND(psav->SavedBciCmd); /*BCI_SEND(psav->pbd_offset); BCI_SEND(psav->pbd_high);*/ +#if 0 + if ( psav->SavedBciCmd & BCI_CMD_SEND_COLOR ) + BCI_SEND(psav->SavedFgColor); +#endif BCI_SEND(psav->SavedFgColor); BCI_SEND(BCI_X_Y(x1, y1)); BCI_SEND(BCI_W_H(w, h)); @@ -465,7 +499,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int srcp++; } - exaWaitSync(pDst->drawable.pScreen); + /*exaWaitSync(pDst->drawable.pScreen);*/ return TRUE; } commit 675ff8177852732c6e9d52464f34d5fe867ac67e Author: Alex Deucher <[EMAIL PROTECTED]> Date: Wed Mar 21 02:14:16 2007 -0400 Get Solid() working again You have to send color EVERY time. 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)); commit ee7c53ae2b6e167dd4d6e813bc565e991f6b73e3 Author: Alex Deucher <[EMAIL PROTECTED]> Date: Tue Mar 6 02:28:33 2007 -0500 small exa fix ups, remove an errant comment 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; } -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]