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:
Milan Zamazal
2025-09-12 16:29:06 +02:00
committed by Laurent Pinchart
parent 17febd7bb3
commit dcbde32f5e
7 changed files with 67 additions and 53 deletions

View File

@@ -45,8 +45,8 @@ namespace {{ns}} {
{% endfor %}
{%- endif %}
{{proxy_name}}::{{proxy_name}}(IPAModule *ipam, bool isolate)
: IPAProxy(ipam), isolate_(isolate),
{{proxy_name}}::{{proxy_name}}(IPAModule *ipam, bool isolate, const GlobalConfiguration &configuration)
: IPAProxy(ipam, configuration), isolate_(isolate),
controlSerializer_(ControlSerializer::Role::Proxy), seq_(0)
{
LOG(IPAProxy, Debug)

View File

@@ -37,7 +37,7 @@ namespace {{ns}} {
class {{proxy_name}} : public IPAProxy, public {{interface_name}}, public Object
{
public:
{{proxy_name}}(IPAModule *ipam, bool isolate);
{{proxy_name}}(IPAModule *ipam, bool isolate, const GlobalConfiguration &configuration);
~{{proxy_name}}();
{% for method in interface_main.methods %}