xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 11 10:03:13 UTC 2021


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

New commits:
commit 4f6fbd5009ae533cf0b3bbe382502254f9276a01
Author: Erik Kurzinger <ekurzinger at nvidia.com>
Date:   Tue Apr 27 07:23:44 2021 -0400

    xwayland-eglstream: fix X11 rendering to flipping GL / VK window
    
    If a window is being used for direct rendering with OpenGL or Vulkan, and is
    using the flipping path for presentation, it's pixmap will be set to a dma-buf
    backed pixmap created by the client-side GL driver. However, this means that
    xwl_glamor_eglstream_post_damage won't work since it requires that the pixmap
    has an EGLSurface that it can render to, which dma-buf backed pixmaps do not.
    
    In this case, though, xwl_glamor_eglstream_post_damage is not necessary since
    glamor will have rendered directly to the pixmap, so we can simply pass it
    directly to the compositor. There's no need for the intermediate copy we
    normally do in that function.
    
    Therefore, this change adds an early-return case to post_damage for dma-buf
    backed pixmaps, and removes the corresponding asserts from that function and
    allow_commits.
    
    Signed-off-by: Erik Kurzinger <ekurzinger at nvidia.com>
    Acked-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
index 2d8380e1f..17295f3bd 100644
--- a/hw/xwayland/xwayland-glamor-eglstream.c
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
@@ -576,7 +576,6 @@ xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window)
     struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap);
 
     if (xwl_pixmap) {
-        assert(xwl_pixmap->type == XWL_PIXMAP_EGLSTREAM);
         if (pending) {
             /* Wait for the compositor to finish connecting the consumer for
              * this eglstream */
@@ -615,7 +614,12 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
     };
     GLint saved_vao;
 
-    assert(xwl_pixmap->type == XWL_PIXMAP_EGLSTREAM);
+    if (xwl_pixmap->type != XWL_PIXMAP_EGLSTREAM)
+        /* This can happen if a client does X11 rendering on a
+         * flipping OpenGL or Vulkan window. In that case, we don't
+         * need to do the copy below.
+         */
+        return;
 
     /* Unbind the framebuffer BEFORE binding the EGLSurface, otherwise we
      * won't actually draw to it


More information about the xorg-commit mailing list