Patch Detail
Show a patch.
GET /api/1.1/patches/15259/?format=api
{ "id": 15259, "url": "https://patchwork.libcamera.org/api/1.1/patches/15259/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15259/", "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": "<20220107125506.1477795-2-kieran.bingham@ideasonboard.com>", "date": "2022-01-07T12:55:05", "name": "[libcamera-devel,1/2] libcamera: pipeline_handler: Prepare requests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8d6d44869545efd5e4714b8c471eb8fa6d012fd8", "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/15259/mbox/", "series": [ { "id": 2882, "url": "https://patchwork.libcamera.org/api/1.1/series/2882/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2882", "date": "2022-01-07T12:55:04", "name": "libcamera: pipeline_handler: Prepare requests", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2882/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15259/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15259/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 E89A5C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 7 Jan 2022 12:55:13 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E24F860921;\n\tFri, 7 Jan 2022 13:55:12 +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 DB993608E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 7 Jan 2022 13:55:10 +0100 (CET)", "from Monstersaurus.ksquared.org.uk.beta.tailscale.net\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 7CF46A4D;\n\tFri, 7 Jan 2022 13:55:10 +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=\"gQ90xyeF\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641560110;\n\tbh=Pn75HRmzKvRVkRnUb+Q6QwDpslmAnlakg162AnOULQ4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gQ90xyeFH0qttco3vzGp3AMyJ9uxX17hBhszJfSR1fKDhRN5td0ghAuvJ2jXgwdJG\n\tWQw+oTmz4qQKtaWDoQxM47qmLEEiLlpmJ+Pj7Vf/8jzCERT7JhK/zK8n3JZj6IHVFM\n\t2tgR6QhT6euuoYnND/Izy53mE+eD43sO7ZaFFQ8k=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Fri, 7 Jan 2022 12:55:05 +0000", "Message-Id": "<20220107125506.1477795-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20220107125506.1477795-1-kieran.bingham@ideasonboard.com>", "References": "<20220107125506.1477795-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 1/2] libcamera: pipeline_handler: Prepare\n\trequests", "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 prepared and associated with the\npipeline 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 receiveing 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 | 20 ++++++++++++++++---\n 3 files changed, 29 insertions(+), 6 deletions(-)", "diff": "diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex e5b8ffb4db3d..ef7e1390560f 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 prepareRequest(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..1a00b34d9d9d 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_->prepareRequest(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..18b59ef27fb6 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -337,6 +337,23 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const\n \treturn !camera->_d()->queuedRequests_.empty();\n }\n \n+/**\n+ * \\fn PipelineHandler::prepareRequest()\n+ * \\brief Prepare a request for use by the Pipeline Handler\n+ * \\param[in] request The request to prepare\n+ */\n+void PipelineHandler::prepareRequest(Request *request)\n+{\n+\t/*\n+\t * Connect the request prepared signal to the pipeline handler\n+\t * to manage fence based preparations allowing the request\n+\t * to inform us when it is ready to be processed by hardware.\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 +383,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", "1/2" ] }