xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 9 14:08:32 UTC 2021


 hw/xwayland/xwayland-glamor-eglstream.c |   53 +++-----------------------------
 1 file changed, 6 insertions(+), 47 deletions(-)

New commits:
commit 86e645bcfaea63bc3f91e4ccbbc19569929b92c3
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Jul 2 12:41:34 2021 +0200

    xwayland/eglstream: Drop xwl_eglstream_set_window_pixmap
    
    Not sure why we'd need to abandon a pending stream for a pixmap just
    because it's no longer a window pixmap. Let's try not to.
    
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
index ddd7bba6a..b678eaa10 100644
--- a/hw/xwayland/xwayland-glamor-eglstream.c
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
@@ -60,8 +60,6 @@ struct xwl_eglstream_private {
 
     EGLConfig config;
 
-    SetWindowPixmapProcPtr SetWindowPixmap;
-
     Bool have_egl_damage;
     Bool have_egl_stream_flush;
 
@@ -327,31 +325,6 @@ xwl_glamor_eglstream_get_wl_buffer_for_pixmap(PixmapPtr pixmap)
     return xwl_pixmap->buffer;
 }
 
-static void
-xwl_eglstream_set_window_pixmap(WindowPtr window, PixmapPtr pixmap)
-{
-    ScreenPtr screen = window->drawable.pScreen;
-    struct xwl_screen *xwl_screen = xwl_screen_get(screen);
-    struct xwl_eglstream_private *xwl_eglstream =
-        xwl_eglstream_get(xwl_screen);
-    PixmapPtr old_pixmap;
-
-    /* The pixmap for this window has changed.
-     * If that occurs while there is a stream pending, i.e. before the
-     * compositor has finished attaching the consumer for the window's
-     * pixmap's original eglstream, then a producer could no longer be
-     * attached, so the stream would be useless.
-     */
-    old_pixmap = (*screen->GetWindowPixmap) (window);
-    if (old_pixmap && old_pixmap != pixmap)
-        xwl_eglstream_destroy_pending_cb(old_pixmap);
-
-    xwl_screen->screen->SetWindowPixmap = xwl_eglstream->SetWindowPixmap;
-    (*xwl_screen->screen->SetWindowPixmap)(window, pixmap);
-    xwl_eglstream->SetWindowPixmap = xwl_screen->screen->SetWindowPixmap;
-    xwl_screen->screen->SetWindowPixmap = xwl_eglstream_set_window_pixmap;
-}
-
 static const char *
 xwl_eglstream_get_error_str(EGLint error)
 {
@@ -1100,16 +1073,11 @@ error:
 static Bool
 xwl_glamor_eglstream_init_screen(struct xwl_screen *xwl_screen)
 {
-    struct xwl_eglstream_private *xwl_eglstream =
-        xwl_eglstream_get(xwl_screen);
     ScreenPtr screen = xwl_screen->screen;
 
     /* We can just let glamor handle CreatePixmap */
     screen->DestroyPixmap = xwl_glamor_eglstream_destroy_pixmap;
 
-    xwl_eglstream->SetWindowPixmap = screen->SetWindowPixmap;
-    screen->SetWindowPixmap = xwl_eglstream_set_window_pixmap;
-
     return TRUE;
 }
 
commit ba8763c27b2ebc91850abfcaf32ae972e80142e7
Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Jul 2 12:57:21 2021 +0200

    xwayland/eglstream: Consolidate pending_cb destruction
    
    Into a new xwl_eglstream_destroy_pending_stream helper.
    
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
index eda781892..ddd7bba6a 100644
--- a/hw/xwayland/xwayland-glamor-eglstream.c
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
@@ -293,9 +293,11 @@ xwl_eglstream_destroy_pixmap_stream(struct xwl_pixmap *xwl_pixmap)
 }
 
 static void
-xwl_glamor_eglstream_remove_pending_stream(struct xwl_pixmap *xwl_pixmap)
+xwl_eglstream_destroy_pending_cb(PixmapPtr pixmap)
 {
-    if (xwl_pixmap->pending_cb) {
+    struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap);
+
+    if (xwl_pixmap && xwl_pixmap->pending_cb) {
         wl_callback_destroy(xwl_pixmap->pending_cb);
         xwl_pixmap->pending_cb = NULL;
     }
@@ -307,7 +309,7 @@ xwl_glamor_eglstream_destroy_pixmap(PixmapPtr pixmap)
     struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap);
 
     if (xwl_pixmap && pixmap->refcnt == 1) {
-        xwl_glamor_eglstream_remove_pending_stream(xwl_pixmap);
+        xwl_eglstream_destroy_pending_cb(pixmap);
         xwl_eglstream_destroy_pixmap_stream(xwl_pixmap);
         xwl_pixmap_del_buffer_release_cb(pixmap);
     }
@@ -325,16 +327,6 @@ xwl_glamor_eglstream_get_wl_buffer_for_pixmap(PixmapPtr pixmap)
     return xwl_pixmap->buffer;
 }
 
-static void
-xwl_eglstream_cancel_pending_stream(PixmapPtr pixmap)
-{
-    struct xwl_pixmap *xwl_pixmap;
-
-    xwl_pixmap = xwl_pixmap_get(pixmap);
-    if (xwl_pixmap)
-        xwl_glamor_eglstream_remove_pending_stream(xwl_pixmap);
-}
-
 static void
 xwl_eglstream_set_window_pixmap(WindowPtr window, PixmapPtr pixmap)
 {
@@ -352,7 +344,7 @@ xwl_eglstream_set_window_pixmap(WindowPtr window, PixmapPtr pixmap)
      */
     old_pixmap = (*screen->GetWindowPixmap) (window);
     if (old_pixmap && old_pixmap != pixmap)
-        xwl_eglstream_cancel_pending_stream(old_pixmap);
+        xwl_eglstream_destroy_pending_cb(old_pixmap);
 
     xwl_screen->screen->SetWindowPixmap = xwl_eglstream->SetWindowPixmap;
     (*xwl_screen->screen->SetWindowPixmap)(window, pixmap);
@@ -449,8 +441,7 @@ xwl_eglstream_consumer_ready_callback(void *data,
     struct xwl_eglstream_private *xwl_eglstream =
         xwl_eglstream_get(xwl_screen);
 
-    wl_callback_destroy(callback);
-    xwl_pixmap->pending_cb = NULL;
+    xwl_eglstream_destroy_pending_cb(pixmap);
 
     xwl_glamor_egl_make_current(xwl_screen);
 


More information about the xorg-commit mailing list