From patchwork Fri Jun 28 10:47:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20478 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 54119BD87C for ; Fri, 28 Jun 2024 10:49:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E432F63364; Fri, 28 Jun 2024 12:49:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Ib6Ym3BJ"; 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 3E09763340 for ; Fri, 28 Jun 2024 12:49:33 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:82ab:924:d918:cd24]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AEB34735; Fri, 28 Jun 2024 12:49:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719571748; bh=CLYXQPoRxEl+zDFDgbyclQDFfyjNu9HG7EwsE7ZIWVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ib6Ym3BJNEFPZXkYTCcACPmUdy+NA977GyUkocmYG5j8xDKXOcKyjVOVVQ76her1i GSM+zfYEFhNQWCMyDLDIz///8RnSJlYJoYx1L64Nfgio7Wl1/0Bdc+ReOtmA7syqAl UMNZ/MJBPx0IC91pljgfanJ6wkeQSihdFLJbGuvw= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v2 19/25] libtuning: Add static module Date: Fri, 28 Jun 2024 12:47:12 +0200 Message-ID: <20240628104828.2928109-20-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240628104828.2928109-1-stefan.klug@ideasonboard.com> References: <20240628104828.2928109-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 --- 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