xserver: Branch 'master' - 20 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Jan 9 13:15:05 PST 2012


 Xext/xace.c                            |    4 ++
 Xext/xf86bigfont.c                     |    4 +-
 configure.ac                           |    7 ++++
 dix/dispatch.c                         |   26 ++++++++++++------
 dix/dixutils.c                         |   17 ++++++++---
 dix/property.c                         |    2 -
 hw/kdrive/ephyr/ephyrdriext.c          |    4 +-
 hw/xfree86/Makefile.am                 |    2 -
 hw/xfree86/ddc/ddcProperty.c           |   47 ++-------------------------------
 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/xfree86/loader/loadmod.c            |    3 ++
 hw/xfree86/os-support/linux/lnx_init.c |   19 +++++++++----
 hw/xfree86/vgahw/vgaHW.h               |    8 ++---
 hw/xfree86/xaa/Makefile.am             |    4 ++
 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 +-
 mi/mibitblt.c                          |    2 -
 os/access.c                            |    9 ------
 os/client.c                            |   43 +++++++++++++++++++++++++++++-
 os/connection.c                        |   16 ++++++-----
 os/io.c                                |   21 ++++++++++++++
 os/osdep.h                             |   23 +---------------
 29 files changed, 179 insertions(+), 144 deletions(-)

New commits:
commit f4956faab9ccf9aba6cf9603f4489f5dad19a347
Author: Zhigang Gong <zhigang.gong at linux.intel.com>
Date:   Wed Jan 4 07:01:19 2012 +0000

    mi/mibitblt: Fix an overflow bug of bit shift.
    
    When depth equal to 32 and planeMask equal to 0, the overflow will
    occur and cause the pixmap can't be cleared. There are some test
    cases in XTS hit this bug, and this fix can eliminate the corresponding
    failures.
    
    Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 2dfff14..fc6eb8d 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -648,7 +648,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     depth = pDraw->depth;
     if(format == ZPixmap)
     {
-	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
+	if ( (((1LL<<depth)-1)&planeMask) != (1LL<<depth)-1 )
 	{
 	    ChangeGCVal gcv;
 	    xPoint pt;
commit 6d6d4cb6043905d850834946e9bfc526ed5a9ef7
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Mon Jan 2 13:23:59 2012 +0000

    Add OpenBSD support to DetermineClientCmd()
    
    Uses kvm_getargv() from libkvm.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 6de92b4..8fafb2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1024,6 +1024,13 @@ if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
 else
 	CLIENTIDS=no
 fi
+if test "x$CLIENTIDS" = xyes; then
+	case $host_os in
+	openbsd*)
+		SYS_LIBS="$SYS_LIBS -lkvm"
+	;;
+	esac
+fi
 AC_MSG_RESULT([$CLIENTIDS])
 AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
 
diff --git a/os/client.c b/os/client.c
index 8f4707b..fbccf22 100644
--- a/os/client.c
+++ b/os/client.c
@@ -64,6 +64,15 @@
 #include <procfs.h>
 #endif
 
+#ifdef __OpenBSD__
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+
+#include <kvm.h>
+#include <limits.h>
+#endif
+
 /**
  * Try to determine a PID for a client from its connection
  * information. This should be called only once when new client has
@@ -172,7 +181,39 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs)
         if (cmdargs && sp)
             *cmdargs = strdup(sp);
     }
-#else /* not Solaris */
+#elif defined(__OpenBSD__)
+    /* on OpenBSD use kvm_getargv() */
+    {
+	kvm_t *kd;
+	char errbuf[_POSIX2_LINE_MAX];
+	char **argv;
+	struct kinfo_proc *kp;
+	size_t len = 0;
+	int i, n;
+
+	kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, errbuf);
+	if (kd == NULL)
+		return;
+	kp = kvm_getprocs(kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &n);
+	if (n != 1)
+		return;
+	argv = kvm_getargv(kd, kp, 0);
+	*cmdname = strdup(argv[0]);
+	i = 1;
+	while (argv[i] != NULL) {
+		len += strlen(argv[i]) + 1;
+		i++;
+	}
+	*cmdargs = calloc(1, len);
+	i = 1;
+	while (argv[i] != NULL) {
+		strlcat(*cmdargs, argv[i], len);
+		strlcat(*cmdargs, " ", len);
+		i++;
+	}
+	kvm_close(kd);
+    }
+#else /* Linux using /proc/pid/cmdline */
 
     /* Check if /proc/pid/cmdline exists. It's not supported on all
      * operating systems. */
