xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jan 12 12:15:48 PST 2012


 Xext/xf86bigfont.c                    |    4 ++--
 dix/dispatch.c                        |   12 +++---------
 hw/kdrive/ephyr/ephyrdriext.c         |    4 ++--
 hw/xfree86/dixmods/extmod/xf86dga2.c  |    2 +-
 hw/xfree86/dixmods/extmod/xf86vmode.c |    6 +++---
 hw/xfree86/dri/xf86dri.c              |    4 ++--
 hw/xfree86/dri2/dri2ext.c             |    2 +-
 hw/xquartz/applewm.c                  |    4 ++--
 hw/xquartz/xpr/appledri.c             |    4 ++--
 hw/xwin/winwindowswm.c                |    4 ++--
 include/dixstruct.h                   |   30 +++++++++++++++---------------
 include/os.h                          |    2 ++
 include/windowstr.h                   |    4 ++--
 os/access.c                           |    9 ++++++++-
 os/connection.c                       |   14 +++++++-------
 os/io.c                               |   19 +------------------
 os/osdep.h                            |   19 +++++++++++++++++--
 17 files changed, 72 insertions(+), 71 deletions(-)

New commits:
commit 5de0c2582f9c80874b4f4a5b86d250059bfaa85b
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:10:07 2012 -0800

    Revert "os: Repack ConnectionOutput for LP64"
    
    This reverts commit d5f724544afd2949cebfcf4f0b4510ec0c701bec.
    
    ABI change pended for 1.13

diff --git a/os/osdep.h b/os/osdep.h
index 3f774c2..70e2a07 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -120,8 +120,8 @@ typedef struct _connectionInput {
 
 typedef struct _connectionOutput {
     struct _connectionOutput *next;
-    unsigned char *buf;
     int size;
+    unsigned char *buf;
     int count;
 } ConnectionOutput, *ConnectionOutputPtr;
 
commit 11331305d4acd117b71502e45c0e86684fa9280b
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:10:03 2012 -0800

    Revert "dix: Repack ClientRec"
    
    This reverts commit f702372822dadb1fef92cfc25086481f640147b3.
    
    ABI change pended for 1.13

diff --git a/include/dixstruct.h b/include/dixstruct.h
index 5fd595d..0a85f40 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -90,22 +90,23 @@ typedef struct _Client {
     Mask        clientAsMask;
     pointer     requestBuffer;
     pointer     osPrivate;	/* for OS layer, including scheduler */
-    char        swapped;
-    char        big_requests;
-    char        closeDownMode;
-    char        clientGone;
-    char        noClientException;	/* this client died or needs to be
-					 * killed */
-    char	clientState;
+    Bool        swapped;
     ReplySwapPtr pSwapReplyFunc;
     XID         errorValue;
     int         sequence;
+    int         closeDownMode;
+    int         clientGone;
+    int         noClientException;	/* this client died or needs to be
+					 * killed */
     int         ignoreCount;		/* count for Attend/IgnoreClient */
-    int         numSaved;
     SaveSetElt	*saveSet;
-    int         (**requestVector) (ClientPtr /* pClient */);
+    int         numSaved;
+    int         (**requestVector) (
+		ClientPtr /* pClient */);
     CARD32	req_len;		/* length of current request */
+    Bool	big_requests;		/* supports large requests */
     int		priority;
+    ClientState clientState;
     PrivateRec	*devPrivates;
     unsigned short	xkbClientFlags;
     unsigned short	mapNotifyMask;
@@ -113,16 +114,16 @@ typedef struct _Client {
     unsigned short	vMajor,vMinor;
     KeyCode		minKC,maxKC;
 
-    unsigned int replyBytesRemaining;
+    unsigned long replyBytesRemaining;
     int	    smart_priority;
-    int     smart_start_tick;
-    int     smart_stop_tick;
-    int     smart_check_tick;
+    long    smart_start_tick;
+    long    smart_stop_tick;
+    long    smart_check_tick;
     
     DeviceIntPtr clientPtr;
     ClientIdPtr  clientIds;
     unsigned short majorOp, minorOp;
-} ClientRec;
+}           ClientRec;
 
 /*
  * Scheduling interface
commit d9eeede52f2d5ba9dd6368d988a5d2abb3b8b4e5
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:09:59 2012 -0800

    Revert "dix: Pull client-is-local flag up to the ClientRec"
    
    This reverts commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96.
    
    ABI change pended for 1.13

diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 5053852..4b63a13 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -300,7 +300,7 @@ ProcXF86BigfontQueryVersion(
 #endif
     reply.capabilities =
 #ifdef HAS_SHM
-	(client->local && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
+	(LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
 #else
 	0
 #endif
@@ -367,7 +367,7 @@ ProcXF86BigfontQueryFont(
 #else
     switch (client->req_len) {
 	case 2: /* client with version 1.0 libX11 */
-	    stuff_flags = (client->local && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
+	    stuff_flags = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
 	    break;
 	case 3: /* client with version 1.1 libX11 */
 	    stuff_flags = stuff->flags;
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index 85e38e0..0741a72 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -586,7 +586,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
     }
     rep.isCapable = isCapable;
 
-    if (!client->local || client->swapped)
+    if (!LocalClient(client) || client->swapped)
 	rep.isCapable = 0;
 
     if (client->swapped) {
@@ -1253,7 +1253,7 @@ ProcXF86DRIDispatch (register ClientPtr	client)
         }
     }
 
