Commit Graph

6211 Commits

Author SHA1 Message Date
Naushir Patuck
a0f996c21c ipa: rpi: imx500: Update exposure profiles
Allow the max gain to go upto 16x.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
David Plowman
2c5a3a0e9c ipa: rpi: awb: Update neural network AWB tunings for vc4 platform
The network was trained against CT curves measured for PiSP, so use
those as results are generally a bit better.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2026-04-30 16:11:18 +03:00
David Plowman
aa7e6d7e2e ipa: rpi: Update imx500 tuning files to include neural network AWB
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Richard Oliver
4ee74d6373 ipa: rpi: Expose frameCount in extracted IMX500 tensors
When injecting input tensors, the output results are expected to be made
available at a specific frame. This change exports tensors' frameCount
so that an appropriate comparison can be made by the controlling
application.

Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Konsta
5ae5aea2e1 pipeline: rpi: pisp: Use correct cfe devices
* Raspberry Pi 5 ISP (PiSP) support submitted to upstream libcamera is
  different from their own libcamera fork [1].
* These match the naming used in driver that was merged in upstream
  Linux 6.13 kernel [2].
* Revert back to the correct cfe devices that match the current kernel [3].

[1]: https://github.com/raspberrypi/libcamera
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/media/platform/raspberrypi/rp1-cfe/cfe.c#n126
[3]: 317477113b/drivers/media/platform/raspberrypi/rp1_cfe/cfe.c (L139-L194)
2026-04-30 16:11:18 +03:00
Naushir Patuck
df8ba90d44 pipeline: rpi: pisp: Enable FE stats crop if needed
If the decimation width is greater than the max stats width, add a
centre crop on the image to allow the stats to be gathered correctly.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Naushir Patuck
ac83d6fb72 RASPBERRYPI ONLY: Handle mandatory stream flags
Look for the RAW mandatory stream flag in the pipeline handler config
file. If this flag is set, it guarantees that the application will
provide buffers for Unicam Image, so override the minUnicamBuffers and
minTotalUnicamBuffers config parameters in the following way:

- If startup drop frames are required, allocate at least 1 internal buffer.
- If no startup drop frames are required, do not allocate any internal buffers.

Look for the Output 0 mandatory stream flag in in the pipeline handler
config file. If this flag is set, it guarantees that the application
will provide buffers for the ISP, do not allocate any internal buffers
for the device.

Add a new rpi_apps.yaml pipeline handler config file that enables both
these flags.  To use the file, set the following env variable for a
custom build:

export LIBCAMERA_RPI_CONFIG_FILE=/usr/local/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml

or for a packaged install:

export LIBCAMERA_RPI_CONFIG_FILE=/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Naushir Patuck
7b1d459071 ipa: rpi: imx500: Fix stringop-truncation warning
This warning is issued by the compiler because the strncpy copies across
the whole string array, leaving no place for the nul terminator. Fix it
by copying sizeof(str) - 1 elements.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Naushir Patuck
ad64f9e8cc ipa: rpi: Add support for the Sony IMX500 camera sensor
Add a Sony IMX500 camera helper to the IPA. This also includes support
for the on-chip CNN hardware accelerator and parsing of the neural
network data stream returned in the metadata buffer.

Add tuning files for both VC4 and PiSP platforms.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Naushir Patuck
81fd85c271 ipa: rpi: Handle the new CNN controls in the IPA
Add code to handle the new CNN vendor controls in the Raspberry Pi IPA.

The value of CnnInputTensorInfo is cached as it is the only stateful
input control.

All other controls are output controls, and the values are copied into
directly from the rpiMetadata object if present. The camera helpers
populate the rpiMetadata object if the sensor supports on-board CNN
processing, such as the IMX500.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:18 +03:00
Naushir Patuck
6405af684d controls: ipa: rpi: Add CNN controls
Add the follwing RPi vendor controls to handle Convolutional Neural
Network processing:

CnnOutputTensor
CnnOutputTensorInfo
CnnEnableInputTensor
CnnInputTensor
CnnInputTensorInfo
CnnKpiInfo

