Patch Detail
Show a patch.
GET /api/patches/24590/?format=api
{ "id": 24590, "url": "https://patchwork.libcamera.org/api/patches/24590/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24590/", "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": "<20251011160335.50578-3-kieran.bingham@ideasonboard.com>", "date": "2025-10-11T16:03:30", "name": "[RFC,2/7] ipa: mali-c55: Move CameraHelper to context", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "58600c6ad1e8718d56ff8fad363d9acfa2e265db", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24590/mbox/", "series": [ { "id": 5486, "url": "https://patchwork.libcamera.org/api/series/5486/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5486", "date": "2025-10-11T16:03:28", "name": "Preparatory cleanup for libipa rework.", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5486/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24590/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24590/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 E6592BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 11 Oct 2025 16:03:49 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A0E7C6043B;\n\tSat, 11 Oct 2025 18:03:45 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CF26260428\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 Oct 2025 18:03:42 +0200 (CEST)", "from charm.hippo-penny.ts.net\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 51177C6A;\n\tSat, 11 Oct 2025 18:02:06 +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=\"qrWpDVOA\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760198526;\n\tbh=+NFqsKRHsSiJ1Vtz/eaFrEwgw7KFXq6h/Cuzffq2IUc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qrWpDVOAMEG8ZK0+B73e1gnNSTcqk8DU4PRVdlmhW/SXLwymTBGwGmTZyUYvMYTa6\n\tF92zukrFO/APps8Tm88PslgQMMAY65BEV1dMWiP8RvZc5Qsqi9TLPle1azB2LXys0I\n\t27Wxgbo27Z1ZeMjTwY6Xt5a4F0le1CJH48aMj7wQ=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Subject": "[RFC PATCH 2/7] ipa: mali-c55: Move CameraHelper to context", "Date": "Sat, 11 Oct 2025 17:03:30 +0100", "Message-ID": "<20251011160335.50578-3-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251011160335.50578-1-kieran.bingham@ideasonboard.com>", "References": "<20251011160335.50578-1-kieran.bingham@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": "Move the CameraHelper sensor to the Context so that it can be\nused by the algorithms directly.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/mali-c55/ipa_context.h | 4 ++++\n src/ipa/mali-c55/mali-c55.cpp | 27 ++++++++++++---------------\n 2 files changed, 16 insertions(+), 15 deletions(-)", "diff": "diff --git a/src/ipa/mali-c55/ipa_context.h b/src/ipa/mali-c55/ipa_context.h\nindex 13885eb83b5c..bfa805c7b93f 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 7d45e7310aec..0751513dc584 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": [ "RFC", "2/7" ] }