File 0001-egl-wayland2-close-dmabuf-format-table-fd.patch of Package libnvidia-egl-wayland2
From 9ae4f1daf3c9f1a30ef0870d74db7196c3fe8ebf Mon Sep 17 00:00:00 2001
From: Austin Shafer <ashafer@badland.io>
Date: Tue, 5 Aug 2025 13:02:45 -0400
Subject: [PATCH 01/18] egl-wayland2: close dmabuf format table fd
The compositor sends us a memfd for the format table, we need to
actually close it once we are done. This is causing an fd leak on
KDE which is crashing plasmashell after a couple minutes.
---
src/wayland/wayland-dmabuf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/wayland/wayland-dmabuf.c b/src/wayland/wayland-dmabuf.c
index ac12c38..510bde3 100644
--- a/src/wayland/wayland-dmabuf.c
+++ b/src/wayland/wayland-dmabuf.c
@@ -21,6 +21,7 @@
#include <string.h>
#include <sys/mman.h>
#include <assert.h>
+#include <unistd.h>
#include <drm_fourcc.h>
@@ -106,6 +107,8 @@ void eplWlDmaBufFeedbackCommonFormatTable(void *userdata,
base->error = EGL_TRUE;
}
}
+
+ close(fd);
}
void eplWlDmaBufFeedbackCommonMainDevice(void *userdata,
--
2.51.0