xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 11 15:23:35 UTC 2020


 hw/xwayland/xwayland-glamor-gbm.c |   10 ----------
 hw/xwayland/xwayland-glamor.c     |    3 ++-
 hw/xwayland/xwayland-glamor.h     |    6 ++++--
 hw/xwayland/xwayland-screen.c     |   25 +++++++++++++++++++++++++
 hw/xwayland/xwayland-window.c     |    3 ---
 5 files changed, 31 insertions(+), 16 deletions(-)

New commits:
commit a542224ea28e2e8ccaf5e0df85bf6c603e97599a
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Feb 7 12:15:07 2020 +0100

    xwayland: Call glamor_block_handler from xwl_screen_post_damage
    
    In between the two phases introduced by the previous change. This makes
    sure all pending drawing to the new buffers is flushed before they're
    committed to the Wayland server.

diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index 428f176d5..74f27d345 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -29,6 +29,10 @@
 #include <unistd.h>
 #include <errno.h>
 
+#ifdef XWL_HAS_GLAMOR
+#include <glamor.h>
+#endif
+
 #include <X11/Xatom.h>
 #include <micmap.h>
 #include <misyncshm.h>
@@ -300,6 +304,13 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
     if (xorg_list_is_empty(&commit_window_list))
         return;
 
+#ifdef XWL_HAS_GLAMOR
+    if (xwl_screen->glamor &&
+        xwl_screen->egl_backend == &xwl_screen->gbm_backend) {
+        glamor_block_handler(xwl_screen->screen);
+    }
+#endif
+
     xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
                                   &commit_window_list, link_damage) {
         wl_surface_commit(xwl_window->surface);
commit f88d9b1f779835302e02e255fcd45989db7f488d
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Feb 7 12:06:39 2020 +0100

    xwayland: Split up xwl_screen_post_damage into two phases
    
    The first phase sets the new surface properties for all damaged
    windows, then the second phase commits all surface updates.
    
    This is preparatory for the next change, there should be no observable
    change in behaviour (other than the order of Wayland protocol
    requests).
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index b84252306..428f176d5 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -273,6 +273,9 @@ static void
 xwl_screen_post_damage(struct xwl_screen *xwl_screen)
 {
     struct xwl_window *xwl_window, *next_xwl_window;
+    struct xorg_list commit_window_list;
+
+    xorg_list_init(&commit_window_list);
 
     xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
                                   &xwl_screen->damage_window_list, link_damage) {
@@ -290,6 +293,17 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
 #endif
 
         xwl_window_post_damage(xwl_window);
+        xorg_list_del(&xwl_window->link_damage);
+        xorg_list_append(&xwl_window->link_damage, &commit_window_list);
+    }
+
+    if (xorg_list_is_empty(&commit_window_list))
+        return;
+
+    xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
+                                  &commit_window_list, link_damage) {
+        wl_surface_commit(xwl_window->surface);
+        xorg_list_del(&xwl_window->link_damage);
     }
 }
 
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index a9128fb3d..dc12b8e21 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -808,10 +808,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
     }
 
     xwl_window_create_frame_callback(xwl_window);
-    wl_surface_commit(xwl_window->surface);
     DamageEmpty(window_get_damage(xwl_window->window));
-
-    xorg_list_del(&xwl_window->link_damage);
 }
 
 Bool
commit 7b33c2d3f31fe03f88cc26f08590f2baf1a6ef36
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Thu Feb 6 18:45:19 2020 +0100

    Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook"
    
    This reverts commit 9e85aa9c1fbf51ef00674e3a91aded4083a14a15.
    
    To be replaced with a better solution.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 17682a172..80655fd16 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -49,7 +49,6 @@
 #include "xwayland-glamor.h"
 #include "xwayland-pixmap.h"
 #include "xwayland-screen.h"
-#include "xwayland-window.h"
 
 #include "linux-dmabuf-unstable-v1-client-protocol.h"
 
@@ -920,14 +919,6 @@ xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen)
     return TRUE;
 }
 
-static void
-xwl_glamor_gbm_post_damage(struct xwl_window *xwl_window, PixmapPtr pixmap,
-                           RegionPtr region)
-{
-    /* Make sure any pending drawing to the pixmap is flushed to the kernel */
-    glamor_block_handler(xwl_window->xwl_screen->screen);
-}
-
 static Bool
 xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
 {
@@ -1120,6 +1111,5 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen)
     xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl;
     xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen;
     xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap;
-    xwl_screen->gbm_backend.post_damage = xwl_glamor_gbm_post_damage;
     xwl_screen->gbm_backend.is_available = TRUE;
 }
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index f3327f4ee..d9523b0a7 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -124,7 +124,8 @@ xwl_glamor_post_damage(struct xwl_window *xwl_window,
 {
     struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
 
-    xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
+    if (xwl_screen->egl_backend->post_damage)
+        xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
 }
 
 Bool
diff --git a/hw/xwayland/xwayland-glamor.h b/hw/xwayland/xwayland-glamor.h
index 138accd6d..e9896bfef 100644
--- a/hw/xwayland/xwayland-glamor.h
+++ b/hw/xwayland/xwayland-glamor.h
@@ -70,8 +70,10 @@ struct xwl_egl_backend {
                                                   Bool *created);
 
     /* Called by Xwayland to perform any pre-wl_surface damage routines
-     * that are required by the backend to make sure any pending drawing
-     * operations to the pixmap will be visible to the Wayland server.
+     * that are required by the backend. If your backend is poorly
+     * designed and lacks the ability to render directly to a surface,
+     * you should implement blitting from the glamor pixmap to the wayland
+     * pixmap here. Otherwise, this callback is optional.
      */
     void (*post_damage)(struct xwl_window *xwl_window,
                         PixmapPtr pixmap, RegionPtr region);


More information about the xorg-commit mailing list