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

xorg-server: Changes to 'debian-experimental'



 ChangeLog                   |  324 ++++++++++++++++++++++++++++++++++++++++++++
 Xext/sync.c                 |    2 
 configure.ac                |   37 ++---
 debian/changelog            |    2 
 debian/rules                |    2 
 exa/Makefile.am             |    4 
 glx/glxdri2.c               |    4 
 hw/kdrive/ephyr/ephyr.c     |    9 +
 hw/kdrive/ephyr/hostx.c     |    4 
 hw/kdrive/src/kdrive.c      |    3 
 hw/kdrive/src/kdrive.h      |    1 
 hw/kdrive/src/kinput.c      |   10 -
 hw/xfree86/Makefile.am      |   11 -
 hw/xfree86/modes/xf86Crtc.c |    3 
 hw/xnest/GCOps.c            |    1 
 include/input.h             |   12 -
 mi/mieq.c                   |    2 
 miext/sync/Makefile.am      |    3 
 miext/sync/misync.h         |    2 
 miext/sync/misyncfd.c       |   99 +++++++++++++
 miext/sync/misyncfd.h       |   45 ++++++
 miext/sync/misyncshm.c      |   21 +-
 miext/sync/misyncshm.h      |    2 
 present/present.c           |   52 +++++--
 present/present_event.c     |    2 
 present/present_fake.c      |    2 
 present/present_fence.c     |   29 +++
 present/present_priv.h      |   17 ++
 present/present_screen.c    |    2 
 test/Makefile.am            |    4 
 30 files changed, 631 insertions(+), 80 deletions(-)

New commits:
commit e29f8177c0b72665334fc5fe8637de0b525785c0
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Dec 2 12:57:11 2013 +0100

    disable xorg-servers linux acpi and apm support
    
    Can only cause bugs.

diff --git a/debian/rules b/debian/rules
index 3d1168d..741834e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -108,6 +108,8 @@ confflags += \
 	     --enable-dpms \
 	     $(config_backend) \
 	     --enable-xorg \
+	     --disable-linux-acpi \
+	     --disable-linux-apm \
 	     --disable-xquartz \
 	     --disable-xwin \
 	     --disable-xfake \

commit 6ba8ab142ddec34b36cfb0f41f661ffb2b151120
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Dec 2 10:48:56 2013 +0100

    bump changelog

