From patchwork Fri May 7 08:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12222 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 4A19ABF831 for ; Fri, 7 May 2021 08:40:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EAA6068919; Fri, 7 May 2021 10:40:50 +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="j9KncL+U"; dkim-atps=neutral Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E0A86890C for ; Fri, 7 May 2021 10:40:49 +0200 (CEST) Received: by mail-wr1-x436.google.com with SMTP id l14so8319856wrx.5 for ; Fri, 07 May 2021 01:40:49 -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=gWJqV6+KMq4Cdqjn8VB0rZGm/jSwDPd5ZcJ2lMonb8E=; b=j9KncL+UNOwGCZ6bLH9bwOlmpFhoDC8zPaGAvMT5rfFJeNomHPimHlrZ/sAyeM0A1y 0WS5aLGzpF/MPh11s5jaDCGk6S+L3sAZnDkYz/6armdnIpumnbqtOcWdSCNQtM9KlduX LnCaT+kCjnqejI2gl3mVJbeo1m4HERt2gi4uUEM23QEn3eut+FZrrphAxMY8A93PjmQA Ps0r2SmxFbUooxQAmAOjDggY2/jO6lSgdmazDSkkm0ztEIVAuVDU2OqMr+5qAxlfNfkH 3zOzmECiI2Uo4VH+326bCxFjcBvho3hhXW+zHDtMIkNmNenuy2zQUt0r86mQITNr7MWj YbEg== 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=gWJqV6+KMq4Cdqjn8VB0rZGm/jSwDPd5ZcJ2lMonb8E=; b=AUtRCtvB6NdG4+5CUAyTAQZbOfBpTUBLFDqTdscyMpvzqSMTHYxQycXN/K8hrCpIfl v59CeszA9dL+cS9AEaQos3HprUjpTYcXPpYgAJh4EXqMkzOkBJ2tDT/yMN87/XssNs56 FwsY4En3gQgmWl/lmdXclfGf+MO2cQ+ed19f0HHXPdF32lCWzsDYnFjP7Bb8YSrdc+ke R33akSAbFodVXnp4gqspH3CZdQwjnTscnXNvuE1hfugUn74NMXTcpDWV0DW0upy/MmFy soPF5F3YHH9TZI6wDBIM5lssoPg5/Rl321FSlWNG0UzC/EicIs3QO1IU/3b6PBiQisgR Bjaw== X-Gm-Message-State: AOAM531EGzBdPy3fmmWSQ27BXf3KA1Cr51pEIXM947D970Rte0Y84ZTy DdtEJIuYeAx2H5XbGK776aKPdDNR8cg1pg== X-Google-Smtp-Source: ABdhPJyH27Y+ynH6eG5fj+bK0oeCRPGgiC4qcW8GLxXu+O24x4yvqKJO14JHuBs7e5+M7kX6hX2fYQ== X-Received: by 2002:a5d:400f:: with SMTP id n15mr6838475wrp.274.1620376849173; Fri, 07 May 2021 01:40:49 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:81ab:95ee:9715:e9fb]) by smtp.gmail.com with ESMTPSA id l12sm7604098wrm.76.2021.05.07.01.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 01:40:48 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 7 May 2021 09:40:38 +0100 Message-Id: <20210507084042.31879-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210507084042.31879-1-naush@raspberrypi.com> References: <20210507084042.31879-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 1/5] 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 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; }