Commit Graph

5923 Commits

Author SHA1 Message Date
Bryan O'Donoghue
3d7ef342b7 libcamera: software_isp: lut: Make CCM available in debayer params
Provide the CCM calculated in LUT to the debayer params structure for
consumption in the debayer shaders.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:52 +00:00
Bryan O'Donoghue
0640f5ac11 libcamera: software_isp: debayer: Make the debayer_ object of type class Debayer not DebayerCpu
Make the type of object Debayer not DebayerCpu thus allowing us to assign
the object to either DebayerCpu or DebayerEGL.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:52 +00:00
Bryan O'Donoghue
4cb388a1eb libcamera: software_isp: debayer: Introduce a start() / stop() methods to the debayer object
In order to initialise and deinitialise gpuisp we need to be able to setup
EGL in the same thread as Debayer::process() happens in.

This requires extending the Debayer object to provide start and stop
methods which are triggered through invokeMethod in the same way as
process() is.

Introduce start() and stop() methods to the Debayer class. Trigger those
methods as described above via invokeMethod. The debayer_egl class will
take care of initialising and de-initialising as necessary. Debayer CPU
sees no functional change.

Per feedback from Barnabas the stop method is using blocking
synchronisation and thus we drop ispWorkerThread_.removeMessages().

[bod: Made method blocking not queued per Robert's bugfixes]
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:52 +00:00
Bryan O'Donoghue
364886fb13 libcamera: software_isp: Move isStandardBayerOrder to base class
isStandardBayerOrder is useful to both CPU and GPU debayer logic and
reusable as-is for both.

Move to shared location in base class.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:52 +00:00
Bryan O'Donoghue
c9f3e09634 libcamera: software_isp: Make output DMA sync contingent
The DMA sync output buffer from the GPU need only have its cache
invalidated if the CPU is going to modify the buffer. Right now this is
not required for gpuisp so only act on the output buffer if it is
non-null.

Suggested-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:52 +00:00
Bryan O'Donoghue
6b224d91a9 libcamera: software_isp: Move DMA Sync code to Debayer base class
We can reuse the DMA Sync code in the GPUISP. Move the code we need to
the base class.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:51 +00:00
Bryan O'Donoghue
e3c74bbc89 libcamera: software_isp: Move param select code to Debayer base class
Move the parameter selection code into the Debayer base class in-order to
facilitate reuse of the lookup tables in the eGL shaders.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:51 +00:00
Bryan O'Donoghue
cafb39b257 libcamera: software_isp: Move Bayer params init from DebayerCpu to Debayer
Move the initialisation of Bayer params and CCM to a new constructor in the
Debayer class.

Ensure we call the base class constructor from DebayerCpu's constructor in
the expected constructor order Debayer then DebayerCpu.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:51 +00:00
Bryan O'Donoghue
d635cd884e libcamera: software_isp: Move useful items from DebayerCpu to Debayer base class
The DebayerCpu class has a number of variables, embedded structures and
methods which are useful to DebayerGpu implementation.

Move relevant variables and methods to base class.

Since we want to call setParams() from the GPUISP and reuse the code in
the existing CPUISP as a first step, we need to move all of the
dependent variables in DebayerCPU to the Debayer base class including
LookupTable and redCcm_.

The DebayerEGL class will ultimately be able to consume both the CCM and
non-CCM data.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:51 +00:00
Hans de Goede
134f926346 libcamera: swstats_cpu: Add processFrame() method
Add a method to the SwstatsCpu class to process a whole Framebuffer in
one go, rather then line by line. This is useful for gathering stats
when debayering is not necessary or is not done on the CPU.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[bod: various rebase splats fixed]
[bod: Added constructor Doxygen header]
[bod: Squashed a fix from Hans to calculate stats on every 4th frame]
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:51 +00:00
Hans de Goede
bf51f39f3b libcamera: software_isp: Move benchmark code to its own class
Move the code for the builtin benchmark to its own small
Benchmark class.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[bod: Fixed up some drift in this patch since initial propostion]
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:32:50 +00:00
Hans de Goede
4da17de043 libcamera: swstats_cpu: Move header to libcamera/internal/software_isp
Move the swstats_cpu.h file to include/libcamera/internal/software_isp/
so that it can be used outside the src/libcamera/software_isp/ directory.

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Hans de Goede
85cba34493 libcamera: swstats_cpu: Drop patternSize_ documentation
patternSize_ is a private variable and its meaning is already documented
in the patternSize() getter documentation.

Move the list of valid sizes to the patternSize() getter documentation
and drop the patternSize_ documentation.

While at it also add 1x1 as valid size for use with future support
of single plane non Bayer input data.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Hans de Goede
7092566187 libcamera: swstats_cpu: Update statsProcessFn() / processLine0() documentation
Update the documentation of the statsProcessFn() / processLine0() src[]
pointer argument to take into account that swstats_cpu may also be used
with planar input data or with non Bayer single plane input data.

The statsProcessFn typedef is private, so no documentation is generated
for it. Move the new updated src[] pointer argument documentation to
processLine0() so that it gets included in the generated docs.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Bryan O'Donoghue
ab675bc06b meson: Automatically generate glsl_shaders.h from specified shader programs
Encode the bayer shader files into a header as part of the build process.
Qcam already compiles the shader files down into a QT resource file which
it references internally.

In order to share the debayering shader programs outside of qcam create a
generic header which both qcam and libcamera can operate from.

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Bryan O'Donoghue
19371dee41 utils: gen-shader-headers: Add a utility to generate headers from shaders
Two simple script to generate a header that contains GLSL shaders translated
to C arrays.

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Bryan O'Donoghue
8e5a669b29 libcamera: shaders: Move GL shader programs to src/libcamera/assets/shader
Moving the vertex and fragment shaders to src/libcamera/shaders to
allow for reuse of these inside of the SoftISP.

A comment has been added to src/apps/qcam/meson.build to force a
rebuild.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-12 23:07:01 +00:00
Milan Zamazal
0a9cf7e0eb libcamera: simple: Move colour space logging after adjustment
The log message about adjusting an unspecified colour space should log
the value after, not before, the adjustment.

Fixes: 5a33bc10e9 ("libcamera: software_isp: Assign colour spaces in configurations")
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Umang Jain <uajain@igalia.com>
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-12-04 19:32:48 +00:00
Daniel Scally
f4c3dee217 libcamera: V4L2Subdevice: Get device by regexp
Some kernel drivers give their entities names that will differ from
implementation to implementation; for example the drivers for the
Camera Receiver Unit and CSI-2 receiver in the RZ/V2H(P) SoC give their
entities names that include their memory address, in the format
"csi-16000400.csi2". Passing that entity name to
V4L2Subdevice::fromEntityName() is too inflexible given it would only
then work if that specific CSI-2 receiver were the one being used.

Add an overload for V4L2Subdevice::fromEntityName() to instead allow
users to pass a std::basic_regex, and use std::regex_search() instead
of a direct string comparison to find a matching entity. Ths allows
us to form regular expressions like "csi-[0-9a-f]{8}.csi2" to find
the entities.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-12-04 14:46:56 +01:00
Daniel Scally
1e92c4cc0d libcamera: media_device: Get entity by regexp
Some kernel drivers give their entities names that will differ from
implementation to implementation; for example the drivers for the
Camera Receiver Unit and CSI-2 receiver in the RZ/V2H(P) SoC give their
entities names that include their memory address, in the format
"csi-16000400.csi2". Passing that entity name to
MediaDevice::getEntityByName() is too inflexible given it would only
then work if that specific CSI-2 receiver were the one being used.

Add an overload for MediaDevice::getEntityByName() that accepts a
std::basic_regex instead of a string, and use std::regex_search()
instead of a direct string comparison to find a matching entity. This
allows us to search for entites using regex patterns like
"csi-[0-9a-f]{8}.csi2".

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-12-04 14:46:50 +01:00
Daniel Scally
8d068b7470 libcamera: device_enumerator: Support regex to match entity names
Some entities in a media graph have names that might differ from
implementation to implementation; for example the Camera Receiver
Unit and CSI-2 receiver on the RZ/V2H(P) SoC have entities with names
that include their address, in the form "csi-16000400.csi2". Passing
that entity name to DeviceMatch is too inflexible given it would only
work if that specific CSI-2 receiver were the one being used.

Add an overload for DeviceMatch::add() such that users can pass in a
std::regex instead of a string. Update DeviceMatch::match() to check
for entities that are matched by the regular expressions added with
the new overload after checking for any exact matches from the vector
of strings. This allows us to use regex to match on patterns like
"csi-[0-9a-f]{8}.csi2".

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-12-04 14:46:43 +01:00
Daniel Scally
1039a0f2ee libcamera: base: Wrap <regex.h>
Provide a wrapper for regex.h to work around the false-positive
compilation errors that crop up in some versions of gcc.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-12-04 14:46:40 +01:00
Jacopo Mondi
3a835ff48c libcamera: controls: Small style fixes
The Wdr controls have been added without an empty line between them and the
existing ones. Also, a line has a space at the end.

Fix it.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
2025-12-01 15:12:20 +01:00
Andrei Gansari
1a23227c65 pipeline: imx8-isi: Integrating MediaPipeline class
This change integrates the MediaPipeline class into the imx8-isi
pipeline handler. Purpose is to allow a dynamic discovery and
configuration of the actual subdevices graph between the sensor and
the ISI crossbar. This brings support for more complex topologies and
simplifies the implementation.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-27 16:37:57 +00:00
Andrei Gansari
056613cb12 libcamera: media_pipeline: Add accessor for MediaPipeline list of entities
Exposes internal MediaEntity::Entity list to help extracting more
information regarding linked entities.

For example, when the pad index of the last device in the list need to be
retrieved from the media pipeline user.

Exposes as const to with a dedicated access to prevent any corruption from
user. Then it is still protected so as when the list was private.

Since MediaPipeline::Entity needs also to be moved to public, then need to
add some documentation in cpp source. Existing documentation from header
file is applied when available.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-27 16:37:54 +00:00
Kieran Bingham
3c17d1fbb2 libcamera v0.6.0
The abi-compliance checker reports there are both ABI and API changes in this
release:

  Binary compatibility: 99.3%
  Source compatibility: 98.6%
  Total binary compatibility problems: 4, warnings: 1
  Total source compatibility problems: 18, warnings: 5

These have been planned to batch together a lot of recent development to
improve the public facing API, which has extended the previous merge window on
this occasion.

A full and detailed ABI report for those interested can always be generated
between any two versions with the internal tooling:

 "./utils/abi-compat.sh v0.5.2 v0.6.0"

Integration Overview:

With 211 commits and a longer merge window, this is quite a substantial
release.

Key highlights include a new global configuration file system which will
replace or extend the current use of environment variables to configure runtime
behaviours.

The core V4L2 classes can now support the V4L2 Request API - which in turn has
brought in huge developments for the i.MX8MP Dewarper support allowing full
resize, scale, rotate and crop capabilities on top of also performing lens
dewarping.

The SoftISP continues to develop, and specifically the IPU7 has been added as a
supported configuration to the pipeline.

New tuning files have been added for Raspberry Pi platforms, improving support
for the Sony IMX335, IMX415, IMX462, and ST VD55G1 image sensors, and Decompand
support has been added for the Raspberry Pi 5.

At the core, we now require Meson 1.0.1, and various improvements have been
made for thrad handling, improving synchronisation and event dispatch, as well
as fixing the serialisation operations for isolated IPA modules.

In the applications components, there are fixes to cam adding more output
formats and qcam now behaves more consistently when no camera is selected.  The
python bindings have received fixes for paths from meson, and the
FrameBuffer::planes wrapper.

On the Documentation side, there's a new theme refresh and clearer separation
between the internal and public API, and fixes to the contributing guidelines.

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

 - libcamera: base: semaphore: Do not unlock prematurely
   - Bug: https://bugs.libcamera.org/show_bug.cgi?id=225
 - apps: cam: Do not overwrite name when adding camera model
   - Fixes: aab49f903e ("cam: Do not assume Location is available")
 - Documentation: Fix documentation generation when subproject
   - Fixes: 0382d215db ("Documentation: Use Sphinx doxylink to generate links to doxygen")
 - apps: qcam: Do nothing if no camera is selected
   - Bug: https://bugs.libcamera.org/show_bug.cgi?id=177
 - utils: codegen: gen-formats.py: Fix big endian formats
   - Fixes: 7c496f1c54 ("utils: gen-formats: Support big-endian DRM formats")
 - pycamera: Fix FrameBuffer::planes wrapper
   - Fixes: b8d332cdcc ("libcamera: framebuffer: Replace vector with span in constructor")
 - libipa: agc_mean_luminance: Fix constraint logging
   - Fixes: 42e18c96bc ("libipa: agc_mean_luminance: Add debug logging")
 - libcamera: software_isp: Pass correct y-coordinate to stats
   - Bug: https://bugs.libcamera.org/show_bug.cgi?id=280
 - libcamera: controls: Expose string controls as `std::string_view`
   - Bug: https://bugs.libcamera.org/show_bug.cgi?id=256
 - pipeline: simple: Consider output sizes when choosing pipe config
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/236
 - ipa: rpi: vd56g3: Fix frameIntegrationDiff value
   - Reported-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
 - libcamera: rkisp1: Mark VBLANK as priority
   - Fixes: f72c76eb6e ("rkisp1: Honor the FrameDurationLimits control")
 - libcamera: base: thread: Use `pthread_self()` when setting name
   - Fixes: 559128b1f1 ("Thread: Add name parameter")
 - pipeline: imx8-isi: Delay ISI routes config to acquire() time
   - Fixes: 92df79112f ("pipeline: imx8-isi: Add multicamera support")
 - pipeline: simple: Reduce warning of unknown pixel formats
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/291
 - libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/281
 - libcamera: software_isp: Assign colour spaces in configurations
   - Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/294
 - libipa: exposure_mode_helper: Set quantizationGain in absence of a sensor helper
   - Fixes: f077c58e08 ("libipa: exposure_mode_helper: Take exposure/gain quantization into account")
 - ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints
   - Fixes: 24247a12c7 ("ipa: libipa: Add AgcMeanLuminance base class")
 - libcamera: control_serializer: Add array info to serialized ControlValue
   - Bug: https://bugs.libcamera.org/show_bug.cgi?id=285

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

core:
 - libcamera: converter_v4l2_m2m: Add missing `<set>` include
 - treewide: Remove top-level `const` from return types
 - libcamera: camera_sensor: getControls(): Use span
 - libcamera: camera_sensor: getFormat(): Use span
 - libcamera: ipa_proxy: Log configuration file path
 - libcamera: base: thread: eventDispatcher(): Not thread safe
 - libcamera: base: semaphore: Do not unlock prematurely
 - meson: Bump minimum version to v1.0.1
 - meson: Use dependency('dl')
 - libcamera: v4l2_videodevice: Avoid repeated calls to FrameBuffer::planes()
 - meson: Check for Python modules manually
 - libcamera: sensor: imx462: Add sensor delays to CameraSensorProperties
 - libcamera: clock_recovery: Use nanoseconds in addSample()
 - utils: Add unary negation operation to Duration
 - utils: codegen: ipc: Put default values in declaration
 - utils: codegen: ipc: Generate templated constructor
 - utils: codegen: gen-formats.py: Use jinja
 - utils: codegen: gen-formats.py: Fix big endian formats
 - libcamera: framebuffer: Replace vector with span in constructor
 - libcamera: request: addBuffer(): Do not destroy fence on failure
 - libcamera: camera_sensor_properties: Add vd55g1 camera sensor
 - include: linux: Partially update linux headers from v6.16-rc1-310-gd968e50b5c26
 - config: Introduce global runtime configuration
 - libcamera: camera_manager: Construct GlobalConfiguration instance
 - config: Add configuration retrieval helpers
 - camera_manager: Look up pipelines match list in configuration file
 - config: Check configuration file version
 - meson: Add option to disable libunwind integration
 - libcamera: base: thread: Make `removeMessages()` public
 - utils: codegen: ipc: Split proxy types
 - libcamera: controls: Expose string controls as `std::string_view`
 - subprojects: libpisp: Update to v1.3.0
 - libcamera: request: Clarify ReuseBuffers flag usage with fences
 - libcamera: base: utils: Simplify `enumerate()`
 - config: Fix doxygen 1.15.0 errors
 - libcamera: base: {unique,shared}_fd: Warn if closing fails
 - libcamera: base: utils: Simplify hex adaptor
 - libcamera: base: thread: Use `std::unique_ptr` instead of raw pointer
 - Thread: Add name parameter
 - libcamera: base: thread: Use `pthread_self()` when setting name
 - utils: checkstyle.py: Accept `Closes` commit trailer
 - libcamera: pipeline_handler: Add accessor for useCount_
 - subprojects: libyuv: Bump to version 1922
 - treewide: Use `argparse.FileType` in more places
 - libcamera: pipeline_handler: Fix requestComplete on waiting requests on stop
 - libcamera: base: thread: Use `acquire` memo. when reading event dispatcher
 - libcamera: request: Store fence `EventNotifier` directly
 - libcamera: ipa_data_serializer: Add specialization for enums
 - libcamera: simple: Detect Bayer pattern change during configure()
 - libcamera: converter: Utilise shared MediaDevice pointers
 - libcamera: Add support for V4L2 requests
 - libcamera: converter: Add V4L2 request support
 - libcamera: converter_v4l2_m2m: Add suport for V4L2 requests
 - libcamera: converter_v4l2_m2m: Always set stride
 - include: linux: Update headers for Dw100 dewarper engine
 - libcamera: converter_v4l2_m2m: Add helper to apply controls
 - libcamera: converter_v4l2_m2m: Add debug logging for formats
 - libcamera: converter: Add dw100 vertex map class
 - libcamera: converter: Add dw100 converter module
 - libcamera: internal: camera_sensor: Add accessor for mountingOrientation_
 - libcamera: Add transpose() function to size
 - libcamera: dw100_vertexmap: Implement parametric dewarping
 - libcamera: Add and implement LensDewarpEnable control
 - libcamera: control_serializer: Add array info to serialized ControlValue
 - Revert "controls: Add boolean constructors for ControlInfo"

pipeline:
 - pipeline: simple: Improve debug log in validate()
 - libcamera: pipeline: Avoid unnecessary indirection in frame info map
 - pipeline: ipu3: Drop unneeded forward declarations
 - pipeline: rkisp1: Replace error handling gotos with utils::exit_scope
 - pipeline: rpi: Use structured bindings in range-based for loop
 - pipeline: imx8-isi: Fix crossbar's sink pad computation
 - pipeline: simple: Enable simple pipelinehandler with SoftISP on Intel IPU7
 - pipelines: Use lambda functions to factor out buffer mapping code
 - pipeline: rkisp1: Add error log when parameter queuing fails
 - pipeline: rkisp1: Query kernel for available params blocks
 - rkisp1: agc: Agc add yTarget to frame context
 - pipeline: simple: Allow enabling software ISP via config file
 - libcamera: software_isp: Make input buffer copying configurable
 - libcamera: software_isp: Make measurement configurable
 - libcamera: pipeline: virtual: Move image generation to separate thread
 - libcamera: software_isp: Add valid flag to struct SwIspStats
 - libcamera: software_isp: Run sw-statistics once every 4th frame
 - libcamera: software_isp: Fix width adjustment in SwStatsCpu::setWindow
 - libcamera: software_isp: Clarify SwStatsCpu::setWindow use
 - libcamera: software_isp: Pass correct y-coordinate to stats
 - pipeline: simple: Initialize maxQueuedRequestsDevice to 4
 - pipeline: simple: Increase internal buffers for software ISP to 4
 - pipeline: simple: Allow buffer counts from 1 to 32
 - libcamera: software_isp: Clear pending async work
 - pipeline: simple: Avoid overusage of auto variables
 - libcamera: software_isp: Apply CCM swap also on green
 - pipeline: simple: Consider output sizes when choosing pipe config
 - libcamera: rkisp1: Mark VBLANK as priority
 - pipeline: imx8-isi: Delay ISI routes config to acquire() time
 - libcamera: software_isp: Fix gamma table when CCM is used
 - pipeline: simple: Reduce warning of unknown pixel formats
 - libcamera: pipeline: uvcvideo: Reject sensor configuration
 - libcamera: software_isp: Assign colour spaces in configurations
 - pipeline: virtual: Provide and validate colorspace
 - libcamera: pipeline: Utilise shared MediaDevice pointers
 - libcamera: rkisp1: Properly cancel buffers in dewarp case
 - libcamera: rkisp1: Move useDewarper_ flag into RkISP1CameraData
 - libcamera: rkisp1: Scale down in dewarper instead of resizer
 - libcamera: rkisp1: Allow upscaling when the dewarper is present
 - pipeline: rkisp1: Fix number of buffers imported into the dewarper
 - libcamera: rkisp1: Use the dw100 converter module instead of the generic v4l2 converter
 - pipeline: rksip1: Move isRaw up in scope
 - pipeline: rkisp1: Drop rawFormat variable
 - pipeline: rkisp1: Enable the dewarper based on the tuning file
 - libcamera: rkisp1: Handle requested orientation using dewarper
 - pipeline: rkisp1: Load dewarp parameters from tuning file

apps:
 - apps: common: options: Avoid copying in range based for loop
 - apps: cam: Do not overwrite name when adding camera model
 - apps: cam: drm: Drop unneeded local variable
 - py: libcamera: Improve python binding installation
 - py: libcamera: Get dependency from meson python module unconditionally
 - py: libcamera: Always use install path from meson python module
 - apps: qcam: Do nothing if no camera is selected
 - apps: cam: Support PPM output for other RGB formats
 - pycamera: Fix FrameBuffer::planes wrapper
 - apps: cam: Use signalfd
 - gstreamer: Update the TODO list
 - android: camera_hal_manager: Remove `cameraLocation()`
 - gstreamer: Associate libcamera::Stream with GstPad
 - gstreamer: Improve logging for buffer pool activation
 - gstreamer: Track RequestWrap's GstBuffer using GstPad
 - py: gen-py-formats.py: Open input file in binary mode
 - apps: cam: sdl_texture: Support NV21

documentation:
 - Documentation: Fix documentation generation when subproject
 - Documentation: Use python3 directly to check for doxylink version
 - Documentation: Use standard ordering for Doxyfile variables
 - Documentation: Add doxygen-awesome-css
 - Documentation: Enable doxygen-awesome-css
 - Documentation: Use the sphinx book theme
 - Documentation: Add api-html/ and internal-api-html/ to docs sources
 - Documentation: Reorganize toctree
 - Documentation: Improve Sphinx and Doxygen integration
 - Documentation: Drop unnecessary documentation-contents.rst
 - Documentation: mainpage: Make it easier to distinguish public and internal API
 - Documentation: Rename api to public-api and drop -html suffix
 - Documentation: Add global configuration file documentation
 - Documentation: Fix grammar and typo in meson.build comment
 - Documentation: contributing: Provide a reference to Matrix
 - Documentation: contributing: Update issue tracker
 - Documentation: contributing: Update Source references

ipa:
 - ipa: rpi: Add Arducam B0568 IMX335 tuning files
 - ipa: rpi: Add Arducam B0569 IMX415 tuning files
 - ipa: rpi:: denoise: Implement TDN back-off for CDN deviation
 - ipa: rpi: pisp: data: Improve noise and detail tuning
 - ipa: rpi: pisp: data: Update all non-official camera tuning files
 - ipa: rpi: vc4: Minor tuning changes
 - ipa: rpi: sdn: Remove legacy denoise warning
 - ipa: rpi: imx462: Add official RPi tuning for IMX462
 - ipa: rpi: ccm: Implement "manual" CCM mode
 - ipa: rpi: Add vd55g1 support for rpi
 - ipa: rpi: Add vd55g1 tuning files for rpi
 - libcamera: libipa: Add vd55g1 support for libipa
 - libcamera: libipa: camera_sensor: Add Himax HM1246 sensor properties
 - ipa: rkisp1: Add basic compression algorithm
 - libipa: camera_sensor_helper: Add quantizeGain() function
 - libipa: exposure_mode_helper: Take exposure/gain quantization into account
 - libipa: exposure_mode_helper: Remove double calculation of lastStageGain
 - libipa: exposure_mode_helper: Remove unnecessary clamp calls
 - libipa: agc_mean_luminance: Fix constraint logging
 - libipa: agc_mean_luminance: Configure the exposure mode helpers
 - libipa: exposure_mode_helper: Calculate quantization gain in splitExposure()
 - ipa: rkisp1: agc: Add correction for exposure quantization
 - ipa: rkisp1: Switch histogram to RGB combined mode
 - libipa: agc_mean_luminance: Introduce effectiveYTarget() accessor
 - libipa: agc_mean_luminance: Add support for additional constraints
 - ipa: rkisp1: Add WDR algorithm
 - ipa: Look up IPA configurables in configuration file
 - ipa: rpi: agc: Allow exposure mode to be updated in auto mode
 - ipa: software_isp: Fix context_.configuration.agc.againMin init
 - ipa: software_isp: AGC: Do not lower gain below 1.0
 - ipa: software_isp: AGC: Raise exposure or gain not both at the same time
 - ipa: software_isp: AGC: Only use integers for exposure calculations
 - ipa: simple: blc: Use 16 as starting blacklevel when there is no sensor-info
 - ipa: simple: awb: Avoid incorrect arithmetic in AWB
 - ipa: simple: awb: Use correct type in std::accumulate
 - ipa: simple: blc: Prevent division by zero in BLC
 - ipa: simple: agc: Prevent division by zero in AGC
 - ipa: rpi: pisp: Add decompand support using PiSP hardware block
 - ipa: rpi: Add FE globals as a parameter to applyDecompand()
 - ipa: rpi: pisp: Add a DecompandAlgorithm class
 - ipa: rpi: pisp: Allow an initial decompand curve to be set on the FE
 - ipa: meson.build: Remove duplicated variable
 - ipa: rpi: Fix the set function for floating statistics regions
 - ipa: rpi: lux: Handle camera mode sensitivity correctly
 - ipa: rpi: pisp: Use a floating region to get whole image Y statistics
 - ipa: rpi: vc4: Use a floating statistics region for a full image Y sum
 - ipa: rpi: lux: Use floating statistics region to obtain the current Y value
 - libipa: camera_sensor_helper: Add imx708
 - ipa: rpi: vd56g3: Fix frameIntegrationDiff value
 - ipa: libipa: agc_mean_luminance: Avoid unnecessary copies
 - ipa: rkisp1: dpf: Enable strength after enable Dpf
 - libipa: module: Allow algorithms to be disabled via the tuning file
 - libipa: exposure_mode_helper: Set quantizationGain in absence of a sensor helper
 - ipa: libipa: pwl: Allow to parse a plain yaml value as single point PWL
 - ipa: rkisp1: lux: Properly handle frame context and active state
 - ipa: libipa: agc_mean_luminance: Change luminance target to piecewise linear function
 - ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints
 - ipa: ipu3, mali-c55, rkisp1, rpi: Fix reporting non-scalar controls

tuning:
 - utils: raspberrypi: ctt: Update noise/sharpness tuning
 - utils: raspberrypi: ctt: Update vc4 tuning defaults
 - tuning: rksip1: Add a static Compress entry
 - tuning: rksip1: Add a static WideDynamicRange entry

test:
 - test: camera: Use Request::ReuseBuffers flag
 - test: utils: Add endlines
 - test: utils: Validate hex sign extension
 - lc-compliance: Ensure stream's colorspace is set after validate()

Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-27 11:55:28 +00:00
Paul Elder
4e9be7d11b ipa: ipu3, mali-c55, rkisp1, rpi: Fix reporting non-scalar controls
The ControlInfos of non-scalar controls that are reported in controls()
must have non-scalar default values for controls that have a defined
size. This is because applications should be able to directly set the
default value from a ControlInfo to the control.

Currently this is relevant to the following controls:
- ColourGains
- ColourCorrectionMatrix
- FrameDurationLimits
- AfWindows

Fix the scalarness of these controls where relevant.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> # rkisp1
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 16:52:19 +00:00
Paul Elder
cfdc281100 libcamera: control_serializer: Add array info to serialized ControlValue
Array controls (eg. ColourCorrectionMatrix, FrameDurationLimits,
ColourGains) are serialized properly by the ControlSerializer, but are
not deserialized properly. This is because their arrayness and size are
not considered during deserialization.

Fix this by adding arrayness and size to the serialized form of all
ControlValues. This is achieved by fully serializing the min/max/def
ControlValue's metadata associated with each ControlInfo entry in the
ControlInfoMap.

While at it, clean up the serialization format of ControlValues and
ControlLists:
- ControlValue's id is only used by ControlList, so add a new struct for
  ControlList entries to contain it, and remove id from ControlValue
- Remove offset from ControlInfo's entry, as it is no longer needed,
  since the serialized data of a ControlInfo has now been converted to
  simply three serialized ControlValues
- Remove the type from the serialized data of ControlValue, as it is
  already in the metadata entry

The issue regarding array controls was not noticed before because the
default value of the ControlInfo of other array controls had been set to
scalar values similar to how min/max are set, and ColourCorrectionMatrix
was the first control to properly define a non-scalar default value.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=285
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> # rkisp1
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 16:52:19 +00:00
Stefan Klug
7313f046a2 libcamera: Add and implement LensDewarpEnable control
Add a LensDewarpEnable control to enable or disable lens dewarping if it
is configured. Implement it inside the dw100 converter module.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:30 +01:00
Stefan Klug
302f285b3b pipeline: rkisp1: Load dewarp parameters from tuning file
Load the dewarp parameters from the tuning file.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:30 +01:00
Stefan Klug
1784e08be3 libcamera: dw100_vertexmap: Implement parametric dewarping
Implement functions to allow lens dewarping based on the common lens
dewarp model used e.g. by OpenCV.

See https://docs.opencv.org/4.12.0/d9/d0c/group__calib3d.html for an
in depth explanation of the parameters.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:30 +01:00
Stefan Klug
4b9251fa70 libcamera: rkisp1: Handle requested orientation using dewarper
When the dewarper is present it can handle arbitrary orientations
specified in the requested camera configuration. In that case handle all
transformations inside the dewarper (even if the sensor supports some of
them) because that makes it easier to handle coordinates for lens
dewarping inside the dewarper.

This complicates the path selection a bit, as for transformations that
include a transpose, the format before the dewarper has swapped
width/height.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:30 +01:00
Stefan Klug
a111bb6903 libcamera: Add transpose() function to size
Add a transpose() function to size that applies the
Transformation::Transpose operation in the size. This is useful when
handling orientation adjustments.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:30 +01:00
Stefan Klug
9df164fa42 libcamera: internal: camera_sensor: Add accessor for mountingOrientation_
To properly handle the orientation in the dewarper, the mounting
orientation of the sensor needs to be queryable. Add that.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
ff1908a7a1 pipeline: rkisp1: Enable the dewarper based on the tuning file
To do actual lens dewarping, the dewarper will be configured based on
the tuning file.

As a first step implement the basic loading of the
tuning file and enable/disable the dewarper for the given camera based
on the existence of the "Dewarp" entry under a new top level element
'modules' in the tuning file.

Note: This is an backwards incompatible change in that the dewarper is
currently included in the chain unconditionally. Some users may want to
not use the dewarper, so it is sensible to make that configurable.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
ef14661487 pipeline: rkisp1: Drop rawFormat variable
In raw mode we know there is only a single configuration so there
is no need to iterate over all configurations to find the format.
Drop that.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Umang Jain <uajain@igalia.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
fa78167e3a pipeline: rksip1: Move isRaw up in scope
In raw mode the number of configurations is actively limited to 1. It is
therefore safe to move isRaw up one level to simplify the code and
prepare for later use.

During that rework it was noticed that the old code actually has a bug
in that it reduces the number of configurations to 1 in case a raw
config is found, but it doesn't reduce the config vector to that raw
config, but the first config.

Change that behavior to check the first config and either remove all
remaining configs if the first is raw or drop all raw configs if the
first is non-raw.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
13e5c71294 libcamera: rkisp1: Use the dw100 converter module instead of the generic v4l2 converter
The dewarper integration into the rkisp1 pipeline is quite complicated.
Simplify that by switching to the now available ConverterDW100Module. As
there is no other known converter in combination with the rkisp1 ISP this
is a safe step to do.

This change also paves the way to implement dw100 specific features later.

The input crop implemented in the dw100 kernel driver is quite limited
in that it doesn't allow arbitrary crop rectangles but only scale
factors quantized to the underlying fixed point representation and only
aspect ratio preserving crops.

The vertex map based implementation allows for pixel perfect crops. The
only downside is that ScalerCrop can no longer be set dynamically on
older kernels. A corresponding warning is already implemented in the
converter module.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
ffde6b28f3 libcamera: converter: Add dw100 converter module
The DW100 Dewarp engine is present on i.MX8MP SoC and possibly others.
This patch provides a dedicated converter module that allows easy
integration of such a dewarper into a pipeline handler.

In this patch only the ScalerCrop control is implemented. Support for
additional functionality will be added in later patches.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
b48d41a853 libcamera: converter: Add dw100 vertex map class
Using a custom vertex map the dw100 dewarper is capable of doing
complex and useful transformations on the image data. This class
implements a pipeline featuring:
- Arbitrary ScalerCrop
- Full transform support (Flip, 90deg rotations)
- Arbitrary move, scale, rotate

ScalerCrop and Transform is implemented to provide a interface that is
standardized libcamera wide. The rest is implemented on top for more
flexible dw100 specific features.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
19cbbd65fe pipeline: rkisp1: Fix number of buffers imported into the dewarper
When the dewarper is used, an addition buffer loop with
kRkISP1MinBufferCount buffers is created between ISP and dewarper. When
the dewarper is configured, it stores the bufferCount value of the
requested stream configurations. This number of buffers is then imported
when the dewarper is started.

On the input stream of the dewarper the bufferCount is currently left
unchanged, meaning it carries the bufferCount as supplied by the user
instead of the bufferCount of the additional loop. Fix that by setting
the bufferCount to kRkISP1MinBufferCount.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
d5c6e78a60 libcamera: rkisp1: Allow upscaling when the dewarper is present
When the dewarper is present, there is no need to forbid upscaling of
the image data.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
ca20801aa1 libcamera: rkisp1: Scale down in dewarper instead of resizer
In order to allow digital zooming, scale down in the dewarper instead of
the resizer. That means forwarding the full sensor size data to the
dewarper. The ScalerCrop rectangle will also be applied at the dewarper.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
852491e420 libcamera: rkisp1: Move useDewarper_ flag into RkISP1CameraData
The decision if the dewarper shall be used is not per pipeline but per
camera and per configuration (raw streams can't use it). Move the
corresponding flag into the camera data class. Rename the flag to
"usesDewarper" which is easier understand when we later add the ability
to enable/disable the dewarper on a per camera basis which will be
expressed using a "canUseDewarper" flag.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Stefan Klug
46ded9a8da libcamera: converter_v4l2_m2m: Add debug logging for formats
Getting the requested input/output format is crucial for debugging. Add
log statements for that.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-11-26 17:39:29 +01:00
Umang Jain
801c3c3010 libcamera: converter_v4l2_m2m: Add helper to apply controls
Add applyControls() helper to apply controls for a stream.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-11-26 17:39:28 +01:00
Xavier Roumegue
ae4cd6e427 include: linux: Update headers for Dw100 dewarper engine
Include the DW100 dewarper header as part of linux headers.
It will be used to set the V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP
control by ConverterDW100

Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Acked-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
2025-11-26 17:39:28 +01:00
Stefan Klug
0b0f32e736 libcamera: rkisp1: Properly cancel buffers in dewarp case
In case the buffer returned from the ISP was canceled, the upstream
buffer was not correctly marked as canceled. Move the cancel
functionality into an own helper function and correctly cancel the
upstream buffers. Add missing cancellation in case queuing to the
dewarper fails.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2025-11-26 17:39:28 +01:00
Stefan Klug
0d48cb6bb0 libcamera: converter_v4l2_m2m: Always set stride
Ensure the stride is properly set after a call to validateOutput().

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Umang Jain <uajain@igalia.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-11-26 17:39:28 +01:00
Stefan Klug
6d8109f4f1 libcamera: converter_v4l2_m2m: Add suport for V4L2 requests
To actually use requests with the m2m device, requests need to be
allocated on the underlying media device. This can only be done if the
media device is opened which means acquiring it. Add a function to check
if the m2m device supports requests by acquiring the media device,
asking it and then releasing it again. Also add a function to allocate
requests that acquires the internal media device and releases it after
allocating the requests.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-26 17:39:28 +01:00