From a6de9030893753e5428ee912fe7c52fbf93febd1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 27 Apr 2020 02:36:18 +0300 Subject: ipa: Pass IPA initialization settings to IPAInterface::init() Add a new IPASettings class to pass IPA initialization settings through the IPAInterface::init() method. The settings currently only contain the name of a configuration file, and are expected to be extended later. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/ipa/libipa/ipa_interface_wrapper.cpp | 8 ++++++-- src/ipa/libipa/ipa_interface_wrapper.h | 3 ++- src/ipa/rkisp1/rkisp1.cpp | 2 +- src/ipa/vimc/vimc.cpp | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/ipa') diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp index f50f93a0..9596cb20 100644 --- a/src/ipa/libipa/ipa_interface_wrapper.cpp +++ b/src/ipa/libipa/ipa_interface_wrapper.cpp @@ -79,11 +79,15 @@ void *IPAInterfaceWrapper::get_interface(struct ipa_context *_ctx) return ctx->ipa_.get(); } -void IPAInterfaceWrapper::init(struct ipa_context *_ctx) +void IPAInterfaceWrapper::init(struct ipa_context *_ctx, + const struct ipa_settings *settings) { IPAInterfaceWrapper *ctx = static_cast(_ctx); - ctx->ipa_->init(); + IPASettings ipaSettings{ + .configurationFile = settings->configuration_file + }; + ctx->ipa_->init(ipaSettings); } int IPAInterfaceWrapper::start(struct ipa_context *_ctx) diff --git a/src/ipa/libipa/ipa_interface_wrapper.h b/src/ipa/libipa/ipa_interface_wrapper.h index e4bc6dd4..78ccf0f5 100644 --- a/src/ipa/libipa/ipa_interface_wrapper.h +++ b/src/ipa/libipa/ipa_interface_wrapper.h @@ -23,7 +23,8 @@ public: private: static void destroy(struct ipa_context *ctx); static void *get_interface(struct ipa_context *ctx); - static void init(struct ipa_context *ctx); + static void init(struct ipa_context *ctx, + const struct ipa_settings *settings); static int start(struct ipa_context *ctx); static void stop(struct ipa_context *ctx); static void register_callbacks(struct ipa_context *ctx, diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 7f0ffb0a..9a347e52 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -32,7 +32,7 @@ LOG_DEFINE_CATEGORY(IPARkISP1) class IPARkISP1 : public IPAInterface { public: - int init() override { return 0; } + int init(const IPASettings &settings) override { return 0; } int start() override { return 0; } void stop() override {} diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index cfdbd6f9..e6bda8ec 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -31,7 +31,7 @@ public: IPAVimc(); ~IPAVimc(); - int init() override; + int init(const IPASettings &settings) override; int start() override; void stop() override; @@ -61,7 +61,7 @@ IPAVimc::~IPAVimc() ::close(fd_); } -int IPAVimc::init() +int IPAVimc::init(const IPASettings &settings) { trace(IPAOperationInit); -- cgit v1.2.1