From patchwork Fri Oct 24 08:50:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24768 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 D99CDC3259 for ; Fri, 24 Oct 2025 08:51:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 964C760880; Fri, 24 Oct 2025 10:51:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ElW24RM9"; 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 F1AD06085B for ; Fri, 24 Oct 2025 10:51:42 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:7edc:62f4:c118:1549]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 7E18A1AA6; Fri, 24 Oct 2025 10:49:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761295797; bh=nukIpOw0g1pYJyUv4O678RTC9+Rmqr1IOBx5HvTHMpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElW24RM9rIXhN334LY0KYIYCm3KsGj+NfbDZXT+vVquQJzTvjX6QTNG66vYog7zpF rF5yFl8cd4APJPPybSnlSKG6YHMjNc4mKpbH6LuDo3zXXvT+Ym+VVnig13IT2+oDEw PFD3vJ85+2S1KAcDcJCHiuMal6/3XkZeOnCxfx14= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 02/35] libcamera: delayed_controls: Handle missed pushes Date: Fri, 24 Oct 2025 10:50:26 +0200 Message-ID: <20251024085130.995967-3-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" In unstable systems it can happen, that some sequence numbers are missed in the IPA. Gracefully handle that situation by queuing no-ops. Signed-off-by: Stefan Klug --- src/libcamera/delayed_controls.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp index 246e7cefa4e5..e5bdc374fd0e 100644 --- a/src/libcamera/delayed_controls.cpp +++ b/src/libcamera/delayed_controls.cpp @@ -178,6 +178,15 @@ bool DelayedControls::push(uint32_t sequence, const ControlList &controls) << " current queue index: " << queueCount_; } + while (sequence > queueCount_) { + LOG(DelayedControls, Warning) + << "Missed push for sequence " << queueCount_ + << " Auto queue no-op."; + push(queueCount_, {}); + } + + ASSERT(sequence == queueCount_); + /* Copy state from previous frame. */ for (auto &ctrl : values_) { Info &info = ctrl.second[queueCount_];