From patchwork Mon Jun 13 14:28:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 16209 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 E9711BD161 for ; Mon, 13 Jun 2022 14:29:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 61BDA6563B; Mon, 13 Jun 2022 16:29:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655130541; bh=xjUqAq6sENCsDVxFsK0bZsfoNMdTj5MgGgCp36nYbU8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=WKhz+YUbPsM8JIIbyFjT59mYT73eSFU7ZyMU8zBYFRX1n0q9FTd87S+IZJpQ01tbt W/mtPMwa7fB4POkWmPApqchSgjvdWM+xJRkwhRq7ULzRfPhheI20EczU1qUi41EMN0 1qSqOuzc2AdjHt2XhyTSmUqRjh4VyEiyJEbPVYmyOSbJ81TKn2TrSJOrxz5Bbwu2bW Fn1dNaxTvlhOOLa8wkcLPI4eUYF92bZHYqzjBN2u0KDoYaTD4J3XRV7YphGMhChgm0 Yalvmk4fp4cdFEHSl4dPKmfgTH05oDhVX/m6uVbxAVe9f7VNSsCO6Aj5GkHaVSU4lG ZiOfLQxvqO4VA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B6BB600F1 for ; Mon, 13 Jun 2022 16:29:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jqaV1yD4"; dkim-atps=neutral Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:a1c7:c28c:7720:9b30]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8DF39305; Mon, 13 Jun 2022 16:28:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655130539; bh=xjUqAq6sENCsDVxFsK0bZsfoNMdTj5MgGgCp36nYbU8=; h=From:To:Cc:Subject:Date:From; b=jqaV1yD4JSK7oMHgwTqvVHJakFbJNWlX1A9gJcneuymYLcHP335nofS2b+eY9VggD hRzkjQ82Nm6c9k4ipRZABz2n2D3ua74+mjNtFVQvNCKKLP1Ut+ZcuJ0jRPFQ90ymNv /7j3E3/VSmQHLNt78wMZul9uNriIYojyNsrmlz08= To: libcamera-devel@lists.libcamera.org Date: Mon, 13 Jun 2022 16:28:43 +0200 Message-Id: <20220613142853.98484-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/10] ipa: raspberrypi: Introduce an autofocus algorithm 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: Jean-Michel Hautbois via libcamera-devel From: Jean-Michel Hautbois Reply-To: Jean-Michel Hautbois Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This series introduces a contrast based algorithm, already used in the IPU3, with some of the recently merged AF controls. I have not included the LensPosition control, as we don't have, yet, a way to know the hyperfocale, and so, we can't really give the user a proper position. I also have not included the AfLensRange control, for a similar reason, but the basic mechanism is introduced in patch 9/10. Patch 10/10 is, for now, more a reference file than anything else, I used it in combination with the new capture script support in cam to test the AF state machine. It will certainly be part of lc-compliance in a near future, but right now, we miss some features (we can't pass span<> and we can't read back the values in the same format). Thanks for the comments, JM Jean-Michel Hautbois (10): ipa: raspberrypi: Introduce an autofocus algorithm libcamera: raspberrypi: Control the lens from pipeline ipa: raspberrypi: Control the lens position ipa: raspberrypi: Send the AF status back ipa: raspberrypi: Af: Add AfState ipa: raspberrypi: Add AfMode control ipa: raspberrypi: Introduce AfPause and AfPauseState ipa: raspberrypi: Introduce AfTrigger control ipa: raspberrypi: Set a constrained range test: af: Introduce a capture script test file include/libcamera/ipa/raspberrypi.h | 7 +- include/libcamera/ipa/raspberrypi.mojom | 1 + .../raspberrypi/controller/af_algorithm.hpp | 37 +++ src/ipa/raspberrypi/controller/af_status.h | 23 ++ src/ipa/raspberrypi/controller/iob/af.cpp | 254 ++++++++++++++++++ src/ipa/raspberrypi/controller/iob/af.h | 67 +++++ src/ipa/raspberrypi/meson.build | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 87 +++++- .../pipeline/raspberrypi/raspberrypi.cpp | 17 ++ test/af/af-state-machine.yaml | 46 ++++ 10 files changed, 538 insertions(+), 2 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/af_algorithm.hpp create mode 100644 src/ipa/raspberrypi/controller/af_status.h create mode 100644 src/ipa/raspberrypi/controller/iob/af.cpp create mode 100644 src/ipa/raspberrypi/controller/iob/af.h create mode 100644 test/af/af-state-machine.yaml