{"id":27131,"url":"https://patchwork.libcamera.org/api/1.1/patches/27131/?format=json","web_url":"https://patchwork.libcamera.org/patch/27131/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260629163017.863145-54-barnabas.pocze@ideasonboard.com>","date":"2026-06-29T16:30:16","name":"[RFC,v1,53/54] libcamera: request: Remove `addBuffer()`","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"0150025ff1860a47b15fdc662be9e08abc90f0dc","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/27131/mbox/","series":[{"id":6025,"url":"https://patchwork.libcamera.org/api/1.1/series/6025/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6025","date":"2026-06-29T16:29:23","name":"libcamera: Split requests and buffers","version":1,"mbox":"https://patchwork.libcamera.org/series/6025/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/27131/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/27131/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 52955C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2026 16:31:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAB8765FDE;\n\tMon, 29 Jun 2026 18:31:42 +0200 (CEST)","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 6161F65F79\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:30:34 +0200 (CEST)","from pb-laptop.local (185.221.140.128.nat.pool.zt.hu\n\t[185.221.140.128])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 33F58E91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:29:51 +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=\"fGZbTU1N\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782750591;\n\tbh=GptUHR2d3aB72tskvga2gusJRJ8q9ubPKt1Al1jYqgA=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=fGZbTU1NvVAdSBXRPxmSxvFtXFAiONSKyxDN6mEY0ne6DoOphYoBeT2njWgYsA/Am\n\tV+o7UENEOnwjVJ+DIav3Gmv0H2uakiH0/7Zy+oYEPJLlfMt5fYxai+Ran3KtaXOtrP\n\tsCQZvz5th7bs3+/DuxnpjRzUXjx3gxSNbpF93+Ug=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[RFC PATCH v1 53/54] libcamera: request: Remove `addBuffer()`","Date":"Mon, 29 Jun 2026 18:30:16 +0200","Message-ID":"<20260629163017.863145-54-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>","References":"<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","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":"There are no callers, so the stub can now be removed.\n\nTODO: what of `FrameBuffer::request` ?\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/request.h   |  2 --\n src/libcamera/fence.cpp       | 10 ++++------\n src/libcamera/framebuffer.cpp |  8 +++-----\n src/libcamera/request.cpp     | 13 -------------\n 4 files changed, 7 insertions(+), 26 deletions(-)","diff":"diff --git a/include/libcamera/request.h b/include/libcamera/request.h\nindex 462611da59..14b9ee6f12 100644\n--- a/include/libcamera/request.h\n+++ b/include/libcamera/request.h\n@@ -47,8 +47,6 @@ public:\n \tControlList &controls() { return controls_; }\n \tconst ControlList &metadata() const;\n \tconst BufferMap &buffers() const { return bufferMap_; }\n-\tint addBuffer(const Stream *stream, FrameBuffer *buffer,\n-\t\t      std::unique_ptr<Fence> &&fence = {});\n \tFrameBuffer *findBuffer(const Stream *stream) const;\n \tvoid enableStream(const Stream *stream, bool enabled);\n \ndiff --git a/src/libcamera/fence.cpp b/src/libcamera/fence.cpp\nindex 92d1b37366..8dc748b176 100644\n--- a/src/libcamera/fence.cpp\n+++ b/src/libcamera/fence.cpp\n@@ -52,12 +52,10 @@ namespace libcamera {\n  *\n  * A Fence is constructed with a UniqueFD whose ownership is moved in the Fence.\n  * A FrameBuffer can be associated with a Fence by passing it to the\n- * Request::addBuffer() function, which will move the Fence into the FrameBuffer\n- * itself. Once a Request is queued to the Camera, a preparation phase\n- * guarantees that before actually applying the Request to the hardware, all the\n- * valid fences of the frame buffers in a Request are correctly signalled. Once\n- * a Fence has completed, the library will release the FrameBuffer fence so that\n- * application won't be allowed to access it.\n+ * Camera::addBuffer() function, which will move the Fence into the FrameBuffer\n+ * itself. The buffer will not be used in any completed request until the fence\n+ * is signalled. Once a Fence has completed, the library will release the FrameBuffer\n+ * fence so that application won't be allowed to access it.\n  *\n  * An optional timeout can be started while waiting for a fence to complete. If\n  * waiting on a Fence fails for whatever reason, the FrameBuffer's fence is not\ndiff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\nindex 55ca24c8a3..61a5959a96 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -151,7 +151,7 @@ FrameBuffer::Private::~Private()\n  * The intended callers of this function are buffer completion handlers that\n  * need to associate a buffer to the request it belongs to.\n  *\n- * A FrameBuffer is associated to a request by Request::addBuffer() and the\n+ * A FrameBuffer is associated to a request by the libcamera core and the\n  * association is valid until the buffer completes. The returned request\n  * pointer is valid only during that interval.\n  *\n@@ -164,9 +164,7 @@ FrameBuffer::Private::~Private()\n  * \\brief Set the request this buffer belongs to\n  * \\param[in] request Request to set\n  *\n- * For buffers added to requests by applications, this function is called by\n- * Request::addBuffer() or Request::reuse(). For buffers internal to pipeline\n- * handlers, it is called by the pipeline handlers themselves.\n+ * For buffers internal to pipeline handlers, it is called by the pipeline handlers themselves.\n  */\n \n /**\n@@ -439,7 +437,7 @@ void FrameBuffer::setCookie(uint64_t cookie)\n  *\n  * If buffer with a Fence completes with errors due to a failure in handling\n  * the fence, applications are responsible for releasing the Fence before\n- * calling Request::addBuffer() again.\n+ * reusing the buffer.\n  *\n  * \\return A unique pointer to the Fence if set, or nullptr if the fence has\n  * been released already\ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex 5d28ac80df..f886ec0e4e 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -287,19 +287,6 @@ const ControlList &Request::metadata() const\n  * \\return The map of Stream to FrameBuffer\n  */\n \n-/**\n- * \\brief Add a FrameBuffer with its associated Stream to the Request\n- * \\param[in] stream The stream the buffer belongs to\n- * \\param[in] buffer The FrameBuffer to add to the request\n- * \\param[in] fence The optional fence\n- */\n-int Request::addBuffer(const Stream *, FrameBuffer *,\n-\t\t       std::unique_ptr<Fence> &&)\n-{\n-\tLOG(Request, Fatal) << \"REMOVED\";\n-\treturn -ENOTSUP;\n-}\n-\n /**\n  * \\var Request::bufferMap_\n  * \\brief Mapping of streams to buffers for this request\n","prefixes":["RFC","v1","53/54"]}