From patchwork Wed Apr 6 14:17:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15638 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 1A1F6C3256 for ; Wed, 6 Apr 2022 14:17:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C040B65644; Wed, 6 Apr 2022 16:17:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649254653; bh=DCDdXzR5EXqotv0wLejnkY0Hx6RbJS0oVZfHYjTbqGo=; 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=1IPpvbccylA+xx88CsjIBiZGtOt0kbeyLHMxW7F2LpmKg1blWESdzIcgq6LyxXZpB +bB/HyH6SgiqcfQahee7UUhB4+6Be4m9CZsmCEBuXL2VogVywjXjpuj6YDjzCzW08W MZ+T/LrXLA5XmkZY53Ppf9HAYnrIJ2BFVkJ1t8ud7AhOMIdb6cqp7LWmotyddDxizT nJFOHmJT+nuJHcR2FlaVEfg+2HsBV+ZsS2MgTWVgFRdg739IZpj1T9WQPlEv63a5xd QtSZxxHLXba7Vj+vlbKTbMFODqjMvrbEhrFuKvovppeaQPi7d6QwjUZgSETaDOC+lb f1jMU9I0SyOzw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 25BE9633A4 for ; Wed, 6 Apr 2022 16:17:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gv621aeT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [27.57.186.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BD2BA482; Wed, 6 Apr 2022 16:17:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1649254651; bh=DCDdXzR5EXqotv0wLejnkY0Hx6RbJS0oVZfHYjTbqGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gv621aeTDtQTRIijaN6a9rL8LjAltJs8bgMTVxmNIRJCoQi0hvZdSVmUFZ4h4sLVK a0+wOqBaYqRaZCfzPqtbXUTL4a2G9RyzwOjFMxltJxbgVqMHOqQ4R9W7DrRezErWAD oOxzFekLwcGUA14blZnZjHir9apXn/Sj7zvjFiv4= To: libcamera-devel@lists.libcamera.org Date: Wed, 6 Apr 2022 19:47:06 +0530 Message-Id: <20220406141709.164794-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220406141709.164794-1-umang.jain@ideasonboard.com> References: <20220406141709.164794-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 3/6] ipa: ipu3: Inline 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 Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- 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 8c9a20f5..569c1311 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -156,9 +156,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); @@ -546,11 +543,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) @@ -568,37 +569,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); @@ -629,6 +599,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