Show a patch.

GET /api/1.1/patches/20851/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20851,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20851/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20851/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240809005914.20662-2-laurent.pinchart@ideasonboard.com>",
    "date": "2024-08-09T00:59:05",
    "name": "[01/10] meson: Store controls and properties YAML files in variables",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "058cc6d09ccf3b46860557b1e87b7fda26e9ed64",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20851/mbox/",
    "series": [
        {
            "id": 4506,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4506/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4506",
            "date": "2024-08-09T00:59:04",
            "name": "libcamera: Improve code generation for controls",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4506/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20851/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20851/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 E261CBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Aug 2024 00:59:45 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19C3B633BD;\n\tFri,  9 Aug 2024 02:59:44 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4F4176337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Aug 2024 02:59:40 +0200 (CEST)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 59DA083F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Aug 2024 02:58:46 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rThDv1Pb\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723165126;\n\tbh=Cg8pAQzex1NdRaF1U100ZMUm9brX4D/j6NRkEQDwsOs=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=rThDv1PbHjY8pUTC+XoA1fRHj8BxXh7cEZRJxVn+yEkismiDK1WYc2FDIteRkoldj\n\t0/rE6XP1Pp7xz0d9YJGQ/VMUTDavcBXZ7qOxdG+wOoUDmA1K+hMewSA+eRWC4j/Dy2\n\t0lgIFmV5CdouGrxT+fX12+jvVd627oiJXGkxCLNA=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH 01/10] meson: Store controls and properties YAML files in\n\tvariables",
        "Date": "Fri,  9 Aug 2024 03:59:05 +0300",
        "Message-ID": "<20240809005914.20662-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "In-Reply-To": "<20240809005914.20662-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240809005914.20662-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When generating control headers, the YAML files to be used are\ndetermined dynamically based on the selected pipeline handlers. As part\nof this process, the build system populates an array of meson File\nobjects used an an input for the control headers generation custom\ntarget, as well as an array of file names (as strings). The file names\narray is later used to generate the control source files for the\nlibcamera core, as well as the source code for controls support in the\nPython bindings.\n\nBoth of the source code generators manually turn the array of file names\ninto File objects. This duplicates code and reduces readability. A third\nsimilar implementation has also been proposed to generate control\nsupport sources in the GStreamer element, making the issue worse.\n\nTo simplify this, store File objects instead of file names in the\ncontrols_files array. As the meson configuration summary doesn't support\nFile objects, create a separate controls_files_names to store the file\nnames for that sole purpose.\n\nThe exact same process occurs for properties, address them the same way.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/meson.build |  8 ++++++--\n meson.build                   |  4 ++--\n src/libcamera/meson.build     |  2 --\n src/py/libcamera/meson.build  | 15 ++-------------\n 4 files changed, 10 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\nindex c8c900eba66a..36de1c2a393c 100644\n--- a/include/libcamera/meson.build\n+++ b/include/libcamera/meson.build\n@@ -47,7 +47,9 @@ controls_map = {\n \n control_headers = []\n controls_files = []\n+controls_files_names = []\n properties_files = []\n+properties_files_names = []\n \n foreach mode, entry : controls_map\n     files_list = []\n@@ -70,10 +72,12 @@ foreach mode, entry : controls_map\n     outfile = ''\n     if mode == 'controls'\n         outfile = 'control_ids.h'\n-        controls_files += files_list\n+        controls_files += input_files\n+        controls_files_names += files_list\n     else\n         outfile = 'property_ids.h'\n-        properties_files += files_list\n+        properties_files += input_files\n+        properties_files_names += files_list\n     endif\n \n     template_file = files(outfile + '.in')\ndiff --git a/meson.build b/meson.build\nindex 59293e478b00..432ae1337b4a 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -278,8 +278,8 @@ py_mod.find_installation('python3', modules : py_modules)\n summary({\n             'Enabled pipelines': pipelines,\n             'Enabled IPA modules': enabled_ipa_names,\n-            'Controls files': controls_files,\n-            'Properties files': properties_files,\n+            'Controls files': controls_files_names,\n+            'Properties files': properties_files_names,\n             'Hotplug support': libudev.found(),\n             'Tracing support': tracing_enabled,\n             'Android support': android_enabled,\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex c3efc5278ec8..79b8cbaf1311 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -134,8 +134,6 @@ controls_mode_files = {\n }\n \n foreach mode, input_files : controls_mode_files\n-    input_files = files(input_files)\n-\n     if mode == 'controls'\n         template_file = files('control_ids.cpp.in')\n     else\ndiff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build\nindex 4807ca7d75ed..2e67407598db 100644\n--- a/src/py/libcamera/meson.build\n+++ b/src/py/libcamera/meson.build\n@@ -28,32 +28,21 @@ pycamera_sources = files([\n \n # Generate controls\n \n-gen_py_controls_input_files = []\n gen_py_controls_template = files('py_controls_generated.cpp.in')\n-\n gen_py_controls = files('gen-py-controls.py')\n \n-foreach file : controls_files\n-    gen_py_controls_input_files += files('../../libcamera/' + file)\n-endforeach\n-\n pycamera_sources += custom_target('py_gen_controls',\n-                                  input : gen_py_controls_input_files,\n+                                  input : controls_files,\n                                   output : ['py_controls_generated.cpp'],\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 = []\n gen_py_properties_template = files('py_properties_generated.cpp.in')\n \n-foreach file : properties_files\n-    gen_py_property_enums_input_files += files('../../libcamera/' + file)\n-endforeach\n-\n pycamera_sources += custom_target('py_gen_properties',\n-                                  input : gen_py_property_enums_input_files,\n+                                  input : properties_files,\n                                   output : ['py_properties_generated.cpp'],\n                                   command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',\n                                              '-t', gen_py_properties_template, '@INPUT@'])\n",
    "prefixes": [
        "01/10"
    ]
}