From patchwork Wed Mar 26 08:00:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 23028 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 735F3C323E for ; Wed, 26 Mar 2025 08:00:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 89D9668955; Wed, 26 Mar 2025 09:00:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dpAbzls2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D85B6894B for ; Wed, 26 Mar 2025 09:00:44 +0100 (CET) Received: from neptunite.flets-east.jp (unknown [IPv6:2404:7a81:160:2100:7402:917d:ea0c:6d4c]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 79F853A4; Wed, 26 Mar 2025 08:58:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1742975936; bh=6aVKyIGRMPfY7WDiDxG4+gHyEbnSl+OdY8gUjWxzd6U=; h=From:To:Cc:Subject:Date:From; b=dpAbzls2gBKVQ3nRwPkv1cqDnPAtcfjbo/KH49hS8mdMw1VKR2N7z3F6xXGs6HZhJ 36c01gRfQ5jGuHozyTJWD/huUF5ngG0vg8p7lL0rt+/sfIm8k8ZQqE7b4T4yNF292A q10BmZOi7AReweh3m0TdeOJ31jiqJfLhVWzswIT4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH v2 0/3] libipa: Fix CameraSensorHelper gain helpers Date: Wed, 26 Mar 2025 17:00:30 +0900 Message-ID: <20250326080034.1733385-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 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" The CameraSensorHelper class provides helpers to simplify the descriptions of gain models of the sensors. This provides an implementation of converting a gain-code to a linear gain value, and a return calculation that converts a linear gain to a gain code. It could be expected that a gain value reported by the 'gain(code)' function should itself generate the same code when called into 'gainCode(gain)' but this is not the case. This series addresses this by correcting the rounding issue and adding a test to ensure all CameraSensorHelpers meet this expectation. Note that the test needs extended as it falsly identifies a failure in the ar0521 helper. v2 mainly recovers from bitrot. Kieran Bingham (3): ipa: libipa: Allow retrieving the name of a CameraSensorHelperFactory test: ipa: libipa: Add CameraSensorHelper Gain Model tests libipa: camera_sensor_helper: Fix rounding of gainCode src/ipa/libipa/camera_sensor_helper.cpp | 6 +-- src/ipa/libipa/camera_sensor_helper.h | 2 + test/ipa/camera_sensor_helper.cpp | 69 +++++++++++++++++++++++++ test/ipa/meson.build | 1 + 4 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 test/ipa/camera_sensor_helper.cpp