[{"id":15425,"web_url":"https://patchwork.libcamera.org/comment/15425/","msgid":"<CAEmqJPo23c5qU5jSnCH5oT-h-mbe8upRO+gMYn-JeDWCpM+dVA@mail.gmail.com>","date":"2021-03-02T15:16:43","subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nThank you for your patch.\n\nOn Tue, 2 Mar 2021 at 15:05, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> It can be useful for pipeline handlers to pass additional parameters to\n> the IPA init() method. Allow doing so.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  .../libcamera_templates/module_ipa_proxy.cpp.tmpl         | 2 +-\n>  .../generators/libcamera_templates/proxy_functions.tmpl   | 8 ++++++--\n>  utils/ipc/generators/mojom_libcamera_generator.py         | 3 ---\n>  3 files changed, 7 insertions(+), 6 deletions(-)\n>\n> diff --git\n> a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> index d451fab35e83..f2f9128b056c 100644\n> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> @@ -142,7 +142,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage\n> &data)\n>  {{proxy_funcs.func_sig(proxy_name, method, \"Thread\")}}\n>  {\n>  {%- if method.mojom_name == \"init\" %}\n> -       {{proxy_funcs.init_thread_body()}}\n> +       {{proxy_funcs.init_thread_body(method)}}\n>  {%- elif method.mojom_name == \"stop\" %}\n>         {{proxy_funcs.stop_thread_body()}}\n>  {%- elif method.mojom_name == \"start\" %}\n> diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> index 40611feb179b..222a2a63764d 100644\n> --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> @@ -22,8 +22,12 @@\n>  {#\n>   # \\brief Generate function body for IPA init() function for thread\n>   #}\n> -{%- macro init_thread_body() -%}\n> -       int ret = ipa_->init(settings);\n> +{%- macro init_thread_body(method) -%}\n> +       int ret = ipa_->init(\n> +       {%- for param in method|method_param_names -%}\n> +               {{param}}{{- \", \" if not loop.last}}\n> +       {%- endfor -%}\n> +);\n>         if (ret)\n>                 return ret;\n>\n> diff --git a/utils/ipc/generators/mojom_libcamera_generator.py\n> b/utils/ipc/generators/mojom_libcamera_generator.py\n> index 438e41c649ad..2bfc4af23231 100644\n> --- a/utils/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n> @@ -346,10 +346,7 @@ def ValidateInterfaces(interfaces):\n>      f_stop  = f_stop[0]\n>\n>      # Validate parameters to init()\n> -    ValidateSingleLength(f_init.parameters, 'input parameter to init()')\n>      ValidateSingleLength(f_init.response_parameters, 'output parameter\n> from init()')\n> -    if f_init.parameters[0].kind.mojom_name != 'IPASettings':\n> -        raise Exception('init() must have single IPASettings input\n> parameter')\n>      if f_init.response_parameters[0].kind.spec != 'i32':\n>          raise Exception('init() must have single int32 output parameter')\n>\n\nAs discussed, it would be really useful if the restriction on the return\nvalue from init() could be relaxed as well.\nHopefully this will not be too complicated to achieve :-)\n\nRegards,\nNaush\n\n\n\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\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 C544CBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Mar 2021 15:17:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 558BA68A93;\n\tTue,  2 Mar 2021 16:17:03 +0100 (CET)","from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com\n\t[IPv6:2a00:1450:4864:20::12f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C35168A7E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Mar 2021 16:17:02 +0100 (CET)","by mail-lf1-x12f.google.com with SMTP id d3so31804529lfg.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 02 Mar 2021 07:17:01 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"cKWcBNoZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=v2O53YWLEN4TNBFAQE8ylc1v/mzszpn9KukaPlsWIeI=;\n\tb=cKWcBNoZLX1NSrg9lQvWDbwDIz5BXS57RzG02akPMl6CWU3hN22CnzpyjAZvhAGYFl\n\tNO1txfiZUOoy+S9NG+gw5WWlENsVNiacN4paJ9N73HXMQdk0t2w80/2eRcXMcPu2Qu1n\n\tdQWgElJZ5a8QmdjXLE8K7urryn7ULYnM6mevGtfKUC2Xa4RPsDZ+JaSil2hN4CpXCljP\n\t0JXB68mEJFbmUPOa2jWCBuqrucH2XoN2BsKhlJHN5Th3IgIF45wSNmG63TpvPOQ6TD6B\n\tB6JffeMVtT6eV/wzq31Nw2YR3tiWCNnOENOkIJTd5RLPJkJWc7YV3j510M8eGcdCdPTU\n\tyFuQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=v2O53YWLEN4TNBFAQE8ylc1v/mzszpn9KukaPlsWIeI=;\n\tb=P5VYRgmBYaeoGpPIhvMoyypRsTUWoiU+mxQdo8FQHGG7ME68BRy1ZqH1zz0/WbhQFo\n\tttjEaZauczgnlO6T43BnDtfdRT9TtX+aWweK/xPsgDi/udEqalYKPn2A+WqDLzl2ynuc\n\tUEQBhazI7Jt+7m7Sw+q1+cTNJDOKI+LeQEWmmIQdsd5f8EJGq5iQmln3WU9dlzkXG2gc\n\tnhVVHo64O9kTP4vqf1I9dvpdmCNy78tucpYUNND9Xv4yHSu29fXtpUm1ey1T7naIy1zb\n\t3/Rs2EBLnzFepSqJltpA3fiSj3Wq1Ss3nUrUEFxoHSRH7U98quD3LLAAT+V1PGWMHy8F\n\tD5jQ==","X-Gm-Message-State":"AOAM531xMtw4Ni9oQzZPiOXIRZ6ME5aG539/dpqTwHxaOwIPwZs4eU+i\n\twhjaSpkr6EDftn82DI1XP2oWfUYpk65fHPxozlXmEA==","X-Google-Smtp-Source":"ABdhPJyR5512iLA5kog/yE9ARB8RW2X83oLWfZCH+sX//CAYqSH/bmWzooUmHYQqwm2lDz1ZsFIfmXzyCvjJ4vBZuso=","X-Received":"by 2002:a19:ef13:: with SMTP id\n\tn19mr6826582lfh.210.1614698221307; \n\tTue, 02 Mar 2021 07:17:01 -0800 (PST)","MIME-Version":"1.0","References":"<20210302150501.15191-1-laurent.pinchart@ideasonboard.com>\n\t<20210302150501.15191-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20210302150501.15191-2-laurent.pinchart@ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 2 Mar 2021 15:16:43 +0000","Message-ID":"<CAEmqJPo23c5qU5jSnCH5oT-h-mbe8upRO+gMYn-JeDWCpM+dVA@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/mixed;\n\tboundary=\"===============0645353202203144046==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15437,"web_url":"https://patchwork.libcamera.org/comment/15437/","msgid":"<20210303102613.GC477268@pyrite.rasen.tech>","date":"2021-03-03T10:26:13","subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Laurent and Naush,\n\nOn Tue, Mar 02, 2021 at 03:16:43PM +0000, Naushir Patuck wrote:\n> Hi Laurent,\n> \n> Thank you for your patch.\n> \n> On Tue, 2 Mar 2021 at 15:05, Laurent Pinchart <\n> laurent.pinchart@ideasonboard.com> wrote:\n> \n>     It can be useful for pipeline handlers to pass additional parameters to\n>     the IPA init() method. Allow doing so.\n> \n>     Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>     ---\n>      .../libcamera_templates/module_ipa_proxy.cpp.tmpl         | 2 +-\n>      .../generators/libcamera_templates/proxy_functions.tmpl   | 8 ++++++--\n>      utils/ipc/generators/mojom_libcamera_generator.py         | 3 ---\n>      3 files changed, 7 insertions(+), 6 deletions(-)\n> \n>     diff --git a/utils/ipc/generators/libcamera_templates/\n>     module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/\n>     module_ipa_proxy.cpp.tmpl\n>     index d451fab35e83..f2f9128b056c 100644\n>     --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>     +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>     @@ -142,7 +142,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &\n>     data)\n>      {{proxy_funcs.func_sig(proxy_name, method, \"Thread\")}}\n>      {\n>      {%- if method.mojom_name == \"init\" %}\n>     -       {{proxy_funcs.init_thread_body()}}\n>     +       {{proxy_funcs.init_thread_body(method)}}\n>      {%- elif method.mojom_name == \"stop\" %}\n>             {{proxy_funcs.stop_thread_body()}}\n>      {%- elif method.mojom_name == \"start\" %}\n\nMarker (for reference in paragraph below).\n\n>     diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n>     b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n>     index 40611feb179b..222a2a63764d 100644\n>     --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n>     +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n>     @@ -22,8 +22,12 @@\n>      {#\n>       # \\brief Generate function body for IPA init() function for thread\n>       #}\n>     -{%- macro init_thread_body() -%}\n>     -       int ret = ipa_->init(settings);\n>     +{%- macro init_thread_body(method) -%}\n>     +       int ret = ipa_->init(\n>     +       {%- for param in method|method_param_names -%}\n>     +               {{param}}{{- \", \" if not loop.last}}\n>     +       {%- endfor -%}\n>     +);\n>             if (ret)\n>                     return ret;\n\nSo, this is sufficient for custom input parameters. But what we're doing\n(especially since we want to add support for custom output parameters as\nwell) is analogous to what we've already done to start(), so I think\nit's better to put it at the marker above.\n\nLike we can\n- {%- elif not method|is_async %}\n+ {%- elif not method|is_async or method.mojom_name == \"init\" %}\n\nand then after the shared function body, conditionally (on\nmethod.mojom_name == \"init\") put in proxy_.moveToThread(&thread_);\n\nThen we can get rid of init_thread_body() too.\n\nThe IPC part, as you've noticed, should be able to handle the custom\ndefinition as-is.\n\n> \n>     diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/\n>     generators/mojom_libcamera_generator.py\n>     index 438e41c649ad..2bfc4af23231 100644\n>     --- a/utils/ipc/generators/mojom_libcamera_generator.py\n>     +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n>     @@ -346,10 +346,7 @@ def ValidateInterfaces(interfaces):\n>          f_stop  = f_stop[0]\n> \n>          # Validate parameters to init()\n>     -    ValidateSingleLength(f_init.parameters, 'input parameter to init()')\n>          ValidateSingleLength(f_init.response_parameters, 'output parameter\n>     from init()')\n>     -    if f_init.parameters[0].kind.mojom_name != 'IPASettings':\n>     -        raise Exception('init() must have single IPASettings input\n>     parameter')\n>          if f_init.response_parameters[0].kind.spec != 'i32':\n>              raise Exception('init() must have single int32 output parameter')\n\nWe can remove the whole stanza after we support totally customizable\nparameters to init().\n\n> \n> \n> As discussed, it would be really useful if the restriction on the return value\n> from init() could be relaxed as well.\n> Hopefully this will not be too complicated to achieve :-)\n\nYeah we can do that :)\n\nI'll send a patch tomorrow if Laurent doesn't get nerd-sniped before\nthat :)\n\n\nPaul","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 3B7A7BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Mar 2021 10:26:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0AD2268A98;\n\tWed,  3 Mar 2021 11:26:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2AC1568A69\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Mar 2021 11:26:21 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 77875ED;\n\tWed,  3 Mar 2021 11:26:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"X6CAaSOb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614767180;\n\tbh=BdPhhcuiKv8htgpsUSkt20vEex0GbAqKdDD37Xw0JW4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=X6CAaSObS/9MWRI/xTn1ciRir4Z3CHqPP5BUe62zh2+j4WZN5A1978NGeMsOOiddP\n\tD2g9PJM9GZ1HAAjp4XCWR4k1gy0EZLjWKdZJdRaFnnwjoiitrLdVgkHIkZMzZo/eZa\n\t2vrlYybBwt3ftS+Xbh08AAG5s8uxz4zzS6x6g2jw=","Date":"Wed, 3 Mar 2021 19:26:13 +0900","From":"paul.elder@ideasonboard.com","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20210303102613.GC477268@pyrite.rasen.tech>","References":"<20210302150501.15191-1-laurent.pinchart@ideasonboard.com>\n\t<20210302150501.15191-2-laurent.pinchart@ideasonboard.com>\n\t<CAEmqJPo23c5qU5jSnCH5oT-h-mbe8upRO+gMYn-JeDWCpM+dVA@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPo23c5qU5jSnCH5oT-h-mbe8upRO+gMYn-JeDWCpM+dVA@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15438,"web_url":"https://patchwork.libcamera.org/comment/15438/","msgid":"<YD9mswLzndRCUFrE@pendragon.ideasonboard.com>","date":"2021-03-03T10:36:35","subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nOn Wed, Mar 03, 2021 at 07:26:13PM +0900, paul.elder@ideasonboard.com wrote:\n> On Tue, Mar 02, 2021 at 03:16:43PM +0000, Naushir Patuck wrote:\n> > On Tue, 2 Mar 2021 at 15:05, Laurent Pinchart wrote:\n> > \n> > > It can be useful for pipeline handlers to pass additional parameters to\n> > > the IPA init() method. Allow doing so.\n> > > \n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  .../libcamera_templates/module_ipa_proxy.cpp.tmpl         | 2 +-\n> > >  .../generators/libcamera_templates/proxy_functions.tmpl   | 8 ++++++--\n> > >  utils/ipc/generators/mojom_libcamera_generator.py         | 3 ---\n> > >  3 files changed, 7 insertions(+), 6 deletions(-)\n> > > \n> > > diff --git a/utils/ipc/generators/libcamera_templates/\n> > > module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/\n> > > module_ipa_proxy.cpp.tmpl\n> > > index d451fab35e83..f2f9128b056c 100644\n> > > --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> > > +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> > > @@ -142,7 +142,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &\n> > > data)\n> > >  {{proxy_funcs.func_sig(proxy_name, method, \"Thread\")}}\n> > >  {\n> > >  {%- if method.mojom_name == \"init\" %}\n> > > -       {{proxy_funcs.init_thread_body()}}\n> > > +       {{proxy_funcs.init_thread_body(method)}}\n> > >  {%- elif method.mojom_name == \"stop\" %}\n> > >         {{proxy_funcs.stop_thread_body()}}\n> > >  {%- elif method.mojom_name == \"start\" %}\n> \n> Marker (for reference in paragraph below).\n> \n> > > diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > > b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > > index 40611feb179b..222a2a63764d 100644\n> > > --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > > +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl\n> > > @@ -22,8 +22,12 @@\n> > >  {#\n> > >   # \\brief Generate function body for IPA init() function for thread\n> > >   #}\n> > > -{%- macro init_thread_body() -%}\n> > > -       int ret = ipa_->init(settings);\n> > > +{%- macro init_thread_body(method) -%}\n> > > +       int ret = ipa_->init(\n> > > +       {%- for param in method|method_param_names -%}\n> > > +               {{param}}{{- \", \" if not loop.last}}\n> > > +       {%- endfor -%}\n> > > +);\n> > >         if (ret)\n> > >                 return ret;\n> \n> So, this is sufficient for custom input parameters. But what we're doing\n> (especially since we want to add support for custom output parameters as\n> well) is analogous to what we've already done to start(), so I think\n> it's better to put it at the marker above.\n> \n> Like we can\n> - {%- elif not method|is_async %}\n> + {%- elif not method|is_async or method.mojom_name == \"init\" %}\n> \n> and then after the shared function body, conditionally (on\n> method.mojom_name == \"init\") put in proxy_.moveToThread(&thread_);\n> \n> Then we can get rid of init_thread_body() too.\n\nShould we also improve the output parameters handling, so that if the\nfirst output parameter is an int, it's returned from the function\ninstead of creating a void function with an int * output parameter ?\n\n> The IPC part, as you've noticed, should be able to handle the custom\n> definition as-is.\n>\n> > > diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/\n> > > generators/mojom_libcamera_generator.py\n> > > index 438e41c649ad..2bfc4af23231 100644\n> > > --- a/utils/ipc/generators/mojom_libcamera_generator.py\n> > > +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n> > > @@ -346,10 +346,7 @@ def ValidateInterfaces(interfaces):\n> > >      f_stop  = f_stop[0]\n> > > \n> > >      # Validate parameters to init()\n> > > -    ValidateSingleLength(f_init.parameters, 'input parameter to init()')\n> > >      ValidateSingleLength(f_init.response_parameters, 'output parameter from init()')\n> > > -    if f_init.parameters[0].kind.mojom_name != 'IPASettings':\n> > > -        raise Exception('init() must have single IPASettings input parameter')\n> > >      if f_init.response_parameters[0].kind.spec != 'i32':\n> > >          raise Exception('init() must have single int32 output parameter')\n> \n> We can remove the whole stanza after we support totally customizable\n> parameters to init().\n> \n> > As discussed, it would be really useful if the restriction on the return value\n> > from init() could be relaxed as well.\n> > Hopefully this will not be too complicated to achieve :-)\n> \n> Yeah we can do that :)\n> \n> I'll send a patch tomorrow if Laurent doesn't get nerd-sniped before\n> that :)","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 93735BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Mar 2021 10:37:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BD3068A98;\n\tWed,  3 Mar 2021 11:37:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0450668A69\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Mar 2021 11:37:04 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 65C46ED;\n\tWed,  3 Mar 2021 11:37:04 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CB15Ls6l\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614767824;\n\tbh=xSDqP+RuxdL2TBRGHvkJujs9TTW7eb5j2utuAOy/m0A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CB15Ls6lFJgr7Smjvb3IgvtohMroyXNg8CQtDrIe1hPjhH3YtDui1TJ8S7vDLtHRk\n\tspw/S5mDdK8MCfD3g6shz/hu2dcAnWjT+JLUGWX9/EO90wmaW8G+5SEuTtcBGxIz9L\n\tH8k4Hzdmtj45ogEkKUiz60OCkEMrDqrY/JdZwzyg=","Date":"Wed, 3 Mar 2021 12:36:35 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"paul.elder@ideasonboard.com","Message-ID":"<YD9mswLzndRCUFrE@pendragon.ideasonboard.com>","References":"<20210302150501.15191-1-laurent.pinchart@ideasonboard.com>\n\t<20210302150501.15191-2-laurent.pinchart@ideasonboard.com>\n\t<CAEmqJPo23c5qU5jSnCH5oT-h-mbe8upRO+gMYn-JeDWCpM+dVA@mail.gmail.com>\n\t<20210303102613.GC477268@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210303102613.GC477268@pyrite.rasen.tech>","Subject":"Re: [libcamera-devel] [PATCH 2/2] utils: ipc: Support extending IPA\n\tinit() parameters","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]