xserver: Branch 'master' - 3 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Jun 23 13:48:33 PDT 2014


 configure.ac      |    2 +-
 present/present.c |   25 ++++++++++++++++++++++---
 2 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit 334faabe682a422075ba214501c7554dd5ee5563
Author: Frank Binns <frank.binns at imgtec.com>
Date:   Tue Jun 10 13:43:31 2014 +0100

    present: restore screen pixmap when aborting a flip
    
    If a 2D application is started on top of a fullscreen 3D application, which
    is flipping, then we need to stop flipping and restore the root window, and
    possibly the flip window, to using the screen pixmap. Normally this would
    be done as part of an unflip. However, in the case that there is a pending
    flip there is no mechanism to abort so the unflip is deferred until the
    pending flip completes. This provides a window of opportunity for the 2D
    application to draw to the wrong pixmap.
    
    Restore the screen pixmap at the point a pending flip is marked as aborted,
    thus avoiding this issue.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Frank Binns <frank.binns at imgtec.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/present/present.c b/present/present.c
index 165860a..271c251 100644
--- a/present/present.c
+++ b/present/present.c
@@ -383,6 +383,24 @@ present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap)
 }
 
 static void
+present_set_abort_flip(ScreenPtr screen)
+{
+    present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+    /* Switch back to using the screen pixmap now to avoid
+     * 2D applications drawing to the wrong pixmap.
+     */
+
+    if (screen_priv->flip_window)
+        present_set_tree_pixmap(screen_priv->flip_window,
+                                  (*screen->GetScreenPixmap)(screen));
+
+    present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
+
+    screen_priv->flip_pending->abort_flip = TRUE;
+}
+
+static void
 present_unflip(ScreenPtr screen)
 {
     present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -511,7 +529,7 @@ present_check_flip_window (WindowPtr window)
         if (flip_pending->window == window) {
             if (!present_check_flip(flip_pending->crtc, window, flip_pending->pixmap,
                                     flip_pending->sync_flip, NULL, 0, 0))
-                flip_pending->abort_flip = TRUE;
+                present_set_abort_flip(screen);
         }
     } else {
         /*
@@ -634,7 +652,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
             /* Check pending flip
              */
             if (window == screen_priv->flip_pending->window)
-                screen_priv->flip_pending->abort_flip = TRUE;
+                present_set_abort_flip(screen);
         } else if (!screen_priv->unflip_event_id) {
 
             /* Check current flip
@@ -916,7 +934,7 @@ present_flip_destroy(ScreenPtr screen)
 
     /* Do the actual cleanup once the flip has been performed by the hardware */
     if (screen_priv->flip_pending)
-        screen_priv->flip_pending->abort_flip = TRUE;
+        present_set_abort_flip(screen);
 }
 
 void
commit 382ff4a306b97b0ddcdac03ce8611b026ca5323b
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jun 17 15:50:48 2014 -0700

    present: Remove executing vblank from window list. Bug# 79709.
    
    Once the vblank is actually getting executed, it's lifetime is no
    longer tied to the window, and so it shouldn't be controlled by window
    destruction. In particular, if the vblank is queued for flip, it will
    get stored in the flip_pending field, and will be correctly destroyed
    when the flip completes.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/present/present.c b/present/present.c
index 1bf3a58..165860a 100644
--- a/present/present.c
+++ b/present/present.c
@@ -578,6 +578,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     }
 
     xorg_list_del(&vblank->event_queue);
+    xorg_list_del(&vblank->window_list);
     vblank->queued = FALSE;
 
     if (vblank->pixmap && vblank->window) {
commit 1095c262502332bc570a9b288b01da51c1fa10ec
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Fri Jun 6 17:54:22 2014 -0700

    config: show default path in help for --with-xkb-bin-directory
    
    Now shows:
      --with-xkb-bin-directory=DIR
                              Directory containing xkbcomp program (default:
                              ${bindir})
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 0a6e772..dabebb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1424,7 +1424,7 @@ AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
 
 AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
 AC_ARG_WITH(xkb-bin-directory,
-				AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]),
+				AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: ${bindir})]),
 				[XKB_BIN_DIRECTORY="$withval"],
 				[XKB_BIN_DIRECTORY="$bindir"])
 


More information about the xorg-commit mailing list