[PATCH] xserver: remove PIXPRIV tests

Eamon Walsh ewalsh at tycho.nsa.gov
Tue Mar 6 16:04:06 PST 2007


PIXPRIV has been hardwired to 1 since at least 1 Jul 2005 ("Adding initial build system").

Patch for master.

--
 Xext/shm.c                    |   23 -----------------------
 afb/afbpixmap.c               |    4 ----
 cfb/cfbpixmap.c               |    4 ----
 dix/main.c                    |    6 ------
 dix/privates.c                |    2 --
 fb/fbpixmap.c                 |    4 ----
 hw/dmx/dmxpixmap.c            |    4 ----
 hw/dmx/dmxscrinit.c           |    6 ------
 hw/xfree86/loader/dixsym.c    |    2 --
 hw/xfree86/xf4bpp/ppcPixmap.c |    4 ----
 hw/xnest/Pixmap.c             |    6 ------
 hw/xnest/Screen.c             |    4 ----
 hw/xnest/XNPixmap.h           |    7 -------
 include/pixmapstr.h           |    2 --
 include/screenint.h           |    4 ----
 include/scrnintstr.h          |    2 --
 mfb/mfbpixmap.c               |    4 ----
 17 files changed, 0 insertions(+), 88 deletions(-)

diff --git a/Xext/shm.c b/Xext/shm.c
index 7cfaa68..ac587be 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -119,9 +119,7 @@ static int pixmapFormat;
 static int shmPixFormat[MAXSCREENS];
 static ShmFuncsPtr shmFuncs[MAXSCREENS];
 static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
-#ifdef PIXPRIV
 static int  shmPixmapPrivate;
-#endif
 static ShmFuncs miFuncs = {NULL, miShmPutImage};
 static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
 
@@ -237,7 +235,6 @@ ShmExtensionInit(INITARGS)
 	    destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap;
 	    screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
 	}
-#ifdef PIXPRIV
 	shmPixmapPrivate = AllocatePixmapPrivateIndex();
 	for (i = 0; i < screenInfo.numScreens; i++)
 	{
@@ -245,7 +242,6 @@ ShmExtensionInit(INITARGS)
 				       shmPixmapPrivate, 0))
 		return;
 	}
-#endif
       }
     }
     ShmSegType = CreateNewResourceType(ShmDetachSegment);
@@ -299,22 +295,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
     if (pPixmap->refcnt == 1)
     {
 	ShmDescPtr  shmdesc;
-#ifdef PIXPRIV
 	shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr;
-#else
-	char	*base = (char *) pPixmap->devPrivate.ptr;
-	
-	if (base != (pointer) (pPixmap + 1))
-	{
-	    for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next)
-	    {
-		if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size)
-		    break;
-	    }
-	}
-	else
-	    shmdesc = 0;
-#endif
 	if (shmdesc)
 	    ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id);
     }
@@ -781,9 +762,7 @@ CreatePmap:
 				shmdesc->addr + stuff->offset);
 
 	if (pMap) {
-#ifdef PIXPRIV
             pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
             shmdesc->refcnt++;
 	    pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
 	    pMap->drawable.id = newPix->info[j].id;
@@ -1097,9 +1076,7 @@ CreatePmap:
 			    shmdesc->addr + stuff->offset);
     if (pMap)
     {
-#ifdef PIXPRIV
 	pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc;
-#endif
 	shmdesc->refcnt++;
 	pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
 	pMap->drawable.id = stuff->pid;
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
index 6801960..6a3a485 100644
--- a/afb/afbpixmap.c
+++ b/afb/afbpixmap.c
@@ -102,12 +102,8 @@ afbCreatePixmap(pScreen, width, height, depth)
 	pPixmap->drawable.height = height;
 	pPixmap->devKind = paddedWidth;
 	pPixmap->refcnt = 1;
-#ifdef PIXPRIV
 	pPixmap->devPrivate.ptr =  datasize ?
 				(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-	pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
 	return(pPixmap);
 }
 
diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c
index d51c518..6fdf3ea 100644
--- a/cfb/cfbpixmap.c
+++ b/cfb/cfbpixmap.c
@@ -96,12 +96,8 @@ cfbCreatePixmap (pScreen, width, height, depth)
     pPixmap->drawable.height = height;
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr = datasize ?
 		(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-    pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
     return pPixmap;
 }
 
diff --git a/dix/main.c b/dix/main.c
index 3a77533..92c30b6 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -361,9 +361,7 @@ main(int argc, char *argv[], char *envp[])
 	ResetScreenPrivates();
 	ResetWindowPrivates();
 	ResetGCPrivates();
-#ifdef PIXPRIV
 	ResetPixmapPrivates();
-#endif
 	ResetColormapPrivates();
 	ResetFontPrivateIndex();
 	ResetDevicePrivateIndex();
@@ -731,11 +729,9 @@ AddScreen(
     pScreen->GCPrivateSizes = (unsigned *)NULL;
     pScreen->totalGCSize =
         ((sizeof(GC) + sizeof(long) - 1) / sizeof(long)) * sizeof(long);
-#ifdef PIXPRIV
     pScreen->PixmapPrivateLen = 0;
     pScreen->PixmapPrivateSizes = (unsigned *)NULL;
     pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8);
-#endif
     pScreen->ClipNotify = 0;	/* for R4 ddx compatibility */
     pScreen->CreateScreenResources = 0;
     
@@ -799,9 +795,7 @@ FreeScreen(ScreenPtr pScreen)
 {
     xfree(pScreen->WindowPrivateSizes);
     xfree(pScreen->GCPrivateSizes);
-#ifdef PIXPRIV
     xfree(pScreen->PixmapPrivateSizes);
-#endif
     xfree(pScreen->devPrivates);
     xfree(pScreen);
 }
diff --git a/dix/privates.c b/dix/privates.c
index b20a1db..a61c3cb 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -309,7 +309,6 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
 /*
  *  pixmap private machinery
  */
-#ifdef PIXPRIV
 static int  pixmapPrivateCount;
 
 void
@@ -355,7 +354,6 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
     pScreen->totalPixmapSize = BitmapBytePad(pScreen->totalPixmapSize * 8);
     return TRUE;
 }
