From patchwork Thu Apr 14 07:43:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15676 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 CB93CC3256 for ; Thu, 14 Apr 2022 07:44:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4E4A365657; Thu, 14 Apr 2022 09:44:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649922271; bh=xTjNR3ealMX/ay+mWesY1mmQU4WV6lkwj0YLN4RJFoI=; 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=QU2yNBm6jtc93uPaGpsICHSfTAd5nPleZoelZv9vDCPTVK6OByWjiw/6TSh67SzIn RjrAE7rcF9hRG610P8hJ+w1+R9Btsw2srbC2b2Q/nD3nC/j+0ySlWfIgU0Mll6C52p ZtljXwjCNmaJX6/kv79Z2xApw/aT0qsdErwjSLPHuazHNCsI6cihdee4okWywuO4OM wqLuNqKMjqOH3ajdqS0slWMH8Nsy1fB/Z7eC7iec8iuoFYP4LP3yrDt9KO7Yw4exUS qmnNPwEzLbMWNTd0HB7BJ93S4ukvgdbs9OP+nW3phNdBBcDiJPDjQI4SwWYNCV1Ob4 mV/RSnVKRMT9w== 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 46AF96564A for ; Thu, 14 Apr 2022 09:44:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Eny11BpH"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649922269; 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=oTiYx9TtVywnsP8GpOnyQDdDpbhGdKtxn/jF98TEPIE=; b=Eny11BpH3qTEjGLjoY7zRedVj2ZCtz5YclnEWa0USPIO5Xz0wOrHNyolpeefZbVXXQFJtj gCd9kIEDkf1gENjTOtjjxWqUwKJyK7Q/VKvQL5CEFtzvL/zYUqyHA6vfFLp+FaqlDpiIHI ufVPcrgyisl7n/8acFIeT8eoc67yD/Y= 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-211-th2srw_wM8eK3pLpY946yw-1; Thu, 14 Apr 2022 03:44:27 -0400 X-MC-Unique: th2srw_wM8eK3pLpY946yw-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 EFD0A80418A for ; Thu, 14 Apr 2022 07:44:26 +0000 (UTC) Received: from fedora.rhtw.internal (unknown [10.39.193.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 503E6111D3CC; Thu, 14 Apr 2022 07:44:24 +0000 (UTC) To: libcamera devel Date: Thu, 14 Apr 2022 15:43:42 +0800 Message-Id: <20220414074342.7455-6-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 5/5] 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 context configuration. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/af.cpp | 6 +++--- src/ipa/ipu3/ipu3.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index addf98af..95fb39f5 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -179,7 +179,7 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo) grid.y_start |= IPU3_UAPI_GRID_Y_START_EN; /* Initial max focus step */ - maxStep_ = kMaxFocusSteps; + maxStep_ = context.configuration.af.maxVcmSteps; /* Initial focus value */ context.frameContext.af.focus = 0; @@ -214,7 +214,7 @@ void Af::afCoarseScan(IPAContext &context) context.frameContext.af.focus = focus_; previousVariance_ = 0; maxStep_ = std::clamp(focus_ + static_cast((focus_ * kFineRange)), - 0U, kMaxFocusSteps); + 0U, static_cast(context.configuration.af.maxVcmSteps)); } } @@ -259,7 +259,7 @@ void Af::afReset(IPAContext &context) previousVariance_ = 0.0; coarseCompleted_ = false; fineCompleted_ = false; - maxStep_ = kMaxFocusSteps; + maxStep_ = context.configuration.af.maxVcmSteps; } /** diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index dd6cfd79..d46f7853 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -456,6 +456,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo, /* Clean frameContext at each reconfiguration. */ context_.frameContext = {}; + context_.configuration.af.maxVcmSteps = configInfo.sensorInfo.maxVcmSteps; if (!validateSensorControls()) { LOG(IPAIPU3, Error) << "Sensor control validation failed.";