From patchwork Fri Feb 12 11:33:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11257 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 E3400BD160 for ; Fri, 12 Feb 2021 11:37:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A568F63778; Fri, 12 Feb 2021 12:37:38 +0100 (CET) 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="PyDK2PjH"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7493663773 for ; Fri, 12 Feb 2021 12:37:35 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id o15so604784wmq.5 for ; Fri, 12 Feb 2021 03:37:35 -0800 (PST) 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=5vjj4cYR7d7qVH47wyq/bjJgcWDE/QbUdq7aNrrkbX8=; b=PyDK2PjHBFcyuFWMjuMBkiw5hiuCNMDxoGMCB5/f4mZT6ePPqqyD2oMHYB8lmzws5T AeFrm+2F/m+cBp72J22mQgvwQIJNOz0g/7Uzb1o1onS/uRtlrUaZmSz7hJpLDzH7b1mQ A4v42vtSCVETqG4pQoon5AtSHf9HW93jZj9wA7SuakLyKzE1NSrKpt03HBg1oHon8vhw pwxn5P80I8KXi7XmUoVcJvu24MhkKcKwhoLjyE6gQ/GKegPObwLsDWuYoK3cXClI7FMJ EzcWc2gpC9M6GxQgxEJ4bTuMPsfg3K9ZfnAsLMJ0l0d7ttJ8A4zu/zAPiCKsuBA3tPpj /ESA== 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=5vjj4cYR7d7qVH47wyq/bjJgcWDE/QbUdq7aNrrkbX8=; b=Ox+/qmhw5AxRFU/2xJ906CUY0zilqrW5oN7iaJUONR8DimdHjA+/pG3Yco3hHQE3KX 6k+Z+PTFtJwZPEPhnIk5qIiGY9ErVtojp6h/VpbgpVybTxgVGh1+Ldzz3P4iKIsM+8VD tl0mBj4t2dAnFOwDP7DBwPhhT3jrSDblai1JMdW7ChcRrlF80p9wzj5QiGGBqvxPR2HH uk3HTBI5ptpwnQPov1k4J2mQHJwj4zD2jy3jqqdT2u7hMSDSj1UgO/at5TWvKQfIzZ+E Twh1jlbx/X2xwG2J5QPhZ50F6VLr2mIKLmIdE2OYv4e9s/n7nje2PpKCM+dw4KpQ4hEP h47A== X-Gm-Message-State: AOAM532hI39m3KsfIhHnwoG32WnKwwDBzqAp1cU6Z3yOuq/OqZAQmBdG LCPgaKo+MWf456YcgchnNg2bjkqmll5aDPbU X-Google-Smtp-Source: ABdhPJzGL91ePRhsQRQ1+yUVeIoAw317B2SQ3tVdwiC94nx5xAsPGvP9hRchjMm6rRjYKCGNyN8ewQ== X-Received: by 2002:a05:600c:4242:: with SMTP id r2mr2247020wmm.109.1613129854894; Fri, 12 Feb 2021 03:37:34 -0800 (PST) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id v5sm10005020wro.71.2021.02.12.03.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 03:37:34 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Feb 2021 11:33:11 +0000 Message-Id: <20210212113312.239076-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210212113312.239076-1-naush@raspberrypi.com> References: <20210212113312.239076-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/5] libcamera: delayed_controls: Remove spurious no-op queued controls 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" In DelayedControls::applyControls(), the controls queue would be extended via a no-op control push to fill the intermittent slots with unchanged control values. This is needed so that we read back unchanged control values correctly on every frame. However, there was one additional no-op performed on every frame that is not required, meaning that any controls queued by the pipeline handler would have their write delayed by one further frame. The original StaggeredCtrl did not do this, as it only had one index to manage, whereas DelayedControls uses two. Remove this last no-op push so that the pipeline_handler provided controls would be written on the very next frame if possible. Signed-off-by: Naushir Patuck Reported-by: David Plowman Fixes: 3d4b7b005911 ("libcamera: delayed_controls: Add helper for controls that apply with a delay") --- src/libcamera/delayed_controls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp index fe2606a0d9aa..f140b4b562e7 100644 --- a/src/libcamera/delayed_controls.cpp +++ b/src/libcamera/delayed_controls.cpp @@ -257,7 +257,7 @@ void DelayedControls::applyControls(uint32_t sequence) writeCount_++; - while (writeCount_ >= queueCount_) { + while (writeCount_ > queueCount_) { LOG(DelayedControls, Debug) << "Queue is empty, auto queue no-op."; push({});