summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-19ipu3: ipa: Update to latest IPACameraSensorInfoHEADmasterKieran Bingham
In libcamera commit e5fc0132f80d ("camera_sensor: Add minimum and maximum line length to IPACameraSensorInfo"), the IPU3 IPA interface is updated to provide both minimum and maximum line lengths, replacing the existing lineLength field. Update the ipu3-ipa to use IPACameraSensorInfo::minLineLength instead of IPACameraSensorInfo::lineLength, as logically we will always want to use the fastest sensor readout by default. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-04-08ipa: ipu3: Inline parseStatistics() into processStatsBuffer()Umang Jain
Since we have moved away from switch/case on the operation ID, there's little reason to split the operation in two functions. 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> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-08ipu3: Inline fillParams() in fillParamsBuffer()Umang Jain
Since we have moved away from switch/case on the operation ID, there's little reason to split the operation in two functions. 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> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-08ipu3: Use the new IPAIPU3 interfaceUmang Jain
Use the new IPAIPU3 interface that migrates the event-based ops to dedication functions. 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> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-12-06libcamera-helpers: mapped_framebuffer: Update to new FD APIKieran Bingham
The plane file descriptors API has been updated in the libcamera base library. Update our mapped_framebuffer class accordingly. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> 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-12-03ipu3: Apply auto focus and send lens controls to pipeline handlerHan-Lin Chen
Apply auto focus and send lens controls to pipeline handler. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-19ipu3: Run AIQ for the first frame to avoid blankingHan-Lin Chen
The start() function set the first exposure time and analog gain to maximum. In result, the first frame might be over bright and the user may see a bright blank when changing the camera in application. Run AIQ to get an initial exposure time and analog gain in start() to smooth the AE process. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> [Kieran: Rebased without lens controls] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-19ipu3: Use gbce and tone mapping from the tuning filesHan-Lin Chen
Change the flags to gbce algorithm to use the global brightness and tone mapping from the tuning files. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-19ipu3: Set statistics with the effective AE AiqResultsHan-Lin Chen
Set the statistics with the latest AE AiqResults which has the same exposure time and analog gain. The patch reduces the AE hunting during the converging process. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-19ipu3: Add a class AiqResultsRingBuffer to reserve AiqResults historyHan-Lin Chen
The AIQ algorithm expects the statstistics comes with the effective AiqResults applied on the sensor, which may not always be the latest AiqResults, since pipeline handler may delay setting the controls based on SOF. Add a class to reserve the history of the AiqResults generated for previous frames, so IPA can have a chance to look for the suitable one backwards. In details, the patch adds following to AiqResult Class. - Make the parameters to setXXX() functions const. - Implement copy constructors - Implement a RingBuffer to maintain AiqResults History Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-19ipu3: Use ia_aiq_frame_use_preview as default mode for AIQHan-Lin Chen
The frame use mode is set according to Android Capture Intent in Intel HAL's implememtation. The current default mode ia_aiq_frame_use_still is only used with the single capture request. For preview use case, it has a hard time converging AE and AF smoothly. Change the default mode to ia_aiq_frame_use_preview for better user experience. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-18ipu3: Update camera controls in configure()Kieran Bingham
When a new CameraConfiguration is applied to the Camera the IPA is configured as well, using the newly applied sensor configuration and its updated V4L2 controls. Also update the Camera controls at IPA::configure() time by re-computing the controls::ExposureTime and controls::FrameDurationLimits limits and update the controls on the pipeline handler side after having configured the IPA. This commit corresponds to the libcamera commit 4ed22985a846 ("ipa: ipu3: Update camera controls in configure()") and applies the same changes to this IPA. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-10-18ipu3: Apply shading adapter as part of AIQ::run2a()Han-Lin Chen
Populate shading adapter input parameters and run it as a part of run2a() to correct lens shading for the camera. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-18ipu3: Change Macro migrated from Chrome OS to its std version accordinglyHan-Lin Chen
Change the Macro STDCOPY, MEMCPY_S and CLEAR to its std version to better suit the style. The patch also fix misusage of STDCOPY as memcpy, which leads to copying overflown in PA and SA results. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-18ipu3: Remove the usage of SharedItemPoolHan-Lin Chen
The SharedItemPool was migrated from Chrome OS to maintain RGBS and AF grids in IPAIPU3Stats. The orginal reason is to reserve the validness unitl the grids are processed in a different thread. However, it leads to a subtle bug which recycles the buffer before sending into AIQ libraries. Since the IPU3 IPA (Unlike Chrome OS) process IPAIPU3Stats in a single thread, It would be simpler to maintain the grids as the members of IPAIPU3Stats, and remove the usage of SharedItemPool. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-18libcamera-helpers: Integrate latest MappedFrameBufferKieran Bingham
The MappedFrameBuffer helper class has been updated in the libcamera source code. This makes use of the new enum MapFlags type, and corrects the mapping changes that were made during 8708904fad6f ("libcamera: mapped_framebuffer: Return plane begin address by MappedBuffer::maps()") This update also brings back isolated IPA functionality to this external IPA, which is otherwise broken due to the offset/plane changes. The files are renamed to mapped_framebuffer to match the naming in libcamera, but are kept within the 'libcamera-helper' hierarchy of the IPA. Also, a minor todo is added to IPAIPU3::mapBuffers, to highlight that we could potentially map Statistics buffers as read only rather than read/write if we could correctly identify them. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-09-28ipu3: Use new sensor controlsKieran Bingham
The IPU3 interface was updated in 4c1fc33d8ab9 ("libcamera: ipu3: Drop entityControls map") where the sensor controls are given their own dedicated control list and is named accordingly. Update the IPU3 IPA to match the new interface update. Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-17ipu3: Initialise controls in the IPAKieran Bingham
In commit 11fe4333c54d ("libcamera: ipu3: Initialize controls in the IPA") the interface for the IPA was updated and the creation of exposure and frame duration controls are now the responsibility of the IPA. In libcamera, the code that creates these controls was moved to the integrated IPA for the IPU3. Duplicate the implementation here. Acked-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-06ipu3: Use ChromeOS tuning file pathsKieran Bingham
During development, the IPA relied upon tuning database files copied from Chrome OS, duplicated in this repository, and installed in a second location on the target, in /usr/share/libcamera/ipa/ipu3/. Having two copies of the same files on the target devices is not only pointless, it also causes an issue with some Soraka models that use a different sensor module, with a different tuning file. Use the tuning files from Chrome OS directly and drop our copies. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-04binary_data: Use type-safe file flagsUmang Jain
In commit 91d06ae2fc61("libcamera: file: Use Flags<> class for open flags"), type-safe file mode flags are introduced. Adapt our usage accordingly in BinaryData, which uses the File class from libcamera. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
2021-07-15ipu3: Use updated buffer.h headerKieran Bingham
In libcamera commit 6a31a8d8e274 ("libcamera: buffer: Rename buffer.h to framebuffer.h"), the public header buffer.h was renamed. Update the usage accordingly. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-28package: Provide ipu3-ipa ebuildUmang Jain
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28ipu3: Integrate AIQ/AICKieran Bingham
Utilise the AIQ and AIC libraries to handle image control within the IPU3. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aic: Provide Automatic IPU Configuration supportUmang Jain
Provide a support layer for the AIC abstraction of the IPU configuration layer. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aic: Import IPU3ISPPipeUmang Jain
Import and construct the IPU3ISPPipe to provide the callback hooks required by the ia_imaging libraries. We need to set 'MACRO_KBL_AIC' for rgbir_2500_config aic config parameter since it's wrapped in #ifdefs directives. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aic: Add IPU3 parameter encoderKieran Bingham
The Parameter Encoder is imported from the ChromeOS implementation, with some small changes to fit style and support building independantly. The parameter encoders have assertions in them to check that the required input data is valid. ispAwbFrEncode() is currently disabled due to failing assertions around grid widths. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aiq: Provide initial Intel AIQ Wrapper supportKieran Bingham
The AIQ class is the entry point for running IPA algorithms for the requested frame and handles the statistics being generated. It comprises of wrapping the ia_aiq_*_run() functions and provide helper functions that take in the input parameters and location for their results after the run. These results(AiqResults) can be used for subsequent runs and setting statistics as required. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28stats: Create IPAIPU3Stats and import intel_skycam_statistics_convert()Umang Jain
This is will be used to convert statistics received from kernel to AIQ stats format. Specific 3a conversion functions will be added in IPAIP3Stats in subsequent commits. ipu3_stats_get_3a() will extract, memcpy each of 3A relevant structures. It's is intended just before setting the stats for next frame in AIQ::setStatistics(). It receives ipu3_uapi_stats_3a struct from the kernel. This API will be developed per parameter of ipu3_uapi_stats_3a struct in subsequent commit. IPAIPU3Stats will be responsible to take in the AIQ algorithms results set and hardware statistics as input and generate(and convert) AIQ consumable ia_aiq_statistics_input_param structure. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28stats: Import SharedItemPool for stats' grid buffersUmang Jain
Import the SharedItemPool implementation to managed grid buffers. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aiq: AiqInputParametersUmang Jain
Import the AiqInputParameters structures to facilitate configuring and managing the algorithms as they run. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28aiq: Provide managed AIQ Results structuresUmang Jain
The AIQ results structures returned from the AIQ library has many complex and deeply nested data structures which must be copied out. This class handles the correct initialisation of a full set of AIQ results, along with the allocations required, and the ability to copy data into those structures correctly. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-28aiq: Provide a BinaryData wrapperKieran Bingham
The AIQ class loads data as instances of ia_binary_data. The data for this structure should be loaded from files, and the lifetime of the data is managed by the lifetime of the class. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28include: Link to ia_imaging library and import headersUmang Jain
libia_imaging is provided by the ChromeOS system, however the headers aren't installed at the system's $includedir locations. We need to carry them in-tree, to be able to use them. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28data: Add tuning data filesUmang Jain
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-28ipu3: Import the Intel IPA skeleton from libcameraUmang Jain
Import the raw Intel IPU3 IPA from libcamera master at revision b2cc8a2f57333f. Also, copy the build enviroment and adapt the meson.build to build the shared library. The ipu3.cpp is now ready for integration with the Intel IPA library. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-06-28src: Import MappedBuffer class from libcameraUmang Jain
This libcamera internal class, needs to be imported from libcamera code base, in order to have standalone ipu3-ipa build. Other libcamera components required by ipu3-ipa, will be linked through libcamera_platform.so in subsequent commit. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-05-20Intel IPU3 IPAKieran Bingham
Provide an IPA implementation for the Intel IPU3 using the Intel IA Imaging library to handle the image algorithm control and configuration of the IPU3 hardware. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>