{"id":15676,"url":"https://patchwork.libcamera.org/api/patches/15676/?format=json","web_url":"https://patchwork.libcamera.org/patch/15676/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220414074342.7455-6-hpa@redhat.com>","date":"2022-04-14T07:43:42","name":"[libcamera-devel,RFC,v1,5/5] ipa: ipu3: af: Remove hardcoded maximum VCM steps","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ad5a2a67bea4b0a6a03ba06142b03407abc07090","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/people/105/?format=json","name":"Kate Hsuan","email":"hpa@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15676/mbox/","series":[{"id":3052,"url":"https://patchwork.libcamera.org/api/series/3052/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3052","date":"2022-04-14T07:43:37","name":"Enabling AF algorithm to get the VCM attributes from the device driver","version":1,"mbox":"https://patchwork.libcamera.org/series/3052/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15676/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15676/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CB93CC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Apr 2022 07:44:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4E4A365657;\n\tThu, 14 Apr 2022 09:44:31 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 46AF96564A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 09:44:30 +0200 (CEST)","from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n\t[66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-211-th2srw_wM8eK3pLpY946yw-1; Thu, 14 Apr 2022 03:44:27 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFD0A80418A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 07:44:26 +0000 (UTC)","from fedora.rhtw.internal (unknown [10.39.193.169])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 503E6111D3CC;\n\tThu, 14 Apr 2022 07:44:24 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649922271;\n\tbh=xTjNR3ealMX/ay+mWesY1mmQU4WV6lkwj0YLN4RJFoI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=QU2yNBm6jtc93uPaGpsICHSfTAd5nPleZoelZv9vDCPTVK6OByWjiw/6TSh67SzIn\n\tRjrAE7rcF9hRG610P8hJ+w1+R9Btsw2srbC2b2Q/nD3nC/j+0ySlWfIgU0Mll6C52p\n\tZtljXwjCNmaJX6/kv79Z2xApw/aT0qsdErwjSLPHuazHNCsI6cihdee4okWywuO4OM\n\twqLuNqKMjqOH3ajdqS0slWMH8Nsy1fB/Z7eC7iec8iuoFYP4LP3yrDt9KO7Yw4exUS\n\tqmnNPwEzLbMWNTd0HB7BJ93S4ukvgdbs9OP+nW3phNdBBcDiJPDjQI4SwWYNCV1Ob4\n\tmV/RSnVKRMT9w==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1649922269;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=oTiYx9TtVywnsP8GpOnyQDdDpbhGdKtxn/jF98TEPIE=;\n\tb=Eny11BpH3qTEjGLjoY7zRedVj2ZCtz5YclnEWa0USPIO5Xz0wOrHNyolpeefZbVXXQFJtj\n\tgCd9kIEDkf1gENjTOtjjxWqUwKJyK7Q/VKvQL5CEFtzvL/zYUqyHA6vfFLp+FaqlDpiIHI\n\tufVPcrgyisl7n/8acFIeT8eoc67yD/Y="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"Eny11BpH\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"th2srw_wM8eK3pLpY946yw-1","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","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","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"US-ASCII\"; x-default=true","Subject":"[libcamera-devel] [RFC v1 5/5] ipa: ipu3: af: Remove hardcoded\n\tmaximum VCM steps","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The hardcoded VCM step variable was removed and was replaced by the\ncontext configuration.\n\nSigned-off-by: Kate Hsuan<hpa@redhat.com>\n---\n src/ipa/ipu3/algorithms/af.cpp | 6 +++---\n src/ipa/ipu3/ipu3.cpp          | 1 +\n 2 files changed, 4 insertions(+), 3 deletions(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\nindex addf98af..95fb39f5 100644\n--- a/src/ipa/ipu3/algorithms/af.cpp\n+++ b/src/ipa/ipu3/algorithms/af.cpp\n@@ -179,7 +179,7 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n \tgrid.y_start |= IPU3_UAPI_GRID_Y_START_EN;\n \n \t/* Initial max focus step */\n-\tmaxStep_ = kMaxFocusSteps;\n+\tmaxStep_ = context.configuration.af.maxVcmSteps;\n \n \t/* Initial focus value */\n \tcontext.frameContext.af.focus = 0;\n@@ -214,7 +214,7 @@ void Af::afCoarseScan(IPAContext &context)\n \t\tcontext.frameContext.af.focus = focus_;\n \t\tpreviousVariance_ = 0;\n \t\tmaxStep_ = std::clamp(focus_ + static_cast<uint32_t>((focus_ * kFineRange)),\n-\t\t\t\t      0U, kMaxFocusSteps);\n+\t\t\t\t      0U, static_cast<uint32_t>(context.configuration.af.maxVcmSteps));\n \t}\n }\n \n@@ -259,7 +259,7 @@ void Af::afReset(IPAContext &context)\n \tpreviousVariance_ = 0.0;\n \tcoarseCompleted_ = false;\n \tfineCompleted_ = false;\n-\tmaxStep_ = kMaxFocusSteps;\n+\tmaxStep_ = context.configuration.af.maxVcmSteps;\n }\n \n /**\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex dd6cfd79..d46f7853 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -456,6 +456,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \n \t/* Clean frameContext at each reconfiguration. */\n \tcontext_.frameContext = {};\n+\tcontext_.configuration.af.maxVcmSteps = configInfo.sensorInfo.maxVcmSteps;\n \n \tif (!validateSensorControls()) {\n \t\tLOG(IPAIPU3, Error) << \"Sensor control validation failed.\";\n","prefixes":["libcamera-devel","RFC","v1","5/5"]}