Show a patch.

GET /api/patches/10377/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 10377,
    "url": "https://patchwork.libcamera.org/api/patches/10377/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10377/",
    "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": "<20201106103707.49660-30-paul.elder@ideasonboard.com>",
    "date": "2020-11-06T10:36:59",
    "name": "[libcamera-devel,v4,29/37] libcamera: IPAProxy: Remove registration mechanism",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ce9805bd28bcf5f52117a949bc2e2accf650dc69",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10377/mbox/",
    "series": [
        {
            "id": 1448,
            "url": "https://patchwork.libcamera.org/api/series/1448/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1448",
            "date": "2020-11-06T10:36:30",
            "name": "IPA isolation implementation",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/1448/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10377/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10377/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 1D282BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Nov 2020 10:38:25 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE86962D3B;\n\tFri,  6 Nov 2020 11:38:24 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5095962D3C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Nov 2020 11:38:23 +0100 (CET)",
            "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 89F3AB16;\n\tFri,  6 Nov 2020 11:38:21 +0100 (CET)"
        ],
        "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=\"Dn6cOkmj\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604659103;\n\tbh=PPsDAplVVbYM3hNV807Vyfo0Ne764Q9I5SgMof8qOdM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Dn6cOkmj9MM1NM8MG5iiBsvu/Jeq5fwpTpWGvcqvq/o3bnEE+hUp6E0TnasFkMYE/\n\tazi7SVc1qtGsvhJdfmwxivTxORTak/8d8BTS89/j+n2TYqA+19d3v0hJHMFL7wN2FN\n\trwmwIWkGj84KSijtutQB1q7q9oHzLrv6GS3N2tY4=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  6 Nov 2020 19:36:59 +0900",
        "Message-Id": "<20201106103707.49660-30-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201106103707.49660-1-paul.elder@ideasonboard.com>",
        "References": "<20201106103707.49660-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v4 29/37] 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=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "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>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n---\nNo change in v4\n\nNo change in v3\n\nChanges in v2:\n- remove documentation\n---\n include/libcamera/internal/ipa_proxy.h | 29 --------\n src/libcamera/ipa_proxy.cpp            | 93 --------------------------\n 2 files changed, 122 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\nindex 195d2cb4..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() = default;\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 ee5e6f3e..29c0e9e0 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -30,17 +30,11 @@ LOG_DEFINE_CATEGORY(IPAProxy)\n  * \\brief IPA Proxy\n  *\n  * Isolate IPA into separate process.\n- *\n- * Every subclass of proxy shall be registered with libcamera using\n- * the REGISTER_IPA_PROXY() macro.\n  */\n \n /**\n  * \\brief Construct an IPAProxy instance\n  * \\param[in] ipam The IPA module\n- *\n- * IPAProxy instances shall be constructed through the IPAProxyFactory::create()\n- * method implemented by the respective factories.\n  */\n IPAProxy::IPAProxy(IPAModule *ipam)\n \t: valid_(false), ipam_(ipam)\n@@ -219,91 +213,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- * \\param[in] isolate Flag to isolate 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. If \\a isolate is true, then the IPA module will\n- * be isolated.\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",
        "v4",
        "29/37"
    ]
}