From patchwork Wed Aug 5 10:03:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 27614 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 5A409C330A for ; Wed, 5 Aug 2026 10:05:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CF12C680DB; Wed, 5 Aug 2026 12:05:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="WH7T2xDm"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 05D5C6805D for ; Wed, 5 Aug 2026 12:05:07 +0200 (CEST) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-47f706438c3so65754f8f.3 for ; Wed, 05 Aug 2026 03:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1785924306; x=1786529106; 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:content-type; bh=j6ulnDyYAT7qfuCOwZquqvKEPXSnAK8zUd75fPrc20M=; b=WH7T2xDmChFKp604Ou9mXqy+CMan3SmRipFyL83OwQzkQzDCV0bN4hlPYSlN5uV+3i OCAijaydEGdhslFnY6mes+JxuDIku6AzOaH6EMef1Q82KbrjZvXvEufoDeBpdHA2VtnX iiaptpJ9ysPyxt3d+hBSe2vVFGuOHexm8EA2v/h6zrA/OdVK8SKXAbWa/RZxpWYAEQ0a 1+OY9zJltiDf0/+kF7D0wcOYeCUqQ8+qtd7uplgKMZCUwxXV0ATOxv1QN7GLnbMb1sqs dKb+NOCKRhP+uRoF/eAcTsQcn51qRH1NKEXl2imhPjMh2YE4OxiK8fYdHgl0MG/NGlsQ 5W/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785924306; x=1786529106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=j6ulnDyYAT7qfuCOwZquqvKEPXSnAK8zUd75fPrc20M=; b=m6IBIZdXIhLPvzDoq4lP8avG3R7agLneNhy4SDL2VcqBtYpp+2DYnf0zi1d8dBgJys i0Tn1YVN7C2x16GwNRWX5IksLYjDUPslUL0tvKoV/NQmntxzMA4eMn4jMgDACMh5AtAP 7wUMnJl8PkbIlP7ItYwRh11fJ75ZBrIj06y3XT720lJOfFay1dAjgn/PeBdvWNvDV9DJ IhHpQ+SOn/o3GDfOaSssvIYzwG+hdPG0ZZ9nUmR5zF8kowyNvOfKHwauZIN1uEp6+Dm8 5fbLxhVwXA1MmKzh0E9iWmVq11MeOZDZWlqgZUrFIiyGFh1QPM5t/qs5A7Rw4eXf7Myc 0MeA== X-Gm-Message-State: AOJu0YzdJsZ1xcEAhgNISgCNVppTFk5QT6862xLPGcBh0VOM+bO9KE0Z BIvE9zKbWTYm363L7lgVs8bzZWAHR9B2kVu5M+F4ZmZo9OJ4Buu80aCRVdfWXX7BvUgh3UeeywU ypP0LBQo= X-Gm-Gg: AR+sD13aoPsyXOl50UTQ1H11C56KwqfT6eVB+otYGN0Fcx59HcYfTAC2hFEs+BXxSMd L0DT7gfHv+iVVxW0aPgvBvayxCecDs058/JbsQMc1MaHFitBCmucmQ8Xrk7owpUjqWxsc+2y8Yi pSZo2FTMvKSkaLo66E+chB7gGz4Rz2CdsW6urYNZDGnz7L8LItfznWqtG4y0jYCrC+oJfoZtikW DHqxN3AYiuzFy3RUIJ/6WcNzAlXcEvCsruqz95oFAOxWECrNZtv0/zxXPsM/8Hf97mYROyGxFLx 2pCFu1zpouPpLLW9TQQSPd/U4dJHNt0vFwMjoK1/IR2a5NHYN+9tl1WYqo7gF9FgVKzey454ETo dcQddur6vGWoxCzFW21fLNB3pmXR1fT4X8Fb6smBS9rucjjv07si781SQdf/WFIINu3OKHPBq8k UOi5mKlE+aF7rJfqHvQ97h5tsFPJxq3R06FB6rSgOmfbwz+LAdqPh50++1hDxBtDvH4KEOxU17G VT/lPRdJCB/nGpbgMAAQDm2OAxgyRjc+af8YUIzckSqLuEvnjpyVcpkttGCv/Jh7Xlo4qPsN0Wm P0zecssyem/Tk6jo563fmBkmmdel9pZcpu/NHXx86O7aWXuV7HqRqv+aPG1B/8qwHEHxhQZe151 uJNDMEhQVULgd4Z94t3y9NWSl X-Received: by 2002:a05:600c:1c22:b0:495:71ff:598d with SMTP id 5b1f17b1804b1-4994edf895dmr24833735e9.1.1785924306390; Wed, 05 Aug 2026 03:05:06 -0700 (PDT) Received: from naush-dell.pitowers.org ([2a00:1098:3142:1f:7130:ff97:e57d:5cf8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4994e04c2a1sm79185785e9.14.2026.08.05.03.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 03:05:06 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: david.plowman@raspberrypi.com, Naushir Patuck Subject: [PATCH v1 1/2] ipa: rpi: Rename mistrustFramesStartup() to mistrustMetadataStartup() Date: Wed, 5 Aug 2026 11:03:53 +0100 Message-ID: <20260805100502.1947139-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260805100502.1947139-1-naush@raspberrypi.com> References: <20260805100502.1947139-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" This matches what the CamHelper member function actually advertises. Rename this to avoid any confusion when reading the code. Also reword some of the comments for the same reason. No functional changes in this commit. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham --- src/ipa/rpi/cam_helper/cam_helper.cpp | 4 ++-- src/ipa/rpi/cam_helper/cam_helper.h | 4 ++-- src/ipa/rpi/cam_helper/cam_helper_ov5647.cpp | 4 ++-- src/ipa/rpi/common/ipa_base.cpp | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ipa/rpi/cam_helper/cam_helper.cpp b/src/ipa/rpi/cam_helper/cam_helper.cpp index dfdcd167839a..9afcf4bb52cf 100644 --- a/src/ipa/rpi/cam_helper/cam_helper.cpp +++ b/src/ipa/rpi/cam_helper/cam_helper.cpp @@ -192,9 +192,9 @@ unsigned int CamHelper::hideFramesModeSwitch() const return 0; } -unsigned int CamHelper::mistrustFramesStartup() const +unsigned int CamHelper::mistrustMetadataStartup() const { - /* Many sensors return a single bad frame on start-up. */ + /* Many sensors return bad metadata on the first frame after start-up. */ return 1; } diff --git a/src/ipa/rpi/cam_helper/cam_helper.h b/src/ipa/rpi/cam_helper/cam_helper.h index bd101895f23e..3bbc74310670 100644 --- a/src/ipa/rpi/cam_helper/cam_helper.h +++ b/src/ipa/rpi/cam_helper/cam_helper.h @@ -56,7 +56,7 @@ namespace RPiController { * HideFramesModeSwitch(): Tell the pipeline handler not to return this * many frames after a mode switch (other than start-up). Some sensors * may produce innvalid frames after a mode switch; others may not. - * MistrustFramesStartup(): At start-up a sensor may return frames for + * mistrustMetadataStartup(): At start-up a sensor may return frames for * which we should not run any control algorithms (for example, metadata * may be invalid). * MistrustFramesModeSwitch(): The number of frames, after a mode switch @@ -96,7 +96,7 @@ public: virtual double getModeSensitivity(const CameraMode &mode) const; virtual unsigned int hideFramesStartup() const; virtual unsigned int hideFramesModeSwitch() const; - virtual unsigned int mistrustFramesStartup() const; + virtual unsigned int mistrustMetadataStartup() const; virtual unsigned int mistrustFramesModeSwitch() const; virtual unsigned int getMinDebinFactor() const; diff --git a/src/ipa/rpi/cam_helper/cam_helper_ov5647.cpp b/src/ipa/rpi/cam_helper/cam_helper_ov5647.cpp index 40d6b6d76452..f7d0515c8113 100644 --- a/src/ipa/rpi/cam_helper/cam_helper_ov5647.cpp +++ b/src/ipa/rpi/cam_helper/cam_helper_ov5647.cpp @@ -19,7 +19,7 @@ public: double gain(uint32_t gainCode) const override; unsigned int hideFramesStartup() const override; unsigned int hideFramesModeSwitch() const override; - unsigned int mistrustFramesStartup() const override; + unsigned int mistrustMetadataStartup() const override; unsigned int mistrustFramesModeSwitch() const override; private: @@ -68,7 +68,7 @@ unsigned int CamHelperOv5647::hideFramesModeSwitch() const return 2; } -unsigned int CamHelperOv5647::mistrustFramesStartup() const +unsigned int CamHelperOv5647::mistrustMetadataStartup() const { /* * First couple of frames are under-exposed and are no good for control diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index dacafa578c98..74517503ebc2 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -351,12 +351,11 @@ void IpaBase::start(const ControlList &controls, StartResult *result) frameCount_ = 0; if (firstStart_) { invalidCount_ = helper_->hideFramesStartup(); - mistrustCount_ = helper_->mistrustFramesStartup(); - + mistrustCount_ = helper_->mistrustMetadataStartup(); /* * Query the AGC/AWB for how many frames they may take to * converge sufficiently. Where these numbers are non-zero - * we must allow for the frames with bad statistics + * we must allow for the frames with bad metadata * (mistrustCount_) that they won't see. But if zero (i.e. * no convergence necessary), no frames need to be dropped. */