{"id":22869,"url":"https://patchwork.libcamera.org/api/patches/22869/?format=json","web_url":"https://patchwork.libcamera.org/patch/22869/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250225164116.414301-6-stanislaw.gruszka@linux.intel.com>","date":"2025-02-25T16:41:16","name":"[v5,5/5] pipeline: simple: Create DelayedControls instance once only","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"81213dc8c1e900ec36adaddfda23efdba6a181d6","submitter":{"id":211,"url":"https://patchwork.libcamera.org/api/people/211/?format=json","name":"Stanislaw Gruszka","email":"stanislaw.gruszka@linux.intel.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22869/mbox/","series":[{"id":5021,"url":"https://patchwork.libcamera.org/api/series/5021/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5021","date":"2025-02-25T16:41:11","name":"libcamera: start frame events changes","version":5,"mbox":"https://patchwork.libcamera.org/series/5021/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22869/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22869/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EBAE0BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Feb 2025 16:41:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A1EFA68733;\n\tTue, 25 Feb 2025 17:41:57 +0100 (CET)","from mgamail.intel.com (mgamail.intel.com [192.198.163.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 01D5D6872D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Feb 2025 17:41:55 +0100 (CET)","from orviesa005.jf.intel.com ([10.64.159.145])\n\tby fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n\t25 Feb 2025 08:41:54 -0800","from sgruszka-mobl.ger.corp.intel.com (HELO localhost)\n\t([10.245.115.185]) by orviesa005-auth.jf.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:41:51 -0800"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"Phd9DzaU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n\tt=1740501716; x=1772037716;\n\th=from:to:cc:subject:date:message-id:in-reply-to:\n\treferences:mime-version:content-transfer-encoding;\n\tbh=5TUsit5KkBSqkcFHmQvWJf8nR/TKdJIJxtM4z//UWEI=;\n\tb=Phd9DzaU7UhxK3lMFekkE5gTX3cjkw+45ca+Bd3s1Hi6FXZb0nRqYVXe\n\tCrwkN/8cydEtzXEhGuhRo0mpJgc//ZRhygzCYyhVQPTOz/tVlqNGG7WeL\n\tXrEB/SU8ubiTM5eKULyqX6Q9dp1bZmED6OLl9kMtpmT77vWQJ2hllBeT5\n\tgVugpVxSURsZIaJP62GzrzOL9tWDTOlh23McBR7HrnZoI7PwTHYqQRz5r\n\tM1tmOwt4dN8KI/UiUzBynzAURPYAWM/eOLr6H2fKo/aC8qHhWnatbvyJs\n\tl5s8+unJT9Em14s1+DadIGdf+mVCHlN72l4ZMIxAL0ON7imUyw6upJCWZ A==;","X-CSE-ConnectionGUID":["rQovXHqiQDuTZzPtDby4Qw==","wdjBb0SNSpiofxhDolBgVg=="],"X-CSE-MsgGUID":["9K1jAHTqROygJrRvzLMpdw==","WbwzeAJzQj6R/X+S42lwdw=="],"X-IronPort-AV":["E=McAfee;i=\"6700,10204,11314\"; a=\"52740869\"","E=Sophos;i=\"6.12,310,1728975600\"; d=\"scan'208\";a=\"52740869\"","E=Sophos;i=\"6.12,224,1728975600\"; d=\"scan'208\";a=\"121689887\""],"X-ExtLoop1":"1","From":"Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tNaushir Patuck <naush@raspberrypi.com>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tHans de Goede <hdegoede@redhat.com>","Subject":"[PATCH v5 5/5] pipeline: simple: Create DelayedControls instance\n\tonce 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","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThe DelayedControls instance for the camera sensor is created in\nSimplePipelineHandler::configure(). Constant deletion and reconstruction\nof a new object is unnecessary, as the control delays are an intrinsic\nproperty of the sensor and are known at initialization time. Move the\nDelayedControls creation to the SimpleCameraData class constructor.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 16 +++++++---------\n 1 file changed, 7 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b92b738b..73a4138e 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -489,6 +489,13 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \tif (!sensor_)\n \t\treturn;\n \n+\tconst CameraSensorProperties::SensorDelays &delays = sensor_->sensorDelays();\n+\tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n+\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n+\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n+\t};\n+\tdelayedCtrls_ = std::make_unique<DelayedControls>(sensor_->device(), params);\n+\n \tLOG(SimplePipeline, Debug)\n \t\t<< \"Found pipeline: \"\n \t\t<< utils::join(entities_, \" -> \",\n@@ -1294,15 +1301,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tif (outputCfgs.empty())\n \t\treturn 0;\n \n-\tconst CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n-\tstd::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n-\t\t{ V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n-\t\t{ V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n-\t};\n-\tdata->delayedCtrls_ =\n-\t\tstd::make_unique<DelayedControls>(data->sensor_->device(),\n-\t\t\t\t\t\t  params);\n-\n \tStreamConfiguration inputCfg;\n \tinputCfg.pixelFormat = pipeConfig->captureFormat;\n \tinputCfg.size = pipeConfig->captureSize;\n","prefixes":["v5","5/5"]}