[RFC,v1,53/54] libcamera: request: Remove `addBuffer()`
diff mbox series

Message ID 20260629163017.863145-54-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: Split requests and buffers
Related show

Commit Message

Barnabás Pőcze June 29, 2026, 4:30 p.m. UTC
There are no callers, so the stub can now be removed.

TODO: what of `FrameBuffer::request` ?

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 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(-)

Patch
diff mbox series

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> &&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<Fence> &&)
-{
-	LOG(Request, Fatal) << "REMOVED";
-	return -ENOTSUP;
-}
-
 /**
  * \var Request::bufferMap_
  * \brief Mapping of streams to buffers for this request