Skip to content
Snippets Groups Projects

temp/libcamera: Use udmabuf by default

Merged Imported Administrator requested to merge libcamera-udmabuf into master

Depends on !5584 (merged), !5585 (merged) and !5586 (merged)

udmabufs 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:

  1. No "reservation" required, thus no size limit and no blocking of memory.
  2. 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:

  1. https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2174#note_2081391111
  2. !5399 (comment 2077524825)
Edited by Administrator

Merge request reports

Checking pipeline status.

Merged by AdministratorAdministrator 6 months ago (Sep 12, 2024 6:14pm UTC)

Loading

Pipeline #204213 passed

Pipeline passed for 014fdc1d on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator mentioned in issue pmbootstrap#2174 (closed) · Imported

    mentioned in issue pmbootstrap#2174 (closed)

    By Robert Mader on 2024-08-29T19:54:53

  • Administrator changed the description · Imported

    changed the description

    By Robert Mader on 2024-08-29T20:39:09

  • Administrator changed the description · Imported

    changed the description

    By Robert Mader on 2024-08-29T20:41:01

  • added camera type::feature labels

    • Author Owner
      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 libcamera :smile:

      By Pablo Correa Gomez on 2024-08-29T21:45:52

      Edited by Ghost User
  • Author Owner

    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 User
  • Administrator added 1 commit · Imported

    added 1 commit

    • 8d627079 - kconfigcheck: Add udmabuf instead of cma heaps for libcamera

    Compare with previous version

    By Robert Mader on 2024-08-29T21:45:41

  • Administrator added 1 commit · Imported

    added 1 commit

    • 7d4d5ca6 - kconfigcheck: Add udmabuf instead of cma heaps for libcamera

    Compare with previous version

    By Robert Mader on 2024-08-29T21:48:27

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading