Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libnvidia-egl-wayland for 
openSUSE:Factory checked in at 2026-09-04 12:35:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libnvidia-egl-wayland (Old)
 and      /work/SRC/openSUSE:Factory/.libnvidia-egl-wayland.new.1265 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libnvidia-egl-wayland"

Fri Sep  4 12:35:47 2026 rev:24 rq:1375162 version:1.1.22

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/libnvidia-egl-wayland/libnvidia-egl-wayland.changes  
    2026-02-05 17:57:27.004180654 +0100
+++ 
/work/SRC/openSUSE:Factory/.libnvidia-egl-wayland.new.1265/libnvidia-egl-wayland.changes
    2026-09-04 12:35:48.975904623 +0200
@@ -1,0 +2,66 @@
+Tue Sep  1 11:23:51 UTC 2026 - Stefan Dirsch <[email protected]>
+
+- 0004-egl-wayland-fix-fd-and-mapping-leaks-in-dmabuf-feedb.patch
+  * egl-wayland: fix fd and mapping leaks in dmabuf feedback handlers:
+    dmabuf_feedback_check_format_table() ignored the format-table fd
+    without closing it, leaking one fd per EGL display initialization.
+    dmabuf_feedback_format_table() overwrote the previous mapping when a
+    compositor resends feedback, leaking the old table mapping. Unmap it
+    before replacing.
+- 0005-egl-wayland-destroy-the-default-feedback-proxy-after.patch
+  * egl-wayland: destroy the default feedback proxy after initialization:
+    The default dmabuf feedback is bound on the display's internal event
+    queue, which is never dispatched again once initialization completes.
+    When a compositor resends feedback (e.g. mutter < 50 resends the
+    format table on every scanout-candidacy change), each resent
+    format_table event carries an fd that sits in the undispatched queue
+    forever. Long-lived clients accumulate fds until they hit
+    RLIMIT_NOFILE, at which point the kernel drops the next SCM_RIGHTS
+    message, libwayland fails demarshalling with "file descriptor
+    expected, object (N), message format_table(hu)" and the client dies
+    with a fatal display error. Observed in the wild with kitty on
+    GNOME 46 / NVIDIA 580: hundreds of leaked 4032-byte
+    /memfd:mutter-shared fds and a crash roughly every 40 minutes under
+    frequent feedback resends.
+    The proxy's parsed data (format table and tranches) lives in
+    defaultFeedback and remains valid; resent updates were never being
+    processed anyway since the queue is not dispatched. Destroy the proxy
+    once the initial burst has been handled. Per-surface feedback still
+    tracks dynamic changes on the surface queues, which are dispatched at
+    swap time.
+- 0006-egl-wayland-destroy-the-display-registry-after-initi.patch
+  * egl-wayland: destroy the display registry after initialization:
+    The registry is only used to discover globals during initialization,
+    but it was kept alive for the display's lifetime while its events are
+    delivered to a queue that is never dispatched again on the dmabuf
+    path, so runtime global announcements (e.g. output hotplug)
+    accumulate on that queue indefinitely. Destroy the registry once
+    initialization completes, as suggested in review, to better match
+    egl-wayland2, which keeps neither the registry nor the event queue
+    after eglInitialize.
+    The queue itself is retained here since wlDmaBuf and other long-lived
+    proxies remain attached to it and the EGLStream path still performs
+    swap-interval roundtrips on it.
+- 0007-egl-wayland-make-the-registry-a-local-variable.patch
+  * The wl_registry no longer outlasts wlEglInitializeHook, so it does not
+    need to be stored in WlEglDisplay. Destroy it on the failure path as
+    well, since terminateDisplay() no longer does.
+- 0008-egl-wayland-unmap-the-format-table-with-the-proxy.patch
+  * The default feedback's format table is only read while parsing tranche
+    events, which can no longer arrive once the proxy is destroyed, so
+    unmap it there instead of holding the mapping for the display's
+    lifetime. Move the unmap into a helper so the resend and teardown
+    paths share its guards.
+- 0009-egl-wayland-clear-the-feedback-proxy-pointer-on-dest.patch
+  * egl-wayland: clear the feedback proxy pointer on destroy:
+    wlEglDestroyFeedback destroyed the proxy but left the pointer set, so
+    a second call on the same feedback (e.g. terminateDisplay running
+    again after a failed eglInitialize retry) would destroy a stale proxy.
+- 0010-Remove-the-unused-queue-parameter-from-wlEglSendDama.patch
+  * Remove the unused queue parameter from wlEglSendDamageEvent:
+    Since wlEglSendDamageEvent doesn't dispatch an event queue anymore, it
+    doesn't need to take a wl_event_queue parameter.
+    Also, in damage_thread, don't allocate a wl_event_queue, since the only
+    place it was used there was to pass it to wlEglSendDamageEvent.
+
+-------------------------------------------------------------------

