From patchwork Mon Jun 29 16:30:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 27131 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 52955C3261 for ; Mon, 29 Jun 2026 16:31:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DAB8765FDE; Mon, 29 Jun 2026 18:31:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fGZbTU1N"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6161F65F79 for ; Mon, 29 Jun 2026 18:30:34 +0200 (CEST) Received: from pb-laptop.local (185.221.140.128.nat.pool.zt.hu [185.221.140.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 33F58E91 for ; Mon, 29 Jun 2026 18:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782750591; bh=GptUHR2d3aB72tskvga2gusJRJ8q9ubPKt1Al1jYqgA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fGZbTU1NvVAdSBXRPxmSxvFtXFAiONSKyxDN6mEY0ne6DoOphYoBeT2njWgYsA/Am V+o7UENEOnwjVJ+DIav3Gmv0H2uakiH0/7Zy+oYEPJLlfMt5fYxai+Ran3KtaXOtrP sCQZvz5th7bs3+/DuxnpjRzUXjx3gxSNbpF93+Ug= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= 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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" There are no callers, so the stub can now be removed. TODO: what of `FrameBuffer::request` ? Signed-off-by: Barnabás Pőcze --- include/libcamera/request.h | 2 -- src/libcamera/fence.cpp | 10 ++++------ src/libcamera/framebuffer.cpp | 8 +++----- src/libcamera/request.cpp | 13 ------------- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 462611da59..14b9ee6f12 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -47,8 +47,6 @@ public: ControlList &controls() { return controls_; } const ControlList &metadata() const; const BufferMap &buffers() const { return bufferMap_; } - int addBuffer(const Stream *stream, FrameBuffer *buffer, - std::unique_ptr &&fence = {}); FrameBuffer *findBuffer(const Stream *stream) const; void enableStream(const Stream *stream, bool enabled); diff --git a/src/libcamera/fence.cpp b/src/libcamera/fence.cpp index 92d1b37366..8dc748b176 100644 --- a/src/libcamera/fence.cpp +++ b/src/libcamera/fence.cpp @@ -52,12 +52,10 @@ namespace libcamera { * * A Fence is constructed with a UniqueFD whose ownership is moved in the Fence. * A FrameBuffer can be associated with a Fence by passing it to the - * Request::addBuffer() function, which will move the Fence into the FrameBuffer - * itself. Once a Request is queued to the Camera, a preparation phase - * guarantees that before actually applying the Request to the hardware, all the - * valid fences of the frame buffers in a Request are correctly signalled. Once - * a Fence has completed, the library will release the FrameBuffer fence so that - * application won't be allowed to access it. + * Camera::addBuffer() function, which will move the Fence into the FrameBuffer + * itself. The buffer will not be used in any completed request until the fence + * is signalled. Once a Fence has completed, the library will release the FrameBuffer + * fence so that application won't be allowed to access it. * * An optional timeout can be started while waiting for a fence to complete. If * waiting on a Fence fails for whatever reason, the FrameBuffer's fence is not diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp index 55ca24c8a3..61a5959a96 100644 --- a/src/libcamera/framebuffer.cpp +++ b/src/libcamera/framebuffer.cpp @@ -151,7 +151,7 @@ FrameBuffer::Private::~Private() * The intended callers of this function are buffer completion handlers that * need to associate a buffer to the request it belongs to. * - * A FrameBuffer is associated to a request by Request::addBuffer() and the + * A FrameBuffer is associated to a request by the libcamera core and the * association is valid until the buffer completes. The returned request * pointer is valid only during that interval. * @@ -164,9 +164,7 @@ FrameBuffer::Private::~Private() * \brief Set the request this buffer belongs to * \param[in] request Request to set * - * For buffers added to requests by applications, this function is called by - * Request::addBuffer() or Request::reuse(). For buffers internal to pipeline - * handlers, it is called by the pipeline handlers themselves. + * For buffers internal to pipeline handlers, it is called by the pipeline handlers themselves. */ /** @@ -439,7 +437,7 @@ void FrameBuffer::setCookie(uint64_t cookie) * * If buffer with a Fence completes with errors due to a failure in handling * the fence, applications are responsible for releasing the Fence before - * calling Request::addBuffer() again. + * reusing the buffer. * * \return A unique pointer to the Fence if set, or nullptr if the fence has * been released already diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 5d28ac80df..f886ec0e4e 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -287,19 +287,6 @@ const ControlList &Request::metadata() const * \return The map of Stream to FrameBuffer */ -/** - * \brief Add a FrameBuffer with its associated Stream to the Request - * \param[in] stream The stream the buffer belongs to - * \param[in] buffer The FrameBuffer to add to the request - * \param[in] fence The optional fence - */ -int Request::addBuffer(const Stream *, FrameBuffer *, - std::unique_ptr &&) -{ - LOG(Request, Fatal) << "REMOVED"; - return -ENOTSUP; -} - /** * \var Request::bufferMap_ * \brief Mapping of streams to buffers for this request