From patchwork Sun Oct 20 15:28:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikhail Rudenko X-Patchwork-Id: 21709 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 93C4DC3307 for ; Sun, 20 Oct 2024 15:28:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE55A65393; Sun, 20 Oct 2024 17:28:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O1IfeYQb"; dkim-atps=neutral Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 75FCD65392 for ; Sun, 20 Oct 2024 17:28:40 +0200 (CEST) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5366fd6fdf1so5244471e87.0 for ; Sun, 20 Oct 2024 08:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729438118; x=1730042918; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mBo7mhFEAoREmEgOkqNk+zC0d3g9ZeqMWWN8cDklThM=; b=O1IfeYQbxirvFWzRGzwfFazx04Oes495TDCr7yKP0UTo3WxZedk+ArDafLwEJVrHIr P4Rgnmj+ann4ft5+JgSl3WWaCOVl5w4SX0rDiTINmb6Stio3SW6DSvle+jhCJrOaZ/j+ mX7sED0gDKPltIZrFwFCB30BfjVFHSJe/V0EJkIW6e1JtQ+HeVU0svi5Rksm9XMcjMu3 RkU3Lge42tPnjkpJsTwO1QU/uCqoUj7G8D8o7Y2JBuAcjCEWzzMV4jBv8znA8qwyu4Q1 MzeMbF/LzJvu8XraZf0Aa4hZESzYB6IhvwLPXnNZ1LIbD7DUvC36067f3mJA+fWHFJrI uGJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729438118; x=1730042918; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mBo7mhFEAoREmEgOkqNk+zC0d3g9ZeqMWWN8cDklThM=; b=spy0fL0wxXEFi8MMaeBSrjl9U8jsp1heDJT499eo5aebNiQQaO4UgrpCY45ptUJvAO /ZW/DX64NT2ZCeq0uuZhkyRWDP7oGlgZ2FT0gOXwuMbK3F2Nu2SbtoMMzwIr5M9QFBAQ 4aal/H2VBWrYiCCIBjwPmMw/OFtEp13pVrYXiBHphrsmnd2847oKDnXi/ZIxkygLfoIt MJ0SznQeXghI/cW91M2sm0U6H9RTIiAaS/giY3eyMIXSqc52TsTslhTbSjiuRxi0aFs7 QGsS8U7S9f9pBUHQtrUcVCPxFLQAsbdBeJ03H3S+TqvXzGjG6C2fJ4UuisJiaJEmi0mo wkOA== X-Gm-Message-State: AOJu0Yz9DDRU1BlY9CYyWRs7YizHKu2BzDmLvKNkpVIeGR4Jd8ALqXf+ Z4SERrh9WbL2GtMyhhep9YpQcSMl8D15FH2hncWMHG1s14gYt8VajEiFxA== X-Google-Smtp-Source: AGHT+IERa9kp8yzjbLKUZPyShQEkLxHmz0W9NvNrc89+lRVFGOtJltz/v9ujHAApeEG2s2LV30wZPw== X-Received: by 2002:a05:6512:3092:b0:539:e80c:23f with SMTP id 2adb3069b0e04-53a15444867mr4136473e87.14.1729438117879; Sun, 20 Oct 2024 08:28:37 -0700 (PDT) Received: from localhost.localdomain (static.40.223.216.95.clients.your-server.de. [95.216.223.40]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53a223efad4sm249040e87.67.2024.10.20.08.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 08:28:37 -0700 (PDT) From: Mikhail Rudenko To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Mikhail Rudenko Subject: [PATCH v2 2/4] utils: ipc: Allow start method with output parameters in 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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- .../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 -%}