xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 13:52:04 UTC 2020


 hw/xwayland/xwayland-pixmap.c         |    6 +++---
 hw/xwayland/xwayland-pixmap.h         |    4 ++--
 hw/xwayland/xwayland-present.c        |   31 +++++++++++++++++--------------
 hw/xwayland/xwayland-present.h        |    1 -
 hw/xwayland/xwayland-screen.c         |   10 ++++++++++
 hw/xwayland/xwayland-window-buffers.c |    2 +-
 hw/xwayland/xwayland-window.c         |   10 ----------
 7 files changed, 33 insertions(+), 31 deletions(-)

New commits:
commit 2beefda5a80e5a016c32c1da733f9415a121179d
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Mar 17 12:55:34 2020 +0100

    xwayland: Move xwl_surface_damage definition to xwayland-screen.c
    
    It was already declared in xwayland-screen.h, and only takes a screen
    parameter, no window ones.
    
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index 18d8968c7..d248a3901 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -513,6 +513,16 @@ xwl_sync_events (struct xwl_screen *xwl_screen)
     xwl_read_events (xwl_screen);
 }
 
+void xwl_surface_damage(struct xwl_screen *xwl_screen,
+                        struct wl_surface *surface,
+                        int32_t x, int32_t y, int32_t width, int32_t height)
+{
+    if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
+        wl_surface_damage_buffer(surface, x, y, width, height);
+    else
+        wl_surface_damage(surface, x, y, width, height);
+}
+
 void
 xwl_screen_roundtrip(struct xwl_screen *xwl_screen)
 {
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index 7c5cfb015..23d2b3086 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -783,16 +783,6 @@ xwl_destroy_window(WindowPtr window)
     return ret;
 }
 
-void xwl_surface_damage(struct xwl_screen *xwl_screen,
-                        struct wl_surface *surface,
-                        int32_t x, int32_t y, int32_t width, int32_t height)
-{
-    if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
-        wl_surface_damage_buffer(surface, x, y, width, height);
-    else
-        wl_surface_damage(surface, x, y, width, height);
-}
-
 void
 xwl_window_post_damage(struct xwl_window *xwl_window)
 {
commit 12af425acd3f4a3a8aa85352857b130b0006b83c
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Thu Jun 25 17:56:41 2020 +0200

    xwayland: Rename xwl_pixmap_cb → xwl_buffer_release_cb
    
    Seems clearer.
    
    While we're at it, also drop the unused pixmap parameter.
    
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-pixmap.c b/hw/xwayland/xwayland-pixmap.c
index fef6fa4cf..6e797a34c 100644
--- a/hw/xwayland/xwayland-pixmap.c
+++ b/hw/xwayland/xwayland-pixmap.c
@@ -41,7 +41,7 @@ static DevPrivateKeyRec xwl_pixmap_private_key;
 static DevPrivateKeyRec xwl_pixmap_cb_private_key;
 
 struct xwl_pixmap_buffer_release_callback {
-    xwl_pixmap_cb callback;
+    xwl_buffer_release_cb callback;
     void *data;
 };
 
@@ -59,7 +59,7 @@ xwl_pixmap_get(PixmapPtr pixmap)
 
 Bool
 xwl_pixmap_set_buffer_release_cb(PixmapPtr pixmap,
-                                 xwl_pixmap_cb func, void *data)
+                                 xwl_buffer_release_cb func, void *data)
 {
     struct xwl_pixmap_buffer_release_callback *xwl_pixmap_buffer_release_callback;
 
@@ -107,7 +107,7 @@ xwl_pixmap_buffer_release_cb(void *data, struct wl_buffer *wl_buffer)
                                                           &xwl_pixmap_cb_private_key);
     if (xwl_pixmap_buffer_release_callback)
         (*xwl_pixmap_buffer_release_callback->callback)
-            (pixmap, xwl_pixmap_buffer_release_callback->data);
+            (xwl_pixmap_buffer_release_callback->data);
 }
 
 Bool
diff --git a/hw/xwayland/xwayland-pixmap.h b/hw/xwayland/xwayland-pixmap.h
index 9b926b507..06ee4898a 100644
--- a/hw/xwayland/xwayland-pixmap.h
+++ b/hw/xwayland/xwayland-pixmap.h
@@ -34,12 +34,12 @@
 /* This is an opaque structure implemented in the different backends */
 struct xwl_pixmap;
 
-typedef void (*xwl_pixmap_cb) (PixmapPtr pixmap, void *data);
+typedef void (*xwl_buffer_release_cb) (void *data);
 
 void xwl_pixmap_set_private(PixmapPtr pixmap, struct xwl_pixmap *xwl_pixmap);
 struct xwl_pixmap *xwl_pixmap_get(PixmapPtr pixmap);
 Bool xwl_pixmap_set_buffer_release_cb(PixmapPtr pixmap,
-                                      xwl_pixmap_cb func, void *data);
+                                      xwl_buffer_release_cb func, void *data);
 void xwl_pixmap_del_buffer_release_cb(PixmapPtr pixmap);
 void xwl_pixmap_buffer_release_cb(void *data, struct wl_buffer *wl_buffer);
 Bool xwl_pixmap_init(void);
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 4db068109..a5326d916 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -176,7 +176,7 @@ xwl_present_cleanup(WindowPtr window)
 }
 
 static void
