[{"id":22766,"web_url":"https://patchwork.libcamera.org/comment/22766/","msgid":"<165053796656.3016671.9173899045895275060@Monstersaurus>","date":"2022-04-21T10:46:06","subject":"Re: [libcamera-devel] [PATCH 2/3] ipa: ipu3: Mark the beginning and\n\tend of a frame","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2022-03-10 20:51:29)\n> From: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> \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> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 20 ++++++++++++++++++++\n>  1 file changed, 20 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 81788b9a..3d5c5706 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -163,6 +163,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(const uint32_t frame);\n> +       void frameCompleted(const uint32_t frame);\n> +\n>         std::map<unsigned int, MappedFrameBuffer> buffers_;\n>  \n>         ControlInfoMap ctrls_;\n> @@ -491,6 +499,14 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n>         }\n>  }\n>  \n> +void IPAIPU3::frameStarted([[maybe_unused]] const uint32_t frame)\n> +{\n> +}\n> +\n> +void IPAIPU3::frameCompleted([[maybe_unused]] const uint32_t frame)\n> +{\n> +}\n> +\n>  /**\n>   * \\brief Prepare the ISP to process the Request\n>   * \\param[in] frame The frame number\n> @@ -549,6 +565,8 @@ void IPAIPU3::processControls(const uint32_t frame,\n>                               [[maybe_unused]] const ControlList &controls)\n\nAha, I was a bit confused, but I think this is now called queueRequest()\n\nIt will be interesting to see how we tie up a request that is queued to\nthe frame index that it will capture from. I think it works out in the\nend, as long as we ensure that requests are queued before we start the\ncamera ...\n\n(and now I can't recall, do we support starting the camera without\nrequests queued?...)\n\n\n>  {\n>         /* \\todo Start processing for 'frame' based on 'controls'. */\n> +\n> +       frameStarted(frame);\n>  }\n>  \n>  /**\n> @@ -620,6 +638,8 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>          */\n>  \n>         statsBufferReady.emit(frame, ctrls);\n> +\n> +       frameCompleted(frame);\n>  }\n>  \n>  /**\n> -- \n> 2.31.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 29D85C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Apr 2022 10:46:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 353B665646;\n\tThu, 21 Apr 2022 12:46:10 +0200 (CEST)","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 541C465641\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Apr 2022 12:46:09 +0200 (CEST)","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 CF14EEE;\n\tThu, 21 Apr 2022 12:46:08 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650537970;\n\tbh=ZGPxdNblAhAU+4H+mvuqFhQCbiSFBCGQT6i+xCiCm1c=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=xvBOSpi6iEktX2s4BcAtepTyzdLumrMjutO0tCC09EIremUJov7JoRjmV27D6q+4B\n\ttIHJx029gCRGuoUDSus3gyM20X2/XokfWHK5nBLPyUDr4lWrcpNVWv7DsFEb5mZdUO\n\tAd8n0xSeFl9ezWfjCIpR3yoHZXITME8JZAbj46Uh/DRgh0u5I5D6qTmKqwZC4ZpZHD\n\tXwGq45UZzut00UsCUOaRu8LzLKs8Wn235cimkPqj1dMEt/BKvpaTkWc43xJGrQvaAC\n\tUStKZR4ER42zIThgupU4qVa65kFJc5myZBPlRVhSEW4gPOqVFwcTZbW8a6MQBzC51G\n\tLuxnIDo1KYjgQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1650537968;\n\tbh=ZGPxdNblAhAU+4H+mvuqFhQCbiSFBCGQT6i+xCiCm1c=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=cNFcT5ylQxn1/zucUvS0Q55RjoS8ls/DLi4XnaLRulzXFk0X/MjaVeFPwF4fvmkvp\n\tKHZg3tzYJ1hlejw42kYVsNCzEKC/W15bXl1HtDpQ4O/CJSS+ayUHj9s29fzdfPhM0x\n\tK7mEmY8N6LrAjXXXKJubaPrWJEvb8ZrvvrftqRpU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"cNFcT5yl\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220310205130.336361-3-umang.jain@ideasonboard.com>","References":"<20220310205130.336361-1-umang.jain@ideasonboard.com>\n\t<20220310205130.336361-3-umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 21 Apr 2022 11:46:06 +0100","Message-ID":"<165053796656.3016671.9173899045895275060@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 2/3] ipa: ipu3: Mark the beginning and\n\tend 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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22779,"web_url":"https://patchwork.libcamera.org/comment/22779/","msgid":"<37d1eb1c-a3a4-1438-8ace-81903623311c@ideasonboard.com>","date":"2022-04-25T06:14:28","subject":"Re: [libcamera-devel] [PATCH 2/3] ipa: ipu3: Mark the beginning and\n\tend of a frame","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran\n\nOn 4/21/22 16:16, Kieran Bingham wrote:\n> Quoting Umang Jain (2022-03-10 20:51:29)\n>> From: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n>>\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>> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>> ---\n>>   src/ipa/ipu3/ipu3.cpp | 20 ++++++++++++++++++++\n>>   1 file changed, 20 insertions(+)\n>>\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 81788b9a..3d5c5706 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -163,6 +163,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(const uint32_t frame);\n>> +       void frameCompleted(const uint32_t frame);\n>> +\n>>          std::map<unsigned int, MappedFrameBuffer> buffers_;\n>>   \n>>          ControlInfoMap ctrls_;\n>> @@ -491,6 +499,14 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n>>          }\n>>   }\n>>   \n>> +void IPAIPU3::frameStarted([[maybe_unused]] const uint32_t frame)\n>> +{\n>> +}\n>> +\n>> +void IPAIPU3::frameCompleted([[maybe_unused]] const uint32_t frame)\n>> +{\n>> +}\n>> +\n>>   /**\n>>    * \\brief Prepare the ISP to process the Request\n>>    * \\param[in] frame The frame number\n>> @@ -549,6 +565,8 @@ void IPAIPU3::processControls(const uint32_t frame,\n>>                                [[maybe_unused]] const ControlList &controls)\n> Aha, I was a bit confused, but I think this is now called queueRequest()\n\n\nYep, this will go under a major rebase to adapt to new interface.\n\n>\n> It will be interesting to see how we tie up a request that is queued to\n> the frame index that it will capture from. I think it works out in the\n\n\nDiscussion is under progress. Either we can tie up Request sequence with \nframe number\n\nOR\n\nfor the HAL case, the Camera3RequestDescriptor gets a frame number/id \nfrom the framework. I am keen to use that too but for non-HAL cases it \nwon't suffice (or I need to develop an alternative mechanism)\n\nhttps://git.libcamera.org/libcamera/libcamera.git/tree/include/android/hardware/libhardware/include/hardware/camera3.h#n2228\n\n\n> end, as long as we ensure that requests are queued before we start the\n> camera ...\n>\n> (and now I can't recall, do we support starting the camera without\n> requests queued?...)\n\n\nInitially we dont.\n\nBut if there is a start/stop sequence, I think on next start, the \nrequest already queued will get satisfied first?\n\n>\n>\n>>   {\n>>          /* \\todo Start processing for 'frame' based on 'controls'. */\n>> +\n>> +       frameStarted(frame);\n>>   }\n>>   \n>>   /**\n>> @@ -620,6 +638,8 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>>           */\n>>   \n>>          statsBufferReady.emit(frame, ctrls);\n>> +\n>> +       frameCompleted(frame);\n>>   }\n>>   \n>>   /**\n>> -- \n>> 2.31.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 71C82C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Apr 2022 06:14:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B2F1B65644;\n\tMon, 25 Apr 2022 08:14:35 +0200 (CEST)","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 9F3A8604A8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Apr 2022 08:14:34 +0200 (CEST)","from [IPV6:2401:4900:1f3e:1694:a668:6c2b:aa4c:da5f] (unknown\n\t[IPv6:2401:4900:1f3e:1694:a668:6c2b:aa4c:da5f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3186330B;\n\tMon, 25 Apr 2022 08:14:32 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650867275;\n\tbh=q1Psdn8CRXi61K+JLUnzKn/zZubnQsYwpz18ysssVI4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=PKd1s8zgZR56prscW9Hy4GVnkWD9bAR8GSxCMqPzyb89tAk64dydDgrER4YIjKeQL\n\t+ZWipX+AoJY7thjv6Ud7eRTVJC1OUF247E9S+uci1ZeT0trJWdQe+k+TnqKxrSMEwH\n\tQBX7xFEiJvNSaHR1k9I5A7w74wCfyt3VAGe6BgVMZUJGW7mdhC091+ZrO/n0vf3s7/\n\tQGTpF/iNuh6pkMuYajchlI8wFVO5IPO1nshesMSm3+wAZdIO8eOEQ160j0nLN8M1fR\n\t5ipaePspfXxgSygR/fVAONJ49ggSpjyJfAGajtv4kV6Zrsi3jIJ6oLga+bTdyshMzh\n\tc/fpSXvOea5iA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1650867274;\n\tbh=q1Psdn8CRXi61K+JLUnzKn/zZubnQsYwpz18ysssVI4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=dJA6cPZ3t3FYSKb3BAfvXpkMgFV1WNQYOYzNjOaqCU337jNWUNEbzFs8FyINXqxmU\n\tazfeoJJVnEpnkPB4z/Msn46Qn9FH4LceOU5HqMxf96pnAp5/bMJxmOrKGQilV/hTJf\n\tIm8sA6IuGKlqO2HPzTikJyCo8YTPg2iDwpcJSelY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"dJA6cPZ3\"; dkim-atps=neutral","Message-ID":"<37d1eb1c-a3a4-1438-8ace-81903623311c@ideasonboard.com>","Date":"Mon, 25 Apr 2022 11:44:28 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220310205130.336361-1-umang.jain@ideasonboard.com>\n\t<20220310205130.336361-3-umang.jain@ideasonboard.com>\n\t<165053796656.3016671.9173899045895275060@Monstersaurus>","In-Reply-To":"<165053796656.3016671.9173899045895275060@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/3] ipa: ipu3: Mark the beginning and\n\tend 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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]