libtuning: Add static module
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 <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
8e411bfaef
commit
9eb26a8716
1 changed files with 24 additions and 0 deletions
24
utils/tuning/libtuning/modules/static.py
Normal file
24
utils/tuning/libtuning/modules/static.py
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue