summaryrefslogtreecommitdiff
path: root/src/ipa
AgeCommit message (Collapse)Author
2020-08-25meson: Remove -Wno-unused-parameterLaurent Pinchart
We build libcamera with -Wno-unused-parameter and this doesn't cause much issue internally. However, it prevents catching unused parameters in inline functions defined in public headers. This can lead to compilation warnings for applications compiled without -Wno-unused-parameter. To catch those issues, remove -Wno-unused-parameter and fix all the related warnings with [[maybe_unused]]. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-25libcamera: Replace utils::clamp() with std::clamp()Laurent Pinchart
Now that libcamera uses C++17, the C++ standard library provides std::clamp(). Drop our custom utils::clamp() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-05libcamera: ipa: raspberrypi: ALSC: Improve behaviour when camera mode changesDavid Plowman
Now that we stop the asynchronous thread on a SwitchMode, we would do better to regenerate all the tables if the new camera mode crops in a significantly different way to the old one. A few minor tweaks make sense along with this: * Reset the lambda values when we reset everything. It wouldn't make sense to re-start with the old mode's values. * Use the last recorded colour temperature to generate new tables rather than any default value. * Set the frame "phase" counter to ensure the adaptive procedure will run asap. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-08-05libcamera: ipa: raspberrypi: ALSC: Resample luminance tableDavid Plowman
This fixes a bug where the luminance correction table was not being resampled according to the camera mode, in the same way as the colour tables. This could be noticeable if any camera modes crop aggressively. This resampling can be done "up front" in the SwitchMode, as we have only a single fixed luminance table. In order to protect the recalculation of the table from the asynchronous thread (which reads it) I've elected to wait for that thread to go idle (though I doubt it would have mattered much). As a by-product of stopping the thread, it no longer needs its own copy of the camera mode (async_camera_mode_). Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-05libcamera: ipa: raspberrypi: ALSC: Improve locking in a few placesDavid Plowman
Fix up a few locations where we call notify_one() with the lock held. In particular, restartAsync does not need to be called with the lock held for its entire duration. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-05libcamera: ipa: raspberrypi: ALSC: Camera mode does not need to be atomicDavid Plowman
In the libcamera framework, SwitchMode (which overwrites the camera_mode) cannot run concurrently with Prepare (which uses it). Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-25libcamera: raspberrypi: Add ColourCorrectionMatrix controlDavid Plowman
Implements, for the Raspberry Pi platform, the returning of the CCM (Colour Correction Matrix) used by the pipeline in the libcamera metadata. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tablesNaushir Patuck
Remove use of vcsm allocations and replace with dma heap allocations. The pipeline handler now passes the fd of the allocation over to the IPA instead of the raw pointer. Also use libcamera::FileDescriptor for fd lifetime management. This commit must be built alongside the accompanying BCM2835 ISP kernel driver changes at https://github.com/raspberrypi/linux/pull/3715. Otherwise a mismatch will cause undefined behavior. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17ipa: raspberrypi: Pass sensor config back from configure()Laurent Pinchart
The Raspberry Pi IPA uses the custom RPI_IPA_ACTION_SET_SENSOR_CONFIG frame action to send the sensor staggered write configuration to the pipeline handler when the IPA is configured. Replace this ad-hoc mechanism by passing the corresponding data back from the IPA to the pipeline handler through the configure() response. This allows synchronous handling of the response on the pipeline handler side. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17ipa: raspberrypi: Pass lens shading table through configure() functionLaurent Pinchart
The IPAInterface::configure() function now accepts custom configuration data. Use it to pass the lens shading table instead of using a custom IPA event. This will allow starting the IPA when starting the camera, instead of pre-starting it early in order to process the lens shading table allocation event. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17ipa: raspberrypi: Drop CameraHelper::GetOrientation()Laurent Pinchart
The camera sensor orientation is now handled by the pipeline handler. Drop hardcoded per-sensor orientations from the IPA. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17libcamera: ipa_interface: Add support for custom IPA data to configure()Laurent Pinchart
Add two new parameters, ipaConfig and result, to the IPAInterface::configure() function to allow pipeline handlers to pass custom data to their IPA, and receive data back. Wire this through the code base. The C API interface will be addressed separately, likely through automation of the C <-> C++ translation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06libcamera: ipa: raspberrypi: Populate focus FoM from the ISP statisticsNaushir Patuck
Switch FocusStatus::num to unsigned int for convenience. Fill in libcamera::controls::FocusFoM with the average of the middle two regions (across a 4x3 grid) FoM statistics from the ISP. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-06ipa: raspberrypi: Populate libcamera metadata after controller processNaushir Patuck
For control algorithms like focus, this is needed to return out the the current frame focus statistics. For other algorithms, there is no functional change. Signed-off-By: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-03ipa: raspberrypi: Enable focus measure without recompileDavid Plowman
Previously, output of the focus measure could not be enabled without recompiling (because of the RPI_LOGGING_ENABLE macro). This uses the libcamera logging mechanism instead, so can be enabled/disabled at runtime. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-01ipa/pipeline: rkisp1: Fix spellingAndrej Shadura
Fix a typo in the word "unknown". Suggested-by: IOhannes m zmölnig <umlaeute@debian.org> Signed-off-by: Andrej Shadura <andrewsh@debian.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-06-25ipa: rpi: Add "focus" algorithmDavid Plowman
Adds FocusStatus to the image metadata, containing contrast measurements across the image. Optionally also prints a contrast measure to the console, to aid in manual adjustment of the lens. Note that it is not an actual auto-focus algorithm that can drive a lens! Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-25libcamera: ipa: raspberrypi: Plumb in the libcamera sharpness controlDavid Plowman
This simply wires up the libcamera sharpness control in the Raspberry Pi IPAs so that it controls the strength of the Raspberry Pi sharpness control algorithm. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-25libcamera: ipa: raspberrypi: Add sharpness strength controlDavid Plowman
The sharpness control is, loosely speaking, a gain applied to the amount of sharpening added to an image. We also report the sharpness setting used back to the caller in metadata. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-25libcamera: ipa: raspberrypi: Make sharpening mode_factor an ordinary doubleDavid Plowman
No need for it to be std::atomic as SwitchMode runs synchronously with Prepare. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-22libcamera: ipa: raspberrypi: Recalculate camera exposure/gain when camera ↵David Plowman
mode changes This commit causes the AGC to recalculate its camera exposure/gain values when the camera mode changes. For example it's possible that the exposure profile could be changed by the application so the division between exposure time and analogue gain may be different. The other underlying reason (and which this commit accomplishes too) is that the sensor's line timing may change in a new mode, and because V4L2 drivers store a number of exposure _lines_, the resulting _time_ will "change under our feet". So we have to go through the process of recalculating the correct number of lines and writing this back to the sensor with every mode switch, regardless of anything else. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-22libcamera: ipa: raspberrypi: Allow SwitchMode method to return camera settingsDavid Plowman
This commit adds a Metadata parameter to the SwitchMode method enabling it to return camera and other settings to the caller (usually the configure method, just after the camera mode has been selected). In future this will allow the Raspberry Pi IPAs to take those settings (such as exposure and analogue gain) and program them directly into the camera or ISP before the camera is even started. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-09libcamera: Add missing SPDX headers to miscellaneous small filesLaurent Pinchart
Add missing SPDX headers to miscellaneous small files. Use CC0-1.0 for meson.build, .gitignore and the small include/linux/README, and licenses matching the corresponding component for other files. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-16libcamera: Move IPA headers from include/ipa/ to include/libcamera/ipa/Laurent Pinchart
The IPA headers are installed into $prefix/include/libcamera/ipa/, but are located in the source tree in include/ipa/. This requires files within libcamera to include them with #include <ipa/foo.h> while a third party IPA would need to use #include <libcamera/ipa/foo.h> Not only is this inconsistent, it can create issues later if IPA headers need to include each other, as the first form of include directive wouldn't be valid once the headers are installed. Fix the problem by moving the IPA headers to include/libcamera/ipa/. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-05-16libcamera: Move internal headers to include/libcamera/internal/Laurent Pinchart
The libcamera internal headers are located in src/libcamera/include/. The directory is added to the compiler headers search path with a meson include_directories() directive, and internal headers are included with (e.g. for the internal semaphore.h header) #include "semaphore.h" All was well, until libcxx decided to implement the C++20 synchronization library. The __threading_support header gained a #include <semaphore.h> to include the pthread's semaphore support. As include_directories() adds src/libcamera/include/ to the compiler search path with -I, the internal semaphore.h is included instead of the pthread version. Needless to say, the compiler isn't happy. Three options have been considered to fix this issue: - Use -iquote instead of -I. The -iquote option instructs gcc to only consider the header search path for headers included with the "" version. Meson unfortunately doesn't support this option. - Rename the internal semaphore.h header. This was deemed to be the beginning of a long whack-a-mole game, where namespace clashes with system libraries would appear over time (possibly dependent on particular system configurations) and would need to be constantly fixed. - Move the internal headers to another directory to create a unique namespace through path components. This causes lots of churn in all the existing source files through the all project. The first option would be best, but isn't available to us due to missing support in meson. Even if -iquote support was added, we would need to fix the problem before a new version of meson containing the required support would be released. The third option is thus the only practical solution available. Bite the bullet, and do it, moving headers to include/libcamera/internal/. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-05-13ipa: Only sign IPA modules that are being installedLaurent Pinchart
The ipa-sign-install.sh script, run when installing libcamera, signs all IPA modules present in the module directory. This would result in third-party modules being signed if any are present in the directory. Fix it by explicitly passing the list of IPA modules to the ipa-sign-install.sh script. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2020-05-13licenses: License all meson files under CC0-1.0Laurent Pinchart
In an attempt to clarify the license terms of all files in the libcamera project, the build system files deserve particular attention. While they describe how the binaries are created, they are not themselves transformed into any part of binary distributions of the software, and thus don't influence the copyright on the binary packages. They are however subject to copyright, and thus influence the distribution terms of the source packages. Most of the meson.build files would not meet the threshold of originality criteria required for copyright protection. Some of the more complex meson.build files may be eligible for copyright protection. To avoid any ambiguity and uncertainty, state our intent to not assert copyrights on the build system files by putting them in the public domain with the CC0-1.0 license. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Show Liu <show.liu@linaro.org>
2020-05-11libcamera: raspberrypi: Add components to meson buildNaushir Patuck
Add the Raspberry Pi pipeline handler and IPA as targets in the meson build system. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-11libcamera: ipa: Raspberry Pi IPANaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) libcamera IPA and associated libraries. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-11meson: Use files() instead of find_program() for internal scriptsLaurent Pinchart
Using find_program() to locate scripts part of the source tree causes meson to print messages at setup time for each of those scripts: Program ipa-sign.sh found: YES (/home/user/src/libcamera/src/ipa/ipa-sign.sh) This pollutes the meson setup log with useless messages, as we know the scripts are present. Use files() instead to avoid this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: Build IPA module signatures by defaultLaurent Pinchart
Commit 7206035ee609 ("libcamera: Regenerate IPA module signatures at install time") replaced installation of the IPA module signatures with an install script that signs all modules. While doing so, it inadvertently also disabled generation of the signature at build time by default. This breaks running libcamera binaries from the build directory. Fix it. Fixes: 7206035ee609 ("libcamera: Regenerate IPA module signatures at install time") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-29libcamera: Regenerate IPA module signatures at install timeLaurent Pinchart
When the IPA modules are installed, meson strips the DT_RPATH and DT_RUNPATH from the binaries. This invalidates the signatures. Disable installation of the .sign files and add an installation script to regenerate them directly in the target directory. The .sign files still need to be created at build time to support running IPA modules from the build tree. Two alternative approaches have been considered: - meson could be taught a new target argument to preserve binary compatibility by skipping any operation that modifies files. This has been proposed in the #mesonbuild IRC channel. While this could be interesting in the longer term, we need to fix the issue now. - The module signatures could be computed on selected sections only. While skipping the .dynamic section when signing may not cause security issues, it would make signature generation and verification more complex, and wasn't deemed worth it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28libcamera: ipa: Add support for CameraSensorInfoJacopo Mondi
Add support for camera sensor information in the libcamera IPA protocol. Define a new 'struct ipa_sensor_info' structure in the IPA context and use it to perform translation between the C and the C++ API. Update the IPAInterface::configure() operation to accept a new CameraSensorInfo parameter and port all users of that function to the new interface. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28ipa: vimc: Validate configuration file in init()Laurent Pinchart
Make sure we can open the configuration file passed to the init() function, and return an error otherwise. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28ipa: vimc: Add a dummy configuration file to the vimc IPALaurent Pinchart
The file will be used to test the corresponding APIs. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28ipa: Pass IPA initialization settings to IPAInterface::init()Laurent Pinchart
Add a new IPASettings class to pass IPA initialization settings through the IPAInterface::init() method. The settings currently only contain the name of a configuration file, and are expected to be extended later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28libcamera: ipa_proxy: Provide suport for IPA configuration filesLaurent Pinchart
IPA modules may require configuration files, which may be stored in different locations in the file system. To standardize file locations between all IPAs and pipeline handlers, provide a helper function to locate a configuration file by searching in the following directories: - All directories specified in the LIBCAMERA_IPA_CONFIG_PATH environment variable ; or - In the source tree if libcamera is not installed ; otherwise - In standard system locations (etc and share directories). When stored in the source tree, configuration files shall be located in a 'data' subdirectory of their respective IPA directory. More locations, or extensions to the mechanism, may be implemented later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28ipa: Name IPA modules after their source directoryLaurent Pinchart
The IPAModuleInfo::name field is currently a free-formed string that has little use. Tighten its usage rules to make it suitable for building file system paths to IPA-specific resources by matching the directory name of the IPA module. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-16libcamera: Make IPA module signing optionalLaurent Pinchart
The IPA module signing mechanism relies on openssl to generate keys and sign the module. If openssl is not found on the system, the build will fail. Make the dependency optional by detecting openssl, and skip generation of signatures if openssl isn't found. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-14libcamera: ipa: Remove IPAModuleInfo license fieldLaurent Pinchart
The IPAModuleInfo license field isn't needed anymore now that modules are cryptographically signed. Remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-14libcamera: Add IPA module signing infrastructureLaurent Pinchart
Add infrastructure to generate an RSA private key and sign IPA modules. The signatures are stored in separate files with a .sign suffix. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-14ipa: vimc: Remove isolated VIMC IPA moduleLaurent Pinchart
The isolated VIMC module isn't used in any test. Remove it to prepare for the rework of IPA module isolation. The feature can be added back later alongside corresponding tests if needed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-14ipa: Add start() and stop() operationsNiklas Söderlund
Add two new operations to the IPA interface to start and stop it. The intention is that these functions shall be used by the IPA to perform actions when the camera is started and stopped. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-25libcamera: Make pipeline handlers selectable at compile timeLaurent Pinchart
Add a 'pipelines' project option that specifies which pipeline handlers to compile in. The corresponding IPA modules are automatically selected. The default is to compile all pipeline handlers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-25ipa: Move vimc to a subdirectoryLaurent Pinchart
Give a subdirectory to all IPA modules to make the structure of the source tree more consistent. This will also simplify the implementation of IPA module selection at build time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-01-14libcamera: Switch from utils::make_unique to std::make_uniqueLaurent Pinchart
Now that we're using C++-14, drop utils::make_unique for std::make_unique. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-01-14meson.build: Switch to C++14Laurent Pinchart
C++14 is a minor release that doesn't introduce major new concepts or paradigms compared to C++11, but brings two useful changes for us: - std::make_unique allows dropping our custom implementation in utils. - Functions returning constexpr are not assumed to be const anymore, which is needed to create a standard-conformant span implementation. All the g++ and clang++ versions we support and test (g++-5 onwards and clang++6 onwards) support C++14. However, due to a defect in the original C++14 specification, solved in N4387 ([1]), compilation would fail on g++-5 due to the use of std::map::emplace() with a non-copyable value type. It turns out we can easily fix it by switching to the explicit piecewise emplace() overload. There is thus really nothing holding back the switch. Let's do it, and update the coding style accordingly. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-01-12ipa: Switch to FrameBuffer interfaceNiklas Söderlund
Switch the IPA interfaces and implementations to use the Framebuffer interface. - The IPA interface is switched to use the simpler FrameBuffer::Plane container when carrying dmabuf descriptions (fd and length) over the pipeline/IPA boundary. - The RkISP1 IPA implementation takes advantage of the new simpler and safer (better control over file descriptors) FrameBuffer interface. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20ipa: Allow short-circuiting the ipa_context_opsLaurent Pinchart
When an IPA module is loaded without isolation and implements the IPAInterface internally, going through ipa_context_ops is a waste of time. Add an operation to retrieve the IPAInterface, and use it directly in the IPAContextWrapper. For debugging purpose, make it possible to forcing usage of the C API by defining the LIBCAMERA_IPA_FORCE_C_API environment variable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20ipa: Switch to the plain C APIJacopo Mondi
Switch IPA communication to the plain C API. As the IPAInterface class is easier to use for pipeline handlers than a plain C API, retain it and add an IPAContextWrapper that translate between the C++ and the C APIs. On the IPA module side usage of IPAInterface may be desired for IPAs implemented in C++ that want to link to libcamera. For those IPAs, a new IPAInterfaceWrapper helper class is introduced to wrap the IPAInterface implemented internally by the IPA module into an ipa_context, ipa_context_ops and ipa_callback_ops. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>