Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xwayland for openSUSE:Factory 
checked in at 2021-11-10 21:45:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xwayland (Old)
 and      /work/SRC/openSUSE:Factory/.xwayland.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xwayland"

Wed Nov 10 21:45:59 2021 rev:7 rq:930159 version:21.1.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/xwayland/xwayland.changes        2021-10-11 
16:48:36.462166966 +0200
+++ /work/SRC/openSUSE:Factory/.xwayland.new.1890/xwayland.changes      
2021-11-10 21:46:05.263802028 +0100
@@ -1,0 +2,8 @@
+Mon Nov  8 11:45:16 UTC 2021 - Stefan Dirsch <[email protected]>
+
+- Update to version 21.1.3
+  * Most notable change is a fix for the GBM backend to work with
+    the Nvidia driver series 495.
+- supersedes U_glamor-Fix-handling-of-1-bit-pixmaps.patch
+
+-------------------------------------------------------------------

Old:
----
  U_glamor-Fix-handling-of-1-bit-pixmaps.patch
  xwayland-21.1.2.tar.xz
  xwayland-21.1.2.tar.xz.sig

New:
----
  xwayland-21.1.3.tar.xz
  xwayland-21.1.3.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xwayland.spec ++++++
--- /var/tmp/diff_new_pack.yqMhzN/_old  2021-11-10 21:46:06.459802549 +0100
+++ /var/tmp/diff_new_pack.yqMhzN/_new  2021-11-10 21:46:06.459802549 +0100
@@ -24,7 +24,7 @@
 %endif
 
 Name:           xwayland
-Version:        21.1.2
+Version:        21.1.3
 Release:        0
 URL:            http://xorg.freedesktop.org/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -34,7 +34,6 @@
 Group:          System/X11/Servers/XF86_4
 Source0:        %{name}-%{version}.tar.xz
 Source1:        %{name}-%{version}.tar.xz.sig
-Patch0:         U_glamor-Fix-handling-of-1-bit-pixmaps.patch
 BuildRequires:  meson
 BuildRequires:  ninja
 BuildRequires:  pkgconfig
@@ -132,7 +131,6 @@
 
 %prep
 %setup -q -n %{name}-%{version}
-%patch0 -p1
 
 %build
 %define _lto_cflags %{nil}

