John Sheu <s...@google.com> writes:

> Hello folks:
>
> About the ownership of dmabuf file descriptors that are passed into EGL.
>  I'm looking in particular at this blurb from the spec:
>
>        * If <target> is EGL_LINUX_DMA_BUF_EXT and eglCreateImageKHR fails,
>          EGL does not retain ownership of the file descriptor and it is the
>          responsibility of the application to close it."
>
> My take on this is that this is different from most users of dmabuf, or
> even file descriptors in general.  For example, mmap() doesn't own the
> descriptor passed to it; and more specifically to dmabufs, neither does
> (say) DRM_IOCTL_PRIME_HANDLE_TO_FD, or any of the V4L2 entry points that
> support dmabuf (e.g. VIDIOC_QBUF).  They all increment the refcount on the
> descriptor, not own it.
>
> Since we're still iterating drafts on the EXT_image_dma_buf_import spec --
> I'd like to see the spec specify that EGL has the similar behavior of
> taking a reference, but not owning the descriptor.

It's still considered a draft?  I wasn't aware of this.  The file I have
of Version 5 says Status: Complete

I think it would be way more sane for the application to be always
responsible for closing its fd, and the GL had better reference any
resources it needs out of the fd before returning.

Attachment: pgpenC1f_NoVo.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to