diff options
Diffstat (limited to 'hw/xfree86/xaa')
-rw-r--r-- | hw/xfree86/xaa/xaa.h | 40 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaFallback.c | 7 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInit.c | 18 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInitAccel.c | 10 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaOverlay.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPCache.c | 3 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPaintWin.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaPict.c | 109 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaROP.c | 19 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaStipple.c | 5 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaTEGlyph.c | 6 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaWideLine.c | 5 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaalocal.h | 41 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaarop.h | 6 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaawrap.h | 14 |
15 files changed, 240 insertions, 47 deletions
diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h index 98db3cf50..d4ff7bbd8 100644 --- a/hw/xfree86/xaa/xaa.h +++ b/hw/xfree86/xaa/xaa.h @@ -1278,6 +1278,10 @@ typedef struct _XAAInfoRec { GlyphPtr *glyphs ); + /* The old SetupForCPUToScreenAlphaTexture function is no longer used because + * it doesn't pass in enough information to write a conforming + * implementation. See SetupForCPUToScreenAlphaTexture2. + */ Bool (*SetupForCPUToScreenAlphaTexture) ( ScrnInfoPtr pScrn, int op, @@ -1304,6 +1308,10 @@ typedef struct _XAAInfoRec { int CPUToScreenAlphaTextureFlags; CARD32 * CPUToScreenAlphaTextureFormats; + /* The old SetupForCPUToScreenTexture function is no longer used because + * it doesn't pass in enough information to write a conforming + * implementation. See SetupForCPUToScreenTexture2. + */ Bool (*SetupForCPUToScreenTexture) ( ScrnInfoPtr pScrn, int op, @@ -1333,6 +1341,38 @@ typedef struct _XAAInfoRec { BoxRec SolidLineLimits; BoxRec DashedLineLimits; +#ifdef RENDER + /* These were added for X.Org 6.8.0 */ + Bool (*SetupForCPUToScreenAlphaTexture2) ( + ScrnInfoPtr pScrn, + int op, + CARD16 red, + CARD16 green, + CARD16 blue, + CARD16 alpha, + CARD32 maskFormat, + CARD32 dstFormat, + CARD8 *alphaPtr, + int alphaPitch, + int width, + int height, + int flags + ); + CARD32 *CPUToScreenAlphaTextureDstFormats; + + Bool (*SetupForCPUToScreenTexture2) ( + ScrnInfoPtr pScrn, + int op, + CARD32 srcFormat, + CARD32 dstFormat, + CARD8 *texPtr, + int texPitch, + int width, + int height, + int flags + ); + CARD32 *CPUToScreenTextureDstFormats; +#endif /* RENDER */ } XAAInfoRec, *XAAInfoRecPtr; #define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c index 6bc7bfed3..df67342ff 100644 --- a/hw/xfree86/xaa/xaaFallback.c +++ b/hw/xfree86/xaa/xaaFallback.c @@ -347,6 +347,7 @@ GCOps XAAFallbackOps = { {NULL} /* devPrivate */ }; - - - +GCOps *XAAGetFallbackOps(void) +{ + return &XAAFallbackOps; +} diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 186711e3f..f6f2d491e 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -40,11 +40,29 @@ static int XAASetDGAMode(int index, int num, DGADevicePtr devRet); static void XAAEnableDisableFBAccess (int index, Bool enable); static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask); +/* + * XXX These three should be static, but that breaks ABI compat with XF4.4 + * and Xorg 6.7.0 modules. DO NOT use them in new code, you should never + * be setting them, and you've got Get functions below. + */ int XAAScreenIndex = -1; int XAAGCIndex = -1; int XAAPixmapIndex = -1; + static unsigned long XAAGeneration = 0; +int XAAGetScreenIndex(void) { + return XAAScreenIndex; +} + +int XAAGetGCIndex(void) { + return XAAGCIndex; +} + +int XAAGetPixmapIndex(void) { + return XAAPixmapIndex; +} + /* temp kludge */ static Bool SwitchedOut = FALSE; diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c index 7233e215c..9d3764506 100644 --- a/hw/xfree86/xaa/xaaInitAccel.c +++ b/hw/xfree86/xaa/xaaInitAccel.c @@ -101,8 +101,8 @@ static XF86ModuleVersionInfo xaaVersRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, - 1, 1, 0, + XORG_VERSION_CURRENT, + 1, 2, 0, ABI_CLASS_VIDEODRV, /* requires the video driver ABI */ ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, @@ -1269,10 +1269,12 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) #ifdef RENDER { Bool haveTexture = infoRec->CPUToScreenTextureFormats && - infoRec->SetupForCPUToScreenTexture && + infoRec->CPUToScreenTextureDstFormats && + infoRec->SetupForCPUToScreenTexture2 && infoRec->SubsequentCPUToScreenTexture; Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats && - infoRec->SetupForCPUToScreenAlphaTexture && + infoRec->CPUToScreenAlphaTextureDstFormats && + infoRec->SetupForCPUToScreenAlphaTexture2 && infoRec->SubsequentCPUToScreenAlphaTexture; if(!infoRec->Composite && (haveTexture || haveAlphaTexture)) diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 42a9428c4..f0505a8b6 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.1.4.3.2.3 2004/03/04 20:16:48 kaleb Exp $ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.2 2004/04/23 19:54:16 eich Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14tsi Exp $ */ #include "misc.h" diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 25f8bd486..94790d21c 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -1653,7 +1653,8 @@ XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) return pCache; } - +XAACachePlanarMonoStippleProc +XAAGetCachePlanarMonoStipple(void) { return XAACachePlanarMonoStipple; } XAACacheInfoPtr XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg) diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c index 1cf6c3422..351d0e85f 100644 --- a/hw/xfree86/xaa/xaaPaintWin.c +++ b/hw/xfree86/xaa/xaaPaintWin.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.1.4.2.2.3 2004/03/04 20:16:48 kaleb Exp $ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.2 2004/04/23 19:54:16 eich Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.10 2001/10/28 03:34:04 tsi Exp $ */ #include "misc.h" diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index af3380231..12523e85f 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -172,6 +172,10 @@ XAA_888_plus_PICT_a8_to_8888 ( } } +#define DRAWABLE_IS_ON_CARD(pDraw) \ + (pDraw->type == DRAWABLE_WINDOW || \ + (pDraw->type == DRAWABLE_PIXMAP && IS_OFFSCREEN_PIXMAP(pDraw))) + Bool XAADoComposite ( CARD8 op, @@ -190,7 +194,7 @@ XAADoComposite ( ScreenPtr pScreen = pDst->pDrawable->pScreen; XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); RegionRec region; - CARD32 *formats; + CARD32 *formats, *dstformats; int flags = 0; BoxPtr pbox; int nbox, w, h; @@ -198,13 +202,10 @@ XAADoComposite ( if(!REGION_NUM_RECTS(pDst->pCompositeClip)) return TRUE; - if(!infoRec->pScrn->vtSema || - ((pDst->pDrawable->type != DRAWABLE_WINDOW) && - !IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) + if(!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable)) return FALSE; - if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) || - IS_OFFSCREEN_PIXMAP(pSrc->pDrawable)) + if(DRAWABLE_IS_ON_CARD(pSrc->pDrawable)) return FALSE; if (pSrc->transform || (pMask && pMask->transform)) @@ -279,7 +280,9 @@ XAADoComposite ( return TRUE; } - if(!(formats = infoRec->CPUToScreenAlphaTextureFormats)) + formats = infoRec->CPUToScreenAlphaTextureFormats; + dstformats = infoRec->CPUToScreenAlphaTextureDstFormats; + if(!formats || !dstformats) return FALSE; w = pMask->pDrawable->width; @@ -304,6 +307,11 @@ XAADoComposite ( if(!(*formats)) return FALSE; formats++; } + while(*dstformats != pDst->format) { + if(!(*dstformats)) + return FALSE; + dstformats++; + } if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, @@ -318,8 +326,9 @@ XAADoComposite ( return TRUE; } - if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn, - op, red, green, blue, alpha, pMask->format, + if(!(infoRec->SetupForCPUToScreenAlphaTexture2)(infoRec->pScrn, + op, red, green, blue, alpha, pMask->format, + pDst->format, ((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr, ((PixmapPtr)(pMask->pDrawable))->devKind, w, h, flags)) @@ -343,8 +352,10 @@ XAADoComposite ( REGION_UNINIT(pScreen, ®ion); return TRUE; } - } else { - if(!(formats = infoRec->CPUToScreenTextureFormats)) + } else { + formats = infoRec->CPUToScreenTextureFormats; + dstformats = infoRec->CPUToScreenTextureDstFormats; + if(!formats || !dstformats) return FALSE; w = pSrc->pDrawable->width; @@ -361,11 +372,15 @@ XAADoComposite ( flags |= XAA_RENDER_REPEAT; } - while(*formats != pSrc->format) { if(!(*formats)) return FALSE; formats++; } + while(*dstformats != pDst->format) { + if(!(*dstformats)) + return FALSE; + dstformats++; + } if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, @@ -380,8 +395,8 @@ XAADoComposite ( return TRUE; } - if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn, - op, pSrc->format, + if(!(infoRec->SetupForCPUToScreenTexture2)(infoRec->pScrn, + op, pSrc->format, pDst->format, ((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr, ((PixmapPtr)(pSrc->pDrawable))->devKind, w, h, flags)) @@ -411,6 +426,63 @@ XAADoComposite ( return FALSE; } +static void +XAACompositeSrcCopy (PicturePtr pSrc, + PicturePtr pDst, + INT16 xSrc, + INT16 ySrc, + INT16 xDst, + INT16 yDst, + CARD16 width, + CARD16 height) +{ + ScreenPtr pScreen = pDst->pDrawable->pScreen; + XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); + int i, nbox; + int xoff, yoff; + BoxPtr pbox; + DDXPointPtr pptSrc; + RegionRec region; + + xDst += pDst->pDrawable->x; + yDst += pDst->pDrawable->y; + xSrc += pSrc->pDrawable->x; + ySrc += pSrc->pDrawable->y; + + if (!miComputeCompositeRegion (®ion, pSrc, NULL, pDst, + xSrc, ySrc, 0, 0, xDst, yDst, + width, height)) + return; + + nbox = REGION_NUM_RECTS(®ion); + pbox = REGION_RECTS(®ion); + + if(!nbox) { + REGION_UNINIT(pScreen, ®ion); + return; + } + pptSrc = ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); + if (!pptSrc) { + REGION_UNINIT(pScreen, ®ion); + return; + } + xoff = xSrc - xDst; + yoff = ySrc - yDst; + for (i = 0; i < nbox; i++) { + pptSrc[i].x = pbox[i].x1 + xoff; + pptSrc[i].y = pbox[i].y1 + yoff; + } + + infoRec->ScratchGC.planemask = ~0L; + infoRec->ScratchGC.alu = GXcopy; + + XAADoBitBlt(pSrc->pDrawable, pDst->pDrawable, &infoRec->ScratchGC, ®ion, + pptSrc); + + DEALLOCATE_LOCAL(pptSrc); + REGION_UNINIT(pScreen, ®ion); + return; +} void XAAComposite (CARD8 op, @@ -430,7 +502,14 @@ XAAComposite (CARD8 op, XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAA_RENDER_PROLOGUE(pScreen, Composite); - if(!infoRec->Composite || + if((op == PictOpSrc) && !pMask && infoRec->pScrn->vtSema && + infoRec->ScreenToScreenBitBlt && + DRAWABLE_IS_ON_CARD(pSrc->pDrawable) && + DRAWABLE_IS_ON_CARD(pDst->pDrawable) && + !pSrc->transform && !pSrc->repeat && (pSrc->format == pDst->format)) + { + XAACompositeSrcCopy(pSrc, pDst, xSrc, ySrc, xDst, yDst, width, height); + } else if(!infoRec->Composite || !(*infoRec->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) diff --git a/hw/xfree86/xaa/xaaROP.c b/hw/xfree86/xaa/xaaROP.c index 70a7b1d7d..931740159 100644 --- a/hw/xfree86/xaa/xaaROP.c +++ b/hw/xfree86/xaa/xaaROP.c @@ -94,6 +94,25 @@ int XAAPatternROP_PM[16] = ROP_DPo }; +int XAAGetCopyROP(int i) +{ + return XAACopyROP[i]; +} + +int XAAGetCopyROP_PM(int i) +{ + return XAACopyROP_PM[i]; +} + +int XAAGetPatternROP(int i) +{ + return XAAPatternROP[i]; +} + +int XAAGetPatternROP_PM(int i) +{ + return XAAPatternROP_PM[i]; +} int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop) diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c index 8b111d1cf..66d3a81e3 100644 --- a/hw/xfree86/xaa/xaaStipple.c +++ b/hw/xfree86/xaa/xaaStipple.c @@ -15,8 +15,10 @@ static CARD32* StippleOver32_Inverted(CARD32*, CARD32*, int, int, int); #ifdef TRIPLE_BITS #define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc3) +#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc3) #else #define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc) +#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc) #endif StippleScanlineProcPtr stipple_scanline_func[6] = { @@ -28,6 +30,9 @@ StippleScanlineProcPtr stipple_scanline_func[6] = { StippleOver32_Inverted }; +StippleScanlineProcPtr *stipple_get_scanline_func(void) { + return stipple_scanline_func; +} #ifdef FIXEDBASE # define DEST(i) *dest diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c index 0fd572617..7a699fd1f 100644 --- a/hw/xfree86/xaa/xaaTEGlyph.c +++ b/hw/xfree86/xaa/xaaTEGlyph.c @@ -74,7 +74,7 @@ static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp, #endif #define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc) - +#define glyph_get_scanline_func EXPNAME(XAAGetGlyphScanlineFunc) GlyphScanlineFuncPtr glyph_scanline_func[32] = { @@ -125,6 +125,10 @@ GlyphScanlineFuncPtr glyph_scanline_func[32] = { DrawTETextScanlineGeneric, DrawTETextScanlineGeneric }; +GlyphScanlineFuncPtr *glyph_get_scanline_func(void) { + return glyph_scanline_func; +} + /******************************************************************** diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c index fedd8f44d..cbe5fe70f 100644 --- a/hw/xfree86/xaa/xaaWideLine.c +++ b/hw/xfree86/xaa/xaaWideLine.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */ - +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.3 2004/08/29 00:48:17 alanc Exp $ */ /* XAAPolylinesWideSolid does not maintain a span list and subsequently does @@ -15,7 +15,8 @@ Original mi code written by Keith Packard. */ #ifndef XFree86LOADER -#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) +#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) \ + || (defined(sun) && defined(__SVR4)) #include <math.h> #else #define _XOPEN_SOURCE /* to get prototype for hypot on some systems */ diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 04d8d154a..883e64d5b 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -727,6 +727,11 @@ extern CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32])( CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width ); +GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirstFixedBase(void); +GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirst(void); +GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirstFixedBase(void); +GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirst(void); + void XAAFillColorExpandRectsLSBFirst( ScrnInfoPtr pScrn, @@ -1046,6 +1051,11 @@ extern CARD32 *(*XAAStippleScanlineFuncLSBFirst[6])( CARD32* base, CARD32* src, int offset, int width, int dwords ); +StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirstFixedBase(void); +StippleScanlineProcPtr *XAAGetStippleScanlineFuncMSBFirst(void); +StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirstFixedBase(void); +StippleScanlineProcPtr *XAAGetStippleScanlineFuncLSBFirst(void); + int XAAPolyText8TEColorExpansion( DrawablePtr pDraw, @@ -1506,6 +1516,9 @@ XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix); XAACacheInfoPtr XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix); +typedef XAACacheInfoPtr (*XAACachePlanarMonoStippleProc)(ScrnInfoPtr, PixmapPtr); +XAACachePlanarMonoStippleProc XAAGetCachePlanarMonoStipple(void); + XAACacheInfoPtr XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg); @@ -1623,13 +1636,17 @@ XAAGetPixelFromRGBA ( ); #endif - +/* XXX should be static */ extern GCOps XAAFallbackOps; +extern GCOps *XAAGetFallbackOps(void); extern GCFuncs XAAGCFuncs; -extern int XAAScreenIndex; -extern int XAAGCIndex; -extern int XAAPixmapIndex; +extern int XAAScreenIndex; /* XXX DONTUSE */ +extern int XAAGCIndex; /* XXX DONTUSE */ +extern int XAAPixmapIndex; /* XXX DONTUSE */ +extern int XAAGetScreenIndex(void); +extern int XAAGetGCIndex(void); +extern int XAAGetPixmapIndex(void); extern unsigned int XAAShiftMasks[32]; @@ -1638,28 +1655,28 @@ extern unsigned int byte_expand3[256], byte_reversed_expand3[256]; CARD32 XAAReverseBitOrder(CARD32 data); #define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\ - (pScreen)->devPrivates[XAAScreenIndex].ptr + (pScreen)->devPrivates[XAAGetScreenIndex()].ptr #define GET_XAASCREENPTR_FROM_GC(pGC)\ - (pGC)->pScreen->devPrivates[XAAScreenIndex].ptr + (pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr #define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\ - (pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr + (pDraw)->pScreen->devPrivates[XAAGetScreenIndex()].ptr #define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\ - ((XAAScreenPtr)((pScreen)->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec + ((XAAScreenPtr)((pScreen)->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec #define GET_XAAINFORECPTR_FROM_GC(pGC)\ -((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec +((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec #define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\ -((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec +((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec #define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\ -((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec +((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec #define XAA_GET_PIXMAP_PRIVATE(pix)\ - (XAAPixmapPtr)((pix)->devPrivates[XAAPixmapIndex].ptr) + (XAAPixmapPtr)((pix)->devPrivates[XAAGetPixmapIndex()].ptr) #define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff)) diff --git a/hw/xfree86/xaa/xaarop.h b/hw/xfree86/xaa/xaarop.h index 048ed00fc..1c95727b3 100644 --- a/hw/xfree86/xaa/xaarop.h +++ b/hw/xfree86/xaa/xaarop.h @@ -299,9 +299,15 @@ int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop); int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop); +/* XXX These four should be static, but it breaks the 6.7.0 ABI. */ extern int XAACopyROP[16]; extern int XAACopyROP_PM[16]; extern int XAAPatternROP[16]; extern int XAAPatternROP_PM[16]; +extern int XAAGetCopyROP(int i); +extern int XAAGetCopyROP_PM(int i); +extern int XAAGetPatternROP(int i); +extern int XAAGetPatternROP_PM(int i); + #endif /* _XAAROP_H */ diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h index 59f0a2cc7..5e3e0e683 100644 --- a/hw/xfree86/xaa/xaawrap.h +++ b/hw/xfree86/xaa/xaawrap.h @@ -2,14 +2,14 @@ #define XAA_SCREEN_PROLOGUE(pScreen, field)\ ((pScreen)->field = \ - ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field) + ((XAAScreenPtr) (pScreen)->devPrivates[XAAGetScreenIndex()].ptr)->field) #define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\ ((pScreen)->field = wrapper) #define XAA_GC_FUNC_PROLOGUE(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;\ + XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGetGCIndex()].ptr;\ (pGC)->funcs = pGCPriv->wrapFuncs;\ if(pGCPriv->flags)\ (pGC)->ops = pGCPriv->wrapOps @@ -25,13 +25,13 @@ #define XAA_GC_OP_PROLOGUE(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\ + XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\ GCFuncs *oldFuncs = pGC->funcs;\ pGC->funcs = pGCPriv->wrapFuncs;\ pGC->ops = pGCPriv->wrapOps #define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\ + XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\ GCFuncs *oldFuncs = pGC->funcs;\ if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \ pGC->funcs = pGCPriv->wrapFuncs;\ @@ -45,7 +45,7 @@ #define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\ - XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\ + XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGetGCIndex()].ptr);\ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\ GCFuncs *oldFuncs = pGC->funcs;\ pGC->funcs = pGCPriv->wrapFuncs;\ @@ -61,7 +61,7 @@ #ifdef RENDER #define XAA_RENDER_PROLOGUE(pScreen,field)\ (GetPictureScreen(pScreen)->field = \ - ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field) + ((XAAScreenPtr) (pScreen)->devPrivates[XAAGetScreenIndex()].ptr)->field) #define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\ (GetPictureScreen(pScreen)->field = wrapper) @@ -71,7 +71,7 @@ #define SYNC_CHECK(pGC) {\ XAAInfoRecPtr infoRec =\ -((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec;\ +((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAGetScreenIndex()].ptr))->AccelInfoRec;\ if(infoRec->NeedToSync) {\ (*infoRec->Sync)(infoRec->pScrn);\ infoRec->NeedToSync = FALSE;\ |