[v2,07/10] ipa: libipa: camera_sensor_helper: Add OV2740 black level
diff mbox series

Message ID 20260506230722.1041596-8-devve.3@gmail.com
State New
Headers show
Series
  • OV01A10 sensor support and simple IPA improvements
Related show

Commit Message

devve May 6, 2026, 11:07 p.m. UTC
From: Javier Tia <floss@jetm.me>

Set blackLevel_ = 4096 (0x40 at 10-bit) in CameraSensorHelperOv2740.
The OV2740 kernel driver programs BLC target register 0x4003 with 0x40
for the 180 MHz link frequency mode. This matches the same pattern
used by OV5675 and other OmniVision sensors with a 10-bit black level
of 64.

Without this, the Simple pipeline falls back to auto-guessing the
black level, which happens to arrive at the same value but isn't
documented. More importantly, the CameraSensorHelper is the canonical
location for sensor calibration data and is used across all pipeline
handlers, not just Simple.

Suggested-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Javier Tia <floss@jetm.me>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: d3vv3 <devve.3@gmail.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 72466867..f3e8d7c8 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -684,6 +684,8 @@  class CameraSensorHelperOv2740 : public CameraSensorHelper
 public:
 	CameraSensorHelperOv2740()
 	{
+		/* From Linux kernel driver: 0x40 at 10bits. */
+		blackLevel_ = 4096;
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };