[v3,1/2] ipa: libipa: camera_sensor_helper: Add OV5670 black level
diff mbox series

Message ID 20260910172120.73148-2-dmanresa@gmail.com
State New
Headers show
Series
  • ipa: ipu3: Take the OV5670 black level from the sensor helper
Related show

Commit Message

D. Manresa Sept. 10, 2026, 5:21 p.m. UTC
The OV5670 has a black level of 64 at 10 bits, the sensor's default BLC
target. This was confirmed on a Dell Latitude 7275 by reading the ImgU
statistics and dark frames with different black level corrections.
Provide it in the camera sensor helper so that IPAs can use it instead of
hard-coded or tuning-file values.

Signed-off-by: D. Manresa <dmanresa@gmail.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Pinchart Sept. 10, 2026, 6:09 p.m. UTC | #1
On Thu, Sep 10, 2026 at 07:21:19PM +0200, D. Manresa wrote:
> The OV5670 has a black level of 64 at 10 bits, the sensor's default BLC
> target. This was confirmed on a Dell Latitude 7275 by reading the ImgU
> statistics and dark frames with different black level corrections.

That's not the right way to measure the data pedestal.

> Provide it in the camera sensor helper so that IPAs can use it instead of
> hard-coded or tuning-file values.
> 
> Signed-off-by: D. Manresa <dmanresa@gmail.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index 82bf255..eeb3277 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -802,6 +802,8 @@ class CameraSensorHelperOv5670 : public CameraSensorHelper
>  public:
>  	CameraSensorHelperOv5670()
>  	{
> +		/* Default BLC target of 64 at 10bits, confirmed by measurement. */
> +		blackLevel_ = 4096;
>  		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
>  	}
>  };

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 82bf255..eeb3277 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -802,6 +802,8 @@  class CameraSensorHelperOv5670 : public CameraSensorHelper
 public:
 	CameraSensorHelperOv5670()
 	{
+		/* Default BLC target of 64 at 10bits, confirmed by measurement. */
+		blackLevel_ = 4096;
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 128 };
 	}
 };