-#endif
 
 
 /*
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index c2ddcb0..18c1204 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -43,11 +43,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
     if (paddedWidth / 4 > 32767 || height > 32767)
 	return NullPixmap;
     datasize = height * paddedWidth;
-#ifdef PIXPRIV
     base = pScreen->totalPixmapSize;
-#else
-    base = sizeof (PixmapRec);
-#endif
     adjust = 0;
     if (base & 7)
 	adjust = 8 - (base & 7);
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 4a669fd..9340606 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -49,15 +49,11 @@
 /** Initialize a private area in \a pScreen for pixmap information. */
 Bool dmxInitPixmap(ScreenPtr pScreen)
 {
-#ifdef PIXPRIV
     if (!AllocatePixmapPrivate(pScreen, dmxPixPrivateIndex,
 			       sizeof(dmxPixPrivRec)))
 	return FALSE;
 
     return TRUE;
-#else
-#error Must define PIXPRIV to compile DMX X server
-#endif
 }
 
 /** Create a pixmap on the back-end server. */
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index 5bfb4df..7c315d8 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -70,9 +70,7 @@ static unsigned long *dmxCursorGeneration;
 
 int dmxGCPrivateIndex;          /**< Private index for GCs       */
 int dmxWinPrivateIndex;         /**< Private index for Windows   */
-#ifdef PIXPRIV
 int dmxPixPrivateIndex;         /**< Private index for Pixmaps   */
-#endif
 int dmxFontPrivateIndex;        /**< Private index for Fonts     */
 int dmxScreenPrivateIndex;      /**< Private index for Screens   */
 int dmxColormapPrivateIndex;    /**< Private index for Colormaps */
@@ -233,14 +231,10 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
 	if (dmxWinPrivateIndex == -1)
 	    return FALSE;
 
-#ifdef PIXPRIV
 	/* Allocate pixmap private index */
 	dmxPixPrivateIndex = AllocatePixmapPrivateIndex();
 	if (dmxPixPrivateIndex == -1)
 	    return FALSE;
-#else
-#error Must define PIXPRIV to compile DMX X server
-#endif
 
 	/* Allocate font private index */
 	dmxFontPrivateIndex = AllocateFontPrivateIndex();
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 32e0e4f..594bf43 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -271,10 +271,8 @@ _X_HIDDEN void *dixLookupTab[] = {
     SYMFUNC(AllocateColormapPrivateIndex)
     SYMFUNC(AllocateDevicePrivateIndex)
     SYMFUNC(AllocateDevicePrivate)
-#ifdef PIXPRIV
     SYMFUNC(AllocatePixmapPrivateIndex)
     SYMFUNC(AllocatePixmapPrivate)
-#endif
     /* resource.c */
     SYMFUNC(AddResource)
     SYMFUNC(ChangeResourceValue)
diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c
index 9f4cdc9..9b2defd 100644
--- a/hw/xfree86/xf4bpp/ppcPixmap.c
+++ b/hw/xfree86/xf4bpp/ppcPixmap.c
@@ -120,12 +120,8 @@ xf4bppCreatePixmap( pScreen, width, height, depth )
     pPixmap->devKind = size;
     pPixmap->refcnt = 1 ;
     size = height * pPixmap->devKind ;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap)
 					 + pScreen->totalPixmapSize);
