summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2004-07-30 20:30:57 +0000
committerAdam Jackson <ajax@nwnk.net>2004-07-30 20:30:57 +0000
commit48514fee3c8ec26f36e142ffc9272e510b9a4238 (patch)
tree2f0aaa0b3861f7ace00d2c1f5d0bc6a5e0ab8e93
parent29012adb37c533f57c684ad94c4d83a6c31793e5 (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.
-rw-r--r--fb/fb.h13
-rw-r--r--fb/fballpriv.c12
-rw-r--r--fb/fboverlay.c7
-rw-r--r--fb/fboverlay.h7
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c9
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h2
-rw-r--r--hw/xfree86/xaa/xaaFallback.c7
-rw-r--r--hw/xfree86/xaa/xaaInit.c18
-rw-r--r--hw/xfree86/xaa/xaaROP.c19
-rw-r--r--hw/xfree86/xaa/xaalocal.h28
-rw-r--r--hw/xfree86/xaa/xaarop.h6
-rw-r--r--hw/xfree86/xaa/xaawrap.h14
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.h7
-rw-r--r--hw/xfree86/xf4bpp/mfbbres.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbbresd.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c2
-rw-r--r--hw/xfree86/xf4bpp/mfbhrzvert.c2
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbzerarc.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcArea.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcGC.c8
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c8
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c24
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyPnt.c2
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c24
-rw-r--r--hw/xfree86/xf4bpp/ppcWindow.c2
-rw-r--r--hw/xfree86/xf4bpp/vgaGC.c2
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16.h5
-rw-r--r--hw/xfree86/xf8_16bpp/cfbscrinit.c2
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h10
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c2
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32wid.h5
-rw-r--r--hw/xfree86/xf8_32wid/cfbscrinit.c4
-rw-r--r--mfb/maskbits.c6
-rw-r--r--mfb/maskbits.h35
-rw-r--r--mfb/mfb.h6
-rw-r--r--mfb/mfbscrinit.c13
39 files changed, 234 insertions, 107 deletions
diff --git a/fb/fb.h b/fb/fb.h
index 0b5c98aff..d9bd145c2 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -22,7 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.4 2004/06/21 13:51:57 ago Exp $ */
#ifndef _FB_H_
#define _FB_H_
@@ -564,9 +564,13 @@ extern void fbSetBits (FbStip *bits, int stride, FbStip data);
} \
}
+/* XXX fb*PrivateIndex should be static, but it breaks the ABI */
+
extern int fbGCPrivateIndex;
+extern int fbGetGCPrivateIndex(void);
#ifndef FB_NO_WINDOW_PIXMAPS
extern int fbWinPrivateIndex;
+extern int fbGetWinPrivateIndex(void);
#endif
extern const GCOps fbGCOps;
extern const GCFuncs fbGCFuncs;
@@ -587,6 +591,7 @@ extern WindowPtr *WindowTable;
#ifdef FB_SCREEN_PRIVATE
extern int fbScreenPrivateIndex;
+extern int fbGetScreenPrivateIndex(void);
/* private field of a screen */
typedef struct {
@@ -595,7 +600,7 @@ typedef struct {
} FbScreenPrivRec, *FbScreenPrivPtr;
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
- (pScreen)->devPrivates[fbScreenPrivateIndex].ptr)
+ (pScreen)->devPrivates[fbGetScreenPrivateIndex()].ptr)
#endif
/* private field of GC */
@@ -619,7 +624,7 @@ typedef struct {
} FbGCPrivRec, *FbGCPrivPtr;
#define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
- (pGC)->devPrivates[fbGCPrivateIndex].ptr)
+ (pGC)->devPrivates[fbGetGCPrivateIndex()].ptr)
#ifdef FB_OLD_GC
#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
@@ -638,7 +643,7 @@ typedef struct {
#define fbGetWindowPixmap(d) fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
#else
#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
- ((WindowPtr) (pWin))->devPrivates[fbWinPrivateIndex].ptr)
+ ((WindowPtr) (pWin))->devPrivates[fbGetWinPrivateIndex()].ptr)
#endif
#if defined(__DARWIN__)||defined(__CYGWIN__)
diff --git a/fb/fballpriv.c b/fb/fballpriv.c
index e7fcfd45b..29e98ae9f 100644
--- a/fb/fballpriv.c
+++ b/fb/fballpriv.c
@@ -27,10 +27,22 @@
#ifdef FB_SCREEN_PRIVATE
int fbScreenPrivateIndex;
+int fbGetScreenPrivateIndex(void)
+{
+ return fbScreenPrivateIndex;
+}
#endif
int fbGCPrivateIndex;
+int fbGetGCPrivateIndex(void)
+{
+ return fbGCPrivateIndex;
+}
#ifndef FB_NO_WINDOW_PIXMAPS
int fbWinPrivateIndex;
+int fbGetWinPrivateIndex(void)
+{
+ return fbWinPrivateIndex;
+}
#endif
int fbGeneration;
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index fdd82edf7..98bd5fc1c 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -23,7 +23,7 @@
* Author: Keith Packard, SuSE, Inc.
*/
-/* $XdotOrg: $ */
+/* $XdotOrg: xc/programs/Xserver/fb/fboverlay.c,v 1.3 2004/05/16 05:08:39 alanc Exp $ */
#include "fb.h"
#include "fboverlay.h"
@@ -31,6 +31,11 @@
int fbOverlayGeneration;
int fbOverlayScreenPrivateIndex = -1;
+int fbOverlayGetScreenPrivateIndex(void)
+{
+ return fbOverlayScreenPrivateIndex;
+}
+
/*
* Replace this if you want something supporting
* multiple overlays with the same depth
diff --git a/fb/fboverlay.h b/fb/fboverlay.h
index 72891ece3..aecb3856f 100644
--- a/fb/fboverlay.h
+++ b/fb/fboverlay.h
@@ -27,7 +27,8 @@
#define _FBOVERLAY_H_
extern int fbOverlayGeneration;
-extern int fbOverlayScreenPrivateIndex;
+extern int fbOverlayScreenPrivateIndex; /* XXX should be static */
+extern int fbOverlayGetScreenPrivateIndex(void);
#ifndef FB_OVERLAY_MAX
#define FB_OVERLAY_MAX 2
@@ -58,8 +59,8 @@ typedef struct _fbOverlayScrPriv {
} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
#define fbOverlayGetScrPriv(s) \
- ((fbOverlayScreenPrivateIndex != -1) ? \
- (s)->devPrivates[fbOverlayScreenPrivateIndex].ptr : NULL)
+ ((fbOverlayGetScreenPrivateIndex() != -1) ? \
+ (s)->devPrivates[fbOverlayGetScreenPrivateIndex()].ptr : NULL)
Bool
fbOverlayCreateWindow(WindowPtr pWin);
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;
diff --git a/mfb/maskbits.c b/mfb/maskbits.c
index 09f593ec2..4cd2d493b 100644
--- a/mfb/maskbits.c
+++ b/mfb/maskbits.c
@@ -1003,6 +1003,12 @@ PixelType rmask[] =
#undef _1_
+PixelType mfbGetmask(int i) { return mask[i]; }
+PixelType mfbGetrmask(int i) { return rmask[i]; }
+PixelType mfbGetstarttab(int i) { return starttab[i]; }
+PixelType mfbGetendtab(int i) { return endtab[i]; }
+PixelType mfbGetpartmasks(int i, int j) { return partmasks[i][j]; }
+
/*
* Merge raster ops for full src + dest + plane mask
*
diff --git a/mfb/maskbits.h b/mfb/maskbits.h
index 4cd30be39..5ca79c929 100644
--- a/mfb/maskbits.h
+++ b/mfb/maskbits.h
@@ -224,11 +224,18 @@ getshiftedleftbits(psrc, offset, w, dst)
#define MFB_PWSH 5
#endif /* MFB_PPW == 32 */
+/* XXX don't use these five */
extern PixelType starttab[];
extern PixelType endtab[];
extern PixelType partmasks[MFB_PPW][MFB_PPW];
extern PixelType rmask[];
extern PixelType mask[];
+/* XXX use these five */
+extern PixelType mfbGetstarttab(int);
+extern PixelType mfbGetendtab(int);
+extern PixelType mfbGetpartmasks(int, int);
+extern PixelType mfbGetrmask(int);
+extern PixelType mfbGetmask(int);
#ifndef MFB_CONSTS_ONLY
@@ -304,19 +311,19 @@ extern PixelType mask[];
}
#define maskbits(x, w, startmask, endmask, nlw) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM]; \
+ startmask = mfbGetstarttab((x) & PIM); \
+ endmask = mfbGetendtab(((x)+(w)) & PIM); \
if (startmask) \
nlw = (((w) - (PPW - ((x) & PIM))) >> PWSH); \
else \
nlw = (w) >> PWSH;
#define maskpartialbits(x, w, mask) \
- mask = partmasks[(x) & PIM][(w) & PIM];
+ mask = mfbGetpartmasks((x) & PIM, (w) & PIM);
#define maskPPWbits(x, w, startmask, endmask) \
- startmask = starttab[(x) & PIM]; \
- endmask = endtab[((x)+(w)) & PIM];
+ startmask = mfbGetstarttab((x) & PIM); \
+ endmask = mfbGetendtab(((x)+(w)) & PIM);
#ifdef __GNUC__ /* XXX don't want for Alpha? */
#ifdef vax
@@ -390,8 +397,8 @@ extern PixelType mask[];
{ \
register int d = PPW-(x); \
*(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | \
- (SCRLEFT(src, d) & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | \
+ (SCRLEFT(src, d) & mfbGetendtab(n)); \
} \
}
@@ -440,10 +447,10 @@ extern PixelType mask[];
else \
{ \
int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
+ *(pdst) = (*(pdst) & mfbGetendtab(x)) | (t2 & mfbGetstarttab(x)); \
t1 = SCRLEFT((src), m); \
DoRop(t2, rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | (t2 & mfbGetendtab(n)); \
} \
}
@@ -514,10 +521,10 @@ extern PixelType mask[];
else \
{ \
int m = PPW-(x); \
- *(pdst) = (*(pdst) & endtab[x]) | (t2 & starttab[x]); \
+ *(pdst) = (*(pdst) & mfbGetendtab(x)) | (t2 & mfbGetstarttab(x)); \
t1 = SCRLEFT((src), m); \
t2 = DoRRop(rop, t1, (pdst)[1]); \
- (pdst)[1] = ((pdst)[1] & starttab[n]) | (t2 & endtab[n]); \
+ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | (t2 & mfbGetendtab(n)); \
} \
}
#endif
@@ -645,7 +652,7 @@ extern PixelType mask[];
if ((width) > _flag) \
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
@@ -659,7 +666,7 @@ extern PixelType mask[];
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
DoRop(_src, rop, _src, *(pdst)); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
#define getandputrrop0(psrc, sbindex, width, pdst, rop) \
@@ -672,7 +679,7 @@ extern PixelType mask[];
_src |= SCRRIGHT (*((psrc) + 1), _flag); \
_src = DoRRop(rop, _src, *(pdst)); \
\
- *(pdst) = (*(pdst) & starttab[(width)]) | (_src & endtab[(width)]); \
+ *(pdst) = (*(pdst) & mfbGetstarttab((width))) | (_src & mfbGetendtab((width))); \
}
#endif /* FASTGETBITS && FASTPUTBITS */
diff --git a/mfb/mfb.h b/mfb/mfb.h
index 267ebc4ea..d0105c93c 100644
--- a/mfb/mfb.h
+++ b/mfb/mfb.h
@@ -713,6 +713,8 @@ extern void mfbSetWindowPixmap(
PixmapPtr /*pPix*/
);
+extern void mfbFillInScreen(ScreenPtr pScreen);
+
/* mfbseg.c */
extern void mfbSegmentSS(
@@ -874,10 +876,14 @@ typedef struct {
typedef mfbPrivGC *mfbPrivGCPtr;
#endif
+/* XXX these should be static, but it breaks the ABI */
extern int mfbGCPrivateIndex; /* index into GC private array */
+extern int mfbGetGCPrivateIndex(void);
extern int mfbWindowPrivateIndex; /* index into Window private array */
+extern int mfbGetWindowPrivateIndex(void);
#ifdef PIXMAP_PER_WINDOW
extern int frameWindowPrivateIndex; /* index into Window private array */
+extern int frameGetWindowPrivateIndex(void);
#endif
#ifndef MFB_PROTOTYPES_ONLY
diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c
index c85d4e36b..7e840303c 100644
--- a/mfb/mfbscrinit.c
+++ b/mfb/mfbscrinit.c
@@ -65,9 +65,12 @@ SOFTWARE.
#ifdef PIXMAP_PER_WINDOW
int frameWindowPrivateIndex;
+int frameGetWindowPrivateIndex(void) { return frameWindowPrivateIndex; }
#endif
int mfbWindowPrivateIndex;
+int mfbGetWindowPrivateIndex(void) { return mfbWindowPrivateIndex; }
int mfbGCPrivateIndex;
+int mfbGetGCPrivateIndex(void) { return mfbGCPrivateIndex; }
static unsigned long mfbGeneration = 0;
static VisualRec visual = {
@@ -195,3 +198,13 @@ mfbSetWindowPixmap(pWin, pPix)
#endif
}
+void mfbFillInScreen(ScreenPtr pScreen)
+{
+ pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes;
+ pScreen->RealizeWindow = mfbMapWindow;
+ pScreen->UnrealizeWindow = mfbUnmapWindow;
+ pScreen->DestroyPixmap = mfbDestroyPixmap;
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+}