[{"id":31117,"web_url":"https://patchwork.libcamera.org/comment/31117/","msgid":"<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>","date":"2024-09-09T08:21:45","subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Milan\n\nOn 06/09/2024 13:09, 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> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.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 ddccd154..347fd69b 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>   \t[async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n> +\t[async] fillParamsBuffer(uint32 frame);\n>   \t[async] processStats(uint32 frame,\n>   \t\t\t     uint32 bufferId,\n>   \t\t\t     libcamera.ControlList sensorControls);\n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index eb3bbd92..3a0cb6e0 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -79,6 +79,7 @@ public:\n>   \tvoid stop() override;\n>   \n>   \tvoid queueRequest(const uint32_t frame, const ControlList &controls) override;\n> +\tvoid fillParamsBuffer(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> @@ -279,6 +280,13 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n>   \t\talgo->queueRequest(context_, frame, frameContext, controls);\n>   }\n>   \n> +void IPASoftSimple::fillParamsBuffer(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([[maybe_unused]] const uint32_t frame,\n>   \t\t\t\t [[maybe_unused]] const uint32_t bufferId,\n>   \t\t\t\t const ControlList &sensorControls)\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index eda18947..564e44e8 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -352,6 +352,7 @@ void SoftwareIsp::stop()\n>    */\n>   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>   {\n> +\tipa_->fillParamsBuffer(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 11D1BBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Sep 2024 08:21:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D772C634F4;\n\tMon,  9 Sep 2024 10:21:50 +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 6A058634E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2024 10:21:48 +0200 (CEST)","from [192.168.0.53] (213-229-8-243.static.upcbusiness.at\n\t[213.229.8.243])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 582203EA;\n\tMon,  9 Sep 2024 10:20:32 +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=\"mCBrQ/Un\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725870032;\n\tbh=0ZmNlFntC5d2UMxJ85B8WSxlCH+h4s6dJ4kenkbbuIw=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=mCBrQ/UnfdJ8FW2atgDc01RGrNLmfNM9jotwzT8xnyHlOkfzk22dFkgHtdbqC5z3F\n\tDVuNBNFWhVFDRPlGus6QPTksLaca1wDtNera9SGAScRLIO4VX+EugsOPDhn6Bv+E09\n\t7cjhrbhD1yjbGv0XBQC3CMEYZDE9TwyMbJJaBAt0=","Message-ID":"<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>","Date":"Mon, 9 Sep 2024 09:21:45 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Umang Jain <umang.jain@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20240906120927.4071508-1-mzamazal@redhat.com>\n\t<20240906120927.4071508-12-mzamazal@redhat.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6BqkQALgeD6KnXSWwaoCULp18etYW\n\tB31bfgrdphXQ5kUQibB0ADK8DERB4wrzrUb5CMxLBFE7mQty+v5NsP0OFNK9XTaAOcmD+Ove\n\teIjYvqurAaro91jrRVrS1gBRxIFqyPgNvwwL+alMZhn3/2jU2uvBmuRrgnc/e9cHKiuT3Dtq\n\tMHGPKL2m+plk+7tjMoQFfexoQ1JKugHAjxAhJfrkXh6uS6rc01bYCyo7ybzg53m1HLFJdNGX\n\tsUKR+dQpBs3SY4s66tc1sREJqdYyTsSZf80HjIeJjU/hRunRo4NjRIJwhvnK1GyjOvvuCKVU\n\tRWpY8dNjNu5OeAfdrlvFJOxIE9M8JuYCQTMULqd1NuzbpFMjc9524U3Cngs589T7qUMPb1H1\n\tNTA81LmtJ6Y+IV5/kiTUANflpzBwhu18Ok7kGyCq2a2jsOcVmk8gZNs04gyjuj8JziYwwLbf\n\tvzABwpFVcS8aR+nHIZV1HtOzyw8CsL8OySc3K9y+Y0NRpziMRvutrppzgyMb9V+N31mK9Mxl\n\t1YkgaTl4ciNWpdfUe0yxH03OCuHi3922qhPLF4XX5LN+NaVw5Xz2o3eeWklXdouxwV7QlN33\n\tu4+u2FWzKxDqO6WLQGjxPE0mVB4Gh5Pa1Vb0ct9Ctg0qElvtGQARAQABzShEYW4gU2NhbGx5\n\tIDxkYW4uc2NhbGx5QGlkZWFzb25ib2FyZC5jb20+wsGNBBMBCAA3FiEEsdtt8OWP7+8SNfQe\n\tkiQuh/L+GMQFAmLydlIFCQWjmoACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRCSJC6H8v4YxDI2\n\tEAC2Gz0iyaXJkPInyshrREEWbo0CA6v5KKf3I/HlMPqkZ48bmGoYm4mEQGFWZJAT3K4ir8bg\n\tcEfs9V54gpbrZvdwS4abXbU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sEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<20240906120927.4071508-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":31138,"web_url":"https://patchwork.libcamera.org/comment/31138/","msgid":"<172591256065.2319503.10154182761143667451@ping.linuxembedded.co.uk>","date":"2024-09-09T20:09:20","subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Dan Scally (2024-09-09 09:21:45)\n> Hi Milan\n> \n> On 06/09/2024 13:09, 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> > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> \n> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.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 ddccd154..347fd69b 100644\n> > --- a/include/libcamera/ipa/soft.mojom\n> > +++ b/include/libcamera/ipa/soft.mojom\n> > @@ -24,6 +24,7 @@ interface IPASoftInterface {\n> >               => (int32 ret);\n> >   \n> >       [async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n> > +     [async] fillParamsBuffer(uint32 frame);\n> >       [async] processStats(uint32 frame,\n> >                            uint32 bufferId,\n> >                            libcamera.ControlList sensorControls);\n> > diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> > index eb3bbd92..3a0cb6e0 100644\n> > --- a/src/ipa/simple/soft_simple.cpp\n> > +++ b/src/ipa/simple/soft_simple.cpp\n> > @@ -79,6 +79,7 @@ public:\n> >       void stop() override;\n> >   \n> >       void queueRequest(const uint32_t frame, const ControlList &controls) override;\n> > +     void fillParamsBuffer(const uint32_t frame) override;\n> >       void processStats(const uint32_t frame, const uint32_t bufferId,\n> >                         const ControlList &sensorControls) override;\n> >   \n> > @@ -279,6 +280,13 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n> >               algo->queueRequest(context_, frame, frameContext, controls);\n> >   }\n> >   \n> > +void IPASoftSimple::fillParamsBuffer(const uint32_t frame)\n> > +{\n> > +     IPAFrameContext &frameContext = context_.frameContexts.get(frame);\n> > +     for (auto const &algo : algorithms())\n> > +             algo->prepare(context_, frame, frameContext, params_);\n\nThis doesn't fill a parameter buffer. Do we anticipate having a\nstructured buffer to pass to the SoftISP components?\n\nOtherwise perhaps we should just call this\n\t'IPASoftSimple::prepare(const uint32_t frame)'\n\n\n> > +}\n> > +\n> >   void IPASoftSimple::processStats([[maybe_unused]] const uint32_t frame,\n> >                                [[maybe_unused]] const uint32_t bufferId,\n> >                                const ControlList &sensorControls)\n> > diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> > index eda18947..564e44e8 100644\n> > --- a/src/libcamera/software_isp/software_isp.cpp\n> > +++ b/src/libcamera/software_isp/software_isp.cpp\n> > @@ -352,6 +352,7 @@ void SoftwareIsp::stop()\n> >    */\n> >   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n> >   {\n> > +     ipa_->fillParamsBuffer(frame);\n\nOh... are we mixing prepare and process calls?\n\nI'll have to take a look at the bigger picture ....\n\n> >       debayer_->invokeMethod(&DebayerCpu::process,\n> >                              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 66E64BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Sep 2024 20:09:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 48335634EE;\n\tMon,  9 Sep 2024 22:09:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7004F634EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2024 22:09:23 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D18DE827;\n\tMon,  9 Sep 2024 22:08:06 +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=\"aNcblprV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725912486;\n\tbh=RAglITSQAoA90vEHByICvgte528lamXYmJ+MJvipzQE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=aNcblprVNvuSPC0wUapwMg7y2ltuqg8CQJ71ji28ACR9aVHlAgutaQH1d/9Je87PG\n\tV/jDe/gB8AvfHa08bwMWi6mxB2s2TlBLL2M1qoICfx3PNBCPIw8NpyzUvUY6OJdUUV\n\tq7zhcEk1SwJvPKrRsWJDK60b81FRN0AhwYCUu2R0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>","References":"<20240906120927.4071508-1-mzamazal@redhat.com>\n\t<20240906120927.4071508-12-mzamazal@redhat.com>\n\t<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>","Subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Umang Jain <umang.jain@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Dan Scally <dan.scally@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Mon, 09 Sep 2024 21:09:20 +0100","Message-ID":"<172591256065.2319503.10154182761143667451@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":31140,"web_url":"https://patchwork.libcamera.org/comment/31140/","msgid":"<172591395648.2319503.2893055799320510338@ping.linuxembedded.co.uk>","date":"2024-09-09T20:32:36","subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kieran Bingham (2024-09-09 21:09:20)\n> Quoting Dan Scally (2024-09-09 09:21:45)\n> > Hi Milan\n> > \n> > On 06/09/2024 13:09, 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> > > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> > > ---\n> > \n> > Reviewed-by: Daniel Scally <dan.scally@ideasonboard.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 ddccd154..347fd69b 100644\n> > > --- a/include/libcamera/ipa/soft.mojom\n> > > +++ b/include/libcamera/ipa/soft.mojom\n> > > @@ -24,6 +24,7 @@ interface IPASoftInterface {\n> > >               => (int32 ret);\n> > >   \n> > >       [async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n> > > +     [async] fillParamsBuffer(uint32 frame);\n> > >       [async] processStats(uint32 frame,\n> > >                            uint32 bufferId,\n> > >                            libcamera.ControlList sensorControls);\n> > > diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> > > index eb3bbd92..3a0cb6e0 100644\n> > > --- a/src/ipa/simple/soft_simple.cpp\n> > > +++ b/src/ipa/simple/soft_simple.cpp\n> > > @@ -79,6 +79,7 @@ public:\n> > >       void stop() override;\n> > >   \n> > >       void queueRequest(const uint32_t frame, const ControlList &controls) override;\n> > > +     void fillParamsBuffer(const uint32_t frame) override;\n> > >       void processStats(const uint32_t frame, const uint32_t bufferId,\n> > >                         const ControlList &sensorControls) override;\n> > >   \n> > > @@ -279,6 +280,13 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n> > >               algo->queueRequest(context_, frame, frameContext, controls);\n> > >   }\n> > >   \n> > > +void IPASoftSimple::fillParamsBuffer(const uint32_t frame)\n> > > +{\n> > > +     IPAFrameContext &frameContext = context_.frameContexts.get(frame);\n> > > +     for (auto const &algo : algorithms())\n> > > +             algo->prepare(context_, frame, frameContext, params_);\n> \n> This doesn't fill a parameter buffer. Do we anticipate having a\n> structured buffer to pass to the SoftISP components?\n> \n> Otherwise perhaps we should just call this\n>         'IPASoftSimple::prepare(const uint32_t frame)'\n> \n> \n> > > +}\n> > > +\n> > >   void IPASoftSimple::processStats([[maybe_unused]] const uint32_t frame,\n> > >                                [[maybe_unused]] const uint32_t bufferId,\n> > >                                const ControlList &sensorControls)\n> > > diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> > > index eda18947..564e44e8 100644\n> > > --- a/src/libcamera/software_isp/software_isp.cpp\n> > > +++ b/src/libcamera/software_isp/software_isp.cpp\n> > > @@ -352,6 +352,7 @@ void SoftwareIsp::stop()\n> > >    */\n> > >   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n> > >   {\n> > > +     ipa_->fillParamsBuffer(frame);\n> \n> Oh... are we mixing prepare and process calls?\n> \n> I'll have to take a look at the bigger picture ....\n\nAha - no - this does make sense because this is the 'process' stages of\nthe SoftISP which is the 'running' process.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> > >       debayer_->invokeMethod(&DebayerCpu::process,\n> > >                              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 B0F59BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 Sep 2024 20:32:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0C55634EE;\n\tMon,  9 Sep 2024 22:32:40 +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 4152D634EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2024 22:32:39 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD5F6827;\n\tMon,  9 Sep 2024 22:31:22 +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=\"RgSDJfgA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725913882;\n\tbh=AJrgLVrqzKVaxk88iw7ex0qCmqsAL5F3SJCDF6jd6zg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=RgSDJfgA1udXTNx/+82wQE3+AHS0YC4EdXvPOWgXKqkntlczzU9NXZaMIRuwQ7Fk6\n\tr0DclebXJqXOSNcMNVvbBjsDZJn1LgdCIBdctjIuUQcZAnA5E5QPVXubLqgkVmoX4q\n\teIwr9b8uR3PY/Tc+r4HCtOHB/Bc5CgZ12LvPytH4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<172591256065.2319503.10154182761143667451@ping.linuxembedded.co.uk>","References":"<20240906120927.4071508-1-mzamazal@redhat.com>\n\t<20240906120927.4071508-12-mzamazal@redhat.com>\n\t<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>\n\t<172591256065.2319503.10154182761143667451@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Umang Jain <umang.jain@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Dan Scally <dan.scally@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Mon, 09 Sep 2024 21:32:36 +0100","Message-ID":"<172591395648.2319503.2893055799320510338@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":31276,"web_url":"https://patchwork.libcamera.org/comment/31276/","msgid":"<8734lvmt6u.fsf@redhat.com>","date":"2024-09-19T17:47:37","subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Kieran,\n\nthank you for review.\n\nKieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Quoting Kieran Bingham (2024-09-09 21:09:20)\n>> Quoting Dan Scally (2024-09-09 09:21:45)\n>> > Hi Milan\n>\n>> > \n>> > On 06/09/2024 13:09, 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>> > > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n>> > > ---\n>> > \n>> > Reviewed-by: Daniel Scally <dan.scally@ideasonboard.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 ddccd154..347fd69b 100644\n>> > > --- a/include/libcamera/ipa/soft.mojom\n>> > > +++ b/include/libcamera/ipa/soft.mojom\n>> > > @@ -24,6 +24,7 @@ interface IPASoftInterface {\n>> > >               => (int32 ret);\n>> > >   \n>> > >       [async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n>> > > +     [async] fillParamsBuffer(uint32 frame);\n>> > >       [async] processStats(uint32 frame,\n>> > >                            uint32 bufferId,\n>> > >                            libcamera.ControlList sensorControls);\n>> > > diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n>> > > index eb3bbd92..3a0cb6e0 100644\n>> > > --- a/src/ipa/simple/soft_simple.cpp\n>> > > +++ b/src/ipa/simple/soft_simple.cpp\n>> > > @@ -79,6 +79,7 @@ public:\n>> > >       void stop() override;\n>> > >   \n>> > >       void queueRequest(const uint32_t frame, const ControlList &controls) override;\n>> > > +     void fillParamsBuffer(const uint32_t frame) override;\n>> > >       void processStats(const uint32_t frame, const uint32_t bufferId,\n>> > >                         const ControlList &sensorControls) override;\n>> > >   \n>> > > @@ -279,6 +280,13 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro\n>> > >               algo->queueRequest(context_, frame, frameContext, controls);\n>> > >   }\n>> > >   \n>> > > +void IPASoftSimple::fillParamsBuffer(const uint32_t frame)\n>> > > +{\n>> > > +     IPAFrameContext &frameContext = context_.frameContexts.get(frame);\n>> > > +     for (auto const &algo : algorithms())\n>> > > +             algo->prepare(context_, frame, frameContext, params_);\n>> \n>> This doesn't fill a parameter buffer. Do we anticipate having a\n>> structured buffer to pass to the SoftISP components?\n>> \n>> Otherwise perhaps we should just call this\n>>         'IPASoftSimple::prepare(const uint32_t frame)'\n\nIt has been renamed from IPASoftSimple::prepare to\nIPASoftSimple::fillParamsBuffer on Laurent's request, for consistency\nwith the other pipelines.  params_ is a mmaped structure, a single slot\ncurrently but it will be selected from a ring in a followup patch\nseries; so I think \"buffer\" in the name is not completely off.\n\n>> > > +}\n>> > > +\n>> > >   void IPASoftSimple::processStats([[maybe_unused]] const uint32_t frame,\n>> > >                                [[maybe_unused]] const uint32_t bufferId,\n>> > >                                const ControlList &sensorControls)\n>> > > diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n>> > > index eda18947..564e44e8 100644\n>> > > --- a/src/libcamera/software_isp/software_isp.cpp\n>> > > +++ b/src/libcamera/software_isp/software_isp.cpp\n>> > > @@ -352,6 +352,7 @@ void SoftwareIsp::stop()\n>> > >    */\n>> > >   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>> > >   {\n>> > > +     ipa_->fillParamsBuffer(frame);\n>> \n>> Oh... are we mixing prepare and process calls?\n>> \n>> I'll have to take a look at the bigger picture ....\n>\n> Aha - no - this does make sense because this is the 'process' stages of\n> the SoftISP which is the 'running' process.\n\nYes.\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>> \n>> > >       debayer_->invokeMethod(&DebayerCpu::process,\n>> > >                              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 B3B9AC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Sep 2024 17:47:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B668634FC;\n\tThu, 19 Sep 2024 19:47: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 AC8C2618E7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Sep 2024 19:47:46 +0200 (CEST)","from mail-lf1-f70.google.com (mail-lf1-f70.google.com\n\t[209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-615-iD9kdGu2NoyAcoR0hUNMWA-1; Thu, 19 Sep 2024 13:47:42 -0400","by mail-lf1-f70.google.com with SMTP id\n\t2adb3069b0e04-5365f58edcaso1333332e87.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Sep 2024 10:47:41 -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-5c42bc8907asm6588663a12.85.2024.09.19.10.47.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Sep 2024 10:47: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=\"asF6TemM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1726768065;\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=NHua/+y2dvoGsqyJ/k2Tn4aYTisMb8cfEK55DNHsc60=;\n\tb=asF6TemMUJXGzmZPPjJkYPnbGkOnegYEWf+EByWZQNCxAcM1yV2C9orAJDkHcoyPhllteO\n\tlqVXSwe7Isn4ULM6qUtAaLsuc0PjQnA6MJla3TNRb1KSFHxa9r2AF0YVozlmxTiAtr+tPs\n\tJxlGsrYlMq/pqZTtoVzcb5hL0ZWSQqY=","X-MC-Unique":"iD9kdGu2NoyAcoR0hUNMWA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1726768061; x=1727372861;\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=NHua/+y2dvoGsqyJ/k2Tn4aYTisMb8cfEK55DNHsc60=;\n\tb=OX3eYxEDILDnExIGiS+f274sppCubrKtrdjZ23i8KFHQHZu+c6piOoNh0A1FREeWt3\n\tUPKSwgbhQxJlWyKfsFa8y9pzxIxOWIlgAKh9u/fzY7fCqZi/iZfidkMOQeNe1CsXekoO\n\tkgb5PJMIpdABBhYYW1NKYW13vJvzAjjW5D42H2QEY+um56pr2LGrXm2JrM/cRg3bFZpy\n\tXyVxZxlYL+cXuEw3wkn+NJs1GB9Gim9LIhQqydu8W4G2L3LEc6SujNdgUWPWL10q8nXn\n\tofL+zXk8O1GswtwWVSeAIL39+YS40NtQSQcKTWu5IMKjsqBje59sVksRmFHmuQuBwuJf\n\ttWWg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCXG95AR1N1+Lmd5vsXs3H1C6mnjgED/ePr1X1HDm8EuFJodK4diVT6XhU+ypT1w44Pg6axFferjpVpeeoZEsZY=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YzdbbGf8I9jV1kEVbGAxN3O0Q6buXlarrHcj8P94TRdHd7nDyp+\n\txAvmLBW/D+CHd7Yd7I7Yvi7A8Q0nj5LfArgoPtPrp1oPIvbxFwbJ8KDakuRXK5xOxiJu+BgjDgj\n\tEESZ0+kFBX3MiuKPHovhABNnO+gXgqyMYSrm0LZGi1RLrWEwBgKGItmgEmJxix5qEQdd1DLQ=","X-Received":["by 2002:a05:6512:3dac:b0:535:6892:3be3 with SMTP id\n\t2adb3069b0e04-536ac31d6bcmr67906e87.41.1726768060556; \n\tThu, 19 Sep 2024 10:47:40 -0700 (PDT)","by 2002:a05:6512:3dac:b0:535:6892:3be3 with SMTP id\n\t2adb3069b0e04-536ac31d6bcmr67889e87.41.1726768060040; \n\tThu, 19 Sep 2024 10:47:40 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFUq1dL151vF6elwVebjgxEFHzbJcMjaWJB3HTK6Y0XldP9QUxuGWq7ZnZlix2RXBfcv+i1OQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Dan Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,  Umang Jain\n\t<umang.jain@ideasonboard.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v6 11/18] libcamera: software_isp: Call\n\tAlgorithm::prepare","In-Reply-To":"<172591395648.2319503.2893055799320510338@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Mon, 09 Sep 2024 21:32:36 +0100\")","References":"<20240906120927.4071508-1-mzamazal@redhat.com>\n\t<20240906120927.4071508-12-mzamazal@redhat.com>\n\t<770a78c8-5d4d-41e6-ad0b-47db1f35c5af@ideasonboard.com>\n\t<172591256065.2319503.10154182761143667451@ping.linuxembedded.co.uk>\n\t<172591395648.2319503.2893055799320510338@ping.linuxembedded.co.uk>","Date":"Thu, 19 Sep 2024 19:47:37 +0200","Message-ID":"<8734lvmt6u.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>"}}]