xserver: Branch 'master' - 10 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jan 20 21:21:47 PST 2011


 dix/resource.c              |   42 +++++++++++++++++-------------------------
 hw/dmx/config/xdmxconfig.c  |    2 +-
 hw/dmx/dmxextension.c       |   18 ++++++++++--------
 hw/dmx/dmxgc.c              |    7 +------
 hw/dmx/input/dmxinputinit.c |   40 ++++------------------------------------
 os/WaitFor.c                |   12 +++++++++---
 6 files changed, 42 insertions(+), 79 deletions(-)

New commits:
commit be3be7580b6f6fd2f7fa4d4abfe5e1ab19470223
Merge: 57a1d9b... a1d885f...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 20 21:21:21 2011 -0800

    Merge remote branch 'ajax/for-keithp'

commit a1d885fdd67503a442b348626d2eddf6d22419e8
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Jun 23 13:28:55 2010 -0400

    resource: Fix indentation
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/resource.c b/dix/resource.c
index f558ed2..26d2c72 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -881,21 +881,21 @@ LegalNewID(XID id, ClientPtr client)
 #ifdef PANORAMIX
     XID 	minid, maxid;
 
-	if (!noPanoramiXExtension) { 
-	    minid = client->clientAsMask | (client->index ? 
-			                    SERVER_BIT : SERVER_MINID);
-	    maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1;
-            if ((id >= minid) && (id <= maxid))
-	        return TRUE;
-	}
+    if (!noPanoramiXExtension) {
+        minid = client->clientAsMask | (client->index ?
+                                        SERVER_BIT : SERVER_MINID);
+        maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1;
+        if ((id >= minid) && (id <= maxid))
+            return TRUE;
+    }
 #endif /* PANORAMIX */
-	if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
-	{
-	    rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
-					  DixGetAttrAccess);
-	    return rc == BadValue;
-	}
-	return FALSE;
+    if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
+    {
+        rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
+                                      DixGetAttrAccess);
+        return rc == BadValue;
+    }
+    return FALSE;
 }
 
 int
commit cb61cf5c99004ba3c76b504220c6728b5f2d2de6
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 15 18:36:55 2010 -0400

    resource: Remove expectID hack
    
    This is clearly meant to short-circuit the (modestly) expensive resource
    lookup in LegalNewID.  The problem is that long-lived clients will
    eventually run completely through their XID space and start asking
    XC-MISC for IDs to reuse.  Once that happens, the comparison against
    expectID will always be true, and we'll no longer catch XID collisions
    at all.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/resource.c b/dix/resource.c
index 18ed682..f558ed2 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -175,7 +175,6 @@ typedef struct _ClientResource {
     int		hashsize;	/* log(2)(buckets) */
     XID		fakeID;
     XID		endFakeID;
-    XID		expectID;
 } ClientResourceRec;
 
 RESTYPE lastResourceType;
@@ -322,7 +321,6 @@ InitClientResources(ClientPtr client)
     clientTable[i].fakeID = client->clientAsMask |
 			    (client->index ? SERVER_BIT : SERVER_MINID);
     clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1;
-    clientTable[i].expectID = client->clientAsMask;
     for (j=0; j<INITBUCKETS; j++) 
     {
         clientTable[i].resources[j] = NULL;
@@ -511,8 +509,6 @@ AddResource(XID id, RESTYPE type, pointer value)
     res->value = value;
     *head = res;
     rrec->elements++;
-    if (!(id & SERVER_BIT) && (id >= rrec->expectID))
-	rrec->expectID = id + 1;
     CallResourceStateCallback(ResourceStateAdding, res);
     return TRUE;
 }
@@ -895,9 +891,6 @@ LegalNewID(XID id, ClientPtr client)
 #endif /* PANORAMIX */
 	if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
 	{
-	    if (clientTable[client->index].expectID <= id)
-		return TRUE;
-
 	    rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
 					  DixGetAttrAccess);
 	    return rc == BadValue;
commit 3282e3c627f97f079e3a9af756a6b13bd9a5f227
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 15 08:46:28 2010 -0400

    resource: s/NullResource/NULL/g
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/resource.c b/dix/resource.c
index 6bd2403..18ed682 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -167,7 +167,6 @@ typedef struct _Resource {
     RESTYPE		type;
     pointer		value;
 } ResourceRec, *ResourcePtr;
