[Xquartz-changes] xserver: Branch 'master' - 16 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Dec 29 12:27:37 PST 2013


 Xi/exevents.c               |    6 ++++--
 configure.ac                |    8 ++++----
 dix/events.c                |    2 +-
 dri3/dri3_request.c         |    5 +++--
 dri3/dri3_screen.c          |    6 ++++++
 glx/glxext.c                |    4 +++-
 hw/xquartz/X11Application.m |   13 +++++++++++++
 include/protocol-versions.h |    8 ++++++++
 present/present.c           |   33 +++++++++++++++++++++++++++++----
 present/present_request.c   |    5 +++--
 10 files changed, 74 insertions(+), 16 deletions(-)

New commits:
commit c395f6ac3932a424d0b7967f36952802f724ea81
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Dec 29 12:22:55 2013 -0800

    XQuartz: Silence some static analyzer warnings by annotating referencing counts
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 1f9b05d..2efbd65 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -70,6 +70,18 @@ xpbproxy_run(void);
 static dispatch_queue_t eventTranslationQueue;
 #endif
 
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#ifndef CF_RETURNS_RETAINED
+#if __has_feature(attribute_cf_returns_retained)
+#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+#else
+#define CF_RETURNS_RETAINED
+#endif
+#endif
+
 extern Bool noTestExtensions;
 extern Bool noRenderExtension;
 extern BOOL serverRunning;
@@ -526,6 +538,7 @@ cfrelease(CFAllocatorRef a, const void *b)
     CFRelease(b);
 }
 
