Patch Detail
Show a patch.
GET /api/1.1/patches/26559/?format=api
{ "id": 26559, "url": "https://patchwork.libcamera.org/api/1.1/patches/26559/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26559/", "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": "<20260423230059.3180987-38-laurent.pinchart@ideasonboard.com>", "date": "2026-04-23T23:00:59", "name": "[v3,37/37] pipeline: simple: Turn devices configuration option into dictionary", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "81d05c21572038772292e84c6df19a0c0a39ab77", "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/26559/mbox/", "series": [ { "id": 5883, "url": "https://patchwork.libcamera.org/api/1.1/series/5883/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5883", "date": "2026-04-23T23:00:22", "name": "libcamera: Global configuration file improvements", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5883/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/26559/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26559/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 696A7BDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Apr 2026 23:02:09 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 118A962FE5;\n\tFri, 24 Apr 2026 01:02:09 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B32662FC2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2026 01:01:52 +0200 (CEST)", "from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B29F61A4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2026 01:00:12 +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=\"S0UQc4iw\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1776985212;\n\tbh=p2cC2HRZib4lYgISO2fuyANTT9PKHDu0z0H6ABaNSVQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=S0UQc4iwtLJTa8alVw14cnAYoZJCOeE8nSuMVmADZvc0t/5sqVMU6BB5mt3deH1Ey\n\t9JeO3WK1RCyDQeRUvYBUudw4GEpN3uhs2E0PI423c8s/VPGssGmRBf9ownIJBTML1d\n\tEC7CW4xqCVGAZgtDHKgqXrzJRMxpcqUBbcOy7xGg=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v3 37/37] pipeline: simple: Turn devices configuration option\n\tinto dictionary", "Date": "Fri, 24 Apr 2026 02:00:59 +0300", "Message-ID": "<20260423230059.3180987-38-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260423230059.3180987-1-laurent.pinchart@ideasonboard.com>", "References": "<20260423230059.3180987-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "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": "The pipelines.simple.devices configuration option contains a list of\ndevices, each of them being a dictionary with a \"driver\" element that\nacts as a unique key to index the list. Turn it into a YAML dictionary\nto ensure uniqueness of the key, and simplify access in the pipeline\nhandler.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\n---\nChanges since v1:\n\n- Print override message only when overriding\n---\nThis simplification will preclude indexing the list of devices with a\ncompound key. For instance, if we were to extend the simple pipeline\nhandler to match not only on a driver name but on a (driver, driver\nversion) pair, the current configuration file structure would allow\nexpressing this with\n\n pipelines:\n simple:\n devices:\n - driver: mxc-isi\n\t driver_version: 1\n\t software_isp: true\n - driver: mxc-isi\n\t driver_version: 2\n\t software_isp: false\n\nThe new structure would conceptually allow us to write\n\n pipelines:\n simple:\n devices:\n ? driver: mxc-isi\n\t driver_version: 1\n\t: software_isp: true\n ? driver: mxc-isi\n\t driver_version: 2\n\t: software_isp: false\n\nFor those not familiar with the explicit syntax for mappings, this would\ntranslate to the following Python data if dict objects were hashable in\nPython:\n\n{\n 'pipelines': {\n 'simple': {\n\t 'devices': {\n\t { 'driver': 'mxc-isi', 'driver_version': 1 }: {\n\t\t 'software_isp': True,\n\t\t},\n\t { 'driver': 'mxc-isi', 'driver_version': 2 }: {\n\t\t 'software_isp': False,\n\t\t},\n\t },\n\t},\n },\n}\n\nYes, YAML can use complex data as keys in mappings. I would really not\nwant to have to support that in libcamera though.\n\nOpinions will be appreciated.\n---\n Documentation/runtime_configuration.rst | 6 +++---\n src/libcamera/pipeline/simple/simple.cpp | 21 ++++++++++-----------\n 2 files changed, 13 insertions(+), 14 deletions(-)", "diff": "diff --git a/Documentation/runtime_configuration.rst b/Documentation/runtime_configuration.rst\nindex 9dfa61e72ce8..6fc53131433f 100644\n--- a/Documentation/runtime_configuration.rst\n+++ b/Documentation/runtime_configuration.rst\n@@ -44,7 +44,7 @@ file structure:\n pipelines:\n simple:\n devices:\n- - driver: # driver name, e.g. `mxc-isi`\n+ # driver name, e.g. `mxc-isi`:\n software_isp: # true/false\n software_isp:\n copy_input_buffer: # true/false\n@@ -79,7 +79,7 @@ Configuration file example\n pipelines:\n simple:\n devices:\n- - driver: mxc-isi\n+ mxc-isi:\n software_isp: true\n software_isp:\n copy_input_buffer: false\n@@ -150,7 +150,7 @@ LIBCAMERA_SOFTISP_MODE, software_isp.mode\n \n Example value: ``gpu``\n \n-pipelines.simple.devices.driver, pipelines.simple.devices.software_isp\n+pipelines.simple.devices.<driver>.software_isp\n Override whether software ISP is enabled for the given driver.\n \n Example `driver` value: ``mxc-isi``\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 9ae220fc8860..b10c7fc4a25e 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1879,18 +1879,17 @@ bool SimplePipelineHandler::matchDevice(std::shared_ptr<MediaDevice> media,\n \t}\n \n \tswIspEnabled_ = info.swIspEnabled;\n+\n \tconst GlobalConfiguration &configuration = cameraManager()->_d()->configuration();\n-\tfor (const ValueNode &entry :\n-\t configuration.configuration()[\"pipelines\"][\"simple\"][\"devices\"]\n-\t\t .asList()) {\n-\t\tauto name = entry[\"driver\"].get<std::string>();\n-\t\tif (name == info.driver) {\n-\t\t\tswIspEnabled_ = entry[\"software_isp\"].get<bool>().value_or(swIspEnabled_);\n-\t\t\tLOG(SimplePipeline, Debug)\n-\t\t\t\t<< \"Configuration file overrides software ISP for \"\n-\t\t\t\t<< info.driver << \" to \" << swIspEnabled_;\n-\t\t\tbreak;\n-\t\t}\n+\tconst ValueNode &cfg =\n+\t\tconfiguration.configuration()[\"pipelines\"][\"simple\"][\"devices\"][info.driver];\n+\n+\tif (auto enable = cfg[\"software_isp\"].get<bool>()) {\n+\t\tswIspEnabled_ = *enable;\n+\n+\t\tLOG(SimplePipeline, Debug)\n+\t\t\t<< \"Configuration file overrides software ISP for \"\n+\t\t\t<< info.driver << \" to \" << swIspEnabled_;\n \t}\n \n \t/* Locate the sensors. */\n", "prefixes": [ "v3", "37/37" ] }