ipa: rkisp1: agc: Fix build on debian 11 (gcc-9)
diff mbox series

Message ID 20250211172115.210087-1-stefan.klug@ideasonboard.com
State Accepted
Commit f63f4d71d4c917b62242cb9b7e06edae80d6c204
Headers show
Series
  • ipa: rkisp1: agc: Fix build on debian 11 (gcc-9)
Related show

Commit Message

Stefan Klug Feb. 11, 2025, 5:20 p.m. UTC
Apparently not every compiler is able to deduce types the same way. Fix
compile on gcc-9 by explicitly specifying the type.

Fixes: ee918b370a08 ("ipa: rkisp1: agc: Initialize enum controls with a list of values")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---

Hi all,

Unfortunately I broke the CI build of mainline :-(. This patch fixes it.
A corresponding CI run is here:
https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1362476

Best regards,
Stefan

 src/ipa/rkisp1/algorithms/agc.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kieran Bingham Feb. 11, 2025, 5:56 p.m. UTC | #1
Quoting Stefan Klug (2025-02-11 17:20:56)
> Apparently not every compiler is able to deduce types the same way. Fix
> compile on gcc-9 by explicitly specifying the type.
> 
> Fixes: ee918b370a08 ("ipa: rkisp1: agc: Initialize enum controls with a list of values")
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
> 
> Hi all,
> 
> Unfortunately I broke the CI build of mainline :-(. This patch fixes it.
> A corresponding CI run is here:
> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1362476

Ayeee,

Being explicit on the type looks fine here, and it's how the other
ControlValues are also specified, so I guess that's expected too.

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

> 
> Best regards,
> Stefan
> 
>  src/ipa/rkisp1/algorithms/agc.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index e7c6de757593..45ec72188b3a 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -151,11 +151,11 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData)
>         context.ctrlMap[&controls::ExposureTimeMode] =
>                 ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),
>                                 ControlValue(controls::ExposureTimeModeManual) } },
> -                           controls::ExposureTimeModeAuto);
> +                           ControlValue(controls::ExposureTimeModeAuto));
>         context.ctrlMap[&controls::AnalogueGainMode] =
>                 ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),
>                                 ControlValue(controls::AnalogueGainModeManual) } },
> -                           controls::AnalogueGainModeAuto);
> +                           ControlValue(controls::AnalogueGainModeAuto));
>         /* \todo Move this to the Camera class */
>         context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true);
>         context.ctrlMap.merge(controls());
> -- 
> 2.43.0
>
Kieran Bingham Feb. 11, 2025, 5:58 p.m. UTC | #2
Quoting Kieran Bingham (2025-02-11 17:56:36)
> Quoting Stefan Klug (2025-02-11 17:20:56)
> > Apparently not every compiler is able to deduce types the same way. Fix
> > compile on gcc-9 by explicitly specifying the type.

I think this fixes compilation on both gcc-9 and gcc-10 in fact, based
on both 
 https://gitlab.freedesktop.org/camera/libcamera/-/jobs/70899831
and
 https://gitlab.freedesktop.org/camera/libcamera/-/jobs/70878357

--
Kieran

> > 
> > Fixes: ee918b370a08 ("ipa: rkisp1: agc: Initialize enum controls with a list of values")
> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> > ---
> > 
> > Hi all,
> > 
> > Unfortunately I broke the CI build of mainline :-(. This patch fixes it.
> > A corresponding CI run is here:
> > https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1362476
> 
> Ayeee,
> 
> Being explicit on the type looks fine here, and it's how the other
> ControlValues are also specified, so I guess that's expected too.
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> > 
> > Best regards,
> > Stefan
> > 
> >  src/ipa/rkisp1/algorithms/agc.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> > index e7c6de757593..45ec72188b3a 100644
> > --- a/src/ipa/rkisp1/algorithms/agc.cpp
> > +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> > @@ -151,11 +151,11 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData)
> >         context.ctrlMap[&controls::ExposureTimeMode] =
> >                 ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),
> >                                 ControlValue(controls::ExposureTimeModeManual) } },
> > -                           controls::ExposureTimeModeAuto);
> > +                           ControlValue(controls::ExposureTimeModeAuto));
> >         context.ctrlMap[&controls::AnalogueGainMode] =
> >                 ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),
> >                                 ControlValue(controls::AnalogueGainModeManual) } },
> > -                           controls::AnalogueGainModeAuto);
> > +                           ControlValue(controls::AnalogueGainModeAuto));
> >         /* \todo Move this to the Camera class */
> >         context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true);
> >         context.ctrlMap.merge(controls());
> > -- 
> > 2.43.0
> >
Laurent Pinchart Feb. 11, 2025, 8:24 p.m. UTC | #3
On Tue, Feb 11, 2025 at 06:20:56PM +0100, Stefan Klug wrote:
> Apparently not every compiler is able to deduce types the same way. Fix
> compile on gcc-9 by explicitly specifying the type.
> 
> Fixes: ee918b370a08 ("ipa: rkisp1: agc: Initialize enum controls with a list of values")
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

If this issue affected recent compilers I'd ask for a more detailed
analysis, and a bug report being filed to gcc. As I can't reproduce it
neither with gcc 9.5.0 nor 10.5.0, that's not necessary. I'm still
curious to know why the compiler doesn't consider the right ControlInfo
constructor though.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
> Hi all,
> 
> Unfortunately I broke the CI build of mainline :-(. This patch fixes it.
> A corresponding CI run is here:
> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1362476
> 
> Best regards,
> Stefan
> 
>  src/ipa/rkisp1/algorithms/agc.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index e7c6de757593..45ec72188b3a 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -151,11 +151,11 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData)
>  	context.ctrlMap[&controls::ExposureTimeMode] =
>  		ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),
>  				ControlValue(controls::ExposureTimeModeManual) } },
> -			    controls::ExposureTimeModeAuto);
> +			    ControlValue(controls::ExposureTimeModeAuto));
>  	context.ctrlMap[&controls::AnalogueGainMode] =
>  		ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),
>  				ControlValue(controls::AnalogueGainModeManual) } },
> -			    controls::AnalogueGainModeAuto);
> +			    ControlValue(controls::AnalogueGainModeAuto));
>  	/* \todo Move this to the Camera class */
>  	context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true);
>  	context.ctrlMap.merge(controls());

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index e7c6de757593..45ec72188b3a 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -151,11 +151,11 @@  int Agc::init(IPAContext &context, const YamlObject &tuningData)
 	context.ctrlMap[&controls::ExposureTimeMode] =
 		ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto),
 				ControlValue(controls::ExposureTimeModeManual) } },
-			    controls::ExposureTimeModeAuto);
+			    ControlValue(controls::ExposureTimeModeAuto));
 	context.ctrlMap[&controls::AnalogueGainMode] =
 		ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto),
 				ControlValue(controls::AnalogueGainModeManual) } },
-			    controls::AnalogueGainModeAuto);
+			    ControlValue(controls::AnalogueGainModeAuto));
 	/* \todo Move this to the Camera class */
 	context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true);
 	context.ctrlMap.merge(controls());