aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-11-15 16:33:16 +0000
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2017-11-27 17:58:20 +0000
commit93652645f2fbd65c5b01cf32616d2dd1cbcd7af3 (patch)
treef53dc23301ee584efadf03c46ff2be9b55a4eaa8
parent9cdd1e7b5678d426cadfb25f679a9216d50cfa61 (diff)
Added XDG compatibility to ivi-shell
Backported M.Teyfel patch from wayland-devel mailing list: https://lists.freedesktop.org/archives/wayland-devel/2017-November/035700.html Upgrade wayland-ivi-extension to v2.0.2 but keep using 1.1x for now with PREFERRED_VERSION until HMI could use the new version. Added Emre Ucan simple-id-agent to review. Bug-AGL: SPEC-1096 Change-Id: I74c4ae0bf0bf822e27dcbb193dc9f7a13d3e270d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/11991 Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org> ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanibata@denso.co.jp> Reviewed-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
-rw-r--r--meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bbappend (renamed from meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend)0
-rw-r--r--meta-agl-distro/conf/distro/poky-agl.conf1
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch66
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch11
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch18
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch73
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch74
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch117
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch74
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch30
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch166
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch24
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch34
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch133
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch164
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch107
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch130
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch82
-rw-r--r--meta-agl/recipes-graphics/wayland/weston_2.0.0.bbappend16
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch264
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch69
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch13
-rwxr-xr-xmeta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend6
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb31
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb (renamed from meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb)11
25 files changed, 1707 insertions, 7 deletions
diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bbappend
index e9a57d324..e9a57d324 100644
--- a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
+++ b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bbappend
diff --git a/meta-agl-distro/conf/distro/poky-agl.conf b/meta-agl-distro/conf/distro/poky-agl.conf
index 00c46c412..ce15355ba 100644
--- a/meta-agl-distro/conf/distro/poky-agl.conf
+++ b/meta-agl-distro/conf/distro/poky-agl.conf
@@ -67,6 +67,7 @@ DISTRO_FEATURES_APPEND = " "
DISTRO_FEATURES_remove = "x11"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+PREFERRED_VERSION_wayland-ivi-extension ?= "1.1%"
# Prefer GStreamer 1.10.x by default
PREFERRED_VERSION_gstreamer1.0 ?= "1.10.%"
diff --git a/meta-agl/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch b/meta-agl/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch
new file mode 100644
index 000000000..449b7a0fd
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch
@@ -0,0 +1,66 @@
+index 67619b8f..e9ddf9a4 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -497,44 +497,53 @@ wet_shell_init(struct weston_compositor *compositor,
+ {
+ struct ivi_shell *shell;
+ struct ivi_shell_setting setting = { };
+- int retval = -1;
+
+ shell = zalloc(sizeof *shell);
+ if (shell == NULL)
+ return -1;
+
+ if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0)
+- return -1;
++ goto err_shell;
+
+ init_ivi_shell(compositor, shell, &setting);
++ /* TODO deinit_ivi_shell should be implemented, since init_ivi_shell is
++ * initializing multiple lists. */
+
+ shell->destroy_listener.notify = shell_destroy;
+ wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
+
+ if (input_panel_setup(shell) < 0)
+- goto out_settings;
++ goto err_settings;
+
+ shell->text_backend = text_backend_init(compositor);
+ if (!shell->text_backend)
+- goto out_settings;
++ goto err_settings;
+
+ if (wl_global_create(compositor->wl_display,
+ &ivi_application_interface, 1,
+ shell, bind_ivi_application) == NULL)
+- goto out_settings;
++ goto err_text_backend;
+
+ ivi_layout_init_with_compositor(compositor);
++ /* TODO ivi_layout_destroy should be implemented, since multiple lists
++ * and signals are initialized.*/
+ shell_add_bindings(compositor, shell);
+
+ /* Call module_init of ivi-modules which are defined in weston.ini */
+ if (load_controller_modules(compositor, setting.ivi_module,
+ argc, argv) < 0)
+- goto out_settings;
++ goto err_text_backend;
++
++ return IVI_SUCCEEDED;
+
+- retval = 0;
++err_text_backend:
++ text_backend_destroy(shell->text_backend);
+
+-out_settings:
++err_settings:
+ free(setting.ivi_module);
+
+- return retval;
++err_shell:
++ free(shell);
++
++ return IVI_FAILED;
+ }
diff --git a/meta-agl/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch b/meta-agl/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch
new file mode 100644
index 000000000..4507e769c
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch
@@ -0,0 +1,11 @@
+index e9ddf9a4..f3156d35 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -114,7 +114,6 @@ shell_surface_send_configure(struct weston_surface *surface,
+ struct ivi_shell_surface *shsurf;
+
+ shsurf = get_ivi_shell_surface(surface);
+- assert(shsurf);
+ if (!shsurf)
+ return;
+
diff --git a/meta-agl/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch b/meta-agl/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch
new file mode 100644
index 000000000..6f683ca92
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch
@@ -0,0 +1,18 @@
+index 2317d6e9..e1e897ed 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -56,12 +56,14 @@ extern "C" {
+ #endif /* __cplusplus */
+
+ #include <stdint.h>
++#include <limits.h>
+
+ #include "stdbool.h"
+ #include "compositor.h"
+
+ #define IVI_SUCCEEDED (0)
+ #define IVI_FAILED (-1)
++#define IVI_INVALID_ID UINT_MAX
+
+ struct ivi_layout_layer;
+ struct ivi_layout_screen;
diff --git a/meta-agl/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch b/meta-agl/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch
new file mode 100644
index 000000000..6401c5b81
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch
@@ -0,0 +1,73 @@
+index e1e897ed..5b1f12f0 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -320,6 +320,12 @@ struct ivi_layout_interface {
+ struct ivi_layout_surface *ivisurf,
+ uint32_t duration);
+
++ /**
++ * \brief set id of ivi_layout_surface
++ */
++ int32_t (*surface_set_id)(struct ivi_layout_surface *ivisurf,
++ uint32_t id_surface);
++
+ /**
+ * layer controller interface
+ */
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 298e18ea..fa8e75f6 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1901,6 +1901,44 @@ ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf,
+ return 0;
+ }
+
++/*
++ * This interface enables e.g. an id agent to set the id of an ivi-layout
++ * surface, that has been created by a desktop application. This can only be
++ * done once as long as the initial surface id equals IVI_INVALID_ID. Afterwards
++ * two events are emitted, namely surface_created and surface_configured.
++ */
++static int32_t
++ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
++ uint32_t id_surface)
++{
++ struct ivi_layout *layout = get_instance();
++ struct ivi_layout_surface *search_ivisurf = NULL;
++
++ if (!ivisurf) {
++ weston_log("%s: invalid argument\n", __func__);
++ return IVI_FAILED;
++ }
++
++ if (ivisurf->id_surface != IVI_INVALID_ID) {
++ weston_log("surface id can only be set once\n");
++ return IVI_FAILED;
++ }
++
++ search_ivisurf = get_surface(&layout->surface_list, id_surface);
++ if (search_ivisurf) {
++ weston_log("id_surface(%d) is already created\n", id_surface);
++ return IVI_FAILED;
++ }
++
++ ivisurf->id_surface = id_surface;
++
++ wl_signal_emit(&layout->surface_notification.created, ivisurf);
++ wl_signal_emit(&layout->surface_notification.configure_changed,
++ ivisurf);
++
++ return IVI_SUCCEEDED;
++}
++
+ static int32_t
+ ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf,
+ enum ivi_layout_transition_type type,
+@@ -2058,6 +2096,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ .surface_get_weston_surface = ivi_layout_surface_get_weston_surface,
+ .surface_set_transition = ivi_layout_surface_set_transition,
+ .surface_set_transition_duration = ivi_layout_surface_set_transition_duration,
++ .surface_set_id = ivi_layout_surface_set_id,
+
+ /**
+ * layer controller interfaces
diff --git a/meta-agl/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch b/meta-agl/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch
new file mode 100644
index 000000000..ddd949e35
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch
@@ -0,0 +1,74 @@
+index 5b1f12f0..dd0997aa 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -187,6 +187,16 @@ struct ivi_layout_interface {
+ */
+ int32_t (*add_listener_configure_surface)(struct wl_listener *listener);
+
++ /**
++ * \brief add a listener for notification when desktop_surface is configured
++ *
++ * When an desktop_surface is configured, a signal is emitted
++ * to the listening controller plugins.
++ * The pointer of the configured desktop_surface is sent as the void *data argument
++ * to the wl_listener::notify callback function of the listener.
++ */
++ int32_t (*add_listener_configure_desktop_surface)(struct wl_listener *listener);
++
+ /**
+ * \brief Get all ivi_surfaces which are currently registered and managed
+ * by the services
+diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
+index 2b8bd472..fe5be01a 100644
+--- a/ivi-shell/ivi-layout-private.h
++++ b/ivi-shell/ivi-layout-private.h
+@@ -104,6 +104,7 @@ struct ivi_layout {
+ struct wl_signal created;
+ struct wl_signal removed;
+ struct wl_signal configure_changed;
++ struct wl_signal configure_desktop_changed;
+ } surface_notification;
+
+ struct weston_layer layout_layer;
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index fa8e75f6..690af742 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1040,6 +1040,21 @@ ivi_layout_add_listener_configure_surface(struct wl_listener *listener)
+ return IVI_SUCCEEDED;
+ }
+
++static int32_t
++ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener)
++{
++ struct ivi_layout *layout = get_instance();
++
++ if (!listener) {
++ weston_log("ivi_layout_add_listener_configure_desktop_surface: invalid argument\n");
++ return IVI_FAILED;
++ }
++
++ wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener);
++
++ return IVI_SUCCEEDED;
++}
++
+ uint32_t
+ ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf)
+ {
+@@ -2057,6 +2072,7 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
+ wl_signal_init(&layout->surface_notification.created);
+ wl_signal_init(&layout->surface_notification.removed);
+ wl_signal_init(&layout->surface_notification.configure_changed);
++ wl_signal_init(&layout->surface_notification.configure_desktop_changed);
+
+ /* Add layout_layer at the last of weston_compositor.layer_list */
+ weston_layer_init(&layout->layout_layer, ec);
+@@ -2081,6 +2097,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ .add_listener_create_surface = ivi_layout_add_listener_create_surface,
+ .add_listener_remove_surface = ivi_layout_add_listener_remove_surface,
+ .add_listener_configure_surface = ivi_layout_add_listener_configure_surface,
++ .add_listener_configure_desktop_surface = ivi_layout_add_listener_configure_desktop_surface,
+ .get_surface = shell_get_ivi_layout_surface,
+ .get_surfaces = ivi_layout_get_surfaces,
+ .get_id_of_surface = ivi_layout_get_id_of_surface,
diff --git a/meta-agl/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch b/meta-agl/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch
new file mode 100644
index 000000000..04461a1d4
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch
@@ -0,0 +1,117 @@
+index 68ca68ba..c86cbb11 100644
+--- a/ivi-shell/ivi-layout-shell.h
++++ b/ivi-shell/ivi-layout-shell.h
+@@ -39,6 +39,14 @@ struct weston_view;
+ struct weston_surface;
+ struct ivi_layout_surface;
+
++void
++ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height);
++
++struct ivi_layout_surface*
++ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface);
++
+ void
+ ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height);
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 690af742..086d0fd2 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1995,20 +1995,8 @@ ivi_layout_surface_dump(struct weston_surface *surface,
+ * methods of interaction between ivi-shell with ivi-layout
+ */
+
+-void
+-ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+- int32_t width, int32_t height)
+-{
+- struct ivi_layout *layout = get_instance();
+-
+- /* emit callback which is set by ivi-layout api user */
+- wl_signal_emit(&layout->surface_notification.configure_changed,
+- ivisurf);
+-}
+-
+-struct ivi_layout_surface*
+-ivi_layout_surface_create(struct weston_surface *wl_surface,
+- uint32_t id_surface)
++static struct ivi_layout_surface*
++surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
+ {
+ struct ivi_layout *layout = get_instance();
+ struct ivi_layout_surface *ivisurf = NULL;
+@@ -2018,14 +2006,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
+ return NULL;
+ }
+
+- ivisurf = get_surface(&layout->surface_list, id_surface);
+- if (ivisurf != NULL) {
+- if (ivisurf->surface != NULL) {
+- weston_log("id_surface(%d) is already created\n", id_surface);
+- return NULL;
+- }
+- }
+-
+ ivisurf = calloc(1, sizeof *ivisurf);
+ if (ivisurf == NULL) {
+ weston_log("fails to allocate memory\n");
+@@ -2049,7 +2029,55 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
+
+ wl_list_insert(&layout->surface_list, &ivisurf->link);
+
+- wl_signal_emit(&layout->surface_notification.created, ivisurf);
++ return ivisurf;
++}
++
++void
++ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height)
++{
++ struct ivi_layout *layout = get_instance();
++
++ /* emit callback which is set by ivi-layout api user */
++ wl_signal_emit(&layout->surface_notification.configure_desktop_changed,
++ ivisurf);
++}
++
++struct ivi_layout_surface*
++ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface)
++{
++ return surface_create(wl_surface, id_surface);
++}
++
++void
++ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
++ int32_t width, int32_t height)
++{
++ struct ivi_layout *layout = get_instance();
++
++ /* emit callback which is set by ivi-layout api user */
++ wl_signal_emit(&layout->surface_notification.configure_changed,
++ ivisurf);
++}
++
++struct ivi_layout_surface*
++ivi_layout_surface_create(struct weston_surface *wl_surface,
++ uint32_t id_surface)
++{
++ struct ivi_layout *layout = get_instance();
++ struct ivi_layout_surface *ivisurf = NULL;
++
++ ivisurf = get_surface(&layout->surface_list, id_surface);
++ if (ivisurf) {
++ weston_log("id_surface(%d) is already created\n", id_surface);
++ return NULL;
++ }
++
++ ivisurf = surface_create(wl_surface, id_surface);
++
++ if (ivisurf)
++ wl_signal_emit(&layout->surface_notification.created, ivisurf);
+
+ return ivisurf;
+ }
diff --git a/meta-agl/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch b/meta-agl/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch
new file mode 100644
index 000000000..9286ba00b
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch
@@ -0,0 +1,74 @@
+diff --git a/Makefile.am b/Makefile.am
+index cdf82ab4..d990d400 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -993,6 +993,7 @@ ivi_shell_la_LDFLAGS = -module -avoid-version
+ ivi_shell_la_LIBADD = \
+ libshared.la \
+ libweston-@LIBWESTON_MAJOR@.la \
++ libweston-desktop-@LIBWESTON_MAJOR@.la \
+ $(COMPOSITOR_LIBS)
+ ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
+ ivi_shell_la_SOURCES = \
+diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
+index fe5be01a..c054130b 100644
+--- a/ivi-shell/ivi-layout-private.h
++++ b/ivi-shell/ivi-layout-private.h
+@@ -30,6 +30,7 @@
+
+ #include "compositor.h"
+ #include "ivi-layout-export.h"
++#include "libweston-desktop/libweston-desktop.h"
+
+ struct ivi_layout_view {
+ struct wl_list link; /* ivi_layout::view_list */
+@@ -52,6 +53,7 @@ struct ivi_layout_surface {
+
+ struct ivi_layout *layout;
+ struct weston_surface *surface;
++ struct weston_desktop_surface *weston_desktop_surface;
+
+ struct ivi_layout_surface_properties prop;
+
+diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
+index f3156d35..84db2c97 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -44,7 +44,7 @@
+
+ #include "ivi-shell.h"
+ #include "ivi-application-server-protocol.h"
+-#include "ivi-layout-export.h"
++#include "ivi-layout-private.h"
+ #include "ivi-layout-shell.h"
+ #include "shared/helpers.h"
+ #include "compositor/weston.h"
+@@ -271,6 +271,8 @@ application_surface_create(struct wl_client *client,
+ return;
+ }
+
++ layout_surface->weston_desktop_surface = NULL;
++
+ ivisurf = zalloc(sizeof *ivisurf);
+ if (ivisurf == NULL) {
+ wl_resource_post_no_memory(resource);
+diff --git a/ivi-shell/ivi-shell.h b/ivi-shell/ivi-shell.h
+index e35f75f2..be430853 100644
+--- a/ivi-shell/ivi-shell.h
++++ b/ivi-shell/ivi-shell.h
+@@ -30,6 +30,7 @@
+ #include <stdint.h>
+
+ #include "compositor.h"
++#include "libweston-desktop/libweston-desktop.h"
+
+ struct ivi_shell
+ {
+@@ -37,6 +38,7 @@ struct ivi_shell
+
+ struct weston_compositor *compositor;
+
++ struct weston_desktop *desktop;
+ struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */
+
+ struct text_backend *text_backend;
diff --git a/meta-agl/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch b/meta-agl/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch
new file mode 100644
index 000000000..e53a8c458
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch
@@ -0,0 +1,30 @@
+index 086d0fd2..6b854503 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -153,7 +153,10 @@ ivi_view_destroy(struct ivi_layout_view *ivi_view)
+ wl_list_remove(&ivi_view->pending_link);
+ wl_list_remove(&ivi_view->order_link);
+
+- weston_view_destroy(ivi_view->view);
++ if (weston_surface_is_desktop_surface(ivi_view->ivisurf->surface))
++ weston_desktop_surface_unlink_view(ivi_view->view);
++ else
++ weston_view_destroy(ivi_view->view);
+
+ free(ivi_view);
+ }
+@@ -170,7 +173,13 @@ ivi_view_create(struct ivi_layout_layer *ivilayer,
+ return NULL;
+ }
+
+- ivi_view->view = weston_view_create(ivisurf->surface);
++ if (weston_surface_is_desktop_surface(ivisurf->surface)) {
++ ivi_view->view = weston_desktop_surface_create_view(
++ ivisurf->weston_desktop_surface);
++ } else {
++ ivi_view->view = weston_view_create(ivisurf->surface);
++ }
++
+ if (ivi_view->view == NULL) {
+ weston_log("fails to allocate memory\n");
+ free(ivi_view);
diff --git a/meta-agl/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch b/meta-agl/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
new file mode 100644
index 000000000..6a72f15d8
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch
@@ -0,0 +1,166 @@
+index 84db2c97..e797e4f9 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -489,6 +489,162 @@ shell_add_bindings(struct weston_compositor *compositor,
+ shell);
+ }
+
++/*
++ * libweston-desktop
++ */
++
++static void
++desktop_surface_ping_timeout(struct weston_desktop_client *client,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_ping_timeout is not supported\n");
++}
++
++static void
++desktop_surface_pong(struct weston_desktop_client *client,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_pong is not supported\n");
++}
++
++static void
++desktop_surface_added(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ struct ivi_shell *shell = (struct ivi_shell *) user_data;
++ struct ivi_layout_surface *layout_surface;
++ struct ivi_shell_surface *ivisurf;
++ struct weston_surface *weston_surf =
++ weston_desktop_surface_get_surface(surface);
++
++ layout_surface = ivi_layout_desktop_surface_create(weston_surf,
++ IVI_INVALID_ID);
++ if (!layout_surface) {
++ return;
++ }
++
++ layout_surface->weston_desktop_surface = surface;
++
++ ivisurf = zalloc(sizeof *ivisurf);
++ if (!ivisurf) {
++ return;
++ }
++
++ ivisurf->shell = shell;
++ ivisurf->id_surface = IVI_INVALID_ID;
++
++ ivisurf->width = 0;
++ ivisurf->height = 0;
++ ivisurf->layout_surface = layout_surface;
++ ivisurf->surface = weston_surf;
++
++ weston_desktop_surface_set_user_data(surface, ivisurf);
++}
++
++static void
++desktop_surface_removed(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
++ weston_desktop_surface_get_user_data(surface);
++
++ assert(ivisurf != NULL);
++
++ if (ivisurf->layout_surface)
++ layout_surface_cleanup(ivisurf);
++}
++
++static void
++desktop_surface_committed(struct weston_desktop_surface *surface,
++ int32_t sx, int32_t sy, void *user_data)
++{
++ struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
++ weston_desktop_surface_get_user_data(surface);
++ struct weston_surface *weston_surf =
++ weston_desktop_surface_get_surface(surface);
++
++ if(!ivisurf)
++ return;
++
++ if (weston_surf->width == 0 || weston_surf->height == 0)
++ return;
++
++ if (ivisurf->width != weston_surf->width ||
++ ivisurf->height != weston_surf->height) {
++ ivisurf->width = weston_surf->width;
++ ivisurf->height = weston_surf->height;
++
++ ivi_layout_desktop_surface_configure(ivisurf->layout_surface,
++ weston_surf->width,
++ weston_surf->height);
++ }
++}
++
++static void
++desktop_surface_move(struct weston_desktop_surface *surface,
++ struct weston_seat *seat, uint32_t serial, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_move is not supported\n");
++}
++
++static void
++desktop_surface_resize(struct weston_desktop_surface *surface,
++ struct weston_seat *seat, uint32_t serial,
++ enum weston_desktop_surface_edge edges, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_resize is not supported\n");
++}
++
++static void
++desktop_surface_fullscreen_requested(struct weston_desktop_surface *surface,
++ bool fullscreen,
++ struct weston_output *output,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_fullscreen_requested is not supported\n");
++}
++
++static void
++desktop_surface_maximized_requested(struct weston_desktop_surface *surface,
++ bool maximized, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_maximized_requested is not supported\n");
++}
++
++static void
++desktop_surface_minimized_requested(struct weston_desktop_surface *surface,
++ void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_minimized_requested is not supported\n");
++}
++
++static void
++desktop_surface_set_xwayland_position(struct weston_desktop_surface *surface,
++ int32_t x, int32_t y, void *user_data)
++{
++ weston_log("ivi-shell: desktop_surface_set_xwayland_position is not supported\n");
++}
++
++static const struct weston_desktop_api shell_desktop_api = {
++ .struct_size = sizeof(struct weston_desktop_api),
++ .ping_timeout = desktop_surface_ping_timeout,
++ .pong = desktop_surface_pong,
++ .surface_added = desktop_surface_added,
++ .surface_removed = desktop_surface_removed,
++ .committed = desktop_surface_committed,
++
++ .move = desktop_surface_move,
++ .resize = desktop_surface_resize,
++ .fullscreen_requested = desktop_surface_fullscreen_requested,
++ .maximized_requested = desktop_surface_maximized_requested,
++ .minimized_requested = desktop_surface_minimized_requested,
++ .set_xwayland_position = desktop_surface_set_xwayland_position,
++};
++
++/*
++ * end of libweston-desktop
++ */
++
+ /*
+ * Initialization of ivi-shell.
+ */
diff --git a/meta-agl/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch b/meta-agl/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch
new file mode 100644
index 000000000..b76c35d4f
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch
@@ -0,0 +1,24 @@
+index e797e4f9..5f64e72d 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -162,6 +162,10 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
+ {
+ assert(ivisurf->layout_surface != NULL);
+
++ /* destroy weston_surface destroy signal. */
++ if (!ivisurf->layout_surface->weston_desktop_surface)
++ wl_list_remove(&ivisurf->surface_destroy_listener.link);
++
+ ivi_layout_surface_destroy(ivisurf->layout_surface);
+ ivisurf->layout_surface = NULL;
+
+@@ -169,9 +173,6 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
+ ivisurf->surface->committed_private = NULL;
+ weston_surface_set_label_func(ivisurf->surface, NULL);
+ ivisurf->surface = NULL;
+-
+- // destroy weston_surface destroy signal.
+- wl_list_remove(&ivisurf->surface_destroy_listener.link);
+ }
+
+ /*
diff --git a/meta-agl/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch b/meta-agl/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch
new file mode 100644
index 000000000..551e449ad
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch
@@ -0,0 +1,34 @@
+index 5f64e72d..dc8e6f1d 100644
+--- a/ivi-shell/ivi-shell.c
++++ b/ivi-shell/ivi-shell.c
+@@ -677,10 +677,14 @@ wet_shell_init(struct weston_compositor *compositor,
+ if (!shell->text_backend)
+ goto err_settings;
+
++ shell->desktop = weston_desktop_create(compositor, &shell_desktop_api, shell);
++ if (!shell->desktop)
++ goto err_text_backend;
++
+ if (wl_global_create(compositor->wl_display,
+ &ivi_application_interface, 1,
+ shell, bind_ivi_application) == NULL)
+- goto err_text_backend;
++ goto err_desktop;
+
+ ivi_layout_init_with_compositor(compositor);
+ /* TODO ivi_layout_destroy should be implemented, since multiple lists
+@@ -690,10 +694,13 @@ wet_shell_init(struct weston_compositor *compositor,
+ /* Call module_init of ivi-modules which are defined in weston.ini */
+ if (load_controller_modules(compositor, setting.ivi_module,
+ argc, argv) < 0)
+- goto err_text_backend;
++ goto err_desktop;
+
+ return IVI_SUCCEEDED;
+
++err_desktop:
++ weston_desktop_destroy(shell->desktop);
++
+ err_text_backend:
+ text_backend_destroy(shell->text_backend);
+
diff --git a/meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch b/meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch
new file mode 100644
index 000000000..c5d85bb17
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch
@@ -0,0 +1,133 @@
+index d5403e06..7b2f2707 100644
+--- a/ivi-shell/hmi-controller.c
++++ b/ivi-shell/hmi-controller.c
+@@ -129,9 +129,9 @@ struct hmi_controller {
+ struct weston_compositor *compositor;
+ struct wl_listener destroy_listener;
+
+- struct wl_listener surface_created;
+ struct wl_listener surface_removed;
+ struct wl_listener surface_configured;
++ struct wl_listener desktop_surface_configured;
+
+ struct wl_client *user_interface;
+ struct ui_setting ui_setting;
+@@ -581,28 +581,6 @@ create_layer(struct weston_output *output,
+ /**
+ * Internal set notification
+ */
+-static void
+-set_notification_create_surface(struct wl_listener *listener, void *data)
+-{
+- struct hmi_controller *hmi_ctrl =
+- wl_container_of(listener, hmi_ctrl,
+- surface_created);
+- struct ivi_layout_surface *ivisurf = data;
+- struct hmi_controller_layer *layer_link =
+- wl_container_of(hmi_ctrl->application_layer_list.prev,
+- layer_link,
+- link);
+- struct ivi_layout_layer *application_layer = layer_link->ivilayer;
+- int32_t ret = 0;
+-
+- /* skip ui widgets */
+- if (is_surf_in_ui_widget(hmi_ctrl, ivisurf))
+- return;
+-
+- ret = ivi_layout_interface->layer_add_surface(application_layer, ivisurf);
+- assert(!ret);
+-}
+-
+ static void
+ set_notification_remove_surface(struct wl_listener *listener, void *data)
+ {
+@@ -670,6 +648,42 @@ set_notification_configure_surface(struct wl_listener *listener, void *data)
+ switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
+ }
+
++static void
++set_notification_configure_desktop_surface(struct wl_listener *listener, void *data)
++{
++ struct hmi_controller *hmi_ctrl =
++ wl_container_of(listener, hmi_ctrl,
++ desktop_surface_configured);
++ struct ivi_layout_surface *ivisurf = data;
++ struct hmi_controller_layer *layer_link =
++ wl_container_of(hmi_ctrl->application_layer_list.prev,
++ layer_link,
++ link);
++ struct ivi_layout_layer *application_layer = layer_link->ivilayer;
++ struct weston_surface *surface;
++ int32_t ret = 0;
++
++ /* skip ui widgets */
++ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf))
++ return;
++
++ ret = ivi_layout_interface->layer_add_surface(application_layer, ivisurf);
++ assert(!ret);
++
++ /*
++ * if application changes size of wl_buffer. The source rectangle shall be
++ * fit to the size.
++ */
++ surface = ivi_layout_interface->surface_get_weston_surface(ivisurf);
++ if (surface) {
++ ivi_layout_interface->surface_set_source_rectangle(ivisurf, 0,
++ 0, surface->width, surface->height);
++ }
++
++ ivi_layout_interface->commit_changes();
++ switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
++}
++
+ /**
+ * A hmi_controller used 4 ivi_layers to manage ivi_surfaces. The IDs of
+ * corresponding ivi_layer are defined in weston.ini. Default scene graph
+@@ -852,6 +866,9 @@ hmi_controller_create(struct weston_compositor *ec)
+ hmi_ctrl->surface_configured.notify = set_notification_configure_surface;
+ ivi_layout_interface->add_listener_configure_surface(&hmi_ctrl->surface_configured);
+
++ hmi_ctrl->desktop_surface_configured.notify = set_notification_configure_desktop_surface;
++ ivi_layout_interface->add_listener_configure_desktop_surface(&hmi_ctrl->desktop_surface_configured);
++
+ hmi_ctrl->destroy_listener.notify = hmi_controller_destroy;
+ wl_signal_add(&hmi_ctrl->compositor->destroy_signal,
+ &hmi_ctrl->destroy_listener);
+@@ -1275,13 +1292,6 @@ ivi_hmi_controller_UI_ready(struct wl_client *client,
+ ivi_layout_interface->commit_changes();
+
+ ivi_hmi_controller_add_launchers(hmi_ctrl, 256);
+-
+- /* Add surface_created listener after the initialization of launchers.
+- * Otherwise, surfaces of the launchers will be added to application
+- * layer too.*/
+- hmi_ctrl->surface_created.notify = set_notification_create_surface;
+- ivi_layout_interface->add_listener_create_surface(&hmi_ctrl->surface_created);
+-
+ hmi_ctrl->is_initialized = 1;
+ }
+
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 6b854503..22d63708 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -787,9 +787,15 @@ commit_surface_list(struct ivi_layout *layout)
+ ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
+
+ if (configured && !is_surface_transition(ivisurf)) {
+- shell_surface_send_configure(ivisurf->surface,
+- ivisurf->prop.dest_width,
+- ivisurf->prop.dest_height);
++ if (ivisurf->weston_desktop_surface) {
++ weston_desktop_surface_set_size(ivisurf->weston_desktop_surface,
++ ivisurf->prop.dest_width,
++ ivisurf->prop.dest_height);
++ } else {
++ shell_surface_send_configure(ivisurf->surface,
++ ivisurf->prop.dest_width,
++ ivisurf->prop.dest_height);
++ }
+ }
+ } else {
+ configured = 0;
diff --git a/meta-agl/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch b/meta-agl/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch
new file mode 100644
index 000000000..8094f9b85
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch
@@ -0,0 +1,164 @@
+index 23f79dfe..f9c8010b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -616,9 +616,7 @@ demo_clients += weston-simple-egl
+ weston_simple_egl_SOURCES = clients/simple-egl.c
+ nodist_weston_simple_egl_SOURCES = \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+- protocol/xdg-shell-unstable-v6-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h
++ protocol/xdg-shell-unstable-v6-client-protocol.h
+ weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
+ weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
+ endif
+diff --git a/clients/simple-egl.c b/clients/simple-egl.c
+index dad0f09b..07e7e785 100644
+--- a/clients/simple-egl.c
++++ b/clients/simple-egl.c
+@@ -45,8 +45,6 @@
+ #include "xdg-shell-unstable-v6-client-protocol.h"
+ #include <sys/types.h>
+ #include <unistd.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+
+ #include "shared/helpers.h"
+ #include "shared/platform.h"
+@@ -74,7 +72,6 @@ struct display {
+ EGLConfig conf;
+ } egl;
+ struct window *window;
+- struct ivi_application *ivi_application;
+
+ PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
+ };
+@@ -97,7 +94,6 @@ struct window {
+ struct wl_surface *surface;
+ struct zxdg_surface_v6 *xdg_surface;
+ struct zxdg_toplevel_v6 *xdg_toplevel;
+- struct ivi_surface *ivi_surface;
+ EGLSurface egl_surface;
+ struct wl_callback *callback;
+ int fullscreen, opaque, buffer_size, frame_sync, delay;
+@@ -355,27 +351,22 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
+ };
+
+ static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
++create_surface(struct window *window)
+ {
+- struct window *window = data;
+-
+- wl_egl_window_resize(window->native, width, height, 0, 0);
+-
+- window->geometry.width = width;
+- window->geometry.height = height;
++ struct display *display = window->display;
++ EGLBoolean ret;
+
+- if (!window->fullscreen)
+- window->window_size = window->geometry;
+-}
++ window->surface = wl_compositor_create_surface(display->compositor);
+
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
++ window->native =
++ wl_egl_window_create(window->surface,
++ window->geometry.width,
++ window->geometry.height);
++ window->egl_surface =
++ weston_platform_create_egl_surface(display->egl.dpy,
++ display->egl.conf,
++ window->native, NULL);
+
+-static void
+-create_xdg_surface(struct window *window, struct display *display)
+-{
+ window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
+ window->surface);
+ zxdg_surface_v6_add_listener(window->xdg_surface,
+@@ -390,50 +381,6 @@ create_xdg_surface(struct window *window, struct display *display)
+
+ window->wait_for_configure = true;
+ wl_surface_commit(window->surface);
+-}
+-
+-static void
+-create_ivi_surface(struct window *window, struct display *display)
+-{
+- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->surface);
+-
+- if (window->ivi_surface == NULL) {
+- fprintf(stderr, "Failed to create ivi_client_surface\n");
+- abort();
+- }
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+-}
+-
+-static void
+-create_surface(struct window *window)
+-{
+- struct display *display = window->display;
+- EGLBoolean ret;
+-
+- window->surface = wl_compositor_create_surface(display->compositor);
+-
+- window->native =
+- wl_egl_window_create(window->surface,
+- window->geometry.width,
+- window->geometry.height);
+- window->egl_surface =
+- weston_platform_create_egl_surface(display->egl.dpy,
+- display->egl.conf,
+- window->native, NULL);
+-
+-
+- if (display->shell) {
+- create_xdg_surface(window, display);
+- } else if (display->ivi_application ) {
+- create_ivi_surface(window, display);
+- } else {
+- assert(0);
+- }
+
+ ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
+ window->egl_surface, window->display->egl.ctx);
+@@ -465,8 +412,6 @@ destroy_surface(struct window *window)
+ zxdg_toplevel_v6_destroy(window->xdg_toplevel);
+ if (window->xdg_surface)
+ zxdg_surface_v6_destroy(window->xdg_surface);
+- if (window->display->ivi_application)
+- ivi_surface_destroy(window->ivi_surface);
+ wl_surface_destroy(window->surface);
+
+ if (window->callback)
+@@ -821,10 +766,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
+ fprintf(stderr, "unable to load default left pointer\n");
+ // TODO: abort ?
+ }
+- } else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, name,
+- &ivi_application_interface, 1);
+ }
+ }
+
+@@ -939,9 +880,6 @@ main(int argc, char **argv)
+ if (display.shell)
+ zxdg_shell_v6_destroy(display.shell);
+
+- if (display.ivi_application)
+- ivi_application_destroy(display.ivi_application);
+-
+ if (display.compositor)
+ wl_compositor_destroy(display.compositor);
+
diff --git a/meta-agl/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch b/meta-agl/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch
new file mode 100644
index 000000000..495e50ca2
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch
@@ -0,0 +1,107 @@
+index f9c8010b..c37cd00b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -574,9 +574,7 @@ nodist_weston_simple_shm_SOURCES = \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+ protocol/xdg-shell-unstable-v6-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+- protocol/fullscreen-shell-unstable-v1-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h
++ protocol/fullscreen-shell-unstable-v1-client-protocol.h
+ weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
+ weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
+
+diff --git a/clients/simple-shm.c b/clients/simple-shm.c
+index 9fa2e214..fc2ef001 100644
+--- a/clients/simple-shm.c
++++ b/clients/simple-shm.c
+@@ -40,10 +40,6 @@
+ #include "xdg-shell-unstable-v6-client-protocol.h"
+ #include "fullscreen-shell-unstable-v1-client-protocol.h"
+
+-#include <sys/types.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+-
+ struct display {
+ struct wl_display *display;
+ struct wl_registry *registry;
+@@ -52,7 +48,6 @@ struct display {
+ struct zwp_fullscreen_shell_v1 *fshell;
+ struct wl_shm *shm;
+ bool has_xrgb;
+- struct ivi_application *ivi_application;
+ };
+
+ struct buffer {
+@@ -67,7 +62,6 @@ struct window {
+ struct wl_surface *surface;
+ struct zxdg_surface_v6 *xdg_surface;
+ struct zxdg_toplevel_v6 *xdg_toplevel;
+- struct ivi_surface *ivi_surface;
+ struct buffer buffers[2];
+ struct buffer *prev_buffer;
+ struct wl_callback *callback;
+@@ -165,17 +159,6 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
+ handle_xdg_toplevel_close,
+ };
+
+-static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
+-{
+- /* Simple-shm is resizable */
+-}
+-
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
+-
+ static struct window *
+ create_window(struct display *display, int width, int height)
+ {
+@@ -213,19 +196,6 @@ create_window(struct display *display, int width, int height)
+ window->surface,
+ ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_DEFAULT,
+ NULL);
+- } else if (display->ivi_application ) {
+- uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->surface);
+- if (window->ivi_surface == NULL) {
+- fprintf(stderr, "Failed to create ivi_client_surface\n");
+- abort();
+- }
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+-
+ } else {
+ assert(0);
+ }
+@@ -407,11 +377,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
+ id, &wl_shm_interface, 1);
+ wl_shm_add_listener(d->shm, &shm_listener, d);
+ }
+- else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, id,
+- &ivi_application_interface, 1);
+- }
+ }
+
+ static void
+@@ -555,11 +520,6 @@ main(int argc, char **argv)
+
+ fprintf(stderr, "simple-shm exiting\n");
+
+- if (window->display->ivi_application) {
+- ivi_surface_destroy(window->ivi_surface);
+- ivi_application_destroy(window->display->ivi_application);
+- }
+-
+ destroy_window(window);
+ destroy_display(display);
+
diff --git a/meta-agl/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch b/meta-agl/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch
new file mode 100644
index 000000000..f3d2fe47f
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch
@@ -0,0 +1,130 @@
+index c37cd00b..f30ddbe9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -665,8 +665,6 @@ nodist_libtoytoolkit_la_SOURCES = \
+ protocol/viewporter-client-protocol.h \
+ protocol/xdg-shell-unstable-v6-protocol.c \
+ protocol/xdg-shell-unstable-v6-client-protocol.h \
+- protocol/ivi-application-protocol.c \
+- protocol/ivi-application-client-protocol.h \
+ protocol/pointer-constraints-unstable-v1-protocol.c \
+ protocol/pointer-constraints-unstable-v1-client-protocol.h \
+ protocol/relative-pointer-unstable-v1-protocol.c \
+diff --git a/clients/window.c b/clients/window.c
+index 95796d46..aac43abd 100644
+--- a/clients/window.c
++++ b/clients/window.c
+@@ -82,10 +82,6 @@ typedef void *EGLContext;
+
+ #include "window.h"
+
+-#include <sys/types.h>
+-#include "ivi-application-client-protocol.h"
+-#define IVI_SURFACE_ID 9000
+-
+ #define ZWP_RELATIVE_POINTER_MANAGER_V1_VERSION 1
+ #define ZWP_POINTER_CONSTRAINTS_V1_VERSION 1
+
+@@ -107,7 +103,6 @@ struct display {
+ struct wl_data_device_manager *data_device_manager;
+ struct text_cursor_position *text_cursor_position;
+ struct zxdg_shell_v6 *xdg_shell;
+- struct ivi_application *ivi_application; /* ivi style shell */
+ struct zwp_relative_pointer_manager_v1 *relative_pointer_manager;
+ struct zwp_pointer_constraints_v1 *pointer_constraints;
+ EGLDisplay dpy;
+@@ -269,8 +264,6 @@ struct window {
+ struct window *parent;
+ struct window *last_parent;
+
+- struct ivi_surface *ivi_surface;
+-
+ struct window_frame *frame;
+
+ /* struct surface::link, contains also main_surface */
+@@ -1441,19 +1434,6 @@ window_get_display(struct window *window)
+ return window->display;
+ }
+
+-static void
+-handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface,
+- int32_t width, int32_t height)
+-{
+- struct window *window = data;
+-
+- window_schedule_resize(window, width, height);
+-}
+-
+-static const struct ivi_surface_listener ivi_surface_listener = {
+- handle_ivi_surface_configure,
+-};
+-
+ static void
+ surface_create_surface(struct surface *surface, uint32_t flags)
+ {
+@@ -1604,9 +1584,6 @@ window_destroy(struct window *window)
+ if (window->xdg_surface)
+ zxdg_surface_v6_destroy(window->xdg_surface);
+
+- if (window->ivi_surface)
+- ivi_surface_destroy(window->ivi_surface);
+-
+ surface_destroy(window->main_surface);
+
+ wl_list_remove(&window->link);
+@@ -5200,7 +5177,7 @@ window_create_internal(struct display *display, int custom)
+ surface = surface_create(window);
+ window->main_surface = surface;
+
+- assert(custom || display->xdg_shell || display->ivi_application);
++ assert(custom || display->xdg_shell);
+
+ window->custom = custom;
+ window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE;
+@@ -5220,7 +5197,6 @@ struct window *
+ window_create(struct display *display)
+ {
+ struct window *window;
+- uint32_t id_ivisurf;
+
+ window = window_create_internal(display, 0);
+
+@@ -5243,16 +5219,6 @@ window_create(struct display *display)
+ window_inhibit_redraw(window);
+
+ wl_surface_commit(window->main_surface->surface);
+- } else if (display->ivi_application) {
+- /* auto generation of ivi_id based on process id + basement of id */
+- id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
+- window->ivi_surface =
+- ivi_application_surface_create(display->ivi_application,
+- id_ivisurf, window->main_surface->surface);
+- fail_on_null(window->ivi_surface, 0, __FILE__, __LINE__);
+-
+- ivi_surface_add_listener(window->ivi_surface,
+- &ivi_surface_listener, window);
+ }
+
+ return window;
+@@ -6013,11 +5979,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
+ wl_registry_bind(registry, id,
+ &wl_subcompositor_interface, 1);
+ }
+- else if (strcmp(interface, "ivi_application") == 0) {
+- d->ivi_application =
+- wl_registry_bind(registry, id,
+- &ivi_application_interface, 1);
+- }
+
+ if (d->global_handler)
+ d->global_handler(d, id, interface, version, d->user_data);
+@@ -6316,9 +6277,6 @@ display_destroy(struct display *display)
+ if (display->xdg_shell)
+ zxdg_shell_v6_destroy(display->xdg_shell);
+
+- if (display->ivi_application)
+- ivi_application_destroy(display->ivi_application);
+-
+ if (display->shm)
+ wl_shm_destroy(display->shm);
+
diff --git a/meta-agl/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch b/meta-agl/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch
new file mode 100644
index 000000000..3e85e93f6
--- /dev/null
+++ b/meta-agl/recipes-graphics/wayland/weston/0016-ivi-shell_add_screen_remove_layer_api.patch
@@ -0,0 +1,82 @@
+From deee858b0b199d8cfa8033a46d7078f30b23725e Mon Sep 17 00:00:00 2001
+From: "Ucan, Emre (ADITG/SW1)" <eucan@de.adit-jv.com>
+Date: Thu, 2 Mar 2017 08:47:33 +0000
+Subject: ivi-shell: add_screen_remove_layer API
+
+It is analagous to layer_remove_surface API.
+The API removes a layer from the render order
+of the screen.
+
+v3:
+add the new vfunc at the end of
+the ivi_layout_interface struct.
+
+Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
+Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
+Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
+diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
+index 2317d6e..39ffde1 100644
+--- a/ivi-shell/ivi-layout-export.h
++++ b/ivi-shell/ivi-layout-export.h
+@@ -578,6 +578,16 @@ struct ivi_layout_interface {
+ */
+ struct ivi_layout_surface *
+ (*get_surface)(struct weston_surface *surface);
++
++ /**
++ * \brief Remove a ivi_layer to a weston_output which is currently managed
++ * by the service
++ *
++ * \return IVI_SUCCEEDED if the method call was successful
++ * \return IVI_FAILED if the method call was failed
++ */
++ int32_t (*screen_remove_layer)(struct weston_output *output,
++ struct ivi_layout_layer *removelayer);
+ };
+
+ #ifdef __cplusplus
+diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
+index 298e18e..8e4280b 100644
+--- a/ivi-shell/ivi-layout.c
++++ b/ivi-shell/ivi-layout.c
+@@ -1664,6 +1664,27 @@ ivi_layout_screen_add_layer(struct weston_output *output,
+ }
+
+ static int32_t
++ivi_layout_screen_remove_layer(struct weston_output *output,
++ struct ivi_layout_layer *removelayer)
++{
++ struct ivi_layout_screen *iviscrn;
++
++ if (output == NULL || removelayer == NULL) {
++ weston_log("ivi_layout_screen_remove_layer: invalid argument\n");
++ return IVI_FAILED;
++ }
++
++ iviscrn = get_screen_from_output(output);
++
++ wl_list_remove(&removelayer->pending.link);
++ wl_list_init(&removelayer->pending.link);
++
++ iviscrn->order.dirty = 1;
++
++ return IVI_SUCCEEDED;
++}
++
++static int32_t
+ ivi_layout_screen_set_render_order(struct weston_output *output,
+ struct ivi_layout_layer **pLayer,
+ const int32_t number)
+@@ -2088,6 +2109,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
+ */
+ .get_screens_under_layer = ivi_layout_get_screens_under_layer,
+ .screen_add_layer = ivi_layout_screen_add_layer,
++ .screen_remove_layer = ivi_layout_screen_remove_layer,
+ .screen_set_render_order = ivi_layout_screen_set_render_order,
+
+ /**
+--
+cgit v0.10.2
+
+
diff --git a/meta-agl/recipes-graphics/wayland/weston_2.0.0.bbappend b/meta-agl/recipes-graphics/wayland/weston_2.0.0.bbappend
index 65f34bc24..f6f88a6d6 100644
--- a/meta-agl/recipes-graphics/wayland/weston_2.0.0.bbappend
+++ b/meta-agl/recipes-graphics/wayland/weston_2.0.0.bbappend
@@ -2,6 +2,22 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
SRC_URI_append = "\
file://0001-Allow-regular-users-to-launch-Weston_2.0.0.patch \
+ file://0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch \
+ file://0002-ivi-shell-removed-assert.patch \
+ file://0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch \
+ file://0004-layout-interface-added-interface-to-change-surface-id.patch \
+ file://0005-ivi-layout-introcuded-configure_desktop_changed.patch \
+ file://0006-ivi-layout-introcuded-surface_create_and_configure.patch \
+ file://0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch \
+ file://0008-ivi-layout-use-libweston-desktop-api-for-views.patch \
+ file://0009-ivi-shell-added-libweston-desktop-api_implementation.patch \
+ file://0010-ivi-shell-remove-surface_destroy_listener.patch \
+ file://0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch \
+ file://0012-hmi-controller-register-for-desktop_surface_configured.patch \
+ file://0013-simple-egl-remove-ivi-application-support.patch \
+ file://0014-simple-shm-remove-ivi-application-support.patch \
+ file://0015-window-client-remove-ivi-application-support.patch \
+ file://0016-ivi-shell_add_screen_remove_layer_api.patch \
"
EXTRA_OECONF_append = " --enable-sys-uid"
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch
new file mode 100644
index 000000000..9e95167ed
--- /dev/null
+++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch
@@ -0,0 +1,264 @@
+From 8f67f40f7c6b6f62e094f0bdc5044793ae76b1c7 Mon Sep 17 00:00:00 2001
+From: Emre Ucan <eucan@de.adit-jv.com>
+Date: Fri, 24 Nov 2017 16:24:51 +0100
+Subject: [PATCH 1/2] simple-id-agent: initial commit
+
+it is a very simple id-agent plugin.
+It is possible to configure default surface id
+offset. Assigned ids would start
+from the given id offset.
+
+Please check the example weston.ini for loading
+and configuring the simple-id-agent
+
+Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
+---
+ CMakeLists.txt | 1 +
+ id-agent-modules/simple-id-agent/CMakeLists.txt | 72 ++++++++++++
+ .../simple-id-agent/src/simple-id-agent.c | 124 +++++++++++++++++++++
+ id-agent-modules/simple-id-agent/weston.ini.in | 11 ++
+ 4 files changed, 208 insertions(+)
+ create mode 100644 id-agent-modules/simple-id-agent/CMakeLists.txt
+ create mode 100644 id-agent-modules/simple-id-agent/src/simple-id-agent.c
+ create mode 100644 id-agent-modules/simple-id-agent/weston.ini.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bad85df..d07abf5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,6 +35,7 @@ add_subdirectory(ivi-layermanagement-api/ilmClient)
+ add_subdirectory(ivi-layermanagement-api/ilmControl)
+ add_subdirectory(ivi-layermanagement-api/test)
+ add_subdirectory(ivi-layermanagement-examples)
++add_subdirectory(id-agent-modules/simple-id-agent)
+
+ if(WITH_ILM_INPUT)
+ add_subdirectory(ivi-input-api/ilmInput)
+diff --git a/id-agent-modules/simple-id-agent/CMakeLists.txt b/id-agent-modules/simple-id-agent/CMakeLists.txt
+new file mode 100644
+index 0000000..8290722
+--- /dev/null
++++ b/id-agent-modules/simple-id-agent/CMakeLists.txt
+@@ -0,0 +1,72 @@
++############################################################################
++#
++# Copyright (C) 2013 DENSO CORPORATION
++# Copyright 2014 BMW Car IT GmbH
++#
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++############################################################################
++
++cmake_minimum_required (VERSION 2.6)
++
++project(simple-id-agent)
++
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(WAYLAND_SERVER wayland-server>=1.13.0 REQUIRED)
++pkg_check_modules(WESTON weston>=2.0.0 REQUIRED)
++pkg_check_modules(PIXMAN pixman-1 REQUIRED)
++
++find_package(Threads REQUIRED)
++
++GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES)
++
++include_directories(
++ src
++ ${IVI_EXTENSION_INCLUDE_DIRS}
++ ${WAYLAND_SERVER_INCLUDE_DIRS}
++ ${WESTON_INCLUDE_DIRS}
++ ${PIXMAN_INCLUDE_DIRS}
++)
++
++link_directories(
++ ${WAYLAND_SERVER_LIBRARY_DIRS}
++ ${PIXMAN_LIBRARY_DIRS}
++)
++
++add_library(${PROJECT_NAME} MODULE
++ src/simple-id-agent.c
++)
++
++set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
++
++add_dependencies(${PROJECT_NAME}
++ ivi-extension-protocol
++ ${WAYLAND_SERVER_LIBRARIES}
++ ${PIXMAN_LIBRARIES}
++)
++
++set(LIBS
++ ${LIBS}
++ ivi-extension-protocol
++ ${WAYLAND_SERVER_LIBRARIES}
++)
++
++set(CMAKE_C_LDFLAGS "-module -avoid-version")
++
++target_link_libraries(${PROJECT_NAME} ${LIBS})
++
++install (
++ TARGETS ${PROJECT_NAME}
++ LIBRARY DESTINATION lib${LIB_SUFFIX}/weston
++)
+diff --git a/id-agent-modules/simple-id-agent/src/simple-id-agent.c b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
+new file mode 100644
+index 0000000..3c9e989
+--- /dev/null
++++ b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
+@@ -0,0 +1,124 @@
++/*
++ * Copyright (C) 2017 Advanced Driver Information Technology Joint Venture GmbH
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and
++ * its documentation for any purpose is hereby granted without fee, provided
++ * that the above copyright notice appear in all copies and that both that
++ * copyright notice and this permission notice appear in supporting
++ * documentation, and that the name of the copyright holders not be used in
++ * advertising or publicity pertaining to distribution of the software
++ * without specific, written prior permission. The copyright holders make
++ * no representations about the suitability of this software for any
++ * purpose. It is provided "as is" without express or implied warranty.
++ *
++ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
++ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
++ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
++ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
++ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
++ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
++ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <limits.h>
++
++#include <weston.h>
++#include <weston/ivi-layout-export.h>
++
++struct ivi_id_agent
++{
++ uint32_t default_id_offset;
++ uint32_t last_assigned_id;
++ struct weston_compositor *compositor;
++ const struct ivi_layout_interface *interface;
++ struct wl_listener desktop_surface_configured;
++};
++
++static void
++desktop_surface_event_configure(struct wl_listener *listener,
++ void *data)
++{
++ struct ivi_id_agent *ida = wl_container_of(listener, ida,
++ desktop_surface_configured);
++ struct ivi_layout_surface *layout_surface =
++ (struct ivi_layout_surface *) data;
++ uint32_t tmp_id;
++
++ tmp_id = ++ida->last_assigned_id;
++
++ /* Find an unused id */
++ while(ida->interface->get_surface_from_id(tmp_id)) {
++ weston_log("simple-id-agent: surface id: %d is already used\n", tmp_id);
++ tmp_id++;
++ }
++
++ ida->last_assigned_id = tmp_id;
++
++ if (ida->interface->surface_set_id(layout_surface, ida->last_assigned_id) != 0)
++ weston_log("simple-id-agent: failed to set surface id :%d\n", ida->last_assigned_id);
++}
++
++static void
++deinit(struct ivi_id_agent *ida)
++{
++ wl_list_remove(&ida->desktop_surface_configured.link);
++ free(ida);
++}
++
++static int32_t
++read_config(struct ivi_id_agent *ida)
++{
++ struct weston_config *config = NULL;
++ struct weston_config_section *section = NULL;
++ const char *name = NULL;
++
++ config = wet_get_config(ida->compositor);
++ if (!config)
++ return -1;
++
++ section = weston_config_get_section(config, "id-agent", NULL, NULL);
++
++ if (section) {
++
++ weston_config_section_get_uint(section, "default-id-offset",
++ &ida->default_id_offset, 0);
++
++ } else {
++ ida->default_id_offset = 0;
++ }
++
++ return 0;
++}
++
++WL_EXPORT int32_t
++id_agent_module_init(struct weston_compositor *ec,
++ const struct ivi_layout_interface *interface,
++ size_t interface_version)
++{
++ struct ivi_id_agent *ida;
++
++ ida = calloc(1, sizeof *ida);
++ if (ida == NULL) {
++ weston_log("failed to allocate ivi_id_agent\n");
++ return -1;
++ }
++
++ ida->compositor = ec;
++ ida->interface = interface;
++ ida->desktop_surface_configured.notify = desktop_surface_event_configure;
++ ida->interface->add_listener_configure_desktop_surface(&ida->desktop_surface_configured);
++
++ if(read_config(ida) != 0) {
++ deinit(ida);
++ return -1;
++ }
++
++ ida->last_assigned_id = ida->default_id_offset;
++
++ weston_log("id_agent_module_init: success\n");
++
++ return 0;
++}
+diff --git a/id-agent-modules/simple-id-agent/weston.ini.in b/id-agent-modules/simple-id-agent/weston.ini.in
+new file mode 100644
+index 0000000..b5e5fa1
+--- /dev/null
++++ b/id-agent-modules/simple-id-agent/weston.ini.in
+@@ -0,0 +1,11 @@
++[core]
++shell=ivi-shell.so
++require-input=false
++
++[ivi-shell]
++ivi-module=ivi-controller.so
++ivi-input-module=ivi-input-controller.so
++id-agent-module=simple-id-agent.so
++
++[id-agent]
++default-id-offset=10
+--
+2.13.6
+
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch
new file mode 100644
index 000000000..f44786a36
--- /dev/null
+++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch
@@ -0,0 +1,69 @@
+From 26f2f7ce78ba2002809048b227ad9c35921a9cd8 Mon Sep 17 00:00:00 2001
+From: Emre Ucan <eucan@de.adit-jv.com>
+Date: Fri, 24 Nov 2017 16:27:01 +0100
+Subject: [PATCH 2/2] ivi-controller: load id-agent module
+
+Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
+---
+ weston-ivi-shell/src/ivi-controller.c | 39 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+
+diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
+index 312a978..47b6de2 100644
+--- a/weston-ivi-shell/src/ivi-controller.c
++++ b/weston-ivi-shell/src/ivi-controller.c
+@@ -1518,6 +1518,40 @@ load_input_module(struct weston_compositor *ec,
+ return 0;
+ }
+
++static int load_id_agent_module(struct weston_compositor *ec,
++ const struct ivi_layout_interface *interface,
++ size_t interface_version)
++{
++ struct weston_config *config = wet_get_config(ec);
++ struct weston_config_section *section;
++ char *id_agent_module = NULL;
++
++ int (*id_agent_module_init)(struct weston_compositor *ec,
++ const struct ivi_layout_interface *interface,
++ size_t interface_version);
++
++ section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
++
++ if (weston_config_section_get_string(section, "id-agent-module",
++ &id_agent_module, NULL) < 0) {
++ weston_log("ivi-controller: No id-agent-module set\n");
++ return 0;
++ }
++
++ id_agent_module_init = wet_load_module_entrypoint(id_agent_module, "id_agent_module_init");
++ if (!id_agent_module_init)
++ return -1;
++
++ if (id_agent_module_init(ec, interface,
++ sizeof(struct ivi_layout_interface)) != 0) {
++ weston_log("ivi-controller: Initialization of id agent module fails\n");
++ return -1;
++ }
++
++ free(id_agent_module);
++ return 0;
++}
++
+ WL_EXPORT int
+ controller_module_init(struct weston_compositor *compositor,
+ int *argc, char *argv[],
+@@ -1555,5 +1589,10 @@ controller_module_init(struct weston_compositor *compositor,
+ return -1;
+ }
+
++ if (load_id_agent_module(compositor, interface, interface_version) < 0) {
++ free(shell);
++ return -1;
++ }
++
+ return 0;
+ }
+--
+2.13.6
+
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch
new file mode 100644
index 000000000..df5d616fd
--- /dev/null
+++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch
@@ -0,0 +1,13 @@
+Index: git/ivi-layermanagement-api/test/CMakeLists.txt
+===================================================================
+--- git.orig/ivi-layermanagement-api/test/CMakeLists.txt
++++ git/ivi-layermanagement-api/test/CMakeLists.txt
+@@ -58,7 +58,7 @@ IF(BUILD_ILM_API_TESTS)
+ )
+
+ SET(GCC_SANITIZER_COMPILE_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover -fstack-protector-all")
+- SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_SANITIZER_COMPILE_FLAGS}" )
++ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
+ SET( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -static-libasan -static-libubsan" )
+
+ ADD_EXECUTABLE(${PROJECT_NAME} ${SRC_FILES})
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
deleted file mode 100755
index 9508dc6d1..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:"
-
-SRC_URI_append_wandboard = " file://wandboard_fix_build.patch"
-
-# workaround paralellism issue:
-PARALLEL_MAKE = ""
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb
new file mode 100644
index 000000000..14340c54f
--- /dev/null
+++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Wayland IVI Extension"
+DESCRIPTION = "GENIVI Layer Management API based on Wayland IVI Extension"
+HOMEPAGE = "http://projects.genivi.org/wayland-ivi-extension"
+BUGTRACKER = "http://bugs.genivi.org/enter_bug.cgi?product=Wayland%20IVI%20Extension"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1f1a56bb2dadf5f2be8eb342acf4ed79"
+
+SRCREV = "ede33c1c898eeaf673dd2c275e92763a5aabd066"
+SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \
+ file://0001-simple-id-agent-initial-commit.patch;patch=1 \
+ file://0002-ivi-controller-load-id-agent-module.patch;patch=1 \
+"
+S = "${WORKDIR}/git"
+
+DEPENDS = "weston virtual/libgles2 pixman wayland-native"
+
+inherit cmake
+
+EXTRA_OECMAKE := "-DWITH_ILM_INPUT=1"
+
+FILES_${PN} += "${libdir}/weston/*"
+FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
+
+EXTRA_OECMAKE += "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+
+FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:"
+
+SRC_URI_append_wandboard = " file://wandboard_fix_build.patch"
+
+# workaround paralellism issue:
+PARALLEL_MAKE = ""
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb
index 0ed8d9c7c..d4e280455 100644
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb
+++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb
@@ -5,18 +5,27 @@ BUGTRACKER = "http://bugs.genivi.org/enter_bug.cgi?product=Wayland%20IVI%20Exten
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1f1a56bb2dadf5f2be8eb342acf4ed79"
-SRCREV = "3ebb7b74e60a35d549284e7f77183de66bef18e0"
+SRCREV = "ff067a640451de46836200624ece7ac777977c30"
SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \
"
+SRC_URI_append_wandboard = " file://wandboard_fix_build.patch"
+
S = "${WORKDIR}/git"
DEPENDS = "weston virtual/libgles2 pixman wayland-native"
+FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:"
+
+# workaround paralellism issue:
+PARALLEL_MAKE = ""
+
inherit cmake
EXTRA_OECMAKE := "-DWITH_ILM_INPUT=1"
FILES_${PN} += "${libdir}/weston/*"
+FILES_${PN} += "${datadir}/wayland-protocols/stable/ivi-application/*"
+
FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
EXTRA_OECMAKE += "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"