From patchwork Mon Jun 29 16:29:46 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: 27102 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 42E76C3261 for ; Mon, 29 Jun 2026 16:31:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D9DC65F5A; Mon, 29 Jun 2026 18:31:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZLF6hAKB"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E4CE65F48 for ; Mon, 29 Jun 2026 18:30:26 +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 16F0AE91 for ; Mon, 29 Jun 2026 18:29:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782750583; bh=PfZX+7AwvmbjHQf/FCMDuEMyKABil9jpmI84bEgektk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZLF6hAKBM1Zy2yViEkJapMWTjSuMdXysd4zkwI7qijrDyjQ6GIVHeIpFKA8dgQHsb LRj4veJ38Jc4cjaDlVlY+Vq6lgQvAvq0LRhE0lrZurYC0EBwtkN7POQpXBNYAKmIgr 8+EQ3jI0H9pGqckomNFiS4CPpTSEeT1do1uh9PDM= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 23/54] libcamera: request: addBuffer(): Remove impl Date: Mon, 29 Jun 2026 18:29:46 +0200 Message-ID: <20260629163017.863145-24-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" With the separation of requests and buffers, this function will be removed. For now only the implementation is removed because: * there are many external users, and * not to hinder changing implementation details. Signed-off-by: Barnabás Pőcze --- src/libcamera/request.cpp | 62 +++------------------------------------ 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 278d993445..8a3934add3 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -446,66 +446,12 @@ const ControlList &Request::metadata() const * \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 - * - * A reference to the buffer is stored in the request. The caller is responsible - * for ensuring that the buffer will remain valid until the request complete - * callback is called. - * - * A request can only contain one buffer per stream. If a buffer has already - * been added to the request for the same stream, this function returns -EEXIST. - * - * A Fence can be optionally associated with the \a buffer. - * - * When a valid Fence is provided to this function, \a fence is moved to \a - * buffer and this Request will only be queued to the device once the - * fences of all its buffers have been correctly signalled. Ownership of the - * fence will only be taken in case of success, otherwise the fence will - * be left unmodified. - * - * If the \a fence associated with \a buffer isn't signalled, the request will - * fail after a timeout. The buffer will still contain the fence, which - * applications must retrieve with FrameBuffer::releaseFence() before the buffer - * can be reused in another request. Attempting to add a buffer that still - * contains a fence to a request will result in this function returning -EEXIST. - * - * \sa FrameBuffer::releaseFence() - * - * \return 0 on success or a negative error code otherwise - * \retval -EEXIST The request already contains a buffer for the stream - * or the buffer still references a fence - * \retval -EINVAL The buffer does not reference a valid Stream */ -int Request::addBuffer(const Stream *stream, FrameBuffer *buffer, - std::unique_ptr &&fence) +int Request::addBuffer(const Stream *, FrameBuffer *, + std::unique_ptr &&) { - if (!stream) { - LOG(Request, Error) << "Invalid stream reference"; - return -EINVAL; - } - - /* - * Make sure the fence has been extracted from the buffer - * to avoid waiting on a stale fence. - */ - if (buffer->_d()->fence()) { - LOG(Request, Error) << "Can't add buffer that still references a fence"; - return -EEXIST; - } - - auto [it, inserted] = bufferMap_.try_emplace(stream, buffer); - if (!inserted) { - LOG(Request, Error) << "FrameBuffer already set for stream"; - return -EEXIST; - } - - buffer->_d()->setRequest(this); - buffer->_d()->stream_ = stream; - _d()->pending_.insert(buffer); - - if (fence && fence->isValid()) - buffer->_d()->setFence(std::move(fence)); - - return 0; + LOG(Request, Fatal) << "REMOVED"; + return -ENOTSUP; } /**