{"id":23751,"url":"https://patchwork.libcamera.org/api/1.1/patches/23751/?format=json","web_url":"https://patchwork.libcamera.org/patch/23751/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20250707085520.39777-3-stefan.klug@ideasonboard.com>","date":"2025-07-07T08:55:05","name":"[v3,2/9] utils: gen-debug-controls: Fix handling of controls that appear multiple times","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c4142d95279d58403cc00e7a3b97f99a6d06fef8","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23751/mbox/","series":[{"id":5273,"url":"https://patchwork.libcamera.org/api/1.1/series/5273/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5273","date":"2025-07-07T08:55:03","name":"Wdr preparations","version":3,"mbox":"https://patchwork.libcamera.org/series/5273/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23751/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23751/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 DE191C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jul 2025 08:55:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7327B68E8C;\n\tMon,  7 Jul 2025 10:55:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4F47968E7F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jul 2025 10:55:40 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:c79f:85df:e7f5:4c31])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A7A80190D; \n\tMon,  7 Jul 2025 10:55:13 +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=\"DydhLHMc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751878513;\n\tbh=mpWY2PdpGfqPwI38J+x1H4tmUL82j0GDHtT12cc7mXI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DydhLHMctrE6MueYevdYSyr+aLVrGcMUCYUvtan9h/djh7FB7z33QAgKCJpVeQKLc\n\tAyg/84rXR1x/jyNKSfnCT1IrwgUOGSz4Pat+B2JcYXs7CHJThAT72RULJ0YO+iu420\n\tQYHXKFYbyTkpQ01vRNqLHcwjrJNZxK3qAHacT6fM=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>,\n\tIsaac Scott <isaac.scott@ideasonboard.com>","Subject":"[PATCH v3 2/9] utils: gen-debug-controls: Fix handling of controls\n\tthat appear multiple times","Date":"Mon,  7 Jul 2025 10:55:05 +0200","Message-ID":"<20250707085520.39777-3-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.48.1","In-Reply-To":"<20250707085520.39777-1-stefan.klug@ideasonboard.com>","References":"<20250707085520.39777-1-stefan.klug@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":"Allow usage of the same debug control in multiple places as long as all\ninstances are of the same type and size.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\n\n---\n\nChanges in v3:\n- Collected tags\n\nChanges in v2:\n- Collected tag\n---\n utils/gen-debug-controls.py | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)","diff":"diff --git a/utils/gen-debug-controls.py b/utils/gen-debug-controls.py\nindex 53c8fa70d76d..ff22b986475e 100755\n--- a/utils/gen-debug-controls.py\n+++ b/utils/gen-debug-controls.py\n@@ -96,6 +96,7 @@ def main(argv):\n             controls_map[k] = v\n \n     obsolete_names = list(controls_map.keys())\n+    found_by_name = {}\n \n     for m in matches:\n         if not m.type:\n@@ -111,6 +112,12 @@ def main(argv):\n         if m.size is not None:\n             desc['size'] = m.size\n \n+        c = found_by_name.setdefault(m.name, m)\n+        if c.type != m.type or c.size != m.size:\n+            logger.error(\n+                f\"Found multiple entries for control '{m.name}' with differing type or size\")\n+            return 1\n+\n         if m.name in controls_map:\n             # Can't use == for modified check because of the special yaml dicts.\n             update_needed = False\n@@ -127,7 +134,9 @@ def main(argv):\n                 controls_map[m.name].clear()\n                 controls_map[m.name].update(desc)\n \n-            obsolete_names.remove(m.name)\n+            # Don't try to remove more than once in case control was found multiple files.\n+            if m.name in obsolete_names:\n+                obsolete_names.remove(m.name)\n         else:\n             logger.info(f\"Add control '{m.name}'\")\n             insert_before = len(controls)\n","prefixes":["v3","2/9"]}