These controls will be used to support the new Raspberry Pi AI Camera,
using an IMX500 sensor with on-board neural network processing.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2026-04-30 16:11:17 +03:00
Kieran Bingham
183e37362f libcamera v0.7.1
This release brings 142 commits with the largest developments in the core of
libcamera components. Perhaps the most obvious is that we now use C++20 for the
project. The Configuration file handling has had a substantial rework with
updates to the yaml_parser.

The RKISP1 IPA has now added a new Hue control which brought with it a rework
of how we manage fixed point arithmetic with the Quantized class. I hope this
makes it easier to convey types with hardware operations.

The SoftISP has the ability to perform CPU debaying with multiple threads which
helps throughput on platforms such as the Arduino Uno Q.

The Mali-C55 pipeline handler now has full support for the RZG2LCRU and inline
handling which enables camera support on the Renesas RZ/V2H and RZ/V2NP
platforms.

And of interest in the apps components, the gstreamer plugin now has the
ability to select and configure the sensor mode configuration properties.
Finally a new script "libcamera-bug-report" is available to be packaged which
will help users identify issues when reporting bugs.

Contributors:

    64  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    28  Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
    21  Kieran Bingham <kieran.bingham@ideasonboard.com>
     8  Hans de Goede <johannes.goede@oss.qualcomm.com>
     7  Jacopo Mondi <jacopo.mondi@ideasonboard.com>
     3  David Plowman <david.plowman@raspberrypi.com>
     3  Milan Zamazal <mzamazal@redhat.com>
     3  Naushir Patuck <naush@raspberrypi.com>
     2  Stefan Klug <stefan.klug@ideasonboard.com>
     1  Daniel Scally <dan.scally@ideasonboard.com>
     1  Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
     1  van Veen, Stephan <stephan.vanveen@karlstorz.com>

142 commits,  319 files changed, 5346 insertions(+), 8486 deletions(-)

Integration Overview:

ABI:

The abi-compliance checker reports 100% compatibility in this release,
so the SONAME is maintained at 0.7.

Validating ABI compatibility between v0.7.0 and v0.7.1
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

The following commits in this release relate to either a bug fix or an
improvement to an existing commit.

bugs:
 - libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
   - Fixes: 1784e08be3 ("libcamera: dw100_vertexmap: Implement parametric dewarping")
 - py: Disable `-Winvalid-offsetof`
   - Link: https://github.com/pybind/pybind11/pull/5824
 - libcamera: software_isp: Set initial values of DebayerParams
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/311
 - py: Fix include order
   - Link: https://github.com/python/cpython/issues/61322
 - ipa: simple: Fix `again10` value with sensor helper
   - Fixes: 950ca85e8a ("ipa: software_isp: AGC: Do not lower gain below 1.0")
 - apps: qcam: Fix clang build
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/315
 - apps: qcam: Show `QImageWriter` errors
   - Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/313
 - gstreamer: Add `-Wno-volatile` for GCC
   - Link: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
 - treewide: Use character literal instead of string in some cases
   - Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
 - Documentation: Enable treeview generation for doxygen < 1.13.0
   - Fixes: 42d914f20c ("Documentation: Enable doxygen-awesome-css")
 - gstreamer: Add sensor-config property
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/300
 - utils: update-kernel-headers: Fix destination path
   - Fixes: ee8f88fc64 ("include: linux: Add v4l2-isp.h")
 - libcamera: egl: Remove `eGLImage::image_`
   - Fixes: f520b29fe9 ("libcamera: software_isp: debayer_egl: Add an eGL Debayer class")
 - libcamera: pipeline: rkisp1: Fix buffer queue memleaks
   - Fixes: c8f63760e5 ("pipeline: rkisp1: Support raw Bayer capture at runtime")
 - ipa: rpi: awb_nn: Rename YamlObject to ValueNode
   - Fixes: 554c5c7fa1 ("libcamera: Rename YamlObject to ValueNode")

And the following updates have been made in this release, grouped by category:

