From patchwork Mon Jun 20 01:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16270 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 D4A51BE173 for ; Mon, 20 Jun 2022 01:43:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C4E3665638; Mon, 20 Jun 2022 03:43:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655689406; bh=SY01/qcK77sPL8sMx9RD8z2f82SPtk8HdhVjLenJ8BQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ih4VYj+nDJAP3lNxEmBRygPTTndojmz4ASMR7IA2XADTUKcDaihI+VdC505k+LA2F Vml9+iLPTgdoI55M3BK+WkHB+4bn4O8kkyhTSEp39UXOu/Ypbaxg/imMfANWuSkpMN Ea1mQMcqadIaLATi0sSPFwmWO1GZKYfS4n6PvRrOw8LL70VwZDZV2NqyDSb3lkJ73s xrwbCvDQH4zSj7ApWw01falbrmU4U9EG8Lz+FJOJ8yGDapsldgU5CW0zq2vDvEUhQx 9D1fe1tcfdsASzsvF3IzqvfwbkBP+gSqI100yh5LO3xLW5FdzSorLERe9L1G2dnH5P Npv1bzTigX/9A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 19BF6601EE for ; Mon, 20 Jun 2022 03:43:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SeP0Hxux"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5AB7E25E; Mon, 20 Jun 2022 03:43:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655689404; bh=SY01/qcK77sPL8sMx9RD8z2f82SPtk8HdhVjLenJ8BQ=; h=From:To:Cc:Subject:Date:From; b=SeP0Hxuxwy+vG6wmTySD7e79JtzlYKfoFPJZ0g0KmDjedh50rpTEQ9lIYuuUDGb8Y EhrH1+MRIfR1Djh8e39aSL9+SO1tEbFfmp+7KZw1oYWBUqr7XKANM1gxWhQ8wVVZOJ neNmZ1DILv/2MB1y7YDPajZGe4ic69BINOhyc6c4= To: libcamera-devel@lists.libcamera.org Date: Mon, 20 Jun 2022 04:42:53 +0300 Message-Id: <20220620014305.26778-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 00/12] Add tuning file support for the RkISP1 IPA module 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series is a new version of Florian's "[PATCH v3 0/5] Add tuning file support for rkisp1 blc algo". The first 6 patches address an issue with v3 that stemmed from the new YAML file format, using ordered mappings. As ordered mappings can't be indexed by key, the retrieval of algorithm data by each algorithm got broken. Instead of trying to fix that issue, I decided to bite the bullet and make the algorithms dynamically instantiable, like done in the RPi IPA. To support this without duplicating too much code in different IPA modules, patch 01/12 introduces a Module class template for IPA modules. Patch 02/12 then cleans up documentation a little bit, and patch 03/12 adds an algorithm registration mechanism. Patch 04/12 extends the Algorithm class with an init() function to parse the tuning data for the algorithm, and patch 05/12 supports dynamic instantiation of algorithms from YAML in the Module class. Patch 06/12 is a small debugging improvement. The rest of the series is similar to v3, with patch 07/12 that implements tuning file selection in the RkISP1 pipeline handler. Patch 08/12 then enables algorithm registration in the RkISP1 IPA module, and patch 09/12 implements tuning data parsing in the IPA. Patch 10/12 is new and adds a tuning file for the IMX219, while patches 11/12 and 12/12 are similar to v3 (with the changes required by the rework of the rest of the series). Changes to patches present in v3 are described in individual patches. I'm tempted to merge the src/ipa/${ipa}/algorithms/algorithm.h file with src/ipa/${ipa}/module.h, as the Algorithm and Module class are very related, and both files are very small. Feedback would be appreciated. Florian Sylvestre (5): ipa: libipa: algorithm: Add init() function to the Algorithm class pipeline: rkisp1: Support IPA tuning file ipa: rkisp1: Add YAML tuning file support ipa: rkisp1: Add OV5640 tuning file ipa: rkisp1: Add support of Black Level Correction tuning Laurent Pinchart (7): ipa: libipa: Introduce a Module class template ipa: libipa: Move ipa namespace documentation to module.cpp ipa: libipa: algorithm: Add an algorithm registration mechanism ipa: libipa: module: Add support for instantiation from YAML ipa: libipa: module: Make the Module class Loggable ipa: rkisp1: Register algorithms ipa: rkisp1: Add IMX219 tuning file src/ipa/ipu3/algorithms/algorithm.h | 8 +- src/ipa/ipu3/module.h | 27 +++++ src/ipa/libipa/algorithm.cpp | 87 ++++++++++++++-- src/ipa/libipa/algorithm.h | 64 ++++++++++-- src/ipa/libipa/libipa.cpp | 22 ---- src/ipa/libipa/meson.build | 6 +- src/ipa/libipa/module.cpp | 126 +++++++++++++++++++++++ src/ipa/libipa/module.h | 124 ++++++++++++++++++++++ src/ipa/rkisp1/algorithms/agc.cpp | 2 + src/ipa/rkisp1/algorithms/algorithm.h | 10 +- src/ipa/rkisp1/algorithms/awb.cpp | 2 + src/ipa/rkisp1/algorithms/blc.cpp | 51 +++++++-- src/ipa/rkisp1/algorithms/blc.h | 10 +- src/ipa/rkisp1/data/imx219.yaml | 13 +++ src/ipa/rkisp1/data/meson.build | 10 ++ src/ipa/rkisp1/data/ov5640.yaml | 13 +++ src/ipa/rkisp1/data/uncalibrated.yaml | 8 ++ src/ipa/rkisp1/meson.build | 1 + src/ipa/rkisp1/module.h | 27 +++++ src/ipa/rkisp1/rkisp1.cpp | 54 +++++++--- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 20 +++- 21 files changed, 608 insertions(+), 77 deletions(-) create mode 100644 src/ipa/ipu3/module.h delete mode 100644 src/ipa/libipa/libipa.cpp create mode 100644 src/ipa/libipa/module.cpp create mode 100644 src/ipa/libipa/module.h create mode 100644 src/ipa/rkisp1/data/imx219.yaml create mode 100644 src/ipa/rkisp1/data/meson.build create mode 100644 src/ipa/rkisp1/data/ov5640.yaml create mode 100644 src/ipa/rkisp1/data/uncalibrated.yaml create mode 100644 src/ipa/rkisp1/module.h