From patchwork Mon Sep 14 14:02:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 28263 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 B515FC3359 for ; Mon, 14 Sep 2026 14:04:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 162EC686D4; Mon, 14 Sep 2026 16:04:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nwbcAESR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C450D6869A for ; Mon, 14 Sep 2026 16:04:19 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:a279:75fa:1f6c:7f40]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C64F4929; Mon, 14 Sep 2026 16:02:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789394559; bh=yQyRn0mTAx67FWBQZf4EQMEDnwk3h9NCS12HIBD+l5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nwbcAESRIe2o9da3Xk5ccJWDnX2uGMSQQfSwoqrrgcfucsM7R4wYei8/BcMlS33WS cH+wUqSSwESERGVNrCtx4aWFLvTRAQg5Ji94rQnhsvPWdRvUEdpRwkEGqBtBJxCRz7 O9uNDUdbAxwJvqou2eQhTmkyOFB00a+kCR0U3amg= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v3 19/41] ipa: rkisp1: Allow processStats() to be called without stats buffer Date: Mon, 14 Sep 2026 16:02:32 +0200 Message-ID: <20260914140309.3354666-20-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260914140309.3354666-1-stefan.klug@ideasonboard.com> References: <20260914140309.3354666-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 fe1a42af36a3..08b7dde6b2de 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -263,6 +263,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)); @@ -338,7 +341,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());