[PATCH 03/27] libcamera: dma_buf_allocator: Favour udmabuf over cma heap allocations
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Apr 25 15:07:46 CEST 2025
Le jeudi 24 avril 2025 à 14:51 +0100, Bryan O'Donoghue a écrit :
> Thinking about this patch.
>
> A user on a system such as imx/hantro is free to configure the system to
> support CMA and UDMABuf.
>
> If you never pass that buffer to the video encoder - where the encoder
> requires phys contig/cma heap memory - then you probably want udmabuf.
>
> The reverse is also true.
>
> Its almost use-case specific. If you want the encoder you need CMA and
> if you just want to say - display the output in cheese you want UDMAbuf.
That is hardware specific. There is some encoders with an iommu that
can emit page fault on CPU cached pages, and so can handle UDMABuf
fully in hardware. i.MX8 series, not so much.
>
> Probably the right thing to do is to leave CMA heap as default and leave
> it to the system designer to configure the system as they wish.
>
> In my case, switching off the CMA heap or perhaps a libcamera config/env
> variable to specify which to use...
As we target "Desktop like" with the software ISP, there is no system
designer in that process. Unless you consider the user to be as such.
That being said, you can quirk it based on which CSI receiver brand in
use if you don't want to try one and cascade to the other if one fails.
Nicolas
More information about the libcamera-devel
mailing list