Show a patch.

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

{
    "id": 1257,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1257/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1257/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20190522210220.1631-3-paul.elder@ideasonboard.com>",
    "date": "2019-05-22T21:02:17",
    "name": "[libcamera-devel,RFC,2/5] libcamera: ipa_module: add aquired attribute",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "def559ca0994d08af7709d30102f08a5e4fe2a62",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1257/mbox/",
    "series": [
        {
            "id": 317,
            "url": "https://patchwork.libcamera.org/api/1.1/series/317/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=317",
            "date": "2019-05-22T21:02:15",
            "name": "Add IPAManager",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/317/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1257/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1257/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8655660C1D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 May 2019 23:02:40 +0200 (CEST)",
            "from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DC9D3443;\n\tWed, 22 May 2019 23:02:39 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558558960;\n\tbh=taQlwj66wEEKf2K8OTshHMR1u1IONV+5vLaFO3OWXTM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jBGY0JluxIQkkdbRIo2cHmYl8qOkO/f5yAzpgQt642RmLtcG5Gk2rVmLPLXycRR3O\n\tHMY9NEcJJGB/DLQhF5Ff3ZCSsbq1wIABzzknVAciyJ9aDKBQOGxijUoX2KR4V3dYh2\n\t84KzBUeo6i8+jo3VzVL2IxMF+UWdWm9i+Osc+kig=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 22 May 2019 17:02:17 -0400",
        "Message-Id": "<20190522210220.1631-3-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190522210220.1631-1-paul.elder@ideasonboard.com>",
        "References": "<20190522210220.1631-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 2/5] libcamera: ipa_module: add\n\taquired attribute",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Wed, 22 May 2019 21:02:41 -0000"
    },
    "content": "The IPAManager will be designed like an enumerator, and IPA modules\ncannot be used by multiple pipelines at once. Add an aquired attribute\nto IPAModule, and corresponding getter and setters.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/include/ipa_module.h |  5 +++++\n src/libcamera/ipa_module.cpp       | 21 ++++++++++++++++++++-\n 2 files changed, 25 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h\nindex a4c6dbd..dc26037 100644\n--- a/src/libcamera/include/ipa_module.h\n+++ b/src/libcamera/include/ipa_module.h\n@@ -22,11 +22,16 @@ public:\n \n \tconst struct IPAModuleInfo &info() const;\n \n+\tbool acquired();\n+\tbool acquire();\n+\tvoid release();\n+\n private:\n \tstruct IPAModuleInfo info_;\n \n \tstd::string libPath_;\n \tbool valid_;\n+\tbool acquired_;\n \n \tint loadIPAModuleInfo();\n };\ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 86cbe71..fb294e6 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -212,7 +212,7 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize,\n  * IPAModule instance to verify the validity of the IPAModule.\n  */\n IPAModule::IPAModule(const std::string &libPath)\n-\t: libPath_(libPath), valid_(false)\n+\t: libPath_(libPath), valid_(false), acquired_(false)\n {\n \tif (loadIPAModuleInfo() < 0)\n \t\treturn;\n@@ -289,4 +289,23 @@ const struct IPAModuleInfo &IPAModule::info() const\n \treturn info_;\n }\n \n+bool IPAModule::acquired()\n+{\n+\treturn acquired_;\n+}\n+\n+bool IPAModule::acquire()\n+{\n+\tif (acquired_)\n+\t\treturn false;\n+\n+\tacquired_ = true;\n+\treturn true;\n+}\n+\n+void IPAModule::release()\n+{\n+\tacquired_ = false;\n+}\n+\n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "2/5"
    ]
}