Patch Detail
Show a patch.
GET /api/patches/27462/?format=api
{ "id": 27462, "url": "https://patchwork.libcamera.org/api/patches/27462/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27462/", "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": "<20260723154327.1357866-13-barnabas.pocze@ideasonboard.com>", "date": "2026-07-23T15:42:55", "name": "[RFC,v2,12/43] 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/27462/mbox/", "series": [ { "id": 6075, "url": "https://patchwork.libcamera.org/api/series/6075/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6075", "date": "2026-07-23T15:42:43", "name": "ipa: libipa: agc rework", "version": 2, "mbox": "https://patchwork.libcamera.org/series/6075/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27462/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27462/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 56658C32FE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jul 2026 15:43:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5C64467F21;\n\tThu, 23 Jul 2026 17:43:51 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7AD0D67EDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Jul 2026 17:43:33 +0200 (CEST)", "from pb-laptop.local (185.182.215.156.nat.pool.zt.hu\n\t[185.182.215.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E82D2C0B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Jul 2026 17:42: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=\"LzhugbI+\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1784821352;\n\tbh=FiqcuUi9DpZ8BHcj0S1GFTJ2m2G4x+SocPWrpFip7R4=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=LzhugbI+uCu7PgT2TeeG+ih9NsO3RPzJOTYr+bcNRp2OafzqW1p9nJr6R6ZCRBuVh\n\tM1HPG+UCEF7+6mSYYrg/VXROc4M8nrs9xbp60g+Qnf4b/yvVunVlnPBn51Q7+0qRjj\n\tyNTkpBf47BAkhehf2MBmnUq48t8TY+n0e1jo4IDs=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC PATCH v2 12/43] ipa: libipa: agc_mean_luminance: Remove\n\tunnecessary `std::shared_ptr`", "Date": "Thu, 23 Jul 2026 17:42:55 +0200", "Message-ID": "<20260723154327.1357866-13-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.55.0", "In-Reply-To": "<20260723154327.1357866-1-barnabas.pocze@ideasonboard.com>", "References": "<20260723154327.1357866-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>\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 8284c15ce2..faa8a41fd7 100644\n--- a/src/ipa/libipa/agc_mean_luminance.cpp\n+++ b/src/ipa/libipa/agc_mean_luminance.cpp\n@@ -332,10 +332,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@@ -347,12 +344,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@@ -373,7 +366,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@@ -484,7 +477,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@@ -684,7 +677,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@@ -696,7 +689,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@@ -718,7 +711,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", "v2", "12/43" ] }