ipa: camera_sensor_helper: Add black level for OV8865
diff mbox series

Message ID 20261030205706.29237-1-tim.heyne@firestrike.de
State New
Headers show
Series
  • ipa: camera_sensor_helper: Add black level for OV8865
Related show

Commit Message

Tim Heyne Oct. 30, 2026, 8:57 p.m. UTC
The OmniVision OV8865 sensor has a configurable data pedestal (BLC target,
registers 0x4004/0x4005) that is 0x10 for 10-bit data, the same as the
OV5693. Read back on a Surface Pro 7 while streaming: 0x4004 = 0x00,
0x4005 = 0x10, with BLC enabled (0x4000 = 0xf1). Add the 16-bit
representation of that level to CameraSensorHelperOv8865.

Without a known black level the software ISP falls back to estimating it
from the histogram. In dim scenes with high analogue gain the estimate
lands on the noise floor and the whole image is subtracted away, leaving a
flat grey frame. With the black level set, the rear camera of the Surface
Pro 7 produces a dark but structured image under the same conditions.

This change was found and prepared with the help of an AI coding
assistant (Claude); the submitter reviewed it and ran the tests on the
hardware.

Signed-off-by: Tim Heyne <tim.heyne@firestrike.de>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 359040ec..f9a17067 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -872,6 +872,7 @@  class CameraSensorHelperOv8865 : public CameraSensorHelper
 public:
 	CameraSensorHelperOv8865()
 	{
+		blackLevel_ = 1024;
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };