[v2,0/2] libipa: Fix CameraSensorHelper gain helpers
mbox series

Message ID 20240524135256.649406-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • libipa: Fix CameraSensorHelper gain helpers
Related show

Message

Kieran Bingham May 24, 2024, 1:52 p.m. UTC
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