-xwl_present_buffer_release(PixmapPtr pixmap, void *data)
+xwl_present_buffer_release(void *data)
 {
     struct xwl_present_event *event = data;
 
diff --git a/hw/xwayland/xwayland-window-buffers.c b/hw/xwayland/xwayland-window-buffers.c
index ff9ed57db..d1ae8774f 100644
--- a/hw/xwayland/xwayland-window-buffers.c
+++ b/hw/xwayland/xwayland-window-buffers.c
@@ -181,7 +181,7 @@ xwl_window_buffer_timer_callback(OsTimerPtr timer, CARD32 time, void *arg)
 }
 
 static void
-xwl_window_buffer_release_callback(PixmapPtr pixmap, void *data)
+xwl_window_buffer_release_callback(void *data)
 {
     struct xwl_window_buffer *xwl_window_buffer = data;
     struct xwl_window *xwl_window = xwl_window_buffer->xwl_window;
commit 9eb0b4f731e21952f93e168900f10bf07e261107
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Thu Jun 25 17:49:27 2020 +0200

    xwayland: Remove xwl_present_event::buffer_released in favor of ::pixmap
    
    No need for the separate boolean.
    
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 06f7f54ed..4db068109 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -118,18 +118,23 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
 }
 
 static void
-xwl_present_free_event(struct xwl_present_event *event)
+xwl_present_release_pixmap(struct xwl_present_event *event)
 {
-    if (!event)
+    if (!event->pixmap)
         return;
 
-    if (event->pixmap) {
-        if (!event->buffer_released)
-            xwl_pixmap_del_buffer_release_cb(event->pixmap);
+    xwl_pixmap_del_buffer_release_cb(event->pixmap);
+    dixDestroyPixmap(event->pixmap, event->pixmap->drawable.id);
+    event->pixmap = NULL;
+}
 
-        dixDestroyPixmap(event->pixmap, event->pixmap->drawable.id);
-    }
+static void
+xwl_present_free_event(struct xwl_present_event *event)
+{
+    if (!event)
+        return;
 
+    xwl_present_release_pixmap(event);
     xorg_list_del(&event->list);
     free(event);
 }
@@ -178,8 +183,7 @@ xwl_present_buffer_release(PixmapPtr pixmap, void *data)
     if (!event)
         return;
 
-    xwl_pixmap_del_buffer_release_cb(pixmap);
-    event->buffer_released = TRUE;
+    xwl_present_release_pixmap(event);
 
     if (event->abort) {
         if (!event->pending)
@@ -212,7 +216,7 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window)
         present_wnmd_event_notify(xwl_present_window->window, event->event_id,
                                   xwl_present_window->ust, msc);
 
-        if (event->buffer_released) {
+        if (!event->pixmap) {
             /* If the buffer was already released, clean up now */
             present_wnmd_event_notify(xwl_present_window->window, event->event_id,
                                       xwl_present_window->ust, msc);
@@ -281,7 +285,7 @@ xwl_present_sync_callback(void *data,
 
     if (event->abort) {
         /* Event might have been aborted */
-        if (event->buffer_released)
+        if (!event->pixmap)
             /* Buffer was already released, cleanup now */
             xwl_present_free_event(event);
         return;
@@ -292,7 +296,7 @@ xwl_present_sync_callback(void *data,
                               xwl_present_window->ust,
                               xwl_present_window->msc);
 
-    if (event->buffer_released) {
+    if (!event->pixmap) {
         /* If the buffer was already released, send the event now again */
         present_wnmd_event_notify(xwl_present_window->window,
                                   event->event_id,
@@ -468,7 +472,6 @@ xwl_present_flip(WindowPtr present_window,
     event->target_msc = target_msc;
     event->pending = TRUE;
     event->abort = FALSE;
-    event->buffer_released = FALSE;
 
     if (sync_flip) {
         xorg_list_init(&event->list);
diff --git a/hw/xwayland/xwayland-present.h b/hw/xwayland/xwayland-present.h
index a3de1a523..5a7cb3607 100644
--- a/hw/xwayland/xwayland-present.h
+++ b/hw/xwayland/xwayland-present.h
@@ -56,7 +56,6 @@ struct xwl_present_event {
 
     Bool abort;
     Bool pending;
-    Bool buffer_released;
 
     struct xwl_present_window *xwl_present_window;
     PixmapPtr pixmap;


More information about the xorg-commit mailing list