[PATCH v3 4/7] ipa: rkisp1: Add constructor to the ipa context

Stefan Klug stefan.klug at ideasonboard.com
Tue Oct 8 17:29:42 CEST 2024


Initialization using the initializer list is cumbersome and requires
modifications to the list whenever the context is modified. Fix that by
adding a proper constructor to the context.

Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/ipa/rkisp1/ipa_context.h | 5 +++++
 src/ipa/rkisp1/rkisp1.cpp    | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
index e274d9b01e1c..d52e73ad2503 100644
--- a/src/ipa/rkisp1/ipa_context.h
+++ b/src/ipa/rkisp1/ipa_context.h
@@ -180,6 +180,11 @@ struct IPAFrameContext : public FrameContext {
 };
 
 struct IPAContext {
+	IPAContext(unsigned int frameContextSize)
+		: hw(nullptr), frameContexts(frameContextSize)
+	{
+	}
+
 	const IPAHwSettings *hw;
 	IPACameraSensorInfo sensorInfo;
 	IPASessionConfiguration configuration;
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 9e161cabdea4..a579f21de56f 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -124,7 +124,7 @@ const ControlInfoMap::Map rkisp1Controls{
 } /* namespace */
 
 IPARkISP1::IPARkISP1()
-	: context_({ {}, {}, {}, {}, { kMaxFrameContexts }, {}, {} })
+	: context_(kMaxFrameContexts)
 {
 }
 
-- 
2.43.0



More information about the libcamera-devel mailing list