[libcamera-devel] [PATCH v6 08/10] ipa: rkisp1: Add AF controls to the RkISP1 IPA
Jacopo Mondi
jacopo.mondi at ideasonboard.com
Mon Apr 3 11:37:09 CEST 2023
Hi Daniel
On Fri, Mar 31, 2023 at 10:19:28AM +0200, Daniel Semkowicz via libcamera-devel wrote:
> Add controls supported by the AF algorithm to the list of controls
> supported by the RkISP1 IPA. This exposes the AF controls to the user
> and allows controlling the AF algorithm using the top level API.
>
> Signed-off-by: Daniel Semkowicz <dse at thaumatec.com>
> ---
> src/ipa/rkisp1/rkisp1.cpp | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index 292768cf..9c8b4a82 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -456,6 +456,28 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,
> frameDurations[1],
> frameDurations[2]);
>
> + if (lensControls_) {
> + const ControlInfo &focusAbsolute =
> + lensControls_->at(V4L2_CID_FOCUS_ABSOLUTE);
> +
> + using namespace controls;
> +
> + ctrlMap[&AfMetering] = ControlInfo(AfMeteringValues);
> + ctrlMap[&AfMode] = ControlInfo(AfModeValues);
> + ctrlMap[&AfPause] = ControlInfo(
> + Span<const ControlValue>{
> + { static_cast<int32_t>(AfPauseImmediate),
> + static_cast<int32_t>(AfPauseResume) } });
> + ctrlMap[&AfTrigger] = ControlInfo(AfTriggerValues);
> + ctrlMap[&AfWindows] = ControlInfo(
> + Rectangle(), Rectangle(sensorInfo.outputSize),
I wonder if the ISP doesn't have a minimum valid window size..
> + Rectangle());
> + ctrlMap[&LensPosition] = ControlInfo(
> + static_cast<float>(focusAbsolute.min().get<int32_t>()),
> + static_cast<float>(focusAbsolute.max().get<int32_t>()),
> + static_cast<float>(focusAbsolute.def().get<int32_t>()));
We're here exposing the values as they come from the v4l2 control
interface. We should get to a point where we have a CameraLensHelper
like we have CameraSensorHelpers to translate the platform-specific
value to a generic value. I can add a \todo when applying if you agree
with this.
The rest looks good
Reviewed-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
Thanks
j
> + }
> +
> *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);
> }
>
> --
> 2.39.2
>
More information about the libcamera-devel
mailing list