core:
 - libcamera: base: Add missing `private.h` includes
 - meson: Add `libdw` option to control libdw dependency
 - libcamera: converter: converter_dw100_vertexmap: Fix dewarp parameter p2 handling
 - libcamera: controls: Define a new core Hue control
 - libcamera: Replace iterators with structured bindings
 - libcamera: Replace iterators with range-based for loops
 - libcamera: Use `it` variable name for iterators only
 - libcamera: Standardize on 'const auto'
 - libcamera: rpi: Make the controller min frame duration configurable
 - utils: Add missing SPDX headers to scripts
 - meson: Ignore `Wredundant-move` with GCC 11 and above
 - libcamera: base: log: Ignore deprecations
 - treewide: Use character literal instead of string in some cases
 - meson: Switch to C++20
 - meson: Add options to control drm, sdl2, jpeg dependencies of `cam`
 - meson: Add `apps-output-dng` option to control libtiff dependency
 - meson: Drop unnecessary egl, gles feature defines
 - meson: Add `egl.cpp` to sources alongside `debayer_egl.cpp`
 - meson: Simplify condition
 - meson: Remove `gles_headless_enabled`
 - meson: Use dependency object when checking for headers
 - meson: Move egl related dependencies to `software_isp` subdir
 - meson: Guard softisp gpu acceleration with feature option: softisp-gpu
 - utils: raspberrypi: Remove Raspberry Pi CTT from the source tree
 - utils: raspberrypi: Add a README.md to the old RPi CTT directory
 - libcamera: Make converter/softISP configure()'s outputCfgs argument really const
 - utils: Introduce libcamera-bug-report
 - libcamera: properties: Add a pipeline handler name property
 - libcamera: camera: Report the pipeline handler name
 - subprojects: Add nlohmann_json to .gitignore
 - reuse: Convert to REUSE.toml
 - reuse: Update file paths in REUSE.toml
 - reuse: Drop unnecessary entry from REUSE.toml
 - reuse: Add missing files to REUSE.toml
 - libcamera: Add missing SPDX headers
 - libcamera: rpi: Add missing SPDX headers
 - include: linux: Convert drm_fourcc.h to use SPDX
 - meson: Print soft ISP boolean options as YES/NO
 - meson: Print missing application options in summary
 - utils: update-kernel-headers: Fix destination path
 - meson: Use <version> header for C++ library version check
 - libcamera: egl: Remove `eGLImage::image_`
 - utils: checkstyle: Add license commit checker
 - libcamera: Drop unneeded usage of this pointer
 - libcamera: Replace plain pointers with std::unique<>
 - libcamera: pipeline_handler: Add createIPA() function
 - libcamera: camera_manager: Move IPAManager creation to start() time
 - libcamera: utils: Add overloaded visitor helpers
 - libcamera: yaml_parser: Use std::make_unique<>
 - libcamera: yaml_parser: Rename Container to ValueContainer
 - libcamera: yaml_parser: Rename Getter to Accessor
 - libcamera: yaml_parser: Replace getList() with get() specializations
 - libcamera: yaml_parser: Add function to set a YamlObject value
 - libcamera: yaml_parser: Add functions to add children
 - libcamera: yaml_parser: Un-friend YamlParserContext from YamlObject
 - libcamera: yaml_parser: Move Size handling to geometry.cpp
 - libcamera: yaml_parser: Drop unneeded \fn Doxygen commands
 - libcamera: yaml_parser: Split YamlObject from YamlParser
 - libcamera: yaml_object: Miscellaneous documentation improvements
 - libcamera: Rename YamlObject to ValueNode
 - libcamera: value_node: Add constructor with value
 - libcamera: value_node: Rework templates to prepare for mutable views
 - libcamera: value_node: Add mutable adapters
 - libcamera: value_node: Add mutable children accessors
 - libcamera: value_node: Support adding nested children in one operation
 - libcamera: value_node: Support looking up descendant node by path
 - libcamera: value_node: Add functions to erase child nodes
 - libcamera: Pass CameraManager around instead of GlobalConfiguration
 - libcamera: global_configuration: Reorder functions
 - libcamera: global_configuration: Add missing include and comment
 - libcamera: global_configuration: Rename yamlConfiguration_
 - libcamera: global_configuration: Rename Configuration to Option
 - libcamera: global_configuration: Drop Option type
 - libcamera: global_configuration: Populate empty configuration
 - libcamera: global_configuration: Override options with environment variables

