From patchwork Sat Oct 22 06:23:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17661 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 35D71C327C for ; Sat, 22 Oct 2022 06:23:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A89C262EEC; Sat, 22 Oct 2022 08:23:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666419821; bh=okeMoeWqj1EblqU83DqjMjkYekp8+PSq3UnXEZT98fo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uo0fpgJOcRRrU+Zk9868go8qVAixnrutDOK1B1o/Tno/cpkzI40RR77hhHm7At0CN lySX2e2heQ9E4YPrJVw8R9vlPtTQGBzjK/t1NYDFhXmyw9WcfC1h/KATWXBntqulR5 A9fvNGYCxGDdV6vIL7Q0zPHuzKqi5joVC58ooaJyo0NNv4s96SyF/pCmeZ/A+MR/Eg 9PsKGeIRFn8oRjKxi4p0U8FEEYNM2adP3bnHEncYtlanciPLQ5xKJQWUo3DEXeVyHO sRR9CCQG7k1fU1pp5hezskrycoyhuwRzH1+mcIhJ5ivI4OuqREakLI4tnaqBBhHyb9 LI6d0SIrJcCsA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A68FE62EC6 for ; Sat, 22 Oct 2022 08:23:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JkwzhaG8"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 55E7A106; Sat, 22 Oct 2022 08:23:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1666419818; bh=okeMoeWqj1EblqU83DqjMjkYekp8+PSq3UnXEZT98fo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkwzhaG8xaD5Yptpv8OnJ6YTPRzQdyAhQ4Pizwb1F7XIvZCg6CFy3LQmG+TTcXDyB h0U/34oYodnKmBPHYUIUDsQ85wJ6xP90u7/0bJCn7f0oLi8puGvSNm6OrENQQCZ29Y nvpNF15YWcGJSR4Y6mJOQHQ7iLR5mOO57301VJUE= To: libcamera-devel@lists.libcamera.org Date: Sat, 22 Oct 2022 15:23:09 +0900 Message-Id: <20221022062310.2545463-11-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221022062310.2545463-1-paul.elder@ideasonboard.com> References: <20221022062310.2545463-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 10/11] [DNI] utils: tuning: Add full libtuning raspberrypi tuning script 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a tuning script for raspberrypi that uses libtuning. This reproduces what ctt does (albeit with less logging for now), but with common components factored out into libtuning so that tuning scripts for other platforms can reuse them. Signed-off-by: Paul Elder --- Changes in v2: - add SPDX and copyright This is incomplete, hence the DNI. --- utils/tuning/raspberrypi.py | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 utils/tuning/raspberrypi.py diff --git a/utils/tuning/raspberrypi.py b/utils/tuning/raspberrypi.py new file mode 100644 index 00000000..8e963743 --- /dev/null +++ b/utils/tuning/raspberrypi.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2022, Paul Elder +# +# raspberrypi.py - Tuning script for raspberrypi + +import sys + +import libtuning as lt +from libtuning.modules import AWB +from libtuning.parsers import RaspberryPiParser +from libtuning.generators import RaspberryPiOutput + +from raspberrypi.alsc import ALSC + +tuner = lt.Camera('Raspberry Pi') + +# These modules can also be custom modules. libtuning will come with utilities +# for handling stuff like images, so there shouldn't be too much boilerplate +# involved in creating custom modules, though I don't yet have a concrete +# vision on how custom implementations of modules would look. +tuner.add(ALSC) + +# Other tuning modules can be added like so. +# The order that the tuning modules will be executed is determined by the order +# that they're added. +# This is kind of an implementation detail, but the "context" is saved +# internally in lt.Camera, so modules that are added (and therefore executed) +# later can use the output of the previous modules. I'm thinking that a module +# that depends on values from another module has two modes of execution, for +# when those values are available and another for when they're not. Not quite +# sure concretely how to handle this yet. +tuner.add(AWB( # module parameters +)) + +tuner.setInputType(RaspberryPiParser) +tuner.setOutputType(RaspberryPiOutput) + +# The order of the output doesn't necessarily have to be the same as the order +# of input, which is specified by the order of adding the modules above. +tuner.setOutputOrder([AWB, ALSC]) + +tuner.run(sys.argv)