From patchwork Wed Nov 18 08:08:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 28958 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1FC1FBDE17 for ; Wed, 18 Nov 2026 08:09:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BFCF26A8AD; Wed, 18 Nov 2026 09:09:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tJroo6Ri"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BC08A6A7EA for ; Wed, 18 Nov 2026 09:09:21 +0100 (CET) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c67:cdf:7464:6c04:36e4:ee87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 351ED63C; Wed, 18 Nov 2026 09:06:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794989213; bh=AUtdPK+QTJcUTfDilkAcyJQlTN9jrNQrUGZ4feTe5Cw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tJroo6RiRFyLAtpOsoEn4Fs3BsoLfUCch7IEmP+zhgC+PoEDcIW6xtmj/vl9oeTEV HuVqHQhovWNxFQG8XhkLpr6jhfb1ttGWWZGTe+mX+BgK9QzemZtv+I4YyiZJngtlo6 cItHQrbkAhWxEljPMzsMKNiQPNtL+2H057/dszZs= From: Jai Luthra Date: Wed, 18 Nov 2026 13:38:25 +0530 Subject: [PATCH v4 1/4] ipa: libipa: camera_sensor_helper: Match multiple sensors per helper MIME-Version: 1.0 Message-Id: <20261118-mainline-imx676-v4-1-48ae007f11b4@ideasonboard.com> References: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> In-Reply-To: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Dave Stevenson , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=16039; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=AUtdPK+QTJcUTfDilkAcyJQlTN9jrNQrUGZ4feTe5Cw=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBq/V0k/S09N9YxU/fj+ggHeuHJVGUR5k9KO2b/7 4up51ZJ/4+JAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCav1dJAAKCRBD3pH5JJpx RaHSD/41f4JKXWf0wWplDIySY6PRcGQ1Cu/gkFIlLSXUBmxKJ3dXlf4PYQWN9SE/tFYYIHSmkfz GfWLuNWtWG4bQgSlrYgB4BHbzUPL97/IZdHRAyrMU5plzjV5R6JHzj8DdT69l3N1Fy4sTPKQWA6 VDPFrQuEd+PBoMwcj/NOPHvhmaGnmAeHF32xVrZ1GVGFxLpS5xmw6/4LIP8kcz6atV/51R72ys3 2fyW48lMnykbAIederIztQ/9C5six3kXqFpgYzj1iRKYBZxLHrsopEWFmbhHSAjuWi2QB4M6q7T 3xGBAbgh5mvyd6ADlZA6JRTeZYOPmU7aSvJu/HsN95S+0UUIGorFeGie/wUE833liwho/U4Vt2H O2XoOXzHaWvjItdYxC/Y5I+lwzpESxDFkQzuK0GyCYT7Qt3Ks/GjaBzLN+DEqIRfbrSytdsAAfL OsEuuBxBKCl3/yFfQu7bluykPh+EKHIxt5n5eh/HRJa7qkxDQ/orAt993sOAIGF4mS7nw6/SbC2 y4ALV/a549bWSz77DW2ar1RejcbeEq/b/hdtDoGxoz8Dp2Naclu5zzWrK8YPCxgBa5VKQexX3oP IeRgaLsEMYWe0co05hjW8fh+UpudQ+SHBwcYa95xZYvRME2PMNW7U76hAr9cYMVzD3u9B5E6yvt 7yVZnw0CFB+xdaQ== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Multiple sensors by the same vendor often have similar gain models and pedestal values, sometimes even having the same register layouts. In such cases they can be supported by the same helper. Currently we achieve this by deriving a new class and calling the registration macro again. Like below: class CameraSensorHelperImx327 : public CameraSensorHelperImx290 { }; REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327) A cleaner solution is to instead allow registering a single camera sensor helper class for multiple sensor model names, and updating the macro to accept >= 1 names using variadic arguments. Implement it, and also convert the two derived classes of the Imx290 helper to use this approach. Prefix it with a comment to clarify that this is done only for convenience, and if differences are found we may split out any of the sensors into a separate helper. Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck Signed-off-by: Jai Luthra --- src/ipa/libipa/camera_sensor_helper.cpp | 106 +++++++++++++++----------------- src/ipa/libipa/camera_sensor_helper.h | 12 ++-- 2 files changed, 57 insertions(+), 61 deletions(-) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 608937d45ee2..b106070c49d2 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -257,15 +257,15 @@ double CameraSensorHelper::quantizeGain(double _gain, double *quantizationGain) /** * \brief Construct a camera sensor helper factory base - * \param[in] name Name of the camera sensor helper class + * \param[in] names Names of the camera sensors to match with the helper * * Creating an instance of the factory base registers it with the global list of * factories, accessible through the factories() function. * - * The factory \a name is used to look up factories and shall be unique. + * The factory \a names are used to look up factories and shall be unique. */ -CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(const std::string name) - : name_(name) +CameraSensorHelperFactoryBase::CameraSensorHelperFactoryBase(std::initializer_list names) + : names_(names.begin(), names.end()) { registerType(this); } @@ -285,7 +285,8 @@ std::unique_ptr CameraSensorHelperFactoryBase::create(const CameraSensorHelperFactoryBase::factories(); for (const CameraSensorHelperFactoryBase *factory : factories) { - if (name != factory->name_) + const auto &names = factory->names_; + if (std::find(names.begin(), names.end(), name) == names.end()) continue; return factory->createInstance(); @@ -338,9 +339,9 @@ std::vector &CameraSensorHelperFactoryBase::fac */ /** - * \fn CameraSensorHelperFactory::CameraSensorHelperFactory(const char *name) + * \fn CameraSensorHelperFactory::CameraSensorHelperFactory(std::initializer_list names) * \brief Construct a camera sensor helper factory - * \param[in] name Name of the camera sensor helper class + * \param[in] names Names of the camera sensors to match with the helper * * Creating an instance of the factory registers it with the global list of * factories, accessible through the CameraSensorHelperFactoryBase::factories() @@ -361,8 +362,9 @@ std::vector &CameraSensorHelperFactoryBase::fac /** * \def REGISTER_CAMERA_SENSOR_HELPER * \brief Register a camera sensor helper with the camera sensor helper factory - * \param[in] name Sensor model name used to register the class * \param[in] helper Class name of CameraSensorHelper derived class to register + * \param[in] name Sensor model name used to register the class + * \param[in] ... More sensor model names that can be matched to this helper * * Register a CameraSensorHelper subclass with the factory and make it available * to try and match sensors. @@ -485,7 +487,7 @@ public: return m * (1 << coarse) / (1.0 - (fine / d1) / d2); } }; -REGISTER_CAMERA_SENSOR_HELPER("ar0144", CameraSensorHelperAr0144) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0144, "ar0144") class CameraSensorHelperAr0521 : public CameraSensorHelper { @@ -515,7 +517,7 @@ public: private: static constexpr double kStep_ = 16; }; -REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperAr0521, "ar0521") class CameraSensorHelperGc05a2 : public CameraSensorHelper { @@ -528,7 +530,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc05a2, "gc05a2") class CameraSensorHelperGc08a3 : public CameraSensorHelper { @@ -541,7 +543,7 @@ public: exposureMargin_ = 16; } }; -REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperGc08a3, "gc08a3") class CameraSensorHelperHm1246 : public CameraSensorHelper { @@ -552,7 +554,7 @@ public: exposureMargin_ = 2; } }; -REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperHm1246, "hm1246") class CameraSensorHelperImx214 : public CameraSensorHelper { @@ -565,7 +567,7 @@ public: exposureMargin_ = 10; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx214, "imx214") class CameraSensorHelperImx219 : public CameraSensorHelper { @@ -578,7 +580,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx219", CameraSensorHelperImx219) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx219, "imx219") class CameraSensorHelperImx258 : public CameraSensorHelper { @@ -591,7 +593,7 @@ public: exposureMargin_ = 10; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx258, "imx258") class CameraSensorHelperImx283 : public CameraSensorHelper { @@ -604,8 +606,12 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx283", CameraSensorHelperImx283) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx283, "imx283") +/* + * Reusing CameraSensorHelperImx290 for multiple sensors, for convenience. + * They may need to be split apart if any differences are found later. + */ class CameraSensorHelperImx290 : public CameraSensorHelper { public: @@ -617,7 +623,7 @@ public: exposureMargin_ = 2; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx290", CameraSensorHelperImx290) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx290, "imx290", "imx327", "imx462") class CameraSensorHelperImx296 : public CameraSensorHelper { @@ -632,12 +638,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx296", CameraSensorHelperImx296) - -class CameraSensorHelperImx327 : public CameraSensorHelperImx290 -{ -}; -REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx296, "imx296") class CameraSensorHelperImx335 : public CameraSensorHelper { @@ -650,7 +651,7 @@ public: exposureMargin_ = 10; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx335, "imx335") class CameraSensorHelperImx355 : public CameraSensorHelper { @@ -663,7 +664,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx355", CameraSensorHelperImx355) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx355, "imx355") class CameraSensorHelperImx415 : public CameraSensorHelper { @@ -674,12 +675,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx415", CameraSensorHelperImx415) - -class CameraSensorHelperImx462 : public CameraSensorHelperImx290 -{ -}; -REGISTER_CAMERA_SENSOR_HELPER("imx462", CameraSensorHelperImx462) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx415, "imx415") class CameraSensorHelperImx471 : public CameraSensorHelper { @@ -693,7 +689,7 @@ public: exposureMargin_ = 18; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx471", CameraSensorHelperImx471) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx471, "imx471") class CameraSensorHelperImx477 : public CameraSensorHelper { @@ -704,7 +700,7 @@ public: exposureMargin_ = 22; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx477", CameraSensorHelperImx477) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477") class CameraSensorHelperImx662 : public CameraSensorHelper { @@ -717,7 +713,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx662", CameraSensorHelperImx662) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662") class CameraSensorHelperImx678 : public CameraSensorHelper { @@ -730,7 +726,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx678", CameraSensorHelperImx678) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678") class CameraSensorHelperImx708 : public CameraSensorHelper { @@ -742,7 +738,7 @@ public: exposureMargin_ = 48; } }; -REGISTER_CAMERA_SENSOR_HELPER("imx708", CameraSensorHelperImx708) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx708, "imx708") class CameraSensorHelperOv01a10 : public CameraSensorHelper { @@ -755,7 +751,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov01a10", CameraSensorHelperOv01a10) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv01a10, "ov01a10") class CameraSensorHelperOv08d10 : public CameraSensorHelper { @@ -768,7 +764,7 @@ public: exposureMargin_ = 6; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov08d10", CameraSensorHelperOv08d10) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08d10, "ov08d10") class CameraSensorHelperOv08x40 : public CameraSensorHelper { @@ -780,7 +776,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov08x40", CameraSensorHelperOv08x40) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv08x40, "ov08x40") class CameraSensorHelperMira220 : public CameraSensorHelper { @@ -793,7 +789,7 @@ public: exposureMargin_ = 6; } }; -REGISTER_CAMERA_SENSOR_HELPER("mira220", CameraSensorHelperMira220) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperMira220, "mira220") class CameraSensorHelperOv2685 : public CameraSensorHelper { @@ -808,7 +804,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov2685", CameraSensorHelperOv2685) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2685, "ov2685") class CameraSensorHelperOv2740 : public CameraSensorHelper { @@ -821,7 +817,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov2740", CameraSensorHelperOv2740) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv2740, "ov2740") class CameraSensorHelperOv4689 : public CameraSensorHelper { @@ -834,7 +830,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov4689", CameraSensorHelperOv4689) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv4689, "ov4689") class CameraSensorHelperOv5640 : public CameraSensorHelper { @@ -854,7 +850,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov5640", CameraSensorHelperOv5640) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5640, "ov5640") class CameraSensorHelperOv5647 : public CameraSensorHelper { @@ -865,7 +861,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov5647", CameraSensorHelperOv5647) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5647, "ov5647") class CameraSensorHelperOv5670 : public CameraSensorHelper { @@ -876,7 +872,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov5670", CameraSensorHelperOv5670) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5670, "ov5670") class CameraSensorHelperOv5675 : public CameraSensorHelper { @@ -889,7 +885,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov5675", CameraSensorHelperOv5675) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5675, "ov5675") class CameraSensorHelperOv5693 : public CameraSensorHelper { @@ -901,7 +897,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv5693, "ov5693") class CameraSensorHelperOv64a40 : public CameraSensorHelper { @@ -912,7 +908,7 @@ public: exposureMargin_ = 32; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov64a40", CameraSensorHelperOv64a40) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv64a40, "ov64a40") class CameraSensorHelperOv8858 : public CameraSensorHelper { @@ -929,7 +925,7 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov8858", CameraSensorHelperOv8858) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8858, "ov8858") class CameraSensorHelperOv8865 : public CameraSensorHelper { @@ -940,7 +936,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov8865", CameraSensorHelperOv8865) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv8865, "ov8865") class CameraSensorHelperOv13858 : public CameraSensorHelper { @@ -951,7 +947,7 @@ public: exposureMargin_ = 8; } }; -REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858") class CameraSensorHelperVd55g1 : public CameraSensorHelper { @@ -964,7 +960,7 @@ public: exposureMargin_ = 64; } }; -REGISTER_CAMERA_SENSOR_HELPER("vd55g1", CameraSensorHelperVd55g1) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd55g1, "vd55g1") class CameraSensorHelperVd56g3 : public CameraSensorHelper { @@ -977,7 +973,7 @@ public: exposureMargin_ = 75; } }; -REGISTER_CAMERA_SENSOR_HELPER("vd56g3", CameraSensorHelperVd56g3) +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperVd56g3, "vd56g3") } /* namespace */ diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h index a9e55c832da1..de3734810a62 100644 --- a/src/ipa/libipa/camera_sensor_helper.h +++ b/src/ipa/libipa/camera_sensor_helper.h @@ -56,7 +56,7 @@ private: class CameraSensorHelperFactoryBase { public: - CameraSensorHelperFactoryBase(const std::string name); + CameraSensorHelperFactoryBase(std::initializer_list names); virtual ~CameraSensorHelperFactoryBase() = default; static std::unique_ptr create(const std::string &name); @@ -70,15 +70,15 @@ private: virtual std::unique_ptr createInstance() const = 0; - std::string name_; + std::vector names_; }; template class CameraSensorHelperFactory final : public CameraSensorHelperFactoryBase { public: - CameraSensorHelperFactory(const char *name) - : CameraSensorHelperFactoryBase(name) + CameraSensorHelperFactory(std::initializer_list names) + : CameraSensorHelperFactoryBase(names) { } @@ -89,8 +89,8 @@ private: } }; -#define REGISTER_CAMERA_SENSOR_HELPER(name, helper) \ -static CameraSensorHelperFactory global_##helper##Factory(name); +#define REGISTER_CAMERA_SENSOR_HELPER(helper, name, ...) \ + static CameraSensorHelperFactory global_##helper##Factory({ name, __VA_ARGS__ }); } /* namespace ipa */ From patchwork Wed Nov 18 08:08:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 28959 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 284B3BDE17 for ; Wed, 18 Nov 2026 08:09:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B3F856A8B0; Wed, 18 Nov 2026 09:09:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i69kOejP"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2398A6A7EA for ; Wed, 18 Nov 2026 09:09:27 +0100 (CET) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c67:cdf:7464:6c04:36e4:ee87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 924354F1; Wed, 18 Nov 2026 09:06:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794989219; bh=Dh2h/w+X6P79GzGzlO6LgYVBBXbAIpfWaNyMNDL3vcY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i69kOejPpfj/2e4b3Dx8LWr67AJk0CvYWyoRVJ6AxyT+Z0Jay3uHWmulAQnSNqHNi nyzhxAFUg1sNZ281j5ghMYA3KWhgj14aWTtajPQDvTF4I/n0fSfyTokx9mL3IkSvxj 78QraaHc7jU4C3CNpX33qwQa88U9wUedcGaqLn5s= From: Jai Luthra Date: Wed, 18 Nov 2026 13:38:26 +0530 Subject: [PATCH v4 2/4] libcamera: camera_sensor: Add properties and helpers for Sony IMX675 and IMX832 MIME-Version: 1.0 Message-Id: <20261118-mainline-imx676-v4-2-48ae007f11b4@ideasonboard.com> References: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> In-Reply-To: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Dave Stevenson , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3165; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=Dh2h/w+X6P79GzGzlO6LgYVBBXbAIpfWaNyMNDL3vcY=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBq/V0lZnWDdBpSd5rPpEt+m9SGV81Otn/h8h85X vBM0pDCqY2JAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCav1dJQAKCRBD3pH5JJpx Rfl6D/9BlQvdsjxS3x6OjoxVc4BuGgkEwWI+djknNtUXwZHUbjd8VUlR3RBz3uvo2/9WI3eO9Up nJmoyiBeQpwHu73rA9PXvIahHfyhSu1yRPY621JsX9XSM+JSGBzMGyzMjMrbB4bQSZnBzv/LWLT zYMRQRRIBCpXExY4yscEtrY1nbaffUytlovVH0akLJnhqvJ0CzJ+kpEZwe/GBNDTxnUQyapAww8 pKqdJVz0otAsJflat/ah1BIQwzSKOT+Id5hVTEdo9zgpe9SS6QTLqVU+cNjAQ429akKsmdQ6p6y 2tjN3DzDKqQiEvImpLKwiemwwFQoD/SsfZYwi9D/Vtiza4dHRlVzLrcM8yVK8fs+F9sn7wO1+gz bWqedsryF++ij+ATXnOvrQVUZTnD2rWxn6cJC8yorEGgb2fxK7hn5L5Uo9a48EbpSLFsCkk8Igu GnXrPib80qW7cxgp/dNH72iEUr5RjtUFq28HRgpmUAq1za+jclHbJuwGmWJtMRKkBBMLbWtxiQP 1A1b+whJehu5QXrrJjmGO15r7+sP6MXDe5iwcgrwQNNfbS2CUuSFbml2qyA9o1X9Wnp4jBCHk1f rMjjMOHq2BLrRkkFp1p1C1t9+G52SGd5aZxKDdw1vo34wBMZ0yGPGOkuZZp31Wv7hY3z467MUPk tm5/6lPQVdr8v0A== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sony IMX675 (5.12MP) and IMX832 (2.12MP) are Starvis 2 sensors, with very similar properties to IMX662 and IMX678. Add the camera sensor properties for both. To my knowledge, all of these 4 sensors have the same black level and gain models. For convenience use the IMX678 camera sensor helper for all of these 4. This of course can change if differences are found later. Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck Signed-off-by: Jai Luthra --- src/ipa/libipa/camera_sensor_helper.cpp | 20 ++++++-------------- src/libcamera/sensor/camera_sensor_properties.cpp | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index b106070c49d2..770fc474254d 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -702,19 +702,10 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477") -class CameraSensorHelperImx662 : public CameraSensorHelper -{ -public: - CameraSensorHelperImx662() - { - /* From datasheet: 0xc8 at 12bits. */ - blackLevel_ = 3200; - gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) }; - exposureMargin_ = 4; - } -}; -REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx662, "imx662") - +/* + * Reusing CameraSensorHelperImx678 for multiple sensors, for convenience. + * They may need to be split apart if any differences are found later. + */ class CameraSensorHelperImx678 : public CameraSensorHelper { public: @@ -726,7 +717,8 @@ public: exposureMargin_ = 4; } }; -REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx678") +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx678, "imx662", "imx675", + "imx678", "imx832") class CameraSensorHelperImx708 : public CameraSensorHelper { diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 20cfd0bc11a6..9dde76937a28 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -350,6 +350,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 2 }, } }, + { "imx675", { + .unitCellSize = { 2000, 2000 }, + .testPatternModes = {}, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "imx678", { .unitCellSize = { 2000, 2000 }, .testPatternModes = {}, @@ -376,6 +386,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 3 }, } }, + { "imx832", { + .unitCellSize = { 2900, 2900 }, + .testPatternModes = {}, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "ov08d10", { .unitCellSize = { 1120, 1120 }, .testPatternModes = { From patchwork Wed Nov 18 08:08:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 28960 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 44A80BDE17 for ; Wed, 18 Nov 2026 08:09:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E52246A8A8; Wed, 18 Nov 2026 09:09:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bv0U6hcw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DAD016A89F for ; Wed, 18 Nov 2026 09:09:32 +0100 (CET) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c67:cdf:7464:6c04:36e4:ee87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59ED663C; Wed, 18 Nov 2026 09:07:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794989224; bh=hsIWm8+KeVfgzDua5gAVOT8oJU/aL1zzCWhpbiizyQE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bv0U6hcwLTqbFncwnsEpBaYYSzTo4JnKVjAFwC2sXe2TBpojjEk0xTh2zwgF+HuXP lYDoDlitJw34gKDxTjLxQulyHEnFB7R1/ICiqbfqSoz1FDwnsNUMyJiP/NmgQLsmJU KvHFwihA+G41Ild9WPgczhq8K5TrjoP8tEZIDBTQ= From: Jai Luthra Date: Wed, 18 Nov 2026 13:38:27 +0530 Subject: [PATCH v4 3/4] libcamera: camera_sensor: Add properties and helpers for Sony IMX585 and IMX676 MIME-Version: 1.0 Message-Id: <20261118-mainline-imx676-v4-3-48ae007f11b4@ideasonboard.com> References: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> In-Reply-To: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Dave Stevenson , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2933; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=hsIWm8+KeVfgzDua5gAVOT8oJU/aL1zzCWhpbiizyQE=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBq/V0m4UG745MXV4XRywTOZbPNFufADBUVVnqen FQlhY34OuyJAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCav1dJgAKCRBD3pH5JJpx RVQYD/9Yt46pKu5IXsnhkmKGKqVHwESOfTDjoui84L7NVttcco0hCUWGUEu4KNQ0g7MexPPrecx ZD75ysz3JhT+fZnG1O69d8cfYs09JpHqKt09DvNqWAtdPMsFKpB212w2RBtFPHrYUYKh//l4HKR rnWtgG4Cz8/pcVq6fQBuBvl4sfQ6vxzx/CT2ou+s29sMhH70nBSRuytERwnc0J8SvhaZIGVUnRD DXvFigEBYIgGZzmWcDf1sF2VbE1P2oTIFfx0HPwCAwoCsEssjhzI4begWwZEZL7qZmLB38AKXNA IJUFkYlvbBue+ch7uD5gqt1nrPwLbxF8sw4qY5FuYgZGSw9C2B9UAvpAqoMWAj3J4ShWZHMxI6V d5P6Uc+ODPNDj5nZFZYbpozv5W6n06FYMuwp76RyW6aOAtKynv4CeYlmBoJ7VkSivzI3prpKRSa e2nk5tTlmUM68D/+Sbi8qT2nTKGm8XEDB8iEI52kXbipeCgfUH7jwO8h6XXqge8wV8wvjiHWr1T f8SkVyno/9J729nb4w9yoJgg8BQYLJ1y/cf1H/FuSfTB9GCwRitt/mqhN44C9vpzQLALAPN2oB3 /RbZVmAffRQqzLFq/1yIspTxwcs+KQa+KhQR6+EPkyBHx1RyasALfvhRZU6pBe3Ip4Jrbe5t8wJ bX+LL2Noxu7VWuQ== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sony IMX585 (8.4MP) and IMX676 (12.6MP) are Starvis 2 sensors, with similar properties to the rest. Add camera sensor properties for both. While they share the gain model with others, they differ on the minimum value for the shutter register (SHR0), which is 8 instead of 4. So define a separate camera sensor helper class to support these two sensors with exposure margin of 8. Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck Signed-off-by: Jai Luthra --- src/ipa/libipa/camera_sensor_helper.cpp | 17 +++++++++++++++++ src/libcamera/sensor/camera_sensor_properties.cpp | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 770fc474254d..c5c8a447567f 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -702,6 +702,23 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx477, "imx477") +/* + * Reusing CameraSensorHelperImx585 for multiple sensors, for convenience. + * They may need to be split apart if any differences are found later. + */ +class CameraSensorHelperImx585 : public CameraSensorHelper +{ +public: + CameraSensorHelperImx585() + { + /* From datasheet: 0x32 at 10bits. */ + blackLevel_ = 3200; + gain_ = AnalogueGainExp{ 1.0, expGainDb(0.3) }; + exposureMargin_ = 8; + } +}; +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperImx585, "imx585", "imx676") + /* * Reusing CameraSensorHelperImx678 for multiple sensors, for convenience. * They may need to be split apart if any differences are found later. diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 9dde76937a28..fbe82d47bd10 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -340,6 +340,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 3 }, } }, + { "imx585", { + .unitCellSize = { 2900, 2900 }, + .testPatternModes = {}, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "imx662", { .unitCellSize = { 2900, 2900 }, .testPatternModes = {}, @@ -360,6 +370,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 2 }, } }, + { "imx676", { + .unitCellSize = { 2000, 2000 }, + .testPatternModes = {}, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "imx678", { .unitCellSize = { 2000, 2000 }, .testPatternModes = {}, From patchwork Wed Nov 18 08:08:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 28961 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DCE0ABDE17 for ; Wed, 18 Nov 2026 08:09:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90D9D6A8AD; Wed, 18 Nov 2026 09:09:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aGsmfapQ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9CFFA6A89F for ; Wed, 18 Nov 2026 09:09:37 +0100 (CET) Received: from mail.ideasonboard.com (unknown [IPv6:2401:4900:1c67:cdf:7464:6c04:36e4:ee87]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 35E3D4F1; Wed, 18 Nov 2026 09:07:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794989229; bh=H4T9IBgsjt68V2J8s3/eJo8blOsfn1GM9M63JEz8m7o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aGsmfapQTx1isoyir0TqrSGtYQpX9qpvSGWwsD3APoyBwaEQU6Xmd7umcUIf5tG0l wKq1ckBQZfbdYff/5/yLZPeqBimkh1xtO3yT6ti5zOccgf/ATduh/MSelRDDww/oIQ bJyTfDgO7thohv0EPv1kAsuHxi6GAwNJA/s7ABtI= From: Jai Luthra Date: Wed, 18 Nov 2026 13:38:28 +0530 Subject: [PATCH v4 4/4] ipa: rpi: cam-helper: Support IMX585 and IMX676 MIME-Version: 1.0 Message-Id: <20261118-mainline-imx676-v4-4-48ae007f11b4@ideasonboard.com> References: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> In-Reply-To: <20261118-mainline-imx676-v4-0-48ae007f11b4@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , Laurent Pinchart , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Dave Stevenson , Jai Luthra X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2206; i=jai.luthra@ideasonboard.com; h=from:subject:message-id; bh=H4T9IBgsjt68V2J8s3/eJo8blOsfn1GM9M63JEz8m7o=; b=owEBbQKS/ZANAwAKAUPekfkkmnFFAcsmYgBq/V0n5C5PBYu0KOQFSeFxJ4yc+/3rYbRnOnC3r nYPE9FlnLqJAjMEAAEKAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCav1dJwAKCRBD3pH5JJpx RVoGEACwcO9AwrzVgqYxPuu8c3n3venoW9EFza254hvsDVm/5C06P//7l5aC2WnrrVRm4Io7WlY 9OhXeliqNoy1dclNJuW82jioCm32V+/yCyqS4FkjkL4NKNi2rS09TuhPVOSHUVAe/30i99G30oV TufXB22/7A8R9C7ZNAM6kw7pXO/DNl10JHivWwrP6ROuxkARNB4vH4+jJslnLJM/8x3b7CI0T/x 2LzFVw+k2TWcyZ19ujmakyCmin+tFSGHPl/gy6aaSDqxcsqbc8C2mqnsIwpwCGBXSAqprddfNGg 1QUw5FHL2+OfjeZUR0Em4NekKGOFc1orqfgS/VTFoQhPECPKg3Hh8LZ9BxYTAtRSHnnDnBki3mH eE0qo3w0OK4kWUps9G0YZeYWQqYTprT83tAhRUJhRt1ESy657FbN6SkUhMwxGQ0EbQII/+xDhar bVv786w+Ei1LduMQxN7USuVxLpbgwr0/dM4X2D53OPZEVyB/mm0gLGfQlqts76cYpwtDZvYSE3Y Fi5HqN3uYNGKny4aev8aSDM8KISpD7JUwX251JWsQmoakMuYgr4Qvc6yKidf2u91h52HpDn7AN0 AFNoDIltBPnkxpu8J2xr5In3zwoGGOpNy2rotT5mwnzBgPFH+OHBCreG+hhegypi866JJ+MuIBN dCh41Cc+ZLqMuog== X-Developer-Key: i=jai.luthra@ideasonboard.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sony IMX585 and IMX676 are also Starvis 2 sensors, with same gain model as rest of them. The integration time constraints are different, as the SRM specifies the shutter reigster minimum to be 8 (in units of 2H) as opposed to 4 (in units of 1H). Add support for both through the existing Starvis 2 helper, handling the integration time explicitly during registration. Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck Signed-off-by: Jai Luthra --- src/ipa/rpi/cam_helper/cam_helper_starvis2.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ipa/rpi/cam_helper/cam_helper_starvis2.cpp b/src/ipa/rpi/cam_helper/cam_helper_starvis2.cpp index a2f01bbc8370..07e77b939ec2 100644 --- a/src/ipa/rpi/cam_helper/cam_helper_starvis2.cpp +++ b/src/ipa/rpi/cam_helper/cam_helper_starvis2.cpp @@ -17,7 +17,7 @@ using namespace RPiController; class CamHelperStarvis2 : public CamHelper { public: - CamHelperStarvis2(); + CamHelperStarvis2(unsigned int frameIntegrationDiff = kFrameIntegrationDiff); uint32_t gainCode(double gain) const override; double gain(uint32_t gainCode) const override; @@ -26,10 +26,10 @@ private: * Smallest difference between the frame length and integration time, * in units of lines. */ - static constexpr int frameIntegrationDiff = 4; + static constexpr unsigned int kFrameIntegrationDiff = 4; }; -CamHelperStarvis2::CamHelperStarvis2() +CamHelperStarvis2::CamHelperStarvis2(unsigned int frameIntegrationDiff) : CamHelper({}, frameIntegrationDiff) { } @@ -50,8 +50,16 @@ CamHelper *create() return new CamHelperStarvis2(); } +CamHelper *create585() +{ + /* IMX585 and IMX676 manuals specify the minimum for SHR0 as 8 lines */ + return new CamHelperStarvis2(8); +} + +RegisterCamHelper reg585("imx585", &create585); RegisterCamHelper reg662("imx662", &create); RegisterCamHelper reg675("imx675", &create); +RegisterCamHelper reg676("imx676", &create585); RegisterCamHelper reg678("imx678", &create); RegisterCamHelper reg832("imx832", &create);