ipa: Look up IPA configurables in configuration file
This patch adds configuration options for environment variables used in
the IPA proxy.
The configuration snippet:
configuration:
ipa:
config_paths:
- config path 1
- config path 2
- ...
module_paths:
- module path 1
- module path 2
- ...
proxy_paths:
- proxy path 1
- proxy path 2
- ...
force_isolation: BOOL
LIBCAMERA_<IPA_NAME>_TUNING_FILE remains configurable only via the
environment variable; this is supposed to be used only for testing and
debugging and it's not clear what to do about IPA names like "rpi/vc4"
and "rpi/pisp" exactly.
There are two ways to pass the configuration to the places where it is
needed: Either to pass it as an argument to the method calls that need
it, or to pass it to the class constructors and extract the needed
configuration from there. This patch uses the second method as it is
less polluting the code.
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
17febd7bb3
commit
dcbde32f5e
@@ -17,6 +17,7 @@
|
||||
#include <libcamera/ipa/ipa_module_info.h>
|
||||
|
||||
#include "libcamera/internal/camera_manager.h"
|
||||
#include "libcamera/internal/global_configuration.h"
|
||||
#include "libcamera/internal/ipa_module.h"
|
||||
#include "libcamera/internal/pipeline_handler.h"
|
||||
#include "libcamera/internal/pub_key.h"
|
||||
@@ -28,7 +29,7 @@ LOG_DECLARE_CATEGORY(IPAManager)
|
||||
class IPAManager
|
||||
{
|
||||
public:
|
||||
IPAManager();
|
||||
IPAManager(const GlobalConfiguration &configuration);
|
||||
~IPAManager();
|
||||
|
||||
template<typename T>
|
||||
@@ -42,7 +43,8 @@ public:
|
||||
if (!m)
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<T> proxy = std::make_unique<T>(m, !self->isSignatureValid(m));
|
||||
const GlobalConfiguration &configuration = cm->_d()->configuration();
|
||||
std::unique_ptr<T> proxy = std::make_unique<T>(m, !self->isSignatureValid(m), configuration);
|
||||
if (!proxy->isValid()) {
|
||||
LOG(IPAManager, Error) << "Failed to load proxy";
|
||||
return nullptr;
|
||||
@@ -73,6 +75,7 @@ private:
|
||||
#if HAVE_IPA_PUBKEY
|
||||
static const uint8_t publicKeyData_[];
|
||||
static const PubKey pubKey_;
|
||||
bool forceIsolation_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -7,10 +7,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <libcamera/ipa/ipa_interface.h>
|
||||
|
||||
#include "libcamera/internal/global_configuration.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class IPAModule;
|
||||
@@ -24,7 +28,7 @@ public:
|
||||
ProxyRunning,
|
||||
};
|
||||
|
||||
IPAProxy(IPAModule *ipam);
|
||||
IPAProxy(IPAModule *ipam, const GlobalConfiguration &configuration);
|
||||
~IPAProxy();
|
||||
|
||||
bool isValid() const { return valid_; }
|
||||
@@ -40,6 +44,8 @@ protected:
|
||||
|
||||
private:
|
||||
IPAModule *ipam_;
|
||||
std::vector<std::string> configPaths_;
|
||||
std::vector<std::string> execPaths_;
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user