+CF_RETURNS_RETAINED
 static CFMutableArrayRef
 nsarray_to_cfarray(NSArray *in)
 {
commit 2ea973e12f5d954211e1d10085a4c74581b43aca
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Dec 27 09:50:55 2013 -0800

    Bump version to 1.15.0
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 7ec1997..8f82386 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.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-12-19"
-RELEASE_NAME="Kraken"
+AC_INIT([xorg-server], 1.15.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-12-27"
+RELEASE_NAME="Egg Nog"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_USE_SYSTEM_EXTENSIONS
commit 2eb9915eea358f941702d3dad7434197991885c5
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Dec 12 15:48:08 2013 -0800

    present: Set complete notify mode to Skip as needed
    
    Skipped present pixmap calls were not setting the mode to
    PresentCompleteModeSkip for skipped operations.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/present/present.c b/present/present.c
index 3caa8b7..30cd3b9 100644
--- a/present/present.c
+++ b/present/present.c
@@ -525,6 +525,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     WindowPtr                   window = vblank->window;
     ScreenPtr                   screen = window->drawable.pScreen;
     present_screen_priv_ptr     screen_priv = present_screen_priv(screen);
+    uint8_t                     mode;
 
     if (vblank->wait_fence) {
         if (!present_fence_check_triggered(vblank->wait_fence)) {
@@ -604,7 +605,20 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 
         present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence);
     }
-    present_vblank_notify(vblank, vblank->kind, PresentCompleteModeCopy, ust, crtc_msc);
+
+    /* Compute correct CompleteMode
+     */
+    if (vblank->kind == PresentCompleteKindPixmap) {
+        if (vblank->pixmap && vblank->window)
+            mode = PresentCompleteModeCopy;
+        else
+            mode = PresentCompleteModeSkip;
+    }
+    else
+        mode = PresentCompleteModeCopy;
+
+
+    present_vblank_notify(vblank, vblank->kind, mode, ust, crtc_msc);
     present_vblank_destroy(vblank);
 }
 
commit e487babd525ef1bd016ec7b283fa08cf9e6c6f4f
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Dec 12 14:52:35 2013 -0800

    present: Don't abandon presents which are already queued for flip
    
    Presents which are not marked 'queued' and are in the window present
    list are waiting for the flip event; discarding those won't work very
    well (it'll end up trashing displayed content for the next frame), so
    skip over those when looking for duplicate frame presents
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/present/present.c b/present/present.c
index 4c0d63b..3caa8b7 100644
--- a/present/present.c
+++ b/present/present.c
@@ -689,6 +689,9 @@ present_pixmap(WindowPtr window,
             if (!vblank->pixmap)
                 continue;
 
+            if (!vblank->queued)
+                continue;
+
             if (vblank->crtc != target_crtc || vblank->target_msc != target_msc)
                 continue;
 
commit ca3a5b2a8f9f627bbaa9883e16512a21c2a0b81d
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Dec 12 14:17:40 2013 -0800

    present: Handle PresentOptionAsync for copy mode
    
    Check for Async flag and execute immediately if set, otherwise wait
    for the next appropriate vblank before copying.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/present/present.c b/present/present.c
index 50bd055..4c0d63b 100644
--- a/present/present.c
+++ b/present/present.c
@@ -663,10 +663,18 @@ present_pixmap(WindowPtr window,
     if (crtc_msc >= target_msc) {
         if (divisor != 0) {
             target_msc = crtc_msc - (crtc_msc % divisor) + remainder;
-            if (target_msc <= crtc_msc)
-                target_msc += divisor;
-        } else
+            if (options & PresentOptionAsync) {
+                if (target_msc < crtc_msc)
+                    target_msc += divisor;
+            } else {
+                if (target_msc <= crtc_msc)
+                    target_msc += divisor;
+            }
+        } else {
             target_msc = crtc_msc;
+            if (!(options & PresentOptionAsync))
+                target_msc++;
+        }
     }
 
     /*
commit a68df147421da21528b5be2d34678383922fa352
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Dec 19 14:31:07 2013 -0800

    Bump version to 1.14.99.905 (1.15 RC5)
    
    Another week, another RC. This should be the last before 1.15 final
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 51ac30b..7ec1997 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.904, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-12-10"
-RELEASE_NAME="Chai"
+AC_INIT([xorg-server], 1.14.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-12-19"
+RELEASE_NAME="Kraken"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_USE_SYSTEM_EXTENSIONS
commit 4b1ead9d3400acc3402c2480d7cc0527750c32f0
Merge: 4d62646 929795d
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Dec 19 14:14:59 2013 -0800

    Merge remote-tracking branch 'whot/for-keith'

commit 4d62646142718024b0981eb4f1fd0131e829161f
Merge: f4bfb14 81ba89d
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Dec 16 09:27:57 2013 -0800

    Merge remote-tracking branch 'jeremyhu/master'

commit f4bfb14f53a939574da1f5995f0dad949898b86a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Dec 12 10:57:40 2013 -0500

    configure: Fix a typo near dri3/shmfence detection
    
    " is not the mate of ].
    
    Reviewed-by: Jasper St. Pierre <jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index 8bedd35..3f2c2d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1218,7 +1218,7 @@ case "$DRI3,$HAVE_XSHMFENCE" in
 	yes,yes | auto,yes)
 		;;
 	yes,no)
-		AC_MSG_ERROR("DRI3 requested, but xshmfence not found.])
+		AC_MSG_ERROR([DRI3 requested, but xshmfence not found.])
 		DRI3=no
 		;;
 	no,*)
commit 8248b4af31ef71ac03158871b77f20eb456dbe38
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 15:07:48 2013 -0500

    glx: Add null pointer protection to __glGetProcAddress
    
    This can't happen when GLX is the backing window system, but can
    elsewhere.  We may as well protect against it at a high level.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/glx/glxext.c b/glx/glxext.c
index 84ac43d..316b4f6 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -554,7 +554,9 @@ __glXsetGetProcAddress(glx_gpa_proc get_proc_address)
 
 void *__glGetProcAddress(const char *proc)
 {
-    return _get_proc_address(proc);
+    void *ret = _get_proc_address(proc);
+
+    return ret ? ret : NoopDDA;
 }
 
 /*
commit 128449dd6498a2f74c3770f89a9dae0f70e2b351
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:39:16 2013 -0500

    present: Don't use the major/minor version from the protocol headers
    
    We want to advertise the version we implement, not the version the
    protocol headers happen to describe.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 7fe61e0..fc428c8 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -67,6 +67,10 @@
 #define SERVER_PANORAMIX_MAJOR_VERSION          1
 #define SERVER_PANORAMIX_MINOR_VERSION		1
 
+/* Present */
+#define SERVER_PRESENT_MAJOR_VERSION            1
+#define SERVER_PRESENT_MINOR_VERSION            0
+
 /* RandR */
 #define SERVER_RANDR_MAJOR_VERSION		1
 #define SERVER_RANDR_MINOR_VERSION		4
diff --git a/present/present_request.c b/present/present_request.c
index 095fa2d..1064dcb 100644
--- a/present/present_request.c
+++ b/present/present_request.c
@@ -26,6 +26,7 @@
 
 #include "present_priv.h"
 #include "randrstr.h"
+#include <protocol-versions.h>
 
 static int
 proc_present_query_version(ClientPtr client)
@@ -35,8 +36,8 @@ proc_present_query_version(ClientPtr client)
         .type = X_Reply,
         .sequenceNumber = client->sequence,
         .length = 0,
-        .majorVersion = PRESENT_MAJOR,
-        .minorVersion = PRESENT_MINOR
+        .majorVersion = SERVER_PRESENT_MAJOR_VERSION,
+        .minorVersion = SERVER_PRESENT_MINOR_VERSION
     };
 
     REQUEST_SIZE_MATCH(xPresentQueryVersionReq);
commit ec6087bf070131bc3a26848fb9fb840f09b0e19d
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:36:38 2013 -0500

    dri3: Don't use the major/minor version from the protocol headers
    
    We want to advertise the version we implement, not the version the
    protocol headers happen to describe.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 3ebb9d5..4e1408f 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <xace.h>
 #include "../Xext/syncsdk.h"
+#include <protocol-versions.h>
 
 static int
 proc_dri3_query_version(ClientPtr client)
@@ -38,8 +39,8 @@ proc_dri3_query_version(ClientPtr client)
         .type = X_Reply,
         .sequenceNumber = client->sequence,
         .length = 0,
-        .majorVersion = DRI3_MAJOR,
-        .minorVersion = DRI3_MINOR
+        .majorVersion = SERVER_DRI3_MAJOR_VERSION,
+        .minorVersion = SERVER_DRI3_MINOR_VERSION
     };
 
     REQUEST_SIZE_MATCH(xDRI3QueryVersionReq);
diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 95df8ce..7fe61e0 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -46,6 +46,10 @@
 #define SERVER_DAMAGE_MAJOR_VERSION		1
 #define SERVER_DAMAGE_MINOR_VERSION		1
 
+/* DRI3 */
+#define SERVER_DRI3_MAJOR_VERSION               1
+#define SERVER_DRI3_MINOR_VERSION               0
+
 /* DMX */
 #define SERVER_DMX_MAJOR_VERSION		2
 #define SERVER_DMX_MINOR_VERSION		2
commit e6fafd3de70d315130fb6e5732cfd02a5901b788
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 13 11:28:59 2013 -0500

    dri3: Guard against buggy clients
    
    There's nothing to stop a client from sending these requests to screens
    without DRI3 support, and if they do, we'll crash.  Let's not do that.
    
    Reviewed-by: Jasper St. Pierre <<jstpierre at mecheye.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index cf2735b..c880296 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -55,6 +55,9 @@ dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd,
     dri3_screen_info_ptr        info = ds->info;
     PixmapPtr                   pixmap;
 
+    if (!info || !info->pixmap_from_fd)
+        return BadImplementation;
+
     pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp);
     if (!pixmap)
         return BadAlloc;
