From patchwork Thu Mar 31 16:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15596 X-Patchwork-Delegate: umang.jain@ideasonboard.com 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 F1E02C3256 for ; Thu, 31 Mar 2022 16:31:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A96CD65635; Thu, 31 Mar 2022 18:31:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648744283; bh=woaICZpi4vBYwSHNgQg1gJUb3iznCV2EVIobAILwSUI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=UoswSlTzITyyrVtFq4q3nOJ4Wayu3MfQ5+teQKMnTSQ/8Z8yAqqvIqdT0EuiYR5r/ XwXi/IGOuYDv0yVZhxvfnG1GfcVrq6tT4ViUhkUMmlF2BceiIEMTXp0A7TDDyHhXn4 mWC0jm2xjvamJXRwTCiDUd6azlVLC2zZy7Woc8szqCX61+EozmFnH9Oi9w8SKCu/Y+ GAWJXWJpe8mGWzfEWGWktIj1KhmgvtXR9B1/94ITT9gIF6E/TtarMic9SNdIaD3AOC E73idVOwG4StqwnOJPwRswDjW8DHNk8f2PumSKY+b9xb5Z/+WMnyv7fT0EakBDx1CV vOyj8tP1F5vZg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87F016563E for ; Thu, 31 Mar 2022 18:31:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="No02faHa"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [103.74.73.150]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7DD54486; Thu, 31 Mar 2022 18:31:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648744281; bh=woaICZpi4vBYwSHNgQg1gJUb3iznCV2EVIobAILwSUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=No02faHa8FgioXIT0FhUlV8+HTqWYXW7zL0Yhbf3H4cAnqjdxLV8+s1dR2lUGdL54 YzFyOQXjn6tQQsdElCoJl/5pPllUCzOM1XG0AVrmuzhYncPUicH14ev200Xgr9gOxA zInjQFRotJNUcxHV61yZHQORvF3AECdh0282rlGU= To: libcamera-devel@lists.libcamera.org Date: Thu, 31 Mar 2022 22:00:55 +0530 Message-Id: <20220331163058.171418-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220331163058.171418-1-umang.jain@ideasonboard.com> References: <20220331163058.171418-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/6] ipa: ipu3: Inlink parseStatistics() into processStatsBuffer() 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-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Since we have moved away from switch/case on the operation ID, there's little reason to split the operation in two functions. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/ipu3.cpp | 54 +++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 23a9033e..605ca9a5 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -157,9 +157,6 @@ private: ControlInfoMap *ipaControls); void updateSessionConfiguration(const ControlInfoMap &sensorControls); - void parseStatistics(unsigned int frame, - int64_t frameTimestamp, - const ipu3_uapi_stats_3a *stats); bool validateSensorControls(); void setControls(unsigned int frame); @@ -547,11 +544,15 @@ void IPAIPU3::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) } /** - * \brief Process statistics after ISP completion + * \brief Process the statistics generated by the ImgU * \param[in] frame The frame number * \param[in] frameTimestamp Timestamp of the frame * \param[in] bufferId ID of the statistics buffer * \param[in] sensorControls Sensor controls + * + * Parse the most recently processed image statistics from the ImgU. The + * statistics are passed to each algorithm module to run their calculations and + * update their state accordingly. */ void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp, const uint32_t bufferId, const ControlList &sensorControls) @@ -569,37 +570,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, const int64_t frameTimest context_.frameContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get(); context_.frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get()); - parseStatistics(frame, frameTimestamp, stats); -} - -/** - * \brief Queue a request and process the control list from the application - * \param[in] frame The number of the frame which will be processed next - * \param[in] controls The controls for the \a frame - * - * Parse the request to handle any IPA-managed controls that were set from the - * application such as manual sensor settings. - */ -void IPAIPU3::queueRequest(const uint32_t frame, - [[maybe_unused]] const ControlList &controls) -{ - /* \todo Start processing for 'frame' based on 'controls'. */ -} - -/** - * \brief Process the statistics generated by the ImgU - * \param[in] frame The number of the latest frame processed - * \param[in] frameTimestamp The current frame timestamp - * \param[in] stats The IPU3 statistics and ISP results - * - * Parse the most recently processed image statistics from the ImgU. The - * statistics are passed to each algorithm module to run their calculations and - * update their state accordingly. - */ -void IPAIPU3::parseStatistics(unsigned int frame, - [[maybe_unused]] int64_t frameTimestamp, - const ipu3_uapi_stats_3a *stats) -{ double lineDuration = context_.configuration.sensor.lineDuration.get(); int32_t vBlank = context_.configuration.sensor.defVBlank; ControlList ctrls(controls::controls); @@ -630,6 +600,20 @@ void IPAIPU3::parseStatistics(unsigned int frame, metadataReady.emit(frame, ctrls); } +/** + * \brief Queue a request and process the control list from the application + * \param[in] frame The number of the frame which will be processed next + * \param[in] controls The controls for the \a frame + * + * Parse the request to handle any IPA-managed controls that were set from the + * application such as manual sensor settings. + */ +void IPAIPU3::queueRequest(const uint32_t frame, + [[maybe_unused]] const ControlList &controls) +{ + /* \todo Start processing for 'frame' based on 'controls'. */ +} + /** * \brief Handle sensor controls for a given \a frame number * \param[in] frame The frame on which the sensor controls should be set