++++++ xwayland-21.1.2.tar.xz -> xwayland-21.1.3.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/.gitlab-ci/debian-install.sh 
new/xwayland-21.1.3/.gitlab-ci/debian-install.sh
--- old/xwayland-21.1.2/.gitlab-ci/debian-install.sh    1970-01-01 
01:00:00.000000000 +0100
+++ new/xwayland-21.1.3/.gitlab-ci/debian-install.sh    2021-11-08 
11:37:14.821922000 +0100
@@ -0,0 +1,166 @@
+#!/bin/bash
+
+set -e
+set -o xtrace
+
+# Packages which are needed by this script, but not for the xserver build
+EPHEMERAL="
+       libcairo2-dev
+       libevdev-dev
+       libexpat-dev
+       libgles2-mesa-dev
+       libinput-dev
+       libxkbcommon-dev
+       x11-utils
+       x11-xserver-utils
+       xauth
+       xvfb
+       "
+
+apt-get install -y \
+       $EPHEMERAL \
+       autoconf \
+       automake \
+       bison \
+       build-essential \
+       ca-certificates \
+       ccache \
+       flex \
+       git \
+       libaudit-dev \
+       libbsd-dev \
+       libcairo2 \
+       libdbus-1-dev \
+       libdmx-dev \
+       libdrm-dev \
+       libegl1-mesa-dev \
+       libepoxy-dev \
+       libevdev2 \
+       libexpat1 \
+       libffi-dev \
+       libgbm-dev \
+       libgcrypt-dev \
+       libgl1-mesa-dev \
+       libgles2 \
+       libglx-mesa0 \
+       libinput10 \
+       libnvidia-egl-wayland-dev \
+       libpciaccess-dev \
+       libpixman-1-dev \
+       libselinux1-dev \
+       libsystemd-dev \
+       libtool \
+       libudev-dev \
+       libunwind-dev \
+       libx11-dev \
+       libx11-xcb-dev \
+       libxau-dev \
+       libxaw7-dev \
+       libxcb-glx0-dev \
+       libxcb-icccm4-dev \
+       libxcb-image0-dev \
+       libxcb-keysyms1-dev \
+       libxcb-randr0-dev \
+       libxcb-render-util0-dev \
+       libxcb-render0-dev \
+       libxcb-shape0-dev \
+       libxcb-shm0-dev \
+       libxcb-util0-dev \
+       libxcb-xf86dri0-dev \
+       libxcb-xkb-dev \
+       libxcb-xv0-dev \
+       libxcb1-dev \
+       libxdmcp-dev \
+       libxext-dev \
+       libxfixes-dev \
+       libxfont-dev \
+       libxi-dev \
+       libxinerama-dev \
+       libxkbcommon0 \
+       libxkbfile-dev \
+       libxmu-dev \
+       libxmuu-dev \
+       libxpm-dev \
+       libxrender-dev \
+       libxres-dev \
+       libxshmfence-dev \
+       libxt-dev \
+       libxtst-dev \
+       libxv-dev \
+       mesa-common-dev \
+       meson \
+       nettle-dev \
+       pkg-config \
+       python3-mako \
+       python3-numpy \
+       python3-six \
+       x11proto-dev \
+       xfonts-utils \
+       xkb-data \
+       xtrans-dev \
+       xutils-dev
+
+cd /root
+
+# weston 9.0 requires libwayland >= 1.18
+git clone https://gitlab.freedesktop.org/wayland/wayland.git --depth 1 
--branch=1.18.0
+cd wayland
+meson _build -D{documentation,dtd_validation}=false
+ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf wayland
+
+# Xwayland requires wayland-protocols >= 1.18, but Debian buster has 1.17 only
+git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 
1 --branch=1.18
+cd wayland-protocols
+./autogen.sh
+make -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf wayland-protocols
+
+# Xwayland requires weston > 5.0, but Debian buster has 5.0 only
+git clone https://gitlab.freedesktop.org/wayland/weston.git --depth 1 
--branch=9.0
+cd weston
+meson _build -Dbackend-{drm,drm-screencast-vaapi,fbdev,rdp,wayland,x11}=false \
+      -Dbackend-default=headless -Dcolor-management-{colord,lcms}=false \
+      -Ddemo-clients=false -Dimage-{jpeg,webp}=false \
+      
-D{pipewire,remoting,screenshare,test-junit-xml,wcap-decode,weston-launch,xwayland}=false
 \
