Show a patch.

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

{
    "id": 16818,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16818/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16818/",
    "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": "<20220727023816.30008-7-laurent.pinchart@ideasonboard.com>",
    "date": "2022-07-27T02:38:08",
    "name": "[libcamera-devel,v7,06/14] ipa: raspberrypi: Propagate errors from AGC metering tuning data read",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9ecfd5c4d55f258ddc53f1139556921bb45f5aa9",
    "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/16818/mbox/",
    "series": [
        {
            "id": 3331,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3331/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3331",
            "date": "2022-07-27T02:38:02",
            "name": "Replace boost JSON parser with libyaml in Raspberry Pi IPA",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/3331/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16818/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16818/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 7CBC2BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 02:38:28 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1455D63321;\n\tWed, 27 Jul 2022 04:38:28 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CB566331A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 04:38:25 +0200 (CEST)",
            "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B507D56D;\n\tWed, 27 Jul 2022 04:38:24 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658889508;\n\tbh=luqq5mg3n/Ocf6RJpP4l9IGSv4THtMeGK/EoW4TKN+I=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=vGSio50SYfF9yI025Xk9hQ3Wn03zk2o/5PWWEbX2U7mjw4/2eKQnuEcfLOfGRHUuA\n\tIxJmmbORT73tn990nWZW91D2TH+KaJGsTohxAHH1YLLZYzU+4xRXxRRsey5MrWoSLI\n\t/EuPt0C+lTkEo23iqh0fpoXqKe2zHXLBtGfovV84uEPHGaYWXtzMg8A6IRUXX1WN4M\n\tYotB/QK76GXe5TnzaHDgHPgZGhefphRLomuGj5HssyY8UPufe2otJ/xXJUNgFjgFCp\n\tqeKZZivo0suinEph8R9JZQd0cXAaqk95M0fprUpTVh46UfpL5stQmOUpOX23GZAPe0\n\twzR20zQFbOSEQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1658889504;\n\tbh=luqq5mg3n/Ocf6RJpP4l9IGSv4THtMeGK/EoW4TKN+I=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=HPQ0xNNmZjYY9ILevtJSYS6dGBZTDXS4soB4rZjangZpppwsyMgxG+8Rn0n1ygLEL\n\tzt848TljvDhMLXrfglx5Dqrf72XzKviAFEuxEfsQgl+pJv/7zuqMcpiJJr7fXcBiqW\n\t/T1oKq3B2GS2OJBC+txnIm1QpsIrofGvhgLkta10="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HPQ0xNNm\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 27 Jul 2022 05:38:08 +0300",
        "Message-Id": "<20220727023816.30008-7-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220727023816.30008-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220727023816.30008-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 06/14] ipa: raspberrypi: Propagate\n\terrors from AGC metering tuning data read",
        "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>",
        "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Update the AGC metering functions that deal with reading tuning data to\npropagate errors to the caller, using std::tie and std::tuple to group\nthe error code and return value.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 71 ++++++++++++++++------\n 1 file changed, 54 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 130c606d4136..93f966a1d5ce 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -6,6 +6,7 @@\n  */\n \n #include <map>\n+#include <tuple>\n \n #include <linux/bcm2835-isp.h>\n \n@@ -43,19 +44,25 @@ int AgcMeteringMode::read(boost::property_tree::ptree const &params)\n \treturn 0;\n }\n \n-static std::string\n+static std::tuple<int, std::string>\n readMeteringModes(std::map<std::string, AgcMeteringMode> &meteringModes,\n \t\t  boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n+\tint ret;\n+\n \tfor (auto &p : params) {\n \t\tAgcMeteringMode meteringMode;\n-\t\tmeteringMode.read(p.second);\n+\t\tret = meteringMode.read(p.second);\n+\t\tif (ret)\n+\t\t\treturn { ret, {} };\n+\n \t\tmeteringModes[p.first] = std::move(meteringMode);\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n-\treturn first;\n+\n+\treturn { 0, first };\n }\n \n static int readList(std::vector<double> &list,\n@@ -87,19 +94,25 @@ int AgcExposureMode::read(boost::property_tree::ptree const &params)\n \treturn 0;\n }\n \n-static std::string\n+static std::tuple<int, std::string>\n readExposureModes(std::map<std::string, AgcExposureMode> &exposureModes,\n \t\t  boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n+\tint ret;\n+\n \tfor (auto &p : params) {\n \t\tAgcExposureMode exposureMode;\n-\t\texposureMode.read(p.second);\n+\t\tret = exposureMode.read(p.second);\n+\t\tif (ret)\n+\t\t\treturn { ret, {} };\n+\n \t\texposureModes[p.first] = std::move(exposureMode);\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n-\treturn first;\n+\n+\treturn { 0, first };\n }\n \n int AgcConstraint::read(boost::property_tree::ptree const &params)\n@@ -115,38 +128,62 @@ int AgcConstraint::read(boost::property_tree::ptree const &params)\n \treturn yTarget.read(params.get_child(\"y_target\"));\n }\n \n-static AgcConstraintMode\n+static std::tuple<int, AgcConstraintMode>\n readConstraintMode(boost::property_tree::ptree const &params)\n {\n \tAgcConstraintMode mode;\n+\tint ret;\n+\n \tfor (auto &p : params) {\n \t\tAgcConstraint constraint;\n-\t\tconstraint.read(p.second);\n+\t\tret = constraint.read(p.second);\n+\t\tif (ret)\n+\t\t\treturn { ret, {} };\n+\n \t\tmode.push_back(std::move(constraint));\n \t}\n-\treturn mode;\n+\n+\treturn { 0, mode };\n }\n \n-static std::string readConstraintModes(std::map<std::string, AgcConstraintMode> &constraintModes,\n-\t\t\t\t       boost::property_tree::ptree const &params)\n+static std::tuple<int, std::string>\n+readConstraintModes(std::map<std::string, AgcConstraintMode> &constraintModes,\n+\t\t    boost::property_tree::ptree const &params)\n {\n \tstd::string first;\n+\tint ret;\n+\n \tfor (auto &p : params) {\n-\t\tconstraintModes[p.first] = readConstraintMode(p.second);\n+\t\tstd::tie(ret, constraintModes[p.first]) = readConstraintMode(p.second);\n+\t\tif (ret)\n+\t\t\treturn { ret, {} };\n+\n \t\tif (first.empty())\n \t\t\tfirst = p.first;\n \t}\n-\treturn first;\n+\n+\treturn { 0, first };\n }\n \n int AgcConfig::read(boost::property_tree::ptree const &params)\n {\n \tLOG(RPiAgc, Debug) << \"AgcConfig\";\n-\tdefaultMeteringMode = readMeteringModes(meteringModes, params.get_child(\"metering_modes\"));\n-\tdefaultExposureMode = readExposureModes(exposureModes, params.get_child(\"exposure_modes\"));\n-\tdefaultConstraintMode = readConstraintModes(constraintModes, params.get_child(\"constraint_modes\"));\n+\tint ret;\n \n-\tint ret = yTarget.read(params.get_child(\"y_target\"));\n+\tstd::tie(ret, defaultMeteringMode) =\n+\t\treadMeteringModes(meteringModes, params.get_child(\"metering_modes\"));\n+\tif (ret)\n+\t\treturn ret;\n+\tstd::tie(ret, defaultExposureMode) =\n+\t\treadExposureModes(exposureModes, params.get_child(\"exposure_modes\"));\n+\tif (ret)\n+\t\treturn ret;\n+\tstd::tie(ret, defaultConstraintMode) =\n+\t\treadConstraintModes(constraintModes, params.get_child(\"constraint_modes\"));\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = yTarget.read(params.get_child(\"y_target\"));\n \tif (ret)\n \t\treturn ret;\n \n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "06/14"
    ]
}