[PATCH 2/3] utils: ipc: Allow start method with output parameters in IPA proxies

Mikhail Rudenko mike.rudenko at gmail.com
Thu Oct 17 14:46:12 CEST 2024


At present IPA proxy and IPA proxy worker templates generate incorrect
code when IPA start method has multiple output parameters and no input
parameters. Fix that. Also merge repetitive cases of start function
returning void/non-void in IPA proxy template.

Signed-off-by: Mikhail Rudenko <mike.rudenko at gmail.com>
---
 .../libcamera_templates/module_ipa_proxy.h.tmpl       | 11 ++++-------
 .../module_ipa_proxy_worker.cpp.tmpl                  |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

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
index e213b18a..138832b5 100644
--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
@@ -95,13 +95,10 @@ private:
 {%- elif method.mojom_name == "start" %}
 		{{proxy_funcs.func_sig(proxy_name, method, "", false)|indent(16)}}
 		{
-{%- if method|method_return_value != "void" %}
-			return ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}});
-{%- else %}
-			ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}}
-	{{- ", " if method|method_param_outputs|params_comma_sep -}}
-	{{- method|method_param_outputs|params_comma_sep}});
-{%- endif %}
+			{{ "return" if method|method_return_value != "void" }} ipa_->
+			{{- method.mojom_name}}({{method.parameters|params_comma_sep}}
+				{{- ", " if method|method_param_outputs|params_comma_sep and method.parameters|params_comma_sep -}}
+				{{- method|method_param_outputs|params_comma_sep}});
 		}
 {%- endif %}
 {%- endfor %}
diff --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
index 1f990d3f..6bc11a09 100644
--- 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
@@ -93,7 +93,7 @@ public:
 			{{method|method_return_value}} _callRet =
 {%- endif -%}
 			ipa_->{{method.mojom_name}}({{method.parameters|params_comma_sep}}
-{{- ", " if method|method_param_outputs|params_comma_sep -}}
+{{- ", " if method|method_param_outputs|params_comma_sep and method.parameters|params_comma_sep -}}
 {%- for param in method|method_param_outputs -%}
 &{{param.mojom_name}}{{", " if not loop.last}}
 {%- endfor -%}
-- 
2.46.0



More information about the libcamera-devel mailing list