diff options
author | Adam Jackson <ajax@nwnk.net> | 2004-07-30 20:30:57 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2004-07-30 20:30:57 +0000 |
commit | 48514fee3c8ec26f36e142ffc9272e510b9a4238 (patch) | |
tree | 2f0aaa0b3861f7ace00d2c1f5d0bc6a5e0ab8e93 /hw/xfree86 | |
parent | 29012adb37c533f57c684ad94c4d83a6c31793e5 (diff) |
Bug #400 (partial): Driver fixes for the dlloader. When using dlloader, all
framebuffer formats except cfb and the overlay modes should work, and
r128 and radeon need to be loaded from the ati driver (both issues to
be fixed soon). Tested on i740, s3virge, mach64, tdfx, vesa, and vga
drivers. elfloader users shouldn't be affected.
Diffstat (limited to 'hw/xfree86')
31 files changed, 157 insertions, 85 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 6a8aafea7..19fb05954 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -880,3 +880,12 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode) return TRUE; } + +void +fbdevHWFillInScreenInfo(ScrnInfoPtr pScrn) { + pScrn->SwitchMode = fbdevHWSwitchMode; + pScrn->AdjustFrame = fbdevHWAdjustFrame; + pScrn->EnterVT = fbdevHWEnterVT; + pScrn->LeaveVT = fbdevHWLeaveVT; + pScrn->ValidMode = fbdevHWValidMode; +} diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h index 219ca07d3..3d881220f 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.h +++ b/hw/xfree86/fbdevhw/fbdevhw.h @@ -49,4 +49,6 @@ void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags); Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode); +void fbdevHWFillInScreenInfo(ScrnInfoPtr pScrn); + #endif 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/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/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 04d8d154a..9075752d9 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -1623,13 +1623,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 +1642,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;\ diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h index a29332497..7b8dfa30d 100644 --- a/hw/xfree86/xf1bpp/mfbmap.h +++ b/hw/xfree86/xf1bpp/mfbmap.h @@ -34,13 +34,20 @@ #define mfbDoBitbltGeneral xf1bppDoBitbltGeneral #define mfbDoBitbltOr xf1bppDoBitbltOr #define mfbDoBitbltXor xf1bppDoBitbltXor +#define mfbFillInScreen xf1bppFillInScreen #define mfbFillPolyBlack xf1bppFillPolyBlack #define mfbFillPolyInvert xf1bppFillPolyInvert #define mfbFillPolyWhite xf1bppFillPolyWhite #define mfbGCPrivateIndex xf1bppGCPrivateIndex +#define mfbGetGCPrivateIndex xf1bppGetGCPrivateIndex #define mfbGetImage xf1bppGetImage #define mfbGetSpans xf1bppGetSpans #define mfbGetWindowPixmap xf1bppGetWindowPixmap +#define mfbGetWindowPrivateIndex xf1bppGetWindowPrivateIndex +#define mfbGetmask xf1bppGetmask +#define mfbGetrmask xf1bppGetrmask +#define mfbGetstarttab xf1bppGetstarttab +#define mfbGetendtab xf1bppGetendtab #define mfbHorzS xf1bppHorzS #define mfbImageGlyphBltBlack xf1bppImageGlyphBltBlack #define mfbImageGlyphBltWhite xf1bppImageGlyphBltWhite diff --git a/hw/xfree86/xf4bpp/mfbbres.c b/hw/xfree86/xf4bpp/mfbbres.c index 82b17e59e..ae9df6e10 100644 --- a/hw/xfree86/xf4bpp/mfbbres.c +++ b/hw/xfree86/xf4bpp/mfbbres.c @@ -79,8 +79,8 @@ int len; /* length of line */ register PixelType *addrl; /* bitmask long pointer *dont* * cast to char pointer */ register PixelType bit; /* current bit being set/cleared/etc. */ - PixelType leftbit = mask[0]; /* leftmost bit to process in new word */ - PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */ + PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ + PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ register int e3 = e2-e1; @@ -88,7 +88,7 @@ int len; /* length of line */ addrl = mfbScanline(addrlbase, x1, y1, nlwidth); yinc = signdy * nlwidth; e = e-e1; /* to make looping easier */ - bit = mask[x1 & PIM]; + bit = mfbGetmask(x1 & PIM); if (!len) return; diff --git a/hw/xfree86/xf4bpp/mfbbresd.c b/hw/xfree86/xf4bpp/mfbbresd.c index 29b816a3a..0f320ebc6 100644 --- a/hw/xfree86/xf4bpp/mfbbresd.c +++ b/hw/xfree86/xf4bpp/mfbbresd.c @@ -102,8 +102,8 @@ int len; /* length of line */ register PixelType *addrl; register int e3 = e2-e1; register unsigned long bit; - PixelType leftbit = mask[0]; /* leftmost bit to process in new word */ - PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */ + PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ + PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ int dashIndex; int dashOffset; int dashRemaining; @@ -125,7 +125,7 @@ int len; /* length of line */ addrl = mfbScanline(addrlbase, x1, y1, nlwidth); yinc = signdy * nlwidth; e = e-e1; /* to make looping easier */ - bit = mask[x1 & PIM]; + bit = mfbGetmask(x1 & PIM); if (axis == X_AXIS) { if (signdx > 0) diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c index 5d677174d..c3f62cb64 100644 --- a/hw/xfree86/xf4bpp/mfbfillarc.c +++ b/hw/xfree86/xf4bpp/mfbfillarc.c @@ -252,7 +252,7 @@ xf4bppPolyFillArcSolid mfbPrivGC *priv; int rop; - priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr; + priv = (mfbPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr; rop = priv->rop; if ((rop == RROP_NOP) || !(pGC->planemask & 1)) #else diff --git a/hw/xfree86/xf4bpp/mfbhrzvert.c b/hw/xfree86/xf4bpp/mfbhrzvert.c index c53edd19d..0e5594356 100644 --- a/hw/xfree86/xf4bpp/mfbhrzvert.c +++ b/hw/xfree86/xf4bpp/mfbhrzvert.c @@ -128,6 +128,6 @@ register int len; /* length of line */ len = -len; } - bitmask = mask[x1 & PIM]; + bitmask = mfbGetmask(x1 & PIM); Duff(len, UPDRW(addrl,bitmask); addrl += nlwidth); } diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c index b4f5bd014..95d7a7fcb 100644 --- a/hw/xfree86/xf4bpp/mfbimggblt.c +++ b/hw/xfree86/xf4bpp/mfbimggblt.c @@ -148,7 +148,7 @@ xf4bppImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr; + pPrivGC = pGC->devPrivates[mfbGetGCPrivateIndex()].ptr; oldfillStyle = pPrivGC->colorRrop.fillStyle; /* GJA */ oldfg = pPrivGC->colorRrop.fgPixel; /* GJA */ oldalu = pPrivGC->colorRrop.alu; /* GJA */ @@ -243,7 +243,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) /* UNCLEAN CODE we know the mfbPolyFillRect uses only three fields in - devPrivate[mfbGCPrivateIndex].ptr, two of which (the rotated + devPrivate[mfbGetGCPrivateIndex()].ptr, two of which (the rotated tile/stipple and the ropFillArea) are irrelevant for solid filling, so we just poke the FillArea field. the GC is now in an inconsistent state, but we'll fix @@ -253,7 +253,7 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) NOTE: if you are not using the standard mfbFillRectangle code, you need to poke any fields in the GC the rectangle stuff need - (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGCPrivateIndex].ptr + (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGetGCPrivateIndex()].ptr (probably rop or ropFillArea.) You could just call ValidateGC, but that is usually not a cheap thing to do. */ diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c index b200a611e..356028b8c 100644 --- a/hw/xfree86/xf4bpp/mfbline.c +++ b/hw/xfree86/xf4bpp/mfbline.c @@ -466,9 +466,9 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit) PixelType _mask; if (alu == RROP_BLACK) - _mask = rmask[x2 & PIM]; + _mask = mfbGetrmask(x2 & PIM); else - _mask = mask[x2 & PIM]; + _mask = mfbGetmask(x2 & PIM); nbox = nboxInit; pbox = pboxInit; @@ -797,7 +797,7 @@ dontStep: ; { unsigned long _mask; - _mask = mask[x2 & PIM]; + _mask = mfbGetmask(x2 & PIM); addrl = mfbScanline(addrl, x2, y2, nlwidth); UPDRW(addrl,_mask); break; diff --git a/hw/xfree86/xf4bpp/mfbzerarc.c b/hw/xfree86/xf4bpp/mfbzerarc.c index 106fc6ae5..4853f8807 100644 --- a/hw/xfree86/xf4bpp/mfbzerarc.c +++ b/hw/xfree86/xf4bpp/mfbzerarc.c @@ -108,7 +108,7 @@ v16ZeroArcSS int pmask; register int *paddr; - if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop == + if (((mfbPrivGC *)(pGC->devPrivates[mfbGetGCPrivateIndex()].ptr))->rop == RROP_BLACK) pixel = 0; else diff --git a/hw/xfree86/xf4bpp/ppcArea.c b/hw/xfree86/xf4bpp/ppcArea.c index 0d1a2075b..663672878 100644 --- a/hw/xfree86/xf4bpp/ppcArea.c +++ b/hw/xfree86/xf4bpp/ppcArea.c @@ -47,7 +47,7 @@ int alu ; unsigned long int fg, bg, pm ; int xSrc, ySrc ; PixmapPtr pPixmap ; -ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr; +ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGetGCPrivateIndex()].ptr; TRACE( ( "xf4bppFillArea(0x%x,%d,0x%x,0x%x)\n", pWin, nboxes, pBox, pGC ) ) ; diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c index bbc64c97c..881dfbf05 100644 --- a/hw/xfree86/xf4bpp/ppcGC.c +++ b/hw/xfree86/xf4bpp/ppcGC.c @@ -184,7 +184,7 @@ register GCPtr pGC ; * a pointer to a ppcPrivGC in its slot. */ *pPriv = vgaPrototypeGCPriv; - (pGC->devPrivates[mfbGCPrivateIndex].ptr) = (pointer) pPriv; + (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr) = (pointer) pPriv; /* Set the vgaGCOps */ *pOps = vgaGCOps; @@ -210,7 +210,7 @@ xf4bppDestroyGC( pGC ) if ( pGC->freeCompClip && pGC->pCompositeClip ) REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); if(pGC->ops->devPrivate.val) xfree( pGC->ops ); - xfree( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ; + xfree( pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ; return ; } @@ -221,7 +221,7 @@ ppcChangePixmapGC register Mask changes ) { -register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ; +register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ; register unsigned long int idx ; /* used for stepping through bitfields */ #define LOWBIT( x ) ( x & - x ) /* Two's complement */ @@ -303,7 +303,7 @@ xf4bppValidateGC( pGC, changes, pDrawable ) register ppcPrivGCPtr devPriv ; WindowPtr pWin ; - devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ; + devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ; if ( pDrawable->type != devPriv->lastDrawableType ) { devPriv->lastDrawableType = pDrawable->type ; diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c index 02019b19a..6b6fb1c09 100644 --- a/hw/xfree86/xf4bpp/ppcIO.c +++ b/hw/xfree86/xf4bpp/ppcIO.c @@ -209,22 +209,16 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware; pScreen-> DestroyWindow = xf4bppDestroyWindow; pScreen-> PositionWindow = xf4bppPositionWindow; - pScreen-> ChangeWindowAttributes = mfbChangeWindowAttributes; - pScreen-> RealizeWindow = mfbMapWindow; - pScreen-> UnrealizeWindow = mfbUnmapWindow; pScreen-> PaintWindowBackground = xf4bppPaintWindow; pScreen-> PaintWindowBorder = xf4bppPaintWindow; pScreen-> CopyWindow = xf4bppCopyWindow; pScreen-> CreatePixmap = xf4bppCreatePixmap; - pScreen-> DestroyPixmap = mfbDestroyPixmap; pScreen-> SaveDoomedAreas = (SaveDoomedAreasProcPtr)NoopDDA; pScreen-> RestoreAreas = (RestoreAreasProcPtr)NoopDDA; pScreen-> ExposeCopy = (ExposeCopyProcPtr)NoopDDA; pScreen-> TranslateBackingStore = (TranslateBackingStoreProcPtr)NoopDDA; pScreen-> ClearBackingStore = (ClearBackingStoreProcPtr)NoopDDA; pScreen-> DrawGuarantee = (DrawGuaranteeProcPtr)NoopDDA; - pScreen-> RealizeFont = mfbRealizeFont; - pScreen-> UnrealizeFont = mfbUnrealizeFont; pScreen-> CreateGC = xf4bppCreateGC; pScreen-> CreateColormap = xf4bppInitializeColormap; pScreen-> DestroyColormap = (DestroyColormapProcPtr)NoopDDA; @@ -233,7 +227,7 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> ListInstalledColormaps = miListInstalledColormaps; pScreen-> StoreColors = (StoreColorsProcPtr)NoopDDA; pScreen-> ResolveColor = xf4bppResolveColor; - pScreen-> BitmapToRegion = mfbPixmapToRegion; + mfbFillInScreen(pScreen); if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL)) return FALSE; diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c index 66b547e59..957a88135 100644 --- a/hw/xfree86/xf4bpp/ppcPixFS.c +++ b/hw/xfree86/xf4bpp/ppcPixFS.c @@ -122,7 +122,7 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; n = nInit * miFindMaxBand(pGC->pCompositeClip) ; @@ -140,8 +140,8 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit, ppt, pwidth, fSorted ) ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ; for ( ; n-- ; ppt++, pwidth++ ) { @@ -257,14 +257,14 @@ int fSorted ; return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, pptFree, pwidth, ppt, fSorted ) ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; pTile = pGC->stipple ; tlwidth = pTile->devKind ; @@ -356,15 +356,15 @@ int fSorted ; return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, pptFree, pwidth, ppt, fSorted ) ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; - bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; + bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.bgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ; pTile = pGC->stipple ; @@ -459,14 +459,14 @@ int fSorted ; return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, pptFree, pwidth, ppt, fSorted ) ; /* the following code is for 8 bits per pixel addressable memory only */ - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ; pTile = pGC->tile.pixmap ; tileWidth = pTile->drawable.width ; diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c index 65ff055d2..f68dbdc19 100644 --- a/hw/xfree86/xf4bpp/ppcPntWin.c +++ b/hw/xfree86/xf4bpp/ppcPntWin.c @@ -98,7 +98,7 @@ xf4bppPaintWindow(pWin, pRegion, what) { register mfbPrivWin *pPrivWin; - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); + pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr); TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n", pWin,pRegion,what)); diff --git a/hw/xfree86/xf4bpp/ppcPolyPnt.c b/hw/xfree86/xf4bpp/ppcPolyPnt.c index 736d128c6..568902925 100644 --- a/hw/xfree86/xf4bpp/ppcPolyPnt.c +++ b/hw/xfree86/xf4bpp/ppcPolyPnt.c @@ -100,7 +100,7 @@ if ( pDrawable->type == DRAWABLE_PIXMAP ) { return ; } -devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ; +devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGetGCPrivateIndex()].ptr ) ; if ( ( alu = devPriv->colorRrop.alu ) == GXnoop ) return ; diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c index ff59fccff..d7fd6b790 100644 --- a/hw/xfree86/xf4bpp/ppcWinFS.c +++ b/hw/xfree86/xf4bpp/ppcWinFS.c @@ -94,7 +94,7 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; n = nInit * miFindMaxBand( pGC->pCompositeClip ) ; @@ -112,8 +112,8 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit, ppt, pwidth, fSorted ) ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; for ( ; n-- ; ppt++, pwidth++ ) if ( *pwidth ) @@ -161,14 +161,14 @@ int fSorted ; return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, pptFree, pwidth, ppt, fSorted ) ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; xSrc = pGC->patOrg.x + pDrawable->x ; ySrc = pGC->patOrg.y + pDrawable->y ; @@ -213,15 +213,15 @@ int fSorted ; return ; } - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, pptFree, pwidth, ppt, fSorted ) ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; - fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; - bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; + fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.fgPixel ; + bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.bgPixel ; xSrc = pGC->patOrg.x + pDrawable->x ; ySrc = pGC->patOrg.y + pDrawable->y ; @@ -258,7 +258,7 @@ int fSorted ; TRACE( ( "xf4bppTileWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n", pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ; - if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) + if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.alu ) == GXnoop ) return ; SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, @@ -266,7 +266,7 @@ int fSorted ; xSrc = pGC->patOrg.x + pDrawable->x ; ySrc = pGC->patOrg.y + pDrawable->y ; - pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; + pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGetGCPrivateIndex()].ptr )->colorRrop.planemask ; for ( ; n-- ; ppt++, pwidth++ ) xf4bppTileRect( (WindowPtr)pDrawable, pGC->tile.pixmap, alu, pm, diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c index a1c7afd9d..c15962aaf 100644 --- a/hw/xfree86/xf4bpp/ppcWindow.c +++ b/hw/xfree86/xf4bpp/ppcWindow.c @@ -214,7 +214,7 @@ register WindowPtr pWin ; TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin)); - pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr); + pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbGetWindowPrivateIndex()].ptr); pPrivWin->pRotatedBorder = NullPixmap; pPrivWin->pRotatedBackground = NullPixmap; pPrivWin->fastBackground = 0; diff --git a/hw/xfree86/xf4bpp/vgaGC.c b/hw/xfree86/xf4bpp/vgaGC.c index 39597d268..a1aecafbb 100644 --- a/hw/xfree86/xf4bpp/vgaGC.c +++ b/hw/xfree86/xf4bpp/vgaGC.c @@ -106,7 +106,7 @@ xf4bppChangeWindowGC( pGC, changes ) register GC *pGC ; register Mask changes ; { -register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr) ; +register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGetGCPrivateIndex()].ptr) ; register unsigned long int idx ; /* used for stepping through bitfields */ #define LOWBIT( x ) ( x & - x ) /* Two's complement */ diff --git a/hw/xfree86/xf8_16bpp/cfb8_16.h b/hw/xfree86/xf8_16bpp/cfb8_16.h index a4a3bda22..97586ba01 100644 --- a/hw/xfree86/xf8_16bpp/cfb8_16.h +++ b/hw/xfree86/xf8_16bpp/cfb8_16.h @@ -14,7 +14,8 @@ typedef struct { unsigned char key; } cfb8_16ScreenRec, *cfb8_16ScreenPtr; -extern int cfb8_16ScreenPrivateIndex; +extern int cfb8_16ScreenPrivateIndex; /* XXX */ +extern int cfb8_16GetScreenPrivateIndex(void); Bool cfb8_16ScreenInit ( @@ -64,6 +65,6 @@ cfb8_16WindowExposures( ); #define CFB8_16_GET_SCREEN_PRIVATE(pScreen)\ - (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16ScreenPrivateIndex].ptr) + (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16GetScreenPrivateIndex()].ptr) #endif /* _CFB8_16_H */ diff --git a/hw/xfree86/xf8_16bpp/cfbscrinit.c b/hw/xfree86/xf8_16bpp/cfbscrinit.c index cb4b8d726..e8d911db4 100644 --- a/hw/xfree86/xf8_16bpp/cfbscrinit.c +++ b/hw/xfree86/xf8_16bpp/cfbscrinit.c @@ -34,6 +34,8 @@ int cfb8_16ScreenPrivateIndex; +int cfb8_16GetScreenPrivateIndex(void) { return cfb8_16ScreenPrivateIndex; } + static unsigned long cfb8_16Generation = 0; static PixmapPtr cfb8_16GetWindowPixmap(WindowPtr pWin); diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h index 98a50f810..d992b77c5 100644 --- a/hw/xfree86/xf8_32bpp/cfb8_32.h +++ b/hw/xfree86/xf8_32bpp/cfb8_32.h @@ -19,8 +19,10 @@ typedef struct { } cfb8_32ScreenRec, *cfb8_32ScreenPtr; -extern int cfb8_32GCPrivateIndex; -extern int cfb8_32ScreenPrivateIndex; +extern int cfb8_32GCPrivateIndex; /* XXX */ +extern int cfb8_32GetGCPrivateIndex(void); +extern int cfb8_32ScreenPrivateIndex; /* XXX */ +extern int cfb8_32GetScreenPrivateIndex(void); void cfb8_32SaveAreas( @@ -212,10 +214,10 @@ cfb8_32ChangeWindowAttributes( #define CFB8_32_GET_GC_PRIVATE(pGC)\ - (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GCPrivateIndex].ptr) + (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GetGCPrivateIndex()].ptr) #define CFB8_32_GET_SCREEN_PRIVATE(pScreen)\ - (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32ScreenPrivateIndex].ptr) + (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32GetScreenPrivateIndex()].ptr) Bool xf86Overlay8Plus32Init (ScreenPtr pScreen); diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c index 93323d487..dc23d912c 100644 --- a/hw/xfree86/xf8_32bpp/cfbscrinit.c +++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c @@ -38,7 +38,9 @@ static BSFuncRec cfb8_32BSFuncRec = { int cfb8_32GCPrivateIndex; +int cfb8_32GetGCPrivateIndex(void) { return cfb8_32GCPrivateIndex; } int cfb8_32ScreenPrivateIndex; +int cfb8_32GetScreenPrivateIndex(void) { return cfb8_32ScreenPrivateIndex; } static unsigned long cfb8_32Generation = 0; static Bool diff --git a/hw/xfree86/xf8_32wid/cfb8_32wid.h b/hw/xfree86/xf8_32wid/cfb8_32wid.h index 2168054d9..1d1093e54 100644 --- a/hw/xfree86/xf8_32wid/cfb8_32wid.h +++ b/hw/xfree86/xf8_32wid/cfb8_32wid.h @@ -27,7 +27,8 @@ typedef struct { cfb8_32WidOps *WIDOps; } cfb8_32WidScreenRec, *cfb8_32WidScreenPtr; -extern int cfb8_32WidScreenPrivateIndex; +extern int cfb8_32WidScreenPrivateIndex; /* XXX */ +extern int cfb8_32WidGetScreenPrivateIndex(void); Bool cfb8_32WidScreenInit ( @@ -88,6 +89,6 @@ Bool cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv); #define CFB8_32WID_GET_SCREEN_PRIVATE(pScreen)\ - (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidScreenPrivateIndex].ptr) + (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidGetScreenPrivateIndex()].ptr) #endif /* _CFB8_32WID_H */ diff --git a/hw/xfree86/xf8_32wid/cfbscrinit.c b/hw/xfree86/xf8_32wid/cfbscrinit.c index 8f307034f..02f6cd21f 100644 --- a/hw/xfree86/xf8_32wid/cfbscrinit.c +++ b/hw/xfree86/xf8_32wid/cfbscrinit.c @@ -36,6 +36,10 @@ compiled with CFB_NEED_SCREEN_PRIVATE */ int cfb8_32WidScreenPrivateIndex; +int cfb8_32WidGetScreenPrivateIndex(void) +{ + return cfb8_32WidScreenPrivateIndex; +} static unsigned long cfb8_32WidGeneration = 0; extern WindowPtr *WindowTable; |