libcamera: software_isp: Get black level from the camera helper

The black level in software ISP is unconditionally guessed from the
obtained frames.  CameraSensorHelper optionally provides the black level
from camera specifications now.  Let's use the value if available.

If the black level is not available from the given CameraSensorHelper
instance, it's still determined on the fly.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Milan Zamazal
2024-10-18 16:12:36 +02:00
committed by Kieran Bingham
parent 41e3d61c74
commit 7bbe26bbc4
3 changed files with 19 additions and 1 deletions
+5 -1
View File
@@ -24,7 +24,8 @@ BlackLevel::BlackLevel()
int BlackLevel::configure(IPAContext &context,
[[maybe_unused]] const IPAConfigInfo &configInfo)
{
context.activeState.blc.level = 255;
context.activeState.blc.level =
context.configuration.black.level.value_or(255);
return 0;
}
@@ -34,6 +35,9 @@ void BlackLevel::process(IPAContext &context,
const SwIspStats *stats,
[[maybe_unused]] ControlList &metadata)
{
if (context.configuration.black.level.has_value())
return;
if (frameContext.sensor.exposure == exposure_ &&
frameContext.sensor.gain == gain_) {
return;