[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'debian-unstable'



 ChangeLog                              |  171 +++++++++++++++++++++++++++++++++
 composite/compalloc.c                  |   11 +-
 configure.ac                           |    4 
 debian/changelog                       |    7 +
 hw/xfree86/common/xf86Events.c         |    9 -
 hw/xfree86/modes/xf86Crtc.c            |   25 +++-
 hw/xfree86/os-support/linux/lnx_init.c |   14 +-
 hw/xnest/Keyboard.c                    |   25 ++++
 hw/xquartz/applewm.c                   |    4 
 hw/xquartz/xpr/appledri.c              |  153 +++++++++++++++++++++++++++--
 hw/xwin/winwindowswm.c                 |    4 
 11 files changed, 386 insertions(+), 41 deletions(-)

New commits:
commit 74ed78aec4763daac68e0e7b9227deb0382c6d55
Author: Cyril Brulebois <kibi@debian.org>
Date:   Wed Nov 2 11:10:10 2011 +0100

    Upload to unstable.

diff --git a/debian/changelog b/debian/changelog
index f189717..aac683f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-xorg-server (2:1.11.1.902-1) UNRELEASED; urgency=low
+xorg-server (2:1.11.1.902-1) unstable; urgency=low
 
   * New upstream release candidate (1.11.2 RC2):
     - Fixes for various crashes and correctness issues.
 
- -- Cyril Brulebois <kibi@debian.org>  Wed, 02 Nov 2011 11:08:50 +0100
+ -- Cyril Brulebois <kibi@debian.org>  Wed, 02 Nov 2011 11:10:03 +0100
 
 xorg-server (2:1.11.1.901-2) unstable; urgency=high
 

commit b1dfa72019ebf3595f41f3593cc9cbfc4c9e738f
Author: Cyril Brulebois <kibi@debian.org>
Date:   Wed Nov 2 11:09:59 2011 +0100

    Bump changelogs.

diff --git a/ChangeLog b/ChangeLog
index 8f04005..cc054af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,174 @@
+commit 0bffe6b38cdf6b21d9ec9b0abf0092d4d4eaef86
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Fri Oct 28 18:32:28 2011 -0700
+
+    configure.ac: Bump to 1.11.1.902 (1.11.2 RC2)
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit a1d638da0d12c82c944bfecb996903210879f426
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Tue Oct 25 23:53:43 2011 -0700
+
+    XWin: windowswm: Correct byte swapping in event notifications
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
+    (cherry picked from commit 286fa9bf9b4ffb0f9dbd3f1cae46ddcb27ee9318)
+
+commit 0715469f1cb150261b51867df75892d26916ea05
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Tue Oct 25 23:49:33 2011 -0700
+
+    XQuartz: appledri: Correct byte swapping in event notifications
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    (cherry picked from commit dc054fefc586c5b404fe0f949dbd456e5267c647)
+
+commit bc2600466eea2af2d6a81fe1592d908565995cb2
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Tue Oct 25 23:48:16 2011 -0700
+
+    XQuartz: applewm: Correct byte swapping in event notifications
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    (cherry picked from commit d5fee2b638fabeb8bec31a24e57d5c2a232d0893)
+
+commit 7be5492bcfab540676d6f849b85ad3db64a5ada0
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Fri Oct 21 10:27:16 2011 -0700
+
+    XQuartz: appledri: Allow byte swapped requests
+    
+    Even though it's only valid when local, it is possible for a local
+    client and the server to not match endianness, such as when running
+    a ppc application under Rosetta.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    (cherry picked from commit 1c8bda798b4480bab0f0da6f531e4770c7a1f771)
+
+commit 0ad049706d2fa8ff2758c42bdd412fb62bb1e86a
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Thu Oct 20 22:34:44 2011 -0700
+
+    XQuartz: appledri: Fix byte swapping in replies
+    
+    Even though it's only valid when local, it is possible for a local
+    client and the server to not match endianness, such as when running
+    a ppc application under Rosetta.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+    (cherry picked from commit 14205ade0c750191bf43fba8bd55c65dba912cf4)
+    
+    Conflicts:
+    
+    	hw/xquartz/xpr/appledri.c
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 3b931c92764fc4e6417f1f38a67114b8c7442fc2
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Thu Oct 20 22:23:07 2011 -0700
+
+    XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
+    
+    http://xquartz.macosforge.org/trac/ticket/508
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+    (cherry picked from commit 2ba0ac202ad64eb4a555715980ba538de19c9fd7)
+
+commit f22a41416b9795c778deeae6406cd33d18f13fa3
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Sun Oct 16 02:12:38 2011 -0700
+
+    Xnest: Match the host's keymap
+    
+    This was a regression.
+    
+    Introduced by: 08363c5830bdea34012dcd954b45ccfdc79a3a7e and
+                   32db27a7f867b503c2840ca7b815e96d10be9210
+    Masked by: 1e69fd4a60147287b31e53bfc61543fb17bb82c8
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+    (cherry picked from commit 83fef4235db86343477b4ec9858c6ba35e1aa7d9)
+
+commit 82445286d56fdac36f21ec5eed436646bda768dd
+Author: Tomáš Trnka <tomastrnka@gmx.com>
+Date:   Tue Oct 11 09:11:18 2011 +0200
+
+    Fix drain_console unregistration
+    
+    Bug introduced by 9dca441670d261a9a9fb6108960ed48f3d58fb7f
+    xfree86: add a hook to replace the new console handler.
+    
+    console_handler was not being set, making the server eat up CPU spinning
+    in WaitForSomething selecting consoleFd over and over again, every time
+    trying to unregister drain_console without success due to
+    console_handler being NULL.
+    
+    Let's just fix the unregistration in xf86SetConsoleHandler() and use that.
+    
+    But wait, there could be a catch: If some driver replaced the handler using
+    xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
+    that one. I don't understand Xorg well enough to know whether this poses a
+    problem (could mess up driver deinit somehow or something like that). As it is,
+    xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
+    handler is currently registered).
+    
+    I had been using it for two days on my machine that previously hit 100% CPU
+    several times a day. That has now gone away without any new problems appearing.
+    
+    Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    (cherry picked from commit 323869f3298cbbfe864af9404a8aed1bf7995d79)
+
+commit c8c5ed998aac2c91dbec1f86af3395e08ddab373
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu Oct 13 12:01:10 2011 -0700
+
+    crtc: match full preferred modes if possible when choosing an initial config
+    
+    It's fairly common to have multiple, identical monitors plugged in.  In
+    that case, it's preferable to run the monitor's preferred mode on each
+    output, rather than just matching the width & height and end up with
+    different timings or refresh rates.
+    
+    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    (cherry picked from commit 3e145d3d67b472cb5d74cb8078b614160c4722b7)
+
+commit d780c6f6301ed2263b21ac7d327a1b2e8d3e76df
+Author: Ville Syrjala <syrjala@sci.fi>
+Date:   Sun Oct 9 01:11:04 2011 +0300
+
+    composite: Update borderClip in compAllocPixmap()
+    
+    Previously the parent constrained borderClip was copied over
+    when compRedirectWindow() is called. That is insufficient eg. in
+    case the window was already redirected, but not yet realized. So
+    copy the borderClip over in compAllocPixmap() instead.
+    
+    Example:
+    Window 1 is below an automatically redirect window 2. Window 2 is
+    unmapped and moved outside the extents of window 1. Window 2 is
+    then mapped again, and MarkOverlappedWindows() uses the up to
+    date borderSize of window 2 to mark windows, which leaves
+    window 1 unmarked. Then exposures are calculated using the stale
+    borderClip of window 2, which causes the window below window 2,
+    to be exposed through an apparent hole in window 1.
+    
+    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566
+    
+    Signed-off-by: Ville Syrjala <syrjala@sci.fi>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    (cherry picked from commit a5266dcb3a60587e1877f90c18552baf60b597a0)
+
 commit 12f65819ffb04103f170ecd7e281348de618fc4c
 Author: Matthieu Herrb <matthieu.herrb@laas.fr>
 Date:   Mon Oct 17 22:27:35 2011 +0200
