summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-11ipa: rkisp1: agc: Load ExposureValue from configjmondi/imx8mp/debix-aJacopo Mondi
Load the initial ExpoureValue correction value from configuration file. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-03-11ipa: rkisp: Add support for ExposureValueJacopo Mondi
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2023-03-08ipa: rkisp1: lsc: Move 'enable' to activeStateJacopo Mondi
Now that the LSC algorithm can be enabled and disabled at run-time, move the 'enabled' flag from the context's configuration to the algorithm's active state. This allows to populate the LensShadingEnable metadata in the process() function implementation. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-03-08cam: capture_script: Add LSC test scriptJacopo Mondi
Add a test script that allows to test the LSC correction effect. The script runs the AWB in manual mode with values taken from a previous run with Awb in auto mode. When the AWB is disabled, enable the LSC correction to visually see the improvements in image quality. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2023-03-08ipa: rkisp1: lsc: Enable/disable LSC algorithmJacopo Mondi
Implement LSC algorithm enable/disable by parsing the "LensShadingEnable" control in queueRequest(). Start with the LSC algorithm enabled by default and disable it on application request. The 'lsc' filed in the context configuration could also be removed but other algorithms inspect it. Do not remove it for now. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-03-08libcamera: control_ids: Introduce LensShadingEnableJacopo Mondi
Introduce a control to enable and disable LSC and replace the draft android control. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2023-03-08rkip1: data: imx219: Replace LSC tables with ones from RPiJacopo Mondi
Replace the Lens Shading Correction table with the one from RaspberryPi tuning file generated by the rksip1_lsc_rpi_libcamera.py script. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-03-08utils: rkisp1: Add script to parse RPi lens shading tablesJacopo Mondi
Add a python script to parse the lens shading tables from the RaspberryPi json tuning file. Example invocation: ./utils/rkisp1/rkisp1_lsc_rpi_to_libcamera.py \ -f src/ipa/raspberrypi/data/imx219.json \ -a src/ipa/rkisp1/data/imx219.yaml -t 1000 The script overrides the existing "LensShadingCorrection" section in the output .yaml configuration file. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2023-03-08[RFC] ipa: rkisp1: dpcc: Generalize YAML parsingLaurent Pinchart
The DefectPixelClusterCorrection::init() function contains a large manually written piece of tuning data parsing code, with duplication of similar but slightly different sections. This is error-prone as copy and paste errors easily creep in and can be hard to spot. As an attempt to address this issue, replace that code with two generic functions tbat operate over a data table which describes the structure of the tuning data and where it fits in the ISP configuration structure (which maps directly to registers). At the same time, restructure the tuning data to group parameter per method, to organize the data in a set-method-parameter structure. The line-threshold and line-mad-factor parameters are grouped in a "lc" (line check) method, and the rnd-threshold and rnd-offset parameters in a "rnd" (rank neighbour difference) method. The other parameters (pg-factor, rg-factor and ro-limits) are directly specified in a "pg", "rg" or "ro" method respectively without a parameter name for simplicity. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- A few questions (hence the RFC): - Should methods that have a single parameter (e.g. "pg") have an explicit parameter name in YAML, to match methods that have multiple parameters ? This would result in pg: green: factor: 10 red-blue: factor: 10 instead of pg: green: 10 red-blue: 10 - Should the method names be spelled out fully in YAML, instead of being abbreviated to 2 or 3 letters ? - Is this actually worth it ?
2023-03-08[WIP] ipa: rkisp1: Support the i.MX8MP ISPPaul Elder
Handle the i.MX8MP version of the ISP. This matches the current versioning scheme of the driver, but doesn't seem to scale very well.
2023-03-06ipa: rkisp1: lsc: Fix integer division errorJacopo Mondi
The RkISP1 implementation of the LensShadingCorrection algorithm has been made adaptive to the scene color temperature in commit 14c869c00fdd ("ipa: rkisp1: Take into account color temperature during LSC algorithm"). The LSC algorithm interpolates the correction factors using the table's reference color temperatures. When calculating the interpolation coefficients, an unintended integer division makes both coefficient zeros resulting in a completely black image. Fix this by type casting to double one of the division operands. Fixes: 14c869c00fdd ("ipa: rkisp1: Take into account color temperature during LSC algorithm") Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2023-03-06libcamera: camera_manager: Stop exponential explosive calls to ↵Sophie Friedrich
createPipelineHandlers Currently the function `createPipelineHandlers` connects itself to the `devicesAdded` signal at the end of each call. As the Signal object supports multiple non-unique listeners connected to it, the former function would be called exponentially often with each new emitted event on `devicesAdded` (i.e. with udev plugging in a new camera) Fix it by connecting the createPipelineHandlers() slot to `devicesAdded` signal in CameraManager::Private::init() instead. This will prevent the slot getting connected multiple times to the `devicesAdded` signal. Signed-off-by: Sophie Friedrich <dev@flowerpot.me> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-03-06Documentation: guides: pipeline-handler: Fix spelling errorAdvait Dhamorikar
The pipeline handler writers guide incorrectly references the VividCameradata::init() impelementation with a spelling error. Fix spelling of "impelementation" in the pipeline handler development guide. Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-03-01libcamera: Keep using syslog for isolated IPA modulesMatthias Fend
Currently it is not possible to display debug output from an isolated IPA module. The standard descriptors are all closed and any specified log file is explicitly deactivated for the IPA module. Since libcamera and the isolated IPA module are separate processes, they cannot write to the same file. However, if syslog is used, then this would be possible. If syslog is specified as a log file, then this is left as it is for the isolated IPA module. Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2023-03-01utils: checkstyle.py: Don't run commit title checker on staged commitsPaul Elder
When creating a new commit, there is no title, so the title checker complains that the title isn't compliant and the commit cannot be created if checkstyle is run as a pre-commit hook. Fix this by skipping the title checker when run on staged changes. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-15apps: Return std::optional<> from StreamKeyValueParser::parseRole()Barnabás Pőcze
Instead of having bool return type and an out parameter, use std::optional<libcamera::StreamRole> to return from StreamKeyValueParser::parseRole(). Meanwhile at it, re-word an existing comment to make it lucid. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2023-02-15pipeline: raspberrypi: Always use ColorSpace::Raw for raw streamsDavid Plowman
Commit 613d5402673e ("pipeline: raspberrypi: Fix handling of colour spaces") adjusts the colorspace to ColorSpace::Raw for raw streams. However, if the colorspace is not requested for raw streams(nullopt), we should still set the colorspace to ColorSpace::Raw, for raw streams. Fixes: 613d5402673e ("pipeline: raspberrypi: Fix handling of colour spaces") Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2023-02-12Documentation: Small typo fixPavel Machek
Out should really be output. Signed-off-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-10android: jpeg: Add JEA implementationHarvey Yang
This patch adds JEA implementation to replace libjpeg in CrOS platform, where hardware accelerator is available. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-10android: jpeg: Pass StreamBuffer to Encoder::encoderHarvey Yang
To prepare for support of the JEA encoder in a following commit, which will need to access the buffer_handle_t of the destination buffer, pass the StreamBuffer to the Encoder::encoder() function. As the StreamBuffer contains the source FrameBuffer and the destination Span, drop them from the function arguments and access them directly from the StreamBuffer. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-10android: jpeg: Add meson.build in src/android/jpegHarvey Yang
To further control sources in jpeg to build based on the platform, this patch adds meson.build in src/android/jpeg directory. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-10android: framebuffer: Add HALFrameBuffer and replace FrameBufferHarvey Yang
HALFrameBuffer is derived from FrameBuffer with access to buffer_handle_t, which is needed for JEA usage. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-10libcamera: framebuffer: Allow inheritance of FrameBufferHarvey Yang
To add buffer_handle_t access in android, this patch allows inheritance of FrameBuffer to add a derived class in android. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-09libcamera: Remove transform from V4L2SubdeviceFormatJacopo Mondi
Commit 6f6e1bf704fe ("libcamera: camera_sensor: Apply flips at setFormat()") extended the CameraSensor::setFormat() function to apply vertical/horizontal flips on the sensor based on the supplied Transform. To pass the Transform to the function the V4L2SubdeviceFormat structure has been augmented with a Transform member. However as the newly added Transform is not used at all in the V4L2Subdevice class, it should not be part of V4L2SubdeviceFormat. Fix that by removing the transform field from V4L2SubdeviceFormat and pass it as an explicit parameter to CameraSensor::setFormat(). Fixes: 6f6e1bf704fe ("libcamera: camera_sensor: Apply flips at setFormat()) Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-02-09pipeline: raspberrypi: Drop unused codeLaurent Pinchart
Commit 1a614866a29c ("libcamera: camera_sensor: Validate Transform") has removed usage of the RPiCameraData::supportsFlips_ but hasn't removed the field itself, nor its initialization. Drop those as they're unused. Fixes: 1a614866a29c ("libcamera: camera_sensor: Validate Transform") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2023-02-09pipeline: ipu3: Drop unused codeLaurent Pinchart
Commit 1a614866a29c ("libcamera: camera_sensor: Validate Transform") has removed usage of the IPU3CameraData::rotationTransform_ but hasn't removed the field itself, nor its initialization. Drop those as they're unused. Fixes: 1a614866a29c ("libcamera: camera_sensor: Validate Transform") 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-02-09libcamera: camera_sensor: Fix typo in commentLaurent Pinchart
Fix a typo introduced in a comment when refactoring transformation handling in the CameraSensor class. Fixes: 1a614866a29c ("libcamera: camera_sensor: Validate Transform") 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-02-09libcamera: camera_sensor: Demote flip support message to DebugLaurent Pinchart
The CameraSensor::validateSensorDriver() function prints a Warning message when the camera sensor doesn't support flips. We don't mandate flip support and can run without it without any problem, so a warning is too harsh. Demote it to a Debug message. 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-02-09libcamera: internal: tracepoints: Use correct include directiveUmang Jain
libcamera uses double quotes "..." for #include directives for internal headers. While at it, move the request internal header include to the right location. 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>
2023-02-09ipa: raspberrypi: Normalise region sums to 16-bitsNaushir Patuck
The VC4 ISP uses a pipeline bit-depth of 13-bits. The AGC algorithm needs to know this bit-depth when computing the Y value for the image. Instead of hardcoding the VC4 bit-depth in the AGC source code, normalise all region sums to 16-bits when filling the Statistics structure. AWB and ALSC are agnostic about pipeline depth, so do not need changing. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-02-09ipa: raspberrypi: Use the generic statistics structure in the algorithmsNaushir Patuck
Repurpose the StatisticsPtr type from being a shared_ptr<bcm2835_isp_stats> to shared_ptr<RPiController::Statistics>. This removes any hardware specific header files and structures from the algorithms source code. Add a new function in the Raspberry Pi IPA to populate the generic statistics structure from the values provided by the hardware in the bcm2835_isp_stats structure. Update the Lux, AWB, AGC, ALSC, Contrast, and Focus algorithms to use the generic statistics structure appropriately in their calculations. Additionally, remove references to any hardware specific headers and defines in these source files. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Tested-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-02-09ipa: raspberrypi: awb: Delay release of the statistics bufferNaushir Patuck
Release the statistics buffer after running the through the AWB calculations. Only the "counted" statistics are copied out to a local structure, so keeping the statistics buffer allows the algorithm to see the "uncounted" statistics as well. This is currently handled by hard-coding the total number of statistics regions regions based on the structure definition in the bcm2835_isp_stats structure. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-02-09ipa: raspberrypi: histogram: Add a constructor for an empty histogramNaushir Patuck
Add a default constructor to the RPiController::Histogram class that creates an empty histogram. Since this is a cumulative histogram, push a value of 0 into the first (and only) bin to signify this. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-02-09ipa: raspberrypi: Generalise statisticsNaushir Patuck
At present, the controller algorithms access the bcm2835_isp_stats structure, which is hardware specific. It would be desirable to abstract out the statistics structure to remove hardware specific headers from the algorithms source files. Define a new templated RegionStats class that encompasses region based statistics generated by the ISP. For the VC4 ISP, this can be used to hold RGB sums and focus FoM values. Define a new Statistics structure that holds all the VC4 ISP statistics output. This includes AGC histograms, AGC/AWB region sums and focus FoM regions. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-02-01libcamera v0.0.4Kieran Bingham
Bugfixes: * libcamera: yaml_parser: Use C locale * libcamera: base: utils: Support C libraries lacking locale support * py: cam.py: Fix duplicate metadata output if more than one stream * libcamera: camera: Fix validateColorSpaces to choose main colour space * pipeline: raspberrypi: Fix handling of colour spaces Core: * test: Fix/Enable testing with ASan * test: Remove redundant pipeline tests * meson: Only build pipeline handlers needed in host architecture * meson: Add 'all' choice to pipelines option * utils: checkstyle.py: Add commit title checker * libcamera: ipa_module: Relax ipaModuleInfo symbol size check * pipeline: Support configuration file paths ipa: * camera_sensor: Improve h/v flip handling * camera_sensor: Add AR0521 Sensor support * camera_sensor: Add OV4689 Sensor support * camera_sensor: Add support for OmniVision OV8858 * raspberrypi: Support Autofocus with PDAF * raspberrypi: Support for the Sony IMX708 sensor * rkisp1: Raise maximum analogue gain pipeline: * raspberrypi: Support parameters from a configuration file * raspberrypi: Add a parameter to disable startup drop frames * libcamera: rkisp1: Add support for Transform apps: * gstreamer: Add bayer8 support to libcamerasrc * qcam: Show string representation of pixel format ABI Compliance: * abi-compliance-checker reports 100% ABI and API compatibility with with v0.0.3 Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31pipeline: raspberrypi: Add a parameter to disable startup drop framesNaushir Patuck
Add a new pipeline config parameter "disable_startup_frame_drops" to disable any startup drop frames, overriding the IPA request. When this parameter is set, it allows the pipeline handler to run with no internally allocated Unicam buffers ("min_unicam_buffers"). Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31pipeline: raspberrypi: Read config parameters from a fileNaushir Patuck
Add the ability to read the platform configuration parameters from a config file provided by the user through the LIBCAMERA_RPI_CONFIG_FILE environment variable. Use the PipelineHandler::configurationFile() helper to determine the full path of the file. Provide an example configuration file named example.yaml. Currently two parameters are available through the json file: "min_unicam_buffers" The minimum number of internal Unicam buffers to allocate. "min_total_unicam_buffers" The minimum number of internal + external Unicam buffers that must be allocated. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31pipeline: raspberrypi: Reorder startup drop frame initialisationNaushir Patuck
Reorder the code such that the IPA requested startup drop frames count is available before the pipeline handler allocates any stream buffers. This will be used in a subsequent change to stop Unicam buffer allocations if there are no startup drop frames required and the application has configured a raw stream and always provides buffers for it. Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
2023-01-31pipeline: raspberrypi: Add a pipeline config structureNaushir Patuck
Add a configuration structure to store platform specific parameters used by the pipeline handler. Currently, these only store Unicam buffer counts, replacing the hardcoded static values in the source code. In subsequent commits, more parameters will be added to the configuration structure, and parameters will be read in through a config file. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31libcamera: pipeline: Add a platform configuration file helperNaushir Patuck
Add a new helper function PipelineHandler::configurationFile() that returns the full path of a named configuration file. This configuration file may be read by pipeline handlers for platform specific configuration parameters on initialisation. The mechanism for searching for the configuration file is similar to the IPA configuration file: - 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 pipeline handler directory. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31libcamera: pipeline: build: Add pipeline_data_dir variableNaushir Patuck
Add a pipeline_data_dir variable to the meson build files. This variable points to the location of pipeline handler specific configuration files on the filesystem. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-31pipeline: raspberrypi: Fix handling of colour spacesDavid Plowman
We implement a custom validateColorSpaces method that forces all (non-raw) streams to same colour space, whilst distinguishing RGB streams from YUV ones, as the former must have the YCbCr encoding and range over-written. When we apply the colour space, we always send the full YUV version as that gets converted correctly to what our hardware drivers expect. It is also careful to check what comes back as the YCbCr information gets overwritten again on the way back. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2023-01-30ipa: raspberrypi: Add support for the Sony IMX708 sensorNick Hollinghurst
Add support for Raspberry Pi Camera 3 modules (Sony IMX708 camera sensor) to the Raspberry Pi IPA. These modules are available in either normal or wide angle lens, both with IR or no IR cut options, giving a total for 4 variants. Provide IQ tuning files for all four variants. The IMX708 camera helper additionally parses PDAF and HDR histogram data that is provided in the embedded data stream from Unicam. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30libcamera: camera_sensor: Add Sony IMX708 sensor propertiesNick Hollinghurst
Add CameraSensorProperties for the Sony IMX708 sensor. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: Add lens position to DeviceStatusNaushir Patuck
Add the current frame's lens position (in dioptres) to the DeviceStatus structure. This value is obtained from the AfAlgorithm::getLensPosition() member function. Return this lens position back to the pipeline handler to store in the metadata field of the request. As a drive-by, fixup some inaccurate comments in the DeviceStatus structure. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Nick Hollinghurst nick.hollinghurst@raspberrypi.com Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: First version of autofocus algorithm using PDAFNick Hollinghurst
Provide the first version of the Raspberry Pi autofocus algorithm. This implementation uses a hybrid of contrast detect autofocus (CDAF) and phase detect autofocus (PDAF) statistics. PDAF is always preferred over CDAF due to having less "hunting" behavior. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: Handle autofocus algorithm resultsNick Hollinghurst
Handle the results returned from the autofocus algorithm by updating lens actuator position to the desired value. Update the Request metadata with the algorithm status to provide back to the application. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: Handle autofocus controlsNick Hollinghurst
Add handlers for all autofocus related libcamera controls. Translate these controls to the RPiController autofocus algorithm API. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: Include autofocus controls in the IPA ControlInfoMapNaushir Patuck
Add all the autofocus controls handled by the IPA into the ControlInfoMap if a controllable lens actuator is present. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-01-30ipa: raspberrypi: Reorder header file inclusionNaushir Patuck
Reorder the libcamera/request header file inclusion to match the libcamera guidelines. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>