summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-19 11:13:34 +0100
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-29 20:41:38 +0100
commitaf7f70b69ac9c8127e14557a8f2d9618a054da59 (patch)
treedb681bcfdc16699a4570ca34327cf71da7c74c6b
parent431749b399dd689890300b6cbc9b6305801bfd1b (diff)
ipa: rkisp1: agc: Introduce HW revision in IPAContext
The ISP can use 25 or 81 cells depending on its revision. Remove the cached value in IPARkISP1 and use IPASessionConfiguration to store it and pass it to AGC later. 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>
-rw-r--r--src/ipa/rkisp1/ipa_context.cpp8
-rw-r--r--src/ipa/rkisp1/ipa_context.h5
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp7
3 files changed, 20 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp
index 819b2c73..6b53dfdf 100644
--- a/src/ipa/rkisp1/ipa_context.cpp
+++ b/src/ipa/rkisp1/ipa_context.cpp
@@ -55,4 +55,12 @@ namespace libcamera::ipa::rkisp1 {
* are run. This needs to be turned into real per-frame data storage.
*/
+/**
+ * \var IPASessionConfiguration::hw
+ * \brief RkISP1-specific hardware information
+ *
+ * \var IPASessionConfiguration::hw.revision
+ * \brief Hardware revision of the ISP
+ */
+
} /* namespace libcamera::ipa::rkisp1 */
diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
index 919139dd..9342025b 100644
--- a/src/ipa/rkisp1/ipa_context.h
+++ b/src/ipa/rkisp1/ipa_context.h
@@ -8,11 +8,16 @@
#pragma once
+#include <linux/rkisp1-config.h>
+
namespace libcamera {
namespace ipa::rkisp1 {
struct IPASessionConfiguration {
+ struct {
+ rkisp1_cif_isp_version revision;
+ } hw;
};
struct IPAFrameContext {
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 2b073258..59676a70 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -74,6 +74,7 @@ private:
uint32_t maxGain_;
/* revision-specific data */
+ rkisp1_cif_isp_version hwRevision_;
unsigned int hwAeMeanMax_;
unsigned int hwHistBinNMax_;
unsigned int hwGammaOutMaxSamples_;
@@ -114,6 +115,9 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision)
LOG(IPARkISP1, Debug) << "Hardware revision is " << hwRevision;
+ /* Cache the value to set it in configure. */
+ hwRevision_ = static_cast<rkisp1_cif_isp_version>(hwRevision);
+
camHelper_ = CameraSensorHelperFactory::create(settings.sensorModel);
if (!camHelper_) {
LOG(IPARkISP1, Error)
@@ -176,6 +180,9 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,
/* Clean context at configuration */
context_ = {};
+ /* Set the hardware revision for the algorithms. */
+ context_.configuration.hw.revision = hwRevision_;
+
return 0;
}