ipa: rpi: agc: Allow exposure mode to be updated in auto mode
diff mbox series

Message ID 20250922083712.3364-1-david.plowman@raspberrypi.com
State New
Headers show
Series
  • ipa: rpi: agc: Allow exposure mode to be updated in auto mode
Related show

Commit Message

David Plowman Sept. 22, 2025, 8:37 a.m. UTC
The code was only allowing the exposure mode to be updated when both
exposure/gain were in manual mode, which is a mistake. It needs to be
updatable precisely when the auto modes are enabled.

The fix is to ignore the enabled/disabled status of AEC/AGC, matching
our other controls (metering mode, constraint mode etc.). While there
might be a debate to be had about what the actual behaviour of all
these controls should be, for the time being we'll just match
everything else.

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

Comments

Naushir Patuck Sept. 22, 2025, 12:43 p.m. UTC | #1
Hi David,


On Mon, 22 Sept 2025 at 09:37, David Plowman <david.plowman@raspberrypi.com>
wrote:

> The code was only allowing the exposure mode to be updated when both
> exposure/gain were in manual mode, which is a mistake. It needs to be
> updatable precisely when the auto modes are enabled.
>
> The fix is to ignore the enabled/disabled status of AEC/AGC, matching
> our other controls (metering mode, constraint mode etc.). While there
> might be a debate to be had about what the actual behaviour of all
> these controls should be, for the time being we'll just match
> everything else.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
>

Seems correct to me.

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



> ---
>  src/ipa/rpi/common/ipa_base.cpp | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp
> b/src/ipa/rpi/common/ipa_base.cpp
> index 6448e6ab..8dfe35cc 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -1026,13 +1026,6 @@ void IpaBase::applyControls(const ControlList
> &controls)
>                                 break;
>                         }
>
> -                       /*
> -                        * Ignore AE_EXPOSURE_MODE if the shutter or the
> gain
> -                        * are in auto mode.
> -                        */
> -                       if (agc->autoExposureEnabled() ||
> agc->autoGainEnabled())
> -                               break;
> -
>                         int32_t idx = ctrl.second.get<int32_t>();
>                         if (ExposureModeTable.count(idx)) {
>
> agc->setExposureMode(ExposureModeTable.at(idx));
> --
> 2.39.5
>
>

Patch
diff mbox series

diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index 6448e6ab..8dfe35cc 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -1026,13 +1026,6 @@  void IpaBase::applyControls(const ControlList &controls)
 				break;
 			}
 
-			/*
-			 * Ignore AE_EXPOSURE_MODE if the shutter or the gain
-			 * are in auto mode.
-			 */
-			if (agc->autoExposureEnabled() || agc->autoGainEnabled())
-				break;
-
 			int32_t idx = ctrl.second.get<int32_t>();
 			if (ExposureModeTable.count(idx)) {
 				agc->setExposureMode(ExposureModeTable.at(idx));