summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-06-02 16:37:25 +0300
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-06-15 10:09:24 +0000
commit2251407990b12fd8b501930caae886c6aae7b176 (patch)
treedff7e0385d554e6add5d6edc703a9ffc3e1c5bab
parentb3c4f205c94e55d574483160f5d38b0bfc7c1d16 (diff)
src: Hold a reference for remoting_api in the ivi_compositor
This will be necesary a bit in the future, to ensure that we can't later on enable the remote output so we need access to the api. Bug-AGl: SPEC-3280 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ica13548c852efb7ae4cabade634a6629ed6fe215
-rw-r--r--src/ivi-compositor.h3
-rw-r--r--src/main.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h
index d6b6c80..3b25915 100644
--- a/src/ivi-compositor.h
+++ b/src/ivi-compositor.h
@@ -34,6 +34,8 @@
#include <libweston/windowed-output-api.h>
#include <libweston-desktop/libweston-desktop.h>
+#include "remote.h"
+
#include "agl-shell-server-protocol.h"
struct ivi_compositor;
@@ -66,6 +68,7 @@ struct ivi_compositor {
} cmdline;
const struct weston_windowed_output_api *window_api;
const struct weston_drm_output_api *drm_api;
+ const struct weston_remoting_api *remoting_api;
struct wl_global *agl_shell;
struct wl_global *agl_shell_desktop;
diff --git a/src/main.c b/src/main.c
index 4294c64..4935a2f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -662,9 +662,9 @@ err:
}
static int
-load_remoting(struct weston_compositor *compositor, struct weston_config *config)
+load_remoting(struct ivi_compositor *ivi, struct weston_config *config)
{
- const struct weston_remoting_api *api = NULL;
+ struct weston_compositor *compositor = ivi->compositor;
int (*module_init)(struct weston_compositor *wc);
struct weston_config_section *remote_section = NULL;
const char *section_name;
@@ -677,14 +677,14 @@ load_remoting(struct weston_compositor *compositor, struct weston_config *config
if (module_init(compositor) < 0)
return -1;
- api = weston_remoting_get_api(compositor);
- if (!api)
+ ivi->remoting_api = weston_remoting_get_api(compositor);
+ if (!ivi->remoting_api)
return -1;
while (weston_config_next_section(config, &remote_section, &section_name)) {
if (strcmp(section_name, "remote-output"))
continue;
- remote_output_init(compositor, remote_section, api);
+ remote_output_init(compositor, remote_section, ivi->remoting_api);
}
return 0;
@@ -744,7 +744,7 @@ load_drm_backend(struct ivi_compositor *ivi, int *argc, char *argv[])
goto error;
}
- load_remoting(ivi->compositor, ivi->config);
+ load_remoting(ivi, ivi->config);
error:
free(config.gbm_format);