From patchwork Thu Sep 5 20:47:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Apitzsch?= X-Patchwork-Id: 21167 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 755AAC324C for ; Thu, 5 Sep 2024 20:49:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7D5B3634CB; Thu, 5 Sep 2024 22:49:14 +0200 (CEST) Received: from smtprelay08.ispgateway.de (smtprelay08.ispgateway.de [134.119.228.109]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C97946345D for ; Thu, 5 Sep 2024 22:47:22 +0200 (CEST) Received: from [77.64.252.226] (helo=[192.168.1.141]) by smtprelay08.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1smJNy-000000001oP-0DBM; Thu, 05 Sep 2024 22:47:22 +0200 From: =?utf-8?q?Andr=C3=A9_Apitzsch?= Date: Thu, 05 Sep 2024 22:47:46 +0200 Subject: [PATCH] libcamera: libipa: camera_sensor: Add Sony IMX214 sensor properties MIME-Version: 1.0 Message-Id: <20240905-imx214-v1-1-740caf6fb0a9@apitzsch.eu> X-B4-Tracking: v=1; b=H4sIAPEY2mYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDSwNT3czcCiNDE11zSzNLY8ukFBNT42QloOKCotS0zAqwQdGxtbUAOoG d4lgAAAA= To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Andr=C3=A9_Apitzsch?= X-Mailer: b4 0.14.1 X-Df-Sender: YW5kcmVAYXBpdHpzY2guZXU= X-Mailman-Approved-At: Thu, 05 Sep 2024 22:49:13 +0200 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" Provide the Sony IMX214 camera sensor properties and registration with libipa for the gain code helpers. Signed-off-by: André Apitzsch Reviewed-by: Kieran Bingham --- src/ipa/libipa/camera_sensor_helper.cpp | 13 +++++++++++++ src/libcamera/sensor/camera_sensor_properties.cpp | 10 ++++++++++ 2 files changed, 23 insertions(+) --- base-commit: f75b8dd26feaca86701704390dea18c71e2f0350 change-id: 20240905-imx214-796939bd453c Best regards, diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index ffc7c1d7..f3289b1c 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -519,6 +519,19 @@ private: }; REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521) +class CameraSensorHelperImx214 : public CameraSensorHelper +{ +public: + CameraSensorHelperImx214() + { + /* From datasheet: 64 at 10bits. */ + blackLevel_ = 4096; + gainType_ = AnalogueGainLinear; + gainConstants_.linear = { 0, 512, -1, 512 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("imx214", CameraSensorHelperImx214) + class CameraSensorHelperImx219 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 4e5217ab..6d4136d0 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -88,6 +88,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen */ }, } }, + { "imx214", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + { controls::draft::TestPatternModeSolidColor, 2 }, + { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, + { controls::draft::TestPatternModePn9, 4 }, + }, + } }, { "imx219", { .unitCellSize = { 1120, 1120 }, .testPatternModes = {