From patchwork Thu Feb 24 11:33:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 15377 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2B663BF415 for ; Thu, 24 Feb 2022 11:33:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 08B9D601F9; Thu, 24 Feb 2022 12:33:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Ln5TpxzI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 30B03610F9 for ; Thu, 24 Feb 2022 12:33:53 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:ce74:6df2:4b76:b230]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ADB1B484; Thu, 24 Feb 2022 12:33:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1645702432; bh=mMJuuto1bzrXlL+ATfOahFbg6hgrOBbR0dCtYEcgtPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ln5TpxzIhaANpCh7AHlq3ueq90wUIVSFoYyED9mineL1HJYIOu46Fp4rtX01AQlL0 rZAX4MlKaCfLcMWiL9aTk8MGteshui1LMejcZQoT6snptpotum+PUWjmeMyr/34khM arQVnxklm8bF50EtQlDoep63Bazg6NnBwK/qgDFc= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Feb 2022 12:33:43 +0100 Message-Id: <20220224113347.80001-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com> References: <20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/5] ipa: rkisp1: Use frame counter for the request queued 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Introduce a frameCount variable in the IPAFrameContext which increments each time a request is queued. It is reset at configure call, when the camera is started. This will allow the frameCount to be used by other algorithms, without having to keep multiple private frame counters. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- v3: - replace frameId by a frame counter - Change the date of the copyright --- src/ipa/rkisp1/ipa_context.cpp | 9 ++++++++- src/ipa/rkisp1/ipa_context.h | 4 +++- src/ipa/rkisp1/rkisp1.cpp | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 9cb2a9fd..664f572f 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ /* - * Copyright (C) 2021, Ideas On Board + * Copyright (C) 2021-2022, Ideas On Board * * ipa_context.cpp - RkISP1 IPA Context */ @@ -113,4 +113,11 @@ namespace libcamera::ipa::rkisp1 { * \brief Analogue gain multiplier */ +/** + * \var IPAFrameContext::frameCount + * \brief Number of queued requests for this frame context + * + * It restarts from 0 when the camera is started. + */ + } /* namespace libcamera::ipa::rkisp1 */ diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index b94ade0c..212fa052 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ /* - * Copyright (C) 2021, Ideas On Board + * Copyright (C) 2021-2022, Ideas On Board * * ipa_context.h - RkISP1 IPA Context * @@ -43,6 +43,8 @@ struct IPAFrameContext { uint32_t exposure; double gain; } sensor; + + unsigned int frameCount; }; struct IPAContext { diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 2d79f15f..f119b3f3 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -196,6 +196,8 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info, context_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_); context_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_); + context_.frameContext.frameCount = 0; + for (auto const &algo : algorithms_) { int ret = algo->configure(context_, info); if (ret) @@ -284,6 +286,7 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params, op.op = ActionParamFilled; queueFrameAction.emit(frame, op); + context_.frameContext.frameCount++; } void IPARkISP1::updateStatistics(unsigned int frame,