dixSetPrivate regressions in DDX xwin

Submitted by Colin Harrison on June 7, 2010, 5:40 p.m.

Details

Message ID 201006071040.o57AeoNI004803@StraightRunning.com
State Deferred, archived
Headers show

Not browsing as part of any series.

Commit Message

Colin Harrison June 7, 2010, 5:40 p.m.
Hi,

Patches for a few typos and a regression in DDX xwin...


Thanks,
Colin Harrison

Patch hide | download patch | download mbox

--- ./hw/xwin/save_winallpriv.c 2010-06-06 06:02:02.000000000 +0100
+++ ./hw/xwin/winallpriv.c      2010-06-06 17:45:40.000000000 +0100
@@ -74,25 +74,31 @@ 
   /* Intialize private structure members */
   pScreenPriv->fActive = TRUE;

+  if (!dixRegisterPrivateKey(g_iScreenPrivateKey, PRIVATE_SCREEN, 0))
+    {
+      ErrorF ("winAllocatePrivates - AllocateScreenPrivate () failed\n");
+      return FALSE;
+    }
+
   /* Save the screen private pointer */
   winSetScreenPriv (pScreen, pScreenPriv);

   /* Reserve GC memory for our privates */
-  if (!dixRequestPrivateKey(g_iGCPrivateKey, PRIVATE_GC, sizeof
(winPrivGCRec)))
+  if (!dixRegisterPrivateKey(g_iGCPrivateKey, PRIVATE_GC, sizeof
(winPrivGCRec)))
     {
       ErrorF ("winAllocatePrivates - AllocateGCPrivate () failed\n");
       return FALSE;
     }

   /* Reserve Pixmap memory for our privates */
-  if (!dixRequestPrivateKey(g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof
(winPrivPixmapRec)))
+  if (!dixRegisterPrivateKey(g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof
(winPrivPixmapRec)))
     {
       ErrorF ("winAllocatePrivates - AllocatePixmapPrivates () failed\n");
       return FALSE;
     }

   /* Reserve Window memory for our privates */
-  if (!dixRequestPrivateKey(g_iWindowPrivateKey, PRIVATE_WINDOW, sizeof
(winPrivWinRec)))
+  if (!dixRegisterPrivateKey(g_iWindowPrivateKey, PRIVATE_WINDOW, sizeof
(winPrivWinRec)))
     {
       ErrorF ("winAllocatePrivates () - AllocateWindowPrivates ()
failed\n");
        return FALSE;


--- ./hw/xwin/save_win.h        2010-06-06 06:02:02.000000000 +0100
+++ ./hw/xwin/win.h     2010-06-06 07:15:38.000000000 +0100
@@ -631,7 +631,7 @@ 
 extern DevPrivateKeyRec                g_iScreenPrivateKeyRec;
 #define g_iScreenPrivateKey    (&g_iScreenPrivateKeyRec)
 extern DevPrivateKeyRec                g_iCmapPrivateKeyRec;
-#define g_iCmapPrivateKeyRec   (&g_iCmapPrivateKeyRec)
+#define g_iCmapPrivateKey      (&g_iCmapPrivateKeyRec)
 extern DevPrivateKeyRec                g_iGCPrivateKeyRec;
 #define g_iGCPrivateKey        (&g_iGCPrivateKeyRec)
 extern DevPrivateKeyRec                g_iPixmapPrivateKeyRec;

Comments

I haven't looked at the surrounding code, but this looks right to me.

Reviewed-by: Jamey Sharp <jamey@minilop.net>

On Mon, Jun 7, 2010 at 3:40 AM, Colin Harrison
<colin.harrison@virgin.net> wrote:
> Hi,
>
> Patches for a few typos and a regression in DDX xwin...
>
> --- ./hw/xwin/save_winallpriv.c 2010-06-06 06:02:02.000000000 +0100
> +++ ./hw/xwin/winallpriv.c      2010-06-06 17:45:40.000000000 +0100
> @@ -74,25 +74,31 @@
>   /* Intialize private structure members */
>   pScreenPriv->fActive = TRUE;
>
> +  if (!dixRegisterPrivateKey(g_iScreenPrivateKey, PRIVATE_SCREEN, 0))
> +    {
> +      ErrorF ("winAllocatePrivates - AllocateScreenPrivate () failed\n");
> +      return FALSE;
> +    }
> +
>   /* Save the screen private pointer */
>   winSetScreenPriv (pScreen, pScreenPriv);
>
>   /* Reserve GC memory for our privates */
> -  if (!dixRequestPrivateKey(g_iGCPrivateKey, PRIVATE_GC, sizeof
> (winPrivGCRec)))
> +  if (!dixRegisterPrivateKey(g_iGCPrivateKey, PRIVATE_GC, sizeof
> (winPrivGCRec)))
>     {
>       ErrorF ("winAllocatePrivates - AllocateGCPrivate () failed\n");
>       return FALSE;
>     }
>
>   /* Reserve Pixmap memory for our privates */
> -  if (!dixRequestPrivateKey(g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof
> (winPrivPixmapRec)))
> +  if (!dixRegisterPrivateKey(g_iPixmapPrivateKey, PRIVATE_PIXMAP, sizeof
> (winPrivPixmapRec)))
>     {
>       ErrorF ("winAllocatePrivates - AllocatePixmapPrivates () failed\n");
>       return FALSE;
>     }
>
>   /* Reserve Window memory for our privates */
> -  if (!dixRequestPrivateKey(g_iWindowPrivateKey, PRIVATE_WINDOW, sizeof
> (winPrivWinRec)))
> +  if (!dixRegisterPrivateKey(g_iWindowPrivateKey, PRIVATE_WINDOW, sizeof
> (winPrivWinRec)))
>     {
>       ErrorF ("winAllocatePrivates () - AllocateWindowPrivates ()
> failed\n");
>        return FALSE;
>
>
> --- ./hw/xwin/save_win.h        2010-06-06 06:02:02.000000000 +0100
> +++ ./hw/xwin/win.h     2010-06-06 07:15:38.000000000 +0100
> @@ -631,7 +631,7 @@
>  extern DevPrivateKeyRec                g_iScreenPrivateKeyRec;
>  #define g_iScreenPrivateKey    (&g_iScreenPrivateKeyRec)
>  extern DevPrivateKeyRec                g_iCmapPrivateKeyRec;
> -#define g_iCmapPrivateKeyRec   (&g_iCmapPrivateKeyRec)
> +#define g_iCmapPrivateKey      (&g_iCmapPrivateKeyRec)
>  extern DevPrivateKeyRec                g_iGCPrivateKeyRec;
>  #define g_iGCPrivateKey        (&g_iGCPrivateKeyRec)
>  extern DevPrivateKeyRec                g_iPixmapPrivateKeyRec;
>
> Thanks,
> Colin Harrison
>
> _______________________________________________
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>