From patchwork Fri Feb 23 15:59:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 19528 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 7E263BD80A for ; Fri, 23 Feb 2024 16:00:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B117D6285F; Fri, 23 Feb 2024 16:59:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I0uA/nrO"; 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 696DA61CA1 for ; Fri, 23 Feb 2024 16:59:58 +0100 (CET) Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E8F8A2E7; Fri, 23 Feb 2024 16:59:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1708703989; bh=vm5gwISBZr/Nr2Mzp3UDPCxER3FacWEwlEz5X9oQqdg=; h=From:To:Cc:Subject:Date:From; b=I0uA/nrOf3nBwpz/oRpuJzu1uDRm2LbEzHRrFnfXqzp+ai83gzQSIKPJjyfQ0zmGg +1wGymdlNJAr+pw1JkVDsMvqNf8verKH+QlIogMLE10LSmb56yuJyBf5GE/MNhAaFT +Cw/OwrUSqC0HyO8EWC68ez++XdO+EmY1oK7RvBE= From: Kieran Bingham To: libcamera devel Subject: [PATCH 0/3] libipa: Fix CameraSensorHelper gain helpers Date: Fri, 23 Feb 2024 15:59:51 +0000 Message-Id: <20240223155954.4139705-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 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. 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