From patchwork Wed Apr 6 14:17:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15640 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DA9A0C3256 for ; Wed, 6 Apr 2022 14:17:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2DE865646; Wed, 6 Apr 2022 16:17:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649254659; bh=Rf9JkFUqZrQKSWL4TWMesOvFCqEe7TSKyBCPUM4MhwU=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Gms3GtEwXfDTLe92atPE1Sv7jyjJdIOiGGX68LuIWZVOpj+Y6jfhUTzyUGgCsixCN xcwm99l53iLjnm88XOqBxICRFQncNeKTaX4h6LGYBK8TIlOwi2N8kOSD7rWiuZ4fM9 kdpD2LBs/8dMpPvFLSTapulXSC9e9Qtt9ZRO6jiKz0gBMr2UWJTvHAl95hyeKhK3TG tTki2tdP2kZTftR0IMg4emX2XLo7VojYqZI0MxLzs6uy89W5OSlkQsrdMZLSndc6dE uFJSxftEW789rUcQY08COy9fXR+qjTG2npEUytn/MBwMOcjNQbOkQcJQR6vb4AZJun +2n+oRZCE15jg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E1999633A4 for ; Wed, 6 Apr 2022 16:17:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SxEFZJyN"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [27.57.186.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 19EF2482; Wed, 6 Apr 2022 16:17:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1649254657; bh=Rf9JkFUqZrQKSWL4TWMesOvFCqEe7TSKyBCPUM4MhwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SxEFZJyNb5l8J0MceVPF8vgvTO8TyT10EYib2lDIxif3r0rMLrV2VI6Xw7CDd6GdU 6tCCEAhihnEOJJwBum8QBJFPkFvDjunEbLY2+STMquOQMpch9hoiIiCxEX3660ZSmI nMUt2NCRtS4NQ4sGggBUgYEtjkD70XRrAYDGkhqg= To: libcamera-devel@lists.libcamera.org Date: Wed, 6 Apr 2022 19:47:08 +0530 Message-Id: <20220406141709.164794-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220406141709.164794-1-umang.jain@ideasonboard.com> References: <20220406141709.164794-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [IPAIPU3 PATCH v5 5/6] ipu3: Inline fillParams() in fillParamsBuffer() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- ipu3.cpp | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/ipu3.cpp b/ipu3.cpp index b6d2129..0543a2e 100644 --- a/ipu3.cpp +++ b/ipu3.cpp @@ -60,7 +60,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, @@ -342,7 +341,29 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) ipu3_uapi_params *params = reinterpret_cast(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, @@ -390,33 +411,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,