From patchwork Mon Sep 14 14:02:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 28268 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 83149C335D for ; Mon, 14 Sep 2026 14:04:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0479D686EE; Mon, 14 Sep 2026 16:04:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="viGxjoMm"; 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 B727F686EC for ; Mon, 14 Sep 2026 16:04:31 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:a279:75fa:1f6c:7f40]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C5C57512; Mon, 14 Sep 2026 16:02:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789394571; bh=rbq+6rtEALC8VfLUhEWq8LHy4llIg73e8OrM0gKOukQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=viGxjoMm83FHvefF/eHIEdl/d9ichS84f2pu6bdpEVH/cwk7yiEM7GKbMEMkOC+Ut pVrSWXvdstIh4oIZ4r9KVi44hnLegJERsATnd01nxnWG8yHpHi30nbAKl0ebermQ8g nA8k+3CEN8zLavA7Hri0v7u7M1a9X0L7cmtFUoHs= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v3 24/41] pipeline: rkisp1: Pass bufferId to metadataReady() Date: Mon, 14 Sep 2026 16:02:37 +0200 Message-ID: <20260914140309.3354666-25-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" The frame number is not necessarily unique. This should not be the case, but even misbehaving kernel drivers should not be able to negatively influence libcamera. Pass the bufferId, to have a guaranteed unique handle. This patch only introduces the parameter without using it. It is preparatory for the upcoming synchronization rework. Signed-off-by: Stefan Klug --- include/libcamera/ipa/rkisp1.mojom | 4 ++-- src/ipa/rkisp1/rkisp1.cpp | 4 ++-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 4c29b53cd7f9..04230d0f852e 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -42,7 +42,7 @@ interface IPARkISP1Interface { }; interface IPARkISP1EventInterface { - paramsComputed(uint32 frame, uint32 bytesused); + paramsComputed(uint32 frame, uint32 bufferId, uint32 bytesused); setSensorControls(uint32 frame, libcamera.ControlList sensorControls); - metadataReady(uint32 frame, libcamera.ControlList metadata); + metadataReady(uint32 frame, uint32 bufferId, libcamera.ControlList metadata); }; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 08b7dde6b2de..abfd3c5ff58f 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -324,7 +324,7 @@ void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId) for (const auto &algo : algorithms()) algo->prepare(context_, frame, frameContext, ¶ms); - paramsComputed.emit(frame, params.bytesused()); + paramsComputed.emit(frame, bufferId, params.bytesused()); } ControlList ctrls = getSensorControls(frameContext); @@ -358,7 +358,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId, } context_.debugMetadata.moveEntries(metadata); - metadataReady.emit(frame, metadata); + metadataReady.emit(frame, bufferId, metadata); } void IPARkISP1::updateControls(ControlInfoMap *ipaControls) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index edd9f352524c..d84044f218b5 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -130,11 +130,11 @@ public: bool usesDewarper_; private: - void paramsComputed(unsigned int frame, unsigned int bytesused); + void paramsComputed(unsigned int frame, unsigned int bufferId, unsigned int bytesused); void setSensorControls(unsigned int frame, const ControlList &sensorControls); - void metadataReady(unsigned int frame, const ControlList &metadata); + void metadataReady(unsigned int frame, unsigned int bufferId, const ControlList &metadata); int loadTuningFile(const std::string &file); }; @@ -475,7 +475,9 @@ int RkISP1CameraData::loadTuningFile(const std::string &path) return 0; } -void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused) +void RkISP1CameraData::paramsComputed(unsigned int frame, + [[maybe_unused]] unsigned int bufferId, + unsigned int bytesused) { PipelineHandlerRkISP1 *pipe = RkISP1CameraData::pipe(); RkISP1FrameInfo *info = frameInfo_.find(frame); @@ -506,7 +508,9 @@ void RkISP1CameraData::setSensorControls(unsigned int frame, delayedCtrls_->push(frame, sensorControls); } -void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata) +void RkISP1CameraData::metadataReady(unsigned int frame, + [[maybe_unused]] unsigned int bufferId, + const ControlList &metadata) { RkISP1FrameInfo *info = frameInfo_.find(frame); if (!info)