xserver: Branch 'master' - 25 commits

Adam Jackson ajax at kemper.freedesktop.org
Fri Oct 3 14:07:39 PDT 2008


 dix/events.c                         |   25 --
 dix/main.c                           |    3 
 hw/xfree86/common/xf86.h             |    8 
 hw/xfree86/common/xf86Bus.c          |  301 +++++++----------------------------
 hw/xfree86/common/xf86Bus.h          |    9 -
 hw/xfree86/common/xf86str.h          |   12 -
 hw/xfree86/loader/dixsym.c           |    4 
 hw/xfree86/loader/misym.c            |  176 ++++++++------------
 hw/xfree86/loader/xf86sym.c          |   15 -
 hw/xfree86/os-support/bus/Pci.c      |    1 
 hw/xfree86/os-support/bus/bsd_pci.c  |    1 
 hw/xfree86/os-support/bus/ix86Pci.c  |    2 
 hw/xfree86/os-support/bus/linuxPci.c |    1 
 hw/xfree86/os-support/bus/xf86Pci.h  |    2 
 hw/xquartz/quartz.c                  |    2 
 include/extension.h                  |    2 
 include/globals.h                    |    1 
 include/os.h                         |    8 
 mi/mi.h                              |    8 
 mi/mibank.c                          |   54 ------
 mi/mibank.h                          |    6 
 mi/mibitblt.c                        |    4 
 mi/micmap.c                          |   28 ---
 mi/micmap.h                          |    7 
 mi/micursor.c                        |   15 -
 mi/midash.c                          |    2 
 mi/miexpose.c                        |    4 
 mi/migc.c                            |   27 ---
 mi/migc.h                            |    8 
 mi/miinitext.c                       |   25 --
 mi/mipolycon.c                       |    2 
 mi/mipushpxl.c                       |    2 
 mi/miregion.c                        |   30 ---
 mi/miscrinit.c                       |   28 +--
 mi/mivaltree.c                       |    2 
 mi/miwindow.c                        |    6 
 mi/mizerline.c                       |    2 
 os/connection.c                      |    4 
 os/io.c                              |    8 
 os/utils.c                           |   76 ++------
 randr/rrscreen.c                     |    2 
 record/record.c                      |   93 ----------
 42 files changed, 211 insertions(+), 805 deletions(-)

New commits:
commit 9dbfcd89214241626ac2704d1ffffff1cc0c67ae
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:40:30 2008 -0400

    Delete unused miModifyBanking()

diff --git a/mi/mibank.c b/mi/mibank.c
index 32d52fe..68415e6 100644
--- a/mi/mibank.c
+++ b/mi/mibank.c
@@ -67,7 +67,6 @@
  *   dropped due to colour flashing concerns.
  *
  * TODO:
- * - Allow miModifyBanking() to change BankSize and nBankDepth.
  * - Re-instate shared and double banking for framebuffers whose pixmap formats
  *   don't describe how the server "sees" the screen.
  * - Remove remaining assumptions that a pixmap's devPrivate field points
@@ -2216,59 +2215,6 @@ miBankNewSerialNumber(
     return WT_WALKCHILDREN;
 }
 
-/* This entry modifies the banking interface */
-Bool
-miModifyBanking(
-    ScreenPtr     pScreen,
-    miBankInfoPtr pBankInfo
-)
-{
-    unsigned int type;
-
-    if (!pScreen)
-        return FALSE;
-
-    if (miBankGeneration == serverGeneration)
-    {
-        SCREEN_INIT;
-
-        if (pScreenPriv)
-        {
-            if (!pBankInfo || !pBankInfo->BankSize ||
-                !pBankInfo->pBankA || !pBankInfo->pBankB ||
-                !pBankInfo->SetSourceBank || !pBankInfo->SetDestinationBank ||
-                !pBankInfo->SetSourceAndDestinationBanks)
-                return FALSE;
-
-            /* BankSize and nBankDepth cannot, as yet, be changed */
-            if ((pScreenPriv->BankInfo.BankSize != pBankInfo->BankSize) ||
-                (pScreenPriv->BankInfo.nBankDepth != pBankInfo->nBankDepth))
-                return FALSE;
-
-            if ((type = miBankDeriveType(pScreen, pBankInfo)) == BANK_NOBANK)
-                return FALSE;
-
-            /* Reset banking info */
-            pScreenPriv->BankInfo = *pBankInfo;
-            if (type != pScreenPriv->type)
-            {
-                /*
-                 * Banking type is changing.  Revalidate all window GC's.
-                 */
-                pScreenPriv->type = type;
-                WalkTree(pScreen, miBankNewSerialNumber, 0);
-            }
-
-            return TRUE;
-        }
-    }
-
-    if (!pBankInfo || !pBankInfo->BankSize)
-        return TRUE;                            /* No change requested */
-
-    return FALSE;
-}
-
 /*
  * Given various screen attributes, determine the minimum scanline width such
  * that each scanline is server and DDX padded and any pixels with imbedded
diff --git a/mi/mibank.h b/mi/mibank.h
index fe93ab4..327507d 100644
--- a/mi/mibank.h
+++ b/mi/mibank.h
@@ -94,12 +94,6 @@ miInitializeBanking(
     miBankInfoPtr /*pBankInfo*/
 );
 
-Bool
-miModifyBanking(
-    ScreenPtr /*pScreen*/,
-    miBankInfoPtr /*pBankInfo*/
-);
-
 /*
  * This function determines the minimum screen width, given a initial estimate
  * and various screen attributes.  DDX needs to determine this width before
commit 94825ad3c72a1c3f6a61199c302841f63241cf87
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:39:34 2008 -0400

    Remove unused wrapping for visual initialization.

diff --git a/dix/main.c b/dix/main.c
index f021511..9a6f2d6 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -307,7 +307,6 @@ int main(int argc, char *argv[], char *envp[])
 	dixResetRegistry();
 	ResetFontPrivateIndex();
 	InitCallbackManager();
-	InitVisualWrap();
 	InitOutput(&screenInfo, argc, argv);
 
 	if (screenInfo.numScreens < 1)
diff --git a/include/extension.h b/include/extension.h
index 6e60817..14526e9 100644
--- a/include/extension.h
+++ b/include/extension.h
@@ -60,8 +60,6 @@ extern void EnableDisableExtensionError(char *name, Bool enable);
 
 extern void InitExtensions(int argc, char **argv);
 
-extern void InitVisualWrap(void);
-
 extern void CloseDownExtensions(void);
 
 _XFUNCPROTOEND
diff --git a/mi/micmap.c b/mi/micmap.c
index 60dacc3..2d43e01 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -52,8 +52,6 @@ static Bool miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
 		int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
 		unsigned long sizes, int bitsPerRGB, int preferredVis);
 
-miInitVisualsProcPtr miInitVisualsProc = miDoInitVisuals;
-
 _X_EXPORT int
 miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
 {
@@ -479,20 +477,6 @@ miSetPixmapDepths (void)
     return TRUE;
 }
 
-_X_EXPORT Bool
-miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
-		int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
-		unsigned long sizes, int bitsPerRGB, int preferredVis)
-
-{
-    if (miInitVisualsProc)
-	return miInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
-				 rootDepthp, defaultVisp, sizes, bitsPerRGB,
-				 preferredVis);
-    else
-	return FALSE;
-}
-
 /*
  * Distance to least significant one bit
  */
@@ -517,10 +501,11 @@ maskShift (Pixel p)
  * the set which can be used with this version of cfb.
  */
 
-static Bool
-miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
+_X_EXPORT Bool
+miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
 		int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
 		unsigned long sizes, int bitsPerRGB, int preferredVis)
+
 {
     int		i, j = 0, k;
     VisualPtr	visual;
@@ -688,10 +673,3 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
 
     return TRUE;
 }
-
-void
-miResetInitVisuals(void)
-{
-    miInitVisualsProc = miDoInitVisuals;
-}
-
diff --git a/mi/micmap.h b/mi/micmap.h
index 9ee9f4a..667004b 100644
--- a/mi/micmap.h
+++ b/mi/micmap.h
@@ -10,8 +10,6 @@ typedef Bool (* miInitVisualsProcPtr)(VisualPtr *, DepthPtr *, int *, int *,
 					int *, VisualID *, unsigned long, int,
 					int);
 
-extern miInitVisualsProcPtr miInitVisualsProc;
-					
 int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
 void miInstallColormap(ColormapPtr pmap);
 void miUninstallColormap(ColormapPtr pmap);
@@ -30,11 +28,6 @@ Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
 int miGetDefaultVisualMask(int);
 Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *,
 			unsigned long, int, int);
-void miResetInitVisuals(void);
-
-void miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
-		       void (*new)(miInitVisualsProcPtr *));
-
 
 #define MAX_PSEUDO_DEPTH	10
 #define MIN_TRUE_DEPTH		6
diff --git a/mi/miinitext.c b/mi/miinitext.c
index cea8984..3a943b3 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -491,12 +491,6 @@ InitExtensions(int argc, char *argv[])
 #endif
 }
 
-void
-InitVisualWrap()
-{
-    miResetInitVisuals();
-}
-
 #else /* XFree86LOADER */
 /* List of built-in (statically linked) extensions */
 static ExtensionModule staticExtensions[] = {
@@ -574,23 +568,4 @@ InitExtensions(int argc, char *argv[])
     }
 }
 
-static void (*__miHookInitVisualsFunction)(miInitVisualsProcPtr *);
-
-void
-InitVisualWrap()
-{
-    miResetInitVisuals();
-    if (__miHookInitVisualsFunction)
-	(*__miHookInitVisualsFunction)(&miInitVisualsProc);
-}
-
-void
-miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
-		  void (*new)(miInitVisualsProcPtr *))
-{
-    if (old)
-	*old = __miHookInitVisualsFunction;
-    __miHookInitVisualsFunction = new;
-}
-
 #endif /* XFree86LOADER */
commit 4791f8e2ba9a0e318b7f13c83618ece036dd53ed
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:23:58 2008 -0400

    staticize mi{G,S}etScreenPixmap

diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 2008a68..28d3316 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -189,6 +189,19 @@ miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits)
     return TRUE;
 }
 
+static PixmapPtr
+miGetScreenPixmap(ScreenPtr pScreen)
+{
+    return (PixmapPtr)(pScreen->devPrivate);
+}
+
+static void
+miSetScreenPixmap(PixmapPtr pPix)
+{
+    if (pPix)
+	pPix->drawable.pScreen->devPrivate = (pointer)pPix;
+}
+
 _X_EXPORT Bool
 miScreenInit(
     ScreenPtr pScreen,
@@ -297,16 +310,3 @@ miSetZeroLineBias(ScreenPtr pScreen, unsigned int bias)
 {
     dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, (pointer)bias);
 }
-
-PixmapPtr
-miGetScreenPixmap(ScreenPtr pScreen)
-{
-    return (PixmapPtr)(pScreen->devPrivate);
-}
-
-void
-miSetScreenPixmap(PixmapPtr pPix)
-{
-    if (pPix)
-	pPix->drawable.pScreen->devPrivate = (pointer)pPix;
-}
commit 14d98b4a2fdea4a4f5cc9b751151672cb392fba3
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:21:16 2008 -0400

    miFindMaxBand is dead code

diff --git a/mi/mi.h b/mi/mi.h
index 8bacaa7..e38bf38 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -369,10 +369,6 @@ extern Bool miRectAlloc(
     int /*n*/
 );
 
-extern int miFindMaxBand(
-    RegionPtr /*prgn*/
-);
-
 #ifdef DEBUG
 extern Bool miValidRegion(
     RegionPtr /*prgn*/
diff --git a/mi/miregion.c b/mi/miregion.c
index be97934..bbeac87 100644
--- a/mi/miregion.c
+++ b/mi/miregion.c
@@ -1843,33 +1843,3 @@ miClipSpans(
     }
     return (pwidthNew - pwidthNewStart);
 }
