From patchwork Tue Apr 29 12:48:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac Scott X-Patchwork-Id: 23299 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by patchwork.libcamera.org (Postfix) with ESMTPS id 56752C327D for ; Tue, 29 Apr 2025 13:03:20 +0000 (UTC) Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B17C2AF for ; Tue, 29 Apr 2025 15:03:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745931794; bh=KbS3mukcgnOPMc4hFmFPVUJylIR4G9rs7QD+GbSrbAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Resent-From:Resent-To:From; b=s7VlSk58OYIqSIrM74o4iu0zvrEqUThJqlKDtj74r15iNiGG9XLS0icbGFBSCIoF8 Z2FKRsgpEjAVebesoZNOzR6A7TVH5KHdRh7IYNvy3GZI3vHh45ZoRT7/f6a3iE9XP4 NMo+eEy7cSRDSEN+Jj6aQ08omk48P0MeKNuYZ+DU= Delivered-To: kbingham@ideasonboard.com Received: from perceval.ideasonboard.com by perceval.ideasonboard.com with LMTP id kDGJN5DKEGgOLzgA4E0KoQ (envelope-from ) for ; Tue, 29 Apr 2025 14:48:16 +0200 Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by perceval.ideasonboard.com (Postfix) with ESMTPS id 5E4204CE; Tue, 29 Apr 2025 14:48:16 +0200 (CEST) Authentication-Results: perceval.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.a=rsa-sha256 header.s=mail header.b=Vfv18LO2; dkim-atps=neutral Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AA41B68ADB; Tue, 29 Apr 2025 14:48:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Vfv18LO2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C321617DC for ; Tue, 29 Apr 2025 14:48:17 +0200 (CEST) Received: from isaac-ThinkPad-T16-Gen-2.lan (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 82C07AF; Tue, 29 Apr 2025 14:48:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745930891; bh=KbS3mukcgnOPMc4hFmFPVUJylIR4G9rs7QD+GbSrbAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vfv18LO2BobyPHkKe3Iuk3ltjE5kncSOROMvveSRFZUMBdYfGDjjtW3AK4JIicfRP vxYu6YqySVsK+KCMECqd+2R4PfGFqtuMwdwsL2eOkiFnPyagGGd4Wov3C+1KbFUKmU VgR4oSPBmIDmnmLMWYAECidANgBg3Keu8m0C57WY= From: Isaac Scott To: libcamera devel Cc: Isaac Scott Subject: [PATCH 1/1] libipa: Allow disabling algorithms via the tuning file Date: Tue, 29 Apr 2025 13:48:06 +0100 Message-ID: <20250429124806.138056-2-isaac.scott@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250429124806.138056-1-isaac.scott@ideasonboard.com> References: <20250429124806.138056-1-isaac.scott@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" X-TUID: 4hdkPGZyiZG3 Resent-From: Kieran Bingham Resent-To: parsemail@patchwork.libcamera.org Allows the user to add "disabled" as a parameter in their tuning file, which lets them test disabling algorithms without having to delete them. Usage example: version: 1 algorithms: - Agc: disabled: AeMeteringMode: MeteringCentreWeighted: [ 0, 0, 0, 0, 0, 0, 6, 8, 6, 0, 0, 8, 16, 8, 0, 0, 6, 8, 6, 0, 0, 0, 0, 0, 0 ] MeteringSpot: [ 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 4, 16, 4, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0 ] MeteringMatrix: [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] AeExposureMode: This example will disable the Agc algorithm. Signed-off-by: Isaac Scott --- src/ipa/libipa/module.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h index 0fb51916..86cc382b 100644 --- a/src/ipa/libipa/module.h +++ b/src/ipa/libipa/module.h @@ -74,6 +74,13 @@ private: int createAlgorithm(Context &context, const YamlObject &data) { const auto &[name, algoData] = *data.asDict().begin(); + if (algoData.contains("disabled")) { + LOG(IPAModuleAlgo, Debug) + << "Algorithm " << name << " is disabled" + << " in the tuning file!"; + /* If we return an error code, the IPA does not work */ + return 0; + } std::unique_ptr> algo = createAlgorithm(name); if (!algo) { LOG(IPAModuleAlgo, Error)