From patchwork Mon May 19 09:20:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23391 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 1B9C1C322E for ; Mon, 19 May 2025 09:23:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D2DF168D85; Mon, 19 May 2025 11:23:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="PAXxyTPp"; dkim-atps=neutral Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1DBEB68C91 for ; Mon, 19 May 2025 11:22:55 +0200 (CEST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a35c339e95so446780f8f.3 for ; Mon, 19 May 2025 02:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747646574; x=1748251374; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iDJm16zb7hwM/O4mxusEMEmz8cHY3wVG5puaLJGJwFQ=; b=PAXxyTPpoZ6ATP/IzuAYo53fg//LUciYZ0eaiLfl+jYec6gARyp7qiADLcND5qHWif jS/5F5NEHCrC6ypWNBiyfX/AMhJvyxHSeDFoOqyq5Sbe9yM4x9D24LDVTVIi8t6ONhDW CZvMF36x9IXswXY9dUMInhhznZqH7aw95M94aMgCDv/4lHLa0+/0H7rcdq8cbg2qYrAN uvqiRvp74Xy60hWx4HvISjVhoWvmVVz2pTVfI3sxRqrBNWQHGtsCDyWhWD0XguGjjxSR s7S+lcRG+zxpoArUNA0CM2BTuoJy2iTiA7V2BoWB9x6Snmq1eRYOmF4opUQobKJMcz7h Q7iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747646574; x=1748251374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iDJm16zb7hwM/O4mxusEMEmz8cHY3wVG5puaLJGJwFQ=; b=oy329vJg6yDn9RvgNlCDip91EKYVqoly8vukFJA3vA1U3n0hREAZC+E83p9tmnzTKR decqrUBJIQKBY3JwRk1nUdwabmnzT5NVLMTVtfAehJ7bllfeTJUV32mFcvPJBSPh31wo 3/Qx8DtkpdSbs3pCLUvxKz0/L+KTFxvKsTMbUIW5zcEumUHMCikQzt+1CFOL03glEH0M ryBfbZ28mhOp+O2r/HTrFCqDZPwlZi7hEtAStaN11UvgAL6XuLxXpE5SFe6D8n/cFmET 5sPVlBpTf7utmhUduQyeCCn7L+KOBNSfM+Et42xQKKKAw6s+gWzcH0QSEuagUsB4mTGI NFWg== X-Gm-Message-State: AOJu0YzvPa/VAyZWIqdtp/sVU0e34OHinMfoPl+qKuDo8yqfAF8vKn6z dg5g9YcWhDk5PX65DN8NqerDA0+iXHpgBCiSPe0VmLSykwPl9CLmE2ypXKsA4ZVRbsCQG2TKeaI VXB9I X-Gm-Gg: ASbGncvPX20lgBzfdLR6ioDZfi5DZHyVObsphV3XA78OV8GJbE4TTmGugQ4s8PkUAZc VaBUpYIxWP1tfYhFdp4Njns7OFwP+lXsT4iGvCVxqTYBetbtBI6IF8f2JyIIsN2wbf1dFO11jl8 Fl5rNnETRuL7OTdq3JQBrTNY8LT9nAflTfgSeHptMWq+8NXvmBIZWrxLs9f3FsmZnJUWqr3PvW5 JJ4Y4AL6vdwbMR4896iRQbONPHBPu2ZEYrL1ancKDvHCFZA3IIhvgAxy4SXBiWXSaDG4XX5IGwF ZNqxbDNmiyKNN/YWHO8M+yRdooPb98CWASMbXEvP53WPM76jk+681rPOKqUE1WPOXGtQpRM= X-Google-Smtp-Source: AGHT+IGjOTq95UtX2EB5DWIuy2WVmx2OoCIrmpIMFx85c+3/6l4+ikKdajIARCnR5jo2crSuR0wTBA== X-Received: by 2002:a5d:5848:0:b0:3a0:99a4:e53f with SMTP id ffacd0b85a97d-3a35c843e2cmr3406507f8f.8.1747646574387; Mon, 19 May 2025 02:22:54 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a366e08747sm8645961f8f.95.2025.05.19.02.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 02:22:54 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 6/6] ipa: rpi: Rename dropFrameCount_ to startupCount_ Date: Mon, 19 May 2025 10:20:54 +0100 Message-ID: <20250519092245.269048-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250519092245.269048-1-naush@raspberrypi.com> References: <20250519092245.269048-1-naush@raspberrypi.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" Rename dropFrameCount_ to startupCount_ to better reflect its use as frames are no longer dropped by the pipeline handler. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/ipa/rpi/common/ipa_base.cpp | 10 +++++----- src/ipa/rpi/common/ipa_base.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index c15f8a7bf71e..8d591faeceaa 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -327,7 +327,7 @@ void IpaBase::start(const ControlList &controls, StartResult *result) unsigned int agcConvergenceFrames = 0, awbConvergenceFrames = 0; frameCount_ = 0; if (firstStart_) { - dropFrameCount_ = helper_->hideFramesStartup(); + startupCount_ = helper_->hideFramesStartup(); mistrustCount_ = helper_->mistrustFramesStartup(); /* @@ -353,14 +353,14 @@ void IpaBase::start(const ControlList &controls, StartResult *result) awbConvergenceFrames += mistrustCount_; } } else { - dropFrameCount_ = helper_->hideFramesModeSwitch(); + startupCount_ = helper_->hideFramesModeSwitch(); mistrustCount_ = helper_->mistrustFramesModeSwitch(); } result->startupFrameCount = std::max({ agcConvergenceFrames, awbConvergenceFrames }); - result->invalidFrameCount = dropFrameCount_; + result->invalidFrameCount = startupCount_; - dropFrameCount_ = std::max({ dropFrameCount_, agcConvergenceFrames, awbConvergenceFrames }); + startupCount_ = std::max({ startupCount_, agcConvergenceFrames, awbConvergenceFrames }); LOG(IPARPI, Debug) << "Startup frames: " << result->startupFrameCount << " Invalid frames: " << result->invalidFrameCount; @@ -443,7 +443,7 @@ void IpaBase::prepareIsp(const PrepareParams ¶ms) /* Allow a 10% margin on the comparison below. */ Duration delta = (frameTimestamp - lastRunTimestamp_) * 1.0ns; - if (lastRunTimestamp_ && frameCount_ > dropFrameCount_ && + if (lastRunTimestamp_ && frameCount_ > startupCount_ && delta < controllerMinFrameDuration * 0.9 && !hdrChange) { /* * Ensure we merge the previous frame's metadata with the current diff --git a/src/ipa/rpi/common/ipa_base.h b/src/ipa/rpi/common/ipa_base.h index 1a811beb31f2..a51afc156a8f 100644 --- a/src/ipa/rpi/common/ipa_base.h +++ b/src/ipa/rpi/common/ipa_base.h @@ -115,8 +115,8 @@ private: /* How many frames we should avoid running control algos on. */ unsigned int mistrustCount_; - /* Number of frames that need to be dropped on startup. */ - unsigned int dropFrameCount_; + /* Number of frames that need to be marked as dropped on startup. */ + unsigned int startupCount_; /* Frame timestamp for the last run of the controller. */ uint64_t lastRunTimestamp_;