-
-/* find the band in a region with the most rectangles */
-_X_EXPORT int
-miFindMaxBand(RegionPtr prgn)
-{
-    int nbox;
-    BoxPtr pbox;
-    int nThisBand;
-    int nMaxBand = 0;
-    short yThisBand;
-
-    good(prgn);
-    nbox = REGION_NUM_RECTS(prgn);
-    pbox = REGION_RECTS(prgn);
-
-    while(nbox > 0)
-    {
-	yThisBand = pbox->y1;
-	nThisBand = 0;
-	while((nbox > 0) && (pbox->y1 == yThisBand))
-	{
-	    nbox--;
-	    pbox++;
-	    nThisBand++;
-	}
-	if (nThisBand > nMaxBand)
-	    nMaxBand = nThisBand;
-    }
-    return (nMaxBand);
-}
commit 48b47928133bc462947104bd0f4204f00b993862
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:16:28 2008 -0400

    mi{Create,Destroy}GCOps are unused, nuke 'em.

diff --git a/mi/migc.c b/mi/migc.c
index c846659..17931be 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -54,31 +54,6 @@ miDestroyGC(GCPtr pGC)
     miDestroyGCOps(pGC->ops);
 }
 
-/*
- * create a private op array for a gc
- */
-
-GCOpsPtr
-miCreateGCOps(GCOpsPtr prototype)
-{
-    GCOpsPtr        ret;
-
-    ret = xalloc(sizeof(GCOps));
-    if (!ret)
-	return NULL;
-    *ret = *prototype;
-    ret->devPrivate.val = 1;
-    return ret;
-}
-
-void
-miDestroyGCOps(GCOpsPtr ops)
-{
-    if (ops->devPrivate.val)
-	xfree(ops);
-}
-
-
 _X_EXPORT void
 miDestroyClip(GCPtr pGC)
 {
diff --git a/mi/migc.h b/mi/migc.h
index 84dc75c..51ed7b6 100644
--- a/mi/migc.h
+++ b/mi/migc.h
@@ -36,14 +36,6 @@ extern void miDestroyGC(
     GCPtr  /*pGC*/
 );
 
-extern GCOpsPtr miCreateGCOps(
-    GCOpsPtr /*prototype*/
-);
-
-extern void miDestroyGCOps(
-    GCOpsPtr /*ops*/
-);
-
 extern void miDestroyClip(
     GCPtr /*pGC*/
 );
commit bd0e87c74789bd5447ec731aa2d2d6e05dd54abc
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 17:13:10 2008 -0400

    Remove a bunch of unused API from the mi export list.

diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index 1f9b9a6..91f2529 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -84,8 +84,6 @@
 extern miPointerSpriteFuncRec miSpritePointerFuncs;
 
 _X_HIDDEN void *miLookupTab[] = {
-    SYMFUNC(miAllocateGCPrivateIndex)
-    SYMFUNC(miChangeBorderWidth)
     SYMFUNC(miChangeClip)
     SYMFUNC(miChangeGC)
     SYMFUNC(miClearDrawable)
@@ -93,29 +91,19 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miClearVisualTypes)
     SYMFUNC(miClipSpans)
     SYMFUNC(miComputeCompositeClip)
-    SYMFUNC(miCopyArea)
     SYMFUNC(miCopyClip)
     SYMFUNC(miCopyGC)
-    SYMFUNC(miCopyPlane)
     SYMFUNC(miCreateDefColormap)
-    SYMFUNC(miCreateGCOps)
     SYMFUNC(miCreateScreenResources)
     SYMFUNC(miDCInitialize)
     SYMFUNC(miDestroyClip)
     SYMFUNC(miDestroyGC)
-    SYMFUNC(miDestroyGCOps)
     SYMFUNC(miExpandDirectColors)
     SYMFUNC(miFillArcSetup)
     SYMFUNC(miFillArcSliceSetup)
-    SYMFUNC(miFillConvexPoly)
     SYMFUNC(miFillPolygon)
-    SYMFUNC(miFindMaxBand)
     SYMFUNC(miGetDefaultVisualMask)
-    SYMFUNC(miGetImage)
-    SYMFUNC(miGetScreenPixmap)
     SYMFUNC(miHandleExposures)
-    SYMFUNC(miHandleValidateExposures)
-    SYMFUNC(miHookInitVisuals)
     SYMFUNC(miImageGlyphBlt)
     SYMFUNC(miImageText16)
     SYMFUNC(miImageText8)
@@ -128,7 +116,6 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miIntersect)
     SYMFUNC(miInverse)
     SYMFUNC(miListInstalledColormaps)
-    SYMFUNC(miModifyBanking)
     SYMFUNC(miModifyPixmapHeader)
     SYMFUNC(miOverlayCollectUnderlayRegions)
     SYMFUNC(miOverlayComputeCompositeClip)
@@ -136,7 +123,6 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miOverlayGetPrivateClips)
     SYMFUNC(miOverlaySetRootClip)
     SYMFUNC(miOverlaySetTransFunction)
-    SYMFUNC(miPaintWindow)
     SYMFUNC(miPointInRegion)
     SYMFUNC(miPointerAbsoluteCursor)
     SYMFUNC(miPointerCurrentScreen)
@@ -153,9 +139,6 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miPolySegment)
     SYMFUNC(miPolyText16)
     SYMFUNC(miPolyText8)
-    SYMFUNC(miPushPixels)
-    SYMFUNC(miPutImage)
-    SYMFUNC(miRecolorCursor)
     SYMFUNC(miRectAlloc)
     SYMFUNC(miRectIn)
     SYMFUNC(miRectsToRegion)
@@ -176,15 +159,10 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miRoundJoinClip)
     SYMFUNC(miScreenInit)
     SYMFUNC(miSegregateChildren)
-    SYMFUNC(miSendGraphicsExpose)
     SYMFUNC(miSetPixmapDepths)
-    SYMFUNC(miSetScreenPixmap)
-    SYMFUNC(miSetShape)
     SYMFUNC(miSetVisualTypes)
     SYMFUNC(miSetVisualTypesAndMasks)
     SYMFUNC(miSetZeroLineBias)
-    SYMFUNC(miShapedWindowIn)
-    SYMFUNC(miStepDash)
     SYMFUNC(miSubtract)
     SYMFUNC(miTranslateRegion)
     SYMFUNC(miUninstallColormap)
