From patchwork Fri Jul 5 14:41:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20608 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 CA03FBD87C for ; Fri, 5 Jul 2024 14:43:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3DF5F63377; Fri, 5 Jul 2024 16:43:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="sK+WUYD2"; dkim-atps=neutral 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 AF8A863370 for ; Fri, 5 Jul 2024 16:43:01 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:60b6:33a3:3a20:6030]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 25FCD4CC; Fri, 5 Jul 2024 16:42:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720190552; bh=r0co8nzlO1+0omMhGFlDG1pkntNR6Kw0koQXZpgHI/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sK+WUYD2/AzKwOsi7ZEf9uM6zfaDRwX23Nw3bk/RFoxMw4/IxaITV6p5rQz9T4fnl zifJM9u/jKvUSDPpk2dQtw7KFqId9ZUmb8H36OLNLrVK9SDcvcK2mgQWGWEyffB7au d804vqZr38LaXW6pCZNuYE9LXbMVbmvs3hd4U07U= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Laurent Pinchart , Paul Elder Subject: [PATCH v4 19/23] libtuning: Add static module Date: Fri, 5 Jul 2024 16:41:55 +0200 Message-ID: <20240705144209.418906-20-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705144209.418906-1-stefan.klug@ideasonboard.com> References: <20240705144209.418906-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" Add a static module class, that can be used to add static data to the tuning file. This is propably not the best solution, but allows us to progress without writing lots of dummy classes for static cases. Signed-off-by: Stefan Klug Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- utils/tuning/libtuning/modules/static.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 utils/tuning/libtuning/modules/static.py diff --git a/utils/tuning/libtuning/modules/static.py b/utils/tuning/libtuning/modules/static.py new file mode 100644 index 000000000000..4d0f7e18c24e --- /dev/null +++ b/utils/tuning/libtuning/modules/static.py @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2024, Ideas on Board +# +# Module implementation for static data + +from .module import Module + + +# This module can be used in cases where the tuning file should contain +# static data. +class StaticModule(Module): + def __init__(self, out_name: str, output: dict = {}): + super().__init__() + self.out_name = out_name + self.hr_name = f'Static {out_name}' + self.type = f'static_{out_name}' + self.output = output + + def validate_config(self, config: dict) -> bool: + return True + + def process(self, config: dict, images: list, outputs: dict) -> dict: + return self.output