[{"id":20695,"web_url":"https://patchwork.libcamera.org/comment/20695/","msgid":"<163612991913.287435.109351022918190879@Monstersaurus>","date":"2021-11-05T16:31:59","subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: List the events in their\n\torder of calling","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jean-Michel Hautbois (2021-11-05 15:20:31)\n> This is a cleanup patch, no functionnal behaviour changes. It makes it\n> clearer when an event is called.\n\nHow about:\n\"\"\"\nThe IPU3 IPA has three events which are handled from the pipeline\nhandler.\n\nThe events are received in the sequence, EventProcessControls,\nEventFillParams, and finally EventStatReady, while the code lists these\nin a different order.\n\nUpdate the flow of IPAIPU3::processEvent() to match the expected\nsequence of events, to help support the reader in interpreting the flow\nof events through the IPA.\n\"\"\"\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 27 +++++++++++++++++----------\n\nHow about updating include/libcamera/ipa/ipu3.mojom to re-order the enum\ndefinitions as well:\n\n\tEventProcessControls = 4,\n\tEventStatReady = 5,\n\tEventFillParams = 6,\n\nmay as well become:\n\n\tEventProcessControls = 4,\n\tEventFillParams = 5,\n\tEventStatReady = 6,\n\n\n>  1 file changed, 17 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 5c51607d..d97b2f9e 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -509,6 +509,13 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n>  /**\n>   * \\brief Process an event generated by the pipeline handler\n>   * \\param[in] event The event sent from pipeline handler\n> + *\n> + * The expected event handling over the lifetime of a Request has\n> + * the following sequence:\n> + *\n> + *   - EventProcessControls : Handle controls from a new Request\n> + *   - EventFillParams : Prepare the ISP to process the request\n\nEither s/request/Request/ or s/Request/request/ in the line above it.\n\nWith those.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> + *   - EventStatReady : Process statistics after ISP completion\n>   */\n>  void IPAIPU3::processEvent(const IPU3Event &event)\n>  {\n> @@ -517,32 +524,32 @@ void IPAIPU3::processEvent(const IPU3Event &event)\n>                 processControls(event.frame, event.controls);\n>                 break;\n>         }\n> -       case EventStatReady: {\n> +       case EventFillParams: {\n>                 auto it = buffers_.find(event.bufferId);\n>                 if (it == buffers_.end()) {\n> -                       LOG(IPAIPU3, Error) << \"Could not find stats buffer!\";\n> +                       LOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n>                         return;\n>                 }\n>  \n>                 Span<uint8_t> mem = it->second.planes()[0];\n> -               const ipu3_uapi_stats_3a *stats =\n> -                       reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n> +               ipu3_uapi_params *params =\n> +                       reinterpret_cast<ipu3_uapi_params *>(mem.data());\n>  \n> -               parseStatistics(event.frame, event.frameTimestamp, stats);\n> +               fillParams(event.frame, params);\n>                 break;\n>         }\n> -       case EventFillParams: {\n> +       case EventStatReady: {\n>                 auto it = buffers_.find(event.bufferId);\n>                 if (it == buffers_.end()) {\n> -                       LOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n> +                       LOG(IPAIPU3, Error) << \"Could not find stats buffer!\";\n>                         return;\n>                 }\n>  \n>                 Span<uint8_t> mem = it->second.planes()[0];\n> -               ipu3_uapi_params *params =\n> -                       reinterpret_cast<ipu3_uapi_params *>(mem.data());\n> +               const ipu3_uapi_stats_3a *stats =\n> +                       reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n>  \n> -               fillParams(event.frame, params);\n> +               parseStatistics(event.frame, event.frameTimestamp, stats);\n>                 break;\n>         }\n>         default:\n> -- \n> 2.32.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 61DC2BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  5 Nov 2021 16:32:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B60236034E;\n\tFri,  5 Nov 2021 17:32:03 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 416AF6032C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  5 Nov 2021 17:32:02 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D3AC1110E;\n\tFri,  5 Nov 2021 17:32:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kzY96mu+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636129921;\n\tbh=kvokmoacTH4yXnxg1qQEUw4bm9xR5jsKpyYsM6IfduY=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=kzY96mu+tC0WN7PmTXoR/8gceWlG5JCOgsj2wEsapoIGCa/wYMC/zo+bFa7mwt6mE\n\twbBEeKyD/7uEC0ubj6PkqKkJIOdFbQglkDlq1vRyHVgEFlCKL0zQG6voMZc5RDaWWR\n\tJ7ZTCaeceFJPaVOmNSrb6YTMeIvhJ62uvMGr1Iic=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211105152031.526267-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20211105152031.526267-1-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 05 Nov 2021 16:31:59 +0000","Message-ID":"<163612991913.287435.109351022918190879@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH] ipa: ipu3: List the events in their\n\torder of calling","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]