Patch Detail
Show a patch.
GET /api/1.1/patches/25053/?format=api
{ "id": 25053, "url": "https://patchwork.libcamera.org/api/1.1/patches/25053/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25053/", "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-1-b7c07feba026@ideasonboard.com>", "date": "2025-11-14T14:16:56", "name": "[v3,01/19] ipa: mali-c55: Move CameraHelper to context", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2d2c90a06bc72fe66a4685461419151b0e729505", "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/25053/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/25053/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25053/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 8C18FC3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 14:17:25 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B937F60A81;\n\tFri, 14 Nov 2025 15:17:20 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E64E2609D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 15:17:17 +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 D9ED2BD2;\n\tFri, 14 Nov 2025 15:15:16 +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=\"QfADUwe8\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763129717;\n\tbh=5iyhsG+PxIIOdWozo5WrA+PgYKaevQSGKPX52cc/AYk=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=QfADUwe8FjgK7Ikzy3oFimICstcGSFFUnHKJ9pBpPvA0OVne5eOeY5g9n1E9j8Q3l\n\tGBAxFvhRUeG/t5VBBxOJ3nG+eVnnwBpAUmP80xuuNB6I1fS2C1yBJjUZFn50woWYXF\n\tRiWy6EaQHlS2vVI83z52oVBii1xf1J/e2yVHHJI4=", "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Date": "Fri, 14 Nov 2025 15:16:56 +0100", "Subject": "[PATCH v3 01/19] ipa: mali-c55: Move CameraHelper to context", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20251114-exposure-limits-v3-1-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>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>", "X-Mailer": "b4 0.14.2", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=5760;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=XXjCIJilmpPNFOSZreYmdd/oc9KrrhoPAYsrfWG9wdc=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpFznqN9hK0npMkS3w9KCmAeFRf/nRfZol0jaOq\n\tGJLKH50h9mJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaRc56gAKCRByNAaPFqFW\n\tPMiCD/9boUoPhbn291oFcnPJMZDjcLrhlg2LhSSNriSvlPL7UlBVu5bciYc0O1UXs9bWGebdXbI\n\tVEi1im5CV1CWRziC8T4i2j+JjJGPhg5DckImBWO/IqcXg+z6bgVPR2SRIKFiHoAAUZMnwta0zdP\n\ty5F3PH7GlqxXPifbGHyp11zQpZdQktCg2E+CpCyOHTNMm4N40J+6vxncyRcXz4winjYfr39fIhE\n\t3tx3AIhbZJaHvRVIISjBQ55oD6TcKfhJ5teJfnT5+xYw8I6v8rcPpxJPvAErw/6f7UXW6iiRmvX\n\tMPXLNagKRDARHpp2ICM359TtI7+Wye9MhQWqbb8j/uukkkJmWb23I8ZW3WDMwcVvzxBVrPHTAgh\n\tVXRvRK8ci5tSW0YpYdeniUnstOBpM76rrELB2BG/Y7Al3HNCpHuHu5qZAND0yzDni8n9oxEmxq3\n\tnKGzVZ7SvFu70z1Y2Lycyon8Ul+uCo7O1WdVn/jL9RgMG1QCz342KIthGyVj6MiSXRbL1QgJNIW\n\tWzHG5k/E0nRqfbt/HlHjKSfDJlnaxvTDn++4fmUoqlSe9Bh7vUi1AWkFCXL5Bqf8WSgHS6fGUNi\n\tBgl2gpLIPem3pOlb1Opv3bG3JgggXuCUhuGMtbkPtDP59fiH3eaXM0t/dtzpiz/tODDlkc9vwFU\n\tPjTis1m3OC5C5zw==", "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": "From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nMove the CameraHelper sensor to the Context so that it can be\nused by the algorithms directly.\n\nWhile at it, document the undocumented ctrlMap member of IPAContext.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/mali-c55/ipa_context.cpp | 6 ++++++\n src/ipa/mali-c55/ipa_context.h | 4 ++++\n src/ipa/mali-c55/mali-c55.cpp | 27 ++++++++++++---------------\n 3 files changed, 22 insertions(+), 15 deletions(-)", "diff": "diff --git a/src/ipa/mali-c55/ipa_context.cpp b/src/ipa/mali-c55/ipa_context.cpp\nindex 1b203e2b260592cda945855d54f1aceefaaece91..a1e4c39f38704d3a4b5948ab789ffb9773f216c9 100644\n--- a/src/ipa/mali-c55/ipa_context.cpp\n+++ b/src/ipa/mali-c55/ipa_context.cpp\n@@ -96,6 +96,12 @@ namespace libcamera::ipa::mali_c55 {\n *\n * \\var IPAContext::frameContexts\n * \\brief Ring buffer of per-frame contexts\n+ *\n+ * \\var IPAContext::ctrlMap\n+ * \\brief A ControlInfoMap::Map of controls populated by the algorithms\n+ *\n+ * \\var IPAContext::camHelper\n+ * \\brief The camera sensor helper\n */\n \n } /* namespace libcamera::ipa::mali_c55 */\ndiff --git a/src/ipa/mali-c55/ipa_context.h b/src/ipa/mali-c55/ipa_context.h\nindex 13885eb83b5c4d7c7af6c4f8d5673890834fed58..bfa805c7b93f313dda2497365e83542bbc39e291 100644\n--- a/src/ipa/mali-c55/ipa_context.h\n+++ b/src/ipa/mali-c55/ipa_context.h\n@@ -12,6 +12,7 @@\n \n #include \"libcamera/internal/bayer_format.h\"\n \n+#include <libipa/camera_sensor_helper.h>\n #include <libipa/fc_queue.h>\n \n namespace libcamera {\n@@ -83,6 +84,9 @@ struct IPAContext {\n \tFCQueue<IPAFrameContext> frameContexts;\n \n \tControlInfoMap::Map ctrlMap;\n+\n+\t/* Interface to the Camera Helper */\n+\tstd::unique_ptr<CameraSensorHelper> camHelper;\n };\n \n } /* namespace ipa::mali_c55 */\ndiff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\nindex 7d45e7310aecdae0e47655e6d2e8830e776d74cd..0751513dc584ca84dd212bf8c1469dd4b40c053d 100644\n--- a/src/ipa/mali-c55/mali-c55.cpp\n+++ b/src/ipa/mali-c55/mali-c55.cpp\n@@ -74,9 +74,6 @@ private:\n \n \tControlInfoMap sensorControls_;\n \n-\t/* Interface to the Camera Helper */\n-\tstd::unique_ptr<CameraSensorHelper> camHelper_;\n-\n \t/* Local parameter storage */\n \tstruct IPAContext context_;\n };\n@@ -98,8 +95,8 @@ std::string IPAMaliC55::logPrefix() const\n int IPAMaliC55::init(const IPASettings &settings, const IPAConfigInfo &ipaConfig,\n \t\t ControlInfoMap *ipaControls)\n {\n-\tcamHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n-\tif (!camHelper_) {\n+\tcontext_.camHelper = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n+\tif (!context_.camHelper) {\n \t\tLOG(IPAMaliC55, Error)\n \t\t\t<< \"Failed to create camera sensor helper for \"\n \t\t\t<< settings.sensorModel;\n@@ -142,10 +139,10 @@ void IPAMaliC55::setControls()\n \n \tif (activeState.agc.autoEnabled) {\n \t\texposure = activeState.agc.automatic.exposure;\n-\t\tgain = camHelper_->gainCode(activeState.agc.automatic.sensorGain);\n+\t\tgain = context_.camHelper->gainCode(activeState.agc.automatic.sensorGain);\n \t} else {\n \t\texposure = activeState.agc.manual.exposure;\n-\t\tgain = camHelper_->gainCode(activeState.agc.manual.sensorGain);\n+\t\tgain = context_.camHelper->gainCode(activeState.agc.manual.sensorGain);\n \t}\n \n \tControlList ctrls(sensorControls_);\n@@ -191,17 +188,17 @@ void IPAMaliC55::updateSessionConfiguration(const IPACameraSensorInfo &info,\n \tcontext_.configuration.agc.minShutterSpeed = minExposure * context_.configuration.sensor.lineDuration;\n \tcontext_.configuration.agc.maxShutterSpeed = maxExposure * context_.configuration.sensor.lineDuration;\n \tcontext_.configuration.agc.defaultExposure = defExposure;\n-\tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n-\tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n+\tcontext_.configuration.agc.minAnalogueGain = context_.camHelper->gain(minGain);\n+\tcontext_.configuration.agc.maxAnalogueGain = context_.camHelper->gain(maxGain);\n \n-\tif (camHelper_->blackLevel().has_value()) {\n+\tif (context_.camHelper->blackLevel().has_value()) {\n \t\t/*\n \t\t * The black level from CameraSensorHelper is a 16-bit value.\n \t\t * The Mali-C55 ISP expects 20-bit settings, so we shift it to\n \t\t * the appropriate width\n \t\t */\n \t\tcontext_.configuration.sensor.blackLevel =\n-\t\t\tcamHelper_->blackLevel().value() << 4;\n+\t\t\tcontext_.camHelper->blackLevel().value() << 4;\n \t}\n }\n \n@@ -252,9 +249,9 @@ void IPAMaliC55::updateControls(const IPACameraSensorInfo &sensorInfo,\n \n \t/* Compute the analogue gain limits. */\n \tconst ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\n-\tfloat minGain = camHelper_->gain(v4l2Gain.min().get<int32_t>());\n-\tfloat maxGain = camHelper_->gain(v4l2Gain.max().get<int32_t>());\n-\tfloat defGain = camHelper_->gain(v4l2Gain.def().get<int32_t>());\n+\tfloat minGain = context_.camHelper->gain(v4l2Gain.min().get<int32_t>());\n+\tfloat maxGain = context_.camHelper->gain(v4l2Gain.max().get<int32_t>());\n+\tfloat defGain = context_.camHelper->gain(v4l2Gain.def().get<int32_t>());\n \tctrlMap[&controls::AnalogueGain] = ControlInfo(minGain, maxGain, defGain);\n \n \t/*\n@@ -362,7 +359,7 @@ void IPAMaliC55::processStats(unsigned int request, unsigned int bufferId,\n \tframeContext.agc.exposure =\n \t\tsensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n \tframeContext.agc.sensorGain =\n-\t\tcamHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n+\t\tcontext_.camHelper->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n \n \tControlList metadata(controls::controls);\n \n", "prefixes": [ "v3", "01/19" ] }