diff --git a/ChangeLog b/ChangeLog
index 9752e3b..547da14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,327 @@
+commit 80481267662c8687e73081237913fa561e7a6561
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Nov 23 22:22:37 2013 -0800
+
+    Bump release to 1.14.99.903 (1.15 RC3)
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f1604002a32b7f098c2a16b4a8649c694af570c8
+Author: Keith Packard <keithp@keithp.com>
+Date:   Mon Nov 18 22:36:17 2013 -0800
+
+    miext: Ensure xshmfence is only called when driver supports it
+    
+    This provides a place for drivers to insert their own FD-based
+    SyncFence implementations, and prevents applications from using DRI3
+    SyncFence creation functions unless the driver has some support for
+    them.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Tested-by: Fredrik Höglund <fredrik@kde.org>
+
+commit 037566c57caff93fd7717f385d4b532b81f19c77
+Author: Keith Packard <keithp@keithp.com>
+Date:   Mon Nov 18 22:33:27 2013 -0800
+
+    Xext: Recover from miSyncInitFenceFromFD failure without crashing
+    
+    miSyncDestroyFence must not be called unless miSyncInitFence has been
+    invoked, so if miSyncInitFenceFromFD fails, we must free the fence
+    manually.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Tested-by: Fredrik Höglund <fredrik@kde.org>
+
+commit e7000534a456fdf9cd4eaada3193846c8525f740
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date:   Sat Oct 5 08:47:03 2013 +0100
+
+    glx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen
+    
+    In a similar spirit to
+    
+    commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b
+    Author: Keith Packard <keithp@keithp.com>
+    Date:   Mon Jul 12 16:01:34 2010 -0700
+    
+        Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
+    
+    we need to unwrap our pScrn->EnterVT/LeaveVT hooks around server
+    regeneration or else we cause an infinite recursion on the next VT
+    switch afterwards.
+    
+    Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1235516
+    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 6d5883bd7e5b765f8f0548501b825d9e56840799
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Nov 23 16:19:46 2013 -0800
+
+    xnest: Ignore GetImage() error in xnestGetImage() (v3)
+    
+    (I found an amended version of this patch and applied the difference
+    here - keithp)
+    
+    v3: Don't call Xsync before restoring error handler as any errors
+        generated by XGetImage() should be processed when this call
+        returns as suggested by Jamey Sharp <jamey@minilop.net>
+    
+    Signed-off-by: Egbert Eich <eich@freedesktop.org>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+
+commit 6403cbb143c67872ca9c58e3116ae7942def0ae1
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Nov 19 22:13:54 2013 -0800
+
+    present: When unflipping, copy to flip window rather than screen
+    
+    unflip happens after the clip lists have been updated, so instead of
+    smashing the whole screen and drawing over other windows, just draw to
+    the original flip window; it'll have the right clip list and so the
+    copy will work just fine.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit 8bdd2ccc776ded3f527596b5009ef25129aa3287
+Author: Keith Packard <keithp@keithp.com>
+Date:   Mon Nov 11 18:03:42 2013 -0800
+
+    present: Block for wait_fence in present_execute
+    
+    Pend presentation until wait_fence is also triggered by having the
+    SyncFence trigger invoke present_execute once triggered.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit e5a188cb919edee2e3a03054276bce0db02f7b62
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Nov 9 12:36:47 2013 -0800
+
+    present: Signal destroyed flip window with vblank->window == NULL
+    
+    This eliminates dereferencing freed window pointers when there is a
+    flip for that window in progress. The flip will complete, and then
+    immediately get undone (as we can't stop an in-progress flip).
+    
+    Remove the vblank->window_destroyed field as we can signal this with
+    vblank->window == NULL instead.
+    
+    Change check to vblank->window == NULL in:
+    
+    	present_flip_notify
+    
+    Add check for vblank->window == NULL in:
+    	present_vblank_notify
+    	present_execute
+    
+    present_flip_notify was also using vblank->window->drawable.pScreen,
+    so stop doing that and use vblank->screen instead.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit a5bcc4f7b9499caf8993f0a6ef96088553399ca3
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Nov 9 12:33:02 2013 -0800
+
+    present: Ignore event_id 0 from driver vblank notify
+    
+    We use event_id 0 to mean 'no such event'; if a driver sends us that
+    event_id, make sure we don't accidentally match it.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit 4f3c37a1f17ffcfbbff71d217e1caad3d0148c90
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Nov 7 14:17:12 2013 -0800
+
+    present: Round fake MSC computations intead of truncating
+    
+    If the timer fired too early, we'd sometimes mis-compute the MSC for
+    fake vblanks. Rounding the computation to the nearest MSC fixes this nicely.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+
+commit da9997f89f14ab619f244d5b2e80a423b028c789
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Nov 19 08:07:09 2013 +1000
+
+    configure: allow for --enable-libunwind and --disable-libunwind
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 29240e5cbf6e7f875b128fc7bfc4d56b2350835a
+Merge: 0492deb 8ff7e32
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Nov 14 17:02:04 2013 +0900
+
+    Merge remote-tracking branch 'whot/for-keith'
+
+commit 0492deb8f8238b7782e5a706ec6219d88aa1091d
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Oct 29 12:09:27 2013 -0400
+
+    mieq: Bump default queue size to 512
+    
+    Based on some bugzilla scraping I did around November 2012.  Of xserver
+    bugs in Red Hat bugzilla with an EQ size message in the log, the
+    distribution looked like:
+    
+    String                      | Matches
+    -------------------------------------
+    Increasing EQ size to 512   | 460
+    Increasing EQ size to 1024  | 52
+    Increasing EQ size to 2048  | 6
+    Increasing EQ size to 4096  | 0
+    
+    Most of the "512" ones appear to be mostly harmless, some relatively
+    expensive path in either rendering or resource destruction simply taking
+    too long due to external pressures like paging or CPU contention.  So
+    let's raise the initial queue size, both to reduce the number of
+    spurious abrt reports and to drop fewer events in all but the most
+    pathological cases.
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit d1440783a7367ff0d0c47d256bbca3b3cf8a5034
+Author: Dave Airlie <airlied@redhat.com>
+Date:   Tue Oct 29 12:09:26 2013 -0400
+
+    xfree86: return NULL for compat output if no outputs.
+    
+    With outputless GPUs showing up we crash here if there are not outputs
+    try and recover with a bit of grace.
+    
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+    Signed-off-by: Dave Airlie <airlied@redhat.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit d7ee27e5e415778240919082c83a65226c6f17e6
+Author: Dan Horák <dan@danny.cz>
+Date:   Tue Oct 29 12:09:25 2013 -0400
+
+    test: build the touch test only when building Xorg
+    
+    Reviewed-by: Adam Jackson <ajax@redhat.com>
+    Signed-off-by: Dan Horák <dan@danny.cz>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 8ff7e32c3ef7b0c13c4ab9664f651e9782d35a85
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Nov 13 17:14:11 2013 +1000
+
+    include: export key_is_down and friends
+    
+    VNC needs key_is_down to check if a key is processed as down before it
+    simulates various key releases. Make it available, because I seriously can't
+    be bothered thinking about how to rewrite VNC to not need that.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Acked-by: Keith Packard <keithp@keithp.com>
+
+commit 0ba7fc8472f1227fd1cd51bd58048f164b8ea1ab
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Tue Nov 12 14:46:04 2013 -0800
+
+    Stop including inline assembly .il file for Solaris Studio builds
+    
+    Since all the inb/outb/etc. use in the X server itself (except for
+    xf86SlowBcopy) has been replaced by calls to libpciaccess, we no
+    longer need to pass inline assembly files to replace the gcc inline
+    assembly from hw/xfree86/common/compiler.h when building Xorg itself.
+    
+    The .il files are still generated and installed in the SDK for the
+    benefit of drivers who may use them.
+    
+    Binary diff of before and after showed that xf86SlowBcopy was the
+    only function changed across the Xorg binary and all modules built
+    in the Xserver build, it just calls the outb() function now instead
+    of having the outb instructions inlined, making it a slightly slower
+    bcopy.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 550baf38f6096658f0bcf0ad647c4fedf93132f2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Oct 4 10:55:52 2013 +1000
+
+    kdrive: fix cursor jumps on CursorOffScreen behavior
+    
+    This patch fixes cursor jumps when there is a grab on the Xephyr window and
+    the pointer moves outside the window.
+    
+    So on two side-by-side 640x480 screens, a coordinate of 0/481
+    triggers KdCursorOffscreen.
+    
+    If the delta between two screens is 0, they share the same offset for
+    that dimension. When searching for the new screen, the loop always rules out
+    the current screen. So we get to the second screen, trigger the conditions
+    where dy <= 0 and decide that this new screen is the correct one. The result
+    is that whenever KdCursorOffScreen is called, the pointer jumps to the other
+    screen.
+    
+    Change to check for dy < 0 etc. so that the cursor stays on the same screen if
+    there is no other screen at the target location.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit a94d945065177d73f3ee8dc0b9147264ba281136
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 29 14:24:41 2013 +1000
+
+    kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that
+    
+    A multi-head Xephyr instance has the pointer stuck on one screen
+    because of bad coordinate calculation. The coordinates passed to
+    GetPointerEvents are per-screen, so the cursor gets stuck on the left-most
+    screen by default.
+    
+    Adjust and mark the events as POINTER_DESKTOP, so the DIX
+    can adjust them accordingly.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+
+commit d66832a3b8a8675f1e5f3656dcb1bbe95598f0ea
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Nov 14 13:21:54 2013 +1000
+
+    kdrive: handle WxH as valid geometry spec
+    
+    If a screen size was specified as WxH, the loop returned early and kdOrigin
+    was never advanced. Thus, screen->origin was always 0 (or whatever was given
+    at the -origin commandline flag).
+    
+    If a screen size was given with a bit depth (WxHxD), kdOrigin would always
+    advance by the current screen, offsetting the next screen.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c8c5105c1d5c093675d7f571f158147f22f7572b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 29 14:33:56 2013 +1000
+
+    ephyr: xcb_connect returns an error, not NULL
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Keith Packard <keithp@keithp.com>
+
 commit 2aa67ccef6ad8f51deb94b66defc668ddb7d226c
 Author: Keith Packard <keithp@keithp.com>
 Date:   Thu Nov 14 10:26:20 2013 +0900
diff --git a/debian/changelog b/debian/changelog
index 0adde4d..c01d75c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xorg-server (2:1.14.99.902-1) UNRELEASED; urgency=low
+xorg-server (2:1.14.99.903-1) UNRELEASED; urgency=low
 
   * New upstream snapshot.
   * Point to http://www.debian.org/support instead of the uploader's email

commit 80481267662c8687e73081237913fa561e7a6561
Author: Keith Packard <keithp@keithp.com>
Date:   Sat Nov 23 22:22:37 2013 -0800

    Bump release to 1.14.99.903 (1.15 RC3)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/configure.ac b/configure.ac
index 2f4edee..6c4a609 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.14.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-11-14"
-RELEASE_NAME="English Breakfast"
+AC_INIT([xorg-server], 1.14.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-11-23"
+RELEASE_NAME="Apple Pie"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_USE_SYSTEM_EXTENSIONS

commit f1604002a32b7f098c2a16b4a8649c694af570c8
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Nov 18 22:36:17 2013 -0800

    miext: Ensure xshmfence is only called when driver supports it
    
    This provides a place for drivers to insert their own FD-based
    SyncFence implementations, and prevents applications from using DRI3
    SyncFence creation functions unless the driver has some support for
    them.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Tested-by: Fredrik Höglund <fredrik@kde.org>

diff --git a/miext/sync/Makefile.am b/miext/sync/Makefile.am
index ac13c52..34961d5 100644
--- a/miext/sync/Makefile.am
+++ b/miext/sync/Makefile.am
@@ -5,7 +5,7 @@ AM_CFLAGS = $(DIX_CFLAGS)
 AM_CPPFLAGS = 
 
 if XORG
-sdk_HEADERS = misync.h misyncstr.h misyncshm.h
+sdk_HEADERS = misync.h misyncstr.h misyncshm.h misyncfd.h
 endif
 
 XSHMFENCE_SRCS = misyncshm.c
@@ -13,6 +13,7 @@ XSHMFENCE_SRCS = misyncshm.c
 libsync_la_SOURCES =	\
 	misync.c	\
 	misync.h	\
+	misyncfd.c	\
 	misyncstr.h
 
 if XSHMFENCE
diff --git a/miext/sync/misync.h b/miext/sync/misync.h
index f63ec2b..dc78c5f 100644
--- a/miext/sync/misync.h
+++ b/miext/sync/misync.h
@@ -42,8 +42,8 @@ typedef struct _syncScreenFuncs {
     SyncScreenDestroyFenceFunc DestroyFence;
 } SyncScreenFuncsRec, *SyncScreenFuncsPtr;
 
-extern _X_EXPORT void
 
+extern _X_EXPORT void
 miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
                         Bool initially_triggered);
 extern _X_EXPORT void
diff --git a/miext/sync/misyncfd.c b/miext/sync/misyncfd.c
new file mode 100644
index 0000000..93ff85f
--- /dev/null
+++ b/miext/sync/misyncfd.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "scrnintstr.h"
+#include "misync.h"
+#include "misyncstr.h"
+#include "misyncfd.h"
+#include "pixmapstr.h"
+
+static DevPrivateKeyRec syncFdScreenPrivateKey;
+
+typedef struct _SyncFdScreenPrivate {
+    SyncFdScreenFuncsRec        funcs;
+} SyncFdScreenPrivateRec, *SyncFdScreenPrivatePtr;
+
+static inline SyncFdScreenPrivatePtr sync_fd_screen_priv(ScreenPtr pScreen)
+{
+    if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey))
+        return NULL;
+    return dixLookupPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey);
+}
+
+int
+miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered)
+
+{
+    SyncFdScreenPrivatePtr      priv = sync_fd_screen_priv(pDraw->pScreen);
+
+    if (!priv)
+        return BadMatch;
+
+    return (*priv->funcs.CreateFenceFromFd)(pDraw->pScreen, pFence, fd, initially_triggered);
+}
+
+int
+miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
+{
+    SyncFdScreenPrivatePtr      priv = sync_fd_screen_priv(pDraw->pScreen);
+
+    if (!priv)
+        return -1;
+
+    return (*priv->funcs.GetFenceFd)(pDraw->pScreen, pFence);
+}
+
+_X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen,
+                                  const SyncFdScreenFuncsRec *funcs)
+{
+    SyncFdScreenPrivatePtr     priv;
+
+    /* Check to see if we've already been initialized */
+    if (sync_fd_screen_priv(pScreen) != NULL)
+        return FALSE;
+
+    if (!miSyncSetup(pScreen))
+        return FALSE;
+    
+    if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) {
+        if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, 0))
+            return FALSE;
+    }
+
+    priv = calloc(1, sizeof (SyncFdScreenPrivateRec));
+    if (!priv)
+        return FALSE;
+
+    /* Will require version checks when there are multiple versions
+     * of the funcs structure
+     */
+
+    priv->funcs = *funcs;
+
+    dixSetPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey, priv);
+    
+    return TRUE;
+}
diff --git a/miext/sync/misyncfd.h b/miext/sync/misyncfd.h
new file mode 100644
index 0000000..c1d05f9
--- /dev/null
+++ b/miext/sync/misyncfd.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _MISYNCFD_H_
+#define _MISYNCFD_H_
+
+typedef int (*SyncScreenCreateFenceFromFdFunc) (ScreenPtr screen,
+                                                SyncFence *fence,
+                                                int fd,
+                                                Bool initially_triggered);
+
+typedef int (*SyncScreenGetFenceFdFunc) (ScreenPtr screen,
+                                      SyncFence *fence);
+
+#define SYNC_FD_SCREEN_FUNCS_VERSION    1
+
+typedef struct _syncFdScreenFuncs {
+    int                                 version;
+    SyncScreenCreateFenceFromFdFunc     CreateFenceFromFd;
+    SyncScreenGetFenceFdFunc            GetFenceFd;
+} SyncFdScreenFuncsRec, *SyncFdScreenFuncsPtr;
+
+extern _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen,
+                                         const SyncFdScreenFuncsRec *funcs);
+
+#endif /* _MISYNCFD_H_ */
diff --git a/miext/sync/misyncshm.c b/miext/sync/misyncshm.c
index ddd15ae..3f9350a 100644
--- a/miext/sync/misyncshm.c
+++ b/miext/sync/misyncshm.c
@@ -28,6 +28,7 @@
 #include "misync.h"
 #include "misyncstr.h"
 #include "misyncshm.h"
