[{"id":22652,"web_url":"https://patchwork.libcamera.org/comment/22652/","msgid":"<164936978523.22830.396473507897537657@Monstersaurus>","date":"2022-04-07T22:16:25","subject":"Re: [libcamera-devel] [PATCH v5 3/6] ipa: ipu3: Inline\n\tparseStatistics() into processStatsBuffer()","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:06)\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>  src/ipa/ipu3/ipu3.cpp | 54 +++++++++++++++----------------------------\n>  1 file changed, 19 insertions(+), 35 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 8c9a20f5..569c1311 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -156,9 +156,6 @@ private:\n>                             ControlInfoMap *ipaControls);\n>         void updateSessionConfiguration(const ControlInfoMap &sensorControls);\n>  \n> -       void parseStatistics(unsigned int frame,\n> -                            int64_t frameTimestamp,\n> -                            const ipu3_uapi_stats_3a *stats);\n>         bool validateSensorControls();\n>  \n>         void setControls(unsigned int frame);\n> @@ -546,11 +543,15 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n>  }\n>  \n>  /**\n> - * \\brief Process statistics after ISP completion\n> + * \\brief Process the statistics generated by the ImgU\n>   * \\param[in] frame The frame number\n>   * \\param[in] frameTimestamp Timestamp of the frame\n>   * \\param[in] bufferId ID of the statistics buffer\n>   * \\param[in] sensorControls Sensor controls\n> + *\n> + * Parse the most recently processed image statistics from the ImgU. The\n> + * statistics are passed to each algorithm module to run their calculations and\n> + * update their state accordingly.\n>   */\n>  void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n>                                  const uint32_t bufferId, const ControlList &sensorControls)\n> @@ -568,37 +569,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimest\n>         context_.frameContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n>         context_.frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n>  \n> -       parseStatistics(frame, frameTimestamp, stats);\n> -}\n> -\n> -/**\n> - * \\brief Queue a request and process the control list from the application\n> - * \\param[in] frame The number of the frame which will be processed next\n> - * \\param[in] controls The controls for the \\a frame\n> - *\n> - * Parse the request to handle any IPA-managed controls that were set from the\n> - * application such as manual sensor settings.\n> - */\n> -void IPAIPU3::queueRequest(const uint32_t frame,\n> -                          [[maybe_unused]] const ControlList &controls)\n> -{\n> -       /* \\todo Start processing for 'frame' based on 'controls'. */\n> -}\n> -\n> -/**\n> - * \\brief Process the statistics generated by the ImgU\n> - * \\param[in] frame The number of the latest frame processed\n> - * \\param[in] frameTimestamp The current frame timestamp\n> - * \\param[in] stats The IPU3 statistics and ISP results\n> - *\n> - * Parse the most recently processed image statistics from the ImgU. The\n> - * statistics are passed to each algorithm module to run their calculations and\n> - * update their state accordingly.\n> - */\n> -void IPAIPU3::parseStatistics(unsigned int frame,\n> -                             [[maybe_unused]] int64_t frameTimestamp,\n> -                             const ipu3_uapi_stats_3a *stats)\n> -{\n>         double lineDuration = context_.configuration.sensor.lineDuration.get<std::micro>();\n>         int32_t vBlank = context_.configuration.sensor.defVBlank;\n>         ControlList ctrls(controls::controls);\n> @@ -629,6 +599,20 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>         metadataReady.emit(frame, ctrls);\n>  }\n>  \n> +/**\n> + * \\brief Queue a request and process the control list from the application\n> + * \\param[in] frame The number of the frame which will be processed next\n> + * \\param[in] controls The controls for the \\a frame\n> + *\n> + * Parse the request to handle any IPA-managed controls that were set from the\n> + * application such as manual sensor settings.\n> + */\n> +void IPAIPU3::queueRequest(const uint32_t frame,\n> +                          [[maybe_unused]] const ControlList &controls)\n> +{\n> +       /* \\todo Start processing for 'frame' based on 'controls'. */\n> +}\n> +\n>  /**\n>   * \\brief Handle sensor controls for a given \\a frame number\n>   * \\param[in] frame The frame on which the sensor controls should be set\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 DA408C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Apr 2022 22:16:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 36CD565643;\n\tFri,  8 Apr 2022 00:16:29 +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 0ECB165640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Apr 2022 00:16:28 +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 91AC5499;\n\tFri,  8 Apr 2022 00:16:27 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649369789;\n\tbh=vJGrZbSvZpTDDbPfAkmPiDfoaVVpWa5NMDLLV8VwC5w=;\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=pP15Jppmu3H8y7ACROTqXGNo/JVhVvJ8Ow9KEA4pXWDJmdznmFRq/Mo+fz4TTbVv3\n\tw+vg9fKxsFGGHPfbSvUMw4KyEoYG8L3/krIYe06F5AzznupWGBORdp7ZjMU0IgOmHn\n\tsr/17H7MSHYpNlQTBekbC5D8fK1bIV2ztiGfg2mcbB3oYivxnTh+21skGyUtswVgJ9\n\tUN7e7DRpdQCyk031t6T2qjz1/3DwZhF4vVob5SMURek0/LHey3nvsaERnui6tKTgn/\n\tmY646vvLyJvmKqcF0gA35CrGuk8kpTIVoXcnbeknqexE7j/g2sgPgE1aREjfCHs/Gh\n\tV2zZmGWSj79nw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649369787;\n\tbh=vJGrZbSvZpTDDbPfAkmPiDfoaVVpWa5NMDLLV8VwC5w=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=T5AzB4wLk5VdLP70ozaqoGvLe/N6Fgr8Rd+ZDHLbb7by/enFgVQPKn/PmAD13lkaU\n\tM2HNmluzav1kFG9MnQvPyxcMFRaJoB6Gxhi0uKXib+TT3R93RpaJYp8eUTva85gqwK\n\tOiXaowStxsU+RrHWFmnVbq29VaatQ0Nnqmxei+Hs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"T5AzB4wL\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220406141709.164794-4-umang.jain@ideasonboard.com>","References":"<20220406141709.164794-1-umang.jain@ideasonboard.com>\n\t<20220406141709.164794-4-umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 07 Apr 2022 23:16:25 +0100","Message-ID":"<164936978523.22830.396473507897537657@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v5 3/6] ipa: ipu3: Inline\n\tparseStatistics() into processStatsBuffer()","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":22663,"web_url":"https://patchwork.libcamera.org/comment/22663/","msgid":"<20220408070705.GO3237525@pyrite.rasen.tech>","date":"2022-04-08T07:07:05","subject":"Re: [libcamera-devel] [PATCH v5 3/6] ipa: ipu3: Inline\n\tparseStatistics() into processStatsBuffer()","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:06PM +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>  src/ipa/ipu3/ipu3.cpp | 54 +++++++++++++++----------------------------\n>  1 file changed, 19 insertions(+), 35 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 8c9a20f5..569c1311 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -156,9 +156,6 @@ private:\n>  \t\t\t    ControlInfoMap *ipaControls);\n>  \tvoid updateSessionConfiguration(const ControlInfoMap &sensorControls);\n>  \n> -\tvoid parseStatistics(unsigned int frame,\n> -\t\t\t     int64_t frameTimestamp,\n> -\t\t\t     const ipu3_uapi_stats_3a *stats);\n>  \tbool validateSensorControls();\n>  \n>  \tvoid setControls(unsigned int frame);\n> @@ -546,11 +543,15 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n>  }\n>  \n>  /**\n> - * \\brief Process statistics after ISP completion\n> + * \\brief Process the statistics generated by the ImgU\n>   * \\param[in] frame The frame number\n>   * \\param[in] frameTimestamp Timestamp of the frame\n>   * \\param[in] bufferId ID of the statistics buffer\n>   * \\param[in] sensorControls Sensor controls\n> + *\n> + * Parse the most recently processed image statistics from the ImgU. The\n> + * statistics are passed to each algorithm module to run their calculations and\n> + * update their state accordingly.\n>   */\n>  void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp,\n>  \t\t\t\t const uint32_t bufferId, const ControlList &sensorControls)\n> @@ -568,37 +569,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimest\n>  \tcontext_.frameContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n>  \tcontext_.frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n>  \n> -\tparseStatistics(frame, frameTimestamp, stats);\n> -}\n> -\n> -/**\n> - * \\brief Queue a request and process the control list from the application\n> - * \\param[in] frame The number of the frame which will be processed next\n> - * \\param[in] controls The controls for the \\a frame\n> - *\n> - * Parse the request to handle any IPA-managed controls that were set from the\n> - * application such as manual sensor settings.\n> - */\n> -void IPAIPU3::queueRequest(const uint32_t frame,\n> -\t\t\t   [[maybe_unused]] const ControlList &controls)\n> -{\n> -\t/* \\todo Start processing for 'frame' based on 'controls'. */\n> -}\n> -\n> -/**\n> - * \\brief Process the statistics generated by the ImgU\n> - * \\param[in] frame The number of the latest frame processed\n> - * \\param[in] frameTimestamp The current frame timestamp\n> - * \\param[in] stats The IPU3 statistics and ISP results\n> - *\n> - * Parse the most recently processed image statistics from the ImgU. The\n> - * statistics are passed to each algorithm module to run their calculations and\n> - * update their state accordingly.\n> - */\n> -void IPAIPU3::parseStatistics(unsigned int frame,\n> -\t\t\t      [[maybe_unused]] int64_t frameTimestamp,\n> -\t\t\t      const ipu3_uapi_stats_3a *stats)\n> -{\n>  \tdouble lineDuration = context_.configuration.sensor.lineDuration.get<std::micro>();\n>  \tint32_t vBlank = context_.configuration.sensor.defVBlank;\n>  \tControlList ctrls(controls::controls);\n> @@ -629,6 +599,20 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>  \tmetadataReady.emit(frame, ctrls);\n>  }\n>  \n> +/**\n> + * \\brief Queue a request and process the control list from the application\n> + * \\param[in] frame The number of the frame which will be processed next\n> + * \\param[in] controls The controls for the \\a frame\n> + *\n> + * Parse the request to handle any IPA-managed controls that were set from the\n> + * application such as manual sensor settings.\n> + */\n> +void IPAIPU3::queueRequest(const uint32_t frame,\n> +\t\t\t   [[maybe_unused]] const ControlList &controls)\n> +{\n> +\t/* \\todo Start processing for 'frame' based on 'controls'. */\n> +}\n> +\n>  /**\n>   * \\brief Handle sensor controls for a given \\a frame number\n>   * \\param[in] frame The frame on which the sensor controls should be set\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 56D32C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Apr 2022 07:07:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B1B765642;\n\tFri,  8 Apr 2022 09:07:15 +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 6CEF961FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Apr 2022 09:07:13 +0200 (CEST)","from pyrite.rasen.tech (softbank036240056250.bbtec.net\n\t[36.240.56.250])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 11E78499;\n\tFri,  8 Apr 2022 09:07:11 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649401635;\n\tbh=bE600gEPoJCpeQysGWLnRE6IreOK/YCwYL4GNBrwJqY=;\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=tdX2kp+yzn71iaos+9LFbTgwRPGSom8u9B3JVhysJ0IgpyLWQEbLfTueLPY/FolhR\n\ti4iLm0DmH/hnP0Htk4wzVdjrsI7RhfyT9dOGVVICT2E/cQ+XHHZoeFjy+l2znmYDLW\n\t83hMGSQSqTfu1Mwrl4KYJoBugZh+4dWD+bPih2XuOuNWt4O7sEMIbWHp4N7ObLzCeS\n\tFlUu6wvKSSrqvszvA/RCZ63p7xqqlZCGuQ3QoR5J3G9EFKtvcekmPQ1/wQ1LnDvGJE\n\twKUoi6/SVwpKmrP1ZM4HiymdsdkueuzOsVhJQkTKz3GHuU+BfQ2H4fe/skDr//qI0L\n\ttOhBh1sCWT1BA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649401633;\n\tbh=bE600gEPoJCpeQysGWLnRE6IreOK/YCwYL4GNBrwJqY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KKhuGpx9mG25Y8r2yWyQnbngTMc5QYaS6/loPvkIz2OMCrYOx0/tJ/znOKZ812nE/\n\tF06ioImA8KDfn9w3FhfVLiGeHOMiaiZJfs+DXrIb5O0yFDQKtMx8kMbQX8vzYDfQ5T\n\tzBUYfeiB06JxXLcqisfAISA9Dcg8dT0lCj2KarMk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KKhuGpx9\"; dkim-atps=neutral","Date":"Fri, 8 Apr 2022 16:07:05 +0900","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20220408070705.GO3237525@pyrite.rasen.tech>","References":"<20220406141709.164794-1-umang.jain@ideasonboard.com>\n\t<20220406141709.164794-4-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20220406141709.164794-4-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v5 3/6] ipa: ipu3: Inline\n\tparseStatistics() into processStatsBuffer()","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>"}}]