From patchwork Fri Oct 24 08:50:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24786 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 1D179C3259 for ; Fri, 24 Oct 2025 08:52:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D02C7608DF; Fri, 24 Oct 2025 10:52:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gDnT7cTc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 51B60608C7 for ; Fri, 24 Oct 2025 10:52:37 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:7edc:62f4:c118:1549]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id D68E71AC5; Fri, 24 Oct 2025 10:50:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761295851; bh=GHDBZhxUClPjiTGikBMuLaR34/ZPU/bFsMTzDclcYuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gDnT7cTcwjVT64MFc6NleIwaCgDKYko1VWZpAZfbjqVPR10XpXgLcNQS0uH+ZG6D/ qLx+EEdFn0JGhMBWcskypR/Ok1kbivogx5v1Nn2B1a9yzGgccxihVLKOG0JalF4rkV Osi0M4nBdI6PlbHHHbtl050FRMh+kShP5zUR4eUI= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 20/35] libcamera: delayed_controls: Ignore double pushes for the same frame number Date: Fri, 24 Oct 2025 10:50:44 +0200 Message-ID: <20251024085130.995967-21-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251024085130.995967-1-stefan.klug@ideasonboard.com> References: <20251024085130.995967-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 --- src/libcamera/delayed_controls.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp index 8239f3dcf347..3dead0dc4429 100644 --- a/src/libcamera/delayed_controls.cpp +++ b/src/libcamera/delayed_controls.cpp @@ -176,6 +176,8 @@ bool DelayedControls::push(uint32_t sequence, const ControlList &controls) LOG(DelayedControls, Warning) << "Double push for sequence " << sequence << " current queue index: " << queueCount_; + LOG(DelayedControls, Warning) << "ignore silently"; + return true; } while (sequence > queueCount_) { @@ -278,7 +280,11 @@ 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 + << " expected: " << writeCount_ + << " (instant controls for frame " + << (sequence - maxDelay_) << ")"; while (queueCount_ - 1 < sequence) { LOG(DelayedControls, Warning)