From patchwork Thu Apr 3 07:45:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 23113 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 A992CC3213 for ; Thu, 3 Apr 2025 07:46:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 55B45689A6; Thu, 3 Apr 2025 09:46:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="CcCeeVMn"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D3F3A689A0 for ; Thu, 3 Apr 2025 09:46:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743666377; x=1775202377; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qBUl+9nQXJ/cOw+W0Ys07mYDrg2vpWXEtVlAozbyPgA=; b=CcCeeVMnhdCV8vy3g8UeBs2Q7Rr0zzVKGXu5st1UAmDJp9tvTJ4D2Kp5 KmuB9wsJPcpd3nMkYy2dI7L94o83O9J0jWXkj06tfKEzpxeuW/CGFGk08 fVD1CRl3eJsLpGBqKPrWXEmNDw3XW2lGKl9PDX5v7tgBmvgNpGK1f0she UfN9iORx6zomkBJTNfaguR5wcfWNvHXxvgoGayaESJUxosN+mGRLl4hKq HFNx6iSdGoqeSPzF/RylBX4QwOI1PlUIB+QY7IuH+g27FHGAxRSRad2eM qYtRDew5CMJT0DIpbGQpDXmkcyEJPbrvY+jJ73GxtBOS9ZXk25URYPmuw A==; X-CSE-ConnectionGUID: Hy3/JCxCQnKuTESRiQrbYA== X-CSE-MsgGUID: XqqP4ozPSA+JZ3BmzjWE/w== X-IronPort-AV: E=McAfee;i="6700,10204,11392"; a="48721721" X-IronPort-AV: E=Sophos;i="6.15,184,1739865600"; d="scan'208";a="48721721" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2025 00:46:16 -0700 X-CSE-ConnectionGUID: GUPuFUV3RSarpg9DYf8/8Q== X-CSE-MsgGUID: 29NOJPhZTmqKO461LOcg0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,184,1739865600"; d="scan'208";a="164159703" Received: from sgruszka-mobl.ger.corp.intel.com (HELO localhost) ([10.246.8.237]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2025 00:46:13 -0700 From: Stanislaw Gruszka To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Hans de Goede , Laurent Pinchart , Kieran Bingham , Sakari Ailus , Stefan Klug Subject: [PATCH v7 4/5] pipeline: simple: Create DelayedControls instance once only Date: Thu, 3 Apr 2025 09:45:50 +0200 Message-Id: <20250403074551.263496-5-stanislaw.gruszka@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250403074551.263496-1-stanislaw.gruszka@linux.intel.com> References: <20250403074551.263496-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. Reviewed-by: Stefan Klug # v6 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 c97904076b63..262192b849e2 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -542,6 +542,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_, " -> ", @@ -1388,15 +1395,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;