mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
dma: contiguous: Reserve default CMA heap
The CMA code, in addition to the reserved-memory regions in the device tree, will also register a default CMA region if the device tree doesn't provide any, with its size and position coming from either the kernel command-line or configuration. Let's register that one for use to create a heap for it. Reviewed-by: T.J. Mercier <tjmercier@google.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: https://lore.kernel.org/r/20251013-dma-buf-ecc-heap-v8-4-04ce150ea3d9@kernel.org
This commit is contained in:
committed by
Sumit Semwal
parent
84a593066a
commit
8f1fc1bf1a
@@ -242,6 +242,8 @@ void __init dma_contiguous_reserve(phys_addr_t limit)
|
||||
}
|
||||
|
||||
if (selected_size && !dma_contiguous_default_area) {
|
||||
int ret;
|
||||
|
||||
pr_debug("%s: reserving %ld MiB for global area\n", __func__,
|
||||
(unsigned long)selected_size / SZ_1M);
|
||||
|
||||
@@ -249,6 +251,10 @@ void __init dma_contiguous_reserve(phys_addr_t limit)
|
||||
selected_limit,
|
||||
&dma_contiguous_default_area,
|
||||
fixed);
|
||||
|
||||
ret = dma_heap_cma_register_heap(dma_contiguous_default_area);
|
||||
if (ret)
|
||||
pr_warn("Couldn't register default CMA heap.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user