summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-10-02 21:28:51 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-10-18 17:32:41 +0300
commit23caf4180436eb45dfcfc5454df9d6137b77cd3d (patch)
treea40020fc63d2054779757f5ee2753106cb4d95a7
parentd510c44dcbe8e4302a7660ec11c3fb849e45b5e6 (diff)
main: Add support loading waltham transmitter plug-in
This is the same as the remoting plug-in, given that we'll be using the remoting plug-in to create the remoting output. The difference would be that instead of the 'remoting-output' section we'll use 'transmitter-output', with all other section specific being the same. For instance, using agl-shell-app-id we can instruct the application to be assigned to that 'transmitter-output'. Bug-AGL: SPEC-3611 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic16b6b9672802f4f83be121385c0798b9dbe08e9
-rw-r--r--meson.build25
-rw-r--r--src/ivi-compositor.h1
-rw-r--r--src/main.c37
3 files changed, 62 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index ab4f086..34f8558 100644
--- a/meson.build
+++ b/meson.build
@@ -59,10 +59,28 @@ foreach depname : depnames
if not dep.found()
message('Remoting requires @0@ which was not found. '.format(depname))
endif
-deps_remoting += dep
+ deps_remoting += dep
endforeach
+# the transmitter plug-in requires waltham but we don't have a cflags or libs
+# for it so we add waltham depends here. Further more, the output is being
+# handled by remoting plug-in
+depnames_waltham = [
+ 'waltham'
+]
+
+deps_waltham = []
+foreach depname : depnames_waltham
+ dep = dependency(depname, required: false)
+ if not dep.found()
+ message('Waltham requires @0@ which was not found. '.format(depname))
+ endif
+ deps_waltham += dep
+endforeach
+
+deps_waltham += deps_remoting
+
agl_shell_xml = files('protocol/agl-shell.xml')
agl_shell_desktop_xml = files('protocol/agl-shell-desktop.xml')
agl_screenshooter = files('protocol/agl-screenshooter.xml')
@@ -197,6 +215,11 @@ if deps_remoting.length() == depnames.length()
message('Found remoting depends, enabling remoting')
endif
+if deps_waltham.length() == depnames_waltham.length() + depnames.length()
+ config_h.set('HAVE_WALTHAM', 1)
+ message('Found waltham depends, enabling waltham')
+endif
+
if dep_libsmack.found()
config_h.set('HAVE_SMACK', 1)
deps_libweston += dep_libsmack
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index 0c9d604..50e516b 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -70,6 +70,7 @@ struct ivi_compositor {
const struct weston_windowed_output_api *window_api;
const struct weston_drm_output_api *drm_api;
const struct weston_remoting_api *remoting_api;
+ const struct weston_transmitter_api *waltham_transmitter_api;
struct wl_global *agl_shell;
struct wl_global *agl_shell_desktop;
diff --git a/src/main.c b/src/main.c
index e85d788..338ec6a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -57,6 +57,10 @@
#include "remote.h"
#endif
+#ifdef HAVE_WALTHAM
+#include <waltham-transmitter/transmitter_api.h>
+#endif
+
static int cached_tm_mday = -1;
static struct weston_log_scope *log_scope;
@@ -558,6 +562,38 @@ heads_changed(struct wl_listener *listener, void *arg)
}
}
+#ifdef HAVE_WALTHAM
+static int
+load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config)
+{
+ struct weston_compositor *compositor = ivi->compositor;
+ int (*module_init)(struct weston_compositor *wc);
+
+ module_init = weston_load_module("waltham-transmitter.so",
+ "wet_module_init");
+ if (!module_init)
+ return -1;
+
+ if (module_init(compositor) < 0)
+ return -1;
+
+ ivi->waltham_transmitter_api = weston_get_transmitter_api(compositor);
+ if (!ivi->waltham_transmitter_api) {
+ weston_log("Failed to load waltham-transmitter plugin.\n");
+ return -1;
+ }
+
+ weston_log("waltham-transmitter plug-in loaded\n");
+ return 0;
+}
+#else
+static int
+load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config)
+{
+ return -1;
+}
+#endif
+
#ifdef HAVE_REMOTING
static int
drm_backend_remoted_output_configure(struct weston_output *output,
@@ -804,6 +840,7 @@ load_drm_backend(struct ivi_compositor *ivi, int *argc, char *argv[])
}
load_remoting_plugin(ivi, ivi->config);
+ load_waltham_plugin(ivi, ivi->config);
error:
free(config.gbm_format);