From patchwork Tue Mar 14 14:48:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18393 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 42393C3263 for ; Tue, 14 Mar 2023 14:49:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7821462713; Tue, 14 Mar 2023 15:49:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678805395; bh=ejOENZ/e1++33Ovtlo6eNchLLyXr5wDvErTCzcVI18U=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MVUlLFcqxuNI9uSjkLGHoewrQ+i3ZFdIdqtMqreJaiKZf8D+d3DKJIr06EKG3R78+ A0R6H9us9/Rws0XdlXOBd5JbZMipPYwwPh3DD/q+IYihMJsriI41kOSwx0sjpbB5JG EId7z1zijj/yTLSEASoejIms4miUiB1xARSp7rA7310IafGToKZ4JXzFnNix0/JMC1 2kKJlus506d0jBud6rDmE/879SzoRgBC8N0kEEk2+zppEKrXw9HjwrTBr/FDXsD3h9 oZK9Fa6IdsciFD6R4QKGmJ9IB/rUB3XC6k+7P72SgJRdyVKEGTaP5pXQ11f3kKBZdh g/3MFcsLBM0fA== Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 94F29626D6 for ; Tue, 14 Mar 2023 15:49:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=thaumatec-com.20210112.gappssmtp.com header.i=@thaumatec-com.20210112.gappssmtp.com header.b="GklvlonF"; dkim-atps=neutral Received: by mail-lj1-x22c.google.com with SMTP id h3so16271103lja.12 for ; Tue, 14 Mar 2023 07:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1678805392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8l6sE+OVX2uuIoyLjXNkPNCNwAZLjqHWm3i7Yg1Y6Qs=; b=GklvlonFTgBAQHZYv6XciJ2G9M/mbIedUWdDbPS/Jf8PIl2v3WRViNemKbcV5WNAIR c5LZCdjUi3L9g85OQLv7Y13WSnX6mm4T3ajeD8Y/zqeyobGS+24qsNTdykk4kyVohQKf qAwXeOAjfp4HHNt4eQRizu2knSU1EiR7yK4SZFefyLXV0grqZQRKFAT7wLa/yHHtSXK4 mUZTYHF7ey+xWcpAKIDduWX5autyFUH27XiAsGstxOuOrAcrRrI02HMBsHbDy2wI+C4U NXLkquIokC1U5xmDAq6/COHIf0xtfB3RNCurLchjVlItpo7+58JvMQ2+BmIL4rBB9Utg rDLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678805392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8l6sE+OVX2uuIoyLjXNkPNCNwAZLjqHWm3i7Yg1Y6Qs=; b=QLXdQvl6a3lncfEb7oA2z9BapOSBHlkRw4TlNXGM1hsBxsyBHT1HjUK+GBe0Qrmsxg dJRg3ntCojY9bu7iI76C+zowFNtLnj0znQejHl9V+eC8ynvaZZTJO+GfDhOfOyWlLNpG m86nLRdurVlD5cYuNHn27MPPGJpvP4hIYmJU8UbKvme03y+7mXh3RvRdE7z2Ny8cd/yJ 9B67E/ktKDVIi3RTppbs+GJI6PPYa/s2udl+I6BgRCKdE05VHxxOTGCFp3a2KSlXE0bk sbcBGDRhiw8XGtcKrxOIyiyzGn5JLmWWO92ICkVCGVPkJGlULiljrCvJrNuxUyZFWj+i ukOw== X-Gm-Message-State: AO0yUKVaTnSxAX+G/L+p9rSi9n5k+uZiXCPaNYYqpJwubZt0GMvnm3gl 64nh6K5psmrtyHBsMRkVBkHzJiVYVF9X1vj5hkc= X-Google-Smtp-Source: AK7set9GC8gZa4SSPe0PHbasVEPn1lA6MJuPD/+RATnROMXOfpUq14u+XGsYuwE7Vjnkk3/vWt0Hgg== X-Received: by 2002:a05:651c:2cb:b0:293:5f35:d68f with SMTP id f11-20020a05651c02cb00b002935f35d68fmr13021841ljo.31.1678805391844; Tue, 14 Mar 2023 07:49:51 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id q25-20020a2eb4b9000000b00295a35f30e1sm470961ljm.115.2023.03.14.07.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 07:49:51 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 14 Mar 2023 15:48:26 +0100 Message-Id: <20230314144834.85193-3-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314144834.85193-1-dse@thaumatec.com> References: <20230314144834.85193-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 02/10] ipa: rkisp1: Add lens limits to the session config 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: , X-Patchwork-Original-From: Daniel Semkowicz via libcamera-devel From: Daniel Semkowicz Reply-To: Daniel Semkowicz Cc: jacopo.mondi@ideasonboard.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add information about focus lens position limits to the IPA session configuration. These information can then be used by IPA algorithms to know which focus positions are valid. Signed-off-by: Daniel Semkowicz --- src/ipa/rkisp1/ipa_context.cpp | 12 ++++++++++++ src/ipa/rkisp1/ipa_context.h | 5 +++++ src/ipa/rkisp1/rkisp1.cpp | 13 ++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp index 9bbf3684..401c098f 100644 --- a/src/ipa/rkisp1/ipa_context.cpp +++ b/src/ipa/rkisp1/ipa_context.cpp @@ -89,6 +89,18 @@ namespace libcamera::ipa::rkisp1 { * \brief Sensor output resolution */ +/** + * \var IPASessionConfiguration::lens + * \brief Lens-specific information + * + * \var IPASessionConfiguration::lens.minFocusPosition + * \brief Minimum position supported by the camera focus lens + * + * \var IPASessionConfiguration::lens.maxFocusPosition + * \brief Maximum position supported by the camera focus lens + * + */ + /** * \var IPASessionConfiguration::raw * \brief Indicates if the camera is configured to capture raw frames diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index b9b20653..bfb6e1b7 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -45,6 +45,11 @@ struct IPASessionConfiguration { Size size; } sensor; + struct { + int32_t minFocusPosition; + int32_t maxFocusPosition; + } lens; + struct { rkisp1_cif_isp_version revision; } hw; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 248cf5e0..cd1fbae3 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -267,9 +267,20 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; }); - if (!ipaConfig.lensControls.empty()) + if (!ipaConfig.lensControls.empty()) { lensControls_ = ipaConfig.lensControls; + const ControlInfo focusAbsolute = + lensControls_->find(V4L2_CID_FOCUS_ABSOLUTE)->second; + + LOG(IPARkISP1, Debug) + << "Focus lens: " << focusAbsolute.toString(); + + auto &lensConfig = context_.configuration.lens; + lensConfig.minFocusPosition = focusAbsolute.min().get(); + lensConfig.maxFocusPosition = focusAbsolute.max().get(); + } + for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get());