Patch Detail
Show a patch.
GET /api/1.1/patches/24251/?format=api
{ "id": 24251, "url": "https://patchwork.libcamera.org/api/1.1/patches/24251/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24251/", "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": "<20250828-py-control-prefix-v1-1-7b9496996fa3@emfend.at>", "date": "2025-08-28T09:25:39", "name": "py: gen-py-controls: Use generic workaround for enum prefixes", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "670dd99ae35b7f000e8c5747123b2986ee49468c", "submitter": { "id": 134, "url": "https://patchwork.libcamera.org/api/1.1/people/134/?format=api", "name": "Matthias Fend", "email": "matthias.fend@emfend.at" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24251/mbox/", "series": [ { "id": 5409, "url": "https://patchwork.libcamera.org/api/1.1/series/5409/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5409", "date": "2025-08-28T09:25:39", "name": "py: gen-py-controls: Use generic workaround for enum prefixes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5409/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24251/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24251/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 F1F69BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Aug 2025 09:25:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD6A5692F1;\n\tThu, 28 Aug 2025 11:25:47 +0200 (CEST)", "from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A12A3613BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Aug 2025 11:25:45 +0200 (CEST)", "from 194-208-208-245.tele.net ([194.208.208.245]:49864\n\thelo=[127.0.1.1]) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls\n\tTLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93)\n\t(envelope-from <matthias.fend@emfend.at>)\n\tid 1urYt6-007XtY-E0; Thu, 28 Aug 2025 11:25:44 +0200" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=emfend.at header.i=@emfend.at\n\theader.b=\"KCLiQJar\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at;\n\ts=mail;\n\th=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:\n\tMIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID:Content-Description\n\t:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tIn-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=JV3yalUTNx1iRiwCZg7bgloFGJpJxEVV25rokJkAIm8=;\n\tb=KCLiQJarc7zDNtg5jPzITgMP+C\n\tTJdK5zi0wWj3kpxPava0190KlMjrOSqzMsusRnTqE8buQccxLdszHON0u4M5KaWInDQ1rLcxhIsVD\n\ttuNWyoTyMDnnxpVqW1TzyOO334yiAk5dum+zAi9LxPR7+Y3bJoS8n0jYlA2NaF4XZYq8=;", "From": "Matthias Fend <matthias.fend@emfend.at>", "Date": "Thu, 28 Aug 2025 11:25:39 +0200", "Subject": "[PATCH] py: gen-py-controls: Use generic workaround for enum\n\tprefixes", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20250828-py-control-prefix-v1-1-7b9496996fa3@emfend.at>", "X-B4-Tracking": "v=1; b=H4sIAJIgsGgC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE\n\tvPSU3UzU4B8JSMDI1MDCyML3YJK3eT8vJKi/BzdgqLUtMwKXXOj5ETLxMRkyzRDMyWgPogw2Mz\n\to2NpaAMrtX6pjAAAA", "X-Change-ID": "20250828-py-control-prefix-72ca9aac9f16", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Matthias Fend <matthias.fend@emfend.at>", "X-Mailer": "b4 0.14.2", "X-Spam-Score": "", "X-Spam-Bar": "", "X-Spam-Report": "", "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": "Detecting the prefix from the enum value strings doesn't work properly if\nthe individual values start with the same characters. This is the case, for\nexample, with On/Off and Start/Stop. Therefore, a hard-coded workaround was\nrequired for the LensShadingMapMode (Off/On) control.\n\nSince enum values typically use the control name as the prefix, a better\nand more generic solution would be to use the name directly as the prefix.\n\nHowever, since some existing control enums use a different prefix than\ntheir name, the previous version is still required for these.\n\nTo eliminate the workaround and still remain compatible, the control name\nis used as the prefix if the prefix determined with the original method\nbegins with the control name.\n\nSigned-off-by: Matthias Fend <matthias.fend@emfend.at>\n---\n src/py/libcamera/gen-py-controls.py | 12 +++---------\n 1 file changed, 3 insertions(+), 9 deletions(-)\n\n\n---\nbase-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\nchange-id: 20250828-py-control-prefix-72ca9aac9f16\n\nBest regards,", "diff": "diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py\nindex d43a7c1c7eab5744988febebc493c8a858f1d82e..8e9fb560145dd655f3d605be2863407feaef1fc1 100755\n--- a/src/py/libcamera/gen-py-controls.py\n+++ b/src/py/libcamera/gen-py-controls.py\n@@ -34,15 +34,9 @@ def extend_control(ctrl, mode):\n if not ctrl.is_enum:\n return ctrl\n \n- if mode == 'controls':\n- # Adjustments for controls\n- if ctrl.name == 'LensShadingMapMode':\n- prefix = 'LensShadingMapMode'\n- else:\n- prefix = find_common_prefix([e.name for e in ctrl.enum_values])\n- else:\n- # Adjustments for properties\n- prefix = find_common_prefix([e.name for e in ctrl.enum_values])\n+ prefix = find_common_prefix([e.name for e in ctrl.enum_values])\n+ if prefix.startswith(ctrl.name):\n+ prefix = ctrl.name\n \n for enum in ctrl.enum_values:\n enum.py_name = enum.name[len(prefix):]\n", "prefixes": [] }