Show a patch.

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

{
    "id": 24522,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24522/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24522/",
    "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": "<20250930122726.1837524-24-stefan.klug@ideasonboard.com>",
    "date": "2025-09-30T12:26:44",
    "name": "[v1,23/33] libcamera: rkisp1: Implement dw100 specific features",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "1535f7b8264941b88e65577f8dca38d5c67c016c",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/24522/mbox/",
    "series": [
        {
            "id": 5468,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5468/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5468",
            "date": "2025-09-30T12:26:21",
            "name": "Full dewarper support on imx8mp",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5468/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24522/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24522/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 36EB2C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Sep 2025 13:22:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40A9E6B5FB;\n\tTue, 30 Sep 2025 15:22:25 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 54D1162C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Sep 2025 15:22:23 +0200 (CEST)",
            "from ideasonboard.com (unknown [94.31.94.171])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id B326416A;\n\tTue, 30 Sep 2025 15:20:54 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sFerUjzC\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759238454;\n\tbh=7gVhXc/6VudosqCazp5WIjZFQ5QB+EbIqSMNrUWXtLQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=sFerUjzCU0he9WntMzFEOZwAy3vFR/Go5F0Xx4pXJNuyMnpkzbaWNJBhuh1nXjQo1\n\tfEU/p15RMS6XV7tqzDsb5kbFgnqF9uriKEQcQMW5z0Ltr5CcCCwmMnT/kE7e+/uzQe\n\t7qfJP4vSKwx5dqffECzQwonbBpYzw3hXVI7xwsJs=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures",
        "Date": "Tue, 30 Sep 2025 14:26:44 +0200",
        "Message-ID": "<20250930122726.1837524-24-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.48.1",
        "In-Reply-To": "<20250930122726.1837524-1-stefan.klug@ideasonboard.com>",
        "References": "<20250930122726.1837524-1-stefan.klug@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": "The dw100 allows more features implemented in the dw100 vertex map.\nImplement these features for the rkisp1 pipeline.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n 2 files changed, 85 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\nindex 03309eeac34f..10ee68db6d8c 100644\n--- a/src/libcamera/control_ids_draft.yaml\n+++ b/src/libcamera/control_ids_draft.yaml\n@@ -206,7 +206,44 @@ controls:\n             available only on this camera device are at least this numeric\n             value. All of the custom test patterns will be static (that is the\n             raw image must not vary from frame to frame).\n-\n+  - Dw100ScaleMode:\n+      type: int32_t\n+      direction: inout\n+      description: |\n+        Scale mode of the dewarper.\n+      enum:\n+        - name: Fill\n+          value: 0\n+          description: |\n+            Fills the given output size with the largest rectangle possible. \n+            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are \n+            ignored.\n+        - name: Crop\n+          value: 1\n+          description: |\n+            Crops to the given output size. The scale factor can be specified \n+            using Dw100Scale. Aspect ratio is preserved.\n+  - Dw100Scale:\n+      type: float\n+      direction: inout\n+      description: |\n+        Scale factor applied to the image when Dw100ScaleMode is set to Crop. \n+        This value is clamped, so that all pixels have valid input data. \n+        Therefore a value of 0 always provides the largest possible field of \n+        view.\n+  - Dw100Rotation:\n+      type: float\n+      direction: inout\n+      description: |\n+        Rotates the image by the given angle in degrees.\n+  - Dw100Offset:\n+      type: Point\n+      direction: inout\n+      description: |\n+        Moves the image by the given values in x and y direction in output \n+        coordinate space. This is clamped, so that all output pixels contain \n+        valid data. The offset is therefore ignored when Dw100ScaleMode is set \n+        to 'Fit' or the Dw100Scale value is too small.\n   - FaceDetectMode:\n       type: int32_t\n       direction: inout\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 8b78c7f213f6..740791ac9c02 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -1364,6 +1364,17 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n \t\t\t\t\t\t\t      scalerMaxCrop_);\n \t\tdata->properties_.set(properties::ScalerCropMaximum, scalerMaxCrop_);\n \t\tactiveCrop_ = scalerMaxCrop_;\n+\n+\t\tif (dewarper_->supportsRequests()) {\n+\t\t\tcontrols[&controls::draft::Dw100Scale] = ControlInfo(0.2f, 8.0f, 1.0f);\n+\t\t\tcontrols[&controls::draft::Dw100Rotation] = ControlInfo(-180.0f, 180.0f, 0.0f);\n+\t\t\tcontrols[&controls::draft::Dw100Offset] = ControlInfo(Point(-10000, -10000), Point(10000, 10000), Point(0, 0));\n+\t\t\tcontrols[&controls::draft::Dw100ScaleMode] = ControlInfo(controls::draft::Dw100ScaleModeValues, controls::draft::Fill);\n+\t\t} else {\n+\t\t\tLOG(RkISP1, Warning)\n+\t\t\t\t<< \"dw100 kernel driver has no requests support.\"\n+\t\t\t\t   \" No dynamic configuration possible.\";\n+\t\t}\n \t}\n \n \t/* Add the IPA registered controls to list of camera controls. */\n@@ -1637,6 +1648,37 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \t\tavailableDewarpRequests_.pop();\n \t}\n \n+\tbool update = false;\n+\tauto &vertexMap = dewarper_->vertexMap(&data->mainPathStream_);\n+\n+\tconst auto &scale = request->controls().get(controls::draft::Dw100Scale);\n+\tif (scale) {\n+\t\tvertexMap.setScale(*scale);\n+\t\tupdate = true;\n+\t}\n+\n+\tconst auto &rotation = request->controls().get(controls::draft::Dw100Rotation);\n+\tif (rotation) {\n+\t\tvertexMap.setRotation(*rotation);\n+\t\tupdate = true;\n+\t}\n+\n+\tconst auto &offset = request->controls().get(controls::draft::Dw100Offset);\n+\tif (offset) {\n+\t\tvertexMap.setOffset(*offset);\n+\t\tupdate = true;\n+\t}\n+\n+\tconst auto &scaleMode = request->controls().get(controls::draft::Dw100ScaleMode);\n+\tif (scaleMode) {\n+\t\tvertexMap.setMode(static_cast<Dw100VertexMap::ScaleMode>(*scaleMode));\n+\t\tupdate = true;\n+\t}\n+\n+\tif (update || info->frame == 0) {\n+\t\tdewarper_->applyVertexMap(&data->mainPathStream_, dewarpRequest);\n+\t}\n+\n \t/* Handle scaler crop control. */\n \tconst auto &crop = request->controls().get(controls::ScalerCrop);\n \tif (crop) {\n@@ -1700,7 +1742,11 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \t\t}\n \t}\n \n-\trequest->metadata().set(controls::ScalerCrop, activeCrop_.value());\n+\tauto &meta = request->metadata();\n+\tmeta.set(controls::draft::Dw100Scale, vertexMap.effectiveScale());\n+\tmeta.set(controls::draft::Dw100Rotation, vertexMap.rotation());\n+\tmeta.set(controls::draft::Dw100Offset, vertexMap.effectiveOffset());\n+\tmeta.set(controls::ScalerCrop, activeCrop_.value());\n }\n \n void PipelineHandlerRkISP1::dewarpRequestReady(V4L2Request *request)\n",
    "prefixes": [
        "v1",
        "23/33"
    ]
}