+      -Dshell-{fullscreen,ivi,kiosk}=false -Dsimple-clients=
+ninja -C _build -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf weston
+
+git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1
+
+git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1
+cd xts
+./autogen.sh
+xvfb-run make -j${FDO_CI_CONCURRENT:-4}
+cd ..
+
+git clone https://gitlab.freedesktop.org/xorg/test/rendercheck --depth 1
+cd rendercheck
+meson build
+ninja -j${FDO_CI_CONCURRENT:-4} -C build install
+cd ..
+
+rm -rf piglit/.git xts/.git piglit/tests/spec/ rendercheck/
+
+echo '[xts]' > piglit/piglit.conf
+echo 'path=/root/xts' >> piglit/piglit.conf
+
+find -name \*.a -o -name \*.o -o -name \*.c -o -name \*.h -o -name \*.la\* | 
xargs rm
+strip xts/xts5/*/.libs/*
+
+# Running meson dist requires xkbcomp 1.4.1 or newer, but Debian buster has 
1.4.0 only
+git clone https://gitlab.freedesktop.org/xorg/app/xkbcomp.git --depth 1 
--branch=xkbcomp-1.4.1
+cd xkbcomp
+./autogen.sh --datarootdir=/usr/share
+make -j${FDO_CI_CONCURRENT:-4} install
+cd ..
+rm -rf xkbcomp
+
+apt-get purge -y \
+       $EPHEMERAL
+
+apt-get autoremove -y --purge
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/.gitlab-ci/manpages-check 
new/xwayland-21.1.3/.gitlab-ci/manpages-check
--- old/xwayland-21.1.2/.gitlab-ci/manpages-check       1970-01-01 
01:00:00.000000000 +0100
+++ new/xwayland-21.1.3/.gitlab-ci/manpages-check       2021-11-08 
11:37:14.822922000 +0100
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+find build/ -regex ".*\.[1-9]$" -exec grep -E \
+@vendorversion@\|\
+@xorgversion@\|\
+@xservername@\|\
+@xconfigfile@\|\
+@projectroot@\|\
+@apploaddir@\|\
+@appmansuffix@\|\
+@drivermansuffix@\|\
+@adminmansuffix@\|\
+@libmansuffix@\|\
+@miscmansuffix@\|\
+@filemansuffix@\|\
+@logdir@\|\
+@datadir@\|\
+@mandir@\|\
+@sysconfdir@\|\
+@xconfigdir@\|\
+@xkbdir@\|\
+@XKB_DFLT_RULES@\|\
+@XKB_DFLT_MODEL@\|\
+@XKB_DFLT_LAYOUT@\|\
+@XKB_DFLT_VARIANT@\|\
+@XKB_DFLT_OPTIONS@\|\
+@bundle_id_prefix@\|\
+@modulepath@\|\
+@suid_wrapper_dir@\|\
+@default_font_path@\
+ '{}' + && { echo "Missing manpage substitutions detected!" >&2 ; exit 1; }
+
+exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/.gitlab-ci.yml 
new/xwayland-21.1.3/.gitlab-ci.yml
--- old/xwayland-21.1.2/.gitlab-ci.yml  1970-01-01 01:00:00.000000000 +0100
+++ new/xwayland-21.1.3/.gitlab-ci.yml  2021-11-08 11:37:14.821922000 +0100
@@ -0,0 +1,74 @@
+# FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs.
+# If the image doesn't exist yet, the docker-image stage generates it.
+#
+# In order to generate a new image, one should generally change the tag.
+# While removing the image from the registry would also work, that's not
+# recommended except for ephemeral images during development: Replacing an
+# image after a significant amount of time might pull in newer versions of
+# gcc/clang or other packages, which might break the build with older commits
+# using the same tag.
+variables:
+    UPSTREAM_REPO: xorg/xserver
+    FDO_DISTRIBUTION_VERSION: buster-slim
+    FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash 
.gitlab-ci/debian-install.sh'
+    FDO_DISTRIBUTION_TAG: "2021-01-19-git"
+
+include:
+  - project: 'freedesktop/ci-templates'
+    ref: 4f06663cd1507136a0f8440925a2521098adb298
+    file: '/templates/debian.yml'
+
+stages:
+    - docker-image
+    - build-and-test
+
+.ci-run-policy:
+  # Retry jobs after runner system failures
+  retry:
+    max: 2
+    when:
+      - runner_system_failure
+  # Cancel CI run if a newer commit is pushed to the same branch
+  interruptible: true
+
+debian-buster:
+  extends:
+    - .fdo.container-build@debian
+    - .ci-run-policy
+  stage: docker-image
+  variables:
+    GIT_STRATEGY: none
+
+.common-build-and-test:
+    extends:
+        - .fdo.distribution-image@debian
+        - .ci-run-policy
+    stage: build-and-test
+    artifacts:
+        when: on_failure
+        paths:
+            - build/test/piglit-results/
+    variables:
+        CCACHE_COMPILERCHECK: content
+        CCACHE_DIR: /cache/xserver/cache
+        LC_ALL: C.UTF-8
+    before_script:
+        - export CCACHE_BASEDIR="$PWD"
+        - export PATH="/usr/lib/ccache:$PATH"
+        - ccache --show-stats
+    after_script:
+        - ccache --show-stats
+
+meson:
+    extends: .common-build-and-test
+    script:
+        - meson -Dc_args="-fno-common" -Dprefix=/usr -Dxvfb=false 
-Dwerror=true $MESON_EXTRA_OPTIONS build/
+        - ninja -j${FDO_CI_CONCURRENT:-4} -C build/ dist
+        - PIGLIT_DIR=/root/piglit XTEST_DIR=/root/xts ninja 
-j${FDO_CI_CONCURRENT:-4} -C build/ test
+        - .gitlab-ci/manpages-check
+
+meson-noglamor:
+    extends: meson
+    variables:
+        MESON_EXTRA_OPTIONS: >
+          -Dglamor=false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/glamor/glamor.c 
new/xwayland-21.1.3/glamor/glamor.c
--- old/xwayland-21.1.2/glamor/glamor.c 2021-07-09 12:27:07.344904700 +0200
+++ new/xwayland-21.1.3/glamor/glamor.c 2021-11-08 11:37:14.849922400 +0100
@@ -216,7 +216,7 @@
              w <= glamor_priv->glyph_max_dim &&
              h <= glamor_priv->glyph_max_dim)
          || (w == 0 && h == 0)
-         || !glamor_priv->formats[depth].format))
+         || !glamor_priv->formats[depth].rendering_supported))
         return fbCreatePixmap(screen, w, h, depth, usage);
     else
         pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
@@ -461,7 +461,8 @@
 
 static void
 glamor_add_format(ScreenPtr screen, int depth, CARD32 render_format,
-                  GLenum internalformat, GLenum format, GLenum type)
+                  GLenum internalformat, GLenum format, GLenum type,
+                  Bool rendering_supported)
 {
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
     struct glamor_format *f = &glamor_priv->formats[depth];
@@ -476,7 +477,7 @@
      * Note that we can't just create a pixmap because we're in
      * screeninit.
      */