commit a55214d11916b707b7c8c65c555cc0cbb59ac503
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Jan 3 06:22:24 2012 +0000

    Always install xaa sdk headers
    
    Always install XAA SDK headers so drivers still build even with
    --disable-xaa
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 4f08772..72be889 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -11,9 +11,7 @@ if XF86UTILS
 XF86UTILS_SUBDIR = utils
 endif
 
-if XAA
 XAA_SUBDIR = xaa
-endif
 
 if VGAHW
 VGAHW_SUBDIR = vgahw
diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am
index 7ebe0b9..78d9348 100644
--- a/hw/xfree86/xaa/Makefile.am
+++ b/hw/xfree86/xaa/Makefile.am
@@ -8,6 +8,8 @@ MSB_FIXED = mf-xaaBitmap.c mf-xaaStipple.c mf-xaaTEGlyph.c
 MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c
 POLYSEG = s-xaaLine.c s-xaaDashLine.c
 
+if XAA
+
 libxaa_la_LDFLAGS = -module -avoid-version
 if COMPOSITE
 libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la
@@ -60,6 +62,8 @@ ${MSB_3_FIXED}:
 	$(AM_V_GEN)echo "#define FIXEDBASE" >> $@
 	$(AM_V_GEN)echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@
 
+endif # XAA
+
 DISTCLEANFILES = $(POLYSEG) \
 	$(LSB_FIRST) $(LSB_FIXED) $(MSB_FIRST) $(MSB_FIXED) \
 	$(LSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIRST) $(MSB_3_FIXED)
commit dafc327f3c75205cf7e5360e9ccd71c7457f61a5
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Mon Jan 2 13:11:41 2012 +0000

    UnloadSubModule(): accept pointer value '1' and ignore it.
    
    Some driver modules try to unload submodules that are now built-in.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 5b9f8d1..5b9c119 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1090,6 +1090,9 @@ UnloadSubModule(pointer _mod)
 {
     ModuleDescPtr mod = (ModuleDescPtr)_mod;
 
+    /* Some drivers are calling us on built-in submodules, ignore them */
+    if (mod == (ModuleDescPtr)1)
+	return;
     RemoveChild(mod);
     UnloadModuleOrDriver(mod);
 }
commit 8db029064bcbe378061e812bb8136608e3123226
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Jan 4 16:39:33 2012 +0000

    vgahw: Fix DACDelay() macro to use the driver's vtable
    
    We don't want to unconditionally use I/O routines here, since if the
    driver is using mmap'd VGA ports then the I/O handle won't be set up.
    
    Tested-by: Jeff Chua <jeff.chua.linux at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
