[PATCH 3/3] xfree86: Kill pixmapPrivate with a vengeance

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 14 06:13:41 PDT 2010


ScrnInfo->pixmapPrivate only existed in order to catch invalid access to
the framebuffer by making the backing data NULL across the VT switch.
This was causing more confusion in the higher layers during mode setting
without any real benefit, so remove it.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 hw/xfree86/common/xf86Helper.c |   11 -----------
 hw/xfree86/common/xf86str.h    |    1 -
 hw/xfree86/modes/xf86RandR12.c |   16 ----------------
 hw/xfree86/shadowfb/shadow.c   |   11 -----------
 4 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 90e0c67..97e5aec 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1180,10 +1180,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
     if (enable)
     {
 	/*
-	 * Restore the screen pixmap devPrivate field
-	 */
-	pspix->devPrivate = pScrnInfo->pixmapPrivate;
-	/*
 	 * Restore all of the clip lists on the screen
 	 */
 	if (!xf86Resetting)
@@ -1196,13 +1192,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
 	 * Empty all of the clip lists on the screen
 	 */
 	xf86SetRootClip (pScreen, FALSE);
-	/*
-	 * save the screen pixmap devPrivate field and
-	 * replace it with NULL so accidental references
-	 * to the frame buffer are caught
-	 */
-	pScrnInfo->pixmapPrivate = pspix->devPrivate;
-	pspix->devPrivate.ptr = NULL;
     }
 }
 
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index c9b261d..b979884 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -765,7 +765,6 @@ typedef struct _ScrnInfoRec {
 
     /* Allow screens to be enabled/disabled individually */
     Bool		vtSema;
-    DevUnion		pixmapPrivate;		/* saved devPrivate from pixmap */
 
     /* hw cursor moves at SIGIO time */
     Bool		silkenMouse;
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index b334b3c..89b74dd 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -520,7 +520,6 @@ xf86RandR12SetMode (ScreenPtr	    pScreen,
     WindowPtr		pRoot = pScreen->root;
     DisplayModePtr      currentMode = NULL;
     Bool 		ret = TRUE;
-    PixmapPtr 		pspix = NULL;
 
     if (pRoot)
 	(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
@@ -569,14 +568,6 @@ xf86RandR12SetMode (ScreenPtr	    pScreen,
 	pScreen->mmHeight = oldmmHeight;
         scrp->currentMode = currentMode;
     }
-    /*
-     * Get the new Screen pixmap ptr as SwitchMode might have called
-     * ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back...
-     * Unfortunately.
-     */
-    pspix = (*pScreen->GetScreenPixmap) (pScreen);
-    if (pspix->devPrivate.ptr)
-       scrp->pixmapPrivate = pspix->devPrivate;
 
     /*
      * Make sure the layout is correct
@@ -728,13 +719,6 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
     }
 
     pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
-    /*
-     * Get the new Screen pixmap ptr as resize() might have called
-     * ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back...
-     * Unfortunately.
-     */
-    if (pScrnPix->devPrivate.ptr)
-       pScrn->pixmapPrivate = pScrnPix->devPrivate;
     pScreen->width = pScrnPix->drawable.width = width;
     pScreen->height = pScrnPix->drawable.height = height;
     randrp->mmWidth = pScreen->mmWidth = mmWidth;
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
index 344f1ab..bf525c2 100644
--- a/hw/xfree86/shadowfb/shadow.c
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -325,7 +325,6 @@ ShadowModifyPixmapHeader(
     ScrnInfoPtr pScrn;
     ShadowScreenPtr pPriv;
     Bool retval;
-    PixmapPtr pScreenPix;
 
     if (!pPixmap)
 	return FALSE;
@@ -333,11 +332,6 @@ ShadowModifyPixmapHeader(
     pScreen = pPixmap->drawable.pScreen;
     pScrn = xf86Screens[pScreen->myNum];
 
-    pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-    
-    if (pPixmap == pScreenPix && !pScrn->vtSema)
-	pScreenPix->devPrivate = pScrn->pixmapPrivate;
-    
     pPriv = GET_SCREEN_PRIVATE(pScreen);
 
     pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
@@ -345,11 +339,6 @@ ShadowModifyPixmapHeader(
 	width, height, depth, bitsPerPixel, devKind, pPixData);
     pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
 
-    if (pPixmap == pScreenPix && !pScrn->vtSema)
-    {
-	pScrn->pixmapPrivate = pScreenPix->devPrivate;
-	pScreenPix->devPrivate.ptr = 0;
-    }
     return retval;
 }
 
-- 
1.7.1



More information about the xorg-devel mailing list