From patchwork Thu Apr 21 07:28:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15691 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 172DFC0F1B for ; Thu, 21 Apr 2022 07:29:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6012965644; Thu, 21 Apr 2022 09:29:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1650526145; bh=u8H0dKQsY9hy0ja5mMcSO5cPUaX524TQo6CL8ZxnwiQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=1C2I/EzT9IXKMW38cIPWesgR64jKRSGjrv6IGrj1NeVYHagkXmhppkbaOSeBj4rwq j2ThwQj3IoifL1r+fW5D59L8BjzfIwRiu4yI1PxGsv9DAhDUPgdCEC9RT1W99Jy9vV IkNw5Id8y+j3q7vUBvDcZeiq18pbiupLoMMQIQdaD7SyMZhhcJM72dJCTKAz6SM/q5 sFfmBGx6ETft7orxOlUQA+PxRg2MPYw7crbn7OYlHpulbXGOeTx7aRNFhv54qSxaYl kW7uGueOkXhwnMNADkIoHSkjVu8CTxmDEQUkcXXfxaqvziXnYGmQNkMk5Mo1+PFCHU al/b+tP5PjAig== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 76413604AD for ; Thu, 21 Apr 2022 09:29:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="O0IgwHbp"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650526142; 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; bh=LTft5Ci4iSEjUXRlviF1Uq6kW/YVIB3ej7fLF9fUeCI=; b=O0IgwHbpkHK1asEqojKoMhJrVmPjVH+mI4Wi0/BCKTPOMT5qPrYY1EZ8LMFFx0NVqG/o60 2ktyvqvAb42Ky4aCb1i9GzHH5bsP5+O9cLx7oPP2mIsX3p3fHMFaujr8s7JG4rVpjfzo7V NuHuIkFzP0sLHISEK0BcuJBPxqc1n5Y= 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-16-B6l7d6ggPSqX4y1EwbOv-w-1; Thu, 21 Apr 2022 03:28:58 -0400 X-MC-Unique: B6l7d6ggPSqX4y1EwbOv-w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B5B8101AA44 for ; Thu, 21 Apr 2022 07:28:58 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.194.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0294C33AE9; Thu, 21 Apr 2022 07:28:56 +0000 (UTC) To: libcamera devel Date: Thu, 21 Apr 2022 15:28:44 +0800 Message-Id: <20220421072848.6752-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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 PATCH v2 0/4] Enabling AF algorithm to get the VCM attributes from the device driver 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" Some of the algorithm, such as autofocus needs the information from the device to configure the range of the search or the maximum values of the configurations. Currently, this information, such as VCM attributes was hardcoded in the code so it can only be used for specific hardware. If the device attributes can be got through the codes, the algorithm can be dynamically configured based on the device attributes got from the kernel. This work proposed an implementation that can be used to get the device attribute from the kernel and allows the algorithm has a method to get the device attribute without a specific call. Therefore, for example, the AF algorithm can get the necessary maximum VCM steps value to configure itself. During the AF algorithm configuration, the prefetched VCM steps will be set to the configInfo and based on this the corresponding variable will also be initiated. Kate Hsuan (4): ipa: ipu3: Variables to hold the maximum VCM steps libcamera: camera_lens: Get maximum VCM steps libcamera: pipeline: ipu3: Get and set VCM information ipa: ipu3: af: Remove hardcoded maximum VCM steps include/libcamera/internal/camera_lens.h | 1 + include/libcamera/ipa/core.mojom | 7 +++++++ src/ipa/ipu3/algorithms/af.cpp | 13 ++++--------- src/ipa/ipu3/algorithms/af.h | 2 ++ src/libcamera/camera_lens.cpp | 13 +++++++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 15 +++++++++++++++ 6 files changed, 42 insertions(+), 9 deletions(-)