libcamera: prefer udmabuf over dma-heaps - #464
Conversation
|
kernel config PR: qualcomm-linux/kernel-topics#1805 |
Test Results 34 files 260 suites 2h 14m 28s ⏱️ Results for commit 5948083. ♻️ This comment has been updated with latest results. |
|
I think this is a more generic problem, to be solved with libcamera itself. If the allocator can't provide enough memory, the libcamera should be able to fallback to the other allocators. This is especially true for the CMA allocators where we know that memory space is limited. |
|
The upstream linux-media (e.g. gstreamer) direction seems to be to use udmabuf more and more where ever possible now that it is generally available in most distro configurations. I think trying relatively unlimited udmabuf memory before CMA heaps makes sense from a not wasting scarce resources like CMA. OTOH IIRC the try CMA first approach is there for platforms where e.g. the video hw encoder which may sit after libcamera can only operate on CMA memory. So I think that rather then carrying a downstream patch the following should be done:
Dmitry Baryshkov (@lumag)'s idea of falling back to another allocator is interesting but I think that will complicate things quite a bit. E.g. in case of platforms where we actually want CMA to be tried first, returning a udmabuf backed dmabuf may cause errors elsewhere (e.g. the video-encoder), so I'm not sure how helpful this will be. I think that a configurable setting in which order to try the allocators should solve this nicely. |
|
Wenmeng Liu (@wenmliu) I think, Hans de Goede (@jwrdegoede) 's reply means: please open a merge request against libcamera, once agreed there, please backport it to QLI. |
|
Ack, I was about to write: to be clear my suggestion to fix this should be done upstream first. |
|
p.s. :
|
|
Sounds good. I'll work on the changes and submit them upstream. |
Just an FYI but you probably already know: UDMABUF is not enabled in defconfig |
Interesting, I'm not really a defconfig user, but that is a good point and one which is probably worth fixing... Let me discuss this with Robert Mader who has been pushing this from the gstreamer side. |
Yes, that's why I submitted a PR to enable UDMABUF for Qualcomm platforms: |
fe7e479 to
9e90744
Compare
|
The patch has been submitted to the libcamera community: https://lists.libcamera.org/pipermail/libcamera-devel/2026-September/062007.html |
fd2399b to
f91f470
Compare
|
Build failures should be fixed with #468 |
|
Please rebase. |
f91f470 to
534756a
Compare
done |
On Hamoa, CMA memory is currently insufficient for libcamera operation at some resolutions. Make the DMA-BUF provider priority order configurable through the runtime configuration. DmaBufAllocator now accepts an ordered list of preferred provider names; providers not listed are tried afterwards in the built-in order. When the list is empty, the historical order is preserved, so behaviour remains unchanged by default. The change is carried as a qcom-specific patch applied through a libcamera bbappend. Signed-off-by: Wenmeng Liu <wenmeng.liu@oss.qualcomm.com>
5948083
534756a to
5948083
Compare
172c640
into
qualcomm-linux:main
|
Successfully created backport PR for |
On Hamoa, CMA memory is currently insufficient for libcamera operation
at some resolutions. Make the DMA-BUF provider priority order
configurable through the runtime configuration.
DmaBufAllocator now accepts an ordered list of preferred provider names;
providers not listed are tried afterwards in the built-in order. When
the list is empty, the historical order is preserved, so behaviour
remains unchanged by default.
The change is carried as a qcom-specific patch applied through a
libcamera bbappend.