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 = {},