summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
23 hourslibcamera: base: signal: Drop pre-C++17 supportHEADmasterLaurent Pinchart
The libcamera public API requires C++17, drop support for older standards. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
23 hourslibcamera: base: log: Fix uninitialized variable warningLaurent Pinchart
gcc 13.3.0, cross-compiling from amd64 to arm64, warns about a possibly uninitialized variable in Logger::parseLogLevel(): src/libcamera/base/log.cpp: In static member function ‘static libcamera::LogSeverity libcamera::Logger::parseLogLevel(std::string_view)’: ../../src/libcamera/base/log.cpp:694:55: error: ‘severity’ may be used uninitialized [-Werror=maybe-uninitialized] 694 | if (ec != std::errc() || *end != '\0' || severity > LogFatal) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ src/libcamera/base/log.cpp:690:22: note: ‘severity’ was declared here 690 | unsigned int severity; | ^~~~~~~~ This appears to be a false positive, as the std::from_chars() function should set severity value when it returns without an error. Still, the warning is easy to solve, so fix it by initializing the severity variable. Fixes: 8fa119e0b50f ("libcamera: base: log: Use `std::from_chars()`") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
3 daysutils: ipc: Only dispatch messages for proxy when stopping threadMilan Zamazal
When stopping the proxy thread, all messages of InvokeMessage type posted to the pipeline handler thread are dispatched, to ensure that all signals emitted from the proxy thread and queued for delivery to the proxy are delivered synchronously. This unnecessarily delivers queued signals for other objects in the pipeline handler thread, possibly delaying processing of higher priority events. Improve the implementation by limiting synchronous delivery to messages posted for the proxy. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
3 dayslibcamera: software_isp: Dispatch messages on stopMilan Zamazal
There may be pending messages in SoftwareIsp message queue when SoftwareIsp stops. The call to IPAProxySoft::stop() will dispatch them before SoftwareIsp::stop() finishes. But this is dependent on IPAProxySoft::stop() implementation, let's break this dependency and dispatch messages to SoftwareIsp explicitly in SoftwareIsp::stop(). This also allows dropping `running_' flag. Since the SoftwareIsp messages get processed and invoke IPA calls before the IPA proxy is set to ProxyStopping state and the SoftwareIsp worker thread is no longer running, it's guaranteed that no new messages come to SoftwareIsp and attempt to call the stopped IPA proxy. Signed-off-by: Milan Zamazal <mzamazal@redhat.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>
3 dayslibcamera: base: thread: Support dispatching for a specific receiverMilan Zamazal
The Thread::dispatchMessage() function supports filtering messages based on their type. It can be useful to also dispatch only messages posted for a specific receiver. Add an optional receiver argument to the dispatchMessage() function to do so. When set to null (the default value), the behaviour of the function is not changed. This facility is actually used in followup patches. Signed-off-by: Milan Zamazal <mzamazal@redhat.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>
3 dayslibcamera: software_isp: Handle queued input buffers on stopMilan Zamazal
When SoftwareIsp stops, input and output buffers queued to it may not yet be fully processed. They will be eventually returned but stop means stop, there should be no processing related actions invoked afterwards. Let's stop forwarding processed input buffers from SoftwareIsp slots when SoftwareIsp is stopped. Let's track the queued input buffers and return them back for capture in SoftwareIsp::stop(). The returned input buffers are marked as cancelled. This is not necessary at the moment but it gives the pipeline handlers chance to deal with this if they need to. Signed-off-by: Milan Zamazal <mzamazal@redhat.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>
3 dayslibcamera: software_isp: Handle queued output buffers on stopMilan Zamazal
When SoftwareIsp stops, input and output buffers queued to it may not yet be fully processed. They will be eventually returned but stop means stop, there should be no processing related actions invoked afterwards. Let's stop forwarding processed output buffers from the SoftwareIsp slots once SoftwareIsp is stopped. Let's track the queued output buffers and mark those still pending as cancelled in SoftwareIsp::stop and return them to the pipeline handler. Dealing with input buffers is addressed in a separate patch. Signed-off-by: Milan Zamazal <mzamazal@redhat.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>
3 dayslibcamera: software_isp: Emit ispStatsReady only if IPA is runningMilan Zamazal
Software ISP runs debayering in a separate thread and debayering may emit statsReady when software ISP (including the IPA) is being stopped. The signal waits in a queue and gets invoked later, resulting in an assertion error when attempting to invoke a method on the stopped IPA: FATAL default soft_ipa_proxy.cpp:456 assertion "state_ == ProxyRunning" failed in processStatsThread() Let's prevent this problem by forwarding the ISP stats signal from software ISP only when the IPA is running. To track this, SoftwareISP::running_ variable is introduced. Making processing of the other signals in SoftwareISP more robust is addressed in the followup patches. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reported-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.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>
3 dayslibcamera: meson: Fix libyuv detectionDylan Aïssi
We already fall back to a subproject to support the libyuv package when it can not be discovered through the usual dependency() mechanism. Unfortunately libyuv may be packaged without any corresponding pkg-config support as can be seen at [0], so further extend the dependency search by using an explicit cxx.find_library() call. [0] https://packages.debian.org/bookworm/amd64/libyuv-dev/filelist Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 daysipa: libipa: Fix bug in ExposureModeHelper that leads to oscillations in AEGCStefan Klug
The ExposureModeHelper::splitExposures() runs through the configured stages to find the best gain/exposure time pair. It first raises the exposure time until it reaches the limit of the current stage. Then it raises the gain until that also reaches the limit of the current stage. After that it continues with the next stage until a match is found. Due to a slight mistake in the initial code, the second step doesn't work as expected because the exposure time gets divided by the gain of the current stage, effectively leading to a jump of the gain value from the maximum gain of the last stage to the maximum gain of the current stage instead of gradually increasing the gain value. Depending on the tuning file this leads to very visible oscillations and jumps in the brightness. Fix by clamping the exposure time in the second step to the maximum exposure time of the current stage. While at it, add two comments for easier understanding. Fixes: 34c9ab62827b ("ipa: libipa: Add ExposureModeHelper") Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysipa: rkisp1: Allow exposure time to be shorter than minimum frame duration limitStefan Klug
The minimum FrameDurationLimit also limits the min exposure time and results in overly bright AE regulation. Remove the limit on the minimum exposure time as the vertical blanking ensures the minimum frame duration limit. Fixes: f72c76eb6e06 ("rkisp1: Honor the FrameDurationLimits control") Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 daysapps: lc-compliance: Merge `CaptureBalanced` and `CaptureUnbalanced`Barnabás Pőcze
The above two classes have very similar implementations, in fact, the only essential difference is how many requests are queued. `CaptureBalanced` queues a predetermined number of requests, while `CaptureUnbalanced` queues requests without limit. This can be addressed by introducing a "capture" and a "queue" limit into the `Capture` class, which determine at most how many requests can be queued, and how many request completions are expected before stopping. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 daysapps: lc-compliance: Add message to `GTEST_SKIP()`Barnabás Pőcze
Just like other gtest macros, `GTEST_SKIP()` returns an object to which a formatted message can be added using the usual `<<` stream operator. So use it instead of printing to `std::cout`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Use array instead of `std::vector`Barnabás Pőcze
There is no reason to use `std::vector` for this static data, a simple array will do fine. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Use `std::vector` for argument arrayBarnabás Pőcze
Just use an `std::vector` to store the arguments passed to `InitGoogleTest()`. This removes the need for the map and the separate `argc` variable used for size-keeping. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 daysapps: lc-compliance: Don't allocate `FrameBufferAllocator` dynamicallyBarnabás Pőcze
There is no reason to do so. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Remove redundant getter callBarnabás Pőcze
Smart pointers overload `operator->()`, no reason to use `get()`. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Optimize `std::shared_ptr` usageBarnabás Pőcze
Avoid unnecessary copies and try to move construct `std::shared_ptr` whenever possible. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Put tests into anonymous namespaceBarnabás Pőcze
There is no reason for these symbols to be global. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: lc-compliance: Initialize `CameraManager` pointer in `Environment`Barnabás Pőcze
Do not leave it unitialized. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: common: event_loop: Remove unused type aliasBarnabás Pőcze
The type alias `duration` is not used anywhere, so remove it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 daysapps: common: event_loop: Use single event source for deferred callsBarnabás Pőcze
Instead of calling `event_base_once()` every time a deferred call is added to the loop, create an event source at construction, and simply trigger that when a new deferred call is scheduled. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 daysapps: common: event_loop: Use `std::deque` instead of `std::list`Barnabás Pőcze
Deque has fast pop_front and push_back operations while making fewer allocations for the same number of elements as an `std::list`. So use an `std::deque` for storing the deferred calls of the loop. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 daysapps: common: event_loop: Disable copy/moveBarnabás Pőcze
The compiler generated functions are not appropriate, so delete the copy/move constructor/assignment to avoid potential issues. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 daysapps: common: event_loop: Take callbacks by rvalue refBarnabás Pőcze
Using a const lvalue reference to `std::function<>` is not ideal because it forces a copy to happen. Use an rvalue reference and `std::move()` to avoid that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
5 dayslibcamera: base: log: Avoid manual `LogCategory` deletionBarnabás Pőcze
Wrap the `LogCategory` pointers in `std::unique_ptr` to avoid the need for manual deletion in the destructor. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Protect log categories with lockBarnabás Pőcze
Log categories may be added from any thread, so it is important to synchronize access to the `Logger::categories_` list between its two users: category creation (by LogCategory::create(), which calls Logger::findCategory() and Logger::registerCategory()); and log level setting (by Logger::logSetLevel()). The LogCategory::create() function uses a mutex to serialize category creation, but Logger::logSetLevel() can access `Logger::categories_` concurrently without any protection. To fix the issue, move the mutex to the Logger class, and use it to protect all accesses to the categories list. This requires moving all the logic of LogCategory::create() to a new Logger::findOrCreateCategory() function that combines both Logger::findCategory() and Logger::registerCategory() in order to make the two operations exacute atomically. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 dayslibcamera: base: log: Pass dynamic prefix throughBarnabás Pőcze
Use move construction to essentially pass through the string returned by `Loggable::logPrefix()` to avoid an unnecessary copy. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Use `std::string_view` to avoid some copiesBarnabás Pőcze
Use `std::string_view` to avoid some largely unnecessary copies, and to make string comparisong potentially faster by eliminating repeated `strlen()` calls. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Make `LogCategory::severity_` atomicBarnabás Pőcze
The severity of a log category may be changed from a different thread, so it is important to ensure that the reads and writes happen atomically. Using `std::memory_order_relaxed` should not introduce any synchronization overhead, it should only guarantee that the operation itself is atomic. Secondly, inline `LogCategory::setSeverity()`, as it is merely an assignment, so going through a DSO call is a big pessimization. `LogCategory` is not part of the public API, so this change has no external effects. Thirdly, assert that the atomic variable is lock free so as to ensure it won't silently fall back to libatomic (or similar) on any platform. If this assertion fails, this needs to be revisited. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Remove `LogMessage::init()`Barnabás Pőcze
It is a short function that can be merged into the constructor with essentially no change in observable behaviour, so do that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Use `std::from_chars()`Barnabás Pőcze
Use the `std::from_chars()` function from `<charconv>` to parse the integral log level instead of `strtoul` as it provides an easier to use interface and better type safety. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
5 dayslibcamera: base: log: Remove move constructorBarnabás Pőcze
C++17 guarantees move and copy elision in certain cases, such as when returning a prvalue of the same type as the return type of the function. This is what the `_log()` functions do, thus there is no need for the move constructor, so remove it. Furthermore, do not just remove the implementation, but instead delete it as well. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 daysrkisp1: Honor the FrameDurationLimits controlPaul Elder
Add support to rkisp1 for controlling the framerate via the FrameDurationLimits control. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
6 daysipa: rkisp1: Alias lineDurationKieran Bingham
The configured line duration of the sensor is used frequently throughout the AGC implementation. It's available in the IPA context through the rather long: context.configuration.sensor.lineDuration Take a copy of the lineDuration early in the call and replace the two current usages of the reference with the shorter copy to manage line length and ease readibility. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
6 daysipa: rkisp1: Initialise AGC from FrameDurationLimits controlsKieran Bingham
The IPA calculates and reports the FrameDurationLimits to applications by configuring the ControlInfo accordingly during IPARkISP1::updateControls() We later need to know these limits during Agc::configure() for initialising the ActiveState of the AGC implementation with the limits. Store the FrameDurationLimits ControlInfo in the ControlInfoMap which is now present in the IPAContext so that it is commonly available for the AGC algorithm, removing the 'todo' accordingly. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
6 dayslibcamera: formatting: Avoid spaces in for loops without expressionMilan Zamazal
The clang formatter removes spaces in places of empty expressions in for loops. For example, it changes for (init; condition; ) to for (init; condition;) libcamera currently uses both the styles and we should use only one of them for consistency. Since there is apparently no option to override the formatter behavior (see https://clang.llvm.org/docs/ClangFormatStyleOptions.html), let's remove the extra spaces to make the formatter happy. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
6 daysmeson: Enable the -Wnon-virtual-dtor compiler optionLaurent Pinchart
A base class with virtual functions and a non-virtual public destructor is prone to undefined behaviourif deleted from a pointer to the base. Enable the -Wnon-virtual-dtor warning to report those issues. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
6 dayslibipa: awb: Fix non-virtual destructor warning in AwbStatsLaurent Pinchart
The AwbStats structure has virtual functions but a publicly accessible non-virtual destructors. This can cause undefined behaviour if deleting a derived class instance through a pointer to the base AwbStats class. The problem is theoretical only as no code in libcamera is expected to perform such deletion, but compilers can't know that and will emit a warning if the -Wnon-virtual-dtor option is enabled. Fixing this can be done by declaring a virtual public destructor in the AwbStats class. A more efficient alternative is to declare a protected non-virtual destructor, ensuring that instances can't be deleted through a pointer to the base class. Do so, and mark the derived RkISP1AwbStats as final to avoid the same warning. Fixes: 6f663990a0f7 ("libipa: Add AWB algorithm base class") Reported-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Tested-by: Milan Zamazal <mzamazal@redhat.com>
8 daysipa: rkisp1: algorithms: awb: Fix AWB means vector order in RGB modeStefan Klug
Fix the order of the rgbMeans vector that got broken accidentally during refactoring. As there is currently no way to enable rgb mode at runtime it went unnoticed. Fixes: 29892f1c56c6 ("ipa: libipa: colour: Use the RGB class to model RGB values") Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 dayslibcamera: Drop spurious colon after doxygen \todo directiveLaurent Pinchart
The doxygen \todo directive doesn't need to be followed by a colon. Drop it. While at it, turn one 'todo:' into '\todo'. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 daysipa: rkisp1: awb: Capitalize AWBLaurent Pinchart
AWB is an abbreviation, capitalize it in comments and log messages for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 daysipa: rkisp1: awb: Don't calculate RGB means if stats are missingLaurent Pinchart
When statistics are missing we can't meaningfully calculate the RGB means. Move their calculation after checking if stats are available. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb_grey: Minor comment fixesLaurent Pinchart
Fix the top-level file description to mention the file contains an AWB grey world implementation, not a base class, and fix a grammar mistake in a documentation block. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb: Tidy up includesLaurent Pinchart
Drop unneeded headers and add missing ones. The yaml_parser.h header is dropped from awb_grey.h as the classes it provides are only used in virtual functions defined by the base class, so any required definitions are guaranteed to be available already. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb: Rename AwbStats::getRGBMeans() to rgbMeans()Laurent Pinchart
The convention in libcamera is not to prefix getters with a 'get' prefix. Rename the AwbStats::getRGBMeans() function accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 daysipa: rkisp1: awb: Fix wrong indentation in commentLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb: Pass lux value to calculateAwb() as unsigned intLaurent Pinchart
The lux value can never be negative. Pass it as an unsigned int. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb: Replace reference to pipeline handle with IPA moduleLaurent Pinchart
The AwbStats documentation incorrectly references pipeline handlers when it means IPA modules. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
8 dayslibipa: awb: Standardize spelling on 'grey' worldLaurent Pinchart
All locations but one spell 'grey' instead of 'gray'. Fix the outlier. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>