From patchwork Sun Oct 18 10:27:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Predel X-Patchwork-Id: 28501 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 01AF1C3261 for ; Sun, 18 Oct 2026 11:25:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A2B6968E5E; Sun, 18 Oct 2026 13:25:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="phxkaQwg"; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87DD468955 for ; Sun, 18 Oct 2026 12:27:03 +0200 (CEST) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4a1b07c3c5fso13598435e9.1 for ; Sun, 18 Oct 2026 03:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792319223; x=1792924023; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=brtTzT17J/FcL3jrVyJol6JcBR2kdZPrXIpdQq+RNN4=; b=phxkaQwgNptqcjjNK/t95MUEDRrINVpbrIngWiY1cd+GPgGis4qdujCzvdIhevhqMD b3jQ/YV0eZNHoQYx/ozGiDyy/g8KyZjVHGToWiW+0NUD3beLd1DnQXYiqs7nU5sc8GE8 oa4xlaRwA4LUvEKwUtWddjF/hibQEAqIpjmHidb8ixqrp3iPYlVJtNKlZ+RkZNoWZOap W/nt4NNpbQPX3KLvT5AOPqdJzLgsZeK8s3UGP3To2teRHtn/vfOtR32OXI7BMgjlo1mb M52fq4zgjwRFKVRom/AKDT2Jef03YiDksRr9p6KV7/qnUa216yIQPWgg+IVxKXs9MKFn +Ruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792319223; x=1792924023; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=brtTzT17J/FcL3jrVyJol6JcBR2kdZPrXIpdQq+RNN4=; b=bSFxRcBEs3kDCwAbM11JMckFGpTbKVbNbuI2Q1PclTg+NHVAOcsaGwdod9wIWbVU6P Q55ON7W3B2FDMo0+tM76crItpmPxI4+zdlRCx7ix5IJxm+dm0R8x7rqoBG2zgk9wuelc Bump7UiACJcP+H7VuiG4CAIZjQ4HfbbqIOF0070z4qvFs6gxo+76lp7qj9B7QYnHmOfA L6dZwSlv6u6eadF5GcZYXudACyaWfePlMPihiFT4JaYOaGAQS9mbt8KG6iSoInzPbNIa VQE2Ir9yh8N2sBi1vEF66Fto2zGbUARINXFHtG+32uvZj8j1J8ZCj419dezXKwSekHHA 6Xiw== X-Gm-Message-State: AFq9FYKuEkAnOdcWlNeYGVZ/JWUKBSCbXJj7vfEoqEPOgDOj0T6bZ+Cd BzpDbMy3O6xPC76Qcfjx9Kw4kLe8lxugeiBMvSI1JFDZPBBs7As0YY8KvBHC4g== X-Gm-Gg: AYBFou2aijnbV1HzohSPJMHdMa8V8oPTmJK4HF0Mf8iNxrhk8afpCHQvgdOWwT2r4iZ OPiVXWnBwc40BZl/odLDLHFekbGEGARJZ+m3fmxdK5n3a/Dzj6M07qAXxdul3Yq4rX+g35xnmeM C44FrZWhA6GlmiOtDiEBJt/OUEVg6um0jfOjeSMa899C/taB2Fu6sOXTED4kV7beMScRsJcBJ0B WYS3Fg4MvB7jsbVjAtHFPBcq/0zSXargBm5/YKe/XK3Qz7LpaLpu8U9ESbiI+VXarCUJPw1BXB6 xFp8QipEX0NnRqMv8M6b4DJPsHCsl4heEDLROsv+KKlvLxcWivwTlYEYodmkQQJvIerJvkESyBV Qks/Y0EVmurrxbs8Dk7pGyJtr549hC51fbLe3YaEteUYc+6A6jaU7SqQaDMgQPmeLKrgkUZTI8r makt4uyeHLL19vk5qShXGQ7V9cS5LtKZDBS0YRvOPpeLiQzYFYnHoD70tqQeWMAq3rndNNrhas X-Received: by 2002:a05:600c:8b22:b0:4a1:8627:aec7 with SMTP id 5b1f17b1804b1-4a1d75e6fe3mr100192105e9.5.1792319222858; Sun, 18 Oct 2026 03:27:02 -0700 (PDT) Received: from archlinux ([178.197.200.30]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48dfd4f8cfesm14098352f8f.37.2026.10.18.03.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2026 03:27:02 -0700 (PDT) From: Tobias Predel To: libcamera-devel@lists.libcamera.org Cc: Tobias Predel Subject: [PATCH] libcamera: camera_sensor: Add Hynix Hi556 sensor properties and helper Date: Sun, 18 Oct 2026 12:27:00 +0200 Message-ID: <20261018102700.32980-1-tobias.predel@gmail.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 18 Oct 2026 13:25:01 +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" Add camera sensor properties and a camera sensor helper for the Hynix Hi556, a 5MP sensor used as the user-facing camera on IPU6 laptops such as the HP Dragonfly 13.5 inch G4. The unit cell size is 1.12um. The test pattern modes follow the order of the menu exposed by the kernel driver, the same as for the Hi846. The black level was measured on raw 10-bit frames as the intercept of a linear fit of the mean pixel value against exposure time, at analogue gain codes 0 and 64 (63.95 and 64.20 respectively), giving 64 at 10 bits. The kernel driver exposes analogue gain codes 0 to 240 in steps of 1. The gain is 1 + code / 16, giving 1x to 16x. This was verified on raw frames of a static scene, with a gain code 0 reference frame captured before and after each step to cancel out light changes: the measured gain is within 1% of the model for codes 0 to 224, and 1.5% below it at code 240. Without the helper, the soft ISP falls back to the uncalibrated defaults and cannot convert between gain codes and gain values. Signed-off-by: Tobias Predel Assisted-by: Claude:claude-opus-5-5 --- Notes: Tested on an HP Dragonfly 13.5 inch G4 (Hi556 on IPU6 ISYS, simple pipeline handler with the soft ISP); the runtime log confirms that the helper and the sensor properties are picked up. This patch was written with the help of an AI coding assistant (hence the Assisted-by trailer, following the Linux kernel's coding-assistants guidelines; checkstyle doesn't know that trailer key yet). I reviewed the code and ran the measurements on the hardware myself. src/ipa/libipa/camera_sensor_helper.cpp | 13 +++++++++++++ .../sensor/camera_sensor_properties.cpp | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 359040ec7..87d72afa0 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -519,6 +519,19 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3) +class CameraSensorHelperHi556 : public CameraSensorHelper +{ +public: + CameraSensorHelperHi556() + { + /* Measured: 64 at 10bits. */ + blackLevel_ = 4096; + /* Analogue gain is 1 + code / 16, codes 0 to 240 (1x to 16x). */ + gain_ = AnalogueGainLinear{ 1, 16, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("hi556", CameraSensorHelperHi556) + class CameraSensorHelperHm1246 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 20cfd0bc1..203ffb382 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -132,6 +132,24 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen .hblankDelay = 2 }, } }, + { "hi556", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeSolidColor, 1 }, + { controls::draft::TestPatternModeColorBars, 2 }, + { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, + { controls::draft::TestPatternModePn9, 4 }, + /* + * No corresponding test pattern mode for: + * 5: "Gradient Horizontal" + * 6: "Gradient Vertical" + * 7: "Check Board" + * 8: "Slant Pattern" + */ + }, + .sensorDelays = { }, + } }, { "hi846", { .unitCellSize = { 1120, 1120 }, .testPatternModes = {