[{"id":36424,"web_url":"https://patchwork.libcamera.org/comment/36424/","msgid":"<003c9e3c-6925-4ecb-bba2-84c4a2e0a67d@ideasonboard.com>","date":"2025-10-24T09:39:24","subject":"Re: [PATCH v1 22/35] ipa: rkisp1: Allow processStats to be called\n\twithout stats buffer","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 10. 24. 10:50 keltezéssel, Stefan Klug írta:\n> When there are no stats available for a frame, it still makes sense\n> to call processStats to fill in the metadata of that frame. This mechanism is\n> already used for the raw path. Allow it's use for no-raw also.\n> \n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>   src/ipa/rkisp1/rkisp1.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 7a7b7682e242..01b30c947a0a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -389,7 +389,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n>   \t * provided.\n>   \t */\n>   \tconst rkisp1_stat_buffer *stats = nullptr;\n> -\tif (!context_.configuration.raw)\n> +\tif (bufferId != 0)\n>   \t\tstats = reinterpret_cast<rkisp1_stat_buffer *>(\n>   \t\t\tmappedBuffers_.at(bufferId).planes()[0].data());\n\nThis assumes that bufferId of 0 is considered \"invalid\". This is kind of ensured in\n`PipelineHandlerRkISP1::allocateBuffers()`, but not really enforced in\n`IPARkISP1::mapBuffers()` or such. So maybe doing something like\n\n   if (auto it = mappedBuffers_.find(bufferId); it != mappedBuffers_.end())\n     stats = reinterpret_cast<rkisp1_stat_buffer *>(it->second.planes()[0].data());\n\ncould be considered. Although this has the potential of \"hiding\" incorrect of incorrect\nids, whereas currently they cause an exception, which terminates the process quite visibly.\n\n\n> \n> --\n> 2.48.1\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 06C15C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Oct 2025 09:39:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4BBCE6089E;\n\tFri, 24 Oct 2025 11:39:30 +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 4A05E6088F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Oct 2025 11:39:28 +0200 (CEST)","from [192.168.33.13] (185.221.141.231.nat.pool.zt.hu\n\t[185.221.141.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B517419E5;\n\tFri, 24 Oct 2025 11:37:42 +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=\"F/FjlAhn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761298662;\n\tbh=0BB0lLNaydkujff5Mn55B8Gu3EbXwexbeLrd4SgKGIw=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=F/FjlAhnH/CI3rkdaBTOzREi3CIoxWSXDYAF7k+wwMxgniTz/HvgiywhUN4sADSMS\n\txa5qxorklrjskBECYA41ehJIzpsddsY4ZrzTJ5Ob9kjJ6foR3WqaL8mC/e5UyCHB3S\n\tzrpuEZalCABcAhd9MH4dTR0Fo+PIdpCobuMyMaIY=","Message-ID":"<003c9e3c-6925-4ecb-bba2-84c4a2e0a67d@ideasonboard.com>","Date":"Fri, 24 Oct 2025 11:39:24 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 22/35] ipa: rkisp1: Allow processStats to be called\n\twithout stats buffer","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251024085130.995967-1-stefan.klug@ideasonboard.com>\n\t<EfEieJGI4mfMGESBRY4ZCqxrHqSR3zrMH_c8YLvXiT_ajysgaNK_ke4jrVbXvn5psrLZF9hi3kjkry9Roh7hcA==@protonmail.internalid>\n\t<20251024085130.995967-23-stefan.klug@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251024085130.995967-23-stefan.klug@ideasonboard.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":37856,"web_url":"https://patchwork.libcamera.org/comment/37856/","msgid":"<176907341459.3882822.8457377576108786508@neptunite.rasen.tech>","date":"2026-01-22T09:16:54","subject":"Re: [PATCH v1 22/35] ipa: rkisp1: Allow processStats to be called\n\twithout stats buffer","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-10-24 17:50:46)\n> When there are no stats available for a frame, it still makes sense\n> to call processStats to fill in the metadata of that frame. This mechanism is\n> already used for the raw path. Allow it's use for no-raw also.\n> \n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/rkisp1.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 7a7b7682e242..01b30c947a0a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -389,7 +389,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n>          * provided.\n>          */\n>         const rkisp1_stat_buffer *stats = nullptr;\n> -       if (!context_.configuration.raw)\n\nThis breaks raw capture.\n\n> +       if (bufferId != 0)\n\nI get that you want to take this path on the 0th frame though for start(), so I\nthink we should or this condition with the above.\n\nOr we could take Barnabás's approach, which is probably more memory-safe.\n\n\nPaul\n\n>                 stats = reinterpret_cast<rkisp1_stat_buffer *>(\n>                         mappedBuffers_.at(bufferId).planes()[0].data());\n>  \n> -- \n> 2.48.1\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 66C14BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 09:17:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 14F4F61FD9;\n\tThu, 22 Jan 2026 10:17:02 +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 504AD61FC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 10:17:00 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:8816:a947:ebed:2ec7])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 645D6324;\n\tThu, 22 Jan 2026 10:16:27 +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=\"LDRkp80Q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769073387;\n\tbh=PLo9kfevyZlEgSoHDr5Vv9nHw3ezYuMINgznhiTbjaA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=LDRkp80Qrr2+phnBBlcZkr4xKihqTob22TC0YjmLXgCF7M58BZpS6V3+l4+b8v0op\n\tGLRQel0PH6TVesGnuwfzb9G7AY+S2ZLLqWqYVycRbtPTdCSqYtYXtQjUTVtB9PVgbU\n\t/ItoQEUTDMMIlpIDvjQG+bQB1G31w9trTm5GWZqU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251024085130.995967-23-stefan.klug@ideasonboard.com>","References":"<20251024085130.995967-1-stefan.klug@ideasonboard.com>\n\t<20251024085130.995967-23-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v1 22/35] ipa: rkisp1: Allow processStats to be called\n\twithout stats buffer","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 22 Jan 2026 18:16:54 +0900","Message-ID":"<176907341459.3882822.8457377576108786508@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>"}}]