{"id":9629,"url":"https://patchwork.libcamera.org/api/1.1/patches/9629/?format=json","web_url":"https://patchwork.libcamera.org/patch/9629/","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":"<20200915142038.28757-20-paul.elder@ideasonboard.com>","date":"2020-09-15T14:20:34","name":"[libcamera-devel,19/23] libcamera: IPAProxy: Remove registration mechanism","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6edd9230768862fe820466dcb7673c774e04a253","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9629/mbox/","series":[{"id":1291,"url":"https://patchwork.libcamera.org/api/1.1/series/1291/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1291","date":"2020-09-15T14:20:16","name":"IPA isolation implementation","version":1,"mbox":"https://patchwork.libcamera.org/series/1291/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9629/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9629/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 EF63CBF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Sep 2020 14:21:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C163862E32;\n\tTue, 15 Sep 2020 16:21:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65BFD62D27\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Sep 2020 16:21:38 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A9338276;\n\tTue, 15 Sep 2020 16:21:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QiHgRXxX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1600179698;\n\tbh=urhzEubPDXC4MXe9xCrpU38vtq2k003CzNMsLvFNjTY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=QiHgRXxX/Ba9f4SPg5n3BsiZixS/hqbJDR9QmmT9nyf9I/N6lRSMsa1OgoQVe+qeI\n\trN/NJtyxfLmBodPC/jAKIcbI7fSrTif5prhKvoshh2edZtncWcmKzmIqXK+/J4gUdl\n\tNWLdOa27osNe2Xve19YcelcixBnfEgaDT+wF4ySE=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 15 Sep 2020 23:20:34 +0900","Message-Id":"<20200915142038.28757-20-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200915142038.28757-1-paul.elder@ideasonboard.com>","References":"<20200915142038.28757-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 19/23] libcamera: IPAProxy: Remove\n\tregistration mechanism","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Implementations of IPA proxies use a registration mechanism to register\nthemselves with the main IPA proxy factory. This registration declares\nstatic objects, causing a risk of things being constructed before the\nproper libcamera facilities are ready. Since each pipeline handler has\nits own IPA proxy and knows the type, it isn't necessary to have a proxy\nfactory. Remove it to alleviate the risk of early construction.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n include/libcamera/internal/ipa_proxy.h | 29 ---------\n src/libcamera/ipa_proxy.cpp            | 85 --------------------------\n 2 files changed, 114 deletions(-)","diff":"diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\nindex 1903150e..f651a3ae 100644\n--- a/include/libcamera/internal/ipa_proxy.h\n+++ b/include/libcamera/internal/ipa_proxy.h\n@@ -36,35 +36,6 @@ private:\n \tIPAModule *ipam_;\n };\n \n-class IPAProxyFactory\n-{\n-public:\n-\tIPAProxyFactory(const char *name);\n-\tvirtual ~IPAProxyFactory() {}\n-\n-\tvirtual std::unique_ptr<IPAProxy> create(IPAModule *ipam, bool isolate) = 0;\n-\n-\tconst std::string &name() const { return name_; }\n-\n-\tstatic void registerType(IPAProxyFactory *factory);\n-\tstatic std::vector<IPAProxyFactory *> &factories();\n-\n-private:\n-\tstd::string name_;\n-};\n-\n-#define REGISTER_IPA_PROXY(proxy)\t\t\t\t\t\\\n-class proxy##Factory final : public IPAProxyFactory\t\t\t\\\n-{\t\t\t\t\t\t\t\t\t\\\n-public:\t\t\t\t\t\t\t\t\t\\\n-\tproxy##Factory() : IPAProxyFactory(#proxy) {}\t\t\t\\\n-\tstd::unique_ptr<IPAProxy> create(IPAModule *ipam, bool isolate)\t\\\n-\t{\t\t\t\t\t\t\t\t\\\n-\t\treturn std::make_unique<proxy>(ipam, isolate);\t\t\\\n-\t}\t\t\t\t\t\t\t\t\\\n-};\t\t\t\t\t\t\t\t\t\\\n-static proxy##Factory global_##proxy##Factory;\n-\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_H__ */\ndiff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\nindex ff4d7fd1..e7d4db06 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -229,89 +229,4 @@ std::string IPAProxy::resolvePath(const std::string &file) const\n  * construction.\n  */\n \n-/**\n- * \\class IPAProxyFactory\n- * \\brief Registration of IPAProxy classes and creation of instances\n- *\n- * To facilitate discovery and instantiation of IPAProxy classes, the\n- * IPAProxyFactory class maintains a registry of IPAProxy classes. Each\n- * IPAProxy subclass shall register itself using the REGISTER_IPA_PROXY()\n- * macro, which will create a corresponding instance of a IPAProxyFactory\n- * subclass and register it with the static list of factories.\n- */\n-\n-/**\n- * \\brief Construct a IPAProxy factory\n- * \\param[in] name Name of the IPAProxy class\n- *\n- * Creating an instance of the factory registers is with the global list of\n- * factories, accessible through the factories() function.\n- *\n- * The factory \\a name is used for debugging and IPAProxy matching purposes\n- * and shall be unique.\n- */\n-IPAProxyFactory::IPAProxyFactory(const char *name)\n-\t: name_(name)\n-{\n-\tregisterType(this);\n-}\n-\n-/**\n- * \\fn IPAProxyFactory::create()\n- * \\brief Create an instance of the IPAProxy corresponding to the factory\n- * \\param[in] ipam The IPA module\n- *\n- * This virtual function is implemented by the REGISTER_IPA_PROXY() macro.\n- * It creates a IPAProxy instance that isolates an IPA interface designated\n- * by the IPA module \\a ipam.\n- *\n- * \\return A pointer to a newly constructed instance of the IPAProxy subclass\n- * corresponding to the factory\n- */\n-\n-/**\n- * \\fn IPAProxyFactory::name()\n- * \\brief Retrieve the factory name\n- * \\return The factory name\n- */\n-\n-/**\n- * \\brief Add a IPAProxy class to the registry\n- * \\param[in] factory Factory to use to construct the IPAProxy\n- *\n- * The caller is responsible to guarantee the uniqueness of the IPAProxy name.\n- */\n-void IPAProxyFactory::registerType(IPAProxyFactory *factory)\n-{\n-\tstd::vector<IPAProxyFactory *> &factories = IPAProxyFactory::factories();\n-\n-\tfactories.push_back(factory);\n-\n-\tLOG(IPAProxy, Debug)\n-\t\t<< \"Registered proxy \\\"\" << factory->name() << \"\\\"\";\n-}\n-\n-/**\n- * \\brief Retrieve the list of all IPAProxy factories\n- *\n- * The static factories map is defined inside the function to ensure it gets\n- * initialized on first use, without any dependency on link order.\n- *\n- * \\return The list of pipeline handler factories\n- */\n-std::vector<IPAProxyFactory *> &IPAProxyFactory::factories()\n-{\n-\tstatic std::vector<IPAProxyFactory *> factories;\n-\treturn factories;\n-}\n-\n-/**\n- * \\def REGISTER_IPA_PROXY\n- * \\brief Register a IPAProxy with the IPAProxy factory\n- * \\param[in] proxy Class name of IPAProxy derived class to register\n- *\n- * Register a proxy subclass with the factory and make it available to\n- * isolate IPA modules.\n- */\n-\n } /* namespace libcamera */\n","prefixes":["libcamera-devel","19/23"]}