From patchwork Thu Oct 17 12:46:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikhail Rudenko X-Patchwork-Id: 21652 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 08B74C32FD for ; Thu, 17 Oct 2024 12:46:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4ADD66538B; Thu, 17 Oct 2024 14:46:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JrgaYjmA"; dkim-atps=neutral Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1FC8E6353B for ; Thu, 17 Oct 2024 14:46:24 +0200 (CEST) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2fb587d0436so10037341fa.2 for ; Thu, 17 Oct 2024 05:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729169183; x=1729773983; 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=JrgaYjmAOMyONe78+DMrcnXnagstuvsCxB+CV0H4LoWQulZMJ+Ple4Ly4znPgaB2l3 u3oOmdrOCgB5MWP2tQh5AGv1GSaf6ePxOXL+aORgQH+yeRmt8X9yau/+svirr4/DBqHJ zkEbQvsK+AjrVU1DXHLkfGakLi17JJAwDBSLldQZAl7mZCC7iJahZ1Qd3jt+Cp90UNF6 +Q3ZO4dTahhAPT6WHcgTNlqnKOELBJjp5HT5c8k34l4XdBnzshUCM/fJZBqRDPO3poCq KNvx6nMnegIyeeEMZ/M5DfbbNujRRa0viqq5V6al8aP1la31FP4qx3rNdzbAAj0/hp8X Em4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729169183; x=1729773983; 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=UwXPl/QcEiqphqVJ1PhimOE4wXwYLh7eMNCpdl6N0zOJjZdALoJPGgxAfNMDCHTV4b U6GnWox3hLchD0KvsA3WxSWCCUOhUgQNyUdFvYz1NP+fh+6qwXmoS1sN5qnbz+mm613h 5E406jaNrtz+/3EfZeOT/iIi/clpFhV/rBq7D35+FuyQC9n0QciOeYpMzlg3Eim2k8JF 5hJzwlwxFva1W/9owH7XN3X8WF2be/9kR7wofSLIhyHNOZf8q+Ug796AfCx+7pKHcu1P zUtUTFxCXOZj7k7aNHYHyWpn0YJ98lWAxoPbu0UCSY1XB2NVQIN4uvGDhqL98NmfFcOY aJ/A== X-Gm-Message-State: AOJu0YwYHzSH73BVOxv5C1+iJvI6jybAjlf8ehPPiWPrc+08uKIZMUhh iusnrq+2nD4VIrT9mFY9/fd02ccxKnCwXWwWAgTrSAs9UpYZC9k/nRrGRw== X-Google-Smtp-Source: AGHT+IGj8zzuNnD7lSLbU0PSJcez3rYW1i7t26X2GliS7RBmiAEPWwUxW5oraYqJxeG/+ReLGduKLA== X-Received: by 2002:a2e:719:0:b0:2fb:3d1d:dd96 with SMTP id 38308e7fff4ca-2fb3f1b477dmr80151941fa.20.1729169182589; Thu, 17 Oct 2024 05:46:22 -0700 (PDT) Received: from localhost ([83.149.246.185]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2fb5d0fdd34sm7173311fa.12.2024.10.17.05.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 05:46:22 -0700 (PDT) From: Mikhail Rudenko To: libcamera-devel@lists.libcamera.org Cc: Mikhail Rudenko Subject: [PATCH 2/3] utils: ipc: Allow start method with output parameters in IPA proxies Date: Thu, 17 Oct 2024 15:46:12 +0300 Message-ID: <20241017124613.3853273-3-mike.rudenko@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241017124613.3853273-1-mike.rudenko@gmail.com> References: <20241017124613.3853273-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 -%}