summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/rkisp1.cpp
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>2021-06-21 16:59:47 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-07-22 14:38:44 +0200
commitab4932f87dd363c04c70887d57f0e36a2a59c5a6 (patch)
treeb07e620838cd8642c265dea9b34558ae2fb5c417 /src/ipa/rkisp1/rkisp1.cpp
parent5468048b68a96307e58a27878e62faf53f43c835 (diff)
ipa: rkisp1: Add support for V12 isp blocks
Some values for array sizes differ between v10 and v12, so set them in init() and adjust the auto exposure algorithm to the ae value from there. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/ipa/rkisp1/rkisp1.cpp')
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index b881d42e..06fb9640 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -66,12 +66,31 @@ private:
uint32_t gain_;
uint32_t minGain_;
uint32_t maxGain_;
+
+ /* revision-specific data */
+ unsigned int hwAeMeanMax_;
+ unsigned int hwHistBinNMax_;
+ unsigned int hwGammaOutMaxSamples_;
+ unsigned int hwHistogramWeightGridsSize_;
};
int IPARkISP1::init(unsigned int hwRevision)
{
/* \todo Add support for other revisions */
- if (hwRevision != RKISP1_V10) {
+ switch (hwRevision) {
+ case RKISP1_V10:
+ hwAeMeanMax_ = RKISP1_CIF_ISP_AE_MEAN_MAX_V10;
+ hwHistBinNMax_ = RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10;
+ hwGammaOutMaxSamples_ = RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10;
+ hwHistogramWeightGridsSize_ = RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10;
+ break;
+ case RKISP1_V12:
+ hwAeMeanMax_ = RKISP1_CIF_ISP_AE_MEAN_MAX_V12;
+ hwHistBinNMax_ = RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12;
+ hwGammaOutMaxSamples_ = RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12;
+ hwHistogramWeightGridsSize_ = RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12;
+ break;
+ default:
LOG(IPARkISP1, Error)
<< "Hardware revision " << hwRevision
<< " is currently not supported";
@@ -236,7 +255,7 @@ void IPARkISP1::updateStatistics(unsigned int frame,
unsigned int value = 0;
unsigned int num = 0;
- for (int i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX_V10; i++) {
+ for (unsigned int i = 0; i < hwAeMeanMax_; i++) {
if (ae->exp_mean[i] <= 15)
continue;