[{"id":22589,"web_url":"https://patchwork.libcamera.org/comment/22589/","msgid":"<YkzJiBFmoYH1YxT5@pendragon.ideasonboard.com>","date":"2022-04-05T22:58:16","subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v4 5/6] ipu3: Inlink\n\tfillParams() in fillParamsBuffer()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\ns/Inlink/Inline/\n\nOn Thu, Mar 31, 2022 at 10:00:57PM +0530, Umang Jain via libcamera-devel wrote:\n> Since we have moved away from switch/case on the operation ID,\n> there's little reason to split the operation in two functions.\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  ipu3.cpp | 52 +++++++++++++++++++++++-----------------------------\n>  1 file changed, 23 insertions(+), 29 deletions(-)\n> \n> diff --git a/ipu3.cpp b/ipu3.cpp\n> index 289cc77..a435005 100644\n> --- a/ipu3.cpp\n> +++ b/ipu3.cpp\n> @@ -61,7 +61,6 @@ private:\n>  \t\t\t    const ControlInfoMap &sensorControls,\n>  \t\t\t    ControlInfoMap *ipaControls);\n>  \tvoid runAiq(unsigned int frame);\n> -\tvoid fillParams(unsigned int frame, ipu3_uapi_params *params);\n>  \tvoid parseStatistics(unsigned int frame,\n>  \t\t\t     int64_t frameTimestamp,\n>  \t\t\t     const ipu3_uapi_stats_3a *stats,\n> @@ -343,7 +342,29 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n>  \tipu3_uapi_params *params =\n>  \t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n>  \n> -\tfillParams(frame, params);\n> +\t/* Prepare parameters buffer. */\n> +\tmemset(params, 0, sizeof(*params));\n> +\n> +\t/*\n> +\t * Call into the AIQ object, and set up the library with any requested\n> +\t * controls or settings from the incoming request.\n> +\t *\n> +\t * (statistics are fed into the library as a separate event\n> +\t *  when available)\n> +\t *\n> +\t * - Run algorithms\n> +\t *\n> +\t * - Fill params buffer with the results of the algorithms.\n> +\t */\n> +\trunAiq(frame);\n> +\n> +\taiq::AiqResults& latestResults = resultsHistory_.latest();\n> +\taic_.updateRuntimeParams(latestResults);\n> +\taic_.run(params);\n> +\n> +\tsetControls(frame);\n> +\n> +\tparamsBufferReady.emit(frame);\n>  }\n>  \n>  void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n> @@ -391,33 +412,6 @@ void IPAIPU3::runAiq([[maybe_unused]] unsigned int frame)\n>  \tlensPosition_ = latestResults.af()->next_lens_position;\n>  }\n>  \n> -void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n> -{\n> -\t/* Prepare parameters buffer. */\n> -\tmemset(params, 0, sizeof(*params));\n> -\n> -\t/*\n> -\t * Call into the AIQ object, and set up the library with any requested\n> -\t * controls or settings from the incoming request.\n> -\t *\n> -\t * (statistics are fed into the library as a separate event\n> -\t *  when available)\n> -\t *\n> -\t * - Run algorithms\n> -\t *\n> -\t * - Fill params buffer with the results of the algorithms.\n> -\t */\n> -\trunAiq(frame);\n> -\n> -\taiq::AiqResults& latestResults = resultsHistory_.latest();\n> -\taic_.updateRuntimeParams(latestResults);\n> -\taic_.run(params);\n> -\n> -\tsetControls(frame);\n> -\n> -\tparamsBufferReady.emit(frame);\n> -}\n> -\n>  void IPAIPU3::parseStatistics(unsigned int frame,\n>  \t\t\t      int64_t frameTimestamp,\n>  \t\t\t      const ipu3_uapi_stats_3a *stats,","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 305B2C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Apr 2022 22:58:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D93FA65642;\n\tWed,  6 Apr 2022 00:58:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DEC2B633A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Apr 2022 00:58:19 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96C73482;\n\tWed,  6 Apr 2022 00:58:19 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649199500;\n\tbh=Kndzb7jAUAaDrpxwAKk3CBlpRGqckpwqNP7FfcocU0U=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Nk6mmBnfeK8f/wiI9ScvOwN3yDT4uKggtYnm50KOsWPof5NeqTcarU2CFnj9lx4/f\n\tb9sU1/I65x7aXzoQWKQ+sUDo/ONUuM+kSyHd7+ic3OmjDZ5TtfivQbCTHNtzelOv9/\n\t/rSi06EHca8NHVc/rYybAQ/aF541BUL/bDNrvS+4lwTTZnoQw28brdIaH3TdMNnscO\n\t6dSznYX5+7chE+X0sKug47+UulGnU5j2+XAJmox7mF9wDTvtRuhwpQXScOklsyXbGa\n\tyceab4CpqjqkLLdX7W0uxWMBIoTkmmfpXsuhs8XgXvrnCnQl1YPjiKIXecFP9q3Lhw\n\t1L86lDPGRKx1A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649199499;\n\tbh=Kndzb7jAUAaDrpxwAKk3CBlpRGqckpwqNP7FfcocU0U=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=aukrhRMt5S9Hc4kuLW80MR4tygvRVE+QZI4BBubK9TPZnNOWC91eVY1hvPOIuFnJI\n\taU0KNNDw4MdrbJN+sO//4OX+MN8Wd+GTKsmALRASJJpYi4DcV+/70mc6OCWFNAWFD2\n\tdmI9BNajUQnG4R16Je4W28VJwwTmnLDuTm0u2vX0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"aukrhRMt\"; dkim-atps=neutral","Date":"Wed, 6 Apr 2022 01:58:16 +0300","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YkzJiBFmoYH1YxT5@pendragon.ideasonboard.com>","References":"<20220331163058.171418-1-umang.jain@ideasonboard.com>\n\t<20220331163058.171418-6-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220331163058.171418-6-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v4 5/6] ipu3: Inlink\n\tfillParams() in fillParamsBuffer()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]