From patchwork Thu Nov 19 20:46:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 29051 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 697E4C3366 for ; Thu, 19 Nov 2026 20:46:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA1126A935; Thu, 19 Nov 2026 21:46:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="WuKHga8Y"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C78296A92D for ; Thu, 19 Nov 2026 21:46:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795121194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XN9V97KmHUO/OwLqfsBCCQZj4ZrVS2Hsdrq1z90iaDQ=; b=WuKHga8YLF4YocapcvALDgI8aCa/+2NxFTQ1pDBSD8wGrAf/ytLeqP8zum1UwIxzgIG66k 2o3WEFb4G6WykyVEtTzgedjYnZP25XIgxqLBrJkfeza/6UtAsYOtUhMQke2DtjOyMkC2ac FwjUPHK4S/7BSUvxoSn3WUfI3tAQtBg= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-RRrK1yrpP3OcrfcI-mxcSQ-1; Thu, 19 Nov 2026 20:46:29 +0000 X-MC-Unique: RRrK1yrpP3OcrfcI-mxcSQ-1 X-Mimecast-MFC-AGG-ID: RRrK1yrpP3OcrfcI-mxcSQ_1795121188 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 814EC180065F; Thu, 19 Nov 2026 20:46:28 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 773C3195604E; Thu, 19 Nov 2026 20:46:26 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , =?utf-8?b?QmFybmFiw6FzIFDFkWN6?= =?utf-8?q?e?= , Kieran Bingham , Robert Mader , Jayden Milne Subject: [PATCH v3 3/8] ipa: libipa: Add af::prepareControls() Date: Thu, 19 Nov 2026 21:46:06 +0100 Message-ID: <20261119204611.278218-4-mzamazal@redhat.com> In-Reply-To: <20261119204611.278218-1-mzamazal@redhat.com> References: <20261119204611.278218-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wTHxJiQ1N_trOG3YZR_nGcUGXBk6LC3t8pWgwMCJwdg_1795121188 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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" Similarly to what other algorithms do, let's add a control initialisation function to the libipa autofocus algorithm and use it in ipu3 IPA. Signed-off-by: Milan Zamazal --- src/ipa/ipu3/ipu3.cpp | 3 +-- src/ipa/libipa/af.h | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index e4333539a..605a57eea 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -554,8 +554,7 @@ void IPAIPU3::setControls(unsigned int frame) agc::prepareControls(ctrls, context_.camHelper.get(), frameContext.agc); ControlList lensCtrls(lensCtrls_); - lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, - static_cast(context_.activeState.af.focus)); + af::prepareControls(lensCtrls, context_.activeState.af.focus); setSensorControls.emit(frame, ctrls, lensCtrls); } diff --git a/src/ipa/libipa/af.h b/src/ipa/libipa/af.h index c902b434c..de9f7e0ba 100644 --- a/src/ipa/libipa/af.h +++ b/src/ipa/libipa/af.h @@ -7,6 +7,8 @@ #pragma once +#include + #include #include @@ -25,6 +27,11 @@ struct ActiveState { bool stable; }; +inline void prepareControls(ControlList &controls, int32_t focus) +{ + controls.set(V4L2_CID_FOCUS_ABSOLUTE, focus); +} + } /* namespace af */ class AfAlgorithm