From patchwork Fri Nov 5 16:36:25 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: 14467 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 1AE4BBF415 for ; Fri, 5 Nov 2021 16:36:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76C3A6032C; Fri, 5 Nov 2021 17:36:30 +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="Cgg5D75Q"; 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 78465600B8 for ; Fri, 5 Nov 2021 17:36:29 +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 2086D110E; Fri, 5 Nov 2021 17:36:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1636130189; bh=pljLW2ueKj8mk+M+Bp0OAbiSV6cyw8oYl2peO+rvT/g=; h=From:To:Cc:Subject:Date:From; b=Cgg5D75QBnSbRCNS5C9LR+AUSHOjcDjKrNmiYK1lZA/649SHo9PYzzhj1BhRcRHOa yyC/OHNk8KxL+DdxldHFlWmo1pxDgyUjI7DcjWqN3IZcB6PxV/lVCmYTsKrdX+yCy6 v5fOZGdYj9NJ5VWrTIND9RwG7jMkVlR/UhZrZRPY= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Nov 2021 17:36:25 +0100 Message-Id: <20211105163625.545541-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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" The IPU3 IPA has three events which are handled from the pipeline handler. The events are received in the sequence, EventProcessControls, EventFillParams, and finally EventStatReady, while the code lists these in a different order. Update the flow of IPAIPU3::processEvent() to match the expected sequence of events, to help support the reader in interpreting the flow of events through the IPA. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- 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..93b700bd 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: