From e5fc0132f80d644757373ab0e0e3db00fe6ee010 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 10 Oct 2022 08:42:32 +0100 Subject: camera_sensor: Add minimum and maximum line length to IPACameraSensorInfo Add fields for minimum and maximum line length (in units of pixels) to the IPACameraSensorInfo structure. This replaces the existing lineLength field. Update the ipu3, raspberrypi and rkisp1 IPAs to use IPACameraSensorInfo::minLineLength instead of IPACameraSensorInfo::lineLength, as logically we will always want to use the fastest sensor readout by default. Since the IPAs now use minLineLength for their calculations, set the starting value of the V4L2_CID_HBLANK control to its minimum in CameraSensor::init(). Signed-off-by: Naushir Patuck Tested-by: Dave Stevenson Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/libcamera/ipa/core.mojom | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 74f3339e..2bc3028c 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -172,10 +172,17 @@ module libcamera; */ /** - * \var IPACameraSensorInfo::lineLength - * \brief Total line length in pixels + * \var IPACameraSensorInfo::minLineLength + * \brief The minimum line length in pixels * - * The total line length in pixel clock periods, including blanking. + * The minimum allowable line length in pixel clock periods, including blanking. + */ + +/** + * \var IPACameraSensorInfo::maxLineLength + * \brief The maximum line length in pixels + * + * The maximum allowable line length in pixel clock periods, including blanking. */ /** @@ -189,7 +196,7 @@ module libcamera; * To obtain the minimum frame duration: * * \verbatim - frameDuration(s) = minFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) + frameDuration(s) = minFrameLength(lines) * minLineLength(pixels) / pixelRate(pixels per second) \endverbatim */ @@ -204,7 +211,7 @@ module libcamera; * To obtain the maximum frame duration: * * \verbatim - frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) + frameDuration(s) = maxFrameLength(lines) * maxLineLength(pixels) / pixelRate(pixels per second) \endverbatim */ struct IPACameraSensorInfo { @@ -217,7 +224,9 @@ struct IPACameraSensorInfo { Size outputSize; uint64 pixelRate; - uint32 lineLength; + + uint32 minLineLength; + uint32 maxLineLength; uint32 minFrameLength; uint32 maxFrameLength; -- cgit v1.2.1