diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-04 16:47:44 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-05 08:53:59 +0100 |
commit | 9f1c38e2609cd8689aab901402188cd223c223b5 (patch) | |
tree | a4e50bc2b15aa755a7e7e7bd81cdb9438e0a8bb5 /src/ipa/ipu3 | |
parent | d2d27a85933e34b52fd16d39b6b10b7d9ada5fb9 (diff) |
ipa: ipu3: Move the ipu3_uapi_params
The ipu3_uapi_params are part of the IPA context referenced by the
algorithms.
Move the structure into the IPAContext directly and adapt existing
algorithm implementations.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3')
-rw-r--r-- | src/ipa/ipu3/ipa_context.h | 2 | ||||
-rw-r--r-- | src/ipa/ipu3/ipu3.cpp | 20 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index 6cf85524..5d717be5 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -20,7 +20,7 @@ struct IPAContext { const ipu3_uapi_stats_3a *stats; /* Output Parameters which will be written to the hardware */ - ipu3_uapi_params *params; + ipu3_uapi_params params; }; } /* namespace ipa::ipu3 */ diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index d37cdda7..1d89c28b 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -91,7 +91,6 @@ private: std::list<Algorithm> algorithms_; /* Local parameter storage */ - struct ipu3_uapi_params params_; struct ipu3_uapi_grid_config bdsGrid_; struct IPAContext context_; }; @@ -104,12 +103,6 @@ int IPAIPU3::init(const IPASettings &settings) return -ENODEV; } - /* - * This may require better linking, or it could simply be moved into the - * context structure entirely. (Moving it makes more sense) - */ - context_.params = ¶ms_; - initialiseAlgorithms(); return 0; @@ -211,14 +204,19 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo) defVBlank_ = itVBlank->second.def().get<int32_t>(); - params_ = {}; + /* Reset all the hardware settings */ + context_.params = {}; calculateBdsGrid(configInfo.bdsOutputSize); + /* + * Algorithms are responsible for initialising all parameter settings + * at configure time. + */ configureAlgorithms(); awbAlgo_ = std::make_unique<IPU3Awb>(); - awbAlgo_->initialise(params_, configInfo.bdsOutputSize, bdsGrid_); + awbAlgo_->initialise(context_.params, configInfo.bdsOutputSize, bdsGrid_); agcAlgo_ = std::make_unique<IPU3Agc>(); agcAlgo_->initialise(bdsGrid_, sensorInfo_); @@ -296,9 +294,9 @@ void IPAIPU3::processControls([[maybe_unused]] unsigned int frame, void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params) { if (agcAlgo_->updateControls()) - awbAlgo_->updateWbParameters(params_, agcAlgo_->gamma()); + awbAlgo_->updateWbParameters(context_.params, agcAlgo_->gamma()); - *params = params_; + *params = context_.params; IPU3Action op; op.op = ActionParamFilled; |