From patchwork Thu May 22 07:48:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23421 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 C7097C331D for ; Thu, 22 May 2025 07:53:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 50FAC68D9C; Thu, 22 May 2025 09:53:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="q7KqahLx"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F37D668D9A for ; Thu, 22 May 2025 09:52:51 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a365bc0af8so559999f8f.3 for ; Thu, 22 May 2025 00:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747900371; x=1748505171; 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=LZqiQlR9owO1wtt/qZunnLktQ2lr/L7FkNTRGEyHuSo=; b=q7KqahLxI3A8LNi8VO7RTPpIPHyKNnJMpigQjsRIo/WyZ95s63wn+UA0AJxGkJW4Nw 07/d6PKBapnxGef34RHyghOUNEw4eTti80LPhpwwmXYakLgcM4IeRCpooc4ifXqdhpbM 7utKGtx3K4JjfBou+1R/IUGiCNiWTfgHviYSZwyQdavW4duhR7uHo1C4rjBuu9oFuZlj A9JauiZjySax2VmohJGOAznk9z6IQktp9AJCtlrceOlPAK/vja5CITx51lEkov20jkjP qLQE8GgDD4B+7ZhbTex9Si43Mj1TbT64WLnsrHKCtf2QFr6kvTAN7ExX5maqg+peytjQ b+4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900371; x=1748505171; 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=LZqiQlR9owO1wtt/qZunnLktQ2lr/L7FkNTRGEyHuSo=; b=D/2DvNefCAUlxRLQH9QllcrXQ9ATN9rnhp/QDYwN3tT6SW0t83WsUCI+N87ZPBx0/2 SN0+TV40VRCjntv/wF6yoDLwXzqqRfaVHkKnr9yEXQkdgLDb8G4goLNuSpyjemRaCNIb em5cOSZdwS3Ffe6malzNxkWApCM2e6i7dNGGYScwP0HDYA67FODufFPNukWBx661D23N Azb4ZH8SbcsJX0O36zXq8W8OMpeutkcg2BUdLvD4IvkZFmprKy5400BxiVlPNvGnRIHS WCvzK8qkGkoeqCsEy0RFnfJKiVj+ik+Ix2mKed42XsU5sAoQC4fSMkrAWpgf5gKaLEJS 1DuA== X-Gm-Message-State: AOJu0YxUTrfgNslSlbMX50Uu2Ppqgk5KGSWuuk6tujgriib2M60NR32w 4EfwdNX4N3m97kGKbxfSjIF99qYzfHeH9z6Hd7JFd4hmvcDTCwOetZ5nU7+sYcL1tkStoAHivDH YKV0B X-Gm-Gg: ASbGnct+JhTUQr23rjZbC5IGK+IwYM8y+wJtdzkv4jJXhf/X3BKrPZslGJiaUgKQUqH 1WhN7+WCViIyKtPtdlwsv0dZG9WNufV6vaEWHgJzoUTSg+n1u8EvHuHpHP00n7M8GmbEct+zvha xg3Px/QDLxLUumBI6tMkwYSkk29Mhmd1SdabZMWNWJPwIZyizM7xB+Oz2dFRkagioKuATWXx8Md 9ClTmt/ZsPcxuVz6A6oOb2e+TvCOgU/dItp+asN1CYyXnq/Z+Za6kecsxV4DkdAT2CLzYTeQsjG 62TQTQsuxFZ/JuYD3iij+im3X8Xly7v56bLExnpIfd6aZ8F7z5lphwvfP5GZS+3VqQ2s8lE= X-Google-Smtp-Source: AGHT+IF8EHRy4DXetsyS78VNd/9WTw78b9zq3+ReMWJtFSYv66fPAamWEBrISf45bENRs4+jkw+STg== X-Received: by 2002:a05:6000:2284:b0:3a3:6e0e:a09d with SMTP id ffacd0b85a97d-3a36e0ea15dmr5782700f8f.6.1747900370791; Thu, 22 May 2025 00:52:50 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3ca066eb7sm4191516f8f.2.2025.05.22.00.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:52:50 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH v2 6/6] ipa: rpi: Rename dropFrameCount_ to startupCount_ Date: Thu, 22 May 2025 08:48:22 +0100 Message-ID: <20250522075244.1198110-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250522075244.1198110-1-naush@raspberrypi.com> References: <20250522075244.1198110-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_;