[{"id":20697,"web_url":"https://patchwork.libcamera.org/comment/20697/","msgid":"<20211106102834.6q2otrgznxi4tyuo@uno.localdomain>","date":"2021-11-06T10:28:34","subject":"Re: [libcamera-devel] [PATCH v2] ipa: ipu3: List the events in\n\ttheir order of calling","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Jean-Michel\n\nOn Fri, Nov 05, 2021 at 05:36:25PM +0100, Jean-Michel Hautbois wrote:\n> The IPU3 IPA has three events which are handled from the pipeline\n> handler.\n>\n> The events are received in the sequence, EventProcessControls,\n> EventFillParams, and finally EventStatReady, while the code lists these\n> in a different order.\n>\n> Update the flow of IPAIPU3::processEvent() to match the expected\n> sequence of events, to help support the reader in interpreting the flow\n> of events through the IPA.\n>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nThanks, it makes it easier to follow the operations flow!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 27 +++++++++++++++++----------\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..93b700bd 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> + *   - 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>  \t\tprocessControls(event.frame, event.controls);\n>  \t\tbreak;\n>  \t}\n> -\tcase EventStatReady: {\n> +\tcase EventFillParams: {\n>  \t\tauto it = buffers_.find(event.bufferId);\n>  \t\tif (it == buffers_.end()) {\n> -\t\t\tLOG(IPAIPU3, Error) << \"Could not find stats buffer!\";\n> +\t\t\tLOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n>  \t\t\treturn;\n>  \t\t}\n>\n>  \t\tSpan<uint8_t> mem = it->second.planes()[0];\n> -\t\tconst ipu3_uapi_stats_3a *stats =\n> -\t\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n> +\t\tipu3_uapi_params *params =\n> +\t\t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n>\n> -\t\tparseStatistics(event.frame, event.frameTimestamp, stats);\n> +\t\tfillParams(event.frame, params);\n>  \t\tbreak;\n>  \t}\n> -\tcase EventFillParams: {\n> +\tcase EventStatReady: {\n>  \t\tauto it = buffers_.find(event.bufferId);\n>  \t\tif (it == buffers_.end()) {\n> -\t\t\tLOG(IPAIPU3, Error) << \"Could not find param buffer!\";\n> +\t\t\tLOG(IPAIPU3, Error) << \"Could not find stats buffer!\";\n>  \t\t\treturn;\n>  \t\t}\n>\n>  \t\tSpan<uint8_t> mem = it->second.planes()[0];\n> -\t\tipu3_uapi_params *params =\n> -\t\t\treinterpret_cast<ipu3_uapi_params *>(mem.data());\n> +\t\tconst ipu3_uapi_stats_3a *stats =\n> +\t\t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n>\n> -\t\tfillParams(event.frame, params);\n> +\t\tparseStatistics(event.frame, event.frameTimestamp, stats);\n>  \t\tbreak;\n>  \t}\n>  \tdefault:\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 89E4FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  6 Nov 2021 10:27:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF32E6034E;\n\tSat,  6 Nov 2021 11:27:44 +0100 (CET)","from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52C0E600BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  6 Nov 2021 11:27:43 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay6-d.mail.gandi.net (Postfix) with ESMTPSA id B6E81C000B;\n\tSat,  6 Nov 2021 10:27:42 +0000 (UTC)"],"Date":"Sat, 6 Nov 2021 11:28:34 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<20211106102834.6q2otrgznxi4tyuo@uno.localdomain>","References":"<20211105163625.545541-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211105163625.545541-1-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: ipu3: List the events in\n\ttheir order 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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]