-    if (!client->local)
+    if (!LocalClient(client))
         return DRIErrorBase + XF86DRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index 4b17f15..4bcf77e 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -928,7 +928,7 @@ ProcXDGADispatch (ClientPtr client)
 {
     REQUEST(xReq);
 
-    if (!client->local)
+    if (!LocalClient(client))
 	return DGAErrorBase + XF86DGAClientNotLocal;
 
 #ifdef DGA_REQ_DEBUG
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 6e5e3f9..6d3d5fc 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -1527,7 +1527,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
     rep.sequenceNumber = client->sequence;
     rep.permissions = XF86VM_READ_PERMISSION;
     if (xf86GetVidModeEnabled() &&
-	(xf86GetVidModeAllowNonLocal() || client->local)) {
+	(xf86GetVidModeAllowNonLocal() || LocalClient (client))) {
 	rep.permissions |= XF86VM_WRITE_PERMISSION;
     }
     if(client->swapped) {
@@ -1597,7 +1597,7 @@ ProcXF86VidModeDispatch(ClientPtr client)
     default:
 	if (!xf86GetVidModeEnabled())
 	    return VidModeErrorBase + XF86VidModeExtensionDisabled;
-	if (xf86GetVidModeAllowNonLocal() || client->local) {
+	if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
 	    switch (stuff->data) {
 	    case X_XF86VidModeAddModeLine:
 		return ProcXF86VidModeAddModeLine(client);
@@ -2017,7 +2017,7 @@ SProcXF86VidModeDispatch(ClientPtr client)
     default:
 	if (!xf86GetVidModeEnabled())
 	    return VidModeErrorBase + XF86VidModeExtensionDisabled;
-	if (xf86GetVidModeAllowNonLocal() || client->local) {
+	if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
 	    switch (stuff->data) {
 	    case X_XF86VidModeAddModeLine:
 		return SProcXF86VidModeAddModeLine(client);
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index 723e526..c35ba2f 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -130,7 +130,7 @@ ProcXF86DRIQueryDirectRenderingCapable(
     }
     rep.isCapable = isCapable;
 
-    if (!client->local || client->swapped)
+    if (!LocalClient(client) || client->swapped)
 	rep.isCapable = 0;
 
     if (client->swapped) {
@@ -557,7 +557,7 @@ ProcXF86DRIDispatch (
 	return ProcXF86DRIQueryDirectRenderingCapable(client);
     }
 
-    if (!client->local)
+    if (!LocalClient(client))
 	return DRIErrorBase + XF86DRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 2133155..73ef7f2 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -547,7 +547,7 @@ ProcDRI2Dispatch (ClientPtr client)
 	return ProcDRI2QueryVersion(client);
     }
 
-    if (!client->local)
+    if (!LocalClient(client))
 	return BadRequest;
 
     switch (stuff->data) {
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 7077a6c..55976c4 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -630,7 +630,7 @@ ProcAppleWMDispatch (
         return ProcAppleWMQueryVersion(client);
     }
 
-    if (!client->local)
+    if (!LocalClient(client))
         return WMErrorBase + AppleWMClientNotLocal;
 
     switch (stuff->data)
@@ -693,7 +693,7 @@ SProcAppleWMDispatch (
     REQUEST(xReq);
 
     /* It is bound to be non-local when there is byte swapping */
-    if (!client->local)
+    if (!LocalClient(client))
         return WMErrorBase + AppleWMClientNotLocal;
 
     /* only local clients are allowed WM access */
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 091145b..44c132a 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -133,7 +133,7 @@ ProcAppleDRIQueryDirectRenderingCapable(
     }
     rep.isCapable = isCapable;
 
-    if (!client->local)
+    if (!LocalClient(client))
         rep.isCapable = 0;
 
     if (client->swapped) {
@@ -365,7 +365,7 @@ ProcAppleDRIDispatch (
         return ProcAppleDRIQueryDirectRenderingCapable(client);
     }
 
-    if (!client->local)
+    if (!LocalClient(client))
         return DRIErrorBase + AppleDRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index f43834d..577614d 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -548,7 +548,7 @@ ProcWindowsWMDispatch (ClientPtr client)
       return ProcWindowsWMQueryVersion(client);
     }
 
-  if (!client->local)
+  if (!LocalClient(client))
     return WMErrorBase + WindowsWMClientNotLocal;
 
   switch (stuff->data)
@@ -598,7 +598,7 @@ SProcWindowsWMDispatch (ClientPtr client)
   REQUEST(xReq);
 
   /* It is bound to be non-local when there is byte swapping */
-  if (!client->local)
+  if (!LocalClient(client))
     return WMErrorBase + WindowsWMClientNotLocal;
 
   /* only local clients are allowed WM access */
diff --git a/include/dixstruct.h b/include/dixstruct.h
index cb37051..5fd595d 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -91,7 +91,6 @@ typedef struct _Client {
     pointer     requestBuffer;
     pointer     osPrivate;	/* for OS layer, including scheduler */
     char        swapped;
-    char        local;
     char        big_requests;
     char        closeDownMode;
     char        clientGone;
diff --git a/include/os.h b/include/os.h
index 84dedd5..48ce329 100644
--- a/include/os.h
+++ b/include/os.h
@@ -353,6 +353,8 @@ typedef struct sockaddr * sockaddrPtr;
 
 extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client);
 
+extern _X_EXPORT int LocalClient(ClientPtr /* client */);
+
 extern _X_EXPORT int LocalClientCred(ClientPtr, int *, int *);
 
 #define LCC_UID_SET	(1 << 0)
diff --git a/os/access.c b/os/access.c
index ed13d0a..b609442 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1045,6 +1045,13 @@ ComputeLocalClient(ClientPtr client)
     return FALSE;
 }
 
+Bool LocalClient(ClientPtr client)
+{
+    if (!client->osPrivate)
+        return FALSE;
+    return ((OsCommPtr)client->osPrivate)->local_client;
+}
+
 /*
  * Return the uid and gid of a connected local client
  * 
@@ -1202,7 +1209,7 @@ AuthorizedClient(ClientPtr client)
     if (rc != Success)
 	return rc;
 
-    return client->local ? Success : BadAccess;
+    return LocalClient(client) ? Success : BadAccess;
 }
 
 /* Add a host to the access control list.  This is the external interface
diff --git a/os/connection.c b/os/connection.c
index e1b77bb..0e557a5 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -745,7 +745,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time)
 	free(oc);
 	return NullClient;
     }
-    client->local = ComputeLocalClient(client);
+    oc->local_client = ComputeLocalClient(client);
 #if !defined(WIN32)
     ConnectionTranslation[fd] = client->index;
 #else
diff --git a/os/osdep.h b/os/osdep.h
index 52d2ead..3f774c2 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -162,6 +162,7 @@ typedef struct _osComm {
     XID	auth_id;		/* authorization id */
     CARD32 conn_time;		/* timestamp if not established, else 0  */
     struct _XtransConnInfo *trans_conn; /* transport connection object */
+    Bool local_client;
 } OsCommRec, *OsCommPtr;
 
 extern int FlushClient(
commit 3be37375eed9eb9cfb9c42821deda4213af4057b
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:09:55 2012 -0800

    Revert "dix: Extend initial connection handshake for forwarding proxies"
    
    This reverts commit 78fa121f4097d29458e5453c13473595df06e26e.
    
    ABI change pended for 1.13

diff --git a/dix/dispatch.c b/dix/dispatch.c
index b91b41f..44c2433 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3582,14 +3582,12 @@ ProcInitialConnection(ClientPtr client)
     REQUEST(xReq);
     xConnClientPrefix *prefix;
     int whichbyte = 1;
-    char order;
 
     prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
-    order = prefix->byteOrder;
-    if (order != 'l' && order != 'B' && order != 'r' && order != 'R')
+    if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
 	return client->noClientException = -1;
-    if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
-	(!(*(char *) &whichbyte) && (order == 'l' || order == 'r')))
+    if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
+	(!(*(char *) &whichbyte) && (prefix->byteOrder == 'l')))
     {
 	client->swapped = TRUE;
 	SwapConnClientPrefix(prefix);
@@ -3601,10 +3599,6 @@ ProcInitialConnection(ClientPtr client)
     {
 	swaps(&stuff->length);
     }
-    if (order == 'r' || order == 'R')
-    {
-	client->local = FALSE;
-    }
     ResetCurrentRequest(client);
     return Success;
 }
diff --git a/os/connection.c b/os/connection.c
index a91501a..e1b77bb 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -882,7 +882,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
     xConnSetupPrefix csp;
     char pad[3];
     struct iovec iov[3];
-    char order = 0;
+    char byteOrder = 0;
     int whichbyte = 1;
     struct timeval waittime;
     fd_set mask;
@@ -895,16 +895,16 @@ ErrorConnMax(XtransConnInfo trans_conn)
     FD_SET(fd, &mask);
     (void)Select(fd + 1, &mask, NULL, NULL, &waittime);
     /* try to read the byte-order of the connection */
-    (void)_XSERVTransRead(trans_conn, &order, 1);
-    if (order == 'l' || order == 'B' || order == 'r' || order == 'R')
+    (void)_XSERVTransRead(trans_conn, &byteOrder, 1);
+    if ((byteOrder == 'l') || (byteOrder == 'B'))
     {
 	csp.success = xFalse;
 	csp.lengthReason = sizeof(NOROOM) - 1;
 	csp.length = (sizeof(NOROOM) + 2) >> 2;
 	csp.majorVersion = X_PROTOCOL;
 	csp.minorVersion = X_PROTOCOL_REVISION;
-	if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
-	    (!(*(char *) &whichbyte) && (order == 'l' || order == 'r')))
+	if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
+	    (!(*(char *) &whichbyte) && (byteOrder == 'l')))
 	{
 	    swaps(&csp.majorVersion);
 	    swaps(&csp.minorVersion);
commit 5b9f5c8a53aca03c3c73bc10bd362987621a9d72
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:09:44 2012 -0800

    Revert "os: Hide the Connection{In,Out}put implementation details"
    
    This reverts commit 48e7a2ef574c8b38c4f8f07b45f54c8bfd02552b.
    
    ABI change pended for 1.13

diff --git a/os/connection.c b/os/connection.c
index 2c90d72..a91501a 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1032,7 +1032,7 @@ CloseDownConnection(ClientPtr client)
     if (FlushCallback)
 	CallCallbacks(&FlushCallback, NULL);
 
-    if (oc->output)
+    if (oc->output && oc->output->count)
 	FlushClient(client, oc, (char *)NULL, 0);
 #ifdef XDMCP
     XdmcpCloseDisplay(oc->fd);
diff --git a/os/io.c b/os/io.c
index 78b7260..f5013d7 100644
--- a/os/io.c
+++ b/os/io.c
@@ -84,23 +84,6 @@ SOFTWARE.
 CallbackListPtr       ReplyCallback;
 CallbackListPtr       FlushCallback;
 
-typedef struct _connectionInput {
-    struct _connectionInput *next;
-    char *buffer;               /* contains current client input */
-    char *bufptr;               /* pointer to current start of data */
-    int  bufcnt;                /* count of bytes in buffer */
-    int lenLastReq;
-    int size;
-    unsigned int ignoreBytes;   /* bytes to ignore before the next request */
-} ConnectionInput, *ConnectionInputPtr;
-
-typedef struct _connectionOutput {
-    struct _connectionOutput *next;
-    unsigned char *buf;
-    int size;
-    int count;
-} ConnectionOutput, *ConnectionOutputPtr;
-
 static ConnectionInputPtr AllocateInputBuffer(void);
 static ConnectionOutputPtr AllocateOutputBuffer(void);
 
@@ -908,7 +891,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
     long notWritten;
     long todo;
 
-    if (!oco || !oco->count)
+    if (!oco)
 	return 0;
     written = 0;
     padsize = padlength[extraCount & 3];
diff --git a/os/osdep.h b/os/osdep.h
index c9add48..52d2ead 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -108,8 +108,22 @@ typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
 			      unsigned data_length, char *data);
 #endif
 
-typedef struct _connectionInput *ConnectionInputPtr;
-typedef struct _connectionOutput *ConnectionOutputPtr;
+typedef struct _connectionInput {
+    struct _connectionInput *next;
+    char *buffer;               /* contains current client input */
+    char *bufptr;               /* pointer to current start of data */
+    int  bufcnt;                /* count of bytes in buffer */
+    int lenLastReq;
+    int size;
+    unsigned int ignoreBytes;   /* bytes to ignore before the next request */
+} ConnectionInput, *ConnectionInputPtr;
+
+typedef struct _connectionOutput {
+    struct _connectionOutput *next;
+    unsigned char *buf;
+    int size;
+    int count;
+} ConnectionOutput, *ConnectionOutputPtr;
 
 struct _osComm;
 
commit 5867d453cebebec6b4f10409af86b603755fbf51
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jan 12 12:09:34 2012 -0800

    Revert "dix: Fix types in WindowOptRec"
    
    This reverts commit a4553019a10b4e01cc06f3081db71a83338697b4.
    
    ABI change pended for 1.13

diff --git a/include/windowstr.h b/include/windowstr.h
index 1124dfc..222de31 100644
--- a/include/windowstr.h
+++ b/include/windowstr.h
@@ -87,8 +87,8 @@ typedef struct _WindowOpt {
     struct _OtherClients *otherClients;	   /* default: NULL */
     struct _GrabRec	*passiveGrabs;	   /* default: NULL */
     PropertyPtr		userProps;	   /* default: NULL */
-    CARD32		backingBitPlanes;  /* default: ~0L */
-    CARD32		backingPixel;	   /* default: 0 */
+    unsigned long	backingBitPlanes;  /* default: ~0L */
+    unsigned long	backingPixel;	   /* default: 0 */
     RegionPtr		boundingShape;	   /* default: NULL */
     RegionPtr		clipShape;	   /* default: NULL */
     RegionPtr		inputShape;	   /* default: NULL */


More information about the xorg-commit mailing list