New:
----
  0004-egl-wayland-fix-fd-and-mapping-leaks-in-dmabuf-feedb.patch
  0005-egl-wayland-destroy-the-default-feedback-proxy-after.patch
  0006-egl-wayland-destroy-the-display-registry-after-initi.patch
  0007-egl-wayland-make-the-registry-a-local-variable.patch
  0008-egl-wayland-unmap-the-format-table-with-the-proxy.patch
  0009-egl-wayland-clear-the-feedback-proxy-pointer-on-dest.patch
  0010-Remove-the-unused-queue-parameter-from-wlEglSendDama.patch

----------(New B)----------
  New:
- 0004-egl-wayland-fix-fd-and-mapping-leaks-in-dmabuf-feedb.patch
  * egl-wayland: fix fd and mapping leaks in dmabuf feedback handlers:
  New:    before replacing.
- 0005-egl-wayland-destroy-the-default-feedback-proxy-after.patch
  * egl-wayland: destroy the default feedback proxy after initialization:
  New:    swap time.
- 0006-egl-wayland-destroy-the-display-registry-after-initi.patch
  * egl-wayland: destroy the display registry after initialization:
  New:    swap-interval roundtrips on it.
- 0007-egl-wayland-make-the-registry-a-local-variable.patch
  * The wl_registry no longer outlasts wlEglInitializeHook, so it does not
  New:    well, since terminateDisplay() no longer does.
- 0008-egl-wayland-unmap-the-format-table-with-the-proxy.patch
  * The default feedback's format table is only read while parsing tranche
  New:    paths share its guards.
- 0009-egl-wayland-clear-the-feedback-proxy-pointer-on-dest.patch
  * egl-wayland: clear the feedback proxy pointer on destroy:
  New:    again after a failed eglInitialize retry) would destroy a stale proxy.
- 0010-Remove-the-unused-queue-parameter-from-wlEglSendDama.patch
  * Remove the unused queue parameter from wlEglSendDamageEvent:
----------(New E)----------

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

Other differences:
------------------
++++++ libnvidia-egl-wayland.spec ++++++
--- /var/tmp/diff_new_pack.gMKiDx/_old  2026-09-04 12:35:49.681929412 +0200
+++ /var/tmp/diff_new_pack.gMKiDx/_new  2026-09-04 12:35:49.684929517 +0200
@@ -37,6 +37,13 @@
 Patch1:         0001-egl-wayland-add-FP16-DRM-format.patch
 Patch2:         0002-Bump-version-to-1.1.22.patch
 Patch3:         0003-egl-wayland-remove-extraneous-call-to-wl_display_rou.patch
+Patch4:         0004-egl-wayland-fix-fd-and-mapping-leaks-in-dmabuf-feedb.patch
+Patch5:         0005-egl-wayland-destroy-the-default-feedback-proxy-after.patch
+Patch6:         0006-egl-wayland-destroy-the-display-registry-after-initi.patch
+Patch7:         0007-egl-wayland-make-the-registry-a-local-variable.patch
+Patch8:         0008-egl-wayland-unmap-the-format-table-with-the-proxy.patch
+Patch9:         0009-egl-wayland-clear-the-feedback-proxy-pointer-on-dest.patch
+Patch10:        0010-Remove-the-unused-queue-parameter-from-wlEglSendDama.patch
 BuildRequires:  gcc-c++
 BuildRequires:  meson >= 0.50
 BuildRequires:  ninja