@@ -194,12 +172,10 @@ _X_HIDDEN void *miLookupTab[] = {
     SYMFUNC(miWindowExposures)
     SYMFUNC(miZeroArcSetup)
     SYMFUNC(miZeroClipLine)
-    SYMFUNC(miZeroDashLine)
     SYMFUNC(miZeroLine)
     SYMFUNC(miZeroPolyArc)
     SYMVAR(miEmptyBox)
     SYMVAR(miEmptyData)
-    SYMVAR(miInitVisualsProc)
     SYMVAR(miInstalledMaps)
     SYMVAR(miPointerScreenKey)
     SYMVAR(miSpritePointerFuncs)
diff --git a/mi/mi.h b/mi/mi.h
index 45bfa1d..8bacaa7 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -423,10 +423,6 @@ extern DevPrivateKey miAllocateGCPrivateIndex(
     void
 );
 
-extern PixmapPtr miGetScreenPixmap(
-    ScreenPtr pScreen
-);
-
 extern void miSetScreenPixmap(
     PixmapPtr pPix
 );
diff --git a/mi/mibank.c b/mi/mibank.c
index 92288ab..32d52fe 100644
--- a/mi/mibank.c
+++ b/mi/mibank.c
@@ -2217,7 +2217,7 @@ miBankNewSerialNumber(
 }
 
 /* This entry modifies the banking interface */
-_X_EXPORT Bool
+Bool
 miModifyBanking(
     ScreenPtr     pScreen,
     miBankInfoPtr pBankInfo
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 168b915..99375b6 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -73,7 +73,7 @@ extern int ffs(int);
  *     set them in the destination with SetSpans
  * We let SetSpans worry about clipping to the destination.
  */
-_X_EXPORT RegionPtr
+RegionPtr
 miCopyArea(DrawablePtr  pSrcDrawable,
            DrawablePtr  pDstDrawable,
            GCPtr        pGC,
@@ -549,7 +549,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
  * build a source clip
  * Use the bitmap we've built up as a Stipple for the destination 
  */
-_X_EXPORT RegionPtr
+RegionPtr
 miCopyPlane( DrawablePtr pSrcDrawable,
              DrawablePtr pDstDrawable,
              GCPtr pGC,
diff --git a/mi/micmap.c b/mi/micmap.c
index 33d9481..60dacc3 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -52,7 +52,7 @@ static Bool miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
 		int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
 		unsigned long sizes, int bitsPerRGB, int preferredVis);
 
-_X_EXPORT miInitVisualsProcPtr miInitVisualsProc = miDoInitVisuals;
+miInitVisualsProcPtr miInitVisualsProc = miDoInitVisuals;
 
 _X_EXPORT int
 miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
diff --git a/mi/micursor.c b/mi/micursor.c
index 8b16490..f6ae8f4 100644
--- a/mi/micursor.c
+++ b/mi/micursor.c
@@ -54,7 +54,7 @@ SOFTWARE.
 #include "mi.h"
 #include "inputstr.h"
 
-_X_EXPORT void
+void
 miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr,
                 CursorPtr pCurs, Bool displayed)
 {
diff --git a/mi/midash.c b/mi/midash.c
index 40c741b..ba64d35 100644
--- a/mi/midash.c
+++ b/mi/midash.c
@@ -52,7 +52,7 @@ SOFTWARE.
 #include "mistruct.h"
 #include "mifpoly.h"
 
-_X_EXPORT void
+void
 miStepDash (
     int dist,			/* distance to step */
     int *pDashIndex,		/* current dash */
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 9fbcdd7..f8a9e2f 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -341,7 +341,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 
 /* send GraphicsExpose events, or a NoExpose event, based on the region */
 
-_X_EXPORT void
+void
 miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
                       int major, int minor)
 {
@@ -514,7 +514,7 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
 	REGION_DESTROY( pWin->drawable.pScreen, exposures);
 }
 
-_X_EXPORT void
+void
 miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 {
     ScreenPtr	pScreen = pWin->drawable.pScreen;
diff --git a/mi/migc.c b/mi/migc.c
index 8590d91..c846659 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -58,7 +58,7 @@ miDestroyGC(GCPtr pGC)
  * create a private op array for a gc
  */
 
-_X_EXPORT GCOpsPtr
+GCOpsPtr
 miCreateGCOps(GCOpsPtr prototype)
 {
     GCOpsPtr        ret;
@@ -71,7 +71,7 @@ miCreateGCOps(GCOpsPtr prototype)
     return ret;
 }
 
-_X_EXPORT void
+void
 miDestroyGCOps(GCOpsPtr ops)
 {
     if (ops->devPrivate.val)
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 6516f43..cea8984 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -584,7 +584,7 @@ InitVisualWrap()
 	(*__miHookInitVisualsFunction)(&miInitVisualsProc);
 }
 
-_X_EXPORT void
+void
 miHookInitVisuals(void (**old)(miInitVisualsProcPtr *),
 		  void (*new)(miInitVisualsProcPtr *))
 {
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
index 085bed3..6e38896 100644
--- a/mi/mipolycon.c
+++ b/mi/mipolycon.c
@@ -71,7 +71,7 @@ static int getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty);
  *     For a derivation of the algorithm, see the author of
  *     this code.
  */
-_X_EXPORT Bool
+Bool
 miFillConvexPoly(
     DrawablePtr dst,
     GCPtr	pgc,
diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c
index 87ca144..4b97890 100644
--- a/mi/mipushpxl.c
+++ b/mi/mipushpxl.c
@@ -92,7 +92,7 @@ bitsizeof(int) padding and sacnline unit == bitsizeof(int).)
  * in order to have both (MSB_FIRST and LSB_FIRST) versions of this
  * in the server, we need to rename one of them
  */
-_X_EXPORT void
+void
 miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
              int dx, int dy, int xOrg, int yOrg)
 {
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index df96993..2008a68 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -283,7 +283,7 @@ miScreenInit(
 static int privateKeyIndex;
 static DevPrivateKey privateKey = &privateKeyIndex;
 
-_X_EXPORT DevPrivateKey
+DevPrivateKey
 miAllocateGCPrivateIndex()
 {
     return privateKey;
@@ -298,13 +298,13 @@ miSetZeroLineBias(ScreenPtr pScreen, unsigned int bias)
     dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, (pointer)bias);
 }
 
-_X_EXPORT PixmapPtr
+PixmapPtr
 miGetScreenPixmap(ScreenPtr pScreen)
 {
     return (PixmapPtr)(pScreen->devPrivate);
 }
 
-_X_EXPORT void
+void
 miSetScreenPixmap(PixmapPtr pPix)
 {
     if (pPix)
diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index 92dcffe..2585422 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -106,7 +106,7 @@ Equipment Corporation.
 /*
  * Compute the visibility of a shaped window
  */
-_X_EXPORT int
+int
 miShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, RegionPtr bounding,
                   BoxPtr rect, int x, int y)
 {
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 8c4b6d0..498c8a6 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -223,7 +223,7 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin)
  *    regions, translate the regions, restore any backing store,
  *    and then send any regions still exposed to the client
  *****/
-_X_EXPORT void
+void
 miHandleValidateExposures(WindowPtr pWin)
 {
     WindowPtr pChild;
@@ -694,7 +694,7 @@ miGetLayerWindow(WindowPtr pWin)
  *    and send appropriate exposure events
  */
 
-_X_EXPORT void
+void
 miSetShape(WindowPtr pWin)
 {
     Bool	WasViewable = (Bool)(pWin->viewable);
@@ -750,7 +750,7 @@ miSetShape(WindowPtr pWin)
 
 /* Keeps the same inside(!) origin */
 
-_X_EXPORT void
+void
 miChangeBorderWidth(WindowPtr pWin, unsigned int width)
 {
     int oldwidth;
diff --git a/mi/mizerline.c b/mi/mizerline.c
index e1e8e6e..a415d73 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -363,7 +363,7 @@ miZeroLine(
     xfree(pspanInit);
 }
 
-_X_EXPORT void
+void
 miZeroDashLine(
             DrawablePtr dst,
             GCPtr pgc,
commit ee5e07bc22f0c3af7a412b6bc430eae6a1dafe16
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 16:58:01 2008 -0400

    loader: sort the mi symbol list

diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index c754228..1f9b9a6 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -84,126 +84,126 @@
 extern miPointerSpriteFuncRec miSpritePointerFuncs;
 
 _X_HIDDEN void *miLookupTab[] = {
-    SYMFUNC(miClearToBackground)
-    SYMFUNC(miSendGraphicsExpose)
-    SYMFUNC(miModifyPixmapHeader)
-    SYMFUNC(miHandleValidateExposures)
-    SYMFUNC(miSetShape)
+    SYMFUNC(miAllocateGCPrivateIndex)
     SYMFUNC(miChangeBorderWidth)
-    SYMFUNC(miShapedWindowIn)
-    SYMFUNC(miRectIn)
-    SYMFUNC(miZeroClipLine)
-    SYMFUNC(miZeroDashLine)
+    SYMFUNC(miChangeClip)
+    SYMFUNC(miChangeGC)
     SYMFUNC(miClearDrawable)
-    SYMFUNC(miPolyPoint)
-    SYMFUNC(miStepDash)
-    SYMFUNC(miIntersect)
-    SYMFUNC(miRegionAppend)
-    SYMFUNC(miRegionCopy)
-    SYMFUNC(miRegionDestroy)
-    SYMFUNC(miRegionEmpty)
-    SYMFUNC(miRegionExtents)
-    SYMFUNC(miRegionInit)
-    SYMFUNC(miRegionNotEmpty)
-    SYMFUNC(miRegionEqual)
-    SYMFUNC(miRegionReset)
-    SYMFUNC(miRegionUninit)
-    SYMFUNC(miRegionValidate)
-    SYMFUNC(miTranslateRegion)
-    SYMFUNC(miHandleExposures)
-    SYMFUNC(miPolyFillRect)
-    SYMFUNC(miPolyFillArc)
-    SYMFUNC(miImageGlyphBlt)
-    SYMFUNC(miPolyGlyphBlt)
-    SYMFUNC(miFillPolygon)
-    SYMFUNC(miFillConvexPoly)
-    SYMFUNC(miPolySegment)
-    SYMFUNC(miZeroLine)
-    SYMFUNC(miWideLine)
-    SYMFUNC(miWideDash)
-    SYMFUNC(miZeroPolyArc)
-    SYMFUNC(miPolyArc)
-    SYMFUNC(miCreateGCOps)
-    SYMFUNC(miDestroyGCOps)
+    SYMFUNC(miClearToBackground)
+    SYMFUNC(miClearVisualTypes)
+    SYMFUNC(miClipSpans)
     SYMFUNC(miComputeCompositeClip)
-    SYMFUNC(miChangeGC)
+    SYMFUNC(miCopyArea)
+    SYMFUNC(miCopyClip)
     SYMFUNC(miCopyGC)
-    SYMFUNC(miDestroyGC)
-    SYMFUNC(miChangeClip)
+    SYMFUNC(miCopyPlane)
+    SYMFUNC(miCreateDefColormap)
+    SYMFUNC(miCreateGCOps)
+    SYMFUNC(miCreateScreenResources)
+    SYMFUNC(miDCInitialize)
     SYMFUNC(miDestroyClip)
-    SYMFUNC(miCopyClip)
-    SYMFUNC(miPolyRectangle)
-    SYMFUNC(miPolyText8)
-    SYMFUNC(miPolyText16)
-    SYMFUNC(miImageText8)
-    SYMFUNC(miImageText16)
-    SYMFUNC(miRegionCreate)
-    SYMFUNC(miPaintWindow)
-    SYMFUNC(miZeroArcSetup)
+    SYMFUNC(miDestroyGC)
+    SYMFUNC(miDestroyGCOps)
+    SYMFUNC(miExpandDirectColors)
     SYMFUNC(miFillArcSetup)
     SYMFUNC(miFillArcSliceSetup)
+    SYMFUNC(miFillConvexPoly)
+    SYMFUNC(miFillPolygon)
     SYMFUNC(miFindMaxBand)
-    SYMFUNC(miClipSpans)
-    SYMFUNC(miAllocateGCPrivateIndex)
-    SYMFUNC(miScreenInit)
+    SYMFUNC(miGetDefaultVisualMask)
+    SYMFUNC(miGetImage)
     SYMFUNC(miGetScreenPixmap)
-    SYMFUNC(miSetScreenPixmap)
-    SYMFUNC(miPointerCurrentScreen)
-    SYMFUNC(miRectAlloc)
+    SYMFUNC(miHandleExposures)
+    SYMFUNC(miHandleValidateExposures)
+    SYMFUNC(miHookInitVisuals)
+    SYMFUNC(miImageGlyphBlt)
+    SYMFUNC(miImageText16)
+    SYMFUNC(miImageText8)
+    SYMFUNC(miInitOverlay)
+    SYMFUNC(miInitVisuals)
     SYMFUNC(miInitializeBackingStore)
     SYMFUNC(miInitializeBanking)
+    SYMFUNC(miInitializeColormap)
+    SYMFUNC(miInstallColormap)
+    SYMFUNC(miIntersect)
+    SYMFUNC(miInverse)
+    SYMFUNC(miListInstalledColormaps)
     SYMFUNC(miModifyBanking)
-    SYMFUNC(miCopyPlane)
-    SYMFUNC(miCopyArea)
-    SYMFUNC(miCreateScreenResources)
-    SYMFUNC(miGetImage)
-    SYMFUNC(miPutImage)
-    SYMFUNC(miPushPixels)
+    SYMFUNC(miModifyPixmapHeader)
+    SYMFUNC(miOverlayCollectUnderlayRegions)
+    SYMFUNC(miOverlayComputeCompositeClip)
+    SYMFUNC(miOverlayCopyUnderlay)
+    SYMFUNC(miOverlayGetPrivateClips)
+    SYMFUNC(miOverlaySetRootClip)
+    SYMFUNC(miOverlaySetTransFunction)
+    SYMFUNC(miPaintWindow)
+    SYMFUNC(miPointInRegion)
+    SYMFUNC(miPointerAbsoluteCursor)
+    SYMFUNC(miPointerCurrentScreen)
     SYMFUNC(miPointerInitialize)
-    SYMFUNC(miRecolorCursor)
     SYMFUNC(miPointerWarpCursor)
-    SYMFUNC(miDCInitialize)
-    SYMFUNC(miRectsToRegion)
-    SYMFUNC(miPointInRegion)
-    SYMFUNC(miInverse)
-    SYMFUNC(miSubtract)
-    SYMFUNC(miUnion)
+    SYMFUNC(miPolyArc)
     SYMFUNC(miPolyBuildEdge)
     SYMFUNC(miPolyBuildPoly)
-    SYMFUNC(miRoundJoinClip)
-    SYMFUNC(miRoundCapClip)
-    SYMFUNC(miSetZeroLineBias)
+    SYMFUNC(miPolyFillArc)
+    SYMFUNC(miPolyFillRect)
+    SYMFUNC(miPolyGlyphBlt)
+    SYMFUNC(miPolyPoint)
+    SYMFUNC(miPolyRectangle)
+    SYMFUNC(miPolySegment)
+    SYMFUNC(miPolyText16)
+    SYMFUNC(miPolyText8)
+    SYMFUNC(miPushPixels)
+    SYMFUNC(miPutImage)
+    SYMFUNC(miRecolorCursor)
+    SYMFUNC(miRectAlloc)
+    SYMFUNC(miRectIn)
+    SYMFUNC(miRectsToRegion)
+    SYMFUNC(miRegionAppend)
+    SYMFUNC(miRegionCopy)
+    SYMFUNC(miRegionCreate)
+    SYMFUNC(miRegionDestroy)
+    SYMFUNC(miRegionEmpty)
+    SYMFUNC(miRegionEqual)
+    SYMFUNC(miRegionExtents)
+    SYMFUNC(miRegionInit)
+    SYMFUNC(miRegionNotEmpty)
+    SYMFUNC(miRegionReset)
+    SYMFUNC(miRegionUninit)
+    SYMFUNC(miRegionValidate)
     SYMFUNC(miResolveColor)
-    SYMFUNC(miInitializeColormap)
-    SYMFUNC(miInstallColormap)
-    SYMFUNC(miUninstallColormap)
-    SYMFUNC(miListInstalledColormaps)
-    SYMFUNC(miExpandDirectColors)
-    SYMFUNC(miCreateDefColormap)
-    SYMFUNC(miClearVisualTypes)
+    SYMFUNC(miRoundCapClip)
+    SYMFUNC(miRoundJoinClip)
+    SYMFUNC(miScreenInit)
+    SYMFUNC(miSegregateChildren)
+    SYMFUNC(miSendGraphicsExpose)
+    SYMFUNC(miSetPixmapDepths)
+    SYMFUNC(miSetScreenPixmap)
+    SYMFUNC(miSetShape)
     SYMFUNC(miSetVisualTypes)
     SYMFUNC(miSetVisualTypesAndMasks)
-    SYMFUNC(miGetDefaultVisualMask)
-    SYMFUNC(miSetPixmapDepths)
-    SYMFUNC(miInitVisuals)
+    SYMFUNC(miSetZeroLineBias)
+    SYMFUNC(miShapedWindowIn)
+    SYMFUNC(miStepDash)
+    SYMFUNC(miSubtract)
+    SYMFUNC(miTranslateRegion)
+    SYMFUNC(miUninstallColormap)
+    SYMFUNC(miUnion)
+    SYMFUNC(miWideDash)
+    SYMFUNC(miWideLine)
     SYMFUNC(miWindowExposures)
-    SYMFUNC(miSegregateChildren)
-    SYMFUNC(miHookInitVisuals)
-    SYMFUNC(miPointerAbsoluteCursor)
-    SYMFUNC(miOverlayCopyUnderlay)
-    SYMFUNC(miOverlaySetTransFunction)
-    SYMFUNC(miOverlayCollectUnderlayRegions)
-    SYMFUNC(miInitOverlay)
-    SYMFUNC(miOverlayComputeCompositeClip)
-    SYMFUNC(miOverlayGetPrivateClips)
-    SYMFUNC(miOverlaySetRootClip)
+    SYMFUNC(miZeroArcSetup)
+    SYMFUNC(miZeroClipLine)
+    SYMFUNC(miZeroDashLine)
+    SYMFUNC(miZeroLine)
+    SYMFUNC(miZeroPolyArc)
     SYMVAR(miEmptyBox)
     SYMVAR(miEmptyData)
-    SYMVAR(miZeroLineScreenKey)
-    SYMVAR(miSpritePointerFuncs)
-    SYMVAR(miPointerScreenKey)
-    SYMVAR(miInstalledMaps)
     SYMVAR(miInitVisualsProc)
+    SYMVAR(miInstalledMaps)
+    SYMVAR(miPointerScreenKey)
+    SYMVAR(miSpritePointerFuncs)
+    SYMVAR(miZeroLineScreenKey)
 #ifdef DAMAGE
     SYMFUNC(DamageDamageRegion)
 #endif
commit 77d0b0ecfa3c67ff8d11e773a7f083721cf4c6d7
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 16:53:08 2008 -0400

    Remove unused pciNumBuses

diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index e64068a..4fc83f2 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -838,9 +838,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     /* Globals from xf86Configure.c */
     SYMVAR(ConfiguredMonitor)
 
-    /* Pci.c */
-    SYMVAR(pciNumBuses)
-
     /* modes */
     SYMVAR(xf86CrtcConfigPrivateIndex)
     SYMFUNC(xf86CrtcConfigInit)
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 734e709..5dccd39 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -139,7 +139,6 @@
 /* Global data */
 
 pciBusInfo_t *pciBusInfo = NULL;
-_X_EXPORT int pciNumBuses = 0;     /* Actual number of PCI buses */
 
 _X_EXPORT ADDRESS
 pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
index 3bd9d15..7becc0a 100644
--- a/hw/xfree86/os-support/bus/bsd_pci.c
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -79,7 +79,6 @@ xf86MapLegacyIO(struct pci_device *dev)
 void
 bsdPciInit(void)
 {
-    pciNumBuses = 1;
     pciBusInfo = &bsd_pci;
 
     xf86InitVidMem();
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
index 80bac32..a279363 100644
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -474,13 +474,11 @@ void
 ix86PciInit()
 {
     /* Initialize pciBusInfo */
-    pciNumBuses    = 1;
     pciBusInfo     = &ix86Pci0;
 
     /* Make sure that there is a PCI bus present. */
     ix86PciSelectCfgmech();
     if (ix86Pci0.configMech == PCI_CFG_MECH_UNKNOWN) {
-	pciNumBuses    = 0;
 	pciBusInfo     = NULL;
     }
 }
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index bbc5917..4a48632 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -114,7 +114,6 @@ linuxPciInit(void)
 	   we'll need a fallback for 2.0 kernels here */
 	return;
     }
-    pciNumBuses    = 1;
     pciBusInfo	   = &linuxPci0;
 }
 
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 2b8a4f7..3a73678 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -255,8 +255,6 @@ ADDRESS	      pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
 PCITAG	      pciTag(int busnum, int devnum, int funcnum);
 Bool xf86scanpci(void);
 
-extern int pciNumBuses;
-
 /* Domain access functions.  Some of these probably shouldn't be public */
 pointer xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
     ADDRESS Base, unsigned long Size);
commit 0ce61e21d6d7dcca0090e319bbcdb678570f2c3f
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 16:05:19 2008 -0400

    Remove the Must_have_memory hack.
    
    Also remove an astonishing amount of misunderstanding of how casts work.

diff --git a/dix/events.c b/dix/events.c
index 2947ff1..7a43e66 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2640,11 +2640,8 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
 	    if (pSprite->spriteTraceGood >= pSprite->spriteTraceSize)
 	    {
 		pSprite->spriteTraceSize += 10;
-		Must_have_memory = TRUE; /* XXX */
-		pSprite->spriteTrace = (WindowPtr *)xrealloc(
-		                    pSprite->spriteTrace,
+		pSprite->spriteTrace = xrealloc(pSprite->spriteTrace,
 		                    pSprite->spriteTraceSize*sizeof(WindowPtr));
-		Must_have_memory = FALSE; /* XXX */
 	    }
 	    pSprite->spriteTrace[pSprite->spriteTraceGood++] = pWin;
 	    pWin = pWin->firstChild;
@@ -3462,11 +3459,8 @@ CheckPassiveGrabsOnWindow(
 	    {
 		if (grabinfo->sync.evcount < scount)
 		{
-		    Must_have_memory = TRUE; /* XXX */
-		    grabinfo->sync.event = (xEvent *)xrealloc(grabinfo->sync.event,
-							    scount*
-							    sizeof(xEvent));
-		    Must_have_memory = FALSE; /* XXX */
+		    grabinfo->sync.event = xrealloc(grabinfo->sync.event,
+						    scount * sizeof(xEvent));
 		}
 		grabinfo->sync.evcount = scount;
                 /* we always store the XI event, never the core event */
@@ -3792,10 +3786,8 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
 	    FreezeThaw(thisDev, TRUE);
 	    if (grabinfo->sync.evcount < count)
 	    {
-		Must_have_memory = TRUE; /* XXX */
-		grabinfo->sync.event = (xEvent *)xrealloc(grabinfo->sync.event,
-							 count*sizeof(xEvent));
-		Must_have_memory = FALSE; /* XXX */
+		grabinfo->sync.event = xrealloc(grabinfo->sync.event,
+						count * sizeof(xEvent));
 	    }
 	    grabinfo->sync.evcount = count;
 	    for (dxE = grabinfo->sync.event; --count >= 0; dxE++, xE++)
@@ -4953,11 +4945,8 @@ SetInputFocus(
         if (depth > focus->traceSize)
         {
 	    focus->traceSize = depth+1;
-	    Must_have_memory = TRUE; /* XXX */
-	    focus->trace = (WindowPtr *)xrealloc(focus->trace,
-						 focus->traceSize *
-						 sizeof(WindowPtr));
-	    Must_have_memory = FALSE; /* XXX */
+	    focus->trace = xrealloc(focus->trace,
+				    focus->traceSize * sizeof(WindowPtr));
 	}
 	focus->traceGood = depth;
         for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 118e589..aaecd88 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -333,7 +333,6 @@ _X_HIDDEN void *dixLookupTab[] = {
     /* utils.c */
     SYMFUNC(Xstrdup)
     SYMFUNC(XNFstrdup)
-    SYMVAR(Must_have_memory)
     SYMFUNC(AdjustWaitForDelay)
     SYMVAR(noTestExtensions)
     SYMFUNC(GiveUp)
diff --git a/include/globals.h b/include/globals.h
index 9716139..63e998a 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -19,7 +19,6 @@ extern char *defaultFontPath;
 extern int monitorResolution;
 extern int defaultColorVisualClass;
 
-extern Bool Must_have_memory;
 extern WindowPtr WindowTable[MAXSCREENS];
 extern int GrabInProgress;
 extern Bool noTestExtensions;
diff --git a/mi/micursor.c b/mi/micursor.c
index ec20946..8b16490 100644
--- a/mi/micursor.c
+++ b/mi/micursor.c
@@ -54,8 +54,6 @@ SOFTWARE.
 #include "mi.h"
 #include "inputstr.h"
 
-extern Bool Must_have_memory;
-
 _X_EXPORT void
 miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr,
                 CursorPtr pCurs, Bool displayed)
@@ -64,11 +62,8 @@ miRecolorCursor(DeviceIntPtr pDev, ScreenPtr pScr,
      * This is guaranteed to correct any color-dependent state which may have
      * been bound up in private state created by RealizeCursor
      */
-    (* pScr->UnrealizeCursor)( pDev, pScr, pCurs);
-    Must_have_memory = TRUE; /* XXX */
-    (* pScr->RealizeCursor)( pDev, pScr, pCurs);
-    Must_have_memory = FALSE; /* XXX */
-    if ( displayed)
-	(* pScr->DisplayCursor)( pDev, pScr, pCurs);
-
+    pScr->UnrealizeCursor(pDev, pScr, pCurs);
+    pScr->RealizeCursor(pDev, pScr, pCurs);
+    if (displayed)
+	pScr->DisplayCursor(pDev, pScr, pCurs);
 }
diff --git a/mi/migc.c b/mi/migc.c
index 7fb28c4..8590d91 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -63,11 +63,9 @@ miCreateGCOps(GCOpsPtr prototype)
 {
     GCOpsPtr        ret;
 
-     /* XXX */ Must_have_memory = TRUE;
-    ret = (GCOpsPtr) xalloc(sizeof(GCOps));
-     /* XXX */ Must_have_memory = FALSE;
+    ret = xalloc(sizeof(GCOps));
     if (!ret)
-	return 0;
+	return NULL;
     *ret = *prototype;
     ret->devPrivate.val = 1;
     return ret;
diff --git a/os/utils.c b/os/utils.c
index 709b5df..b5dcd65 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -212,9 +212,6 @@ Bool PanoramiXExtensionDisabledHack = FALSE;
 
 int auditTrailLevel = 1;
 
-_X_EXPORT Bool Must_have_memory = FALSE;
-
-
 #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
 #define HAS_SAVED_IDS_AND_SETEUID
 #endif
@@ -1056,60 +1053,40 @@ set_font_authorizations(char **authorizations, int *authlen, pointer client)
 #endif /* TCPCONN */
 }
 
-/* XALLOC -- X's internal memory allocator.  Why does it return unsigned
- * long * instead of the more common char *?  Well, if you read K&R you'll
- * see they say that alloc must return a pointer "suitable for conversion"
- * to whatever type you really want.  In a full-blown generic allocator
- * there's no way to solve the alignment problems without potentially
- * wasting lots of space.  But we have a more limited problem. We know
- * we're only ever returning pointers to structures which will have to
- * be long word aligned.  So we are making a stronger guarantee.  It might
- * have made sense to make Xalloc return char * to conform with people's
- * expectations of malloc, but this makes lint happier.
- */
-
 #ifndef INTERNAL_MALLOC
 
 _X_EXPORT void * 
 Xalloc(unsigned long amount)
 {
-    register pointer  ptr;
-	
+    void *ptr;
+
     if ((long)amount <= 0) {
-	return (unsigned long *)NULL;
+	return NULL;
     }
     /* aligned extra on long word boundary */
     amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
-    if ((ptr = (pointer)malloc(amount))) {
-	return (unsigned long *)ptr;
-    }
-    if (Must_have_memory)
-	FatalError("Out of memory");
-    return (unsigned long *)NULL;
+    ptr = malloc(amount);
+    return ptr;
 }
 
 /*****************
  * XNFalloc 
- * "no failure" realloc, alternate interface to Xalloc w/o Must_have_memory
+ * "no failure" realloc
  *****************/
 
 _X_EXPORT void *
 XNFalloc(unsigned long amount)
 {
-    register pointer ptr;
+    void *ptr;
 
     if ((long)amount <= 0)
-    {
-        return (unsigned long *)NULL;
-    }
+        return NULL;
     /* aligned extra on long word boundary */
     amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
-    ptr = (pointer)malloc(amount);
+    ptr = malloc(amount);
     if (!ptr)
-    {
         FatalError("Out of memory");
-    }
-    return ((unsigned long *)ptr);
+    return ptr;
 }
 
 /*****************
@@ -1119,11 +1096,11 @@ XNFalloc(unsigned long amount)
 _X_EXPORT void *
 Xcalloc(unsigned long amount)
 {
-    unsigned long   *ret;
+    void *ret;
 
     ret = Xalloc (amount);
     if (ret)
-	bzero ((char *) ret, (int) amount);
+	bzero (ret, (int) amount);
     return ret;
 }
 
@@ -1134,11 +1111,11 @@ Xcalloc(unsigned long amount)
 _X_EXPORT void *
 XNFcalloc(unsigned long amount)
 {
-    unsigned long   *ret;
+    void *ret;
 
     ret = Xalloc (amount);
     if (ret)
-	bzero ((char *) ret, (int) amount);
+	bzero (ret, (int) amount);
     else if ((long)amount > 0)
         FatalError("Out of memory");
     return ret;
@@ -1155,34 +1132,31 @@ Xrealloc(pointer ptr, unsigned long amount)
     {
 	if (ptr && !amount)
 	    free(ptr);
-	return (unsigned long *)NULL;
+	return NULL;
     }
     amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
     if (ptr)
-        ptr = (pointer)realloc((char *)ptr, amount);
+        ptr = realloc(ptr, amount);
     else
-	ptr = (pointer)malloc(amount);
-    if (ptr)
-        return (unsigned long *)ptr;
-    if (Must_have_memory)
-	FatalError("Out of memory");
-    return (unsigned long *)NULL;
+	ptr = malloc(amount);
+
+    return ptr;
 }
                     
 /*****************
  * XNFrealloc 
- * "no failure" realloc, alternate interface to Xrealloc w/o Must_have_memory
+ * "no failure" realloc
  *****************/
 
 _X_EXPORT void *
 XNFrealloc(pointer ptr, unsigned long amount)
 {
-    if (( ptr = (pointer)Xrealloc( ptr, amount ) ) == NULL)
+    if ((ptr = Xrealloc(ptr, amount)) == NULL)
     {
 	if ((long)amount > 0)
             FatalError( "Out of memory" );
     }
-    return ((unsigned long *)ptr);
+    return ptr;
 }
 
 /*****************
@@ -1194,7 +1168,7 @@ _X_EXPORT void
 Xfree(pointer ptr)
 {
     if (ptr)
-	free((char *)ptr); 
+	free(ptr); 
 }
 #endif /* !INTERNAL_MALLOC */
 
@@ -1207,7 +1181,7 @@ Xstrdup(const char *s)
     if (s == NULL)
 	return NULL;
 
-    sd = (char *)Xalloc(strlen(s) + 1);
+    sd = Xalloc(strlen(s) + 1);
     if (sd != NULL)
 	strcpy(sd, s);
     return sd;
@@ -1222,7 +1196,7 @@ XNFstrdup(const char *s)
     if (s == NULL)
 	return NULL;
 
-    sd = (char *)XNFalloc(strlen(s) + 1);
+    sd = XNFalloc(strlen(s) + 1);
     strcpy(sd, s);
     return sd;
 }
commit e6b1c1fada19268af559d89375989973729fdb19
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:47:50 2008 -0400

    const cleanup

diff --git a/dix/main.c b/dix/main.c
index 4e838a9..f021511 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -461,7 +461,7 @@ SetVendorString(char *string)
     VendorString = string;
 }
 
-static int padlength[4] = {0, 3, 2, 1};
+static const int padlength[4] = {0, 3, 2, 1};
 
 #ifndef PANORAMIX
 static
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index b17e561..616c2b0 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -186,7 +186,7 @@ void QuartzInitInput(
 
 #ifdef FAKE_RANDR
 
-static int padlength[4] = {0, 3, 2, 1};
+static const int padlength[4] = {0, 3, 2, 1};
 
 static void
 RREditConnectionInfo (ScreenPtr pScreen)
diff --git a/os/io.c b/os/io.c
index d022aac..40f69cf 100644
--- a/os/io.c
+++ b/os/io.c
@@ -576,9 +576,7 @@ ResetCurrentRequest(ClientPtr client)
     }
 }
 
-    /* lookup table for adding padding bytes to data that is read from
-    	or written to the X socket.  */
-static int padlength[4] = {0, 3, 2, 1};
+static const int padlength[4] = {0, 3, 2, 1};
 
  /********************
  * FlushAllOutput()
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 8cce5ee..9c2d09c 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -22,7 +22,7 @@
 
 #include "randrstr.h"
 
-static int padlength[4] = {0, 3, 2, 1};
+static const int padlength[4] = {0, 3, 2, 1};
 
 static CARD16
 RR10CurrentSizeID (ScreenPtr pScreen);
commit fe616f9230b672edb89fca7516e750dc1b20c690
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:42:58 2008 -0400

    Drop the never-called SkippedRequestCallback list.

diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 359c256..118e589 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -436,7 +436,6 @@ _X_HIDDEN void *dixLookupTab[] = {
     SYMFUNC(SetCriticalOutputPending)
     SYMVAR(FlushCallback)
     SYMVAR(ReplyCallback)
-    SYMVAR(SkippedRequestsCallback)
     SYMFUNC(ResetCurrentRequest)
     /* connection.c */
     SYMFUNC(IgnoreClient)
diff --git a/include/os.h b/include/os.h
index bfe2363..c2bcd09 100644
--- a/include/os.h
+++ b/include/os.h
@@ -425,14 +425,6 @@ extern void ddxUseMsg(void);
     (_pxReq->length ? (otherReqTypePtr)_pxReq \
 		    : (otherReqTypePtr)(((CARD32*)_pxReq)+1))
 
-/* stuff for SkippedRequestsCallback */
-extern CallbackListPtr SkippedRequestsCallback;
-typedef struct {
-    xReqPtr req;
-    ClientPtr client;
-    int numskipped;
-} SkippedRequestInfoRec;
-
 /* stuff for ReplyCallback */
 extern CallbackListPtr ReplyCallback;
 typedef struct {
diff --git a/os/io.c b/os/io.c
index 3c0d494..d022aac 100644
--- a/os/io.c
+++ b/os/io.c
@@ -576,10 +576,6 @@ ResetCurrentRequest(ClientPtr client)
     }
 }
 
-
-
-_X_EXPORT CallbackListPtr SkippedRequestsCallback = NULL;
-
     /* lookup table for adding padding bytes to data that is read from
     	or written to the X socket.  */
 static int padlength[4] = {0, 3, 2, 1};
diff --git a/record/record.c b/record/record.c
index d6a1c98..4621898 100644
--- a/record/record.c
+++ b/record/record.c
@@ -574,95 +574,6 @@ RecordARequest(ClientPtr client)
     return (* pClientPriv->originalVector[majorop])(client);
 } /* RecordARequest */
 
-
-/* RecordASkippedRequest
- *
- * Arguments:
- *	pcbl is &SkippedRequestCallback.
- *	nulldata is NULL.
- *	calldata is a pointer to a SkippedRequestInfoRec (include/os.h)
- *	  which provides information about requests that the server is
- *	  skipping.  The client's proc vector won't be called for skipped
- *	  requests, so that's why we have to catch them here.
- *
- * Returns: nothing.
- *
- * Side Effects:
- *	The skipped requests are recorded by all contexts that have 
- *	registered those requests for this client.
- *
- * Note: most servers don't skip requests, so calls to this will probably
- *	 be rare.  For more information on skipped requests, search for
- *	 the word skip in ddx.tbl.ms (the porting layer document).
- */
-static void
-RecordASkippedRequest(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
-{
-    SkippedRequestInfoRec *psi = (SkippedRequestInfoRec *)calldata;
-    RecordContextPtr pContext;
-    RecordClientsAndProtocolPtr pRCAP;
-    xReqPtr stuff = psi->req;
-    ClientPtr client = psi->client;
-    int numSkippedRequests = psi->numskipped;
-    int reqlen;
-    int i;
-    int majorop;
-    
-    while (numSkippedRequests--)
-    {
-	majorop = stuff->reqType;
-	reqlen = ReqLen(stuff, client);
-	/* handle big request */
-	if (stuff->length == 0)
-	    reqlen += 4;
-	for (i = 0; i < numEnabledContexts; i++)
-	{
-	    pContext = ppAllContexts[i];
-	    pRCAP = RecordFindClientOnContext(pContext, client->clientAsMask,
-					      NULL);
-	    if (pRCAP && pRCAP->pRequestMajorOpSet &&
-		RecordIsMemberOfSet(pRCAP->pRequestMajorOpSet, majorop))
-	    {
-		if (majorop <= 127)
-		{ /* core request */
-
-		    RecordAProtocolElement(pContext, client, XRecordFromClient,
-				(pointer)stuff, reqlen, 0);
-		}
-		else /* extension, check minor opcode */
-		{
-		    int minorop = MinorOpcodeOfRequest(client);
-		    int numMinOpInfo;
-		    RecordMinorOpPtr pMinorOpInfo = pRCAP->pRequestMinOpInfo;
-
-		    assert (pMinorOpInfo);
-		    numMinOpInfo = pMinorOpInfo->count;
-		    pMinorOpInfo++;
-		    assert (numMinOpInfo);
-		    for ( ; numMinOpInfo; numMinOpInfo--, pMinorOpInfo++)
-		    {
-			if (majorop >= pMinorOpInfo->major.first &&
-			    majorop <= pMinorOpInfo->major.last &&
-			    RecordIsMemberOfSet(pMinorOpInfo->major.pMinOpSet,
-						minorop))
-			{
-			    RecordAProtocolElement(pContext, client, 
-				    XRecordFromClient, (pointer)stuff,
-				    reqlen, 0);
-			    break;
-			}			    
-		    } /* end for each minor op info */
-		} /* end extension request */
-	    } /* end this RCAP wants this major opcode */
-	} /* end for each context */
-
-	/* go to next request */
-	stuff = (xReqPtr)( ((char *)stuff) + reqlen);
-
-    } /* end for each skipped request */
-} /* RecordASkippedRequest */
-
-
 /* RecordAReply
  *
  * Arguments:
@@ -1012,9 +923,6 @@ RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
 	    return BadAlloc;
 	if (!AddCallback(&ReplyCallback, RecordAReply, NULL))
 	    return BadAlloc;
-	if (!AddCallback(&SkippedRequestsCallback, RecordASkippedRequest,
-			 NULL))
-	    return BadAlloc;
 	if (!AddCallback(&FlushCallback, RecordFlushAllContexts, NULL))
 	    return BadAlloc;
 	/* Alternate context flushing scheme: delete the line above
@@ -1116,7 +1024,6 @@ RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
 	DeleteCallback(&EventCallback, RecordADeliveredEventOrError, NULL);
 	DeleteCallback(&DeviceEventCallback, RecordADeviceEvent, NULL);
 	DeleteCallback(&ReplyCallback, RecordAReply, NULL);
-	DeleteCallback(&SkippedRequestsCallback, RecordASkippedRequest, NULL);
 	DeleteCallback(&FlushCallback, RecordFlushAllContexts, NULL);
 	/* Alternate context flushing scheme: delete the line above
 	 * and call RemoveBlockAndWakeupHandlers here passing
commit 31136b9467c2a17bbed4a51d6a6c41e3290bd236
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:33:47 2008 -0400

    Unexport MakeClientGrab{Imp,P}ervious
    
    xtrap used to use these, but it's gone now.  xtest still does but it's
    linked statically.

diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index a18a0ea..359c256 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -443,8 +443,6 @@ _X_HIDDEN void *dixLookupTab[] = {
     SYMFUNC(AttendClient)
     SYMFUNC(AddEnabledDevice)
     SYMFUNC(RemoveEnabledDevice)
-    SYMFUNC(MakeClientGrabPervious)
-    SYMFUNC(MakeClientGrabImpervious)
     SYMVAR(GrabInProgress)
 
 #ifdef XKB
diff --git a/os/connection.c b/os/connection.c
index a111fa5..e80b95e 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1218,7 +1218,7 @@ AttendClient (ClientPtr client)
 
 /* make client impervious to grabs; assume only executing client calls this */
 
-_X_EXPORT void
+void
 MakeClientGrabImpervious(ClientPtr client)
 {
     OsCommPtr oc = (OsCommPtr)client->osPrivate;
@@ -1237,7 +1237,7 @@ MakeClientGrabImpervious(ClientPtr client)
 
 /* make client pervious to grabs; assume only executing client calls this */
 
-_X_EXPORT void
+void
 MakeClientGrabPervious(ClientPtr client)
 {
     OsCommPtr oc = (OsCommPtr)client->osPrivate;
commit eaf3fdf97014c27aececa8505c2713e7c9a537fc
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:24:35 2008 -0400

    Unexport xf86NoSharedResources

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index be603d6..039b295 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -2671,7 +2671,7 @@ CheckGenericGA()
 #endif
 }
 
-_X_EXPORT Bool
+Bool
 xf86NoSharedResources(int screenIndex,resType res)
 {
     int j;
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index da369df..e64068a 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -321,7 +321,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86IsEntityPrimary)
     SYMFUNC(xf86SetOperatingState)
     SYMFUNC(xf86FindScreenForEntity)
-    SYMFUNC(xf86NoSharedResources)
     /* Shared Accel Accessor Functions */
     SYMFUNC(xf86GetLastScrnFlag)
     SYMFUNC(xf86SetLastScrnFlag)
commit d7d9edb506bfea1c10516b6c4eb72dee3559863c
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:17:44 2008 -0400

    Unexport xf86DeallocateResourcesForEntity

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 3e4fa4a..be603d6 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -402,7 +402,7 @@ xf86ClearEntityListForScreen(int scrnIndex)
     pScrn->entityInstanceList = NULL;
 }
 
-_X_EXPORT void
+void
 xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type)
 {
     resPtr *pprev_next = &Acc;
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index c257d2d..da369df 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -316,7 +316,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86GetNumEntityInstances)
     SYMFUNC(xf86GetDevFromEntity)
     SYMFUNC(xf86GetPciInfoForEntity)
-    SYMFUNC(xf86DeallocateResourcesForEntity)
     SYMFUNC(xf86RegisterResources)
     SYMFUNC(xf86CheckPciMemBase)
     SYMFUNC(xf86IsEntityPrimary)
commit 49673b43584928c22d699d1968ed6813b272aefe
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:13:39 2008 -0400

    Unexport xf86SetEntityFuncs

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 0933738..3e4fa4a 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -253,7 +253,7 @@ xf86IsEntityPrimary(int entityIndex)
     }
 }
 	
-_X_EXPORT Bool
+Bool
 xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter,
 		   EntityProc leave, pointer private)
 {
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index af9b6ed..c257d2d 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -316,7 +316,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86GetNumEntityInstances)
     SYMFUNC(xf86GetDevFromEntity)
     SYMFUNC(xf86GetPciInfoForEntity)
-    SYMFUNC(xf86SetEntityFuncs)
     SYMFUNC(xf86DeallocateResourcesForEntity)
     SYMFUNC(xf86RegisterResources)
     SYMFUNC(xf86CheckPciMemBase)
commit 949ef6b79a36d6f6bbc192c20ef0f13cc95d4f28
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:10:26 2008 -0400

    Unexport xf86ChkConflict
    
    Also remove the unused internal ChkConflict()

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 325d9b2..9e3826c 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -134,7 +134,6 @@ Bool xf86IsEntityPrimary(int entityIndex);
 resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
 resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
 void xf86EnterServerState(xf86State state);
-memType xf86ChkConflict(resRange *rgp, int entityIndex);
 ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
 Bool xf86NoSharedResources(int screenIndex, resType res);
 resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 69d23a7..0933738 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1100,23 +1100,14 @@ checkConflict(resRange *rgp, resPtr pRes, int entityIndex,
 }
 
 /*
- * ChkConflict() -- used within xxxBus ; find conflict with any location.
- */
-memType
-ChkConflict(resRange *rgp, resPtr res, xf86State state)
-{
-    return checkConflict(rgp, res, -2, state,FALSE);
-}
-
-/*
  * xf86ChkConflict() - This function is the low level interface to
  * the resource broker that gets exported. Tests all resources ie.
  * performs test with SETUP flag.
  */
-_X_EXPORT memType
+static memType
 xf86ChkConflict(resRange *rgp, int entityIndex)
 {
-    return checkConflict(rgp, Acc, entityIndex, SETUP,FALSE);
+    return checkConflict(rgp, Acc, entityIndex, SETUP, FALSE);
 }
 
 /*
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 246302d..d28190a 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -129,7 +129,6 @@ extern BusAccPtr xf86BusAccInfo;
 
 int xf86AllocateEntity(void);
 BusType StringToBusType(const char* busID, const char **retID);
-memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
 Bool xf86IsSubsetOf(resRange range, resPtr list);
 resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
 resPtr xf86FindIntersect(resRange Range, resPtr list);
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 9850a55..af9b6ed 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -322,7 +322,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86CheckPciMemBase)
     SYMFUNC(xf86IsEntityPrimary)
     SYMFUNC(xf86SetOperatingState)
-    SYMFUNC(xf86ChkConflict)
     SYMFUNC(xf86FindScreenForEntity)
     SYMFUNC(xf86NoSharedResources)
     /* Shared Accel Accessor Functions */
commit d7c0ba2e9eae7044ef4c31d9c3cbb9a71ee0f9f9
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 15:06:42 2008 -0400

    Remove unused server state change callbackery.

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index bac4be0..325d9b2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -138,8 +138,6 @@ memType xf86ChkConflict(resRange *rgp, int entityIndex);
 ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
 Bool xf86NoSharedResources(int screenIndex, resType res);
 resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
-void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
-Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
 
 int xf86GetLastScrnFlag(int entityIndex);
 void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 245bac0..69d23a7 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -95,10 +95,6 @@ _X_EXPORT resRange res8514Shared[] = {_8514_SHARED, _END};
 static Bool needRAC = FALSE;
 static Bool doFramebufferMode = FALSE;
 
-/* state change notification callback list */
-static StateChangeNotificationPtr StateChangeNotificationList;
-static void notifyStateChange(xf86NotifyState state);
-
 #undef MIN
 #define MIN(x,y) ((x<y)?x:y)
 
@@ -595,7 +591,6 @@ xf86AccessEnter(void)
     PciStateEnter();
     disableAccess();
     EntityEnter();
-    notifyStateChange(NOTIFY_ENTER);
     xf86EnterServerState(SETUP);
     xf86ResAccessEnter = TRUE;
 }
@@ -614,7 +609,6 @@ xf86AccessLeave(void)
 {
     if (!xf86ResAccessEnter)
 	return;
-    notifyStateChange(NOTIFY_LEAVE);
     disableAccess();
     DisablePciBusAccess();
     EntityLeave();
@@ -1766,15 +1760,9 @@ xf86EnterServerState(xf86State state)
      */
     if (!needRAC) {
 	xf86EnableAccess(xf86Screens[0]);
-	notifyStateChange(NOTIFY_ENABLE);
 	return;
     }
     
-    if (state == SETUP)
-	notifyStateChange(NOTIFY_SETUP_TRANSITION);
-    else
-	notifyStateChange(NOTIFY_OPERATING_TRANSITION);
-    
     clearAccess();
     for (i=0; i<xf86NumScreens;i++) {
 
@@ -1817,10 +1805,6 @@ xf86EnterServerState(xf86State state)
 	    break;
 	}
     }
-    if (state == SETUP)
-	notifyStateChange(NOTIFY_SETUP);
-    else
-	notifyStateChange(NOTIFY_OPERATING);
 }
 
 /*
@@ -2070,7 +2054,6 @@ xf86PostProbe(void)
 	} else  {
 	    xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
 	    xf86AccessRestoreState();
-	    notifyStateChange(NOTIFY_ENABLE);
 	    doFramebufferMode = TRUE;
 
 	    return;
@@ -2729,46 +2712,6 @@ xf86NoSharedResources(int screenIndex,resType res)
     return TRUE;
 }
 
-_X_EXPORT void
-xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
-{
-    StateChangeNotificationPtr ptr =
-	(StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
-
-    ptr->func = func;
-    ptr->arg = arg;
-    ptr->next = StateChangeNotificationList;
-    StateChangeNotificationList = ptr;
-}
-
-_X_EXPORT Bool
-xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func)
-{
-    StateChangeNotificationPtr *ptr = &StateChangeNotificationList;
-    StateChangeNotificationPtr tmp;
-    
-    while (*ptr) {
-	if ((*ptr)->func == func) {
-	    tmp = (*ptr);
-	    (*ptr) = (*ptr)->next;
-	    xfree(tmp);
-	    return TRUE;
-	}
-	ptr = &((*ptr)->next);
-    }
-    return FALSE;
-}
-
-static void
-notifyStateChange(xf86NotifyState state)
-{
-    StateChangeNotificationPtr ptr = StateChangeNotificationList;
-    while (ptr) {
-	ptr->func(state,ptr->arg);
-	ptr = ptr->next;
-    }
-}
-
 /* Multihead accel sharing accessor functions and entity Private handling */
 
 _X_EXPORT int
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 489ee34..246302d 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -119,14 +119,6 @@ typedef struct x_BusAccRec {
     } busdep;
 } BusAccRec, *BusAccPtr;
 