index e943aa3..d1ba9da 100644
--- a/hw/xfree86/vgahw/vgaHW.h
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -170,10 +170,10 @@ typedef struct _vgaHWRec {
 #define BITS_PER_GUN 6
 #define COLORMAP_SIZE 256
 
-#define DACDelay(hw)							 \
-	do {								 \
-	    pci_io_read8((hw)->io, (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
-	    pci_io_read8((hw)->io, (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
+#define DACDelay(hw) \
+	do { \
+	    (hw)->readST01((hw)); \
+	    (hw)->readST01((hw)); \
 	} while (0)
 
 /* Function Prototypes */
commit 63a8012947fc44ccb3d661dec88dbda14e7f3c04
Author: Chris Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Thu Jan 5 01:22:40 2012 +0000

    Revert "dix: don't return BadMatch from GetProperty (#23562)"
    
    This reverts commit f04fe06ae244b851b38be824b1a80f2f8a030591.
    
    dixLookupWindow no longer returns BadMatch. No other caller was checking
    for it, so this problem is now fixed in the utility function.
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/property.c b/dix/property.c
index a1ae530..d933d5c 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -474,7 +474,7 @@ ProcGetProperty(ClientPtr client)
     }
     rc = dixLookupWindow(&pWin, stuff->window, client, win_mode);
     if (rc != Success)
-	return (rc == BadMatch) ? BadWindow : rc;
+	return rc;
 
     if (!ValidAtom(stuff->property))
     {
commit ef492e9797b6d4f6bbc25e86bedc24477819fde7
Author: Chris Halse Rogers <christopher.halse.rogers at canonical.com>
Date:   Thu Jan 5 01:22:39 2012 +0000

    dix: Return BadWindow rather than BadMatch from dixLookupWindow
    
    dixLookupWindow uses dixLookupDrawable internally, which returns
    BadMatch when the XID matches a non-Window drawable.  Users
    of dixLookupWindow don't care about this, just that it's not
    a valid Window.
    
    This is a generalised version of the fix for X.Org Bug 23562,
    where GetProperty was incorrectly returning BadMatch. Auditing other
    window requests, all that I checked would incorrectly return BadMatch
    in these circumstances.  An incomplete list of calls that could
    incorrectly return BadMatch is: ListProperties, SetSelectionOwner,
    {Destroy,Map,Unmap}{,Sub}Window.
    
    None of the callers of dixLookupWindow, except for GetProperty, check
    for BadMatch
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 2b5391f..da26dc1 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -224,7 +224,15 @@ dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access)
 {
     int rc;
     rc = dixLookupDrawable((DrawablePtr*)pWin, id, client, M_WINDOW, access);
-    return (rc == BadDrawable) ? BadWindow : rc;
+    /* dixLookupDrawable returns BadMatch iff id is a valid Drawable
+       but is not a Window. Users of dixLookupWindow expect a BadWindow
+       error in this case; they don't care that it's a valid non-Window XID */
+    if (rc == BadMatch)
+	rc = BadWindow;
+    /* Similarly, users of dixLookupWindow don't want BadDrawable. */
+    if (rc == BadDrawable)
+	rc = BadWindow;
+    return rc;
 }
 
 int
commit ff891bbf68caefc22cabb541b6b56af086ac2280
Author: Arthur Taylor <art at ified.ca>
Date:   Fri Jan 6 07:21:37 2012 +0000

    linux: Use K_OFF VT KB mode over K_RAW if available.
    
    Linux kernels since 2.6.38 (March 2011) have an VT KB mode K_OFF in
    which special keys (like Ctrl+C) are not interpreted and input is not
    buffered. Use of this mode over K_RAW removes the need for a
    xf86ConsoleHandler to drain the VT input buffer, removing the grief it
    causes when it goes wrong or is (de)initialized out-of-order. (This
    also saves a few needless context switches per key event.)
    
    If K_OFF is not defined or not understood by the kernel, K_RAW and the
    previous method is used as a fall-back.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Arthur Taylor <art at ified.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index 5f3e3a9..2176985 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -212,10 +212,20 @@ xf86OpenConsole(void)
             tcgetattr(xf86Info.consoleFd, &tty_attr);
 	    SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode));
 
-	    SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW));
+#ifdef K_OFF
+	    /* disable kernel special keys and buffering */
+	    SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF));
 	    if (ret < 0)
-		FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
-			strerror(errno));
+#endif
+	    {
+		SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW));
+		if (ret < 0)
+		    FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
+			    strerror(errno));
+
+		/* need to keep the buffer clean, else the kernel gets angry */
+		xf86SetConsoleHandler(drain_console, NULL);
+	    }
 
             nTty = tty_attr;
             nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
@@ -228,9 +238,6 @@ xf86OpenConsole(void)
             cfsetospeed(&nTty, 9600);
             tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
 
-            /* need to keep the buffer clean, else the kernel gets angry */
-	    xf86SetConsoleHandler(drain_console, NULL);
-
 	    /* we really should have a InitOSInputDevices() function instead
 	     * of Init?$#*&Device(). So I just place it here */
         }
commit 0b113f7cdf5228dccd51a749a339c8669e3f20ff
Merge: 0b2c649... 777bf90...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Jan 9 13:07:25 2012 -0800

    Merge commit '777bf90abeac37087a3d0538b847742523d5acf2'

