Patch Detail
Show a patch.
GET /api/patches/25990/?format=api
{ "id": 25990, "url": "https://patchwork.libcamera.org/api/patches/25990/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25990/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20260128074956.760538-7-paul.elder@ideasonboard.com>", "date": "2026-01-28T07:49:54", "name": "[v5,6/8] libcamera: camera: Hook into the LayerManager", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a0ff170b6871468bacc6c162447bca999dffaf49", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25990/mbox/", "series": [ { "id": 5747, "url": "https://patchwork.libcamera.org/api/series/5747/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5747", "date": "2026-01-28T07:49:48", "name": "Add Layers support", "version": 5, "mbox": "https://patchwork.libcamera.org/series/5747/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25990/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25990/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 5E597C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Jan 2026 07:50:25 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 01A7861FDF;\n\tWed, 28 Jan 2026 08:50:24 +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 F2F6D61FD4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Jan 2026 08:50:19 +0100 (CET)", "from neptunite.hamster-moth.ts.net (unknown\n\t[IPv6:2404:7a81:160:2100:508d:7983:72a6:2eeb])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4070473B;\n\tWed, 28 Jan 2026 08:49:42 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"V9cwTrzP\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769586583;\n\tbh=6sCX7DQ/6ErOB8r8xOoqmenfBjpNGMcBRZbVQ6hqYcU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=V9cwTrzPK7lSsIdiKhbuzbw32Rdfgyo4Q2K/WQpz7Sfjyq8jjQOYzwV6P5SLmQr9z\n\t5ltBZtmPHy53tZMjlbzVxntExJEPl/nc5yygzZI1bFdEw1GDssYH5R0ICLItGeCkre\n\tmqBVuFChYT6MvbZj20kuM9cFEhcOm2KRZQ0bSBUw=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Paul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH v5 6/8] libcamera: camera: Hook into the LayerManager", "Date": "Wed, 28 Jan 2026 16:49:54 +0900", "Message-ID": "<20260128074956.760538-7-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.47.2", "In-Reply-To": "<20260128074956.760538-1-paul.elder@ideasonboard.com>", "References": "<20260128074956.760538-1-paul.elder@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 hooks into the CameraManager to call into the LayerManager on all\nrelevant public-facing interface of Camera.\n\nThe entry point for each function into the LayerManager is has been\nchosen based on the capabilities that we want to allow to Layer\nimplementations.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNo change in v4\n\nChanges in v3:\n- send the copy of controls returned by LayerManager::start()\n- each Camera now has a LayerController that it can call into,\n shortening each hook call significantly\n\nChanges in v2:\n- move the LayerManager out of Camera into the CameraManager\n- remove hooks for generateConfiguration() and streams()\n- Camera now passes itself into the layer hooks, as it is required for\n the LayerManager to fetch the closure based on the camera to pass to\n each layer\n---\n include/libcamera/internal/camera.h | 4 ++++\n src/libcamera/camera.cpp | 30 ++++++++++++++++++++++++++---\n 2 files changed, 31 insertions(+), 3 deletions(-)", "diff": "diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h\nindex d28cd921a0f9..fdabc460a357 100644\n--- a/include/libcamera/internal/camera.h\n+++ b/include/libcamera/internal/camera.h\n@@ -19,6 +19,8 @@\n \n #include <libcamera/camera.h>\n \n+#include \"libcamera/internal/layer_manager.h\"\n+\n namespace libcamera {\n \n class CameraControlValidator;\n@@ -78,6 +80,8 @@ private:\n \tstd::atomic<State> state_;\n \n \tstd::unique_ptr<CameraControlValidator> validator_;\n+\n+\tstd::unique_ptr<LayerController> layers_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex a2132e61a7bd..1b3984e683b1 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -18,6 +18,7 @@\n #include <libcamera/base/log.h>\n #include <libcamera/base/thread.h>\n \n+#include <libcamera/camera_manager.h>\n #include <libcamera/color_space.h>\n #include <libcamera/control_ids.h>\n #include <libcamera/framebuffer_allocator.h>\n@@ -27,6 +28,8 @@\n \n #include \"libcamera/internal/camera.h\"\n #include \"libcamera/internal/camera_controls.h\"\n+#include \"libcamera/internal/camera_manager.h\"\n+#include \"libcamera/internal/layer_manager.h\"\n #include \"libcamera/internal/pipeline_handler.h\"\n #include \"libcamera/internal/request.h\"\n \n@@ -774,18 +777,21 @@ void Camera::Private::setState(State state)\n void Camera::Private::emitBufferCompleted(Request *request, FrameBuffer *buffer)\n {\n \tCamera *camera = _o<Camera>();\n+\tlayers_->bufferCompleted(request, buffer);\n \tcamera->bufferCompleted.emit(request, buffer);\n }\n \n void Camera::Private::emitRequestCompleted(Request *request)\n {\n \tCamera *camera = _o<Camera>();\n+\tlayers_->requestCompleted(request);\n \tcamera->requestCompleted.emit(request);\n }\n \n void Camera::Private::emitDisconnected()\n {\n \tCamera *camera = _o<Camera>();\n+\tlayers_->disconnected();\n \tcamera->disconnected.emit();\n }\n \n@@ -976,6 +982,10 @@ Camera::Camera(std::unique_ptr<Private> d, const std::string &id,\n \t_d()->id_ = id;\n \t_d()->streams_ = streams;\n \t_d()->validator_ = std::make_unique<CameraControlValidator>(this);\n+\t_d()->layers_ =\n+\t\t_d()->pipe()->cameraManager()->_d()->layerManager()->createController(this,\n+\t\t\t\t\t\t\t\t\t\t _d()->properties_,\n+\t\t\t\t\t\t\t\t\t\t _d()->controlInfo_);\n }\n \n Camera::~Camera()\n@@ -1065,6 +1075,8 @@ int Camera::acquire()\n \t\treturn -EBUSY;\n \t}\n \n+\td->layers_->acquire();\n+\n \td->setState(Private::CameraAcquired);\n \n \treturn 0;\n@@ -1097,6 +1109,8 @@ int Camera::release()\n \t\td->pipe_->invokeMethod(&PipelineHandler::release,\n \t\t\t\t ConnectionTypeBlocking, this);\n \n+\td->layers_->release();\n+\n \td->setState(Private::CameraAvailable);\n \n \treturn 0;\n@@ -1114,7 +1128,7 @@ int Camera::release()\n */\n const ControlInfoMap &Camera::controls() const\n {\n-\treturn _d()->controlInfo_;\n+\treturn _d()->layers_->controls();\n }\n \n /**\n@@ -1127,7 +1141,7 @@ const ControlInfoMap &Camera::controls() const\n */\n const ControlList &Camera::properties() const\n {\n-\treturn _d()->properties_;\n+\treturn _d()->layers_->properties();\n }\n \n /**\n@@ -1276,6 +1290,8 @@ int Camera::configure(CameraConfiguration *config)\n \t\td->activeStreams_.insert(stream);\n \t}\n \n+\td->layers_->configure(config, d->controlInfo_);\n+\n \td->setState(Private::CameraConfigured);\n \n \treturn 0;\n@@ -1316,6 +1332,8 @@ std::unique_ptr<Request> Camera::createRequest(uint64_t cookie)\n \t/* Associate the request with the pipeline handler. */\n \td->pipe_->registerRequest(request.get());\n \n+\td->layers_->createRequest(cookie, request.get());\n+\n \treturn request;\n }\n \n@@ -1417,6 +1435,8 @@ int Camera::queueRequest(Request *request)\n \t/* Pre-process AeEnable. */\n \tpatchControlList(request->controls());\n \n+\td->layers_->queueRequest(request);\n+\n \td->pipe_->invokeMethod(&PipelineHandler::queueRequest,\n \t\t\t ConnectionTypeQueued, request);\n \n@@ -1453,8 +1473,10 @@ int Camera::start(const ControlList *controls)\n \n \tASSERT(d->requestSequence_ == 0);\n \n+\tControlList *newControls = d->layers_->start(controls);\n+\n \tif (controls) {\n-\t\tControlList copy(*controls);\n+\t\tControlList copy(*newControls);\n \t\tpatchControlList(copy);\n \t\tret = d->pipe_->invokeMethod(&PipelineHandler::start,\n \t\t\t\t\t ConnectionTypeBlocking, this, ©);\n@@ -1505,6 +1527,8 @@ int Camera::stop()\n \n \td->setState(Private::CameraStopping);\n \n+\td->layers_->stop();\n+\n \td->pipe_->invokeMethod(&PipelineHandler::stop, ConnectionTypeBlocking,\n \t\t\t this);\n \n", "prefixes": [ "v5", "6/8" ] }