[libcamera-devel] [PATCH 18/22] ipa: ipu3: Move the sensor update controls
Jean-Michel Hautbois
jeanmichel.hautbois at ideasonboard.com
Mon Nov 8 14:13:46 CET 2021
We want the setControls() to use the cached exposure_ and gain_ values,
so move the frame context update of those variables into
frameCompleted() call instead.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
---
src/ipa/ipu3/ipu3.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index b60ab7e7..9b20e8ab 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -534,6 +534,10 @@ void IPAIPU3::frameStarted([[maybe_unused]] unsigned int frame)
void IPAIPU3::frameCompleted([[maybe_unused]] unsigned int frame)
{
+ /* Apply the exposure and gain updated values */
+ exposure_ = context_.frameContext->agc.exposure;
+ gain_ = camHelper_->gainCode(context_.frameContext->agc.gain);
+
/*
* Remove the pointer from the queue, it should not be accessed
* anymore and delete it.
@@ -711,10 +715,6 @@ void IPAIPU3::setControls(unsigned int frame)
IPU3Action op;
op.op = ActionSetSensorControls;
- /* Apply the exposure and gain updated values */
- exposure_ = context_.frameContext->agc.exposure;
- gain_ = camHelper_->gainCode(context_.frameContext->agc.gain);
-
ControlList ctrls(ctrls_);
ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));
ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
--
2.32.0
More information about the libcamera-devel
mailing list