[{"id":33691,"web_url":"https://patchwork.libcamera.org/comment/33691/","msgid":"<85msdafr2w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-03-24T14:20:23","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Robert,\n\nwould you have a chance to test that this changed version also works?\n(I expect it does, just testing before merging.)\n\nMilan Zamazal <mzamazal@redhat.com> writes:\n\n> Automatic black level setting in software ISP updates the determined\n> black level value when exposure or gain change.  It stores the last\n> exposure and gain values to detect the change.\n>\n> BlackLevel::configure() resets the stored black level value but not the\n> exposure and gain values.  This can prevent updating the black value and\n> cause bad image output, e.g. after suspending and resuming a camera, if\n> exposure and gain remain unchanged.\n>\n> Let's store exposure and gain in IPAActiveState.  Although the values\n> are not supposed to be used outside BlackLevel class, storing them in\n> the context has the advantage of their automatic reset together with the\n> other context contents and having them in `blc' struct indicates their\n> relationship to the black value computation.\n>\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>  src/ipa/simple/algorithms/blc.h   |  2 --\n>  src/ipa/simple/ipa_context.h      |  2 ++\n>  3 files changed, 7 insertions(+), 7 deletions(-)\n>\n> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n> index 1d7d370b..089e492a 100644\n> --- a/src/ipa/simple/algorithms/blc.cpp\n> +++ b/src/ipa/simple/algorithms/blc.cpp\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n> - * Copyright (C) 2024, Red Hat Inc.\n> + * Copyright (C) 2024-2025, Red Hat Inc.\n>   *\n>   * Black level handling\n>   */\n> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>  \tif (context.configuration.black.level.has_value())\n>  \t\treturn;\n>  \n> -\tif (frameContext.sensor.exposure == exposure_ &&\n> -\t    frameContext.sensor.gain == gain_) {\n> +\tif (frameContext.sensor.exposure == context.activeState.blc.lastExposure &&\n> +\t    frameContext.sensor.gain == context.activeState.blc.lastGain) {\n>  \t\treturn;\n>  \t}\n>  \n> @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>  \t\tseen += histogram[i];\n>  \t\tif (seen >= pixelThreshold) {\n>  \t\t\tcontext.activeState.blc.level = i * histogramRatio;\n> -\t\t\texposure_ = frameContext.sensor.exposure;\n> -\t\t\tgain_ = frameContext.sensor.gain;\n> +\t\t\tcontext.activeState.blc.lastExposure = frameContext.sensor.exposure;\n> +\t\t\tcontext.activeState.blc.lastGain = frameContext.sensor.gain;\n>  \t\t\tLOG(IPASoftBL, Debug)\n>  \t\t\t\t<< \"Auto-set black level: \"\n>  \t\t\t\t<< i << \"/\" << SwIspStats::kYHistogramSize\n> diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\n> index 52d59cab..db9e6d63 100644\n> --- a/src/ipa/simple/algorithms/blc.h\n> +++ b/src/ipa/simple/algorithms/blc.h\n> @@ -30,8 +30,6 @@ public:\n>  \t\t     ControlList &metadata) override;\n>  \n>  private:\n> -\tint32_t exposure_;\n> -\tdouble gain_;\n>  \tstd::optional<uint8_t> definedLevel_;\n>  };\n>  \n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index 4af51306..b1198af5 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>  struct IPAActiveState {\n>  \tstruct {\n>  \t\tuint8_t level;\n> +\t\tint32_t lastExposure;\n> +\t\tdouble lastGain;\n>  \t} blc;\n>  \n>  \tstruct {","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 B0167C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Mar 2025 14:20:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D8A3568951;\n\tMon, 24 Mar 2025 15:20:34 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 706746893F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Mar 2025 15:20:32 +0100 (CET)","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-414-vgaDAoOBOjiSVh0rk9I6iA-1; Mon, 24 Mar 2025 10:20:26 -0400","by mail-wm1-f72.google.com with SMTP id\n\t5b1f17b1804b1-43d0830c3f7so35306095e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Mar 2025 07:20:26 -0700 (PDT)","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-43d4fdbd348sm122224735e9.39.2025.03.24.07.20.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 24 Mar 2025 07:20:24 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"GNW0NYeF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1742826031;\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=BGsQllXXCXvKGBwOLMSzUMMU2tkDAQxkkBpPYeN95vE=;\n\tb=GNW0NYeFNfAnMFrnS5jnnFukzuSAs+sPV5JHFhr2nNpEgAKJl5v7HUOLKd0+Mux0DojOon\n\tjv+MJDtApOe/F045CIMVAZmZNAxEgp78PITX2GiWGLTVsnrFwkcF9O7XqV7bUZ2OJuwhsy\n\tuFbVLlVr0yvSvk0anE43Pat8qVVuJd4=","X-MC-Unique":"vgaDAoOBOjiSVh0rk9I6iA-1","X-Mimecast-MFC-AGG-ID":"vgaDAoOBOjiSVh0rk9I6iA_1742826025","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1742826025; x=1743430825;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=BGsQllXXCXvKGBwOLMSzUMMU2tkDAQxkkBpPYeN95vE=;\n\tb=Q4WyLFWlkQrFH0zLeFpAGivs9BQRCK916xEjRYMbqQd442v9yoqwoM/h3VRJfDM77o\n\tysy1Yq/dPe0hOWiGamtANn4YqWDGQ4UIEcm5DYY9jlTcA+DCvJlhBNK2Tsk3g+6pC0Dr\n\tpHVo1RyBQY6SYUSU+2+Av5ZfNrKHHzMNgJEAIiF7xlwu3fi0lcwmF6ac9B9l9L9d9xkt\n\tFrDTF0u15gVBy5KH5hqANzOPXvyhkLzX+AANYGyMbTzqc1bMLHJgiVBzaeMb1ngG53ww\n\tO2gw3CYmzl3RmbBrs7O24nzIP14NlfVP88st61l+8jZi/9Sll0kLOwtYVRcxZE2NXuCV\n\tIAbQ==","X-Gm-Message-State":"AOJu0YzJCi0P1pA8nO+sWVGyDgq4+TMNRKpACcPttqFM1EJZsEWra8XX\n\tFbRynhx2LdO7/jwvAT4/hw1fC2BlTTDx/Em2SAM42D1Ao25DtBRzNw/xt8y1MEf0cLYS5jZuQ/r\n\twtpojFTojzeIhjpsp2ToxmR2I2qApElue9DQ1TJFJQdk9vDIdns1BINRxjJvoyNsg99/iME4=","X-Gm-Gg":"ASbGncuLr1xHYRaZYFYuuEWg4hK1a4LYygSzpO9qlr7v2uQUH7l8Xn0awlvFHwEG52a\n\tN5m6eOIyVkdY4fM+keA6e1QBx16kenJpurluYLAzeLLI5VjPC/AIPn1gwUD9MxSmkawMGLnzEJr\n\tGr+7CB5TT3ODTnzQf3JQ44Jyl9qqLKRCFkuKtpAZKl41SLd18zS7vSWtiN/8UBaqI4M458yo+dQ\n\tmM3OeayYrdG4Y0l5tPx0ab4TcLQOJuq69yyoUKwL9b2vg7Cc0rilSzazQx2+sD2mTHZvH/GjR8t\n\tXnfcvOeXQZpgTY+pavphTFoAVnRko0c2+MBq3oIluHVLWiaac9tMBeCmySK+/oOuJiyH","X-Received":["by 2002:a05:600c:1e0d:b0:43c:f689:88ce with SMTP id\n\t5b1f17b1804b1-43d50a1d1b4mr127804685e9.20.1742826025324; \n\tMon, 24 Mar 2025 07:20:25 -0700 (PDT)","by 2002:a05:600c:1e0d:b0:43c:f689:88ce with SMTP id\n\t5b1f17b1804b1-43d50a1d1b4mr127804325e9.20.1742826024856; \n\tMon, 24 Mar 2025 07:20:24 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IHI1dbtEej7niWKUF5vaPDkD9j7sUs36jPEamlhgb3yj75w8qzn//Xi/73z0r/fyoPsu3A0BA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Robert Mader <robert.mader@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","In-Reply-To":"<20250319095533.24550-1-mzamazal@redhat.com> (Milan Zamazal's\n\tmessage of \"Wed, 19 Mar 2025 10:55:33 +0100\")","References":"<20250319095533.24550-1-mzamazal@redhat.com>","Date":"Mon, 24 Mar 2025 15:20:23 +0100","Message-ID":"<85msdafr2w.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":"ZP2ijYve9nMvSX-pwW_J8CWwieFsaYHY3KvO_bp4Na8_1742826025","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":33730,"web_url":"https://patchwork.libcamera.org/comment/33730/","msgid":"<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>","date":"2025-03-26T15:11:53","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Yep, works fine here -> T-b\n\nOn 24.03.25 15:22, Robert Mader wrote:\n> Sure, unfortunately not before Wednesday. Made me a reminder.\n>\n> On 24.03.25 15:20, Milan Zamazal wrote:\n>> Hi Robert,\n>>\n>> would you have a chance to test that this changed version also works?\n>> (I expect it does, just testing before merging.)\n>>\n>> Milan Zamazal <mzamazal@redhat.com> writes:\n>>\n>>> Automatic black level setting in software ISP updates the determined\n>>> black level value when exposure or gain change.  It stores the last\n>>> exposure and gain values to detect the change.\n>>>\n>>> BlackLevel::configure() resets the stored black level value but not the\n>>> exposure and gain values.  This can prevent updating the black value \n>>> and\n>>> cause bad image output, e.g. after suspending and resuming a camera, if\n>>> exposure and gain remain unchanged.\n>>>\n>>> Let's store exposure and gain in IPAActiveState.  Although the values\n>>> are not supposed to be used outside BlackLevel class, storing them in\n>>> the context has the advantage of their automatic reset together with \n>>> the\n>>> other context contents and having them in `blc' struct indicates their\n>>> relationship to the black value computation.\n>>>\n>>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>> ---\n>>>   src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>>>   src/ipa/simple/algorithms/blc.h   |  2 --\n>>>   src/ipa/simple/ipa_context.h      |  2 ++\n>>>   3 files changed, 7 insertions(+), 7 deletions(-)\n>>>\n>>> diff --git a/src/ipa/simple/algorithms/blc.cpp \n>>> b/src/ipa/simple/algorithms/blc.cpp\n>>> index 1d7d370b..089e492a 100644\n>>> --- a/src/ipa/simple/algorithms/blc.cpp\n>>> +++ b/src/ipa/simple/algorithms/blc.cpp\n>>> @@ -1,6 +1,6 @@\n>>>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>>   /*\n>>> - * Copyright (C) 2024, Red Hat Inc.\n>>> + * Copyright (C) 2024-2025, Red Hat Inc.\n>>>    *\n>>>    * Black level handling\n>>>    */\n>>> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>>>       if (context.configuration.black.level.has_value())\n>>>           return;\n>>>   -    if (frameContext.sensor.exposure == exposure_ &&\n>>> -        frameContext.sensor.gain == gain_) {\n>>> +    if (frameContext.sensor.exposure == \n>>> context.activeState.blc.lastExposure &&\n>>> +        frameContext.sensor.gain == \n>>> context.activeState.blc.lastGain) {\n>>>           return;\n>>>       }\n>>>   @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>>>           seen += histogram[i];\n>>>           if (seen >= pixelThreshold) {\n>>>               context.activeState.blc.level = i * histogramRatio;\n>>> -            exposure_ = frameContext.sensor.exposure;\n>>> -            gain_ = frameContext.sensor.gain;\n>>> +            context.activeState.blc.lastExposure = \n>>> frameContext.sensor.exposure;\n>>> +            context.activeState.blc.lastGain = \n>>> frameContext.sensor.gain;\n>>>               LOG(IPASoftBL, Debug)\n>>>                   << \"Auto-set black level: \"\n>>>                   << i << \"/\" << SwIspStats::kYHistogramSize\n>>> diff --git a/src/ipa/simple/algorithms/blc.h \n>>> b/src/ipa/simple/algorithms/blc.h\n>>> index 52d59cab..db9e6d63 100644\n>>> --- a/src/ipa/simple/algorithms/blc.h\n>>> +++ b/src/ipa/simple/algorithms/blc.h\n>>> @@ -30,8 +30,6 @@ public:\n>>>                ControlList &metadata) override;\n>>>     private:\n>>> -    int32_t exposure_;\n>>> -    double gain_;\n>>>       std::optional<uint8_t> definedLevel_;\n>>>   };\n>>>   diff --git a/src/ipa/simple/ipa_context.h \n>>> b/src/ipa/simple/ipa_context.h\n>>> index 4af51306..b1198af5 100644\n>>> --- a/src/ipa/simple/ipa_context.h\n>>> +++ b/src/ipa/simple/ipa_context.h\n>>> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>>>   struct IPAActiveState {\n>>>       struct {\n>>>           uint8_t level;\n>>> +        int32_t lastExposure;\n>>> +        double lastGain;\n>>>       } blc;\n>>>         struct {","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 315C2C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Mar 2025 15:12:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B8F66896B;\n\tWed, 26 Mar 2025 16:12:03 +0100 (CET)","from sender3-pp-f112.zoho.com (sender3-pp-f112.zoho.com\n\t[136.143.184.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 786E068967\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Mar 2025 16:12:01 +0100 (CET)","by mx.zohomail.com with SMTPS id 1743001915579813.4238983992136;\n\tWed, 26 Mar 2025 08:11:55 -0700 (PDT)"],"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=\"WycOi55C\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1743001917; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=UJjcYhWDA2V1S9NbP4hAZLVm5fU4KSB48ylHfCbXVnUbOmMHpN3uNBtczET6AkK2HTwzmB4ASEGrldxNAEhs557t/rMMlOFNXMBXI4XVwCNkjpZptq9Ixph7harPH6iRIgjGCSmDteN+biUt9kcgAG90WY+VF7Y7q7PpZGdJvL4=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1743001917;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=7JZCrwzvr740rJRT2UUHxEmVlF1LZGPLe30YVs4ONiQ=; \n\tb=NGW8EJbwM7KvMQTACODNxA7pb8Gty/lWMNJvwuKbCNwccosYMGIyvUqvrHAoSp5ZB9CVMDj12nLUIMNYEK96lbaHjr6bHHl3EbvCnXC09Xh9qKL/Akaw3XCL9DoUZN0lXOENlOxZtLCzQSNiWGFf/720l92hzupvemm7TipqQOs=","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=1743001917;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=7JZCrwzvr740rJRT2UUHxEmVlF1LZGPLe30YVs4ONiQ=;\n\tb=WycOi55CJemSBPxHCgxOh5ckU2erN9UeR2X/C1nTnNeVdrP5K1L1KRdqUdCY8XWI\n\tOt+Xq14ADUFo4nGytjqsv4Lxwqrj0WVlxvW11QrIw5x9RyKNulOibupI0IyUVD3qsIg\n\tV8kueWys8xz6nUiRYkpk0Pk2PAhK32scF2qiewgk=","Message-ID":"<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>","Date":"Wed, 26 Mar 2025 16:11:53 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","To":"libcamera-devel@lists.libcamera.org","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<85msdafr2w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<47c9db41-4fc9-4460-9677-048efec23551@collabora.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<47c9db41-4fc9-4460-9677-048efec23551@collabora.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":33732,"web_url":"https://patchwork.libcamera.org/comment/33732/","msgid":"<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>","date":"2025-03-26T15:18:41","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Robert Mader (2025-03-26 15:11:53)\n> Yep, works fine here -> T-b\n\nPatch work only picks up on full tags.\n\nTested-by: Robert Mader <robert.mader@collabora.com>\n\nThanks\n\n> \n> On 24.03.25 15:22, Robert Mader wrote:\n> > Sure, unfortunately not before Wednesday. Made me a reminder.\n> >\n> > On 24.03.25 15:20, Milan Zamazal wrote:\n> >> Hi Robert,\n> >>\n> >> would you have a chance to test that this changed version also works?\n> >> (I expect it does, just testing before merging.)\n> >>\n> >> Milan Zamazal <mzamazal@redhat.com> writes:\n> >>\n> >>> Automatic black level setting in software ISP updates the determined\n> >>> black level value when exposure or gain change.  It stores the last\n> >>> exposure and gain values to detect the change.\n> >>>\n> >>> BlackLevel::configure() resets the stored black level value but not the\n> >>> exposure and gain values.  This can prevent updating the black value \n> >>> and\n> >>> cause bad image output, e.g. after suspending and resuming a camera, if\n> >>> exposure and gain remain unchanged.\n> >>>\n> >>> Let's store exposure and gain in IPAActiveState.  Although the values\n> >>> are not supposed to be used outside BlackLevel class, storing them in\n> >>> the context has the advantage of their automatic reset together with \n> >>> the\n> >>> other context contents and having them in `blc' struct indicates their\n> >>> relationship to the black value computation.\n> >>>\n> >>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n> >>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >>> ---\n> >>>   src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n> >>>   src/ipa/simple/algorithms/blc.h   |  2 --\n> >>>   src/ipa/simple/ipa_context.h      |  2 ++\n> >>>   3 files changed, 7 insertions(+), 7 deletions(-)\n> >>>\n> >>> diff --git a/src/ipa/simple/algorithms/blc.cpp \n> >>> b/src/ipa/simple/algorithms/blc.cpp\n> >>> index 1d7d370b..089e492a 100644\n> >>> --- a/src/ipa/simple/algorithms/blc.cpp\n> >>> +++ b/src/ipa/simple/algorithms/blc.cpp\n> >>> @@ -1,6 +1,6 @@\n> >>>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n> >>>   /*\n> >>> - * Copyright (C) 2024, Red Hat Inc.\n> >>> + * Copyright (C) 2024-2025, Red Hat Inc.\n> >>>    *\n> >>>    * Black level handling\n> >>>    */\n> >>> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n> >>>       if (context.configuration.black.level.has_value())\n> >>>           return;\n> >>>   -    if (frameContext.sensor.exposure == exposure_ &&\n> >>> -        frameContext.sensor.gain == gain_) {\n> >>> +    if (frameContext.sensor.exposure == \n> >>> context.activeState.blc.lastExposure &&\n> >>> +        frameContext.sensor.gain == \n> >>> context.activeState.blc.lastGain) {\n> >>>           return;\n> >>>       }\n> >>>   @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n> >>>           seen += histogram[i];\n> >>>           if (seen >= pixelThreshold) {\n> >>>               context.activeState.blc.level = i * histogramRatio;\n> >>> -            exposure_ = frameContext.sensor.exposure;\n> >>> -            gain_ = frameContext.sensor.gain;\n> >>> +            context.activeState.blc.lastExposure = \n> >>> frameContext.sensor.exposure;\n> >>> +            context.activeState.blc.lastGain = \n> >>> frameContext.sensor.gain;\n> >>>               LOG(IPASoftBL, Debug)\n> >>>                   << \"Auto-set black level: \"\n> >>>                   << i << \"/\" << SwIspStats::kYHistogramSize\n> >>> diff --git a/src/ipa/simple/algorithms/blc.h \n> >>> b/src/ipa/simple/algorithms/blc.h\n> >>> index 52d59cab..db9e6d63 100644\n> >>> --- a/src/ipa/simple/algorithms/blc.h\n> >>> +++ b/src/ipa/simple/algorithms/blc.h\n> >>> @@ -30,8 +30,6 @@ public:\n> >>>                ControlList &metadata) override;\n> >>>     private:\n> >>> -    int32_t exposure_;\n> >>> -    double gain_;\n> >>>       std::optional<uint8_t> definedLevel_;\n> >>>   };\n> >>>   diff --git a/src/ipa/simple/ipa_context.h \n> >>> b/src/ipa/simple/ipa_context.h\n> >>> index 4af51306..b1198af5 100644\n> >>> --- a/src/ipa/simple/ipa_context.h\n> >>> +++ b/src/ipa/simple/ipa_context.h\n> >>> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n> >>>   struct IPAActiveState {\n> >>>       struct {\n> >>>           uint8_t level;\n> >>> +        int32_t lastExposure;\n> >>> +        double lastGain;\n> >>>       } blc;\n> >>>         struct {\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\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 E5690C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Mar 2025 15:18:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 953936896D;\n\tWed, 26 Mar 2025 16:18:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73EAC68967\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Mar 2025 16:18:44 +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 6D8813A4;\n\tWed, 26 Mar 2025 16:16:56 +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=\"bbFE0sRS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743002216;\n\tbh=RNkCbCnJUVyPsjoQPwxqv64APTHqR8g+xrYhFhfqZYk=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=bbFE0sRSoC6qrlZfd2D8ayfwzVDbmKKlvYv4qQCN3mSKhXSGvflDZZxCxu1Nb8bL+\n\tdebwfMpY5xqA/+3QDNTsXnzZFwPP9oqHywpFubqA5J+1U1Zl0Cqcx8pBF9vbzYb4tK\n\tRpxJ7e+RHIWdBl3owdrIc41kCbwc8TPZpjLfsk7o=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<85msdafr2w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<47c9db41-4fc9-4460-9677-048efec23551@collabora.com>\n\t<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 26 Mar 2025 15:18:41 +0000","Message-ID":"<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":33733,"web_url":"https://patchwork.libcamera.org/comment/33733/","msgid":"<6a2e9a8a-39d1-415a-b824-32002aefffe4@collabora.com>","date":"2025-03-26T15:20:35","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Oh, I wasn't aware that it automatically picks those tags up - thanks!\n\nOn 26.03.25 16:18, Kieran Bingham wrote:\n> Quoting Robert Mader (2025-03-26 15:11:53)\n>> Yep, works fine here -> T-b\n> Patch work only picks up on full tags.\n>\n> Tested-by: Robert Mader <robert.mader@collabora.com>\n>\n> Thanks\n>\n>> On 24.03.25 15:22, Robert Mader wrote:\n>>> Sure, unfortunately not before Wednesday. Made me a reminder.\n>>>\n>>> On 24.03.25 15:20, Milan Zamazal wrote:\n>>>> Hi Robert,\n>>>>\n>>>> would you have a chance to test that this changed version also works?\n>>>> (I expect it does, just testing before merging.)\n>>>>\n>>>> Milan Zamazal <mzamazal@redhat.com> writes:\n>>>>\n>>>>> Automatic black level setting in software ISP updates the determined\n>>>>> black level value when exposure or gain change.  It stores the last\n>>>>> exposure and gain values to detect the change.\n>>>>>\n>>>>> BlackLevel::configure() resets the stored black level value but not the\n>>>>> exposure and gain values.  This can prevent updating the black value\n>>>>> and\n>>>>> cause bad image output, e.g. after suspending and resuming a camera, if\n>>>>> exposure and gain remain unchanged.\n>>>>>\n>>>>> Let's store exposure and gain in IPAActiveState.  Although the values\n>>>>> are not supposed to be used outside BlackLevel class, storing them in\n>>>>> the context has the advantage of their automatic reset together with\n>>>>> the\n>>>>> other context contents and having them in `blc' struct indicates their\n>>>>> relationship to the black value computation.\n>>>>>\n>>>>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n>>>>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>>>>> ---\n>>>>>    src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>>>>>    src/ipa/simple/algorithms/blc.h   |  2 --\n>>>>>    src/ipa/simple/ipa_context.h      |  2 ++\n>>>>>    3 files changed, 7 insertions(+), 7 deletions(-)\n>>>>>\n>>>>> diff --git a/src/ipa/simple/algorithms/blc.cpp\n>>>>> b/src/ipa/simple/algorithms/blc.cpp\n>>>>> index 1d7d370b..089e492a 100644\n>>>>> --- a/src/ipa/simple/algorithms/blc.cpp\n>>>>> +++ b/src/ipa/simple/algorithms/blc.cpp\n>>>>> @@ -1,6 +1,6 @@\n>>>>>    /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>>>>    /*\n>>>>> - * Copyright (C) 2024, Red Hat Inc.\n>>>>> + * Copyright (C) 2024-2025, Red Hat Inc.\n>>>>>     *\n>>>>>     * Black level handling\n>>>>>     */\n>>>>> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>>>>>        if (context.configuration.black.level.has_value())\n>>>>>            return;\n>>>>>    -    if (frameContext.sensor.exposure == exposure_ &&\n>>>>> -        frameContext.sensor.gain == gain_) {\n>>>>> +    if (frameContext.sensor.exposure ==\n>>>>> context.activeState.blc.lastExposure &&\n>>>>> +        frameContext.sensor.gain ==\n>>>>> context.activeState.blc.lastGain) {\n>>>>>            return;\n>>>>>        }\n>>>>>    @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>>>>>            seen += histogram[i];\n>>>>>            if (seen >= pixelThreshold) {\n>>>>>                context.activeState.blc.level = i * histogramRatio;\n>>>>> -            exposure_ = frameContext.sensor.exposure;\n>>>>> -            gain_ = frameContext.sensor.gain;\n>>>>> +            context.activeState.blc.lastExposure =\n>>>>> frameContext.sensor.exposure;\n>>>>> +            context.activeState.blc.lastGain =\n>>>>> frameContext.sensor.gain;\n>>>>>                LOG(IPASoftBL, Debug)\n>>>>>                    << \"Auto-set black level: \"\n>>>>>                    << i << \"/\" << SwIspStats::kYHistogramSize\n>>>>> diff --git a/src/ipa/simple/algorithms/blc.h\n>>>>> b/src/ipa/simple/algorithms/blc.h\n>>>>> index 52d59cab..db9e6d63 100644\n>>>>> --- a/src/ipa/simple/algorithms/blc.h\n>>>>> +++ b/src/ipa/simple/algorithms/blc.h\n>>>>> @@ -30,8 +30,6 @@ public:\n>>>>>                 ControlList &metadata) override;\n>>>>>      private:\n>>>>> -    int32_t exposure_;\n>>>>> -    double gain_;\n>>>>>        std::optional<uint8_t> definedLevel_;\n>>>>>    };\n>>>>>    diff --git a/src/ipa/simple/ipa_context.h\n>>>>> b/src/ipa/simple/ipa_context.h\n>>>>> index 4af51306..b1198af5 100644\n>>>>> --- a/src/ipa/simple/ipa_context.h\n>>>>> +++ b/src/ipa/simple/ipa_context.h\n>>>>> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>>>>>    struct IPAActiveState {\n>>>>>        struct {\n>>>>>            uint8_t level;\n>>>>> +        int32_t lastExposure;\n>>>>> +        double lastGain;\n>>>>>        } blc;\n>>>>>          struct {\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\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 08E38C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Mar 2025 15:20:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ECE156896A;\n\tWed, 26 Mar 2025 16:20:43 +0100 (CET)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C95C68950\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Mar 2025 16:20:41 +0100 (CET)","by mx.zohomail.com with SMTPS id 1743002437225488.80019912649175; \n\tWed, 26 Mar 2025 08:20:37 -0700 (PDT)"],"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=\"DqDZUf+g\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1743002438; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=E0DhGabR8kGIuJFjwFm2bJp2rBgaeYZNFJhxrC6YEIDT5fntMobFehhGqtmQ8XhU26BIke/X2EPs+Xk+LQgEtXYn7uzDfumGTrxwON6cSWDziXngkBV4qddRIWgEEDn6f9wqwPPX21CV5XBrDAa8plsIocegX0mYKsZFjW3I0cQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1743002438;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=3d0re1mGb2AaEo5DlpxnEQTvqkVmaPlJeMQ/RLYNozs=; \n\tb=NGGKsEszHHSdZ/dCuT9RVgSwPHvCw1rI5ZJCwTZ8wd3xBmkU1s+XYU4+PTTbvW1YNkyApV1W/Pi1tfrkLC5bOJgBfoFbH/auVnKuOrDuzCtVPF6mqp2CsxJvgly+6b6P3U2lDmT7oDbADBjPgPA/rFJXhM/EXdSWjFEgq/PnkjA=","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=1743002438;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=3d0re1mGb2AaEo5DlpxnEQTvqkVmaPlJeMQ/RLYNozs=;\n\tb=DqDZUf+g45pJg2Nr6xMeWQkTi0oZ+95RPvKoY22ctHbxDuHiKB2EoZE1BQ4i+jl1\n\tRteZ9lP4fOnVEhqpK+QbjX7gSgKeCrWlQXbq3AonR36qr4RwdzLprwplspWFpa/tBg3\n\t3AoQdLbTti0rSpL7T2n6W3cLyZa2aWz03rIOZgLE=","Message-ID":"<6a2e9a8a-39d1-415a-b824-32002aefffe4@collabora.com>","Date":"Wed, 26 Mar 2025 16:20:35 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<85msdafr2w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<47c9db41-4fc9-4460-9677-048efec23551@collabora.com>\n\t<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>\n\t<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>","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":33756,"web_url":"https://patchwork.libcamera.org/comment/33756/","msgid":"<8534exlgl1.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-03-28T08:11:54","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Quoting Robert Mader (2025-03-26 15:11:53)\n>> Yep, works fine here -> T-b\n\nThank you, Robert, for testing.\n\n> Patch work only picks up on full tags.\n>\n> Tested-by: Robert Mader <robert.mader@collabora.com>\n\nI believe the patch is all right now and could get in for 0.5?\n\n> Thanks\n>\n>> \n>> On 24.03.25 15:22, Robert Mader wrote:\n>> > Sure, unfortunately not before Wednesday. Made me a reminder.\n>> >\n>> > On 24.03.25 15:20, Milan Zamazal wrote:\n>> >> Hi Robert,\n>> >>\n>> >> would you have a chance to test that this changed version also works?\n>> >> (I expect it does, just testing before merging.)\n>> >>\n>> >> Milan Zamazal <mzamazal@redhat.com> writes:\n>> >>\n>> >>> Automatic black level setting in software ISP updates the determined\n>> >>> black level value when exposure or gain change.  It stores the last\n>> >>> exposure and gain values to detect the change.\n>> >>>\n>> >>> BlackLevel::configure() resets the stored black level value but not the\n>> >>> exposure and gain values.  This can prevent updating the black value \n>> >>> and\n>> >>> cause bad image output, e.g. after suspending and resuming a camera, if\n>> >>> exposure and gain remain unchanged.\n>> >>>\n>> >>> Let's store exposure and gain in IPAActiveState.  Although the values\n>> >>> are not supposed to be used outside BlackLevel class, storing them in\n>> >>> the context has the advantage of their automatic reset together with \n>> >>> the\n>> >>> other context contents and having them in `blc' struct indicates their\n>> >>> relationship to the black value computation.\n>> >>>\n>> >>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n>> >>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> >>> ---\n>> >>>   src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>> >>>   src/ipa/simple/algorithms/blc.h   |  2 --\n>> >>>   src/ipa/simple/ipa_context.h      |  2 ++\n>> >>>   3 files changed, 7 insertions(+), 7 deletions(-)\n>> >>>\n>> >>> diff --git a/src/ipa/simple/algorithms/blc.cpp \n>> >>> b/src/ipa/simple/algorithms/blc.cpp\n>> >>> index 1d7d370b..089e492a 100644\n>> >>> --- a/src/ipa/simple/algorithms/blc.cpp\n>> >>> +++ b/src/ipa/simple/algorithms/blc.cpp\n>> >>> @@ -1,6 +1,6 @@\n>> >>>   /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>> >>>   /*\n>> >>> - * Copyright (C) 2024, Red Hat Inc.\n>> >>> + * Copyright (C) 2024-2025, Red Hat Inc.\n>> >>>    *\n>> >>>    * Black level handling\n>> >>>    */\n>> >>> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>> >>>       if (context.configuration.black.level.has_value())\n>> >>>           return;\n>> >>>   -    if (frameContext.sensor.exposure == exposure_ &&\n>> >>> -        frameContext.sensor.gain == gain_) {\n>> >>> +    if (frameContext.sensor.exposure == \n>> >>> context.activeState.blc.lastExposure &&\n>> >>> +        frameContext.sensor.gain == \n>> >>> context.activeState.blc.lastGain) {\n>> >>>           return;\n>> >>>       }\n>> >>>   @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>> >>>           seen += histogram[i];\n>> >>>           if (seen >= pixelThreshold) {\n>> >>>               context.activeState.blc.level = i * histogramRatio;\n>> >>> -            exposure_ = frameContext.sensor.exposure;\n>> >>> -            gain_ = frameContext.sensor.gain;\n>> >>> +            context.activeState.blc.lastExposure = \n>> >>> frameContext.sensor.exposure;\n>> >>> +            context.activeState.blc.lastGain = \n>> >>> frameContext.sensor.gain;\n>> >>>               LOG(IPASoftBL, Debug)\n>> >>>                   << \"Auto-set black level: \"\n>> >>>                   << i << \"/\" << SwIspStats::kYHistogramSize\n>> >>> diff --git a/src/ipa/simple/algorithms/blc.h \n>> >>> b/src/ipa/simple/algorithms/blc.h\n>> >>> index 52d59cab..db9e6d63 100644\n>> >>> --- a/src/ipa/simple/algorithms/blc.h\n>> >>> +++ b/src/ipa/simple/algorithms/blc.h\n>> >>> @@ -30,8 +30,6 @@ public:\n>> >>>                ControlList &metadata) override;\n>> >>>     private:\n>> >>> -    int32_t exposure_;\n>> >>> -    double gain_;\n>> >>>       std::optional<uint8_t> definedLevel_;\n>> >>>   };\n>> >>>   diff --git a/src/ipa/simple/ipa_context.h \n>> >>> b/src/ipa/simple/ipa_context.h\n>> >>> index 4af51306..b1198af5 100644\n>> >>> --- a/src/ipa/simple/ipa_context.h\n>> >>> +++ b/src/ipa/simple/ipa_context.h\n>> >>> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>> >>>   struct IPAActiveState {\n>> >>>       struct {\n>> >>>           uint8_t level;\n>> >>> +        int32_t lastExposure;\n>> >>> +        double lastGain;\n>> >>>       } blc;\n>> >>>         struct {\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\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 72314C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Mar 2025 08:12:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6619768979;\n\tFri, 28 Mar 2025 09:12:03 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F0E0361868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 09:12:00 +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-8-UV4erGCzOl-Gthwu_wOO9g-1; Fri, 28 Mar 2025 04:11:58 -0400","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-4394040fea1so9829285e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 01:11:58 -0700 (PDT)","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\tffacd0b85a97d-39c0b6630a3sm1865123f8f.30.2025.03.28.01.11.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 28 Mar 2025 01:11:55 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"S9zE2iId\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1743149519;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=LeE4ExQfCAG1pr8qOoeF19kzUAVyWaRaHIJQx38XAlI=;\n\tb=S9zE2iIdrtzDiwhCSQnHCOLRdXjKvmTWwkM9iNsz2POr5Kx8itQZCmfmSt0LC+pcP0fLMq\n\tZMamFZxliK9uXXuFE+gLc1vcVivGUkq7g54PyIsBpjVqCPDKbfx4jSBmPFBgOZjlY3J4n8\n\tqCoETFo45EXFQei7Fbg4wYAuqTAyUrs=","X-MC-Unique":"UV4erGCzOl-Gthwu_wOO9g-1","X-Mimecast-MFC-AGG-ID":"UV4erGCzOl-Gthwu_wOO9g_1743149517","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1743149516; x=1743754316;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=Dp4pqFjf7txuN1aVSzbx+bnZnj+3WBA5aBW0b2l8vdk=;\n\tb=b1++1K0gsqpJjurKOZ58Gtdvsx1YXcmsIe7NaRN852HxiNcltXJjzwDXuJ8X744rFg\n\tqw0jufoG2FcutVL8B8gBAre9sT/HL5Xsi1AwHQBAbIvVN3fGElJ4mY+CURSPEYL9fPCH\n\tyLangffCxyR5TZoTsSEJthpDG8sL+ZkmjYwP7ppgQ8dccOEgDjm20CMK9rt0j8I/UR0o\n\tbzgHMfA2Hgj5hbucb4V3kHz2kNvJMtPB3/P3qSHSWpWi4lYgmb++EF9tceYRzLFbwiW0\n\tdC0rzu7mTmU6QuoaF3c5JopY2Izxob9jCUNgNB12upKn+yboEHcOlC9Dzja0kAEigZYF\n\tWkOA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCW3agaH2rHcR9jvI3riI9x27tfbRqX2PeWLrpaHxr5gGp9RaGd/v/QO+uCM27JPL+J0V+N4sopuqPKjKoPHPiE=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YztDcUau+XZtnZbBFLpuF2zzI7nroEgikrp50fU+8yDMJeo3hCS\n\t/g847otl6vJwXsKDKHbQvQLz3maSDuFEJ7T1PUGFCbee/6rEW9aA/poV18AYb4W8OwCEEos/ED2\n\tPaTEhrFjPH8cjDqLHrtHtLM66GnAvIGwXPu4XfgNf5DI/WvROIJDgxbR7X53ZcqPiXVk/SB8T5z\n\tu1jJnM/+FjlmU6AXIxPRc2hV1ytwYkI906IiV9Ug8FBxQqHKYUbaYHWCCaWg==","X-Gm-Gg":"ASbGncujiA6bRT76ZxEh+rvmnfzikf8HM3IuIdSXPQ8Fx1V3A7pdKJaLAYdYkzz3ndH\n\tl8EFJ5qZ4pFkk1sg1lNJBPpgFxLq8HgxT5vU8P4bQN7jXniZ5LtdalASmzYNh+3U9IRz43milC2\n\t30gm17VW5/jTKvXvIaJ5ehmoXgXxSkNA/qgBAxjjaU6Kow1TnSRnvJqWkwjLSMM0ypCqxsuQxxb\n\tTLDHBPAZ1bfkL4iz5ilxEAqj4tgtYs9G4mneY714q2EFOPUX++WT/ZBQge84C9gBU3D6Y6y6PJp\n\tyY5ohhNdIrS3MB3VS5OgZ2AZLqXjqKxo0Sp+a3rx3cBUKzWpPNInp/TRzkwrQZEqyZR2","X-Received":["by 2002:a05:600c:3d14:b0:43b:c7f0:6173 with SMTP id\n\t5b1f17b1804b1-43d91435b9bmr13550585e9.4.1743149516485; \n\tFri, 28 Mar 2025 01:11:56 -0700 (PDT)","by 2002:a05:600c:3d14:b0:43b:c7f0:6173 with SMTP id\n\t5b1f17b1804b1-43d91435b9bmr13550295e9.4.1743149515947; \n\tFri, 28 Mar 2025 01:11:55 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IEnZHKzF80ZIKDBMoGh2WlNM83J0/PTSTHSU9Sk0GMMJQlpIfXFWQ0eRPq60nP9RBIcfOZUNg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","In-Reply-To":"<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Wed, 26 Mar 2025 15:18:41 +0000\")","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<85msdafr2w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<47c9db41-4fc9-4460-9677-048efec23551@collabora.com>\n\t<79f8a6d4-b4b2-4176-9df7-84d7f878c3c7@collabora.com>\n\t<174300232176.409220.12115297483260413261@ping.linuxembedded.co.uk>","Date":"Fri, 28 Mar 2025 09:11:54 +0100","Message-ID":"<8534exlgl1.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":"QcsHhx7ZrDphUQS3ONRk0Wc6yiLb49C1SvRtIGT1tqU_1743149517","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":33761,"web_url":"https://patchwork.libcamera.org/comment/33761/","msgid":"<20250328192101.GH22295@pendragon.ideasonboard.com>","date":"2025-03-28T19:21:01","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn Wed, Mar 19, 2025 at 10:55:33AM +0100, Milan Zamazal wrote:\n> Automatic black level setting in software ISP updates the determined\n> black level value when exposure or gain change.  It stores the last\n> exposure and gain values to detect the change.\n> \n> BlackLevel::configure() resets the stored black level value but not the\n> exposure and gain values.  This can prevent updating the black value and\n> cause bad image output, e.g. after suspending and resuming a camera, if\n> exposure and gain remain unchanged.\n\nI'm a bit puzzled there. If the exposure time and gain don't change,\nthen the black level will stay at 0. However, the bug report mentions\nvery dark images. What am I missing ?\n\n> Let's store exposure and gain in IPAActiveState.  Although the values\n> are not supposed to be used outside BlackLevel class, storing them in\n> the context has the advantage of their automatic reset together with the\n> other context contents and having them in `blc' struct indicates their\n> relationship to the black value computation.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>  src/ipa/simple/algorithms/blc.h   |  2 --\n>  src/ipa/simple/ipa_context.h      |  2 ++\n>  3 files changed, 7 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n> index 1d7d370b..089e492a 100644\n> --- a/src/ipa/simple/algorithms/blc.cpp\n> +++ b/src/ipa/simple/algorithms/blc.cpp\n> @@ -1,6 +1,6 @@\n>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>  /*\n> - * Copyright (C) 2024, Red Hat Inc.\n> + * Copyright (C) 2024-2025, Red Hat Inc.\n>   *\n>   * Black level handling\n>   */\n> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>  \tif (context.configuration.black.level.has_value())\n>  \t\treturn;\n>  \n> -\tif (frameContext.sensor.exposure == exposure_ &&\n> -\t    frameContext.sensor.gain == gain_) {\n> +\tif (frameContext.sensor.exposure == context.activeState.blc.lastExposure &&\n> +\t    frameContext.sensor.gain == context.activeState.blc.lastGain) {\n>  \t\treturn;\n>  \t}\n>  \n> @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>  \t\tseen += histogram[i];\n>  \t\tif (seen >= pixelThreshold) {\n>  \t\t\tcontext.activeState.blc.level = i * histogramRatio;\n> -\t\t\texposure_ = frameContext.sensor.exposure;\n> -\t\t\tgain_ = frameContext.sensor.gain;\n> +\t\t\tcontext.activeState.blc.lastExposure = frameContext.sensor.exposure;\n> +\t\t\tcontext.activeState.blc.lastGain = frameContext.sensor.gain;\n>  \t\t\tLOG(IPASoftBL, Debug)\n>  \t\t\t\t<< \"Auto-set black level: \"\n>  \t\t\t\t<< i << \"/\" << SwIspStats::kYHistogramSize\n> diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\n> index 52d59cab..db9e6d63 100644\n> --- a/src/ipa/simple/algorithms/blc.h\n> +++ b/src/ipa/simple/algorithms/blc.h\n> @@ -30,8 +30,6 @@ public:\n>  \t\t     ControlList &metadata) override;\n>  \n>  private:\n> -\tint32_t exposure_;\n> -\tdouble gain_;\n>  \tstd::optional<uint8_t> definedLevel_;\n>  };\n>  \n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index 4af51306..b1198af5 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>  struct IPAActiveState {\n>  \tstruct {\n>  \t\tuint8_t level;\n> +\t\tint32_t lastExposure;\n> +\t\tdouble lastGain;\n>  \t} blc;\n>  \n>  \tstruct {","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 D5EB3C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Mar 2025 19:21:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3322A614E8;\n\tFri, 28 Mar 2025 20:21:28 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D619614E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 20:21:25 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E232F844;\n\tFri, 28 Mar 2025 20:19:35 +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=\"FImK0hF8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743189576;\n\tbh=g+CeW92syt6jnn2KBNtN4X3HH+4R1OHa/zp/4pE2zE4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FImK0hF87ykh7gEcFki8FiJCWNhlBj0qoktHCArejBPM4ruC4UG0vudmtOcN3yIqC\n\tijtWZj1AXYydWioMRjjBdGrG6p8EziEu+9JiP95bxF2zP+qUBvXFWeTCOBpe7C+uWO\n\tKVBjLCMod1irvs+IZBPEA/MRYGLPntr3G9IurdOs=","Date":"Fri, 28 Mar 2025 21:21:01 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tRobert Mader <robert.mader@collabora.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","Message-ID":"<20250328192101.GH22295@pendragon.ideasonboard.com>","References":"<20250319095533.24550-1-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250319095533.24550-1-mzamazal@redhat.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":33764,"web_url":"https://patchwork.libcamera.org/comment/33764/","msgid":"<85y0wokgpd.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-03-28T21:06:54","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Laurent,\n\nLaurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> Hi Milan,\n>\n> Thank you for the patch.\n>\n> On Wed, Mar 19, 2025 at 10:55:33AM +0100, Milan Zamazal wrote:\n>> Automatic black level setting in software ISP updates the determined\n>> black level value when exposure or gain change.  It stores the last\n>> exposure and gain values to detect the change.\n>> \n>> BlackLevel::configure() resets the stored black level value but not the\n>> exposure and gain values.  This can prevent updating the black value and\n>> cause bad image output, e.g. after suspending and resuming a camera, if\n>> exposure and gain remain unchanged.\n>\n> I'm a bit puzzled there. If the exposure time and gain don't change,\n> then the black level will stay at 0. However, the bug report mentions\n> very dark images. What am I missing ?\n\nThat the black level, if unspecified, is initially set to 255.  (The\npoint is to get the lowest black level experienced, hence we start with\nthe highest value.)\n\n>> Let's store exposure and gain in IPAActiveState.  Although the values\n>> are not supposed to be used outside BlackLevel class, storing them in\n>> the context has the advantage of their automatic reset together with the\n>> other context contents and having them in `blc' struct indicates their\n>> relationship to the black value computation.\n>> \n>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n>>  src/ipa/simple/algorithms/blc.h   |  2 --\n>>  src/ipa/simple/ipa_context.h      |  2 ++\n>>  3 files changed, 7 insertions(+), 7 deletions(-)\n>> \n>> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n>> index 1d7d370b..089e492a 100644\n>> --- a/src/ipa/simple/algorithms/blc.cpp\n>> +++ b/src/ipa/simple/algorithms/blc.cpp\n>> @@ -1,6 +1,6 @@\n>>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n>>  /*\n>> - * Copyright (C) 2024, Red Hat Inc.\n>> + * Copyright (C) 2024-2025, Red Hat Inc.\n>>   *\n>>   * Black level handling\n>>   */\n>> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n>>  \tif (context.configuration.black.level.has_value())\n>>  \t\treturn;\n>>  \n>> -\tif (frameContext.sensor.exposure == exposure_ &&\n>> -\t    frameContext.sensor.gain == gain_) {\n>> +\tif (frameContext.sensor.exposure == context.activeState.blc.lastExposure &&\n>> +\t    frameContext.sensor.gain == context.activeState.blc.lastGain) {\n>>  \t\treturn;\n>>  \t}\n>>  \n>> @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n>>  \t\tseen += histogram[i];\n>>  \t\tif (seen >= pixelThreshold) {\n>>  \t\t\tcontext.activeState.blc.level = i * histogramRatio;\n>> -\t\t\texposure_ = frameContext.sensor.exposure;\n>> -\t\t\tgain_ = frameContext.sensor.gain;\n>> +\t\t\tcontext.activeState.blc.lastExposure = frameContext.sensor.exposure;\n>> +\t\t\tcontext.activeState.blc.lastGain = frameContext.sensor.gain;\n>>  \t\t\tLOG(IPASoftBL, Debug)\n>>  \t\t\t\t<< \"Auto-set black level: \"\n>>  \t\t\t\t<< i << \"/\" << SwIspStats::kYHistogramSize\n>> diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\n>> index 52d59cab..db9e6d63 100644\n>> --- a/src/ipa/simple/algorithms/blc.h\n>> +++ b/src/ipa/simple/algorithms/blc.h\n>> @@ -30,8 +30,6 @@ public:\n>>  \t\t     ControlList &metadata) override;\n>>  \n>>  private:\n>> -\tint32_t exposure_;\n>> -\tdouble gain_;\n>>  \tstd::optional<uint8_t> definedLevel_;\n>>  };\n>>  \n>> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n>> index 4af51306..b1198af5 100644\n>> --- a/src/ipa/simple/ipa_context.h\n>> +++ b/src/ipa/simple/ipa_context.h\n>> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n>>  struct IPAActiveState {\n>>  \tstruct {\n>>  \t\tuint8_t level;\n>> +\t\tint32_t lastExposure;\n>> +\t\tdouble lastGain;\n>>  \t} blc;\n>>  \n>>  \tstruct {","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 8F771C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Mar 2025 21:07:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 65E3E6897A;\n\tFri, 28 Mar 2025 22:07:02 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A81D614E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 22:07:00 +0100 (CET)","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n\t[209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-488-Df7maDwhN1KTzoMhDwYSZg-1; Fri, 28 Mar 2025 17:06:57 -0400","by mail-wr1-f71.google.com with SMTP id\n\tffacd0b85a97d-394bbefc98cso2107057f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Mar 2025 14:06:57 -0700 (PDT)","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\tffacd0b85a97d-39c0b65873bsm3647061f8f.8.2025.03.28.14.06.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 28 Mar 2025 14:06:55 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"gBRLr0Wd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1743196019;\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=VGiVFk2L1IgVQmw81NIUshDB4AhZJB8qE8mvZdhyy54=;\n\tb=gBRLr0WdkN3tAEaZgBQOexp66RyULQOLy5Fzpku7ySQG4y4U31++Z0ewHvrwmw9yW0CHIe\n\tpf8NNqLqeHMimBINAz02AEVcZ5D7ErOb3hS4cWyzOUjXaWvCWQ7E45s0tJwc7B1PCPyF+j\n\tgBUljIaNWNV1Wo9Bp8cSyKB9ikdB9pc=","X-MC-Unique":"Df7maDwhN1KTzoMhDwYSZg-1","X-Mimecast-MFC-AGG-ID":"Df7maDwhN1KTzoMhDwYSZg_1743196016","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1743196016; x=1743800816;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=VGiVFk2L1IgVQmw81NIUshDB4AhZJB8qE8mvZdhyy54=;\n\tb=TQ4QqK7rrwt1j54VFlIae1Wz1LPzb8boD2XoWFHkMVpKabpwCTT3YsFcsPeq1sKxEY\n\t7ojY5sQ2QYAHnH96XKz47w/eqf3NhOd9/K8MYQcg/Nit0R8ZQUTnRrKnUufuuXIpcXod\n\tf+L4QgbwbWuzQKFkFH2AAeYlYlnp5uYylD5y12ZV7QLqV6pLmkb+FaglC6hZfW0Wgtnm\n\tT1JYP72iLoEQCTBybUZxdi9m1ZzHq6WQw1kbbtQcKmQcUmsubkli5KhjfDCuGe98lqwx\n\tXSmod6o2lVS4ub5MEXc553NMNXQkcguYZ0p2EW0fWJwfBT+r95lf7wfhHvPr0msXAfcZ\n\tW3eg==","X-Gm-Message-State":"AOJu0Yzs+aKDO1xBectrdnfo8gAdQMBnVAxkslmNuK/JA1QAsKTIj9DI\n\tiiRNtagEYnqtsmyxx9fGQPQECVn+MDSbLombDka1J7K6t5rEoddzMGXdvV+0751jc+G+p1yvsrX\n\tzptvA5e+y+W/i79Kbhp1svobtdEtkJvxuVFZ07DGaxfvZK8ZH5TCT0/bleCb/ImWiokKZ8OE=","X-Gm-Gg":"ASbGncvRWy5QZ/fZle8AljYiak0DBzFWdTldDzKUE+T3B+Zfty/nMO1raf3L7mUGjjx\n\tKADlQBpN1Cm4shSgsLROelXol0lRqC2ty4mOgya+akcbERV20s5VSaWDy5ytf8usJAejXTwhhCW\n\th/UsYRdCAWZP+6uleATQ6TXJSKaCLYVOXFHQt8KrD1SB/6GetwFvHvcsKbU1+0u3myPdiRVhGmb\n\t6LqEvhW8l3POJzbM6H3D6R7HnshkaFoh1EeVhPX7+6Hvt4r6RF5IWtJWzdRkB8raFy88q9+otgA\n\txSw1RGcge76I69UILJgdDqbgsUOdWDqxO1BVN7a98/1LY7ZPTJj4XbKP/zV7U/X8Xv5x","X-Received":["by 2002:a05:6000:2a4:b0:391:306f:57de with SMTP id\n\tffacd0b85a97d-39c1211ddcemr465927f8f.45.1743196016157; \n\tFri, 28 Mar 2025 14:06:56 -0700 (PDT)","by 2002:a05:6000:2a4:b0:391:306f:57de with SMTP id\n\tffacd0b85a97d-39c1211ddcemr465907f8f.45.1743196015692; \n\tFri, 28 Mar 2025 14:06:55 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGVmPJyqITpsBVxs2/QK7VGpo3fnvv39AmSQV0cGoqgOuPQn8fVZ3PItxmABDYxXiYguTJ4cg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Robert Mader\n\t<robert.mader@collabora.com>,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","In-Reply-To":"<20250328192101.GH22295@pendragon.ideasonboard.com> (Laurent\n\tPinchart's message of \"Fri, 28 Mar 2025 21:21:01 +0200\")","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<20250328192101.GH22295@pendragon.ideasonboard.com>","Date":"Fri, 28 Mar 2025 22:06:54 +0100","Message-ID":"<85y0wokgpd.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":"GlwoH9fIPbuuKSlIYC2njNAS-kM4JA2PvBf3a525uyY_1743196016","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":33836,"web_url":"https://patchwork.libcamera.org/comment/33836/","msgid":"<20250401021227.GB26315@pendragon.ideasonboard.com>","date":"2025-04-01T02:12:27","subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Mar 28, 2025 at 10:06:54PM +0100, Milan Zamazal wrote:\n> Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n> > On Wed, Mar 19, 2025 at 10:55:33AM +0100, Milan Zamazal wrote:\n> >> Automatic black level setting in software ISP updates the determined\n> >> black level value when exposure or gain change.  It stores the last\n> >> exposure and gain values to detect the change.\n> >> \n> >> BlackLevel::configure() resets the stored black level value but not the\n> >> exposure and gain values.  This can prevent updating the black value and\n> >> cause bad image output, e.g. after suspending and resuming a camera, if\n> >> exposure and gain remain unchanged.\n> >\n> > I'm a bit puzzled there. If the exposure time and gain don't change,\n> > then the black level will stay at 0. However, the bug report mentions\n> > very dark images. What am I missing ?\n> \n> That the black level, if unspecified, is initially set to 255.  (The\n> point is to get the lowest black level experienced, hence we start with\n> the highest value.)\n\nAahhh of course.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >> Let's store exposure and gain in IPAActiveState.  Although the values\n> >> are not supposed to be used outside BlackLevel class, storing them in\n> >> the context has the advantage of their automatic reset together with the\n> >> other context contents and having them in `blc' struct indicates their\n> >> relationship to the black value computation.\n> >> \n> >> Bug: https://bugs.libcamera.org/show_bug.cgi?id=259\n> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >> ---\n> >>  src/ipa/simple/algorithms/blc.cpp | 10 +++++-----\n> >>  src/ipa/simple/algorithms/blc.h   |  2 --\n> >>  src/ipa/simple/ipa_context.h      |  2 ++\n> >>  3 files changed, 7 insertions(+), 7 deletions(-)\n> >> \n> >> diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\n> >> index 1d7d370b..089e492a 100644\n> >> --- a/src/ipa/simple/algorithms/blc.cpp\n> >> +++ b/src/ipa/simple/algorithms/blc.cpp\n> >> @@ -1,6 +1,6 @@\n> >>  /* SPDX-License-Identifier: LGPL-2.1-or-later */\n> >>  /*\n> >> - * Copyright (C) 2024, Red Hat Inc.\n> >> + * Copyright (C) 2024-2025, Red Hat Inc.\n> >>   *\n> >>   * Black level handling\n> >>   */\n> >> @@ -54,8 +54,8 @@ void BlackLevel::process(IPAContext &context,\n> >>  \tif (context.configuration.black.level.has_value())\n> >>  \t\treturn;\n> >>  \n> >> -\tif (frameContext.sensor.exposure == exposure_ &&\n> >> -\t    frameContext.sensor.gain == gain_) {\n> >> +\tif (frameContext.sensor.exposure == context.activeState.blc.lastExposure &&\n> >> +\t    frameContext.sensor.gain == context.activeState.blc.lastGain) {\n> >>  \t\treturn;\n> >>  \t}\n> >>  \n> >> @@ -79,8 +79,8 @@ void BlackLevel::process(IPAContext &context,\n> >>  \t\tseen += histogram[i];\n> >>  \t\tif (seen >= pixelThreshold) {\n> >>  \t\t\tcontext.activeState.blc.level = i * histogramRatio;\n> >> -\t\t\texposure_ = frameContext.sensor.exposure;\n> >> -\t\t\tgain_ = frameContext.sensor.gain;\n> >> +\t\t\tcontext.activeState.blc.lastExposure = frameContext.sensor.exposure;\n> >> +\t\t\tcontext.activeState.blc.lastGain = frameContext.sensor.gain;\n> >>  \t\t\tLOG(IPASoftBL, Debug)\n> >>  \t\t\t\t<< \"Auto-set black level: \"\n> >>  \t\t\t\t<< i << \"/\" << SwIspStats::kYHistogramSize\n> >> diff --git a/src/ipa/simple/algorithms/blc.h b/src/ipa/simple/algorithms/blc.h\n> >> index 52d59cab..db9e6d63 100644\n> >> --- a/src/ipa/simple/algorithms/blc.h\n> >> +++ b/src/ipa/simple/algorithms/blc.h\n> >> @@ -30,8 +30,6 @@ public:\n> >>  \t\t     ControlList &metadata) override;\n> >>  \n> >>  private:\n> >> -\tint32_t exposure_;\n> >> -\tdouble gain_;\n> >>  \tstd::optional<uint8_t> definedLevel_;\n> >>  };\n> >>  \n> >> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> >> index 4af51306..b1198af5 100644\n> >> --- a/src/ipa/simple/ipa_context.h\n> >> +++ b/src/ipa/simple/ipa_context.h\n> >> @@ -33,6 +33,8 @@ struct IPASessionConfiguration {\n> >>  struct IPAActiveState {\n> >>  \tstruct {\n> >>  \t\tuint8_t level;\n> >> +\t\tint32_t lastExposure;\n> >> +\t\tdouble lastGain;\n> >>  \t} blc;\n> >>  \n> >>  \tstruct {","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 E2731C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Apr 2025 02:12:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C076F68981;\n\tTue,  1 Apr 2025 04:12:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E1E3F62C66\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Apr 2025 04:12:52 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-147-224-nat.elisa-mobile.fi\n\t[85.76.147.224])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A363A250;\n\tTue,  1 Apr 2025 04:11:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DWeq5I6Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743473460;\n\tbh=NKBRzSW65/nmNlp+qhPDAdcAfC0EgNiav28O9/Vhn9w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DWeq5I6ZYnpfvcf2mvj1PkkKa4As1JxFG9CzYxglEI1pwcEy3t8ONlLrS46uMlHYa\n\tziCVw0owjkV9eff5Br1Wir+rvBgWqOAtVHVjE3UBPZhHoR8KSeoTrbwt2+Qvztu9dx\n\tz7C0kuqTtZzbTmtWZmzOWENzYuViXf3A0D1JAc7o=","Date":"Tue, 1 Apr 2025 05:12:27 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tRobert Mader <robert.mader@collabora.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: software_isp: Reset stored exposure in\n\tblack level","Message-ID":"<20250401021227.GB26315@pendragon.ideasonboard.com>","References":"<20250319095533.24550-1-mzamazal@redhat.com>\n\t<20250328192101.GH22295@pendragon.ideasonboard.com>\n\t<85y0wokgpd.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<85y0wokgpd.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","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>"}}]