[{"id":37477,"web_url":"https://patchwork.libcamera.org/comment/37477/","msgid":"<ab6c209f-8b61-4dbc-a476-3af2041d31f9@oss.qualcomm.com>","date":"2026-01-05T13:23:33","subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"content":"Hi,\n\nThank you for the new version.\n\nOn 5-Jan-26 13:41, Vasiliy Doylov wrote:\n> On most imx sensors the formula seems to be:\n> \n> again_float = 512.0 / (512.0 - again_ctrl_value)\n> \n> So the default of 0 makes sense and actually translates to a gain of 1.0.\n> And the max gain of 400 leads to 512.0 / 112.0 = 4.57 which is about typical for\n> a max sensor gain.\n\ns/default/minimum again/\ns/max sensor gain/maximum again/\n\nAnd can you add some extra text explaining the change a bit more\nhere, e.g. :\n\nSince a minimum again value of 0 is actually normal, the special\nhandling of againMin == 0 is undesirable and this is actually\ncausing problems on these IMX sensors. again10 correctly gets set\nto 0 which is less then the adjusted againMin which causes\nthe AGC code to not work properly.\n\nFix this by dropping the special handling of againMin == 0.\n\n> \n> Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>\n> ---\n> Changes in v2:\n> - Drop old solution\n> - Fix minimal analog gain initialisation\n> - Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2026-January/056045.html\n> ---\n>  src/ipa/simple/soft_simple.cpp | 19 +------------------\n>  1 file changed, 1 insertion(+), 18 deletions(-)\n> \n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index b147aca2..dde11666 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -237,26 +237,9 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)\n>  \t\t\t\tcamHelper_->blackLevel().value() / 256;\n>  \t\t}\n>  \t} else {\n> -\t\t/*\n> -\t\t * The camera sensor gain (g) is usually not equal to the value written\n> -\t\t * into the gain register (x). But the way how the AGC algorithm changes\n> -\t\t * the gain value to make the total exposure closer to the optimum\n> -\t\t * assumes that g(x) is not too far from linear function. If the minimal\n> -\t\t * gain is 0, the g(x) is likely to be far from the linear, like\n> -\t\t * g(x) = a / (b * x + c). To avoid unexpected changes to the gain by\n> -\t\t * the AGC algorithm (abrupt near one edge, and very small near the\n> -\t\t * other) we limit the range of the gain values used.\n> -\t\t */\n>  \t\tcontext_.configuration.agc.againMax = againMax;\n>  \t\tcontext_.configuration.agc.again10 = againDef;\n> -\t\tif (againMin) {\n> -\t\t\tcontext_.configuration.agc.againMin = againMin;\n> -\t\t} else {\n> -\t\t\tLOG(IPASoft, Warning)\n> -\t\t\t\t<< \"Minimum gain is zero, that can't be linear\";\n> -\t\t\tcontext_.configuration.agc.againMin =\n> -\t\t\t\tstd::min(100, againMin / 2 + againMax / 2);\n> -\t\t}\n> +\t\tcontext_.configuration.agc.againMin = againMin;\n\nPlease move this to above:\n\n  \t\tcontext_.configuration.agc.againMax = againMax;\n\nSo that the values are initialized in the same order as in\nthe if (true) code block above the else.\n\nRegards,\n\nHans","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 173ACBDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 13:23:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1889261FB9;\n\tMon,  5 Jan 2026 14:23:40 +0100 (CET)","from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n\t[205.220.180.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1195E61F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 14:23:37 +0100 (CET)","from pps.filterd (m0279872.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t6058JKcg3838852 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 13:23:37 GMT","from mail-qt1-f200.google.com (mail-qt1-f200.google.com\n\t[209.85.160.200])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bfyx0j274-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 13:23:36 +0000 (GMT)","by mail-qt1-f200.google.com with SMTP id\n\td75a77b69052e-4f1d60f037bso317377661cf.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 05:23:36 -0800 (PST)","from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec?\n\t(2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl.\n\t[2001:1c00:c32:7800:5bfa:a036:83f0:f9ec])\n\tby smtp.gmail.com with ESMTPSA id\n\t4fb4d7f45d1cf-64b916b372esm54233835a12.32.2026.01.05.05.23.34\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 05:23:34 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=qualcomm.com header.i=@qualcomm.com\n\theader.b=\"iQd6vcaf\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"gkOukBYQ\"; dkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcontent-transfer-encoding:content-type:date:from:in-reply-to\n\t:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n\tXx4WT2cSkDdJeyJu0bVRecGZKVzuoSxhn0XEB5FCRr0=; b=iQd6vcafKQRc4LuC\n\tklarbtTHmo340x18EOKbblCpebCV90D3CLMZVJZ/hHDXrxdUUjLJK0RqmeCtiJnT\n\toSGibAf6mVOJjPM/auCGYdbC7vcZiWrEvfanBI5Sjv9G4BN1Sa59e2b0w5iwwozz\n\t8tFNfvgbDtDnScM+mlaNZNsc0+Fwhqj0aztluV5S1lKdySBXjVK/vg8SqCVyU9iq\n\twsCK/EbICfaCRdWa3sf9EoEk9xQlzxTCcUVFxD8UOruKOIYY3Y3oboFQ2G5JSbuI\n\tjbIMVVWfNhKIdXymPRM3PNP1ISWG2GIViYPJE2GZqGLwIl5feGsw6wTHLesl+7Sd\n\tYpPBYw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767619416; x=1768224216;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:in-reply-to:content-language:references\n\t:to:subject:from:user-agent:mime-version:date:message-id:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Xx4WT2cSkDdJeyJu0bVRecGZKVzuoSxhn0XEB5FCRr0=;\n\tb=gkOukBYQJB119iIhb6eoI7e8kmLg6Gvz//ybf9vDiTsHL5uORdA2AdimWF6GjUYEPb\n\t9YQpDOWEYekxaa+Qsj7rxo0jlnLCfszk5C/ZPCcYInIHkuQ3PtYvrsg7nQ0v+KlAkJ8M\n\tzZ7P/Evav66qNhWrna8/7u0a4ShLN4S6NxRE1FCIhuMgiy9s7tUUt+hns4FzPpNc21Mp\n\tFxdLcX1/pQZxinTjmuPz8kw8Sli+kz6kyGP2i2iQErD7sCazwU/kyc3NDbCEQ2s1YKuP\n\t/Lp8jSOb61eZsUjlnJRTct8RiyI/IdqVOdx9Yi0ZOk8AJ44xupxyeqRNcLflTwjbZVXz\n\tPZJg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767619416; x=1768224216;\n\th=content-transfer-encoding:in-reply-to:content-language:references\n\t:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg\n\t:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Xx4WT2cSkDdJeyJu0bVRecGZKVzuoSxhn0XEB5FCRr0=;\n\tb=h+cxdnoMdRue2m97l7OyxWDXurXPiDXMLvcHEOFnbGI//K3dnhrWKOXS1n2x1tH432\n\tXF691Aiu2ftLtbOjtu5RHNd2aNpzxXRO53mbfo7x+Gpk0U4zaAo3bgLtlSc52cZ5C/MJ\n\tN4fidxjQDl/SkoboEqYX8d1RHFoMyiZCwCpP04dxCigqWvnmwfafkYJ93gxxqvZ4kDXM\n\t4OSKSFfWim1nusigWR7UizSgUjCybTLaA2Zp/mWN5FN6/5x7VLGhwhIVlP/H1ON2IUVs\n\thGajg+4uy+Ur5xqfN7MYPIJWrM9uoM6Yb1kYeJycFd8M/6qSBo0hHRrvBzMl6AWGY5EI\n\tEPhA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWRjF+D1iJtuVPC2xSVA+7InOV46hl9QwC+ii8y44TGnvX1qui3LsB9cnc30MDeiCjV57r5yuB6YV6WzRQgTys=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yy9E/LYxfDdpkX6A1VQOfFi0av+23f2oJ+RWf9M/Vxvsl3iTclq\n\tlzXy+752qfI6EJ7fjOQoWkcZaPkbg3YGrDs9M3PVUHhTDA9AdC0sirz5gsH0Vym2J/kzLWTIeee\n\tvwxV6GIkFRDhgsnoHVfosM80YfL7El0x36Tf5SxTwKmQcL2mDE78UZQb9DSiBooYwP+NZJeW/oN\n\t5E","X-Gm-Gg":"AY/fxX6A6KlfW2jHNR+q8nzMfU1lf31WkIzZdBD7+Da38zneA0mTrN3wZ3V7EnfILMk\n\tTC0wQB0kqo3fE8CdOlPcRSgMf4hpz6otZM61vFJJth8z3wRP9g1emhvgMEQ/Wx5T1NtTPTtLKpZ\n\tPhsTKejKrsqQKfLQ2VYb1ecvj+Wv7igb1H4i3nHI/+4WUQBsxQiUcuu0v282l6DL3bM1WDJDYoH\n\t+UNkjUfmYFPCOtRezMsmu7wa5jTznZLoyv91ySaFGspci42kwi7l27ekCubCU/hdMQjxgQIi1hF\n\tqYJol/yJxXClqN+a1sYMMEphrf5ez+ypZakUsRgTo6iG4dWtUlds/M7lI+kf4No+oTI4Trupy5v\n\t+F6CWdOdG64xa5uI1f+D5xCGc87wgLRB/pYNu08ZB+9XUXhL8tBiXKI3kr7HQZpZ+qIg8HD1edS\n\tKCSfVR6MuQUZ8GZQkLg8AHTUk+rPcpc6TQXOntRcT/1VMzlf54rRjH3yHh7EOzIHhBmfBmzBv9B\n\tLZx","X-Received":["by 2002:a05:622a:15cf:b0:4ee:17e9:999d with SMTP id\n\td75a77b69052e-4f4abd161e6mr800872841cf.34.1767619415932; \n\tMon, 05 Jan 2026 05:23:35 -0800 (PST)","by 2002:a05:622a:15cf:b0:4ee:17e9:999d with SMTP id\n\td75a77b69052e-4f4abd161e6mr800872381cf.34.1767619415388; \n\tMon, 05 Jan 2026 05:23:35 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IGpUiXRS1R0truhcRqx9I3T9qJ9CXkaXD7Dg79+fssCQS7GxUHCVbYjcnYTvcVnG1poAB3gYw==","Message-ID":"<ab6c209f-8b61-4dbc-a476-3af2041d31f9@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 14:23:33 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v2-1-9013e693ffd5@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<20260105-softisp-agc-v2-1-9013e693ffd5@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-Authority-Analysis":"v=2.4 cv=CZYFJbrl c=1 sm=1 tr=0 ts=695bbb58 cx=c_pps\n\ta=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n\ta=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=YAyIRdgMAAAA:8 a=OuZLqq7tAAAA:8 a=awiks7oCl5yZ3YqcxCYA:9\n\ta=QEXdDO2ut3YA:10\n\ta=SX4dUu0mqi8A:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=o1rO4XtwZBNj6n05oSJ_:22\n\ta=AKGiAy9iJ-JzxKVHQNES:22","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDExNyBTYWx0ZWRfX9COcdZ+FfCVI\n\t+MYOwmj8+YgN5vU3XY8YFCnQYc2gumvgkSCSxtS3xwSikaLSp6lZUqkUFWxlME7pCEIgUX+PZsK\n\tVJqf1jfkUxxbw6M9MXzAf9nJKDKnRBodWSM8sE3eEkpZmjTAKm/ZRsr9cg3r3xxouTlboFZafGg\n\tGVhEg0qc1WtVON/P/bUv0FtQWPajXeUl0mxVQyu7Y0HYaA3nKY0Scrr58KK68rreha5L/vjr8Vd\n\t9EbuzqQfhcUrKvQMyWPnGpGpkI3UMuvusxMtb2ZAJQsgSGjlIU04P2LeStNKAmbPKWjWJzqO3tD\n\tCTCjJiRoFUgDIYDugyZN8iUqVJW5dBuk6nmCmarLZFc2JNxrkkzUZoADCJz8SbGXcVes1jY/4jj\n\twD5RAsCcsWWKZDbIQn/vew4xNAh6VntghrXeP1uyKtcPdewuu7av7s0/vud5BCemPuLrhT/itkJ\n\tEUXgICJV0CKZseCRiYg==","X-Proofpoint-GUID":"QvPHaMVwYoWO-mZWb4rjh6xDQ_ev78iM","X-Proofpoint-ORIG-GUID":"QvPHaMVwYoWO-mZWb4rjh6xDQ_ev78iM","X-Proofpoint-Virus-Version":"vendor=baseguard\n\tengine=ICAP:2.0.293, Aquarius:18.0.1121, Hydra:6.1.9,\n\tFMLib:17.12.100.49\n\tdefinitions=2026-01-05_01,2025-12-31_01,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tclxscore=1015 priorityscore=1501 spamscore=0 bulkscore=0\n\tlowpriorityscore=0\n\timpostorscore=0 suspectscore=0 adultscore=0 phishscore=0\n\tmalwarescore=0\n\tclassifier=typeunknown authscore=0 authtc= authcc= route=outbound\n\tadjust=0\n\treason=mlx scancount=1 engine=8.22.0-2512120000\n\tdefinitions=main-2601050117","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37480,"web_url":"https://patchwork.libcamera.org/comment/37480/","msgid":"<73bab3e9-84d5-4295-b9d4-279a77d320c6@collabora.com>","date":"2026-01-05T14:35:11","subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Hi, thanks for the patch!\n\nOn 05.01.26 14:23, johannes.goede@oss.qualcomm.com wrote:\n>>   \t\tcontext_.configuration.agc.againMax = againMax;\n>>   \t\tcontext_.configuration.agc.again10 = againDef;\n>> -\t\tif (againMin) {\n>> -\t\t\tcontext_.configuration.agc.againMin = againMin;\n>> -\t\t} else {\n>> -\t\t\tLOG(IPASoft, Warning)\n>> -\t\t\t\t<< \"Minimum gain is zero, that can't be linear\";\n>> -\t\t\tcontext_.configuration.agc.againMin =\n>> -\t\t\t\tstd::min(100, againMin / 2 + againMax / 2);\n>> -\t\t}\n>> +\t\tcontext_.configuration.agc.againMin = againMin;\n> Please move this to above:\n>\n>    \t\tcontext_.configuration.agc.againMax = againMax;\n>\n> So that the values are initialized in the same order as in\n> the if (true) code block above the else.\n>\n> Regards,\n>\n> Hans\nI'm afraid this part was forgotten in v3","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2C812BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 14:35:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3465961FBB;\n\tMon,  5 Jan 2026 15:35:22 +0100 (CET)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 787C161F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 15:35:20 +0100 (CET)","by mx.zohomail.com with SMTPS id 1767623713946890.9727794321593;\n\tMon, 5 Jan 2026 06:35:13 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"a8dtyeEy\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1767623716; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=cP5aZdDiyXIhbxcJeHLNwMMmz7TyqwK7sJ9+cncrLCKcTyUeJGMJr32eqZ5AVZ8GGk7cedHOk/93Ng8Ady4h3ou6OMDJYvpVCtPpNLV1m5QQL6ufh42Pl9sLgZdqjrLwfvUqyHxE3nzhMrtgga7iL8LPdHXIs2P1c842IPMpFrU=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1767623716;\n\th=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=LDsn8fcK8FKyxiVp8LLgMByswQZ58xFAbO+0AIT7TCM=; \n\tb=KX9q4Fx7sMBjHNXNXDxgy1pCuXCOJgyg898tYJJ1mBFMJLz4xDikWnUKi/E7av5E4GtSFddSy+uH8R+/8b7CTSa1983N2jnK/8+tKOzA7Ww2C/M4t4a6JZhWh8FFq4LicQz4OemCCpwO+VpuFDAXPXnkO3jkMMJuK/98IXqshTc=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1767623716;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Content-Type:Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Message-Id:Reply-To:Cc;\n\tbh=LDsn8fcK8FKyxiVp8LLgMByswQZ58xFAbO+0AIT7TCM=;\n\tb=a8dtyeEyN8d5RPbzB+Q1n9UKuH6KUd9H+NQ+WD7es2lBl/6xV/IMyEnnXYj76lYk\n\tYG2ynOVcKZnIFF/ctQvxDHJ7LJHTNG3kzKIdRZO78+2scVr8vQPnTuknD0hcvvkn6ho\n\tHK1pRag7zEMiRXTNYw7mHCfwnT1Lrgix37EG6dvY=","Content-Type":"multipart/alternative;\n\tboundary=\"------------DuS6MDp1ZRvD9bK5jGhDcD0v\"","Message-ID":"<73bab3e9-84d5-4295-b9d4-279a77d320c6@collabora.com>","Date":"Mon, 5 Jan 2026 15:35:11 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","To":"libcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v2-1-9013e693ffd5@mainlining.org>\n\t<ab6c209f-8b61-4dbc-a476-3af2041d31f9@oss.qualcomm.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<ab6c209f-8b61-4dbc-a476-3af2041d31f9@oss.qualcomm.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37482,"web_url":"https://patchwork.libcamera.org/comment/37482/","msgid":"<176762467905.3486172.7381351673460815856@ping.linuxembedded.co.uk>","date":"2026-01-05T14:51:19","subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Robert Mader (2026-01-05 14:35:11)\n> Hi, thanks for the patch!\n> \n> On 05.01.26 14:23, johannes.goede@oss.qualcomm.com wrote:\n> >>              context_.configuration.agc.againMax = againMax;\n> >>              context_.configuration.agc.again10 = againDef;\n> >> -            if (againMin) {\n> >> -                    context_.configuration.agc.againMin = againMin;\n> >> -            } else {\n> >> -                    LOG(IPASoft, Warning)\n> >> -                            << \"Minimum gain is zero, that can't be linear\";\n> >> -                    context_.configuration.agc.againMin =\n> >> -                            std::min(100, againMin / 2 + againMax / 2);\n> >> -            }\n> >> +            context_.configuration.agc.againMin = againMin;\n> > Please move this to above:\n> >\n> >               context_.configuration.agc.againMax = againMax;\n> >\n> > So that the values are initialized in the same order as in\n> > the if (true) code block above the else.\n> >\n> > Regards,\n> >\n> > Hans\n> I'm afraid this part was forgotten in v3\n\nArgh, sorry - I just merged v3 as I thought it was all handled.\n\nI think the ordering is trivial, but happy to merge a patch fixing the\norder too!\n\n--\nKieran\n\n\n> \n> -- \n> Robert Mader\n> Consultant Software Developer\n> \n> Collabora Ltd.\n> Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK\n> Registered in England & Wales, no. 5513718","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 23298BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 14:51:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B86961FB9;\n\tMon,  5 Jan 2026 15:51:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E79961F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 15:51:22 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 923FD1E8A;\n\tMon,  5 Jan 2026 15:51:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"R5sA/4si\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767624661;\n\tbh=rEhNMYQcx6W81oTW9Se/gmtjmYKcXOxWwi52vPjZ3+w=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=R5sA/4siiwe/5DBVY0tFLcqqPmZmuQpFU4h0161ojH/e8Cf/txfTQZcm3QzngSGjX\n\tS+VxfVaRS5j+Eww1ZVoEjzapt0C0LSgtsEj+0UUuOn2T2CUs/3vFPmxl2+H/n6/mGk\n\tKCqXvogzv6TDG366UrF0HvEFA+JLqa+cnMi6rd1g=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<73bab3e9-84d5-4295-b9d4-279a77d320c6@collabora.com>","References":"<20260105-softisp-agc-v2-1-9013e693ffd5@mainlining.org>\n\t<ab6c209f-8b61-4dbc-a476-3af2041d31f9@oss.qualcomm.com>\n\t<73bab3e9-84d5-4295-b9d4-279a77d320c6@collabora.com>","Subject":"Re: [PATCH v2] ipa: simple: fix minimal analog gain init","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 05 Jan 2026 14:51:19 +0000","Message-ID":"<176762467905.3486172.7381351673460815856@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]