++++++ 0001-egl-wayland-add-FP16-DRM-format.patch ++++++
--- /var/tmp/diff_new_pack.gMKiDx/_old  2026-09-04 12:35:49.703930184 +0200
+++ /var/tmp/diff_new_pack.gMKiDx/_new  2026-09-04 12:35:49.708930360 +0200
@@ -1,7 +1,7 @@
 From ad099c694aa2a8f4d68e19dec6ca16092f2081d9 Mon Sep 17 00:00:00 2001
 From: Austin Shafer <[email protected]>
 Date: Fri, 24 Oct 2025 13:24:12 -0400
-Subject: [PATCH 1/3] egl-wayland: add FP16 DRM format
+Subject: [PATCH 01/10] egl-wayland: add FP16 DRM format
 
 Fixes #174, requires some fixes to the core driver to fully work
 however.

++++++ 0002-Bump-version-to-1.1.22.patch ++++++
--- /var/tmp/diff_new_pack.gMKiDx/_old  2026-09-04 12:35:49.729931097 +0200
+++ /var/tmp/diff_new_pack.gMKiDx/_new  2026-09-04 12:35:49.733931238 +0200
@@ -1,7 +1,7 @@
 From 0beb96e2df3ca40cd5156946a42048185b653c2d Mon Sep 17 00:00:00 2001
 From: Kyle Brenneman <[email protected]>
 Date: Tue, 9 Dec 2025 07:52:42 -0700
-Subject: [PATCH 2/3] Bump version to 1.1.22.
+Subject: [PATCH 02/10] Bump version to 1.1.22.
 
 ---
  configure.ac                       | 2 +-

++++++ 0003-egl-wayland-remove-extraneous-call-to-wl_display_rou.patch ++++++
--- /var/tmp/diff_new_pack.gMKiDx/_old  2026-09-04 12:35:49.745931659 +0200
+++ /var/tmp/diff_new_pack.gMKiDx/_new  2026-09-04 12:35:49.751931870 +0200
@@ -1,7 +1,7 @@
 From a557bed172dcd7ba379095f784d047202281c0de Mon Sep 17 00:00:00 2001
 From: Austin Shafer <[email protected]>
 Date: Tue, 6 Jan 2026 10:51:18 -0500
-Subject: [PATCH 3/3] egl-wayland: remove extraneous call to
+Subject: [PATCH 03/10] egl-wayland: remove extraneous call to
  wl_display_roundtrip_queue
 
 This replaces a call to wl_display_roundtrip_queue that we have had

++++++ 0004-egl-wayland-fix-fd-and-mapping-leaks-in-dmabuf-feedb.patch ++++++
>From 39f0e37ccfd683ed25db1eb1b3218acdf94600b7 Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Tue, 7 Jul 2026 15:47:57 +0800
Subject: [PATCH 04/10] egl-wayland: fix fd and mapping leaks in dmabuf
 feedback handlers

dmabuf_feedback_check_format_table() ignored the format-table fd
without closing it, leaking one fd per EGL display initialization.

