ipa: rpi: common: Avoid warnings when AeEnable control is used
diff mbox series

Message ID 20250428131617.3507-1-david.plowman@raspberrypi.com
State Accepted
Commit e4677362a162b6b2174da3c844353f3321068ed0
Headers show
Series
  • ipa: rpi: common: Avoid warnings when AeEnable control is used
Related show

Commit Message

David Plowman April 28, 2025, 1:16 p.m. UTC
The AeEnable control is now just a wrapper that is converted to
ExposureTimeMode and AnalogueGainMode controls instead. Therefore, it
should simply be ignored when we encounter it, without the need for
any warnings.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/ipa/rpi/common/ipa_base.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Naushir Patuck April 28, 2025, 1:20 p.m. UTC | #1
Hi David,

Thanks for fixing this.

On Mon, 28 Apr 2025 at 14:16, David Plowman
<david.plowman@raspberrypi.com> wrote:
>
> The AeEnable control is now just a wrapper that is converted to
> ExposureTimeMode and AnalogueGainMode controls instead. Therefore, it
> should simply be ignored when we encounter it, without the need for
> any warnings.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>

> ---
>  src/ipa/rpi/common/ipa_base.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> index 4c09a093..80c17588 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -967,6 +967,17 @@ void IpaBase::applyControls(const ControlList &controls)
>                         break;
>                 }
>
> +               case controls::AE_ENABLE: {
> +                       /*
> +                        * The AeEnable control is now just a wrapper that will already have been
> +                        * converted to ExposureTimeMode and AnalogueGainMode equivalents, so there
> +                        * would be nothing to do here. Nonetheless, "handle" the control so as to
> +                        * avoid warnings from the "default:" clause of the switch statement.
> +                        */
> +
> +                       break;
> +               }
> +
>                 case controls::AE_FLICKER_MODE: {
>                         RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
>                                 controller_.getAlgorithm("agc"));
> --
> 2.39.5
>
Kieran Bingham April 28, 2025, 1:48 p.m. UTC | #2
Quoting Naushir Patuck (2025-04-28 14:20:11)
> Hi David,
> 
> Thanks for fixing this.
> 
> On Mon, 28 Apr 2025 at 14:16, David Plowman
> <david.plowman@raspberrypi.com> wrote:
> >
> > The AeEnable control is now just a wrapper that is converted to
> > ExposureTimeMode and AnalogueGainMode controls instead. Therefore, it
> > should simply be ignored when we encounter it, without the need for
> > any warnings.
> >
> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> 
> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> 

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

> > ---
> >  src/ipa/rpi/common/ipa_base.cpp | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> > index 4c09a093..80c17588 100644
> > --- a/src/ipa/rpi/common/ipa_base.cpp
> > +++ b/src/ipa/rpi/common/ipa_base.cpp
> > @@ -967,6 +967,17 @@ void IpaBase::applyControls(const ControlList &controls)
> >                         break;
> >                 }
> >
> > +               case controls::AE_ENABLE: {
> > +                       /*
> > +                        * The AeEnable control is now just a wrapper that will already have been
> > +                        * converted to ExposureTimeMode and AnalogueGainMode equivalents, so there
> > +                        * would be nothing to do here. Nonetheless, "handle" the control so as to
> > +                        * avoid warnings from the "default:" clause of the switch statement.
> > +                        */
> > +
> > +                       break;
> > +               }
> > +
> >                 case controls::AE_FLICKER_MODE: {
> >                         RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
> >                                 controller_.getAlgorithm("agc"));
> > --
> > 2.39.5
> >
Laurent Pinchart April 29, 2025, 6:47 p.m. UTC | #3
On Mon, Apr 28, 2025 at 02:49:40PM +0100, Kieran Bingham wrote:
> Quoting Kieran Bingham (2025-04-28 14:48:26)
> > Quoting Naushir Patuck (2025-04-28 14:20:11)
> > > On Mon, 28 Apr 2025 at 14:16, David Plowman wrote:
> > > >
> > > > The AeEnable control is now just a wrapper that is converted to
> > > > ExposureTimeMode and AnalogueGainMode controls instead. Therefore, it
> > > > should simply be ignored when we encounter it, without the need for
> > > > any warnings.
> > > >
> > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > > 
> > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > 
> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> > 
> > > > ---
> > > >  src/ipa/rpi/common/ipa_base.cpp | 11 +++++++++++
> > > >  1 file changed, 11 insertions(+)
> > > >
> > > > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> > > > index 4c09a093..80c17588 100644
> > > > --- a/src/ipa/rpi/common/ipa_base.cpp
> > > > +++ b/src/ipa/rpi/common/ipa_base.cpp
> > > > @@ -967,6 +967,17 @@ void IpaBase::applyControls(const ControlList &controls)
> > > >                         break;
> > > >                 }
> > > >
> > > > +               case controls::AE_ENABLE: {
> > > > +                       /*
> > > > +                        * The AeEnable control is now just a wrapper that will already have been
> > > > +                        * converted to ExposureTimeMode and AnalogueGainMode equivalents, so there
> > > > +                        * would be nothing to do here. Nonetheless, "handle" the control so as to
> > > > +                        * avoid warnings from the "default:" clause of the switch statement.
> > > > +                        */
> > > > +
> 
> Is this encountered at runtime? I wonder if the higher level should
> 'remove' the control that has been handled from the list ... But I'm not
> sure I like the idea of modifying the incoming control list ...

We're lacking infrastructure to modify the control list at the moment.
That's something we'll fix, in the meantime this workaround is fine.

> > > > +                       break;
> > > > +               }
> > > > +
> > > >                 case controls::AE_FLICKER_MODE: {
> > > >                         RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
> > > >                                 controller_.getAlgorithm("agc"));

Patch
diff mbox series

diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index 4c09a093..80c17588 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -967,6 +967,17 @@  void IpaBase::applyControls(const ControlList &controls)
 			break;
 		}
 
+		case controls::AE_ENABLE: {
+			/*
+			 * The AeEnable control is now just a wrapper that will already have been
+			 * converted to ExposureTimeMode and AnalogueGainMode equivalents, so there
+			 * would be nothing to do here. Nonetheless, "handle" the control so as to
+			 * avoid warnings from the "default:" clause of the switch statement.
+			 */
+
+			break;
+		}
+
 		case controls::AE_FLICKER_MODE: {
 			RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
 				controller_.getAlgorithm("agc"));