Show a patch.

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

{
    "id": 1990,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1990/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1990/",
    "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": "<20190918132014.11412-1-laurent.pinchart@ideasonboard.com>",
    "date": "2019-09-18T13:20:14",
    "name": "[libcamera-devel,v2] libcamera: ipa_manager: Rework error messages when enumerating IPAs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e2f0922cc0e0c1d03eb4cbf119873be4a5a92201",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1990/mbox/",
    "series": [
        {
            "id": 502,
            "url": "https://patchwork.libcamera.org/api/1.1/series/502/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=502",
            "date": "2019-09-18T13:20:14",
            "name": "[libcamera-devel,v2] libcamera: ipa_manager: Rework error messages when enumerating IPAs",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/502/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1990/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1990/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@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 03DD460BB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Sep 2019 15:20:27 +0200 (CEST)",
            "from pendragon.ideasonboard.com (126.92.103.87.rev.vodafone.pt\n\t[87.103.92.126])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3C189325;\n\tWed, 18 Sep 2019 15:20:27 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1568812827;\n\tbh=31nAMWL5WgPDLlMGKuCJK43Q35qID1gdICDoPu0PYFQ=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=oAIIAOqwKTxKVVm7ISil3CJ6V3OVmWR0o1PDlOROWO3vn/ibO+xVPoIzzjynOKh3z\n\tUClYYDuCbc/2LvQVCfpezLFC/eAkzj90oTXpMloviXo5o7NlbFPpJ1xUIYOaES48If\n\txgXbh2dBNaNVGG4fdsypZxeXt6jGG2ct9u3klKN4=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 18 Sep 2019 16:20:14 +0300",
        "Message-Id": "<20190918132014.11412-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] libcamera: ipa_manager: Rework error\n\tmessages when enumerating IPAs",
        "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, 18 Sep 2019 13:20:28 -0000"
    },
    "content": "When enumerating IPAs, the system IPA directory and all the directories\nlisted in the LIBCAMERA_IPA_MODULE_PATH environment variable are listed\nin turn. Failing to list any of those directories results in an error\nmessage being printed for every failure. This is particularly common\nwhen developing libcamera, as IPAs may not have been installed locally.\n\nTo avoid unnecessarily worrying error messages, rework the enumeration\nprocedure to only print a message when no IPA can be found at all.\nIndividual missing directories are not considered as an issue anymore.\nThe message is also downgraded from an error to a warning as the\nsituation may still be normal.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\nChanges since v1:\n\n- Only print a warning when LIBCAMERA_IPA_MODULE_PATH is not set if no\n  module can be found in the system IPA directory\n- Add a new temporary paths variable to keep modulePaths unmodified for\n  the warning message\n---\n src/libcamera/ipa_manager.cpp | 34 ++++++++++++++++++++++++----------\n 1 file changed, 24 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp\nindex 4276d995bdd5..270e538a4d01 100644\n--- a/src/libcamera/ipa_manager.cpp\n+++ b/src/libcamera/ipa_manager.cpp\n@@ -33,26 +33,43 @@ LOG_DEFINE_CATEGORY(IPAManager)\n \n IPAManager::IPAManager()\n {\n-\taddDir(IPA_MODULE_DIR);\n+\tunsigned int ipaCount = 0;\n+\tint ret;\n+\n+\tret = addDir(IPA_MODULE_DIR);\n+\tif (ret > 0)\n+\t\tipaCount += ret;\n \n \tconst char *modulePaths = utils::secure_getenv(\"LIBCAMERA_IPA_MODULE_PATH\");\n-\tif (!modulePaths)\n+\tif (!modulePaths) {\n+\t\tif (!ipaCount)\n+\t\t\tLOG(IPAManager, Warning)\n+\t\t\t\t<< \"No IPA found in '\" IPA_MODULE_DIR \"'\";\n \t\treturn;\n+\t}\n \n+\tconst char *paths = modulePaths;\n \twhile (1) {\n-\t\tconst char *delim = strchrnul(modulePaths, ':');\n-\t\tsize_t count = delim - modulePaths;\n+\t\tconst char *delim = strchrnul(paths, ':');\n+\t\tsize_t count = delim - paths;\n \n \t\tif (count) {\n-\t\t\tstd::string path(modulePaths, count);\n-\t\t\taddDir(path.c_str());\n+\t\t\tstd::string path(paths, count);\n+\t\t\tret = addDir(path.c_str());\n+\t\t\tif (ret > 0)\n+\t\t\t\tipaCount += ret;\n \t\t}\n \n \t\tif (*delim == '\\0')\n \t\t\tbreak;\n \n-\t\tmodulePaths += count + 1;\n+\t\tpaths += count + 1;\n \t}\n+\n+\tif (!ipaCount)\n+\t\tLOG(IPAManager, Warning)\n+\t\t\t<< \"No IPA found in '\" IPA_MODULE_DIR \"' and '\"\n+\t\t\t<< modulePaths << \"'\";\n }\n \n IPAManager::~IPAManager()\n@@ -94,9 +111,6 @@ int IPAManager::addDir(const char *libDir)\n \tdir = opendir(libDir);\n \tif (!dir) {\n \t\tint ret = -errno;\n-\t\tLOG(IPAManager, Error)\n-\t\t\t<< \"Invalid path \" << libDir << \" for IPA modules: \"\n-\t\t\t<< strerror(-ret);\n \t\treturn ret;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}