]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Documentation: dma-buf: heaps: Add heap name definitions
authorMaxime Ripard <mripard@kernel.org>
Thu, 6 Mar 2025 13:51:14 +0000 (14:51 +0100)
committerJonathan Corbet <corbet@lwn.net>
Wed, 12 Mar 2025 22:49:02 +0000 (16:49 -0600)
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 <tjmercier@google.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250306135114.1943738-1-mripard@kernel.org
Documentation/userspace-api/dma-buf-heaps.rst [new file with mode: 0644]
Documentation/userspace-api/index.rst
MAINTAINERS

diff --git a/Documentation/userspace-api/dma-buf-heaps.rst b/Documentation/userspace-api/dma-buf-heaps.rst
new file mode 100644 (file)
index 0000000..535f490
--- /dev/null
@@ -0,0 +1,25 @@
+.. 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. Depending on the platform, it
+   might be called ``reserved``, ``linux,cma``, or ``default-pool``.
index b1395d94b3fd0a7d43a3a9a9afa329d467675ae5..9cbe4390c8725852d80ca596df350a17982efe83 100644 (file)
@@ -44,6 +44,7 @@ Devices and I/O
    :maxdepth: 1
 
    accelerators/ocxl
+   dma-buf-heaps
    dma-buf-alloc-exchange
    gpio/index
    iommufd
index d28115625fd3fd61480675ccb0f4140a94fdd680..edcd0d7ca3be6de4cfc17e85c41eea1f5c0c9c13 100644 (file)
@@ -6913,6 +6913,7 @@ L:        dri-devel@lists.freedesktop.org
 L:     linaro-mm-sig@lists.linaro.org (moderated for non-subscribers)
 S:     Maintained
 T:     git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F:     Documentation/userspace-api/dma-buf-heaps.rst
 F:     drivers/dma-buf/dma-heap.c
 F:     drivers/dma-buf/heaps/*
 F:     include/linux/dma-heap.h