Patch Detail
Show a patch.
GET /api/1.1/patches/24594/?format=api
{ "id": 24594, "url": "https://patchwork.libcamera.org/api/1.1/patches/24594/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24594/", "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": "<20251011160335.50578-7-kieran.bingham@ideasonboard.com>", "date": "2025-10-11T16:03:34", "name": "[RFC,6/7] ipa: softipa: Move camhelper to context", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "f5ca1aec9e0c68ccf9ecc488a13244592ad7c25c", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24594/mbox/", "series": [ { "id": 5486, "url": "https://patchwork.libcamera.org/api/1.1/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/24594/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24594/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 0FDBBC3332\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 11 Oct 2025 16:03:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 992E56044D;\n\tSat, 11 Oct 2025 18:03:49 +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 C3F9B603E0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 Oct 2025 18:03:43 +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 787E5111D;\n\tSat, 11 Oct 2025 18:02:07 +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=\"fw9fkwRL\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760198527;\n\tbh=nUwo8X77he7xCHYXX1WZpsW4CByiA4itnK5MKcAtNkg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=fw9fkwRLUirzvu3HJkG5h+6GFPy1QlwAz3VTaWE7PIuQ/2vkvXLACh/P+eG+PCv1H\n\tZqvXW6qmIs+P+1xuPuB1OYFW6U8oqSOn/tGd2LNDz+zRpD1ceUTaMcd45CpE7pw15T\n\tC3P4Dy2uNnucCt0aDyJwnPURJNSfsSD9ntvATNMQ=", "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 6/7] ipa: softipa: Move camhelper to context", "Date": "Sat, 11 Oct 2025 17:03:34 +0100", "Message-ID": "<20251011160335.50578-7-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 camhelper to the context structure so that it can be accessible\nfor algorithms to use directly where needed.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/simple/ipa_context.h | 3 +++\n src/ipa/simple/soft_simple.cpp | 21 ++++++++++-----------\n 2 files changed, 13 insertions(+), 11 deletions(-)", "diff": "diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\nindex c3081e3069b5..3d6a8b72861f 100644\n--- a/src/ipa/simple/ipa_context.h\n+++ b/src/ipa/simple/ipa_context.h\n@@ -16,6 +16,7 @@\n #include \"libcamera/internal/matrix.h\"\n #include \"libcamera/internal/vector.h\"\n \n+#include <libipa/camera_sensor_helper.h>\n #include <libipa/fc_queue.h>\n \n #include \"core_ipa_interface.h\"\n@@ -103,6 +104,8 @@ struct IPAContext {\n \tFCQueue<IPAFrameContext> frameContexts;\n \tControlInfoMap::Map ctrlMap;\n \tbool ccmEnabled = false;\n+\n+\tstd::unique_ptr<CameraSensorHelper> camHelper;\n };\n \n } /* namespace ipa::soft */\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex 0821d214815f..68ddf71e9f24 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -76,7 +76,6 @@ private:\n \n \tDebayerParams *params_;\n \tSwIspStats *stats_;\n-\tstd::unique_ptr<CameraSensorHelper> camHelper_;\n \tControlInfoMap sensorInfoMap_;\n \n \t/* Local parameter storage */\n@@ -99,8 +98,8 @@ int IPASoftSimple::init(const IPASettings &settings,\n \t\t\tControlInfoMap *ipaControls,\n \t\t\tbool *ccmEnabled)\n {\n-\tcamHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n-\tif (!camHelper_) {\n+\tcontext_.camHelper = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n+\tif (!context_.camHelper) {\n \t\tLOG(IPASoft, Warning)\n \t\t\t<< \"Failed to create camera sensor helper for \"\n \t\t\t<< settings.sensorModel;\n@@ -220,15 +219,15 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo,\n \tint32_t againMax = gainInfo.max().get<int32_t>();\n \tint32_t againDef = gainInfo.def().get<int32_t>();\n \n-\tif (camHelper_) {\n-\t\tcontext_.configuration.agc.againMin = camHelper_->gain(againMin);\n-\t\tcontext_.configuration.agc.againMax = camHelper_->gain(againMax);\n-\t\tcontext_.configuration.agc.again10 = camHelper_->gain(1.0);\n+\tif (context_.camHelper) {\n+\t\tcontext_.configuration.agc.againMin = context_.camHelper->gain(againMin);\n+\t\tcontext_.configuration.agc.againMax = context_.camHelper->gain(againMax);\n+\t\tcontext_.configuration.agc.again10 = context_.camHelper->gain(1.0);\n \t\tcontext_.configuration.agc.againMinStep =\n \t\t\t(context_.configuration.agc.againMax -\n \t\t\t context_.configuration.agc.againMin) /\n \t\t\t100.0;\n-\t\tif (camHelper_->blackLevel().has_value()) {\n+\t\tif (context_.camHelper->blackLevel().has_value()) {\n \t\t\t/*\n \t\t\t * The black level from camHelper_ is a 16 bit value, software ISP\n \t\t\t * works with 8 bit pixel values, both regardless of the actual\n@@ -236,7 +235,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo,\n \t\t\t * by dividing the value from the helper by 256.\n \t\t\t */\n \t\t\tcontext_.configuration.black.level =\n-\t\t\t\tcamHelper_->blackLevel().value() / 256;\n+\t\t\t\tcontext_.camHelper->blackLevel().value() / 256;\n \t\t}\n \t} else {\n \t\t/*\n@@ -313,7 +312,7 @@ void IPASoftSimple::processStats(const uint32_t frame,\n \tframeContext.sensor.exposure =\n \t\tsensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n \tint32_t again = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>();\n-\tframeContext.sensor.gain = camHelper_ ? camHelper_->gain(again) : again;\n+\tframeContext.sensor.gain = context_.camHelper ? context_.camHelper->gain(again) : again;\n \n \tControlList metadata(controls::controls);\n \tfor (auto const &algo : algorithms())\n@@ -332,7 +331,7 @@ void IPASoftSimple::processStats(const uint32_t frame,\n \tauto &againNew = frameContext.sensor.gain;\n \tctrls.set(V4L2_CID_EXPOSURE, frameContext.sensor.exposure);\n \tctrls.set(V4L2_CID_ANALOGUE_GAIN,\n-\t\t static_cast<int32_t>(camHelper_ ? camHelper_->gainCode(againNew) : againNew));\n+\t\t static_cast<int32_t>(context_.camHelper ? context_.camHelper->gainCode(againNew) : againNew));\n \n \tsetSensorControls.emit(ctrls);\n }\n", "prefixes": [ "RFC", "6/7" ] }