-/* state change notification callback */
-typedef struct _stateChange {
-    xf86StateChangeNotificationCallbackFunc func;
-    pointer arg;
-    struct _stateChange *next;
-} StateChangeNotificationRec, *StateChangeNotificationPtr;
-
-
 extern EntityPtr *xf86Entities;
 extern int xf86NumEntities;
 extern xf86AccessRec AccessNULL;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 8c21123..b57b7bd 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -778,18 +778,6 @@ typedef enum {
     OPERATING
 } xf86State;
 
-typedef enum {
-    NOTIFY_SETUP_TRANSITION,
-    NOTIFY_SETUP,
-    NOTIFY_OPERATING,
-    NOTIFY_OPERATING_TRANSITION,
-    NOTIFY_ENABLE,
-    NOTIFY_ENTER,
-    NOTIFY_LEAVE
-} xf86NotifyState;
-
-typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
-
 /* DGA */
 
 typedef struct {
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index daeafd2..9850a55 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -324,8 +324,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86SetOperatingState)
     SYMFUNC(xf86ChkConflict)
     SYMFUNC(xf86FindScreenForEntity)
-    SYMFUNC(xf86RegisterStateChangeNotificationCallback)
-    SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
     SYMFUNC(xf86NoSharedResources)
     /* Shared Accel Accessor Functions */
     SYMFUNC(xf86GetLastScrnFlag)
