From patchwork Fri May 24 13:52:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 20097 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 40F2ABD87C for ; Fri, 24 May 2024 13:53:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 291CB634AC; Fri, 24 May 2024 15:53:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FucXFEm3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BFEC561A49 for ; Fri, 24 May 2024 15:53:00 +0200 (CEST) Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 719A69CE; Fri, 24 May 2024 15:52:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716558766; bh=64k5JTMW/sow+w0th+Ie81vmaywMX3vE69Fxtet592k=; h=From:To:Cc:Subject:Date:From; b=FucXFEm3+YM9H72l1RguWlGUPya4btK9n8F/0+jBIT+J4249I5KPVfsXz0NTqxb8R yKfyIOfdFT98kaatr0cjIMPtxH4S0yx1xPCZiEh4ycSAFrq6dWdvp+qAwlL07gy+II /ekpojYo9GrTCeAJusEcDJRWtB90ja+lDkBTgWdI= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH v2 0/2] libipa: Fix CameraSensorHelper gain helpers Date: Fri, 24 May 2024 14:52:54 +0100 Message-Id: <20240524135256.649406-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. The test is introduced first and marked as 'should_fail', which is subsequently updated with the fix. v2: - The test now only validates a single instance of each of the linear and exponential uses of the helpers. Kieran Bingham (2): test: ipa: libipa: Add CameraSensorHelper Gain Model tests libipa: camera_sensor_helper: Fix rounding of gainCode src/ipa/libipa/camera_sensor_helper.cpp | 6 +- test/ipa/camera_sensor_helper.cpp | 101 ++++++++++++++++++++++++ test/ipa/meson.build | 4 +- 3 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 test/ipa/camera_sensor_helper.cpp