+#include "misyncfd.h"
 #include "pixmapstr.h"
 #include <sys/mman.h>
 #include <unistd.h>
@@ -118,13 +119,12 @@ miSyncShmScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence)
     miSyncScreenDestroyFence(pScreen, pFence);
 }
 
-int
-miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initially_triggered)
-
+static int
+miSyncShmCreateFenceFromFd(ScreenPtr pScreen, SyncFence *pFence, int fd, Bool initially_triggered)
 {
     SyncShmFencePrivatePtr      pPriv = SYNC_FENCE_PRIV(pFence);
 
-    miSyncInitFence(pDraw->pScreen, pFence, initially_triggered);
+    miSyncInitFence(pScreen, pFence, initially_triggered);
 
     pPriv->fence = xshmfence_map_shm(fd);
     if (pPriv->fence) {
@@ -136,8 +136,8 @@ miSyncInitFenceFromFD(DrawablePtr pDraw, SyncFence *pFence, int fd, BOOL initial
     return BadValue;
 }
 
-int
-miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
+static int
+miSyncShmGetFenceFd(ScreenPtr pScreen, SyncFence *pFence)
 {
     SyncShmFencePrivatePtr      pPriv = SYNC_FENCE_PRIV(pFence);
 
@@ -154,11 +154,17 @@ miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
     return pPriv->fd;
 }
 
+static const SyncFdScreenFuncsRec miSyncShmScreenFuncs = {
+    .version = SYNC_FD_SCREEN_FUNCS_VERSION,
+    .CreateFenceFromFd = miSyncShmCreateFenceFromFd,
+    .GetFenceFd = miSyncShmGetFenceFd
+};
+
 _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen)
 {
     SyncScreenFuncsPtr  funcs;
 
-    if (!miSyncSetup(pScreen))
+    if (!miSyncFdScreenInit(pScreen, &miSyncShmScreenFuncs))
         return FALSE;
 
     if (!dixPrivateKeyRegistered(&syncShmFencePrivateKey)) {
@@ -171,6 +177,7 @@ _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen)
 
     funcs->CreateFence = miSyncShmScreenCreateFence;
     funcs->DestroyFence = miSyncShmScreenDestroyFence;
+
     return TRUE;
 }
 
diff --git a/miext/sync/misyncshm.h b/miext/sync/misyncshm.h
index 4edbb50..23c001a 100644
--- a/miext/sync/misyncshm.h
+++ b/miext/sync/misyncshm.h
@@ -21,7 +21,7 @@
  */
 
 #ifndef _MISYNCSHM_H_
-#define _MISYNCSYM_H_
+#define _MISYNCSHM_H_
 
 extern _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen);
 

