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/xaa | |
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/xaa')
-rw-r--r-- | hw/xfree86/xaa/xaaFallback.c | 7 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaInit.c | 18 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaROP.c | 19 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaalocal.h | 28 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaarop.h | 6 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaawrap.h | 14 |
6 files changed, 70 insertions, 22 deletions
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;\ |