From patchwork Tue Dec 1 11:23:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tuan Kiet Huynh X-Patchwork-Id: 29128 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 434D5C3300 for ; Tue, 1 Dec 2026 11:23:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BDDEC6AAC9; Tue, 1 Dec 2026 12:23:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jZlZM46c"; dkim-atps=neutral Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C26B86AAB5 for ; Tue, 1 Dec 2026 12:23:10 +0100 (CET) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2f037bc348dso90908615ad.0 for ; Tue, 01 Dec 2026 03:23:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796124189; x=1796728989; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Hrj+v1mgFOpehThznT2e+B4FWMOo9xLX7bGTCxoXHy4=; b=jZlZM46cSEeL37KwbvFOKMLDqe7XU5MJ11lxEz2G56tYpXUemT/LUETnU7WrPVV7Fb /GKgD+NRFAOLUhcQYVOh/Y1O/41EfCcgPAQsr80I5uqW2mVQjmGS2j1hsp3wK3vOCsJ1 haozta86rfOXtehby5Qg/q2xNQtDUkaQ0Lt8JwsyUWQ4gJkcUxzSQxNGU+ogn3fLIqp0 dhRtdBXt5ufMXHgNp8q3878+1O8Qkgd64PtX7efRuXpqdgNlWB9InTR67Ez+x0O5R546 WXcgAgdrPXMCeHJq+oQ2uwcz7R/X3S54AfOzIxDmFT6ARp/COWd6bJxbUO5m8D33r7/u KV3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796124189; x=1796728989; h=content-transfer-encoding:mime-version:references:in-reply-to :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=Hrj+v1mgFOpehThznT2e+B4FWMOo9xLX7bGTCxoXHy4=; b=amsBQQODmpkrAQ6osRY3hillgZy6DMWjjX2bl0Wp3V5YUbLVUfuYRZ9xLRFNjrdUpr StOeBz3tM/Ud1QOXDaXzhSOxkPJCKM5MyM8naw6wA+y//chpvfpq+48HYUoJM1VVo7U/ 3kzLFjgaQaCj2qYB0bz0O7Yqhsw0thMl5xAuhChoQswdRq0TfEv8FbTSu8LF+/r+AzfN hipHVZqiLx4t8kkrnnioODijas580tir7xq8y1lO3AmDyeiqVCrwWhKSmII4yxHTy4ic J5cYBZ9xAAYSHg5sKVFYCvJQJli26hRfP9j9KwPA+f6wj/4eKWdzhDyyu1Z3n494Dgux /l5Q== X-Gm-Message-State: APuU4Z9sXi6hnEFAaHYlqwaMwjau07dtUSFPUDR32fxQROpnYW+yCdBz xKDtQs+LhKtqPtrEtHFjLtbJogh+EqApMG5ym/WlLGCsCP7oUkcSzRk7kF2n9fXBrFfXrQ== X-Gm-Gg: AZFdTZfDimjqyubV3+7WVJfv5Obyj9tgGqYWnjjPi8b2izz27feB9a3HV0wmLkRkcSY 9PXOjztuaAM8LXGCROXLVA/GUO/jNYuMCJV8TRoxn2cSHV1dqsKgtcbBE9dvWgTuHZC0dIWqjVM 2sB1GBblI6OUVWZSAxKtXqtLk9joxqXBTaMvEEAJlD0qN8TfgPbJIJnyUO/tpm8QbMm5IYauRA2 AH7VD8RT93wiDbCeIHz5Ak+ahl03njyRkRKCsxW3KZOchOhCusXiI0wq0m2LUKH0c3FcSkaXeqy ZSZCJI/40g5K8oHVbPGVrszbxhX0mwVmZ77t19xAAcddZ9Z1kPsjOPR5LJZtWqSNihT0VpgvR+S 0e3rUn4/d5OUKFXWIHGU9pfoZpFZDYBM6uONqmIKkkkkJ1W8kaQj1478knS5n+/TtVZhrldGuxi he2BnahnACANxxPTeGO1j4UY01jBdnX0ppgy2V99hYnfoto57c1xAMagcIrU1VWVIHDo4Ii2dDu LgyX1zL/PCp/IKm15LyMlSjqoZfQAjgjv/iDfL9H1ip5IWfPlhbG5w8Af97kNKM0WoGAx7D24Jb eNF9ZZmJtV1JkdUkLkXrC9xx9wl4HDJjgwQtw6aeW45qLtoNVQNWQdDo0JOcTNU3s9rAUrcxJBr TLS5wEdPZlCce6czIvAeXBXDPOs0= X-Received: by 2002:a17:902:e5c5:b0:2ed:a96:8a03 with SMTP id d9443c01a7336-2f03f27e77amr349234975ad.55.1796124189053; Tue, 01 Dec 2026 03:23:09 -0800 (PST) Received: from default-vnic.defaultvcn.oraclevcn.com ([161.118.211.100]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0457fd68dsm169955545ad.39.2026.12.01.03.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 03:23:08 -0800 (PST) From: Tuan Kiet Huynh To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Tuan Kiet Huynh Subject: [PATCH v3 1/2] libcamera: sensor: camera_sensor_properties: Add Samsung S5K5E8 Date: Tue, 1 Dec 2026 18:23:02 +0700 Message-ID: <20261201112304.3425319-2-huynhtuankiet33@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261201112304.3425319-1-huynhtuankiet33@gmail.com> References: <20261201112304.3425319-1-huynhtuankiet33@gmail.com> MIME-Version: 1.0 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 Add static sensor properties for the Samsung S5K5E8 5MP CMOS image sensor (1.12 um pixel pitch, test pattern modes 0..4 including PN9, and hardware-verified control delays on Xiaomi Redmi Note 4X where analogue gain takes effect 1 frame earlier than exposure and vertical blanking). The kernel driver for this sensor was submitted separately to linux-media: Link: https://lore.kernel.org/all/20261201110235.3327189-1-huynhtuankiet33@gmail.com/ Reflow only: the vblankDelay comment is re-wrapped to stay within 80 columns; no content change. Signed-off-by: Tuan Kiet Huynh --- .../sensor/camera_sensor_properties.cpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index fbe82d47..16f17b09 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -611,6 +611,42 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen }, .sensorDelays = { }, } }, + { "s5k5e8", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeSolidColor, 1 }, + { controls::draft::TestPatternModeColorBars, 2 }, + { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, + { controls::draft::TestPatternModePn9, 4 }, + }, + /* + * Frame delays, counted from the S_CTRL that applies + * them. The S_CTRL is issued during frame N+1, after + * DQBUF(N). Measured on the Redmi Note 4X (3 trials + * each): the first frame showing the change is N+3 + * for exposure (900 -> 1964 lines) and for vblank + * (24 -> 1968, frame period 33.5 -> 66.5 ms), and + * N+2 for gain (32 -> 128), so the delays are 2, 1 + * and 2. hblankDelay is unmeasured and carried over + * as 2 from v2. The driver does expose HBLANK, but + * read-only (264 lines full mode, 1480 binned), and + * the RPi pipeline registers it in DelayedControls, + * so the delay is consumed there; it has no visible + * effect on mido's simple pipeline. vblankDelay must + * not be less than exposureDelay: DelayedControls + * writes a shorter-delay control a frame later, so + * the new exposure would be written while the old + * vblank still bounds it, and the V4L2 control core + * would clamp it to the old maximum. + */ + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 1, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "vd55g1", { .unitCellSize = { 2160, 2160 }, .testPatternModes = { From patchwork Tue Dec 1 11:23:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tuan Kiet Huynh X-Patchwork-Id: 29129 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 DD3CFC3355 for ; Tue, 1 Dec 2026 11:23:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE05E6AAB8; Tue, 1 Dec 2026 12:23:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="xgKZG8zC"; dkim-atps=neutral Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B1656AAB5 for ; Tue, 1 Dec 2026 12:23:12 +0100 (CET) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2f066274caeso58170715ad.2 for ; Tue, 01 Dec 2026 03:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796124190; x=1796728990; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vXlHaF629wKHcBIJemLEpvRyaRuOPrtQw5Ue/+pdH8w=; b=xgKZG8zCc5V3SIRNLuwTQW0+hc0Q1lzHNSY5ve9HbiGwziLr9/j0nVFFQ22+WZW6vr N0dyh5KbsXWC5aFR6HTHBRk3MaiALaf+l1gSSixZm/64hXXZdkwiqwU8n0H7VXAn9nX4 5GGNTJxMaoptExF6yzXBNM8CLtIJ99YtGtNdzCn7rhe23tn8rDE/JFDBO7avmIfWnioE YdkR/ZrHZvX3T9jofiwnT339pwyc6BbzRZgLx1nzi28ya3vtYQhstayo6FYC84VXwIoY 7OF3eKFhE0BnghXiVWunYI04K6bs5yTC8T1DN+AX1Illm2n1WwJvOy+B91x1xMbGUraw 7iFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796124190; x=1796728990; h=content-transfer-encoding:mime-version:references:in-reply-to :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=vXlHaF629wKHcBIJemLEpvRyaRuOPrtQw5Ue/+pdH8w=; b=Mvx7YG7efm/fKlxj8oasd0aTj9wPj1Y034MhPnZb4YbRwt/2RKtjrI/XRYkD0buoQr 2znEtihIAkQgVPBwovwyeA89/Yab2rPQpl0mt1LubZMC0qclGH7O/OWfs78QfiOmglbG 90SxBK+8siNVLlBHONmCwlffauvp59j/cdPTa5xG2Z/82Kg/D34cWXpMzmXPCZmy0gU9 Sy0yejEnFN7ln1ZUaipKpe1CcYwoOQ/oWJA1YudysGOof1dcWzMkO5o403nKwbz+Q0LE w+JCEdJUXhyxrUJl4XpIuOL5SGgoB63YVnqLiLhsCWyPtA7jVc5ovXgmSg4pO/LSVqUG oWFQ== X-Gm-Message-State: APuU4Z+J5ya1xdGpDhR/7zh9z+iXJrje02hML/S00A6aONfLQxDICqVk x4Qib/YZm2uEH/Zpih4Ht9VyCIFSgscpp/bsaRs3Jwy8riF54SDlHy0Mck9b9kv9 X-Gm-Gg: AZFdTZdzyJLzzqhSOTOTKocO+4T7omhKKc61R5RDPrg4zdoRgw8Sy/fSuYZXsEwEjW2 BLPuNRaL9Epuz3tz395+ymoyMGrbWf7uBgHXB5mDxXTZJ9O2Vso9VhCzcjjqH0Fk/oZKIJRgB32 9w541JpcxgkUTXzslV5lgEblmJma6Hoz4n3sBc+yAloMMy4JowaR96VE/VxfufoQXRRTnXlGXXH L3M94vMhyACCxBNXH9+4NjSn0Y5u99XTKZauANmCisMXVueXJ/2svIoV0/Jm5FPPBjjNb4/Zlf1 LA/45LaM5AEG/TvanXfjJwSUKa89VV3gh77QUF2yvsKpPoYXk4whKfYXEmSWjF4YRD2sBrJ/FkB H6ML/J6cPGAenj4c1ejRzyC6y3hBFK0ebxWxFWS9qD9QN427Kd38hs3zUec/qp7/TuSYhZ1nzGx TjMKHTd3S/xFw3gi2HCat+yCSZ7+lheKt+K7FHk10lMJGef6JbBmwPB+T3lolBogNfBmfoipZbw o9DMKKAHD5h+LEdHtsXwjFa5KtYWEuQgOLuiY0/tiTpUKlhLieOuOPK4p9LA64ZruzvA7ZN7soQ Q9jx0KPNrvS8+rDJQFlgvkssBR7WCmNURSNcXSket+Rv7yON2CqrZfIcvz9F3GaSyH7p/9S7gbw kvM3NFaREfv9zZNb1ZtabItpDt34= X-Received: by 2002:a17:903:230d:b0:2ed:29a5:7828 with SMTP id d9443c01a7336-2f03f1770c7mr393311955ad.11.1796124190532; Tue, 01 Dec 2026 03:23:10 -0800 (PST) Received: from default-vnic.defaultvcn.oraclevcn.com ([161.118.211.100]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0457fd68dsm169955545ad.39.2026.12.01.03.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 03:23:10 -0800 (PST) From: Tuan Kiet Huynh To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Tuan Kiet Huynh Subject: [PATCH v3 2/2] ipa: libipa: camera_sensor_helper: Add Samsung S5K5E8 Date: Tue, 1 Dec 2026 18:23:03 +0700 Message-ID: <20261201112304.3425319-3-huynhtuankiet33@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261201112304.3425319-1-huynhtuankiet33@gmail.com> References: <20261201112304.3425319-1-huynhtuankiet33@gmail.com> MIME-Version: 1.0 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 Add CameraSensorHelper implementation for the Samsung S5K5E8 5MP CMOS image sensor with hardware-verified 10-bit 0x40 black level (4096 in 16-bit), linear analogue gain (x/32), and 4-line exposure margin. Signed-off-by: Tuan Kiet Huynh --- src/ipa/libipa/camera_sensor_helper.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index c5c8a447..81b67c60 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -958,6 +958,30 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperOv13858, "ov13858") +class CameraSensorHelperS5k5e8 : public CameraSensorHelper +{ +public: + CameraSensorHelperS5k5e8() + { + /* + * Black level measured on the Xiaomi Redmi Note 4X (mido): + * dark frame at minimum exposure and 1.0x gain, median 64 + * at 10 bits (mean 64.14); 64 << 6 = 4096 at 16 bits. + */ + blackLevel_ = 4096; + /* + * Linear analogue gain, gain = code / 32: the kernel driver + * passes the raw code (0x20 = 1.0x to 0x200 = 16.0x) to + * register 0x0204. Spot-checked on mido: stepping gain + * 32 -> 128 (1.0x -> 4.0x) raised the net signal from 18.1 + * to 73.5, i.e. 4.06x measured for 4.00x requested. + */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 32 }; + exposureMargin_ = 4; + } +}; +REGISTER_CAMERA_SENSOR_HELPER(CameraSensorHelperS5k5e8, "s5k5e8") + class CameraSensorHelperVd55g1 : public CameraSensorHelper { public: