From patchwork Fri Mar 24 14:29:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18445 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 17A89C3260 for ; Fri, 24 Mar 2023 14:29:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9695C62718; Fri, 24 Mar 2023 15:29:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679668168; 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=hl1xoDjdHc6KWyLWYSUrfRFlTUfdFBEivQfxaaN4N+7cu52S2JXjiFLnT6Cd8waZE NnQRYn5MREWDKI+gX7waQUOD1wDSpmndetixlPVWD68Fai1LEgp2wu7r+k2DwGqcqo KyAn61ju29EyQRqXzHhbhHU/UDMJiJSsLXiBSRz2Ah45fIM2+zBTkM4TDom4m7sEHr SNTaemz7DbpWSCpUAZI6Kr0l+mNuGlRp707Xt+aqWDPt+3x4OrTFoQxCGswXtnwOWU 1Hd7V3DyHtuCOg5UncG56lyYzu6AbXXGV8BpevKpmKbz8RNxxkR0lpB5LFOKbY3TSv uzTjtegUJ2Qdw== Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E7E5A61ECF for ; Fri, 24 Mar 2023 15:29:25 +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="cgVGFXgy"; dkim-atps=neutral Received: by mail-lj1-x236.google.com with SMTP id f16so1896575ljq.10 for ; Fri, 24 Mar 2023 07:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1679668165; 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=cgVGFXgy1eGQ71qzy5NkubQESUttyiML1nkR9DwMpM6WPYF1Xjoi25+6ogQ/8N1Ujq 8fRqRDYwjCKBvZ/wXp2/nfLGWVhjRl5/rHT8erSegd/Wfg0XTM8dTb7Xx3B7oG5lJY6g 3UlQpjwQrzlaxSJhZJLwwKNAxWLKehx46VtJIccu1Kl101fBn/q37oF/kIRGZ1KzDgaO IzksOJp6mMcvShtRVCyOZdy2aZ8WLpuQDZ0Af5zW9mLgHoC6SAZNe3HNKgynBVVOD41T uoGupIQjN99gN6q1p+IJ34hNfxGSYGD/5ihkMFQSwshzrjsOdWKcIAyfoikRkCXJxtnu GyFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679668165; 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=SUC5xuLMmmeyqXBqtumsee7lDCNH2d+wnUciuIQtYTYsfbRQNBnw+tMeeDMPv1X3yn xRL7xwoY8KDfWBW8LmUCti2DYBdsn82ttP0IsV2YS72MCwStFlF7ld3q3EtB0Ux8jtp2 G3Gcc1V+V/Buz0Pn1dUHWGddDE7GEU1MvivAKwi4Dhnaf48EwqvPADKM9ASzXOJmIWSq Hh3VRBdqtcqn7ywq9y1lufM/n1Sjd9vQKMwAwmJYjcmuLgEgB1zx2SQNAKuOmSBrQcpc SA7tqngth7mhWxhaJyTGFxf/Sav8G9ubqv8Blu0QCJWk1JcQZo/NwGR9LK9GKPdKg+Rl oE9A== X-Gm-Message-State: AAQBX9eoEU9omuxyZm6Vd5CHerosWH22C9lfsECPurOZkpHA6rwsG73e 0EcmBZ79niLKraSxs1xoYsiWhEZjtHfmDL2ZGjI= X-Google-Smtp-Source: AKy350bYQiA9mHFitxVRLanw8dmjb30gvJu1p94qjoKYdQ5KTNfyPVOzSivvSwT471uUE31th1ST1A== X-Received: by 2002:a2e:b046:0:b0:2a2:86de:667a with SMTP id d6-20020a2eb046000000b002a286de667amr932749ljl.40.1679668165285; Fri, 24 Mar 2023 07:29:25 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id j21-20020a2e8515000000b002a10b2ea089sm981714lji.16.2023.03.24.07.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 07:29:25 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 24 Mar 2023 15:29:00 +0100 Message-Id: <20230324142908.64224-3-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230324142908.64224-1-dse@thaumatec.com> References: <20230324142908.64224-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 Reviewed-by: Jacopo Mondi --- 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());