Patch Detail
Show a patch.
GET /api/1.1/patches/15286/?format=api
{ "id": 15286, "url": "https://patchwork.libcamera.org/api/1.1/patches/15286/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15286/", "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": "<20220119001717.2503111-2-kieran.bingham@ideasonboard.com>", "date": "2022-01-19T00:17:16", "name": "[libcamera-devel,v2,1/2] libcamera: pipeline_handler: Register requests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "43f58ab0da044c771fb62dff73463d0c673686a3", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/1.1/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/15286/mbox/", "series": [ { "id": 2897, "url": "https://patchwork.libcamera.org/api/1.1/series/2897/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2897", "date": "2022-01-19T00:17:15", "name": "libcamera: pipeline_handler: Register requests", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2897/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15286/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15286/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 7BF98C325A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Jan 2022 00:17:24 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3966F60948;\n\tWed, 19 Jan 2022 01:17:23 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C5E760868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Jan 2022 01:17:21 +0100 (CET)", "from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DDBF9FF;\n\tWed, 19 Jan 2022 01:17:21 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MJCAbgAl\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1642551441;\n\tbh=8pE+2wrEYXj8YtHa0lGuGo/S9L82ueyUEBZw3113Dw8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=MJCAbgAlxECNBmLbZJzqarOjhjhbm2efMcE63OwmZ5mt3bJ2xTHr2gyALoEil/rFG\n\tYaSPdGdKnx+fOh3WKO3WgSCjhRY0tNcWwgyjf0xmSx9d+no1iWq1rKcn5lhOLWYdl4\n\tNHBHFw2r4gfmT90CekctT65L/stQC78ymCj1dqGE=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Wed, 19 Jan 2022 00:17:16 +0000", "Message-Id": "<20220119001717.2503111-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20220119001717.2503111-1-kieran.bingham@ideasonboard.com>", "References": "<20220119001717.2503111-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/2] libcamera: pipeline_handler:\n\tRegister requests", "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": "Provide a call allowing requests to be registered and associated with\nthe pipeline handler after being constructed by the camera.\n\nThis provides an opportunity for the Pipeline Handler to connect any\nsignals it may be interested in receiving for the request such as\ngetting notifications when the request is ready for processing when\nusing a fence.\n\nWhile here, update the existing usage of the d pointer in\nCamera::createRequest() to match the style of other functions.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/internal/pipeline_handler.h | 1 +\n src/libcamera/camera.cpp | 14 +++++++++++---\n src/libcamera/pipeline_handler.cpp | 19 ++++++++++++++++---\n 3 files changed, 28 insertions(+), 6 deletions(-)", "diff": "diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex e5b8ffb4db3d..c3e4c2587ecd 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -59,6 +59,7 @@ public:\n \tvoid stop(Camera *camera);\n \tbool hasPendingRequests(const Camera *camera) const;\n \n+\tvoid registerRequest(Request *request);\n \tvoid queueRequest(Request *request);\n \n \tbool completeBuffer(Request *request, FrameBuffer *buffer);\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 86d84ac0a77d..5e4b84e24235 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -1074,12 +1074,20 @@ int Camera::configure(CameraConfiguration *config)\n */\n std::unique_ptr<Request> Camera::createRequest(uint64_t cookie)\n {\n-\tint ret = _d()->isAccessAllowed(Private::CameraConfigured,\n-\t\t\t\t\tPrivate::CameraRunning);\n+\tPrivate *const d = _d();\n+\n+\tint ret = d->isAccessAllowed(Private::CameraConfigured,\n+\t\t\t\t Private::CameraRunning);\n \tif (ret < 0)\n \t\treturn nullptr;\n \n-\treturn std::make_unique<Request>(this, cookie);\n+\tstd::unique_ptr<Request> request = std::make_unique<Request>(this, cookie);\n+\n+\t/* Associate the request with the pipeline handler. */\n+\tif (request)\n+\t\td->pipe_->registerRequest(request.get());\n+\n+\treturn request;\n }\n \n /**\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 03e4b9e66aa6..e27dc182c128 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -337,6 +337,22 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const\n \treturn !camera->_d()->queuedRequests_.empty();\n }\n \n+/**\n+ * \\fn PipelineHandler::registerRequest()\n+ * \\brief Register a request for use by the Pipeline Handler\n+ * \\param[in] request The request to register\n+ */\n+void PipelineHandler::registerRequest(Request *request)\n+{\n+\t/*\n+\t * Connect the request prepared signal to notify the pipeline handler\n+\t * when a request is ready to be processed.\n+\t */\n+\trequest->_d()->prepared.connect(this, [this]() {\n+\t\t\t\t\t\tdoQueueRequests();\n+\t\t\t\t\t});\n+}\n+\n /**\n * \\fn PipelineHandler::queueRequest()\n * \\brief Queue a request\n@@ -366,9 +382,6 @@ void PipelineHandler::queueRequest(Request *request)\n \n \twaitingRequests_.push(request);\n \n-\trequest->_d()->prepared.connect(this, [this]() {\n-\t\t\t\t\t\tdoQueueRequests();\n-\t\t\t\t\t});\n \trequest->_d()->prepare(300ms);\n }\n \n", "prefixes": [ "libcamera-devel", "v2", "1/2" ] }