ipa:
 - libcamera: ipa: simple: Fix multiplication order in Awb
 - ipa: rkisp1: Fix awb algorithm brief
 - ipa: simple: Remove duplicate header inclusion
 - ipa: libipa: Provide a Quantized data type support
 - ipa: libipa: fixedpoint: Fix unsigned usage
 - ipa: libipa: Provide fixed point quantized traits
 - ipa: rkisp1: cproc: Convert to use Quantized types
 - ipa: rkisp1: cproc: Report metadata
 - ipa: rkisp1: cproc: Provide a Hue control
 - ipa: rkisp1: ccm: Use Q<4, 7> format directly
 - ipa: mali-c55: Reduce AWB calculations to float precision
 - ipa: mali-c55: Convert AWB to UQ<4, 8> usage
 - ipa: mali-c55: agc: Quantise the ISP Digital Gain
 - ipa: libipa: fixedpoint: Move float conversion inline
 - ipa: rpi: awb_nn: Remove unused constexpr variable
 - ipa: simple: Fix `again10` value with sensor helper
 - ipa: libipa: quantized: Enable `constexpr` operation
 - ipa: rpi: Fix gamma lookup table generation for PiSP platform
 - utils: ipc: extract-docs: Work around reuse tool problem
 - ipa: rpi: awb_nn: Rename YamlObject to ValueNode

pipeline:
 - libcamera: software_isp: debayer: Take `DebayerParams` by ref
 - libcamera: software_isp: Remove redundant include of time.h
 - libcamera: software_isp: Fix LIBCAMERA_SOFTISP_MODE log print
 - libcamera: software_isp: debayer_egl: Remove `frameSize()`
 - libcamera: software_isp: Set initial values of DebayerParams
 - libcamera: software_isp: Convert TODO list to markdown
 - libcamera: software_isp: Move GPU TODO items to TODO.md
 - libcamera: software_isp: debayer: Add missing `override`
 - libcamera: software_isp: debayer_egl: Remove unnecessary declarations
 - libcamera: pipeline: rkisp1: Fix buffer queue memleaks
 - libcamera: mali-c55: Add RZG2LCRU class
 - libcamera: mali-c55: Split TPG and Inline camera handling
 - libcamera: mali-c55: Register memory input camera
 - libcamera: mali-c55: Configure camera in memory-to-memory
 - libcamera: mali-c55: Do not rely on bufferCount
 - libcamera: mali-c55: Implement capture for memory-to-memory
 - libcamera: mali-c55: Fix sensor size computation

test:
 - test: Remove uses of `O_TMPFILE`
 - test: libipa: Add tests for Quantized types
 - test: libipa: Provide FixedPoint Quantized tests
 - test: libipa: Remove legacy fixed point conversion test
 - test: ipa: ipa_interface: Use IPAManager::createIPA()
 - test: ipa: ipa_interface: Replace FIFO with pipe
 - test: Add ValueNode unit test
 - test: yaml-parser: Simplify test
 - test: yaml-parser: Standardize on explicitly qualifying std namespace
 - test: yaml-parser: Fix typos in error messages
 - test: yaml-parser: Replace "object" with "node"

softisp:
 - software_isp: benchmark: Add missing _ postfix to measure data member
 - software_isp: benchmark: Print what is being benchmarked
 - software_isp: swstats_cpu: Prepare for multi-threading support
 - software_isp: debayer_cpu: Add DebayerCpuThread class
 - software_isp: debayer_cpu: Add multi-threading support
 - software_isp: Log input config from configure()

apps:
 - android: camera_stream: Include <poll.h> instead of <sys/poll.h>
 - py: Disable `-Winvalid-offsetof`
 - py: Fix include order
 - apps: qcam: Fix clang build
 - apps: qcam: Show `QImageWriter` errors
 - gstreamer: Add `-Wno-volatile` for GCC
 - cam: Add option to report libcamera version
 - gstreamer: Add sensor-config property

documentation:
 - Documentation/runtime_configuration: Add missing software_isp.mode doc
 - Documentation: Enable treeview generation for doxygen < 1.13.0
 - Documentation: Update to C++20
 - Documentation: Rename runtime configuration title

tuning:
 - tuning: Handle macbeth_ref.pgm license through REUSE.toml

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-04-28 19:13:28 +01:00
Laurent Pinchart
4765309efe ipa: rpi: awb_nn: Rename YamlObject to ValueNode
The global rename of YamlObject to ValueNode in commit 554c5c7fa1
missed awb_nn.cpp. Fix it.

