From patchwork Sat Apr 11 00:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 3423 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7095762D33 for ; Sat, 11 Apr 2020 02:19:22 +0200 (CEST) X-Halon-ID: 13664367-7b8a-11ea-aeed-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 13664367-7b8a-11ea-aeed-005056917f90; Sat, 11 Apr 2020 02:19:15 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sat, 11 Apr 2020 02:19:06 +0200 Message-Id: <20200411001911.1143155-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200411001911.1143155-1-niklas.soderlund@ragnatech.se> References: <20200411001911.1143155-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/7] libcamera: pipeline: rkisp1: Queue parameters even if they are not ready X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2020 00:19:22 -0000 If the IPA has not filled in the parameters buffer still queue it to hardware. Not queuing the buffer results in the pipeline and hardware going out of sync. This is not a permanent fix of the problem and a todo is added to fix it properly. This change does not make the situation worse as the state of the pipeline is just as unknown as if no param buffer is queued as if one with old content in it. Signed-off-by: Niklas Söderlund Acked-by: Laurent Pinchart --- * Changes since v2 - Update commit message - Update todo comment in rkisp1.c --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 2f909cef7c75ba0f..3d37677fb433833a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -351,13 +351,23 @@ protected: if (!info) LOG(RkISP1, Fatal) << "Frame not known"; - if (info->paramFilled) - pipe_->param_->queueBuffer(info->paramBuffer); - else + /* + * \todo: If parameters are not filled a better method to handle + * the situation than queuing a buffer with unknown content + * should be used. + * + * It seems excessive to keep an internal zeroed scratch + * parameters buffer around as this should not happen unless the + * devices is under too much load. Perhaps failing the request + * and returning it to the application with an error code is + * better than queue it to hardware? + */ + if (!info->paramFilled) LOG(RkISP1, Error) << "Parameters not ready on time for frame " - << frame() << ", ignore parameters."; + << frame(); + pipe_->param_->queueBuffer(info->paramBuffer); pipe_->stat_->queueBuffer(info->statBuffer); pipe_->video_->queueBuffer(info->videoBuffer); }