From patchwork Wed Mar 13 10:56:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 19697 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 2718AC32C4 for ; Wed, 13 Mar 2024 10:57:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D1FD162CA8; Wed, 13 Mar 2024 11:57:06 +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="O6DrcvbA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D9EF562C93 for ; Wed, 13 Mar 2024 11:56:54 +0100 (CET) Received: from jasper.fritz.box (unknown [IPv6:2a00:6020:448c:6c00:9b07:31b5:38e1:e957]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6956AA8F; Wed, 13 Mar 2024 11:56:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1710327392; bh=zUGKUWYuVQ7WOMMNKx2r64dDTVeyWgc35NFIoS2N1sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6DrcvbAC6YgVANs+ylK8Y1MCcTPvB3LGSoInGS3aWNvvn6RhhHcp6Z0o20SeL9jq EMjQl3LtGYBB+fL7VnVMQjW8/jdofzSzjzWgQhj097s1Mi5uw1l0zZkTdkHrZelLWJ rkLjcRvs1xSQO7BFDOHJvLWsXOPXnxOXyhVUc3Wc= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Subject: [PATCH 09/12] pipeline: rkisp1: Move call to setSensorControls.emit() Date: Wed, 13 Mar 2024 11:56:42 +0100 Message-Id: <20240313105645.120317-11-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240313105645.120317-1-stefan.klug@ideasonboard.com> References: <20240313105645.120317-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 | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 9dc5f53c..7f8d3bc1 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_; @@ -367,7 +367,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 +431,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 +440,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 */