Show a patch.

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

{
    "id": 9939,
    "url": "https://patchwork.libcamera.org/api/patches/9939/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9939/",
    "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": "<20201002143154.468162-32-paul.elder@ideasonboard.com>",
    "date": "2020-10-02T14:31:47",
    "name": "[libcamera-devel,v3,31/38] libcamera: IPAProxy: Remove registration mechanism",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ccb3904acdbb8ecd8ceb3ecc95fd925df7e3ed6b",
    "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/9939/mbox/",
    "series": [
        {
            "id": 1348,
            "url": "https://patchwork.libcamera.org/api/series/1348/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1348",
            "date": "2020-10-02T14:31:16",
            "name": "IPA isolation implementation",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1348/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9939/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9939/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 8B8B7C3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Oct 2020 14:33:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 57F6A63BE6;\n\tFri,  2 Oct 2020 16:33:22 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1098063B98\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Oct 2020 16:33:21 +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 05B7B528;\n\tFri,  2 Oct 2020 16:33:18 +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=\"gk9clwKO\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601649200;\n\tbh=suC8FhA7ExotBNs3cFppm5Y1UW8OWFfLvA8kVH+GnyI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gk9clwKOUQ/gDMHblzl2HGojVEK/6JH+AQWQre0w+OWyeVIn5xnmyYbGtdWsNL0au\n\tjCP++rCf7AiO8j5yFDFlYc1jRNt93NDHdrsGzRbYtH2vp+Jidc+cA+Kf1b7QQdKTu7\n\tA8IzEnOKYkM9iGwLRcAFkXbqy+O8fnwnXGp6kHuY=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  2 Oct 2020 23:31:47 +0900",
        "Message-Id": "<20201002143154.468162-32-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201002143154.468162-1-paul.elder@ideasonboard.com>",
        "References": "<20201002143154.468162-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 31/38] 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 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 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 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",
        "v3",
        "31/38"
    ]
}