[01/12] ipa: rkisp1: agc: Fix initialization without metering modes
diff mbox series

Message ID 20240616163910.5506-2-laurent.pinchart@ideasonboard.com
State Accepted
Commit 8fd673deaf9beb2e9be9c81342f728c2b7b0513a
Headers show
Series
  • ipa: rkisp1: Miscellaneous AGC fixes
Related show

Commit Message

Laurent Pinchart June 16, 2024, 4:38 p.m. UTC
When no metering modes are specified in the tuning file, the AGC
initialzation fails with

[0:00:46.148508875] [209] ERROR RkISP1Agc agc.cpp:46 'AeMeteringMode' parameter not found in tuning file

which results in a camera initialization failure. Fix it by downgrading
the error into a warning, and continuing the AGC initialization with the
default metering mode.

Fixes: 35233938ee5d ("ipa: rkisp1: agc: Read histogram weights from tuning file")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/agc.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Kieran Bingham June 17, 2024, 8:57 a.m. UTC | #1
Quoting Laurent Pinchart (2024-06-16 17:38:59)
> When no metering modes are specified in the tuning file, the AGC
> initialzation fails with
> 
> [0:00:46.148508875] [209] ERROR RkISP1Agc agc.cpp:46 'AeMeteringMode' parameter not found in tuning file
> 
> which results in a camera initialization failure. Fix it by downgrading
> the error into a warning, and continuing the AGC initialization with the
> default metering mode.
> 
> Fixes: 35233938ee5d ("ipa: rkisp1: agc: Read histogram weights from tuning file")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 8702145187c7..0f60d08fd41c 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -42,11 +42,9 @@ LOG_DEFINE_CATEGORY(RkISP1Agc)
>  
>  int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
>  {
> -       if (!tuningData.isDictionary()) {
> -               LOG(RkISP1Agc, Error)
> +       if (!tuningData.isDictionary())
> +               LOG(RkISP1Agc, Warning)
>                         << "'AeMeteringMode' parameter not found in tuning file";
> -               return -EINVAL;

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

> -       }
>  
>         for (const auto &[key, value] : tuningData.asDict()) {
>                 if (controls::AeMeteringModeNameValueMap.find(key) ==
> -- 
> Regards,
> 
> Laurent Pinchart
>
Paul Elder June 17, 2024, 10:10 a.m. UTC | #2
On Sun, Jun 16, 2024 at 07:38:59PM +0300, Laurent Pinchart wrote:
> When no metering modes are specified in the tuning file, the AGC
> initialzation fails with
> 
> [0:00:46.148508875] [209] ERROR RkISP1Agc agc.cpp:46 'AeMeteringMode' parameter not found in tuning file
> 
> which results in a camera initialization failure. Fix it by downgrading
> the error into a warning, and continuing the AGC initialization with the
> default metering mode.
> 
> Fixes: 35233938ee5d ("ipa: rkisp1: agc: Read histogram weights from tuning file")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 8702145187c7..0f60d08fd41c 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -42,11 +42,9 @@ LOG_DEFINE_CATEGORY(RkISP1Agc)
>  
>  int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
>  {
> -	if (!tuningData.isDictionary()) {
> -		LOG(RkISP1Agc, Error)
> +	if (!tuningData.isDictionary())
> +		LOG(RkISP1Agc, Warning)
>  			<< "'AeMeteringMode' parameter not found in tuning file";
> -		return -EINVAL;
> -	}
>  
>  	for (const auto &[key, value] : tuningData.asDict()) {
>  		if (controls::AeMeteringModeNameValueMap.find(key) ==

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 8702145187c7..0f60d08fd41c 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -42,11 +42,9 @@  LOG_DEFINE_CATEGORY(RkISP1Agc)
 
 int Agc::parseMeteringModes(IPAContext &context, const YamlObject &tuningData)
 {
-	if (!tuningData.isDictionary()) {
-		LOG(RkISP1Agc, Error)
+	if (!tuningData.isDictionary())
+		LOG(RkISP1Agc, Warning)
 			<< "'AeMeteringMode' parameter not found in tuning file";
-		return -EINVAL;
-	}
 
 	for (const auto &[key, value] : tuningData.asDict()) {
 		if (controls::AeMeteringModeNameValueMap.find(key) ==