[libcamera-devel] [PATCH 2/3] libcamera: ipu3: Do not re-queue failed buffers
Jacopo Mondi
jacopo at jmondi.org
Mon Jul 15 07:59:34 CEST 2019
When a video device is stopped all the buffers there queued are
released and their state is set to failure.
Currently, on buffer completion, failed buffers are blindly re-queued to
the ImgU input or CIO2 output devices, preventing them to be re-started
succesfully in future capture sessions.
Fix that by inspecting the buffers status and skip re-queueing if
they're reported as failing. For the ImgU output buffers this is not
required, as failed buffes should be anyhow delivered to applications in
order to report their failure.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 5204487684c2..11bf3af66ae6 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -916,6 +916,9 @@ int PipelineHandlerIPU3::registerCameras()
*/
void IPU3CameraData::imguInputBufferReady(Buffer *buffer)
{
+ if (buffer->status() != Buffer::BufferSuccess)
+ return;
+
cio2_.output_->queueBuffer(buffer);
}
@@ -946,6 +949,9 @@ void IPU3CameraData::imguOutputBufferReady(Buffer *buffer)
*/
void IPU3CameraData::cio2BufferReady(Buffer *buffer)
{
+ if (buffer->status() != Buffer::BufferSuccess)
+ return;
+
imgu_->input_->queueBuffer(buffer);
}
--
2.21.0
More information about the libcamera-devel
mailing list