Patch Detail
Show a patch.
GET /api/patches/25594/?format=api
{ "id": 25594, "url": "https://patchwork.libcamera.org/api/patches/25594/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25594/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20251217100138.82525-22-bryan.odonoghue@linaro.org>", "date": "2025-12-17T10:01:33", "name": "[v9,21/26] ipa: libipa: module: Add createSelfEnumeratingAlgorithm", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "7afafb800bc683af09f465c52c405b6ebf1a0aa5", "submitter": { "id": 175, "url": "https://patchwork.libcamera.org/api/people/175/?format=api", "name": "Bryan O'Donoghue", "email": "bryan.odonoghue@linaro.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25594/mbox/", "series": [ { "id": 5669, "url": "https://patchwork.libcamera.org/api/series/5669/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5669", "date": "2025-12-17T10:01:12", "name": "Add GLES 2.0 GPUISP to libcamera", "version": 9, "mbox": "https://patchwork.libcamera.org/series/5669/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25594/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25594/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 9CCE8C32F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Dec 2025 10:02:25 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D14C061F3A;\n\tWed, 17 Dec 2025 11:02:24 +0100 (CET)", "from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22F8861F28\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Dec 2025 11:02:09 +0100 (CET)", "by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-47798ded6fcso36050895e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Dec 2025 02:02:09 -0800 (PST)", "from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47bdc1583fbsm32292585e9.0.2025.12.17.02.02.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 17 Dec 2025 02:02:07 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"q6FqmFZi\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765965728; x=1766570528;\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=ZK3P0VzssNwl0WhBtRyk+w7dSYasdHalDGrt/ye5fgo=;\n\tb=q6FqmFZiUtuSp//3vCFW+90PAiTwIXGamOK7tWKlNf6SMLzaH4EGo8ZKV4wUPrvBN5\n\tDAWH+MzmgSGqW4qHa6dH9g8H+trUQq+d1Soyo/n+13iqqsbCTNv/8qMzLyDyM8z+gevY\n\tqf+JVMoL64QXZdNM4SUM/pQZc/BDXYS9l2/xBzR+Y8gLH862YVDweFO8L2KeWsfHrhQ+\n\tZuAzGaYFFr8n28ZpwqP/u/Sjht9SzojzbO05vGPhJRhLoU3VZm0yMRbM8UMpL/MyZFe7\n\tTLD5cxMkit3c78ysMfjNlCaQ0+rkw45lUKeBLPiPPr9V5DP2PaccqF4FwMwNw7eCv3wz\n\tMa/A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765965728; x=1766570528;\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=ZK3P0VzssNwl0WhBtRyk+w7dSYasdHalDGrt/ye5fgo=;\n\tb=rdD6STNi2yuNXWucLveMpnc+xxvHf2ZwETH+x8rKLRO7s5jwIQAHN7HOftxVK318fI\n\tqwxrS2eaVqMomsCP9pR0e8Wrb35ZipKBCIz3cVjnnsCoBbIBgTs3qqcvG+ZlV2u/adDo\n\thAYo0eKblTcQZh7z9pZONfO7IexYkt5v05XT59enWu/WQ4i7szRkrKTIwo9EBj+sPHAH\n\tg4VPWawJR7Ux8tISmhbeuqVPXjlToPr7dWPbb/3zHz91ViqtkIEMhXqdw9ByzHQa3816\n\tkL0CdQHP42SFBc9CX+i9qLw6k7oSh30KGetIq6fd5MZaHTXDPkcYB1ocWagjvJ/jEvcj\n\t4y+g==", "X-Gm-Message-State": "AOJu0YzO3XvAuzys4lgxeVeJS1myf17T1qXGBVQI34hUj4H64j0kkCOr\n\txUc2BZzBorkotuGZpYNJAsbk5R2ysw5BLI5XC5sbMAy0lq+HJgGbGxUkomIIqJtSiJShPwB1Tjh\n\tyGAPE", "X-Gm-Gg": "AY/fxX6iU1rawaGRgZYjrN1aaG4Xa46uxHzVnbeN6DTkFvoIzpTYIfYuH9W6Vmqlivw\n\t2OZi99FGlwPBhuxD7XOpFZchX/tOoPj8Z4EZ5/SyT/ryGVSy49+k3VTjvjiqCZ6kCQ4QuES0h+v\n\tuxthO4ZxDr3St9qy75MucT4SDjBNcIwWgsgqReULoRsO1dhexcC/znHxHsnXFvlKhlkCWIzcLXt\n\tOBrAXmCc9veDdtYmDMtZ6XOpOGWltnJzu3ja6kNhwmW6kXeNrsCX49ammwcObnbZkUsAwzr7MfU\n\t7rEDj8o6bC8IhNr5bEgb25dI+YTo9NhGNuP+C9YoAdkge77Tb0g/rMeS/nbxOaGewOR3tGsuMG5\n\tQK0M77rjg+jAmtdkPWxn2MQAOTLVRila/nGHF8CRYz1JgPaoP8fKJVEgFrqTujtLwjZ5MLoLZYh\n\tuQ8GtfxjLF2XWISAL/QzQNIszvACrPYnfT1SgKOKHtcKPI73PPdq+zLcTgKG6Kt8mNtyg=", "X-Google-Smtp-Source": "AGHT+IGYDq5HAP3rkh+XO8HGsPp8VVlBUSrq2YQSUXbsvOMcv1MqKlZY0CaNGNeJmUD9PHM4KSclBA==", "X-Received": "by 2002:a05:600d:b:b0:47a:94fc:d057 with SMTP id\n\t5b1f17b1804b1-47a94fcd555mr125619335e9.2.1765965728179; \n\tWed, 17 Dec 2025 02:02:08 -0800 (PST)", "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMilan Zamazal <mzamazal@redhat.com>", "Subject": "[PATCH v9 21/26] ipa: libipa: module: Add\n\tcreateSelfEnumeratingAlgorithm", "Date": "Wed, 17 Dec 2025 10:01:33 +0000", "Message-ID": "<20251217100138.82525-22-bryan.odonoghue@linaro.org>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20251217100138.82525-1-bryan.odonoghue@linaro.org>", "References": "<20251217100138.82525-1-bryan.odonoghue@linaro.org>", "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": "Create an algorithm without having YAML data input.\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/ipa/libipa/module.cpp | 34 +++++++++++++++++++++++++++++\n src/ipa/libipa/module.h | 46 +++++++++++++++++++++++++++++----------\n 2 files changed, 68 insertions(+), 12 deletions(-)", "diff": "diff --git a/src/ipa/libipa/module.cpp b/src/ipa/libipa/module.cpp\nindex a95dca696..8e86ca823 100644\n--- a/src/ipa/libipa/module.cpp\n+++ b/src/ipa/libipa/module.cpp\n@@ -83,6 +83,40 @@ namespace ipa {\n * \\return The list of instantiated algorithms\n */\n \n+/**\n+ * \\fn int Module::createSelfEnumeratingAlgorithm(Context &context, const std::string &name)\n+ * \\brief Create and initialise a self-enumerating algorithm by name\n+ *\n+ * This function creates an algorithm instance from the registered algorithm\n+ * factories using only the algorithm name, without requiring YAML configuration\n+ * data.\n+ *\n+ * This is useful for algorithms that don't require external configuration\n+ * parameters and can self-configure or use default values.\n+ *\n+ * \\param[in] context The IPA context to pass to the algorithm's init function\n+ * \\param[in] name The name of the algorithm to instantiate\n+ *\n+ * \\return 0 on success, negative errno value on failure:\n+ * -EINVAL if the algorithm is not found in the factory registry\n+ * Other negative values if algorithm initialisation fails\n+ */\n+\n+/**\n+ * \\fn int Module::createAlgorithmCommon(Context &context, const YamlObject &algoData, const std::string &name)\n+ * \\brief Common helper fucntion to allow createSelfEnumeratingAlgorithm and createAlgorithm share code\n+ *\n+ * Worker method which allows sharing of common code in the Yaml and self-initialising algorithm case\n+ *\n+ * \\param[in] context The IPA context to pass to the algorithm's init function\n+ * \\param[in] algoData Yaml object\n+ * \\param[in] name The name of the algorithm to instantiate\n+ *\n+ * \\return 0 on success, negative errno value on failure:\n+ * -EINVAL if the algorithm is not found in the factory registry\n+ * Other negative values if algorithm initialisation fails\n+ */\n+\n /**\n * \\fn Module::createAlgorithms()\n * \\brief Create algorithms from YAML configuration data\ndiff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h\nindex c27af7718..d309606f2 100644\n--- a/src/ipa/libipa/module.h\n+++ b/src/ipa/libipa/module.h\n@@ -70,22 +70,25 @@ public:\n \t\tfactories().push_back(factory);\n \t}\n \n-private:\n-\tint createAlgorithm(Context &context, const YamlObject &data)\n+\tint createSelfEnumeratingAlgorithm(Context &context, const std::string &name)\n \t{\n-\t\tconst auto &[name, algoData] = *data.asDict().begin();\n+\t\tYamlObject dummy;\n \n-\t\t/*\n-\t\t * Optionally, algorithms can be disabled via the tuning file\n-\t\t * by including enabled: false as a parameter within the\n-\t\t * algorithm tuning data. This is not an error, so we return 0.\n-\t\t */\n-\t\tif (!algoData[\"enabled\"].get<bool>(true)) {\n-\t\t\tLOG(IPAModuleAlgo, Info)\n-\t\t\t\t<< \"Algorithm '\" << name << \"' disabled via tuning file\";\n-\t\t\treturn 0;\n+\t\tstd::unique_ptr<Algorithm<Module>> algo = createAlgorithm(name);\n+\t\tif (!algo) {\n+\t\t\tLOG(IPAModuleAlgo, Error)\n+\t\t\t\t<< \"Algorithm '\" << name << \"' not found\";\n+\t\t\treturn -EINVAL;\n \t\t}\n \n+\t\tcontext.selfInitialising = true;\n+\n+\t\treturn createAlgorithmCommon(context, dummy, name);\n+\t}\n+\n+private:\n+\tint createAlgorithmCommon(Context &context, const YamlObject &algoData, const std::string &name)\n+\t{\n \t\tstd::unique_ptr<Algorithm<Module>> algo = createAlgorithm(name);\n \t\tif (!algo) {\n \t\t\tLOG(IPAModuleAlgo, Error)\n@@ -104,9 +107,28 @@ private:\n \t\t\t<< \"Instantiated algorithm '\" << name << \"'\";\n \n \t\talgorithms_.push_back(std::move(algo));\n+\n \t\treturn 0;\n \t}\n \n+\tint createAlgorithm(Context &context, const YamlObject &data)\n+\t{\n+\t\tconst auto &[name, algoData] = *data.asDict().begin();\n+\n+\t\t/*\n+\t\t * Optionally, algorithms can be disabled via the tuning file\n+\t\t * by including enabled: false as a parameter within the\n+\t\t * algorithm tuning data. This is not an error, so we return 0.\n+\t\t */\n+\t\tif (!algoData[\"enabled\"].get<bool>(true)) {\n+\t\t\tLOG(IPAModuleAlgo, Info)\n+\t\t\t\t<< \"Algorithm '\" << name << \"' disabled via tuning file\";\n+\t\t\treturn 0;\n+\t\t}\n+\n+\t\treturn createAlgorithmCommon(context, algoData, name);\n+\t}\n+\n \tstatic std::unique_ptr<Algorithm<Module>> createAlgorithm(const std::string &name)\n \t{\n \t\tfor (const AlgorithmFactoryBase<Module> *factory : factories()) {\n", "prefixes": [ "v9", "21/26" ] }