commit 9ada146a16bcf220b2dd2936fb3a0349a31e99d3
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 14:40:18 2008 -0400

    xf86RegisterResources: Always print any failed registrations.

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 364df1b..245bac0 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1522,11 +1522,11 @@ xf86RegisterResources(int entityIndex, resList list, unsigned long access)
 #ifdef DEBUG
     xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n");
     xf86PrintResList(3, Acc);
-    if (res) xf86MsgVerb(X_INFO, 3,
-			 "Failed Resources after driver initialization "
-			 "for Entity: %i\n",entityIndex);
-    xf86PrintResList(3, res);
 #endif
+    if (res) {
+	xf86MsgVerb(X_INFO, 3, "Failed to register resources:\n");
+	xf86PrintResList(3, res);
+    }
     return res;
     
 }
commit a5d3fa90f3de763a5dcbb0ff4987562449819323
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 14:38:48 2008 -0400

    Typo fix.

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 4156646..364df1b 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1427,7 +1427,7 @@ RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated
 }
 
 /*
- * Resource registrarion
+ * Resource registration
  */
 
 static resList
commit cc3335858508ffbc52123eb5bb0c34f42800c8c4
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 14:37:59 2008 -0400

    Remove the old implementation of RemoveOverlaps

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 4f7b36b..4156646 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1346,74 +1346,6 @@ xf86ResourceBrokerInit(void)
  * At resource broker initialization this is no problem as this
  * only deals with exclusive resources.
  */
