renderer/native: Don't close DMA buf fds before handing them forward

We closed all the DMA buffer fds after creating the DMA buffer backed
CoglFramebuffer, which meant that the fds we passed to CoglDmaBufHandle
were already closed. This broke screen casting with DMA buffers.

Fixes: 8509b74532 ("Make DMA buffer allocation format and modifier aware")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4177>
This commit is contained in:
Jonas Ådahl 2024-12-12 00:42:42 +01:00 committed by Marge Bot
parent 1fce76a0fb
commit aad237a04a

View File

@ -1089,11 +1089,11 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
offsets, offsets,
plane_modifiers, plane_modifiers,
error); error);
close_fds (fds, n_planes);
if (!dmabuf_fb) if (!dmabuf_fb)
{
close_fds (fds, n_planes);
return NULL; return NULL;
}
dmabuf_handle = dmabuf_handle =
cogl_dma_buf_handle_new (dmabuf_fb, cogl_dma_buf_handle_new (dmabuf_fb,