xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Sat Jun 5 21:43:21 PDT 2010


 exa/exa.c             |    9 +++------
 exa/exa_priv.h        |   10 +++++++---
 hw/kdrive/src/kxv.c   |    6 +-----
 hw/xnest/Color.c      |    3 +++
 miext/damage/damage.c |    2 +-
 miext/shadow/shadow.c |    6 +++---
 render/picturestr.h   |    2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 424b593c7872a703d3d0c942b7e8acc0770eb023
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 21:34:51 2010 -0700

    Damage pixmap private key was being mis-registered as a picture key
    
    This would cause all kinds of fun, in particular Xnest would crash at startup.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index e8a1191..ef7974e 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1893,7 +1893,7 @@ DamageSetup (ScreenPtr pScreen)
     if (!dixRegisterPrivateKey(&damageGCPrivateKeyRec, PRIVATE_GC, sizeof(DamageGCPrivRec)))
 	return FALSE;
 
-    if (!dixRegisterPrivateKey(&damagePixPrivateKeyRec, PRIVATE_PICTURE, 0))
+    if (!dixRegisterPrivateKey(&damagePixPrivateKeyRec, PRIVATE_PIXMAP, 0))
 	return FALSE;
 
     if (!dixRegisterPrivateKey(&damageWinPrivateKeyRec, PRIVATE_WINDOW, 0))
commit 9c121ae45ae1d2ebd892c45e1631716ef5e7d649
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 21:34:27 2010 -0700

    Register Xnest colormap screen private key
    
    This key is used to store the currently installed colormap and must be
    registered before we can use it.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c
index 6399e34..3b60cc9 100644
--- a/hw/xnest/Color.c
+++ b/hw/xnest/Color.c
@@ -469,6 +469,9 @@ xnestCreateDefaultColormap(ScreenPtr pScreen)
   unsigned short zero = 0, ones = 0xFFFF;  
   Pixel wp, bp;
 
+  if (!dixRegisterPrivateKey(&cmapScrPrivateKeyRec, PRIVATE_SCREEN, 0))
+      return FALSE;
+
   for (pVisual = pScreen->visuals;
        pVisual->vid != pScreen->rootVisual;
        pVisual++);
commit df534d05208436e9ca8c9b42acff3fbe240e3ec4
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 21:24:54 2010 -0700

    Make GetPictureScreenIfSet check if Render is running
    
    This macro originally checked to see if the Render screen private
    index had been allocated. When the privates were changed the first
    time, there wasn't any need to check as dixLookupPrivate would simply
    return NULL in that case. Now that we care, check to see if the key
    has been initialized before asking for the value.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/render/picturestr.h b/render/picturestr.h
index da69ff6..5c6c41e 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -407,7 +407,7 @@ extern _X_EXPORT RESTYPE	PictFormatType;
 extern _X_EXPORT RESTYPE	GlyphSetType;
 
 #define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
-#define GetPictureScreenIfSet(s) GetPictureScreen(s)
+#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
 #define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p)
 #define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey))
 #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)
commit e7fc8b32e41e10c057d2787fcc377296be67f2e9
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 21:08:01 2010 -0700

    Move the shadow screen private key initialization to shadowSetup
    
    Some users of the shadow code don't call shadowInit, just shadowSetup
    and so make sure the key is initialized there.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index 111f46a..cb1b299 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -136,6 +136,9 @@ shadowSetup(ScreenPtr pScreen)
 {
     shadowBufPtr pBuf;
 
+    if (!dixRegisterPrivateKey(&shadowScrPrivateKeyRec, PRIVATE_SCREEN, 0))
+	return FALSE;
+
     if (!DamageSetup(pScreen))
 	return FALSE;
 
@@ -233,9 +236,6 @@ shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window)
 {
     PixmapPtr pPixmap;
     
-    if (!dixRegisterPrivateKey(&shadowScrPrivateKeyRec, PRIVATE_SCREEN, 0))
-	return FALSE;
-
     pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height,
 				    pScreen->rootDepth, 0);
     if (!pPixmap)
commit 6bd5f0d75bca727c4686b20eee166c8cae472ba2
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 21:07:15 2010 -0700

    Fix exa_priv.h declarations of privates
    
    exa_priv.h exposes the privates to the rest of the exa code, and yet
    the declarations of the privates wasn't fixed when the exa.c versions were.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/exa/exa.c b/exa/exa.c
index bbe93f6..118a110 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -37,12 +37,9 @@
 #include "exa_priv.h"
 #include "exa.h"
 
-static DevPrivateKeyRec exaScreenPrivateKeyRec;
-#define exaScreenPrivateKey (&exaScreenPrivateKeyRec)
-static DevPrivateKeyRec exaPixmapPrivateKeyRec;
-#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec)
-static DevPrivateKeyRec exaGCPrivateKeyRec;
-#define exaGCPrivateKey (&exaGCPrivateKeyRec)
+DevPrivateKeyRec exaScreenPrivateKeyRec;
+DevPrivateKeyRec exaPixmapPrivateKeyRec;
+DevPrivateKeyRec exaGCPrivateKeyRec;
 
 #ifdef MITSHM
 static ShmFuncs exaShmFuncs = { NULL, NULL };
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 14c99e9..58d04b0 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -221,9 +221,13 @@ typedef struct {
     (PixmapWidthPaddingInfo[d].padRoundUp+1)))
 #endif
 
-extern DevPrivateKey exaScreenPrivateKey;
-extern DevPrivateKey exaPixmapPrivateKey;
-extern DevPrivateKey exaGCPrivateKey;
+extern DevPrivateKeyRec exaScreenPrivateKeyRec;
+#define exaScreenPrivateKey (&exaScreenPrivateKeyRec)
+extern DevPrivateKeyRec exaPixmapPrivateKeyRec;
+#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec)
+extern DevPrivateKeyRec exaGCPrivateKeyRec;
+#define exaGCPrivateKey (&exaGCPrivateKeyRec)
+
 #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey))
 #define ExaScreenPriv(s)	ExaScreenPrivPtr    pExaScr = ExaGetScreenPriv(s)
 
commit 6b306f43384e5c2143197e746a5a39c4ebb2583c
Author: Keith Packard <keithp at keithp.com>
Date:   Sat Jun 5 20:58:04 2010 -0700

    kdrive: Xv code uses shared screen private instead of kdrive-specific private
    
    When doing the devPrivate API conversion, I missed this as there was
    also a local private key which wasn't ever used.
    
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 24ae89e..3af6acf 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -105,8 +105,7 @@ static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr*, int);
 
 static DevPrivateKeyRec KdXVWindowKeyRec;
 #define KdXVWindowKey (&KdXVWindowKeyRec)
-static DevPrivateKeyRec KdXvScreenKeyRec;
-#define KdXvScreenKey (&KdXvScreenKeyRec)
+static DevPrivateKey KdXvScreenKey;
 static unsigned long KdXVGeneration = 0;
 static unsigned long PortResource = 0;
 
@@ -202,9 +201,6 @@ KdXVScreenInit(
   if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0))
       return FALSE;
 
-  if (!dixRegisterPrivateKey(&KdXVScreenKeyRec, PRIVATE_SCREEN, 0))
-      return FALSE;
-
   if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
 
   KdXvScreenKey = (*XvGetScreenKeyProc)();


More information about the xorg-commit mailing list