From patchwork Sat Oct 31 18:40:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 28727 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 B1817C3261 for ; Sat, 31 Oct 2026 18:41:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 59CE869146; Sat, 31 Oct 2026 19:41:03 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="TI9i7tV8"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 43A2469133 for ; Sat, 31 Oct 2026 19:41:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793472059; 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=gChfWa4EdlBSIqxRmKY+JuojOPsJ5d+HWnEOeTrfmLk=; b=TI9i7tV8c0amrY1ohLEey/H1clf0rlbJE7upZDWVWwgFx1RUeXEBD6TofmYy0Q3b7e6lZp FQBfTb8F3/SZ4eZg/WcdhZGI7kmzkY6V2XvXKS7M73wvmeB3zvgTmzd/WwpfqiagukN8TZ BXi2VSLhTIGRzoPXUHNVcJtXkjEMHsw= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-257-s-2ofiYOPm-QLSCHxdDqRA-1; Sat, 31 Oct 2026 14:40:58 -0400 X-MC-Unique: s-2ofiYOPm-QLSCHxdDqRA-1 X-Mimecast-MFC-AGG-ID: s-2ofiYOPm-QLSCHxdDqRA_1793472057 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E548819560A7; Sat, 31 Oct 2026 18:40:56 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 780AF1800480; Sat, 31 Oct 2026 18:40:55 +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 Subject: [PATCH v2 3/8] ipa: libipa: Add af::prepareControls() Date: Sat, 31 Oct 2026 19:40:35 +0100 Message-ID: <20261031184040.20139-4-mzamazal@redhat.com> In-Reply-To: <20261031184040.20139-1-mzamazal@redhat.com> References: <20261031184040.20139-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fgFyWsQ-ND006FYlP0Ij_PEAZgL_9fcFRhH_wjMrf10_1793472057 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 30d52cfcf..599817061 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -555,8 +555,7 @@ void IPAIPU3::setControls(unsigned int frame) frameContext.agc.exposure, frameContext.agc.gain); 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