From patchwork Fri Sep 12 09:13:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fend X-Patchwork-Id: 24348 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 67771C324E for ; Fri, 12 Sep 2025 09:13:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1886869367; Fri, 12 Sep 2025 11:13:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=emfend.at header.i=@emfend.at header.b="UJrnqmyE"; dkim-atps=neutral Received: from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 372F3613A3 for ; Fri, 12 Sep 2025 11:13:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yLTAwkxtpLTzJo5b8kubNBsgAoAh5RqD7FmDObt7nug=; b=UJrnqmyEq3UB55wVIsUArUewnt D56mGaR6PtOsDcFjEr+OTZRChKPys40R3ObTbeE9NgMR5c0qfoGrTMwVa7vhymdyWh9tdzUj3f68w OnjvJKezQzxR85VJhu6CjyA3VvYyI9CKzHIXETo/IIKRowkg3lqyeeMU13xyLPcZuayc=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:49839 helo=[127.0.1.1]) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1uwzqT-009jJH-6d; Fri, 12 Sep 2025 11:13:29 +0200 From: Matthias Fend Date: Fri, 12 Sep 2025 11:13:25 +0200 Subject: [PATCH] libcamera: libipa: camera_sensor: Add Himax HM1246 sensor properties MIME-Version: 1.0 Message-Id: <20250912-hm1246-v1-1-58c814f52a26@emfend.at> X-B4-Tracking: v=1; b=H4sIADTkw2gC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI1MDS0Mj3YxcQyMTM11TU1ODJJMU0xRDs1QloOKCotS0zAqwQdGxtbUAZlL Nz1gAAAA= X-Change-ID: 20250912-hm1246-5550b4d5d16e To: libcamera-devel@lists.libcamera.org Cc: Matthias Fend X-Mailer: b4 0.14.2 X-Spam-Score: X-Spam-Bar: X-Spam-Report: 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 Himax HM1246 camera sensor properties and registration with libipa for the gain code helpers. Signed-off-by: Matthias Fend Reviewed-by: Kieran Bingham --- The Himax HM1246-AWD is a 1/3.7-Inch CMOS image sensor SoC with an active array size of 1296 x 976 and parallell interface. The sensor has an integrated ISP that is not supported by the kernel driver. The sensor is therefore operated like a normal sensor in raw mode. The kernel driver required for this is currently under review [1]. [1] https://lore.kernel.org/r/20250912-hm1246-v3-0-3b89f47dfa43@emfend.at --- src/ipa/libipa/camera_sensor_helper.cpp | 10 +++++++ src/libcamera/sensor/camera_sensor_properties.cpp | 32 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) --- base-commit: b8d332cdcc130c27232f61369e7bab2d954e7ac6 change-id: 20250912-hm1246-5550b4d5d16e Best regards, diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index dcd69d9f2bbb39feabfefe41cee8b45f0f958127..df93c0fdeb9c5ae2c3e3dc51dabc62ba4082c0d7 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -497,6 +497,16 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3) +class CameraSensorHelperHm1246 : public CameraSensorHelper +{ +public: + CameraSensorHelperHm1246() + { + gain_ = AnalogueGainLinear{ 1, 16, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("hm1246", CameraSensorHelperHm1246) + class CameraSensorHelperImx214 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index f2da8205372baabca58416e2c0f9da64e722fe02..810f0199d41f0582e120687b304c3ff549a19bc8 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -151,6 +151,38 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen }, .sensorDelays = { }, } }, + { "hm1246", { + .unitCellSize = { 3000, 3000 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + /* Solid white. */ + { controls::draft::TestPatternModeSolidColor, 6 }, + /* The six vertical bars (left-to-right) are as follows: black, + * blue, red, magenta, green and cyan. + */ + { controls::draft::TestPatternModeCustom1, 5 }, + /* + * No corresponding test pattern mode for: + * 1: "Checkboard" + * 2: "Ramp" + * 3: "Moving ones" + * 4: "Blending color bars" + * 7: "Solid black" + * 8: "Solid red" + * 9: "Solid green" + * 10: "Solid blue" + * + * Even though the sensor supports color bars and faded color bars as test patterns, these are + * not offered because these patterns do not meet the expected properties. + */ + }, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "imx214", { .unitCellSize = { 1120, 1120 }, .testPatternModes = {