commit:     0f794d735103f871e077a6e645eb387513e6ef79
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 11 18:15:01 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 06:19:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f794d73

media-libs/mesa: backport wayland warning patches again

See 9d79f611e3930455eafc5b80cf9b2fb71aeb20b0.

Closes: https://bugs.gentoo.org/905146
Bug: https://bugs.gentoo.org/904072
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/mesa/Manifest                           |  1 +
 .../mesa-23.0.2-wayland-crash-warnings-2.patch     | 49 ++++++++++++++++++++++
 .../files/mesa-23.0.2-wayland-crash-warnings.patch | 37 ++++++++++++++++
 .../{mesa-23.0.3.ebuild => mesa-23.0.2-r1.ebuild}  |  6 ++-
 .../{mesa-23.0.3.ebuild => mesa-23.0.3-r1.ebuild}  |  5 +++
 5 files changed, 97 insertions(+), 1 deletion(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 6d35e3451cae..6d6f8a855f1a 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,2 +1,3 @@
 DIST mesa-22.3.7.tar.xz 17136476 BLAKE2B 
291e94302d3a177f842def9339d1ba012bf10de792b7120985255168faac6b87a73d1d59d8b430f56ea2a2640ca0890a5c3721188b70c528b9aad9788d7e139d
 SHA512 
c37bbcb3c0be1908726d6f83bfe98126d681935e401e03946e8b540611f832d2f272a2ac470600c2b77caa5b9a3a9059eb34bd9a93fcf88df114bedf8c39bf5a
+DIST mesa-23.0.2.tar.xz 17595964 BLAKE2B 
5a90fcd8b7096dde1e6c82b9bb5b00622cc1cf35e4308419441d3489d66ed322843db89f2f1162c8c30f6bcddbce867447f83425a29145bd42a742b773ec1258
 SHA512 
c60c47d9430870ce1888018c8d887538ffc18cceaaff8649b6d38207bad873bcf7b37182675cfb0d1d7bfc589c605d7aca3f80c925d983efbd5d03cdbdcf881b
 DIST mesa-23.0.3.tar.xz 17627728 BLAKE2B 
e716d9ddce3da649239c1bc37ec208b9669f316f6b547ca0c69937043f371f0d59ead34fec427297171916045061ddb8783d126f6dec5ece90a0719003fe2c40
 SHA512 
52c778de61daa406c6a1e96a657e9b6fdcc71c8cfda80b7f53acc6470556c7d502c057b9481bb0c3d57ef0263263413fd0d25d53ebf5aa0246fbcc3309de64ae

diff --git a/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings-2.patch 
b/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings-2.patch
new file mode 100644
index 000000000000..5992583a1fa0
--- /dev/null
+++ b/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings-2.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/904072
+https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21647
+
+From 689ce66a4332524b4eb98877de6f75d05dd05c60 Mon Sep 17 00:00:00 2001
+From: Alexandros Frantzis <alexandros.frant...@collabora.com>
+Date: Thu, 2 Mar 2023 10:10:42 +0200
+Subject: [PATCH] vulkan/wsi/wayland: Fix destruction of event queue with
+ proxies still attached.
+
+Destroy the surface dmabuf feedback proxy before destroying the event
+queue that the proxy is attached to.
+
+This silences a warning that libwayland 1.22 emits for programs that use
+Vulkan/Wayland:
+
+warning: queue 0x557a4efbcf70 destroyed while proxies still attached:
+  zwp_linux_dmabuf_feedback_v1@18 still attached
+
+Signed-off-by: Alexandros Frantzis <alexandros.frant...@collabora.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21647>
+--- a/src/vulkan/wsi/wsi_common_wayland.c
++++ b/src/vulkan/wsi/wsi_common_wayland.c
+@@ -1157,18 +1157,18 @@ wsi_wl_surface_destroy(VkIcdSurfaceBase *icd_surface, 
VkInstance _instance,
+    struct wsi_wl_surface *wsi_wl_surface =
+       wl_container_of((VkIcdSurfaceWayland *)icd_surface, wsi_wl_surface, 
base);
+ 
+-   if (wsi_wl_surface->surface)
+-      wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
+-
+-   if (wsi_wl_surface->display)
+-      wsi_wl_display_destroy(wsi_wl_surface->display);
+-
+    if (wsi_wl_surface->wl_dmabuf_feedback) {
+       
zwp_linux_dmabuf_feedback_v1_destroy(wsi_wl_surface->wl_dmabuf_feedback);
+       dmabuf_feedback_fini(&wsi_wl_surface->dmabuf_feedback);
+       dmabuf_feedback_fini(&wsi_wl_surface->pending_dmabuf_feedback);
+    }
+ 
++   if (wsi_wl_surface->surface)
++      wl_proxy_wrapper_destroy(wsi_wl_surface->surface);
++
++   if (wsi_wl_surface->display)
++      wsi_wl_display_destroy(wsi_wl_surface->display);
++
+    vk_free2(&instance->alloc, pAllocator, wsi_wl_surface);
+ }
+ 
+-- 
+GitLab

diff --git a/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings.patch 
b/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings.patch
new file mode 100644
index 000000000000..537d070c091e
--- /dev/null
+++ b/media-libs/mesa/files/mesa-23.0.2-wayland-crash-warnings.patch
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/904072
+https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646
+
+From ee5d2250fd159689aae3f7d632a6226971bea85c Mon Sep 17 00:00:00 2001
+From: Alexandros Frantzis <alexandros.frant...@collabora.com>
+Date: Thu, 2 Mar 2023 09:35:08 +0200
+Subject: [PATCH] egl/wayland: Fix destruction of event queue with proxies
+ still attached.
+
+Destroy the display wrapper proxy before destroying the event queue that
+the proxy is attached to.
+
+This silences a warning that libwayland 1.22 emits for programs that use
+EGL/Wayland:
+
+warning: queue 0x562a5ed2cd20 destroyed while proxies still attached:
+  wl_display@1 still attached
+
+Signed-off-by: Alexandros Frantzis <alexandros.frant...@collabora.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646>
+--- a/src/egl/drivers/dri2/platform_wayland.c
++++ b/src/egl/drivers/dri2/platform_wayland.c
+@@ -2865,10 +2865,10 @@ dri2_teardown_wayland(struct dri2_egl_display 
*dri2_dpy)
+       wl_shm_destroy(dri2_dpy->wl_shm);
+    if (dri2_dpy->wl_registry)
+       wl_registry_destroy(dri2_dpy->wl_registry);
+-   if (dri2_dpy->wl_queue)
+-      wl_event_queue_destroy(dri2_dpy->wl_queue);
+    if (dri2_dpy->wl_dpy_wrapper)
+       wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
++   if (dri2_dpy->wl_queue)
++      wl_event_queue_destroy(dri2_dpy->wl_queue);
+ 
+    if (dri2_dpy->own_device)
+       wl_display_disconnect(dri2_dpy->wl_dpy);
+-- 
+GitLab

diff --git a/media-libs/mesa/mesa-23.0.3.ebuild 
b/media-libs/mesa/mesa-23.0.2-r1.ebuild
similarity index 98%
copy from media-libs/mesa/mesa-23.0.3.ebuild
copy to media-libs/mesa/mesa-23.0.2-r1.ebuild
index 1d4bb730495f..fa2f20039d30 100644
--- a/media-libs/mesa/mesa-23.0.3.ebuild
+++ b/media-libs/mesa/mesa-23.0.2-r1.ebuild
@@ -43,7 +43,6 @@ REQUIRED_USE="
        video_cards_radeon? ( x86? ( llvm ) amd64? ( llvm ) )
        video_cards_r300?   ( x86? ( llvm ) amd64? ( llvm ) )
        video_cards_radeonsi?   ( llvm )
-       vdpau? ( X )
        xa? ( X )
        zink? ( vulkan )
 "
@@ -206,6 +205,11 @@ x86? (
        usr/lib/libGLX_mesa.so.0.0.0
 )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-23.0.2-wayland-crash-warnings.patch
+       "${FILESDIR}"/${PN}-23.0.2-wayland-crash-warnings-2.patch
+)
+
 llvm_check_deps() {
        local flags=${MULTILIB_USEDEP}
        if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi

diff --git a/media-libs/mesa/mesa-23.0.3.ebuild 
b/media-libs/mesa/mesa-23.0.3-r1.ebuild
similarity index 98%
rename from media-libs/mesa/mesa-23.0.3.ebuild
rename to media-libs/mesa/mesa-23.0.3-r1.ebuild
index 1d4bb730495f..767e5341ebf6 100644
--- a/media-libs/mesa/mesa-23.0.3.ebuild
+++ b/media-libs/mesa/mesa-23.0.3-r1.ebuild
@@ -206,6 +206,11 @@ x86? (
        usr/lib/libGLX_mesa.so.0.0.0
 )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-23.0.2-wayland-crash-warnings.patch
+       "${FILESDIR}"/${PN}-23.0.2-wayland-crash-warnings-2.patch
+)
+
 llvm_check_deps() {
        local flags=${MULTILIB_USEDEP}
        if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi

Reply via email to