commit 037566c57caff93fd7717f385d4b532b81f19c77
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Nov 18 22:33:27 2013 -0800

    Xext: Recover from miSyncInitFenceFromFD failure without crashing
    
    miSyncDestroyFence must not be called unless miSyncInitFence has been
    invoked, so if miSyncInitFenceFromFD fails, we must free the fence
    manually.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Tested-by: Fredrik Höglund <fredrik@kde.org>

diff --git a/Xext/sync.c b/Xext/sync.c
index dd18cde..2d58ea1 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -929,7 +929,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
 
     status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
     if (status != Success) {
-        miSyncDestroyFence(pFence);
+        dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
         return status;
     }
 

commit e7000534a456fdf9cd4eaada3193846c8525f740
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Oct 5 08:47:03 2013 +0100

    glx/glxdri2: Unwrap EnterVT/LeaveVT upon CloseScreen
    
    In a similar spirit to
    
    commit d75e8146c414bfd512ba5dbd4a83acb334bbe19b
    Author: Keith Packard <keithp@keithp.com>
    Date:   Mon Jul 12 16:01:34 2010 -0700
    
        Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998
    
    we need to unwrap our pScrn->EnterVT/LeaveVT hooks around server
    regeneration or else we cause an infinite recursion on the next VT
    switch afterwards.
    
    Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1235516
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 1d74c8f..fbbd1fd 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -371,6 +371,7 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
 {
     int i;
 
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
     __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
 
     (*screen->core->destroyScreen) (screen->driScreen);
@@ -385,6 +386,9 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
         free(screen->driConfigs);
     }
 
