From patchwork Mon Sep 2 22:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21149 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 9116CC324C for ; Mon, 2 Sep 2024 22:13:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C44B3634E0; Tue, 3 Sep 2024 00:13:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tJKGOT0h"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4895D618FF for ; Tue, 3 Sep 2024 00:13:50 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9EF1C21E; Tue, 3 Sep 2024 00:12:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1725315158; bh=8zkx8BzCml3W0WN12swY2XYCZqb0+JJQve+/k7bSdtQ=; h=From:To:Cc:Subject:Date:From; b=tJKGOT0hDPo394NFzH+hTl5qj8pDCeFcGQKJF7XhrB3TMR5YpjiUbCdd7lnw/cbx+ iBdoXpQ6qm4FetPylsMQ52NzFP2gX5CxIashXDFOfF+7wEHgWAi0eRC2qJdRw4xjfa gdx+isWd9EMxZ1kRZn+rUv0nELKsrx8rSGLHM688= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , Milan Zamazal Subject: [PATCH 1/2] utils: ipc: Include in generated headers where needed Date: Tue, 3 Sep 2024 01:13:16 +0300 Message-ID: <20240902221317.19005-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 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" Depending on the types used in the IPA interface, generated headers may use the std::string class. Include when needed. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal Reviewed-by: Kieran Bingham --- .../libcamera_templates/core_ipa_interface.h.tmpl | 1 + .../libcamera_templates/module_ipa_interface.h.tmpl | 7 ++++--- utils/codegen/ipc/generators/mojom_libcamera_generator.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) base-commit: ac1c57fcf5dff06ae4e7e5fad7baa8f93c413e37 diff --git a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl index 7f2d0810823b..590135b88421 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl @@ -15,6 +15,7 @@ #pragma once {% if has_map %}#include {% endif %} +{% if has_string %}#include {% endif %} {% if has_array %}#include {% endif %} #include diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl index 4d88a3d77d0f..0111d0c4c591 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl @@ -14,12 +14,13 @@ #pragma once +{% if has_map %}#include {% endif %} +{% if has_string %}#include {% endif %} +{% if has_array %}#include {% endif %} + #include #include -{% if has_map %}#include {% endif %} -{% if has_array %}#include {% endif %} - namespace libcamera { {%- if has_namespace %} {% for ns in namespace %} diff --git a/utils/codegen/ipc/generators/mojom_libcamera_generator.py b/utils/codegen/ipc/generators/mojom_libcamera_generator.py index b8209e516297..d9c620a05e2a 100644 --- a/utils/codegen/ipc/generators/mojom_libcamera_generator.py +++ b/utils/codegen/ipc/generators/mojom_libcamera_generator.py @@ -467,6 +467,7 @@ class Generator(generator.Generator): 'enums': self.module.enums, 'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0, 'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0, + 'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0, 'has_namespace': self.module.mojom_namespace != '', 'interface_event': GetEventInterface(self.module.interfaces), 'interface_main': GetMainInterface(self.module.interfaces), @@ -486,6 +487,7 @@ class Generator(generator.Generator): 'enums_gen_header': [x for x in self.module.enums if x.attributes is None or 'skipHeader' not in x.attributes], 'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0, 'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0, + 'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0, 'structs_gen_header': [x for x in self.module.structs if x.attributes is None or 'skipHeader' not in x.attributes], 'structs_gen_serializer': [x for x in self.module.structs if x.attributes is None or 'skipSerdes' not in x.attributes], }