dmabuf_feedback_format_table() overwrote the previous mapping when a
compositor resends feedback, leaking the old table mapping. Unmap it
before replacing.
---
 src/wayland-egldisplay.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index a46d127..fdd9f66 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -385,6 +385,15 @@ dmabuf_feedback_format_table(void *data,
     (void) dmabuf_feedback;
 
     assert(size % sizeof(WlEglDmaBufFormatTableEntry) == 0);
+
+    /* On a feedback resend, unmap the previous table before replacing it. */
+    if (feedback->formatTable.entry &&
+        feedback->formatTable.entry != MAP_FAILED &&
+        feedback->formatTable.len > 0) {
+        munmap((void *)feedback->formatTable.entry,
+               sizeof(feedback->formatTable.entry[0]) * 
feedback->formatTable.len);
+    }
+
     feedback->formatTable.len = size / sizeof(WlEglDmaBufFormatTableEntry);
 
     feedback->formatTable.entry =
@@ -590,8 +599,10 @@ dmabuf_feedback_check_format_table(void *data,
 {
     (void) data;
     (void) dmabuf_feedback;
-    (void) fd;
     (void) size;
+
+    /* This probe only cares about main_device; don't leak the table fd. */
+    close(fd);
 }
 
 static const struct zwp_linux_dmabuf_feedback_v1_listener 
dmabuf_feedback_check_listener = {
-- 
2.51.0


++++++ 0005-egl-wayland-destroy-the-default-feedback-proxy-after.patch ++++++
>From 4327889b448372652d3eb7c8a5e119852c273301 Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Tue, 7 Jul 2026 15:48:23 +0800
Subject: [PATCH 05/10] egl-wayland: destroy the default feedback proxy after
 initialization

The default dmabuf feedback is bound on the display's internal event
queue, which is never dispatched again once initialization completes.
When a compositor resends feedback (e.g. mutter < 50 resends the
format table on every scanout-candidacy change), each resent
format_table event carries an fd that sits in the undispatched queue
forever. Long-lived clients accumulate fds until they hit
RLIMIT_NOFILE, at which point the kernel drops the next SCM_RIGHTS
message, libwayland fails demarshalling with "file descriptor
expected, object (N), message format_table(hu)" and the client dies
with a fatal display error. Observed in the wild with kitty on
GNOME 46 / NVIDIA 580: hundreds of leaked 4032-byte
/memfd:mutter-shared fds and a crash roughly every 40 minutes under
frequent feedback resends.

The proxy's parsed data (format table and tranches) lives in
defaultFeedback and remains valid; resent updates were never being
processed anyway since the queue is not dispatched. Destroy the proxy
once the initial burst has been handled. Per-surface feedback still
tracks dynamic changes on the surface queues, which are dispatched at
swap time.
---
 src/wayland-egldisplay.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index fdd9f66..ea288b1 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -1441,6 +1441,21 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
     /* We haven't created any surfaces yet, so no need to reallocate. */
     display->defaultFeedback.unprocessedFeedback = false;
 
+    /*
+     * The initial feedback burst was dispatched by the roundtrip above and
+     * its parsed data (format table, tranches) lives in defaultFeedback, not
+     * in the proxy. wlEventQueue is never dispatched again after init, so a
+     * live proxy would only accumulate undispatched resend events, each
+     * holding an open format-table fd (compositors such as mutter < 50
+     * resend feedback on every scanout-candidacy change), until the process
+     * hits RLIMIT_NOFILE. Destroy the proxy now; per-surface feedback keeps
+     * handling dynamic changes on queues that are dispatched at swap time.
+     */
+    if (display->defaultFeedback.wlDmaBufFeedback) {
+        
zwp_linux_dmabuf_feedback_v1_destroy(display->defaultFeedback.wlDmaBufFeedback);
+        display->defaultFeedback.wlDmaBufFeedback = NULL;
+    }
+
     if (major != NULL) {
         *major = display->devDpy->major;
     }
-- 
2.51.0


++++++ 0006-egl-wayland-destroy-the-display-registry-after-initi.patch ++++++
>From 4fe63bb4c84a09234c1442b8f5de9fca3819dfbb Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Wed, 8 Jul 2026 11:00:40 +0800
Subject: [PATCH 06/10] egl-wayland: destroy the display registry after
 initialization

The registry is only used to discover globals during initialization,
but it was kept alive for the display's lifetime while its events are
delivered to a queue that is never dispatched again on the dmabuf
path, so runtime global announcements (e.g. output hotplug)
accumulate on that queue indefinitely. Destroy the registry once
initialization completes, as suggested in review, to better match
egl-wayland2, which keeps neither the registry nor the event queue
after eglInitialize.

The queue itself is retained here since wlDmaBuf and other long-lived
proxies remain attached to it and the EGLStream path still performs
swap-interval roundtrips on it.
---
 src/wayland-egldisplay.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index ea288b1..f5f58ad 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -1450,12 +1450,23 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
      * resend feedback on every scanout-candidacy change), until the process
      * hits RLIMIT_NOFILE. Destroy the proxy now; per-surface feedback keeps
      * handling dynamic changes on queues that are dispatched at swap time.
+     *
+     * The registry is likewise only needed to discover globals during
+     * initialization; destroying it stops runtime global announcements from
+     * accumulating on the queue. The queue itself is kept, unlike in
+     * egl-wayland2: wlDmaBuf and other long-lived proxies stay attached to
+     * it, and the EGLStream path still does swap-interval roundtrips on it.
      */
     if (display->defaultFeedback.wlDmaBufFeedback) {
         
zwp_linux_dmabuf_feedback_v1_destroy(display->defaultFeedback.wlDmaBufFeedback);
         display->defaultFeedback.wlDmaBufFeedback = NULL;
     }
 
+    if (display->wlRegistry) {
+        wl_registry_destroy(display->wlRegistry);
+        display->wlRegistry = NULL;
+    }
+
     if (major != NULL) {
         *major = display->devDpy->major;
     }
-- 
2.51.0


++++++ 0007-egl-wayland-make-the-registry-a-local-variable.patch ++++++
>From 60074fbd8544dd19c324810771cd84d8becaeb87 Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Tue, 4 Aug 2026 10:58:54 +0800
Subject: [PATCH 07/10] egl-wayland: make the registry a local variable

The wl_registry no longer outlasts wlEglInitializeHook, so it does not
need to be stored in WlEglDisplay. Destroy it on the failure path as
well, since terminateDisplay() no longer does.
---
 include/wayland-egldisplay.h |  1 -
 src/wayland-egldisplay.c     | 18 +++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/include/wayland-egldisplay.h b/include/wayland-egldisplay.h
index 466456c..01de62a 100644
--- a/include/wayland-egldisplay.h
+++ b/include/wayland-egldisplay.h
@@ -129,7 +129,6 @@ typedef struct WlEglDisplayRec {
     EGLBoolean         ownNativeDpy;
     struct wl_display *nativeDpy;
 
-    struct wl_registry             *wlRegistry;
     struct wl_eglstream_display    *wlStreamDpy;
     struct wl_eglstream_controller *wlStreamCtl;
     struct zwp_linux_dmabuf_v1     *wlDmaBuf;
diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index f5f58ad..5fa689e 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -743,10 +743,6 @@ static EGLBoolean terminateDisplay(WlEglDisplay *display, 
EGLBoolean globalTeard
         wlEglDestroyFormatSet(&display->formatSet);
         wlEglDestroyFeedback(&display->defaultFeedback);
 
-        if (display->wlRegistry) {
-            wl_registry_destroy(display->wlRegistry);
-            display->wlRegistry = NULL;
-        }
         if (display->wlStreamDpy) {
             wl_eglstream_display_destroy(display->wlStreamDpy);
             display->wlStreamDpy = NULL;
@@ -1325,6 +1321,7 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
     WlEglDisplay      *display = wlEglAcquireDisplay(dpy);
     WlEglPlatformData *data    = NULL;
     struct wl_display *wrapper = NULL;
+    struct wl_registry *wlRegistry = NULL;
     EGLint             err     = EGL_SUCCESS;
     int                ret     = 0;
     const char *dev_exts = NULL;
@@ -1388,9 +1385,9 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
     /* Listen to wl_registry events and make a roundtrip in order to find the
      * wl_eglstream_display and/or zwp_linux_dmabuf_v1 global object
      */
-    display->wlRegistry = wl_display_get_registry(wrapper);
+    wlRegistry = wl_display_get_registry(wrapper);
     wl_proxy_wrapper_destroy(wrapper); /* Done with wrapper */
-    ret = wl_registry_add_listener(display->wlRegistry,
+    ret = wl_registry_add_listener(wlRegistry,
                                    &registry_listener,
                                    display);
     if (ret == 0) {
@@ -1462,9 +1459,9 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
         display->defaultFeedback.wlDmaBufFeedback = NULL;
     }
 
-    if (display->wlRegistry) {
-        wl_registry_destroy(display->wlRegistry);
-        display->wlRegistry = NULL;
+    if (wlRegistry) {
+        wl_registry_destroy(wlRegistry);
+        wlRegistry = NULL;
     }
 
     if (major != NULL) {
@@ -1479,6 +1476,9 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
     return EGL_TRUE;
 
 fail:
+    if (wlRegistry) {
+        wl_registry_destroy(wlRegistry);
+    }
     terminateDisplay(display, EGL_FALSE);
     if (err != EGL_SUCCESS) {
         wlEglSetError(data, err);
-- 
2.51.0


++++++ 0008-egl-wayland-unmap-the-format-table-with-the-proxy.patch ++++++
>From e494943876cbea5704f3a99a9e7ab65835dd0960 Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Tue, 4 Aug 2026 10:59:11 +0800
Subject: [PATCH 08/10] egl-wayland: unmap the format table with the proxy

The default feedback's format table is only read while parsing tranche
events, which can no longer arrive once the proxy is destroyed, so
unmap it there instead of holding the mapping for the display's
lifetime. Move the unmap into a helper so the resend and teardown
paths share its guards.
---
 src/wayland-egldisplay.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index 5fa689e..21f33c5 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -151,12 +151,25 @@ typedef caddr_t pointer_t;
 typedef void *pointer_t;
 #endif
 
+static void
+wlEglFeedbackUnmapFormatTable(WlEglDmaBufFeedback *feedback)
+{
+    if (feedback->formatTable.entry &&
+        feedback->formatTable.entry != MAP_FAILED &&
+        feedback->formatTable.len > 0) {
+        munmap((pointer_t)feedback->formatTable.entry,
+               sizeof(feedback->formatTable.entry[0]) * 
feedback->formatTable.len);
+    }
+
+    feedback->formatTable.entry = NULL;
+    feedback->formatTable.len = 0;
+}
+
 void
 wlEglDestroyFeedback(WlEglDmaBufFeedback *feedback)
 {
     wlEglFeedbackResetTranches(feedback);
-    munmap((pointer_t)feedback->formatTable.entry,
-           sizeof(feedback->formatTable.entry[0]) * feedback->formatTable.len);
+    wlEglFeedbackUnmapFormatTable(feedback);
 
     if (feedback->wlDmaBufFeedback) {
         zwp_linux_dmabuf_feedback_v1_destroy(feedback->wlDmaBufFeedback);
@@ -387,12 +400,7 @@ dmabuf_feedback_format_table(void *data,
     assert(size % sizeof(WlEglDmaBufFormatTableEntry) == 0);
 
     /* On a feedback resend, unmap the previous table before replacing it. */
-    if (feedback->formatTable.entry &&
-        feedback->formatTable.entry != MAP_FAILED &&
-        feedback->formatTable.len > 0) {
-        munmap((void *)feedback->formatTable.entry,
-               sizeof(feedback->formatTable.entry[0]) * 
feedback->formatTable.len);
-    }
+    wlEglFeedbackUnmapFormatTable(feedback);
 
     feedback->formatTable.len = size / sizeof(WlEglDmaBufFormatTableEntry);
 
@@ -1457,6 +1465,13 @@ EGLBoolean wlEglInitializeHook(EGLDisplay dpy, EGLint 
*major, EGLint *minor)
     if (display->defaultFeedback.wlDmaBufFeedback) {
         
zwp_linux_dmabuf_feedback_v1_destroy(display->defaultFeedback.wlDmaBufFeedback);
         display->defaultFeedback.wlDmaBufFeedback = NULL;
+
+        /*
+         * The tranches parsed out of the format table are self-contained
+         * copies, and no further tranche events can arrive once the proxy is
+         * gone, so the mapping is no longer needed.
+         */
+        wlEglFeedbackUnmapFormatTable(&display->defaultFeedback);
     }
 
     if (wlRegistry) {
-- 
2.51.0


++++++ 0009-egl-wayland-clear-the-feedback-proxy-pointer-on-dest.patch ++++++
>From 9cb24d87613ab2c360a3e7fb657b757e7ed397af Mon Sep 17 00:00:00 2001
From: qdu <[email protected]>
Date: Tue, 4 Aug 2026 13:07:57 +0800
Subject: [PATCH 09/10] egl-wayland: clear the feedback proxy pointer on
 destroy

wlEglDestroyFeedback destroyed the proxy but left the pointer set, so
a second call on the same feedback (e.g. terminateDisplay running
again after a failed eglInitialize retry) would destroy a stale proxy.
---
 src/wayland-egldisplay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index 21f33c5..1746811 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -173,6 +173,7 @@ wlEglDestroyFeedback(WlEglDmaBufFeedback *feedback)
 
     if (feedback->wlDmaBufFeedback) {
         zwp_linux_dmabuf_feedback_v1_destroy(feedback->wlDmaBufFeedback);
+        feedback->wlDmaBufFeedback = NULL;
     }
 }
 
-- 
2.51.0


++++++ 0010-Remove-the-unused-queue-parameter-from-wlEglSendDama.patch ++++++
>From 0d182258a54eab4f8622298f9eb4a01cfcc68db7 Mon Sep 17 00:00:00 2001
From: Kyle Brenneman <[email protected]>
Date: Mon, 24 Aug 2026 16:47:36 -0600
Subject: [PATCH 10/10] Remove the unused queue parameter from
 wlEglSendDamageEvent.

Since wlEglSendDamageEvent doesn't dispatch an event queue anymore, it
doesn't need to take a wl_event_queue parameter.

Also, in damage_thread, don't allocate a wl_event_queue, since the only
place it was used there was to pass it to wlEglSendDamageEvent.
---
 include/wayland-eglsurface-internal.h | 1 -
 src/wayland-eglsurface.c              | 8 ++------
 src/wayland-eglswap.c                 | 4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/wayland-eglsurface-internal.h 
b/include/wayland-eglsurface-internal.h
index b70b9d3..9bbe1cb 100644
--- a/include/wayland-eglsurface-internal.h
+++ b/include/wayland-eglsurface-internal.h
@@ -206,7 +206,6 @@ EGLBoolean
 wlEglSurfaceCheckReleasePoints(WlEglDisplay *display, WlEglSurface *surface);
 
 EGLBoolean wlEglSendDamageEvent(WlEglSurface *surface,
-                                struct wl_event_queue *queue,
                                 EGLint *rects,
                                 EGLint n_rects);
 
diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c
index b601934..da13de9 100644
--- a/src/wayland-eglsurface.c
+++ b/src/wayland-eglsurface.c
@@ -243,7 +243,6 @@ send_explicit_sync_points (WlEglDisplay *display, 
WlEglSurface *surface,
 
 EGLBoolean
 wlEglSendDamageEvent(WlEglSurface *surface,
-                     struct wl_event_queue *queue,
                      EGLint *rects,
                      EGLint n_rects)
 {
@@ -321,9 +320,7 @@ damage_thread(void *args)
     WlEglSurface          *surface = (WlEglSurface*)args;
     WlEglDisplay          *display = surface->wlEglDpy;
     WlEglPlatformData     *data    = display->data;
-    struct wl_event_queue *queue   = wl_display_create_queue(
-                                        display->nativeDpy);
-    int                    ok      = (queue != NULL);
+    int                    ok      = 1;
     EGLint                 state;
 
     while (ok) {
@@ -377,7 +374,7 @@ damage_thread(void *args)
 
                 wlEglCreateFrameSync(surface);
 
-                ok = wlEglSendDamageEvent(surface, queue, NULL, 0);
+                ok = wlEglSendDamageEvent(surface, NULL, 0);
                 surface->ctx.framesProcessed++;
 
                 pthread_cond_signal(&surface->condFrameSync);
@@ -397,7 +394,6 @@ damage_thread(void *args)
         }
     }
 
-    wl_event_queue_destroy(queue);
     data->egl.releaseThread();
 
     return NULL;
diff --git a/src/wayland-eglswap.c b/src/wayland-eglswap.c
index ea99f49..85f0a6f 100644
--- a/src/wayland-eglswap.c
+++ b/src/wayland-eglswap.c
@@ -147,7 +147,7 @@ EGLBoolean wlEglSwapBuffersWithDamageHook(EGLDisplay 
eglDisplay, EGLSurface eglS
             surface->ctx.framesProduced++;
         } else {
             wlEglCreateFrameSync(surface);
-            res = wlEglSendDamageEvent(surface, surface->wlEventQueue, rects, 
n_rects);
+            res = wlEglSendDamageEvent(surface, rects, n_rects);
             wlEglSurfaceCheckReleasePoints(display, surface);
         }
     }
@@ -434,7 +434,7 @@ EGLBoolean wlEglPostPresentExport2(WlEglSurface *surface,
         surface->ctx.framesProduced++;
     } else {
         wlEglCreateFrameSync(surface);
-        res = wlEglSendDamageEvent(surface, surface->wlEventQueue, NULL, 0);
+        res = wlEglSendDamageEvent(surface, NULL, 0);
     }
 
     // Release wlEglSurface lock.
-- 
2.51.0

Reply via email to