diff --git a/debian/changelog b/debian/changelog
index 21de21d..f189717 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.11.1.902-1) UNRELEASED; urgency=low
+
+  * New upstream release candidate (1.11.2 RC2):
+    - Fixes for various crashes and correctness issues.
+
+ -- Cyril Brulebois <kibi@debian.org>  Wed, 02 Nov 2011 11:08:50 +0100
+
 xorg-server (2:1.11.1.901-2) unstable; urgency=high
 
   * Merge from upstream to get CVEs fixed:

commit 0bffe6b38cdf6b21d9ec9b0abf0092d4d4eaef86
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Oct 28 18:32:28 2011 -0700

    configure.ac: Bump to 1.11.1.902 (1.11.2 RC2)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index cc4292b..5b6e39c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.11.1.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-10-14"
+AC_INIT([xorg-server], 1.11.1.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-10-28"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit a1d638da0d12c82c944bfecb996903210879f426
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Tue Oct 25 23:53:43 2011 -0700

    XWin: windowswm: Correct byte swapping in event notifications
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
    (cherry picked from commit 286fa9bf9b4ffb0f9dbd3f1cae46ddcb27ee9318)

diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 7138409..f5d27e5 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -629,9 +629,11 @@ winWindowsWMExtensionInit (void)
 			       NULL,
 			       StandardMinorOpcode)))
     {
+      size_t i;
       WMReqCode = (unsigned char)extEntry->base;
       WMErrorBase = extEntry->errorBase;
       WMEventBase = extEntry->eventBase;
-      EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+      for (i=0; i < WindowsWMNumberEvents; i++)
+        EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
     }
 }

