{"id":19250,"url":"https://patchwork.libcamera.org/api/1.1/patches/19250/?format=json","web_url":"https://patchwork.libcamera.org/patch/19250/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20231130142534.2075-3-naush@raspberrypi.com>","date":"2023-11-30T14:25:30","name":"[libcamera-devel,v4,2/6] controls: Update argument handling for controls generation scripts","commit_ref":"bba4ec63c4b0699b7f7ffb20e4f37af2b996d355","pull_url":null,"state":"accepted","archived":false,"hash":"b1501d4965668e900b3b60c89ffebd5b9d29a58e","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19250/mbox/","series":[{"id":4091,"url":"https://patchwork.libcamera.org/api/1.1/series/4091/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4091","date":"2023-11-30T14:25:28","name":"Vendor controls and properties","version":4,"mbox":"https://patchwork.libcamera.org/series/4091/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19250/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19250/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1B851C32B5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Nov 2023 14:25:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2ECFD629C2;\n\tThu, 30 Nov 2023 15:25:45 +0100 (CET)","from mail-ej1-x629.google.com (mail-ej1-x629.google.com\n\t[IPv6:2a00:1450:4864:20::629])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D6ED629C2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Nov 2023 15:25:43 +0100 (CET)","by mail-ej1-x629.google.com with SMTP id\n\ta640c23a62f3a-a18f732dc83so83227666b.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Nov 2023 06:25:43 -0800 (PST)","from localhost.localdomain ([88.97.53.79])\n\tby smtp.gmail.com with ESMTPSA id\n\ta5-20020a17090640c500b009e50ea0a05asm725577ejk.99.2023.11.30.06.25.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 30 Nov 2023 06:25:42 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701354345;\n\tbh=fMpws5UIx7BYKu/3NzHLaLEyUquyAuud/to7nZFElPc=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Frw4pot4HBsgdGPndmw8CYKZfvToPnSIduXWPzOmlFLa5ji/XBwCrSpsmsWL7zkBk\n\tEcoAYi1AZFunAHx6k2iUKZ2xURWBFKVXA5myaeMDfw2PXG8/TeqFu9XdqtfweifZz5\n\tvHBa9yoEViuG09hwPTRdwPE9umWznl9G64UHBK4Pc67BKjAJNK6bnXuOR36ErK6Il4\n\tjW2dVjfa0Lo5j968MT0CKUqnWkhl+7IQnnw6DGhCcfeYojsEZFfG0atMvs0IkaBOwg\n\tekvL5TKNC2BlVPB+H+PyX2bDI8Yle59TqPb7PeMjE2FXNXwQwtLGOe/+1W89FhJwpf\n\tGRQLiS92CywEA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1701354343; x=1701959143;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=5b5WNA8sbB0SjEir0c+PWNwpUQepvRCeAHvgloft+lQ=;\n\tb=Q3swp61bu/Z5O+Q4GLhcMBFKVGF2AzL72Ybww7DD+gTitcY9BfG0UydqzC17axoWqi\n\tDUldaoIVW6nKiHo/maK0Zb6fubUGJwdP3rRTE99R4tAhEDTnKvev5cOAL/ZzeCL9B18Y\n\tmFS1yZaOljEXBKT1UiZpz6jVgn8Y4tMtqbfrc4zbNCcx7W9Yo4JOks/zIHCQECv8mjtx\n\tac3R7ok0xZzkONiFDDDvpZv4Pkr590AhTvKDMdr14Irtyr12lz7D2603HOTU0Ef9gYSy\n\t8LZYZo9Q3cHJHBUp0iXuv78N+KPkz4ebGd0VHUCE483ewGjADAWaVnWIOvuZcD4KeNYM\n\tH3dw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Q3swp61b\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1701354343; x=1701959143;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=5b5WNA8sbB0SjEir0c+PWNwpUQepvRCeAHvgloft+lQ=;\n\tb=wFHacr/tiS3+UWraDqaNcK6QH1gkRtQYrYTOvu5byvGij0GqDI7kUyZ5lcPGdYGZ5L\n\tLPHF+smnaGV/w4CFlCefuMbRFA0lWw09ezxMB+05heW7Z74qzT0i8TaVsekfOvQyZXWZ\n\t9cJvwBmM4Mjbboc0kmgwQ+Zm8rakX6iaHdB8xvVEqi+Y5Ktz54Llv1jnJ6lE7Ndu9fKE\n\tnbF7rF/taz8SxSeUKEi9B1wL0zqYnI4y47T8Dc8Ocsnjz/PWGDgkiyeTqEKavMtx9RLo\n\t6BTg4uPtBo2i/dTTX3her1FUXvmsgqv87KiUhgcvDuH2LyTqsdcSGXrf1KQJTMXaCjZ0\n\thMVg==","X-Gm-Message-State":"AOJu0YyzjicwWLxJ7+Z4tGAQ5Id11PtJZuRYYiZWMjHVc7eVmGZX7r68\n\tMgR/paDycHKielK6eG1oEozLVRjlriJOjblSOkiTVA==","X-Google-Smtp-Source":"AGHT+IEkKp0dYo/dc+H/8/fp1fzi62esKp6xEmZxPcwU3m0bjac9nLkO5dTas9+hILONfBaVs0VXPA==","X-Received":"by 2002:a17:906:220b:b0:a0e:3ba4:4eac with SMTP id\n\ts11-20020a170906220b00b00a0e3ba44eacmr14143011ejs.27.1701354342732; \n\tThu, 30 Nov 2023 06:25:42 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 30 Nov 2023 14:25:30 +0000","Message-Id":"<20231130142534.2075-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20231130142534.2075-1-naush@raspberrypi.com>","References":"<20231130142534.2075-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 2/6] controls: Update argument handling\n\tfor controls generation scripts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The template file to the gen-controls.py and gen-py-controls.py is now\npassed in through the '-t' or '--template' command line argument instead\nof being a positional argument.  This will allow multiple input files to\nbe provided to the scripts in a future commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/meson.build       |  7 ++++---\n src/libcamera/meson.build           |  7 ++++---\n src/py/libcamera/gen-py-controls.py |  4 ++--\n src/py/libcamera/meson.build        | 18 ++++++++----------\n utils/gen-controls.py               |  4 ++--\n 5 files changed, 20 insertions(+), 20 deletions(-)","diff":"diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex 2c8c0258c95e..5fb772e6dd14 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -41,12 +41,13 @@ control_source_files = {\n control_headers = []\n \n foreach header, mode : control_source_files\n-    input_files = files('../../src/libcamera/' + header +'.yaml', header + '.h.in')\n+    input_files = files('../../src/libcamera/' + header +'.yaml')\n+    template_file = files(header + '.h.in')\n     control_headers += custom_target(header + '_h',\n                                      input : input_files,\n                                      output : header + '.h',\n-                                     command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@',\n-                                                '--mode', mode],\n+                                     command : [gen_controls, '-o', '@OUTPUT@',\n+                                                '--mode', mode, '-t', template_file, '@INPUT@'],\n                                      install : true,\n                                      install_dir : libcamera_headers_install_dir)\n endforeach\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex e49bf850b355..05ee38daf22b 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -128,12 +128,13 @@ endif\n control_sources = []\n \n foreach source, mode : control_source_files\n-    input_files = files(source +'.yaml', source + '.cpp.in')\n+    input_files = files(source +'.yaml')\n+    template_file = files(source + '.cpp.in')\n     control_sources += custom_target(source + '_cpp',\n                                      input : input_files,\n                                      output : source + '.cpp',\n-                                     command : [gen_controls, '-o', '@OUTPUT@', '@INPUT@',\n-                                                '--mode', mode])\n+                                     command : [gen_controls, '-o', '@OUTPUT@',\n+                                                '--mode', mode, '-t', template_file, '@INPUT@'])\n endforeach\n \n libcamera_sources += control_sources\ndiff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py\nindex dfd7c179a883..cfcfd4d16acf 100755\n--- a/src/py/libcamera/gen-py-controls.py\n+++ b/src/py/libcamera/gen-py-controls.py\n@@ -93,10 +93,10 @@ def main(argv):\n                         help='Mode is either \"controls\" or \"properties\"')\n     parser.add_argument('--output', '-o', metavar='file', type=str,\n                         help='Output file name. Defaults to standard output if not specified.')\n+    parser.add_argument('--template', '-t', type=str, required=True,\n+                        help='Template file name.')\n     parser.add_argument('input', type=str,\n                         help='Input file name.')\n-    parser.add_argument('template', type=str,\n-                        help='Template file name.')\n     args = parser.parse_args(argv[1:])\n \n     if args.mode not in ['controls', 'properties']:\ndiff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\nindex f58c7198ee9e..1c3ea1843ac0 100644\n--- a/src/py/libcamera/meson.build\n+++ b/src/py/libcamera/meson.build\n@@ -28,29 +28,27 @@ pycamera_sources = files([\n \n # Generate controls\n \n-gen_py_controls_input_files = files([\n-    '../../libcamera/control_ids.yaml',\n-    'py_controls_generated.cpp.in',\n-])\n+gen_py_controls_input_files = files('../../libcamera/control_ids.yaml')\n+gen_py_controls_template = files('py_controls_generated.cpp.in')\n \n gen_py_controls = files('gen-py-controls.py')\n \n pycamera_sources += custom_target('py_gen_controls',\n                                   input : gen_py_controls_input_files,\n                                   output : ['py_controls_generated.cpp'],\n-                                  command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@', '@INPUT@'])\n+                                  command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',\n+                                             '-t', gen_py_controls_template, '@INPUT@'])\n \n # Generate properties\n \n-gen_py_property_enums_input_files = files([\n-    '../../libcamera/property_ids.yaml',\n-    'py_properties_generated.cpp.in',\n-])\n+gen_py_property_enums_input_files = files('../../libcamera/property_ids.yaml')\n+gen_py_properties_template = files('py_properties_generated.cpp.in')\n \n pycamera_sources += custom_target('py_gen_properties',\n                                   input : gen_py_property_enums_input_files,\n                                   output : ['py_properties_generated.cpp'],\n-                                  command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@', '@INPUT@'])\n+                                  command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n+                                             '-t', gen_py_properties_template, '@INPUT@'])\n \n # Generate formats\n \ndiff --git a/utils/gen-controls.py b/utils/gen-controls.py\nindex c1172cb26e7b..56e0c7ba98f2 100755\n--- a/utils/gen-controls.py\n+++ b/utils/gen-controls.py\n@@ -340,10 +340,10 @@ def main(argv):\n                         help='Mode of operation')\n     parser.add_argument('--output', '-o', metavar='file', type=str,\n                         help='Output file name. Defaults to standard output if not specified.')\n+    parser.add_argument('--template', '-t', dest='template', type=str, required=True,\n+                        help='Template file name.')\n     parser.add_argument('input', type=str,\n                         help='Input file name.')\n-    parser.add_argument('template', type=str,\n-                        help='Template file name.')\n \n     args = parser.parse_args(argv[1:])\n \n","prefixes":["libcamera-devel","v4","2/6"]}