-#define NullResource ((ResourcePtr)NULL)
 
 typedef struct _ClientResource {
     ResourcePtr *resources;
@@ -326,7 +325,7 @@ InitClientResources(ClientPtr client)
     clientTable[i].expectID = client->clientAsMask;
     for (j=0; j<INITBUCKETS; j++) 
     {
-        clientTable[i].resources[j] = NullResource;
+        clientTable[i].resources[j] = NULL;
     }
     return TRUE;
 }
@@ -543,7 +542,7 @@ RebuildTable(int client)
     }
     for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
     {
-	*rptr = NullResource;
+	*rptr = NULL;
 	*tptr = rptr;
     }
     clientTable[client].hashsize++;
@@ -555,7 +554,7 @@ RebuildTable(int client)
 	for (res = *rptr; res; res = next)
 	{
 	    next = res->next;
-	    res->next = NullResource;
+	    res->next = NULL;
 	    tptr = &tails[Hash(client, res->id)];
 	    **tptr = res;
 	    *tptr = &res->next;
commit f953ae7d8a578d135a6faaf69d9c06eae7c85ede
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Dec 14 14:38:10 2009 -0500

    os: Reduce smart scheduler setup calls
    
    We can return from WaitForSomething with no clients ready for any number
    of reasons.  There's no reason to set up the scheduler timer when this
    happens.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/WaitFor.c b/os/WaitFor.c
index e663004..867cb04 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -153,13 +153,17 @@ WaitForSomething(int *pClientsReady)
     fd_set clientsWritable;
     int curclient;
     int selecterr;
-    int nready;
+    static int nready;
     fd_set devicesReadable;
     CARD32 now = 0;
     Bool    someReady = FALSE;
 
     FD_ZERO(&clientsReadable);
 
+    if (nready)
+        SmartScheduleStopTimer();
+    nready = 0;
+
     /* We need a while loop here to handle 
        crashed connections and the screen saver timeout */
     while (1)
@@ -211,7 +215,6 @@ WaitForSomething(int *pClientsReady)
 	}
 	XFD_COPYSET(&AllSockets, &LastSelectMask);
 	}
-	SmartScheduleStopTimer ();
 
 	BlockHandler((pointer)&wt, (pointer)&LastSelectMask);
 	if (NewOutputPending)
@@ -230,7 +233,6 @@ WaitForSomething(int *pClientsReady)
 	}
 	selecterr = GetErrno();
 	WakeupHandler(i, (pointer)&LastSelectMask);
-	SmartScheduleStartTimer ();
 	if (i <= 0) /* An error or timeout occurred */
 	{
 	    if (dispatchException)
@@ -388,6 +390,10 @@ WaitForSomething(int *pClientsReady)
 #endif
 	}
     }
+
+    if (nready)
+        SmartScheduleStartTimer();
+
     return nready;
 }
 
commit d127075da06239852c1cc745abfe63d0d180d984
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 19:03:33 2011 -0500

    xdmxconfig: warning fix
    
    xdmxconfig.c: In function ‘dmxConfigCanvasDraw’:
    xdmxconfig.c:299:23: warning: ‘maxHeight’ may be used uninitialized in this function
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 033b525..c67077a 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -142,7 +142,7 @@ static void dmxConfigGetDims(int *maxWidth, int *maxHeight)
     DMXConfigEntryPtr e;
     
     *maxWidth = dmxConfigWallWidth  = 0;
-    *maxWidth = dmxConfigWallHeight = 0;
+    *maxHeight = dmxConfigWallHeight = 0;
     if (!dmxConfigCurrent) return;
     
     dmxConfigWallWidth  = dmxConfigCurrent->width;
