[libcamera-devel] [PATCH v1 4/6] meson: Add a configuration option to build IPAs

Umang Jain umang.jain at ideasonboard.com
Fri May 14 09:58:06 CEST 2021


There can be multiple IPAs per pipeline-handler or platform.
For e.g., the IPU3 platform has a open source IPA in-tree whereas
it shall use a closed source one from a standalone separate remote
for ChromeOS. In a case like this, there should be configure-time
option whether to build the in-tree IPAs or not.

By default, all in-tree IPAs are built.

Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 meson.build                     | 1 +
 meson_options.txt               | 5 +++++
 src/ipa/ipu3/meson.build        | 4 ++++
 src/ipa/meson.build             | 2 ++
 src/ipa/raspberrypi/meson.build | 4 ++++
 src/ipa/rkisp1/meson.build      | 4 ++++
 src/ipa/vimc/meson.build        | 4 ++++
 7 files changed, 24 insertions(+)

diff --git a/meson.build b/meson.build
index fa2a62cf..b89797f3 100644
--- a/meson.build
+++ b/meson.build
@@ -167,6 +167,7 @@ py_mod.find_installation('python3', modules: py_modules)
 ## Summarise Configurations
 summary({
             'Enabled pipelines': pipelines,
+            'Enabled IPAs': ipas,
             'Android support': android_enabled,
             'GStreamer support': gst_enabled,
             'V4L2 emulation support': v4l2_enabled,
diff --git a/meson_options.txt b/meson_options.txt
index 69f11f85..1fcbecc1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -25,6 +25,11 @@ option('gstreamer',
         value : 'auto',
         description : 'Compile libcamera GStreamer plugin')
 
+option('ipas',
+        type : 'array',
+        choices : ['ipu3', 'raspberrypi', 'rkisp1', 'vimc'],
+        description : 'Select which internal IPA to include')
+
 option('lc-compliance',
         type : 'feature',
         value : 'auto',
diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build
index 0d843846..a9f5d0aa 100644
--- a/src/ipa/ipu3/meson.build
+++ b/src/ipa/ipu3/meson.build
@@ -2,6 +2,10 @@
 
 ipa_name = 'ipa_ipu3'
 
+if 'ipu3' not in ipas
+    subdir_done()
+endif
+
 ipu3_ipa_sources = files([
     'ipu3.cpp',
     'ipu3_agc.cpp',
diff --git a/src/ipa/meson.build b/src/ipa/meson.build
index 5b5684a1..fb687497 100644
--- a/src/ipa/meson.build
+++ b/src/ipa/meson.build
@@ -22,6 +22,8 @@ ipa_sign = files('ipa-sign.sh')
 ipas = ['ipu3', 'raspberrypi', 'rkisp1', 'vimc']
 ipa_names = []
 
+ipas = get_option('ipas')
+
 # The ipa-sign-install.sh script which uses the ipa_names variable will itself
 # prepend MESON_INSTALL_DESTDIR_PREFIX to each ipa module name, therefore we
 # must not include the prefix string here.
diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build
index d1397a32..02c143b1 100644
--- a/src/ipa/raspberrypi/meson.build
+++ b/src/ipa/raspberrypi/meson.build
@@ -2,6 +2,10 @@
 
 ipa_name = 'ipa_rpi'
 
+if 'rasberrypi' not in ipas
+    subdir_done()
+endif
+
 rpi_ipa_deps = [
     libcamera_dep,
     dependency('boost'),
diff --git a/src/ipa/rkisp1/meson.build b/src/ipa/rkisp1/meson.build
index 1a1c7159..eecc5877 100644
--- a/src/ipa/rkisp1/meson.build
+++ b/src/ipa/rkisp1/meson.build
@@ -2,6 +2,10 @@
 
 ipa_name = 'ipa_rkisp1'
 
+if 'rkisp1' not in ipas
+    subdir_done()
+endif
+
 mod = shared_module(ipa_name,
                     ['rkisp1.cpp', libcamera_generated_ipa_headers],
                     name_prefix : '',
diff --git a/src/ipa/vimc/meson.build b/src/ipa/vimc/meson.build
index a35825ae..a41a0407 100644
--- a/src/ipa/vimc/meson.build
+++ b/src/ipa/vimc/meson.build
@@ -2,6 +2,10 @@
 
 ipa_name = 'ipa_vimc'
 
+if 'ipu3' not in ipas
+    subdir_done()
+endif
+
 mod = shared_module(ipa_name,
                     ['vimc.cpp', libcamera_generated_ipa_headers],
                     name_prefix : '',
-- 
2.26.2



More information about the libcamera-devel mailing list