Show a patch.

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

{
    "id": 21621,
    "url": "https://patchwork.libcamera.org/api/patches/21621/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21621/",
    "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": "<20241014154747.2295253-2-kieran.bingham@ideasonboard.com>",
    "date": "2024-10-14T15:47:45",
    "name": "[1/3] ipa: rkisp1: Initialise AGC from FrameDurationLimits controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9d0619d7633eb02a8a6203e8b791b26134488b48",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21621/mbox/",
    "series": [
        {
            "id": 4697,
            "url": "https://patchwork.libcamera.org/api/series/4697/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4697",
            "date": "2024-10-14T15:47:44",
            "name": "ipa: rkisp1: Honor FrameDurationLimits",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4697/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21621/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21621/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 8D6F4C32F4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Oct 2024 15:47:57 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 425FF6537E;\n\tMon, 14 Oct 2024 17:47:55 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 94D1465369\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2024 17:47:51 +0200 (CEST)",
            "from Monstersaurus.lgs-net.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7EDFB96C;\n\tMon, 14 Oct 2024 17:46:10 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BJEdn5HW\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728920770;\n\tbh=l7aBtW6B8/jw4kmSGSQUraVQF3wy1M4OCs95YqoDPH8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=BJEdn5HWjCEoS32sheKb0pnBBjUtK2sey12M1gLWRmdz+xf4mJqX3eKeB00mCYra0\n\tg22C93vGlk3CM5aR7HPgwxOs2IlFzEoip/OnTVfuYpzxwT+26H9T5sIDMDLNII/gII\n\tsOW1ucqQ6OjxrEkrtZ+4PzPsaf/7E2Xp+L2AzOkQ=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "Subject": "[PATCH 1/3] ipa: rkisp1: Initialise AGC from FrameDurationLimits\n\tcontrols",
        "Date": "Mon, 14 Oct 2024 16:47:45 +0100",
        "Message-Id": "<20241014154747.2295253-2-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20241014154747.2295253-1-kieran.bingham@ideasonboard.com>",
        "References": "<20241014154747.2295253-1-kieran.bingham@ideasonboard.com>",
        "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 IPA calculates and reports the FrameDurationLimits to applications\nby configuring the ControlInfo accordingly during\nIPARkISP1::updateControls()\n\nWe later need to know these limits during Agc::configure() for\ninitialising the ActiveState of the AGC implementation with the limits.\n\nStore the FrameDurationLimits ControlInfo in the ControlInfoMap which is\nnow present in the IPAContext so that it is commonly available for the\nAGC algorithm, removing the 'todo' accordingly.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/agc.cpp | 9 +++------\n src/ipa/rkisp1/rkisp1.cpp         | 5 ++---\n 2 files changed, 5 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex 17d074d9c03e..33f902862c4a 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -178,12 +178,9 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n \tcontext.activeState.agc.meteringMode =\n \t\tstatic_cast<controls::AeMeteringModeEnum>(meteringModes_.begin()->first);\n \n-\t/*\n-\t * \\todo This should probably come from FrameDurationLimits instead,\n-\t * except it's computed in the IPA and not here so we'd have to\n-\t * recompute it.\n-\t */\n-\tcontext.activeState.agc.maxFrameDuration = context.configuration.sensor.maxShutterSpeed;\n+\t/* Limit the frame duration to match current initialisation */\n+\tControlInfo &frameDurationLimits = context.ctrlMap[&controls::FrameDurationLimits];\n+\tcontext.activeState.agc.maxFrameDuration = std::chrono::microseconds(frameDurationLimits.max().get<int64_t>());\n \n \t/*\n \t * Define the measurement window for AGC as a centered rectangle\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 9e161cabdea4..47777ece783f 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -432,9 +432,8 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,\n \t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n \t}\n \n-\tctrlMap[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n-\t\t\t\t\t\t\t      frameDurations[1],\n-\t\t\t\t\t\t\t      frameDurations[2]);\n+\tcontext_.ctrlMap[&controls::FrameDurationLimits] =\n+\t\tControlInfo(frameDurations[0], frameDurations[1], frameDurations[2]);\n \n \tctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end());\n \t*ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);\n",
    "prefixes": [
        "1/3"
    ]
}