Fixes: 554c5c7fa1 ("libcamera: Rename YamlObject to ValueNode")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-04-24 20:33:28 +03:00
Laurent Pinchart
7227dd4b40 Documentation: Rename runtime configuration title
The Documentation/runtime_configuration.rst file has a title that
mentions "variables" to refer to environment variables. Spell it out
fully for clarity.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:35 +03:00
Laurent Pinchart
16063986bb libcamera: global_configuration: Override options with environment variables
libcamera supports several environment variables that can override
configuration options. This requires components that use such overrides
to call the special envOption() and envListOption() functions, spreading
knowledge of the overrides through the code base. This will hinder
future enhancements to the global configuration, such as implementing
per-camera options that will override pipeline handler-level options. To
prepare for that, move handling of the environment variables to the
GlobalConfiguration class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:09:31 +03:00
Laurent Pinchart
f06ad77043 libcamera: global_configuration: Populate empty configuration
If no configuration file can be parsed, populate an empty configuration.
This will serve as a base to store the configuration options set through
environment variables.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:18 +03:00
Laurent Pinchart
0ef232b486 libcamera: global_configuration: Drop Option type
The GlobalConfiguration::Option type was introduced to decouple the
configuration option storage from its users, and make changes to the
underlying implementation easier. While the type could indeed be changed
to map to a different class, the API would need to remain the same. The
Option type therefore brings little value. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:15 +03:00
Laurent Pinchart
24c965a234 libcamera: global_configuration: Rename Configuration to Option
The GlobalConfiguration::Configuration type represent a configuration
option. Rename it to Option to make this clearer. This shortens lines as
an added bonus.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:12 +03:00
Laurent Pinchart
800a861b01 libcamera: global_configuration: Rename yamlConfiguration_
Once parsed, the global configuration isn't a YAML file anymore. Rename
the yamlConfiguration_ to configuration_.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:11 +03:00
Laurent Pinchart
49d87c613b libcamera: global_configuration: Add missing include and comment
global_configuration.h uses std::initializer_list, include the
corresponding header. Add a comment in global_configuration.cpp to close
an anonymous namespace, as mandated by the coding style.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:09 +03:00
Laurent Pinchart
e2aea3f4e1 libcamera: global_configuration: Reorder functions
Member functions should be implemented in the .cpp file in the same
order as in the class definition, within each access group. Move them to
the right location. While at it, move load() before loadFile() in the
class definition to match execution order, making the code easier to
read.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:07 +03:00
Laurent Pinchart
1c3e1baa6e libcamera: Pass CameraManager around instead of GlobalConfiguration
The GlobalConfiguration is explicitly passed around through constructors
of various objects that need access to the configuration. This ad-hoc
solution works for the specific use cases it was meant to support, but
isn't very generic. We have a top-level object in libcamera, the
CameraManager, that also needs to be accessed from various locations and
is passed to object constructors. Standardize on passing the
CameraManager everywhere, and access the global configuration through
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:05 +03:00
Laurent Pinchart
9cff4b757a test: yaml-parser: Replace "object" with "node"
Now that the storage class for the property tree storing data parsed
from YAML has been renamed from YamlObject to ValueNode, rename
variables and update error messages accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:09:03 +03:00
Laurent Pinchart
9c4e8f0b6c test: yaml-parser: Fix typos in error messages
The unit test contains a few typos in error messages. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:09:02 +03:00
Laurent Pinchart
0561f9abb9 test: yaml-parser: Standardize on explicitly qualifying std namespace
yaml-parser.cpp mixes unqualified and qualified identifier in the std
namespace. Standardize on qualified identifiers, and drop the
"using namespace std" statement.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:09:00 +03:00
Laurent Pinchart
d23a90f4b8 test: yaml-parser: Simplify test
Most of the tests in the YamlParser unit test cover the ValueNode class.
They are now implemented in the ValueNode unit test. Drop them, and only
keep the tests that related to YAML parsing.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:58 +03:00
Laurent Pinchart
16502c7bd8 test: Add ValueNode unit test
Add a unit test for the ValueNode class. The tests focus on the class
itself, without considering that is currently only used when parsing
YAML files. This duplicates some of the tests of the YamlParser class,
which will be dropped from the corresponding unit test in a subsequent
change.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:55 +03:00
Laurent Pinchart
52e65c9f38 libcamera: value_node: Add functions to erase child nodes
There will be a need to erase child nodes when implementing support for
overriding configuration options. Add two erase() functions to the
ValueNode class, mimicking the add() API.

