temp/libcamera: Use udmabuf by default
!5584 (merged), !5585 (merged) and !5586 (merged)
Depends onudmabufs appears to be the better solution for buffer allocation than CMA heaps and distros like Fedora will use them by default for the libcamera swISP. Notably systemd 257 will allow users to use them by default.
They use "normal" memory allocation which has several benefits:
- No "reservation" required, thus no size limit and no blocking of memory.
- Allocation size is properly attributed, cgroup limits are enforced etc.
The big disadvantage is that they require GPUs to have IOMMUs in order to be able to import buffers without copy. This is the case for all more modern devices - such as (most|all)? qcom ones, but some older ones from the GLES 2.0 era might not have it. Crucially we need to check:
-
Librem5 - works -
PinePhone - works
and keep CMA enabled there.
Notes:
- udmabuf support was added to libcamera 0.3.1 following upstream discussion.
- sdm670 and sdm845 already ship with udmabuf enabled but could now disable CMA reservation
See also:
Merge request reports
Activity
added 5 commits
-
19b9b1e7...8ce102b6 - 2 commits from branch
postmarketOS:master
- cc0d22f3 - temp/libcamera: Change udev rule with uaccess tag for udmabuf
- 57aeebf4 - linux-purism-librem5: enable CONFIG_UDMABUF
- 0c1f7033 - linux-postmarketos-allwinner: enable CONFIG_UDMABUF
By Robert Mader on 2024-08-29T19:42:24
Toggle commit list-
19b9b1e7...8ce102b6 - 2 commits from branch
- Resolved by Administrator
Turns out even the Librem5 and PinePhone work just fine with udmabuf - including direct import with EGL[1] \o/
So it looks like we can switch to udmabuf for all currently supported devices (that have working camera support).
cc @pabloyoyoista
1: tested with Gstreamer
glupload
andwaylandsink
By Robert Mader on 2024-08-31T18:38:50
Edited by Ghost User
- Resolved by Administrator
mentioned in issue pmbootstrap#2174 (closed)
By Robert Mader on 2024-08-29T19:54:53
added camera type::feature labels
- Resolved by Administrator
Please modify
kconfigcheck.toml
with the things we now need for the libcamera option. This warranties every kernel will have this enabled in the future if in use with libcameraBy Pablo Correa Gomez on 2024-08-29T21:45:52
Edited by Ghost User
So cool to see this continuing moving forward at the speed of light!
By Pablo Correa Gomez on 2024-08-30T06:50:39
Edited by Ghost Useradded 1 commit
- 8d627079 - kconfigcheck: Add udmabuf instead of cma heaps for libcamera
By Robert Mader on 2024-08-29T21:45:41
added 1 commit
- 7d4d5ca6 - kconfigcheck: Add udmabuf instead of cma heaps for libcamera
By Robert Mader on 2024-08-29T21:48:27