@@ -178,6 +178,11 @@ module libcamera;
* The total line length in pixel clock periods, including blanking.
*/
+/**
+ * \var IPACameraSensorInfo::vblank
+ * \brief The vertical blanking, expressed in number of lines
+ */
+
/**
* \var IPACameraSensorInfo::minFrameLength
* \brief The minimum allowable frame length in units of lines
@@ -218,6 +223,7 @@ struct IPACameraSensorInfo {
uint64 pixelRate;
uint32 lineLength;
+ uint32 vblank;
uint32 minFrameLength;
uint32 maxFrameLength;
@@ -1008,6 +1008,21 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const
info->minFrameLength = info->outputSize.height + vblank.min().get<int32_t>();
info->maxFrameLength = info->outputSize.height + vblank.max().get<int32_t>();
+ /*
+ * Retrieve the vertical blanking.
+ *
+ * We can't rely on the valued cached as vblank can be modified while
+ * streaming to adjust the frame rate.
+ */
+ ControlList ctrls = subdev_->getControls({ V4L2_CID_VBLANK });
+ if (ctrls.empty()) {
+ LOG(CameraSensor, Error)
+ << "Failed to retrieve camera info controls";
+ return -EINVAL;
+ }
+
+ info->vblank = ctrls.get(V4L2_CID_VBLANK).get<int32_t>();
+
return 0;
}
The IPA module needs the vertical blanking value to calculate the total frame size. In order to prepare removing usage of V4L2_CID_VBLANK in IPA modules, add the vblank value to the IPACameraSensorInfo structure. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- include/libcamera/ipa/core.mojom | 6 ++++++ src/libcamera/camera_sensor/camera_sensor.cpp | 15 +++++++++++++++ 2 files changed, 21 insertions(+)