summaryrefslogtreecommitdiff
path: root/src/ipa
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-10-10 08:42:32 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-18 03:09:06 +0300
commite5fc0132f80d644757373ab0e0e3db00fe6ee010 (patch)
treec22201fabfbedcad3a675eb1d55e3af9c5a52a5c /src/ipa
parentae7809307e798ae32f4c978882aca94249ce7fd7 (diff)
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 <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>
Diffstat (limited to 'src/ipa')
-rw-r--r--src/ipa/ipu3/ipu3.cpp6
-rw-r--r--src/ipa/raspberrypi/raspberrypi.cpp2
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 852deb71..891643e0 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -336,7 +336,8 @@ int IPAIPU3::init(const IPASettings &settings,
/* Clean context */
context_.configuration = {};
- context_.configuration.sensor.lineDuration = sensorInfo.lineLength * 1.0s / sensorInfo.pixelRate;
+ context_.configuration.sensor.lineDuration = sensorInfo.minLineLength
+ * 1.0s / sensorInfo.pixelRate;
/* Load the tuning data file. */
File file(settings.configurationFile);
@@ -499,7 +500,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,
context_.frameContexts.clear();
/* Initialise the sensor configuration. */
- context_.configuration.sensor.lineDuration = sensorInfo_.lineLength * 1.0s / sensorInfo_.pixelRate;
+ context_.configuration.sensor.lineDuration = sensorInfo_.minLineLength
+ * 1.0s / sensorInfo_.pixelRate;
/*
* Compute the sensor V4L2 controls to be used by the algorithms and
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 14b06a4f..ec495a37 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -356,7 +356,7 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)
* Calculate the line length as the ratio between the line length in
* pixels and the pixel rate.
*/
- mode_.lineLength = sensorInfo.lineLength * (1.0s / sensorInfo.pixelRate);
+ mode_.lineLength = sensorInfo.minLineLength * (1.0s / sensorInfo.pixelRate);
/*
* Set the frame length limits for the mode to ensure exposure and
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 022595f3..3f5c1a58 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -246,7 +246,7 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,
context_.configuration.hw.revision = hwRevision_;
context_.configuration.sensor.size = info.outputSize;
- context_.configuration.sensor.lineDuration = info.lineLength * 1.0s / info.pixelRate;
+ context_.configuration.sensor.lineDuration = info.minLineLength * 1.0s / info.pixelRate;
/*
* When the AGC computes the new exposure values for a frame, it needs