From patchwork Mon May 10 09:58:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12234 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 0D297BF829 for ; Mon, 10 May 2021 09:59:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8DA576891E; Mon, 10 May 2021 11:59:08 +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="mSWWRfId"; dkim-atps=neutral Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B022C6890C for ; Mon, 10 May 2021 11:59:06 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id p14-20020a05600c358eb029015c01f207d7so2798583wmq.5 for ; Mon, 10 May 2021 02:59:06 -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=KgKpcksnv6s1nkIaPgdoTr/RRRZK1ZRchgD3iCqTLKU=; b=mSWWRfIdSJryyUxVmYJoZP40YEPqCNi2ifzIDxwu9O5b809jnofovvIdWV0x9uW7mE 75YCI4aajYVaEw5mvSgx2+3j2yw3WDHs/Lbaw0/wKjCGBG5RClGAzcn8Bal8lULTrQmk XGYGUUmY+sBegtjjK9iRDYextjcyds2Wz383XOqyEZ3IoFm9/pCi2pV1ayQQL86NbZtO 92ONp3C71n1nMHQdXEvcOgjtZ4zlXwf+sbMhYKvQVGbJNXM+C0zr5oYC9vQkzt9joHJi 9/1hMvLDgk1tJ8n+vqo+RbXSKXMbarmfPyQBZMbIeQxDlcNqu70/UrcvNY/HgKV9AXa7 LhQg== 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=KgKpcksnv6s1nkIaPgdoTr/RRRZK1ZRchgD3iCqTLKU=; b=V94LzWdQgrJlbO0pBLJPH3mn/CgO3o4xfVJYFvPssUhDPVG8GWcl8O+Fz8o2GtI01H 7i30XkkR+qLZucYHQM5tRUd+vkrYbvmdns+sTDqdDfXzuK11plIUs/ZonBs8g1NcmS3c ScYhPgqh0osMAj2hJIQWBBb2AoeM7UOV9neg7NF81tNPZBew5VzUFUKZxPxbPuWV5Cl6 pah6A4/BhjqvuK4h7mi6fMye/TRJE3/L+VazNIsXMKw1Jy2ZVcwqgvTGz9Yq+H7b2GOk 72jfq4nhH1sNdmobahhXJvOJkuIWkTVNZIvzl6Jmd4LdmSsAxdFJoQ68FhyWYrnyXMy0 PG4w== X-Gm-Message-State: AOAM5309ud21hQIPzE5TIM49Wh7vfjUahgFBRJ3QMTny2ks/GApW8gJw /6en6KEZ5ROiM1BcPyxfvcUzjrppFRU87Q== X-Google-Smtp-Source: ABdhPJyJb0TWul5TdK/ukZ9ubh6EBEhDyQG9/W7GFR+p0iIPAKJYjGA1At967AI+b9rtP5ekX3ozCg== X-Received: by 2002:a7b:c0cf:: with SMTP id s15mr36205446wmh.110.1620640746185; Mon, 10 May 2021 02:59:06 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:e710:3ec:6dad:dc2]) by smtp.gmail.com with ESMTPSA id y17sm24767917wrw.90.2021.05.10.02.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 02:59:05 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 10 May 2021 10:58:10 +0100 Message-Id: <20210510095814.3732400-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510095814.3732400-1-naush@raspberrypi.com> References: <20210510095814.3732400-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 1/6] 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 Reviewed-by: Laurent Pinchart --- 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 bb55f9317788..07409621a03a 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; }