commit 7a08f9abef7219fabdab8d1d49e8d3afb042e36a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:59:39 2011 -0500

    dmx: warning fixes
    
    dmxinputinit.c: In function ‘dmxBlockHandler’:
    dmxinputinit.c:610:44: warning: cast from pointer to integer of different size
    dmxinputinit.c: In function ‘dmxWakeupHandler’:
    dmxinputinit.c:637:41: warning: cast from pointer to integer of different size
    dmxinputinit.c: In function ‘dmxInputInit’:
    dmxinputinit.c:1041:36: warning: cast to pointer from integer of different size
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 6fc11cd..5cbd620 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -607,7 +607,7 @@ static void dmxCollectAll(DMXInputInfo *dmxInput)
 static void dmxBlockHandler(pointer blockData, OSTimePtr pTimeout,
                             pointer pReadMask)
 {
-    DMXInputInfo    *dmxInput = &dmxInputs[(int)blockData];
+    DMXInputInfo    *dmxInput = &dmxInputs[(uintptr_t)blockData];
     static unsigned long generation = 0;
     
     if (generation != serverGeneration) {
@@ -634,7 +634,7 @@ static void dmxSwitchReturn(pointer p)
 
 static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask)
 {
-    DMXInputInfo *dmxInput = &dmxInputs[(int)blockData];
+    DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
     int          i;
 
     if (dmxInput->vt_switch_pending) {
@@ -1036,9 +1036,8 @@ void dmxInputInit(DMXInputInfo *dmxInput)
     dmxInput->processInputEvents    = dmxProcessInputEvents;
     dmxInput->detached              = False;
     
-    RegisterBlockAndWakeupHandlers(dmxBlockHandler,
-                                   dmxWakeupHandler,
-                                   (void *)dmxInput->inputIdx);
+    RegisterBlockAndWakeupHandlers(dmxBlockHandler, dmxWakeupHandler,
+                                   (void *)(uintptr_t)dmxInput->inputIdx);
 }
 
 static void dmxInputFreeLocal(DMXLocalInputInfoRec *local)
commit ffd323b7c0212ed9b348e51cd9b36363d7c4d1f2
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:55:20 2011 -0500

    dmx: warning fix
    
    dmxinputinit.c: At top level:
    dmxinputinit.c:135:29: warning: ‘DMXCommonOth’ defined but not used
    
    DMXCommonOth is actually mentioned in a #if 0 block, so delete it and
    the block that references it.  If anyone needs it, git remembers.
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 7cac86f..6fc11cd 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -132,14 +132,6 @@ static DMXLocalInputInfoRec DMXConsoleKbd = {
     NULL, dmxCommonKbdCtrl, dmxCommonKbdBell
 };
 
-static DMXLocalInputInfoRec DMXCommonOth = {
-    "common-oth", DMX_LOCAL_OTHER, DMX_LOCAL_TYPE_COMMON, 1,
-    dmxCommonCopyPrivate, NULL,
-    NULL, NULL, NULL, dmxCommonOthGetInfo,
-    dmxCommonOthOn, dmxCommonOthOff
-};
-
-
 static DMXLocalInputInfoRec DMXLocalDevices[] = {
                                 /* Dummy drivers that can compile on any OS */
 #ifdef __linux__
@@ -897,29 +889,6 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
                     }
                 }
                 break;
-#if 0
-            case IsXExtensionDevice:
-            case IsXExtensionKeyboard:
-            case IsXExtensionPointer:
-                if (doXI) {
-                    if (!dmxInput->numDevs) {
-                        dmxLog(dmxWarning,
-                               "Cannot use remote (%s) XInput devices if"
-                               " not also using core devices\n",
-                               dmxInput->name);
-                    } else {
-                        dmxLocal             = dmxInputCopyLocal(dmxInput,
-                                                                &DMXCommonOth);
-                        dmxLocal->isCore     = FALSE;
-                        dmxLocal->sendsCore  = FALSE;
-                        dmxLocal->deviceId   = devices[i].id;
-                        dmxLocal->deviceName = (devices[i].name
-                                                ? strdup(devices[i].name)
-                                                : NULL);
-                    }
-                }
-                break;
-#endif
             }
         }
         XFreeDeviceList(devices);
commit c1fe0b155d0567440228aa5d9e36036f37670e3b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:52:57 2011 -0500

    dmx: warning fix
    
    dmxgc.c: In function ‘dmxChangeClip’:
    dmxgc.c:386:5: warning: case label value exceeds maximum value for type
    dmxgc.c:387:5: warning: case label value exceeds maximum value for type
    dmxgc.c:388:5: warning: case label value exceeds maximum value for type
    dmxgc.c:389:5: warning: case label value exceeds maximum value for type
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c
index 829200e..f10f9a0 100644
--- a/hw/dmx/dmxgc.c
+++ b/hw/dmx/dmxgc.c
@@ -383,12 +383,7 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
 	break;
 
     case CT_PIXMAP:
-    case CT_UNSORTED:
-    case CT_YSORTED:
-    case CT_YXSORTED:
-    case CT_YXBANDED:
-	/* These clip types are condensed down to either NONE or REGION
-           in the mi code */
+	/* Condensed down to REGION in the mi code */
 	break;
     }
 
