From patchwork Fri Apr 16 10:31:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11963 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 514D4BD235 for ; Fri, 16 Apr 2021 10:31:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9EB1B68814; Fri, 16 Apr 2021 12:31:56 +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="jk6f4MED"; dkim-atps=neutral Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A71006880A for ; Fri, 16 Apr 2021 12:31:54 +0200 (CEST) Received: by mail-wr1-x433.google.com with SMTP id h4so17145532wrt.12 for ; Fri, 16 Apr 2021 03:31:54 -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=acVExA1hKkXl0vFbLi5BIT7JBVgIAwd+XnaOAuP9Co0=; b=jk6f4MEDkidCbbhiP/hycOHXY/z6jZgXqiGPDIiOD9cPC7l3D+KK2aCuYh8GmJrt2f nni6EKKZbeUAsynHPZ9MOC96AkajSaVbTqSLSOS4OWs6eQmDeGZL4uT25d/+IiUt15NH qiv4VfnLz8mi5brrC6G61qXyYZQwueq9pln1IegIg4ZzeKfMNI/wf0gw+oeWqbHQDLXg 60dLaDDHfCDxHo+0WRVw16Zp3xVhwpDQZd8myrAC+lihBEUfevwdpMITPMNkyGMEpGd7 qb5CsNswv8LYevmo5eh67d+yCiyGurXsGv3ou74AMyMQXc0XsQ6KCvbn0ccQyXSozZy9 Xobg== 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=acVExA1hKkXl0vFbLi5BIT7JBVgIAwd+XnaOAuP9Co0=; b=igaMq+IlKaQZXbDlbPBF0VyDczwKftqEPzzKL8puDTtJBA+0XwobTgyAwpEPED8Cm6 q4XYJqcoVKZaAlRq1ldCRO4uzwTb2vrh4vn25g9piD6j2tCm2bhqThmGo6JkMMWVlAF/ 8n7at+Tq08IteTaSkuCfMj6V0L/9pX1SHMU5mKBVd6rFzgg6u8MLNJauG/86Or+I7TLg z3b3Lmv0T0iHDgimomZ/NF/fcevX0LkdFPAnpQCSfJAvw8tJSE8XrUebwu3d8TUEwN1b 5wIZkSKT1apx7Awb1ey54jnEyjx2oiqbP+S67HGhgz4HOHAblgfieMR5bSZ+5npH3vcS dYXg== X-Gm-Message-State: AOAM5338wP7I8xBYlFvRu29ejcZgTFgtPTOIRReYuLG7OAXPV83NGU3W B1KQh5Mi79hcmtfGVEGwYwaEW2sHoaYcvg== X-Google-Smtp-Source: ABdhPJz3Tn8gGqCEnMjJHd72J1qATg5iD0WUrV0ELTMqey1ZScIVxwnMEwRaQgYCXiEfAWfbQWSy+g== X-Received: by 2002:a5d:678e:: with SMTP id v14mr8427156wru.156.1618569114251; Fri, 16 Apr 2021 03:31:54 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:15:4af5:8d45:b5d1:889d]) by smtp.gmail.com with ESMTPSA id d133sm8234500wmf.9.2021.04.16.03.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 03:31:53 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Apr 2021 11:31:39 +0100 Message-Id: <20210416103141.1483745-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416103141.1483745-1-naush@raspberrypi.com> References: <20210416103141.1483745-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/3] 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; }