-#if 0
-void
-RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated)
-{
-    resPtr pRes;
-    memType size, newsize, adjust;
-
-    if (!target)
-	return;
-    
-    for (pRes = list; pRes; pRes = pRes->next) {
-	if (pRes != target
-	    && ((pRes->res_type & ResTypeMask) ==
-		(target->res_type & ResTypeMask))
-	    && pRes->block_begin <= target->block_end
-	    && pRes->block_end >= target->block_begin) {
-	    /* Possibly ignore estimated resources */
-	    if (!useEstimated && (pRes->res_type & ResEstimated)) continue;
-	    /*
-	     * Target should be a larger region than pRes.  If pRes fully
-	     * contains target, don't do anything unless target can overlap.
-	     */
-	    if (pRes->block_begin <= target->block_begin &&
-		pRes->block_end >= target->block_end) {
-		if (target->res_type & ResOverlap) {
-		    /* Nullify range but keep its ResOverlap bit on */
-		    target->block_end = target->block_begin - 1;
-		    return;
-		}
-		continue;
-	    }
-	    /*
-	     * In cases where the target and pRes have the same starting
-	     * address, reduce the size of the target (given it's an estimate).
-	     */
-	    if (pRes->block_begin == target->block_begin) {
-		if (target->res_type & ResOverlap)
-		    target->block_end = target->block_begin - 1;
-		else
-		    target->block_end = pRes->block_end;
-	    }
-	    /* Otherwise, trim target to remove the overlap */
-	    else if (pRes->block_begin <= target->block_end) {
-		target->block_end = pRes->block_begin - 1;
-	    } else if (!pow2Alignment &&
-		       pRes->block_end >= target->block_begin) {
-		target->block_begin = pRes->block_end + 1;
-	    }
-	    if (pow2Alignment) {
-		/*
-		 * Align to a power of two.  This requires finding the
-		 * largest power of two that is smaller than the adjusted
-		 * size.
-		 */
-		size = target->block_end - target->block_begin + 1;
-		newsize = 1UL << (sizeof(memType) * 8 - 1);
-		while (!(newsize & size))
-		    newsize >>= 1;
-		target->block_end = target->block_begin + newsize - 1;
-	    } else if (target->block_end > MEM_ALIGN) {
-		/* Align the end to MEM_ALIGN */
-		if ((adjust = (target->block_end + 1) % MEM_ALIGN))
-		    target->block_end -= adjust;
-	    }
-	}
-    }
-}
-#else
 
 void
 RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated)
