Show a patch.

GET /api/1.1/patches/24867/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 24867,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24867/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24867/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20251028170847.2673396-15-rui.wang@ideasonboard.com>",
    "date": "2025-10-28T17:08:44",
    "name": "[v1,15/16] 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/1.1/people/241/?format=api",
        "name": "Rui Wang",
        "email": "rui.wang@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24867/mbox/",
    "series": [
        {
            "id": 5539,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5539/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5539",
            "date": "2025-10-28T17:08:30",
            "name": "[v1,01/16] ipa: rkisp1: algorithms: add Denoise base class shell",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5539/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24867/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24867/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 E0C96BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Oct 2025 17:09:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7973B60869;\n\tTue, 28 Oct 2025 18:09:29 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2972D6082B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Oct 2025 18:09:23 +0100 (CET)",
            "from rui-Precision-7560.local (unknown [209.216.122.90])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 39EF01AED;\n\tTue, 28 Oct 2025 18:07:34 +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=\"eDDB3MAB\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761671254;\n\tbh=d0nvt/XBK0ElIAIDPInJJPHFSpfeojs94gqBvNzvrqs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=eDDB3MABaKAm63IL3X5lYOJO9ZqXBaBO//WTWvB3uLf7S/rWRMdSRkqLiNl3bJplq\n\tsrdhxhCFupOTzCqX+L5tuBzVhPX9YZjgE6VouRNXyRHFY/X61zy775t2EGtlMaLG1S\n\tAorMDUA10dhaTbVU9LXRVS3KuoFIfMRyAxYwq47Y=",
        "From": "Rui Wang <rui.wang@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Rui Wang <rui.wang@ideasonboard.com>",
        "Subject": "[PATCH v1 15/16] ipa: rkisp1: algorithms: dpf: expose DPF control\n\tmap",
        "Date": "Tue, 28 Oct 2025 13:08:44 -0400",
        "Message-ID": "<20251028170847.2673396-15-rui.wang@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20251028170847.2673396-1-rui.wang@ideasonboard.com>",
        "References": "<20251028170847.2673396-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 dfef2f91..0bbcc9be 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/16"
    ]
}