diff options
Diffstat (limited to 'hw/kdrive/trident')
-rw-r--r-- | hw/kdrive/trident/trident.c | 10 | ||||
-rw-r--r-- | hw/kdrive/trident/trident.h | 16 | ||||
-rw-r--r-- | hw/kdrive/trident/tridentcurs.c | 31 | ||||
-rw-r--r-- | hw/kdrive/trident/tridentdraw.c | 63 | ||||
-rw-r--r-- | hw/kdrive/trident/tridentdraw.h | 7 | ||||
-rw-r--r-- | hw/kdrive/trident/tridentstub.c | 8 |
6 files changed, 74 insertions, 61 deletions
diff --git a/hw/kdrive/trident/trident.c b/hw/kdrive/trident/trident.c index 384800f78..db8b9ef8f 100644 --- a/hw/kdrive/trident/trident.c +++ b/hw/kdrive/trident/trident.c @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.c,v 1.1 1999/11/19 13:54:01 hohndel Exp $ */ #include "trident.h" #define extern @@ -86,6 +86,12 @@ tridentScreenInit (KdScreenInfo *screen) return TRUE; } +Bool +tridentInitScreen (ScreenPtr pScreen) +{ + return fbdevInitScreen (pScreen); +} + CARD8 tridentReadIndex (TridentCardInfo *tridentc, CARD16 port, CARD8 index) { @@ -255,6 +261,7 @@ tridentCardFini (KdCardInfo *card) KdCardFuncs tridentFuncs = { tridentCardInit, /* cardinit */ tridentScreenInit, /* scrinit */ + tridentInitScreen, /* initScreen */ tridentPreserve, /* preserve */ tridentEnable, /* enable */ tridentDPMS, /* dpms */ @@ -271,6 +278,7 @@ KdCardFuncs tridentFuncs = { tridentDrawInit, /* initAccel */ tridentDrawEnable, /* enableAccel */ + tridentDrawSync, /* syncAccel */ tridentDrawDisable, /* disableAccel */ tridentDrawFini, /* finiAccel */ diff --git a/hw/kdrive/trident/trident.h b/hw/kdrive/trident/trident.h index f726e0701..ea50448ef 100644 --- a/hw/kdrive/trident/trident.h +++ b/hw/kdrive/trident/trident.h @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.h,v 1.1 1999/11/19 13:54:01 hohndel Exp $ */ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ @@ -61,13 +61,22 @@ typedef struct _cop { #define COP_MULTI_TEXTURE_ADVANCED 0x20000000 #define COP_MULTI_MASK 0xf0000000 - #define COP_DEPTH_8 0x00000000 #define COP_DEPTH_16 0x00000001 #define COP_DEPTH_24_32 0x00000002 #define COP_DEPTH_15 0x00000005 #define COP_DEPTH_DITHER_DISABLE 0x00000008 + +#define COP_ALPHA_RESULT_ALPHA 0x00100000 +#define COP_ALPHA_DEST_ALPHA 0x00200000 +#define COP_ALPHA_SOURCE_ALPHA 0x00400000 +#define COP_ALPHA_WRITE_ENABLE 0x00800000 +#define COP_ALPHA_TEST_ENABLE 0x01000000 +#define COP_ALPHA_BLEND_ENABLE 0x02000000 +#define COP_ALPHA_DEST_VALUE 0x04000000 +#define COP_ALPHA_SOURCE_VALUE 0x08000000 + VOL32 command; /* 0x24 */ #define COP_OP_NULL 0x00000000 #define COP_OP_LINE 0x20000000 @@ -174,6 +183,9 @@ void tridentDrawEnable (ScreenPtr pScreen); void +tridentDrawSync (ScreenPtr pScreen); + +void tridentDrawDisable (ScreenPtr pScreen); void diff --git a/hw/kdrive/trident/tridentcurs.c b/hw/kdrive/trident/tridentcurs.c index 9c4ebb5d0..241b5bd1a 100644 --- a/hw/kdrive/trident/tridentcurs.c +++ b/hw/kdrive/trident/tridentcurs.c @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentcurs.c,v 1.1 1999/11/19 13:54:01 hohndel Exp $ */ #include "trident.h" #include "cursorstr.h" @@ -82,39 +82,14 @@ tridentMoveCursor (ScreenPtr pScreen, int x, int y) _tridentMoveCursor (pScreen, x, y); } - static void tridentAllocCursorColors (ScreenPtr pScreen) { SetupCursor (pScreen); CursorPtr pCursor = pCurPriv->pCursor; - xColorItem sourceColor, maskColor; - - /* - * Set these to an invalid pixel value so that - * when the store colors comes through, the cursor - * won't get recolored - */ - pCurPriv->source = ~0; - pCurPriv->mask = ~0; - /* - * XXX S3 bug workaround; s3 chip doesn't use RGB values from - * the cursor color registers as documented, rather it uses - * them to index the DAC. This is in the errata though. - */ - sourceColor.red = pCursor->foreRed; - sourceColor.green = pCursor->foreGreen; - sourceColor.blue = pCursor->foreBlue; - FakeAllocColor(pScreenPriv->pInstalledmap, &sourceColor); - maskColor.red = pCursor->backRed; - maskColor.green = pCursor->backGreen; - maskColor.blue = pCursor->backBlue; - FakeAllocColor(pScreenPriv->pInstalledmap, &maskColor); - FakeFreeColor(pScreenPriv->pInstalledmap, sourceColor.pixel); - FakeFreeColor(pScreenPriv->pInstalledmap, maskColor.pixel); - pCurPriv->source = sourceColor.pixel; - pCurPriv->mask = maskColor.pixel; + KdAllocateCursorPixels (pScreen, pCursor, + &pCurPriv->source, &pCurPriv->mask); switch (pScreenPriv->screen->bitsPerPixel) { case 4: pCurPriv->source |= pCurPriv->source << 4; diff --git a/hw/kdrive/trident/tridentdraw.c b/hw/kdrive/trident/tridentdraw.c index f64444c53..2bb4c5763 100644 --- a/hw/kdrive/trident/tridentdraw.c +++ b/hw/kdrive/trident/tridentdraw.c @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentdraw.c,v 1.1 1999/11/19 13:54:01 hohndel Exp $ */ #include "trident.h" #include "tridentdraw.h" @@ -84,7 +84,7 @@ tridentFillBoxSolid (DrawablePtr pDrawable, int nBox, BoxPtr pBox, _tridentRect(cop,pBox->x1,pBox->y1,pBox->x2-1,pBox->y2-1,cmd); pBox++; } - _tridentWaitIdleEmpty(cop); + KdMarkSync(pDrawable->pScreen); } void @@ -154,7 +154,7 @@ tridentCopyNtoN (DrawablePtr pSrcDrawable, cop->command = cmd; pbox++; } - _tridentWaitIdleEmpty(cop); + KdMarkSync(pDstDrawable->pScreen); } RegionPtr @@ -173,8 +173,8 @@ tridentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, srcx, srcy, width, height, dstx, dsty, tridentCopyNtoN, 0, 0); } - return fbCopyArea (pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, dstx, dsty); + return KdCheckCopyArea (pSrcDrawable, pDstDrawable, pGC, + srcx, srcy, width, height, dstx, dsty); } BOOL @@ -217,7 +217,7 @@ tridentFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, if (!tridentFillOk (pGC)) { - fbFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); + KdCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); return; } nTmp = n * miFindMaxBand(fbGetCompositeClip(pGC)); @@ -261,10 +261,10 @@ tridentFillSpans (DrawablePtr pDrawable, GCPtr pGC, int n, width = *pwidth++; if (width) { - _tridentRect(cop,x,y,x + width,y,cmd); + _tridentRect(cop,x,y,x + width - 1,y,cmd); } } - _tridentWaitIdleEmpty (cop); + KdMarkSync(pDrawable->pScreen); DEALLOCATE_LOCAL(pptFree); DEALLOCATE_LOCAL(pwidthFree); } @@ -291,7 +291,7 @@ tridentPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, if (!tridentFillOk (pGC)) { - fbPolyFillRect (pDrawable, pGC, nrectFill, prectInit); + KdCheckPolyFillRect (pDrawable, pGC, nrectFill, prectInit); return; } prgnClip = fbGetCompositeClip(pGC); @@ -491,7 +491,7 @@ tridentSolidBoxClipped (DrawablePtr pDrawable, _tridentRect(cop,partX1, partY1, partX2-1, partY2-1,cmd); } - _tridentWaitIdleEmpty(cop); + KdMarkSync(pDrawable->pScreen); } void @@ -527,7 +527,7 @@ tridentImageGlyphBlt (DrawablePtr pDrawable, depthMask = FbFullMask(pDrawable->depth); if ((pGC->planemask & depthMask) != depthMask) { - fbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); + KdCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); return; } glyph = 0; @@ -575,6 +575,8 @@ tridentImageGlyphBlt (DrawablePtr pDrawable, opaque = FALSE; } + KdCheckSync (pDrawable->pScreen); + ppci = ppciInit; while (nglyph--) { @@ -623,25 +625,25 @@ tridentImageGlyphBlt (DrawablePtr pDrawable, static const GCOps tridentOps = { tridentFillSpans, - fbSetSpans, - fbPutImage, + KdCheckSetSpans, + KdCheckPutImage, tridentCopyArea, - fbCopyPlane, - fbPolyPoint, - fbPolyLine, - fbPolySegment, + KdCheckCopyPlane, + KdCheckPolyPoint, + KdCheckPolylines, + KdCheckPolySegment, miPolyRectangle, - fbPolyArc, + KdCheckPolyArc, miFillPolygon, tridentPolyFillRect, - fbPolyFillArc, + KdCheckPolyFillArc, miPolyText8, miPolyText16, miImageText8, miImageText16, tridentImageGlyphBlt, - fbPolyGlyphBlt, - fbPushPixels, + KdCheckPolyGlyphBlt, + KdCheckPushPixels, #ifdef NEED_LINEHELPER ,NULL #endif @@ -657,7 +659,7 @@ tridentValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) if (pDrawable->type == DRAWABLE_WINDOW) pGC->ops = (GCOps *) &tridentOps; else - pGC->ops = (GCOps *) &fbGCOps; + pGC->ops = (GCOps *) &kdAsyncPixmapGCOps; } GCFuncs tridentGCFuncs = { @@ -778,13 +780,17 @@ tridentPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) #endif break; } - fbPaintWindow (pWin, pRegion, what); + KdCheckPaintWindow (pWin, pRegion, what); } Bool tridentDrawInit (ScreenPtr pScreen) { /* + * Hook up asynchronous drawing + */ + KdScreenInitAsync (pScreen); + /* * Replace various fb screen functions */ pScreen->CreateGC = tridentCreateGC; @@ -803,6 +809,7 @@ tridentDrawEnable (ScreenPtr pScreen) CARD32 base; CARD16 stride; CARD32 format; + CARD32 alpha; int tries; stride = pScreenPriv->screen->pixelStride; @@ -845,7 +852,7 @@ tridentDrawEnable (ScreenPtr pScreen) _tridentRect (cop, 0, 0, pScreenPriv->screen->width, pScreenPriv->screen->height, cmd); - _tridentWaitIdleEmpty (cop); + KdMarkSync (pScreen); } void @@ -857,3 +864,11 @@ void tridentDrawFini (ScreenPtr pScreen) { } + +void +tridentDrawSync (ScreenPtr pScreen) +{ + SetupTrident(pScreen); + + _tridentWaitIdleEmpty(cop); +} diff --git a/hw/kdrive/trident/tridentdraw.h b/hw/kdrive/trident/tridentdraw.h index 5fa64d2a7..7b61a4a3b 100644 --- a/hw/kdrive/trident/tridentdraw.h +++ b/hw/kdrive/trident/tridentdraw.h @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentdraw.h,v 1.1 1999/11/19 13:54:02 hohndel Exp $ */ #ifndef _TRIDENTDRAW_H_ #define _TRIDENTDRAW_H_ @@ -30,10 +30,13 @@ tridentCardInfo(pScreenPriv); \ Cop *cop = tridentc->cop +#define TridentAlpha (COP_MULTI_ALPHA|COP_ALPHA_WRITE_ENABLE) + #define _tridentInit(cop,tridentc) { \ if ((cop)->status == 0xffffffff) tridentSetMMIO(tridentc); \ (cop)->multi = (tridentc)->cop_depth; \ (cop)->multi = (tridentc)->cop_stride; \ + (cop)->multi = TridentAlpha; \ } \ #define _tridentSetSolidRect(cop,pix,alu,cmd) {\ @@ -56,7 +59,7 @@ #define _tridentWaitDone(cop) while ((cop)->status & COP_STATUS_BUSY) -#define _tridentWaitIdleEmpty(cop) _tridentWaitDone(cop); +#define _tridentWaitIdleEmpty(cop) _tridentWaitDone(cop) #define sourceInvarient(alu) (((alu) & 3) == (((alu) >> 2) & 3)) diff --git a/hw/kdrive/trident/tridentstub.c b/hw/kdrive/trident/tridentstub.c index b0005e7c7..74afe7200 100644 --- a/hw/kdrive/trident/tridentstub.c +++ b/hw/kdrive/trident/tridentstub.c @@ -22,7 +22,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentstub.c,v 1.1 1999/11/19 13:54:02 hohndel Exp $ */ #include "trident.h" @@ -47,8 +47,8 @@ InitInput (int argc, char **argv) KdInitInput (&Ps2MouseFuncs, &LinuxKeyboardFuncs); } -void -OsVendorInit (void) +int +ddxProcessArgument (int argc, char **argv, int i) { - KdOsInit (&LinuxFuncs); + return KdProcessArgument (argc, argv, i); } |