-#else
-    pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1);
-#endif
     bzero( (char *) pPixmap->devPrivate.ptr, size ) ;
     return pPixmap ;
 }
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index aa8bed9..612df8d 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -32,9 +32,7 @@ is" without express or implied warranty.
 #include "Screen.h"
 #include "XNPixmap.h"
 
-#ifdef PIXPRIV
 int xnestPixmapPrivateIndex;	    
-#endif
 
 PixmapPtr
 xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
@@ -57,12 +55,8 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
   pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
   pPixmap->refcnt = 1;
   pPixmap->devKind = PixmapBytePad(width, depth);
-#ifdef PIXPRIV
   pPixmap->devPrivates[xnestPixmapPrivateIndex].ptr =
       (pointer)((char *)pPixmap + pScreen->totalPixmapSize);
-#else
-  pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
   if (width && height)
       xnestPixmapPriv(pPixmap)->pixmap = 
 	  XCreatePixmap(xnestDisplay, 
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 8e86efb..e6870e7 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -49,9 +49,7 @@ Window xnestScreenSaverWindows[MAXSCREENS];
 extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
 #endif
 
-#ifdef PIXPRIV
 int xnestScreenGeneration = -1;
-#endif
 
 ScreenPtr
 xnestScreen(Window window)
@@ -154,7 +152,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
 			    sizeof(xnestPrivGC)))) 
     return False;
 
-#ifdef PIXPRIV
   if (xnestScreenGeneration != serverGeneration) {
       if ((xnestPixmapPrivateIndex = AllocatePixmapPrivateIndex()) < 0)
 	  return False;
@@ -164,7 +161,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
   if (!AllocatePixmapPrivate(pScreen,xnestPixmapPrivateIndex,
 			     sizeof (xnestPrivPixmap)))
       return False;
-#endif
   visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec));
   numVisuals = 0;
 
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index 77cba24..6971b11 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -15,21 +15,14 @@ is" without express or implied warranty.
 #ifndef XNESTPIXMAP_H
 #define XNESTPIXMAP_H
 
-#ifdef PIXPRIV
 extern int xnestPixmapPrivateIndex;
-#endif
 
 typedef struct {
   Pixmap pixmap;
 } xnestPrivPixmap;
 
-#ifdef PIXPRIV
 #define xnestPixmapPriv(pPixmap) \
   ((xnestPrivPixmap *)((pPixmap)->devPrivates[xnestPixmapPrivateIndex].ptr))
-#else
-#define xnestPixmapPriv(pPixmap) \
-  ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr))
-#endif
 
 #define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap)
 
diff --git a/include/pixmapstr.h b/include/pixmapstr.h
index 628465b..93bd45d 100644
--- a/include/pixmapstr.h
+++ b/include/pixmapstr.h
@@ -86,9 +86,7 @@ typedef struct _Pixmap {
     int			refcnt;
     int			devKind;
     DevUnion		devPrivate;
-#ifdef PIXPRIV
     DevUnion		*devPrivates; /* real devPrivates like gcs & windows */
-#endif
 #ifdef COMPOSITE
     short		screen_x;
     short		screen_y;
diff --git a/include/screenint.h b/include/screenint.h
index e60c248..1f1434a 100644
--- a/include/screenint.h
+++ b/include/screenint.h
@@ -86,8 +86,6 @@ extern int AddScreen(
     int /*argc*/,
     char** /*argv*/);
 
-#ifdef PIXPRIV
-
 extern void ResetPixmapPrivates(void);
 
 extern int AllocatePixmapPrivateIndex(void);
@@ -97,8 +95,6 @@ extern Bool AllocatePixmapPrivate(
     int /* index */,
     unsigned /* amount */);
 
-#endif /* PIXPRIV */
-
 extern void ResetColormapPrivates(void);
 
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 3613515..110f4dc 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -558,11 +558,9 @@ typedef struct _Screen {
 
     PixmapPtr pScratchPixmap;		/* scratch pixmap "pool" */
 
-#ifdef PIXPRIV
     int			PixmapPrivateLen;
     unsigned int		*PixmapPrivateSizes;
     unsigned int		totalPixmapSize;
-#endif
 
     MarkWindowProcPtr		MarkWindow;
     MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c
index 5ec8502..e349724 100644
--- a/mfb/mfbpixmap.c
+++ b/mfb/mfbpixmap.c
@@ -101,12 +101,8 @@ mfbCreatePixmap (pScreen, width, height, depth)
     pPixmap->drawable.height = height;
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
-#ifdef PIXPRIV
     pPixmap->devPrivate.ptr =  datasize ?
 		(pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL;
-#else
-    pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1);
-#endif
     return pPixmap;
 }
 
-- 1.4.4.2




More information about the xorg mailing list