From patchwork Thu Nov 24 11:38:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17880 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 C14ECBE08B for ; Thu, 24 Nov 2022 11:39:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8CF4E6331E; Thu, 24 Nov 2022 12:39:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669289944; bh=GNpywXg/yKexz4YE18N9donLS2yBn68Rnq+bjYOsli0=; 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=yqnvgLx36oLlPb73NLHOlyLmtloNErnuHg0cEgWybiirYawvaSW+1wgXaJYFiNfJt p1TbQLbyg0L/3iuUjSUdh9554jMrk/cSjnx3uSH85iUD1A5GDzU/cC+r96ilRnpFGl y06Q3UGgwV3Swct8YePfiB+yVoNgxLj3x5pJC0VTuwpZdK82n0F4OOXaqPpyTC1ZCk VGYdSY9i7lt8bv8zaleVmJ6nkODXpaVjCIzT+GQiDXUuT0KqTQ3hsc2qCEDRk2aety pl58Hb+q2vDKo1rNXxHtomJgUt3PE/AZDlAiKLcyWP8TsyaAY7tcxKjL7BmdYIAX52 E2rNDu0EnNXtQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5543C63313 for ; Thu, 24 Nov 2022 12:39:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="feIdwJG3"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1EF34496; Thu, 24 Nov 2022 12:39:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669289942; bh=GNpywXg/yKexz4YE18N9donLS2yBn68Rnq+bjYOsli0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=feIdwJG3IMsjHZEIdUFh9BbJ5PivlS/ZRQg+F2+A/k56Sr8BOk5Si6UFOtUq6HZoA hq8AApdXi1Fq5vXH5kISX1xj06RtNNAXoe9xw5tW5tHt9et6Tc88TUFw2LSAoS5ly7 MU3r5CxxH688VVK6p7rCiaQezQ+JUgInIn0N+Hwo= To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 20:38:44 +0900 Message-Id: <20221124113849.2193579-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221124113849.2193579-1-paul.elder@ideasonboard.com> References: <20221124113849.2193579-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/6] utils: libtuning: module: Prepare per-module debugging infrastructure 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" Prepare for per-module debugging infrastructure in the base Module class. The debug parameter will be provided from a command line argument as opposed to from the tuning script as was originally planned. Remove the debug parameter from the LSC constructor (it is the only module that we have so far). As the debug parameter currently does not do anything, no regression is introduced. Update the tuning scripts accordingly. Signed-off-by: Paul Elder Reviewed-by: Daniel Scally --- utils/tuning/libtuning/modules/lsc/lsc.py | 3 --- utils/tuning/libtuning/modules/module.py | 6 ++++++ utils/tuning/raspberrypi/alsc.py | 1 - utils/tuning/rkisp1.py | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/tuning/libtuning/modules/lsc/lsc.py b/utils/tuning/libtuning/modules/lsc/lsc.py index 344a07a3..f54ca8be 100644 --- a/utils/tuning/libtuning/modules/lsc/lsc.py +++ b/utils/tuning/libtuning/modules/lsc/lsc.py @@ -17,7 +17,6 @@ class LSC(Module): out_name = 'GenericLSC' def __init__(self, *, - debug: list, sector_shape: tuple, sector_x_gradient: lt.Gradient, sector_y_gradient: lt.Gradient, @@ -25,8 +24,6 @@ class LSC(Module): smoothing_function: lt.Smoothing): super().__init__() - self.debug = debug - self.sector_shape = sector_shape self.sector_x_gradient = sector_x_gradient self.sector_y_gradient = sector_y_gradient diff --git a/utils/tuning/libtuning/modules/module.py b/utils/tuning/libtuning/modules/module.py index 12e2fc7c..b4ad0625 100644 --- a/utils/tuning/libtuning/modules/module.py +++ b/utils/tuning/libtuning/modules/module.py @@ -4,6 +4,8 @@ # # module.py - Base class for algorithm-specific tuning modules +from pathlib import Path + # @var type Type of the module. Defined in the base module. # @var out_name The key that will be used for the algorithm in the algorithms @@ -15,8 +17,12 @@ class Module(object): out_name = 'GenericAlgorithm' def __init__(self): + self.debug = None pass + def enable_debug(self, output_dir: Path): + self.debug = output_dir + def validate_config(self, config: dict) -> bool: raise NotImplementedError diff --git a/utils/tuning/raspberrypi/alsc.py b/utils/tuning/raspberrypi/alsc.py index 024eb5a3..4dc5f5ba 100644 --- a/utils/tuning/raspberrypi/alsc.py +++ b/utils/tuning/raspberrypi/alsc.py @@ -10,7 +10,6 @@ from libtuning.modules.lsc import ALSCRaspberryPi ALSC = \ ALSCRaspberryPi(do_color=lt.Param('do_alsc_colour', lt.Param.Mode.Optional, True), luminance_strength=lt.Param('luminance_strength', lt.Param.Mode.Optional, 0.5), - debug=[lt.Debug.Plot], sector_shape=(16, 12), sector_x_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), sector_y_gradient=lt.gradient.Linear(lt.Remainder.DistributeFront), diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py index 1cea6ddb..43b4b190 100755 --- a/utils/tuning/rkisp1.py +++ b/utils/tuning/rkisp1.py @@ -14,7 +14,6 @@ from libtuning.modules.lsc import LSCRkISP1 tuner = lt.Tuner('RkISP1') tuner.add(LSCRkISP1( - debug=[lt.Debug.Plot], # This is for the actual LSC tuning, and is part of the base LSC # module. rkisp1's table sector sizes (16x16 programmed as mirrored # 8x8) are separate, and is hardcoded in its specific LSC tuning