[{"id":20726,"web_url":"https://patchwork.libcamera.org/comment/20726/","msgid":"<163638635504.275423.4255522356753133264@Monstersaurus>","date":"2021-11-08T15:45:55","subject":"Re: [libcamera-devel] [PATCH 15/22] ipa: ipu3: Mark the beginning\n\tand and of a frame","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-08 13:13:43)\n> Introduce the skeleton for two functions which will be used to\n> instantiate a frame context, and do everything needed when a frame is\n> received. Do the same for the other end, once the algorithms have run\n> and updated the frame context to later deallocate the corresponding\n> frame context.\n> \n\nThese definitely make sense to me. I'm not sure if they need their own\npatch to add as a skeleton yet, but let see later.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nCan stand here, but I wonder if there's anything later that might make\nsense to squash in so they all build up together. Perhaps it's fine on\nit's own though.\n\n\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 31 +++++++++++++++++++++++++++++++\n>  1 file changed, 31 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 62df7819..dcf4da65 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -160,6 +160,14 @@ private:\n>         void setControls(unsigned int frame);\n>         void calculateBdsGrid(const Size &bdsOutputSize);\n>  \n> +       /*\n> +        * Internal events that mark the beginning of processing a new frame\n> +        * to the point that it has successfully completed processing its\n> +        * statistics.\n> +        */\n> +       void frameStarted(unsigned int frame);\n> +       void frameCompleted(unsigned int frame);\n> +\n>         std::map<unsigned int, MappedFrameBuffer> buffers_;\n>  \n>         ControlInfoMap ctrls_;\n> @@ -510,6 +518,14 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n>         }\n>  }\n>  \n> +void IPAIPU3::frameStarted([[maybe_unused]] unsigned int frame)\n> +{\n> +}\n> +\n> +void IPAIPU3::frameCompleted([[maybe_unused]] unsigned int frame)\n> +{\n> +}\n> +\n>  /**\n>   * \\brief Process an event generated by the pipeline handler\n>   * \\param[in] event The event sent from pipeline handler\n> @@ -525,6 +541,14 @@ void IPAIPU3::processEvent(const IPU3Event &event)\n>  {\n>         switch (event.op) {\n>         case EventProcessControls: {\n> +               /*\n> +                * To save incurring extra IPC calls, we do not send explicit events\n> +                * when a new request is started or completed.\n> +                * ProcessControls is the first event handled upon receipt of a new\n> +                * request, so we can handle all actions required to start processing\n> +                * a new frame.\n> +                */\n> +               frameStarted(event.frame);\n>                 processControls(event.frame, event.controls);\n>                 break;\n>         }\n> @@ -558,6 +582,13 @@ void IPAIPU3::processEvent(const IPU3Event &event)\n>                 context_.frameContext.agc.gain = camHelper_->gain(event.sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n>  \n>                 parseStatistics(event.frame, event.frameTimestamp, stats);\n> +               /*\n> +               * To save incurring extra IPC calls, we do not send explicit events\n\nIndentation is wrong in this block\n\n> +               * when we have completed all handling of a request.\n> +               * Once the statistics are fully processed, we will no longer handle this\n> +               * frame.\n> +               */\n> +               frameCompleted(event.frame);\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 2C360BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Nov 2021 15:46:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7A78F6034D;\n\tMon,  8 Nov 2021 16:45:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D84CE6032C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Nov 2021 16:45:57 +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 814DC4A6;\n\tMon,  8 Nov 2021 16:45:57 +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=\"dEdQ+WYO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636386357;\n\tbh=iHVu0Wf72cH/qzA//zbGPH5Q6Jzgxgs9j6qyYBc5e7k=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=dEdQ+WYO+oIKsUDyI65/9kKII6iALAhQsnFqaAaDSubM8LXDDnX/1AA+jaH5uZnZL\n\tnQk9UkS44IdoQ/6u3XM85j94Ho4RPh6n/kTAOMbgEi21Db09NYMvhE244LqXh/i3BS\n\t1yTuat62tQGN8C2Bq/ti581PKsfXVf8chfm+ezaw=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211108131350.130665-16-jeanmichel.hautbois@ideasonboard.com>","References":"<20211108131350.130665-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211108131350.130665-16-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":"Mon, 08 Nov 2021 15:45:55 +0000","Message-ID":"<163638635504.275423.4255522356753133264@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH 15/22] ipa: ipu3: Mark the beginning\n\tand and of a frame","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>"}}]