Patch Detail
Show a patch.
GET /api/patches/17327/?format=api
{ "id": 17327, "url": "https://patchwork.libcamera.org/api/patches/17327/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17327/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220908014200.28728-19-laurent.pinchart@ideasonboard.com>", "date": "2022-09-08T01:41:46", "name": "[libcamera-devel,v4,18/32] ipa: rkisp1: Use frame number passed to Algorithm::prepare()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "13c1c5997e7b3f1971a296f7761b2f683e92d8b3", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17327/mbox/", "series": [ { "id": 3476, "url": "https://patchwork.libcamera.org/api/series/3476/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3476", "date": "2022-09-08T01:41:28", "name": "ipa: Frame context queue, IPU3 & RkISP consolidation, and RkISP1 improvements", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3476/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17327/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17327/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 C8309C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 8 Sep 2022 01:42:45 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 753DB620DF;\n\tThu, 8 Sep 2022 03:42:45 +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 41F2E620D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 8 Sep 2022 03:42:43 +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 BB29C6CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 8 Sep 2022 03:42:42 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662601365;\n\tbh=3v11PVcUtrPKZMP+rWuEgyvaNHa3x3/J5D0Re907CSc=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=k5GNpP05j5H6RltVT7R1OjFj9X0yvqX2ieNKvcI6NfM1srD+vWW7bsgpLCyWfFIGF\n\tkv3IZRrs3rI+QN3aumf+sAZV4sfoPIYtFTWTWU7Sm4WC6HSTflvI1JVEpmjuSzGiC6\n\tV1/OTGeRx4DmDS7q7DgkcN2iNg5gmW64XDrRnCgkSh8yRoWFeuD/980AJUdLNx9Qxs\n\tP5x8x+r22uI/fnS6OaYoQuyoISGvVY8nNnC6HQleSUg02sCysFMxNNJO2k842aH/ks\n\tND/ed7VIjvcoqKNi4L5KC7Ld9CGhZc7iW04qYnZVkZaGGbOCry0nkISIdEVGgj2ORb\n\tQsTeJbR3umATA==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662601363;\n\tbh=3v11PVcUtrPKZMP+rWuEgyvaNHa3x3/J5D0Re907CSc=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=wZG7RgUlfKjt4Emoh8XLhuOZR1zp5mPN0PmOgbJHrKUDZZa9TFCTz27ElWhoLfxpl\n\tcbd6wQosg2yXQxbNxcqiTL+t5zyH0Dy1FeSHk9RgUGsTMybH6SKjqehJU7+tejibEd\n\tfLhjenOh1MvD9Q8aTN1Vz5sWJJCQh4W8ilaghdx8=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"wZG7RgUl\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 8 Sep 2022 04:41:46 +0300", "Message-Id": "<20220908014200.28728-19-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>", "References": "<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 18/32] ipa: rkisp1: Use frame number\n\tpassed to Algorithm::prepare()", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Now that the Algorithm::prepare() function takes a frame number, we can\nuse it to replace the IPAActiveState::frameCount member.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/agc.cpp | 5 ++---\n src/ipa/rkisp1/algorithms/awb.cpp | 5 ++---\n src/ipa/rkisp1/algorithms/blc.cpp | 6 +++---\n src/ipa/rkisp1/algorithms/dpcc.cpp | 6 +++---\n src/ipa/rkisp1/algorithms/dpf.cpp | 4 ++--\n src/ipa/rkisp1/algorithms/gsl.cpp | 6 +++---\n src/ipa/rkisp1/algorithms/lsc.cpp | 5 ++---\n src/ipa/rkisp1/ipa_context.cpp | 9 ---------\n src/ipa/rkisp1/ipa_context.h | 2 --\n src/ipa/rkisp1/rkisp1.cpp | 3 ---\n 10 files changed, 17 insertions(+), 34 deletions(-)", "diff": "diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex e9fab0222ac3..4124c3272bc7 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -326,12 +326,11 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void Agc::prepare(IPAContext &context,\n-\t\t [[maybe_unused]] const uint32_t frame,\n+void Agc::prepare(IPAContext &context, const uint32_t frame,\n \t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t rkisp1_params_cfg *params)\n {\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \t/* Configure the measurement window. */\ndiff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex d3e9aa5334cf..a0bbe5cb8afa 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -74,8 +74,7 @@ uint32_t Awb::estimateCCT(double red, double green, double blue)\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void Awb::prepare(IPAContext &context,\n-\t\t [[maybe_unused]] const uint32_t frame,\n+void Awb::prepare(IPAContext &context, const uint32_t frame,\n \t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t rkisp1_params_cfg *params)\n {\n@@ -88,7 +87,7 @@ void Awb::prepare(IPAContext &context,\n \tparams->module_cfg_update |= RKISP1_CIF_ISP_MODULE_AWB_GAIN;\n \n \t/* If we already have configured the gains and window, return. */\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \t/* Configure the gains to apply. */\ndiff --git a/src/ipa/rkisp1/algorithms/blc.cpp b/src/ipa/rkisp1/algorithms/blc.cpp\nindex c4aea0e828ca..500ce94294a2 100644\n--- a/src/ipa/rkisp1/algorithms/blc.cpp\n+++ b/src/ipa/rkisp1/algorithms/blc.cpp\n@@ -65,12 +65,12 @@ int BlackLevelCorrection::init([[maybe_unused]] IPAContext &context,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void BlackLevelCorrection::prepare(IPAContext &context,\n-\t\t\t\t [[maybe_unused]] const uint32_t frame,\n+void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,\n+\t\t\t\t const uint32_t frame,\n \t\t\t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t\t\t rkisp1_params_cfg *params)\n {\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \tif (!tuningParameters_)\ndiff --git a/src/ipa/rkisp1/algorithms/dpcc.cpp b/src/ipa/rkisp1/algorithms/dpcc.cpp\nindex b61eee022a68..f59d48180eb5 100644\n--- a/src/ipa/rkisp1/algorithms/dpcc.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpcc.cpp\n@@ -258,12 +258,12 @@ int DefectPixelClusterCorrection::init([[maybe_unused]] IPAContext &context,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void DefectPixelClusterCorrection::prepare(IPAContext &context,\n-\t\t\t\t\t [[maybe_unused]] const uint32_t frame,\n+void DefectPixelClusterCorrection::prepare([[maybe_unused]] IPAContext &context,\n+\t\t\t\t\t const uint32_t frame,\n \t\t\t\t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t\t\t\t rkisp1_params_cfg *params)\n {\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \tif (!initialized_)\ndiff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nindex 8eafbbf85124..94c35c36570c 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -207,7 +207,7 @@ void Dpf::queueRequest(IPAContext &context,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n+void Dpf::prepare(IPAContext &context, const uint32_t frame,\n \t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t rkisp1_params_cfg *params)\n {\n@@ -216,7 +216,7 @@ void Dpf::prepare(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \n \tauto &dpf = context.activeState.dpf;\n \n-\tif (context.activeState.frameCount == 0) {\n+\tif (frame == 0) {\n \t\tparams->others.dpf_config = config_;\n \t\tparams->others.dpf_strength_config = strengthConfig_;\n \ndiff --git a/src/ipa/rkisp1/algorithms/gsl.cpp b/src/ipa/rkisp1/algorithms/gsl.cpp\nindex ed3104c98e48..44303594bd47 100644\n--- a/src/ipa/rkisp1/algorithms/gsl.cpp\n+++ b/src/ipa/rkisp1/algorithms/gsl.cpp\n@@ -118,12 +118,12 @@ int GammaSensorLinearization::init([[maybe_unused]] IPAContext &context,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void GammaSensorLinearization::prepare(IPAContext &context,\n-\t\t\t\t [[maybe_unused]] const uint32_t frame,\n+void GammaSensorLinearization::prepare([[maybe_unused]] IPAContext &context,\n+\t\t\t\t const uint32_t frame,\n \t\t\t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t\t\t rkisp1_params_cfg *params)\n {\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \tif (!initialized_)\ndiff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\nindex ed5b988599b8..20111c342bb3 100644\n--- a/src/ipa/rkisp1/algorithms/lsc.cpp\n+++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n@@ -132,12 +132,11 @@ int LensShadingCorrection::configure(IPAContext &context,\n /**\n * \\copydoc libcamera::ipa::Algorithm::prepare\n */\n-void LensShadingCorrection::prepare(IPAContext &context,\n-\t\t\t\t [[maybe_unused]] const uint32_t frame,\n+void LensShadingCorrection::prepare(IPAContext &context, const uint32_t frame,\n \t\t\t\t [[maybe_unused]] RkISP1FrameContext &frameContext,\n \t\t\t\t rkisp1_params_cfg *params)\n {\n-\tif (context.activeState.frameCount > 0)\n+\tif (frame > 0)\n \t\treturn;\n \n \tif (!initialized_)\ndiff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\nindex 80fae271a6dc..211428717838 100644\n--- a/src/ipa/rkisp1/ipa_context.cpp\n+++ b/src/ipa/rkisp1/ipa_context.cpp\n@@ -192,15 +192,6 @@ namespace libcamera::ipa::rkisp1 {\n * \\brief Analogue gain multiplier\n */\n \n-/**\n- * \\var IPAActiveState::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-\n /**\n * \\struct RkISP1FrameContext\n * \\brief Per-frame context for algorithms\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex 9d89cf0160fc..4e38ef40ed3c 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -87,8 +87,6 @@ struct IPAActiveState {\n \t\tuint32_t exposure;\n \t\tdouble gain;\n \t} sensor;\n-\n-\tunsigned int frameCount;\n };\n \n struct RkISP1FrameContext : public FrameContext {\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 538401ac89ac..4f6e0b0f87b9 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -261,8 +261,6 @@ 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_.activeState.frameCount = 0;\n-\n \tfor (auto const &algo : algorithms()) {\n \t\tint ret = algo->configure(context_, info);\n \t\tif (ret)\n@@ -325,7 +323,6 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)\n \t\talgo->prepare(context_, frame, frameContext, params);\n \n \tparamsBufferReady.emit(frame);\n-\tcontext_.activeState.frameCount++;\n }\n \n void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId,\n", "prefixes": [ "libcamera-devel", "v4", "18/32" ] }