{"id":13332,"url":"https://patchwork.libcamera.org/api/1.1/patches/13332/?format=json","web_url":"https://patchwork.libcamera.org/patch/13332/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210812165243.276977-5-jeanmichel.hautbois@ideasonboard.com>","date":"2021-08-12T16:52:37","name":"[libcamera-devel,v2,04/10] ipa: ipu3: Introduce a prepare() call to Algorithm","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"581ce55d60884fd8b4689a866f4018f0b9da5356","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13332/mbox/","series":[{"id":2347,"url":"https://patchwork.libcamera.org/api/1.1/series/2347/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2347","date":"2021-08-12T16:52:33","name":"IPU3: Introduce modularity for algorithms","version":2,"mbox":"https://patchwork.libcamera.org/series/2347/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13332/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13332/checks/","tags":{},"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 D768EC3242\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Aug 2021 16:52:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 53901688A2;\n\tThu, 12 Aug 2021 18:52:52 +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 8C5376888D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Aug 2021 18:52:47 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:3d6d:7284:3c48:5edc])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45C0C8AF;\n\tThu, 12 Aug 2021 18:52:47 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"v5Qh6ZVJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628787167;\n\tbh=ldM25BW6pc6QgpkW3YWFgxB8a+1jnLuUKpXxZWRqAfc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=v5Qh6ZVJ93eHRSn+eoAnt8Xbv77rMy5ZCn8R7h0x79taX7T5DyhCb2zNnuTi1WGZj\n\tF/Yqh45Ub759Npc9yRwZe6fPP53FGeSIzryzq95w6MDiMFewPz0UVAdxMT34RcHBfk\n\tUlUwvbvZQoQ/JBUar+FfnWzfXs5kZ2SuHt4U4obA=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 12 Aug 2021 18:52:37 +0200","Message-Id":"<20210812165243.276977-5-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20210812165243.276977-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20210812165243.276977-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 04/10] ipa: ipu3: Introduce a prepare()\n\tcall to Algorithm","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"When a new ipu3_uapi_params buffer is ready, IPAIPU3 receives a\nEventFillParams. When this is called, the algorithms should fill every\nfield in the parameter structure they need to update.\n\nDemonstrate it by adding a loop on the prepare() call in IPAIPU3 and let\nthe Grid algorithm update the grid field.\nThis leads to removing this same update from the Awb algorithm.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/algorithm.h | 2 ++\n src/ipa/ipu3/algorithms/grid.cpp    | 6 ++++++\n src/ipa/ipu3/algorithms/grid.h      | 1 +\n src/ipa/ipu3/ipu3.cpp               | 3 +++\n src/ipa/ipu3/ipu3_awb.cpp           | 1 -\n 5 files changed, 12 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\nindex c1b37276..b571f55a 100644\n--- a/src/ipa/ipu3/algorithms/algorithm.h\n+++ b/src/ipa/ipu3/algorithms/algorithm.h\n@@ -26,6 +26,8 @@ public:\n \t{\n \t\treturn 0;\n \t}\n+\n+\tvirtual void prepare([[maybe_unused]] IPAContext &context, [[maybe_unused]] ipu3_uapi_params &params) {}\n };\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/ipa/ipu3/algorithms/grid.cpp b/src/ipa/ipu3/algorithms/grid.cpp\nindex 3578f41b..e42a760d 100644\n--- a/src/ipa/ipu3/algorithms/grid.cpp\n+++ b/src/ipa/ipu3/algorithms/grid.cpp\n@@ -78,6 +78,12 @@ int Grid::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n \treturn 0;\n }\n \n+void Grid::prepare(IPAContext &context, ipu3_uapi_params &params)\n+{\n+\t/* Update the IPU3 parameters with new calculated grid */\n+\tparams.acc_param.awb.config.grid = context.configuration.grid.bdsGrid;\n+}\n+\n } /* namespace ipa::ipu3::algorithms */\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/ipu3/algorithms/grid.h b/src/ipa/ipu3/algorithms/grid.h\nindex b4a51b42..89399bd2 100644\n--- a/src/ipa/ipu3/algorithms/grid.h\n+++ b/src/ipa/ipu3/algorithms/grid.h\n@@ -19,6 +19,7 @@ public:\n \t~Grid() = default;\n \n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n+\tvoid prepare(IPAContext &context, ipu3_uapi_params &params) override;\n };\n \n } /* namespace ipa::ipu3::algorithms */\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex ef7fec86..394a7a45 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -305,6 +305,9 @@ void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n \n void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n {\n+\tfor (auto const &algo : algorithms_)\n+\t\talgo->prepare(context_, params_);\n+\n \tif (agcAlgo_->updateControls())\n \t\tawbAlgo_->updateWbParameters(params_, agcAlgo_->gamma());\n \ndiff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp\nindex 4ee5ee6f..911760b3 100644\n--- a/src/ipa/ipu3/ipu3_awb.cpp\n+++ b/src/ipa/ipu3/ipu3_awb.cpp\n@@ -159,7 +159,6 @@ void IPU3Awb::initialise(ipu3_uapi_params &params, const Size &bdsOutputSize, st\n \tparams.acc_param.awb.config.rgbs_thr_r = 8191;\n \tparams.acc_param.awb.config.rgbs_thr_gb = 8191;\n \tparams.acc_param.awb.config.rgbs_thr_b = 8191 | IPU3_UAPI_AWB_RGBS_THR_B_EN | IPU3_UAPI_AWB_RGBS_THR_B_INCL_SAT;\n-\tparams.acc_param.awb.config.grid = bdsGrid;\n \tawbGrid_ = bdsGrid;\n \n \tparams.use.acc_bnr = 1;\n","prefixes":["libcamera-devel","v2","04/10"]}