From patchwork Mon Sep 18 09:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19054 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 9BB9EC326B for ; Mon, 18 Sep 2023 09:10:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 249DE6293E; Mon, 18 Sep 2023 11:10:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1695028250; bh=FeDuZuQO5AVk3Vx79FH2cHCj/OownCH9m0ULNxJXX7Q=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ov5ByVzuKr9zz7VVIqBg5fIJJvpygqBnyLcOw8XeroFzc075WZqyx66ufA4bVM2TG sejRu8Ms1lOTNsZb8uDX/3XAID+y2478EcvkafYg2IySTx2D+wtImQUpWkQxC1J5pO JSyIfREyaXPOMuCJEfKAHgpw8D/1/9IIqCYnT/5+zzdZHUXSdZZU7OVZGgtp4SZf2v 2yR5dTgUsQ8YlKbKdyi16H1K4sQLGenYwbH5CTw/0TzZu+f9wvtLXqiefe197XMIsI mcgXXMgPkCuk0LA6eIeKQYraTL0lkzRrr845WtyDJH9BhYrF4CHhEcXVUWyBP6PntL WcFstun2RJ6gw== Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 34BB261DEC for ; Mon, 18 Sep 2023 11:10:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Uvs4GP0D"; dkim-atps=neutral Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-401187f8071so27751625e9.0 for ; Mon, 18 Sep 2023 02:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1695028248; x=1695633048; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5bSQcq0jEBWvwXLfqDd4WA4ENFOQ3ZkA/8GdnctpxnI=; b=Uvs4GP0DdTuMhRG+gLgXVppgh5HR7A/F2mPgzdMGVMRDa79YSJxeeGUXuGPXpkmlYK pvwrc/ey7Sre+qT7JrlX4agDnpvkKEEBCo3kfDM+krnMSrb3gVFWm+ZFZu2KMM6Zc1kp 6UL6bHiUZ22kN/b0vsel/QC5zTZa3XIE9ErK90rkUB+blMO1UowsE0SNbdoGXD1YZEIs /HSb0cwPJh88kalozcf16Y2LOS2iSQ0kiYMgZyPQh3dHLOdlELZzd79xFg1bJPYj5wQ0 mptOxN9vu45NyuJoXjN0bKArvC0ay+4FP76fOLee7BrartftRT62CTC6nPXq9Qpqn67L 2LZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695028248; x=1695633048; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5bSQcq0jEBWvwXLfqDd4WA4ENFOQ3ZkA/8GdnctpxnI=; b=dVkn2ROz4rjc3MQ/SWnO0hJn96T+XYkhDLZuGEm84BK63fCDUlNcaQ9+y+RELwQK+G iONpqtNKcgrqdzh44hF7hxmFn7PbO/OYt+iukVptrpEOUOyIOFecyk7+mQuuYv85TwmH NuSN7igeEqhX1rHKhAQF9bqai0V+ifTAg7J/sveVdWD74T7NEfuSVq1VMOMMuzomIMrL P0aBGZItbpP3GAxYqnCKIC7N4oqC4yt0ceuSvLBdMkzcPBHr/bVqfQqTt4B5o9i9sDWQ L/eptRFKPC0EVRGiLPBC8t69tsQ+yV27fzL4LRtDmeUBH77Zd0+hDOnCNavgmGANe2YX HtGg== X-Gm-Message-State: AOJu0YwaIJh+1VtRCC0gfu0Aae80JVarQU59u6ZoNWIFeTfC45+aYxRD 2jR/3A+WM317AgLcULZgSYR0jyg2598NUsx235MLkA== X-Google-Smtp-Source: AGHT+IEs2agJuSVS2r0li+WOPgdEugCpLo64+S4oioj2gF1liG5YYYpiqYYAfPbhQAYSjwzHrVvKkw== X-Received: by 2002:a05:600c:20d3:b0:3fe:1b5e:82 with SMTP id y19-20020a05600c20d300b003fe1b5e0082mr5911499wmm.20.1695028248431; Mon, 18 Sep 2023 02:10:48 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id c22-20020a7bc856000000b00402f7e473b7sm11717267wml.15.2023.09.18.02.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 02:10:48 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 18 Sep 2023 10:10:45 +0100 Message-Id: <20230918091045.16992-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: Reset the frame lengths queue during configure 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The IPA stores a list of the last 10 frame lengths applied to the sensor for determining the timeout to use. This list gets reset on start(), but there is a path through the code that accesses this list in configure() which happens earlier, causing a logical error. Fix this by constructing the list with 10 initial values of 0s. Bug: https://github.com/raspberrypi/libcamera/issues/64 Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- src/ipa/rpi/common/ipa_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index f7e7ad5ee499..f0ce6c75dc03 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -100,8 +100,8 @@ LOG_DEFINE_CATEGORY(IPARPI) namespace ipa::RPi { IpaBase::IpaBase() - : controller_(), frameCount_(0), mistrustCount_(0), lastRunTimestamp_(0), - firstStart_(true), flickerState_({ 0, 0s }) + : controller_(), frameLengths_(FrameLengthsQueueSize, 0s), frameCount_(0), + mistrustCount_(0), lastRunTimestamp_(0), firstStart_(true), flickerState_({ 0, 0s }) { }