Show a patch.

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

{
    "id": 15128,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15128/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15128/",
    "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": "<20211210205239.354901-7-jacopo@jmondi.org>",
    "date": "2021-12-10T20:52:34",
    "name": "[libcamera-devel,v5,06/11] libcamera: pipeline_handler: Split request queueing",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5f31b84c02e79cf44eb11fecf204fa591a3aea0e",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15128/mbox/",
    "series": [
        {
            "id": 2837,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2837/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2837",
            "date": "2021-12-10T20:52:28",
            "name": "libcamera: Add fence",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2837/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15128/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15128/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 8497ABF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Dec 2021 20:52:00 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F20AA608A8;\n\tFri, 10 Dec 2021 21:51:59 +0100 (CET)",
            "from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D11DF60890\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Dec 2021 21:51:55 +0100 (CET)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 641BF100009;\n\tFri, 10 Dec 2021 20:51:55 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 10 Dec 2021 21:52:34 +0100",
        "Message-Id": "<20211210205239.354901-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.33.1",
        "In-Reply-To": "<20211210205239.354901-1-jacopo@jmondi.org>",
        "References": "<20211210205239.354901-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 06/11] libcamera: pipeline_handler:\n\tSplit request queueing",
        "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 order to prepare to handle synchronization fences at Request\nqueueing time, split the PipelineHandler::queueRequest() function in\ntwo, by creating a list of waiting requests and introducing the\ndoQueueRequest() function that queues requests to the device in the\norder the pipeline has received them.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com\n---\n include/libcamera/internal/pipeline_handler.h |  6 +++++\n .../libcamera/internal/tracepoints/request.tp |  9 +++++++\n src/libcamera/pipeline_handler.cpp            | 27 +++++++++++++++++++\n 3 files changed, 42 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex 3de27ae93645..6aa3378547ba 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -8,6 +8,7 @@\n #pragma once\n \n #include <memory>\n+#include <queue>\n #include <set>\n #include <string>\n #include <sys/types.h>\n@@ -76,9 +77,14 @@ private:\n \tvoid mediaDeviceDisconnected(MediaDevice *media);\n \tvirtual void disconnect();\n \n+\tvoid doQueueRequest(Request *request);\n+\tvoid doQueueRequests();\n+\n \tstd::vector<std::shared_ptr<MediaDevice>> mediaDevices_;\n \tstd::vector<std::weak_ptr<Camera>> cameras_;\n \n+\tstd::queue<Request *> waitingRequests_;\n+\n \tconst char *name_;\n \n \tfriend class PipelineHandlerFactory;\ndiff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp\nindex f039ffd4f88d..f1e54497aa03 100644\n--- a/include/libcamera/internal/tracepoints/request.tp\n+++ b/include/libcamera/internal/tracepoints/request.tp\n@@ -58,6 +58,15 @@ TRACEPOINT_EVENT_INSTANCE(\n \t)\n )\n \n+TRACEPOINT_EVENT_INSTANCE(\n+\tlibcamera,\n+\trequest,\n+\trequest_device_queue,\n+\tTP_ARGS(\n+\t\tlibcamera::Request *, req\n+\t)\n+)\n+\n TRACEPOINT_EVENT_INSTANCE(\n \tlibcamera,\n \trequest,\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 67fdf1d8db01..2374c2891c64 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -312,6 +312,17 @@ void PipelineHandler::queueRequest(Request *request)\n {\n \tLIBCAMERA_TRACEPOINT(request_queue, request);\n \n+\twaitingRequests_.push(request);\n+\tdoQueueRequests();\n+}\n+\n+/**\n+ * \\brief Queue one requests to the device\n+ */\n+void PipelineHandler::doQueueRequest(Request *request)\n+{\n+\tLIBCAMERA_TRACEPOINT(request_device_queue, request);\n+\n \tCamera *camera = request->_d()->camera();\n \tCamera::Private *data = camera->_d();\n \tdata->queuedRequests_.push_back(request);\n@@ -325,6 +336,22 @@ void PipelineHandler::queueRequest(Request *request)\n \t}\n }\n \n+/**\n+ * \\brief Queue requests to the device\n+ *\n+ * Iterate the list of waiting requests and queue them to the device one\n+ * by one.\n+ */\n+void PipelineHandler::doQueueRequests()\n+{\n+\twhile (!waitingRequests_.empty()) {\n+\t\tRequest *request = waitingRequests_.front();\n+\t\twaitingRequests_.pop();\n+\n+\t\tdoQueueRequest(request);\n+\t}\n+}\n+\n /**\n  * \\fn PipelineHandler::queueRequestDevice()\n  * \\brief Queue a request to the device\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "06/11"
    ]
}