From patchwork Tue Jan 13 00:07:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 25727 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 4DC60C3285 for ; Tue, 13 Jan 2026 00:08:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DFCAF61FCB; Tue, 13 Jan 2026 01:08:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p4LjBcQi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6912A61FBC for ; Tue, 13 Jan 2026 01:08:40 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi [81.175.209.152]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id BD91BBCA for ; Tue, 13 Jan 2026 01:08:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768262894; bh=qcl7+VS5Gd19/WBC7zYCeHTYe13Ymb4TPWRrZYqACho=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p4LjBcQi4KwY460EN2BoXj7lTj+6Mr7mxcFgs1jiJcxQHo1fI3AwwvhD7CbKkdbfc gmX6sZ8/9JFfFgUpFDJq0dV93BP0tJkJ20laRO2pCTQLTHcN2o94u/dHuLs4xN0/e4 AHD/I6I5RZ2oO0OE0/7mEhk4b/1Qa1zy7fwHUNGs= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 07/36] libcamera: camera_manager: Move IPAManager creation to start() time Date: Tue, 13 Jan 2026 02:07:39 +0200 Message-ID: <20260113000808.15395-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260113000808.15395-1-laurent.pinchart@ideasonboard.com> References: <20260113000808.15395-1-laurent.pinchart@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 IPAManager is currently instantiated when constructing the CameraManager constructor, in the CameraManager::Private constructor. This is the only sizeable object constructed with the CameraManager, all other components are constructed when starting the manager. Early construction of the IPAManager isn't wrong per-se, but prevents accessing the CameraManager from the IPAManager constructor (as the former isn't fully constructed). It also results in internal objects constructed in different threads, which isn't an issue at the moment as none of the objects constructed by the IPAManager are thread-bound, but could cause issues later. Finally, it prevents influencing the IPAManager creation with parameters passed to the CameraManager::start() function once we implement this, which would be useful for applications to override configuration parameters related to IPA modules. Move the instantiation of the IPAManager to start time to fix all those issues. Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze --- src/libcamera/camera_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index fc6e490bc476..5762c210ffc2 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -41,7 +41,6 @@ LOG_DEFINE_CATEGORY(Camera) CameraManager::Private::Private() : Thread("CameraManager"), initialized_(false) { - ipaManager_ = std::make_unique(configuration()); } int CameraManager::Private::start() @@ -94,6 +93,8 @@ void CameraManager::Private::run() int CameraManager::Private::init() { + ipaManager_ = std::make_unique(configuration()); + enumerator_ = DeviceEnumerator::create(); if (!enumerator_ || enumerator_->enumerate()) return -ENODEV;