@@ -1494,8 +1426,6 @@ RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated
     }
 }
 
-#endif
-
 /*
  * Resource registrarion
  */
commit 8fbf1185f5d6a1836b3e4265de6f605d82478e0b
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 14:32:32 2008 -0400

    Internalise some resource list API.

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 4ca7dfc..bac4be0 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -100,7 +100,6 @@ Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
 			   int *func);
 Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
 void xf86FormatPciBusNumber(int busnum, char *buffer);
-void xf86PrintResList(int verb, resPtr list);
 resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
 int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
 int xf86GetIsaInfoForScreen(int scrnIndex);
@@ -114,8 +113,6 @@ Bool xf86IsPrimaryPci(struct pci_device * pPci);
 Bool xf86IsPrimaryIsa(void);
 /* new RAC */
 resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
-resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
-resPtr xf86DupResList(const resPtr rlist);
 void xf86FreeResList(resPtr rlist);
 void xf86ClaimFixedResources(resList list, int entityIndex);
 Bool xf86DriverHasEntities(DriverPtr drvp);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 88c7519..4f7b36b 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1129,7 +1129,7 @@ xf86ChkConflict(resRange *rgp, int entityIndex)
  * Resources List handling
  */
 
-_X_EXPORT resPtr
+static resPtr
 xf86JoinResLists(resPtr rlist1, resPtr rlist2)
 {
     resPtr pRes;
@@ -1146,7 +1146,7 @@ xf86JoinResLists(resPtr rlist1, resPtr rlist2)
     return rlist1;
 }
 
-_X_EXPORT resPtr
+resPtr
 xf86AddResToList(resPtr rlist, resRange *range, int entityIndex)
 {
     resPtr new;
@@ -1196,7 +1196,7 @@ xf86FreeResList(resPtr rlist)
     xfree(rlist);
 }
 
-_X_EXPORT resPtr
+static resPtr
 xf86DupResList(const resPtr rlist)
 {
     resPtr pRes, ret, prev, new;
@@ -1216,7 +1216,7 @@ xf86DupResList(const resPtr rlist)
     return ret;
 }
 
-_X_EXPORT void
+static void
 xf86PrintResList(int verb, resPtr list)
 {
     int i = 0;
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 7047ff3..daeafd2 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -307,10 +307,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86SetCurrentAccess)
     SYMFUNC(xf86IsPrimaryPci)
     SYMFUNC(xf86IsPrimaryIsa)
-    SYMFUNC(xf86PrintResList)
-    SYMFUNC(xf86AddResToList)
-    SYMFUNC(xf86JoinResLists)
-    SYMFUNC(xf86DupResList)
     SYMFUNC(xf86FreeResList)
     SYMFUNC(xf86ClaimFixedResources)
     SYMFUNC(xf86AddEntityToScreen)
commit 0ca4f3cee7e42a393cdd32d3a772a190ae68abc5
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 13:29:55 2008 -0400

    Unexport xf86EnterServerState

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 6a4bd84..88c7519 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1790,7 +1790,7 @@ SetSIGIOForState(xf86State state)
     }
 }
 
-_X_EXPORT void
+void
 xf86EnterServerState(xf86State state)
 {
     EntityPtr pEnt;
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 72b3975..7047ff3 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -326,7 +326,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86CheckPciMemBase)
     SYMFUNC(xf86IsEntityPrimary)
     SYMFUNC(xf86SetOperatingState)
-    SYMFUNC(xf86EnterServerState)
     SYMFUNC(xf86ChkConflict)
     SYMFUNC(xf86FindScreenForEntity)
     SYMFUNC(xf86RegisterStateChangeNotificationCallback)
commit c1df4fbede8058c15ce3a5759a7758fecafbb9e7
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 13:08:43 2008 -0400

    Unexport (and unimplement) xf86SetAccessFuncs.
    
    Because, no.

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 6c3c095..4ca7dfc 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -133,8 +133,6 @@ void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
 resPtr xf86RegisterResources(int entityIndex, resList list,
 			     unsigned long Access);
 Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base);
-void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
-			xf86SetAccessFuncPtr oldFuncs);
 Bool xf86IsEntityPrimary(int entityIndex);
 resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
 resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index d03baa6..6a4bd84 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -819,24 +819,6 @@ xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn)
     }
 }
 
-_X_EXPORT void
-xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
-		   xf86SetAccessFuncPtr oldFuncs)
-{
-    AccessFuncPtr rac;
-
-    if (!xf86Entities[pEnt->index]->rac)
-	xf86Entities[pEnt->index]->rac = xnfcalloc(1,sizeof(AccessFuncRec));
-
-    rac = xf86Entities[pEnt->index]->rac;
-
-    rac->mem_new = funcs->mem;
-    rac->io_new = funcs->io;
-    rac->io_mem_new = funcs->io_mem;
-    
-    rac->old = oldFuncs;
-}
-
 /*
  * Conflict checking
  */
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 3d6ca7b..72b3975 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -324,7 +324,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86DeallocateResourcesForEntity)
     SYMFUNC(xf86RegisterResources)
     SYMFUNC(xf86CheckPciMemBase)
-    SYMFUNC(xf86SetAccessFuncs)
     SYMFUNC(xf86IsEntityPrimary)
     SYMFUNC(xf86SetOperatingState)
     SYMFUNC(xf86EnterServerState)
commit 44269e604eb60ebaa6189fd4409d39a4ec6b9f4b
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 13:02:50 2008 -0400

    RAC: NO_SEPARATE_*_FROM_* are useless.
    
    If anyone can come up with an example of a bus where:
    
    - both i/o and memory resources are addressable
    - access to them can be controlled
    - but they can't be controlled independently
    
    then by all means, reinstate this logic.

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 246e529..d03baa6 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -830,11 +830,6 @@ xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
 
     rac = xf86Entities[pEnt->index]->rac;
 
-    if (funcs->mem == funcs->io_mem && funcs->mem && funcs->io)
-	xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_MEM_FROM_IO;
-    if (funcs->io == funcs->io_mem && funcs->mem && funcs->io)
-	xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_IO_FROM_MEM;
-    
     rac->mem_new = funcs->mem;
     rac->io_new = funcs->io;
     rac->io_mem_new = funcs->io_mem;
@@ -2269,13 +2264,6 @@ checkRequiredResources(int entityIndex)
 	pAcc = pAcc->next;
     }
     
-    /* check if we can separately enable mem/io resources */
-    /* XXX we still need to find out how to set this yet  */
-    if ( ((pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)
-	  && (pEnt->entityProp & NEED_MEM_SHARED))
-	 || ((pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)
-	     && (pEnt->entityProp & NEED_IO_SHARED)) )
-	pEnt->entityProp |= NEED_SHARED;
     /*
      * After we have checked all resources of an entity agains any
      * other resource we know if the entity need this resource type
@@ -2283,13 +2271,11 @@ checkRequiredResources(int entityIndex)
      * so no need to share it either. 
      */
     if ((pEnt->entityProp & NEED_MEM_SHARED)
-	&& (!(pEnt->entityProp & NEED_MEM))
-	&& (!(pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)))
+	&& (!(pEnt->entityProp & NEED_MEM)))
 	pEnt->entityProp &= ~(unsigned long)NEED_MEM_SHARED;
 
     if ((pEnt->entityProp & NEED_IO_SHARED)
-	&& (!(pEnt->entityProp & NEED_IO))
-	&& (!(pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)))
+	&& (!(pEnt->entityProp & NEED_IO)))
 	pEnt->entityProp &= ~(unsigned long)NEED_IO_SHARED;
 }
 
commit 51fcb58f45824c7cde88b8b4ccbd6bdcf760280e
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 3 12:39:49 2008 -0400

    RAC: AccessEnable() and AccessDisable() are mandatory.

diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 7e6b93a..246e529 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -60,7 +60,10 @@ int xf86NumEntities = 0;
 static int xf86EntityPrivateCount = 0;
 BusAccPtr xf86BusAccInfo = NULL;
 
