[{"id":22654,"web_url":"https://patchwork.libcamera.org/comment/22654/","msgid":"<164936998171.22830.4129534209288826531@Monstersaurus>","date":"2022-04-07T22:19:41","subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v5 5/6] ipu3: Inline\n\tfillParams() in fillParamsBuffer()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain via libcamera-devel (2022-04-06 15:17:08)\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> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@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 b6d2129..0543a2e 100644\n> --- a/ipu3.cpp\n> +++ b/ipu3.cpp\n> @@ -60,7 +60,6 @@ private:\n>                             const ControlInfoMap &sensorControls,\n>                             ControlInfoMap *ipaControls);\n>         void runAiq(unsigned int frame);\n> -       void fillParams(unsigned int frame, ipu3_uapi_params *params);\n>         void parseStatistics(unsigned int frame,\n>                              int64_t frameTimestamp,\n>                              const ipu3_uapi_stats_3a *stats,\n> @@ -342,7 +341,29 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n>         ipu3_uapi_params *params =\n>                 reinterpret_cast<ipu3_uapi_params *>(mem.data());\n>  \n> -       fillParams(frame, params);\n> +       /* Prepare parameters buffer. */\n> +       memset(params, 0, sizeof(*params));\n> +\n> +       /*\n> +        * Call into the AIQ object, and set up the library with any requested\n> +        * controls or settings from the incoming request.\n> +        *\n> +        * (statistics are fed into the library as a separate event\n> +        *  when available)\n> +        *\n> +        * - Run algorithms\n> +        *\n> +        * - Fill params buffer with the results of the algorithms.\n> +        */\n> +       runAiq(frame);\n> +\n> +       aiq::AiqResults& latestResults = resultsHistory_.latest();\n> +       aic_.updateRuntimeParams(latestResults);\n> +       aic_.run(params);\n> +\n> +       setControls(frame);\n> +\n> +       paramsBufferReady.emit(frame);\n>  }\n>  \n>  void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n> @@ -390,33 +411,6 @@ void IPAIPU3::runAiq([[maybe_unused]] unsigned int frame)\n>         lensPosition_ = latestResults.af()->next_lens_position;\n>  }\n>  \n> -void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n> -{\n> -       /* Prepare parameters buffer. */\n> -       memset(params, 0, sizeof(*params));\n> -\n> -       /*\n> -        * Call into the AIQ object, and set up the library with any requested\n> -        * controls or settings from the incoming request.\n> -        *\n> -        * (statistics are fed into the library as a separate event\n> -        *  when available)\n> -        *\n> -        * - Run algorithms\n> -        *\n> -        * - Fill params buffer with the results of the algorithms.\n> -        */\n> -       runAiq(frame);\n> -\n> -       aiq::AiqResults& latestResults = resultsHistory_.latest();\n> -       aic_.updateRuntimeParams(latestResults);\n> -       aic_.run(params);\n> -\n> -       setControls(frame);\n> -\n> -       paramsBufferReady.emit(frame);\n> -}\n> -\n>  void IPAIPU3::parseStatistics(unsigned int frame,\n>                               int64_t frameTimestamp,\n>                               const ipu3_uapi_stats_3a *stats,\n> -- \n> 2.31.0\n>","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 B7C53C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Apr 2022 22:19:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B7F365643;\n\tFri,  8 Apr 2022 00:19:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8EC6065640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Apr 2022 00:19:44 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 41F31499;\n\tFri,  8 Apr 2022 00:19:44 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649369985;\n\tbh=uZgt8HTiJ+R8wy/W9d/dUHRzrwcZfxIvhlf9R3wKaEU=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=T4jeDckUfxqlF4qtiZSp16hh/4u/SAKmkOYE9JFtfJB7uQTV9MsK6xmwVVCD0tg/y\n\tG20RQrmkigIQvHAy5K9JSDTsaFEuynEJTU3Rq8YeK5KFue0aimSkM9o58JRnv6Rh0H\n\tH3Bn4HfgPEz+1wW5Hjeq2bKaFFKzubNmMwY/2uXxZ+yN19J81bsGoSMB3vPGUdwzgm\n\tfUVwpeRmepSxN3fbhVIwi46+a5JriAw21zyJxcsqLxoAVgirfO+cJdUC5OV0cBaWIV\n\tbjRq10o2p25vjdDxignl+Mv0XlovG919DhgUmxWG/WZDF1HxjQL/hmSTXOI8unBt5l\n\tt8YFaCB0mJovg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649369984;\n\tbh=uZgt8HTiJ+R8wy/W9d/dUHRzrwcZfxIvhlf9R3wKaEU=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=X/SnMGk299XegUXtvYJjHA+FvttTsvyy5kA+txyRftvC1TBOo18M5zxEIFOlj05Un\n\tsdiJ7oDqZZ1IYyTCE7XAG1OLyNAD68ar/+JsJL57qYrfLYc16lz3v0dUJDUpwuA2cV\n\t/z+ZHc/lScZedrX9wSLXmh5GaM4p9e0dHkkeZbWQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"X/SnMGk2\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220406141709.164794-6-umang.jain@ideasonboard.com>","References":"<20220406141709.164794-1-umang.jain@ideasonboard.com>\n\t<20220406141709.164794-6-umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 07 Apr 2022 23:19:41 +0100","Message-ID":"<164936998171.22830.4129534209288826531@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v5 5/6] ipu3: Inline\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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22665,"web_url":"https://patchwork.libcamera.org/comment/22665/","msgid":"<20220408071817.GQ3237525@pyrite.rasen.tech>","date":"2022-04-08T07:18:17","subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v5 5/6] ipu3: Inline\n\tfillParams() in fillParamsBuffer()","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Umang,\n\nOn Wed, Apr 06, 2022 at 07:47:08PM +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> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@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 b6d2129..0543a2e 100644\n> --- a/ipu3.cpp\n> +++ b/ipu3.cpp\n> @@ -60,7 +60,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> @@ -342,7 +341,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> @@ -390,33 +411,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,\n> -- \n> 2.31.0\n>","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 16FFAC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Apr 2022 07:18:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BCA0D65642;\n\tFri,  8 Apr 2022 09:18:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 927B061FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Apr 2022 09:18:24 +0200 (CEST)","from pyrite.rasen.tech (softbank036240056250.bbtec.net\n\t[36.240.56.250])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B9A6499;\n\tFri,  8 Apr 2022 09:18:22 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649402305;\n\tbh=yp6nnmHaEqEfbUKMm5wQca4bGyPad3/VSUbnhnZbZDY=;\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=I4S3oyEEH+QcvN58M4xsjfeVQ9dvL8AuEAa2jm3MY4VPjoU5C2DxKnA37V6+zwJM9\n\tFNLA/meyWcOEVWs8O3fJOeHpDjXxMyNuAxQMylhlcc/O6gD95NZGqdS/sgEtyHewdR\n\tCHJrnVYanPgR1fuwDOtY7ZFXxJdi/ms+mwv+ZEM2DadWH36icdln6Ay8aywG5bq754\n\t14xQR8+gGC+9RVtZ9VfGa7xwQrSazAgtCCs1MBy78nrEp5QAnl5K2vi6RspYVt145x\n\t1HXPWo0+9ldAacyo2y5eLpXLp114fij59MVj5Gnv0yqgFjjaWNC+WBnQ2YQnN29nCr\n\tQLRr9x78Bi0Uw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649402304;\n\tbh=yp6nnmHaEqEfbUKMm5wQca4bGyPad3/VSUbnhnZbZDY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jrXVPAhcVXIPMMjZqkVnwFBYPGPGJ9YXPwd2fCd1twhFqRgyKrr3CfWzimcC6uX3y\n\tu3UZ2qwlIYT5HNohDR+lpJl1kHpm+/GGLdCiHd9xOBAVLyMb33gISV2eZIjtXARl32\n\t6le5+1n0AOGnNXCwqPo/Jv5yPc20PTkK8N/0X3fM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jrXVPAhc\"; dkim-atps=neutral","Date":"Fri, 8 Apr 2022 16:18:17 +0900","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20220408071817.GQ3237525@pyrite.rasen.tech>","References":"<20220406141709.164794-1-umang.jain@ideasonboard.com>\n\t<20220406141709.164794-6-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20220406141709.164794-6-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [IPAIPU3 PATCH v5 5/6] ipu3: Inline\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":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"paul.elder@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>"}}]