{"id":27071,"url":"https://patchwork.libcamera.org/api/patches/27071/?format=json","web_url":"https://patchwork.libcamera.org/patch/27071/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260626-ipu3-libipa-rework-v2-11-41546e23de3e@ideasonboard.com>","date":"2026-06-26T13:05:58","name":"[v2,11/12] ipa: ipu3: Add IPACameraSensorInfo to IPAContext","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a52a755386a56ed7e5c1c7fcb2734cba76eb66a7","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/?format=json","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/27071/mbox/","series":[{"id":6022,"url":"https://patchwork.libcamera.org/api/series/6022/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6022","date":"2026-06-26T13:05:47","name":"libipa: Re-work IPU3 IPA to use libipa algorithms","version":2,"mbox":"https://patchwork.libcamera.org/series/6022/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/27071/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/27071/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 3E2D0C330F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Jun 2026 13:06:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD37765EEF;\n\tFri, 26 Jun 2026 15:06:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DACDC65EF9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jun 2026 15:06:07 +0200 (CEST)","from [127.0.1.1]\n\t(chfd-03-b2-v4wan-176392-cust229.vm15.cable.virginm.net\n\t[82.19.20.230])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 035D31D00;\n\tFri, 26 Jun 2026 15:05:26 +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=\"cEgXHgkd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782479127;\n\tbh=A9hGuIqdIKWPEToYxKgGT5lgPd0mj/cV61qp5al+MzI=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=cEgXHgkdz8YFkciGH9i3Yd1YoyjB4DIjA+YrDeCHrreSLBPQkV6mSUkVcCx1Nq/qs\n\tukaxMEmcbCmtUMEWNBm49bNVdMtzSmms2AayAF1PIiEDDZ7Nx7e3w6r8tN1gez0Hdu\n\t0I6FQ7jSgHud8vElBEQtPwTWbxD/jlJwvR6NVJ80=","From":"Daniel Scally <dan.scally@ideasonboard.com>","Date":"Fri, 26 Jun 2026 14:05:58 +0100","Subject":"[PATCH v2 11/12] ipa: ipu3: Add IPACameraSensorInfo to IPAContext","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260626-ipu3-libipa-rework-v2-11-41546e23de3e@ideasonboard.com>","References":"<20260626-ipu3-libipa-rework-v2-0-41546e23de3e@ideasonboard.com>","In-Reply-To":"<20260626-ipu3-libipa-rework-v2-0-41546e23de3e@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Daniel Scally <dan.scally@ideasonboard.com>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=openpgp-sha256; l=4825;\n\ti=dan.scally@ideasonboard.com; h=from:subject:message-id;\n\tbh=A9hGuIqdIKWPEToYxKgGT5lgPd0mj/cV61qp5al+MzI=;\n\tb=owEBbQKS/ZANAwAKAchJV3psRXUyAcsmYgBqPnk7TS6rYD7kinKU0ZIJqrVX5t2HwQ0AYiP2X\n\tbAn3bc0AQKJAjMEAAEKAB0WIQQqyuwyDnZdb+mxmm/ISVd6bEV1MgUCaj55OwAKCRDISVd6bEV1\n\tMnoeD/9jA8tzoMHWOdGpgOQJ+ZQOS4pBOAmlG5co0l6duQnJBusJkYAqw7Nh8g7naTnQUYSIRW8\n\t81KkQAackTZsx1oF9a6yu1xxmIct7QSBMW+VCCTg/5ZUd+xJF1A5vWlbMSZCt5zBbFUZKR0VVAq\n\tHsXtn4ma9eoBF6AFvk78cfZ6fNbJ1Zku765CccyC2wPzwmRKwi4KGpw2SZziELTiISHW6dEWsZ+\n\t+bcZen3b1pMjVNhNauZ5y5mROPeJauTgzk/D+4EpueHsABkRsxxayYfSTiJKg0RGCjfb1f3Q4nG\n\tPOsUJv23wZrWk8FxQ/8NQrCxvHw6YKRg4w3AoiGIWmH6fjW/dGgfxmWYtXiAxiz2X8B+9RjVIO/\n\txkI5U9avJ/OmaoWtwRgMQE7qLCZPNqfW5ZfA0GRzLxNf1BleM89VAkZXZFkwd8rzMO4CNgzML/I\n\tjq7sTV8zdoK+rsuQCrssuJIfWwl1FOObBN9L9+YiBADwi3yNULseAYX3Gj0+X5HeHZDqjk/MXaI\n\tI6GT924OlLZMT01AWonmy6vhNLDmbHoPfbodg0eBnvkjAZBQqx+o3rGqYOKqLzlp7WnernJlU28\n\tuLAyKmyTLKD6nOGjbaIXhd099O1Bh7I4qPeFanyNBPydd1kqhbKDRgOoLXJrxg7JbfaULeyAyds\n\tclObiOt0mW0559g==","X-Developer-Key":"i=dan.scally@ideasonboard.com; a=openpgp;\n\tfpr=EEC699ACA1B7CB5D31330C0BBD501C2A3546CCF6","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":"Add an instance of IPACameraSensorInfo to the IPAContext and fill it\nduring IPAIPU3::init(). This will allow us to pass sensor information\nto algorithms at init time. This means that IPAIPU3::sensorInfo_ is\nno longer needed, as the instance stored in the context is accessible\neverywhere that that was previously used. Drop it.\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\nChanges in v2:\n\n        - Dropped the sensorInfo_ class member, since this replaces it\n---\n src/ipa/ipu3/ipa_context.cpp |  3 +++\n src/ipa/ipu3/ipa_context.h   |  3 +++\n src/ipa/ipu3/ipu3.cpp        | 20 +++++++++-----------\n 3 files changed, 15 insertions(+), 11 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\nindex d3bcd7a81fe010d17d1437bf7f6cedce83a9be5c..9537802ceca5018118bdf4c71ef361c20fc44bfb 100644\n--- a/src/ipa/ipu3/ipa_context.cpp\n+++ b/src/ipa/ipu3/ipa_context.cpp\n@@ -54,6 +54,9 @@ namespace libcamera::ipa::ipu3 {\n  *\n  * \\var IPAContext::ctrlMap\n  * \\brief A ControlInfoMap::Map of controls populated by the algorithms\n+ *\n+ * \\var IPAContext::sensorInfo\n+ * \\brief An IPACameraSensorInfo instance holding information about the sensor\n  */\n \n /**\ndiff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\nindex ce496ed477f4cbe2653aedada3381258396d92c8..d650f2fe1ad8eab91b7128a47c9690e42b1595f1 100644\n--- a/src/ipa/ipu3/ipa_context.h\n+++ b/src/ipa/ipu3/ipa_context.h\n@@ -15,6 +15,8 @@\n #include <libcamera/controls.h>\n #include <libcamera/geometry.h>\n \n+#include <libcamera/ipa/core_ipa_interface.h>\n+\n #include <libipa/awb.h>\n #include <libipa/ccm.h>\n #include <libipa/fc_queue.h>\n@@ -91,6 +93,7 @@ struct IPAContext {\n \tFCQueue<IPAFrameContext> frameContexts;\n \n \tControlInfoMap::Map ctrlMap;\n+\tIPACameraSensorInfo sensorInfo;\n };\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex b1c176e68098b24d8fd37e7a0e278cabf0e1c3b2..c2d3e62d12f4aba9e3d008025c8922a71d45d36f 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -177,8 +177,6 @@ private:\n \tControlInfoMap sensorCtrls_;\n \tControlInfoMap lensCtrls_;\n \n-\tIPACameraSensorInfo sensorInfo_;\n-\n \t/* Interface to the Camera Helper */\n \tstd::unique_ptr<CameraSensorHelper> camHelper_;\n \n@@ -265,19 +263,19 @@ void IPAIPU3::updateControls(const ControlInfoMap &sensorControls,\n \t */\n \tconst ControlInfo &v4l2HBlank = sensorControls.find(V4L2_CID_HBLANK)->second;\n \tuint32_t hblank = v4l2HBlank.def().get<int32_t>();\n-\tuint32_t lineLength = sensorInfo_.outputSize.width + hblank;\n+\tuint32_t lineLength = context_.sensorInfo.outputSize.width + hblank;\n \n \tconst ControlInfo &v4l2VBlank = sensorControls.find(V4L2_CID_VBLANK)->second;\n \tstd::array<uint32_t, 3> frameHeights{\n-\t\tv4l2VBlank.min().get<int32_t>() + sensorInfo_.outputSize.height,\n-\t\tv4l2VBlank.max().get<int32_t>() + sensorInfo_.outputSize.height,\n-\t\tv4l2VBlank.def().get<int32_t>() + sensorInfo_.outputSize.height,\n+\t\tv4l2VBlank.min().get<int32_t>() + context_.sensorInfo.outputSize.height,\n+\t\tv4l2VBlank.max().get<int32_t>() + context_.sensorInfo.outputSize.height,\n+\t\tv4l2VBlank.def().get<int32_t>() + context_.sensorInfo.outputSize.height,\n \t};\n \n \tstd::array<int64_t, 3> frameDurations;\n \tfor (unsigned int i = 0; i < frameHeights.size(); ++i) {\n \t\tuint64_t frameSize = lineLength * frameHeights[i];\n-\t\tframeDurations[i] = frameSize / (sensorInfo_.pixelRate / 1000000U);\n+\t\tframeDurations[i] = frameSize / (context_.sensorInfo.pixelRate / 1000000U);\n \t}\n \tcontrols[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n \t\t\t\t\t\t\t       frameDurations[1],\n@@ -311,7 +309,7 @@ int IPAIPU3::init(const IPASettings &settings,\n \tcontext_.configuration = {};\n \tcontext_.configuration.sensor.lineDuration =\n \t\tsensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate;\n-\tsensorInfo_ = sensorInfo;\n+\tcontext_.sensorInfo = sensorInfo;\n \n \t/* Load the tuning data file. */\n \tFile file(settings.configurationFile);\n@@ -464,7 +462,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \t\treturn -ENODATA;\n \t}\n \n-\tsensorInfo_ = configInfo.sensorInfo;\n+\tcontext_.sensorInfo = configInfo.sensorInfo;\n \n \tlensCtrls_ = configInfo.lensControls;\n \n@@ -475,8 +473,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \n \t/* Initialise the sensor configuration. */\n \tcontext_.configuration.sensor.lineDuration =\n-\t\tsensorInfo_.minLineLength * 1.0s / sensorInfo_.pixelRate;\n-\tcontext_.configuration.sensor.size = sensorInfo_.outputSize;\n+\t\tcontext_.sensorInfo.minLineLength * 1.0s / context_.sensorInfo.pixelRate;\n+\tcontext_.configuration.sensor.size = context_.sensorInfo.outputSize;\n \n \t/*\n \t * Compute the sensor V4L2 controls to be used by the algorithms and\n","prefixes":["v2","11/12"]}