[libcamera-devel] [PATCH v4 6/8] libcamera: pipeline: rkisp1: Call IPA start() and stop()

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Apr 13 23:26:58 CEST 2020


Call the IPA start()/stop() functions before/after the camera is
started. This makes sure the IPA functions properly once thread
management is moved into the start/stop interface.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index c7068c0c285f3775..e3cdc77ba6be560c 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -780,10 +780,19 @@ int PipelineHandlerRkISP1::start(Camera *camera)
 	if (ret)
 		return ret;
 
+	ret = data->ipa_->start();
+	if (ret) {
+		freeBuffers(camera);
+		LOG(RkISP1, Error)
+			<< "Failed to start IPA " << camera->name();
+		return ret;
+	}
+
 	data->frame_ = 0;
 
 	ret = param_->streamOn();
 	if (ret) {
+		data->ipa_->stop();
 		freeBuffers(camera);
 		LOG(RkISP1, Error)
 			<< "Failed to start parameters " << camera->name();
@@ -793,6 +802,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)
 	ret = stat_->streamOn();
 	if (ret) {
 		param_->streamOff();
+		data->ipa_->stop();
 		freeBuffers(camera);
 		LOG(RkISP1, Error)
 			<< "Failed to start statistics " << camera->name();
@@ -803,6 +813,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)
 	if (ret) {
 		param_->streamOff();
 		stat_->streamOff();
+		data->ipa_->stop();
 		freeBuffers(camera);
 
 		LOG(RkISP1, Error)
@@ -846,6 +857,8 @@ void PipelineHandlerRkISP1::stop(Camera *camera)
 		LOG(RkISP1, Warning)
 			<< "Failed to stop parameters " << camera->name();
 
+	data->ipa_->stop();
+
 	data->timeline_.reset();
 
 	data->frameInfo_.clear();
-- 
2.26.0



More information about the libcamera-devel mailing list