{"id":25145,"url":"https://patchwork.libcamera.org/api/patches/25145/?format=json","web_url":"https://patchwork.libcamera.org/patch/25145/","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":"<20251120233347.5046-22-bryan.odonoghue@linaro.org>","date":"2025-11-20T23:33:45","name":"[v4,21/23] ipa: libipa: module: Add createSelfEnumeratingAlgorithm","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"5728910e8ee2b83ddf96bf04874ce89f3b04c664","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25145/mbox/","series":[{"id":5600,"url":"https://patchwork.libcamera.org/api/series/5600/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5600","date":"2025-11-20T23:33:24","name":"Add GLES 2.0 GPUISP to libcamera","version":4,"mbox":"https://patchwork.libcamera.org/series/5600/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25145/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25145/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 399DEBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 23:34:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E680160B0F;\n\tFri, 21 Nov 2025 00:34:33 +0100 (CET)","from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE61960AB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 00:34:31 +0100 (CET)","by mail-wm1-x32d.google.com with SMTP id\n\t5b1f17b1804b1-477a219dbcaso13868525e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 15:34:31 -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\tffacd0b85a97d-42cb7fa3a81sm7984139f8f.26.2025.11.20.15.34.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 20 Nov 2025 15:34:30 -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=\"O2/sxY9e\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1763681671; x=1764286471;\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=TkT+a2CnUga2pQvVkMr1EpE/d+TJ7UNDIhvUEz6eS0s=;\n\tb=O2/sxY9eGLmHh0HfIXCthu2t9y/p2di8r9LZZnMgRvXCJOESwQ1dMSamYaOrgeW6ro\n\t9bjRQpBQQxP6H/AE5oYLZtkbBs/FdPHqx4kbknyudvhFyZs0GcWqa2eJgjOC1Xmqoe3T\n\tjrNEbVCBhLEWvt1I2toERHy1NZtSo4AAEg7ql9W0fE0p/HS46rf7ckwFhqGTLlzsR4Hu\n\tbaZ6Qyx6l/XCi5P0vOYDkj10yxak8+SNSfRy6NiqaEptG94e+Qwq8dzzCGQ6qEK/uPIc\n\tlZCMm6kDlTqAWpdgfkNx1up+7+QOgivNBMOAsJBvGFgg2ucS84Uuu4gxTUAWEeCRRDp+\n\tokfQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763681671; x=1764286471;\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=TkT+a2CnUga2pQvVkMr1EpE/d+TJ7UNDIhvUEz6eS0s=;\n\tb=eOFphUV1Tytkz36Yx8G1Gqd0iLllHuWRsE0a/ygHOARXxTpM1BHuW6IGRV9HGnYvtC\n\tRTEJk3HFqBFTrdhuNdnFAFfhmY+1EKpyjQ4lSQqP3fe9iYAFwAiN50Tti+pJhJbOjLoG\n\tVlkizFLLJataVhqGZNrQMk2zDFRr1shDp3+4H655YQVsKcvTjudmqLiJf2BsDm3OTAo/\n\tWTYsDLPr7Cd4KJBDxd5JN5Q22SY83Tkqz9RjZfd38b5eanS4msiQigaSWqyqlshBrQhg\n\tqFyYiYKkePEVoulP7eMbsoUhneJGPTcL3MVsYRfM5m5Zeh9LF1OvmGJ6xiwKaiElE/Fo\n\tlWvw==","X-Gm-Message-State":"AOJu0Yygm9C5nR97s+aw+ujTDWzxlW41eDD4dIHM4JVoEZ8BeK1ViJWz\n\tc7WEAY9aQTpR23tvAJEXKpeRLt9DknvS2qXZdObAi/viutELXhI6KJ/cXpZ+XQEVkQhonyGTo9r\n\tiaS70+s8=","X-Gm-Gg":"ASbGncthvHbzzN1FjGVL9RuDkBZrcJ3+Zj+Rb8NFGq3Xso0uFx0N2/xEI6OwgvBrxrQ\n\ttaLo2O595Hrgj3NpTaQUwy9VZ8uubX9x3Hw9SQI01KydMvw/oVwq35SaLnEJN1+G53o3LBJvI7s\n\thKeqbDVxxmCgR0nKY6lK1ofLiEQ3ioHpqUkfLmczyzFSkwIg7BO7YeLOIlXsf10/3d0DSG6AsNE\n\tr03u7dBEEbhwXuFjRXjkkts85yM5GN0mSqs2b7Ef7Na4DJ5XYKLYP9lrdbNYxOms+ceZltw8qrZ\n\tUiLAEd1oZQ4x+gMBD+ZsR/9MediOKtjIiGb5IdKi+G7c3yF86Ri/g/+6Z92yX1YwfYWQZVgYkDj\n\tU2nvbtUrAbpixiLz93yWMJiHI85ZUlLgDiOBvgPoLib80zCO+SIZj8f8Wg4IDTum6T9Y1wdvWiu\n\tcAbZ0InSfA8cZbILIbc75lqcdEu5gxGzSEPpNhgKhKj1iVWwjYId8weRgPnDf/QMTm2L4=","X-Google-Smtp-Source":"AGHT+IFMHx96olIGmPLnBgM6g1PRvACossLASN4JRzbSuK3kw+bE7TBrQUO2rzzvqvR1p4dOECR2SA==","X-Received":"by 2002:a05:600c:3110:b0:477:b734:8c52 with SMTP id\n\t5b1f17b1804b1-477c0185bebmr3513425e9.14.1763681671261; \n\tThu, 20 Nov 2025 15:34:31 -0800 (PST)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>","Subject":"[PATCH v4 21/23] ipa: libipa: module: Add\n\tcreateSelfEnumeratingAlgorithm","Date":"Thu, 20 Nov 2025 23:33:45 +0000","Message-ID":"<20251120233347.5046-22-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.51.2","In-Reply-To":"<20251120233347.5046-1-bryan.odonoghue@linaro.org>","References":"<20251120233347.5046-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":"Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/ipa/libipa/module.h | 41 +++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 41 insertions(+)","diff":"diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h\nindex 0fb51916f..d11e189bc 100644\n--- a/src/ipa/libipa/module.h\n+++ b/src/ipa/libipa/module.h\n@@ -70,6 +70,47 @@ public:\n \t\tfactories().push_back(factory);\n \t}\n \n+\t/**\n+\t * \\fn int Module::createSelfEnumeratingAlgorithm(Context &context, const std::string &name)\n+\t * \\brief Create and initialise a self-enumerating algorithm by name\n+\t * \n+\t * This function creates an algorithm instance from the registered algorithm\n+\t * factories using only the algorithm name, without requiring YAML configuration\n+\t * data.\n+\t * \n+\t * This is useful for algorithms that don't require external configuration\n+\t * parameters and can self-configure or use default values.\n+\t * \n+\t * \\param[in] context The IPA context to pass to the algorithm's init function\n+\t * \\param[in] name The name of the algorithm to instantiate\n+\t * \n+\t * \\return 0 on success, negative errno value on failure:\n+\t *         -EINVAL if the algorithm is not found in the factory registry\n+\t *         Other negative values if algorithm initialisation fails\n+\t */\n+\tint createSelfEnumeratingAlgorithm(Context &context, 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+\t\t\t\t<< \"Algorithm '\" << name << \"' not found\";\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tint ret = algo->init(context);\n+\t\tif (ret) {\n+\t\t\tLOG(IPAModuleAlgo, Error)\n+\t\t\t\t<< \"Algorithm '\" << name << \"' failed to initialize\";\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tLOG(IPAModuleAlgo, Debug)\n+\t\t\t<< \"Instantiated algorithm '\" << name << \"'\";\n+\n+\t\talgorithms_.push_back(std::move(algo));\n+\t\treturn 0;\n+\t}\n+\n private:\n \tint createAlgorithm(Context &context, const YamlObject &data)\n \t{\n","prefixes":["v4","21/23"]}