From patchwork Fri Dec 3 12:06:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15010 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 EA452BDB13 for ; Fri, 3 Dec 2021 12:06:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 48942607DE; Fri, 3 Dec 2021 13:06:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="KnWlrkbW"; dkim-atps=neutral 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 D5AFA60725 for ; Fri, 3 Dec 2021 13:06:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638533196; 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=9eb9Vo1DPAbCVkrTBRX341m6IsHem/Y9smAR7pCOuR4=; b=KnWlrkbWaoW6hr0Sxa2wAnPPIXAX171BLYb4+DvAf6ikpBJT4MEbJeU3o6+cgtEvF/lMVK PBeGh2YAtPmskC5KOKbGURzDci8ocnlzKG1DP/Bl1Rv2xgFfnm12NW0lFKhC3zvFD6hEED M1GsddwmZvmV4v1yY/BmNby8kxVmyEc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-GMW5eW-qOWqqg6PACThyAw-1; Fri, 03 Dec 2021 07:06:35 -0500 X-MC-Unique: GMW5eW-qOWqqg6PACThyAw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0824344B5 for ; Fri, 3 Dec 2021 12:06:34 +0000 (UTC) Received: from fedora.rhtw.internal (unknown [10.39.193.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF22B7944B; Fri, 3 Dec 2021 12:06:30 +0000 (UTC) From: Kate Hsuan To: libcamera devel Date: Fri, 3 Dec 2021 20:06:23 +0800 Message-Id: <20211203120624.36657-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 v3 0/1] ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" v3 removes all the V4l2 hardcode from the algorithm and simplify the AF configurations. The hardcoded AF starting area was removed and bdsOutputSize was used to determine start_x and start_y axis. Patch v3 squashed Daniel's commit to remove the V4l2 control from the algorithm. Also, params->acc_param.af is simplified by using kernel's default configuration. Since the V4l2 configuration had been removed, the greedy algorithm is revised to fix some errors. Now, the AF area is determined by the bdsOutputSize. There is still some issues of bdsOutputSize to determine the AF start position. bdsOutputSize gives a 1440x960 size of the image but the output format is 1280x720. If the position is based on it, it will be shifted left for 80px. Kate Hsuan (1): ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM src/ipa/ipu3/algorithms/af.cpp | 239 ++++++++++++++++++++++++++++ src/ipa/ipu3/algorithms/af.h | 53 ++++++ src/ipa/ipu3/algorithms/meson.build | 3 +- src/ipa/ipu3/ipa_context.cpp | 27 ++++ src/ipa/ipu3/ipa_context.h | 11 ++ src/ipa/ipu3/ipu3.cpp | 2 + 6 files changed, 334 insertions(+), 1 deletion(-) create mode 100644 src/ipa/ipu3/algorithms/af.cpp create mode 100644 src/ipa/ipu3/algorithms/af.h