xserver: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Mon Jun 11 16:35:24 UTC 2018


 hw/xwayland/xwayland-present.c |    7 +++----
 present/present_wnmd.c         |    4 ++++
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 1993f147d08170f07a72e43f0a0f27687e16967b
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Fri Jun 8 16:23:44 2018 +0200

    xwayland: use pixmap size on present flip
    
    If the pixmap size does not match the present box size, flickering
    occurs.
    
    This can happen when the client changes its size (e.g. switching to
    fullscreen), and since the buffer is kept as long as the pixmap is
    valid, once the buffer is created, it remains at the wrong (old) size
    and causes continuous flickering.
    
    Use the actual pixmap's drawable size instead of the present box to
    create the buffer so that it's sized appropriately.
    
    Bugzilla: https://bugs.freedesktop.org/106841
    Fixes: 0fb2cca193e6 "xwayland: Preliminary support for Present's new
                         window flip mode"
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
    Reviewed-by: Roman Gilg <subdiff at gmail.com>

diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index b5ae80dcf..c043da1d5 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -440,7 +440,7 @@ xwl_present_flip(WindowPtr present_window,
 {
     struct xwl_window           *xwl_window = xwl_window_from_window(present_window);
     struct xwl_present_window   *xwl_present_window = xwl_present_window_priv(present_window);
-    BoxPtr                      present_box, damage_box;
+    BoxPtr                      damage_box;
     Bool                        buffer_created;
     struct wl_buffer            *buffer;
     struct xwl_present_event    *event;
@@ -448,7 +448,6 @@ xwl_present_flip(WindowPtr present_window,
     if (!xwl_window)
         return FALSE;
 
-    present_box = RegionExtents(&present_window->winSize);
     damage_box = RegionExtents(damage);
 
     event = malloc(sizeof *event);
@@ -458,8 +457,8 @@ xwl_present_flip(WindowPtr present_window,
     xwl_window->present_window = present_window;
 
     buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap,
-                                             present_box->x2 - present_box->x1,
-                                             present_box->y2 - present_box->y1,
+                                             pixmap->drawable.width,
+                                             pixmap->drawable.height,
                                              &buffer_created);
 
     event->event_id = event_id;
commit 10eec2ccb11701fe29ab246acd6c0bdc2991b775
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jun 7 17:55:21 2018 +0200

    present/wnmd: Preserve window pixmap's screen_x/y on flip
    
    The incorrect values could result in the new pixmap's contents
    getting corrupted down the line.
    
    v2:
    * Guard screen_x/y lines by #ifdef COMPOSITE
    
    Bugzilla: https://bugs.freedesktop.org/106841
    Fixes: 029608dd8020 "present: Add window flip mode"
    Reviewed-by: Adam Jackson <ajax at redhat.com> # v1
    Reviewed-by: Keith Packard <keithp at keithp.com> # v1
    Reviewed-by: Roman Gilg <subdiff at gmail.com>
    Tested-by: Olivier Fourdan <ofourdan at redhat.com> # v1

diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 80ffb014e..035ae8ffe 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -469,6 +469,10 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
                 PixmapPtr old_pixmap = screen->GetWindowPixmap(window);
 
                 /* Replace window pixmap with flip pixmap */
+#ifdef COMPOSITE
+                vblank->pixmap->screen_x = old_pixmap->screen_x;
+                vblank->pixmap->screen_y = old_pixmap->screen_y;
+#endif
                 present_set_tree_pixmap(toplvl_window, old_pixmap, vblank->pixmap);
                 vblank->pixmap->refcnt++;
                 dixDestroyPixmap(old_pixmap, old_pixmap->drawable.id);


More information about the xorg-commit mailing list