Expand description
Linux cross-process DMA-BUF-based image (“texture”) sharing
An Image<FD>
primarily contains DMA-BUF (FD
-typed) file descriptor(s)
(within each ImagePlane<FD>
, which also tracks its buffer’s “2D slice”),
and the “DRM format” (DrmFormat
) describing the image’s texel encoding,
all combined into a conveniently (de)serializable form (as long as FD
is).
Under EGL, this allows sharing an OpenGL texture across processes, e.g.:
- A creates an
EGLImage
from some OpenGL texture (or another resource) - A exports its
EGLImage
usingEGL_MESA_image_dma_buf_export
- A passes to B its DMA-BUF file descriptor(s) and “DRM format” metadata
- B imports it as an
EGLImage
usingEGL_EXT_image_dma_buf_import
- B exposes its
EGLImage
as an OpenGL texture usingglEGLImageTargetTexture2DOES
Structs
- In the Linux DRM+KMS system (i.e. kernel-side GPU drivers), a “DRM format” is an image format (i.e. a specific byte-level encoding of texel data) that framebuffers (or more generally “surfaces” / “images”) could use, provided that all the GPUs involved support the specific format used.