-    if (glamor_priv->is_gles) {
+    if (rendering_supported && glamor_priv->is_gles) {
         unsigned fbo, tex;
         int read_format, read_type;
         GLenum status;
@@ -521,6 +522,7 @@
     f->internalformat = internalformat;
     f->format = format;
     f->type = type;
+    f->rendering_supported = rendering_supported;
 }
 
 /* Set up the GL format/types that glamor will use for the various depths
@@ -551,11 +553,15 @@
      * only falling back to a8 if we can't do them.
      */
     if (glamor_priv->is_gles || epoxy_has_gl_extension("GL_ARB_texture_rg")) {
+        glamor_add_format(screen, 1, PICT_a1,
+                          GL_R8, GL_RED, GL_UNSIGNED_BYTE, FALSE);
         glamor_add_format(screen, 8, PICT_a8,
-                          GL_R8, GL_RED, GL_UNSIGNED_BYTE);
+                          GL_R8, GL_RED, GL_UNSIGNED_BYTE, TRUE);
     } else {
+        glamor_add_format(screen, 1, PICT_a1,
+                          GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, FALSE);
         glamor_add_format(screen, 8, PICT_a8,
-                          GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE);
+                          GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, TRUE);
     }
 
     if (glamor_priv->is_gles) {
@@ -569,40 +575,41 @@
          * disable render accel for now.
          */
         glamor_add_format(screen, 15, PICT_x1r5g5b5,
-                          GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
+                          GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 
TRUE);
     } else {
         glamor_add_format(screen, 15, PICT_x1r5g5b5,
-                          GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
+                          GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 
TRUE);
     }
 
     glamor_add_format(screen, 16, PICT_r5g6b5,
-                      GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
+                      GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, TRUE);
 
     if (glamor_priv->is_gles) {
         assert(X_BYTE_ORDER == X_LITTLE_ENDIAN);
         glamor_add_format(screen, 24, PICT_x8b8g8r8,
-                          GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
+                          GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
         glamor_add_format(screen, 32, PICT_a8b8g8r8,
-                          GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
+                          GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
     } else {
         glamor_add_format(screen, 24, PICT_x8r8g8b8,
-                          GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
+                          GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, TRUE);
         glamor_add_format(screen, 32, PICT_a8r8g8b8,
-                          GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
+                          GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, TRUE);
     }
 
     if (glamor_priv->is_gles) {
         glamor_add_format(screen, 30, PICT_x2b10g10r10,
-                          GL_RGB10_A2, GL_RGBA, 
GL_UNSIGNED_INT_2_10_10_10_REV);
+                          GL_RGB10_A2, GL_RGBA, 
GL_UNSIGNED_INT_2_10_10_10_REV, TRUE);
     } else {
         glamor_add_format(screen, 30, PICT_x2r10g10b10,
-                          GL_RGB10_A2, GL_BGRA, 
GL_UNSIGNED_INT_2_10_10_10_REV);
+                          GL_RGB10_A2, GL_BGRA, 
GL_UNSIGNED_INT_2_10_10_10_REV, TRUE);
     }
 
     glamor_priv->cbcr_format.depth = 16;
     glamor_priv->cbcr_format.internalformat = GL_RG8;
     glamor_priv->cbcr_format.format = GL_RG;
     glamor_priv->cbcr_format.type = GL_UNSIGNED_BYTE;
