From patchwork Sun Apr 18 09:04:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11974 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 207DCBD812 for ; Sun, 18 Apr 2021 09:05:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3C8A68818; Sun, 18 Apr 2021 11:05:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="TgitGanK"; dkim-atps=neutral Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 86E46687F3 for ; Sun, 18 Apr 2021 11:05:05 +0200 (CEST) Received: by mail-ed1-x529.google.com with SMTP id w18so37209552edc.0 for ; Sun, 18 Apr 2021 02:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jo8WkXMl8c5cRR6Ta7ynE+2nvwPxIi03CyEKeDa4jWM=; b=TgitGanKKA/DKYLvYo1DhDfma713OjA1IrGJx23PZAZc4aKlUDpAg8vW71im0err/b MCPhGvZieYw3Hq/WdUFVwhKRD2ReszHqVz5lly+Vi3b5Ir+/NGFfcjE0/S50eCbja5LF 8crTKJ6imC6bBcn7X5sREDqlUAq86nQcXXPUZDql0fEKiLh+1+1FKGox+6K2N7jSUZP8 gPS/c1F7niK/7zLP0I9552NqnFJnhFjMDxS3nIQktxRRJg+Er8Zj2fb2hlcSQyOlOZUG IpBBd+0h+r0Q6QNgxEHlZLrFgiecP+GQ1nkRh1rBNXvrf4faq5zyB+2GGcJwgLGg+CDn RGxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jo8WkXMl8c5cRR6Ta7ynE+2nvwPxIi03CyEKeDa4jWM=; b=moHOv5ulZoRR9CTZAiOqPZMvxaMukfDLTX3+abM+MWfUR/llx6ekrcImQTqa88MikB vWqxOHV2x+/2Dq3pjVdLmj0Ks1qCHs3uFc5qsDS4GOtW4+CBjhz9QlSZeKkIlbtzlV/n 5ARbuoT/uInnR+wcVV/i0MEtfJcVgj5y/yMOf19g6j8TLSiox5arjsPYLQ5SpHBXK3uq BFLg2lhyyQ0T1mFhqm7iJ1oCn8UujPmFQGbyrmrLt47hMtGX5T+itrTZzH0d4mAcV29J C429UiE3Uqn/5XRFuenBI4sExBNQ9aY9MPYtSyyJUuJ73F+36Corc68L1Yml+mEHAqpu w+qQ== X-Gm-Message-State: AOAM532LJhtXvMUwRBX6reJJ/6BKo34MY2Yf4iyQbqHrXCLxk6CiRWr5 C5vHThh8aOQY5j/qyvBbgz6cvyJx8uhrVQ== X-Google-Smtp-Source: ABdhPJwbc8Qfe7fr6Q+cV41dVmTuTvBeWAJYPfVp1+dOC8KaltGAWWY3TGL1aPMAafOFK9pQRvKEcw== X-Received: by 2002:a05:6402:26ca:: with SMTP id x10mr4833468edd.386.1618736704714; Sun, 18 Apr 2021 02:05:04 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id z4sm9080679edb.97.2021.04.18.02.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 02:05:04 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Sun, 18 Apr 2021 10:04:56 +0100 Message-Id: <20210418090459.38506-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210418090459.38506-1-naush@raspberrypi.com> References: <20210418090459.38506-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/4] ipa: raspberrypi: Store dropped frame count in a member variable 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" Store the number of dropped frames on startup in a member variable. This will be used in a subsequent change for rate limiting the controller algorithms. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/ipa/raspberrypi/raspberrypi.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index b0f61d351e3a..f6d1ab16a290 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -143,6 +143,9 @@ 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_; + /* LS table allocation passed in from the pipeline handler. */ FileDescriptor lsTableHandle_; void *lsTable_; @@ -220,9 +223,8 @@ void IPARPi::start(const ControlList &controls, ipa::RPi::StartConfig *startConf */ frameCount_ = 0; checkCount_ = 0; - unsigned int dropFrame = 0; if (firstStart_) { - dropFrame = helper_->HideFramesStartup(); + dropFrameCount_ = helper_->HideFramesStartup(); mistrustCount_ = helper_->MistrustFramesStartup(); /* @@ -250,14 +252,14 @@ void IPARPi::start(const ControlList &controls, ipa::RPi::StartConfig *startConf awbConvergenceFrames += mistrustCount_; } - dropFrame = std::max({ dropFrame, agcConvergenceFrames, awbConvergenceFrames }); - LOG(IPARPI, Debug) << "Drop " << dropFrame << " frames on startup"; + dropFrameCount_ = std::max({ dropFrameCount_, agcConvergenceFrames, awbConvergenceFrames }); + LOG(IPARPI, Debug) << "Drop " << dropFrameCount_ << " frames on startup"; } else { - dropFrame = helper_->HideFramesModeSwitch(); + dropFrameCount_ = helper_->HideFramesModeSwitch(); mistrustCount_ = helper_->MistrustFramesModeSwitch(); } - startConfig->dropFrameCount = dropFrame; + startConfig->dropFrameCount = dropFrameCount_; firstStart_ = false; }