How to fetch the implicit sync fence for a GPU buffer?

Simon Ser contact at
Fri Jun 2 10:45:10 UTC 2023

On Friday, June 2nd, 2023 at 12:29, Michel Dänzer <michel at> wrote:

> > I’m wondering whether there’s an API -- maybe something analogous to drmPrimeHandleToFD() – that allows userspace to fetch a waitable fence fd for a dmabuf?
> A dma-buf fd itself can serve this purpose; it polls as readable when the GPU has finished drawing to the buffer.

If you _really_ need a sync_file FD, you can extract it via
DMA_BUF_IOCTL_EXPORT_SYNC_FILE. This is a somewhat recent kernel uAPI.

More information about the wayland-devel mailing list