+    glamor_priv->cbcr_format.rendering_supported = TRUE;
 }
 
 /** Set up glamor for an already-configured GL context. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/glamor/glamor_priv.h 
new/xwayland-21.1.3/glamor/glamor_priv.h
--- old/xwayland-21.1.2/glamor/glamor_priv.h    2021-07-09 12:27:07.347904700 
+0200
+++ new/xwayland-21.1.3/glamor/glamor_priv.h    2021-11-08 11:37:14.853922400 
+0100
@@ -170,6 +170,11 @@
      * transferred using format/type.
      */
     CARD32 render_format;
+    /**
+     * Whether rendering is supported in GL at all (i.e. without pixel data 
conversion
+     * just before upload)
+     */
+    Bool rendering_supported;
 };
 
 struct glamor_saved_procs {
@@ -215,6 +220,11 @@
     Bool can_copyplane;
     int max_fbo_size;
 
+    /**
+     * Stores information about supported formats. Note, that this list 
contains all
+     * supported pixel formats, including these that are not supported on GL 
side
+     * directly, but are converted to another format instead.
+     */
     struct glamor_format formats[33];
     struct glamor_format cbcr_format;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/glamor/glamor_render.c 
new/xwayland-21.1.3/glamor/glamor_render.c
--- old/xwayland-21.1.2/glamor/glamor_render.c  2021-07-09 12:27:07.348904600 
+0200
+++ new/xwayland-21.1.3/glamor/glamor_render.c  2021-11-08 11:37:14.854922500 
+0100
@@ -773,14 +773,19 @@
 {
     PictFormatShort storage_format;
     glamor_screen_private *glamor_priv;
+    struct glamor_format *f;
 
     /* Source-only pictures should always work */
     if (!picture->pDrawable)
         return TRUE;
 
     glamor_priv = glamor_get_screen_private(picture->pDrawable->pScreen);
-    storage_format =
-        glamor_priv->formats[picture->pDrawable->depth].render_format;
+    f = &glamor_priv->formats[picture->pDrawable->depth];
+
+    if (!f->rendering_supported)
+        return FALSE;
+
+    storage_format = f->render_format;
 
     switch (picture->format) {
     case PICT_a2r10g10b10:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/hw/xwayland/xwayland-glamor-gbm.c 
new/xwayland-21.1.3/hw/xwayland/xwayland-glamor-gbm.c
--- old/xwayland-21.1.2/hw/xwayland/xwayland-glamor-gbm.c       2021-07-09 
12:27:07.357904700 +0200
+++ new/xwayland-21.1.3/hw/xwayland/xwayland-glamor-gbm.c       2021-11-08 
11:37:14.863922600 +0100
@@ -120,6 +120,55 @@
     PixmapPtr pixmap;
     struct xwl_pixmap *xwl_pixmap;
     struct xwl_screen *xwl_screen = xwl_screen_get(screen);
+#ifdef GBM_BO_FD_FOR_PLANE
+    struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
+    uint64_t modifier = gbm_bo_get_modifier(bo);
+    const int num_planes = gbm_bo_get_plane_count(bo);
+    int fds[GBM_MAX_PLANES];
+    int plane;
+    int attr_num = 0;
+    EGLint img_attrs[64] = {0};
+    enum PlaneAttrs {
+        PLANE_FD,
+        PLANE_OFFSET,
+        PLANE_PITCH,
+        PLANE_MODIFIER_LO,
+        PLANE_MODIFIER_HI,
+        NUM_PLANE_ATTRS
+    };
+    static const EGLint planeAttrs[][NUM_PLANE_ATTRS] = {
+        {
+            EGL_DMA_BUF_PLANE0_FD_EXT,
+            EGL_DMA_BUF_PLANE0_OFFSET_EXT,
+            EGL_DMA_BUF_PLANE0_PITCH_EXT,
+            EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT,
+            EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT,
+        },
+        {
+            EGL_DMA_BUF_PLANE1_FD_EXT,
+            EGL_DMA_BUF_PLANE1_OFFSET_EXT,
+            EGL_DMA_BUF_PLANE1_PITCH_EXT,
+            EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT,
+            EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT,
+        },
+        {
+            EGL_DMA_BUF_PLANE2_FD_EXT,
+            EGL_DMA_BUF_PLANE2_OFFSET_EXT,
+            EGL_DMA_BUF_PLANE2_PITCH_EXT,
+            EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT,
+            EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT,
+        },
+        {
+            EGL_DMA_BUF_PLANE3_FD_EXT,
+            EGL_DMA_BUF_PLANE3_OFFSET_EXT,
+            EGL_DMA_BUF_PLANE3_PITCH_EXT,
+            EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT,
+            EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT,
+        },
+    };
+
+    for (plane = 0; plane < num_planes; plane++) fds[plane] = -1;
+#endif
 
     xwl_pixmap = calloc(1, sizeof(*xwl_pixmap));
     if (xwl_pixmap == NULL)
@@ -138,10 +187,57 @@
     xwl_glamor_egl_make_current(xwl_screen);
     xwl_pixmap->bo = bo;
     xwl_pixmap->buffer = NULL;
-    xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display,
-                                          xwl_screen->egl_context,
-                                          EGL_NATIVE_PIXMAP_KHR,
-                                          xwl_pixmap->bo, NULL);
+
+#ifdef GBM_BO_FD_FOR_PLANE
+    if (xwl_gbm->dmabuf_capable) {
+#define ADD_ATTR(attrs, num, attr)                                      \
+        do {                                                            \
+            assert(((num) + 1) < (sizeof(attrs) / sizeof((attrs)[0]))); \
+            (attrs)[(num)++] = (attr);                                  \
+        } while (0)
+        ADD_ATTR(img_attrs, attr_num, EGL_WIDTH);
+        ADD_ATTR(img_attrs, attr_num, gbm_bo_get_width(bo));
+        ADD_ATTR(img_attrs, attr_num, EGL_HEIGHT);
+        ADD_ATTR(img_attrs, attr_num, gbm_bo_get_height(bo));
+        ADD_ATTR(img_attrs, attr_num, EGL_LINUX_DRM_FOURCC_EXT);
+        ADD_ATTR(img_attrs, attr_num, gbm_bo_get_format(bo));
+
+        for (plane = 0; plane < num_planes; plane++) {
+            fds[plane] = gbm_bo_get_fd_for_plane(bo, plane);
+            ADD_ATTR(img_attrs, attr_num, planeAttrs[plane][PLANE_FD]);
+            ADD_ATTR(img_attrs, attr_num, fds[plane]);
+            ADD_ATTR(img_attrs, attr_num, planeAttrs[plane][PLANE_OFFSET]);
+            ADD_ATTR(img_attrs, attr_num, gbm_bo_get_offset(bo, plane));
+            ADD_ATTR(img_attrs, attr_num, planeAttrs[plane][PLANE_PITCH]);
+            ADD_ATTR(img_attrs, attr_num, gbm_bo_get_stride_for_plane(bo, 
plane));
+            ADD_ATTR(img_attrs, attr_num, 
planeAttrs[plane][PLANE_MODIFIER_LO]);
+            ADD_ATTR(img_attrs, attr_num, (uint32_t)(modifier & 
0xFFFFFFFFULL));
+            ADD_ATTR(img_attrs, attr_num, 
planeAttrs[plane][PLANE_MODIFIER_HI]);
+            ADD_ATTR(img_attrs, attr_num, (uint32_t)(modifier >> 32ULL));
+        }
+        ADD_ATTR(img_attrs, attr_num, EGL_NONE);
+#undef ADD_ATTR
+
+        xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display,
+                                              EGL_NO_CONTEXT,
+                                              EGL_LINUX_DMA_BUF_EXT,
+                                              NULL,
+                                              img_attrs);
+
+        for (plane = 0; plane < num_planes; plane++) {
+            close(fds[plane]);
+            fds[plane] = -1;
+        }
+    }
+    else
+#endif
+    {
+        xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display,
+                                              xwl_screen->egl_context,
+                                              EGL_NATIVE_PIXMAP_KHR,
+                                              xwl_pixmap->bo, NULL);
+    }
+
     if (xwl_pixmap->image == EGL_NO_IMAGE_KHR)
       goto error;
 
