修bug
Some checks are pending
CI / host-build (push) Waiting to run
CI / rk3588-cross-build (push) Waiting to run

This commit is contained in:
sladro 2026-01-06 14:57:18 +08:00
parent 9bcb82e461
commit d9ec32d40f

View File

@ -164,14 +164,26 @@ DmaBufferPtr DmaAlloc(size_t alloc_size) {
return DmaBufferPtr(reused, [](DmaBuffer* b) { Pool().Put(b); });
}
// Try different dma_heap devices - prefer CMA for RGA compatibility (<4GB)
// Try different dma_heap devices.
// Notes:
// - Some RGA drivers cannot map buffers whose physical address is >4GB; prefer DMA32 heaps.
// - CMA heaps are also <4GB friendly but can be small/fragmented under multi-stream load.
const char* heap_paths[] = {
// Prefer CMA first when available.
"/dev/dma_heap/cma",
"/dev/dma_heap/cma-uncached",
"/dev/dma_heap/cma-uncached",
"/dev/dma_heap/linux,cma",
"/dev/dma_heap/reserved",
// Then prefer DMA32 heaps to keep allocations under 4GB.
"/dev/dma_heap/system-dma32",
"/dev/dma_heap/system-uncached-dma32",
// Generic system heaps (may allocate >4GB on high-mem systems).
"/dev/dma_heap/system-uncached",
"/dev/dma_heap/system",
// Last resort.
"/dev/dma_heap/reserved",
nullptr
};