From patchwork Tue Mar 19 12:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 19753 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 57B21C32C9 for ; Tue, 19 Mar 2024 12:05:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EE3E762E75; Tue, 19 Mar 2024 13:05:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Dq4+NEh8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BAE7D62D31 for ; Tue, 19 Mar 2024 13:05:30 +0100 (CET) Received: from jasper.fritz.box (unknown [IPv6:2a00:6020:448c:6c00:1478:344b:8fcb:baf5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 13EBC480; Tue, 19 Mar 2024 13:05:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1710849904; bh=FTsVWm29oC2K18aJ3DAR3rYpJmCwuCj03DIg7SYbji0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dq4+NEh88bPnTntWURYDSbKC+knGijwu1ttyQ2ZtLtYjKRufHHKz7QsWNBPyNTGL6 uC+umDPdMHmxGDQ3FTfZl/JmewmhAODTNHt/5edIOf1trv/B1FU5MzabQTgCLB+N+g jxUiq43YGGbx9SaeuiCpZFHog5SODkoZbRg9zhtQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v3 13/16] pipeline: rkisp1: Move call to setSensorControls.emit() Date: Tue, 19 Mar 2024 13:05:14 +0100 Message-Id: <20240319120517.362082-14-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240319120517.362082-1-stefan.klug@ideasonboard.com> References: <20240319120517.362082-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" into processStateBuffer(). This is a non-functional change and in preparation for the next commit. Signed-off-by: Stefan Klug --- src/ipa/rkisp1/rkisp1.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 9dc5f53c..44d03eb8 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -74,7 +74,7 @@ private: void updateControls(const IPACameraSensorInfo &sensorInfo, const ControlInfoMap &sensorControls, ControlInfoMap *ipaControls); - void setControls(unsigned int frame); + ControlList getControls(unsigned int frame); std::map buffers_; std::map mappedBuffers_; @@ -201,7 +201,8 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision, int IPARkISP1::start() { - setControls(0); + ControlList ctrls = getControls(0); + setSensorControls.emit(0, ctrls); return 0; } @@ -367,7 +368,8 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId algo->process(context_, frame, frameContext, stats, metadata); } - setControls(frame); + ControlList ctrls = getControls(frame); + setSensorControls.emit(frame, ctrls); metadataReady.emit(frame, metadata); } @@ -430,13 +432,8 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo, *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls); } -void IPARkISP1::setControls(unsigned int frame) +ControlList IPARkISP1::getControls(unsigned int frame) { - /* - * \todo The frame number is most likely wrong here, we need to take - * internal sensor delays and other timing parameters into account. - */ - IPAFrameContext &frameContext = context_.frameContexts.get(frame); uint32_t exposure = frameContext.agc.exposure; uint32_t gain = camHelper_->gainCode(frameContext.agc.gain); @@ -444,8 +441,7 @@ void IPARkISP1::setControls(unsigned int frame) ControlList ctrls(sensorControls_); ctrls.set(V4L2_CID_EXPOSURE, static_cast(exposure)); ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast(gain)); - - setSensorControls.emit(frame, ctrls); + return ctrls; } } /* namespace ipa::rkisp1 */