summaryrefslogtreecommitdiff
path: root/src/ipa/meson.build
AgeCommit message (Collapse)Author
2024-04-16libcamera: ipa: Add Soft IPAAndrey Konovalov
Define the Soft IPA main and event interfaces, add the Soft IPA implementation. The current src/ipa/meson.build assumes the IPA name to match the pipeline name. For this reason "-Dipas=simple" is used for the Soft IPA module. Auto exposure/gain and AWB implementation by Dennis, Toon and Martti. Auto exposure/gain targets a Mean Sample Value of 2.5 following the MSV calculation algorithm from: https://www.araa.asn.au/acra/acra2007/papers/paper84final.pdf Use CameraSensorHelper to convert the analogue gain code read from the camera sensor into real analogue gain value. In the future this makes it possible to use faster AE/AGC algorithm. Right now the CameraSensorHelper lets us use the full range of analogue gain values. If there is no CameraSensorHelper for the camera sensor in use, a warning log message is printed. Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # sc8280xp Lenovo x13s Tested-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Co-developed-by: Dennis Bonke <admin@dennisbonke.com> Signed-off-by: Dennis Bonke <admin@dennisbonke.com> Co-developed-by: Marttico <g.martti@gmail.com> Signed-off-by: Marttico <g.martti@gmail.com> Co-developed-by: Toon Langendam <t.langendam@gmail.com> Signed-off-by: Toon Langendam <t.langendam@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-12-07meson: Tag all installed filesLaurent Pinchart
Meson uses tags to sort installed files in categories, and makes it possible to install a subset of the files using the '--tags' argument to 'meson install'. This is typically used by distributions to split the runtime, development and documentation files into separate packages. By default, meson tries to guess the correct tag for installed files, but can't always do so properly. Mark the install targets that meson can't guess with the correct install_tag. As the feature has been introduced in meson 0.60, bump the minimum meson version. The latest LTS release of all major distributions that libcamera currently targets ship a recent enough meson version. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-05-09meson: Fix usage of overwritten pipeline variableLaurent Pinchart
When iterating over enabled pipelines and IPA modules, libcamera descends into subdirectories in a recursive manner, which involves nested loops. Both the outer and inner loops use the same loop variable named 'pipeline'. As the outer loop uses the variable after descending into the inner directory, it ends up using an incorrect value. Fix it by moving all use of the variable before the subdir() call, and add a comment that warns about the issue to avoid reintroducing it. Fixes: e8526c0c2bc6 ("ipa: meson: Allow nested IPA directory structures") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-05-04ipa: meson: Allow nested IPA directory structuresNaushir Patuck
The current IPA build files require a flat directory structure for the IPAs. Modify the build files to remove this restriction and allow a directory structure such as: src/ipa |- raspberrypi |- common |- cam_helpers |- controller |- vc4 |- rkisp1 |- ipu3 where each subdir (e.g. raspberrypi/common, raspberrypi/cam_helper) has its own meson.build file. Such a directory structure will be introduced for the Raspberry Pi IPA in a future commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-09-20ipa: meson: Fix identationLaurent Pinchart
meson.build files are indented with 4 spaces, not 2. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-09-15meson: Enable vimc IPA for testsUmang Jain
Vimc pipeline handler is enabled unconditionally if the meson config option '-Dtest' is true. However, this is not true for the vimc IPA. Hence, a meson configuration such as: -Dpipelines=raspberrypi -Dipas=raspberrypi -Dtest=true will include the vimc pipeline handler (in addition to raspberrypi) but will skip the vimc IPA which can lead to failure of unit tests that depends on vimc to execute. One such unit test was identified as a result of this issue on RaspberryPi: ERROR IPAModule ipa_module.cpp:278 ipa_vimc.so: Failed to open IPA library: No such file or directory test IPA module src/ipa/vimc/ipa_vimc.so is invalid due to the non-existent ipa_vimc.so. Fix this by including the vimc IPA unconditionally when the tests are enabled, similar to how the vim pipeline-handler is included. Fixes: 6e65d4225736 ("libcamera: Enable vimc pipeline handler when tests are enabled") Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-26libcamera: Correctly report enabled ipa modulesQuentin Schulz
"ipa_modules" stores the value of the ipas meson build option. IPAs are enabled if and only if there is an enabled pipeline for an IPA listed in "ipa_modules" array. It is basically the intersection of pipelines and ipa_modules array. In order to correctly report which IPAs get enabled, let's create a new array storing this intersection. Cc: Quentin Schulz <foss+libcamera@0leil.net> Reported-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-06-16meson: summarise pathsKieran Bingham
The IPAs are loaded from a defined location set as IPA_MODULE_DIR. Furthermore, configuration files for both libcamera and IPAs are loaded from paths defined during the meson configuration. To make it easy to identify these locations for a given configuration, present them as a 'paths' section in the meson summary. This adds a summary section to meson in the form: Paths LIBCAMERA_DATA_DIR : "/usr/share/libcamera" LIBCAMERA_SYSCONF_DIR : "/etc/camera/libcamera" IPA_PROXY_DIR : "/usr/libexec/libcamera" IPA_CONFIG_DIR : "/etc/camera/libcamera/ipa:/usr/share/libcamera/ipa" IPA_MODULE_DIR : "/usr/lib/x86_64-linux-gnu/libcamera" Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-05-24meson: Add a configuration option to build IPAsUmang Jain
There can be multiple IPAs per pipeline-handler or platform. They can live in-tree or externally linked. It is up to the vendor whether to use in-tree IPA for a platform or provide it externally. In the case of IPAs being external, building in-tree IPAs might be futile hence, provide a clear and explicit mechanism to choose whether to build the in-tree IPA for the platform or not. By default, all in-tree IPAs are built when a matching Pipeline handler is also enabled. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-05-11meson: Replace obselete join_paths() with '/' operatorUmang Jain
Since meson v0.49.0, join_paths() is equivalent to '/' hence, drop and replace it with '/' short-hand in meson files. This commit does not introduce any functional changes. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-04-30src: meson: Define system pathsKieran Bingham
Define libcamera specific system paths for use within the library code base. These can be used to identify system configuration files and shared data. Also, make use of the new system path variables and map the ipa paths upon the libcamera system path, making use of the new shorter syntax for join_paths(). Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-02-23libcamera: Enable vimc pipeline handler when tests are enabledLaurent Pinchart
The addition of the new IPA IPC mechanism compiles pipeline-specific headers to define the interface between the pipeline and the IPA. This was optimised in 08ce394465b5 ("meson: ipa, proxy: Only build proxies for enabled pipelines") to only build for enabled pipelines, however the tests directly use the VIMC pipeline handler, and require it to be built. Create a local variable to store the requested pipelines from the user configuration and extend the enabled pipelines to ensure that VIMC is always enabled if the tests are also enabled Fixes: 08ce394465b5 ("meson: ipa, proxy: Only build proxies for enabled pipelines") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Sebastian Fricke<sebastian.fricke@posteo.net>
2021-02-05libcamera: ipa: ipu3: Add an IPA skeleton for the IPU3 pipelineNiklas Söderlund
Add an empty IPA skeleton for the IPU3 pipeline. The skeleton IPA handles the flow of parameter and statistic buffers but does not read or write anything in the buffers. It also allows the IPA to set sensor controls but does not implement any logic to set optimal values and instead sets the V4L2 exposure and gain controls to max and keeps them at that setting. This IPA is meant as a base to allow the pipeline handler to be wired up to an IPA. The image algorithms can then later be added to the IPA independently from also having to add plumbing to the pipeline handler. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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-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-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_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-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-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>
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>
2019-10-11libcamera: ipa: rkisp1: Add basic control of auto exposureNiklas Söderlund
Add an IPA which controls the exposure time and analog gain for a sensor connected to the rkisp1 pipeline. The IPA supports turning AE on and off and informing the camera of the status of the AE control loop. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-10-08ipa: meson: Give IPAs access to internal libcamera APIsJacopo Mondi
Open source IPA implementations can benefit from usage of libcamera internal APIs. Allow this by compiling against the internal headers and linking against libcamera. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-10-08ipa: vimc: Rename ipa_dummy to ipa_vimcJacopo Mondi
The DummyIPA is actually a test IPA module for the virtual media controller driver VIMC. Rename it accordingly to its usage. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-09-15ipa: Generate the two dummy IPA modules from the same sourceLaurent Pinchart
The ipa_dummy.cpp and ipa_dummy_isolate.cpp only differ in the license reported in the IPAModuleInfo structure. Drop the second file and generate the two .so from ipa_dummy.cpp, with the license defined through the command line. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-07-12libcamera: ipa: meson: build dummy IPA that needs isolationPaul Elder
Add the dummy IPA that needs isolation to meson. At the same time, clean up the IPA meson to facilitate adding more IPAs. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05libcamera: ipa: add dummy IPA implementationPaul Elder
Add a dummy IPA module. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05libcamera: ipa_manager: implement class for managing IPA modulesPaul Elder
IPAManager is a class that will search in given directories for IPA modules, and will load them into a list. It also provides an interface for pipeline handlers to acquire an IPA. A meson build file for the IPAs is added, which also specifies a hard-coded path for where to load the IPAs from in the installation directory. More paths can be specified with the environment variable LIBCAMERA_IPA_MODULE_PATH, with the same syntax as the regular PATH environment variable. Make the test framework set this environment variable. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>