From patchwork Tue Feb 25 16:41:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 22869 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 EBAE0BDB1C for ; Tue, 25 Feb 2025 16:41:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A1EFA68733; Tue, 25 Feb 2025 17:41:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Phd9DzaU"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 01D5D6872D for ; Tue, 25 Feb 2025 17:41:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740501716; x=1772037716; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5TUsit5KkBSqkcFHmQvWJf8nR/TKdJIJxtM4z//UWEI=; b=Phd9DzaU7UhxK3lMFekkE5gTX3cjkw+45ca+Bd3s1Hi6FXZb0nRqYVXe CrwkN/8cydEtzXEhGuhRo0mpJgc//ZRhygzCYyhVQPTOz/tVlqNGG7WeL XrEB/SU8ubiTM5eKULyqX6Q9dp1bZmED6OLl9kMtpmT77vWQJ2hllBeT5 gVugpVxSURsZIaJP62GzrzOL9tWDTOlh23McBR7HrnZoI7PwTHYqQRz5r M1tmOwt4dN8KI/UiUzBynzAURPYAWM/eOLr6H2fKo/aC8qHhWnatbvyJs l5s8+unJT9Em14s1+DadIGdf+mVCHlN72l4ZMIxAL0ON7imUyw6upJCWZ A==; X-CSE-ConnectionGUID: rQovXHqiQDuTZzPtDby4Qw== X-CSE-MsgGUID: 9K1jAHTqROygJrRvzLMpdw== X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="52740869" X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="52740869" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:41:54 -0800 X-CSE-ConnectionGUID: wdjBb0SNSpiofxhDolBgVg== X-CSE-MsgGUID: WbwzeAJzQj6R/X+S42lwdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="121689887" Received: from sgruszka-mobl.ger.corp.intel.com (HELO localhost) ([10.245.115.185]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:41:51 -0800 From: Stanislaw Gruszka To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Laurent Pinchart , Kieran Bingham , Naushir Patuck , Sakari Ailus , Hans de Goede Subject: [PATCH v5 5/5] pipeline: simple: Create DelayedControls instance once only Date: Tue, 25 Feb 2025 17:41:16 +0100 Message-Id: <20250225164116.414301-6-stanislaw.gruszka@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250225164116.414301-1-stanislaw.gruszka@linux.intel.com> References: <20250225164116.414301-1-stanislaw.gruszka@linux.intel.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: Laurent Pinchart The DelayedControls instance for the camera sensor is created in SimplePipelineHandler::configure(). Constant deletion and reconstruction of a new object is unnecessary, as the control delays are an intrinsic property of the sensor and are known at initialization time. Move the DelayedControls creation to the SimpleCameraData class constructor. Signed-off-by: Laurent Pinchart Signed-off-by: Stanislaw Gruszka Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index b92b738b..73a4138e 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -489,6 +489,13 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe, if (!sensor_) return; + const CameraSensorProperties::SensorDelays &delays = sensor_->sensorDelays(); + std::unordered_map params = { + { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, + { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, + }; + delayedCtrls_ = std::make_unique(sensor_->device(), params); + LOG(SimplePipeline, Debug) << "Found pipeline: " << utils::join(entities_, " -> ", @@ -1294,15 +1301,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) if (outputCfgs.empty()) return 0; - const CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays(); - std::unordered_map params = { - { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } }, - { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } }, - }; - data->delayedCtrls_ = - std::make_unique(data->sensor_->device(), - params); - StreamConfiguration inputCfg; inputCfg.pixelFormat = pipeConfig->captureFormat; inputCfg.size = pipeConfig->captureSize;