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: