From patchwork Wed Mar 25 15:13:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 26361 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 BF0BFC3303 for ; Wed, 25 Mar 2026 15:15:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 255E962C4E; Wed, 25 Mar 2026 16:15:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FA2YZy+7"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D2AA62BF0 for ; Wed, 25 Mar 2026 16:15:34 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:b16a:5ed9:4ada:a95a]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 8A8571B98; Wed, 25 Mar 2026 16:14:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774451656; bh=328G/l2Pz1R8U8ujQ2WBNyhtWw2/yBzz2aZhPPiXddU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FA2YZy+79XnoE4YkiK/ZW4Jyq1Uaf1TlItSJF8j0TBGFp+6QTqYdkl6fbiAp/M99t iuXXbIt/Q1jjsMkLavDnndbNh8T8FYnaPyDoBzRE2WNaxKdkIIJPG+xgWLxf/fWyfy r/T1XsYHq9do+Q4bzsEFPwY6smOpMrWJqXrDRsCU= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Paul Elder Subject: [PATCH v2 19/32] libcamera: delayed_controls: Ignore double pushes for the same frame number Date: Wed, 25 Mar 2026 16:13:51 +0100 Message-ID: <20260325151416.2114564-20-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260325151416.2114564-1-stefan.klug@ideasonboard.com> References: <20260325151416.2114564-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" For successful PFC a single sequence must only be pushed once to delayed controls. Such a situation can occur if no-ops were pushed in delayed controls due to a buffer underrun. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder --- Changes in v2: - Collated double log message - Collected tag --- src/libcamera/delayed_controls.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp index 4efe3b39c3f6..bcbce4413456 100644 --- a/src/libcamera/delayed_controls.cpp +++ b/src/libcamera/delayed_controls.cpp @@ -173,8 +173,9 @@ bool DelayedControls::push(uint32_t sequence, const ControlList &controls) { if (sequence < queueCount_) { LOG(DelayedControls, Warning) - << "Double push for sequence " << sequence - << " current queue index: " << queueCount_; + << "Ignored double push for sequence " << sequence + << ". Current queue index: " << queueCount_; + return true; } while (sequence > queueCount_) { @@ -277,7 +278,10 @@ ControlList DelayedControls::get(uint32_t sequence) */ void DelayedControls::applyControls(uint32_t sequence) { - LOG(DelayedControls, Debug) << "frame " << sequence << " started"; + LOG(DelayedControls, Debug) + << "Apply controls for: " << sequence + << " (instant controls for frame " + << (sequence - maxDelay_) << ")"; while (queueCount_ - 1 < sequence) { LOG(DelayedControls, Warning)