commit 777bf90abeac37087a3d0538b847742523d5acf2
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jul 18 15:07:07 2011 -0400

    xfree86: Remove the pretense of EDID v2 support
    
    We don't do anything with EDID v2 blocks besides publish them on the
    root window.  Worse, the check deleted by this patch would attempt to
    take a checksum of arbitrary memory if the rawData array isn't 256+
    bytes long (and, for the monitors mentioned, it probably is only 128).
    
    Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index 5d6eec9..c3aced5 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -33,7 +33,6 @@
 #include <string.h>
 
 #define EDID1_ATOM_NAME         "XFree86_DDC_EDID1_RAWDATA"
-#define EDID2_ATOM_NAME         "XFree86_DDC_EDID2_RAWDATA"
 
 static void
 edidMakeAtom(int i, const char *name, CARD8 *data, int size)
@@ -52,59 +51,21 @@ edidMakeAtom(int i, const char *name, CARD8 *data, int size)
 static void
 addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
 {
-    int i, scrnIndex = pScrn->scrnIndex;
-    Bool makeEDID1prop = FALSE;
-    Bool makeEDID2prop = FALSE;
+    int scrnIndex = pScrn->scrnIndex;
 
     if (DDC->flags & MONITOR_DISPLAYID) {
 	/* Don't bother, use RANDR already */
 	return;
     } else if (DDC->ver.version == 1) {
-	makeEDID1prop = TRUE;
-    } else if (DDC->ver.version == 2) {
-	int checksum1;
-	int checksum2;
-	makeEDID2prop = TRUE;
+	int size = 128 +
+	    (DDC->flags & EDID_COMPLETE_RAWDATA ? DDC->no_sections * 128 : 0);
 
-	/* Some monitors (eg Panasonic PanaSync4)
-	 * report version==2 because they used EDID v2 spec document,
-	 * although they use EDID v1 data structure :-(
-	 *
-	 * Try using checksum to determine when we have such a monitor.
-	 */
-	checksum2 = 0;
-	for (i = 0; i < 256; i++)
-	    checksum2 += DDC->rawData[i];
-	if (checksum2 % 256) {
-	    xf86DrvMsg(scrnIndex, X_INFO, "Monitor EDID v2 checksum failed\n");
-	    xf86DrvMsg(scrnIndex, X_INFO,
-		    "XFree86_DDC_EDID2_RAWDATA property may be bad\n");
-	    checksum1 = 0;
-	    for (i = 0; i < 128; i++)
-		checksum1 += DDC->rawData[i];
-	    if (!(checksum1 % 256)) {
-		xf86DrvMsg(scrnIndex, X_INFO,
-			"Monitor EDID v1 checksum passed,\n");
-		xf86DrvMsg(scrnIndex, X_INFO,
-			"XFree86_DDC_EDID1_RAWDATA property created\n");
-		makeEDID1prop = TRUE;
-	    }
-	}
+	edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC->rawData, size);
     } else {
 	xf86DrvMsg(scrnIndex, X_PROBED, "unexpected EDID version %d.%d\n",
 		DDC->ver.version, DDC->ver.revision);
 	return;
     }
-
-    if (makeEDID1prop) {
-	int size = 128 +
-	    (DDC->flags & EDID_COMPLETE_RAWDATA ? DDC->no_sections * 128 : 0);
-
-	edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC->rawData, size);
-    } 
-
-    if (makeEDID2prop)
-	edidMakeAtom(scrnIndex, EDID2_ATOM_NAME, DDC->rawData, 256);
 }
 
 Bool
