[libcamera-devel,11/15] libcamera: IPACameraSensorInfo: Add VBLANK
diff mbox series

Message ID 20220627162732.33160-12-jacopo@jmondi.org
State Not Applicable, archived
Headers show
Series
  • Internal controls, sensor delays and IPA init/configure rework
Related show

Commit Message

Jacopo Mondi June 27, 2022, 4:27 p.m. UTC
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@jmondi.org>
---
 include/libcamera/ipa/core.mojom | 6 ++++++
 src/libcamera/camera_sensor.cpp  | 1 +
 2 files changed, 7 insertions(+)

Patch
diff mbox series

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>();