[{"id":22231,"web_url":"https://patchwork.libcamera.org/comment/22231/","msgid":"<c6afa8f5-bbff-be04-04c6-4b564e37365d@ideasonboard.com>","date":"2022-03-08T08:51:12","subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: rkisp1: Use frame counter\n\tfor the request queued","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 JM\n\nThank you for the patch.\n\nOn 2/24/22 17:03, Jean-Michel Hautbois wrote:\n> Introduce a frameCount variable in the IPAFrameContext which increments\n> each time a request is queued. It is reset at configure call, when the\n> camera is started.\n>\n> This will allow the frameCount to be used by other algorithms, without\n> having to keep multiple private frame counters.\n>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n>\n> ---\n> v3: - replace frameId by a frame counter\n>      - Change the date of the copyright\n> ---\n>   src/ipa/rkisp1/ipa_context.cpp | 9 ++++++++-\n>   src/ipa/rkisp1/ipa_context.h   | 4 +++-\n>   src/ipa/rkisp1/rkisp1.cpp      | 3 +++\n>   3 files changed, 14 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 9cb2a9fd..664f572f 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2021, Ideas On Board\n> + * Copyright (C) 2021-2022, Ideas On Board\n>    *\n>    * ipa_context.cpp - RkISP1 IPA Context\n>    */\n> @@ -113,4 +113,11 @@ namespace libcamera::ipa::rkisp1 {\n>    * \\brief Analogue gain multiplier\n>    */\n>   \n> +/**\n> + * \\var IPAFrameContext::frameCount\n> + * \\brief Number of queued requests for this frame context\n> + *\n> + * It restarts from 0 when the camera is started.\n> + */\n> +\n>   } /* namespace libcamera::ipa::rkisp1 */\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index b94ade0c..212fa052 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -1,6 +1,6 @@\n>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>   /*\n> - * Copyright (C) 2021, Ideas On Board\n> + * Copyright (C) 2021-2022, Ideas On Board\n>    *\n>    * ipa_context.h - RkISP1 IPA Context\n>    *\n> @@ -43,6 +43,8 @@ struct IPAFrameContext {\n>   \t\tuint32_t exposure;\n>   \t\tdouble gain;\n>   \t} sensor;\n> +\n> +\tunsigned int frameCount;\n>   };\n>   \n>   struct IPAContext {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 2d79f15f..f119b3f3 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -196,6 +196,8 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n>   \tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n>   \tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n>   \n> +\tcontext_.frameContext.frameCount = 0;\n> +\n>   \tfor (auto const &algo : algorithms_) {\n>   \t\tint ret = algo->configure(context_, info);\n>   \t\tif (ret)\n> @@ -284,6 +286,7 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n>   \top.op = ActionParamFilled;\n>   \n>   \tqueueFrameAction.emit(frame, op);\n> +\tcontext_.frameContext.frameCount++;\n>   }\n>   \n>   void IPARkISP1::updateStatistics(unsigned int frame,","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 810CDBE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Mar 2022 08:51:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 950FF61183;\n\tTue,  8 Mar 2022 09:51:19 +0100 (CET)","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 0793D604E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Mar 2022 09:51:17 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.72])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DCEED488;\n\tTue,  8 Mar 2022 09:51:16 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1646729479;\n\tbh=Vr3fi5P+nqJw5ptaP7PhjlPUAQLfw2oeVCAC3G6E128=;\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:\n\tFrom;\n\tb=EIGO2or3fEtpw6VFf/RSTM+rgpUcKJtGRPNRMl73M18laQxCRcE30UcECUauQKlg3\n\tjv92LXwxPqBU1MXV8m0OBNmtbBSUe4nToE1LNScE80k5ZJgjd3o0bVUU6VubilzXlW\n\tB3vwEvARs6CoZEoEfpbGZ/EE5oerB705QPY5q0udx1rbdol9cMVDu9GTLpzQnhY2Gk\n\tqcZGAUjmQrSiMRUvJujQnyhzssuak4wKrpL26pfQvKhbuI7OToIXt94rGvNeuI2u1B\n\tyEOirUdwLXguU3DAteS0NYx1ixFe7UJ0u/Oedo616dai9WSHq3k0cYGNH49L0WRkVZ\n\tzAYOapSyJ+FUg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1646729477;\n\tbh=Vr3fi5P+nqJw5ptaP7PhjlPUAQLfw2oeVCAC3G6E128=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=MyxFxXsQfAcLjSrHjcpnhSDucOlD+IjjiYmD7UbS3ybI3CoLNigEx9mfcpM0sP6Es\n\tXlztwCKEm//J5jT7+nlWdi6/hYrxiXRGeTFJD2NkAKJ+gex2+Xym56+OZsGlUqMqXB\n\tmuaEUrR/MynAke+l2HHaFywUCTKv+O3zyQfJ7zD0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"MyxFxXsQ\"; dkim-atps=neutral","Message-ID":"<c6afa8f5-bbff-be04-04c6-4b564e37365d@ideasonboard.com>","Date":"Tue, 8 Mar 2022 14:21:12 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20220224113347.80001-2-jeanmichel.hautbois@ideasonboard.com>","In-Reply-To":"<20220224113347.80001-2-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: rkisp1: Use frame counter\n\tfor the request queued","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22460,"web_url":"https://patchwork.libcamera.org/comment/22460/","msgid":"<YkDHY81mithU+WlZ@pendragon.ideasonboard.com>","date":"2022-03-27T20:21:55","subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: rkisp1: Use frame counter\n\tfor the request queued","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Thu, Feb 24, 2022 at 12:33:43PM +0100, Jean-Michel Hautbois wrote:\n> Introduce a frameCount variable in the IPAFrameContext which increments\n> each time a request is queued. It is reset at configure call, when the\n> camera is started.\n> \n> This will allow the frameCount to be used by other algorithms, without\n> having to keep multiple private frame counters.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> \n> ---\n> v3: - replace frameId by a frame counter\n>     - Change the date of the copyright\n> ---\n>  src/ipa/rkisp1/ipa_context.cpp | 9 ++++++++-\n>  src/ipa/rkisp1/ipa_context.h   | 4 +++-\n>  src/ipa/rkisp1/rkisp1.cpp      | 3 +++\n>  3 files changed, 14 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\n> index 9cb2a9fd..664f572f 100644\n> --- a/src/ipa/rkisp1/ipa_context.cpp\n> +++ b/src/ipa/rkisp1/ipa_context.cpp\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n> - * Copyright (C) 2021, Ideas On Board\n> + * Copyright (C) 2021-2022, Ideas On Board\n>   *\n>   * ipa_context.cpp - RkISP1 IPA Context\n>   */\n> @@ -113,4 +113,11 @@ namespace libcamera::ipa::rkisp1 {\n>   * \\brief Analogue gain multiplier\n>   */\n>  \n> +/**\n> + * \\var IPAFrameContext::frameCount\n> + * \\brief Number of queued requests for this frame context\n\n\"Number of queued requests\" sounds a bit like the number of requests\ncurrently queued.\n\n/**\n * \\var IPAFrameContext::frameCount\n * \\brief Counter of requests queued to the IPA module\n *\n * The counter is reset to 0 when the IPA module is configured, and is\n * incremented for each request being queued, after calling the\n * Algorithm::prepare() function of all algorithms.\n */\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> + *\n> + * It restarts from 0 when the camera is started.\n> + */\n> +\n>  } /* namespace libcamera::ipa::rkisp1 */\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index b94ade0c..212fa052 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n> - * Copyright (C) 2021, Ideas On Board\n> + * Copyright (C) 2021-2022, Ideas On Board\n>   *\n>   * ipa_context.h - RkISP1 IPA Context\n>   *\n> @@ -43,6 +43,8 @@ struct IPAFrameContext {\n>  \t\tuint32_t exposure;\n>  \t\tdouble gain;\n>  \t} sensor;\n> +\n> +\tunsigned int frameCount;\n>  };\n>  \n>  struct IPAContext {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 2d79f15f..f119b3f3 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -196,6 +196,8 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n>  \tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n>  \tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n>  \n> +\tcontext_.frameContext.frameCount = 0;\n> +\n>  \tfor (auto const &algo : algorithms_) {\n>  \t\tint ret = algo->configure(context_, info);\n>  \t\tif (ret)\n> @@ -284,6 +286,7 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n>  \top.op = ActionParamFilled;\n>  \n>  \tqueueFrameAction.emit(frame, op);\n> +\tcontext_.frameContext.frameCount++;\n>  }\n>  \n>  void IPARkISP1::updateStatistics(unsigned int frame,","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 67572C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 27 Mar 2022 20:21:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8640F65633;\n\tSun, 27 Mar 2022 22:21:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9AE0600AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Mar 2022 22:21:57 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2A5882F7;\n\tSun, 27 Mar 2022 22:21:57 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648412518;\n\tbh=O2z1Q+I58f9w7iW4ecvqj6WTm+FFMcYSY6lSR+bcyO0=;\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=lIByFyiBgiHYfIf7t1pZFWtEsI6pWXHHt0BnNI5IsfbpBJGU1u+TMcG6X6HYMFGfG\n\t7ffaUdbJp04Ymf6RnYI0UZnEIiRRp7MmxsFJoMa2SJX73+W+cKAb4vO3xBFA/US2IB\n\tn/VD5FbNPlGNXArHFL88Wc9wk4vwdWPCau3iCkVMcK1r4xN050wI1HizhS7yXt7KlC\n\tBQ9Xi1Wn8xQUlPDN618gkVNJg3FXg/z7UOqmfGNLQEhamLK0cFcO5+zb72Fkzi1blr\n\t3QXrFpDlC/ttM6R6N8iSaUYl2uxL3Onhj2oSYPLtJ+WDxWRUKTta2ORZc173d+bMbE\n\tlg/W29mjm6HNQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648412517;\n\tbh=O2z1Q+I58f9w7iW4ecvqj6WTm+FFMcYSY6lSR+bcyO0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UlfnTmEoU0N+ednrhom0IY/O9unlciMIKVxXe6pNheIs7vUNr2scxzaAseWNpqphx\n\tgEqBDdTQJ9V8SKRdr4JF2aeXnqdWOu2iePLtubW4SUweHWC5aB4Puq2HqonWdPYMDG\n\tEbDy7q83UtKni8FQnYY3L2QDkAUW62n01apycFIg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UlfnTmEo\"; dkim-atps=neutral","Date":"Sun, 27 Mar 2022 23:21:55 +0300","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YkDHY81mithU+WlZ@pendragon.ideasonboard.com>","References":"<20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20220224113347.80001-2-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220224113347.80001-2-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 1/5] ipa: rkisp1: Use frame counter\n\tfor the request queued","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>"}}]