<div dir="ltr"><div dir="ltr">Hi Laurent,<div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 1 May 2024 at 16:53, Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Naush,<br>
<br>
Thank you for the patch.<br>
<br>
On Fri, Apr 26, 2024 at 12:18:15PM +0100, Naushir Patuck wrote:<br>
> The maximum shutter speed calculation in the cam-helper relied on<br>
> the frame duration limits being correctly set in the cam-helper's mode<br>
> structure. This was not the case on first startup, so the maximum<br>
> shutter speed reported back via the ControlInfo was incorrect.<br>
> <br>
> Fix this by setting up the camera mode in the cam-helper before querying<br>
> for the max shutter value.<br>
> <br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
> src/ipa/rpi/common/ipa_base.cpp | 6 ++++++<br>
> 1 file changed, 6 insertions(+)<br>
> <br>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp<br>
> index 149a133ab662..1d12262bda01 100644<br>
> --- a/src/ipa/rpi/common/ipa_base.cpp<br>
> +++ b/src/ipa/rpi/common/ipa_base.cpp<br>
> @@ -592,6 +592,12 @@ void IpaBase::setMode(const IPACameraSensorInfo &sensorInfo)<br>
> mode_.minAnalogueGain = helper_->gain(gainCtrl.min().get<int32_t>());<br>
> mode_.maxAnalogueGain = helper_->gain(gainCtrl.max().get<int32_t>());<br>
> <br>
> + /*<br>
> + * We need to give the helper the min/max frame durations so it can calculate<br>
> + * the correct exposure limits below.<br>
> + */<br>
> + helper_->setCameraMode(mode_);<br>
> +<br>
<br>
Don't you end up doing this twice, once here, and once in<br>
IpaBase::configure(), which calls IpaBase::setMode() ?<br></blockquote><div><br></div><div>Yes, it does happen twice. The other option would be to pass a const reference to mode_ into the helper through setMode(), allowing us only do it once. But that was a bit more involved over this more trivial fix. I can change to do that if folks prefer.</div><div><br></div><div>Naush</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> /* Shutter speed is calculated based on the limits of the frame durations. */<br>
> mode_.minShutter = helper_->exposure(shutterCtrl.min().get<int32_t>(), mode_.minLineLength);<br>
> mode_.maxShutter = Duration::max();<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>