ipa: rkisp1: agc: Store per-frame information in frame context

Rework the algorithm's usage of the active state to store the value of
controls for the last queued request in the queueRequest() function, and
store a copy of the values in the corresponding frame context.

The frame context is used in the prepare() function to populate the ISP
parameters with values corresponding to the right frame.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart
2022-09-08 00:39:53 +03:00
parent b3724d3766
commit 310b7a6a30
5 changed files with 66 additions and 31 deletions
+28 -15
View File
@@ -104,16 +104,13 @@ namespace libcamera::ipa::rkisp1 {
* \var IPAActiveState::agc
* \brief State for the Automatic Gain Control algorithm
*
* The exposure and gain determined are expected to be applied to the sensor
* at the earliest opportunity.
* The exposure and gain are the latest values computed by the AGC algorithm.
*
* \var IPAActiveState::agc.exposure
* \brief Exposure time expressed as a number of lines
*
* \var IPAActiveState::agc.gain
* \brief Analogue gain multiplier
*
* The gain should be adapted to the sensor specific gain code before applying.
*/
/**
@@ -181,17 +178,6 @@ namespace libcamera::ipa::rkisp1 {
* \brief Indicates if ISP parameters need to be updated
*/
/**
* \var IPAActiveState::sensor
* \brief Effective sensor values
*
* \var IPAActiveState::sensor.exposure
* \brief Exposure time expressed as a number of lines
*
* \var IPAActiveState::sensor.gain
* \brief Analogue gain multiplier
*/
/**
* \struct IPAFrameContext
* \brief Per-frame context for algorithms
@@ -199,6 +185,33 @@ namespace libcamera::ipa::rkisp1 {
* \todo Populate the frame context for all algorithms
*/
/**
* \var IPAFrameContext::agc
* \brief Automatic Gain Control parameters for this frame
*
* The exposure and gain are provided by the AGC algorithm, and are to be
* applied to the sensor in order to take effect for this frame.
*
* \var IPAFrameContext::agc.exposure
* \brief Exposure time expressed as a number of lines
*
* \var IPAFrameContext::agc.gain
* \brief Analogue gain multiplier
*
* The gain should be adapted to the sensor specific gain code before applying.
*/
/**
* \var IPAFrameContext::sensor
* \brief Sensor configuration that used been used for this frame
*
* \var IPAFrameContext::sensor.exposure
* \brief Exposure time expressed as a number of lines
*
* \var IPAFrameContext::sensor.gain
* \brief Analogue gain multiplier
*/
/**
* \struct IPAContext
* \brief Global IPA context data shared between all algorithms