{"id":25570,"url":"https://patchwork.libcamera.org/api/patches/25570/?format=json","web_url":"https://patchwork.libcamera.org/patch/25570/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20251216164451.13055-4-david.plowman@raspberrypi.com>","date":"2025-12-16T16:40:43","name":"[v4,3/4] ipa: rpi: controller: Ignore algorithms that are not enabled","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6a279d69102d991415ce8ddbb134b6480d734e0a","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25570/mbox/","series":[{"id":5667,"url":"https://patchwork.libcamera.org/api/series/5667/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5667","date":"2025-12-16T16:40:40","name":"Raspberry Pi AWB using neural networks","version":4,"mbox":"https://patchwork.libcamera.org/series/5667/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25570/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25570/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 C5A73C3274\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Dec 2025 16:45:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA94761A23;\n\tTue, 16 Dec 2025 17:45:01 +0100 (CET)","from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE44161A27\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Dec 2025 17:44:59 +0100 (CET)","by mail-wr1-x436.google.com with SMTP id\n\tffacd0b85a97d-42e33956e76so2267932f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Dec 2025 08:44:59 -0800 (PST)","from davidp-pi5.pitowers.org\n\t([2a00:1098:3142:1f:88ea:c658:5b20:5e46])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-4310ada856bsm26826f8f.3.2025.12.16.08.44.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 16 Dec 2025 08:44:57 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"UCeNMICH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1765903499; x=1766508299;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=rHmpk8rHk/IlsYU76ryoqPKQ/4NYcVsL5LSqEDs/vLU=;\n\tb=UCeNMICHCLHJyrBw3CvzXDcn5kFpTz+mvwjXF6ek30H6naXaseWqSt/InWlV4twq7y\n\twhRqzCpDRzprj8QRmDqjFRRyQ1BM6KxpIX/qjy9WB9+TL/RsWtcsL9T26givTkAiWvmc\n\t3W/ln2oxs+mBhwmIuyz2a2h3wwUhZ24ttCy5mHbKy5F6NYuuW4YGJI51XH+IWVh1T5IN\n\t+/9k+uzDK61wHVtZ7WL6Jo2F9I/uoL6FPsggbxEdP8Dn6YMyFv2U0K2WEHD2BXvoqlu8\n\tiXLFue0BYDhNi15pL9FJV9+M0D3SIsWSAlSqXzZA1EHzXYHYBE9FOpNZmeJt1TndxO8z\n\tsbQA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765903499; x=1766508299;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=rHmpk8rHk/IlsYU76ryoqPKQ/4NYcVsL5LSqEDs/vLU=;\n\tb=CZ+Xm+B+xv3TIQvdKJMgNc/9ZcqbNXD76OoD1jOKRUNdBP3tzBFMu0NXPWEDNsOLna\n\tLHh48YE3ujWdEgQPOYgDqEG/xSJVXQTRJmuXP8J61reWYBDhFlXJ0ER/kQQfg7slYlBU\n\tSEPFy71h5goi2Pn8Kc2Jz4EqlEYPYHpB2AorN7I1CAN6QInk7AshKPk7Df2nbmPiKMgm\n\tKY7HiE/aqmXIMHgQhSn82uL6/sQXjnjio6UUN4kXwYgtZsFe8r2AZ8JS1zDSZuQ61TPw\n\tWtjLu1S+dq8Lihgk4mfL0a2ccv/F1Jnfi5oepq81zGoDcg9Y17X825tEUEHyHVidpkWq\n\tZyNQ==","X-Gm-Message-State":"AOJu0YyX++a6nz58/0qgXNYKlItQKPOtYyoGZNgMH7r5//43crltVhtd\n\t2fwb6SexkcauZg9bxp2umw8UKNaODppEoO0izCuBtbsiY48j6t9Zp8lcK9BnsnkWufI0k+/2sqX\n\t2BDMh","X-Gm-Gg":"AY/fxX7m7ccqUfpCvRpQ5jFtUjt1h0fA8lZgbq9REaUX8Lh9pcbxTN4zJp/6+IxgyxN\n\ttzwvmV5IeQz5miLsyZalJeYzLVnDicdg1RUhHo6v9h5AYeUBsKEPDBApE3JHO4ELQuYBEDfUfB+\n\t4nShEO48jSTYB55zBTlPqHMUdgx3EGGnieOizPtFZB1xsjGZzRIzdluan//pvb07BpKMESY9Vcj\n\tUkwT+zlL1Sm1gyxe+owA2aJ9FZoEWjXi1vfWaAP4oZWMsbbafxroewkm80aCqRDzoenBxoHyN8+\n\t9DbFKGoG3X+kqyDV0eSvmmYDlIfVrDpW6+h6o/964e6JvyLr2nCiml2ziYeF4C477KWiHj5hSXE\n\tNMsHWEacUQT6y10iOHRhIykoyeCaVL0pdWZ/FocoRzwpqhwQeFfBwxeA5ESY+931Rsf2eywIU2N\n\tIb3xasrdWJGM9p+xUvCKLreL0E0xIJABtSLAqGwH79u0DJ9Di8he7iMWSmHbhCGoehzqm4H287E\n\tlhPTxfKm/Q7cMxbQ9cXowqXbv0nUg==","X-Google-Smtp-Source":"AGHT+IHL2PR9VlDqz3d2k3DZMoF5AokydArinNH+yaSlR+W0szgANL2LuFCPaArXXZzQDFM1jhDNAA==","X-Received":"by 2002:a05:6000:2405:b0:430:f23f:4bbe with SMTP id\n\tffacd0b85a97d-430f23f4e20mr14051928f8f.24.1765903498859; \n\tTue, 16 Dec 2025 08:44:58 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Peter Bailey <peter.bailey@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Subject":"[PATCH v4 3/4] ipa: rpi: controller: Ignore algorithms that are not\n\tenabled","Date":"Tue, 16 Dec 2025 16:40:43 +0000","Message-ID":"<20251216164451.13055-4-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<20251216164451.13055-1-david.plowman@raspberrypi.com>","References":"<20251216164451.13055-1-david.plowman@raspberrypi.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":"From: Peter Bailey <peter.bailey@raspberrypi.com>\n\nAlgorithms may now contain an \"enabled\" field which can be set to\nfalse to disable it and prevent it from being loaded. If not present,\nalgorithms are treated as enabled by default for backwards\ncompatability.\n\nWe additionally prevent duplicate versions of the same algorithm type\n(such as AWB) from loading, and flag an error. This will prevent\nundefined behaviour if (for example) two distinct AWB algorithms are\ntrying to run simultaneously.\n\nSigned-off-by: Peter Bailey <peter.bailey@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/rpi/controller/controller.cpp | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)","diff":"diff --git a/src/ipa/rpi/controller/controller.cpp b/src/ipa/rpi/controller/controller.cpp\nindex df45dcd3..88de6f36 100644\n--- a/src/ipa/rpi/controller/controller.cpp\n+++ b/src/ipa/rpi/controller/controller.cpp\n@@ -145,6 +145,14 @@ int Controller::read(char const *filename)\n \n int Controller::createAlgorithm(const std::string &name, const YamlObject &params)\n {\n+\t/* Any algorithm may be disabled by setting \"enabled\" to false. */\n+\tbool enabled = params[\"enabled\"].get<bool>(true);\n+\tLOG(RPiController, Debug)\n+\t\t<< \"Algorithm \" << name << \": \"\n+\t\t<< (enabled ? \"enabled\" : \"disabled\");\n+\tif (!enabled)\n+\t\treturn 0;\n+\n \tauto it = getAlgorithms().find(name);\n \tif (it == getAlgorithms().end()) {\n \t\tLOG(RPiController, Warning)\n@@ -152,6 +160,16 @@ int Controller::createAlgorithm(const std::string &name, const YamlObject &param\n \t\treturn 0;\n \t}\n \n+\t/* Do not allow duplicate versions of algorithms (e.g. AWB) to run. */\n+\tsize_t pos = name.find_last_of('.');\n+\tstd::string const &algoType =\n+\t\tpos == std::string::npos ? name : name.substr(pos + 1);\n+\tif (getAlgorithm(algoType)) {\n+\t\tLOG(RPiController, Error)\n+\t\t\t<< \"Algorithm type '\" << algoType << \"' already exists\";\n+\t\treturn -1;\n+\t}\n+\n \tAlgorithm *algo = (*it->second)(this);\n \tint ret = algo->read(params);\n \tif (ret)\n","prefixes":["v4","3/4"]}