@@ -842,6 +938,7 @@
     struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
     EGLint major, minor;
     const GLubyte *renderer;
+    const char *gbm_backend_name;
 
     if (!xwl_gbm->fd_render_node && !xwl_gbm->drm_authenticated) {
         ErrorF("Failed to get wl_drm, disabling Glamor and DRI3\n");
@@ -893,6 +990,11 @@
                                 "EXT_image_dma_buf_import_modifiers"))
        xwl_gbm->dmabuf_capable = TRUE;
 
+    gbm_backend_name = gbm_device_get_backend_name(xwl_gbm->gbm);
+    /* Mesa uses "drm" as backend name, in that case, just do nothing */
+    if (gbm_backend_name && strcmp(gbm_backend_name, "drm") != 0)
+        xwl_screen->glvnd_vendor = gbm_backend_name;
+
     return TRUE;
 error:
     if (xwl_screen->egl_display != EGL_NO_DISPLAY) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/hw/xwayland/xwayland-input.c 
new/xwayland-21.1.3/hw/xwayland/xwayland-input.c
--- old/xwayland-21.1.2/hw/xwayland/xwayland-input.c    2021-07-09 
12:27:07.358904600 +0200
+++ new/xwayland-21.1.3/hw/xwayland/xwayland-input.c    2021-11-08 
11:37:14.864922500 +0100
@@ -1677,6 +1677,13 @@
     xwl_tablet_tool->proximity_in_serial = serial;
     xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface);
 