commit 8f9bdfd293ad8e45755efe8d764b4dcc2a724f51
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Dec 13 21:23:12 2011 -0500

    dix: Tune dixLookupDrawable for success
    
    The vast vast vast majority of resource lookups are successful.  Move some
    work to the error paths so we don't punish success.
    
    Before:
    40000000 trep @   0.0009 msec (1109091.3/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square
    
    After:
    40000000 trep @   0.0009 msec (1148346.9/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 00bbde6..2b5391f 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
     int rc;
 
     *pDraw = NULL;
-    client->errorValue = id;
-
-    if (id == INVALID)
-	return BadDrawable;
 
     rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
 
+    if (rc != Success)
+	client->errorValue = id;
+
     if (rc == BadValue)
 	return BadDrawable;
     if (rc != Success)
commit 83a98543b58c661a22574a6f8d8f9d777c0955b8
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Dec 13 20:23:40 2011 -0500

    dix: Tune dtrace hooks around Dispatch
    
    Don't call LookupMajorName if the hooks aren't active, it's quite expensive.
    
    Before:
    40000000 trep @   0.0009 msec (1087458.5/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square
    
    After:
    40000000 trep @   0.0009 msec (1109091.3/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (2072652.2/sec): ShmPutImage 10x10 square
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 5544623..b91b41f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -425,9 +425,11 @@ Dispatch(void)
 			client->minorOp = ext->MinorOpcode(client);
 		}
 #ifdef XSERVER_DTRACE
-		XSERVER_REQUEST_START(LookupMajorName(client->majorOp), client->majorOp,
-			      ((xReq *)client->requestBuffer)->length,
-			      client->index, client->requestBuffer);
+		if (XSERVER_REQUEST_START_ENABLED())
+		    XSERVER_REQUEST_START(LookupMajorName(client->majorOp),
+					  client->majorOp,
+					  ((xReq *)client->requestBuffer)->length,
+					  client->index, client->requestBuffer);
 #endif
 		if (result > (maxBigRequestSize << 2))
 		    result = BadLength;
@@ -438,8 +440,10 @@ Dispatch(void)
 		    XaceHookAuditEnd(client, result);
 		}
 #ifdef XSERVER_DTRACE
-		XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), client->majorOp,
-			      client->sequence, client->index, result);
+		if (XSERVER_REQUEST_DONE_ENABLED())
+		    XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp),
+					 client->majorOp, client->sequence,
+					 client->index, result);
 #endif
 
 		if (client->noClientException != Success)
commit 11977fab546da35d579ebe285e3c26864007805e
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Dec 13 21:00:05 2011 -0500

    xace: ricer tuning for XaceHook
    
    gcc doesn't want to hoist the check for XaceHooks[hook] != NULL above the
    varargs code for some reason, so do it ourselves.
    
    Before:
    40000000 trep @   0.0010 msec (1050420.2/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (1921147.6/sec): ShmPutImage 10x10 square
    
    After:
    40000000 trep @   0.0009 msec (1087458.5/sec): PutImage 10x10 square
    60000000 trep @   0.0005 msec (2012238.6/sec): ShmPutImage 10x10 square
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xace.c b/Xext/xace.c
index c757cad..ef69fe3 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -101,6 +101,10 @@ int XaceHook(int hook, ...)
     } u;
     int *prv = NULL;	/* points to return value from callback */
     va_list ap;		/* argument list */
+
+    if (!XaceHooks[hook])
+	return Success;
+
     va_start(ap, hook);
 
     /* Marshal arguments for passing to callback.
commit a4553019a10b4e01cc06f3081db71a83338697b4
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 14:30:06 2011 -0400

    dix: Fix types in WindowOptRec
    
    No reason for these to be 64 bits on LP64.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/windowstr.h b/include/windowstr.h
index 222de31..1124dfc 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 */
-    unsigned long	backingBitPlanes;  /* default: ~0L */
-    unsigned long	backingPixel;	   /* default: 0 */
+    CARD32		backingBitPlanes;  /* default: ~0L */
+    CARD32		backingPixel;	   /* default: 0 */
     RegionPtr		boundingShape;	   /* default: NULL */
     RegionPtr		clipShape;	   /* default: NULL */
     RegionPtr		inputShape;	   /* default: NULL */
commit c44ef2e1ff7bad168c348da63477b4636b3054fd
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 14:17:09 2011 -0400

    os: Minor header cleanup
    
    Move some constants near their only users, and remove some
    getdtablesize() logic that's second-guessing configure.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/connection.c b/os/connection.c
index 0f1f879..2c90d72 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -873,6 +873,8 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure)
  *     Fail a connection due to lack of client or file descriptor space
  ************/
 