More erase() overloads could be added, for instance taking iterators as
parameters, to improve efficiency. This should be considered later, when
usage of the ValueNode class will expand, based on the actual usage
patterns.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:51 +03:00
Laurent Pinchart
bb1f1f1da9 libcamera: value_node: Support looking up descendant node by path
Looking up a descendant node based on a path is a common operation. Add
a helper function to do so, to avoid loops in the callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:48 +03:00
Laurent Pinchart
719dbcdcde libcamera: value_node: Support adding nested children in one operation
The GlobalConfiguration class will need to add nested children to a
ValueNode. Add a new overload to the add() function for this purpose.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:44 +03:00
Laurent Pinchart
eafc366012 libcamera: value_node: Add mutable children accessors
Add two at() functions that return mutable pointer to child nodes, based
on an index for lists and a key for dictionaries.

The API differs from const children accessors that use operator[] and
return a reference in order to allow better error handling: while the
const accessors return a reference to a global instance of an empty
ValueNode when the requested child doesn't exist, a mutable accessor
can't do the same without allowing modifying the empty global instance.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:41 +03:00
Laurent Pinchart
b25556c691 libcamera: value_node: Add mutable adapters
The ValueNode class was initially designed to store read-only property
trees. It is useful to also provide mutable access. Add non-const
adapters and iterators and adapters. This allows obtaining a mutable
ValueNode instance when traversing a tree.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:38 +03:00
Laurent Pinchart
49aa81b9ec libcamera: value_node: Rework templates to prepare for mutable views
ValueNode provides adapter classes to expose the object as an iteratable
list or dictionary. The Iterator and Adapter classes hardcode the
assumption that the ValueNode is const. To prepare for mutable views,
move the const specifier to the top-level DictAdapter and ListAdapter
class templates.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:36 +03:00
Laurent Pinchart
7f854199a3 libcamera: value_node: Add constructor with value
The new constructor takes a value, allowing creation of a leaf ValueNode
with a value in a single operation instead of having to call set() on an
empty node.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:32 +03:00
Laurent Pinchart
554c5c7fa1 libcamera: Rename YamlObject to ValueNode
The YamlObject class is now a generic data container to model trees of
values. Rename it to ValueNode and expand the class documentation.

While at it, drop the unneeded libcamera:: namespace prefix when using
the ValueNode class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:25 +03:00
Laurent Pinchart
9be3ed8104 libcamera: yaml_object: Miscellaneous documentation improvements
Fix a few documentation issues:

- Drop unneeded \fn
- Sort \brief and \tparam correctly
- Add missing \tparam and \param
- Explain the T and U template parameters for get()
- Standardize the naming of dictionary keys as "key"
- Fix typo

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:19 +03:00
Laurent Pinchart
7133680dd7 libcamera: yaml_parser: Split YamlObject from YamlParser
The YamlObject class was designed to represent data parsed from YAML
files. It is outgrowing the initial needs. Move it to a separate file to
prepare for a rename.

Most files that include yaml_parser.h only need access to a YamlObject.
Switch them to yaml_object.h. pipeline_base.cpp was including
yaml_parser.h indirectly through pipeline_base.h, include it directly
now.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:16 +03:00
Laurent Pinchart
31a817cda2 libcamera: yaml_parser: Drop unneeded \fn Doxygen commands
There's no need to specify the function name in Doxygen comment blocks
with \fn if the documentation directly precedes the function definition.
Drop the unneeded \fn.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:11 +03:00
Laurent Pinchart
bc0318e8c8 libcamera: yaml_parser: Move Size handling to geometry.cpp
The YamlObject::Accessor structure is designed to extend the YamlObject
class with new getter and setter types without modifying
yaml_parser.cpp. This feature is used for various libcamera classes,
while standard C++ types are handled in yaml_parser.cpp.

