From patchwork Mon Nov 9 22:43:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaurav Suman X-Patchwork-Id: 28839 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 66F81C3307 for ; Mon, 9 Nov 2026 22:50:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DBFB46A7EA; Mon, 9 Nov 2026 23:50:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Va4CLvpb"; 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 BE8B969301 for ; Mon, 9 Nov 2026 23:43:27 +0100 (CET) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4a2000d5fb1so8260495e9.1 for ; Mon, 09 Nov 2026 14:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794264207; x=1794869007; darn=lists.libcamera.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=c30JhuIcFzVeoyPEFqkpxPDQetFXtm63D7lHsqvDqig=; b=Va4CLvpbQYLayUXBo3WF0ekKGzKR/b+Ek51SyTRFD2WzttvRQ1JBWxPCIEaPFlighU ChU0wUSty8ztQb11WSxnDdqyJKU4B1GjgZaHV4qXlTbEPGgL6jMmrpmW/BsCwdbNwVFi 2RjAdn9pJhV1QLUEXGqngOOrKsfVSfIpbMZ+xTmAE0HPHlJLNZcazNgt/kELr8YbhZCu UdlrZj9WQrcC2FHMacml+lbPM/H0fBqDNwRFnk0dWk9Uhf/oq/D32bb6UsEOeJZ5rHGi 9loJldxejMUHolNi9LRuunQ61xzwt3FKEDOEQO7gdcp2wgt5UMgGF9Qr/aEfCiollt/S Rskw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794264207; x=1794869007; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=c30JhuIcFzVeoyPEFqkpxPDQetFXtm63D7lHsqvDqig=; b=uM1WHjKGwFYPs9ZKZsmgSFEG/OICKyd/AyWVYn8Tu86tmFTq/AQBfAoX+UyLi3HEB1 4vjGZ95EDx1cWjFPo2MbvmNFC59iyq4qa+/ET7LTE34GFCJuqiwRrynZb3EJX34V036H 1tdjWMQ4z+DdbyX0JEc8aYDf/NbgFqxmVKtGI1f3snZKxRE8NPe2oENdg5w2xHGtrqP6 faq6QIH9nedAj1l+BuxMP/Cndxmn5rSVhZ1YsJMJuz5tQ4MjNtmtjnV9vasP0fs+L09B +LATKIb+0BURArhKXkWQfjY3A7FviRO5u+ELtjvEZSMMBRu8ek/PE60DQcxeoXAHo1xc p+9g== X-Gm-Message-State: APuU4Z9+A7pQIBSJ1BMbPq0fjzB1DtBBQpmQ9FvQzI0Gq2gy7nSlEc9M xBYp+QNbuTd3g64FVD0RDvPBvESD/PZgYv7gw1Bdv7JMYrkauIL7f0LvFed30Q== X-Gm-Gg: AYBFou2lV/gQOeOipLLkd6DxbcBQ6PtLJTUWR/1KpoKSVoY3y+74xX0YHyBzVDDoNMa xqYK7JHF7IiF9kDt0gQ/pq7COet1z0v2aD9dpAhOTZk1FVALNGY4VAB5sVslmSkF5y5j5UfT6Fx hJwttALNiYGbyEIYWp6EvewPRRrpr2IaeZ94112LeOa/1q6Sr9EBDyy7lF2HGF/IWFxMgOd+BaM nYoiuiPbBrTrWHjaUUdQRTKVe4AQ5PgwkjhT70yiC02Vqs7iqKyxZCuDYX5BEFvibqEydSiExpS ve5Lv6looQbEzb6aJYPhJZeqC0x+cY9BO82D3HEduivGkQTgTSMJEDy22QSRsSmumyGSAd+eYAu RNEvv0hu0NeFb51BVDrY6vuRlg66X3PcVNkKNqe1Qu5GEGI32kNHR4RNKApzwmfJC+/4sDT57YY hs7ll8hWVq0byfQMmvwX8ymNEdawFE/2Vnyqh6SXGmjwKbDvih1MLGq7Z365IRwaoWU6McoZubo vuAdiHV104h9qE5JtJL7t1f7YA4A/CUfrowl1zQ1xxAzhn72rFBPTqkSb01AfOuQCEscd19cDf0 Ieej93d3Q+4+auVFPuqymdXKJ4wg/qCE+jvOKSiCW1GjSQd7+VvvDqJu8ES0PFCnnjouZI0KinG 2OMZ9jUmMwLYqdD7wf8a6eZQOmb0iGmVs X-Received: by 2002:a05:600d:82e4:b0:4a7:9044:a87 with SMTP id 5b1f17b1804b1-4ba0234efc4mr10882425e9.27.1794264207084; Mon, 09 Nov 2026 14:43:27 -0800 (PST) Received: from [192.168.215.2] (pd9fd8d57.dip0.t-ipconnect.de. [217.253.141.87]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01feee1asm26072495e9.12.2026.11.09.14.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 14:43:26 -0800 (PST) From: Gaurav Suman Date: Mon, 09 Nov 2026 22:43:18 +0000 Subject: [PATCH 1/2] ipa: libipa: camera_sensor_helper: Add IMX363, S5K3M3 and S5KGD1 MIME-Version: 1.0 Message-Id: <20261109-nura-sensors-v1-1-fd93505fe129@gmail.com> References: <20261109-nura-sensors-v1-0-fd93505fe129@gmail.com> In-Reply-To: <20261109-nura-sensors-v1-0-fd93505fe129@gmail.com> To: libcamera-devel@lists.libcamera.org Cc: Gaurav Suman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794264205; l=2297; i=gauravsuman007@gmail.com; s=default; h=from:subject:message-id; bh=Gov6vmdyKkfi40KkkCgnHZF9yDYd1a/Yk2RnMR8pJzA=; b=CljSRLiXDFHlY4jl+q6CFA+zRlFSFEOVOo5g1nHpAXjtOU6t9JH0Np2j1XadD8HOLkbpgmU3H h6mtpv5mowvDCSG91W2146mu/oM7SJ9+I7gILWnsTTm4r/+hN1ixAyv X-Developer-Key: i=gauravsuman007@gmail.com; a=ed25519; pk=lnUC0mQfc0KyA0LE73pQ4+QWYVRaCD8Sd3XWxLZO+JY= X-Mailman-Approved-At: Mon, 09 Nov 2026 23:50:27 +0100 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 helpers for the three sensors of the LG G8x ThinQ (SM8150): - IMX363 uses the same 512-based Sony analogue gain code as the IMX258 (gain = 512 / (512 - code)); black level 64 at 10 bits. - S5K3M3 and S5KGD1 use a linear code with 0x20 = 1x; black level 64 at 10 bits. Without a helper the simple IPA falls back to a generic gain model and the exposure loop converges slowly or overshoots: on the G8x the IMX363 crept from 63 to 227 (of 255) over two seconds. With the helpers both rear cameras settle within about 8 frames. Written with the help of an AI coding assistant (Claude Opus 5.5, Anthropic); tested on the phone with the softisp IPA. Signed-off-by: Gaurav Suman --- src/ipa/libipa/camera_sensor_helper.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 359040ec741830e8765890c5706f7253c2360620..baa60ca44435e5802a7461b95b83e247ba5e2de3 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -565,6 +565,38 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("imx258", CameraSensorHelperImx258) +/* nura (LG G8x): IMX363 uses the same 512-based Sony gain code as IMX258. */ +class CameraSensorHelperImx363 : public CameraSensorHelper +{ +public: + CameraSensorHelperImx363() + { + blackLevel_ = 4096; /* 64 at 10 bits */ + gain_ = AnalogueGainLinear{ 0, 512, -1, 512 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("imx363", CameraSensorHelperImx363) + +/* nura: Samsung S5K sensors, analogue gain = code / 32 (0x20 = 1x). */ +class CameraSensorHelperS5kLinear32 : public CameraSensorHelper +{ +public: + CameraSensorHelperS5kLinear32() + { + blackLevel_ = 4096; /* 64 at 10 bits */ + gain_ = AnalogueGainLinear{ 1, 0, 0, 32 }; + } +}; +class CameraSensorHelperS5k3m3 : public CameraSensorHelperS5kLinear32 +{ +}; +REGISTER_CAMERA_SENSOR_HELPER("s5k3m3", CameraSensorHelperS5k3m3) + +class CameraSensorHelperS5kgd1 : public CameraSensorHelperS5kLinear32 +{ +}; +REGISTER_CAMERA_SENSOR_HELPER("s5kgd1", CameraSensorHelperS5kgd1) + class CameraSensorHelperImx283 : public CameraSensorHelper { public: From patchwork Mon Nov 9 22:43:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaurav Suman X-Patchwork-Id: 28840 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 8EA8BC3307 for ; Mon, 9 Nov 2026 22:50:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F12D86A7D3; Mon, 9 Nov 2026 23:50:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="zpZaXXM8"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 96EDC6A7D3 for ; Mon, 9 Nov 2026 23:43:28 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4a5720b0a57so8770625e9.0 for ; Mon, 09 Nov 2026 14:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794264208; x=1794869008; darn=lists.libcamera.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hjuUymizQBLoaLLc6uxigSRAnIV3Fl/CRdxpWO5CEU4=; b=zpZaXXM80Yv/bBMDgOan14v1PWFvM838dS899fUEt5BPwqUSxoMfBz8dxkGfGAXYcv 4SiJSGl83KK/2CAFBWXoWmxh5/eyBHJyGwxpcAgQgRhuqSsdj03++cs5DiVan9x+I5bg ObIJ+PotoXgA9vENnH6gzCBtO+rSxIYTe7Uhs8TUIvYfRKbFu1DUQgKSvN6koEfheR6d qTffo3/fqfHav0rdm1C9E0gKvNs0MbfnWuSYHQSAuc0Tza3d/eeCpDh2S3pt9hwUaBvv awJl805JgQmxHTTkteksACJvpvBDHlbxYrx7Xn4qo6inI+k+SqbJiHYSY+sksA9IUCUK ZHEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794264208; x=1794869008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hjuUymizQBLoaLLc6uxigSRAnIV3Fl/CRdxpWO5CEU4=; b=jfBsM4qAxgUJG/XhHa6JMaHk8wKIPauqXYEBqmP22SoCsLtIYjO79nhRv8zBUIM1fU YCxBJVY4dq1Px1p1k/ooEmBWvMFvIUhq2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002:a05:600c:6290:b0:4a1:c6f5:2450 with SMTP id 5b1f17b1804b1-4ba02355942mr10688195e9.17.1794264208032; Mon, 09 Nov 2026 14:43:28 -0800 (PST) Received: from [192.168.215.2] (pd9fd8d57.dip0.t-ipconnect.de. [217.253.141.87]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01feee1asm26072495e9.12.2026.11.09.14.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 14:43:27 -0800 (PST) From: Gaurav Suman Date: Mon, 09 Nov 2026 22:43:19 +0000 Subject: [PATCH 2/2] libcamera: camera_sensor_properties: Add IMX363, S5K3M3 and S5KGD1 MIME-Version: 1.0 Message-Id: <20261109-nura-sensors-v1-2-fd93505fe129@gmail.com> References: <20261109-nura-sensors-v1-0-fd93505fe129@gmail.com> In-Reply-To: <20261109-nura-sensors-v1-0-fd93505fe129@gmail.com> To: libcamera-devel@lists.libcamera.org Cc: Gaurav Suman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794264205; l=2525; i=gauravsuman007@gmail.com; s=default; h=from:subject:message-id; bh=TabKde+BkbmlWBpWFJUD1u3izVAx8SiKLpfnH8AVzgg=; b=wFb4D0D8Zq8wSA9BAX/JBP34t+Q9gktVjSu1cs4/2e0cgp5+UTJfpM4Oo6aYQkpg/gHlHgY/z tva1Uy2oKgSAz4ZOc7FJIOcB+saQFqvQp4YFRjMlVc2JMmKOB6JSP7A X-Developer-Key: i=gauravsuman007@gmail.com; a=ed25519; pk=lnUC0mQfc0KyA0LE73pQ4+QWYVRaCD8Sd3XWxLZO+JY= X-Mailman-Approved-At: Mon, 09 Nov 2026 23:50:27 +0100 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 unit cell sizes, test pattern modes and sensor control delays for the three sensors of the LG G8x ThinQ. Delays of two frames match the behaviour observed with the simple pipeline handler. Written with the help of an AI coding assistant (Claude Opus 5.5, Anthropic); tested on the phone with the softisp IPA. Signed-off-by: Gaurav Suman --- src/libcamera/sensor/camera_sensor_properties.cpp | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 20cfd0bc11a661f5cb432e4b6f1b4946cfbce756..18ce59e06bf9f43b75b7948f600a78434269d9b2 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -221,6 +221,20 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen }, .sensorDelays = { }, } }, + { "imx363", { /* nura (LG G8x) */ + .unitCellSize = { 1400, 1400 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeSolidColor, 1 }, + { controls::draft::TestPatternModeColorBars, 2 }, + }, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "imx283", { .unitCellSize = { 2400, 2400 }, .testPatternModes = {}, @@ -482,6 +496,34 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen }, .sensorDelays = { }, } }, + { "s5k3m3", { /* nura (LG G8x) */ + .unitCellSize = { 1000, 1000 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeSolidColor, 1 }, + { controls::draft::TestPatternModeColorBars, 2 }, + }, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, + { "s5kgd1", { /* nura (LG G8x) */ + .unitCellSize = { 1600, 1600 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeSolidColor, 1 }, + { controls::draft::TestPatternModeColorBars, 2 }, + }, + .sensorDelays = { + .exposureDelay = 2, + .gainDelay = 2, + .vblankDelay = 2, + .hblankDelay = 2 + }, + } }, { "ov5693", { .unitCellSize = { 1400, 1400 }, .testPatternModes = {