ipa: camera_sensor_helper: Add black levels for OV5693
diff mbox series

Message ID 20260709-ov5693-v1-1-a17e72273f43@ideasonboard.com
State New
Headers show
Series
  • ipa: camera_sensor_helper: Add black levels for OV5693
Related show

Commit Message

Dan Scally July 9, 2026, 11:30 a.m. UTC
The OmniVision OV5693 sensor has a configurable data pedestal that is
set by default to 0x10 for 10-bit data. Add the 16-bit representation
of that level to CameraSensorHelperOv5693.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 32b0d940baaf182a9d01d4833e30bd340d4dc918
change-id: 20260628-ov5693-735ea0d9ade1

Best regards,

Comments

Kieran Bingham July 9, 2026, 12:05 p.m. UTC | #1
Quoting Daniel Scally (2026-07-09 12:30:55)
> The OmniVision OV5693 sensor has a configurable data pedestal that is
> set by default to 0x10 for 10-bit data. Add the 16-bit representation
> of that level to CameraSensorHelperOv5693.
> 
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index 9ab7a52f2644c93454520f0a20a4c3e370ce9d15..b73ecae6c1d010aad7a49cb3c1d75b4caad97c01 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -752,6 +752,7 @@ class CameraSensorHelperOv5693 : public CameraSensorHelper
>  public:
>         CameraSensorHelperOv5693()
>         {
> +               blacklevel_ = 1024;

I see the sensor does 'automatic black level correction'. Do you know if
that's disabled in the kernel driver?

> There are two main functions of the BLC:
> •adjusting all normal pixel values based on the values of the black levels
> •applying multiplication to all pixel values based on digital gain

So I guess it normalises the range too after subtraction...


Anyway, 

0x4009 BLC_TARGET 0x10 RW Bit[7:0]: Black target level[7:0]

and 0x10 << 6 == 1024

So:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>




>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>         }
>  };
> 
> ---
> base-commit: 32b0d940baaf182a9d01d4833e30bd340d4dc918
> change-id: 20260628-ov5693-735ea0d9ade1
> 
> Best regards,
> -- 
> Daniel Scally <dan.scally@ideasonboard.com>
>
Dan Scally July 9, 2026, 12:40 p.m. UTC | #2
Hi Kieran

On 09/07/2026 13:05, Kieran Bingham wrote:
> Quoting Daniel Scally (2026-07-09 12:30:55)
>> The OmniVision OV5693 sensor has a configurable data pedestal that is
>> set by default to 0x10 for 10-bit data. Add the 16-bit representation
>> of that level to CameraSensorHelperOv5693.
>>
>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
>> ---
>>   src/ipa/libipa/camera_sensor_helper.cpp | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
>> index 9ab7a52f2644c93454520f0a20a4c3e370ce9d15..b73ecae6c1d010aad7a49cb3c1d75b4caad97c01 100644
>> --- a/src/ipa/libipa/camera_sensor_helper.cpp
>> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
>> @@ -752,6 +752,7 @@ class CameraSensorHelperOv5693 : public CameraSensorHelper
>>   public:
>>          CameraSensorHelperOv5693()
>>          {
>> +               blacklevel_ = 1024;
> 
> I see the sensor does 'automatic black level correction'. Do you know if
> that's disabled in the kernel driver?

No, it's enabled in the kernel driver...the double correction won't have an impact currently, as the 
IPU3 BLC algorithm does not currently actually read the levels from the CameraSensorHelper, it just 
hardcodes the value 64. That will need to change of course but it's a little unclear to me what 
bitdepth the ISP expects the values in so I need to do some experimentation.

Thanks
Dan

> 
>> There are two main functions of the BLC:
>> •adjusting all normal pixel values based on the values of the black levels
>> •applying multiplication to all pixel values based on digital gain
> 
> So I guess it normalises the range too after subtraction.t..
> 
> 
> Anyway,
> 
> 0x4009 BLC_TARGET 0x10 RW Bit[7:0]: Black target level[7:0]
> 
> and 0x10 << 6 == 1024
> 
> So:
> 
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> 
> 
> 
>>                  gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
>>          }
>>   };
>>
>> ---
>> base-commit: 32b0d940baaf182a9d01d4833e30bd340d4dc918
>> change-id: 20260628-ov5693-735ea0d9ade1
>>
>> Best regards,
>> -- 
>> Daniel Scally <dan.scally@ideasonboard.com>
>>

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index 9ab7a52f2644c93454520f0a20a4c3e370ce9d15..b73ecae6c1d010aad7a49cb3c1d75b4caad97c01 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -752,6 +752,7 @@  class CameraSensorHelperOv5693 : public CameraSensorHelper
 public:
 	CameraSensorHelperOv5693()
 	{
+		blacklevel_ = 1024;
 		gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };
 	}
 };