{"id":19235,"url":"https://patchwork.libcamera.org/api/patches/19235/?format=json","web_url":"https://patchwork.libcamera.org/patch/19235/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20231124123713.22519-3-naush@raspberrypi.com>","date":"2023-11-24T12:37:08","name":"[libcamera-devel,v3,2/7] controls: Update argument handling for controls generation scripts","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b1501d4965668e900b3b60c89ffebd5b9d29a58e","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19235/mbox/","series":[{"id":4084,"url":"https://patchwork.libcamera.org/api/series/4084/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4084","date":"2023-11-24T12:37:06","name":"Vendor controls and properties","version":3,"mbox":"https://patchwork.libcamera.org/series/4084/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19235/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19235/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 25BF6C328F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Nov 2023 12:37:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0E957629C5;\n\tFri, 24 Nov 2023 13:37:21 +0100 (CET)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 61D4F629B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Nov 2023 13:37:18 +0100 (CET)","by mail-wm1-x32a.google.com with SMTP id\n\t5b1f17b1804b1-40b358f216dso12065605e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Nov 2023 04:37:18 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tv11-20020a05600c444b00b0040b3867a297sm3303690wmn.36.2023.11.24.04.37.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 24 Nov 2023 04:37:16 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1700829441;\n\tbh=ehngwBkfs7R+bPnNwIVw1bFA5d7Nf3Z/b0qPu2pWLyo=;\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:\n\tFrom;\n\tb=U/hb5FoMt08YKW4ALXSG+35kfOOHCx5ZJjxJH2VrDDiN5/mrhG9E4SCA0thK/a4k8\n\t16/EzN+AZ91Bk2LPnisnQR5sOzS9ovWtClWlPLi/eo/N5ltdve1+Vv7h03s5wibRj7\n\t99qZJUyFW8iA+klBCtw9CXJHtnesRI64SPcr2+4f5dcBz30ENa98KqOXJhCeseoCiC\n\tDW2SoSuMSBHsYXahEqIrvhmwSqySQDFO+RYRByVZbcpWIt5+HI9vf8/ZY1nw5BgvVO\n\t61SzdpZX80wwuQqPgSrXcycGo6i/tVdxQXCqsOo7XRyufMM6ZAGCa+0T74KMTxmK0I\n\teSUmWWOPdWTAQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1700829437; x=1701434237;\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=9RwY5vd7zi9A8JwMNsB0WJPcBdyXlwV+lPLOwLdH5O0=;\n\tb=o5O2RKjFKpQuRtp9rAGbqCTtGugfUjmPH4AuSI+5rrnY63yKKpGXips/GPWBgl9pEM\n\tFSbUMGi8YwQV8esuudp6xBq/GJFj7PY0CcQ2+zrQxvsG0iozCzt1D/eEvSLiDOLKDbF+\n\tMLkWFnxSO1JCFWBiKECPzKWW3NEuS7t385zqscD3Nw0fEgdbVLV9e8NWlzVBcdMP+Bd5\n\tUXbtdT3cd4VvDGz4SfXLx3u6HGOfuu1LyZjPGkBTII6/k8vvViTDRpxSVZsOh9q0TbQx\n\tQ3FMVtWHsktp95/Ewx//mx80gcd/UKz5kgzu7FN+y/q7Tz2iUoCs0SRL5KaL7Q34JRWD\n\tqpZA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"o5O2RKjF\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1700829437; x=1701434237;\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=9RwY5vd7zi9A8JwMNsB0WJPcBdyXlwV+lPLOwLdH5O0=;\n\tb=vJmacJsCuF8dSKFUG2R/iuTwqDlWPAFm+Cqblrflz4iKex78WjvCYGyqPPzsieCkyC\n\tDgsfR5CoFO30oHXP5tMG1Yl0saEVK+/X5VjRLJapxeDaT/OULJj8fNEfsXMZZRSZugyS\n\tTav9T2Mz3VmTWsjLmre5jEcS7RjFPlRCRfzni41zVI19Kp9mw5sBQ7i3DwSGmIEw3joM\n\tDZA+HKSl4Ru+QXv06vEH7/wAqCVtRoti+D469skIHNGHqd+BZxGLfcXa+yVhnDXQ2y2U\n\tts9mHTuXa4UCBENJij8yGtDRx0dmyPA/Mfd/jmqFU4IL/uQKzZLj2PzcTCYXUMun/7aK\n\tg8oQ==","X-Gm-Message-State":"AOJu0Yx2TmVSS33lD3dn+rSzCkW1jX5s22KfaT6p2WUQvjT7pccSwQ/Y\n\tiVXShqYVY5SU52kUjHra6xLSL3kOJmHe0MI5kNcrgw==","X-Google-Smtp-Source":"AGHT+IGPOA49crTnC5DmcbdxMW7rZzCPdcitwvem7Vbs4JKfh6C5s69WEu9wkU8MMaKsRcWTTfSDow==","X-Received":"by 2002:a05:600c:2614:b0:408:3ea0:3026 with SMTP id\n\th20-20020a05600c261400b004083ea03026mr2322994wma.11.1700829437600; \n\tFri, 24 Nov 2023 04:37:17 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Nov 2023 12:37:08 +0000","Message-Id":"<20231124123713.22519-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20231124123713.22519-1-naush@raspberrypi.com>","References":"<20231124123713.22519-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/7] 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>","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>\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 4c8d41eb9997..6680ecf84acb 100755\n--- a/utils/gen-controls.py\n+++ b/utils/gen-controls.py\n@@ -337,10 +337,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","v3","2/7"]}