summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-27 00:28:04 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-28 14:25:46 +0200
commitdcb3e7e2dfae021c7e21a0ed32697389bb8aca40 (patch)
treeaf668835909c981f151295963de1cf1b7e8174b4
parent76332f0f8a3c7af1f09f9df1229e025788b2e821 (diff)
libcamera: ipu3: Import instead of allocate statistic buffers
Statistics buffers are not yet used by the IPU3 pipeline, they are never queued to the statistics video device or in any other way consumed. The kernel driver will however not allow video streaming to start if buffers are not either allocated or imported on the statistics video device. Instead of allocating the buffers wasting memory that is never used, import buffers. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index fba45935..90721c2f 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1135,11 +1135,13 @@ int ImgUDevice::allocateBuffers(IPU3CameraData *data, unsigned int bufferCount)
}
/*
- * Use for the stat's internal pool the same number of buffers as for
- * the input pool.
+ * The kernel fails to start if buffers are not either imported or
+ * allocated for the statistics video device. As statistics buffers are
+ * not yet used by the pipeline import buffers to save memory.
+ *
* \todo To be revised when we'll actually use the stat node.
*/
- ret = stat_.dev->allocateBuffers(bufferCount, &stat_.buffers);
+ ret = stat_.dev->importBuffers(bufferCount);
if (ret < 0) {
LOG(IPU3, Error) << "Failed to allocate ImgU stat buffers";
goto error;