Skip to content

Commit 2d38f5f

Browse files
mripardJonathan Corbet
authored andcommitted
Documentation: dma-buf: heaps: Add heap name definitions
Following a recent discussion at last Plumbers, John Stultz, Sumit Sewal, TJ Mercier and I came to an agreement that we should document what the dma-buf heaps names are expected to be, and what the buffers attributes you'll get should be documented. Let's create that doc to make sure those attributes and names are guaranteed going forward. Reviewed-by: T.J. Mercier <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5a63f03 commit 2d38f5f

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
==============================
4+
Allocating dma-buf using heaps
5+
==============================
6+
7+
Dma-buf Heaps are a way for userspace to allocate dma-buf objects. They are
8+
typically used to allocate buffers from a specific allocation pool, or to share
9+
buffers across frameworks.
10+
11+
Heaps
12+
=====
13+
14+
A heap represents a specific allocator. The Linux kernel currently supports the
15+
following 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``.

Documentation/userspace-api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Devices and I/O
4444
:maxdepth: 1
4545

4646
accelerators/ocxl
47+
dma-buf-heaps
4748
dma-buf-alloc-exchange
4849
gpio/index
4950
iommufd

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6913,6 +6913,7 @@ L: [email protected]
69136913
L: [email protected] (moderated for non-subscribers)
69146914
S: Maintained
69156915
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
6916+
F: Documentation/userspace-api/dma-buf-heaps.rst
69166917
F: drivers/dma-buf/dma-heap.c
69176918
F: drivers/dma-buf/heaps/*
69186919
F: include/linux/dma-heap.h

0 commit comments

Comments
 (0)