-xf86AccessRec AccessNULL = {NULL,NULL,NULL};
+static void
+noopEnableDisable(void *arg) { }
+
+xf86AccessRec AccessNULL = { noopEnableDisable, noopEnableDisable, NULL };
 
 xf86CurrentAccessRec xf86CurrentAccess = {NULL,NULL};
 
@@ -170,11 +173,9 @@ xf86EntityInit(void)
 		((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
 		    (xf86Entities[i]->access->busAcc);
 	    pacc = xf86Entities[i]->access->fallback;
-	    if (pacc->AccessEnable)
-		pacc->AccessEnable(pacc->arg);
+	    pacc->AccessEnable(pacc->arg);
 	    xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
-	    if (pacc->AccessDisable)
-		pacc->AccessDisable(pacc->arg);
+	    pacc->AccessDisable(pacc->arg);
 	    /* remove init resources after init is processed */
 	    pprev_next = &Acc;
 	    res = Acc;
@@ -213,11 +214,9 @@ EntityEnter(void)
 		((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
 		    (xf86Entities[i]->access->busAcc);
 	    pacc = xf86Entities[i]->access->fallback;
-	    if (pacc->AccessEnable)
-		pacc->AccessEnable(pacc->arg);
+	    pacc->AccessEnable(pacc->arg);
 	    xf86Entities[i]->entityEnter(i,xf86Entities[i]->private);
-	    if (pacc->AccessDisable)
-		pacc->AccessDisable(pacc->arg);
+	    pacc->AccessDisable(pacc->arg);
 	}
 }
 
@@ -233,11 +232,9 @@ EntityLeave(void)
 		((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
 		    (xf86Entities[i]->access->busAcc);
 	    pacc = xf86Entities[i]->access->fallback;
-	    if (pacc->AccessEnable)
-		pacc->AccessEnable(pacc->arg);
+	    pacc->AccessEnable(pacc->arg);
 	    xf86Entities[i]->entityLeave(i,xf86Entities[i]->private);
-	    if (pacc->AccessDisable)
-		pacc->AccessDisable(pacc->arg);
+	    pacc->AccessDisable(pacc->arg);
 	}
 }
 
@@ -358,10 +355,10 @@ xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)
 	    peacc = xf86Entities[pScrn->entityList[i]]->access;
 	    (*ptr) = peacc->next;
 	    /* disable entity: call disable func */
-	    if (peacc->pAccess && peacc->pAccess->AccessDisable)
+	    if (peacc->pAccess)
 		peacc->pAccess->AccessDisable(peacc->pAccess->arg);
 	    /* also disable fallback - just in case */
-	    if (peacc->fallback && peacc->fallback->AccessDisable)
+	    if (peacc->fallback)
 		peacc->fallback->AccessDisable(peacc->fallback->arg);
 	    for (i++; i < pScrn->numEntities; i++)
 		pScrn->entityList[i-1] = pScrn->entityList[i];
@@ -391,10 +388,10 @@ xf86ClearEntityListForScreen(int scrnIndex)
 	xf86Entities[entityIndex]->inUse = FALSE;
 	/* disable resource: call the disable function */
 	peacc = xf86Entities[entityIndex]->access;
-	if (peacc->pAccess && peacc->pAccess->AccessDisable)
+	if (peacc->pAccess)
 	    peacc->pAccess->AccessDisable(peacc->pAccess->arg);
 	/* and the fallback function */
-	if (peacc->fallback && peacc->fallback->AccessDisable)
+	if (peacc->fallback)
 	    peacc->fallback->AccessDisable(peacc->fallback->arg);
 	/* shared resources are only needed when entity is active: remove */
 	xf86DeallocateResourcesForEntity(entityIndex, ResShared);
@@ -525,14 +522,14 @@ disableAccess(void)
     for (i = 0; i < xf86NumScreens; i++) {
 	peacc = xf86Screens[i]->CurrentAccess->pIoAccess;
 	while (peacc) {
-	    if (peacc->pAccess && peacc->pAccess->AccessDisable)
+	    if (peacc->pAccess)
 		peacc->pAccess->AccessDisable(peacc->pAccess->arg);
 	    peacc = peacc->next;
 	}
 	xf86Screens[i]->CurrentAccess->pIoAccess = NULL;
 	peacc = xf86Screens[i]->CurrentAccess->pMemAccess;
 	while (peacc) {
-	    if (peacc->pAccess && peacc->pAccess->AccessDisable)
+	    if (peacc->pAccess)
 		peacc->pAccess->AccessDisable(peacc->pAccess->arg);
 	    peacc = peacc->next;
 	}
@@ -541,8 +538,7 @@ disableAccess(void)
     /* then call the generic entity disable funcs */
     for (i = 0; i < xf86NumEntities; i++) {
 	pacc = xf86Entities[i]->access->fallback; 
-	if (pacc->AccessDisable)
-	    pacc->AccessDisable(pacc->arg);
+	pacc->AccessDisable(pacc->arg);
     }
 }
 
@@ -692,16 +688,16 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 	    pScrn->CurrentAccess->pMemAccess = NULL;
 	while (pceAcc) {
 	    pAcc = pceAcc->pAccess;
-	    if ( pAcc && pAcc->AccessDisable) 
-		(*pAcc->AccessDisable)(pAcc->arg);
+	    if (pAcc)
+		pAcc->AccessDisable(pAcc->arg);
 	    pceAcc = pceAcc->next;
 	}
 	if (pScrn->busAccess)
 	    ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
 	while (peAcc) {
 	    pAcc = peAcc->pAccess;
-	    if (pAcc && pAcc->AccessEnable) 
-		(*pAcc->AccessEnable)(pAcc->arg);
+	    if (pAcc) 
+		pAcc->AccessEnable(pAcc->arg);
 	    peAcc = peAcc->next;
 	}
 	pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access;
@@ -713,8 +709,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 	    tmp = pceAcc;
 	    while (pceAcc) {
 		pAcc = pceAcc->pAccess;
-		if (pAcc && pAcc->AccessDisable)
-		    (*pAcc->AccessDisable)(pAcc->arg);
+		if (pAcc)
+		    pAcc->AccessDisable(pAcc->arg);
 		pceAcc = pceAcc->next;
 	    }
 	    pceAcc = pScrn->CurrentAccess->pMemAccess;
@@ -722,8 +718,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 		&& tmp !=pceAcc) {
 		while (pceAcc) {
 		    pAcc = pceAcc->pAccess;
-		    if (pAcc && pAcc->AccessDisable)
-			(*pAcc->AccessDisable)(pAcc->arg);
+		    if (pAcc)
+			pAcc->AccessDisable(pAcc->arg);
 		    pceAcc = pceAcc->next;
 		}
 	    }
@@ -734,8 +730,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 	    }
 	    while (pceAcc) {  /* current Mem != pAccess */
 		pAcc = pceAcc->pAccess;
-		if (pAcc && pAcc->AccessDisable) 
-		    (*pAcc->AccessDisable)(pAcc->arg);
+		if (pAcc)
+		    pAcc->AccessDisable(pAcc->arg);
 		pceAcc = pceAcc->next;
 	    }
 	}
@@ -743,8 +739,8 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 	    ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
 	while (peAcc) {
 	    pAcc = peAcc->pAccess;
-	    if (pAcc && pAcc->AccessEnable) 
-		(*pAcc->AccessEnable)(pAcc->arg);
+	    if (pAcc) 
+		pAcc->AccessEnable(pAcc->arg);
 		peAcc = peAcc->next;
 	}
 	pScrn->CurrentAccess->pMemAccess =
@@ -760,16 +756,16 @@ xf86EnableAccess(ScrnInfoPtr pScrn)
 	    pScrn->CurrentAccess->pIoAccess = NULL;
 	while (pceAcc) {
 	    pAcc = pceAcc->pAccess;
-	    if ( pAcc && pAcc->AccessDisable) 
-		(*pAcc->AccessDisable)(pAcc->arg);
+	    if (pAcc)
+		pAcc->AccessDisable(pAcc->arg);
 	    pceAcc = pceAcc->next;
 	}
 	if (pScrn->busAccess)
 	    ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
 	while (peAcc) {
 	    pAcc = peAcc->pAccess;
-	    if (pAcc && pAcc->AccessEnable) 
-		(*pAcc->AccessEnable)(pAcc->arg);
+	    if (pAcc)
+		pAcc->AccessEnable(pAcc->arg);
 	    peAcc = peAcc->next;
 	}
 	pScrn->CurrentAccess->pMemAccess = (EntityAccessPtr) pScrn->access;
@@ -808,13 +804,11 @@ xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn)
 
     while (pceAcc) {
 	pAcc = pceAcc->pAccess;
-	if ( pAcc) {
-	    if (!Enable) {
-		if (pAcc->AccessDisable) 
-		    (*pAcc->AccessDisable)(pAcc->arg);
+	if (pAcc) {
+	    if (Enable) {
+		pAcc->AccessEnable(pAcc->arg);
 	    } else {
-		if (pAcc->AccessEnable) 
-		    (*pAcc->AccessEnable)(pAcc->arg);
+		pAcc->AccessDisable(pAcc->arg);
 	    }
 	}
 	pceAcc = pceAcc->next;
@@ -1733,7 +1727,7 @@ setAccess(EntityPtr pEnt, xf86State state)
 	if (pEnt->rac->old) {
 	    /* give it to the driver, leave state disabled */
 	    pEnt->rac->old->io = org_io;
-	} else if (org_io->AccessEnable) {
+	} else {
 	    /* driver doesn't want it - enable generic access */
 	    org_io->AccessEnable(org_io->arg);
 	}
@@ -1744,7 +1738,7 @@ setAccess(EntityPtr pEnt, xf86State state)
 	if (pEnt->rac->old) {
 	    /* give it to the driver, leave state disabled */
 	    pEnt->rac->old->io_mem = org_mem_io;
-	} else if (org_mem_io->AccessEnable) {
+	} else {
 	    /* driver doesn't want it - enable generic access */
 	    org_mem_io->AccessEnable(org_mem_io->arg);
 	}
@@ -1755,7 +1749,7 @@ setAccess(EntityPtr pEnt, xf86State state)
 	if (pEnt->rac->old) {
 	    /* give it to the driver, leave state disabled */
 	    pEnt->rac->old->mem = org_mem;
-	} else if (org_mem->AccessEnable) {
+	} else {
 	    /* driver doesn't want it - enable generic access */
 	    org_mem->AccessEnable(org_mem->arg);
 	}
@@ -1763,27 +1757,26 @@ setAccess(EntityPtr pEnt, xf86State state)
 
     if (!(prop & NEED_MEM_SHARED)){
 	if (prop & NEED_MEM) {
-	    if (acc_mem && acc_mem->AccessEnable)
+	    if (acc_mem)
 		acc_mem->AccessEnable(acc_mem->arg);
 	} else {
-	    if (acc_mem && acc_mem->AccessDisable)
+	    if (acc_mem)
 		acc_mem->AccessDisable(acc_mem->arg);
 	}
     }
 
     if (!(prop & NEED_IO_SHARED)) {
 	if (prop & NEED_IO) {
-	    if (acc_io && acc_io->AccessEnable)
-	    acc_io->AccessEnable(acc_io->arg);
+	    if (acc_io)
+		acc_io->AccessEnable(acc_io->arg);
 	} else {
-	    if (acc_io && acc_io->AccessDisable)
+	    if (acc_io)
 		acc_io->AccessDisable(acc_io->arg);
 	}
     }
 
     /* disable shared resources */
-    if (pEnt->access->pAccess 
-	&& pEnt->access->pAccess->AccessDisable)
+    if (pEnt->access->pAccess)
 	pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg);
 
     /*


More information about the xorg-commit mailing list