[libcamera-devel] [IPAIPU3 PATCH v4 5/6] ipu3: Inlink fillParams() in fillParamsBuffer()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Apr 6 00:58:16 CEST 2022
Hi Umang,
Thank you for the patch.
s/Inlink/Inline/
On Thu, Mar 31, 2022 at 10:00:57PM +0530, Umang Jain via libcamera-devel wrote:
> Since we have moved away from switch/case on the operation ID,
> there's little reason to split the operation in two functions.
>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> ipu3.cpp | 52 +++++++++++++++++++++++-----------------------------
> 1 file changed, 23 insertions(+), 29 deletions(-)
>
> diff --git a/ipu3.cpp b/ipu3.cpp
> index 289cc77..a435005 100644
> --- a/ipu3.cpp
> +++ b/ipu3.cpp
> @@ -61,7 +61,6 @@ private:
> const ControlInfoMap &sensorControls,
> ControlInfoMap *ipaControls);
> void runAiq(unsigned int frame);
> - void fillParams(unsigned int frame, ipu3_uapi_params *params);
> void parseStatistics(unsigned int frame,
> int64_t frameTimestamp,
> const ipu3_uapi_stats_3a *stats,
> @@ -343,7 +342,29 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)
> ipu3_uapi_params *params =
> reinterpret_cast<ipu3_uapi_params *>(mem.data());
>
> - fillParams(frame, params);
> + /* Prepare parameters buffer. */
> + memset(params, 0, sizeof(*params));
> +
> + /*
> + * Call into the AIQ object, and set up the library with any requested
> + * controls or settings from the incoming request.
> + *
> + * (statistics are fed into the library as a separate event
> + * when available)
> + *
> + * - Run algorithms
> + *
> + * - Fill params buffer with the results of the algorithms.
> + */
> + runAiq(frame);
> +
> + aiq::AiqResults& latestResults = resultsHistory_.latest();
> + aic_.updateRuntimeParams(latestResults);
> + aic_.run(params);
> +
> + setControls(frame);
> +
> + paramsBufferReady.emit(frame);
> }
>
> void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,
> @@ -391,33 +412,6 @@ void IPAIPU3::runAiq([[maybe_unused]] unsigned int frame)
> lensPosition_ = latestResults.af()->next_lens_position;
> }
>
> -void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)
> -{
> - /* Prepare parameters buffer. */
> - memset(params, 0, sizeof(*params));
> -
> - /*
> - * Call into the AIQ object, and set up the library with any requested
> - * controls or settings from the incoming request.
> - *
> - * (statistics are fed into the library as a separate event
> - * when available)
> - *
> - * - Run algorithms
> - *
> - * - Fill params buffer with the results of the algorithms.
> - */
> - runAiq(frame);
> -
> - aiq::AiqResults& latestResults = resultsHistory_.latest();
> - aic_.updateRuntimeParams(latestResults);
> - aic_.run(params);
> -
> - setControls(frame);
> -
> - paramsBufferReady.emit(frame);
> -}
> -
> void IPAIPU3::parseStatistics(unsigned int frame,
> int64_t frameTimestamp,
> const ipu3_uapi_stats_3a *stats,
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list