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

Message ID 20221228223003.2265712-10-paul.elder@ideasonboard.com
State New
Headers show
Series
  • lc-compliance: Add test to queue more requests than hardware depth
Related show

Commit Message

Paul Elder Dec. 28, 2022, 10:29 p.m. UTC
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>

---
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 434fbd63..73eeaf0e 100644
--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp
@@ -148,6 +148,8 @@  private:
 
 	std::unique_ptr<V4L2Subdevice> crossbar_;
 	std::vector<Pipe> pipes_;
+
+	static constexpr unsigned int kBufferSlotCount = 16;
 };
 
 /* -----------------------------------------------------------------------------
@@ -820,9 +822,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;