Package: gdk
Class gdk:dmabuf-texture-builder
Superclassesgobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gdk:dmabuf-texture-builder object is a builder used to construct gdk:texture objects from DMA buffers.
DMA buffers are commonly called dma-bufs. DMA buffers are a feature of the Linux kernel to enable efficient buffer and memory sharing between hardware such as codecs, GPUs, displays, cameras and the kernel drivers controlling them. For example, a decoder may want its output to be directly shared with the display server for rendering without a copy. Any device driver which participates in DMA buffer sharing, can do so as either the exporter or importer of buffers (or both). The memory that is shared via DMA buffers is usually stored in non-system memory (maybe in device’s local memory or something else not directly accessible by the CPU), and accessing this memory from the CPU may have higher-than-usual overhead. In particular for graphics data, it is not uncommon that data consists of multiple separate blocks of memory, for example one block for each of the red, green and blue channels. These blocks are called planes. DMA buffers can have up to four planes. Even if the memory is a single block, the data can be organized in multiple planes, by specifying offsets from the beginning of the data. DMA buffers are exposed to user-space as file descriptors allowing to pass them between processes. If a DMA buffer has multiple planes, there is one file descriptor per plane. The format of the data (for graphics data, essentially its colorspace) is described by a 32-bit integer. These format identifiers are defined in the header file drm_fourcc.h and commonly referred to as fourcc values, since they are identified by 4 ASCII characters. Additionally, each DMA buffer has a modifier, which is a 64-bit integer that describes driver-specific details of the memory layout, such as tiling or compression. For historical reasons, some producers of dma-bufs do not provide an explicit modifier, but instead return DMA_FORMAT_MOD_INVALID to indicate that their modifier is implicit. GTK tries to accommodate this situation by accepting DMA_FORMAT_MOD_INVALID as modifier. The operation of the gdk:dmabuf-texture-builder object is quite simple: Create a texture builder, set all the necessary properties, and then call the gdk:dmabuf-texture-builder-build object to create the new texture. The required properties for a dma-buf texture are
For further information, see the Linux kernel Linux kernel documentation and the drm_fourcc.h header file. Since 4.14 | Inherited Slot Access FunctionsSee also |
2024-7-11