{"id":21709,"url":"https://patchwork.libcamera.org/api/1.1/patches/21709/?format=json","web_url":"https://patchwork.libcamera.org/patch/21709/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241020152821.240726-3-mike.rudenko@gmail.com>","date":"2024-10-20T15:28:19","name":"[v2,2/4] utils: ipc: Allow start method with output parameters in IPA proxies","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e2ada1322d509fc0288c1bf1883a7fd0aaa37f25","submitter":{"id":146,"url":"https://patchwork.libcamera.org/api/1.1/people/146/?format=json","name":"Mikhail Rudenko","email":"mike.rudenko@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21709/mbox/","series":[{"id":4728,"url":"https://patchwork.libcamera.org/api/1.1/series/4728/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4728","date":"2024-10-20T15:28:17","name":"Reduce rkisp1 flicker on first start","version":2,"mbox":"https://patchwork.libcamera.org/series/4728/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21709/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21709/checks/","tags":{},"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 93C4DC3307\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 20 Oct 2024 15:28:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE55A65393;\n\tSun, 20 Oct 2024 17:28:51 +0200 (CEST)","from mail-lf1-x133.google.com (mail-lf1-x133.google.com\n\t[IPv6:2a00:1450:4864:20::133])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 75FCD65392\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 20 Oct 2024 17:28:40 +0200 (CEST)","by mail-lf1-x133.google.com with SMTP id\n\t2adb3069b0e04-5366fd6fdf1so5244471e87.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 20 Oct 2024 08:28:40 -0700 (PDT)","from localhost.localdomain\n\t(static.40.223.216.95.clients.your-server.de. [95.216.223.40])\n\tby smtp.gmail.com with ESMTPSA id\n\t2adb3069b0e04-53a223efad4sm249040e87.67.2024.10.20.08.28.36\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 20 Oct 2024 08:28:37 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"O1IfeYQb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20230601; t=1729438118; x=1730042918;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=mBo7mhFEAoREmEgOkqNk+zC0d3g9ZeqMWWN8cDklThM=;\n\tb=O1IfeYQbxirvFWzRGzwfFazx04Oes495TDCr7yKP0UTo3WxZedk+ArDafLwEJVrHIr\n\tP4Rgnmj+ann4ft5+JgSl3WWaCOVl5w4SX0rDiTINmb6Stio3SW6DSvle+jhCJrOaZ/j+\n\tmX7sED0gDKPltIZrFwFCB30BfjVFHSJe/V0EJkIW6e1JtQ+HeVU0svi5Rksm9XMcjMu3\n\tRkU3Lge42tPnjkpJsTwO1QU/uCqoUj7G8D8o7Y2JBuAcjCEWzzMV4jBv8znA8qwyu4Q1\n\tMzeMbF/LzJvu8XraZf0Aa4hZESzYB6IhvwLPXnNZ1LIbD7DUvC36067f3mJA+fWHFJrI\n\tuGJQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1729438118; x=1730042918;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=mBo7mhFEAoREmEgOkqNk+zC0d3g9ZeqMWWN8cDklThM=;\n\tb=spy0fL0wxXEFi8MMaeBSrjl9U8jsp1heDJT499eo5aebNiQQaO4UgrpCY45ptUJvAO\n\t/ZW/DX64NT2ZCeq0uuZhkyRWDP7oGlgZ2FT0gOXwuMbK3F2Nu2SbtoMMzwIr5M9QFBAQ\n\t4aal/H2VBWrYiCCIBjwPmMw/OFtEp13pVrYXiBHphrsmnd2847oKDnXi/ZIxkygLfoIt\n\tMJ0SznQeXghI/cW91M2sm0U6H9RTIiAaS/giY3eyMIXSqc52TsTslhTbSjiuRxi0aFs7\n\tQGsS8U7S9f9pBUHQtrUcVCPxFLQAsbdBeJ03H3S+TqvXzGjG6C2fJ4UuisJiaJEmi0mo\n\twkOA==","X-Gm-Message-State":"AOJu0Yz9DDRU1BlY9CYyWRs7YizHKu2BzDmLvKNkpVIeGR4Jd8ALqXf+\n\tZ4SERrh9WbL2GtMyhhep9YpQcSMl8D15FH2hncWMHG1s14gYt8VajEiFxA==","X-Google-Smtp-Source":"AGHT+IERa9kp8yzjbLKUZPyShQEkLxHmz0W9NvNrc89+lRVFGOtJltz/v9ujHAApeEG2s2LV30wZPw==","X-Received":"by 2002:a05:6512:3092:b0:539:e80c:23f with SMTP id\n\t2adb3069b0e04-53a15444867mr4136473e87.14.1729438117879; \n\tSun, 20 Oct 2024 08:28:37 -0700 (PDT)","From":"Mikhail Rudenko <mike.rudenko@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMikhail Rudenko <mike.rudenko@gmail.com>","Subject":"[PATCH v2 2/4] utils: ipc: Allow start method with output parameters\n\tin IPA proxies","Date":"Sun, 20 Oct 2024 18:28:19 +0300","Message-ID":"<20241020152821.240726-3-mike.rudenko@gmail.com>","X-Mailer":"git-send-email 2.46.0","In-Reply-To":"<20241020152821.240726-1-mike.rudenko@gmail.com>","References":"<20241020152821.240726-1-mike.rudenko@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"At present IPA proxy and IPA proxy worker templates generate incorrect\ncode when IPA start method has multiple output parameters and no input\nparameters. Fix that. Also merge repetitive cases of start function\nreturning void/non-void in IPA proxy template.\n\nSigned-off-by: Mikhail Rudenko <mike.rudenko@gmail.com>\n---\n .../libcamera_templates/module_ipa_proxy.h.tmpl       | 11 ++++-------\n .../module_ipa_proxy_worker.cpp.tmpl                  |  2 +-\n 2 files changed, 5 insertions(+), 8 deletions(-)","diff":"diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\nindex e213b18a..138832b5 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl\n@@ -95,13 +95,10 @@ private:\n {%- elif method.mojom_name == \"start\" %}\n \t\t{{proxy_funcs.func_sig(proxy_name, method, \"\", false)|indent(16)}}\n \t\t{\n-{%- if method|method_return_value != \"void\" %}\n-\t\t\treturn ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}});\n-{%- else %}\n-\t\t\tipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}}\n-\t{{- \", \" if method|method_param_outputs|params_comma_sep -}}\n-\t{{- method|method_param_outputs|params_comma_sep}});\n-{%- endif %}\n+\t\t\t{{ \"return\" if method|method_return_value != \"void\" }} ipa_->\n+\t\t\t{{- method.mojom_name}}({{method.parameters|params_comma_sep}}\n+\t\t\t\t{{- \", \" if method|method_param_outputs|params_comma_sep and method.parameters|params_comma_sep -}}\n+\t\t\t\t{{- method|method_param_outputs|params_comma_sep}});\n \t\t}\n {%- endif %}\n {%- endfor %}\ndiff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\nindex 1f990d3f..6bc11a09 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\n@@ -93,7 +93,7 @@ public:\n \t\t\t{{method|method_return_value}} _callRet =\n {%- endif -%}\n \t\t\tipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}}\n-{{- \", \" if method|method_param_outputs|params_comma_sep -}}\n+{{- \", \" if method|method_param_outputs|params_comma_sep and method.parameters|params_comma_sep -}}\n {%- for param in method|method_param_outputs -%}\n &{{param.mojom_name}}{{\", \" if not loop.last}}\n {%- endfor -%}\n","prefixes":["v2","2/4"]}