From patchwork Tue Apr 26 05:58:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15708 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 D3AC6C0F1B for ; Tue, 26 Apr 2022 05:59:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C9F8565647; Tue, 26 Apr 2022 07:59:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650952756; bh=aIK5y/CRTitPbOUv2hTstU9AVpsNnwSzCUO+YxUB29U=; 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=YSmoaZArpKorokQSNGKLcCcsVPBiF3+HjMezZ9LvSMbPxHQj3ELalRJuzow/XCvep TJ5da8NU5TbtueJy47pgbOTssQkxgp5eOW8cT6/LTZsel0+aZTbLy9Dbzjy8tDFH33 Qyr0H1+uTRsCNO6lWOMDcettFz+5sm6KNdIA/j6VyrZbXpzJU3K1EGAJQUHqzvDLAM gYQ79rka2fDv3fL8ajPZVbVySLvSCs/5h1cV4vRThxz5xExR9yuCX+E98HRbvbaZ/D tQbjWywPTRhmukguH2wiYIrAB6iHf0eQ18jki++W6e2eFG3UE4gxTf6xGCOI9VUMTZ br6zGZgeADY2A== 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 CD9E56042D for ; Tue, 26 Apr 2022 07:59:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="KHMy5vBb"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650952753; 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=q/lZpI3i9nFEM+07FrNOPFemLziJApnaTZY0q4BLc90=; b=KHMy5vBbnhc0tvviBIoFMbS4Gy68VY7PyLIZpt/MC7nxnWOESkxLkyRIz5uLAltkTU4rhY yQO/+NI7/B7ESMnOjyVOZGLRpnumeCzeeSXZPWRxRCTtzj+Fvv1pHYK9HdzQQEh8q58Qhg Z6lfFsbcs6LZkXRfbsHuvruXwYEGrY8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-TwIyySlIOliUBFogvTlTQw-1; Tue, 26 Apr 2022 01:59:12 -0400 X-MC-Unique: TwIyySlIOliUBFogvTlTQw-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 519D8811E76 for ; Tue, 26 Apr 2022 05:59:06 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC2D8111D78E; Tue, 26 Apr 2022 05:59:00 +0000 (UTC) To: libcamera devel Date: Tue, 26 Apr 2022 13:58:27 +0800 Message-Id: <20220426055830.8999-2-hpa@redhat.com> In-Reply-To: <20220426055830.8999-1-hpa@redhat.com> References: <20220426055830.8999-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] [PATCH v3 1/4] ipa: ipu3: Variables to hold the maximum VCM steps 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" They are used to place the maximum VCM steps. Signed-off-by: Kate Hsuan --- include/libcamera/ipa/core.mojom | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom index 74f3339e..2e99e999 100644 --- a/include/libcamera/ipa/core.mojom +++ b/include/libcamera/ipa/core.mojom @@ -207,6 +207,11 @@ module libcamera; frameDuration(s) = maxFrameLength(lines) * lineLength(pixels) / pixelRate(pixels per second) \endverbatim */ + +/** + * \var IPACameraSensorInfo::maxVcmSteps + * \brief The maximum VCM steps + */ struct IPACameraSensorInfo { string model; @@ -221,6 +226,8 @@ struct IPACameraSensorInfo { uint32 minFrameLength; uint32 maxFrameLength; + + uint32 maxVcmSteps; }; /** From patchwork Tue Apr 26 05:58:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15710 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 ECC84C0F1B for ; Tue, 26 Apr 2022 05:59:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8FF1065647; Tue, 26 Apr 2022 07:59:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650952775; bh=F2y+L6vE3qfEbBj7N92mo37hhxc8Nd5vp5+8wcu29mw=; 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=oDrh7bhXKdw1Cx1BorXN2ad/cmXTxI1ERfvYMamMiQd1kff5TK6Be0p+2/fOf7qCG pjap0LHpLoNhSYHLRzC8oSlRYlbNaYnBzgbbCog/2h0+P3p9mnoWGqPipEAbbhwHNJ gWcl9myEcZruVTrQoXZ7xKxJJ6PzOtyLeVuGMmYINOoBQmez3YQzNjD/9y5lrWhguK twC2ZrRUJMf7Gewkeqmg4xTLXOMRBmqH6M0aXnrlFDsAg/p/Zj91Zj3CjO1Lu7usg3 6s9xTciXRO3PHia+palz0A/Lg0j+DZFfB12YZypmJMfsHwRxU71CldkSmtOgD4MG3z loIxOZI0Y46Hw== 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 123C86042D for ; Tue, 26 Apr 2022 07:59:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="SU5Gq4b0"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650952773; 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=lGfsVSJOvG0lJQ4ZxO5jD55efCr/5Wy/6avz9J/1qi0=; b=SU5Gq4b0lJyaRsY0ThdB/rSY/DZ7SHtvDHAJFV7JzR5a9YEkW5tJFPmzRl46HyUIeCNusM 2dOvFw0REO0Ormwl/ANdA/X7J+mBltn2TYgr765nKinTEPMEq6B9IywBfdZkzqMmh1E/d8 S/+EHxsZPD6zR+IS6+xmACwa33sH/NU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-NMffx9V5MAGcjZNYqJID9g-1; Tue, 26 Apr 2022 01:59:31 -0400 X-MC-Unique: NMffx9V5MAGcjZNYqJID9g-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 9CABC811E80 for ; Tue, 26 Apr 2022 05:59:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 847FD111DCFC; Tue, 26 Apr 2022 05:59:06 +0000 (UTC) To: libcamera devel Date: Tue, 26 Apr 2022 13:58:28 +0800 Message-Id: <20220426055830.8999-3-hpa@redhat.com> In-Reply-To: <20220426055830.8999-1-hpa@redhat.com> References: <20220426055830.8999-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] [PATCH v3 2/4] libcamera: camera_lens: Get maximum VCM steps 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 allows other components to get the maximum VCM steps. It get the device information from subdev and return it's maximum value. Signed-off-by: Kate Hsuan --- include/libcamera/internal/camera_lens.h | 1 + src/libcamera/camera_lens.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h index 277417da..84b3c884 100644 --- a/include/libcamera/internal/camera_lens.h +++ b/include/libcamera/internal/camera_lens.h @@ -27,6 +27,7 @@ public: int init(); int setFocusPosition(int32_t position); + int getMaxFocusStep(); const std::string &model() const { return model_; } diff --git a/src/libcamera/camera_lens.cpp b/src/libcamera/camera_lens.cpp index b3d48199..b9810551 100644 --- a/src/libcamera/camera_lens.cpp +++ b/src/libcamera/camera_lens.cpp @@ -95,6 +95,19 @@ int CameraLens::setFocusPosition(int32_t position) return 0; } +/** + * \brief Get maximum lens steps + * \return The maximum lens steps. + */ +int CameraLens::getMaxFocusStep() +{ + const ControlInfoMap &infoMap_ = subdev_->controls(); + const ControlInfo devInfo = infoMap_.find(V4L2_CID_FOCUS_ABSOLUTE)->second; + int32_t maxFocus = devInfo.max().get(); + + return maxFocus; +} + int CameraLens::validateLensDriver() { int ret = 0; From patchwork Tue Apr 26 05:58:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15712 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 C5AB4C0F1B for ; Tue, 26 Apr 2022 05:59:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 794036564A; Tue, 26 Apr 2022 07:59:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650952786; bh=Bat78dW5kjggr6YCiiPT6PXmwu/0pDYbqCe9NPscKKc=; 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=2OrYlepbOqh8I+q0K5fza56Lz7S0SgQ/P4drXm2zNwnsH+CBIVfVFY/ebvqjvmPkv +RuwGbBtQabTUp9lSjPCjKlgAahoImTXNHPOacxAF6V9/Uvh1Rvvt8Vt7IIEtuSnuK Wg23YIKVsnVMw3F+pqnG0Psow6pBae63yequ9FuxFEYKOxKvdpVqGmweQG1P9561pS SD37RaeQCQwvBlczlDJnbiIfPq5QPwRVlSutQ30nz0l9D8AUg29KanHwOfGnsLbLJE gHGOpvXuYWpaXWvEaiW7wgnW4hJqSrA7G0528X8Xo+hOdjb/5Sg8DgEDk1OnjmUY65 vh0aHRM/RYWOw== 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 787B565646 for ; Tue, 26 Apr 2022 07:59:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="LbHWvWir"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650952784; 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=jc3ShkqkQ+Ujg8leOQE72MJg3eDxmyju53HYJyeTAVY=; b=LbHWvWir6/e8x/y9QMrh0FNMSHESN1jNC0gimKReV0N7Iwy0q0dzEc4XeTqNT6/+ICBiUe 8n39aDOhWTD30Xzud/bU5rNt+dvxTBmh9wVb48EsagfUS3uOQNnyXXr6U7IMdKhglDsUjE 2UH0VSTyxK6M1j6gBm2Wtm+ufLi4qFQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-jrTlArT_PqWgo1ooDkTeiA-1; Tue, 26 Apr 2022 01:59:43 -0400 X-MC-Unique: jrTlArT_PqWgo1ooDkTeiA-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 3C74518812C5 for ; Tue, 26 Apr 2022 05:59:33 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0077112131E; Tue, 26 Apr 2022 05:59:11 +0000 (UTC) To: libcamera devel Date: Tue, 26 Apr 2022 13:58:29 +0800 Message-Id: <20220426055830.8999-4-hpa@redhat.com> In-Reply-To: <20220426055830.8999-1-hpa@redhat.com> References: <20220426055830.8999-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] [PATCH v3 3/4] libcamera: pipeline: ipu3: Get and set 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" The VCM step value is stored in ConfigInfo if lens exists. Signed-off-by: Kate Hsuan --- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index fd989e61..f5cd2173 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -665,8 +665,10 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) configInfo.sensorControls = data->cio2_.sensor()->controls(); CameraLens *lens = data->cio2_.sensor()->focusLens(); - if (lens) + if (lens) { configInfo.lensControls = lens->controls(); + sensorInfo.maxVcmSteps = lens->getMaxFocusStep(); + } configInfo.sensorInfo = sensorInfo; configInfo.bdsOutputSize = config->imguConfig().bds; From patchwork Tue Apr 26 05:58:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15711 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 4E903C0F1B for ; Tue, 26 Apr 2022 05:59:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 14D8565643; Tue, 26 Apr 2022 07:59:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650952777; bh=uThgyHjDnC+lEe99mYtFrOliYIAAEhRoIck9nWog638=; 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=npkqPySpJ3RohUnBuvGEj4TDNnTe/l8R53TTjPnSn+gKOswN8vd+o9a6MjL4P63dp liN+whvZhbfJzwVFLU0ZuWcx4WDRF8YBdI0h1kzg9blj8C2Xid9rCUpSmlfGru/fdk RhJXxs3G4LenMSQQe6FQpI7DgbcczHI35xyoxn2lTamL3iY04yHj/kPXsA4U+vIBLt sY5CLDflJFT4LwQAWTPLJ2hJd7WiUKave2ZMr61JIBWBSgYgd9NaZLAik6rH1Fwqz6 AP279hB+1QhOJGqttgIeAqVv7/ggLrdfIsZG/HbBeuZvbSUsVwqxNpjG7QjqRdBSeS UR2T4JzIGEebg== 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 07B2F6042D for ; Tue, 26 Apr 2022 07:59:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZPhzLQAr"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650952774; 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=yAiQvw5R+MG2sBMTBHOEpOULc3I1Ns2d+x8NgzRMtSA=; b=ZPhzLQArh0TNtV6PamsURQitwIJJEap49rbceE3sQg/P/gj7CXqWdvy7JmJDd6PA2tN0+N lXXK4FTZys0Req9XJIsSStxrkGFViqSSVJ3+FhilzzlU9SuyRPwYqxSMtDYlvhQh+XOGXY 0aAG1fd8eu0e+mtN/FdgesixWe8wJlo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-227-Ysse84tWNG-EjFecOfZqmg-1; Tue, 26 Apr 2022 01:59:32 -0400 X-MC-Unique: Ysse84tWNG-EjFecOfZqmg-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 DEB0780418E for ; Tue, 26 Apr 2022 05:59:31 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 325E5111E3F8; Tue, 26 Apr 2022 05:59:27 +0000 (UTC) To: libcamera devel Date: Tue, 26 Apr 2022 13:58:30 +0800 Message-Id: <20220426055830.8999-5-hpa@redhat.com> In-Reply-To: <20220426055830.8999-1-hpa@redhat.com> References: <20220426055830.8999-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] [PATCH v3 4/4] ipa: ipu3: af: Remove hardcoded maximum VCM steps 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" The hardcoded VCM step variable was removed and was replaced by the configInfo. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/af.cpp | 13 ++++--------- src/ipa/ipu3/algorithms/af.h | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index f700b01f..4faf0bd8 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -62,12 +62,6 @@ namespace ipa::ipu3::algorithms { LOG_DEFINE_CATEGORY(IPU3Af) -/** - * Maximum focus steps of the VCM control - * \todo should be obtained from the VCM driver - */ -static constexpr uint32_t kMaxFocusSteps = 1023; - /* Minimum focus step for searching appropriate focus */ static constexpr uint32_t kCoarseSearchStep = 30; static constexpr uint32_t kFineSearchStep = 1; @@ -179,7 +173,8 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo) grid.y_start |= IPU3_UAPI_GRID_Y_START_EN; /* Initial max focus step */ - maxStep_ = kMaxFocusSteps; + maxStep_ = configInfo.sensorInfo.maxVcmSteps; + maxFocusSteps_ = configInfo.sensorInfo.maxVcmSteps; /* Initial frame ignore counter */ afIgnoreFrameReset(); @@ -217,7 +212,7 @@ void Af::afCoarseScan(IPAContext &context) context.frameContext.af.focus = focus_; previousVariance_ = 0; maxStep_ = std::clamp(focus_ + static_cast((focus_ * kFineRange)), - 0U, kMaxFocusSteps); + 0U, maxFocusSteps_); } } @@ -262,7 +257,7 @@ void Af::afReset(IPAContext &context) previousVariance_ = 0.0; coarseCompleted_ = false; fineCompleted_ = false; - maxStep_ = kMaxFocusSteps; + maxStep_ = maxFocusSteps_; } /** diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h index b85cf941..a1cf561c 100644 --- a/src/ipa/ipu3/algorithms/af.h +++ b/src/ipa/ipu3/algorithms/af.h @@ -45,6 +45,8 @@ private: bool afIsOutOfFocus(IPAContext context); + /* Maximum VCM steps */ + uint32_t maxFocusSteps_; /* VCM step configuration. It is the current setting of the VCM step. */ uint32_t focus_; /* The best VCM step. It is a local optimum VCM step during scanning. */