From patchwork Fri Nov 5 15:20:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 14466 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 BB890BF415 for ; Fri, 5 Nov 2021 15:20:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1A6556034E; Fri, 5 Nov 2021 16:20:38 +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="XS6Dt/q5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 97C786032C for ; Fri, 5 Nov 2021 16:20:36 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:bd59:f4c6:2152:cf32]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 38ED91908; Fri, 5 Nov 2021 16:20:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1636125636; bh=dxTVpjFSRhJmmW+x8621UrAD+cIlVXHkGFFIYFDctig=; h=From:To:Cc:Subject:Date:From; b=XS6Dt/q5VzkJyCz6t0lowJlvU/HDIAZ/Z/fiVTXYa3/eS9IDSKDTUILy2uu6ZwZOE EwbBr5q4VxMmcEXTeNIKF11gIsNhyOtjX0/JBDj9fiDufZwnLBiXjKB1e4iQ44Ise3 M2X0DgzQDMNgO4C2CHYNr8S+MkrE+PhUtQvOSnss= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Nov 2021 16:20:31 +0100 Message-Id: <20211105152031.526267-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] ipa: ipu3: List the events in their order of calling 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" This is a cleanup patch, no functionnal behaviour changes. It makes it clearer when an event is called. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham --- src/ipa/ipu3/ipu3.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 5c51607d..d97b2f9e 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -509,6 +509,13 @@ void IPAIPU3::unmapBuffers(const std::vector &ids) /** * \brief Process an event generated by the pipeline handler * \param[in] event The event sent from pipeline handler + * + * The expected event handling over the lifetime of a Request has + * the following sequence: + * + * - EventProcessControls : Handle controls from a new Request + * - EventFillParams : Prepare the ISP to process the request + * - EventStatReady : Process statistics after ISP completion */ void IPAIPU3::processEvent(const IPU3Event &event) { @@ -517,32 +524,32 @@ void IPAIPU3::processEvent(const IPU3Event &event) processControls(event.frame, event.controls); break; } - case EventStatReady: { + case EventFillParams: { auto it = buffers_.find(event.bufferId); if (it == buffers_.end()) { - LOG(IPAIPU3, Error) << "Could not find stats buffer!"; + LOG(IPAIPU3, Error) << "Could not find param buffer!"; return; } Span mem = it->second.planes()[0]; - const ipu3_uapi_stats_3a *stats = - reinterpret_cast(mem.data()); + ipu3_uapi_params *params = + reinterpret_cast(mem.data()); - parseStatistics(event.frame, event.frameTimestamp, stats); + fillParams(event.frame, params); break; } - case EventFillParams: { + case EventStatReady: { auto it = buffers_.find(event.bufferId); if (it == buffers_.end()) { - LOG(IPAIPU3, Error) << "Could not find param buffer!"; + LOG(IPAIPU3, Error) << "Could not find stats buffer!"; return; } Span mem = it->second.planes()[0]; - ipu3_uapi_params *params = - reinterpret_cast(mem.data()); + const ipu3_uapi_stats_3a *stats = + reinterpret_cast(mem.data()); - fillParams(event.frame, params); + parseStatistics(event.frame, event.frameTimestamp, stats); break; } default: