Patch Detail
Show a patch.
GET /api/1.1/patches/25069/?format=api
{ "id": 25069, "url": "https://patchwork.libcamera.org/api/1.1/patches/25069/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25069/", "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": "<20251114-exposure-limits-v3-17-b7c07feba026@ideasonboard.com>", "date": "2025-11-14T14:17:12", "name": "[v3,17/19] ipa: rkisp1: agc: Calculate frame duration using cam helper", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "af8622b93fa8cb9e82cd3671bf44fc363cee7bc6", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25069/mbox/", "series": [ { "id": 5590, "url": "https://patchwork.libcamera.org/api/1.1/series/5590/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5590", "date": "2025-11-14T14:16:55", "name": "libipa: agc: Calculate exposure limits", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5590/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25069/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25069/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 A2BC6C3336\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 14:17:43 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 433F560AC8;\n\tFri, 14 Nov 2025 15:17:43 +0100 (CET)", "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 6224560AB5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 15:17:24 +0100 (CET)", "from [192.168.1.101] (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 68DC8BD2;\n\tFri, 14 Nov 2025 15:15:23 +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=\"SdNmKW1p\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763129723;\n\tbh=sHkzxU7P8tUG9VmY0HfmH5BmzTEMZ9oHFezgSarUqJI=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=SdNmKW1pDylCoL0h6JuwhF3SXhf8tdAdm2LPuT3Z6DtxdofOYQAK9rC/B1G9KKC6T\n\tER6pj13OjHZ+htZK06RP8+uSGJ/rVclsoNgDlVvSnLsvsPJ/omO9+zlkb6Vp9Cb9/U\n\t0lvkSkfCcyC9XWLp48cWcu2ZLzryoIV/YVtRxadc=", "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Date": "Fri, 14 Nov 2025 15:17:12 +0100", "Subject": "[PATCH v3 17/19] ipa: rkisp1: agc: Calculate frame duration using\n\tcam helper", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20251114-exposure-limits-v3-17-b7c07feba026@ideasonboard.com>", "References": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>", "In-Reply-To": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>", "To": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tRobert Mader <robert.mader@collabora.com>, \n\tlibcamera-devel@lists.libcamera.org", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "X-Mailer": "b4 0.14.2", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=2539;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=sHkzxU7P8tUG9VmY0HfmH5BmzTEMZ9oHFezgSarUqJI=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpFznsiUYfYot8Z/IbPRgQ66+o83qnmtLGgQMJT\n\tgjc+4413raJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaRc57AAKCRByNAaPFqFW\n\tPD6HD/wLbfr+0btKgzQTTQCR4LsIHKt+sX2fcxZCEFGbm7jSIWr1FESnkKazK6kU3IjZS3OqehI\n\tDEGC9YukE7Ilz2EcneT6nD5ZWyah6YxJgU3AK3Sm5J/UYHU1H7HxXEhXMbHQ5NMSBJDThOKg73j\n\tQXA/6M64p/inq0msJOU5L/c7tLhl8K6ozTHlHXN8m4ACA42bPJuhXhy/M7z+NmnG5Kl4FnrphEd\n\tbHPLISHpAnD+KtPz+wcjHizI3bKSDtfdMfSDBkHw8c/+ytzR+qPfstQG5S4OtfyT3VM8geueTnc\n\tW37tRtQ3EZzlRkN5j28mHeWtCM9ojS2xx97ojrcMfwoxIwvla/njL2zKifi6deVXjwcNkA2TmMC\n\t2uQcta+egpm3AhclhsZ1cxii9etvmOn6XgMqDyHVY/23etENyZLeQnxbQAG0Nb6ALJvHxQ2Me1c\n\taV9u8GJyml8mPfp69hY6iotSPwfn1PGjPMpnTds6U/zliBXgsZoHfcBBpgx3w/WFijTkNQbNtNR\n\t9YkmhOGt3o7esTlREyPN/Y3AnSnjEacC5VQ5wej2TuFLZtpBsXnWsAyGu4YjjceJmU2SvrUyIyM\n\txsuS01jBNIU/FAEsktxmOxqWYPQdnBMH0YzbDVE+ABaWDcaH+flap6EB7fNafsWil+Ex3CZu55+\n\ttW08UisHZVE+gGw==", "X-Developer-Key": "i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B", "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 RkISP1 IPA is the only IPA that derives from AgcMeanLuminance\nthat populates the FrameDuration control.\n\nThe way frame duration is calculated is by using the shutter time\nas returned by the Agc helpers and use that value to populate the\nFrameDuration metadata and calculate the vblank.\n\nThis is however not correct as the exposure time shall be shorter than\nthe frame duration by a sensor-specific margin.\n\nUse the camera sensor helper to calculate the minimum frame duration\nrequired to achieve the newly calculated shutter time.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/agc.cpp | 17 +++++++++++------\n 1 file changed, 11 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex a2ecd5c46a1fbcb728e23ed83b37b89fcdb80d84..10498eb6357d8917e299ac24f6c8ba8c33af4eae 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -501,21 +501,26 @@ double Agc::estimateLuminance(double gain) const\n * \\brief Process frame duration and compute vblank\n * \\param[in] context The shared IPA context\n * \\param[in] frameContext The current frame context\n- * \\param[in] frameDuration The target frame duration\n+ * \\param[in] shutterTime The target shutter duration\n *\n- * Compute and populate vblank from the target frame duration.\n+ * Compute and populate vblank from a frame duration that allows to achieve the\n+ * desired \\a shutterTime\n */\n void Agc::processFrameDuration(IPAContext &context,\n \t\t\t IPAFrameContext &frameContext,\n-\t\t\t utils::Duration frameDuration)\n+\t\t\t utils::Duration shutterTime)\n {\n-\tIPACameraSensorInfo &sensorInfo = context.sensorInfo;\n \tutils::Duration lineDuration = context.configuration.sensor.lineDuration;\n+\tutils::Duration frameDuration =\n+\t\tstd::max(context.camHelper->minFrameDuration(shutterTime, lineDuration),\n+\t\t\t context.activeState.agc.minFrameDuration);\n \n-\tframeContext.agc.vblank = (frameDuration / lineDuration) - sensorInfo.outputSize.height;\n+\tframeContext.agc.vblank = (frameDuration / lineDuration)\n+\t\t\t\t- context.sensorInfo.outputSize.height;\n \n \t/* Update frame duration accounting for line length quantization. */\n-\tframeContext.agc.frameDuration = (sensorInfo.outputSize.height + frameContext.agc.vblank) * lineDuration;\n+\tframeContext.agc.frameDuration = (context.sensorInfo.outputSize.height\n+\t\t\t\t + frameContext.agc.vblank) * lineDuration;\n }\n \n /**\n", "prefixes": [ "v3", "17/19" ] }