Show a patch.

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

{
    "id": 24507,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/24507/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24507/",
    "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-9-stefan.klug@ideasonboard.com>",
    "date": "2025-09-30T12:26:29",
    "name": "[v1,08/33] libcamera: converter_v4l2_m2m: Add suport for V4L2 requests",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ed0603e16d8c73ec01b7fb3d2b368edb79f6ce11",
    "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/24507/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/24507/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24507/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 F392FC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Sep 2025 12:48:05 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C6526B5F0;\n\tTue, 30 Sep 2025 14:48:05 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FFDC62C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Sep 2025 14:48:02 +0200 (CEST)",
            "from ideasonboard.com (unknown [94.31.94.171])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 1E6E2220;\n\tTue, 30 Sep 2025 14:46:33 +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=\"Q7ZYt92d\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759236393;\n\tbh=ArMWQcxDRD0hwuC/YGbITjh8Pirv9WLsAcSFn+8u+4M=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Q7ZYt92dhXHRue+xcIEftoBEOtANOYYmQHDusXNrCMKBZBn9PhlU3UKe2y7/YqKTb\n\tHnIYJhvqXL6WOudPa0oYAFaCM3jfT25URguquWg/Mi8cPhTJTE2xXiy1XuYRV9noMm\n\tbmYGIHsyIypVDFP9W1aAu2kRrPsCf+rhClcEjFbM=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v1 08/33] libcamera: converter_v4l2_m2m: Add suport for V4L2\n\trequests",
        "Date": "Tue, 30 Sep 2025 14:26:29 +0200",
        "Message-ID": "<20250930122726.1837524-9-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": "Add support for V4L2 reuests.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\n\nToDo:\n- Fix the place where the MediaObject is acquired/released\n---\n .../internal/converter/converter_v4l2_m2m.h   |  9 ++++-\n .../converter/converter_v4l2_m2m.cpp          | 34 ++++++++++++++++++-\n 2 files changed, 41 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex 1b2a88c4a608..3b8fc5392b7d 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -73,7 +73,12 @@ public:\n \tstd::pair<Rectangle, Rectangle> inputCropBounds() override { return inputCropBounds_; }\n \tstd::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream) override;\n \n-private:\n+\tint allocateRequests(unsigned int count,\n+\t\t\t     std::vector<std::unique_ptr<V4L2Request>> *requests);\n+\n+\tbool supportsRequests();\n+\n+protected:\n \tclass V4L2M2MStream : protected Loggable\n \t{\n \tpublic:\n@@ -122,6 +127,8 @@ private:\n \tstd::map<const Stream *, std::unique_ptr<V4L2M2MStream>> streams_;\n \tstd::map<FrameBuffer *, unsigned int> queue_;\n \tstd::pair<Rectangle, Rectangle> inputCropBounds_;\n+\n+\tstd::shared_ptr<MediaDevice> media_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex ff11a9735db7..c6153d728c9a 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -9,6 +9,7 @@\n #include \"libcamera/internal/converter/converter_v4l2_m2m.h\"\n \n #include <algorithm>\n+#include <errno.h>\n #include <limits.h>\n #include <memory>\n #include <set>\n@@ -266,7 +267,7 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n  * \\param[in] media The media device implementing the converter\n  */\n V4L2M2MConverter::V4L2M2MConverter(std::shared_ptr<MediaDevice> media)\n-\t: Converter(media)\n+\t: Converter(media), media_(media)\n {\n \tif (deviceNode().empty())\n \t\treturn;\n@@ -742,6 +743,37 @@ int V4L2M2MConverter::queueBuffers(FrameBuffer *input,\n \treturn 0;\n }\n \n+/**\n+ * \\copydoc libcamera::MediaDevice::allocateRequests\n+ */\n+int V4L2M2MConverter::allocateRequests(unsigned int count,\n+\t\t\t\t       std::vector<std::unique_ptr<V4L2Request>> *requests)\n+{\n+\t/* \\todo The acquire() must be moved to the right place. */\n+\tmedia_->acquire();\n+\tif (!media_->busy())\n+\t\tLOG(Converter, Error)\n+\t\t\t<< \"MediaDevice must be valid.\";\n+\tint ret = media_->allocateRequests(count, requests);\n+\tmedia_->release();\n+\treturn ret;\n+}\n+\n+/**\n+ * \\copydoc libcamera::MediaDevice::supportsRequests\n+ */\n+bool V4L2M2MConverter::supportsRequests()\n+{\n+\t/* \\todo The acquire() must be moved to the right place. */\n+\tmedia_->acquire();\n+\tif (!media_->busy())\n+\t\tLOG(Converter, Error)\n+\t\t\t<< \"MediaDevice must be valid.\";\n+\tbool ret = media_->supportsRequests();\n+\tmedia_->release();\n+\treturn ret;\n+}\n+\n /*\n  * \\todo This should be extended to include Feature::Flag to denote\n  * what each converter supports feature-wise.\n",
    "prefixes": [
        "v1",
        "08/33"
    ]
}