xserver: Branch 'master' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Thu Feb 25 15:28:28 UTC 2016


 present/present.c |   65 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 26 deletions(-)

New commits:
commit b4ac7b142fa3c536e9b283cfd34b94d82c03aac6
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Feb 24 16:52:59 2016 +0900

    present: Only requeue if target MSC is not reached after an unflip
    
    While present_pixmap decrements target_msc by 1 for present_queue_vblank,
    it leaves the original vblank->target_msc intact. So incrementing the
    latter for requeueing resulted in the requeued presentation being
    executed too late.
    
    Also, no need to requeue if the target MSC is already reached.
    
    This further reduces stutter when a popup menu appears on top of a
    flipping fullscreen window.
    
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

diff --git a/present/present.c b/present/present.c
index 7f9fc17..62865be 100644
--- a/present/present.c
+++ b/present/present.c
@@ -582,10 +582,8 @@ present_check_flip_window (WindowPtr window)
     xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
         if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, vblank->sync_flip, NULL, 0, 0)) {
             vblank->flip = FALSE;
-            if (vblank->sync_flip) {
+            if (vblank->sync_flip)
                 vblank->requeue = TRUE;
-                vblank->target_msc++;
-            }
         }
     }
 }
@@ -622,7 +620,8 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 
     if (vblank->requeue) {
         vblank->requeue = FALSE;
-        if (Success == present_queue_vblank(screen,
+        if (msc_is_after(vblank->target_msc, crtc_msc) &&
+            Success == present_queue_vblank(screen,
                                             vblank->crtc,
                                             vblank->event_id,
                                             vblank->target_msc))
commit e7a35b9e16aa12970908f5d55371bb1b862f8f24
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Feb 24 16:52:58 2016 +0900

    present: Requeue if flip driver hook fails and target MSC not reached
    
    For flipping, we wait for the MSC before the target MSC and then call
    the driver flip hook. If the latter fails, we have to wait for the
    target MSC before falling back to a copy, or else it's executed too
    early.
    
    Fixes glxgears running at unbounded framerate (not synchronized to the
    refresh rate) in fullscreen if the driver flip hook fails.
    
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

diff --git a/present/present.c b/present/present.c
index 17ec526..7f9fc17 100644
--- a/present/present.c
+++ b/present/present.c
@@ -712,6 +712,20 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
             if (window == screen_priv->flip_window)
                 present_unflip(screen);
         }
+
+        /* If present_flip failed, we may have to requeue for the target MSC */
+        if (msc_is_after(vblank->target_msc, crtc_msc) &&
+            Success == present_queue_vblank(screen,
+                                            vblank->crtc,
+                                            vblank->event_id,
+                                            vblank->target_msc)) {
+            xorg_list_add(&vblank->event_queue, &present_exec_queue);
+            xorg_list_append(&vblank->window_list,
+                             &present_get_window_priv(window, TRUE)->vblank);
+            vblank->queued = TRUE;
+            return;
+        }
+
         present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off);
 
         /* present_copy_region sticks the region into a scratch GC,
commit 1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Feb 24 16:52:57 2016 +0900

    present: Move msc_is_(equal_or_)after to the top of present.c
    
    To make them usable from any other function in the file. No functional
    change.
    
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
    Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

diff --git a/present/present.c b/present/present.c
index 8cf3b6f..17ec526 100644
--- a/present/present.c
+++ b/present/present.c
@@ -46,6 +46,28 @@ static void
 present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
 
 /*
+ * Returns:
+ * TRUE if the first MSC value is after the second one
+ * FALSE if the first MSC value is equal to or before the second one
+ */
+static Bool
+msc_is_after(uint64_t test, uint64_t reference)
+{
+    return (int64_t)(test - reference) > 0;
+}
+
+/*
+ * Returns:
+ * TRUE if the first MSC value is equal to or after the second one
+ * FALSE if the first MSC value is before the second one
+ */
+static Bool
+msc_is_equal_or_after(uint64_t test, uint64_t reference)
+{
+    return (int64_t)(test - reference) >= 0;
+}
+
+/*
  * Copies the update region from a pixmap to the target drawable
  */
 static void
@@ -717,28 +739,6 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     present_vblank_destroy(vblank);
 }
 
-/*
- * Returns:
- * TRUE if the first MSC value is after the second one
- * FALSE if the first MSC value is equal to or before the second one
- */
-static Bool
-msc_is_after(uint64_t test, uint64_t reference)
-{
-    return (int64_t)(test - reference) > 0;
-}
-
-/*
- * Returns:
- * TRUE if the first MSC value is equal to or after the second one
- * FALSE if the first MSC value is before the second one
- */
-static Bool
-msc_is_equal_or_after(uint64_t test, uint64_t reference)
-{
-    return (int64_t)(test - reference) >= 0;
-}
-
 int
 present_pixmap(WindowPtr window,
                PixmapPtr pixmap,


More information about the xorg-commit mailing list