[{"id":30400,"web_url":"https://patchwork.libcamera.org/comment/30400/","msgid":"<5a03320a-86a7-4cb4-b6aa-e56f5d6f18ef@ideasonboard.com>","date":"2024-07-13T16:07:56","subject":"Re: [PATCH v2 12/19] libcamera: software_isp: Call\n\tAlgorithm::prepare","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Milan\n\nThank you for the patch\n\nOn 03/07/24 11:21 pm, Milan Zamazal wrote:\n> This patch adds Algorithm::prepare call for the defined algorithms.\n> This is preparation only since there are currently no Algorithm based\n> algorithms defined.\n>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   include/libcamera/ipa/soft.mojom            | 1 +\n>   src/ipa/simple/soft_simple.cpp              | 8 ++++++++\n>   src/libcamera/software_isp/software_isp.cpp | 1 +\n>   3 files changed, 10 insertions(+)\n>\n> diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\n> index 426fee18..1777012a 100644\n> --- a/include/libcamera/ipa/soft.mojom\n> +++ b/include/libcamera/ipa/soft.mojom\n> @@ -24,6 +24,7 @@ interface IPASoftInterface {\n>   \t\t=> (int32 ret);\n>   \n>   \tqueueRequest(uint32 frame, libcamera.ControlList sensorControls);\n> +\tprepare(uint32 frame);\n\nThis is interesting, since no other IPA gets a prepare() call but SoftIPA.\n\nBut it makes total sense here - to be able to prepare the algorithm \nbefore the frame is processed.\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n>   \t[async] processStats(uint32 frame, uint32 bufferId, libcamera.ControlList sensorControls);\n>   };\n>   \n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index bd0dea5f..f4a6bdf4 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -78,6 +78,7 @@ public:\n>   \tvoid stop() override;\n>   \n>   \tvoid queueRequest(const uint32_t frame, const ControlList &controls) override;\n> +\tvoid prepare(const uint32_t frame) override;\n>   \tvoid processStats(const uint32_t frame, const uint32_t bufferId,\n>   \t\t\t  const ControlList &sensorControls) override;\n>   \n> @@ -278,6 +279,13 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n>   \t\talgo->queueRequest(context_, frame, frameContext, controls);\n>   }\n>   \n> +void IPASoftSimple::prepare(const uint32_t frame)\n> +{\n> +\tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n> +\tfor (auto const &algo : algorithms())\n> +\t\talgo->prepare(context_, frame, frameContext, params_);\n> +}\n> +\n>   void IPASoftSimple::processStats(\n>   \t[[maybe_unused]] const uint32_t frame,\n>   \t[[maybe_unused]] const uint32_t bufferId,\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index 4e6b3a2e..38a284ef 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -359,6 +359,7 @@ void SoftwareIsp::stop()\n>    */\n>   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>   {\n> +\tipa_->prepare(frame);\n>   \tdebayer_->invokeMethod(&DebayerCpu::process,\n>   \t\t\t       ConnectionTypeQueued, frame, input, output, debayerParams_);\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 7E492BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 13 Jul 2024 16:08:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C3D1663369;\n\tSat, 13 Jul 2024 18:08:03 +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 251A263365\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2024 18:08:02 +0200 (CEST)","from [IPV6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f] (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F9617E4;\n\tSat, 13 Jul 2024 18:07:26 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"eRaytytK\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720886847;\n\tbh=KsH3u3/QCbsQwfgcm7FHufxxw0AHj4p4GjmfSjWD6Vg=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=eRaytytKRr+b79L94X8q/8iaLq7WK1OWRaz4DDn9sFpnwUGMctRFJUHUn/RwhjvUl\n\tSkyhTbK9k8KMEUEBfhOXTVrVxJnaBAISY3PVkv9hA/vy+8PN6lJeJZdGU2jp7b+Pk3\n\tyy9sBHEW3yzE6GL4oNMtefEQWq7uxKE5VfBnI+jc=","Message-ID":"<5a03320a-86a7-4cb4-b6aa-e56f5d6f18ef@ideasonboard.com>","Date":"Sat, 13 Jul 2024 21:37:56 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 12/19] libcamera: software_isp: Call\n\tAlgorithm::prepare","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","References":"<20240703175119.1872585-1-mzamazal@redhat.com>\n\t<20240703175119.1872585-13-mzamazal@redhat.com>","Content-Language":"en-US","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20240703175119.1872585-13-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}}]