From patchwork Wed Jul 3 14:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20533 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 1EA7ABEFBE for ; Wed, 3 Jul 2024 14:18:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CD1D363376; Wed, 3 Jul 2024 16:18:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JavZuqVd"; 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 88E006336E for ; Wed, 3 Jul 2024 16:18:29 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:9263:c199:9587:576]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5EAB04CA; Wed, 3 Jul 2024 16:18:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720016281; bh=UrljjAhio6rU7Y4wHigmMab7p8CuYd+D8fkroZn46ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JavZuqVdeJHNb2Wn6XbI57YwxvVI6EIRWGLDLtKn1xmcYbKCbeJ7b6GZv8qGufwQh g5sV4D1YpYaar/+p7qFhqSvQTbZxl+MFdb0t6R5pRg/k6tjt4JlDf/LotW+mWqYqR0 QgZJrFhykB2yGqJSYaC0zJ8frovs7tpH7W2ePMkg= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Laurent Pinchart Subject: [PATCH v3 19/23] libtuning: Add static module Date: Wed, 3 Jul 2024 16:17:08 +0200 Message-ID: <20240703141726.252368-20-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240703141726.252368-1-stefan.klug@ideasonboard.com> References: <20240703141726.252368-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