+    pScrn->EnterVT = screen->enterVT;
+    pScrn->LeaveVT = screen->leaveVT;
+
     free(screen);
 }
 

commit 6d5883bd7e5b765f8f0548501b825d9e56840799
Author: Keith Packard <keithp@keithp.com>
Date:   Sat Nov 23 16:19:46 2013 -0800

    xnest: Ignore GetImage() error in xnestGetImage() (v3)
    
    (I found an amended version of this patch and applied the difference
    here - keithp)
    
    v3: Don't call Xsync before restoring error handler as any errors
        generated by XGetImage() should be processed when this call
        returns as suggested by Jamey Sharp <jamey@minilop.net>
    
    Signed-off-by: Egbert Eich <eich@freedesktop.org>
    Reviewed-by: Jamey Sharp <jamey@minilop.net>

diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 7b1956d..d00511d 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -115,7 +115,6 @@ xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
 
     ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
                        x, y, w, h, planeMask, format);
-    XSync(xnestDisplay, False);
     XSetErrorHandler(old_handler);
 
     if (ximage) {

commit 6403cbb143c67872ca9c58e3116ae7942def0ae1
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Nov 19 22:13:54 2013 -0800

    present: When unflipping, copy to flip window rather than screen
    
    unflip happens after the clip lists have been updated, so instead of
    smashing the whole screen and drawing over other windows, just draw to
    the original flip window; it'll have the right clip list and so the
    copy will work just fine.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>

diff --git a/present/present.c b/present/present.c
index 16dc381..f9eef6b 100644
--- a/present/present.c
+++ b/present/present.c
@@ -321,8 +321,8 @@ present_unflip(ScreenPtr screen)
 
     /* Update the screen pixmap with the current flip pixmap contents
      */
-    if (screen_priv->flip_pixmap) {
-        present_copy_region(&screen->GetScreenPixmap(screen)->drawable,
+    if (screen_priv->flip_pixmap && screen_priv->flip_window) {
+        present_copy_region(&screen_priv->flip_window->drawable,
                             screen_priv->flip_pixmap,
                             NULL, 0, 0);
     }

commit 8bdd2ccc776ded3f527596b5009ef25129aa3287
Author: Keith Packard <keithp@keithp.com>
Date:   Mon Nov 11 18:03:42 2013 -0800

    present: Block for wait_fence in present_execute
    
    Pend presentation until wait_fence is also triggered by having the
    SyncFence trigger invoke present_execute once triggered.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>

diff --git a/present/present.c b/present/present.c
index 67d7f6e..16dc381 100644
--- a/present/present.c
+++ b/present/present.c
@@ -453,6 +453,26 @@ present_check_flip_window (WindowPtr window)
 }
 
 /*
+ * Called when the wait fence is triggered; just gets the current msc/ust and
+ * calls present_execute again. That will re-check the fence and pend the
+ * request again if it's still not actually ready
+ */
+static void
+present_wait_fence_triggered(void *param)
+{
+    present_vblank_ptr  vblank = param;
+    WindowPtr           window = vblank->window;
+    uint64_t            ust = 0, crtc_msc = 0;
+
+    if (window) {
+        present_window_priv_ptr     window_priv = present_get_window_priv(window, TRUE);
+        if (window_priv)
+            (void) present_get_ust_msc(window, window_priv->crtc, &ust, &crtc_msc);
+    }
+    present_execute(vblank, ust, crtc_msc);
+}
+
+/*
  * Once the required MSC has been reached, execute the pending request.
  *
  * For requests to actually present something, either blt contents to
@@ -469,7 +489,10 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     present_screen_priv_ptr     screen_priv = present_screen_priv(window->drawable.pScreen);
 
     if (vblank->wait_fence) {
-        /* XXX check fence, queue if not ready */
+        if (!present_fence_check_triggered(vblank->wait_fence)) {
+            present_fence_set_callback(vblank->wait_fence, present_wait_fence_triggered, vblank);
+            return;
+        }
     }
 
     xorg_list_del(&vblank->event_queue);
@@ -654,6 +677,12 @@ present_pixmap(WindowPtr window,
             target_msc--;
     }
 
+    if (wait_fence) {
+        vblank->wait_fence = present_fence_create(wait_fence);
+        if (!vblank->wait_fence)
+            goto no_mem;
+    }
+
     if (idle_fence) {
         vblank->idle_fence = present_fence_create(idle_fence);
         if (!vblank->idle_fence)
@@ -764,6 +793,9 @@ present_vblank_destroy(present_vblank_ptr vblank)
     if (vblank->update)
         RegionDestroy(vblank->update);
 
+    if (vblank->wait_fence)
+        present_fence_destroy(vblank->wait_fence);
+
     if (vblank->idle_fence)
         present_fence_destroy(vblank->idle_fence);
 
diff --git a/present/present_event.c b/present/present_event.c
index a30bc82..a8f7176 100644
--- a/present/present_event.c
+++ b/present/present_event.c
@@ -26,8 +26,6 @@
 
 #include "present_priv.h"
 
-#include "present_priv.h"
-
 RESTYPE present_event_type;
 
 static int
diff --git a/present/present_fence.c b/present/present_fence.c
index db5efca..e09657d 100644
--- a/present/present_fence.c
+++ b/present/present_fence.c
@@ -37,6 +37,8 @@
 struct present_fence {
     SyncTrigger         trigger;
     SyncFence           *fence;
+    void                (*callback)(void *param);
+    void                *param;
 };
 
 /*
@@ -45,12 +47,18 @@ struct present_fence {
 static Bool
 present_fence_sync_check_trigger(SyncTrigger *trigger, XSyncValue oldval)
 {
-    return FALSE;
+    struct present_fence        *present_fence = container_of(trigger, struct present_fence, trigger);
+
+    return present_fence->callback != NULL;
 }
 
 static void
 present_fence_sync_trigger_fired(SyncTrigger *trigger)
 {
+    struct present_fence        *present_fence = container_of(trigger, struct present_fence, trigger);
+
+    if (present_fence->callback)
+        (*present_fence->callback)(present_fence->param);
 }
 
 static void
@@ -101,6 +109,25 @@ present_fence_set_triggered(struct present_fence *present_fence)
             (*present_fence->fence->funcs.SetTriggered) (present_fence->fence);
 }
 
+Bool
+present_fence_check_triggered(struct present_fence *present_fence)
+{
+    if (!present_fence)
+        return TRUE;
+    if (!present_fence->fence)
+        return TRUE;
+    return (*present_fence->fence->funcs.CheckTriggered)(present_fence->fence);
+}
+
+void
+present_fence_set_callback(struct present_fence *present_fence,
+                           void (*callback) (void *param),
+                           void *param)
+{
+    present_fence->callback = callback;
+    present_fence->param = param;
+}
+
 XID
 present_fence_id(struct present_fence *present_fence)
 {
diff --git a/present/present_priv.h b/present/present_priv.h
index 40c88dd..500c7c2 100644


Reply to: