File: dma-buf-heaps.rst

package info (click to toggle)
linux 6.17.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,734,900 kB
  • sloc: ansic: 26,684,436; asm: 271,195; sh: 147,406; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (28 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.. SPDX-License-Identifier: GPL-2.0

==============================
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 ``system`` heap allocates virtually contiguous, cacheable, buffers.

 - The ``cma`` heap 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 the
   ``cma`` parameter, a memory region Device-Tree node with the
   ``linux,cma-default`` property set, or through the ``CMA_SIZE_MBYTES`` or
   ``CMA_SIZE_PERCENTAGE`` Kconfig options. The heap's name in devtmpfs is
   ``default_cma_region``. For backwards compatibility, when the
   ``DMABUF_HEAPS_CMA_LEGACY`` Kconfig option is set, a duplicate node is
   created following legacy naming conventions; the legacy name might be
   ``reserved``, ``linux,cma``, or ``default-pool``.