[libcamera-devel] [PATCH 11/15] libcamera: IPACameraSensorInfo: Add VBLANK

Jacopo Mondi jacopo at jmondi.org
Mon Jun 27 18:27:28 CEST 2022


The IPA modules need the V4L2_CID_VBLANK value to calculate the
total frame size for the current sensor configuration.

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 at jmondi.org>
---
 include/libcamera/ipa/core.mojom | 6 ++++++
 src/libcamera/camera_sensor.cpp  | 1 +
 2 files changed, 7 insertions(+)

diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom
index 74f3339e56f2..d122fb7add4d 100644
--- a/include/libcamera/ipa/core.mojom
+++ b/include/libcamera/ipa/core.mojom
@@ -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;
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 82e51272cccc..e8db9da84e6a 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -1004,6 +1004,7 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const
 	int32_t hblank = ctrls.get(V4L2_CID_HBLANK).get<int32_t>();
 	info->lineLength = info->outputSize.width + hblank;
 	info->pixelRate = ctrls.get(V4L2_CID_PIXEL_RATE).get<int64_t>();
+	info->vblank = ctrls.get(V4L2_CID_VBLANK).get<int32_t>();
 
 	const ControlInfo vblank = ctrls.infoMap()->at(V4L2_CID_VBLANK);
 	info->minFrameLength = info->outputSize.height + vblank.min().get<int32_t>();
-- 
2.36.1



More information about the libcamera-devel mailing list