From patchwork Thu Dec 3 19:56:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 29156 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 21209C3300 for ; Thu, 3 Dec 2026 19:56:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12F2C6AB59; Thu, 3 Dec 2026 20:56:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="aaioBrl6"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cXVG5tBh"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 850C66AB3B for ; Thu, 3 Dec 2026 20:56:54 +0100 (CET) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3IL6g02792986 for ; Thu, 3 Dec 2026 19:56:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=W4bVzRQB5ikb3GoG+pgsS7u4Bg4JJyPEhT0 DjKW93Jw=; b=aaioBrl620ym+Ra6Q31bOPwHYit9N72TzvgyXh3whxUN/aQ21wz xNCdx3XPu7TkUTqkRrnhT7SGTEX2eANHaHAq3yvwqce/b8G+KsUgZJ4yMWJwYq78 orvwWEc7Db5rMoK5OWFEeDXj6fKGfMD8mHDBeLOY+PTkz7XSS1I9YiIW9Bxn249m IYWKp9SmWsKkO4jbdjxB54JlRpycH3QAdPcLnnqnhxJa7z6C116H+WSsjQBJJqmX L6RCIHGVpwgWDfFf7U3fevWvsz5PBx3h73K72mSP4w1iIZUcOxhn7A6aOiR78IWd cdHhieyj2+lZjbAveNya3S/MrH7d15vS2Xg== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jb6dutjys-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Dec 2026 19:56:53 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-921dfc28e5aso2176516d6.1 for ; Thu, 03 Dec 2026 11:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796327813; x=1796932613; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=W4bVzRQB5ikb3GoG+pgsS7u4Bg4JJyPEhT0DjKW93Jw=; b=cXVG5tBhkdJKtI688w5DQEyMyA19x5HH7zP0V5+5a8ebOOANgizPIIMPsfn3lNMuBl NxKLVCgkms0pjjRwVeRkWwY17PVNB5XkT10HMBgaH14DaZXEFUv8ciUC/kIOOM0VyJeP HRBJ4KWRY4imhwzqLEUo1eTzqczcPS5kFHGJ6zjk2MMIVnueW+7Hc0TbDSAgsSpfS190 M8QkJOmdvCtvTxAS+7pOJcFZ9J8+l0pJjpBHLqBXHbRZabqLvPdZVsKCC1jaMdjlvAT0 WseVl5j57/bKrQ6M7B43CuwExoOA+6xIzB/76ZVoRNHmeUGgXZLk8jLSm6o/rLLQ5rO7 F1DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796327813; x=1796932613; h=content-transfer-encoding:mime-version: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=W4bVzRQB5ikb3GoG+pgsS7u4Bg4JJyPEhT0DjKW93Jw=; b=V+CrzeWfEcCLUaoGlukZngSbZ72SuFA0dDcGlChw9dwhCg5gjbtQXoI3lV+RxnAJo+ 1Z4FcullSPDVoFn67CT+McY1CB8TZt+wyWej89mi6ed5glHQbyDQ/5IYQ8OYg8E+iVne ACABCVjeWqsoPIRi1UPpO4DMieEzy4lha8vfkbxW+e1fPecrT2lNCclWQO0GOpvGzEoQ mglBCjNMtGaITi54aVsGKBhLiiVwLtaDoU8UIIxC43vvxdl+1bLZHy8C6M+rgQo0jAME IMqBNj8nwfTwZQOtkojCBKRssuuOTdtE+4DPp7uA7xas87QegKbV/NxZWh+b6g9ekKi5 WOaw== X-Gm-Message-State: APuU4Z+VKLV0K8RkF40z+lG9/I3Ruqe+WMnpq/nJKix8h6Lj6GUQ2oTO uu35mtkTOHN017XcViiCOgPxvG5QSAK7l6v/F5x8PMC/kc4EXNMBoVfYdywfOpnVK6CEqbjICGf 2NdHZ7kuu9IMhA5oH+EGmi3dQNqOXBOfOa1jAHBYBer/uVJ0j/rq4qkUIQYc8+f6fGCWlZm6BBT ODa3F63WDs X-Gm-Gg: AZFdTZfMDn88REskbyoMLzJg50GCYxcP3/OywM2hfzEmCYR2dIla2hnFQbUXwReU7Gz N+rktB7tONRg54Kd8Wk+mUqWjpvh6zjvRkH5QmKadQw+Tpt+aVAu2TGvWnJUsLhhW2TdbCIZIMI uCzl9uMYFIVgz2XjjqDo0m7C8bFKKwWLWhWW+ZDJsiKQ9eAY4LX8d28U8fics3Ud4ppXv2Am1Jo /Xbv1OrgQKFwaazrABRncLXQ6qt/djtGepNZ1xHQwOZtOmTG5A2ft7b1rn14U/LWcEKLnBG0ucl dYmXqx4kpFIoyl1xVPQgfHFTaYNkWmLdQyN/9FJXkhjZj47TRTP1PY0me3ZEucJ+NdTShhu3k3/ XTkK6RFo+j9hBz167E3+Z5Wi478ppGMZKsPiT/0ml7hRbUUig7k6EtMV4uSYa4cBtzM4SQ2LFP4 /cyWQ= X-Received: by 2002:a05:620a:1787:b0:94a:96e:80c with SMTP id af79cd13be357-94a096e0b47mr5070626685a.2.1796327812576; Thu, 03 Dec 2026 11:56:52 -0800 (PST) X-Received: by 2002:a05:620a:1787:b0:94a:96e:80c with SMTP id af79cd13be357-94a096e0b47mr5070622785a.2.1796327811948; Thu, 03 Dec 2026 11:56:51 -0800 (PST) Received: from t14s.dynamic.ziggo.nl ([2001:1c00:c07:4900:f8ab:b92:277a:1632]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c525b3805a6sm18374866b.28.2026.12.03.11.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 11:56:50 -0800 (PST) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Hans de Goede Subject: [PATCH 01/20] ipa: softisp: Emit setSensorControls from computeParams() Date: Thu, 3 Dec 2026 20:56:47 +0100 Message-ID: <20261203195647.18475-1-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 X-Proofpoint-GUID: JOe8hWTvGYmzIbZ63aljdA9HJLkIdkbH X-Proofpoint-ORIG-GUID: JOe8hWTvGYmzIbZ63aljdA9HJLkIdkbH X-Authority-Analysis: v=2.4 cv=ZsJ4uN7G c=1 sm=1 tr=0 ts=6b11c985 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=xqWC_Br6kY4A:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=NVYBIVXJkE7jwSEV7G0A:9 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA3OSBTYWx0ZWRfX02IiACuTUaN9 didZMWKO0IYjc/5qGP856S6lecSeDib1csw6b3cv490ZX3nR4S2wE2OWoDstDCsr68h1oLh7CCS SPbuoKRjf/zu6opnjNr0h643RucAiCQMt808tAmsjgb8Ng/h25qumrO4EvgOxArf2m6Mkvdd+Bx FNsa9jxIj4Ag5pyPD7Xqe0xaGL4/xCEzRn26OP+2W9Ax+HY79oDfhGCV9XKk1/zxcXbMXgXJ9Cf DaiVKVwXv3r7jRAvNTObIu+txTv8QW/s56osxJSlwJKwx5hK2j3BvJTnVDBz/qL8A550fSYpwy1 VaWGdGmIV4LZZfFu4BNju7avBcxTwTgZBx+IyiAQhv7Nmxxg1EzvTARSXrFEAnuwqAwpMn3pKta v6LuSEegDZtULzZ/TsYkWNGagI3PNv1lvIQzQTV/TWgJHoXeMhvbYsTPUQZRf2Ny7LrTv3H+ape lpt/gXi9WNxKnbthstw== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA3OSBTYWx0ZWRfX1ZwWRWvuFrU5 RhQayh9yp8VAv+/nPL2tDfC5ZzYtXdWYRDqgnuItfYaQO2zK8E/CoQ1UXpmebwNMOM3DXMIV4bD e3oDPJfpxGVNso2zLmHTyuu+ETi4dM0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.138, FMLib:17.12.100.49 definitions=2026-12-03_05,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030079 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 The agc::prepareControls() call to prepare the controls to pass to the setSensorControls signal takes frameContext.agc.[exposure,gain] as parameters. These are updated by the prepare() call of the agc algorithm. Doing the agc::prepareControls() call + setSensorControls.emit() in processStats() leads to previous or uninitialized (0) values being used. Move these calls to computeParams() after the prepare() calls. This also nicely groups the agc::prepareControls() call together with the other prepare() calls. Signed-off-by: Hans de Goede --- src/ipa/softisp/softisp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/softisp/softisp.cpp b/src/ipa/softisp/softisp.cpp index 00249a300..96056865d 100644 --- a/src/ipa/softisp/softisp.cpp +++ b/src/ipa/softisp/softisp.cpp @@ -237,6 +237,11 @@ void IPASoftIsp::computeParams(const uint32_t frame) params_->combinedMatrix = context_.activeState.combinedMatrix; paramsComputed.emit(frame); + + ControlList ctrls(context_.sensorControls); + agc::prepareControls(ctrls, context_.camHelper.get(), + frameContext.agc.exposure, frameContext.agc.gain); + setSensorControls.emit(ctrls); } void IPASoftIsp::processStats(const uint32_t frame, @@ -252,11 +257,6 @@ void IPASoftIsp::processStats(const uint32_t frame, for (const auto &algo : algorithms()) algo->process(context_, frame, frameContext, stats_, metadata); metadataReady.emit(frame, metadata); - - ControlList ctrls(context_.sensorControls); - agc::prepareControls(ctrls, context_.camHelper.get(), - frameContext.agc.exposure, frameContext.agc.gain); - setSensorControls.emit(ctrls); } std::string IPASoftIsp::logPrefix() const