Patch Detail
Show a patch.
GET /api/1.1/patches/23082/?format=api
{ "id": 23082, "url": "https://patchwork.libcamera.org/api/1.1/patches/23082/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23082/", "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": "<20250331144352.736700-10-stefan.klug@ideasonboard.com>", "date": "2025-03-31T14:43:48", "name": "[9/9] ipa: rkisp1: agc: Implement ExposureValue control", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "2ad40dcbc9c0339ab220908fe1f7e8a5359eaaae", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23082/mbox/", "series": [ { "id": 5094, "url": "https://patchwork.libcamera.org/api/1.1/series/5094/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5094", "date": "2025-03-31T14:43:39", "name": "Wdr preparations", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5094/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23082/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23082/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 F0B1DC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 31 Mar 2025 14:44:23 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A91CE689A1;\n\tMon, 31 Mar 2025 16:44:23 +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 0A2926899D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Mar 2025 16:44:21 +0200 (CEST)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:823a:c275:e8b5:b937])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9046682A;\n\tMon, 31 Mar 2025 16:42:29 +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=\"obTG7OTd\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743432149;\n\tbh=WNEhDYUGcTwAAFle3Q6jIyWw3xCZc1dMUxi0XAOy9qI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=obTG7OTd9aT+aP5e16drbIs2vljr9eumyVgDm8KV0mC1EudGjFm9kEex0tzfY0IfE\n\te0KtoYZ4Nc4tV7xvxiGsciTrFV46oOskYdFFfIKsFiNUsRkZks8YdTJNgJoqE1Kzrv\n\tSaX/1i9GJSwz10Z7nIMFx26DrNNh9LoGFn8yaWyY=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[PATCH 9/9] ipa: rkisp1: agc: Implement ExposureValue control", "Date": "Mon, 31 Mar 2025 16:43:48 +0200", "Message-ID": "<20250331144352.736700-10-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20250331144352.736700-1-stefan.klug@ideasonboard.com>", "References": "<20250331144352.736700-1-stefan.klug@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": "Now that agc_mean_luminance supports exposure correction, implement the\ncorresponding ExposureValue control for rkisp1.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/agc.cpp | 10 ++++++++++\n src/ipa/rkisp1/ipa_context.h | 2 ++\n 2 files changed, 12 insertions(+)", "diff": "diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex b3ac9400b74f..8e77455e7afd 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -158,6 +158,7 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData)\n \t\t\t ControlValue(controls::AnalogueGainModeAuto));\n \t/* \\todo Move this to the Camera class */\n \tcontext.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true);\n+\tcontext.ctrlMap[&controls::ExposureValue] = ControlInfo(-8.0f, 8.0f, 0.0f);\n \tcontext.ctrlMap.merge(controls());\n \n \treturn 0;\n@@ -180,6 +181,7 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n \tcontext.activeState.agc.manual.exposure = context.activeState.agc.automatic.exposure;\n \tcontext.activeState.agc.autoExposureEnabled = !context.configuration.raw;\n \tcontext.activeState.agc.autoGainEnabled = !context.configuration.raw;\n+\tcontext.activeState.agc.exposureValue = 0.0;\n \n \tcontext.activeState.agc.constraintMode =\n \t\tstatic_cast<controls::AeConstraintModeEnum>(constraintModes().begin()->first);\n@@ -302,6 +304,11 @@ void Agc::queueRequest(IPAContext &context,\n \t\t\tstatic_cast<controls::AeConstraintModeEnum>(*constraintMode);\n \tframeContext.agc.constraintMode = agc.constraintMode;\n \n+\tconst auto &exposureValue = controls.get(controls::ExposureValue);\n+\tif (exposureValue)\n+\t\tagc.exposureValue = *exposureValue;\n+\tframeContext.agc.exposureValue = agc.exposureValue;\n+\n \tconst auto &frameDurationLimits = controls.get(controls::FrameDurationLimits);\n \tif (frameDurationLimits) {\n \t\t/* Limit the control value to the limits in ControlInfo */\n@@ -408,6 +415,7 @@ void Agc::fillMetadata(IPAContext &context, IPAFrameContext &frameContext,\n \tmetadata.set(controls::AeMeteringMode, frameContext.agc.meteringMode);\n \tmetadata.set(controls::AeExposureMode, frameContext.agc.exposureMode);\n \tmetadata.set(controls::AeConstraintMode, frameContext.agc.constraintMode);\n+\tmetadata.set(controls::ExposureValue, frameContext.agc.exposureValue);\n }\n \n /**\n@@ -557,6 +565,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n \tdouble analogueGain = frameContext.sensor.gain;\n \tutils::Duration effectiveExposureValue = exposureTime * analogueGain;\n \n+\tsetExposureCompensation(pow(2.0, frameContext.agc.exposureValue));\n+\n \tutils::Duration newExposureTime;\n \tdouble aGain, dGain;\n \tstd::tie(newExposureTime, aGain, dGain) =\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex f0d504215d34..7ccc7b501aff 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -81,6 +81,7 @@ struct IPAActiveState {\n \n \t\tbool autoExposureEnabled;\n \t\tbool autoGainEnabled;\n+\t\tdouble exposureValue;\n \t\tcontrols::AeConstraintModeEnum constraintMode;\n \t\tcontrols::AeExposureModeEnum exposureMode;\n \t\tcontrols::AeMeteringModeEnum meteringMode;\n@@ -129,6 +130,7 @@ struct IPAFrameContext : public FrameContext {\n \tstruct {\n \t\tuint32_t exposure;\n \t\tdouble gain;\n+\t\tdouble exposureValue;\n \t\tuint32_t vblank;\n \t\tbool autoExposureEnabled;\n \t\tbool autoGainEnabled;\n", "prefixes": [ "9/9" ] }