+    /* If there is a cursor surface frame callback pending, we need to clear it
+     * so that we can continue submitting new cursor frames.
+     */
+    if (xwl_tablet_tool->cursor.frame_cb) {
+        wl_callback_destroy(xwl_tablet_tool->cursor.frame_cb);
+        xwl_tablet_tool->cursor.frame_cb = NULL;
+    }
     xwl_tablet_tool_set_cursor(xwl_tablet_tool);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/hw/xwayland/xwayland-output.c 
new/xwayland-21.1.3/hw/xwayland/xwayland-output.c
--- old/xwayland-21.1.2/hw/xwayland/xwayland-output.c   2021-07-09 
12:27:07.359904500 +0200
+++ new/xwayland-21.1.3/hw/xwayland/xwayland-output.c   2021-11-08 
11:37:14.864922500 +0100
@@ -701,6 +701,8 @@
 void
 xwl_output_destroy(struct xwl_output *xwl_output)
 {
+    if (xwl_output->xdg_output)
+        zxdg_output_v1_destroy(xwl_output->xdg_output);
     wl_output_destroy(xwl_output->output);
     free(xwl_output);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/hw/xwayland/xwayland-shm.c 
new/xwayland-21.1.3/hw/xwayland/xwayland-shm.c
--- old/xwayland-21.1.2/hw/xwayland/xwayland-shm.c      2021-07-09 
12:27:07.359904500 +0200
+++ new/xwayland-21.1.3/hw/xwayland/xwayland-shm.c      2021-11-08 
11:37:14.865922500 +0100
@@ -234,6 +234,15 @@
         (width == 0 && height == 0) || depth < 15)
         return fbCreatePixmap(screen, width, height, depth, hint);
 