commit 0715469f1cb150261b51867df75892d26916ea05
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Tue Oct 25 23:49:33 2011 -0700

    XQuartz: appledri: Correct byte swapping in event notifications
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit dc054fefc586c5b404fe0f949dbd456e5267c647)

diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 129fc78..80955fe 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -541,9 +541,11 @@ AppleDRIExtensionInit(void)
                                  SProcAppleDRIDispatch,
                                  AppleDRIResetProc,
                                  StandardMinorOpcode))) {
+        size_t i;
         DRIReqCode = (unsigned char)extEntry->base;
         DRIErrorBase = extEntry->errorBase;
         DRIEventBase = extEntry->eventBase;
-        EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
+        for (i=0; i < AppleDRINumberEvents; i++)
+            EventSwapVector[DRIEventBase + i] = (EventSwapPtr) SNotifyEvent;
     }
 }

commit bc2600466eea2af2d6a81fe1592d908565995cb2
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Tue Oct 25 23:48:16 2011 -0700

    XQuartz: applewm: Correct byte swapping in event notifications
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit d5fee2b638fabeb8bec31a24e57d5c2a232d0893)

diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 2f26e61..2dfc35a 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -727,10 +727,12 @@ AppleWMExtensionInit(
                                  NULL,
                                  StandardMinorOpcode)))
     {
+        size_t i;
         WMReqCode = (unsigned char)extEntry->base;
         WMErrorBase = extEntry->errorBase;
         WMEventBase = extEntry->eventBase;
-        EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+        for (i=0; i < AppleWMNumberEvents; i++)
+            EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
         appleWMProcs = procsPtr;
     }
 }

commit 7be5492bcfab540676d6f849b85ad3db64a5ada0
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Oct 21 10:27:16 2011 -0700

    XQuartz: appledri: Allow byte swapped requests
    
    Even though it's only valid when local, it is possible for a local
    client and the server to not match endianness, such as when running
    a ppc application under Rosetta.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 1c8bda798b4480bab0f0da6f531e4770c7a1f771)

diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 1d37de2..129fc78 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -2,7 +2,7 @@
 
 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
 Copyright 2000 VA Linux Systems, Inc.
-Copyright (c) 2002, 2009 Apple Computer, Inc.
+Copyright (c) 2002, 2009-2011 Apple Inc.
 All Rights Reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a
@@ -416,21 +416,113 @@ SProcAppleDRIQueryVersion(
 }
 
 static int
