From patchwork Thu Apr 14 07:43:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15675 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 5DD55C326C for ; Thu, 14 Apr 2022 07:44:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D58CC65646; Thu, 14 Apr 2022 09:44:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649922264; bh=l4XnZBrTsOrJDZqmr7XhZrNOHW0j4uiGQmJ0T/jtQQY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qUNG539M4IQbOCM841EFAfUF5heWN0nbg4Og5ZaIULi6Cw+jKY/VfxL595AQqjZV0 Q7W041smQAYWH1UGaqj6B88IukRkYEmfmAU+Un3SGvNQD5ah/+iN9OQIK8r09nupng XoWCkbW2mCVChcEKEc/V37v9RT7+pZFQynCCgaIdg3Nxyf9sSKNstF+rhK4jVMQAaK Lru4+OgFHL6LdTX3qByodMY/cTiQcaPWsXorXSRBZ/+8Qdr/GVIzcQD0qakdAI43LT Y0jm4A1Oa2UAW7w2sJyvnmCqFuql0c17Qgw7Zi50ahw0iOeO0zFAJPiT6VGg+ct5kZ fhO2ASOXxZtMg== 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 1C361604B6 for ; Thu, 14 Apr 2022 09:44:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="AQm/irHQ"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649922262; 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=kx0RgqLy/pWaTJbhrBn1BMiLaOpK1EP6tVd6cMmj48Y=; b=AQm/irHQuUwziuK5ML2mb2YawmRQvpVIzoWc6Yb3V9OG5lkQnYBGVYqwYAKmoIaHkV60Ek qpqfHhR+pt/ww+sVgAdfN5NhSt8YBekDiSvEp7Wxx3gvKZ0eqRBb7i8NSZ57QySSUmg/s+ QfdSpqZXBdqcQTiRtNC7B5I0oCh5IcI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-345-i0Ky0PrgMuSKBDcFyNuPEQ-1; Thu, 14 Apr 2022 03:44:21 -0400 X-MC-Unique: i0Ky0PrgMuSKBDcFyNuPEQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA6DB3C11C73 for ; Thu, 14 Apr 2022 07:44:20 +0000 (UTC) Received: from fedora.rhtw.internal (unknown [10.39.193.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D16E111D3CC; Thu, 14 Apr 2022 07:44:18 +0000 (UTC) To: libcamera devel Date: Thu, 14 Apr 2022 15:43:41 +0800 Message-Id: <20220414074342.7455-5-hpa@redhat.com> In-Reply-To: <20220414074342.7455-1-hpa@redhat.com> References: <20220414074342.7455-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [RFC v1 4/5] libcamera: pipeline: ipu3: Get VCM information 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: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" It is an interface of CameraData to get the VCM steps. Also, the VCM step value is stored in ConfigInfo. Signed-off-by: Kate Hsuan --- src/libcamera/pipeline/ipu3/ipu3.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 9f113171..9cc12e4c 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -85,6 +85,8 @@ public: ControlInfoMap ipaControls_; + int getSensorControls(); + private: void metadataReady(unsigned int id, const ControlList &metadata); void paramsBufferReady(unsigned int id); @@ -670,6 +672,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) configInfo.sensorInfo = sensorInfo; configInfo.bdsOutputSize = config->imguConfig().bds; configInfo.iif = config->imguConfig().iif; + configInfo.sensorInfo.maxVcmSteps = data->getSensorControls(); ret = data->ipa_->configure(configInfo, &data->ipaControls_); if (ret) { @@ -1271,6 +1274,18 @@ void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id, focusLens->setFocusPosition(focusValue.get()); } +int IPU3CameraData::getSensorControls() +{ + int ret = 0; + + CameraLens *focusLens = cio2_.sensor()->focusLens(); + if (!focusLens) + return 0; + + ret = focusLens->getFocusCapabilityies(); + return ret; +} + void IPU3CameraData::paramsBufferReady(unsigned int id) { IPU3Frames::Info *info = frameInfos_.find(id);