From patchwork Tue Sep 30 12:26:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24498 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 0681CC324C for ; Tue, 30 Sep 2025 12:32:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B26296B5F3; Tue, 30 Sep 2025 14:32:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oD87gvvk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A73BA6936E for ; Tue, 30 Sep 2025 14:32:04 +0200 (CEST) Received: from ideasonboard.com (unknown [94.31.94.171]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 61B06220; Tue, 30 Sep 2025 14:30:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1759235436; bh=BtyttId+RSHnpn6/RIQh9Tpcn88MdDojifzZ4WPkTLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oD87gvvkVSfDExpjOp6+64NaB8u6D/EDnMTlf4p+zcvOfX/uU34IBo6cqb9dbXxPf zMdfDjjXxg01f73ItxYajvG7KGaVqZFWVvoC0FeEoPf8SEmJQYCl/StiRuz/zta4nr berJ5ULn2VZCoIP1BGr1j5FhtaLiy4l2S3gqdjsk= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v1 01/33] libcamera: rkisp1: Only connect delayed controls at start/stop Date: Tue, 30 Sep 2025 14:26:22 +0200 Message-ID: <20250930122726.1837524-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250930122726.1837524-1-stefan.klug@ideasonboard.com> References: <20250930122726.1837524-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" From: Kieran Bingham The RKISP1 path may potentially have multiple cameras connected through complex pipelines such as video multiplexors or multiple FPGA paths. The RKISP1 pipeline handler notifies DelayedControls that a new frame is commencing by using the frameStart event on the ISP and using that to signal to DelayedControls that it is time to process the controls for the next frame. When more than one camera is connected to an ISP it is important not to signal events to an inactive Camera. Move the frameStart signal connection from CreateCamera() to start() and introduce a corresponding disconnect at stop(). Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index ecd13831539f..605a0724615d 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -1097,6 +1097,11 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL utils::ScopeExitActions actions; int ret; + isp_->frameStart.connect(data->delayedCtrls_.get(), + &DelayedControls::applyControls); + + actions += [&]() { isp_->frameStart.disconnect(data->delayedCtrls_.get()); }; + /* Allocate buffers for internal pipeline usage. */ ret = allocateBuffers(camera); if (ret) @@ -1168,6 +1173,8 @@ void PipelineHandlerRkISP1::stopDevice(Camera *camera) isp_->setFrameStartEnabled(false); + isp_->frameStart.disconnect(data->delayedCtrls_.get()); + data->ipa_->stop(); if (hasSelfPath_) @@ -1354,8 +1361,6 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor) data->delayedCtrls_ = std::make_unique(data->sensor_->device(), params); - isp_->frameStart.connect(data->delayedCtrls_.get(), - &DelayedControls::applyControls); uint32_t supportedBlocks = kDefaultExtParamsBlocks;