From patchwork Thu Mar 31 16:30:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15598 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 014B0C3256 for ; Thu, 31 Mar 2022 16:31:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9F57765635; Thu, 31 Mar 2022 18:31:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648744292; bh=318j58jnW0FN0U3MPLLoDqOwjks2juifiTrB65Chbg4=; 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=Gd7Qt024iplmelwpp1xxTtg0feCJT8+jCQ0wUCm1csAyGcHsOCO760nfTmCKSeQKi tD/QSjdorOfFtbi81tOazT9zhejm+Pr+nXFaRa2qJZumWtQc2J2r8JvF1lQr+ZajUM ynPr+FwsIsn8+72ejT4sWPH1IG+MqKH+4qoYZeLve+TFIApVpOvj4Y4bW48SC6DYUB G4IMUgIo7Es6oImhDQ/cKU4j4RTbORvX0b4lbqduSCkhYzYWan2s1b7/fOkLrsXBgp eX00apxGPvTy0xGpXh0zhig9Zj645QIcUOIknAJmD3USgIoDzStgWQmN7zP0tngSeP GOqtk5zcZUAWw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C63BA65637 for ; Thu, 31 Mar 2022 18:31:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bpGXidsU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [103.74.73.150]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EAC86486; Thu, 31 Mar 2022 18:31:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648744290; bh=318j58jnW0FN0U3MPLLoDqOwjks2juifiTrB65Chbg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bpGXidsUyotORzYwkkkSDSWAY/e2L2GPWphpwUyaA1K8qIkxE/4ky3fZEBo3hCVSk c+u8myERQr1/LZzO/fJd2TmcK7NE9dF94UIiVp2Bw4rTVq4C7BFxvbO2OrKu4Nq0Zv HdriUBda9w9v9OUt/DLoFh/1nehFeFJwUGm74pyM= To: libcamera-devel@lists.libcamera.org Date: Thu, 31 Mar 2022 22:00:57 +0530 Message-Id: <20220331163058.171418-6-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220331163058.171418-1-umang.jain@ideasonboard.com> References: <20220331163058.171418-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [IPAIPU3 PATCH v4 5/6] ipu3: Inlink 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 --- 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(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,