1.. SPDX-License-Identifier: GPL-2.0
2
3==============================
4Allocating dma-buf using heaps
5==============================
6
7Dma-buf Heaps are a way for userspace to allocate dma-buf objects. They are
8typically used to allocate buffers from a specific allocation pool, or to share
9buffers across frameworks.
10
11Heaps
12=====
13
14A heap represents a specific allocator. The Linux kernel currently supports the
15following heaps:
16
17 - The ``system`` heap allocates virtually contiguous, cacheable, buffers.
18
19 - The ``cma`` heap allocates physically contiguous, cacheable,
20   buffers. Only present if a CMA region is present. Such a region is
21   usually created either through the kernel commandline through the
22   `cma` parameter, a memory region Device-Tree node with the
23   `linux,cma-default` property set, or through the `CMA_SIZE_MBYTES` or
24   `CMA_SIZE_PERCENTAGE` Kconfig options. Depending on the platform, it
25   might be called ``reserved``, ``linux,cma``, or ``default-pool``.
26