[{"id":30151,"web_url":"https://patchwork.libcamera.org/comment/30151/","msgid":"<ae1d66d9-357d-4e14-90d5-c023c65cdebc@ideasonboard.com>","date":"2024-06-29T04:41:18","subject":"Re: [PATCH 11/19] libcamera: software_isp: Call Algorithm::prepare","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Milan\n\nOn 26/06/24 12:50 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 bd48ece9..4975b251 100644\n> --- a/include/libcamera/ipa/soft.mojom\n> +++ b/include/libcamera/ipa/soft.mojom\n> @@ -19,6 +19,7 @@ interface IPASoftInterface {\n>   \tconfigure(libcamera.ControlInfoMap sensorCtrlInfoMap)\n>   \t\t=> (int32 ret);\n>   \n> +        prepare(uint32 frame);\n\nmisaligned\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 c0cb6769..9387508e 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -78,6 +78,7 @@ public:\n>   \tint start() override;\n>   \tvoid stop() override;\n>   \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> @@ -264,6 +265,13 @@ void IPASoftSimple::stop()\n>   {\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>   \tconst 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 aa60fb5f..812bc910 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -347,6 +347,7 @@ void SoftwareIsp::stop()\n>    */\n>   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>   {\n> +\tipa_->prepare(frame);\n\nThe algo->prepare() loop can be in-lined here. I don't (yet) the benefit \nof having and calling a separate function as ipa_->prepare().\n\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 A538FBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 29 Jun 2024 04:41:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8377362C99;\n\tSat, 29 Jun 2024 06:41:25 +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 0ED26619C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Jun 2024 06:41:24 +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 5EBA84B0;\n\tSat, 29 Jun 2024 06:40:58 +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=\"JDAhYwHn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719636059;\n\tbh=tCV7st5KMrFqElFG89QFsqK4hNsRyEf5zhQQm8B9VNI=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=JDAhYwHn5KdPtITp5jvwn1Ai8QZKl9txsAaTmyC8iCoxUT0mVv/hJQL0MWEaZiD2l\n\trTEhqyFAEqKNVgqFsXYr595kQI8V6qAexReHxHhK6dR/Nf2a8qOr2YtrswFbwPcgEo\n\te4W8GXahT1ntdWBi4YPTf0NMbT5BUC26OBOAC6mM=","Message-ID":"<ae1d66d9-357d-4e14-90d5-c023c65cdebc@ideasonboard.com>","Date":"Sat, 29 Jun 2024 10:11:18 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 11/19] libcamera: software_isp: Call Algorithm::prepare","Content-Language":"en-US","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","References":"<20240626072100.55497-1-mzamazal@redhat.com>\n\t<20240626072100.55497-12-mzamazal@redhat.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20240626072100.55497-12-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>"}},{"id":30280,"web_url":"https://patchwork.libcamera.org/comment/30280/","msgid":"<87bk3ejt9u.fsf@redhat.com>","date":"2024-07-03T17:10:37","subject":"Re: [PATCH 11/19] libcamera: software_isp: Call Algorithm::prepare","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Umang,\n\nthank you for review.\n\nUmang Jain <umang.jain@ideasonboard.com> writes:\n\n> Hi Milan\n>\n> On 26/06/24 12:50 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 bd48ece9..4975b251 100644\n>> --- a/include/libcamera/ipa/soft.mojom\n>> +++ b/include/libcamera/ipa/soft.mojom\n>> @@ -19,6 +19,7 @@ interface IPASoftInterface {\n>>   \tconfigure(libcamera.ControlInfoMap sensorCtrlInfoMap)\n>>   \t\t=> (int32 ret);\n>>   +        prepare(uint32 frame);\n>\n> misaligned\n>>   \t[async] processStats(uint32 frame, uint32 bufferId, libcamera.ControlList sensorControls);\n>>   };\n>>   diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n>> index c0cb6769..9387508e 100644\n>> --- a/src/ipa/simple/soft_simple.cpp\n>> +++ b/src/ipa/simple/soft_simple.cpp\n>> @@ -78,6 +78,7 @@ public:\n>>   \tint start() override;\n>>   \tvoid stop() 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>>   @@ -264,6 +265,13 @@ void IPASoftSimple::stop()\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>>   \tconst 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 aa60fb5f..812bc910 100644\n>> --- a/src/libcamera/software_isp/software_isp.cpp\n>> +++ b/src/libcamera/software_isp/software_isp.cpp\n>> @@ -347,6 +347,7 @@ void SoftwareIsp::stop()\n>>    */\n>>   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>>   {\n>> +\tipa_->prepare(frame);\n>\n> The algo->prepare() loop can be in-lined here. I don't (yet) the benefit of having\n> and calling a separate function as ipa_->prepare().\n\nI'm not sure I understand correctly what you mean here.  algo->prepare()\nis an IPA thing, i.e. belonging to ipa_ conceptually, and it requires\nthe IPA context, which is not available here.\n\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 AF4A0BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Jul 2024 17:10:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6EDB62C96;\n\tWed,  3 Jul 2024 19:10:48 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CBEBC62C95\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Jul 2024 19:10:46 +0200 (CEST)","from mail-ed1-f69.google.com (mail-ed1-f69.google.com\n\t[209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-631-rITMIxLyMnew5iwq-ejrzg-1; Wed, 03 Jul 2024 13:10:42 -0400","by mail-ed1-f69.google.com with SMTP id\n\t4fb4d7f45d1cf-58c98ce7d00so1107465a12.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 03 Jul 2024 10:10:42 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t4fb4d7f45d1cf-5861324dca6sm7276977a12.31.2024.07.03.10.10.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 03 Jul 2024 10:10:38 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"IgyRlaxC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1720026645;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=Z8EjB5CF09SBRpxM9qMmrKBDkjNBSxutsGP+uot7wFI=;\n\tb=IgyRlaxC5QPBLsYIPlO/CA7s2SBJPcagr9EDKhFXkwyxJ/sR+h2q1SqmKlqMot3RKoNBHl\n\tPpdbsqmF45iP5GoEtGB1ujutNtWYPE2IqZzWap01xNUlInPcO1d4aT8C7pMyHWT+zxgEMl\n\teavTDQWQzzHCUpMCGGyxe92bdyMxkfw=","X-MC-Unique":"rITMIxLyMnew5iwq-ejrzg-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1720026640; x=1720631440;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Z8EjB5CF09SBRpxM9qMmrKBDkjNBSxutsGP+uot7wFI=;\n\tb=rSvAnPKWQCpum57VdNgZZqWjPP3Cv+aXBEMY2Z+IDsBE6YCHZBen0oPjGolU3TrJw5\n\tqs15KuOpZHFVLrOMQ1tdzlZsMPPFKoZrbEmIda/DfcXHdEIzZHiCftSEWiax2AjM3z9n\n\tdomh/+Ndc2zFj3lFetGXKJbabLAIj4CpvB2ZM+2GjLLauuRg3/9d1gc+fhkoSgDlHaXd\n\tBC5DkNmxuqlWJ2IavYek5qOlFLszkMYvtRq2ZPEr0xPd7sP/7rrq6RF4rNPORqYNhxOa\n\ttZOJNSwjc22TKyiODouORBxf7T5YrMZjfFQcbDDRpGHHuOHFXybNmqadNa0pGV3Iu2GA\n\tJN8g==","X-Gm-Message-State":"AOJu0YxfnQyDrK8NJ1gZypgmMqxatxLt2B5U3QJ2P2Y9V7voG5tr8KZx\n\tyVHtFuSpzbCEhN2XYqhSQPX3Rw4fCSGJCEQ7xDeeUR+kkmgQ/i2v24SqrpgQsMYXCVIzZyhqTR9\n\tKt4BN+JQ68SvWjIHmtK8G0SlyaMOyjNxMStFk1YyGfG90CVV6HCWSWeSJjBgp/95oAt4sv8xM+k\n\tfK013EW8VnuMsbZffTyjf81vfBQDxijaAnNYaGd/td8Uxytib7ln/yZrY=","X-Received":["by 2002:a05:6402:3510:b0:58d:b529:7dc3 with SMTP id\n\t4fb4d7f45d1cf-58db52981f9mr489817a12.19.1720026640217; \n\tWed, 03 Jul 2024 10:10:40 -0700 (PDT)","by 2002:a05:6402:3510:b0:58d:b529:7dc3 with SMTP id\n\t4fb4d7f45d1cf-58db52981f9mr489774a12.19.1720026638743; \n\tWed, 03 Jul 2024 10:10:38 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGS/lGMH6YlFCf75AEoHXquQnyFDSL1adJO73JRL01r3jxzhYdM5jz82mq8y+ynyjmnmV1/kA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 11/19] libcamera: software_isp: Call Algorithm::prepare","In-Reply-To":"<ae1d66d9-357d-4e14-90d5-c023c65cdebc@ideasonboard.com> (Umang\n\tJain's message of \"Sat, 29 Jun 2024 10:11:18 +0530\")","References":"<20240626072100.55497-1-mzamazal@redhat.com>\n\t<20240626072100.55497-12-mzamazal@redhat.com>\n\t<ae1d66d9-357d-4e14-90d5-c023c65cdebc@ideasonboard.com>","Date":"Wed, 03 Jul 2024 19:10:37 +0200","Message-ID":"<87bk3ejt9u.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]