From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- .../agl-desktop-config/agl-desktop-config_0.1.bb | 21 + .../agl-desktop-config/files/user-weston-term.path | 8 + .../files/user-weston-term.service | 12 + .../recipes-graphics/hmi-debug/files/hmi-debug | 8 + .../recipes-graphics/hmi-debug/hmi-debug_git.bb | 19 + .../libhomescreen/org.agl.statusbar.conf | 16 + .../libhomescreen/libhomescreen_git.bb | 26 + .../libwindowmanager/libwindowmanager_git.bb | 15 + .../recipes-graphics/runxdg/runxdg_git.bb | 16 + .../wayland/Readme.weston-ini-conf | 34 ++ .../wayland/waltham-transmitter_git.bb | 34 ++ .../recipes-graphics/wayland/waltham_git.bb | 16 + .../0001-Added-ivi-id-agent-to-CMake.patch | 22 + ...0002-add-LayerManagerControl-error-status.patch | 21 + .../0002-ivi-id-agent-added-ivi-id-agent.patch | 530 +++++++++++++++++++++ .../0003-ivi-controller-load-id-agent-module.patch | 67 +++ ...4-ivi-ilmcontrol-added-focus-notification.patch | 29 ++ ...disable-EGLWLMockNavigation-example-build.patch | 22 + .../wandboard_fix_build.patch | 13 + .../wayland/wayland-ivi-extension_git.bb | 35 ++ .../0001-Change-socket-mode-add-rw-for-group.patch | 29 ++ ...ver-Fix-fake-Address-already-in-use-error.patch | 35 ++ .../recipes-graphics/wayland/wayland_%.bbappend | 6 + .../recipes-graphics/wayland/weston-init.bbappend | 81 ++++ .../wayland/weston-init/weston.service.add | 11 + .../wayland/weston-init/weston_tmpfiles.conf | 6 + .../wayland/weston-ready/weston-ready | 56 +++ .../wayland/weston-ready/weston-ready.service | 10 + .../recipes-graphics/wayland/weston-ready_1.0.bb | 21 + ...llow-regular-users-to-launch-Weston_2.0.0.patch | 39 ++ ...-rework-goto-labels-to-avoid-memory-leaks.patch | 57 +++ ...mpositor-add-output-type-to-weston_output.patch | 202 ++++++++ .../weston/0002-ivi-shell-removed-assert.patch | 11 + ...tor-drm-introduce-drm_get_dmafd_from_view.patch | 111 +++++ ...-ivi-shell-introduction-of-IVI_INVALID_ID.patch | 20 + ...face-added-interface-to-change-surface-id.patch | 73 +++ ...yout-introcuded-configure_desktop_changed.patch | 74 +++ ...t-introcuded-surface_create_and_configure.patch | 117 +++++ ...inked-libweston-desktop-and-added-structs.patch | 74 +++ ...ayout-use-libweston-desktop-api-for-views.patch | 30 ++ ...dded-libweston-desktop-api_implementation.patch | 166 +++++++ ...ivi-shell-remove-surface_destroy_listener.patch | 24 + ...l-create-weston-desktop-in_wet_shell_init.patch | 30 ++ ...r-register-for-desktop_surface_configured.patch | 133 ++++++ ...simple-egl-remove-ivi-application-support.patch | 165 +++++++ ...simple-shm-remove-ivi-application-support.patch | 107 +++++ ...dow-client-remove-ivi-application-support.patch | 130 +++++ ...mpositor-add-output-type-to-weston_output.patch | 254 ++++++++++ ...tor-drm-introduce-drm_get_dmafd_from_view.patch | 109 +++++ ...-get-stride-from-drm_get_dma_fd_from_view.patch | 59 +++ .../wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch | 47 ++ .../recipes-graphics/wayland/weston_%.bbappend | 4 + .../recipes-graphics/wayland/weston_5.0.0.bbappend | 27 ++ .../recipes-graphics/wayland/weston_6.0.0.bbappend | 10 + 54 files changed, 3292 insertions(+) create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/files/hmi-debug create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/hmi-debug_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen/org.agl.statusbar.conf create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/Readme.weston-ini-conf create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham-transmitter_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-add-LayerManagerControl-error-status.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0004-ivi-ilmcontrol-added-focus-notification.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0005-disable-EGLWLMockNavigation-example-build.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.service.add create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready_1.0.bb create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-compositor-add-output-type-to-weston_output.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend create mode 100644 meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend (limited to 'meta-agl/meta-agl-profile-graphical/recipes-graphics') diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb new file mode 100644 index 00000000..e0358d61 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb @@ -0,0 +1,21 @@ +SUMMARY = "AGL desktop config" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI += " \ + file://user-weston-term.service \ + file://user-weston-term.path \ +" + +do_install_append() { + install -d ${D}${systemd_user_unitdir} + install -m 0644 ${WORKDIR}/user-weston-term.service ${D}${systemd_user_unitdir} + install -m 0644 ${WORKDIR}/user-weston-term.path ${D}${systemd_user_unitdir} + + install -d ${D}${systemd_user_unitdir}/default.target.wants + ln -sf ${systemd_user_unitdir}/user-weston-term.path ${D}${libdir}/systemd/user/default.target.wants +} + +FILES_${PN} += "${systemd_user_unitdir}/*" +FILES_${PN} += "${systemd_user_unitdir}/default.target.wants/default.target.wants" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path new file mode 100644 index 00000000..9481840e --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.path @@ -0,0 +1,8 @@ +[Unit] +Description=Terminal for weston user unit path + +[Path] +PathExists=%t/wayland-0 + +[Install] +WantedBy=default.target diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service new file mode 100644 index 00000000..ad8b9583 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/agl-desktop-config/files/user-weston-term.service @@ -0,0 +1,12 @@ +[Unit] +Description=Terminal for weston user +After=user-config.service +Requires=user-config.service + +[Service] +Type=simple +ExecStart=/usr/bin/weston-terminal +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/files/hmi-debug b/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/files/hmi-debug new file mode 100644 index 00000000..fee9573b --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/files/hmi-debug @@ -0,0 +1,8 @@ +#You can select log level of HMI framework +#1 ERROR +#2 WARNING +#3 NOTICE +#4 INFO +#5 DEBUG +#If you want to output debug log about hmi-framework, please uncomment the following. +#USE_HMI_DEBUG=5 diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/hmi-debug_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/hmi-debug_git.bb new file mode 100644 index 00000000..27fb60d6 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/hmi-debug/hmi-debug_git.bb @@ -0,0 +1,19 @@ +DESCRIPTION = "Configurations for HMI framework" + +SECTION = "HMI" +LICENSE = "Apache-2.0" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = " \ + file://hmi-debug \ +" + +FILES_${PN} = " \ + ${sysconfdir}/afm/unit.env.d \ +" + +do_install() { + install -d ${D}${sysconfdir}/afm/unit.env.d + install -m 644 ${WORKDIR}/hmi-debug ${D}${sysconfdir}/afm/unit.env.d +} diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen/org.agl.statusbar.conf b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen/org.agl.statusbar.conf new file mode 100644 index 00000000..dc3852ee --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen/org.agl.statusbar.conf @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen_git.bb new file mode 100644 index 00000000..1acd7af8 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libhomescreen/libhomescreen_git.bb @@ -0,0 +1,26 @@ +SUMMARY = "AGL Home Screen Library" +DESCRIPTION = "libhomescreen" +HOMEPAGE = "http://docs.automotivelinux.org" +LICENSE = "Apache-2.0" +SECTION = "libs" + +BBCLASSEXTEND = " nativesdk" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984" + +DEPENDS = "af-binder json-c" + +inherit cmake + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/libhomescreen.git;protocol=https;branch=${AGL_BRANCH} \ + file://org.agl.statusbar.conf \ + " +SRCREV = "44290c49e08fe52d6e3ed80720473577131090f4" +S = "${WORKDIR}/git" + +do_install_append() { + mkdir -p ${D}${sysconfdir}/dbus-1/session.d + install -m 0644 ${WORKDIR}/org.agl.statusbar.conf ${D}${sysconfdir}/dbus-1/session.d +} + +RDEPENDS_${PN} = "agl-service-homescreen" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb new file mode 100644 index 00000000..04a83dd1 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/libwindowmanager/libwindowmanager_git.bb @@ -0,0 +1,15 @@ +SUMMARY = "Window Manager client library for applications" +DESCRIPTION = "Window Manager client library for application built with recipe" +SECTION = "graphics" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93" + +DEPENDS = "af-binder json-c" +RDEPENDS_${PN} = "agl-service-windowmanager" + +inherit cmake + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/libwindowmanager.git;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "003cdfb640b595345b0d4d09471872c9295d0bc7" +S = "${WORKDIR}/git" +PV = "1.0+git${SRCPV}" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb new file mode 100644 index 00000000..d5bd568b --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/runxdg/runxdg_git.bb @@ -0,0 +1,16 @@ +SUMMARY = "Launcher of XDG application on AGL HMI Framework (2017)" +DESCRIPTION = "The command 'runxdg' is a launcher to execute XDG application \ + on AGL HMI Framework which using wayland-ivi-extension" +HOMEPAGE = "https://git.automotivelinux.org/staging/xdg-launcher" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +DEPENDS = "json-c wayland wayland-ivi-extension libhomescreen libwindowmanager" + +inherit cmake + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/xdg-launcher;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "${AGL_APP_REVISION}" + +PV = "1.0+git${SRCPV}" +S = "${WORKDIR}/git" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/Readme.weston-ini-conf b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/Readme.weston-ini-conf new file mode 100644 index 00000000..bbd5a80c --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/Readme.weston-ini-conf @@ -0,0 +1,34 @@ +##Generate a weston.ini file: + +To modify any of the default sections (core, shell, ivi-shell), add a +do_configure() function to your bbappend: + +''' +do_configure() { + echo repaint-window=34 >> ${WORKDIR}/core.cfg + + echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg + echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg +} +''' +or: +''' +do_configure() { + sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg +} +''' + +To change the display from the default assumption of an HDMI-1-A connected +screen that needs to be rotated 270 degrees: + +''' +SRC_URI_remove = "file://hdmi-a-1-270.cfg" +SRC_URI += "file://hdmi-a-1-90.cfg" +''' + +To add new sections just list them in SRC_URI: +''' +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://dsi.cfg" +''' diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham-transmitter_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham-transmitter_git.bb new file mode 100644 index 00000000..9f6684fc --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham-transmitter_git.bb @@ -0,0 +1,34 @@ +DESCRIPTION = "Waltham is a network IPC library designed to resemble Wayland both protocol and protocol-API wise" +HOMEPAGE = "https://github.com/waltham/waltham" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://waltham-transmitter/COPYING;md5=f21c9af4de068fb53b83f0b37d262ec3" + +DEPENDS += "libdrm virtual/kernel wayland wayland-native waltham weston gstreamer1.0 gstreamer gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad wayland-ivi-extension" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/weston-ivi-plugins.git;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "0fc0e974749f4ce35e14c23b050aa8fe693c3ce5" + +S = "${WORKDIR}/git/" + +WALTHAM_PIPELINE_TRANSMITTER ?= "waltham-transmitter/waltham-renderer/pipeline_example_general.cfg" +WALTHAM_PIPELINE_RECEIVER ?= "waltham-receiver/receiver_pipeline_example_general.cfg" +WALTHAM_RECIEVER_IP ?= "192.168.1.2" +WALTHAM_RECEIVER_PORT ?= "3440" + +inherit pkgconfig cmake + +do_install_append () { + install -d ${D}/etc/xdg/weston/ + install ${S}/${WALTHAM_PIPELINE_TRANSMITTER} ${D}/etc/xdg/weston/pipeline.cfg + install ${S}/${WALTHAM_PIPELINE_RECEIVER} ${D}/etc/xdg/weston/receiver_pipeline.cfg + + sed -i -e "s/YOUR_RECIEVER_IP/${WALTHAM_RECIEVER_IP}/g" ${D}/etc/xdg/weston/pipeline.cfg + sed -i -e "s/YOUR_RECIEVER_PORT/${WALTHAM_RECEIVER_PORT}/g" ${D}/etc/xdg/weston/pipeline.cfg + sed -i -e "s/YOUR_RECIEVER_PORT/${WALTHAM_RECEIVER_PORT}/g" ${D}/etc/xdg/weston/receiver_pipeline.cfg + +} + +FILES_${PN} += "/etc/xdg/weston/*.cfg" +FILES_${PN} += "${libdir}/*" +FILES_${PN} += "${bindir}/*" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham_git.bb new file mode 100644 index 00000000..01023a1f --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/waltham_git.bb @@ -0,0 +1,16 @@ +DESCRIPTION = "Waltham is a network IPC library designed to resemble Wayland both protocol and protocol-API wise" +HOMEPAGE = "https://github.com/waltham/waltham" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=e8ad01a5182f2c1b3a2640e9ea268264 \ +" +SRCREV = "1de58c3ff746ddaba7584d760c5454243723d3ca" +SRC_URI = "git://github.com/wmizuno/waltham.git \ + " +S = "${WORKDIR}/git" + +inherit autotools pkgconfig + +DEPENDS += "libdrm virtual/kernel wayland" +RDEPENDS_${PN} += "libdrm" \ No newline at end of file diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch new file mode 100644 index 00000000..7ea0b6e9 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch @@ -0,0 +1,22 @@ +From 48977cb77410247df547063d9d7bcd381fb13cde Mon Sep 17 00:00:00 2001 +From: Michael Teyfel +Date: Fri, 12 Oct 2018 17:12:24 +0200 +Subject: [PATCH 1/3] Added ivi-id-agent to CMake + +Reworked for wayland-ivi-extension 2.2.0 by Scott Murray. + +Signed-off-by: Michael Teyfel +Signed-off-by: Scott Murray + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7d0044a..988fc89 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,7 @@ add_subdirectory(ivi-layermanagement-api/test) + add_subdirectory(ivi-layermanagement-examples) + add_subdirectory(ivi-layermanagement-api/ilmInput) + add_subdirectory(ivi-input-modules/ivi-input-controller) ++add_subdirectory(ivi-id-agent-modules/ivi-id-agent) + + + #============================================================================================= diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-add-LayerManagerControl-error-status.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-add-LayerManagerControl-error-status.patch new file mode 100644 index 00000000..9f1ab47b --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-add-LayerManagerControl-error-status.patch @@ -0,0 +1,21 @@ +LayerManagerControl: add error exit status + +Tweak to add a non-zero exit status on errors. This is useful for +scripting, and allows writing a simple loop to detect Weston readiness. + +Upstream-Status: Pending + +Signed-off-by: Scott Murray + +diff --git a/ivi-layermanagement-examples/LayerManagerControl/src/main.cpp b/ivi-layermanagement-examples/LayerManagerControl/src/main.cpp +index 8ee0546..210e21e 100644 +--- a/ivi-layermanagement-examples/LayerManagerControl/src/main.cpp ++++ b/ivi-layermanagement-examples/LayerManagerControl/src/main.cpp +@@ -45,6 +45,7 @@ int main(int argc, char* argv[]) + if (CommandSuccess != interpreter.interpretCommand(userCommand)) + { + cerr << "Interpreter error: " << interpreter.getLastError() << endl; ++ return 1; + } + + return 0; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch new file mode 100644 index 00000000..7deb01e9 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch @@ -0,0 +1,530 @@ +From 42fc715a430068cdb4484e2cb119418da8ac4e6f Mon Sep 17 00:00:00 2001 +From: Michael Teyfel +Date: Fri, 12 Oct 2018 16:46:57 +0200 +Subject: [PATCH 2/3] ivi-id-agent: added ivi-id-agent + +This is a reference implementation of an ivi-id-agent plugin. It +creates surface-ids for desktop-surfaces depending on the configuration +provided in "weston.ini". For more please refer to the reference +implementation in this commit. + +The only public interface available is the "id_agent_module_init" +function. It is responsible for initialization of structs and reading +the configuration. + +In the reference "weston.ini" two types of configurations can be found: + +[desktop-app] is used to configure a particular application. Therefore +the desired surface-id must be provided. Moreover "app-title" is the +title that is provided by the desktop application (xdg-protocol). +"app-id" behaves accordingly. Although both parameters can be set, it +is not mandatory. Finally at least one has to be set. + +[desktop-app-default] enables the id-agent to generate generic +surface-ids for unconfigured applications, e.g. for development. This +tag is optional. To generate the id an interval starting from +"default-surface-id" to "default-surface-id-max" is used. The id is +incremented until the interval is exceeded. + +In the function "get_id" a surface-id is assigned by means of the +configuration. It can be adjusted, if another behavior is desired. +In this plugin the parameters, that are described above, are evaluated. + +To use these patches please also apply the dedicated patches for +weston: https://github.com/mtey/weston/tree/xdg_support_ivi_id_agent +Since libweston-desktop is used to introduce desktop-surface support, +xdg-protocol is supported. + +Reworked for wayland-ivi-extension 2.2.0 by Scott Murray. + +Signed-off-by: Michael Teyfel +Signed-off-by: Scott Murray + +diff --git a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt +new file mode 100644 +index 0000000..7354a7e +--- /dev/null ++++ b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt +@@ -0,0 +1,69 @@ ++############################################################################### ++# ++# Copyright (C) 2017 Advanced Driver Information Technology Joint Venture 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(ivi-id-agent) ++ ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED) ++pkg_check_modules(WESTON weston>=5.0.0 REQUIRED) ++pkg_check_modules(PIXMAN pixman-1 REQUIRED) ++pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-6 REQUIRED) ++ ++find_package(Threads REQUIRED) ++ ++include_directories( ++ src ++ ${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/ivi-id-agent.c ++) ++ ++set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") ++ ++add_dependencies(${PROJECT_NAME} ++ ${WAYLAND_SERVER_LIBRARIES} ++ ${PIXMAN_LIBRARIES} ++) ++ ++set(LIBS ++ ${LIBS} ++ ${WAYLAND_SERVER_LIBRARIES} ++ ${LIBWESTON_DESKTOP_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/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c b/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c +new file mode 100644 +index 0000000..9bc115d +--- /dev/null ++++ b/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c +@@ -0,0 +1,381 @@ ++/* ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++#include "config-parser.h" ++#include ++ ++#ifndef INVALID_ID ++#define INVALID_ID 0xFFFFFFFF ++#endif ++ ++struct db_elem ++{ ++ struct wl_list link; ++ uint32_t surface_id; ++ char *cfg_app_id; ++ char *cfg_title; ++ struct ivi_layout_surface *layout_surface; ++}; ++ ++struct ivi_id_agent ++{ ++ uint32_t default_behavior_set; ++ uint32_t default_surface_id; ++ uint32_t default_surface_id_max; ++ struct wl_list app_list; ++ struct weston_compositor *compositor; ++ const struct ivi_layout_interface *interface; ++ ++ struct wl_listener desktop_surface_configured; ++ struct wl_listener destroy_listener; ++ struct wl_listener surface_removed; ++}; ++ ++static int32_t ++check_config_parameter(char *cfg_val, char *val) ++{ ++ if (cfg_val == NULL) ++ return IVI_SUCCEEDED; ++ else if (val == NULL || strcmp(cfg_val, val) != 0) ++ return IVI_FAILED; ++ ++ return IVI_SUCCEEDED; ++} ++ ++static int32_t ++get_id_from_config(struct ivi_id_agent *ida, struct ivi_layout_surface ++ *layout_surface) { ++ struct db_elem *db_elem; ++ char *temp_app_id = NULL; ++ char *temp_title = NULL; ++ int ret = IVI_FAILED; ++ ++ struct weston_surface *weston_surface = ++ ida->interface->surface_get_weston_surface(layout_surface); ++ ++ /* Get app id and title */ ++ struct weston_desktop_surface *wds = weston_surface_get_desktop_surface( ++ weston_surface); ++ ++ if (weston_desktop_surface_get_app_id(wds) != NULL) ++ temp_app_id = strdup(weston_desktop_surface_get_app_id(wds)); ++ ++ if (weston_desktop_surface_get_title(wds) != NULL) ++ temp_title = strdup(weston_desktop_surface_get_title(wds)); ++ ++ /* ++ * Check for every config parameter to be fulfilled. This part must be ++ * extended, if additional attributes are desired to be checked. ++ */ ++ wl_list_for_each(db_elem, &ida->app_list, link) ++ { ++ if (check_config_parameter(db_elem->cfg_app_id, temp_app_id) == 0) { ++ if (check_config_parameter(db_elem->cfg_title, temp_title) == 0) { ++ /* Found configuration for application. */ ++ int res = ida->interface->surface_set_id(layout_surface, ++ db_elem->surface_id); ++ if (res) ++ continue; ++ ++ db_elem->layout_surface = layout_surface; ++ ret = IVI_SUCCEEDED; ++ ++ break; ++ } ++ } ++ } ++ ++ free(temp_app_id); ++ free(temp_title); ++ ++ return ret; ++} ++ ++/* ++ * This function generates the id of a surface in regard to the desired ++ * parameters. For implementation of different behavior in id generation please ++ * adjust this function. ++ * In this implementation the app_id and/or title of the application is used for ++ * identification. It is also possible to use the pid, uid or gid for example. ++ */ ++static int32_t ++get_id(struct ivi_id_agent *ida, struct ivi_layout_surface *layout_surface) ++{ ++ if (get_id_from_config(ida, layout_surface) == IVI_SUCCEEDED) ++ return IVI_SUCCEEDED; ++ ++ /* No default layer available */ ++ if (ida->default_behavior_set == 0) { ++ weston_log("ivi-id-agent: Could not find configuration for application\n"); ++ goto ivi_failed; ++ ++ /* Default behavior for unknown applications */ ++ } else if (ida->default_surface_id < ida->default_surface_id_max) { ++ weston_log("ivi-id-agent: No configuration for application adding to " ++ "default layer\n"); ++ ++ /* ++ * Check if ivi-shell application already created an application with ++ * desired surface_id ++ */ ++ struct ivi_layout_surface *temp_layout_surf = ++ ida->interface->get_surface_from_id( ++ ida->default_surface_id); ++ if ((temp_layout_surf != NULL) && (temp_layout_surf != layout_surface)) { ++ weston_log("ivi-id-agent: surface_id already used by an ivi-shell " ++ "application\n"); ++ goto ivi_failed; ++ } ++ ++ ida->interface->surface_set_id(layout_surface, ++ ida->default_surface_id); ++ ida->default_surface_id++; ++ ++ } else { ++ weston_log("ivi-id-agent: Interval for default surface_id generation " ++ "exceeded\n"); ++ goto ivi_failed; ++ } ++ ++ return IVI_SUCCEEDED; ++ ++ivi_failed: ++ return IVI_FAILED; ++} ++ ++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; ++ ++ if (get_id(ida, layout_surface) == IVI_FAILED) ++ weston_log("ivi-id-agent: Could not create surface_id for application\n"); ++} ++ ++static void ++surface_event_remove(struct wl_listener *listener, void *data) { ++ struct ivi_id_agent *ida = wl_container_of(listener, ida, ++ surface_removed); ++ struct ivi_layout_surface *layout_surface = ++ (struct ivi_layout_surface *) data; ++ struct db_elem *db_elem = NULL; ++ ++ wl_list_for_each(db_elem, &ida->app_list, link) ++ { ++ if(db_elem->layout_surface == layout_surface) { ++ db_elem->layout_surface = NULL; ++ break; ++ } ++ } ++} ++ ++static int32_t deinit(struct ivi_id_agent *ida); ++ ++static void ++id_agent_module_deinit(struct wl_listener *listener, void *data) { ++ (void)data; ++ struct ivi_id_agent *ida = wl_container_of(listener, ida, destroy_listener); ++ ++ deinit(ida); ++} ++ ++static int32_t ++check_config(struct db_elem *curr_db_elem, struct ivi_id_agent *ida) ++{ ++ struct db_elem *db_elem; ++ ++ if (ida->default_surface_id <= curr_db_elem->surface_id ++ && curr_db_elem->surface_id <= ida->default_surface_id_max) { ++ weston_log("ivi-id-agent: surface_id: %d in default id interval " ++ "[%d, %d] (CONFIG ERROR)\n", curr_db_elem->surface_id, ++ ida->default_surface_id, ida->default_surface_id_max); ++ goto ivi_failed; ++ } ++ ++ wl_list_for_each(db_elem, &ida->app_list, link) ++ { ++ if(curr_db_elem == db_elem) ++ continue; ++ ++ if (db_elem->surface_id == curr_db_elem->surface_id) { ++ weston_log("ivi-id-agent: Duplicate surface_id: %d (CONFIG ERROR)\n", ++ curr_db_elem->surface_id); ++ goto ivi_failed; ++ } ++ } ++ ++ return IVI_SUCCEEDED; ++ ++ivi_failed: ++ return IVI_FAILED; ++} ++ ++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) ++ goto ivi_failed; ++ ++ section = weston_config_get_section(config, "desktop-app-default", NULL, ++ NULL); ++ ++ if (section) { ++ weston_log("ivi-id-agent: Default behavior for unknown applications is " ++ "set\n"); ++ ida->default_behavior_set = 1; ++ ++ weston_config_section_get_uint(section, "default-surface-id", ++ &ida->default_surface_id, INVALID_ID); ++ weston_config_section_get_uint(section, "default-surface-id-max", ++ &ida->default_surface_id_max, INVALID_ID); ++ ++ if (ida->default_surface_id == INVALID_ID || ++ ida->default_surface_id_max == INVALID_ID) { ++ weston_log("ivi-id-agent: Missing configuration for default " ++ "behavior\n"); ++ ida->default_behavior_set = 0; ++ } ++ } else { ++ ida->default_behavior_set = 0; ++ } ++ ++ section = NULL; ++ while (weston_config_next_section(config, §ion, &name)) { ++ struct db_elem *db_elem = NULL; ++ ++ if (strcmp(name, "desktop-app") != 0) ++ continue; ++ ++ db_elem = calloc(1, sizeof *db_elem); ++ if (db_elem == NULL) { ++ weston_log("ivi-id-agent: No memory to allocate\n"); ++ goto ivi_failed; ++ } ++ ++ wl_list_insert(&ida->app_list, &db_elem->link); ++ ++ weston_config_section_get_uint(section, "surface-id", ++ &db_elem->surface_id, INVALID_ID); ++ ++ if (db_elem->surface_id == INVALID_ID) { ++ weston_log("ivi-id-agent: surface-id is not set in configuration\n"); ++ goto ivi_failed; ++ } ++ ++ weston_config_section_get_string(section, "app-id", ++ &db_elem->cfg_app_id, NULL); ++ weston_config_section_get_string(section, "app-title", ++ &db_elem->cfg_title, NULL); ++ ++ if (db_elem->cfg_app_id == NULL && db_elem->cfg_title == NULL) { ++ weston_log("ivi-id-agent: Every parameter is NULL in app " ++ "configuration\n"); ++ goto ivi_failed; ++ } ++ ++ if (check_config(db_elem, ida) == IVI_FAILED) { ++ weston_log("ivi-id-agent: No valid config found, deinit...\n"); ++ goto ivi_failed; ++ } ++ } ++ ++ if(ida->default_behavior_set == 0 && wl_list_empty(&ida->app_list)) { ++ weston_log("ivi-id-agent: No valid config found, deinit...\n"); ++ goto ivi_failed; ++ } ++ ++ return IVI_SUCCEEDED; ++ ++ivi_failed: ++ return IVI_FAILED; ++} ++ ++WL_EXPORT int32_t ++id_agent_module_init(struct weston_compositor *compositor, ++ const struct ivi_layout_interface *interface) ++{ ++ struct ivi_id_agent *ida = NULL; ++ ++ ida = calloc(1, sizeof *ida); ++ if (ida == NULL) { ++ weston_log("failed to allocate ivi_id_agent\n"); ++ goto ivi_failed; ++ } ++ ++ ida->compositor = compositor; ++ ida->interface = interface; ++ ida->desktop_surface_configured.notify = desktop_surface_event_configure; ++ ida->destroy_listener.notify = id_agent_module_deinit; ++ ida->surface_removed.notify = surface_event_remove; ++ ++ wl_signal_add(&compositor->destroy_signal, &ida->destroy_listener); ++ ida->interface->add_listener_configure_desktop_surface( ++ &ida->desktop_surface_configured); ++ interface->add_listener_remove_surface(&ida->surface_removed); ++ ++ wl_list_init(&ida->app_list); ++ if(read_config(ida) != 0) { ++ weston_log("ivi-id-agent: Read config failed\n"); ++ deinit(ida); ++ goto ivi_failed; ++ } ++ ++ return IVI_SUCCEEDED; ++ ++ivi_failed: ++ return IVI_FAILED; ++} ++ ++static int32_t ++deinit(struct ivi_id_agent *ida) ++{ ++ struct db_elem *db_elem; ++ wl_list_for_each(db_elem, &ida->app_list, link) { ++ free(db_elem->cfg_app_id); ++ free(db_elem->cfg_title); ++ free(db_elem); ++ } ++ ++ wl_list_remove(&ida->desktop_surface_configured.link); ++ wl_list_remove(&ida->destroy_listener.link); ++ wl_list_remove(&ida->surface_removed.link); ++ free(ida); ++ ++ return IVI_SUCCEEDED; ++} +diff --git a/ivi-id-agent-modules/ivi-id-agent/weston.ini.in b/ivi-id-agent-modules/ivi-id-agent/weston.ini.in +new file mode 100644 +index 0000000..48a196c +--- /dev/null ++++ b/ivi-id-agent-modules/ivi-id-agent/weston.ini.in +@@ -0,0 +1,20 @@ ++[core] ++shell=ivi-shell.so ++require-input=false ++ ++[ivi-shell] ++ivi-module=ivi-controller.so ++ivi-input-module=ivi-input-controller.so ++ivi-id-agent-module=ivi-id-agent.so ++ ++[desktop-app] ++surface-id=111 ++app-title=Flower ++ ++[desktop-app] ++surface-id=251 ++app-title=Flower ++ ++[desktop-app-default] ++default-surface-id=2000000 ++default-surface-id-max=2001000 diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch new file mode 100644 index 00000000..8985879b --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch @@ -0,0 +1,67 @@ +From 5fed5c51ca8c1574804362bfdea4930c16457d34 Mon Sep 17 00:00:00 2001 +From: Michael Teyfel +Date: Fri, 12 Oct 2018 16:57:24 +0200 +Subject: [PATCH 3/3] ivi-controller: load id-agent module + +Reworked for wayland-ivi-extension 2.2.0 by Scott Murray. + +Signed-off-by: Michael Teyfel +Signed-off-by: Scott Murray + +diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c +index 8faec2a..8fa51f4 100644 +--- a/weston-ivi-shell/src/ivi-controller.c ++++ b/weston-ivi-shell/src/ivi-controller.c +@@ -2154,6 +2154,41 @@ load_input_module(struct ivishell *shell) + return 0; + } + ++static int load_id_agent_module(struct ivishell *shell) ++{ ++ struct weston_config *config = wet_get_config(shell->compositor); ++ struct weston_config_section *section; ++ char *id_agent_module = NULL; ++ ++ int (*id_agent_module_init)(struct weston_compositor *compositor, ++ const struct ivi_layout_interface *interface); ++ ++ section = weston_config_get_section(config, "ivi-shell", NULL, NULL); ++ ++ if (weston_config_section_get_string(section, "ivi-id-agent-module", ++ &id_agent_module, NULL) < 0) { ++ /* input events are handled by weston's default grabs */ ++ weston_log("ivi-controller: No ivi-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) { ++ free(id_agent_module); ++ return -1; ++ } ++ ++ if (id_agent_module_init(shell->compositor, shell->interface) != 0) { ++ weston_log("ivi-controller: Initialization of id-agent module failed\n"); ++ free(id_agent_module); ++ return -1; ++ } ++ ++ free(id_agent_module); ++ ++ return 0; ++} ++ + static void + launch_client_process(void *data) + { +@@ -2221,6 +2256,10 @@ wet_module_init(struct weston_compositor *compositor, + shell->destroy_listener.notify = ivi_shell_destroy; + wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); + ++ if (load_id_agent_module(shell) < 0) { ++ weston_log("ivi-controller: id-agent module not loaded\n"); ++ } ++ + if (shell->bkgnd_surface_id && shell->ivi_client_name) { + loop = wl_display_get_event_loop(compositor->wl_display); + wl_event_loop_add_idle(loop, launch_client_process, shell); diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0004-ivi-ilmcontrol-added-focus-notification.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0004-ivi-ilmcontrol-added-focus-notification.patch new file mode 100644 index 00000000..05d1cc23 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0004-ivi-ilmcontrol-added-focus-notification.patch @@ -0,0 +1,29 @@ +diff --git a/ivi-layermanagement-api/ilmCommon/include/ilm_types.h b/ivi-layermanagement-api/ilmCommon/include/ilm_types.h +index a88f2b0..12a2017 100644 +--- a/ivi-layermanagement-api/ilmCommon/include/ilm_types.h ++++ b/ivi-layermanagement-api/ilmCommon/include/ilm_types.h +@@ -245,6 +245,7 @@ typedef enum + ILM_NOTIFICATION_CONTENT_AVAILABLE = ILM_BIT(6), + ILM_NOTIFICATION_CONTENT_REMOVED = ILM_BIT(7), + ILM_NOTIFICATION_CONFIGURED = ILM_BIT(8), ++ ILM_NOTIFICATION_FOCUS = ILM_BIT(9), + ILM_NOTIFICATION_ALL = 0xffff + } t_ilm_notification_mask; + +diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +index a912e50..5166839 100644 +--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c ++++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +@@ -819,6 +819,12 @@ input_listener_input_focus(void *data, + surf_ctx->prop.focus |= device; + else + surf_ctx->prop.focus &= ~device; ++ ++ if (surf_ctx->notification != NULL) { ++ surf_ctx->notification(surf_ctx->id_surface, ++ &surf_ctx->prop, ++ ILM_NOTIFICATION_FOCUS); ++ } + } + } + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0005-disable-EGLWLMockNavigation-example-build.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0005-disable-EGLWLMockNavigation-example-build.patch new file mode 100644 index 00000000..21028d58 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0005-disable-EGLWLMockNavigation-example-build.patch @@ -0,0 +1,22 @@ +Disable EGLWLMockNavigation example build + +The EGLWLMockNavigation example code has build issues on TI platforms. +To avoid needing to patch it just for those platforms, just disable +building it since there are no known users inside AGL. + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Scott Murray + +diff --git a/ivi-layermanagement-examples/CMakeLists.txt b/ivi-layermanagement-examples/CMakeLists.txt +index 1eab8e9..48bdffd 100644 +--- a/ivi-layermanagement-examples/CMakeLists.txt ++++ b/ivi-layermanagement-examples/CMakeLists.txt +@@ -24,7 +24,6 @@ project (ivi-layermanagement-examples) + # cmake configuration + #=========================================================================================================== + add_subdirectory(LayerManagerControl) +-add_subdirectory(EGLWLMockNavigation) + add_subdirectory(EGLWLInputEventExample) + add_subdirectory(layer-add-surfaces) + add_subdirectory(multi-touch-viewer) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch new file mode 100644 index 00000000..86b448be --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3610fa9..8b4614d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,7 +34,7 @@ add_subdirectory(ivi-layermanagement-api/ilmCommon) + 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(ivi-layermanagement-examples) + + if(WITH_ILM_INPUT) + add_subdirectory(ivi-input-api/ilmInput) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb new file mode 100644 index 00000000..3935929a --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_git.bb @@ -0,0 +1,35 @@ +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" + +SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \ + file://0001-Added-ivi-id-agent-to-CMake.patch \ + file://0002-ivi-id-agent-added-ivi-id-agent.patch \ + file://0003-ivi-controller-load-id-agent-module.patch \ + file://0002-add-LayerManagerControl-error-status.patch \ + file://0004-ivi-ilmcontrol-added-focus-notification.patch \ + file://0005-disable-EGLWLMockNavigation-example-build.patch \ +" +SRC_URI_append_wandboard = " file://wandboard_fix_build.patch" +SRCREV = "736fb654ac81230cf4f9e51a5772d3a02d7639bf" + +PV = "2.2.0+git${SRCPV}" +S = "${WORKDIR}/git" + +DEPENDS = "weston virtual/libgles2 pixman wayland-native" + +FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:" + +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', '')}" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch new file mode 100644 index 00000000..b04127b5 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch @@ -0,0 +1,29 @@ +From 9162f7d4cfeec7103474e8703218b3679ca9ed10 Mon Sep 17 00:00:00 2001 +From: Ronan Le Martret +Date: Tue, 18 Apr 2017 13:53:26 +0200 +Subject: [PATCH] Change socket mode:add rw for group + +Signed-off-by: Ronan Le Martret +--- + src/wayland-server.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/wayland-server.c b/src/wayland-server.c +index 64d1bec..313c5a0 100644 +--- a/src/wayland-server.c ++++ b/src/wayland-server.c +@@ -1189,7 +1189,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) + wl_log("bind() failed with error: %m\n"); + return -1; + } +- ++ if (chmod(s->addr.sun_path, 0660) < 0) { ++ wl_log("chmod() failed with error: %m\n"); ++ return -1; ++ } + if (listen(s->fd, 128) < 0) { + wl_log("listen() failed with error: %m\n"); + return -1; +-- +2.6.6 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch new file mode 100644 index 00000000..ea9dbd65 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch @@ -0,0 +1,35 @@ +From 152c9ed968124c253f0be25b76c2a083a21af37e Mon Sep 17 00:00:00 2001 +From: Liu Wenlong +Date: Mon, 26 Aug 2019 17:08:22 +0800 +Subject: [PATCH] server: Fix fake "Address already in use" error + +In the current workflow, socket file will be deleted if it already exists. +However, if the socket file is a symbolic link and the file that it refers +to doesn't exist, we will got "Address already in use" because bind() +thinks the socket file exists and won't create it. + +Now, use lstat() to determine whether the socket file exists. + +Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/35] + +Signed-off-by: Liu Wenlong +--- + src/wayland-server.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/wayland-server.c b/src/wayland-server.c +index 83b984f..3bc6ed7 100644 +--- a/src/wayland-server.c ++++ b/src/wayland-server.c +@@ -1393,7 +1393,7 @@ wl_socket_lock(struct wl_socket *socket) + goto err_fd; + } + +- if (stat(socket->addr.sun_path, &socket_stat) < 0 ) { ++ if (lstat(socket->addr.sun_path, &socket_stat) < 0 ) { + if (errno != ENOENT) { + wl_log("did not manage to stat file %s\n", + socket->addr.sun_path); +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend new file mode 100644 index 00000000..5677ed52 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend @@ -0,0 +1,6 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append = "\ + file://0001-Change-socket-mode-add-rw-for-group.patch \ + file://0002-server-Fix-fake-Address-already-in-use-error.patch \ + " diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend new file mode 100644 index 00000000..910cf5a6 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend @@ -0,0 +1,81 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +inherit agl-graphical + + +WESTONSTART ??= "/usr/bin/weston ${WESTONARGS}" +WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/weston.log", "",d)}" + +SRC_URI += " \ + file://weston_tmpfiles.conf \ + file://weston.service.add \ +" + +do_install_append() { + sed -i "/\[Unit\]/aConflicts=getty@tty${WESTONTTY}.service" \ + ${D}${systemd_system_unitdir}/weston.service + + sed -i "/\[Service\]/r ${S}/weston.service.add" \ + ${D}${systemd_system_unitdir}/weston.service + + if ! grep -q '^Group=' ${D}${systemd_system_unitdir}/weston.service; then + sed -i "/\[Service\]/aGroup=root" ${D}${systemd_system_unitdir}/weston.service + fi + if ! grep -q '^User=' ${D}${systemd_system_unitdir}/weston.service; then + sed -i "/\[Service\]/aUser=root" ${D}${systemd_system_unitdir}/weston.service + fi + + sed -e 's,User=root,User=${WESTONUSER},g' \ + -e 's,Group=root,Group=${WESTONGROUP},g' \ + -e 's,ExecStart=.*,ExecStart=${WESTONSTART},g' \ + -e 's,@WESTONTTY@,${WESTONTTY},g' \ + -e 's,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \ + -e '/PAMName=/d' \ + -i ${D}${systemd_system_unitdir}/weston.service + + # Add a rule to ensure the 'display' user has permissions to + # open the graphics device + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/udev/rules.d + cat >${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF' +SUBSYSTEM=="drm", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +EOF + + # user 'display' must own /dev/tty${WESTONTTY} for weston to start correctly + cat >${D}${sysconfdir}/udev/rules.d/zz-tty.rules <<'EOF' +SUBSYSTEM=="tty", KERNEL=="tty${WESTONTTY}", OWNER="${WESTONUSER}", SECLABEL{smack}="^", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +EOF + + # user 'display' must also be able to access /dev/input/* + cat >${D}${sysconfdir}/udev/rules.d/zz-input.rules <<'EOF' +SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="^", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +EOF + + # user 'display' must also be able to access /dev/media*, etc. + cat >${D}${sysconfdir}/udev/rules.d/zz-remote-display.rules <<'EOF' +SUBSYSTEM=="media", MODE="0660", GROUP="display", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +SUBSYSTEM=="video4linux", MODE="0660", GROUP="display", SECLABEL{smack}="*", TAG+="systemd", ENV{SYSTEMD_WANTS}="weston.service" +KERNEL=="uvcs", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*" +KERNEL=="rgnmm", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*" +EOF + + install -d ${D}${sysconfdir}/tmpfiles.d + install -Dm755 ${WORKDIR}/weston_tmpfiles.conf ${D}/${libdir}/tmpfiles.d/weston.conf + + sed -e 's,@WESTONUSER@,${WESTONUSER},g' \ + -e 's,@WESTONGROUP@,${WESTONGROUP},g' \ + -i ${D}/${libdir}/tmpfiles.d/weston.conf +} + +do_install_append_imx() { + + install -d ${D}${sysconfdir}/udev/rules.d + cat >>${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF' +SUBSYSTEM=="gpu_class", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*" +EOF + +} + +FILES_${PN} += "${libdir}/tmpfiles.d/*.conf" + + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.service.add b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.service.add new file mode 100644 index 00000000..d24a8eb2 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston.service.add @@ -0,0 +1,11 @@ +Type=notify +Environment="XDG_RUNTIME_DIR=@XDG_RUNTIME_DIR@" +Environment="XDG_RUNTIMESHARE_DIR=@XDG_RUNTIME_DIR@/share" +ExecStartPre=/bin/mkdir -p @XDG_RUNTIME_DIR@/share +ExecStartPre=+/usr/bin/chsmack -a User::App-Shared -t @XDG_RUNTIME_DIR@/share +TTYPath=/dev/tty@WESTONTTY@ +StandardInput=tty +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +UtmpIdentifier=tty@WESTONTTY@ diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf new file mode 100644 index 00000000..c4b302fa --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf @@ -0,0 +1,6 @@ +# This file is distributed to create weston XDG_RUNTIME_DIR (/run/deamon/@WESTONUSER@) +# +# See tmpfiles.d(5) for details + +d /run/platform/ 0775 root root - +d /run/platform/@WESTONUSER@ 0770 @WESTONUSER@ @WESTONGROUP@ - diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready new file mode 100644 index 00000000..c7cba304 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready @@ -0,0 +1,56 @@ +#!/bin/bash +# +# Copyright (c) 2018, Konsulko Group +# +# 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. +# + +# +# Simple script to check if Weston+IVI shell is ready by calling +# LayerManagerControl, optionally waiting for a specified timeout. +# + +usage="Usage: weston-ready [-t timeout]" +timeout=0 + +function info() { echo "$@" >&2; } + +if [ $# -eq 2 ]; then + if [ $1 = "-t" ]; then + timeout=$(($2 * 10)) + else + echo $usage + exit 1 + fi +fi + +info "using timeout $timeout" + +time=0 +rc=1 +while true; do + if [ $time -gt $timeout ]; then + info "Timeout reached" + break + elif LayerManagerControl get screens >/dev/null 2>&1; then + info "Weston is now ready" + rc=0 + break + fi + info "waiting..." + if [ $timeout -gt 0 ]; then + usleep 500000 + fi + time=$(($time + 5)) +done +exit $rc diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service new file mode 100644 index 00000000..603f5f36 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready/weston-ready.service @@ -0,0 +1,10 @@ +[Unit] +Description=Wait for Weston readiness +Requires=weston.service +After=weston.service + +[Service] +SupplementaryGroups=display +Environment="XDG_RUNTIME_DIR=/run/platform/display" +ExecStart=/usr/bin/weston-ready -t 10 +Type=oneshot diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready_1.0.bb b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready_1.0.bb new file mode 100644 index 00000000..a3d0bb24 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-ready_1.0.bb @@ -0,0 +1,21 @@ +SUMMARY = "Weston readiness checker" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit systemd + +SRC_URI = "file://weston-ready \ + file://weston-ready.service \ +" + +do_install() { + install -D -m 0755 ${WORKDIR}/weston-ready ${D}${bindir}/weston-ready + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -D -m 0644 ${WORKDIR}/weston-ready.service ${D}${systemd_system_unitdir}/weston-ready.service + fi +} + +SYSTEMD_SERVICE_${PN} = "weston-ready.service" + +RDEPENDS_${PN} += "weston bash" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch new file mode 100644 index 00000000..3a59ba0c --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston_2.0.0.patch @@ -0,0 +1,39 @@ +From 6c145cea35f0b77613d6e3f48679c976b9839d7c Mon Sep 17 00:00:00 2001 +From: Ronan Le Martret +Date: Wed, 31 May 2017 22:48:18 +0000 +Subject: [PATCH] Allow regular users to launch Weston + +Signed-off-by: Ronan Le Martret + +diff --git a/configure.ac b/configure.ac +index 50f8e013..2043b9b0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -156,6 +156,12 @@ PKG_CHECK_MODULES(XKBCOMMON_COMPOSE, [xkbcommon >= 0.5.0], + [AC_DEFINE(HAVE_XKBCOMMON_COMPOSE, 1, + [Define if xkbcommon is 0.5.0 or newer])],true) + ++AC_ARG_ENABLE(sys-uid, [ --enable-sys-uid],, ++ enable_sys_uid=no) ++if test x$enable_sys_uid = xyes; then ++ AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston]) ++fi ++ + AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],, + enable_setuid_install=yes) + AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes) +diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c +index e0ce6d63..d0db9bb5 100644 +--- a/libweston/launcher-direct.c ++++ b/libweston/launcher-direct.c +@@ -283,8 +283,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor * + { + struct launcher_direct *launcher; + ++#ifndef ENABLE_SYS_UID + if (geteuid() != 0) + return -EINVAL; ++#endif + + launcher = zalloc(sizeof(*launcher)); + if (launcher == NULL) diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch new file mode 100644 index 00000000..b1e0b8a5 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-ivi-shell-rework-goto-labels-to-avoid-memory-leaks.patch @@ -0,0 +1,57 @@ +diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c +index 58f53bc5..34cdce27 100644 +--- a/ivi-shell/ivi-shell.c ++++ b/ivi-shell/ivi-shell.c +@@ -484,13 +484,14 @@ wet_shell_init(struct weston_compositor *compositor, + int *argc, char *argv[]) + { + struct ivi_shell *shell; +- int retval = -1; + + shell = zalloc(sizeof *shell); + if (shell == NULL) +- return -1; ++ goto err_shell; + + init_ivi_shell(compositor, shell); ++ /* 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); +@@ -499,22 +500,29 @@ wet_shell_init(struct weston_compositor *compositor, + wl_signal_add(&compositor->wake_signal, &shell->wake_listener); + + if (input_panel_setup(shell) < 0) +- goto out; ++ goto err_shell; + + shell->text_backend = text_backend_init(compositor); + if (!shell->text_backend) +- goto out; ++ goto err_shell; + + if (wl_global_create(compositor->wl_display, + &ivi_application_interface, 1, + shell, bind_ivi_application) == NULL) +- goto out; ++ 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); + +- retval = 0; ++ return IVI_SUCCEEDED; + +-out: +- return retval; ++err_text_backend: ++ text_backend_destroy(shell->text_backend); ++ ++err_shell: ++ free(shell); ++ ++ return IVI_FAILED; + } diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-compositor-add-output-type-to-weston_output.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-compositor-add-output-type-to-weston_output.patch new file mode 100644 index 00000000..187bea50 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-compositor-add-output-type-to-weston_output.patch @@ -0,0 +1,202 @@ +From e31e63976aab7616319c10ad21c998c3b4c634e6 Mon Sep 17 00:00:00 2001 +From: Veeresh Kadasani +Date: Tue, 30 Jul 2019 20:22:15 +0900 +Subject: [PATCH 1/2] compositor: add output type to weston_output + +This enables weston to use multiple types of backend +Each backends have own output structure for each functions +To avoid invalid member access, type identifier is needed + +Signed-off-by: Veeresh Kadasani +--- + libweston/compositor-drm.c | 12 +++++++++++- + libweston/compositor-fbdev.c | 2 +- + libweston/compositor-headless.c | 2 +- + libweston/compositor-rdp.c | 2 +- + libweston/compositor-wayland.c | 2 +- + libweston/compositor-x11.c | 2 +- + libweston/compositor.h | 12 ++++++++++++ + 7 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index c110110..b83459a 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -923,6 +923,7 @@ drm_output_find_by_crtc(struct drm_backend *b, uint32_t crtc_id) + struct drm_output *output; + + wl_list_for_each(output, &b->compositor->output_list, base.link) { ++ if(output->base.output_type == OUTPUT_DRM) + if (output->crtc_id == crtc_id) + return output; + } +@@ -939,6 +940,7 @@ drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id) + wl_list_for_each(base, + &backend->compositor->head_list, compositor_link) { + head = to_drm_head(base); ++ if(base->output->output_type == OUTPUT_DRM) + if (head->connector_id == connector_id) + return head; + } +@@ -6159,6 +6161,7 @@ drm_output_enable(struct weston_output *base) + + assert(!output->virtual); + ++ output->base.output_type = OUTPUT_DRM; + resources = drmModeGetResources(b->drm.fd); + if (!resources) { + weston_log("drmModeGetResources failed\n"); +@@ -6628,6 +6631,7 @@ drm_backend_update_heads(struct drm_backend *b, struct udev_device *drm_device) + /* Remove connectors that have disappeared. */ + wl_list_for_each_safe(base, next, + &b->compositor->head_list, compositor_link) { ++ if (base->output->output_type == OUTPUT_DRM) { + bool removed = true; + + head = to_drm_head(base); +@@ -6646,6 +6650,7 @@ drm_backend_update_heads(struct drm_backend *b, struct udev_device *drm_device) + head->base.name, head->connector_id); + drm_head_destroy(head); + } ++ } + + drm_backend_update_unused_outputs(b, resources); + +@@ -6751,12 +6756,14 @@ session_notify(struct wl_listener *listener, void *data) + * pending frame callbacks. */ + + wl_list_for_each(output, &compositor->output_list, base.link) { ++ if(output->base.output_type == OUTPUT_DRM) { + output->base.repaint_needed = false; + if (output->cursor_plane) + drmModeSetCursor(b->drm.fd, output->crtc_id, + 0, 0, 0); + } +- ++ } ++ if(output->base.output_type == OUTPUT_DRM) { + output = container_of(compositor->output_list.next, + struct drm_output, base.link); + +@@ -6768,6 +6775,7 @@ session_notify(struct wl_listener *listener, void *data) + plane->plane_id, + output->crtc_id, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); ++ } + } + } + } +@@ -7094,6 +7102,7 @@ switch_to_gl_renderer(struct drm_backend *b) + } + + wl_list_for_each(output, &b->compositor->output_list, base.link) ++ if(output->base.output_type == OUTPUT_DRM) + pixman_renderer_output_destroy(&output->base); + + b->compositor->renderer->destroy(b->compositor); +@@ -7106,6 +7115,7 @@ switch_to_gl_renderer(struct drm_backend *b) + } + + wl_list_for_each(output, &b->compositor->output_list, base.link) ++ if(output->base.output_type == OUTPUT_DRM) + drm_output_init_egl(output, b); + + b->use_pixman = 0; +diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c +index 6031be5..97002e6 100644 +--- a/libweston/compositor-fbdev.c ++++ b/libweston/compositor-fbdev.c +@@ -526,7 +526,7 @@ fbdev_output_enable(struct weston_output *base) + struct fbdev_head *head; + int fb_fd; + struct wl_event_loop *loop; +- ++ output->base.output_type = OUTPUT_FBDEV; + head = fbdev_output_get_head(output); + + /* Create the frame buffer. */ +diff --git a/libweston/compositor-headless.c b/libweston/compositor-headless.c +index 5a0e46c..20b78b2 100644 +--- a/libweston/compositor-headless.c ++++ b/libweston/compositor-headless.c +@@ -160,7 +160,7 @@ headless_output_enable(struct weston_output *base) + loop = wl_display_get_event_loop(b->compositor->wl_display); + output->finish_frame_timer = + wl_event_loop_add_timer(loop, finish_frame_handler, output); +- ++ output->base.output_type = OUTPUT_HEADLESS; + if (b->use_pixman) { + output->image_buf = malloc(output->base.current_mode->width * + output->base.current_mode->height * 4); +diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c +index 871a0a3..b3064dd 100644 +--- a/libweston/compositor-rdp.c ++++ b/libweston/compositor-rdp.c +@@ -554,7 +554,7 @@ rdp_output_enable(struct weston_output *base) + struct rdp_output *output = to_rdp_output(base); + struct rdp_backend *b = to_rdp_backend(base->compositor); + struct wl_event_loop *loop; +- ++ output->base.output_type = OUTPUT_RDP; + output->shadow_surface = pixman_image_create_bits(PIXMAN_x8r8g8b8, + output->base.current_mode->width, + output->base.current_mode->height, +diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c +index e1485ca..75140b2 100644 +--- a/libweston/compositor-wayland.c ++++ b/libweston/compositor-wayland.c +@@ -1221,7 +1221,7 @@ wayland_output_enable(struct weston_output *base) + struct wayland_backend *b = to_wayland_backend(base->compositor); + enum mode_status mode_status; + int ret = 0; +- ++ output->base.output_type = OUTPUT_WAYLAND; + weston_log("Creating %dx%d wayland output at (%d, %d)\n", + output->base.current_mode->width, + output->base.current_mode->height, +diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c +index 922e3c8..8c20626 100644 +--- a/libweston/compositor-x11.c ++++ b/libweston/compositor-x11.c +@@ -934,7 +934,7 @@ x11_output_enable(struct weston_output *base) + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + 0 + }; +- ++ output->base.output_type = OUTPUT_X11; + if (!b->no_input) + values[0] |= + XCB_EVENT_MASK_KEY_PRESS | +diff --git a/libweston/compositor.h b/libweston/compositor.h +index a5223c2..040917b 100644 +--- a/libweston/compositor.h ++++ b/libweston/compositor.h +@@ -169,6 +169,17 @@ enum dpms_enum { + WESTON_DPMS_OFF + }; + ++/* bit compatible with drm definitions. */ ++enum output_type { ++ OUTPUT_DRM, ++ OUTPUT_FBDEV, ++ OUTPUT_HEADLESS, ++ OUTPUT_RDP, ++ OUTPUT_WAYLAND, ++ OUTPUT_X11, ++ OUTPUT_WALTHAM ++}; ++ + /** Represents a monitor + * + * This object represents a monitor (hardware backends like DRM) or a window +@@ -202,6 +213,7 @@ struct weston_head { + struct weston_output { + uint32_t id; + char *name; ++ enum output_type output_type; + + /** Matches the lifetime from the user perspective */ + struct wl_signal user_destroy_signal; +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0002-ivi-shell-removed-assert.patch new file mode 100644 index 00000000..4507e769 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch new file mode 100644 index 00000000..388e430d --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch @@ -0,0 +1,111 @@ +From 2cb25adac6b968104bbfb276c684506607dfbff4 Mon Sep 17 00:00:00 2001 +From: Veeresh Kadasani +Date: Wed, 7 Aug 2019 21:05:11 +0900 +Subject: [PATCH 1/1] compositor-drm: introduce drm_get_dmafd_from_view + +This API enables to get dmafd from weston_view + +Signed-off-by: Veeresh Kadasani +--- + libweston/compositor-drm.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++ + libweston/compositor-drm.h | 7 ++++++ + 2 files changed, 66 insertions(+) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index b83459a..98ad85c 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -5848,6 +5848,64 @@ drm_output_set_seat(struct weston_output *base, + seat ? seat : ""); + } + ++ static int ++drm_get_dma_fd_from_view(struct weston_output *base, ++ struct weston_view *ev, int *buf_stride) ++{ ++ struct drm_backend *b = to_drm_backend(base->compositor); ++ struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; ++ struct gbm_bo *bo; ++ struct drm_fb *current; ++ struct linux_dmabuf_buffer *dmabuf; ++ bool is_opaque = weston_view_is_opaque(ev,&ev->transform.boundingbox); ++ uint32_t format; ++ int fd, ret; ++ ++ if(!buffer) { ++ weston_log("buffer is NULL\n"); ++ return -1; ++ } ++ ++ if(dmabuf = linux_dmabuf_buffer_get(buffer->resource)) { ++ current = drm_fb_get_from_dmabuf(dmabuf, b, is_opaque); ++ if (!current) ++ { ++ fprintf(stderr, "failed to get drm_fb from dmabuf\n"); ++ return -1; ++ } ++ *buf_stride=current->strides[0]; ++ } ++ else if(ev->surface->buffer_ref.buffer->legacy_buffer) { ++ bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, ++ buffer->resource, GBM_BO_USE_SCANOUT); ++ if (!bo) { ++ weston_log("failed to get gbm_bo\n"); ++ return -1; ++ } ++ current = drm_fb_get_from_bo(bo, b, is_opaque, BUFFER_CLIENT); ++ ++ if (!current) { ++ weston_log("failed to get drm_fb from bo\n"); ++ return -1; ++ } ++ *buf_stride=current->strides[0]; ++ } ++ else { ++ weston_log("Buffer is not supported\n"); ++ return -1; ++ } ++ ++ ret = drmPrimeHandleToFD(b->drm.fd, current->handles[0], ++ DRM_CLOEXEC, &fd); ++ free(current); ++ if (ret) { ++ weston_log("failed to create prime fd for front buffer\n"); ++ return -1; ++ } ++ ++ return fd; ++} ++ + static int + drm_output_init_gamma_size(struct drm_output *output) + { +@@ -7396,6 +7454,7 @@ static const struct weston_drm_output_api api = { + drm_output_set_mode, + drm_output_set_gbm_format, + drm_output_set_seat, ++ drm_get_dma_fd_from_view + }; + + static const struct weston_drm_virtual_output_api virt_api = { +diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h +index 71a306f..a9379e4 100644 +--- a/libweston/compositor-drm.h ++++ b/libweston/compositor-drm.h +@@ -78,6 +78,13 @@ struct weston_drm_output_api { + */ + void (*set_seat)(struct weston_output *output, + const char *seat); ++ ++ /** Get the dma fd from drm view. ++ * ++ * The dma fd is got from weston_view. ++ * Returns fd on success, -1 on failure. ++ */ ++ int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view, int *buf_stride); + }; + + static inline const struct weston_drm_output_api * +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch new file mode 100644 index 00000000..9f696d8a --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0003-ivi-shell-introduction-of-IVI_INVALID_ID.patch @@ -0,0 +1,20 @@ +diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h +index 016d8b5c..02bfb2cb 100644 +--- a/ivi-shell/ivi-layout-export.h ++++ b/ivi-shell/ivi-layout-export.h +@@ -56,6 +56,7 @@ extern "C" { + #endif /* __cplusplus */ + + #include ++#include + + #include "stdbool.h" + #include "compositor.h" +@@ -63,6 +64,7 @@ extern "C" { + + #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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-layout-interface-added-interface-to-change-surface-id.patch new file mode 100644 index 00000000..6401c5b8 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-ivi-layout-introcuded-configure_desktop_changed.patch new file mode 100644 index 00000000..ddd949e3 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0006-ivi-layout-introcuded-surface_create_and_configure.patch new file mode 100644 index 00000000..04461a1d --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0007-ivi-shell-linked-libweston-desktop-and-added-structs.patch new file mode 100644 index 00000000..9286ba00 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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 + + #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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0008-ivi-layout-use-libweston-desktop-api-for-views.patch new file mode 100644 index 00000000..e53a8c45 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0009-ivi-shell-added-libweston-desktop-api_implementation.patch new file mode 100644 index 00000000..6a72f15d --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0010-ivi-shell-remove-surface_destroy_listener.patch new file mode 100644 index 00000000..b76c35d4 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch new file mode 100644 index 00000000..f6256f78 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0011-ivi-shell-create-weston-desktop-in_wet_shell_init.patch @@ -0,0 +1,30 @@ +diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c +index b0a2a2b9..a889afdb 100644 +--- a/ivi-shell/ivi-shell.c ++++ b/ivi-shell/ivi-shell.c +@@ -664,10 +664,14 @@ wet_shell_init(struct weston_compositor *compositor, + if (!shell->text_backend) + goto err_shell; + ++ 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 +@@ -676,6 +680,9 @@ wet_shell_init(struct weston_compositor *compositor, + + return IVI_SUCCEEDED; + ++err_desktop: ++ weston_desktop_destroy(shell->desktop); ++ + err_text_backend: + text_backend_destroy(shell->text_backend); + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch new file mode 100644 index 00000000..447cff4f --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0012-hmi-controller-register-for-desktop_surface_configured.patch @@ -0,0 +1,133 @@ +diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c +index a0e49ba0..340d1915 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; +@@ -576,28 +576,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 = hmi_ctrl->interface->layer_add_surface(application_layer, ivisurf); +- assert(!ret); +-} +- + static void + set_notification_remove_surface(struct wl_listener *listener, void *data) + { +@@ -665,6 +643,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 = hmi_ctrl->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 = hmi_ctrl->interface->surface_get_weston_surface(ivisurf); ++ if (surface) { ++ hmi_ctrl->interface->surface_set_source_rectangle(ivisurf, 0, ++ 0, surface->width, surface->height); ++ } ++ ++ hmi_ctrl->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 +@@ -868,6 +882,9 @@ hmi_controller_create(struct weston_compositor *ec) + hmi_ctrl->surface_configured.notify = set_notification_configure_surface; + hmi_ctrl->interface->add_listener_configure_surface(&hmi_ctrl->surface_configured); + ++ hmi_ctrl->desktop_surface_configured.notify = set_notification_configure_desktop_surface; ++ hmi_ctrl->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); +@@ -1289,12 +1306,6 @@ ivi_hmi_controller_UI_ready(struct wl_client *client, + + 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; +- hmi_ctrl->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 b06bf309..ef354d49 100644 +--- a/ivi-shell/ivi-layout.c ++++ b/ivi-shell/ivi-layout.c +@@ -715,9 +715,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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch new file mode 100644 index 00000000..036b14cb --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0013-simple-egl-remove-ivi-application-support.patch @@ -0,0 +1,165 @@ +diff --git a/Makefile.am b/Makefile.am +index 17c053e6..e0d3cb78 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -609,9 +609,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 a1e57aef..936e015e 100644 +--- a/clients/simple-egl.c ++++ b/clients/simple-egl.c +@@ -45,8 +45,6 @@ + #include "xdg-shell-unstable-v6-client-protocol.h" + #include + #include +-#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, maximized, opaque, buffer_size, frame_sync, delay; +@@ -359,27 +355,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, +@@ -394,50 +385,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); +@@ -469,8 +416,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) +@@ -825,10 +770,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); + } + } + +@@ -943,9 +884,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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0014-simple-shm-remove-ivi-application-support.patch new file mode 100644 index 00000000..495e50ca --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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 +-#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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0015-window-client-remove-ivi-application-support.patch new file mode 100644 index 00000000..f3d2fe47 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/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 +-#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/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch new file mode 100644 index 00000000..6b93b06e --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0016-compositor-add-output-type-to-weston_output.patch @@ -0,0 +1,254 @@ +From 8ea60075d5310101bebedf09c94902e9d41432ac Mon Sep 17 00:00:00 2001 +From: Veeresh Kadasani +Date: Mon, 29 Jul 2019 17:04:12 +0900 +Subject: [PATCH 1/3] compositor: add output type to weston_output + +This enables weston to use multiple types of backend +Each backends have own output structure for each functions +To avoid invalid member access, type identifier is needed + +Signed-off-by: Veeresh Kadasani +--- + libweston/compositor-drm.c | 78 +++++++++++++++++++++++------------------ + libweston/compositor-fbdev.c | 2 +- + libweston/compositor-headless.c | 2 +- + libweston/compositor-rdp.c | 2 +- + libweston/compositor-wayland.c | 2 +- + libweston/compositor-x11.c | 2 +- + libweston/compositor.h | 12 ++++++- + 7 files changed, 60 insertions(+), 40 deletions(-) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 3891176..26a480c 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -843,8 +843,9 @@ drm_output_find_by_crtc(struct drm_backend *b, uint32_t crtc_id) + struct drm_output *output; + + wl_list_for_each(output, &b->compositor->output_list, base.link) { +- if (output->crtc_id == crtc_id) +- return output; ++ if(output->base.output_type == OUTPUT_DRM) ++ if (output->crtc_id == crtc_id) ++ return output; + } + + return NULL; +@@ -859,7 +860,8 @@ drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id) + wl_list_for_each(base, + &backend->compositor->head_list, compositor_link) { + head = to_drm_head(base); +- if (head->connector_id == connector_id) ++ if(base->output->output_type == OUTPUT_DRM) ++ if (head->connector_id == connector_id) + return head; + } + +@@ -5728,6 +5730,7 @@ drm_output_enable(struct weston_output *base) + drmModeRes *resources; + int ret; + ++ output->base.output_type = OUTPUT_DRM; + resources = drmModeGetResources(b->drm.fd); + if (!resources) { + weston_log("drmModeGetResources failed\n"); +@@ -6188,23 +6191,25 @@ drm_backend_update_heads(struct drm_backend *b, struct udev_device *drm_device) + /* Remove connectors that have disappeared. */ + wl_list_for_each_safe(base, next, + &b->compositor->head_list, compositor_link) { +- bool removed = true; ++ if (base->output->output_type == OUTPUT_DRM) { ++ bool removed = true; + +- head = to_drm_head(base); ++ head = to_drm_head(base); + +- for (i = 0; i < resources->count_connectors; i++) { +- if (resources->connectors[i] == head->connector_id) { +- removed = false; +- break; +- } +- } ++ for (i = 0; i < resources->count_connectors; i++) { ++ if (resources->connectors[i] == head->connector_id) { ++ removed = false; ++ break; ++ } ++ } + +- if (!removed) +- continue; ++ if (!removed) ++ continue; + +- weston_log("DRM: head '%s' (connector %d) disappeared.\n", +- head->base.name, head->connector_id); +- drm_head_destroy(head); ++ weston_log("DRM: head '%s' (connector %d) disappeared.\n", ++ head->base.name, head->connector_id); ++ drm_head_destroy(head); ++ } + } + + drm_backend_update_unused_outputs(b, resources); +@@ -6309,23 +6314,26 @@ session_notify(struct wl_listener *listener, void *data) + * pending frame callbacks. */ + + wl_list_for_each(output, &compositor->output_list, base.link) { +- output->base.repaint_needed = false; +- if (output->cursor_plane) +- drmModeSetCursor(b->drm.fd, output->crtc_id, +- 0, 0, 0); ++ if(output->base.output_type == OUTPUT_DRM) { ++ output->base.repaint_needed = false; ++ if (output->cursor_plane) ++ drmModeSetCursor(b->drm.fd, output->crtc_id, ++ 0, 0, 0); ++ } + } +- +- output = container_of(compositor->output_list.next, +- struct drm_output, base.link); +- +- wl_list_for_each(plane, &b->plane_list, link) { +- if (plane->type != WDRM_PLANE_TYPE_OVERLAY) +- continue; +- +- drmModeSetPlane(b->drm.fd, +- plane->plane_id, +- output->crtc_id, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0); ++ if(output->base.output_type == OUTPUT_DRM) { ++ output = container_of(compositor->output_list.next, ++ struct drm_output, base.link); ++ ++ wl_list_for_each(plane, &b->plane_list, link) { ++ if (plane->type != WDRM_PLANE_TYPE_OVERLAY) ++ continue; ++ ++ drmModeSetPlane(b->drm.fd, ++ plane->plane_id, ++ output->crtc_id, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0); ++ } + } + } + } +@@ -6649,7 +6657,8 @@ switch_to_gl_renderer(struct drm_backend *b) + } + + wl_list_for_each(output, &b->compositor->output_list, base.link) +- pixman_renderer_output_destroy(&output->base); ++ if(output->base.output_type == OUTPUT_DRM) ++ pixman_renderer_output_destroy(&output->base); + + b->compositor->renderer->destroy(b->compositor); + +@@ -6661,7 +6670,8 @@ switch_to_gl_renderer(struct drm_backend *b) + } + + wl_list_for_each(output, &b->compositor->output_list, base.link) +- drm_output_init_egl(output, b); ++ if(output->base.output_type == OUTPUT_DRM) ++ drm_output_init_egl(output, b); + + b->use_pixman = 0; + +diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c +index a71b7bd..8edb50b 100644 +--- a/libweston/compositor-fbdev.c ++++ b/libweston/compositor-fbdev.c +@@ -501,7 +501,7 @@ fbdev_output_enable(struct weston_output *base) + struct fbdev_head *head; + int fb_fd; + struct wl_event_loop *loop; +- ++ output->base.output_type = OUTPUT_FBDEV; + head = fbdev_output_get_head(output); + + /* Create the frame buffer. */ +diff --git a/libweston/compositor-headless.c b/libweston/compositor-headless.c +index 61a5bd9..f633cd7 100644 +--- a/libweston/compositor-headless.c ++++ b/libweston/compositor-headless.c +@@ -159,7 +159,7 @@ headless_output_enable(struct weston_output *base) + loop = wl_display_get_event_loop(b->compositor->wl_display); + output->finish_frame_timer = + wl_event_loop_add_timer(loop, finish_frame_handler, output); +- ++ output->base.output_type = OUTPUT_HEADLESS; + if (b->use_pixman) { + output->image_buf = malloc(output->base.current_mode->width * + output->base.current_mode->height * 4); +diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c +index 134e729..429370c 100644 +--- a/libweston/compositor-rdp.c ++++ b/libweston/compositor-rdp.c +@@ -554,7 +554,7 @@ rdp_output_enable(struct weston_output *base) + struct rdp_output *output = to_rdp_output(base); + struct rdp_backend *b = to_rdp_backend(base->compositor); + struct wl_event_loop *loop; +- ++ output->base.output_type = OUTPUT_RDP; + output->shadow_surface = pixman_image_create_bits(PIXMAN_x8r8g8b8, + output->base.current_mode->width, + output->base.current_mode->height, +diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c +index e80ecc1..808fc8f 100644 +--- a/libweston/compositor-wayland.c ++++ b/libweston/compositor-wayland.c +@@ -1221,7 +1221,7 @@ wayland_output_enable(struct weston_output *base) + struct wayland_backend *b = to_wayland_backend(base->compositor); + enum mode_status mode_status; + int ret = 0; +- ++ output->base.output_type = OUTPUT_WAYLAND; + weston_log("Creating %dx%d wayland output at (%d, %d)\n", + output->base.current_mode->width, + output->base.current_mode->height, +diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c +index 4a9d068..afbaa73 100644 +--- a/libweston/compositor-x11.c ++++ b/libweston/compositor-x11.c +@@ -933,7 +933,7 @@ x11_output_enable(struct weston_output *base) + XCB_EVENT_MASK_STRUCTURE_NOTIFY, + 0 + }; +- ++ output->base.output_type = OUTPUT_X11; + if (!b->no_input) + values[0] |= + XCB_EVENT_MASK_KEY_PRESS | +diff --git a/libweston/compositor.h b/libweston/compositor.h +index 8b7a102..60feda3 100644 +--- a/libweston/compositor.h ++++ b/libweston/compositor.h +@@ -169,6 +169,16 @@ enum dpms_enum { + WESTON_DPMS_OFF + }; + ++/* bit compatible with drm definitions. */ ++enum output_type { ++ OUTPUT_DRM, ++ OUTPUT_FBDEV, ++ OUTPUT_HEADLESS, ++ OUTPUT_RDP, ++ OUTPUT_WAYLAND, ++ OUTPUT_X11, ++ OUTPUT_WALTHAM ++}; + /** Represents a monitor + * + * This object represents a monitor (hardware backends like DRM) or a window +@@ -201,7 +211,7 @@ struct weston_head { + struct weston_output { + uint32_t id; + char *name; +- ++ enum output_type output_type; + /** Matches the lifetime from the user perspective */ + struct wl_signal user_destroy_signal; + +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch new file mode 100644 index 00000000..6fb963fb --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch @@ -0,0 +1,109 @@ +From 020508b35b2bf6c89d62961eb95e2f81d6381ab5 Mon Sep 17 00:00:00 2001 +From: Veeresh Kadasani +Date: Mon, 29 Jul 2019 17:07:00 +0900 +Subject: [PATCH 2/3] compositor-drm: introduce drm_get_dmafd_from_view + +This API enables to get dmafd from weston_view + +Signed-off-by: Veeresh Kadasani +--- + libweston/compositor-drm.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ + libweston/compositor-drm.h | 7 ++++++ + 2 files changed, 64 insertions(+) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 26a480c..2b99db5 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -5420,6 +5420,62 @@ drm_output_set_seat(struct weston_output *base, + } + + static int ++drm_get_dma_fd_from_view(struct weston_output *base, ++ struct weston_view *ev) ++{ ++ struct drm_backend *b = to_drm_backend(base->compositor); ++ struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; ++ struct gbm_bo *bo; ++ struct drm_fb *current; ++ struct linux_dmabuf_buffer *dmabuf; ++ bool is_opaque = drm_view_is_opaque(ev); ++ uint32_t format; ++ int fd, ret; ++ ++ if(!buffer) { ++ weston_log("buffer is NULL\n"); ++ return -1; ++ } ++ ++ if(dmabuf = linux_dmabuf_buffer_get(buffer->resource)) { ++ current = drm_fb_get_from_dmabuf(dmabuf, b, is_opaque); ++ if (!current) ++ { ++ fprintf(stderr, "failed to get drm_fb from dmabuf\n"); ++ return -1; ++ } ++ } ++ else if(ev->surface->buffer_ref.buffer->legacy_buffer) { ++ bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, ++ buffer->resource, GBM_BO_USE_SCANOUT); ++ if (!bo) { ++ weston_log("failed to get gbm_bo\n"); ++ return -1; ++ } ++ current = drm_fb_get_from_bo(bo, b, is_opaque, BUFFER_CLIENT); ++ ++ if (!current) { ++ weston_log("failed to get drm_fb from bo\n"); ++ return -1; ++ } ++ ++ } ++ else { ++ weston_log("Buffer is not supported\n"); ++ return -1; ++ } ++ ++ ret = drmPrimeHandleToFD(b->drm.fd, current->handles[0], ++ DRM_CLOEXEC, &fd); ++ free(current); ++ if (ret) { ++ weston_log("failed to create prime fd for front buffer\n"); ++ return -1; ++ } ++ ++ return fd; ++} ++static int + drm_output_init_gamma_size(struct drm_output *output) + { + struct drm_backend *backend = to_drm_backend(output->base.compositor); +@@ -6696,6 +6752,7 @@ static const struct weston_drm_output_api api = { + drm_output_set_mode, + drm_output_set_gbm_format, + drm_output_set_seat, ++ drm_get_dma_fd_from_view, + }; + + static struct drm_backend * +diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h +index 9c37c15..a82a2a9 100644 +--- a/libweston/compositor-drm.h ++++ b/libweston/compositor-drm.h +@@ -78,6 +78,13 @@ struct weston_drm_output_api { + */ + void (*set_seat)(struct weston_output *output, + const char *seat); ++ ++ /** Get the dma fd from drm view. ++ * ++ * The dma fd is got from weston_view. ++ * Returns fd on success, -1 on failure. ++ */ ++ int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view); + }; + + static inline const struct weston_drm_output_api * +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch new file mode 100644 index 00000000..e2655d12 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch @@ -0,0 +1,59 @@ +From 0dac780379228396a19048544b9e53d5aa407583 Mon Sep 17 00:00:00 2001 +From: Veeresh Kadasani +Date: Mon, 29 Jul 2019 17:08:31 +0900 +Subject: [PATCH 3/3] compositor-drm: get stride from drm_get_dma_fd_from_view + +Modify drm_get_dma_fd_from_view to get buffer stride. + +Signed-off-by: Veeresh Kadasani +--- + libweston/compositor-drm.c | 5 +++-- + libweston/compositor-drm.h | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 2b99db5..ec2765f 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -5421,7 +5421,7 @@ drm_output_set_seat(struct weston_output *base, + + static int + drm_get_dma_fd_from_view(struct weston_output *base, +- struct weston_view *ev) ++ struct weston_view *ev, int *buf_stride) + { + struct drm_backend *b = to_drm_backend(base->compositor); + struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; +@@ -5444,6 +5444,7 @@ drm_get_dma_fd_from_view(struct weston_output *base, + fprintf(stderr, "failed to get drm_fb from dmabuf\n"); + return -1; + } ++ *buf_stride=current->strides[0]; + } + else if(ev->surface->buffer_ref.buffer->legacy_buffer) { + bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, +@@ -5458,7 +5459,7 @@ drm_get_dma_fd_from_view(struct weston_output *base, + weston_log("failed to get drm_fb from bo\n"); + return -1; + } +- ++ *buf_stride=current->strides[0]; + } + else { + weston_log("Buffer is not supported\n"); +diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h +index a82a2a9..c2461b3 100644 +--- a/libweston/compositor-drm.h ++++ b/libweston/compositor-drm.h +@@ -84,7 +84,7 @@ struct weston_drm_output_api { + * The dma fd is got from weston_view. + * Returns fd on success, -1 on failure. + */ +- int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view); ++ int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view, int *buf_stride); + }; + + static inline const struct weston_drm_output_api * +-- +2.7.4 + diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch new file mode 100644 index 00000000..2f3b0108 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch @@ -0,0 +1,47 @@ +From 0ed62e1a0beb47e033f7632dbf6d2087366b7830 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Bollo?= +Date: Fri, 13 Oct 2017 14:05:56 +0200 +Subject: [PATCH] use XDG_RUNTIMESHARE_DIR + +When running with LSM Smack, the file returned by the +function 'os_create_anonymous_file' is tagged with the +security label of weston. That security label genrally doesn't +allow sharing of files? Then passing the vreated file descriptor +to the client application fails with EPERM. + +To allow file descriptors to be tagged with a security +label that allows clients to receive and use it, that +patch introduce the use of the environment variable +XDG_RUNTIMESHARE_DIR that takes precedence over +XDG_RUNTIME_DIR whe, creating anonymous file is needed. + +A correct setting of the shared directory using Smack's +transmute mechanism allows set up file tag for sharing. + +This patch was submitted upstream for discussion but +was rejected with the following reason (IIRC): "the +function 'os_create_anonymous_file' and the sharing +are obsolete and should not be used anymore. IVI was +requiring it but newer version don't use it". Halas, +even aligned with latest versions of IVI-shell and weston, +the patch is needed. Because of its simplicity, it can +remain maintained locally out of mainstream in the wait +of further investigations. + +Signed-off-by: José Bollo + +diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c +index e19fb61b..826e48b8 100644 +--- a/shared/os-compatibility.c ++++ b/shared/os-compatibility.c +@@ -157,7 +157,9 @@ os_create_anonymous_file(off_t size) + int fd; + int ret; + +- path = getenv("XDG_RUNTIME_DIR"); ++ path = getenv("XDG_RUNTIMESHARE_DIR"); ++ if (!path) ++ path = getenv("XDG_RUNTIME_DIR"); + if (!path) { + errno = ENOENT; + return -1; diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend new file mode 100644 index 00000000..bcfe11b1 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_%.bbappend @@ -0,0 +1,4 @@ +PACKAGECONFIG[notify] = "--enable-systemd-notify,--disable-systemd-notify,systemd" +PACKAGECONFIG_append = " notify" + +RRECOMMENDS_${PN}_remove = "weston-conf" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend new file mode 100644 index 00000000..108cca83 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_5.0.0.bbappend @@ -0,0 +1,27 @@ +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://use-XDG_RUNTIMESHARE_DIR.patch \ + file://0016-compositor-add-output-type-to-weston_output.patch \ + file://0017-compositor-drm-introduce-drm_get_dmafd_from_view.patch \ + file://0018-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch \ + " + + +EXTRA_OECONF_append = " --enable-sys-uid" diff --git a/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend new file mode 100644 index 00000000..44fcdcb0 --- /dev/null +++ b/meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston_6.0.0.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" + +SRC_URI_append = "\ + file://0001-Allow-regular-users-to-launch-Weston_2.0.0.patch \ + file://use-XDG_RUNTIMESHARE_DIR.patch \ + file://0002-compositor-add-output-type-to-weston_output.patch \ + file://0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch \ + " + +EXTRA_OECONF_append = " --enable-sys-uid" -- cgit 1.2.3-korg