From patchwork Fri Jun 6 10:55:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23480 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 3225EC3325 for ; Fri, 6 Jun 2025 10:57:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 29E7A68DC4; Fri, 6 Jun 2025 12:57:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="kqXQOqsn"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E1CD268DBF for ; Fri, 6 Jun 2025 12:57:00 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a4e57d018cso318295f8f.1 for ; Fri, 06 Jun 2025 03:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1749207420; x=1749812220; 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=+1kR8yrdGRXTW45504PuBDRwP7cmAEbOv3Y11k50OaI=; b=kqXQOqsnp5TkRG2o8FNLin+JQUc5DvIliGX/32y6MMMrTmhejdMv9u1tB+qonUmDD8 LJ8DK56QyDgaf+4EmwJ5SfdqyYvGlmVr1MNH9yyRg/+4kQy9J0uemK6igi5BMWzYoRBW /cyAEj2cABeywuSBCTAoPxjt+T5+KBXRnGNhFK/qnceZ2EPem2MDvwEsDyfCDgbEV031 Eir6wMmdtHSaLZYKMScDlPWSIdlNBdgpVHzqnxozJhJsuvlq8AfIF9oKXIPOWMt2ydBT DNouWh05Wc5RtN09cm2BSgOoHy+nsYczrheUI+HSaOXEjuoguKkF8M5dWxW4m3tiGBc4 ek1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749207420; x=1749812220; 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=+1kR8yrdGRXTW45504PuBDRwP7cmAEbOv3Y11k50OaI=; b=FiTFWUMTwFkECYZ2XW5efzNLM9CNvGGRpTfEs7mt2tU91lLBuwCP+EOifWiuyJ3BwK f1EK7yG/12MZlvT2urecBvjCH6HDUsmU0oB50kWlxknjVIWuEXZ96+pyqejEJec/RgVf 3nA5jBxrUk1jODWj+soy+77JYNyFNbbVXy47MGROxfj7EIhiyxrtQDhdN5X4u6h7+uJ+ huB3Nhb/cR3t6qm6RfWjwQLGooZN4nTBl+vBBb70PrwM2y3MojYnRFcDg7zbSQjLTLC2 OX1mu3aX/T8seTBgp6n1OW0gjqJcJUv0uhGFJqK2fZpezJNgvVyLmW2unMIx3XpDYplV sWVw== X-Gm-Message-State: AOJu0YzzRAz+Nld4iRqKOtnAms3ic4Y371KcNn9MsVTMP/Sj8wcmOK71 NNGjxQRGcH9iSBXNnPFPSFACkYqAMSE2OD7VZtTyNJbtDA5kNaRzZ3A2FdnXHKBYoQK8xzK+Q0W 6H1L2 X-Gm-Gg: ASbGncvA4OlAFFtFGPSB/3WbC16egD7mV4aU7VL5T9cjLXtViokaMgqP5n5ElrzUCQr 6d8B1px67+3bTbrtC3/1C6dSX3eCyVlm8F8xh+XAfSjZ1NUj1ebtbkDXgI5JWCMkTDPKz7Z8ued dj51f7BdxGNCaHVV0UebWAwa9Z8c6rBm5AbNmMEM5l+hKkVStaIA2YcAvCoxUxp0Adw0IvrRL1K IXhIcFIpBydDSYzeiy+erd3quW5vohqkMDXYiE5uJj8u00UNy6fVDzz5r01gqE1D/K6lDvTRpie BTZp0PUMk5n1S7fFeqRdIRXjyokq62osV27MK5IprkSCh8EKCL8naQN/w4rvvCDbzo1U/jegvVJ U X-Google-Smtp-Source: AGHT+IECrpuT7Vsm0ybGrsT1SDG6pyRE7VNVe4Qu3vQihNe6veKOCtK/vZlZQ2gC+CntrBAqB4LTog== X-Received: by 2002:a05:600c:6206:b0:43d:2318:ed7f with SMTP id 5b1f17b1804b1-4528a05cf37mr8223605e9.0.1749207420177; Fri, 06 Jun 2025 03:57:00 -0700 (PDT) Received: from NAUSH-P-DELL.tail9c427.ts.net ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452137277afsm20092455e9.30.2025.06.06.03.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jun 2025 03:56:59 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Jacopo Mondi Subject: [PATCH v3 6/6] ipa: rpi: Rename dropFrameCount_ to invalidCount_ Date: Fri, 6 Jun 2025 11:55:24 +0100 Message-ID: <20250606105651.1624640-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250606105651.1624640-1-naush@raspberrypi.com> References: <20250606105651.1624640-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 invalidCount_ to better reflect its use as frames are no longer dropped by the pipeline handler. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- 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 eee81e064e0d..50e25f05765d 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(); + invalidCount_ = helper_->hideFramesStartup(); mistrustCount_ = helper_->mistrustFramesStartup(); /* @@ -353,14 +353,14 @@ void IpaBase::start(const ControlList &controls, StartResult *result) awbConvergenceFrames += mistrustCount_; } } else { - dropFrameCount_ = helper_->hideFramesModeSwitch(); + invalidCount_ = helper_->hideFramesModeSwitch(); mistrustCount_ = helper_->mistrustFramesModeSwitch(); } result->startupFrameCount = std::max({ agcConvergenceFrames, awbConvergenceFrames }); - result->invalidFrameCount = dropFrameCount_; + result->invalidFrameCount = invalidCount_; - dropFrameCount_ = std::max({ dropFrameCount_, agcConvergenceFrames, awbConvergenceFrames }); + invalidCount_ = std::max({ invalidCount_, 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_ > invalidCount_ && 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..e818104ba633 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 invalidCount_; /* Frame timestamp for the last run of the controller. */ uint64_t lastRunTimestamp_;