From patchwork Mon Sep 14 14:02:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 28279 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 BD907C3365 for ; Mon, 14 Sep 2026 14:05:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 650AF68713; Mon, 14 Sep 2026 16:05:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wJlMOo6i"; 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 A08C3686ED for ; Mon, 14 Sep 2026 16:04:58 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:a279:75fa:1f6c:7f40]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AD6AF512; Mon, 14 Sep 2026 16:03:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789394598; bh=CGXKU/APkeXXTWLUMT/Ytnyz/+s2rblwYRyNuuEUxmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wJlMOo6i2BnMKle7fEQxqShX7XsiJl01L++eQHwKL/ZMOz/n2jXPzKpt8vf5USWOo XyTYom5NM7HqNpODaB/3tmnVROpSOou+CfDSa9TFY/H/PB6lhReSwP9J5d4p4dFcmQ EHaXRn2JjERXcdcxtbc8WlRI3KnSBt0MP9t549Tk= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v3 35/41] libipa: fc_queue: Early out on first context Date: Mon, 14 Sep 2026 16:02:48 +0200 Message-ID: <20260914140309.3354666-36-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260914140309.3354666-1-stefan.klug@ideasonboard.com> References: <20260914140309.3354666-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" Handle the special case of an uninitialized FCQueue separately, to make the following logic easier to follow. This is a preparatory patch and no functional changes are intended. Signed-off-by: Stefan Klug --- src/ipa/libipa/fc_queue.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h index 633bf646d88d..796ab656cf40 100644 --- a/src/ipa/libipa/fc_queue.h +++ b/src/ipa/libipa/fc_queue.h @@ -59,6 +59,14 @@ public: FC &fc = contexts_[frame % contexts_.size()]; FrameContext &frameContext = fc; + if (!initialized_) { + fc = {}; + frameContext.frame_ = frame; + initCallback_(fc, controls); + initialized_ = true; + return fc; + } + /* * If the IPA algorithms try to access a frame context slot which * has been already overwritten by a newer context, it means the @@ -72,7 +80,7 @@ public: << " has been overwritten by " << frameContext.frame_; - if (initialized_ && frame == frameContext.frame_) { + if (frame == frameContext.frame_) { if (!controls.empty()) { /* Too late to apply the controls. Store them for later. */ LOG(FCQueue, Warning) @@ -97,7 +105,6 @@ public: fc = {}; frameContext.frame_ = frame; initCallback_(fc, *controls2); - initialized_ = true; controlsToApply_.clear(); return fc;