[libcamera-devel] [PATCH v3 18/23] ipa: ipu3: Use an up to date lineDuration
Jacopo Mondi
jacopo at jmondi.org
Thu Jun 30 15:38:57 CEST 2022
The IPA module computes the lineDuration value in the init() function
only, and uses it when processing statistics to recompute the shutter
duration.
As the lineDuration varies when a new mode is applied to the sensor,
computing it once at IPA initialization time is not enough.
Re-calculate the line duration value at IPA configure() time to make
sure the module always uses an updated value.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
include/libcamera/ipa/ipu3.mojom | 3 +--
src/ipa/ipu3/ipu3.cpp | 9 ++++-----
src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +------
3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom
index 5818cd3a6846..64fe65fdd5fc 100644
--- a/include/libcamera/ipa/ipu3.mojom
+++ b/include/libcamera/ipa/ipu3.mojom
@@ -17,8 +17,7 @@ struct IPAConfigInfo {
};
interface IPAIPU3Interface {
- init(libcamera.IPASettings settings,
- libcamera.IPACameraSensorInfo sensorInfo)
+ init(libcamera.IPASettings settings)
=> (int32 ret);
start() => (int32 ret);
stop();
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 44a7d13225df..eb97c8be5431 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -132,8 +132,7 @@ namespace ipa::ipu3 {
class IPAIPU3 : public IPAIPU3Interface
{
public:
- int init(const IPASettings &settings,
- const IPACameraSensorInfo &sensorInfo) override;
+ int init(const IPASettings &settings) override;
int start() override;
void stop() override;
@@ -181,6 +180,8 @@ void IPAIPU3::updateSessionConfiguration(const IPAConfigInfo &info)
{
const IPACameraSensorInfo &sensorInfo = info.sensorInfo;
context_.configuration.sensor.vBlank = sensorInfo.vblank;
+ context_.configuration.sensor.lineDuration = sensorInfo.lineLength * 1.0s
+ / sensorInfo.pixelRate;
const ControlInfoMap &sensorControls = info.sensorControls;
@@ -229,8 +230,7 @@ bool IPAIPU3::validateSensorControls(const ControlInfoMap &sensorControls)
* handler, computes the limits of the controls it handles and returns
* them in the \a ipaControls output parameter.
*/
-int IPAIPU3::init(const IPASettings &settings,
- const IPACameraSensorInfo &sensorInfo)
+int IPAIPU3::init(const IPASettings &settings)
{
camHelper_ = CameraSensorHelperFactory::create(settings.sensorModel);
if (camHelper_ == nullptr) {
@@ -242,7 +242,6 @@ int IPAIPU3::init(const IPASettings &settings,
/* Clean context */
context_.configuration = {};
- context_.configuration.sensor.lineDuration = sensorInfo.lineLength * 1.0s / sensorInfo.pixelRate;
/* Construct our Algorithms */
algorithms_.push_back(std::make_unique<algorithms::Af>());
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index ce207c968075..55b96137f065 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1237,12 +1237,7 @@ int IPU3CameraData::loadIPA()
if (ret)
return ret;
- IPACameraSensorInfo sensorInfo{};
- ret = sensor->sensorInfo(&sensorInfo);
- if (ret)
- return ret;
-
- ret = ipa_->init(IPASettings{ "", sensor->model() }, sensorInfo);
+ ret = ipa_->init(IPASettings{ "", sensor->model() });
if (ret) {
LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
return ret;
--
2.36.1
More information about the libcamera-devel
mailing list