[PATCH v11 08/19] libcamera: pipeline: imx8-isi: Don't rely on bufferCount
Sven Püschel
s.pueschel at pengutronix.de
Mon Apr 28 11:02:33 CEST 2025
From: Paul Elder <paul.elder at 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 at ideasonboard.com>
Signed-off-by: Sven Püschel <s.pueschel at 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(-)
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;
--
2.49.0
More information about the libcamera-devel
mailing list