From patchwork Wed Dec 2 15:13:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 29139 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 32198C3304 for ; Wed, 2 Dec 2026 15:13:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D31316AAFA; Wed, 2 Dec 2026 16:13:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="WbIO/Ngx"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A9DF6AAEE for ; Wed, 2 Dec 2026 16:13:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796224406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZYZm8kwp+ZG/4TXbpqGBkSJx+FQhwPrqGHrCmiS5JJs=; b=WbIO/Ngx+WbROMkpPeQ4jPlNSCTK39+LSBee9fYQlqpvG5fj6Ht5gie9bAe1ZqyM7bEYje oCXBndzH1iEl4U90VaOKruRKiDGMSIwFGC3AhIqfsQSuqKOnNidvBNbGRm0E737R+EOQEj VvF9MRrpkgdq2xgZ2iLxfznIVDr056U= X-MC-Rep: binary re single Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-jC3CMvN5N-G2KKxq2RItIw-1; Wed, 2 Dec 2026 15:13:22 +0000 X-MC-Unique: jC3CMvN5N-G2KKxq2RItIw-1 X-Mimecast-MFC-AGG-ID: jC3CMvN5N-G2KKxq2RItIw_1796224401 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C7ECB1925267; Wed, 2 Dec 2026 15:13:21 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 933E13000398; Wed, 2 Dec 2026 15:13:20 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Hans de Goede , Robert Mader Subject: [PATCH v4 4/4] utils: tuning: Support variable softisp LSC size Date: Wed, 2 Dec 2026 16:13:04 +0100 Message-ID: <20261202151305.132644-5-mzamazal@redhat.com> In-Reply-To: <20261202151305.132644-1-mzamazal@redhat.com> References: <20261202151305.132644-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uMqvf_qckxljrR_iDnEbIsCceNKj9Gt2ZhNGA_j300g_1796224401 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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 Software ISP supports arbitrary lens shading correction table sizes. Let's adjust the softisp tuning script to produce tables of any size too. The size can be specified in the tuning script configuration file. If unspecified, the default size of 17x17 cells is still used for compatibility with the last released libcamera. Signed-off-by: Milan Zamazal --- utils/tuning/config-example.yaml | 5 ++++- utils/tuning/libtuning/modules/lsc/softisp.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/tuning/config-example.yaml b/utils/tuning/config-example.yaml index 238069a6f..c829ee937 100644 --- a/utils/tuning/config-example.yaml +++ b/utils/tuning/config-example.yaml @@ -52,4 +52,7 @@ general: macbeth: small: 1 show: 0 -# blacklevel: 32 \ No newline at end of file + lsc: + grid_width: 17 + grid_height: 17 +# blacklevel: 32 diff --git a/utils/tuning/libtuning/modules/lsc/softisp.py b/utils/tuning/libtuning/modules/lsc/softisp.py index 798553542..99c41427d 100644 --- a/utils/tuning/libtuning/modules/lsc/softisp.py +++ b/utils/tuning/libtuning/modules/lsc/softisp.py @@ -95,7 +95,11 @@ class LSCSoftisp(LSC): return output_list def process(self, config: dict, images: list, outputs: dict) -> dict: - output = {} + if 'lsc' in config['general']: + lsc_config = config['general']['lsc'] + self.sector_shape = (lsc_config['grid_width'], lsc_config['grid_height']) + + output = dict(gridSize=dict(width=self.sector_shape[0], height=self.sector_shape[1])) output['sets'] = self._do_all_lsc(images)