+SProcAppleDRIQueryDirectRenderingCapable(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->screen, n);
+    return ProcAppleDRIQueryDirectRenderingCapable(client);
+}
+
+static int
+SProcAppleDRIAuthConnection(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRIAuthConnectionReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->screen, n);
+    swapl(&stuff->magic, n);
+    return ProcAppleDRIAuthConnection(client);
+}
+
+static int
+SProcAppleDRICreateSurface(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRICreateSurfaceReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->screen, n);
+    swapl(&stuff->drawable, n);
+    swapl(&stuff->client_id, n);
+    return ProcAppleDRICreateSurface(client);
+}
+
+static int
+SProcAppleDRIDestroySurface(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRIDestroySurfaceReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->screen, n);
+    swapl(&stuff->drawable, n);
+    return ProcAppleDRIDestroySurface(client);
+}
+
+static int
+SProcAppleDRICreatePixmap(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRICreatePixmapReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->screen, n);
+    swapl(&stuff->drawable, n);
+    return ProcAppleDRICreatePixmap(client);
+}
+
+static int
+SProcAppleDRIDestroyPixmap(
+    register ClientPtr client
+)
+{
+    register int n;
+    REQUEST(xAppleDRIDestroyPixmapReq);
+    swaps(&stuff->length, n);
+    swapl(&stuff->drawable, n);
+    return ProcAppleDRIDestroyPixmap(client);
+}
+
+static int
 SProcAppleDRIDispatch (
     register ClientPtr client
 )
 {
     REQUEST(xReq);
 
-    /* It is bound to be non-local when there is byte swapping */
+    switch (stuff->data)
+    {
+    case X_AppleDRIQueryVersion:
+        return SProcAppleDRIQueryVersion(client);
+    case X_AppleDRIQueryDirectRenderingCapable:
+        return SProcAppleDRIQueryDirectRenderingCapable(client);
+    }
+
     if (!LocalClient(client))
         return DRIErrorBase + AppleDRIClientNotLocal;
 
-    /* only local clients are allowed DRI access */
     switch (stuff->data)
     {
-    case X_AppleDRIQueryVersion:
-        return SProcAppleDRIQueryVersion(client);
+    case X_AppleDRIAuthConnection:
+        return SProcAppleDRIAuthConnection(client);
+    case X_AppleDRICreateSurface:
+        return SProcAppleDRICreateSurface(client);
+    case X_AppleDRIDestroySurface:
+        return SProcAppleDRIDestroySurface(client);
+    case X_AppleDRICreatePixmap:
+	return SProcAppleDRICreatePixmap(client);
+    case X_AppleDRIDestroyPixmap:
+	return SProcAppleDRIDestroyPixmap(client);
+
     default:
         return BadRequest;
     }

commit 0ad049706d2fa8ff2758c42bdd412fb62bb1e86a
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu Oct 20 22:34:44 2011 -0700

    XQuartz: appledri: Fix byte swapping in replies
    
    Even though it's only valid when local, it is possible for a local
    client and the server to not match endianness, such as when running
    a ppc application under Rosetta.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    (cherry picked from commit 14205ade0c750191bf43fba8bd55c65dba912cf4)
    
    Conflicts:
    
    	hw/xquartz/xpr/appledri.c
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index e1b4134..1d37de2 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -91,7 +91,6 @@ ProcAppleDRIQueryVersion(
 )
 {
     xAppleDRIQueryVersionReply rep;
-    register int n;
 
     REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
     rep.type = X_Reply;
@@ -101,8 +100,12 @@ ProcAppleDRIQueryVersion(
     rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION;
     rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION;
     if (client->swapped) {
+        register int n;
         swaps(&rep.sequenceNumber, n);
         swapl(&rep.length, n);
+        swaps(&rep.majorVersion, n);
+        swaps(&rep.minorVersion, n);
+        swapl(&rep.patchVersion, n);
     }
     WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
     return Success;
@@ -134,6 +137,12 @@ ProcAppleDRIQueryDirectRenderingCapable(
     if (!LocalClient(client))
         rep.isCapable = 0;
 
+    if (client->swapped) {
+        register int n;
+        swaps(&rep.sequenceNumber, n);
+        swapl(&rep.length, n);
+    }
+
     WriteToClient(client, 
         sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
     return Success;
@@ -158,6 +167,14 @@ ProcAppleDRIAuthConnection(
         ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
         rep.authenticated = 0;
     }
+
+    if (client->swapped) {
+        register int n;
+        swaps(&rep.sequenceNumber, n);
+        swapl(&rep.length, n);
+        swapl(&rep.authenticated, n); /* Yes, this is a CARD32 ... sigh */
+    }
+
     WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
     return Success;
 }
@@ -217,6 +234,15 @@ ProcAppleDRICreateSurface(
     rep.key_1 = key[1];
     rep.uid = sid;
 
+    if (client->swapped) {
+        register int n;
+        swaps(&rep.sequenceNumber, n);
+        swapl(&rep.length, n);
+        swapl(&rep.key_0, n);
+        swapl(&rep.key_1, n);
+        swapl(&rep.uid, n);
+    }
+
     WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
     return Success;
 }
@@ -278,7 +304,6 @@ ProcAppleDRICreatePixmap(ClientPtr client)
 	
     rep.stringLength = strlen(path) + 1;
 		
-    /* No need for swapping, because this only runs if LocalClient is true. */
     rep.type = X_Reply;
     rep.length = bytes_to_int32(rep.stringLength);
     rep.sequenceNumber = client->sequence;
@@ -291,8 +316,20 @@ ProcAppleDRICreatePixmap(ClientPtr client)
     if(sizeof(rep) != sz_xAppleDRICreatePixmapReply)
 	ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); 
     
-    WriteReplyToClient(client, sizeof(rep), &rep);
-    (void)WriteToClient(client, rep.stringLength, path);
+    if (client->swapped) {
+        register int n;
+        swaps(&rep.sequenceNumber, n);
+        swapl(&rep.length, n);
+        swapl(&rep.stringLength, n);
+        swapl(&rep.width, n);
+        swapl(&rep.height, n);
+        swapl(&rep.pitch, n);
+        swapl(&rep.bpp, n);
+        swapl(&rep.size, n);
+    }
+
+    WriteToClient(client, sizeof(rep), &rep);
+    WriteToClient(client, rep.stringLength, path);
 
     return Success;
 }

commit 3b931c92764fc4e6417f1f38a67114b8c7442fc2
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu Oct 20 22:23:07 2011 -0700

    XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
    
    http://xquartz.macosforge.org/trac/ticket/508
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    (cherry picked from commit 2ba0ac202ad64eb4a555715980ba538de19c9fd7)

diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index ff70a38..e1b4134 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -280,7 +280,7 @@ ProcAppleDRICreatePixmap(ClientPtr client)
 		
     /* No need for swapping, because this only runs if LocalClient is true. */
     rep.type = X_Reply;
-    rep.length = sizeof(rep) + rep.stringLength;
+    rep.length = bytes_to_int32(rep.stringLength);
     rep.sequenceNumber = client->sequence;
     rep.width = width;
     rep.height = height;

commit f22a41416b9795c778deeae6406cd33d18f13fa3
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Oct 16 02:12:38 2011 -0700

    Xnest: Match the host's keymap
    
    This was a regression.
    
    Introduced by: 08363c5830bdea34012dcd954b45ccfdc79a3a7e and
                   32db27a7f867b503c2840ca7b815e96d10be9210
    Masked by: 1e69fd4a60147287b31e53bfc61543fb17bb82c8
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>
    (cherry picked from commit 83fef4235db86343477b4ec9858c6ba35e1aa7d9)

diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index ec629dc..5ef376b 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -114,11 +114,13 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
 int
 xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
 {
+  XModifierKeymap *modifier_keymap;
   KeySym *keymap;
   int mapWidth;
   int min_keycode, max_keycode;
   KeySymsRec keySyms;
-  int i;
+  CARD8 modmap[MAP_LENGTH];
+  int i, j;
   XKeyboardState values;
   XkbDescPtr xkb;
   int op, event, error, major, minor;
@@ -130,7 +132,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
 #ifdef _XSERVER64
       {
 	KeySym64 *keymap64;
-	int i, len;
+	int len;
 	keymap64 = XGetKeyboardMapping(xnestDisplay,
 				     min_keycode,
 				     max_keycode - min_keycode + 1,
@@ -147,7 +149,17 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
 				   max_keycode - min_keycode + 1,
 				   &mapWidth);
 #endif
-      
+
+      memset(modmap, 0, sizeof(modmap));
+      modifier_keymap = XGetModifierMapping(xnestDisplay);
+      for (j = 0; j < 8; j++)
+            for(i = 0; i < modifier_keymap->max_keypermod; i++) {
+                  CARD8 keycode;
+                  if ((keycode = modifier_keymap->modifiermap[j * modifier_keymap->max_keypermod + i]))
+                      modmap[keycode] |= 1<<j;
+      }
+      XFreeModifiermap(modifier_keymap);
+
       keySyms.minKeyCode = min_keycode;
       keySyms.maxKeyCode = max_keycode;
       keySyms.mapWidth = mapWidth;
@@ -165,7 +177,12 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
       XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb);
 
       InitKeyboardDeviceStruct(pDev, NULL,
-			       xnestBell, xnestChangeKeyboardControl);
+                               xnestBell, xnestChangeKeyboardControl);
+
+      XkbApplyMappingChange(pDev, &keySyms, keySyms.minKeyCode,
+                            keySyms.maxKeyCode - keySyms.minKeyCode + 1,
+                            modmap, serverClient);
+
       XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
       XkbFreeKeyboard(xkb, 0, False);
       free(keymap);

commit 82445286d56fdac36f21ec5eed436646bda768dd
Author: Tomáš Trnka <tomastrnka@gmx.com>
Date:   Tue Oct 11 09:11:18 2011 +0200

    Fix drain_console unregistration
    
    Bug introduced by 9dca441670d261a9a9fb6108960ed48f3d58fb7f
    xfree86: add a hook to replace the new console handler.
    
    console_handler was not being set, making the server eat up CPU spinning
    in WaitForSomething selecting consoleFd over and over again, every time
    trying to unregister drain_console without success due to
    console_handler being NULL.
    
    Let's just fix the unregistration in xf86SetConsoleHandler() and use that.
    
    But wait, there could be a catch: If some driver replaced the handler using
    xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
    that one. I don't understand Xorg well enough to know whether this poses a
    problem (could mess up driver deinit somehow or something like that). As it is,
    xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
    handler is currently registered).
    
    I had been using it for two days on my machine that previously hit 100% CPU
    several times a day. That has now gone away without any new problems appearing.
    
    Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 323869f3298cbbfe864af9404a8aed1bf7995d79)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index c4a4db9..41ffabd 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -601,16 +601,15 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data)
 InputHandlerProc
 xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
 {
-    static InputHandlerProc handler = NULL;
-    InputHandlerProc old_handler = handler;
+    static IHPtr handler = NULL;
+    IHPtr old_handler = handler;
 
     if (old_handler)
         xf86RemoveGeneralHandler(old_handler);
 
-    xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
-    handler = proc;
+    handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
 
-    return old_handler;
+    return (old_handler) ? old_handler->ihproc : NULL;
 }
 
 static void
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index 77dfb2f..e098e14 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -47,15 +47,12 @@ static char vtname[11];
 static struct termios tty_attr; /* tty state to restore */
 static int tty_mode; /* kbd mode to restore */
 
