modesetting: fix shared pixmap dmabuf fd leakage

After the dmabuf fd exported by another screen is imported to a pixmap,
the pixmap holds a reference for the buffer, thus the FD itself finished
its job and needs to be closed to prevent a stale reference to the
buffer.

Signed-off-by: Icenowy Zheng's avatarIcenowy Zheng <uwu@icenowy.me>
This commit is contained in:
Icenowy Zheng
2025-11-24 22:56:41 +02:00
committed by Enrico Weigelt
parent 6be7fe9d12
commit 03fa63778b

View File

@@ -1798,6 +1798,7 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
ppix->devKind,
ppix->drawable.depth,
ppix->drawable.bitsPerPixel);
close(ihandle);
} else {
int size = ppix->devKind * ppix->drawable.height;
ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);