Patch Detail
Show a patch.
GET /api/patches/17430/?format=api
{ "id": 17430, "url": "https://patchwork.libcamera.org/api/patches/17430/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17430/", "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": "<20220927023642.12341-20-laurent.pinchart@ideasonboard.com>", "date": "2022-09-27T02:36:28", "name": "[libcamera-devel,v5,19/33] ipa: rkisp1: Use frame number passed to Algorithm::prepare()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "8e7a8c8cc3b6486de4b4ba5a6824b5582034b20b", "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/17430/mbox/", "series": [ { "id": 3506, "url": "https://patchwork.libcamera.org/api/series/3506/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3506", "date": "2022-09-27T02:36:09", "name": "ipa: Frame context queue, IPU3 & RkISP consolidation, and RkISP1 improvements", "version": 5, "mbox": "https://patchwork.libcamera.org/series/3506/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17430/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17430/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 19062C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Sep 2022 02:37:30 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0EF9622A4;\n\tTue, 27 Sep 2022 04:37:29 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BD21622A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Sep 2022 04:37:27 +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 D50A5E5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Sep 2022 04:37:26 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664246249;\n\tbh=1ZTMVZVGzQtgvJ31xn75MgNd1NZ0xA5ltcPWjKkZ88Q=;\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=rGCRvgyZzeXGzWX4KWPxBM/3SC3ovlTjgQPsU19tfYcE6vIU7vbuiOIaHVyOuGdP0\n\tlNKMAH7uNQ/vNg4Ivu8pQzGB+CZZXPAms5wRUCOqmYbUfbmhXruz/KpkFXcAP/K5jf\n\tazFElLeOYJMMh/F2u+sfSpaLkACbUPWfm+K3VAO9fIABsznLLD2xTYA/ZNybkgRq0g\n\t97wnAFX3qaJ4Oy6bGQSJvVMHwkDqCgcVISFzAe6MzeJ2NVxvuahaStfvxVeD95+LAc\n\tFn5eOrUgoQWjrDBzYcap3N0QVF+fGPsDaqTpE52S2RQa32llhbC+E/ffNo4ih8dcA9\n\tmP0oYew1CCPmQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664246247;\n\tbh=1ZTMVZVGzQtgvJ31xn75MgNd1NZ0xA5ltcPWjKkZ88Q=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=JprMLA/evL/s8YF0PK8rL3EY9o4PyjkdSQRLsdHJ6QS5BVOVSU//8J5X8CDO8uRiY\n\tM3e1tr+k9xrqnZ+D2cJ3IE4CUNEdeWpQDPb9IElkApte61GRDH8zFNfJeZPvGv4FNy\n\tXJe8/AvEfXejaLel+Q7EG+uWsGATa3G+i4PUaTiw=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JprMLA/e\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 27 Sep 2022 05:36:28 +0300", "Message-Id": "<20220927023642.12341-20-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220927023642.12341-1-laurent.pinchart@ideasonboard.com>", "References": "<20220927023642.12341-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v5 19/33] 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>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\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 7219cc5c37ab..87fc5d1ffec7 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -327,12 +327,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]] IPAFrameContext &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 2bd9ef779bc3..78398927e462 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]] IPAFrameContext &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 0f7226cf217d..15324fb11861 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]] IPAFrameContext &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 7c14ace0abee..53aa1d93e42b 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]] IPAFrameContext &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 b8c837c21243..b8d0c7b85639 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]] IPAFrameContext &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 879ca2973e8a..9cbad02038c4 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]] IPAFrameContext &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 9c717bc5f99e..44245caa705e 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]] IPAFrameContext &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 e9846742ee4f..78a785f5f982 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 IPAFrameContext\n * \\brief Per-frame context for algorithms\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex 9a84b7adda45..c7041ea2a214 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -88,8 +88,6 @@ struct IPAActiveState {\n \t\tuint32_t exposure;\n \t\tdouble gain;\n \t} sensor;\n-\n-\tunsigned int frameCount;\n };\n \n struct IPAFrameContext : public FrameContext {\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex b7c1ecfee4c8..5409c2d5219e 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -259,8 +259,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@@ -323,7 +321,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", "v5", "19/33" ] }