[{"id":37462,"web_url":"https://patchwork.libcamera.org/comment/37462/","msgid":"<85fr8kjr1v.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-01-05T10:24:12","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Vasiliy,\n\nthank you for the fix.\n\nVasiliy Doylov <nekocwd@mainlining.org> writes:\n\n> If camera sensor helper is not set, again10 will be 0.\n\nIt should be set according to gainInfo\n(https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/simple/soft_simple.cpp#n201)\nin this case.  Do you mean the case when gainInfo doesn't contain\nmeaningful values?\n\n> It will prevent exposure change, because again will be clamped to againMin\n> and condition again > again10 will always be true.\n> Exposure decrease change will never occur.\n> Fixed by adding again > againMin check.\n>\n> Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>\n> ---\n>  src/ipa/simple/algorithms/agc.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp\n> index 189de770..2972844b 100644\n> --- a/src/ipa/simple/algorithms/agc.cpp\n> +++ b/src/ipa/simple/algorithms/agc.cpp\n> @@ -71,7 +71,8 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou\n>  \t}\n>  \n>  \tif (exposureMSV > kExposureOptimal + kExposureSatisfactory) {\n> -\t\tif (again > context.configuration.agc.again10) {\n> +\t\tif (again > context.configuration.agc.again10 &&\n> +\t\t    again > context.configuration.agc.againMin) {\n\nI think it would be better to ensure that again10 >= againMin (and\nperhaps also again10 <= againMax) when initialising the gain variables\nin soft_simple.cpp.\n\n>  \t\t\tdouble next = again * kExpNumeratorDown / kExpDenominator;\n>  \t\t\tif (again - next < context.configuration.agc.againMinStep)\n>  \t\t\t\tagain -= context.configuration.agc.againMinStep;\n>\n> ---\n> base-commit: 2861817f09c96a0660b88783eff159631e42030f\n> change-id: 20260105-softisp-agc-16d01cb3da49\n>\n> Best regards,","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 2BBC8BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:24:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 43D5B61FBF;\n\tMon,  5 Jan 2026 11:24:20 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D83E961F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:24:18 +0100 (CET)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-621-xMmvqslxO9KY_QovGd5dRg-1; Mon, 05 Jan 2026 05:24:16 -0500","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-4775e00b16fso59187605e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 02:24:15 -0800 (PST)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47d6c0c6ed8sm53312775e9.20.2026.01.05.02.24.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Jan 2026 02:24:13 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"IVNtlr0I\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1767608657;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=aCSHQSwiPegRSI0qR/z2nZOmp8NQx8IUb1QqsMCGPwI=;\n\tb=IVNtlr0I7rZKYyJ4D1MfblMDr2TmRyhRLSoTNA4sMmHHnIOf3xtlqT6OLw0lJZ4JAwghT7\n\trUUolhyymPwUhj/JUDPg3JoATySds6xSw/vN4DnZOFRlQ9kNbP/e2oLrKpmC3+rnseE0EW\n\tWloYOzCWgfWGUdPVQgwaXvwOFIjY1as=","X-MC-Unique":"xMmvqslxO9KY_QovGd5dRg-1","X-Mimecast-MFC-AGG-ID":"xMmvqslxO9KY_QovGd5dRg_1767608655","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767608654; x=1768213454;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=aCSHQSwiPegRSI0qR/z2nZOmp8NQx8IUb1QqsMCGPwI=;\n\tb=VWBCNvt+PBeH+5NB8cz2u7EHWAK9hSn0vmWsmc5owFU4OajYfTCh6XKeliPtOXHNeL\n\tPpZtSd3zuQFYUqzhhzsvW83GHQSqCohjQVE0aUwazYcJlmOXm3Mwz88clz7MYCl/6YV/\n\tTE1H6CJ1BkTDwv5c/0ySv5kaQad+O9lWsji8TUeEd6qwIeRAtmE/tpT/PdSFAJ6HwrVA\n\tCBUi30jm7r6UQ1QGx0MIX60VMX7P8+jTbHTSiLnwBTeknlDtI2HOHRvZWL28I3d4v/Ar\n\tT+bDCBD7wY72lnYI+rkh+tnY+I/mqGBt95M7ClXQcKT+EuYsnZ071nLl7tElfVba/L6s\n\tH+og==","X-Gm-Message-State":"AOJu0YyzJnXNQbLKiXZZNVhQfVz2bctHO9TbRLB3y8+GFjiP+o6Tmim6\n\teIBVHe6Ovzyv0WT5k6tOYaDmK7ij8K7URWqEqyGmydkbSypinyhH03bkpPcdEPBYHnkysQZ6N04\n\tLY66dmrcpCyuj7wuYzm3L8hUpsVHJshYfKucGCK+oAz+wnLhWbczyrRAJd8KYB3fU8JsSOZ1Jre\n\ts=","X-Gm-Gg":"AY/fxX5WA+pESUpB2ESmUcMDYcQOmGzZfxw0KApbBdLc2mwGThCwibVGVDadE9Aldtl\n\t+7k1azb5r+Vu0gWWkU4PKZz7h1uYtld2fq68cxOVHdDKlv3gZ2oGXSP7WvoiYLcSH5iC8ISlzpj\n\thVd01T1wX8/3Cbbz/5mfxzNLhpYZstAxeLBCJR24U3PB1u/xw5CzvxIeu4IRI/v7NO2RyYR1Jiw\n\t7eT4lhEamM37tGbeZwfmRhXb6drO2sTEXrG6ZivmXAkAgEKqocVzT+PK9Ms/GDYQeaSDAnmIPxj\n\tv7qZo8sztjrz8MIp5kIPYDQRT6JVrSfpToi8niXGe8v0ozBK6BvRRjtkzX+kw3JZbBGnXfDaeMp\n\towa4H4SmOauf8vSB+Wt+sq9kwJz83JQ23i+fywgjpj25l6xmSp31rLBmpJRGvJZg=","X-Received":["by 2002:a05:600c:19c8:b0:475:de68:3c30 with SMTP id\n\t5b1f17b1804b1-47d1955797amr625520865e9.16.1767608654405; \n\tMon, 05 Jan 2026 02:24:14 -0800 (PST)","by 2002:a05:600c:19c8:b0:475:de68:3c30 with SMTP id\n\t5b1f17b1804b1-47d1955797amr625520015e9.16.1767608653978; \n\tMon, 05 Jan 2026 02:24:13 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IH56GA4efG7B2OzQ0Aewmdz54Pcuev3uOo1oVWIXVwA/FVdQsFx27IxznLILFQrKrOhjUPG+g==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Vasiliy Doylov <nekocwd@mainlining.org>","Cc":"libcamera-devel@lists.libcamera.org, Hans de Goede\n\t<johannes.goede@oss.qualcomm.com>","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","In-Reply-To":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org> (Vasiliy\n\tDoylov's message of \"Mon, 05 Jan 2026 11:11:12 +0300\")","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>","Date":"Mon, 05 Jan 2026 11:24:12 +0100","Message-ID":"<85fr8kjr1v.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"McJY6y6jaxcsUfKoi9FJQMqwuInf5rqrqcaUqGk2r-k_1767608655","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":37463,"web_url":"https://patchwork.libcamera.org/comment/37463/","msgid":"<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>","date":"2026-01-05T10:26:01","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","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 your patch.\n\nOn 5-Jan-26 09:11, Vasiliy Doylov wrote:\n> If camera sensor helper is not set, again10 will be 0.\n> It will prevent exposure change, because again will be clamped to againMin\n> and condition again > again10 will always be true.\n> Exposure decrease change will never occur.\n> Fixed by adding again > againMin check.\n> \n> Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>\n> ---\n>  src/ipa/simple/algorithms/agc.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp\n> index 189de770..2972844b 100644\n> --- a/src/ipa/simple/algorithms/agc.cpp\n> +++ b/src/ipa/simple/algorithms/agc.cpp\n> @@ -71,7 +71,8 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou\n>  \t}\n>  \n>  \tif (exposureMSV > kExposureOptimal + kExposureSatisfactory) {\n> -\t\tif (again > context.configuration.agc.again10) {\n> +\t\tif (again > context.configuration.agc.again10 &&\n> +\t\t    again > context.configuration.agc.againMin) {\n\nboth again10 and againMin get set by src/ipa/simple/soft_simple.cpp:\nIPASoftSimple::configure(), if there is no camera sensor helper\nwe hit the following else block:\n\n        } else {\n                /*\n                 * The camera sensor gain (g) is usually not equal to the value written\n                 * into the gain register (x). But the way how the AGC algorithm changes\n                 * the gain value to make the total exposure closer to the optimum\n                 * assumes that g(x) is not too far from linear function. If the minimal\n                 * gain is 0, the g(x) is likely to be far from the linear, like\n                 * g(x) = a / (b * x + c). To avoid unexpected changes to the gain by\n                 * the AGC algorithm (abrupt near one edge, and very small near the\n                 * other) we limit the range of the gain values used.\n                 */\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.againMinStep = 1.0;\n        }\n\nSo I guess you are hitting the case where againMin == 0 and then we come\nup with an artificial againMin value causing againDef < againMin and\nthus also again10 < againMin.\n\nI've always considered this whole overruling of againMin a bit weird,\nit feels to me that if a sensor driver advertises againMin = 0 that\nthat then means that we should be able to actually use an again of\n0 instead of avoiding it.\n\nSince you seem to have a sensor with againMin == 0, can you try\nwhat happens if you just remove the code to override againMin in this\ncase ?\n\nRegards,\n\nHans\n\n\n\n\n>  \t\t\tdouble next = again * kExpNumeratorDown / kExpDenominator;\n>  \t\t\tif (again - next < context.configuration.agc.againMinStep)\n>  \t\t\t\tagain -= context.configuration.agc.againMinStep;\n> \n> ---\n> base-commit: 2861817f09c96a0660b88783eff159631e42030f\n> change-id: 20260105-softisp-agc-16d01cb3da49\n> \n> Best regards,","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 B6AC8BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:26:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 25E8961FB9;\n\tMon,  5 Jan 2026 11:26:07 +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 9EE9461F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:26:05 +0100 (CET)","from pps.filterd (m0279870.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t6058KfHB3576818 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 10:26:04 GMT","from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n\t[209.85.219.72])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4beu6t448m-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 10:26:04 +0000 (GMT)","by mail-qv1-f72.google.com with SMTP id\n\t6a1803df08f44-88883a2cabbso548065426d6.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 02:26:04 -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\ta640c23a62f3a-b8037f0b7bcsm5652371066b.49.2026.01.05.02.26.02\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 02:26:02 -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=\"QIK4T0t+\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"DuRdySO2\"; 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\tmIfyPx2ciPHUZVuVB71T4M7seMRpGlDQIIt3VF55R4E=; b=QIK4T0t+U6webm7Y\n\tJtPvWQijmx+EZ3Ro1x01hOMxKlDihMIwOKMQkjgvwsc1qXyuelEIGbKTYvvBrbCL\n\tbiA1tBHxxxQ6+VZSpgeJBwUjeTU/27qpDMMbyr6vLE/QejEliHV05miEpqhDXphg\n\tFGaabpf2c5jgzYkkaX4PeZDN1FmHGUOsSqC/bg0BOIIPN542DhVu0ID6LkJO0xlb\n\tp91kuZbs4P0ilaFNFrVJIMTjIfQGmQimLGVozH5DWMWJOou//fm/eRMQMfJ8X6rs\n\tMVH1szSETwymnncgaHeaWCD7h6QVOHBHeJfl698AFskRqyC/Tp4XlzWYAhuw7Uxm\n\t9hf53g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767608763; x=1768213563;\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=mIfyPx2ciPHUZVuVB71T4M7seMRpGlDQIIt3VF55R4E=;\n\tb=DuRdySO2JbnRPoMN0NNAFj8KeeE7fbFTNYCuq1EmZMhQRNceS34rswSylahpLA7Dcn\n\tAEQw0ccqwY64ZxSBDpHVXbaqr18WcGDyHDaS9O8ibslGFRvLS92Aq7hmdQpr5wLVEkJ4\n\tl5SnxWeEMRDN4pNDNN+UFM25TtJ25tS125nLXPDCumaMVZLOqKfSKL7dycXUTDUDNm0q\n\tRQ44bHOAYAr4kpni7jFjEe0N48HyG7Lg9GG22x6eseVUld3GwwgxCMkD5YrP14tXI+GV\n\taZ8yyLPRjs2VUR5upwhw8aLhovj2U2VSEjGUAmyjGasRLdIPdEh4CpNWdGFRTT2aHlfE\n\tGzAA=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767608763; x=1768213563;\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=mIfyPx2ciPHUZVuVB71T4M7seMRpGlDQIIt3VF55R4E=;\n\tb=q1MSxxcMG0LUUIb7qu60/htnbgeNUJFV8ACQYNcNaPQzNZJDWkZ+ZPvm7ZPV/cOcUS\n\tfcux5RV25YWL2D+R62CIsQYTzoZjIC/+v/tDIZ9PAeTT/tdTYLP+QN6rJ3okVz1y7Djx\n\tjiwqeb1HSjRePT7jBGSSO+sgdgHO/LJ+8gY6diAOyX6fZNmFGqAOJ4v7IkBmmOZRnOg/\n\t9pLa8r3DPpfTo/IUxNTqPAH5yR1iFSc61GyBVCukW5s4CrcVqazagQhdqwOmzii/SKE4\n\t7seyWs7KytW0Wa0TuiWt3hrviyfvKpUuBoECi2MCTNlzPVaRDxcS4QiSvjVZrav5ct8e\n\tKRXg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCVSIZhFIvV+7pQMFIKw0IBDx7IEHGuF+qkkX9HjpoC1O3rKf8Sdzq3oXocpe80TsfC3/mMeZonFr1ozEiGtqUY=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxAREbFH4xxcRnU3PlCka44mL/R5Z84dy/AIjM3OI9so+AZl4Tf\n\tmtdWErULyen3X1b6uh7vG/nvAr5Bp6GKpVFgf5WRpyQi1Z4BUNOgcb/YAI35jFaICDlQALU8jKx\n\tqUQTNjbl25R5XA1hXcsjsWzQUxR4hE8aGuL9qZdLuiLXqURirZFnjX9TNizI2R4o2ndBTfS6YzC\n\tZmFgGjTDlE","X-Gm-Gg":"AY/fxX7bWdMp63eX6STt8pDPo9yzDukV9+rAb7B0Ozb29HnVvR27fdj/JphPnvuxJbY\n\tqGhJpCjFoF7RslSkJ7hmMHx6qZsrA9+aXONZesw+66/fYpXB/f08CI0KZDnxzA5aP1CRVYKTLh9\n\tC/66bw8HCWYXtWyXVfVnUgj1sAc4cmfsHVar9s25tpQIvyySwyk2xFP+3zETEK5Z8o2lHitg5LW\n\tHsmHcVTVJ/pG9qUFpOcBz0Ad40Wj8bzU2fRlaQMMUfI5tKaSmn9NWOWLPFPIMGXDVuGAPHRfbap\n\tiiJjE7Q7kh5aoKOSkEXZBwbcXLHWaiBTmNtQIFZPV1t5ehSyXWoWdzncv1mXgih+8/OSbTkpVQF\n\tXz+xGykzl/jI1+GX++NanQyg3/xWxR+sbB5KGJTQVBUW9Li6ZE6gZIFD6H+Xz9kRHKTqg3c0Y1J\n\tSP1tCXMcjLHKiL6dDwrshKIoncxzMJhDb1/dc9rUIVf8eTuEUZQB98js2OSR7GxWOuZV3jvA1dj\n\tB/1","X-Received":["by 2002:a05:622a:258f:b0:4f0:2321:d5ce with SMTP id\n\td75a77b69052e-4f4abd6e3bfmr640457321cf.45.1767608763374; \n\tMon, 05 Jan 2026 02:26:03 -0800 (PST)","by 2002:a05:622a:258f:b0:4f0:2321:d5ce with SMTP id\n\td75a77b69052e-4f4abd6e3bfmr640457201cf.45.1767608762935; \n\tMon, 05 Jan 2026 02:26:02 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHvYeaUUdrLOmPAqkc2RT4OTcNwXaM90L56SSEk9GLII0Qgu7tTbsrw1QirnyxF/1rXDUBPqQ==","Message-ID":"<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 11:26:01 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDA5MiBTYWx0ZWRfX+OczJP3Lmvo7\n\tujI1YDvLj4fzstDTxbIj7pHmnhPZgi/QdCv7+oLsz80XeclvNCWYl2Cz3ShjNCRJlL/4K16BO0a\n\tmF2eTsIBx8K95S6Mb8SRRWvHRKnmMfWB2QI1XPjlMDmdBX5txwa2m/65Rnn/1xWYSAup/g2UtkJ\n\tTZSxVNtGixRkq3yavwokrb3wboXr6zcu2Ut8CVAze3ApkjbPYOYifYz2Mpow5yHM4fwnLdt7ZIt\n\tX440nTZG+Pmga4ACFiMETp2BESyA1ItaA5+4G1YBacb4/KDLTeyXKemjDliK1YkDu2kQPF8wQ/o\n\txYI8tmcHkhyu9ysZDAQwg2VvXquPRIUrZJc/rs9fLPnKAolNdUXdkSf45MovPvFT/PtJGNKl+Gt\n\t1jL5J69OyPNv47kDdIfOi5cx7Y07qDMelLK6RopilWzuxcEKd0BAQsQ+8SzI5VLLFzBgZ7IP9LS\n\tKXIlys1eDE7V1Angr+g==","X-Authority-Analysis":"v=2.4 cv=HLbO14tv c=1 sm=1 tr=0 ts=695b91bc cx=c_pps\n\ta=7E5Bxpl4vBhpaufnMqZlrw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n\ta=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=OuZLqq7tAAAA:8 a=DF60tfNGtzaFwhSvYT8A:9 a=QEXdDO2ut3YA:10\n\ta=pJ04lnu7RYOZP9TFuWaZ:22 a=AKGiAy9iJ-JzxKVHQNES:22","X-Proofpoint-GUID":"JvH5H9T4A8hbMu4bLC8ewxTGaBvJm4nS","X-Proofpoint-ORIG-GUID":"JvH5H9T4A8hbMu4bLC8ewxTGaBvJm4nS","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\tbulkscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0\n\timpostorscore=0\n\tspamscore=0 priorityscore=1501 adultscore=0 phishscore=0\n\tsuspectscore=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-2601050092","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":37465,"web_url":"https://patchwork.libcamera.org/comment/37465/","msgid":"<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>","date":"2026-01-05T10:44:31","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":255,"url":"https://patchwork.libcamera.org/api/people/255/","name":"Vasiliy Doylov","email":"nekocwd@mainlining.org"},"content":"On 1/5/26 1:26 PM, johannes.goede@oss.qualcomm.com wrote:\n> Hi,\n>\n> Thank you for your patch.\n>\n> ...\n>\n> So I guess you are hitting the case where againMin == 0\n\nMy setup:\n\nOneplus 6 (oneplus-enchilada)\n\nRear wide camera imx376 (which has no cam helper)\n\nagainMax = 480\n\nagainMin = 100\n\nagain10 is set to 0 (for some reason?)\n\n\nif (exposureMSV > kExposureOptimal + kExposureSatisfactory) { // \nOverexposure detected\n         if (again > context.configuration.agc.again10 /* will always be \ntrue, because again clamped to againMin at the end and again10(=0) < \nagainMin(=100) */) {\n             double next = again * kExpNumeratorDown / kExpDenominator;\n             if (again - next < context.configuration.agc.againMinStep)\n                 again -= context.configuration.agc.againMinStep;\n             else\n                 again = next;\n         } else {\n             int32_t next = exposure * kExpNumeratorDown / kExpDenominator;\n             if (exposure - next < 1)\n                 exposure -= 1;\n             else\n                 exposure = next;\n         }\n     }\n\n     // Clamp to againMin(to 100)\n     again = std::clamp(again, context.configuration.agc.againMin,\n                context.configuration.agc.againMax);","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 62978BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:44:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8AC7161FB9;\n\tMon,  5 Jan 2026 11:44:33 +0100 (CET)","from mail.mainlining.org (mail.mainlining.org [5.75.144.95])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7512B61F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:44:32 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=mainlining.org header.i=@mainlining.org\n\theader.b=\"DNaQENWX\"; \n\tdkim=permerror (0-bit key) header.d=mainlining.org\n\theader.i=@mainlining.org header.b=\"NYjkZeUL\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; s=202507r; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767609871;\n\tbh=INih+PnA7cI8LaoYx8F0Z/F Hq0b8BK81eubmtkY7w6o=;\n\tb=DNaQENWXXYlHnzYNqobUSThYuVqvm1JUCbBWhRSKubK8x1BHzX\n\tHfPulCyCSW4uJGVDHrpDHlKDuixz5/8t3jNfbCl5fxJiJlIZ1YL7iNN3XOrPqeuXhb9AuOV3okj\n\tcKOKEb2m2ug5erCNheFhV2ZqW3Mr7IY0sPmYoU0bkxXj5KOUYs8ff/Pfc0SyLXPvXh89iN7Q78+\n\tfCFTCZHcmgv6Hohe1ORKezB33uUJCvA1JjX5LvxwlpO0p0Dsjeu1V9c8P17hJXJXI0rPOFB+Hpq\n\toaTnog6+13K0QoEmElW7lITnO6RDChgZ1Uhc0FhU/qhJUKGndBUCODk25eoSWs/Ri3g==;","v=1; a=ed25519-sha256; s=202507e; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767609871;\n\tbh=INih+PnA7cI8LaoYx8F0Z/F Hq0b8BK81eubmtkY7w6o=;\n\tb=NYjkZeULSqRUgjrGqGnndwWTB505dmKColby1DvRCSA6j/wsNN\n\tDJ1eie1K7DtURzeEACTRCcT5pYn0nuJjGyDQ==;"],"Message-ID":"<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>","Date":"Mon, 5 Jan 2026 13:44:31 +0300","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"johannes.goede@oss.qualcomm.com, libcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>","Content-Language":"en-US","From":"Vasiliy Doylov <nekocwd@mainlining.org>","In-Reply-To":"<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":37466,"web_url":"https://patchwork.libcamera.org/comment/37466/","msgid":"<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>","date":"2026-01-05T10:50:03","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"content":"Hi,\n\nOn 5-Jan-26 11:44, Vasiliy Doylov wrote:\n> \n> On 1/5/26 1:26 PM, johannes.goede@oss.qualcomm.com wrote:\n>> Hi,\n>>\n>> Thank you for your patch.\n>>\n>> ...\n>>\n>> So I guess you are hitting the case where againMin == 0\n> \n> My setup:\n> \n> Oneplus 6 (oneplus-enchilada)\n> \n> Rear wide camera imx376 (which has no cam helper)\n> \n> againMax = 480\n> \n> againMin = 100\n> \n> again10 is set to 0 (for some reason?)\n\nIf there is no helper, then again10 gets set to againDef\nwhich comes from this lines in src/ipa/simple/soft_simple.cpp:\n\n        int32_t againDef = gainInfo.def().get<int32_t>();\n\n                context_.configuration.agc.again10 = againDef;\n\nI guess that your imx376 driver may have a bug and is\nreporting a default value outside of the min max range.\n\nWhat is the output of:\n\nv4l2-ctl -d /dev/v4l-subdev# -l\n\nreplacing # with the subdev no of the imx376, specifically\nwhat is the reported default value for the analogue_gain\ncontrol there ?\n\nRegards,\n\nHans\n\n\np.s.\n\nI could not find an imx376 driver in the mainline kernel\nsources, so I guess you are using an out of tree driver ?\n\n\n\n\n\n\n\n\n\n>\n> \n> if (exposureMSV > kExposureOptimal + kExposureSatisfactory) { // Overexposure detected\n>         if (again > context.configuration.agc.again10 /* will always be true, because again clamped to againMin at the end and again10(=0) < againMin(=100) */) {\n>             double next = again * kExpNumeratorDown / kExpDenominator;\n>             if (again - next < context.configuration.agc.againMinStep)\n>                 again -= context.configuration.agc.againMinStep;\n>             else\n>                 again = next;\n>         } else {\n>             int32_t next = exposure * kExpNumeratorDown / kExpDenominator;\n>             if (exposure - next < 1)\n>                 exposure -= 1;\n>             else\n>                 exposure = next;\n>         }\n>     }\n> \n>     // Clamp to againMin(to 100)\n>     again = std::clamp(again, context.configuration.agc.againMin,\n>                context.configuration.agc.againMax);\n>","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 6829FBDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:50:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D77861FB9;\n\tMon,  5 Jan 2026 11:50:08 +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 D9BCA61F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:50:06 +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\t6058L8NH3874963 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 10:50:05 GMT","from mail-qt1-f199.google.com (mail-qt1-f199.google.com\n\t[209.85.160.199])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bfyx0hpa8-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 10:50:05 +0000 (GMT)","by mail-qt1-f199.google.com with SMTP id\n\td75a77b69052e-4f1b39d7ed2so311853921cf.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 02:50:05 -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-64b916b5777sm56783275a12.33.2026.01.05.02.50.03\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 02:50:03 -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=\"UXngIgMJ\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"CF1zh+g4\"; 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\t9BFswU3vyYEm1eYHHbmR6Lx0q0QvMTAV5+ILhvuJbpI=; b=UXngIgMJTtr272BY\n\tpdSpKs+zm8WUeHpFb2V/cJNwP7vxxSLzxYlICXzNJrtKMyYbPQ1aGBlKEiYF2Wsg\n\tNBODwywyi9LpttOSf1dVzE9zjnI1cMWqSNQcsTWMwMu1BfRnKF7b8mqUaJE3QPNp\n\taVOiltp0+zjic48XjGUzAgxLVOkJmZCklOAJi9LgtEfg0fv90kXgdZvK3hkvn05i\n\tJ5QWYYezQvmlrpWdtl5B6VmlcZC6HiJ1Pm3bI9Qn/1kgGXGlm41lf6jhnuFeaH0H\n\t1YLFCmP0XMlBchUmL/FjGFmicUkIE9HRYRPpJJfCHdTIK4pGNK4749WSh0BapRuq\n\tHqxj7Q==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767610205; x=1768215005;\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=9BFswU3vyYEm1eYHHbmR6Lx0q0QvMTAV5+ILhvuJbpI=;\n\tb=CF1zh+g4E30aMBFHK7Koo95FDVX1O/r5ZHS4nmP0b/fgWLNmuOtKMCZRUpn/USAZpP\n\twO2Kj/72IgCvm7lyF8mJaaC6sX/JvOSk2dt8IMm0p+ZBRsEopJ3EVFrm4sV9UOphGpE/\n\tbG3EGRJXeJEHu/Wn5Zr9yVLRXM6G3YK2usuP5P6LVqfJCjOMGxoWrSd+6CtehuxunazD\n\tDJfLTVddbL6anJSXPRD4OlGNp3HC3zXqfgpccP6mbGL2nv9M9hv3Nu0d6ublndKFr49N\n\ttNzbFXWtnP1rnZLb3R4pcBgCQ2wXOg6RP8/jbll0jppDl4zFKwrurl4VJCR7mpx6//cX\n\tQKwQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767610205; x=1768215005;\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=9BFswU3vyYEm1eYHHbmR6Lx0q0QvMTAV5+ILhvuJbpI=;\n\tb=EHoxPM4VM7rujOTpexo63sg3bE5Fo+236hPKuTw4I0Zt/z25IsTs/JTWVsk2e+Ghef\n\t+zRrhkNJClbCLMVIEJI5GHRO+quPNwUJrScL7K/agmGqXx8D/dSxwuyQjvK90CLbobVa\n\tYIlbkntO+BOHa0qovc/thrwHLUhYtjB39KpuX421WQNcGm8UpVdxWYmCSEjjnYqRM/aB\n\tfjmF9i6Qh1ARz4ffCeJpRcmt+pZgLNp9kG0UJvaTwOmS7KMcv2dyIBAgCq8n31cPWvSK\n\t0equ8draovuIOU/kHLaSzEdoVZqT/vw3UIMdfBrmNhbQtEOSEwPtZhf9NqYrGurlPHOx\n\tIrkw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWtBFUdPdvR+l9k3Uv89MZhE7aYAISBJIUyw/Gj/zOhUbjLi5u7Q7TTqjFy5s9rW5O80LWg/SBWDAsomA3zc9w=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yxx03yG9MOnWq8E32RjHkliPIT5nZUhv0r24YDyHrPUZWVv8oB9\n\tcgt8UTSOllYVFBT1g80CGy1tW55TaRdIPY5hThsEAx11OrFB6T9NjzBPAenVUKjQlCdahmTuNzc\n\t7wKB30uu1vQUO8rKP5aDVLv7wlpsS15G0iIcRQFWAJtx6680LF4bd27TBzD0hZ1P+mLiFO18jAs\n\tAFbBHQ52Es","X-Gm-Gg":"AY/fxX6UBzLbmt938G+hiiGNQC9nLnOBWKzKZmtqTmi/kNPfzOuz0Mub2hyJ/k7+Hln\n\te8zByTqJ2iRxMth0qJX/wlQZOFIJh85kg9D5ziD6QgQbSzpSh7744SdqECE0zyvsM55fnL5PCMA\n\ttr5wS2jSThMsvvnraLlbNWy2tL/KPyeLdvfdGM8fJ1fwe3U4GXQ9ndHPumiemp+DuwLaVK6NJCW\n\tmNIQxn5+jTgBQhQtgPFaTpDO4X5yW/VAhINYzYpEiD7Hsil5aUiFW2U+18DZyEZkn14Pc/BxNJ4\n\t8bYqE9J2C5jSJ7myPyk0dkpLCKZ/dl8nrrJtLCgXB0Eu3VGllMZL1/wUKyLgxn2/BFmk//Xy9GR\n\tdmxmuF7MbAqMfYeH6+nVQEyZb2HJKWf54WCuaYW43eb3ua2OtAormlXu32CDS+F/e67MYomZGHt\n\tlrPq8LqChgjUoQIwRTctsNzarqcBo+vjuwIMCmW/AIA3vctwotZUuHE3YEL2Aimr+/22ImQr00P\n\triD","X-Received":["by 2002:a05:622a:5984:b0:4ee:4a3a:bd07 with SMTP id\n\td75a77b69052e-4f4abddba83mr746845221cf.75.1767610204825; \n\tMon, 05 Jan 2026 02:50:04 -0800 (PST)","by 2002:a05:622a:5984:b0:4ee:4a3a:bd07 with SMTP id\n\td75a77b69052e-4f4abddba83mr746845081cf.75.1767610204402; \n\tMon, 05 Jan 2026 02:50:04 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IE7lCqlP98zLBX1ut7yjhlGeUcPHZXbx5PdkrWOPSsd1AMuHtlh2BG0K7R/0a/B925tjozBew==","Message-ID":"<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 11:50:03 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Authority-Analysis":"v=2.4 cv=CZYFJbrl c=1 sm=1 tr=0 ts=695b975d cx=c_pps\n\ta=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n\ta=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=EUspDBNiAAAA:8 a=hDZynmz1Trs9YTxSMRYA:9 a=3ZKOabzyN94A:10\n\ta=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDA5NSBTYWx0ZWRfX6RHfwup/rnsK\n\tNCLd+hGV3D0dhmTc/DPlN9bpHuxFf3oSM6XzHIU3ffSPJ7FSRLU3hGa3a80EuHwYKrxd5XvJVhZ\n\tlR3YNLr1hVy4B0jLuWuZe2UcYGzaQNoBKmuOk/k2oLWJpV5ma4aSZPIUdBCYW+drPAHBtSaWmDM\n\tKhIwZsLl1cLbzAh3ltI/5eoYloHhGkFR4PPP4uXtkVVqnHvfHbIbWuqAt4wUval9f/xo93PFsmK\n\tXFnm8CIuPsrXRAT6N3UbIrMuSh2oQVqFpp6rMPtDeCmhdDGbhTrKBbii5PILQq6wDuaf1x4KCk8\n\tyRa4xiVdsHpSxHO93jIEBUmVeVfCUkOmqo91gRPlAg4cWIKY4D0k0d5QvRtB8B+FE82A5S92vHO\n\ttI26Ggbu5FJpywHItFe3b4HN9zb4ySNDvUNy2e22e40j1hpl3mknkIO/zissNw4GnP9oJ3qbIMb\n\t63eVDui80YW0fEmBt0Q==","X-Proofpoint-GUID":"OJMLrn_uefQYl963J3NMlaNbTg3gZT7U","X-Proofpoint-ORIG-GUID":"OJMLrn_uefQYl963J3NMlaNbTg3gZT7U","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-2601050095","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":37467,"web_url":"https://patchwork.libcamera.org/comment/37467/","msgid":"<fc5ea0df-76c7-4387-974a-d0625912ce1d@mainlining.org>","date":"2026-01-05T10:51:12","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":255,"url":"https://patchwork.libcamera.org/api/people/255/","name":"Vasiliy Doylov","email":"nekocwd@mainlining.org"},"content":"On 1/5/26 1:24 PM, Milan Zamazal wrote:\n> Hi Vasiliy,\n>\n> thank you for the fix.\n>\n> It should be set according to gainInfo\n> (https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/simple/soft_simple.cpp#n201)\n> in this case.  Do you mean the case when gainInfo doesn't contain\n> meaningful values?\n\nMaybe something broken in gainInfo handling, because v4l2-ctl shows me\n\n\nanalogue_gain 0x009e0903 (int)    : min=0 max=480 step=1 default=0 \nvalue=100 flags=has-min-max\n\n\nBut libcamera reports that min gain is 100 and max 480.\n\n\nI think we need to set againMin to 0 or calculate somehow again10 in \nsrc/ipa/simple/soft_simple.cpp:252\n\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         }","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 AAFAABDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:51:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6129961FA3;\n\tMon,  5 Jan 2026 11:51:15 +0100 (CET)","from mail.mainlining.org (mail.mainlining.org [5.75.144.95])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7456461F84\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:51:13 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=mainlining.org header.i=@mainlining.org\n\theader.b=\"Ktso6pGI\"; \n\tdkim=permerror (0-bit key) header.d=mainlining.org\n\theader.i=@mainlining.org header.b=\"dNxjBVl2\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; s=202507r; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767610273;\n\tbh=5KllUUFIYYzoQVJuLUUGmYC Vyv0Y3UIAKN9J4Gau2Zo=;\n\tb=Ktso6pGIraaycUWWifiZA22ihZGDAfjmDd7PCSut+v2s7IWq62\n\tJp7lk2N3f0C/tvJvcQEyi5WsgW8wF2ah0Y3Hr1IPb2l2Ef/dnaQVUoYuxkdwXHiE+Fj55M7C/Rt\n\tcYp+9SuhVmWpSMS6MpcEBFsXWhD0SsNAiuRpEbLVbxscOVJB1tJ66OQsLUVYomEENzGGS7QMivf\n\twdeLGGMmNAgby53rlasZSzD+6857VIfoUS+FLWWj1+OR94CSqNPYDbOD14BhiWmqOP0YWGwpiTr\n\tPxu4dGuHPhnotO0Mlq7kRF8sayrOQ0LDBRLSnuKwHHUdPgqNqFcJ0bJ43bZPNdcqxHQ==;","v=1; a=ed25519-sha256; s=202507e; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767610273;\n\tbh=5KllUUFIYYzoQVJuLUUGmYC Vyv0Y3UIAKN9J4Gau2Zo=;\n\tb=dNxjBVl22DEwpS4h7elZePYFIfIWsm/ORK79+ZJpB5xZbuwQfV\n\tC0a5jWOo8w1XO3UaoQrhulg/uuKp9x0Hr/BA==;"],"Message-ID":"<fc5ea0df-76c7-4387-974a-d0625912ce1d@mainlining.org>","Date":"Mon, 5 Jan 2026 13:51:12 +0300","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<85fr8kjr1v.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Language":"en-US","From":"Vasiliy Doylov <nekocwd@mainlining.org>","In-Reply-To":"<85fr8kjr1v.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":37468,"web_url":"https://patchwork.libcamera.org/comment/37468/","msgid":"<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","date":"2026-01-05T10:54:40","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":255,"url":"https://patchwork.libcamera.org/api/people/255/","name":"Vasiliy Doylov","email":"nekocwd@mainlining.org"},"content":"On 1/5/26 1:50 PM, johannes.goede@oss.qualcomm.com wrote:\n> Hi,\n>\n> On 5-Jan-26 11:44, Vasiliy Doylov wrote:\n>> On 1/5/26 1:26 PM, johannes.goede@oss.qualcomm.com wrote:\n>>> Hi,\n>>>\n>>> Thank you for your patch.\n>>>\n>>> ...\n>>>\n>>> So I guess you are hitting the case where againMin == 0\n>> My setup:\n>>\n>> Oneplus 6 (oneplus-enchilada)\n>>\n>> Rear wide camera imx376 (which has no cam helper)\n>>\n>> againMax = 480\n>>\n>> againMin = 100\n>>\n>> again10 is set to 0 (for some reason?)\n> If there is no helper, then again10 gets set to againDef\n> which comes from this lines in src/ipa/simple/soft_simple.cpp:\n>\n>          int32_t againDef = gainInfo.def().get<int32_t>();\n>\n>                  context_.configuration.agc.again10 = againDef;\n>\n> I guess that your imx376 driver may have a bug and is\n> reporting a default value outside of the min max range.\n>\n> What is the output of:\n>\n> v4l2-ctl -d /dev/v4l-subdev# -l\nanalogue_gain 0x009e0903 (int)    : min=0 max=480 step=1 default=0 \nvalue=100 flags=has-min-max\nThan again10 is ok. againMin is shifted up here. So i think we need to \nalso shift again10\nsrc/ipa/simple/soft_simple.cpp:252\n```\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```\n>\n>\n> p.s.\n>\n> I could not find an imx376 driver in the mainline kernel\n> sources, so I guess you are using an out of tree driver ?\nYep, it's on sdm845-mainline (close to mainline tree)","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 1FBBABDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 10:54:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C82461FBD;\n\tMon,  5 Jan 2026 11:54:42 +0100 (CET)","from mail.mainlining.org (mail.mainlining.org [5.75.144.95])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 33AD561FA3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 11:54:41 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=mainlining.org header.i=@mainlining.org\n\theader.b=\"Z4FzjlAb\"; \n\tdkim=permerror (0-bit key) header.d=mainlining.org\n\theader.i=@mainlining.org header.b=\"UOGorsaf\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; s=202507r; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767610480;\n\tbh=ei9D4aEMBT5YAj3CR95ESF1 7nrOziYqdT0YrKnUeZ4o=;\n\tb=Z4FzjlAbouVnDXXJGBd0nnzWKtB29HyVyDt4kpzTmi+214qN94\n\tDdeVOyu2WYYk9rXTOrBD+NpdbA8Vt+5ZBGbdtHGgIN4FJUvnGYuLRNOYFdnIm/Iry6UITdwIj5q\n\tw8tamFz66qDyVn0PWeaYh7noa8813lwFiqaw+uk5iqaRcwfuIptlXRg5xZ/wosoqOBkaebg0QzV\n\tqzauRvMA5DMAls9/qnblVJZVWktsvmMK1uocnaXzlDku+8tBn+DAProDuMJfYOq7x3gEMURL3rM\n\t51Bp16++50gG5QZVvweKgCqzMx3Gy0rv2o+MEpSk+I26a7qOChVNLJ7aYj2cp+6RJvg==;","v=1; a=ed25519-sha256; s=202507e; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767610480;\n\tbh=ei9D4aEMBT5YAj3CR95ESF1 7nrOziYqdT0YrKnUeZ4o=;\n\tb=UOGorsafDueHTOInWjJKL974VQNy5tjh83SyW8DRadpZi/Ptss\n\t4WVkOG2gHOFeMX+rk7dfvk00pqjYkGd+4NDQ==;"],"Message-ID":"<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","Date":"Mon, 5 Jan 2026 13:54:40 +0300","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"johannes.goede@oss.qualcomm.com, libcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>","Content-Language":"en-US","From":"Vasiliy Doylov <nekocwd@mainlining.org>","In-Reply-To":"<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":37471,"web_url":"https://patchwork.libcamera.org/comment/37471/","msgid":"<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>","date":"2026-01-05T11:12:12","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":255,"url":"https://patchwork.libcamera.org/api/people/255/","name":"Vasiliy Doylov","email":"nekocwd@mainlining.org"},"content":"Removed that shift and i see no bad impact on result image.\n\nWas that shift an edge case for something?","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 BEB1DBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:12:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 00EA061FBB;\n\tMon,  5 Jan 2026 12:12:16 +0100 (CET)","from mail.mainlining.org (mail.mainlining.org [5.75.144.95])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F6C161F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:12:14 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=mainlining.org header.i=@mainlining.org\n\theader.b=\"nOclIIZZ\"; \n\tdkim=permerror (0-bit key) header.d=mainlining.org\n\theader.i=@mainlining.org header.b=\"j7GNule6\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; s=202507r; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=To:From:Subject:Date:Message-ID; t=1767611533;\n\tbh=Ukxw6Ikxn+/46rwJ6Y2/7km nr8NMHJohjfLaY8wB9oI=;\n\tb=nOclIIZZyOlHz3lgmC0v53ER/86ceOIiFJOmmHXDD7tDqwpy53\n\t22HJrn2EhvhH06dCzbOtrgh3JErI1gxJp4tKTzbhfQ5qgDo6WWSP1oPA0RsErSeS/nk0ZaWBMm8\n\tIu5c4fjwY8GcrKwdnMUl3PCLp9q6p2uKoDYPFahIOsf1Ptk4sldb+zlxQwtrVAAg7E4juM2RT8r\n\tBw5WTO6G+7sMCXD5OwcqILoOSL+vLhr9LJ+NS0FqyJVYmAKy73wBS9M+cWeYSAI+Sa5pIQV5SCQ\n\tS8FDJT2Sq8xTG8MAcgD0cVGwZvWh+B8clzxx8mD7kwg5vuzgSp259spbcS0cj/rDWTw==;","v=1; a=ed25519-sha256; s=202507e; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=To:From:Subject:Date:Message-ID; t=1767611533;\n\tbh=Ukxw6Ikxn+/46rwJ6Y2/7km nr8NMHJohjfLaY8wB9oI=;\n\tb=j7GNule6Wm85BkVLi+mMGSWe9ntbArMQXOaBvz134gDbb+Do5e\n\tXnNbX6TtFes+1/pLQsU+sysCYzRDnPbb+sBQ==;"],"Message-ID":"<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>","Date":"Mon, 5 Jan 2026 14:12:12 +0300","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","From":"Vasiliy Doylov <nekocwd@mainlining.org>","To":"johannes.goede@oss.qualcomm.com, libcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>\n\t<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","Content-Language":"en-US","In-Reply-To":"<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":37472,"web_url":"https://patchwork.libcamera.org/comment/37472/","msgid":"<f0b215d2-df40-4c53-bc85-bfaa007124fd@oss.qualcomm.com>","date":"2026-01-05T11:13:49","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"content":"Hi,\n\nOn 5-Jan-26 11:54, Vasiliy Doylov wrote:\n> \n> On 1/5/26 1:50 PM, johannes.goede@oss.qualcomm.com wrote:\n>> Hi,\n>>\n>> On 5-Jan-26 11:44, Vasiliy Doylov wrote:\n>>> On 1/5/26 1:26 PM, johannes.goede@oss.qualcomm.com wrote:\n>>>> Hi,\n>>>>\n>>>> Thank you for your patch.\n>>>>\n>>>> ...\n>>>>\n>>>> So I guess you are hitting the case where againMin == 0\n>>> My setup:\n>>>\n>>> Oneplus 6 (oneplus-enchilada)\n>>>\n>>> Rear wide camera imx376 (which has no cam helper)\n>>>\n>>> againMax = 480\n>>>\n>>> againMin = 100\n>>>\n>>> again10 is set to 0 (for some reason?)\n>> If there is no helper, then again10 gets set to againDef\n>> which comes from this lines in src/ipa/simple/soft_simple.cpp:\n>>\n>>          int32_t againDef = gainInfo.def().get<int32_t>();\n>>\n>>                  context_.configuration.agc.again10 = againDef;\n>>\n>> I guess that your imx376 driver may have a bug and is\n>> reporting a default value outside of the min max range.\n>>\n>> What is the output of:\n>>\n>> v4l2-ctl -d /dev/v4l-subdev# -l\n> analogue_gain 0x009e0903 (int)    : min=0 max=480 step=1 default=0 value=100 flags=has-min-max\n> Than again10 is ok. againMin is shifted up here. So i think we need to also shift again10\n> src/ipa/simple/soft_simple.cpp:252\n> ```\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> ```\n\n\nRight, so you are indeed hitting the againMin == 0 path and then\nthe code decides to override againMin.\n\nWhich is what I expected. If I'm reading the sensor-helper class\ncode correct then on most imx sensors the formula seems to be:\n\nagain_float = 512.0 / (512.0 - again_ctrl_value).\n\nso the default of 0 makes sense and actually translates to\na gain of 1.0. And the max gain of 400 leads to\n512.0 / 112.0 = 4.57 which is about typical for a max\nsensor gain.\n\nSo as I already suspected but I never found a way to test\nthe above code block you quoted:\n\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\nis non-sense and the fix is to replace this entire block with just:\n\n         context_.configuration.agc.againMin = againMin;\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 1DDB7BDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:13:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C233961FC0;\n\tMon,  5 Jan 2026 12:13:53 +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 9E78F61F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:13:52 +0100 (CET)","from pps.filterd (m0279873.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t605562Mw3521011 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 11:13:51 GMT","from mail-qt1-f197.google.com (mail-qt1-f197.google.com\n\t[209.85.160.197])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bg6uu92ag-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 11:13:51 +0000 (GMT)","by mail-qt1-f197.google.com with SMTP id\n\td75a77b69052e-4edb6a94873so280600961cf.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 03:13:51 -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\ta640c23a62f3a-b8037f089fesm5530515266b.46.2026.01.05.03.13.49\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 03:13:49 -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=\"Rt2s36JG\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"ZNiDEcDi\"; 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\trw54gZiBeCOV49kCh0KeP3FOmQ+sHM2TDe0Gwm9cpAc=; b=Rt2s36JG5qs0TgwH\n\tFmgxBucPAD51o8MB32Wt4fM2BzpeBM+XAmizQZLENdEDKGEMTddf5fSvhBpQtjwW\n\tW/K9+p0UJ9GtWMLymUNjB50gFwrJP1O/2mXJ4Uj0nq2G8EBupmvh5+V1IlEw9zN8\n\tnmDrUc+TFV4rt9PZ2bBVYKgM5lMgkxdrkAeojfi77GkJvyUgMwz6r5m8fJ3hG+GR\n\tmqupn8c2CQWP2TECRY/7Mojxhnu7ym2VGdimKgJdZ1CCryG7VrVez/l7D8F4dlOw\n\toN3bW9R3l8eOXuhMtutGVtEvLAApfsohLIiUGUmrsYKyq2BAyQ+g/iwymQITmwtL\n\tQaxwRw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767611631; x=1768216431;\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=rw54gZiBeCOV49kCh0KeP3FOmQ+sHM2TDe0Gwm9cpAc=;\n\tb=ZNiDEcDi7X+aA/O7wJTvToNU+0b2BYeXxMLugOHKGPvl9F7i8QCTM1zRIJG95G0khF\n\tcAP9WnZlMZd3YNOL2b11mBSwNa+WsYGOBmz89zzYFuqEQ0DDcvhbTMrR0Wjfu+8YgPct\n\thuy0u0fgsoUMRsxxMLhU7cw1cbz86bPk34etpyO2Yx0NrBMArhfMkrgjtYn5sNnx+Nva\n\ts+o5r6XnD/UkPMgHiDQthWXppF+a5ZMCgvG3mLr9yXg+FevnuZroOzw2Y8nCDyolU4UH\n\tMaThlvlIO9HolShsL8J6XMe7NhbYTwvkBtWk7u1XVXy6SW08kjVtlzZHu9+qWt2dEXlZ\n\tC6dQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767611631; x=1768216431;\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=rw54gZiBeCOV49kCh0KeP3FOmQ+sHM2TDe0Gwm9cpAc=;\n\tb=Bt8I4EFthFF1bVXD+X5aZPSAUcR5pAwgTm+FGxzJ9AwtWpjEUCxfws8bH8ZKe+NFlQ\n\t1F5VK/FmOtvyoso18lLNwRF4tN1ys3+WRf59CQjJTSyxn5WcYagvey9nB5dIBa27hPLt\n\tbmU9f02lcMtGx26FS12pLOqYbKB+0j+DjjtgmBZ6S2niAy0axmNsx4qdEkLD2AZ1XEB4\n\tgfodi0iVvEHM2xvpFo23L5ZID+kImd3Pqfyt4lSqgJBHxNl7FxJZ7xlAG5q3MoYXuxIc\n\t+DFygNOsONTsp7dff5tWIGVXVdONF9nke9WH6ZlVVKxQkZ6lWsQOzt8KkaHMFxP5i88t\n\tOBHQ==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCU2SNCFDeGop9o9N1UvtEQkRrrthrHOmIidT1V1GB4KTouyNfOY1w3t6ajP7ox/uVud9VymCxU5jhp0z6zDvys=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yzrzw20VmKZq9/AiyrssdFO+jAiDBgWATYwWZjbQFxMmAdMJDdI\n\thbiqcbEnyBn0Ngy//i+DbWHaL4XAKE75fb2jEbUcHOlFvOf9Yv+uqYkL8XEStJYZ1FTedP4PguY\n\tXduk1IDvyXYMMz0CReXduyarPHHPevY0DI+9r2w4FKHdZE6jF9IwQgzjaY1/Xn5bR81ThRqeRJf\n\tsw","X-Gm-Gg":"AY/fxX6SKSOhP4Y8GBjSyda7tpcsZdgvmsMixJKCC96lB0vww2qFm9z6WCZTzhKMMMh\n\tjsg4GO5G1QJdbmegQsbUn9qjQLVM0RwMMMkHc+17CpCbsGKvEKRbGgKyznmv0GFaXNg/bUfNLf2\n\tyWudSZxF2pg8NN0jQtpVTaQs1OgF3zJv+S7Y/nKAyxQYFhBI+8U/nLnzCocOP8rGi8bszA4T6Lq\n\t/A0NI9KJKARxYZsgj/WmcmZNBmjOfGwtVOAl4AWiQS7qYHL43d3vY73VlWJIebpIK8uOfeCAQDE\n\to6oV4gSSDB1YbEB+4cXsKx8Eu/gwwR/9Z1LhxLGAcgOogawWnvDofAaVkGvgtD8RF6i5kfbXBrf\n\tQPnH5XgSNmVmRS0sHvugSVg1WQkq15Hb9VgXh85/2Wyl56cIdOXVz/K8o79r0060iFgvJ3Zk4+z\n\tSCYly0RuOcesOTHCFXpAL1BtTiO96MtJXKdxXwMGBZ+Swc3761qGnAs7g7yccguoTssXoZkfRpD\n\tsGT","X-Received":["by 2002:a05:622a:2618:b0:4ee:24fc:bea3 with SMTP id\n\td75a77b69052e-4f4abd2a521mr688414611cf.35.1767611630935; \n\tMon, 05 Jan 2026 03:13:50 -0800 (PST)","by 2002:a05:622a:2618:b0:4ee:24fc:bea3 with SMTP id\n\td75a77b69052e-4f4abd2a521mr688414321cf.35.1767611630473; \n\tMon, 05 Jan 2026 03:13:50 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IGFLND4jjfFVXS1f73gS345v5hpw0+5MzlxLcMdZCtCuUYzWe5mnfhwW//binuGKmxHkWbqqQ==","Message-ID":"<f0b215d2-df40-4c53-bc85-bfaa007124fd@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 12:13:49 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>\n\t<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDA5OCBTYWx0ZWRfXxHj8Zuax0fql\n\tyWqD/V80Y9lKGYTXTqYRc6sNcuZYmV8/ShduYEpSgcOypfYrQ0TBP+DweSkEjCNjWm0WqOJ+rGq\n\tPx4UTLTEHjzU/lJzExTnFN572mMKTmcKMhy5E4tg9qoh8AfL3H0JuZ5RdDLad1/iiZD4uJtJLu4\n\tCTbzaiKOjUVIXLS8uby3vL9TPnvl4F7a0yg5T8coACWOYAUU7vFP7OqcdvvY0JJgGKqquRavyfQ\n\tzQRhW8+wDtna68PtxnS82Z8Th4mKE1RBwdQ4JTrQ/Dz/2jsURDAqOA+2O5pWcxwZFLLWNTykYXV\n\tVXqnyYi8DgNZMQsVwE5F3/hnObW92atAvvPis20BOof3Pqk8T8aP595GaVoiTDw0pQZaBA/vOt0\n\tQJU+L/QDM5QeP1YNYL9pEcdtxj0EVyej1s7H4xt1KUUjfzbayWMbFs9myhD26/IFT+YiHdwscmk\n\tuELdovHao9zGZL9mfEw==","X-Authority-Analysis":"v=2.4 cv=eZ8wvrEH c=1 sm=1 tr=0 ts=695b9cef cx=c_pps\n\ta=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n\ta=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=EUspDBNiAAAA:8 a=7uiYsVH9BKV_fLH4bYcA:9 a=3ZKOabzyN94A:10\n\ta=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22","X-Proofpoint-GUID":"uuxfAXgAeZIee4NDYQp7ldKPzlRgYYpf","X-Proofpoint-ORIG-GUID":"uuxfAXgAeZIee4NDYQp7ldKPzlRgYYpf","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\tmalwarescore=0 adultscore=0 phishscore=0 clxscore=1015\n\timpostorscore=0\n\tsuspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0\n\tbulkscore=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-2601050098","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":37473,"web_url":"https://patchwork.libcamera.org/comment/37473/","msgid":"<b2d5841d-5cff-472c-9665-7d4d95ebbb4b@oss.qualcomm.com>","date":"2026-01-05T11:15:20","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"content":"Hi,\n\nOn 5-Jan-26 12:12, Vasiliy Doylov wrote:\n> Removed that shift and i see no bad impact on result image.\n> \n> Was that shift an edge case for something?\n\nSee the reply which I just send, this code was inherited\nfrom the very first version of the softISP and it never\nreally seemed right to me. I think we should just drop\nthe code which changes the minimum gain when it is 0.\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 DD402BDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:15:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 96A8D61FB7;\n\tMon,  5 Jan 2026 12:15:27 +0100 (CET)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n\t[205.220.168.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D33361F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:15:25 +0100 (CET)","from pps.filterd (m0279867.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t6058w6o3593904 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 11:15:23 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 4bga8pgc7x-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 11:15:23 +0000 (GMT)","by mail-qt1-f200.google.com with SMTP id\n\td75a77b69052e-4ed7591799eso348699211cf.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 03:15:23 -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-64b916b5777sm56850424a12.33.2026.01.05.03.15.21\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 03:15:21 -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=\"jQsKNWF3\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"MZ86KjjR\"; 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\tNOzQL0ZYNF37izhXbj7ddgLkysCwgKVuCC+I4/9x3Xg=; b=jQsKNWF3h4caVqqd\n\t+N553g/koDA0J3n6/loWl5hptflqiIJu/iwUX5CqYCmuqCaA2f0ZHgziP3VVQV1W\n\tcnfIqDDqzL964PY4T4LjIuD3iTc/hwuAruAmHaIpRoCNVfmPbQM4kTiPbAZJdjbJ\n\tH80yjqKIDUahdDqGWeeGjlBDMWuo6wdDxTy+yB1DOPMRNqbcUtZKWHjMznKDGzSC\n\tu3UFuLlk4nS2NlVaaabQtl8u7FQ2cbJ/X9gcEVwE3i80m0mD7WfJZVjF1girkeMU\n\tEZfDLwDEdzTMn8s1YgXydmC909XVxuLC3M+50X8+ADuLQGdRf8Dh/CYT1RA61T+n\n\tZW9dDQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767611722; x=1768216522;\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=NOzQL0ZYNF37izhXbj7ddgLkysCwgKVuCC+I4/9x3Xg=;\n\tb=MZ86KjjRYFxX7QdCZ63jRFy3M6k6udOw6CVQxI8rgcVavhPj2JjDt5W6QRm/RO82Uk\n\tvRxX0uPtzli0HpIFWe+3MLX7FhX7/NIblUaSznHZ6vP/XXfDv/YgxnUtOuW7qu0nPFIs\n\t0Cta67/qrx+6yT6vj+NVsftoBve/6qATLUYfSuu9emBAIMFhfR5gtqFRJGraNfM99Uyi\n\tgc1/xzOleKcNo/zu31VqWKjqRGRynnqJ9w3eRp+oRgfnUYGyWhEpWGnG1p+f3x7KVWK9\n\tPTyG+vSZGyXxKvr7+QdlmG7saFzON5o6xw262ziF9iSSc6cGwYlng44pw3QVOgg2Anm8\n\tGJ1A=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767611722; x=1768216522;\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=NOzQL0ZYNF37izhXbj7ddgLkysCwgKVuCC+I4/9x3Xg=;\n\tb=m00GNvVYZDy3sAgDoFG8CydJ+iojmDHMmyCwkbJC3kTQvi+vkOLzZcOGWq78XWgeoO\n\tYK63dzQrsw4r2UWsQ0ssqe7C+ZoALUvfw5LL+58MvAnxezkqVaUz00HEcWe4JVDQyB0v\n\trL3mzAdQJwTDcB32mWxf+lQD6vn6m7W1buMygspRumIZMmpxDO2m8TalLHPcg6GlAhZT\n\tJyhsgPN4BgIJwnb0k0uO6J8m/07UWOEGcu8L2cZSk/1WkgLzLNIlY+OkEk3/4wR06F6e\n\tWrsoamPUw5wJ/8WE5CVkwcDPAbi3FZ5CIYfu7ugHw1/RH4KaJ+rfi5zIZ/JC8zsuRWy5\n\ty9vQ==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCXyF9DrYe1qy6zK+Xfc2y45tXXhSGhrLbxLDCGqXZoVY5TZvLyZ5cbHqKoPV1iE51o98Hg7FjmQbwJJSmgVB8E=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YyGjUmXfPDKn/jRSKcs4cdfLW0f4BaJkYU0tgzA/udts2O5GHaZ\n\tcJWeSsILqMRpuwcHp32lPt6AarV6dwVCLFzaKVoUaUaZV1utgIs08WYWvRXfQ2XDE7TaSOSRTYa\n\tZT+SyZsz8tBlcfXUXIkJnZRRyogxcALkn0gWdq+z6Aw4B8J6VR3n0EXk7hqa1epS/S5smhqWwss\n\t5eBeRhLxOo","X-Gm-Gg":"AY/fxX5K4Fef+b3l0XRgQzGVrRIppmLEBnU5830P6qR1YJE/N8vc6SRLjjmYivmbIx9\n\tNYs7Hq+QOOVCZG0rj1UjvNIELnIJNC3LRCp5MXKFskIoI4Q5exKSdXg0mV3UVl9IKDZLGy5nfyA\n\tnHFNLS69D+t+DYeV+CuhtSH5I0t1rvrF1CeM0EdJuAckGRjO7OjxmD0Ke5f2tsEY7kl33Gu919i\n\thhYWGj1eI6jrVOOE72hBluG793HBNitpXlR+C9ALBI1RSJyJuA7eJCg0FIoVAy4rpmPKpIUGY8j\n\tEWPOA756Hu3zUmSCk+EC4h9sYK5nfX6b9ZrIU1nTy20QVrKyGfgx92h4eQZfYfSkxV/3tsKAbqH\n\t17u6y3FAJL6uKNdI0+yxZ4ViSYjMvWKrhr0pEo1J1lV9O3XUB6m7J5as8yCcPRvCu3lk7saDoDe\n\tswYU2q85hfggeEU1KdJEk1/NDybCQcFNmfElQPs/Jg3vf7YcEgcw+x35Gs51gZL9ShFArRChTC7\n\tZQv","X-Received":["by 2002:a05:622a:418d:b0:4f1:ca42:8a25 with SMTP id\n\td75a77b69052e-4f4abdd6801mr723256111cf.74.1767611722452; \n\tMon, 05 Jan 2026 03:15:22 -0800 (PST)","by 2002:a05:622a:418d:b0:4f1:ca42:8a25 with SMTP id\n\td75a77b69052e-4f4abdd6801mr723255901cf.74.1767611722058; \n\tMon, 05 Jan 2026 03:15:22 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHICRo+5wflaUOcW8R0lB0rdok3pmWC3v56Mj/mtwVoQWBHaKBxtH6enbeTJ3+733ulNuQwtg==","Message-ID":"<b2d5841d-5cff-472c-9665-7d4d95ebbb4b@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 12:15:20 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>\n\t<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>\n\t<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDA5OSBTYWx0ZWRfX7/kUySy5nEme\n\tTDv7U6FusU8JNhM8i91+QvMf6D0vJR6aIOl8HHb7zN2UUQKAzcYJzwgZeaWnV6Nt5k/HU7QLQAr\n\tezu1brKU+Q8fvRS0Rf6mvZiBNMTsEr87TSOgVs4YM1AzsuMA5Qsnw5LgKCPXBHew/ZCbQt47D68\n\tKPyvpf6nlF9YODSA5Qokwps2cBn5BJX7rEhYN0lq7BNPzXc0q70KGCNl+tFcn2zKSdkxdQuQ986\n\tVbssWA91Q7eTVCa9KDcCshLerJHJGnfhq+Jb9mitdfwrVNDH1pvtoFF51flbW0jLKdYaeBm3DU0\n\tVNKMN+UL83whK7NuWCZsq2oqIk5btucfONZlYqJoKJ9rpsWkcq7JB32FZbMUjOFd4z+kHiFrmQe\n\tugXPJLnnaWBs/0YnqIT21q9Tlm1B2lNWTP94oQKxKPOBsiaOWciUJJIBDvO6n2h938nnhv6Lyhw\n\tXGfLWfvr0kXQWvMnaBA==","X-Authority-Analysis":"v=2.4 cv=JfWxbEKV c=1 sm=1 tr=0 ts=695b9d4b 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=aYgPFkgdDV6ubmHe0G4A:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22","X-Proofpoint-ORIG-GUID":"QVDfIScJf5LTgDcSCqW1Bq7q7y0lo35Y","X-Proofpoint-GUID":"QVDfIScJf5LTgDcSCqW1Bq7q7y0lo35Y","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\tbulkscore=0 adultscore=0 suspectscore=0 clxscore=1015\n\tpriorityscore=1501\n\tmalwarescore=0 lowpriorityscore=0 spamscore=0 impostorscore=0\n\tphishscore=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-2601050099","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":37474,"web_url":"https://patchwork.libcamera.org/comment/37474/","msgid":"<e963c343-c2cd-453e-8549-72c6a56b12cf@mainlining.org>","date":"2026-01-05T11:15:59","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":255,"url":"https://patchwork.libcamera.org/api/people/255/","name":"Vasiliy Doylov","email":"nekocwd@mainlining.org"},"content":"Should i send v2 with this drop?\n\nOn 1/5/26 2:15 PM, johannes.goede@oss.qualcomm.com wrote:\n> Hi,\n>\n> On 5-Jan-26 12:12, Vasiliy Doylov wrote:\n>> Removed that shift and i see no bad impact on result image.\n>>\n>> Was that shift an edge case for something?\n> See the reply which I just send, this code was inherited\n> from the very first version of the softISP and it never\n> really seemed right to me. I think we should just drop\n> the code which changes the minimum gain when it is 0.\n>\n> Regards,\n>\n> Hans\n>","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 9426ABDCC0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:16:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 48F5E61FC2;\n\tMon,  5 Jan 2026 12:16:05 +0100 (CET)","from mail.mainlining.org (mail.mainlining.org [5.75.144.95])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BC9DF61F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:16:03 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=mainlining.org header.i=@mainlining.org\n\theader.b=\"X8TnXCLd\"; \n\tdkim=permerror (0-bit key) header.d=mainlining.org\n\theader.i=@mainlining.org header.b=\"T01dagTO\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; s=202507r; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767611759;\n\tbh=HGhtJsewhj/MU8Sf9sa10Dw H4Ztpi2FBhXcBaLVglis=;\n\tb=X8TnXCLdLJiAGOtTxCQ+eN4k6A4jOn7RJG3ms+L+1Z2VOqo7ri\n\tBph3P2xfDbms7WgYsHRJDgILzprc6LNMFfYlWFMs7KSZp/lXLDHWlwwtbSULcqzn1gsMBn7rpTB\n\tnLPaHNBTV2plOYLpTtFMedWTRfz33x251k5OdK2C7Sa5Co0NKNLHu0s4MkYCNj2rV3dkx66Ygdk\n\tPRFBFFDnsYxwGMYEHvm8VvO0vzo/lFd247VFxVcwPb0duDwvmuqpA52Tq8UQ8FlgfZLM5imJARv\n\trHgIfPvhbyxia4Dsz3vrmgvi/6wVAxvsdIhcIIWUNdTNgxAsbQraWK/5Pd2dIxwKkCQ==;","v=1; a=ed25519-sha256; s=202507e; d=mainlining.org;\n\tc=relaxed/relaxed; \n\th=From:To:Subject:Date:Message-ID; t=1767611759;\n\tbh=HGhtJsewhj/MU8Sf9sa10Dw H4Ztpi2FBhXcBaLVglis=;\n\tb=T01dagTOuZz8w9oBghbaaBA816cbd0/kDldOxaKC2QSSN2KLuw\n\t4ec+RFXfKE07Srh9gWcIcUcNbAtZKdG020Dw==;"],"Message-ID":"<e963c343-c2cd-453e-8549-72c6a56b12cf@mainlining.org>","Date":"Mon, 5 Jan 2026 14:15:59 +0300","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"johannes.goede@oss.qualcomm.com, libcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>\n\t<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>\n\t<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>\n\t<b2d5841d-5cff-472c-9665-7d4d95ebbb4b@oss.qualcomm.com>","Content-Language":"en-US","From":"Vasiliy Doylov <nekocwd@mainlining.org>","In-Reply-To":"<b2d5841d-5cff-472c-9665-7d4d95ebbb4b@oss.qualcomm.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":37475,"web_url":"https://patchwork.libcamera.org/comment/37475/","msgid":"<96eaa36b-a194-4c1c-8ea7-1bd209aa0723@oss.qualcomm.com>","date":"2026-01-05T11:20:59","subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"content":"Hi,\n\nOn 5-Jan-26 12:15, Vasiliy Doylov wrote:\n> Should i send v2 with this drop?\n\nYes please, you can use my email bit about typical imx\nanalog gain ctrl-value to gain-factor formula and how\ngainMin == 0 is totally valid there for the commit message.\n\nRegards,\n\nHans\n\n\n\n> \n> On 1/5/26 2:15 PM, johannes.goede@oss.qualcomm.com wrote:\n>> Hi,\n>>\n>> On 5-Jan-26 12:12, Vasiliy Doylov wrote:\n>>> Removed that shift and i see no bad impact on result image.\n>>>\n>>> Was that shift an edge case for something?\n>> See the reply which I just send, this code was inherited\n>> from the very first version of the softISP and it never\n>> really seemed right to me. I think we should just drop\n>> the code which changes the minimum gain when it is 0.\n>>\n>> Regards,\n>>\n>> Hans\n>>","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 8CBFFBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:21:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5323761FB7;\n\tMon,  5 Jan 2026 12:21:06 +0100 (CET)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n\t[205.220.168.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C75061F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:21:03 +0100 (CET)","from pps.filterd (m0279866.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t6059eSnE3542060 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 5 Jan 2026 11:21:02 GMT","from mail-qt1-f198.google.com (mail-qt1-f198.google.com\n\t[209.85.160.198])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bg57shahm-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 11:21:02 +0000 (GMT)","by mail-qt1-f198.google.com with SMTP id\n\td75a77b69052e-4f4a5dba954so370962221cf.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Jan 2026 03:21:02 -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-64b9105b31esm52523109a12.13.2026.01.05.03.21.00\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 05 Jan 2026 03:21:00 -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=\"TdQT4iYv\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"f5l/Gv02\"; 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\tjZ8gPLz4cJkItbCysqIMPpjOmDNQq+QemEUn6TaMdxU=; b=TdQT4iYvbDr77E+j\n\tKLsYoEnP6wBK96NElnFL9F3poKUZsLUm+BwKCiWCYW2xhDR1qOvbWwIN6+x75vV4\n\t0UAKo0L8J6MJrA5/1SayB8EE69du6UJi5WsamosnGQvwByPL7pR/9qDkzc8ikmIQ\n\tmAadUU+UvPI/1OJ2JpYVZxA/OgGYlwPOy8zB4i2M5nOf7pRBGUPJyhcwGGvbyHxH\n\ts+P1YSeO3YiQoi7S4uqfHV6Y9ay+z+anYFbjG6QyRyQitBbnc6AsEbeC6Rs+DmAd\n\tLG8hH8f0vwNOqvbkgiONPkMnFdQ+96dIzE27fLHc+Pmya/m5AkskEjK/VnjjFNnR\n\thRhbpA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1767612061; x=1768216861;\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=jZ8gPLz4cJkItbCysqIMPpjOmDNQq+QemEUn6TaMdxU=;\n\tb=f5l/Gv02NawUfPMAUfSP8DzSAJZ8I+bda6OOtr5mMVVLzVBeEWmpACZ7e7noAOC5DT\n\thWCoFMDLYQ2wNWLF8TlVg7n2UvaFMecxnkOFdw3vW4mHOTWEVH9XWjZDStbpdhLdbOY+\n\td961I+eWPlE5OoDrfi3Lyv44BZHUk7oHfzdqzHmpJe4WJk6e5KFyds1bPLx4MhRCE9sT\n\t5BgI9/AOSbxK5/4po3atlaBdpS+/7ZZG9EdQHWbhQCWPngX7/XaXiLx7uv5M+58Ueo5D\n\t7mxxD7fPDEZB2T71OQcVa3/Y6xGdlRzNiLuCqP8F1TcRYmonfDTnWqGwdm7q6vxz4Dnr\n\tOLdQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1767612061; x=1768216861;\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=jZ8gPLz4cJkItbCysqIMPpjOmDNQq+QemEUn6TaMdxU=;\n\tb=C0bjs5PWdJYO/bo4gI6HuRcNXnQT+m5EAspYlRnQXZ+kj+YDp7S3GFVhCQPRsjrNzo\n\tgGog+lP8ojZE6gLmZtddtBgl+msV2tLwVX//IC0CNuWOf6wpGmre7gqdNPUiTFhBTaHs\n\tbrBBYbECdeEa0nDAnkGnvWISk+wlJI5osvQ03A/293tXfGP6BC8miUl9OXjK2zx8Y+fd\n\to8D/0BZaoerTsd1T4hO+m5IF1CMzOk3SxXaJ0IKGD9Lu1YK+4HWTSvQ31DYdLrXRKgWe\n\tYu9mFocxnUxH2jWvQFJSKNxaRYl2yt8AdmvhQlBLGzsJ3qyRrckkJOU1el3nmB7HePOn\n\tmmDA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCV4CaGhXnN0a66BO82etSS1k0NdYXXY3hfg3BeiVSFW/7qyaDQovMie2CBMx5T1gahuJHDv8OzWHvzJhYeu3Oo=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwfMnTpawJc5nRxUosd4EoPJd5AIOaUw2eFt0stjHPCfx+WEx7F\n\tS0gaMd/onIoLD2KCDVecRyqrjZ8/C/Mfpr38xKl9WmN8q8+Ms/Vp4Qk8GW9C+yZrKH4HvVnUEFb\n\tAHtg84yUZdKJAA4p78EPZQrhq13CJEzrGAT2ubc6jHhyTI6wWhOoQWcYkUQeDZLd1RNLxmi6Y90\n\tuRgIn5AOpt","X-Gm-Gg":"AY/fxX73GQrtIIsUDkobLMmQoKuK04CeQ5w5BWoqZKMVDGx+kXqb6qOSx3+cVB/vdYS\n\t++zWt7wFbamMbd5mWJ4r307R0uVP1JFSTWgOY5Dpm7jqQ6K80eSO6Y74yB6qRG3pd/lXbV8m/ur\n\tQrlGn0E8kj5sZQpNDYw68N36n/AvpgATuqOQN2xJcZ5CZj37+r2QZhSA/FLzbOctN/pMomUZJs2\n\t8Sopg47HWD4uQoMwEnrz9bzYEhibjsBRrHoyK692pVJGELpBDsFZrxu1TJhwQNiajXem5svnjAT\n\tRJeA4XVPo+iQJ7Na4F8evkdbiUGcrNJAJDBXu7EGKzV7kdwXzV9pOywKEdumMbf1jf6eZotpp0t\n\tNAhRIZ60RRikN1+NCIlRnUq+TsLTI1h5mvMn1zW+9cPxaPRDSgAD0dTTYKiMelG6OPmdkKKNDxI\n\tJ64ACFALE/guby4RrW5UGlf+uPVi3JwqzKFftb70+CtUP/Ov1WRGmXAhtQt27bwi4Np8ytrNTqL\n\tLVc","X-Received":["by 2002:a05:622a:1e85:b0:4ee:11bd:f6a9 with SMTP id\n\td75a77b69052e-4f4abd957a5mr750964731cf.61.1767612061220; \n\tMon, 05 Jan 2026 03:21:01 -0800 (PST)","by 2002:a05:622a:1e85:b0:4ee:11bd:f6a9 with SMTP id\n\td75a77b69052e-4f4abd957a5mr750964491cf.61.1767612060840; \n\tMon, 05 Jan 2026 03:21:00 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IFk1X+LTk0IS8lAk0rO517su/wKgzOdH79/vw9Oysse9jxMNOrU0AiPeSKuymReUEN5dFrAoQ==","Message-ID":"<96eaa36b-a194-4c1c-8ea7-1bd209aa0723@oss.qualcomm.com>","Date":"Mon, 5 Jan 2026 12:20:59 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","From":"johannes.goede@oss.qualcomm.com","Subject":"Re: [PATCH] ipa: simple: agc: prevent gain decrease deadloop","To":"Vasiliy Doylov <nekocwd@mainlining.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260105-softisp-agc-v1-1-77626505853a@mainlining.org>\n\t<de05c097-092f-4221-9379-7c13f7ce8246@oss.qualcomm.com>\n\t<e5b82ee0-4a49-4296-b937-30b33ae1d4b3@mainlining.org>\n\t<7e7ecb9a-0f8f-4222-bf19-33d61e272f1c@oss.qualcomm.com>\n\t<41cf7865-69f1-48f9-979b-8822f16eed89@mainlining.org>\n\t<6547ac61-575c-4543-8b79-5ed9f314efde@mainlining.org>\n\t<b2d5841d-5cff-472c-9665-7d4d95ebbb4b@oss.qualcomm.com>\n\t<e963c343-c2cd-453e-8549-72c6a56b12cf@mainlining.org>","Content-Language":"en-US, nl","In-Reply-To":"<e963c343-c2cd-453e-8549-72c6a56b12cf@mainlining.org>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-Authority-Analysis":"v=2.4 cv=UJ/Q3Sfy c=1 sm=1 tr=0 ts=695b9e9e cx=c_pps\n\ta=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n\ta=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=EUspDBNiAAAA:8 a=rSLgkKLZ9ldhbGEVqNoA:9 a=QEXdDO2ut3YA:10\n\ta=dawVfQjAaf238kedN5IG:22","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMTA1MDEwMCBTYWx0ZWRfXxyBrL2EZS34U\n\t5931m89jvE+X7/8ggOzDvKvtmO6YHJ7r28HCYpiEK0ioK8Gw1KPtBTNrftytorhD8VNpYY/Qa1s\n\tFbtPZ/Oi0zFsSlM601MoPqiQAg7lzlRs26Y5goneCOQThXN+XFHlN+C3/FJZlTm8ponf49XyHn2\n\tUxq1ENBwDjji6508B/Vz+eRZDM6mr5e48hpgmnKYLgRuUwZifXYl1dOHbbrzE+vlS5KRMP2lHRv\n\tIMWOt4rCSaApGbqsiTqI8GAdT9yxYBU647ZpkFEKLqfcF5RPWug45Si+EAR1nrO0g4ocYc0poQX\n\tlKXcl2VZV6EtySHC+8UdJx8+EMB4dqoTFLiCBjDa/Rsw1/ddUCwsarM9T1bpNDwjgBpFZ4ZELvG\n\thFja0ehBAzAYiJhJ3kdFGDa3w6Vh6X02YyT64hupSPpxr1Y1fOkYi+NMlRximMzi7yfnu3/eQ1j\n\tEXlXI3kj8QhMvdVVOBw==","X-Proofpoint-ORIG-GUID":"lwGKmKWKiYYy5Kp4qTdCHdBtf98XmIVS","X-Proofpoint-GUID":"lwGKmKWKiYYy5Kp4qTdCHdBtf98XmIVS","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\tsuspectscore=0 adultscore=0 spamscore=0 bulkscore=0 phishscore=0\n\tlowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0\n\tmalwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=\n\troute=outbound adjust=0 reason=mlx scancount=1\n\tengine=8.22.0-2512120000\n\tdefinitions=main-2601050100","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>"}}]