From patchwork Wed Mar 25 15:13:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 26363 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D22B9C3304 for ; Wed, 25 Mar 2026 15:15:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 631C762C7D; Wed, 25 Mar 2026 16:15:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ZBVuDrcg"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B01B62C44 for ; Wed, 25 Mar 2026 16:15:40 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:b16a:5ed9:4ada:a95a]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 73CE71992; Wed, 25 Mar 2026 16:14:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774451662; bh=ZvkKBAI6BWqkHPAtWOtsQMkeg8HSUtRWRmQVERiUozw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZBVuDrcgyyGmNGJqBEAn6Ri8ooEEJ6hkVroYJ/jLLUbgFCviJGy+AwtgOInaaxQCX EvWp04t5igVCsxOp/fK/EkwZ8+GZut+n9pMUstDK052/son5c3LdCk+0jrZgFvK9LD gcn/gSxcvoxVizYUz7RZQSFs2ZdhXK4FgiDZi9CQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v2 21/32] ipa: rkisp1: Allow processStats() to be called without stats buffer Date: Wed, 25 Mar 2026 16:13:53 +0100 Message-ID: <20260325151416.2114564-22-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260325151416.2114564-1-stefan.klug@ideasonboard.com> References: <20260325151416.2114564-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When there are no stats available for a frame, it still makes sense to call processStats() to fill in the metadata of that frame. This mechanism is already used for the raw path. Allow it's use for non-raw also. The current code never produces buffers with id 0, but it is not enforced. Add a assert to enforce that. Signed-off-by: Stefan Klug --- Changes in v2: - Added an assert to ensure there is no buffer with id 0 --- src/ipa/rkisp1/rkisp1.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 3f943a08d011..88cf6afc219d 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -304,6 +304,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, void IPARkISP1::mapBuffers(const std::vector &buffers) { for (const IPABuffer &buffer : buffers) { + /* A buffer id of 0 is considered invalid */ + ASSERT(buffer.id != 0); + auto elem = buffers_.emplace(std::piecewise_construct, std::forward_as_tuple(buffer.id), std::forward_as_tuple(buffer.planes)); @@ -389,7 +392,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId, * provided. */ const rkisp1_stat_buffer *stats = nullptr; - if (!context_.configuration.raw) + if (bufferId != 0) stats = reinterpret_cast( mappedBuffers_.at(bufferId).planes()[0].data());