summaryrefslogtreecommitdiff
path: root/cfb
diff options
context:
space:
mode:
Diffstat (limited to 'cfb')
-rw-r--r--cfb/Makefile.am1
-rw-r--r--cfb/cfb.h9
-rw-r--r--cfb/cfballpriv.c30
-rw-r--r--cfb/cfbcppl.c4
-rw-r--r--cfb/cfbmap.h132
-rw-r--r--cfb/cfbmskbits.h37
-rw-r--r--cfb/cfbpixmap.c2
-rw-r--r--cfb/cfbrrop.h3
-rw-r--r--cfb/cfbscrinit.c18
-rw-r--r--cfb/cfbtab.h14
-rw-r--r--cfb/cfbunmap.h6
-rw-r--r--cfb/cfbwindow.c4
12 files changed, 38 insertions, 222 deletions
diff --git a/cfb/Makefile.am b/cfb/Makefile.am
index d24f027e7..901fc95ae 100644
--- a/cfb/Makefile.am
+++ b/cfb/Makefile.am
@@ -16,7 +16,6 @@ INCLUDES = $(CFB_INCLUDES) -I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir
EXTRA_DIST = cfbline.c cfbfillarc.c cfbzerarc.c cfbblt.c cfbsolid.c \
cfbtileodd.c cfbtile32.c cfb8line.c cfbply1rct.c cfbglblt8.c \
cfb16.h cfb24.h cfb32.h cfb8bit.h cfbrrop.h \
- cfbtab.h \
stip68kgnu.h stipmips.s stipsparc.s stipsprc32.s
sdk_HEADERS = cfb.h cfb32.h cfb16.h cfbmap.h cfbunmap.h cfbmskbits.h
diff --git a/cfb/cfb.h b/cfb/cfb.h
index 6e9001f3f..aece13341 100644
--- a/cfb/cfb.h
+++ b/cfb/cfb.h
@@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "colormap.h"
#include "miscstruct.h"
#include "servermd.h"
+#include "privates.h"
#include "windowstr.h"
#include "mfb.h"
#undef PixelType
@@ -55,7 +56,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
pixmap.devKind = width_of_pixmap_in_bytes
*/
-extern int cfbGCPrivateIndex;
+extern DevPrivateKey cfbGCPrivateKey;
/* private field of GC */
typedef struct {
@@ -70,7 +71,7 @@ typedef struct {
typedef cfbPrivGC *cfbPrivGCPtr;
#define cfbGetGCPrivate(pGC) ((cfbPrivGCPtr)\
- (pGC)->devPrivates[cfbGCPrivateIndex].ptr)
+ dixLookupPrivate(&(pGC)->devPrivates, cfbGCPrivateKey))
#define cfbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
@@ -298,7 +299,7 @@ extern int cfb8SegmentSS1RectXor(
extern Bool cfbAllocatePrivates(
ScreenPtr /*pScreen*/,
- int * /*gc_index*/
+ DevPrivateKey * /*gc_key*/
);
/* cfbbitblt.c */
@@ -1193,7 +1194,7 @@ extern void cfbZeroPolyArcSS8Xor(
#define CFB_NEED_SCREEN_PRIVATE
-extern int cfbScreenPrivateIndex;
+extern DevPrivateKey cfbScreenPrivateKey;
#endif
#ifndef CFB_PROTOTYPES_ONLY
diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c
index 858ff6061..3b58266c5 100644
--- a/cfb/cfballpriv.c
+++ b/cfb/cfballpriv.c
@@ -45,38 +45,26 @@ in this Software without prior written authorization from The Open Group.
#include "mibstore.h"
#if 1 || PSZ==8
-int cfbGCPrivateIndex = -1;
+DevPrivateKey cfbGCPrivateKey = &cfbGCPrivateKey;
#endif
#ifdef CFB_NEED_SCREEN_PRIVATE
-int cfbScreenPrivateIndex = -1;
-static unsigned long cfbGeneration = 0;
+DevPrivateKey cfbScreenPrivateKey = &cfbScreenPrivateKey;
#endif
Bool
-cfbAllocatePrivates(ScreenPtr pScreen, int *gc_index)
+cfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *gc_key)
{
- if (!gc_index || *gc_index == -1)
+ if (!gc_key || !*gc_key)
{
- if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex))
+ if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateKey))
return FALSE;
- if (gc_index)
- *gc_index = cfbGCPrivateIndex;
+ if (gc_key)
+ *gc_key = cfbGCPrivateKey;
}
else
{
- cfbGCPrivateIndex = *gc_index;
+ cfbGCPrivateKey = *gc_key;
}
- if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
- return FALSE;
-#ifdef CFB_NEED_SCREEN_PRIVATE
- if (cfbGeneration != serverGeneration)
- {
- cfbScreenPrivateIndex = AllocateScreenPrivateIndex ();
- cfbGeneration = serverGeneration;
- }
- if (cfbScreenPrivateIndex == -1)
- return FALSE;
-#endif
- return TRUE;
+ return dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC));
}
diff --git a/cfb/cfbcppl.c b/cfb/cfbcppl.c
index c13baf143..00714cbc4 100644
--- a/cfb/cfbcppl.c
+++ b/cfb/cfbcppl.c
@@ -42,9 +42,7 @@ in this Software without prior written authorization from The Open Group.
#include "maskbits.h"
#define PSZ 8
#include "mergerop.h"
-#else /* PSZ==8 */
-#include "cfbtab.h" /* provides starttab, endttab, partmasks */
-#endif /* PSZ==8 */
+#endif
void
diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h
index 2e709b19d..16e4afc3c 100644
--- a/cfb/cfbmap.h
+++ b/cfb/cfbmap.h
@@ -30,132 +30,6 @@ in this Software without prior written authorization from The Open Group.
* Map names around so that multiple depths can be supported simultaneously
*/
-#if 0
-#undef QuartetBitsTable
-#undef QuartetPixelMaskTable
-#undef cfb8ClippedLineCopy
-#undef cfb8ClippedLineGeneral
-#undef cfb8ClippedLineXor
-#undef cfb8LineSS1Rect
-#undef cfb8LineSS1RectCopy
-#undef cfb8LineSS1RectGeneral
-#undef cfb8LineSS1RectPreviousCopy
-#undef cfb8LineSS1RectXor
-#undef cfb8SegmentSS1Rect
-#undef cfb8SegmentSS1RectCopy
-#undef cfb8SegmentSS1RectGeneral
-#undef cfb8SegmentSS1RectShiftCopy
-#undef cfb8SegmentSS1RectXor
-#undef cfbAllocatePrivates
-#undef cfbBSFuncRec
-#undef cfbBitBlt
-#undef cfbBresD
-#undef cfbBresS
-#undef cfbChangeWindowAttributes
-#undef cfbCloseScreen
-#undef cfbCopyArea
-#undef cfbCopyImagePlane
-#undef cfbCopyPixmap
-#undef cfbCopyPlane
-#undef cfbCopyPlaneReduce
-#undef cfbCopyRotatePixmap
-#undef cfbCopyWindow
-#undef cfbCreateGC
-#undef cfbCreatePixmap
-#undef cfbCreateScreenResources
-#undef cfbCreateWindow
-#undef cfbDestroyPixmap
-#undef cfbDestroyWindow
-#undef cfbDoBitblt
-#undef cfbDoBitbltCopy
-#undef cfbDoBitbltGeneral
-#undef cfbDoBitbltOr
-#undef cfbDoBitbltXor
-#undef cfbFillBoxTile32sCopy
-#undef cfbFillBoxTile32sGeneral
-#undef cfbFillBoxTileOdd
-#undef cfbFillBoxTileOddCopy
-#undef cfbFillBoxTileOddGeneral
-#undef cfbFillPoly1RectCopy
-#undef cfbFillPoly1RectGeneral
-#undef cfbFillRectSolidCopy
-#undef cfbFillRectSolidGeneral
-#undef cfbFillRectSolidXor
-#undef cfbFillRectTile32Copy
-#undef cfbFillRectTile32General
-#undef cfbFillRectTileOdd
-#undef cfbFillSpanTile32sCopy
-#undef cfbFillSpanTile32sGeneral
-#undef cfbFillSpanTileOddCopy
-#undef cfbFillSpanTileOddGeneral
-#undef cfbFinishScreenInit
-#undef cfbGCFuncs
-#undef cfbGCPrivateIndex
-#undef cfbGetImage
-#undef cfbGetScreenPixmap
-#undef cfbGetSpans
-#undef cfbHorzS
-#undef cfbImageGlyphBlt8
-#undef cfbInitializeColormap
-#undef cfbInstallColormap
-#undef cfbLineSD
-#undef cfbLineSS
-#undef cfbListInstalledColormaps
-#undef cfbMapWindow
-#undef cfbMatchCommon
-#undef cfbNonTEOps
-#undef cfbNonTEOps1Rect
-#undef cfbPadPixmap
-#undef cfbPolyFillArcSolidCopy
-#undef cfbPolyFillArcSolidGeneral
-#undef cfbPolyFillRect
-#undef cfbPolyGlyphBlt8
-#undef cfbPolyGlyphRop8
-#undef cfbPolyPoint
-#undef cfbPositionWindow
-#undef cfbPutImage
-#undef cfbReduceRasterOp
-#undef cfbResolveColor
-#undef cfbRestoreAreas
-#undef cfbSaveAreas
-#undef cfbScreenInit
-#undef cfbScreenPrivateIndex
-#undef cfbSegmentSD
-#undef cfbSegmentSS
-#undef cfbSetScanline
-#undef cfbSetScreenPixmap
-#undef cfbSetSpans
-#undef cfbSetupScreen
-#undef cfbSolidSpansCopy
-#undef cfbSolidSpansGeneral
-#undef cfbSolidSpansXor
-#undef cfbStippleStack
-#undef cfbStippleStackTE
-#undef cfbTEGlyphBlt
-#undef cfbTEOps
-#undef cfbTEOps1Rect
-#undef cfbTile32FSCopy
-#undef cfbTile32FSGeneral
-#undef cfbUninstallColormap
-#undef cfbUnmapWindow
-#undef cfbUnnaturalStippleFS
-#undef cfbUnnaturalTileFS
-#undef cfbValidateGC
-#undef cfbVertS
-#undef cfbWindowPrivateIndex
-#undef cfbXRotatePixmap
-#undef cfbYRotatePixmap
-#undef cfbZeroPolyArcSS8Copy
-#undef cfbZeroPolyArcSS8General
-#undef cfbZeroPolyArcSS8Xor
-#undef cfbendpartial
-#undef cfbendtab
-#undef cfbmask
-#undef cfbrmask
-#undef cfbstartpartial
-#undef cfbstarttab
-#endif
-
/* a losing vendor cpp dumps core if we define CFBNAME in terms of CATNAME */
#if PSZ != 8
@@ -266,7 +140,7 @@ cfb can not hack PSZ yet
#define cfbFillSpanTileOddGeneral CFBNAME(FillSpanTileOddGeneral)
#define cfbFinishScreenInit CFBNAME(FinishScreenInit)
#define cfbGCFuncs CFBNAME(GCFuncs)
-#define cfbGCPrivateIndex CFBNAME(GCPrivateIndex)
+#define cfbGCPrivateKey CFBNAME(GCPrivateKey)
#define cfbGetImage CFBNAME(GetImage)
#define cfbGetScreenPixmap CFBNAME(GetScreenPixmap)
#define cfbGetSpans CFBNAME(GetSpans)
@@ -296,7 +170,7 @@ cfb can not hack PSZ yet
#define cfbRestoreAreas CFBNAME(RestoreAreas)
#define cfbSaveAreas CFBNAME(SaveAreas)
#define cfbScreenInit CFBNAME(ScreenInit)
-#define cfbScreenPrivateIndex CFBNAME(ScreenPrivateIndex)
+#define cfbScreenPrivateKey CFBNAME(ScreenPrivateKey)
#define cfbSegmentSD CFBNAME(SegmentSD)
#define cfbSegmentSS CFBNAME(SegmentSS)
#define cfbSetScanline CFBNAME(SetScanline)
@@ -320,7 +194,7 @@ cfb can not hack PSZ yet
#define cfbUnnaturalTileFS CFBNAME(UnnaturalTileFS)
#define cfbValidateGC CFBNAME(ValidateGC)
#define cfbVertS CFBNAME(VertS)
-#define cfbWindowPrivateIndex CFBNAME(WindowPrivateIndex)
+#define cfbWindowPrivateKey CFBNAME(WindowPrivateKey)
#define cfbXRotatePixmap CFBNAME(XRotatePixmap)
#define cfbYRotatePixmap CFBNAME(YRotatePixmap)
#define cfbZeroPolyArcSS8Copy CFBNAME(ZeroPolyArcSSCopy)
diff --git a/cfb/cfbmskbits.h b/cfb/cfbmskbits.h
index 6076269b3..5ee9125dd 100644
--- a/cfb/cfbmskbits.h
+++ b/cfb/cfbmskbits.h
@@ -831,42 +831,6 @@ if ((x) + (w) <= PPW) {\
*(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
}
#if PSZ == 24
-# if 0
-#define getstipplepixels24(psrcstip,xt,w,ones,psrcpix,destpix,stipindex,srcindex,dstindex) \
-{ \
- PixelGroup q; \
- CfbBits src; \
- register unsigned int sidx; \
- register unsigned int didx; \
- sidx = ((srcindex) & 3)<<1; \
- didx = ((dstindex) & 3)<<1; \
- q = *(psrcstip) >> (xt); \
-/* if((srcindex)!=0)*/ \
-/* src = (((*(psrcpix)) << cfb24Shift[sidx]) & (cfbmask[sidx])) |*/ \
-/* (((*((psrcpix)+1)) << cfb24Shift[sidx+1]) & (cfbmask[sidx+1])); */\
-/* else */\
- src = (*(psrcpix))&0xFFFFFF; \
- if ( ((xt)+(w)) > PGSZ ) \
- q |= (*((psrcstip)+1)) << (PGSZ -(xt)); \
- q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \
- src &= QuartetPixelMaskTable[q]; \
- *(destpix) &= cfbrmask[didx]; \
- switch(didx) {\
- case 0: \
- *(destpix) |= (src &cfbmask[didx]); \
- break; \
- case 2: \
- case 4: \
- destpix++;didx++; \
- *(destpix) = ((*(destpix)) & (cfbrmask[didx]))| \
- (BitLeft(src, cfb24Shift[didx]) & (cfbmask[didx])); \
- destpix--; didx--;\
- case 6: \
- *(destpix) |= (BitRight(src, cfb24Shift[didx]) & cfbmask[didx]); \
- break; \
- }; \
-}
-# else
#define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \
{ \
PixelGroup q; \
@@ -874,7 +838,6 @@ if ((x) + (w) <= PPW) {\
q = ((ones) ? q : ~q) & 1; \
*(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \
}
-# endif
#endif /* PSZ == 24 */
#endif
diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c
index a7be7cc1b..1166f90b7 100644
--- a/cfb/cfbpixmap.c
+++ b/cfb/cfbpixmap.c
@@ -99,6 +99,7 @@ cfbCreatePixmap (pScreen, width, height, depth, usage_hint)
pPixmap->refcnt = 1;
pPixmap->devPrivate.ptr = datasize ?
(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
+ pPixmap->usage_hint = usage_hint;
return pPixmap;
}
@@ -108,6 +109,7 @@ cfbDestroyPixmap(pPixmap)
{
if(--pPixmap->refcnt)
return TRUE;
+ dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return TRUE;
}
diff --git a/cfb/cfbrrop.h b/cfb/cfbrrop.h
index eeb373a5e..e9ca881be 100644
--- a/cfb/cfbrrop.h
+++ b/cfb/cfbrrop.h
@@ -35,7 +35,8 @@ in this Software without prior written authorization from The Open Group.
#endif
#define RROP_FETCH_GC(gc) \
- RROP_FETCH_GCPRIV(((cfbPrivGCPtr)(gc)->devPrivates[cfbGCPrivateIndex].ptr))
+ RROP_FETCH_GCPRIV((cfbPrivGCPtr)dixLookupPrivate(&(gc)->devPrivates, \
+ cfbGCPrivateKey))
#ifndef RROP
#define RROP GXset
diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c
index ddfb41e6b..6f9ba2e85 100644
--- a/cfb/cfbscrinit.c
+++ b/cfb/cfbscrinit.c
@@ -59,7 +59,7 @@ cfbCloseScreen (index, pScreen)
xfree (depths);
xfree (pScreen->visuals);
#ifdef CFB_NEED_SCREEN_PRIVATE
- xfree (pScreen->devPrivates[cfbScreenPrivateIndex].ptr);
+ xfree (dixLookupPrivate(&pScreen->devPrivates, cfbScreenPrivateKey));
#else
xfree (pScreen->devPrivate);
#endif
@@ -130,9 +130,11 @@ cfbCreateScreenResources(pScreen)
Bool retval;
pointer oldDevPrivate = pScreen->devPrivate;
- pScreen->devPrivate = pScreen->devPrivates[cfbScreenPrivateIndex].ptr;
+ pScreen->devPrivate = dixLookupPrivate(&pScreen->devPrivates,
+ cfbScreenPrivateKey);
retval = miCreateScreenResources(pScreen);
- pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate;
+ dixSetPrivate(&pScreen->devPrivates, cfbScreenPrivateKey,
+ pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
return retval;
}
@@ -171,7 +173,8 @@ cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
pScreen->CloseScreen = cfbCloseScreen;
#ifdef CFB_NEED_SCREEN_PRIVATE
pScreen->CreateScreenResources = cfbCreateScreenResources;
- pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate;
+ dixSetPrivate(&pScreen->devPrivates, cfbScreenPrivateKey,
+ pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
#endif
pScreen->GetScreenPixmap = cfbGetScreenPixmap;
@@ -198,7 +201,8 @@ cfbGetScreenPixmap(pScreen)
ScreenPtr pScreen;
{
#ifdef CFB_NEED_SCREEN_PRIVATE
- return (PixmapPtr)pScreen->devPrivates[cfbScreenPrivateIndex].ptr;
+ return (PixmapPtr)dixLookupPrivate(&pScreen->devPrivates,
+ cfbScreenPrivateKey);
#else
return (PixmapPtr)pScreen->devPrivate;
#endif
@@ -210,8 +214,8 @@ cfbSetScreenPixmap(pPix)
{
#ifdef CFB_NEED_SCREEN_PRIVATE
if (pPix)
- pPix->drawable.pScreen->devPrivates[cfbScreenPrivateIndex].ptr =
- (pointer)pPix;
+ dixSetPrivate(&pPix->drawable.pScreen->devPrivates,
+ cfbScreenPrivateKey, pPix);
#else
if (pPix)
pPix->drawable.pScreen->devPrivate = (pointer)pPix;
diff --git a/cfb/cfbtab.h b/cfb/cfbtab.h
deleted file mode 100644
index 60d203f90..000000000
--- a/cfb/cfbtab.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _CFBTAB_H_
-#define _CFBTAB_H_
-
-/* prototypes */
-#if 0
-extern int starttab[32], endtab[32];
-extern unsigned int partmasks[32][32];
-#endif
-
-#endif /* _CFBTAB_H_ */
diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h
index d15c23e30..db9889217 100644
--- a/cfb/cfbunmap.h
+++ b/cfb/cfbunmap.h
@@ -93,7 +93,7 @@
#undef cfbFillSpanTileOddGeneral
#undef cfbFinishScreenInit
#undef cfbGCFuncs
-#undef cfbGCPrivateIndex
+#undef cfbGCPrivateKey
#undef cfbGetImage
#undef cfbGetScreenPixmap
#undef cfbGetSpans
@@ -123,7 +123,7 @@
#undef cfbRestoreAreas
#undef cfbSaveAreas
#undef cfbScreenInit
-#undef cfbScreenPrivateIndex
+#undef cfbScreenPrivateKey
#undef cfbSegmentSD
#undef cfbSegmentSS
#undef cfbSetScanline
@@ -147,7 +147,7 @@
#undef cfbUnnaturalTileFS
#undef cfbValidateGC
#undef cfbVertS
-#undef cfbWindowPrivateIndex
+#undef cfbWindowPrivateKey
#undef cfbXRotatePixmap
#undef cfbYRotatePixmap
#undef cfbZeroPolyArcSS8Copy
diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c
index 234501212..50728764e 100644
--- a/cfb/cfbwindow.c
+++ b/cfb/cfbwindow.c
@@ -64,8 +64,8 @@ cfbCreateWindow(WindowPtr pWin)
{
#ifdef PIXMAP_PER_WINDOW
/* Setup pointer to Screen pixmap */
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- (pointer) cfbGetScreenPixmap(pWin->drawable.pScreen);
+ dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey,
+ cfbGetScreenPixmap(pWin->drawable.pScreen));
#endif
return TRUE;