[v11,08/19] libcamera: pipeline: imx8-isi: Don't rely on bufferCount
diff mbox series

Message ID 20250428090413.38234-9-s.pueschel@pengutronix.de
State New
Headers show
Series
  • lc-compliance: Add test to queue more requests than hardware depth
Related show

Commit Message

Sven Püschel April 28, 2025, 9:02 a.m. UTC
From: Paul Elder <paul.elder@ideasonboard.com>

Instead of using bufferCount as the number of V4L2 buffer slots to
reserve in the isi pipeline handler, use a reasonably high constant: 16.
Overallocating isn't a problem as buffer slots are cheap. Having too
few, on the other hand, could degrade performance. It is expected that
this number will be more than enough for most, if not all, use cases.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>

---
Changes in v11:
- rebased

New in v10
---
 src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
index 21f44424..efb280d7 100644
--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
@@ -144,6 +144,8 @@  private:
 
 	std::unique_ptr<V4L2Subdevice> crossbar_;
 	std::vector<Pipe> pipes_;
+
+	static constexpr unsigned int kBufferSlotCount = 16;
 };
 
 /* -----------------------------------------------------------------------------
@@ -923,9 +925,8 @@  int PipelineHandlerISI::start(Camera *camera,
 
 	for (const auto &stream : data->enabledStreams_) {
 		Pipe *pipe = pipeFromStream(camera, stream);
-		const StreamConfiguration &config = stream->configuration();
 
-		int ret = pipe->capture->importBuffers(config.bufferCount);
+		int ret = pipe->capture->importBuffers(kBufferSlotCount);
 		if (ret)
 			return ret;