Show a patch.

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

{
    "id": 10614,
    "url": "https://patchwork.libcamera.org/api/patches/10614/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10614/",
    "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": "<20201208204441.9356-3-david.plowman@raspberrypi.com>",
    "date": "2020-12-08T20:44:37",
    "name": "[libcamera-devel,v3,2/6] src: ipa: raspberrypi: agc: Add GetConvergenceFrames method to AGC base class",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9b1890203d7c22916e11014df394f16c0b4c4bd2",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10614/mbox/",
    "series": [
        {
            "id": 1515,
            "url": "https://patchwork.libcamera.org/api/series/1515/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1515",
            "date": "2020-12-08T20:44:35",
            "name": "Raspberry Pi AGC: initial frame drop count",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1515/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10614/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10614/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 109E1BDB20\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Dec 2020 20:44:49 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D156167E4D;\n\tTue,  8 Dec 2020 21:44:48 +0100 (CET)",
            "from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com\n\t[IPv6:2a00:1450:4864:20::52a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8575567F0B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Dec 2020 21:44:46 +0100 (CET)",
            "by mail-ed1-x52a.google.com with SMTP id u19so19035263edx.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Dec 2020 12:44:46 -0800 (PST)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tbe6sm18441471edb.29.2020.12.08.12.44.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Dec 2020 12:44:45 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"r4251brt\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=UYqtHEtBUNAP4L0qxPTMgG5zq+NcHWYZHLEVzCW38KQ=;\n\tb=r4251brtCqji/ieJdgO/tgiZcludjXOD2fc3+XnbXGbTVFrIsD4dcaKFk3P0fKXEzn\n\tnNpNk/oOnb66oJb23FloBAxmLTQTpX7mdksOUkLS9FV3FRco+a7V8KNwED4qd1Enyvrg\n\tHpH8E2SxKsrp3Ix9A8auXvYT+VpN6voj9eJlYXg30woXvXm+PJ8Vrudz9Q8FUinXvVPl\n\tC3pO2mEtEZSVA+emYcTM37EOFWkNyRPOYMuB8sUeG+b/sCrbn8pClAImAkP+4tdMPLSC\n\t0qvNb7AYhtp4FTUoTlHQjSBWu3H5/QUINDVLmn4YMRyHyYaRmoyO5T3a+t1D6d3l9Nl3\n\t0FMQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=UYqtHEtBUNAP4L0qxPTMgG5zq+NcHWYZHLEVzCW38KQ=;\n\tb=mWshqtZb8uEOy3QW521ej47e1KaMpNwR+FXONX1H9HIJj4sEJ235/QGpL3BunX/KOZ\n\tB+W87BsJZBcana1l7skawyMdamj+2QSSAi6yTfrFTbP59mUNOZQ4k/n9dso26UDycFLN\n\tc111CCEBpk9z1VEyrRDWTpHx+iN3hg2wYwsiFQUyUzbPqbRgG38HoPBRYz1HfIEwcWeB\n\tpq3Ln5zgEznnTv8zIxijBPHQWaq/K/7yAjreC7wBJdYx8xrtmnpmYTu4Qx7DBGIg1zKc\n\tNvWkbTKhosPPgwUvcN4FmU/h6ltFV8rvfmnipdJkN+BDNT9ULEdEsd/qKzN5e7yPAnKD\n\t3jIA==",
        "X-Gm-Message-State": "AOAM532TkDDdWyYR80/97G7GeiIDyHHYZZIIqCuzxk2SzMz2Ounm7Ket\n\t5jPBrRCP0BcUsn191v8U9xvtGskcUAVZNrZK",
        "X-Google-Smtp-Source": "ABdhPJyJpUtXmPka4yBw5n5b6HM+ds+t/rVNam4KpGckBJmJcrGbhKjPLxPg1YAq6zhIuBtz2o1piQ==",
        "X-Received": "by 2002:aa7:cf8f:: with SMTP id\n\tz15mr22970078edx.17.1607460285847; \n\tTue, 08 Dec 2020 12:44:45 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  8 Dec 2020 20:44:37 +0000",
        "Message-Id": "<20201208204441.9356-3-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20201208204441.9356-1-david.plowman@raspberrypi.com>",
        "References": "<20201208204441.9356-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 2/6] src: ipa: raspberrypi: agc: Add\n\tGetConvergenceFrames method to AGC base class",
        "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=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "We add a GetConvergenceFrames method to the AgcAlgorithm class which\ncan be called when the AGC is started from scratch. It suggests how\nmany frames should be dropped before displaying any (while the AGC\nconverges).\n\nThe Raspberry Pi specific implementation makes this customisable from\nthe tuning file.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/agc_algorithm.hpp |  1 +\n src/ipa/raspberrypi/controller/rpi/agc.cpp       | 11 +++++++++++\n src/ipa/raspberrypi/controller/rpi/agc.hpp       |  2 ++\n 3 files changed, 14 insertions(+)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex b4ea54fb..981f1de2 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -15,6 +15,7 @@ class AgcAlgorithm : public Algorithm\n public:\n \tAgcAlgorithm(Controller *controller) : Algorithm(controller) {}\n \t// An AGC algorithm must provide the following:\n+\tvirtual unsigned int GetConvergenceFrames() const = 0;\n \tvirtual void SetEv(double ev) = 0;\n \tvirtual void SetFlickerPeriod(double flicker_period) = 0;\n \tvirtual void SetFixedShutter(double fixed_shutter) = 0; // microseconds\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 9da18c31..eddd1684 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -142,6 +142,7 @@ void AgcConfig::Read(boost::property_tree::ptree const &params)\n \tY_target.Read(params.get_child(\"y_target\"));\n \tspeed = params.get<double>(\"speed\", 0.2);\n \tstartup_frames = params.get<uint16_t>(\"startup_frames\", 10);\n+\tconvergence_frames = params.get<unsigned int>(\"convergence_frames\", 6);\n \tfast_reduce_threshold =\n \t\tparams.get<double>(\"fast_reduce_threshold\", 0.4);\n \tbase_ev = params.get<double>(\"base_ev\", 1.0);\n@@ -206,6 +207,16 @@ void Agc::Resume()\n \tfixed_analogue_gain_ = 0;\n }\n \n+unsigned int Agc::GetConvergenceFrames() const\n+{\n+\t// If shutter and gain have been explicitly set, there is no\n+\t// convergence to happen, so no need to drop any frames - return zero.\n+\tif (fixed_shutter_ && fixed_analogue_gain_)\n+\t\treturn 0;\n+\telse\n+\t\treturn config_.convergence_frames;\n+}\n+\n void Agc::SetEv(double ev)\n {\n \tev_ = ev;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp\nindex 95db1812..05c334e4 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp\n@@ -52,6 +52,7 @@ struct AgcConfig {\n \tPwl Y_target;\n \tdouble speed;\n \tuint16_t startup_frames;\n+\tunsigned int convergence_frames;\n \tdouble max_change;\n \tdouble min_change;\n \tdouble fast_reduce_threshold;\n@@ -74,6 +75,7 @@ public:\n \tbool IsPaused() const override;\n \tvoid Pause() override;\n \tvoid Resume() override;\n+\tunsigned int GetConvergenceFrames() const override;\n \tvoid SetEv(double ev) override;\n \tvoid SetFlickerPeriod(double flicker_period) override;\n \tvoid SetFixedShutter(double fixed_shutter) override; // microseconds\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/6"
    ]
}