-static void *console_handler;
-
 static void
 drain_console(int fd, void *closure)
 {
     errno = 0;
     if (tcflush(fd, TCIOFLUSH) == -1 && errno == EIO) {
-	xf86RemoveGeneralHandler(console_handler);
-	console_handler = NULL;
+        xf86SetConsoleHandler(NULL, NULL);
     }
 }
 
@@ -259,10 +256,11 @@ xf86CloseConsole(void)
         return;
     }
 
-    if (console_handler) {
-	xf86RemoveGeneralHandler(console_handler);
-	console_handler = NULL;
-    };
+    /*
+     * unregister the drain_console handler
+     * - what to do if someone else changed it in the meantime?
+     */
+    xf86SetConsoleHandler(NULL, NULL);
 
     /* Back to text mode ... */
     SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));

commit c8c5ed998aac2c91dbec1f86af3395e08ddab373
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Oct 13 12:01:10 2011 -0700

    crtc: match full preferred modes if possible when choosing an initial config
    
    It's fairly common to have multiple, identical monitors plugged in.  In
    that case, it's preferable to run the monitor's preferred mode on each
    output, rather than just matching the width & height and end up with
    different timings or refresh rates.
    
    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 3e145d3d67b472cb5d74cb8078b614160c4722b7)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3fae039..d75cd77 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2060,13 +2060,28 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 		if (o == p)
 		    continue;
 
