From patchwork Sat Oct 17 15:38:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qianhui Xu X-Patchwork-Id: 28500 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 1C1E5C3307 for ; Sat, 17 Oct 2026 15:38:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B5DB568E62; Sat, 17 Oct 2026 17:38:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=mail.ustc.edu.cn header.i=@mail.ustc.edu.cn header.b="iFxg91/B"; dkim-atps=neutral Received: from ustc.edu.cn (smtp.ustc.edu.cn [202.38.64.46]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 05CEA68E4D for ; Sat, 17 Oct 2026 17:38:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:From:To:Cc:Subject:Date: Message-ID:MIME-Version:Content-Transfer-Encoding; bh=8b/oDFYKxI it10rYpnDfdIlLcv056OJ9IWEFt2L0v9o=; b=iFxg91/BTEWHAv7TGi1VEIRVZF FGy6/iQl5xyJOLKVK/jX7m4FM7b1zSaEI+xF4YVw7yJN/LMTvlSfUy3NDV9BLYS4 fTkpDC/WbjMJEM6HD5MJnkVx0o+8OnuxXS6vjhe2EMohIX752W1X4MqHOsf564yD PrFVXTZizc0f6c5/8= Received: from xuqianhui.ustc.edu.cn (unknown [114.214.230.12]) by mailimap2024 (Coremail) with SMTP id 3pYKCgCXGD11ltNqUG0EAA--.1829S2; Sat, 17 Oct 2026 23:38:29 +0800 (CST) From: Qianhui Xu To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Hans de Goede , Kieran Bingham , Laurent Pinchart Subject: [PATCH 0/2] ipa: libipa: add sensor helpers for GC08A8/S5KJNS and make the AGC target tunable Date: Sat, 17 Oct 2026 23:38:27 +0800 Message-ID: <20261017153829.442320-1-xiaqinghuan@mail.ustc.edu.cn> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-CM-TRANSID: 3pYKCgCXGD11ltNqUG0EAA--.1829S2 X-Coremail-Antispam: 1UD129KBjvJXoW7tF4UJrW5urW8tw1DtFy5urg_yoW8Ar18pr Z5Wr98tr4kGFWI9r1fAr4UXayrAayrJF15Crn7tw48Zan8Jas7t3s7Kw4fuFyUA34kua17 ZFn0v347CF1DZaDanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkSb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8Jw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_Jw0_GFyl 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F 4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY 6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUg3l8UUUUU X-CM-SenderInfo: 50ld1x5qjk3t3q6ptxnoox23vfohv3gofq/1tbiAREDB2rSe1QyUQBBsh 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" This small series comes from bringing up the two cameras of the Lenovo Legion Y700 Gen4 (TB322FC, SM8750) with the simple pipeline handler and the software ISP. The first patch describes the analogue gain encoding and the black level of the two sensors (Samsung S5KJNS at the back, GalaxyCore GC08A8 at the front) so that the software ISP works with real gain multipliers instead of raw register codes, and the AGC/tuning does not need the sensor drivers to change their V4L2 control semantics. The second patch makes the AGC exposure target a tuning parameter. The current fixed target of half the histogram range is quite bright for an output that is gamma encoded with the default gamma of 2.2 (about 73% of the full code range), which washes out the image and clips highlights; a platform can now pick a lower target without touching the IPA sources. Both changes were tested on the device with libcamera 0.7.1, rebuilt from this tree (aarch64, musl), against the simple pipeline handler: - Configure log confirms the AGC uses gain ranges in real multipliers (1-64 for s5kjns, 1-16 for gc08a8) instead of raw codes. - With exposureTarget 0.22 the same scene gives a mean around 160 instead of the washed-out 210 obtained with the default target, and the AGC settles inside the target hysteresis band. Qianhui Xu (2): ipa: libipa: add camera sensor helpers for GC08A8 and S5KJNS ipa: simple: agc: make the exposure target tunable src/ipa/libipa/camera_sensor_helper.cpp | 32 +++++++++++++++++++++++++ src/ipa/simple/algorithms/agc.cpp | 24 +++++++++++++++---- src/ipa/simple/algorithms/agc.h | 4 ++++ 3 files changed, 55 insertions(+), 5 deletions(-)