The Size class is an outlier: it is a libcamera class, but is handled in
yaml_parser.cpp. Move it to geometry.cpp. Drop the std::vector<Size>
specialization as it is currently unused.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:08:09 +03:00
Laurent Pinchart
2894f2c14b libcamera: yaml_parser: Un-friend YamlParserContext from YamlObject
YamlParserContext is a friend of the YamlObject class to access private
member variables. Now that YamlObject exposes functions to set a value
and add children, this is not needed anymore. Decouple the two classes.

The YamlParserContext::readValue() function now takes a const reference
to the EventPtr as the YamlParserContext::parseNextYamlObject() function
needs to access it in the error handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:05 +03:00
Laurent Pinchart
f59a6f6857 libcamera: yaml_parser: Add functions to add children
Add YamlObject::add() functions to add children to a list or dictionary
object. This will be used by the YamlParserContext to replace direct
access to YamlObject member variables to decouple the two classes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:08:01 +03:00
Laurent Pinchart
6657a19247 libcamera: yaml_parser: Add function to set a YamlObject value
Add a YamlObject::set() function to set the value of an object, with
specializations for scalar types.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:07:57 +03:00
Laurent Pinchart
3a387cc81d libcamera: yaml_parser: Replace getList() with get() specializations
The YamlObject class has two member function templates to get values:
the get() function gets a scalar value, while the getList() function
gets a vector of scalar values.

As get() is a function template, we can provide specializations for
vector types. This makes the code more systematic, and therefore more
readable. Replace all getList() occurrences, and drop the getList()
function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 18:07:53 +03:00
Laurent Pinchart
56e679ee09 libcamera: yaml_parser: Rename Getter to Accessor
In preparation for support to set the value of a YamlObject, rename the
Getter structure to Accessor. The structure will be extended with a
set() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:07:50 +03:00
Laurent Pinchart
c6aace4467 libcamera: yaml_parser: Rename Container to ValueContainer
The YamlObject class defines two private types, Container and
ListContainer. The format is an alias to std::vector<Value>, and is used
to store child elements. The latter hasn't been used since commit
38987e165c ("libcamera: yaml_parser: Preserve order of items in
dictionary").

To prepare for upcoming reworks that will use the name 'Container' as a
template parameter, rename Container to ValueContainer for clarity, and
drop the unused ListContainer type.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 18:07:48 +03:00
Laurent Pinchart
01f5db9559 libcamera: yaml_parser: Use std::make_unique<>
The YamlParser::parse() function constructs a std::unique_ptr<> instance
with a manual call to operator new. Replace it with std::make_unique<>.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2026-04-24 18:07:44 +03:00
Jacopo Mondi
178007f8ad libcamera: mali-c55: Fix sensor size computation
The last size in the list is always selected unconditionally because
the current best distance is not updated properly during the search.

Fix the size computation procedure which has an inverted assignment.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Tested-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-04-24 14:38:44 +01:00
Jacopo Mondi
88c636b097 libcamera: mali-c55: Implement capture for memory-to-memory
Plumb in the MaliC55 pipeline handler support for capturing frames
from memory using the CRU.

Introduce a data flow which uses the CRU to feed the ISP through
the IVC.

In detail:

- push incoming request to a pending queue until a buffer from the CRU
  is available
- delay the call to ipa_->fillParams() to the CRU buffer ready event
- once the IPA has computed parameters feed the ISP through the IVC
  with buffers from the CRU, params and statistics
- Handle completion of in-flight requests: in m2m mode buffers are
  queued earlier to the ISP capture devices. If the camera is stopped
  these buffers are returned earlier in error state: complete the
  Request bypassing the IPA operations
- As cancelled Requests might now be completed earlier then IPA events,
  modify the IPA event handler to ignore Requests that have been
  completed already

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-04-24 14:38:27 +01:00
Jacopo Mondi
e14c06c19a libcamera: mali-c55: Do not rely on bufferCount
Do not rely on bufferCount for the allocation of parameters and stats
buffers but add instead kMaliC55BufferCount which is also used to limit
the number of in-flight requests supported by the pipeline handler.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 10:22:48 +02:00
Jacopo Mondi
3b6c01fd94 libcamera: mali-c55: Configure camera in memory-to-memory
Add support for memory-to-memory Camera to the
PipelineHandlerMaliC55::configure() function.

Start by enabling the IVC links, then configure the CRU and
propagate the format to the IVC.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2026-04-24 10:22:48 +02:00