summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-11-12ipa: rkisp1: Add rudimentary LSC tables for imx219Paul Elder
Add rudimentary LSC tables for imx219. These were generated with the rkisp1 tuning script from libtuning [1], using an imx8mp (debix) and a white computer monitor, at only a single color temperature of 5800. [1] https://lists.libcamera.org/pipermail/libcamera-devel/2022-October/035017.html Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-11-12ipa: rkisp1: Take into account color temperature during LSC algorithmFlorian Sylvestre
Add coefficients sets in the YAML tuning file to allow using different set depending of the image color temperature (provided by AWB algorithm). During processing, LSC algorithm computes coefficients by doing a linear interpolation between the two closer set. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-12gstreamer: Provide framerate support for libcamerasrcRishikesh Donadkar
Control the framerate by passing the controls::FrameDurationLimits during Camera::start(). Framerate in gstreamer is expressed as GST_TYPE_FRACTION so we maximise on maintaining it as a fraction throughout and only do arithematic computations as and when required (to compute frame-duration and vice-versa). To weed out abritrary framerate as input, place the clamping via the controls::FrameDurationLimits provided after camera::configure() phase. This is handled by a helper function gst_libcamera_clamp_and_set_frameduration(). Set the bound checked framerate (done in the above mentioned helper) into the caps and pass the ControlList containing the frame-duration to Camera::start(ctrls). Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-12gstreamer: Do not expose the caps before configuring the cameraRishikesh Donadkar
Configure the camera before exposing the caps valid controls values (and bounds) are available. These control values might be of interest to be exposed on the capabilites, which otherwise, would not be available if the camera is configured after the update caps event. For instance, the FrameDurationLimits are computed by RPi's IPA in its configure(). Hence, we need to Camera::configure() to happen in order to know the FrameDurationLimits, that can be exposed in the caps. This ties into the framerate support for libcamerasrc which will happen in a follow-up commit. Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-11v4l2: v4l2_camera: Apply clang thread safety annotationHirokazu Honda
This annotates member functions and variables of V4L2Camera by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-11v4l2: v4l2_camera_proxy: Apply clang thread safety annotationHirokazu Honda
This annotates member functions of V4L2CameraProxy by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-11libcamera: camera_manager: Apply clang thread safety annotationHirokazu Honda
This annotates member functions and variables of CameraManager::Private by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-11libcamera: base: thread: Apply clang thread safety annotationHirokazu Honda
This annotates member variables of ThreadData by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-11libcamera: base: semaphore: Apply clang thread safety annotationHirokazu Honda
This annotates member functions and variables of Semaphore by clang thread safety annotations. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-11-09pipeline: rkisp1: Pass info pointer to tryCompleteRequest()Laurent Pinchart
The tryCompleteRequest() function looks up the RkISP1FrameInfo that all but one of its callers already look up. Remove the double look up by passing the info pointer to tryCompleteRequest(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-11-09libcamera: pipeline_handler: Return unique_ptr from generateConfiguration()Laurent Pinchart
The PipelineHandler::generateConfiguration() function allocates a CameraConfiguration instance and returns it. The ownership of the instance is transferred to the caller. This is a perfect match for a std::unique_ptr<>, which the Camera::generateConfiguration() function already returns. Update PipelineHandler::generateConfiguration() to match it. This fixes a memory leak in one of the error return paths in the IPU3 pipeline handler. While at it, update the Camera::generateConfiguration() function documentation to drop the sentence that describes the ownership transfer, as that is implied by usage of std::unique_ptr<>. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-09ipa: rkisp1: Move shutter speed and analogue gain limits from agc to sensorLaurent Pinchart
The limits for the shutter speed and analogue gain are stored in IPASessionConfiguration::agc. While they're related to the AGC, they are properties of the sensor, and are stored in the session configuration by the IPA module, not the AGC algorithm. Move them to the IPASessionConfiguration::sensor structure where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-11-09ipa: Sort algorithm operations based on calling orderLaurent Pinchart
Reorder functions in the base ipa::Algorithm and its derived classes to match the calling order: queueRequest(), prepare() and process(). This makes the code flow easier to read. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-11-08libcamera: camera: Fix the isAcquired testDavid Plowman
All states count as "acquired" except for "CameraAvailable". Fixes: dfc6d711c9f7 ("libcamera: Allow concurrent use of cameras from same pipeline handler") Signed-off-by: David Plowman <david.plowman@raspberrypi.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>
2022-11-03ipa: rkisp1: Compute LSC algorithm parameter during configureFlorian Sylvestre
LSC gradient parameters are currently computed during prepare() phase. Because these parameters can be computed only one time and stay constant for each frame after, move the computation to the configure() function. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
2022-10-28ipa: raspberrypi: awb: Update colour temperature whenever manual gains changeDavid Plowman
Previously we only did this when the system starts (on the first switch_mode). Now we do it whenever the manual colour gains are updated. To facilitate this, this R/B vs. colour temperature inverse functions are stored persistently in the AwbConfig. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28pipeline: raspberrypi: Do not unconditionally free buffers on closeNaushir Patuck
When a camera is terminated, do not unconditionally free buffers in the RPiCameraData destructor. Otherwise, this causes harmless error log messages to be displayed if no buffer have previously been allocated. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: David Plowman <david.plowman@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>
2022-10-28libcamera: v4l2_videodevice: Guard against releasing unallocated buffersNaushir Patuck
releaseBuffers() unconditionally calls ioctl(REQBUFS, 0) to release device buffer allocations through the close() and class destructor functions. If another libcamera process is running concurrently with a different sensor, it would cause the ioctl to fail in the kernel because the buffer queue is owned owned by the other process. This in turn would cause libcamera to generate an error log message. Fix this by ensuring the releaseBuffers() only calls ioctl(REQBUFS, 0) if there have been buffers previously allocated by the device. This is done by testing the presense of the V4L2BufferCache in the object. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28android: libcamera: add useful debug printsNicholas Roth
I identified opportunities to make libcamera's log output easier to understand while working to get it working on my Android device as a HAL. These additional logging statements came out of that and will hopefully prove useful to Android distribution maintainers with the same goal as mine and to users who attempt to debug tools like Waydroid. Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28libcamera: make libdl optional when providedNicholas Roth
Currently, libdl is always required. Sometimes, the C++ runtime includes a dynamic loader, which is the case for Android. Additionally, Android 11 does not have libdl. This fix allows libcamera to build on Android. Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28ipa: raspberry: replace abs() with std::abs()Nicholas Roth
pwl.cpp uses abs() instead of std::abs(), which causes unexpected behavior in the Clang compiler used for Android. Replace with C++-standard absolute value function std::abs(), which supports double-precision absolute values in a standard way. Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28android: remove references to std::filesystemNicholas Roth
Android 11's toolchain does not support std::filesystem, but camera_hal_config.cpp currently uses it. Remove references to std::filesystem in order to support Android <= 11. This adds a very small difference in behaviour, as File::exist() will return true for special files (pipes, character or block devices, ...) while std::filesystem::is_regular_file() doesn't, but I consider this to be a corner case that doesn't matter much. Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-28ipa: add missing thread-safety annotationsNicholas Roth
The raspberrypi IPA is missing thread-safety annotations, which breaks the build. Add required thread-safety annotations. ../src/ipa/raspberrypi/controller/metadata.h:108:31: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis] void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:108:23: note: mutex acquired here void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:109:25: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis] void unlock() { mutex_.unlock(); } ^ Signed-off-by: Nicholas Roth <nicholas@rothemail.net> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-24apps: Share common source between applicationsLaurent Pinchart
Multiple source files in the src/apps/cam/ directory are used by cam, qcam and lc-compliance. They are compiled separately for each application. Move them to a new src/apps/common/ directory and compile them in a static library to decrease the number of compilation operations. 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-10-24ipa: ipu3: Fill AGC and AWB metadata in algorithmsLaurent Pinchart
Fill the frame metadata in the AGC and AWB algorithm's prepare() function. This removes the need to fill metadata manually in the IPA module's processStatsBuffer() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-24ipa: rkisp1: Fill AGC and AWB metadataLaurent Pinchart
Fill the frame metadata in the AGC and AWB algorithm's prepare() function. Additional metadata for other algorithms will be addressed later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-24ipa: Pass metadata to Algorithm::process() functionLaurent Pinchart
Extend the Algorithm::process() function with a metadata control list, to be filled by individual algorithms with frame metadata. Update the rkisp1 and ipu3 IPA modules accordingly, and drop the dead code in the IPARkISP1::prepareMetadata() function while at it. This only creates the infrastructure, filling metadata in individual algorithms will be handled separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-24apps: cam: Fix compilation error with clang when libtiff-4 is not foundLaurent Pinchart
When libtiff-4 is not found, the private camera_ member of the FileSink class is set but never used. This causes a compilation error with clang: In file included from ../../src/apps/cam/file_sink.cpp:19: ../../src/apps/cam/file_sink.h:39:27: error: private field 'camera_' is not used [-Werror,-Wunused-private-field] const libcamera::Camera *camera_; Fix by making the camera_ member field conditional on HAVE_TIFF. Fixes: 6404b163bcbb ("cam: file_sink: Add support for DNG output") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-20apps: Move libtiff dependency to src/apps/meson.buildLaurent Pinchart
libtiff is a shared dependency between cam and qcam, move it to src/apps/. The shared dependency will be used to condition compilation of source files in an upcoming application static library. 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>
2022-10-20apps: Move libevent dependency to src/apps/meson.buildLaurent Pinchart
libevent is a shared dependency between cam and lc-compliance, move it to src/apps/. The shared dependency will be used to condition compilation of source files in an upcoming application static library. 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>
2022-10-20Move test applications to src/apps/Laurent Pinchart
The cam and qcam test application share code, currently through a crude hack that references the cam source files directly from the qcam meson.build file. To prepare for the introduction of hosting that code in a static library, move all applications to src/apps/. 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>
2022-10-20qcam: Simplify dependency handling for libtiffLaurent Pinchart
There's no need to conditionally add tiff_dep to the list of qcam dependency, as a not found dependency() is ignored when listed in the executable dependencies argument. 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>
2022-10-20cam: Don't print DNG option text if libtiff isn't foundLaurent Pinchart
If libtiff isn't found, DNG capture support is disabled. Don't print the part of the --file help text that mentions DNG in that case. 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>
2022-10-20ipa: raspberrypi: Rename ov9281.json to ov9281_mono.jsonNaushir Patuck
The recent change to the naming scheme for the camera tuning files failed to rename ov9281.json, causing the sensor to fail to load. Since this is a mono sensor module, rename this file to ov9281_mono.json. Fixes: 820607b195ff: ("pipeline: raspberrypi: Update naming convention for tuning files") Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-20libcamera: base: log: Fix LogCategory creation issuesTomi Valkeinen
Each declaration of a LogCategory will create a new LogCategory, and will be stored in an unordered_set Logger::categories_. This means that when a plugin .so is unloaded and loaded, as happens when destructing and creating a CamereManager, we'll get duplicate categories. The Logger::registerCategory docs say "Log categories must have unique names. If a category with the same name already exists this function performs no operation.". The code does not comply with this. We solve the issue with two changes: Change the unordered_set to a vector for simplicity, as there's no need for an unordered_set. Instead of using the LogCategory constructor to create new categories in _LOG_CATEGORY() macro, use a factory method. The factory method will return either an existing LogCategory if one exists with the given name, or a newly created one. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@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>
2022-10-20libcamera: base: log: Fix use of freed nameTomi Valkeinen
LogCategory just stores the char * that was given to it in the constructor, i.e. it refers to memory "outside" LogCategory. If the LogCategory is defined in a .so that is unloaded, then it leads to the LogCategory pointing to freed memory, causing a crash. Fix this by taking a copy of the name by using a std::string instead of just storing the pointer. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@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>
2022-10-19ipa: rkisp1: Downgrade sensor controls range message to DebugLaurent Pinchart
There's no need to print the exposure and gain control ranges as an Info message. Downgrade it to Debug. While at it, print the ranges using the "[min, max]" syntax. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-19ipa: Drop period at end of \brief or \paramLaurent Pinchart
A few periods crept in at the end of Doxygen \brief or \param statements in the src/ipa/ directory. Remove them all in one go. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-19cam: dng_writer: Add support for 8-bit raw formatsPaul Elder
Add support for 8-bit raw formats in DNGWriter. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-19cam: file_sink: Add support for DNG outputPaul Elder
Add support for outputting buffers in DNG format. It reuses the DNG writer that we had previously in qcam. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-19qcam, cam: Move DNGWriter from qcam to camPaul Elder
To prepare for adding DNG support to cam, move DNGWriter from qcam to cam so that we only have inclusions from qcam to cam and not the other way around. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-10-18ipa: vimc: Add Flags to parametersPaul Elder
For the purpose of testing serializing/deserializing Flags in function parameters, add an enum class TestFlags and Flags<TestFlags> to some function parameters, both for input and output and Signals. While at it, update the ipa_interface_test. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: vimc: Add IPAOperationCode to init() parameter listPaul Elder
For the purpose of testing serializing/deserializing enums in function parameters, add IPAOperationCode to the parameter list of init(). Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Extract line length from the embedded data parserNaushir Patuck
Update the imx219, imx477 and imx519 parsers to extract the line length values from the embedded data stream and use these values in the deviceStatus metadata, replacing the DelayedControls provided values. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Allow full line length controlNaushir Patuck
Rename CamHelper::getVBlanking to CamHelper::getBlanking, and update the calculations in that function to return both horizontal and vertical blanking values for a given exposure time and frame duration limits. The calculations are setup such that vertical blanking is extended to the maximum allowable value, and any remainder gets put into horizontal blanking. The calculated horizontal blanking value is now returned to the pipeline handler to pass into DelayedControls to program into the sensor. Update the IPA to now specify the maximum frame duration from the maximum horizontal + vertical blanking values provided by the sensor mode. Additionally, the IPA now uses the frame specific horizontal blanking value (as returned by DelayedControls) in all instances. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Add line length to DeviceStatusNaushir Patuck
Add a lineLength field to the DeviceStatus structure to store the line length used for a particular frame. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Add line length calculations helper functionsNaushir Patuck
Add CamHelper::hblankToLineLength() to calculate the line length duration from the horizontal blanking (in pixels) value. Add CamHelper::lineLengthToHblank() to calculate the horizontal blanking (in pixels) value from the line length duration. Add CamHelper::lineLengthPckToDuration() to calculate the line length duration from the line length in pixels. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Add pixel clock rate to the CameraMode structureNaushir Patuck
The pixel clock rate will be used in subsequent commits to calculate line length durations. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18pipeline: ipa: raspberrypi: Add HBLANK control to DelayedControlsNaushir Patuck
Update CamHelper::getDelays() to return the sensor HBLANK delay. The HBLANK delay is set to the same value as VBLANK delay for all sensors in the Raspberry Pi IPA. Return the HBLANK gain delay from the IPA to the pipeline handler, and initialise DelayedControls to handle V4L2_CID_HBLANK with this delay value. As a drive-by, check that the V4L2_CID_HBLANK control is available when calling IPARPi::configure(). Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-18ipa: raspberrypi: Remove initialized_ field from CamHelperNaushir Patuck
Given that the single user of the CamHelper is the Raspberry Pi IPA, the initialized_ field check is unnecessary. Remove the check and the field. 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>