-		for (mode = output->probed_modes; mode; mode = mode->next) {
-		    Rotation r = output->initial_rotation;
-		    if (xf86ModeWidth(mode, r) == pref_width &&
-			    xf86ModeHeight(mode, r) == pref_height) {
+		/*
+		 * First see if the preferred mode matches on the next
+		 * output as well.  This catches the common case of identical
+		 * monitors and makes sure they all have the same timings
+		 * and refresh.  If that fails, we fall back to trying to
+		 * match just width & height.
+		 */
+		mode = xf86OutputHasPreferredMode(output, pref_width,
+						  pref_height);
+		if (mode && xf86ModesEqual(mode, preferred[p])) {
 			preferred[o] = mode;
 			match = TRUE;
-		    }
+		} else {
+			for (mode = output->probed_modes; mode;
+			     mode = mode->next) {
+				Rotation r = output->initial_rotation;
+				if (xf86ModeWidth(mode, r) == pref_width &&
+				    xf86ModeHeight(mode, r) == pref_height) {
+					preferred[o] = mode;
+					match = TRUE;
+				}
+			}
 		}
 
 		all_match &= match;

commit d780c6f6301ed2263b21ac7d327a1b2e8d3e76df
Author: Ville Syrjala <syrjala@sci.fi>
Date:   Sun Oct 9 01:11:04 2011 +0300

    composite: Update borderClip in compAllocPixmap()
    
    Previously the parent constrained borderClip was copied over
    when compRedirectWindow() is called. That is insufficient eg. in
    case the window was already redirected, but not yet realized. So
    copy the borderClip over in compAllocPixmap() instead.
    
    Example:
    Window 1 is below an automatically redirect window 2. Window 2 is
    unmapped and moved outside the extents of window 1. Window 2 is
    then mapped again, and MarkOverlappedWindows() uses the up to
    date borderSize of window 2 to mark windows, which leaves
    window 1 unmarked. Then exposures are calculated using the stale
    borderClip of window 2, which causes the window below window 2,
    to be exposed through an apparent hole in window 1.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=22566
    
    Signed-off-by: Ville Syrjala <syrjala@sci.fi>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit a5266dcb3a60587e1877f90c18552baf60b597a0)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index f00bf4e..9857a92 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -196,11 +196,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
 
 	anyMarked = compMarkWindows (pWin, &pLayerWin);
 
-	/* Make sure our borderClip is correct for ValidateTree */
 	RegionNull(&cw->borderClip);
-	RegionCopy(&cw->borderClip, &pWin->borderClip);
-	cw->borderClipX = pWin->drawable.x;
-	cw->borderClipY = pWin->drawable.y;
 	cw->update = CompositeRedirectAutomatic;
 	cw->clients = 0;
 	cw->oldx = COMP_ORIGIN_INVALID;
@@ -658,6 +654,13 @@ compAllocPixmap (WindowPtr pWin)
 	DamageRegister (&pWin->drawable, cw->damage);
 	cw->damageRegistered = TRUE;
     }
+
+    /* Make sure our borderClip is up to date */
+    RegionUninit(&cw->borderClip);
+    RegionCopy(&cw->borderClip, &pWin->borderClip);
+    cw->borderClipX = pWin->drawable.x;
+    cw->borderClipY = pWin->drawable.y;
+
     return TRUE;
 }
 


Reply to: