Show a patch.

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

{
    "id": 22507,
    "url": "https://patchwork.libcamera.org/api/patches/22507/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22507/",
    "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": "<20250110023920.28502-1-laurent.pinchart@ideasonboard.com>",
    "date": "2025-01-10T02:39:19",
    "name": "[1/2] libcamera: pipeline_handler: Enable silent configuration file lookup",
    "commit_ref": "31a7378c879a09e88c8908c6743c9a120c66a3c5",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a3e1009950bff451db745038b9393c067547d6d6",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22507/mbox/",
    "series": [
        {
            "id": 4940,
            "url": "https://patchwork.libcamera.org/api/series/4940/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4940",
            "date": "2025-01-10T02:39:19",
            "name": "[1/2] libcamera: pipeline_handler: Enable silent configuration file lookup",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4940/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22507/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22507/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 BAF8CC32F5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Jan 2025 02:39:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A54C7684F3;\n\tFri, 10 Jan 2025 03:39:25 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A13A0608A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Jan 2025 03:39:23 +0100 (CET)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3FD1578C;\n\tFri, 10 Jan 2025 03:38:29 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RkgR89r1\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736476709;\n\tbh=nfKvoUwrWtJbp6jJgfiX01ZdiWp/m1VDa6p8CxYdeco=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=RkgR89r1T+Ue9ZP55HcJ03giK3WpQ3DxHJsXOeNBmFrnCC8xn2yTj6CtobGRyfw2O\n\tI1MtcCEFaUdm6LTjcxbb3iOD3PGMo/FSzWUJ46gEinWSsNn6MW/mxFXejF7Bp9YdJy\n\t0XS+++ha6MH3vi2kRowREviajJeoNES7J2SuyBYs=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tJulien Vuillaumier <julien.vuillaumier@nxp.com>, \n\tHarvey Yang <chenghaoyang@chromium.org>",
        "Subject": "[PATCH 1/2] libcamera: pipeline_handler: Enable silent configuration\n\tfile lookup",
        "Date": "Fri, 10 Jan 2025 04:39:19 +0200",
        "Message-ID": "<20250110023920.28502-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The PipelineHandler::configurationFile() function prints an error\nmessage when no configuration file is found. It can be useful for\npipeline handlers to silence the lookup operation and handle errors\nthemselves. Add a silent parameter to the function to enable this.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/pipeline_handler.h |  3 ++-\n src/libcamera/pipeline_handler.cpp            | 12 ++++++++----\n 2 files changed, 10 insertions(+), 5 deletions(-)\n\n\nbase-commit: d49a84a4f3aa63efc900564ff32558e4f5d85b04",
    "diff": "diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex fb28a18d0f4668ab..972a2fa65310e1d9 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -63,7 +63,8 @@ public:\n \tvoid cancelRequest(Request *request);\n \n \tstd::string configurationFile(const std::string &subdir,\n-\t\t\t\t      const std::string &name) const;\n+\t\t\t\t      const std::string &name,\n+\t\t\t\t      bool silent = false) const;\n \n \tconst char *name() const { return name_; }\n \ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex caa5c20e74836956..d84dff3c9f198756 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -581,6 +581,7 @@ void PipelineHandler::cancelRequest(Request *request)\n  * \\brief Retrieve the absolute path to a platform configuration file\n  * \\param[in] subdir The pipeline handler specific subdirectory name\n  * \\param[in] name The configuration file name\n+ * \\param[in] silent Disable error messages\n  *\n  * This function locates a named platform configuration file and returns\n  * its absolute path to the pipeline handler. It searches the following\n@@ -596,7 +597,8 @@ void PipelineHandler::cancelRequest(Request *request)\n  * string if no configuration file can be found\n  */\n std::string PipelineHandler::configurationFile(const std::string &subdir,\n-\t\t\t\t\t       const std::string &name) const\n+\t\t\t\t\t       const std::string &name,\n+\t\t\t\t\t       bool silent) const\n {\n \tstd::string confPath;\n \tstruct stat statbuf;\n@@ -626,9 +628,11 @@ std::string PipelineHandler::configurationFile(const std::string &subdir,\n \tif (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)\n \t\treturn confPath;\n \n-\tLOG(Pipeline, Error)\n-\t\t<< \"Configuration file '\" << confPath\n-\t\t<< \"' not found for pipeline handler '\" << PipelineHandler::name() << \"'\";\n+\tif (!silent)\n+\t\tLOG(Pipeline, Error)\n+\t\t\t<< \"Configuration file '\" << confPath\n+\t\t\t<< \"' not found for pipeline handler '\"\n+\t\t\t<< PipelineHandler::name() << \"'\";\n \n \treturn std::string();\n }\n",
    "prefixes": [
        "1/2"
    ]
}