Patch Detail
Show a patch.
GET /api/patches/27561/?format=api
{ "id": 27561, "url": "https://patchwork.libcamera.org/api/patches/27561/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27561/", "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-13-barnabas.pocze@ideasonboard.com>", "date": "2026-08-03T13:13:57", "name": "[RFC,v3,12/50] ipa: libipa: agc_mean_luminance: Remove unnecessary `std::shared_ptr`", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7413c66f6bc74a260f7199d86a2c33b362bc1688", "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/27561/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/27561/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27561/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 CCFC9C3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 3 Aug 2026 13:15:05 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 588FA68086;\n\tMon, 3 Aug 2026 15:14:52 +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 BE3616807C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 3 Aug 2026 15:14:41 +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 D7BAA18E1;\n\tMon, 3 Aug 2026 15:13:32 +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=\"TJFWMc70\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1785762812;\n\tbh=78XzNzIBmEs2ez2lXqIXGQlAO6+sc5nnZlvfbsG2q5w=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=TJFWMc70vbK2FjWvxk8FrjB6GUStXTNcrOtLAzdI1Jdx4JCBePvF3CfAeQ4iG8m/A\n\taiiFf9Uo2Q5tFARcNs4teDd8PXCmogAisnTpq0zPjxXwScv9JVa7IICoOfeCpEhbzo\n\tO9h8RkGOoE8GnqzzonKwxN8teAHDuFQo1EqrJ6CI=", "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>", "Subject": "[RFC PATCH v3 12/50] ipa: libipa: agc_mean_luminance: Remove\n\tunnecessary `std::shared_ptr`", "Date": "Mon, 3 Aug 2026 15:13:57 +0200", "Message-ID": "<20260803131435.153927-13-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": "The `ExposureModeHelper` object can be directly in the map, so do that.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/libipa/agc_mean_luminance.cpp | 23 ++++++++---------------\n src/ipa/libipa/agc_mean_luminance.h | 4 ++--\n 2 files changed, 10 insertions(+), 17 deletions(-)", "diff": "diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\nindex 1b0c43febf..c1ec5a3ddb 100644\n--- a/src/ipa/libipa/agc_mean_luminance.cpp\n+++ b/src/ipa/libipa/agc_mean_luminance.cpp\n@@ -331,10 +331,7 @@ int AgcMeanLuminance::parseExposureModes(const ValueNode &tuningData)\n \t\t\t\t});\n \t\t\t}\n \n-\t\t\tstd::shared_ptr<ExposureModeHelper> helper =\n-\t\t\t\tstd::make_shared<ExposureModeHelper>(stages);\n-\n-\t\t\texposureModeHelpers_.try_emplace(it->second, std::move(helper));\n+\t\t\texposureModeHelpers_.try_emplace(it->second, stages);\n \t\t\tavailableExposureModes.push_back(it->second);\n \t\t}\n \t}\n@@ -346,12 +343,8 @@ int AgcMeanLuminance::parseExposureModes(const ValueNode &tuningData)\n \t * possible before touching gain.\n \t */\n \tif (availableExposureModes.empty()) {\n-\t\tstd::vector<std::pair<utils::Duration, double>> stages = { };\n-\n-\t\tstd::shared_ptr<ExposureModeHelper> helper =\n-\t\t\tstd::make_shared<ExposureModeHelper>(stages);\n-\n-\t\texposureModeHelpers_.try_emplace(controls::ExposureNormal, std::move(helper));\n+\t\texposureModeHelpers_.try_emplace(controls::ExposureNormal,\n+\t\t\t\t\t\t Span<std::pair<utils::Duration, double>>{});\n \t\tavailableExposureModes.push_back(controls::ExposureNormal);\n \t}\n \n@@ -372,7 +365,7 @@ void AgcMeanLuminance::configure(utils::Duration lineDuration,\n \t\t\t\t const CameraSensorHelper *sensorHelper)\n {\n \tfor (auto &[id, helper] : exposureModeHelpers_)\n-\t\thelper->configure(lineDuration, sensorHelper);\n+\t\thelper.configure(lineDuration, sensorHelper);\n \n \tluxWarningEnabled_ = true;\n }\n@@ -483,7 +476,7 @@ void AgcMeanLuminance::setLimits(utils::Duration minExposureTime,\n \t\t\t\t std::vector<AgcMeanLuminance::AgcConstraint> constraints)\n {\n \tfor (auto &[id, helper] : exposureModeHelpers_)\n-\t\thelper->setLimits(minExposureTime, maxExposureTime, minGain, maxGain);\n+\t\thelper.setLimits(minExposureTime, maxExposureTime, minGain, maxGain);\n \n \tadditionalConstraints_ = std::move(constraints);\n }\n@@ -683,7 +676,7 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n \t * The pipeline handler should validate that we have received an allowed\n \t * value for AeExposureMode.\n \t */\n-\tstd::shared_ptr<ExposureModeHelper> exposureModeHelper =\n+\tExposureModeHelper &exposureModeHelper =\n \t\texposureModeHelpers_.at(exposureModeIndex);\n \n \tif (effectiveExposureValue == 0s) {\n@@ -695,7 +688,7 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n \t\t * doesn't get stuck with 0 in case the sensor driver allows a\n \t\t * min exposure of 0.\n \t\t */\n-\t\treturn exposureModeHelper->splitExposure(10ms);\n+\t\treturn exposureModeHelper.splitExposure(10ms);\n \t}\n \n \tdouble gain = estimateInitialGain(traits);\n@@ -717,7 +710,7 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n \tnewExposureValue = filterExposure(newExposureValue);\n \n \tframeCount_++;\n-\treturn exposureModeHelper->splitExposure(newExposureValue);\n+\treturn exposureModeHelper.splitExposure(newExposureValue);\n }\n \n /**\ndiff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h\nindex f4e1680ab5..d5425cd20b 100644\n--- a/src/ipa/libipa/agc_mean_luminance.h\n+++ b/src/ipa/libipa/agc_mean_luminance.h\n@@ -69,7 +69,7 @@ public:\n \t\treturn constraintModes_;\n \t}\n \n-\tconst std::map<int32_t, std::shared_ptr<ExposureModeHelper>> &exposureModeHelpers() const\n+\tconst std::map<int32_t, ExposureModeHelper> &exposureModeHelpers() const\n \t{\n \t\treturn exposureModeHelpers_;\n \t}\n@@ -111,7 +111,7 @@ private:\n \n \tstd::vector<AgcConstraint> additionalConstraints_;\n \tstd::map<int32_t, std::vector<AgcConstraint>> constraintModes_;\n-\tstd::map<int32_t, std::shared_ptr<ExposureModeHelper>> exposureModeHelpers_;\n+\tstd::map<int32_t, ExposureModeHelper> exposureModeHelpers_;\n \tControlInfoMap::Map controls_;\n };\n \n", "prefixes": [ "RFC", "v3", "12/50" ] }