{"id":25981,"url":"https://patchwork.libcamera.org/api/1.1/patches/25981/?format=json","web_url":"https://patchwork.libcamera.org/patch/25981/","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":"<20260127171506.17480-4-david.plowman@raspberrypi.com>","date":"2026-01-27T17:13:18","name":"[v6,3/4] ipa: rpi: controller: Ignore algorithms that are not enabled","commit_ref":"7214950ffeb323a512e221167ba9c5350f1c5441","pull_url":null,"state":"accepted","archived":false,"hash":"6a279d69102d991415ce8ddbb134b6480d734e0a","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/1.1/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25981/mbox/","series":[{"id":5745,"url":"https://patchwork.libcamera.org/api/1.1/series/5745/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5745","date":"2026-01-27T17:13:15","name":"Raspberry Pi AWB using neural networks","version":6,"mbox":"https://patchwork.libcamera.org/series/5745/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25981/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25981/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 D28E5C32E7\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Jan 2026 17:15:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 103BA61FD5;\n\tTue, 27 Jan 2026 18:15:20 +0100 (CET)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C130361FBF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jan 2026 18:15:14 +0100 (CET)","by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-4801d98cf39so45292845e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jan 2026 09:15:14 -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\t5b1f17b1804b1-4806cddffe9sm12267865e9.4.2026.01.27.09.15.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 27 Jan 2026 09:15:12 -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=\"nqmr3FwO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1769534114; x=1770138914;\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=nqmr3FwOVkPhcyNo5qpum0sO/G4IolVFW5jdfZQhJEu3BB0ZISJXdyo3zQZr3LNvjK\n\t35yD3Epua2hf7OzTG+WmPlOEvoDoH/q8EDyQL2t6HcBgEov1ec1kKJAFa4j9OAAYk5ta\n\t04SbCuIhuHw002iV5CNLUdhENcrM112wBOiKGgWYeZkQQ8Y4Ynv2C0ubJO+7UmOV1t9r\n\t2jlfWurtdX9Tp9xmsNWLTOqsKc2z/ZzGxzSKjTQ6bs/XyK8NUYCtf43W1D8QV0wfaUgE\n\tBGX8rGdG9jG9uu8eVg+2PZcTa81cwy+ONjlVgLYQLiz7MjgciRHa4gtkflyQopivMFsB\n\t+Pcg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1769534114; x=1770138914;\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=FXK+EY/atcc2+auHXUM5citE4asv6dtWO5O394dGLIdgCRZvAMCWCjrIp3jsTJ0zwc\n\t/uWRHE2NKaSiM/YGCyCAmXAm8UuJ7gAtmkhDJBJstyFNPpXNgVamHM1EshwczLIuWZlT\n\tql30im6zFrG5niKYblnUNln0cDZMNvUCf2fDjUUFN+nwLceSMr3Vvyjvjd1yWIkERUS/\n\tIqRcflNs4AoH1yGerX0Nt0D3EYQPp8IZ+G3t0WReDnzYar5hvTxzsg0oxMhgcbYq5rJq\n\th0mGYOHsbDUKenZmaLaAy+GdXF/6nnptjyTRiQ+I0vFbVCjobVRP/lIaI0apmn1grhYS\n\t4THA==","X-Gm-Message-State":"AOJu0YxvckKUkwsvV2vvVLHdcM5ZdyzWU+Ds0IT6FQxSXsyUd1WnK8/+\n\tqPuXMYYNcY9PFLDStyzyGz6JpIBclHwQTEL/TEFCvTUIntxmcUa6srkQx2Cn/PXTiCdNZIW0oAZ\n\tys3P3","X-Gm-Gg":"AZuq6aJgNvwxGh+3Zl2Il4YKYjlPsYpIfljjC8bODzGTn3j4Wcu1b3bcz5CGkLeQwQC\n\tr0KB31OissSpJdvSWlmt1lf7vRghK7xabdnD5h4EaxrGvaX3OBv8QR4xlDdQktYPlpnvsDB2eCL\n\tYhyr82iBPrg+knYsMp1XTAegpFWSlOs6DbWcb1hN+s8TlOA28Fc2/BWkHuXUUo1ictnmxK8VfBt\n\t7Tu4oinaxNeFJy6kUpJ4iXYW92J/niB51lg8pet9Uuxbx3Q8iL+3VXC2L+XNl+9l5e2i0uGF5wh\n\t3WBgbLKVEyVtDSc/fDvvNgL+wZYmuIcn90muHSfw0iwd4yUcO6HO5x6PaHoXHkKr0AgZcQCa4rt\n\tNWwWXgxrVlQgBuWoiYYRYnqbMj2I5PlCuIJjCnTaAN/gQWLWKWDKglBazaktIfN2/tyak9w9heF\n\tkJqMUtm4rsfuPXTZeuHKf9TDfNNrgRDWpsAe8zgwYYN3m/Q6QsXrmfZeRK8LJlMCVJjhmq7lXPW\n\tkjKYEkEwyIPMfwZcMPW17wkGPw82A==","X-Received":"by 2002:a05:600c:8b16:b0:480:1a9a:e571 with SMTP id\n\t5b1f17b1804b1-48069c8c109mr28174895e9.22.1769534113730; \n\tTue, 27 Jan 2026 09:15:13 -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 v6 3/4] ipa: rpi: controller: Ignore algorithms that are not\n\tenabled","Date":"Tue, 27 Jan 2026 17:13:18 +0000","Message-ID":"<20260127171506.17480-4-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<20260127171506.17480-1-david.plowman@raspberrypi.com>","References":"<20260127171506.17480-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":["v6","3/4"]}