+    stride = PixmapBytePad(width, depth);
+    size = stride * height;
+    /* Size in the protocol is an integer, make sure we don't exceed
+     * INT32_MAX or else the Wayland compositor will raise an error and
+     * kill the Wayland connection!
+     */
+    if (size > INT32_MAX)
+        return NULL;
+
     pixmap = fbCreatePixmap(screen, 0, 0, depth, hint);
     if (!pixmap)
         return NULL;
@@ -242,8 +251,6 @@
     if (xwl_pixmap == NULL)
         goto err_destroy_pixmap;
 
-    stride = PixmapBytePad(width, depth);
-    size = stride * height;
     xwl_pixmap->buffer = NULL;
     xwl_pixmap->size = size;
     fd = os_create_anonymous_file(size);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/include/dix-config.h.in 
new/xwayland-21.1.3/include/dix-config.h.in
--- old/xwayland-21.1.2/include/dix-config.h.in 2021-07-09 12:27:07.361904600 
+0200
+++ new/xwayland-21.1.3/include/dix-config.h.in 2021-11-08 11:37:14.867922500 
+0100
@@ -443,6 +443,9 @@
 /* GBM has modifiers support */
 #undef GBM_BO_WITH_MODIFIERS
 
+/* GBM has gbm_bo_get_fd_for_plane function */
+#undef GBM_BO_FD_FOR_PLANE
+
 /* Glamor can use eglQueryDmaBuf* functions */
 #undef GLAMOR_HAS_EGL_QUERY_DMABUF
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/include/meson.build 
new/xwayland-21.1.3/include/meson.build
--- old/xwayland-21.1.2/include/meson.build     2021-07-09 12:27:07.364904600 
+0200
+++ new/xwayland-21.1.3/include/meson.build     2021-11-08 11:37:14.869922600 
+0100
@@ -96,6 +96,8 @@
               build_glamor and gbm_dep.found() and 
gbm_dep.version().version_compare('>= 10.6'))
 conf_data.set('GBM_BO_WITH_MODIFIERS',
               build_glamor and gbm_dep.found() and 
gbm_dep.version().version_compare('>= 17.1'))
+conf_data.set('GBM_BO_FD_FOR_PLANE',
+              build_glamor and gbm_dep.found() and 
gbm_dep.version().version_compare('>= 21.1'))
 
 conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir)
 conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/meson.build 
new/xwayland-21.1.3/meson.build
--- old/xwayland-21.1.2/meson.build     2021-07-09 12:27:07.367904700 +0200
+++ new/xwayland-21.1.3/meson.build     2021-11-08 11:37:14.872922700 +0100
@@ -3,7 +3,7 @@
             'buildtype=debugoptimized',
             'c_std=gnu99',
         ],
-        version: '21.1.2',
+        version: '21.1.3',
         meson_version: '>= 0.46.0',
 )
 add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-21.1.2/test/scripts/xwayland-piglit.sh 
new/xwayland-21.1.3/test/scripts/xwayland-piglit.sh
--- old/xwayland-21.1.2/test/scripts/xwayland-piglit.sh 2021-07-09 
12:27:07.385904300 +0200
+++ new/xwayland-21.1.3/test/scripts/xwayland-piglit.sh 2021-11-08 
11:37:14.887922800 +0100
@@ -36,6 +36,8 @@
 
 export PIGLIT_ARGS
 
+# Do not let run-piglit.sh exit status terminate this script prematurely
+set +e
 $XSERVER_DIR/test/scripts/run-piglit.sh
 PIGLIT_STATUS=$?
 

Reply via email to