Patch Detail
Show a patch.
GET /api/patches/27597/?format=api
{ "id": 27597, "url": "https://patchwork.libcamera.org/api/patches/27597/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27597/", "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": "<20260803131435.153927-51-barnabas.pocze@ideasonboard.com>", "date": "2026-08-03T13:14:35", "name": "[RFC,v3,50/50] ipa: libipa: agc_mean_luminance: Fold resetFrameCount() in configure()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3c0aa707f39c5ef687e454e830f2a33f7387f6c3", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27597/mbox/", "series": [ { "id": 6103, "url": "https://patchwork.libcamera.org/api/series/6103/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6103", "date": "2026-08-03T13:13:45", "name": "ipa: libipa: agc rework", "version": 3, "mbox": "https://patchwork.libcamera.org/series/6103/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27597/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27597/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 15888C334F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 3 Aug 2026 13:15:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E0C736811C;\n\tMon, 3 Aug 2026 15:15:24 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E5ED680BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 Aug 2026 15:14:50 +0200 (CEST)", "from pb-laptop.local (185.221.141.208.nat.pool.zt.hu\n\t[185.221.141.208])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A9095B3;\n\tMon, 3 Aug 2026 15:13:41 +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=\"aKX40sNB\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1785762821;\n\tbh=kacR/suTA4055UNYcQaPB3NQZqnpB8DfktUn8fW/LX0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=aKX40sNBh7XhKGOdoEE68rkU8AvRfofAROR/AhqOYbFtFJVIV66ngvVE6AK6Q0fVa\n\ttVi8bdss41hBtGpDlPVIOdIhW94iiQMJVfUClzf89uXPhRTmBi6Y3grHvOsjj0e6D0\n\tGwNSGlVaND6ivtpXiLBML9PGPXusNWTdFy/h/rFU=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>", "Subject": "[RFC PATCH v3 50/50] ipa: libipa: agc_mean_luminance: Fold\n\tresetFrameCount() in configure()", "Date": "Mon, 3 Aug 2026 15:14:35 +0200", "Message-ID": "<20260803131435.153927-51-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.55.0", "In-Reply-To": "<20260803131435.153927-1-barnabas.pocze@ideasonboard.com>", "References": "<20260803131435.153927-1-barnabas.pocze@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "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": "From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThe AgcMeanLuminance::resetFrameCount() function has to be called\nafter a call to AgcMeanLuminance::configure(). As the two calls always\nhappen one after another, do not require each IPA implementation to do\nthat but fold instead the call to resetFrameCount() in\nAgcMeanLuminance::configure().\n\nUpdate the AgcMeanLuminance class documentation accordingly.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/ipa/libipa/agc.cpp | 1 -\n src/ipa/libipa/agc_mean_luminance.cpp | 21 ++++++---------------\n src/ipa/libipa/agc_mean_luminance.h | 5 -----\n 3 files changed, 6 insertions(+), 21 deletions(-)", "diff": "diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp\nindex 169a53f2cd..cd10bd45b6 100644\n--- a/src/ipa/libipa/agc.cpp\n+++ b/src/ipa/libipa/agc.cpp\n@@ -413,7 +413,6 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state,\n \n \t\t\tASSERT(sensor_);\n \t\t\timpl.configure(session.lineDuration, sensor_);\n-\t\t\timpl.resetFrameCount();\n \n \t\t\tif (session.autoAllowed) {\n \t\t\t\tconfig.ctrlMap[&controls::ExposureValue] = ControlInfo(-8.0f, 8.0f, 0.0f);\ndiff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\nindex 8303065008..2459f8b44a 100644\n--- a/src/ipa/libipa/agc_mean_luminance.cpp\n+++ b/src/ipa/libipa/agc_mean_luminance.cpp\n@@ -169,11 +169,11 @@ static constexpr unsigned int kDefaultLuxLevel = 500;\n *\n * IPA modules that want to use this class to implement their AEGC algorithm\n * should derive AgcMeanLuminance::Traits and override the necessary functions.\n- * The users must call parseTuningData() in init(), and must also call setLimits()\n- * and resetFrameCounter() in configure(). They may then use calculateNewEv() in\n- * process(). If the limits passed to setLimits() change for any reason (for example,\n- * in response to a FrameDurationLimit control being passed in queueRequest())\n- * then setLimits() must be called again with the new values.\n+ * The users must call parseTuningData() in init(), and must also call configure()\n+ * and setLimits() in configure(). They may then use calculateNewEv() in process().\n+ * If the limits passed to setLimits() change for any reason (for example, in\n+ * response to a FrameDurationLimit control being passed in queueRequest()) then\n+ * setLimits() must be called again with the new values.\n */\n \n AgcMeanLuminance::AgcMeanLuminance()\n@@ -354,6 +354,7 @@ void AgcMeanLuminance::configure(utils::Duration lineDuration,\n \n \tluxWarningEnabled_ = true;\n \tfilteredExposure_ = 0s;\n+\tframeCount_ = 0;\n }\n \n /**\n@@ -699,16 +700,6 @@ AgcMeanLuminance::calculateNewEv(const Params ¶ms)\n \treturn { exposureModeHelper.splitExposure(newExposureValue), yTarget };\n }\n \n-/**\n- * \\fn AgcMeanLuminance::resetFrameCount()\n- * \\brief Reset the frame counter\n- *\n- * This function resets the internal frame counter, which exists to help the\n- * algorithm decide whether it should respond instantly or not. The expectation\n- * is for users to call this function before each camera start call in their\n- * configure() function.\n- */\n-\n } /* namespace ipa */\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h\nindex 46a4d3e3f3..f799618ffc 100644\n--- a/src/ipa/libipa/agc_mean_luminance.h\n+++ b/src/ipa/libipa/agc_mean_luminance.h\n@@ -79,11 +79,6 @@ public:\n \n \tdouble effectiveYTarget(double lux, double exposureCompensation) const;\n \n-\tvoid resetFrameCount()\n-\t{\n-\t\tframeCount_ = 0;\n-\t}\n-\n private:\n \tint parseRelativeLuminanceTarget(const ValueNode &tuningData);\n \tint parseConstraint(const ValueNode &modeDict, int32_t id);\n", "prefixes": [ "RFC", "v3", "50/50" ] }