Show a patch.

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

{
    "id": 24510,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24510/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24510/",
    "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-12-stefan.klug@ideasonboard.com>",
    "date": "2025-09-30T12:26:32",
    "name": "[v1,11/33] libcamera: rkisp1: Properly cancel buffers in dewarp case",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e1ebedcdbf962f7f7a1d59c2ed0538db592e3d45",
    "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/24510/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/24510/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24510/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 F1016C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Sep 2025 12:54:54 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F11536B5F0;\n\tTue, 30 Sep 2025 14:54:53 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 145A462C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Sep 2025 14:54:52 +0200 (CEST)",
            "from ideasonboard.com (unknown [94.31.94.171])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A48ED220;\n\tTue, 30 Sep 2025 14:53:23 +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=\"hwZ/71/z\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759236803;\n\tbh=W9XQr5DS9xpvqVy+l0tC4HVURPUlRbZztdIcGOjy87c=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hwZ/71/zdZZLmeQ7iJGntfBFvWVmq7avdrVAgxBrJ76ENfLBaPopBytDqyfIkwAvn\n\t0ijJwupx1pUYlG/KcVDncN5OavdN9m5M85IEshvkVS1w3UcteezgRY61ztNLeACPgm\n\t2Q00oONqFks4c2hfjIMqERiIWiMpHOnBVkh+SL2g=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v1 11/33] libcamera: rkisp1: Properly cancel buffers in\n\tdewarp case",
        "Date": "Tue, 30 Sep 2025 14:26:32 +0200",
        "Message-ID": "<20250930122726.1837524-12-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": "In case the buffer returned from the ISP was canceled, the upstream\nbuffer was not correctly marked as canceled. Move the cancel\nfunctionality into an own helper function and correctly cancel the\nupstream buffers. Add missing cancellation in case queuing to the\ndewarper fails.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++---------\n 1 file changed, 31 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 6048f028000a..d5790864d026 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -208,6 +208,7 @@ private:\n \tint initLinks(Camera *camera, const RkISP1CameraConfiguration &config);\n \tint createCamera(MediaEntity *sensor);\n \tvoid tryCompleteRequest(RkISP1FrameInfo *info);\n+\tvoid cancelDewarpRequest(RkISP1FrameInfo *info);\n \tvoid imageBufferReady(FrameBuffer *buffer);\n \tvoid paramBufferReady(FrameBuffer *buffer);\n \tvoid statBufferReady(FrameBuffer *buffer);\n@@ -1526,6 +1527,31 @@ void PipelineHandlerRkISP1::tryCompleteRequest(RkISP1FrameInfo *info)\n \tcompleteRequest(request);\n }\n \n+void PipelineHandlerRkISP1::cancelDewarpRequest(RkISP1FrameInfo *info)\n+{\n+\tRkISP1CameraData *data = cameraData(activeCamera_);\n+\tRequest *request = info->request;\n+\t/*\n+\t * i.MX8MP is the only known platform with dewarper. It has\n+\t * no self path. Hence, only main path buffer completion is\n+\t * required.\n+\t *\n+\t * Also, we cannot completeBuffer(request, buffer) as buffer\n+\t * here, is an internal buffer (between ISP and dewarper) and\n+\t * is not associated to the any specific request. The request\n+\t * buffer associated with main path stream is the one that\n+\t * is required to be completed (not the internal buffer).\n+\t */\n+\tfor (auto [stream, buffer] : request->buffers()) {\n+\t\tif (stream == &data->mainPathStream_) {\n+\t\t\tbuffer->_d()->cancel();\n+\t\t\tcompleteBuffer(request, buffer);\n+\t\t}\n+\t}\n+\n+\ttryCompleteRequest(info);\n+}\n+\n void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n {\n \tASSERT(activeCamera_);\n@@ -1567,23 +1593,7 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \n \t/* Do not queue cancelled frames to dewarper. */\n \tif (metadata.status == FrameMetadata::FrameCancelled) {\n-\t\t/*\n-\t\t * i.MX8MP is the only known platform with dewarper. It has\n-\t\t * no self path. Hence, only main path buffer completion is\n-\t\t * required.\n-\t\t *\n-\t\t * Also, we cannot completeBuffer(request, buffer) as buffer\n-\t\t * here, is an internal buffer (between ISP and dewarper) and\n-\t\t * is not associated to the any specific request. The request\n-\t\t * buffer associated with main path stream is the one that\n-\t\t * is required to be completed (not the internal buffer).\n-\t\t */\n-\t\tfor (auto it : request->buffers()) {\n-\t\t\tif (it.first == &data->mainPathStream_)\n-\t\t\t\tcompleteBuffer(request, it.second);\n-\t\t}\n-\n-\t\ttryCompleteRequest(info);\n+\t\tcancelDewarpRequest(info);\n \t\treturn;\n \t}\n \n@@ -1641,6 +1651,8 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \t\tif (dewarpRequest)\n \t\t\tdewarpRequestReady(dewarpRequest);\n \n+\t\tcancelDewarpRequest(info);\n+\n \t\treturn;\n \t}\n \n@@ -1651,6 +1663,8 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n \t\t\t\t\t   << strerrorname_np(-ret);\n \t\t\t/* Push it back into the queue. */\n \t\t\tdewarpRequestReady(dewarpRequest);\n+\n+\t\t\tcancelDewarpRequest(info);\n \t\t}\n \t}\n \n",
    "prefixes": [
        "v1",
        "11/33"
    ]
}