+#define BOTIMEOUT 200 /* in milliseconds */
+
 static void
 ErrorConnMax(XtransConnInfo trans_conn)
 {
diff --git a/os/io.c b/os/io.c
index bc3b837..78b7260 100644
--- a/os/io.c
+++ b/os/io.c
@@ -129,6 +129,8 @@ static OsCommPtr AvailableInput = (OsCommPtr)NULL;
 				  ((xBigReq *)(req))->length)
 
 #define MAX_TIMES_PER         10
+#define BUFSIZE 4096
+#define BUFWATERMARK 8192
 
 /*
  *   A lot of the code in this file manipulates a ConnectionInputPtr:
diff --git a/os/osdep.h b/os/osdep.h
index 9b9dda9..c9add48 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -52,10 +52,6 @@ SOFTWARE.
 #ifndef _OSDEP_H_
 #define _OSDEP_H_ 1
 
-#define BOTIMEOUT 200 /* in milliseconds */
-#define BUFSIZE 4096
-#define BUFWATERMARK 8192
-
 #if defined(XDMCP) || defined(HASXDMAUTH)
 #include <X11/Xdmcp.h>
 #endif
commit 48e7a2ef574c8b38c4f8f07b45f54c8bfd02552b
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 14:03:01 2011 -0400

    os: Hide the Connection{In,Out}put implementation details
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/connection.c b/os/connection.c
index f25106b..0f1f879 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1030,7 +1030,7 @@ CloseDownConnection(ClientPtr client)
     if (FlushCallback)
 	CallCallbacks(&FlushCallback, NULL);
 
-    if (oc->output && oc->output->count)
+    if (oc->output)
 	FlushClient(client, oc, (char *)NULL, 0);
 #ifdef XDMCP
     XdmcpCloseDisplay(oc->fd);
diff --git a/os/io.c b/os/io.c
index ebb8216..bc3b837 100644
--- a/os/io.c
+++ b/os/io.c
@@ -84,6 +84,23 @@ 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);
 
@@ -889,7 +906,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
     long notWritten;
     long todo;
 
-    if (!oco)
+    if (!oco || !oco->count)
 	return 0;
     written = 0;
     padsize = padlength[extraCount & 3];
diff --git a/os/osdep.h b/os/osdep.h
index 60cef27..9b9dda9 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -112,22 +112,8 @@ typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
 			      unsigned data_length, char *data);
 #endif
 
-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;
+typedef struct _connectionInput *ConnectionInputPtr;
+typedef struct _connectionOutput *ConnectionOutputPtr;
 
 struct _osComm;
 
commit 78fa121f4097d29458e5453c13473595df06e26e
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 13:43:38 2011 -0400

    dix: Extend initial connection handshake for forwarding proxies
    
    Forwarding proxies like sshd will appear to be local, even though they
    aren't really.  This leads to weird behaviour for extensions that truly
    require running under the same OS services as the client, like MIT-SHM
    and DRI2.
    
    Add two new legal values for the initial connection's byteOrder field,
    'r' and 'R'.  These act like 'l' and 'B' respectively, but have the side
    effect of forcing the client to be treated as non-local.  Forwarding
    proxies should attempt to munge the first packet of the connection
    accordingly; older servers will reject connections thusly munged, so the
    proxy should fall back to passthrough if the munged connection attempt
    fails.
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 048dff6..5544623 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3578,12 +3578,14 @@ ProcInitialConnection(ClientPtr client)
     REQUEST(xReq);
     xConnClientPrefix *prefix;
     int whichbyte = 1;
+    char order;
 
     prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
-    if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
+    order = prefix->byteOrder;
+    if (order != 'l' && order != 'B' && order != 'r' && order != 'R')
 	return client->noClientException = -1;
-    if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
-	(!(*(char *) &whichbyte) && (prefix->byteOrder == 'l')))
+    if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+	(!(*(char *) &whichbyte) && (order == 'l' || order == 'r')))
     {
 	client->swapped = TRUE;
 	SwapConnClientPrefix(prefix);
@@ -3595,6 +3597,10 @@ 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 575cfb8..f25106b 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -880,7 +880,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
     xConnSetupPrefix csp;
     char pad[3];
     struct iovec iov[3];
-    char byteOrder = 0;
+    char order = 0;
     int whichbyte = 1;
     struct timeval waittime;
     fd_set mask;
@@ -893,16 +893,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, &byteOrder, 1);
-    if ((byteOrder == 'l') || (byteOrder == 'B'))
+    (void)_XSERVTransRead(trans_conn, &order, 1);
+    if (order == 'l' || order == 'B' || order == 'r' || order == 'R')
     {
 	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) && (byteOrder == 'B')) ||
