linux/Documentation/userspace-api
Maxime Ripard 4f5f8baf73 dma-buf: heaps: cma: Create CMA heap for each CMA reserved region
Aside from the main CMA region, it can be useful to allow userspace to
allocate from the other CMA reserved regions.

Indeed, those regions can have specific properties that can be useful to
a specific us-case.

For example, one of them platform I've been with has ECC enabled on the
entire memory but for a specific region. Using that region to allocate
framebuffers can be particular beneficial because enabling the ECC has a
performance and memory footprint cost.

Thus, exposing these regions as heaps user-space can allocate from and
import wherever needed allows to cover that use-case.

For now, only shared-dma-pools regions with the reusable property (ie,
backed by CMA) are supported, but eventually we'll want to support other
DMA pools types.

Since we collected all the CMA regions created during boot, we can
simply iterate over all of them to create the heaps.

This has a weird interaction with the recent work on the CMA name, in
particular the backward compatibility code created by commit
854acbe75f ("dma-buf: heaps: Give default CMA heap a fixed name").

Indeed, the old name was either 'reserved', or the name of the
reserved-memory region device tree node if the linux,cma-default
property was set.

In both these cases, we have now collected this region during boot, and
we're using the same name. So we're now largely redundant with the
code to handle backward compatibility code, and we can thus remove it
and the associated Kconfig option.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
   [sumits: rebased the doc to latest]
Link: https://lore.kernel.org/r/20251013-dma-buf-ecc-heap-v8-5-04ce150ea3d9@kernel.org
2025-10-18 21:31:22 +05:30
..
accelerators
ebpf
fwctl docs: Improve grammar in Userspace API/fwctl 2025-06-09 15:11:46 -06:00
gpio
ioctl powerpc/pseries: Define papr-hvpipe ioctl 2025-09-15 13:38:39 +05:30
media It has been a relatively busy cycle in docsland, with changes all over: 2025-10-03 17:16:13 -07:00
netlink docs: uapi: netlink: update netlink specs link 2025-08-12 07:47:30 +02:00
ELF.rst
check_exec.rst
dcdbas.rst
dma-buf-alloc-exchange.rst
dma-buf-heaps.rst dma-buf: heaps: cma: Create CMA heap for each CMA reserved region 2025-10-18 21:31:22 +05:30
futex2.rst
index.rst
iommufd.rst iommufd: Fix spelling errors in iommufd.rst 2025-08-18 11:15:06 -03:00
isapnp.rst
landlock.rst
lsm.rst
mfd_noexec.rst
mseal.rst LoongArch: Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS 2025-05-30 21:45:42 +08:00
no_new_privs.rst
ntsync.rst
perf_ring_buffer.rst
seccomp_filter.rst
spec_ctrl.rst
sysfs-platform_profile.rst docs: Fix typos, improve grammar in Userspace API 2025-06-09 15:13:33 -06:00
tee.rst
unshare.rst
vduse.rst