Allocating dma-buf using heaps¶
Dma-buf Heaps are a way for userspace to allocate dma-buf objects. They are typically used to allocate buffers from a specific allocation pool, or to share buffers across frameworks.
Heaps¶
A heap represents a specific allocator. The Linux kernel currently supports the following heaps:
The
systemheap allocates virtually contiguous, cacheable, buffers.The
cmaheap allocates physically contiguous, cacheable, buffers. Only present if a CMA region is present. Such a region is usually created either through the kernel commandline through thecmaparameter, a memory region Device-Tree node with thelinux,cma-defaultproperty set, or through theCMA_SIZE_MBYTESorCMA_SIZE_PERCENTAGEKconfig options. The heap’s name in devtmpfs isdefault_cma_region. For backwards compatibility, when theDMABUF_HEAPS_CMA_LEGACYKconfig option is set, a duplicate node is created following legacy naming conventions; the legacy name might bereserved,linux,cma, ordefault-pool.