@@ -71,6 +74,9 @@ dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
     dri3_screen_info_ptr        info = ds->info;
     int                         fd;
 
+    if (!info || !info->fd_from_pixmap)
+        return BadImplementation;
+
     fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size);
     if (fd < 0)
         return BadAlloc;
commit 929795d50d788358d6269ce423f72c6cc40e334b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 3 10:14:51 2013 +1000

    dix: fix check for grab type
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 4632bb7..4aaa54c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4696,7 +4696,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
 
     filter = GetEventFilter(mouse, (xEvent *) event);
 
-    if (grab && grab->type == XI2) {
+    if (grab && grab->grabtype == XI2) {
         Mask mask;
 
         mask = xi2mask_isset(grab->xi2mask, mouse, type);
commit 23394c7fea0f5c33333198c87ecfecc9f6c6a791
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 3 08:36:45 2013 +1000

    Xi: ungrab device when releasing a passive grab without ButtonReleaseMask (#71878)
    
    If an touch triggers an async button grab and that grab does not have the
    ButtonReleaseMask set, the TouchEnd is never delivered, deliveries is 0  and
    the grab is never deactivated.
    
    If the grab is pointer async and keyboard sync, the keyboard events are stuck
    in EnqueueEvent until some other pointer event terminates the grab.
    
    Change this to check for the number of listeners. If we're about to deliver a
    TouchEnd to a passive pointer grab, the number of listeners is already 1 -
    pointer grabs always accept so other listeners were removed.
    
    X.Org Bug 71878 <http://bugs.freedesktop.org/show_bug.cgi?id=71878>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5e1d3e0..dff0a92 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1413,7 +1413,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
                 !(ev->device_event.flags & TOUCH_CLIENT_ID))
                 TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
 
-            if (deliveries && ev->any.type == ET_TouchEnd &&
+            if (ev->any.type == ET_TouchEnd &&
+                ti->num_listeners == 1 &&
                 !dev->button->buttonsDown &&
                 dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
                 (*dev->deviceGrab.DeactivateGrab) (dev);
commit c1d30b5bd7f90e68bc38404fd0cc32578d6d3018
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Nov 21 21:24:20 2013 -0500

    Xi: Don't ActivateEarlyAccept POINTER_REGULAR listeners
    
    Bug #71878 describes a bug resulting in the server ceasing to respond to
    keyboard input after a touch event. The problem might be the following:
    
    DeliverTouchBeginEvent tries to deliver an event to a listener of type
    LISTENER_POINTER_REGULAR, taking the following if branch,
    
        if (listener->type == LISTENER_POINTER_REGULAR ||
            listener->type == LISTENER_POINTER_GRAB) {
            rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
                                           grab, xi2mask);
            if (rc == Success) {
                listener->state = LISTENER_IS_OWNER;
                /* async grabs cannot replay, so automatically accept this touch */
                if (dev->deviceGrab.grab &&
                    dev->deviceGrab.fromPassiveGrab &&
                    dev->deviceGrab.grab->pointerMode == GrabModeAsync)
                    ActivateEarlyAccept(dev, ti);
            }
            goto out;
        }
    
    DeliverTouchEmulatedEvent succeeds.  The deviceGrab meets all
    three of the conditions of the inner if, enters
    ActivateEarlyAccept which then fails due to,
    
        BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB &&
                   ti->listeners[0].type != LISTENER_POINTER_GRAB);
    
    That is, despite listener->type == LISTENER_POINTER_REGULAR. With my
    non-existent knowledge of XINPUT, it seems like the solution here
    might be to only ActivateEarlyAccept when listener->type ==
    LISTENER_POINTER_GRAB.
    
    Signed-off-by: Ben Gamari <bgamari.foss at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 5dc9020..5e1d3e0 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1845,7 +1845,8 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         if (rc == Success) {
             listener->state = LISTENER_IS_OWNER;
             /* async grabs cannot replay, so automatically accept this touch */
-            if (dev->deviceGrab.grab &&
+            if (listener->type == LISTENER_POINTER_GRAB &&
+                dev->deviceGrab.grab &&
                 dev->deviceGrab.fromPassiveGrab &&
                 dev->deviceGrab.grab->pointerMode == GrabModeAsync)
                 ActivateEarlyAccept(dev, ti);


More information about the Xquartz-changes mailing list