Patch Detail
Show a patch.
GET /api/patches/24885/?format=api
{ "id": 24885, "url": "https://patchwork.libcamera.org/api/patches/24885/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24885/", "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": "<20251028211751.2761420-15-rui.wang@ideasonboard.com>", "date": "2025-10-28T21:17:48", "name": "[v1,15/17] ipa: rkisp1: algorithms: dpf: expose DPF control map", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "07720678d8e3308459d6c5edc5fc0b9b84810598", "submitter": { "id": 241, "url": "https://patchwork.libcamera.org/api/people/241/?format=api", "name": "Rui Wang", "email": "rui.wang@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24885/mbox/", "series": [ { "id": 5542, "url": "https://patchwork.libcamera.org/api/series/5542/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5542", "date": "2025-10-28T21:17:34", "name": "[v1,01/17] ipa: rkisp1: algorithms: add Denoise base class shell", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5542/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24885/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24885/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 ABA4EBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Oct 2025 21:18:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5CE3D60877;\n\tTue, 28 Oct 2025 22:18:59 +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 D42AC60883\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Oct 2025 22:18:55 +0100 (CET)", "from rui-Precision-7560.local (unknown [209.216.122.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7840F1864;\n\tTue, 28 Oct 2025 22:17:06 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"inIvD9I0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761686227;\n\tbh=73DZhhr9Oc3haxy/EfonptYIeR7fwDWTvkhUFYfGWn4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=inIvD9I0qY1Cx+hjX40LWbocgaMa0GWeE5zR40CVdbvTkzJ6zKVGiuFjZLJY2ESt4\n\to1cKp17nG+mjlT4Z663SoEKA/6Z8e8E4c9p4Okxcva3X7y7XzR888KH8Rk1nOtirRS\n\tv0yCBf4OQ8+mquWu8YEG7zGuQsUrMFyorpdSO8ro=", "From": "Rui Wang <rui.wang@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Rui Wang <rui.wang@ideasonboard.com>", "Subject": "[PATCH v1 15/17] ipa: rkisp1: algorithms: dpf: expose DPF control\n\tmap", "Date": "Tue, 28 Oct 2025 17:17:48 -0400", "Message-ID": "<20251028211751.2761420-15-rui.wang@ideasonboard.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20251028211751.2761420-1-rui.wang@ideasonboard.com>", "References": "<20251028211751.2761420-1-rui.wang@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Implement getControlMap() to provide the RkISP1 DPF controls with tuning-\nderived defaults. The map includes:\n- DpfEnable (master enable toggle)\n- DpfMode (auto/manual mode selection)\n- DpfChannelStrengths (R/G/B strength values)\n- Developer mode controls when enabled:\n - Spatial coefficients (green and RB)\n - RB filter size (9x9 or 13x9)\n - NLL coefficients and scale mode\n- DpfIso (read-only ISO indicator)\n\nThis control map is registered during init() to expose DPF controls to\napplications.\n\nSigned-off-by: Rui Wang <rui.wang@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/denoise.h | 2 ++\n src/ipa/rkisp1/algorithms/dpf.cpp | 29 +++++++++++++++++++++++++++\n src/ipa/rkisp1/algorithms/dpf.h | 2 ++\n src/libcamera/control_ids_rkisp1.yaml | 8 ++++++++\n 4 files changed, 41 insertions(+)", "diff": "diff --git a/src/ipa/rkisp1/algorithms/denoise.h b/src/ipa/rkisp1/algorithms/denoise.h\nindex e2bedc41..53a0b642 100644\n--- a/src/ipa/rkisp1/algorithms/denoise.h\n+++ b/src/ipa/rkisp1/algorithms/denoise.h\n@@ -60,6 +60,8 @@ protected:\n \tvirtual void prepareManualMode(IPAContext &context, const uint32_t frame,\n \t\t\t\t IPAFrameContext &frameContext, RkISP1Params *params) = 0;\n \n+\tvirtual ControlInfoMap::Map getControlMap() const = 0;\n+\n private:\n \tbool manualMode_ = false; /**< Current manual/auto mode state */\n \tbool devMode_ = false; /**< Developer mode state for advanced controls */\ndiff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp\nindex c4597932..59c3559e 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.cpp\n+++ b/src/ipa/rkisp1/algorithms/dpf.cpp\n@@ -507,6 +507,35 @@ void Dpf::logConfigIfChanged(unsigned iso, int isoIndex, bool anyOverride, const\n \thaveLast = true;\n }\n \n+ControlInfoMap::Map Dpf::getControlMap() const\n+{\n+\tControlInfoMap::Map map;\n+\tmap[&controls::rkisp1::DpfEnable] = ControlInfo(false, true, enableDpf_);\n+\tmap[&controls::rkisp1::DpfMode] = ControlInfo(controls::rkisp1::DpfModeValues, ControlValue(controls::rkisp1::DpfModeAuto));\n+\tstd::array<int32_t, 3> strengthDefault = { static_cast<int32_t>(baseStrengthConfig_.r), static_cast<int32_t>(baseStrengthConfig_.g), static_cast<int32_t>(baseStrengthConfig_.b) };\n+\tmap[&controls::rkisp1::DpfChannelStrengths] = ControlInfo(0, 255, Span<const int32_t, 3>(strengthDefault));\n+\tif (isDevMode()) {\n+\t\tstd::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS> greenCoeffs;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i)\n+\t\t\tgreenCoeffs[i] = baseConfig_.g_flt.spatial_coeff[i];\n+\t\tmap[&controls::rkisp1::DpfGreenSpatialCoefficients] = ControlInfo(0, 63, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS>(greenCoeffs));\n+\t\tstd::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS> rbCoeffs;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS; ++i)\n+\t\t\trbCoeffs[i] = baseConfig_.rb_flt.spatial_coeff[i];\n+\t\tmap[&controls::rkisp1::DpfRedBlueSpatialCoefficients] = ControlInfo(0, 63, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS>(rbCoeffs));\n+\t\tint32_t rbSizeDefault = (baseConfig_.rb_flt.fltsize == RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9) ? 1 : 0;\n+\t\tmap[&controls::rkisp1::DpfRbFilterSize] = ControlInfo(controls::rkisp1::DpfRbFilterSizeValues, ControlValue(rbSizeDefault));\n+\t\tstd::array<int32_t, RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS> nllCoeffs;\n+\t\tfor (unsigned i = 0; i < RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS; ++i)\n+\t\t\tnllCoeffs[i] = baseConfig_.nll.coeff[i];\n+\t\tmap[&controls::rkisp1::DpfNoiseLevelLookupCoefficients] = ControlInfo(0, 1023, Span<const int32_t, RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS>(nllCoeffs));\n+\t\tint32_t scaleModeDefault = (baseConfig_.nll.scale_mode == RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC) ? 1 : 0;\n+\t\tmap[&controls::rkisp1::DpfNoiseLevelLookupScaleMode] = ControlInfo(controls::rkisp1::DpfNoiseLevelLookupScaleModeValues, ControlValue(scaleModeDefault));\n+\t}\n+\tmap[&controls::rkisp1::DpfIso] = ControlInfo(0, 3200, 0);\n+\treturn map;\n+}\n+\n /**\n * \\copydoc libcamera::ipa::Algorithm::queueRequest\n */\ndiff --git a/src/ipa/rkisp1/algorithms/dpf.h b/src/ipa/rkisp1/algorithms/dpf.h\nindex d84ba45f..5db50143 100644\n--- a/src/ipa/rkisp1/algorithms/dpf.h\n+++ b/src/ipa/rkisp1/algorithms/dpf.h\n@@ -111,6 +111,8 @@ private:\n \n \tvoid prepareManualMode(IPAContext &context, const uint32_t frame,\n \t\t\t IPAFrameContext &frameContext, RkISP1Params *params) override;\n+\n+\tControlInfoMap::Map getControlMap() const override;\n };\n \n } /* namespace ipa::rkisp1::algorithms */\ndiff --git a/src/libcamera/control_ids_rkisp1.yaml b/src/libcamera/control_ids_rkisp1.yaml\nindex 78b95447..af95a753 100644\n--- a/src/libcamera/control_ids_rkisp1.yaml\n+++ b/src/libcamera/control_ids_rkisp1.yaml\n@@ -121,5 +121,13 @@ controls:\n - name: DpfModeManual\n value: 1\n description: Manual mode - parameters are frozen and can be overridden.\n+ \n+ - DpfIso:\n+ type: int32_t\n+ direction: out\n+ description: |\n+ Estimated scene ISO value used for DPF tuning selection. Derived\n+ from analogue gain (approx ISO = gain * 100). Provided each frame\n+ for client awareness and debugging. Range 0..409600.\n \n ...\n", "prefixes": [ "v1", "15/17" ] }