commit b02e006b2733ea457df41791f6054309e4edf7f6
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 20 18:46:00 2011 -0500

    dmx: warning fixes
    
    Dear gcc: I do not care about machines where sizeof(void *) <
    sizeof(int), and neither should you.
    
    dmxextension.c: In function ‘dmxBECreateResources’:
    dmxextension.c:858:26: warning: cast from pointer to integer of different size
    dmxextension.c: In function ‘dmxBERestoreRenderPict’:
    dmxextension.c:1062:29: warning: cast from pointer to integer of different size
    dmxextension.c: In function ‘dmxBERestoreRenderGlyph’:
    dmxextension.c:1084:35: warning: cast from pointer to integer of different size
    dmxextension.c: In function ‘dmxAttachScreen’:
    dmxextension.c:1277:8: warning: cast to pointer from integer of different size
    dmxextension.c:1286:34: warning: cast to pointer from integer of different size
    dmxextension.c:1292:35: warning: cast to pointer from integer of different size
    dmxextension.c: In function ‘dmxBEDestroyResources’:
    dmxextension.c:1456:26: warning: cast from pointer to integer of different size
    dmxextension.c: In function ‘dmxDetachScreen’:
    dmxextension.c:1599:8: warning: cast to pointer from integer of different size
    
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index 45cb3db..bd326ce 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -855,7 +855,7 @@ static void dmxBERestorePixmap(PixmapPtr pPixmap)
 static void dmxBECreateResources(pointer value, XID id, RESTYPE type,
 				 pointer n)
 {
-    int        scrnNum = (int)n;
+    int        scrnNum = (uintptr_t)n;
     ScreenPtr  pScreen = screenInfo.screens[scrnNum];
 
     if ((type & TypeMask) == (RT_WINDOW & TypeMask)) {
@@ -1059,7 +1059,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n)
 {
     PicturePtr   pPicture = value;               /* The picture */
     DrawablePtr  pDraw    = pPicture->pDrawable; /* The picture's drawable */
-    int          scrnNum  = (int)n;
+    int          scrnNum  = (uintptr_t)n;
 
     if (pDraw->pScreen->myNum != scrnNum) {
 	/* Picture not on the screen we are restoring*/
@@ -1081,7 +1081,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n)
 static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n)
 {
     GlyphSetPtr      glyphSet   = value;
-    int              scrnNum    = (int)n;
+    int              scrnNum    = (uintptr_t)n;
     dmxGlyphPrivPtr  glyphPriv  = DMX_GET_GLYPH_PRIV(glyphSet);
     DMXScreenInfo   *dmxScreen  = &dmxScreens[scrnNum];
     GlyphRefPtr      table;
@@ -1274,7 +1274,7 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
     for (i = currentMaxClients; --i >= 0; )
 	if (clients[i])
 	    FindAllClientResources(clients[i], dmxBECreateResources,
-				   (pointer)idx);
+				   (pointer)(uintptr_t)idx);
 
     /* Create window hierarchy (top down) */
     dmxBECreateWindowTree(idx);
@@ -1283,13 +1283,15 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
     for (i = currentMaxClients; --i >= 0; )
 	if (clients[i])
 	    FindClientResourcesByType(clients[i],PictureType, 
-				      dmxBERestoreRenderPict,(pointer)idx);
+				      dmxBERestoreRenderPict,
+				      (pointer)(uintptr_t)idx);
 
     /* Restore the glyph state for RENDER */
     for (i = currentMaxClients; --i >= 0; )
 	if (clients[i])
 	    FindClientResourcesByType(clients[i],GlyphSetType, 
-				      dmxBERestoreRenderGlyph,(pointer)idx);
+				      dmxBERestoreRenderGlyph,
+				      (pointer)(uintptr_t)idx);
 
     /* Refresh screen by generating exposure events for all windows */
     dmxForceExposures(idx);
@@ -1453,7 +1455,7 @@ static void dmxBESavePixmap(PixmapPtr pPixmap)
 static void dmxBEDestroyResources(pointer value, XID id, RESTYPE type,
 				  pointer n)
 {
-    int        scrnNum = (int)n;
+    int        scrnNum = (uintptr_t)n;
     ScreenPtr  pScreen = screenInfo.screens[scrnNum];
 
     if ((type & TypeMask) == (RT_WINDOW & TypeMask)) {
@@ -1596,7 +1598,7 @@ int dmxDetachScreen(int idx)
     for (i = currentMaxClients; --i >= 0; )
 	if (clients[i])
 	    FindAllClientResources(clients[i], dmxBEDestroyResources,
-				   (pointer)idx);
+				   (pointer)(uintptr_t)idx);
 
     /* Free scratch GCs */
     dmxBEDestroyScratchGCs(idx);


More information about the xorg-commit mailing list