summaryrefslogtreecommitdiff
path: root/src/ipa
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-18 14:39:50 +0100
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-29 20:41:37 +0100
commitc2da6aab2154731c539eb645e02df4505843010d (patch)
treeea21e0074caef747e5c1777a6080ffab309335e2 /src/ipa
parented1cb19e7657b888bea6b66b6d409302b4bf4f25 (diff)
ipa: rkisp1: Instantiate CameraSensorHelper
When the AGC will run, it will use analogue gains as double values. We will need those values to be converted to apply the control. Introduce CameraSensorHelper and call it at init(). 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>
Diffstat (limited to 'src/ipa')
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 910ad952..73a7f582 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -25,6 +25,8 @@
#include <libcamera/internal/mapped_framebuffer.h>
+#include "libipa/camera_sensor_helper.h"
+
namespace libcamera {
LOG_DEFINE_CATEGORY(IPARkISP1)
@@ -73,10 +75,12 @@ private:
unsigned int hwHistBinNMax_;
unsigned int hwGammaOutMaxSamples_;
unsigned int hwHistogramWeightGridsSize_;
+
+ /* Interface to the Camera Helper */
+ std::unique_ptr<CameraSensorHelper> camHelper_;
};
-int IPARkISP1::init([[maybe_unused]] const IPASettings &settings,
- unsigned int hwRevision)
+int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision)
{
/* \todo Add support for other revisions */
switch (hwRevision) {
@@ -100,6 +104,15 @@ int IPARkISP1::init([[maybe_unused]] const IPASettings &settings,
}
LOG(IPARkISP1, Debug) << "Hardware revision is " << hwRevision;
+
+ camHelper_ = CameraSensorHelperFactory::create(settings.sensorModel);
+ if (!camHelper_) {
+ LOG(IPARkISP1, Error)
+ << "Failed to create camera sensor helper for "
+ << settings.sensorModel;
+ return -ENODEV;
+ }
+
return 0;
}