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 <uwu@icenowy.me>
This commit is contained in:
Icenowy Zheng 2025-09-23 19:08:45 +08:00 committed by Alan Coopersmith
parent 0b0b59d711
commit f76e4bbd35

View file

@ -1876,6 +1876,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);