From patchwork Mon Jan 3 17:09: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: 15237 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 03A6FC3258 for ; Mon, 3 Jan 2022 17:10:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6ABD3608E9; Mon, 3 Jan 2022 18:10:17 +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="Bwt+vSLD"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CBCBC604F4 for ; Mon, 3 Jan 2022 18:10:15 +0100 (CET) Received: from perceval.ideasonboard.com (unknown [IPv6:2401:4900:1f3e:193e:9a73:f356:8c6a:a1aa]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D8E4DE57; Mon, 3 Jan 2022 18:10:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1641229815; bh=7Um9WZFfBnDVnoqeIk6skONFCu4zOkLwAMXZZWy0xVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bwt+vSLD07i54b/arA0Snw122dAVYH+GqBuw+jhrcCLUV6yMHp+oyU280DgRE4e79 3mSPFEOimhLX+wt5WqW6ATqRDXQEcB5fuDOsN/niBu3+7skj0HsdeUiVVT924+JmNV mrj3Kzt7ye3vlF+w1yKh2Uah97yeOSJCSzdYDmk4= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 3 Jan 2022 22:39:55 +0530 Message-Id: <20220103170956.323025-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220103170956.323025-1-umang.jain@ideasonboard.com> References: <20220103170956.323025-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] ipa: ipu3: Mark the beginning and end of a frame 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" From: Jean-Michel Hautbois Introduce the skeleton for two functions which will be used to instantiate a frame context, and do everything needed when a frame is received. Do the same for the other end, once the algorithms have run and updated the frame context to later deallocate the corresponding frame context. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Signed-off-by: Umang Jain --- src/ipa/ipu3/ipu3.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 4f03d7e9..fa40c41f 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -162,6 +162,14 @@ private: void setControls(unsigned int frame); void calculateBdsGrid(const Size &bdsOutputSize); + /* + * Internal events that mark the beginning of processing a new frame + * to the point that it has successfully completed processing its + * statistics. + */ + void frameStarted(const uint32_t frame); + void frameCompleted(const uint32_t frame); + std::map buffers_; ControlInfoMap ctrls_; @@ -508,6 +516,14 @@ void IPAIPU3::unmapBuffers(const std::vector &ids) } } +void IPAIPU3::frameStarted([[maybe_unused]] const uint32_t frame) +{ +} + +void IPAIPU3::frameCompleted([[maybe_unused]] const uint32_t frame) +{ +} + /** * \brief Prepare the ISP to process the Request * \param[in] frame The frame number @@ -566,6 +582,15 @@ void IPAIPU3::processControls(const uint32_t frame, [[maybe_unused]] const ControlList &controls) { /* \todo Start processing for 'frame' based on 'controls'. */ + + /* + * To save incurring extra IPC calls, we do not send explicit events + * when a new request is started or completed. + * ProcessControls is the first event handled upon receipt of a new + * request, so we can handle all actions required to start processing + * a new frame. + */ + frameStarted(frame); } /** @@ -635,6 +660,14 @@ void IPAIPU3::parseStatistics(unsigned int frame, */ metadataReady.emit(frame, ctrls); + + /* + * To save incurring extra IPC calls, we do not send explicit events + * when we have completed all handling of a request. + * Once the statistics are fully processed, we will no longer handle this + * frame. + */ + frameCompleted(frame); } /**