[v2,2/4] utils: ipc: Allow start method with output parameters in IPA proxies
diff mbox series

Message ID 20241020152821.240726-3-mike.rudenko@gmail.com
State New
Headers show
Series
  • Reduce rkisp1 flicker on first start
Related show

Commit Message

Mikhail Rudenko Oct. 20, 2024, 3:28 p.m. UTC
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@gmail.com>
---
 .../libcamera_templates/module_ipa_proxy.h.tmpl       | 11 ++++-------
 .../module_ipa_proxy_worker.cpp.tmpl                  |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

Patch
diff mbox series

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 -%}