[libcamera-devel] [PATCH] libcamera: pipeline: rkisp1: Guard against IPA posting actions when we have no camera

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Sep 14 16:02:17 CEST 2020


The IPA is running asynchronously from the pipeline and may be in the
process of completing some action while the pipeline is stopping the
camera. Prevent processing actions after the camera is stopped by
checking that the pipeline is running with an active camera or not.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index a6fc3b8e36f3b00a..73d1e9c4ef21fd45 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -413,6 +413,11 @@ int RkISP1CameraData::loadIPA()
 void RkISP1CameraData::queueFrameAction(unsigned int frame,
 					const IPAOperationData &action)
 {
+	/* Guard again IPA queuing actions when we have no camera. */
+	PipelineHandlerRkISP1 *pipe = static_cast<PipelineHandlerRkISP1 *>(pipe_);
+	if (!pipe->activeCamera_)
+		return;
+
 	switch (action.operation) {
 	case RKISP1_IPA_ACTION_V4L2_SET: {
 		const ControlList &controls = action.controls[0];
-- 
2.28.0



More information about the libcamera-devel mailing list