@@ -126,8 +126,8 @@ namespace libcamera::ipa::ipu3 {
* \var IPASessionConfiguration::sensor.lineDuration
* \brief Line duration in microseconds
*
- * \var IPASessionConfiguration::sensor.defVBlank
- * \brief The default vblank value of the sensor
+ * \var IPASessionConfiguration::sensor.vBlank
+ * \brief The vertical blanking expressed in number of lines
*/
/**
@@ -43,7 +43,7 @@ struct IPASessionConfiguration {
} agc;
struct {
- int32_t defVBlank;
+ int32_t vBlank;
utils::Duration lineDuration;
} sensor;
};
@@ -149,7 +149,7 @@ public:
const uint32_t bufferId,
const ControlList &sensorControls) override;
private:
- void updateSessionConfiguration(const ControlInfoMap &sensorControls);
+ void updateSessionConfiguration(const IPAConfigInfo &info);
bool validateSensorControls();
@@ -177,10 +177,12 @@ private:
* \brief Compute IPASessionConfiguration using the sensor information and the
* sensor V4L2 controls
*/
-void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)
+void IPAIPU3::updateSessionConfiguration(const IPAConfigInfo &info)
{
- const ControlInfo vBlank = sensorControls.find(V4L2_CID_VBLANK)->second;
- context_.configuration.sensor.defVBlank = vBlank.def().get<int32_t>();
+ const IPACameraSensorInfo &sensorInfo = info.sensorInfo;
+ context_.configuration.sensor.vBlank = sensorInfo.vblank;
+
+ const ControlInfoMap &sensorControls = info.sensorControls;
const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;
int32_t minExposure = v4l2Exposure.min().get<int32_t>();
@@ -391,7 +393,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo)
}
/* Update the IPASessionConfiguration using the sensor settings. */
- updateSessionConfiguration(sensorCtrls_);
+ updateSessionConfiguration(configInfo);
for (auto const &algo : algorithms_) {
int ret = algo->configure(context_, configInfo);
@@ -501,7 +503,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,
frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());
double lineDuration = context_.configuration.sensor.lineDuration.get<std::micro>();
- int32_t vBlank = context_.configuration.sensor.defVBlank;
+ int32_t vBlank = context_.configuration.sensor.vBlank;
ControlList ctrls(controls::controls);
for (auto const &algo : algorithms_)
@@ -509,7 +511,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,
setControls(frame);
- /* \todo Use VBlank value calculated from each frame exposure. */
int64_t frameDuration = (vBlank + sensorInfo_.outputSize.height) * lineDuration;
ctrls.set(controls::FrameDuration, frameDuration);
The IPU3 IPA module uses the default value from the V4L2_CID_VBLANK control to compute the total frame size in processStatsBuffer(). Most drivers update the VBLANK control limits when a new format is applied and assign to the default the current control value. As this is not required by the API specification, and the VBLANK default value can be different than its current value, use the actual control value as now available from the IPACameraSensorInfo structure. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/ipa/ipu3/ipa_context.cpp | 4 ++-- src/ipa/ipu3/ipa_context.h | 2 +- src/ipa/ipu3/ipu3.cpp | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-)