summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/camera_sensor_helper.cpp
AgeCommit message (Collapse)Author
2021-11-29libipa: Correct IMX219 in CameraSensorHelperJean-Michel Hautbois
The equation is badly reported in the CameraSensorHelper, as m1 and c0 are inverted. Correct it to have a proper gain calculation. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-08-09libcamera: Rename 'method' to 'function'Laurent Pinchart
Usage of 'method' to refer to member functions comes from Java. The C++ standard uses the term 'function' only. Replace 'method' with 'function' or 'member function' through the whole code base and documentation. While at it, fix two typos (s/backeng/backend/). The BoundMethod and Object::invokeMethod() are left as-is here, and will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-25libipa: Add CameraSensorHelper for ov8865Daniel Scally
Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned from the datasheet; the lowest 7 bits are reported there as fractional bits, so real gain is val/128. Signed-off-by: Daniel Scally <djrscally@gmail.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-23libipa: Add CameraSensorHelper for IMX258Umang Jain
Extend the CameraSensorHelper factory with support for the IMX258 sensor found in the Nautilus Chromebook. The values are read by manually tweaking the IMX258 kernel driver. The IMX258 kernel driver hints that the sensor may be compatible with the MIPI CCS specification, as the register set matches. The values for analog gain constants are obtained by reading the register indexes, corresponding to the analog gain constants, as mentioned in MIPI CCS v1.1 specification. The values have further been confirmed by Dave Stevenson as being those specified in the datasheet. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-15libipa: Correct OV5670 CameraSensorHelper gain valuesJean-Michel Hautbois
The datasheet states that the low 7 bits are fraction bits. real_gain = GainCode/128 For example, 0x080 is 1x gain, 0x100 is 2x gain. It means that we should have m0=1 and c1=128. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-15libipa: Add CameraSensorHelper for OV13858Jean-Michel Hautbois
Extend the CameraSensorHelper factory with support for an OV13858 sensor as found in the Soraka Chromebook. The datasheet states that low 7 bits are fraction bits, so the gain is calculated as gainCode=128*gain. According to the formula, it means m0=1 and c1=128. m1 then has to be 0, and c0=0. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-09ipa: libipa: Fixups in CameraSensorHelpersJean-Michel Hautbois
A few lines needed to be wrapped under 80 lines. Remove some unneeded documentation and minor typos. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-06-28ipa: Create a camera sensor helper classJean-Michel Hautbois
For various sensor operations, it may be needed to do sensor specific computations, like analogue gain or vertical blanking. This commit introduces a new camera sensor helper in libipa which aims to solve this specific issue. It is based on the MIPI alliance Specification for Camera Command Set and implements, for now, only the analogue "Global gain" mode. Setting analogue gain for a specific sensor is not a straightforward operation, as one needs to know how the gain is calculated for it. Three helpers are created in this patch: imx219, ov5670 and ov5693. Adding a new sensor is pretty straightforward as one only needs to implement the sub-class for it and register that class to the CameraSensorHelperFactory. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>