Cover Letter Detail
Show a cover letter.
GET /api/1.1/covers/24351/?format=api
{ "id": 24351, "url": "https://patchwork.libcamera.org/api/1.1/covers/24351/?format=api", "web_url": "https://patchwork.libcamera.org/cover/24351/", "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": "<20250912142915.53949-1-mzamazal@redhat.com>", "date": "2025-09-12T14:29:01", "name": "[v18,00/12] Add global configuration file", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "mbox": "https://patchwork.libcamera.org/cover/24351/mbox/", "series": [ { "id": 5441, "url": "https://patchwork.libcamera.org/api/1.1/series/5441/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5441", "date": "2025-09-12T14:29:01", "name": "Add global configuration file", "version": 18, "mbox": "https://patchwork.libcamera.org/series/5441/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/covers/24351/comments/", "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 CE613BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Sep 2025 14:29:30 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF6976936F;\n\tFri, 12 Sep 2025 16:29:29 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5645169367\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Sep 2025 16:29:28 +0200 (CEST)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-355-0HLUHXoqOxqhRHvyS7eN4w-1;\n\tFri, 12 Sep 2025 10:29:24 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.93])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id BC1BA1944F06; Fri, 12 Sep 2025 14:29:22 +0000 (UTC)", "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.45.224.48])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id D67C31800446; Fri, 12 Sep 2025 14:29:19 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"cDkgTjPw\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1757687367;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=LLFoKOrJIPDrcCpnBpUgdDRno/Ujvl/VhWhC/mL3Egc=;\n\tb=cDkgTjPwjFfbhWB6V2BYrQA3PQnS1DcxDpd1UfwX0n8Y0DU85jPkO6TsNK8y5w8waaZ5um\n\tAWAuyWsufbPzKxaSht+ngw/MqdkHLDLhr9Gy1V4+PSsfgDdk3m1km1F5pJjlr1pZhWxawm\n\tFiQJIYglhWzRXxh1chfWqzd+Nh5f7ZY=", "X-MC-Unique": "0HLUHXoqOxqhRHvyS7eN4w-1", "X-Mimecast-MFC-AGG-ID": "0HLUHXoqOxqhRHvyS7eN4w_1757687363", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>", "Subject": "[PATCH v18 00/12] Add global configuration file", "Date": "Fri, 12 Sep 2025 16:29:01 +0200", "Message-ID": "<20250912142915.53949-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "f2kwcPQf4MGoP_XtLBv4JBifFbHpqJ1tJnV6IrQmNiY_1757687363", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=UTF-8", "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": "This patch series introduces global configuration file for libcamera, to\nprovide runtime configuration means other than environment variables.\nInstead of, or in addition to, the growing list of configuration\nenvironment variables, the whole configuration can be specified in a\nsingle configuration file. This is both simpler and more flexible.\n\nThis is not a replacement for specific configuration files already\npresent in libcamera, with the exception of rpi configuration file (see\n“Look up rpi configuration in the configuration file” patch).\n\nThe patches implement what is needed to introduce a configuration file\nthat can handle the current environment variables and software ISP\nTODOs. They demonstrate how to deal with the key points that must be\nconsidered. Logging is omitted from the configuration file for\ntechnical reasons. See commit messages for more details.\n\nThe configuration file is a YAML file. It is looked up in user’s home\ndirectory or, if not present, in system-wide libcamera directories.\nBoth the directories and file name of the configuration file can be\noverridden using newly introduced environment variables.\n\nThe current configuration environment variables are still supported and\ntake precedence, if defined, over the corresponding entries in the YAML\nfile.\n\nThis patch series is not exhaustive, there can be future enhancements,\nmost notably configuration file validation to avoid confusions caused by\ntypos etc.\n\nNot everything has been tested because some of the patches are related\nto specific hardware.\n\nChanges in v18:\n- Cosmetic changes suggested by Paul applied.\n- A superfluous include removed.\n- All patches Reviewed-by Paul.\n\nChanges in v17:\n- Configuration file version is checked now.\n- The behaviour when a configuration file can’t be loaded documented in\n GlobalConfiguration class docstring.\n- Wording improvements based on the feedback from Paul.\n- All the configuration access helpers moved to a single commit.\n- The debug log about software ISP override logs the driver name and\n that it comes from the configuration file.\n- Software ISP configuration options moved out of the simple pipeline to\n a dedicated configuration section.\n- No-env-variable configuration options documented in the documentation.\n- LIBCAMERA_CONFIG_NAME being a relative path is no longer mentioned in\n the documentation. The implementation is unchanged but the\n description is simplified.\n- LIBCAMERA_CONFIG_DIR + LIBCAMERA_CONFIG_NAME patches squashed and\n the commit message enhanced with comments from Barnabás.\n\nChanges in v16:\n- Non-code fixes suggested by Barnabás.\n\nChanges in v15:\n- Fixes to reading configuration files suggested by Barnabás.\n- The outdated example in the documentation fixed.\n\nChanges in v14:\n- Unused expectedTarget variable removed.\n- Old `ipas' examples in examples removed.\n- IPAProxy::{configPaths_,execPaths_} have their direct types now,\n without std::optional.\n\nChanges in v13:\n- If LIBCAMERA_CONFIG_NAME is defined but empty, no configuration is\n loaded.\n- Standard user configuration directory has no longer precedence over\n LIBCAMERA_CONFIG_DIR.\n- Improvements to the rpi code suggested by Barnabás.\n- Documentation fixes suggested by Barnabás.\n- Make sure yamlConfiguration_ is initialized.\n\nChanges in v12:\n- The commit message of \"Make GlobalConfiguration instance\" updated\n according to the recent discussions.\n- Use initializer_list rather than a string with separators for\n GlobalConfiguration option path arguments.\n- char *const qualifiers dropped.\n- rpi can have separate configurations for different targets.\n- GlobalConfiguration::option template is not type limited anymore.\n- utils::join used instead of manual string concatenation.\n- envListOption and listOption return std::optional now.\n- Configuration corresponding to LIBCAMERA_*_TUNING_FILE dropped.\n- Isolation configuration stored to IPAManager to avoid passing the\n whole configuraton to isSignatureValid.\n- Similarly to paths in IPAProxy.\n- `delimiter' argument added to GlobalConfiguration::envListOption and\n used for LIBCAMERA_PIPELINES_MATCH_LIST processing.\n- Configuration no longer looked up in /etc/libcamera and additionally\n looked up in LIBCAMERA_DATA_DIR.\n- Cosmetic changes suggested by Barnabás.\n\nChanges in v11:\n- global_configuration.cpp moved out of base and yaml_parser.cpp left in\n its original place.\n- Configuration initialized as empty if there is no configuration file,\n preventing a segfault on later access.\n- Cosmetic changes suggested by Laurent.\n- GlobalConfiguration::get() removed, *yamlConfiguration_ used directly.\n- Failing to read an existent configuration file is an error, rather\n than warning, now. (It should be also fatal, but how to propagate it?)\n- Slash is used instead of dot to separate configuration names.\n- rpi configuration read is in the global configuration directly (unless\n overridden by LIBCAMERA_RPI_CONFIG_FILE) now.\n\nChanges in v10:\n- Minor improvements suggested by Barnabás.\n\nChanges in v9:\n- The configuration instance is now stored in CameraManager and accessed\n from there rather than being a separate singleton wrapped by global\n accessors. This solves the ugly problem of delayed initialization but\n I don’t like anything else about it. I played a bit with the idea of\n attaching it to Logger instead, see the commit message of patch 03 for\n some discussion, but stayed with the CameraManager proposal\n eventually.\n- I’ve given up on the logging configuration now when the configuration\n is stored in CameraManager and removed the corresponding patches. I\n think it’s possible to add it later, but for now, it’s already\n complicated enough.\n- Not much tested, let’s see first if the current implementation gets in\n an acceptable direction.\n\nChanges in v8:\n- Rebased on current master.\n- Anniversary edition: 400 days since v1 posted. ;-)\n\nChanges in v7:\n- Rebased on current master.\n- Tuning file path configuration updated for recent changes.\n A significant change is that the tuning file configuration is no\n longer sensor dependent as there is apparently no access to the sensor\n info in the IPA proxy.\n- Minor improvements of some commit messages.\n\nChanges in v6:\n- Rebased on master.\n- File names from file header descriptions removed.\n- Indentation fix in moved code as requested by checkstyle.py.\n- Unneeded const_cast's removed.\n- Using GlobalConfiguration namespace rather than a class.\n- Path configuration options are defined as sequences in YAML.\n- A patch introducing LIBCAMERA_CONFIG_NAME added.\n- A patch introducing LIBCAMERA_CONFIG_DIR added.\n- Miscellaneous minor code changes suggested by Barnabás.\n\nChanges in v5:\n- A pointer is used to store the global configuration singleton rather\n than a static variable. This makes the things more robust and fixes\n the problem with re-entrancy on logging and a failing\n camera_reconfigure test.\n- In relation to the change above, a new initialization method\n GlobalConfiguration::initialize() was introduced that replaces the\n initialization calls in CameraManager and IPAManager.\n- Logging YAML errors when reading the configuration was also fixed.\n- Global configuration is placed to base directly, without an\n intermediate patch.\n- An `optional' value comparison simplified.\n- A temporary typo in a comment fixed.\n- Unused stdint.h include removed.\n\nChanges in v4:\n- Rebased on current master.\n- Configuration option for LIBCAMERA_IPA_PROXY_PATH added.\n- Added a patch to include stdlib.h instead of cstdlib in yaml_parser.cpp.\n\nChanges in v3:\n- Added a configuration item for the newly introduced\n LIBCAMERA_PIPELINES_MATCH_LIST variable.\n- A minor indentation fix.\n- Fixed `pipelines.' x `pipeline.' configuration item naming mismatch.\n- Tuning files are looked up now by particular cameras attached rather than\n being specified for the whole pipeline.\n- Helpers use std::string& instead of char* for confPath arguments.\n- Protection against returning YamlObject::empty as a regular value (the\n problem has been probably exposed by addition of\n LIBCAMERA_PIPELINES_MATCH_LIST).\n\nChanges in v2:\n- Rebased on master.\n- Various cleanups, documentation improvements and minor fixes.\n- Configuration option for LIBCAMERA_RPI_TUNING_FILE added (Naush).\n- Two more patches for software ISP configuration added.\n\nMilan Zamazal (12):\n config: Introduce global runtime configuration\n libcamera: camera_manager: Construct GlobalConfiguration instance\n config: Add configuration retrieval helpers\n pipeline: rpi: Look up rpi configuration in the configuration file\n ipa: Look up IPA configurables in configuration file\n libcamera: camera_manager: Look up pipelines match list in\n configuration file\n pipeline: simple: Allow enabling software ISP via config file\n Documentation: Add global configuration file documentation\n libcamera: software_isp: Make input buffer copying configurable\n libcamera: software_isp: Make measurement configurable\n config: Make configuration file locations configurable\n config: Check configuration file version\n\n Documentation/documentation-contents.rst | 2 +-\n Documentation/index.rst | 2 +-\n Documentation/meson.build | 2 +-\n ...ariables.rst => runtime_configuration.rst} | 160 +++++++++-\n include/libcamera/internal/camera_manager.h | 12 +-\n .../libcamera/internal/global_configuration.h | 62 ++++\n include/libcamera/internal/ipa_manager.h | 7 +-\n include/libcamera/internal/ipa_proxy.h | 8 +-\n include/libcamera/internal/meson.build | 1 +\n src/libcamera/camera_manager.cpp | 20 +-\n src/libcamera/global_configuration.cpp | 274 ++++++++++++++++++\n src/libcamera/ipa_manager.cpp | 39 ++-\n src/libcamera/ipa_proxy.cpp | 58 ++--\n src/libcamera/meson.build | 1 +\n .../pipeline/rpi/common/pipeline_base.cpp | 59 ++--\n .../pipeline/rpi/common/pipeline_base.h | 3 +-\n src/libcamera/pipeline/rpi/pisp/pisp.cpp | 26 +-\n src/libcamera/pipeline/rpi/vc4/vc4.cpp | 26 +-\n src/libcamera/pipeline/simple/simple.cpp | 15 +\n src/libcamera/software_isp/TODO | 36 ---\n src/libcamera/software_isp/debayer_cpu.cpp | 32 +-\n src/libcamera/software_isp/debayer_cpu.h | 10 +-\n src/libcamera/software_isp/software_isp.cpp | 3 +-\n .../module_ipa_proxy.cpp.tmpl | 4 +-\n .../module_ipa_proxy.h.tmpl | 2 +-\n 25 files changed, 680 insertions(+), 184 deletions(-)\n rename Documentation/{environment_variables.rst => runtime_configuration.rst} (54%)\n create mode 100644 include/libcamera/internal/global_configuration.h\n create mode 100644 src/libcamera/global_configuration.cpp" }