-	    (!(*(char *) &whichbyte) && (byteOrder == 'l')))
+	if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+	    (!(*(char *) &whichbyte) && (order == 'l' || order == 'r')))
 	{
 	    swaps(&csp.majorVersion);
 	    swaps(&csp.minorVersion);
commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 13:22:41 2011 -0400

    dix: Pull client-is-local flag up to the ClientRec
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 4b63a13..5053852 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -300,7 +300,7 @@ ProcXF86BigfontQueryVersion(
 #endif
     reply.capabilities =
 #ifdef HAS_SHM
-	(LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
+	(client->local && !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 = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
+	    stuff_flags = (client->local && !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 0741a72..85e38e0 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 (!LocalClient(client) || client->swapped)
+    if (!client->local || client->swapped)
 	rep.isCapable = 0;
 
     if (client->swapped) {
@@ -1253,7 +1253,7 @@ ProcXF86DRIDispatch (register ClientPtr	client)
         }
     }
 
-    if (!LocalClient(client))
+    if (!client->local)
         return DRIErrorBase + XF86DRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index 4bcf77e..4b17f15 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 (!LocalClient(client))
+    if (!client->local)
 	return DGAErrorBase + XF86DGAClientNotLocal;
 
 #ifdef DGA_REQ_DEBUG
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 6d3d5fc..6e5e3f9 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() || LocalClient (client))) {
+	(xf86GetVidModeAllowNonLocal() || client->local)) {
 	rep.permissions |= XF86VM_WRITE_PERMISSION;
     }
     if(client->swapped) {
@@ -1597,7 +1597,7 @@ ProcXF86VidModeDispatch(ClientPtr client)
     default:
 	if (!xf86GetVidModeEnabled())
 	    return VidModeErrorBase + XF86VidModeExtensionDisabled;
-	if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
+	if (xf86GetVidModeAllowNonLocal() || client->local) {
 	    switch (stuff->data) {
 	    case X_XF86VidModeAddModeLine:
 		return ProcXF86VidModeAddModeLine(client);
@@ -2017,7 +2017,7 @@ SProcXF86VidModeDispatch(ClientPtr client)
     default:
 	if (!xf86GetVidModeEnabled())
 	    return VidModeErrorBase + XF86VidModeExtensionDisabled;
-	if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
+	if (xf86GetVidModeAllowNonLocal() || client->local) {
 	    switch (stuff->data) {
 	    case X_XF86VidModeAddModeLine:
 		return SProcXF86VidModeAddModeLine(client);
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index c35ba2f..723e526 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -130,7 +130,7 @@ ProcXF86DRIQueryDirectRenderingCapable(
     }
     rep.isCapable = isCapable;
 
-    if (!LocalClient(client) || client->swapped)
+    if (!client->local || client->swapped)
 	rep.isCapable = 0;
 
     if (client->swapped) {
@@ -557,7 +557,7 @@ ProcXF86DRIDispatch (
 	return ProcXF86DRIQueryDirectRenderingCapable(client);
     }
 
-    if (!LocalClient(client))
+    if (!client->local)
 	return DRIErrorBase + XF86DRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 73ef7f2..2133155 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -547,7 +547,7 @@ ProcDRI2Dispatch (ClientPtr client)
 	return ProcDRI2QueryVersion(client);
     }
 
-    if (!LocalClient(client))
+    if (!client->local)
 	return BadRequest;
 
     switch (stuff->data) {
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 55976c4..7077a6c 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -630,7 +630,7 @@ ProcAppleWMDispatch (
         return ProcAppleWMQueryVersion(client);
     }
 
-    if (!LocalClient(client))
+    if (!client->local)
         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 (!LocalClient(client))
+    if (!client->local)
         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 44c132a..091145b 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -133,7 +133,7 @@ ProcAppleDRIQueryDirectRenderingCapable(
     }
     rep.isCapable = isCapable;
 
-    if (!LocalClient(client))
+    if (!client->local)
         rep.isCapable = 0;
 
     if (client->swapped) {
@@ -365,7 +365,7 @@ ProcAppleDRIDispatch (
         return ProcAppleDRIQueryDirectRenderingCapable(client);
     }
 
-    if (!LocalClient(client))
+    if (!client->local)
         return DRIErrorBase + AppleDRIClientNotLocal;
 
     switch (stuff->data)
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 577614d..f43834d 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -548,7 +548,7 @@ ProcWindowsWMDispatch (ClientPtr client)
       return ProcWindowsWMQueryVersion(client);
     }
 
-  if (!LocalClient(client))
+  if (!client->local)
     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 (!LocalClient(client))
+  if (!client->local)
     return WMErrorBase + WindowsWMClientNotLocal;
 
   /* only local clients are allowed WM access */
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 5fd595d..cb37051 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -91,6 +91,7 @@ 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 48ce329..84dedd5 100644
--- a/include/os.h
+++ b/include/os.h
@@ -353,8 +353,6 @@ 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 b609442..ed13d0a 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1045,13 +1045,6 @@ 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
  * 
@@ -1209,7 +1202,7 @@ AuthorizedClient(ClientPtr client)
     if (rc != Success)
 	return rc;
 
-    return LocalClient(client) ? Success : BadAccess;
+    return client->local ? 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 8a677a7..575cfb8 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;
     }
-    oc->local_client = ComputeLocalClient(client);
+    client->local = ComputeLocalClient(client);
 #if !defined(WIN32)
     ConnectionTranslation[fd] = client->index;
 #else
diff --git a/os/osdep.h b/os/osdep.h
index 5fe019f..60cef27 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -166,7 +166,6 @@ 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 f702372822dadb1fef92cfc25086481f640147b3
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 17 12:58:25 2011 -0400

    dix: Repack ClientRec
    
    sizeof(ClientRec)   ILP32   LP64
    before                120    184
    after                 104    136
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/dixstruct.h b/include/dixstruct.h
index 0a85f40..5fd595d 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -90,23 +90,22 @@ typedef struct _Client {
     Mask        clientAsMask;
     pointer     requestBuffer;
     pointer     osPrivate;	/* for OS layer, including scheduler */
-    Bool        swapped;
+    char        swapped;
+    char        big_requests;
+    char        closeDownMode;
+    char        clientGone;
+    char        noClientException;	/* this client died or needs to be
+					 * killed */
+    char	clientState;
     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 */
-    SaveSetElt	*saveSet;
     int         numSaved;
-    int         (**requestVector) (
-		ClientPtr /* pClient */);
+    SaveSetElt	*saveSet;
+    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;
@@ -114,16 +113,16 @@ typedef struct _Client {
     unsigned short	vMajor,vMinor;
     KeyCode		minKC,maxKC;
 
-    unsigned long replyBytesRemaining;
+    unsigned int replyBytesRemaining;
     int	    smart_priority;
-    long    smart_start_tick;
-    long    smart_stop_tick;
-    long    smart_check_tick;
+    int     smart_start_tick;
+    int     smart_stop_tick;
+    int     smart_check_tick;
     
     DeviceIntPtr clientPtr;
     ClientIdPtr  clientIds;
     unsigned short majorOp, minorOp;
-}           ClientRec;
+} ClientRec;
 
 /*
  * Scheduling interface
commit d5f724544afd2949cebfcf4f0b4510ec0c701bec
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jun 16 17:40:24 2011 -0400

    os: Repack ConnectionOutput for LP64
    
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/osdep.h b/os/osdep.h
index 71a7e44..5fe019f 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -124,8 +124,8 @@ typedef struct _connectionInput {
 
 typedef struct _connectionOutput {
     struct _connectionOutput *next;
-    int size;
     unsigned char *buf;
+    int size;
     int count;
 } ConnectionOutput, *ConnectionOutputPtr;
 


More information about the xorg-commit mailing list