From f05bcdadc5422b0d7fa9b094aec256c3e86791c2 Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Mon, 8 Feb 2016 14:24:41 +0900 Subject: [PATCH 01/16] Fix error by envsetup.sh when reuse a terminal When reuse a terminal between defferent targets, poky's setup script report error and setup is terminated. E.g. Setup for qemu first, then setup for porter. $ source meta-agl/scripts/envsetup.sh qemux86-64 build-qemu $ (bitbake or somthing) $ cd .. $ source meta-agl/scripts/envsetup.sh porter build-porter ERROR: OE-core's config sanity cheker detected a potential misconfiguration. ... Change-Id: Ie8e6f723d447b1ea53ada333f03bbfb4f03433c4 Signed-off-by: Tadao Tanikawa --- scripts/envsetup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 89713d968..79d2a25d8 100644 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -75,3 +75,4 @@ fi export BB_ENV_EXTRAWHITE +unset TEMPLATECONF -- 2.16.6 From 4904012b7748fd096681dda66f53ec5b06438495 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Thu, 21 Jan 2016 23:04:13 +0100 Subject: [PATCH 02/16] Add wandboard as target board MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds the wandboard as i.mx6 target. Change-Id: Iae25b991d475ce321b4192cbac130ad389021c72 Signed-off-by: Jan-Simon Möller --- scripts/envsetup.sh | 12 +- templates/wandboard/conf/bblayers.conf.sample | 25 +++ templates/wandboard/conf/conf-notes.txt | 6 + templates/wandboard/conf/local.conf.sample | 254 ++++++++++++++++++++++++++ 4 files changed, 292 insertions(+), 5 deletions(-) create mode 100644 templates/wandboard/conf/bblayers.conf.sample create mode 100644 templates/wandboard/conf/conf-notes.txt create mode 100644 templates/wandboard/conf/local.conf.sample diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 79d2a25d8..4925ef7e9 100644 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -36,6 +36,8 @@ case "$MACHINE" in ;; "qemux86-64") ;; + "wandboard") + ;; *) # nothing to do here echo "WARN: '$MACHINE' is not tested by AGL Distro" @@ -60,11 +62,6 @@ else BUILD_DIR=build fi -echo "envsetup: Setup build environment for poky/oe." -echo -e - -source poky/oe-init-build-env $BUILD_DIR - if [ -n "$DL_DIR" ]; then BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE DL_DIR" fi @@ -75,4 +72,9 @@ fi export BB_ENV_EXTRAWHITE +echo "envsetup: Setup build environment for poky/oe." +echo -e + +source poky/oe-init-build-env $BUILD_DIR + unset TEMPLATECONF diff --git a/templates/wandboard/conf/bblayers.conf.sample b/templates/wandboard/conf/bblayers.conf.sample new file mode 100644 index 000000000..25cd5142c --- /dev/null +++ b/templates/wandboard/conf/bblayers.conf.sample @@ -0,0 +1,25 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "6" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + ##OEROOT##/meta-yocto-bsp \ + ##OEROOT##/../meta-agl/meta-ivi-common \ + ##OEROOT##/../meta-agl/meta-agl \ + ##OEROOT##/../meta-agl/meta-agl-bsp \ + ##OEROOT##/../meta-openembedded/meta-oe \ + ##OEROOT##/../meta-openembedded/meta-multimedia \ + ##OEROOT##/../meta-openembedded/meta-efl \ + ##OEROOT##/../meta-fsl-arm \ + ##OEROOT##/../meta-fsl-arm-extra \ + " +BBLAYERS_NON_REMOVABLE ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + ##OEROOT##/../meta-agl/meta-agl \ + " diff --git a/templates/wandboard/conf/conf-notes.txt b/templates/wandboard/conf/conf-notes.txt new file mode 100644 index 000000000..f91379f98 --- /dev/null +++ b/templates/wandboard/conf/conf-notes.txt @@ -0,0 +1,6 @@ +Common targets are: + agl-image-ivi + agl-image-ivi-crosssdk + + agl-image-minimal + agl-image-weston diff --git a/templates/wandboard/conf/local.conf.sample b/templates/wandboard/conf/local.conf.sample new file mode 100644 index 000000000..5334a8998 --- /dev/null +++ b/templates/wandboard/conf/local.conf.sample @@ -0,0 +1,254 @@ +# Machine Selection: MinnowBoard MAX +MACHINE ?= "wandboard" + +# +# This file is your local configuration file and is where all local user settings +# are placed. The comments in this file give some guide to the options a new user +# to the system might want to change but pretty much any configuration option can +# be set in this file. More adventurous users can look at local.conf.extended +# which contains other examples of configuration which can be placed in this file +# but new users likely won't need any of them initially. +# +# Lines starting with the '#' character are commented out and in some cases the +# default values are provided as comments to show people example syntax. Enabling +# the option is a question of removing the # character and making any change to the +# variable as required. + +# +# Machine Selection +# +# You need to select a specific machine to target the build with. There are a selection +# of emulated machines available which can boot and run in the QEMU emulator: +# +#MACHINE ?= "qemuarm" +#MACHINE ?= "qemumips" +#MACHINE ?= "qemuppc" +#MACHINE ?= "qemux86" +#MACHINE ?= "qemux86-64" +# +# There are also the following hardware board target machines included for +# demonstration purposes: +# +#MACHINE ?= "beaglebone" +#MACHINE ?= "genericx86" +#MACHINE ?= "genericx86-64" +#MACHINE ?= "mpc8315e-rdb" +#MACHINE ?= "edgerouter" +# +# This sets the default machine to be qemux86 if no other machine is selected: +MACHINE ??= "qemux86-64" + +# +# Where to place downloads +# +# During a first build the system will download many different source code tarballs +# from various upstream projects. This can take a while, particularly if your network +# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you +# can preserve this directory to speed up this part of subsequent builds. This directory +# is safe to share between multiple builds on the same machine too. +# +# The default is a downloads directory under TOPDIR which is the build directory. +# +#DL_DIR ?= "${TOPDIR}/downloads" + +# +# Where to place shared-state files +# +# BitBake has the capability to accelerate builds based on previously built output. +# This is done using "shared state" files which can be thought of as cache objects +# and this option determines where those files are placed. +# +# You can wipe out TMPDIR leaving this directory intact and the build would regenerate +# from these files if no changes were made to the configuration. If changes were made +# to the configuration, only shared state files where the state was still valid would +# be used (done using checksums). +# +# The default is a sstate-cache directory under TOPDIR. +# +#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" + +# +# Where to place the build output +# +# This option specifies where the bulk of the building work should be done and +# where BitBake should place its temporary files and output. Keep in mind that +# this includes the extraction and compilation of many applications and the toolchain +# which can use Gigabytes of hard disk space. +# +# The default is a tmp directory under TOPDIR. +# +#TMPDIR = "${TOPDIR}/tmp" + +# +# Default policy config +# +# The distribution setting controls which policy settings are used as defaults. +# The default value is fine for general Yocto project use, at least initially. +# Ultimately when creating custom policy, people will likely end up subclassing +# these defaults. +# +#DISTRO ?= "poky" +DISTRO ?= "poky-agl" +# As an example of a subclass there is a "bleeding" edge policy configuration +# where many versions are set to the absolute latest code from the upstream +# source control systems. This is just mentioned here as an example, its not +# useful to most new users. +# DISTRO ?= "poky-bleeding" + +# +# Package Management configuration +# +# This variable lists which packaging formats to enable. Multiple package backends +# can be enabled at once and the first item listed in the variable will be used +# to generate the root filesystems. +# Options are: +# - 'package_deb' for debian style deb files +# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) +# - 'package_rpm' for rpm style packages +# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" +# We default to rpm: +PACKAGE_CLASSES ?= "package_rpm" + +# +# SDK/ADT target architecture +# +# This variable specifies the architecture to build SDK/ADT items for and means +# you can build the SDK packages for architectures other than the machine you are +# running the build on (i.e. building i686 packages on an x86_64 host). +# Supported values are i686 and x86_64 +#SDKMACHINE ?= "i686" + +# +# Extra image configuration defaults +# +# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated +# images. Some of these options are added to certain image types automatically. The +# variable can contain the following options: +# "dbg-pkgs" - add -dbg packages for all installed packages +# (adds symbol information for debugging/profiling) +# "dev-pkgs" - add -dev packages for all installed packages +# (useful if you want to develop against libs in the image) +# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages +# (useful if you want to run the package test suites) +# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) +# "tools-debug" - add debugging tools (gdb, strace) +# "eclipse-debug" - add Eclipse remote debugging support +# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind) +# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) +# "debug-tweaks" - make an image suitable for development +# e.g. ssh root access has a blank password +# There are other application targets that can be used here too, see +# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. +# We default to enabling the debugging tweaks. +EXTRA_IMAGE_FEATURES = "debug-tweaks" + +# +# Additional image features +# +# The following is a list of additional classes to use when building images which +# enable extra features. Some available options which can be included in this variable +# are: +# - 'buildstats' collect build statistics +# - 'image-mklibs' to reduce shared library files size for an image +# - 'image-prelink' in order to prelink the filesystem image +# - 'image-swab' to perform host system intrusion detection +# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink +# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended +USER_CLASSES ?= "buildstats image-mklibs image-prelink" + +# +# Runtime testing of images +# +# The build system can test booting virtual machine images under qemu (an emulator) +# after any root filesystems are created and run tests against those images. To +# enable this uncomment this line. See classes/testimage(-auto).bbclass for +# further details. +#TEST_IMAGE = "1" +# +# Interactive shell configuration +# +# Under certain circumstances the system may need input from you and to do this it +# can launch an interactive shell. It needs to do this since the build is +# multithreaded and needs to be able to handle the case where more than one parallel +# process may require the user's attention. The default is iterate over the available +# terminal types to find one that works. +# +# Examples of the occasions this may happen are when resolving patches which cannot +# be applied, to use the devshell or the kernel menuconfig +# +# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none +# Note: currently, Konsole support only works for KDE 3.x due to the way +# newer Konsole versions behave +#OE_TERMINAL = "auto" +# By default disable interactive patch resolution (tasks will just fail instead): +PATCHRESOLVE = "noop" + +# +# Disk Space Monitoring during the build +# +# Monitor the disk space during the build. If there is less that 1GB of space or less +# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully +# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort +# of the build. The reason for this is that running completely out of space can corrupt +# files and damages the build in ways which may not be easily recoverable. +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can +# used to accelerate build time. This variable can be used to configure the system +# to search other mirror locations for these objects before it builds the data itself. +# +# This can be a filesystem directory, or a remote url such as http or ftp. These +# would contain the sstate-cache results from previous builds (possibly from other +# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the +# cache locations to check for the shared objects. +# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH +# at the end as shown in the examples below. This will be substituted with the +# correct path within the directory structure. +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + + +# +# Qemu configuration +# +# By default qemu will build with a builtin VNC server where graphical output can be +# seen. The two lines below enable the SDL backend too. This assumes there is a +# libsdl library available on your build system. +PACKAGECONFIG_append_pn-qemu-native = " sdl" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" +ASSUME_PROVIDED += "libsdl-native" + +############### +# +# AGL specifics +# +############### + +# AGL includes all kernel modules here for ease-of-use during development. +# Comment this out to be able to select the kernel modules yourself. +IMAGE_INSTALL_append = " kernel-modules" + +# Likewise as we included all kernel modules by default in the filesystem, +# we do not need a separate tarball stored. +# Comment this out to receive the separate modules tarbal again. +MODULE_TARBALL_DEPLOY ?= "0" + +############### +# /END AGL +############### + + +# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to +# track the version of this file when it was generated. This can safely be ignored if +# this doesn't mean anything to you. +CONF_VERSION = "1" -- 2.16.6 From d33e1cc64a0b204bbacca793569b581024133061 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Fri, 19 Feb 2016 22:17:01 +0100 Subject: [PATCH 03/16] Allow alias names in envsetup.sh - here for minnowboard MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commit allows us to define also alias names for MACHINE. TEMPLATECONF moved down for this. Change-Id: Ibec9882ac5a7c3bf734ead8a05b452bb655bbeeb Signed-off-by: Jan-Simon Möller --- scripts/envsetup.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 4925ef7e9..0b783e9a2 100644 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -7,10 +7,6 @@ fi MACHINE="$1" -# set template conf for each -if [ -z "$TEMPLATECONF" ]; then - TEMPLATECONF="$PWD/meta-agl-demo/templates/$MACHINE/conf" -fi case "$MACHINE" in "porter") @@ -32,6 +28,10 @@ case "$MACHINE" in ;; "intel-corei7-64") ;; + "minnowboard") + # alias for minnowboardmax + MACHINE="intel-corei7-64" + ;; "qemux86") ;; "qemux86-64") @@ -44,9 +44,17 @@ case "$MACHINE" in ;; esac +# set template conf for each +if [ -z "$TEMPLATECONF" ]; then + if [ -d "$PWD/meta-agl-demo/templates/$MACHINE/conf" ]; then + TEMPLATECONF="$PWD/meta-agl-demo/templates/$MACHINE/conf" + fi +fi + echo "envsetup: Set '$1 as MACHINE." export MACHINE +# fallback if [ ! -d "$TEMPLATECONF" ]; then # Allow to use templates at meta-agl-demo/conf TEMPLATECONF="$PWD/meta-agl-demo/conf" -- 2.16.6 From b3a5a720f96df72810b01d2c1d599015924811e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Fri, 26 Feb 2016 06:25:50 +0100 Subject: [PATCH 04/16] Temporary build fix for the wandboard MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This temporary fix conditional to the wandboard is used to overcome a build breakage in the examples of wayland-ivi-extension. Change-Id: If5eccbce94e8aeb73cf303c72284510f966714f3 Signed-off-by: Jan-Simon Möller --- .../wayland/wayland-ivi-extension/wandboard_fix_build.patch | 13 +++++++++++++ .../recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch new file mode 100644 index 000000000..86b448be1 --- /dev/null +++ b/meta-ivi-common/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-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb index 56bb560ad..7bc619072 100644 --- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb +++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb @@ -10,6 +10,8 @@ DEPENDS = "weston" SRC_URI = "git://git.projects.genivi.org/${PN}.git \ file://apply_weston-1.5.x.patch \ " +SRC_URI_append_wandboard = "file://wandboard_fix_build.patch" + SRCREV = "8f0874b606b8e2a9385af947728905735bad3939" S = "${WORKDIR}/git" -- 2.16.6 From 20dfa8d262d6de0c689cce0d8fc0b76a40ba5a75 Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Wed, 10 Feb 2016 19:20:25 +0900 Subject: [PATCH 05/16] Add package group and bitbake target for Quality Assurance New packagegroup and bitbake target are added which includes utilities for testing distribution. It is assumed to be used in the Quality Assurance of AGL Distro. New package group: packagegroup-agl-test packagegroup-ivi-common-test New target: agl-image-ivi-qa Change-Id: Ifb20d8a140dd71de6c464499e1b07fd9a0e36457 Signed-off-by: Tadao Tanikawa --- meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb | 11 +++++++++++ .../recipes-test/packagegroups/packagegroup-agl-test.bb | 15 +++++++++++++++ .../packagegroups/packagegroup-ivi-common-test.bb | 15 +++++++++++++++ templates/intel-corei7-64/conf/conf-notes.txt | 1 + templates/qemux86-64/conf/conf-notes.txt | 1 + templates/qemux86/conf/conf-notes.txt | 1 + 6 files changed, 44 insertions(+) create mode 100644 meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb create mode 100644 meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb create mode 100644 meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb diff --git a/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb b/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb new file mode 100644 index 000000000..bd062660a --- /dev/null +++ b/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb @@ -0,0 +1,11 @@ +SUMMARY = "A basic system of AGL distribution of IVI profile for Quality Assurance(QA)" +DESCRIPTION = "A basic set of AGL Distribution. This image also has additional \ +packages (e.g. commandline tools) for Quality Assurance(QA)." + +require agl-image-ivi.bb + +IMAGE_INSTALL_append = " \ + packagegroup-agl-test \ + packagegroup-ivi-common-test \ + " + diff --git a/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb b/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb new file mode 100644 index 000000000..2a18cbc89 --- /dev/null +++ b/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb @@ -0,0 +1,15 @@ +SUMMARY = "Utilities for testing of AGL" +DESCRIPTION = "A set of packages required by testing AGL for Quality Assurance" + +LICENSE = "MIT" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-agl-test \ + " + +ALLOW_EMPTY_${PN} = "1" + +RDEPENDS_${PN} += "\ + " diff --git a/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb b/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb new file mode 100644 index 000000000..e613d43b0 --- /dev/null +++ b/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb @@ -0,0 +1,15 @@ +SUMMARY = "Utilities for testing of AGL" +DESCRIPTION = "A set of common packages required by testing AGL for Quality Assurance" + +LICENSE = "MIT" + +inherit packagegroup + +PACKAGES = "\ + packagegroup-ivi-common-test \ + " + +ALLOW_EMPTY_${PN} = "1" + +RDEPENDS_${PN} += "\ + " diff --git a/templates/intel-corei7-64/conf/conf-notes.txt b/templates/intel-corei7-64/conf/conf-notes.txt index f91379f98..80246306e 100644 --- a/templates/intel-corei7-64/conf/conf-notes.txt +++ b/templates/intel-corei7-64/conf/conf-notes.txt @@ -1,6 +1,7 @@ Common targets are: agl-image-ivi agl-image-ivi-crosssdk + agl-image-ivi-qa agl-image-minimal agl-image-weston diff --git a/templates/qemux86-64/conf/conf-notes.txt b/templates/qemux86-64/conf/conf-notes.txt index f91379f98..80246306e 100644 --- a/templates/qemux86-64/conf/conf-notes.txt +++ b/templates/qemux86-64/conf/conf-notes.txt @@ -1,6 +1,7 @@ Common targets are: agl-image-ivi agl-image-ivi-crosssdk + agl-image-ivi-qa agl-image-minimal agl-image-weston diff --git a/templates/qemux86/conf/conf-notes.txt b/templates/qemux86/conf/conf-notes.txt index f91379f98..80246306e 100644 --- a/templates/qemux86/conf/conf-notes.txt +++ b/templates/qemux86/conf/conf-notes.txt @@ -1,6 +1,7 @@ Common targets are: agl-image-ivi agl-image-ivi-crosssdk + agl-image-ivi-qa agl-image-minimal agl-image-weston -- 2.16.6 From 67662f237904ad175fc1137204356225e0507d9e Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Mon, 14 Mar 2016 09:03:31 +0000 Subject: [PATCH 06/16] Upgrade to Wayland/Weston 1.9.0 Yocto 2.0 ("Jethro") provides Wayland and Weston 1.8.0; manually upgrading to 1.9.0 does not break compatibility with existing frameworks (Qt..), while at the same time allowing easier integration of mandatory components such as Weston IVI-Shell and Wayland IVI Extension. We can thus in the same pass remove backport patches for these 2 components. Here is the related discussion on the mailing list : http://lists.linuxfoundation.org/pipermail/ automotive-discussions/2016-March/001623.html Change-Id: I874eac50ff64d8b93e32910b6f1297002faa06a5 Signed-off-by: Manuel Bachmann --- meta-agl/recipes-graphics/wayland/wayland_1.9.0.bb | 41 + .../wayland/weston/0001-make-error-portable.patch | 80 + .../weston/make-lcms-explicitly-configurable.patch | 43 + .../make-libwebp-explicitly-configurable.patch | 37 + .../recipes-graphics/wayland/weston/weston.desktop | 9 + .../recipes-graphics/wayland/weston/weston.png | Bin 0 -> 2383 bytes meta-agl/recipes-graphics/wayland/weston_1.9.0.bb | 93 + .../wayland-ivi-extension/apply_weston-1.5.x.patch | 202 -- .../wayland/wayland-ivi-extension_1.5.0.bb | 1 - ...Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch | 2392 -------------------- ...-Shell-use-primary-screen-for-resolution.patch} | 0 ...weston_1.8.0.bbappend => weston_1.9.0.bbappend} | 3 +- 12 files changed, 304 insertions(+), 2597 deletions(-) create mode 100644 meta-agl/recipes-graphics/wayland/wayland_1.9.0.bb create mode 100644 meta-agl/recipes-graphics/wayland/weston/0001-make-error-portable.patch create mode 100644 meta-agl/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch create mode 100644 meta-agl/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch create mode 100644 meta-agl/recipes-graphics/wayland/weston/weston.desktop create mode 100644 meta-agl/recipes-graphics/wayland/weston/weston.png create mode 100644 meta-agl/recipes-graphics/wayland/weston_1.9.0.bb delete mode 100644 meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/apply_weston-1.5.x.patch delete mode 100644 meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch rename meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/{0002-IVI-Shell-use-primary-screen-for-resolution.patch => 0001-IVI-Shell-use-primary-screen-for-resolution.patch} (100%) rename meta-ivi-common/recipes-graphics/wayland/{weston_1.8.0.bbappend => weston_1.9.0.bbappend} (52%) diff --git a/meta-agl/recipes-graphics/wayland/wayland_1.9.0.bb b/meta-agl/recipes-graphics/wayland/wayland_1.9.0.bb new file mode 100644 index 000000000..00d2a5623 --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/wayland_1.9.0.bb @@ -0,0 +1,41 @@ +SUMMARY = "Wayland, a protocol between a compositor and clients" +DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \ +as well as a C library implementation of that protocol. The compositor can be \ +a standalone display server running on Linux kernel modesetting and evdev \ +input devices, an X application, or a wayland client itself. The clients can \ +be traditional applications, X servers (rootless or fullscreen) or other \ +display servers." +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \ + file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce" + +SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz" +SRC_URI[md5sum] = "5e141b3f2a7005d6c89d6f233c87c317" +SRC_URI[sha256sum] = "9c8770720aa0034479735f58a4dc4ca9b172ecfede28f5134312e135b7301efa" + +EXTRA_OECONF_class-native = "--disable-documentation" + +inherit autotools pkgconfig + +BBCLASSEXTEND = "native nativesdk" + +DEPENDS = "expat libffi wayland-native" + +EXTRA_OECONF = "--disable-documentation --with-host-scanner" + +# Wayland installs a M4 macro for other projects to use, which uses the target +# pkg-config to find files. Replace pkg-config with pkg-config-native. +do_install_append_class-native() { + sed -e 's,PKG_CHECK_MODULES(.*),,g' \ + -e 's,$PKG_CONFIG,pkg-config-native,g' \ + -i ${D}/${datadir}/aclocal/wayland-scanner.m4 +} + +sysroot_stage_all_append_class-target () { + rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4 + cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/ +} + +FILES_${PN} = "${libdir}/*${SOLIBS}" +FILES_${PN}-dev += "${bindir} ${datadir}/wayland" diff --git a/meta-agl/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/meta-agl/recipes-graphics/wayland/weston/0001-make-error-portable.patch new file mode 100644 index 000000000..148848d8d --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/weston/0001-make-error-portable.patch @@ -0,0 +1,80 @@ +From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 29 May 2015 20:56:00 -0700 +Subject: [PATCH weston] make error() portable + +error() is not posix but gnu extension so may not be available on all +kind of systemsi e.g. musl. + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted + + configure.ac | 2 ++ + src/weston-error.h | 20 ++++++++++++++++++++ + src/weston-launch.c | 2 +- + 3 files changed, 23 insertions(+), 1 deletion(-) + create mode 100644 src/weston-error.h + +diff --git a/configure.ac b/configure.ac +index 263fc22..f52cd62 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -57,6 +57,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[], + [[#include ]]) + AC_CHECK_HEADERS([execinfo.h]) + ++AC_CHECK_HEADERS([error.h]) ++ + AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate]) + + COMPOSITOR_MODULES="wayland-server >= 1.7.93 pixman-1 >= 0.25.2" +diff --git a/src/weston-error.h b/src/weston-error.h +new file mode 100644 +index 0000000..2089d02 +--- /dev/null ++++ b/src/weston-error.h +@@ -0,0 +1,20 @@ ++#ifndef _WESTON_ERROR_H ++#define _WESTON_ERROR_H ++ ++#if defined(HAVE_ERROR_H) ++#include ++#else ++#include ++#include ++#define _weston_error(S, E, F, ...) do { \ ++ if (E) \ ++ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \ ++ else \ ++ err(S, F, ##__VA_ARGS__); \ ++} while(0) ++ ++#define error _weston_error ++#endif ++ ++#endif ++ +diff --git a/src/weston-launch.c b/src/weston-launch.c +index 10c66de..3e6d30a 100644 +--- a/src/weston-launch.c ++++ b/src/weston-launch.c +@@ -30,7 +30,6 @@ + #include + #include + +-#include + #include + + #include +@@ -56,6 +55,7 @@ + #endif + + #include "weston-launch.h" ++#include "weston-error.h" + + #define DRM_MAJOR 226 + +-- +2.1.4 + diff --git a/meta-agl/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch b/meta-agl/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch new file mode 100644 index 000000000..35e6d6ff5 --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch @@ -0,0 +1,43 @@ +weston-1.5.0/configure.ac: make lcms explicitly configurable + +The lcms package is outside of openembedded-core, so make it +explicitly configurable. Make it deterministic, so that if lcms +dependencies are missing, autoconf throws a fatal error. Follow +upstream style to make it more likely to be merged. + +Upstream-Status: Pending + +Index: weston-1.5.0/configure.ac +=================================================================== +--- weston-1.5.0.orig/configure.ac ++++ weston-1.5.0/configure.ac +@@ -491,12 +491,24 @@ AC_ARG_ENABLE(demo-clients-install, + enable_demo_clients_install=no) + AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"]) + +-PKG_CHECK_MODULES(LCMS, lcms2, +- [have_lcms=yes], [have_lcms=no]) +-if test "x$have_lcms" = xyes; then +- AC_DEFINE(HAVE_LCMS, 1, [Have lcms support]) ++AC_ARG_ENABLE(lcms, ++ AS_HELP_STRING([--disable-lcms], ++ [Disable lcms support]),, ++ enable_lcms=auto) ++AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes]) ++if test "x$enable_lcms" != "xno"; then ++ PKG_CHECK_MODULES(LCMS, ++ lcms2, ++ [have_lcms=yes], ++ [have_lcms=no]) ++ if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then ++ AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found]) ++ fi ++ if test "x$have_lcms" = "xyes"; then ++ enable_lcms=yes ++ AC_DEFINE(HAVE_LCMS, 1, [Have lcms support]) ++ fi + fi +-AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes]) + + AC_PATH_PROG([wayland_scanner], [wayland-scanner]) + if test x$wayland_scanner = x; then diff --git a/meta-agl/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch b/meta-agl/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch new file mode 100644 index 000000000..ad07d4fc2 --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch @@ -0,0 +1,37 @@ + +The libwebp package is outside of openembedded-core, so make it +explicitly configurable. Make it deterministic, so that if libwebp +dependencies are missing, autoconf throws a fatal error. + +Upstream-Status: Pending + +Index: weston-1.5.0/configure.ac +=================================================================== +--- weston-1.5.0.orig/configure.ac ++++ weston-1.5.0/configure.ac +@@ -268,9 +268,22 @@ fi + + PKG_CHECK_MODULES(PIXMAN, [pixman-1]) + PKG_CHECK_MODULES(PNG, [libpng]) +-PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no]) +-AS_IF([test "x$have_webp" = "xyes"], +- [AC_DEFINE([HAVE_WEBP], [1], [Have webp])]) ++AC_ARG_ENABLE(webp, ++ AS_HELP_STRING([--disable-webp], ++ [Disable libwebp support]),, ++ enable_webp=auto) ++AM_CONDITIONAL(HAVE_WEBP, [test "x$enable_webp" = xyes]) ++AS_IF([test "x$enable_webp" != "xno"], ++ PKG_CHECK_MODULES(WEBP, ++ [libwebp], ++ [have_webp=yes], ++ [have_webp=no]) ++ AS_IF([test "x$have_webp" = "xno" -a "x$enable_webp" = "xyes"], ++ AC_MSG_ERROR([libwebp support explicitly request, but lipwebp could not be found])) ++ AS_IF([test "x$have_webp" = "xyes"], ++ [enable_webp=yes] ++ [AC_DEFINE([HAVE_WEBP], [1], [Have webp])]) ++) + + AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],, + enable_vaapi_recorder=auto) diff --git a/meta-agl/recipes-graphics/wayland/weston/weston.desktop b/meta-agl/recipes-graphics/wayland/weston/weston.desktop new file mode 100644 index 000000000..1086ae8bf --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/weston/weston.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=Weston +Comment=Wayland Compostitor +Exec=weston +Icon=weston +Terminal=false +Categories=Utility; diff --git a/meta-agl/recipes-graphics/wayland/weston/weston.png b/meta-agl/recipes-graphics/wayland/weston/weston.png new file mode 100644 index 0000000000000000000000000000000000000000..ea8b7e0e233c86301a88e5bc925f09b3de2f9dec GIT binary patch literal 2383 zcmV-V39$BwP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^000SaNLh0L00vqB00vqCV0pn~000Od zNklxQqBu<>r2)6lHU)*YGzD6ustAQm;suEZ zhy*;Kma`z8lfl}Zs zt(P8+CIeqHN%sZD!;$E}D=->`wJ4A{*-ZKJL!lV-N%25gfT6XP%v!n#FS3o9;k$el zEw@6~y|s39h@#XAXucVg0ZW%aSL#DjK(fo5S{d|YSh)e1F0G!WRlt)hzVZG*NdkI5 z15N8gicM(04cdm>n3{&%QE--6R?H@77?5XY$sl)Z6)5!lt3D_jSY$*2q=0V$cTzkZ zbwTT`kn9Y_lnM4C*!e(lq7zo`f|f1r49k!^0hMem6S^$f=)Y@ltl+)tUPyMy^Xv%B zzBojZFQY3;9}=c~E`YBhg%g%8L=7qvdLD*Eb8QCtFK&aj!6{1pY8wJ09mH6&4LU#O z_OoDSKRA{Gz61;c7@=ijJ8*}u-Bp=3hxMW$`r+! zjnKSFK9{dT?sc#8YTywsra*%IA;JM~=b|oWlBP{-2sUX7u0202?EA<0ylV|`hAvyK#*9d29WHCbRpF%B?F|=_k9k`2FX+- zCF~dt0@7@Tj-b*|7=y|}*un{?r4zhnEMz(sO*4BP=#OKx0xL%eajTmqLu-m;X*{V{|`$$li(87AM z6WVTzx~?!5cgS09$n@!suwgVxWsa*sO&fyQc6}TY?eaXc4=(&vo;&V_)@?!Q&_LUV z#EqWhPe5fpj;T%$RN%ViO|pj7TTh$TLHb5W_dwTu(q=Eh#51sPRBBJM6Z$?2h8c`& z{h$QAC&kmXiR1==;m#u{x0MAbjJq?mYlkFzgo*A?2K6TU56F%}aa^`60NoD=s~RxV z(0of&Pu;y2mbdE+{8Ty@d@f(99ij|a`>6Zu2Ke-TsN|t|O2G9zEE(9n6Bgfs^bL?1 z40KeokbkQlsGP^t`Pk2;v+=8bs!x6%vkR}eZd`(^e{`1=1uMS@P49!2ZQ^p@?7ty* zyxvX5gjc6dBAfX{n=3QPG?l-=AhaZRdEmXr-oO9eMlQMOZEP+W-9_@-A9 zP5@V6djYZ)|`OK z9lZv%3aLU)+{c%JF+=U}8}dOBK{D{W zNWcX$b5JrYEOxPeW@^NEcx`ivaBdIePgVzb3HT9mC`RoFfeNwp3h)?Sl~+jMp80-s zLuO5j>*7QqZV!K-ABE|C)qrf^7f9In7$Qtnx$!$bFf>d)2jjbgLYX@v?A5#MwdSGV zUQgILnE085LLe33IpBLhA!NJ8eIBq1@HDU+_ehPl1laKh;p`IM;*?=-ME);6 zEA9*?kOzJOd=r=p1M-ND759{*kWevaII={P{KphDM+LD?Pgu2mQSKH>guL3XT(c-1&a zK^y}P0DFNqfJ!|u%Yjlr7cd9d{uSdP-&}^)&6_Bm*?_&c205a&x)WIht^lWzg?`-C zqn88oZkY0~$Z9TQrB4E|smyC$?(h~gMd+&X-GW#aR1B~%z*x0&tFCOWlNI>MZcDkiHCXvpcpM70000bbVXQnWMOn=I&E)cX=Zr -Date: Wed, 30 Sep 2015 05:22:25 +0200 -Subject: [PATCH] Backport to Wayland/Weston 1.9.0 > 1.5.0. - -Downgrade requirements to Wayland/Weston 1.9.0 > 1.5.0. - -"wl_display_roundtrip_queue()" did not exist at the time, -so just use the wrapper functions instead. - -Signed-off-by: Manuel Bachmann ---- - .../ilmClient/src/ilm_client_wayland_platform.c | 15 ++----- - .../ilmControl/src/ilm_control_wayland_platform.c | 52 +++++++++++++++++++--- - protocol/CMakeLists.txt | 4 +- - weston-ivi-shell/CMakeLists.txt | 4 +- - 4 files changed, 53 insertions(+), 22 deletions(-) - -diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c -index 55b1621..8730616 100644 ---- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c -+++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c -@@ -61,7 +61,6 @@ struct ilm_client_context { - struct wl_registry *registry; - struct wl_compositor *compositor; - struct ivi_application *ivi_application; -- struct wl_event_queue *queue; - - struct wl_list list_surface; - -@@ -167,12 +166,6 @@ destroy_client_resouses(void) - ctx->ivi_application = NULL; - } - -- if (ctx->queue) -- { -- wl_event_queue_destroy(ctx->queue); -- ctx->queue = NULL; -- } -- - if (ctx->registry) - { - wl_registry_destroy(ctx->registry); -@@ -203,21 +196,19 @@ init_client(void) - - wl_list_init(&ctx->list_surface); - -- ctx->queue = wl_display_create_queue(ctx->display); - ctx->registry = wl_display_get_registry(ctx->display); - if (ctx->registry == NULL) { -- wl_event_queue_destroy(ctx->queue); - fprintf(stderr, "Failed to get registry\n"); - return; - } - -- wl_proxy_set_queue((void*)ctx->registry, ctx->queue); - if (wl_registry_add_listener(ctx->registry, - ®istry_client_listener, ctx)) { - fprintf(stderr, "Failed to add registry listener\n"); - return; - } -- wl_display_roundtrip_queue(ctx->display, ctx->queue); -+ wl_display_dispatch(ctx->display); -+ wl_display_roundtrip(ctx->display); - - if ((ctx->display == NULL) || (ctx->ivi_application == NULL)) { - fprintf(stderr, "Failed to connect display at ilm_client\n"); -@@ -239,7 +230,7 @@ get_client_instance(void) - exit(0); - } - -- wl_display_roundtrip_queue(ctx->display, ctx->queue); -+ wl_display_roundtrip(ctx->display); - - return ctx; - } -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 8910df5..61bdfc5 100644 ---- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c -+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c -@@ -76,6 +76,46 @@ struct screen_context { - struct ilm_control_context *ctx; - }; - -+static void roundtrip_done(void *data, struct wl_callback *callback, -+ uint32_t serial) -+{ -+ (void) serial; -+ -+ *(int *)data = 1; -+ -+ wl_callback_destroy(callback); -+} -+ -+static struct wl_callback_listener roundtrip_listener = {roundtrip_done}; -+ -+int display_roundtrip_queue(struct wl_display *display, -+ struct wl_event_queue *queue) -+{ -+ int done = 0; -+ int ret = 0; -+ struct wl_callback *callback = wl_display_sync(display); -+ -+ if (! callback) -+ { -+ return -1; -+ } -+ -+ wl_proxy_set_queue((void *)callback, queue); -+ wl_callback_add_listener(callback, &roundtrip_listener, &done); -+ -+ while (ret != -1 && !done) -+ { -+ ret = wl_display_dispatch_queue(display, queue); -+ } -+ -+ if (ret == -1 && !done) -+ { -+ wl_callback_destroy(callback); -+ } -+ -+ return ret; -+} -+ - static inline void lock_context(struct ilm_control_context *ctx) - { - pthread_mutex_lock(&ctx->mutex); -@@ -1304,11 +1344,11 @@ init_control(void) - - if ( - // first level objects; ivi_controller -- wl_display_roundtrip_queue(wl->display, wl->queue) == -1 || -+ display_roundtrip_queue(wl->display, wl->queue) == -1 || - // second level object: ivi_controller_surfaces/layers -- wl_display_roundtrip_queue(wl->display, wl->queue) == -1 || -+ display_roundtrip_queue(wl->display, wl->queue) == -1 || - // third level objects: ivi_controller_surfaces/layers properties -- wl_display_roundtrip_queue(wl->display, wl->queue) == -1) -+ display_roundtrip_queue(wl->display, wl->queue) == -1) - { - fprintf(stderr, "Failed to initialize wayland connection: %s\n", strerror(errno)); - return -1; -@@ -1349,7 +1389,7 @@ ilmErrorTypes impl_sync_and_acquire_instance(struct ilm_control_context *ctx) - - lock_context(ctx); - -- if (wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) == -1) { -+ if (display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) == -1) { - int err = wl_display_get_error(ctx->wl.display); - fprintf(stderr, "Error communicating with wayland: %s\n", strerror(err)); - unlock_context(ctx); -@@ -2454,7 +2494,7 @@ ilm_getPropertiesOfSurface(t_ilm_uint surfaceID, - // request statistics for surface - ivi_controller_surface_send_stats(ctx_surf->controller); - // force submission -- int ret = wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue); -+ int ret = display_roundtrip_queue(ctx->wl.display, ctx->wl.queue); - - // If we got an error here, there is really no sense - // in returning the properties as something is fundamentally -@@ -2567,7 +2607,7 @@ ilm_commitChanges(void) - if (ctx->wl.controller != NULL) { - ivi_controller_commit_changes(ctx->wl.controller); - -- if (wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) != -1) -+ if (display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) != -1) - { - returnValue = ILM_SUCCESS; - } -diff --git a/protocol/CMakeLists.txt b/protocol/CMakeLists.txt -index 6842131..207b8f1 100644 ---- a/protocol/CMakeLists.txt -+++ b/protocol/CMakeLists.txt -@@ -22,8 +22,8 @@ cmake_minimum_required (VERSION 2.6) - project(ivi-extension-protocol) - - find_package(PkgConfig REQUIRED) --pkg_check_modules(WAYLAND_CLIENT wayland-client>=1.9.0 REQUIRED) --pkg_check_modules(WAYLAND_SERVER wayland-server>=1.9.0 REQUIRED) -+pkg_check_modules(WAYLAND_CLIENT wayland-client>=1.5.0 REQUIRED) -+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.5.0 REQUIRED) - - find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) - -diff --git a/weston-ivi-shell/CMakeLists.txt b/weston-ivi-shell/CMakeLists.txt -index c2664df..927e3f5 100644 ---- a/weston-ivi-shell/CMakeLists.txt -+++ b/weston-ivi-shell/CMakeLists.txt -@@ -23,8 +23,8 @@ cmake_minimum_required (VERSION 2.6) - project(ivi-controller) - - find_package(PkgConfig REQUIRED) --pkg_check_modules(WAYLAND_SERVER wayland-server>=1.9.0 REQUIRED) --pkg_check_modules(WESTON weston>=1.9.0 REQUIRED) -+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.5.0 REQUIRED) -+pkg_check_modules(WESTON weston>=1.5.0 REQUIRED) - pkg_check_modules(PIXMAN pixman-1 REQUIRED) - - GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES) --- -1.8.3.1 - diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb index 7bc619072..9582a5a55 100644 --- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb +++ b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.5.0.bb @@ -8,7 +8,6 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=176cedb32f48dd58f07e0c1c717b3ea4" DEPENDS = "weston" SRC_URI = "git://git.projects.genivi.org/${PN}.git \ - file://apply_weston-1.5.x.patch \ " SRC_URI_append_wandboard = "file://wandboard_fix_build.patch" diff --git a/meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch b/meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch deleted file mode 100644 index 33476a8f3..000000000 --- a/meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch +++ /dev/null @@ -1,2392 +0,0 @@ -From fb20221f0c0068a4a75fe62f2873d9d3c5566e73 Mon Sep 17 00:00:00 2001 -From: Manuel Bachmann -Date: Wed, 13 Jan 2016 18:42:26 +0100 -Subject: [PATCH] [PATCH] Backport IVI-Shell from Weston 1.9.0 to 1.8.0 - -IVI-Shell is the alternative Weston shell implementing the -eponymous protocol, and supported in client toolkits such -as EFL, Qt... - -We backport only what is necessary, without modifying core -compositor code. - -Signed-off-by: Manuel Bachmann ---- - ivi-shell/hmi-controller.c | 140 +++--- - ivi-shell/input-panel-ivi.c | 41 +- - ivi-shell/ivi-layout-export.h | 58 ++- - ivi-shell/ivi-layout-private.h | 47 +- - ivi-shell/ivi-layout-transition.c | 39 +- - ivi-shell/ivi-layout.c | 983 +++++++++++++++++++------------------- - ivi-shell/ivi-shell.c | 91 ++-- - ivi-shell/ivi-shell.h | 37 +- - 8 files changed, 758 insertions(+), 678 deletions(-) - -diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c -index 88e9333..2f18217 100644 ---- a/ivi-shell/hmi-controller.c -+++ b/ivi-shell/hmi-controller.c -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2014 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - /** -@@ -721,27 +724,9 @@ hmi_controller_create(struct weston_compositor *ec) - ivi_controller_interface->layer_set_visibility( - hmi_ctrl->workspace_background_layer.ivilayer, false); - -- /* init workspace ivi_layer */ -- hmi_ctrl->workspace_layer.x = hmi_ctrl->workspace_background_layer.x; -- hmi_ctrl->workspace_layer.y = hmi_ctrl->workspace_background_layer.y; -- hmi_ctrl->workspace_layer.width = -- hmi_ctrl->workspace_background_layer.width; -- hmi_ctrl->workspace_layer.height = -- hmi_ctrl->workspace_background_layer.height; -- hmi_ctrl->workspace_layer.id_layer = -- hmi_ctrl->hmi_setting->workspace_layer_id; -- -- create_layer(iviscrn, &hmi_ctrl->workspace_layer); -- ivi_controller_interface->layer_set_opacity(hmi_ctrl->workspace_layer.ivilayer, 0); -- ivi_controller_interface->layer_set_visibility(hmi_ctrl->workspace_layer.ivilayer, -- false); - - wl_list_init(&hmi_ctrl->workspace_fade.layer_list); - tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); -- tmp_link_layer->layout_layer = hmi_ctrl->workspace_layer.ivilayer; -- wl_list_insert(&hmi_ctrl->workspace_fade.layer_list, -- &tmp_link_layer->link); -- tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); - tmp_link_layer->layout_layer = - hmi_ctrl->workspace_background_layer.ivilayer; - wl_list_insert(&hmi_ctrl->workspace_fade.layer_list, -@@ -976,12 +961,11 @@ static void - ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, - int32_t icon_size) - { -- struct ivi_layout_layer *layer = hmi_ctrl->workspace_layer.ivilayer; - int32_t minspace_x = 10; - int32_t minspace_y = minspace_x; - -- int32_t width = hmi_ctrl->workspace_layer.width; -- int32_t height = hmi_ctrl->workspace_layer.height; -+ int32_t width = hmi_ctrl->workspace_background_layer.width; -+ int32_t height = hmi_ctrl->workspace_background_layer.height; - - int32_t x_count = (width - minspace_x) / (minspace_x + icon_size); - int32_t space_x = (int32_t)((width - x_count * icon_size) / (1.0 + x_count)); -@@ -1011,6 +995,11 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, - struct ivi_layout_surface* layout_surface = NULL; - uint32_t *add_surface_id = NULL; - -+ struct ivi_layout_screen *iviscrn = NULL; -+ struct link_layer *tmp_link_layer = NULL; -+ struct ivi_layout_screen **pp_screen = NULL; -+ int32_t screen_length = 0; -+ - if (0 == x_count) - x_count = 1; - -@@ -1087,16 +1076,10 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, - ivi_controller_interface->get_surface_from_id(data->surface_id); - assert(layout_surface); - -- ret = ivi_controller_interface->layer_add_surface(layer, layout_surface); -- assert(!ret); -- - ret = ivi_controller_interface->surface_set_destination_rectangle( - layout_surface, x, y, icon_size, icon_size); - assert(!ret); - -- ret = ivi_controller_interface->surface_set_visibility(layout_surface, true); -- assert(!ret); -- - nx++; - - if (x_count == nx) { -@@ -1105,6 +1088,43 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, - } - } - -+ /* init workspace ivi_layer */ -+ hmi_ctrl->workspace_layer.x = hmi_ctrl->workspace_background_layer.x; -+ hmi_ctrl->workspace_layer.y = hmi_ctrl->workspace_background_layer.y; -+ hmi_ctrl->workspace_layer.width = -+ hmi_ctrl->workspace_background_layer.width * hmi_ctrl->workspace_count; -+ hmi_ctrl->workspace_layer.height = -+ hmi_ctrl->workspace_background_layer.height; -+ hmi_ctrl->workspace_layer.id_layer = -+ hmi_ctrl->hmi_setting->workspace_layer_id; -+ -+ ivi_controller_interface->get_screens(&screen_length, &pp_screen); -+ iviscrn = pp_screen[0]; -+ free(pp_screen); -+ create_layer(iviscrn, &hmi_ctrl->workspace_layer); -+ ivi_controller_interface->layer_set_opacity(hmi_ctrl->workspace_layer.ivilayer, 0); -+ ivi_controller_interface->layer_set_visibility(hmi_ctrl->workspace_layer.ivilayer, -+ false); -+ -+ tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); -+ tmp_link_layer->layout_layer = hmi_ctrl->workspace_layer.ivilayer; -+ wl_list_insert(&hmi_ctrl->workspace_fade.layer_list, -+ &tmp_link_layer->link); -+ -+ /* Add surface to layer */ -+ wl_array_for_each(data, &launchers) { -+ layout_surface = -+ ivi_controller_interface->get_surface_from_id(data->surface_id); -+ assert(layout_surface); -+ -+ ret = ivi_controller_interface->layer_add_surface(hmi_ctrl->workspace_layer.ivilayer, -+ layout_surface); -+ assert(!ret); -+ -+ ret = ivi_controller_interface->surface_set_visibility(layout_surface, true); -+ assert(!ret); -+ } -+ - wl_array_release(&launchers); - ivi_controller_interface->commit_changes(); - } -@@ -1266,8 +1286,8 @@ move_workspace_grab_end(struct move_grab *move, struct wl_resource* resource, - duration); - ivi_controller_interface->layer_set_destination_rectangle(layer, - end_pos, pos_y, -- hmi_ctrl->workspace_background_layer.width, -- hmi_ctrl->workspace_background_layer.height); -+ hmi_ctrl->workspace_layer.width, -+ hmi_ctrl->workspace_layer.height); - ivi_controller_interface->commit_changes(); - } - -@@ -1465,15 +1485,18 @@ enum HMI_GRAB_DEVICE { - static enum HMI_GRAB_DEVICE - get_hmi_grab_device(struct weston_seat *seat, uint32_t serial) - { -- if (seat->pointer && -- seat->pointer->focus && -- seat->pointer->button_count && -- seat->pointer->grab_serial == serial) -+ struct weston_pointer *pointer = seat->pointer; -+ struct weston_touch *touch = seat->touch; -+ -+ if (pointer && -+ pointer->focus && -+ pointer->button_count && -+ pointer->grab_serial == serial) - return HMI_GRAB_DEVICE_POINTER; - -- if (seat->touch && -- seat->touch->focus && -- seat->touch->grab_serial == serial) -+ if (touch && -+ touch->focus && -+ touch->grab_serial == serial) - return HMI_GRAB_DEVICE_TOUCH; - - return HMI_GRAB_DEVICE_NONE; -@@ -1564,6 +1587,9 @@ ivi_hmi_controller_workspace_control(struct wl_client *client, - struct pointer_move_grab *pnt_move_grab = NULL; - struct touch_move_grab *tch_move_grab = NULL; - struct weston_seat *seat = NULL; -+ struct weston_pointer *pointer; -+ struct weston_touch *touch; -+ - enum HMI_GRAB_DEVICE device; - - if (hmi_ctrl->workspace_count < 2) -@@ -1582,21 +1608,23 @@ ivi_hmi_controller_workspace_control(struct wl_client *client, - - switch (device) { - case HMI_GRAB_DEVICE_POINTER: -- pnt_move_grab = create_workspace_pointer_move(seat->pointer, -+ pointer = seat->pointer; -+ pnt_move_grab = create_workspace_pointer_move(pointer, - resource); - - pointer_grab_start(&pnt_move_grab->base, layer, - &pointer_move_grab_workspace_interface, -- seat->pointer); -+ pointer); - break; - - case HMI_GRAB_DEVICE_TOUCH: -- tch_move_grab = create_workspace_touch_move(seat->touch, -+ touch = seat->touch; -+ tch_move_grab = create_workspace_touch_move(touch, - resource); - - touch_grab_start(&tch_move_grab->base, layer, - &touch_move_grab_workspace_interface, -- seat->touch); -+ touch); - break; - - default: -diff --git a/ivi-shell/input-panel-ivi.c b/ivi-shell/input-panel-ivi.c -index 6b89177..3eefb68 100644 ---- a/ivi-shell/input-panel-ivi.c -+++ b/ivi-shell/input-panel-ivi.c -@@ -3,23 +3,26 @@ - * Copyright © 2011-2012 Collabora, Ltd. - * Copyright © 2013 Raspberry Pi Foundation - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - #include "config.h" -@@ -66,9 +69,11 @@ show_input_panel_surface(struct input_panel_surface *ipsurf) - float x, y; - - wl_list_for_each(seat, &shell->compositor->seat_list, link) { -- if (!seat->keyboard || !seat->keyboard->focus) -+ struct weston_keyboard *keyboard = seat->keyboard; -+ -+ if (!keyboard || !keyboard->focus) - continue; -- focus = weston_surface_get_main_surface(seat->keyboard->focus); -+ focus = weston_surface_get_main_surface(keyboard->focus); - ipsurf->output = focus->output; - x = ipsurf->output->x + (ipsurf->output->width - ipsurf->surface->width) / 2; - y = ipsurf->output->y + ipsurf->output->height - ipsurf->surface->height; -diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h -index 4b4328c..8a92009 100644 ---- a/ivi-shell/ivi-layout-export.h -+++ b/ivi-shell/ivi-layout-export.h -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2013 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - /** -@@ -467,7 +470,7 @@ struct ivi_controller_interface { - /** - * \brief Removes a ivi_layer which is currently managed by the service - */ -- void (*layer_remove)(struct ivi_layout_layer *ivilayer); -+ void (*layer_destroy)(struct ivi_layout_layer *ivilayer); - - /** - * \brief Get all ivi_layers which are currently registered and managed -@@ -780,6 +783,27 @@ struct ivi_controller_interface { - int32_t x, int32_t y, - int32_t width, int32_t height); - -+ /** -+ * remove notification by callback on property changes of ivi_surface -+ */ -+ void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf, -+ surface_property_notification_func callback, -+ void *userdata); -+ -+ /** -+ * \brief remove notification by callback on property changes of ivi_layer -+ */ -+ void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer, -+ layer_property_notification_func callback, -+ void *userdata); -+ -+ /** -+ * \brief get id of ivi_screen from ivi_layout_screen -+ * -+ * -+ * \return id of ivi_screen -+ */ -+ uint32_t (*get_id_of_screen)(struct ivi_layout_screen *iviscrn); - }; - - #ifdef __cplusplus -diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h -index 4531748..074d598 100644 ---- a/ivi-shell/ivi-layout-private.h -+++ b/ivi-shell/ivi-layout-private.h -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2014 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - #ifndef _ivi_layout_PRIVATE_H_ -@@ -36,12 +39,7 @@ struct ivi_layout_surface { - struct ivi_layout *layout; - struct weston_surface *surface; - -- struct wl_listener surface_destroy_listener; -- struct weston_transform surface_rotation; -- struct weston_transform layer_rotation; -- struct weston_transform surface_pos; -- struct weston_transform layer_pos; -- struct weston_transform scaling; -+ struct weston_transform transform; - - struct ivi_layout_surface_properties prop; - uint32_t event_mask; -@@ -83,9 +81,12 @@ struct ivi_layout_layer { - } pending; - - struct { -+ int dirty; - struct wl_list surface_list; - struct wl_list link; - } order; -+ -+ int32_t ref_count; - }; - - struct ivi_layout { -@@ -223,4 +224,6 @@ ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); - int - load_controller_modules(struct weston_compositor *compositor, const char *modules, - int *argc, char *argv[]); -+void -+ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf); - #endif -diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c -index f691d35..d12a8f4 100644 ---- a/ivi-shell/ivi-layout-transition.c -+++ b/ivi-shell/ivi-layout-transition.c -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2014 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - #include -@@ -226,7 +229,7 @@ layout_transition_destroy(struct ivi_layout_transition *transition) - struct ivi_layout *layout = get_instance(); - - remove_transition(layout, transition); -- if(transition->destroy_func) -+ if (transition->destroy_func) - transition->destroy_func(transition); - free(transition); - } -@@ -660,7 +663,7 @@ transition_move_layer_destroy(struct ivi_layout_transition *transition) - { - struct move_layer_data *data = transition->private_data; - -- if(data->destroy_func) -+ if (data->destroy_func) - data->destroy_func(transition->user_data); - - free(data); -diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c -index abfba70..c153884 100644 ---- a/ivi-shell/ivi-layout.c -+++ b/ivi-shell/ivi-layout.c -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2013 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - /** -@@ -55,12 +58,15 @@ - #include "config.h" - - #include -+#include - - #include "compositor.h" - #include "ivi-layout-export.h" - #include "ivi-layout-private.h" - --#include "../shared/os-compatibility.h" -+#include "shared/os-compatibility.h" -+ -+#define max(a, b) ((a) > (b) ? (a) : (b)) - - struct link_layer { - struct ivi_layout_layer *ivilayer; -@@ -89,14 +95,13 @@ struct ivi_layout_screen { - struct ivi_layout *layout; - struct weston_output *output; - -- uint32_t event_mask; -- - struct { - struct wl_list layer_list; - struct wl_list link; - } pending; - - struct { -+ int dirty; - struct wl_list layer_list; - struct wl_list link; - } order; -@@ -107,6 +112,17 @@ struct ivi_layout_notification_callback { - void *data; - }; - -+struct ivi_rectangle -+{ -+ int32_t x; -+ int32_t y; -+ int32_t width; -+ int32_t height; -+}; -+ -+static void -+remove_notification(struct wl_list *listener_list, void *callback, void *userdata); -+ - static struct ivi_layout ivilayout = {0}; - - struct ivi_layout * -@@ -139,12 +155,8 @@ remove_link_to_surface(struct ivi_layout_layer *ivilayer) - struct link_layer *next = NULL; - - wl_list_for_each_safe(link, next, &ivilayer->link_to_surface, link_to_layer) { -- if (!wl_list_empty(&link->link_to_layer)) { -- wl_list_remove(&link->link_to_layer); -- } -- if (!wl_list_empty(&link->link)) { -- wl_list_remove(&link->link); -- } -+ wl_list_remove(&link->link_to_layer); -+ wl_list_remove(&link->link); - free(link); - } - -@@ -158,7 +170,6 @@ static void - add_link_to_layer(struct ivi_layout_screen *iviscrn, - struct link_screen *link_screen) - { -- wl_list_init(&link_screen->link_to_screen); - wl_list_insert(&iviscrn->link_to_layer, &link_screen->link_to_screen); - } - -@@ -178,7 +189,6 @@ add_ordersurface_to_layer(struct ivi_layout_surface *ivisurf, - } - - link_layer->ivilayer = ivilayer; -- wl_list_init(&link_layer->link); - wl_list_insert(&ivisurf->layer_list, &link_layer->link); - add_link_to_surface(ivilayer, link_layer); - } -@@ -190,12 +200,8 @@ remove_ordersurface_from_layer(struct ivi_layout_surface *ivisurf) - struct link_layer *next = NULL; - - wl_list_for_each_safe(link_layer, next, &ivisurf->layer_list, link) { -- if (!wl_list_empty(&link_layer->link)) { -- wl_list_remove(&link_layer->link); -- } -- if (!wl_list_empty(&link_layer->link_to_layer)) { -- wl_list_remove(&link_layer->link_to_layer); -- } -+ wl_list_remove(&link_layer->link); -+ wl_list_remove(&link_layer->link_to_layer); - free(link_layer); - } - wl_list_init(&ivisurf->layer_list); -@@ -217,7 +223,6 @@ add_orderlayer_to_screen(struct ivi_layout_layer *ivilayer, - } - - link_scrn->iviscrn = iviscrn; -- wl_list_init(&link_scrn->link); - wl_list_insert(&ivilayer->screen_list, &link_scrn->link); - add_link_to_layer(iviscrn, link_scrn); - } -@@ -229,12 +234,8 @@ remove_orderlayer_from_screen(struct ivi_layout_layer *ivilayer) - struct link_screen *next = NULL; - - wl_list_for_each_safe(link_scrn, next, &ivilayer->screen_list, link) { -- if (!wl_list_empty(&link_scrn->link)) { -- wl_list_remove(&link_scrn->link); -- } -- if (!wl_list_empty(&link_scrn->link_to_screen)) { -- wl_list_remove(&link_scrn->link_to_screen); -- } -+ wl_list_remove(&link_scrn->link); -+ wl_list_remove(&link_scrn->link_to_screen); - free(link_scrn); - } - wl_list_init(&ivilayer->screen_list); -@@ -290,9 +291,7 @@ remove_all_notification(struct wl_list *listener_list) - - wl_list_for_each_safe(listener, next, listener_list, link) { - struct listener_layout_notification *notification = NULL; -- if (!wl_list_empty(&listener->link)) { -- wl_list_remove(&listener->link); -- } -+ wl_list_remove(&listener->link); - - notification = - container_of(listener, -@@ -315,29 +314,36 @@ ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) - remove_all_notification(&ivisurf->property_changed.listener_list); - } - -+static void -+ivi_layout_surface_remove_notification_by_callback(struct ivi_layout_surface *ivisurf, -+ surface_property_notification_func callback, -+ void *userdata) -+{ -+ if (ivisurf == NULL) { -+ weston_log("ivi_layout_surface_remove_notification_by_callback: invalid argument\n"); -+ return; -+ } -+ -+ remove_notification(&ivisurf->property_changed.listener_list, callback, userdata); -+} -+ - /** -- * this shall not be called from controller because this is triggered by ivi_surface.destroy -- * This means that this is called from westonsurface_destroy_from_ivisurface. -+ * Called at destruction of wl_surface/ivi_surface - */ --static void --ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) -+void -+ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) - { - struct ivi_layout *layout = get_instance(); - - if (ivisurf == NULL) { -- weston_log("ivi_layout_surface_remove: invalid argument\n"); -+ weston_log("%s: invalid argument\n", __func__); - return; - } - -- if (!wl_list_empty(&ivisurf->pending.link)) { -- wl_list_remove(&ivisurf->pending.link); -- } -- if (!wl_list_empty(&ivisurf->order.link)) { -- wl_list_remove(&ivisurf->order.link); -- } -- if (!wl_list_empty(&ivisurf->link)) { -- wl_list_remove(&ivisurf->link); -- } -+ wl_list_remove(&ivisurf->transform.link); -+ wl_list_remove(&ivisurf->pending.link); -+ wl_list_remove(&ivisurf->order.link); -+ wl_list_remove(&ivisurf->link); - remove_ordersurface_from_layer(ivisurf); - - wl_signal_emit(&layout->surface_notification.removed, ivisurf); -@@ -350,27 +356,6 @@ ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) - } - - /** -- * Called at destruction of ivi_surface -- */ --static void --westonsurface_destroy_from_ivisurface(struct wl_listener *listener, void *data) --{ -- struct ivi_layout_surface *ivisurf = NULL; -- -- ivisurf = container_of(listener, struct ivi_layout_surface, -- surface_destroy_listener); -- -- wl_list_remove(&ivisurf->surface_rotation.link); -- wl_list_remove(&ivisurf->layer_rotation.link); -- wl_list_remove(&ivisurf->surface_pos.link); -- wl_list_remove(&ivisurf->layer_pos.link); -- wl_list_remove(&ivisurf->scaling.link); -- -- ivisurf->surface = NULL; -- ivi_layout_surface_remove(ivisurf); --} -- --/** - * Internal API to check ivi_layer/ivi_surface already added in ivi_layer/ivi_screen. - * Called by ivi_layout_layer_add_surface/ivi_layout_screenAddLayer - */ -@@ -423,14 +408,12 @@ create_screen(struct weston_compositor *ec) - continue; - } - -- wl_list_init(&iviscrn->link); - iviscrn->layout = layout; - - iviscrn->id_screen = count; - count++; - - iviscrn->output = output; -- iviscrn->event_mask = 0; - - wl_list_init(&iviscrn->pending.layer_list); - wl_list_init(&iviscrn->pending.link); -@@ -494,293 +477,319 @@ update_opacity(struct ivi_layout_layer *ivilayer, - } - - static void --update_surface_orientation(struct ivi_layout_layer *ivilayer, -- struct ivi_layout_surface *ivisurf) --{ -- struct weston_view *view; -- struct weston_matrix *matrix = &ivisurf->surface_rotation.matrix; -- float width = 0.0f; -- float height = 0.0f; -- float v_sin = 0.0f; -- float v_cos = 0.0f; -- float cx = 0.0f; -- float cy = 0.0f; -- float sx = 1.0f; -- float sy = 1.0f; -- -- wl_list_for_each(view, &ivisurf->surface->views, surface_link) { -- if (view != NULL) { -- break; -- } -- } -- -- if (view == NULL) { -- return; -- } -- -- if ((ivilayer->prop.dest_width == 0) || -- (ivilayer->prop.dest_height == 0)) { -- return; -- } -- width = (float)ivilayer->prop.dest_width; -- height = (float)ivilayer->prop.dest_height; -- -- switch (ivisurf->prop.orientation) { -- case WL_OUTPUT_TRANSFORM_NORMAL: -- v_sin = 0.0f; -- v_cos = 1.0f; -- break; -+get_rotate_values(enum wl_output_transform orientation, -+ float *v_sin, -+ float *v_cos) -+{ -+ switch (orientation) { - case WL_OUTPUT_TRANSFORM_90: -- v_sin = 1.0f; -- v_cos = 0.0f; -- sx = width / height; -- sy = height / width; -+ *v_sin = 1.0f; -+ *v_cos = 0.0f; - break; - case WL_OUTPUT_TRANSFORM_180: -- v_sin = 0.0f; -- v_cos = -1.0f; -+ *v_sin = 0.0f; -+ *v_cos = -1.0f; - break; - case WL_OUTPUT_TRANSFORM_270: -+ *v_sin = -1.0f; -+ *v_cos = 0.0f; -+ break; -+ case WL_OUTPUT_TRANSFORM_NORMAL: - default: -- v_sin = -1.0f; -- v_cos = 0.0f; -- sx = width / height; -- sy = height / width; -+ *v_sin = 0.0f; -+ *v_cos = 1.0f; - break; - } -- wl_list_remove(&ivisurf->surface_rotation.link); -- weston_view_geometry_dirty(view); -- -- weston_matrix_init(matrix); -- cx = 0.5f * width; -- cy = 0.5f * height; -- weston_matrix_translate(matrix, -cx, -cy, 0.0f); -- weston_matrix_rotate_xy(matrix, v_cos, v_sin); -- weston_matrix_scale(matrix, sx, sy, 1.0); -- weston_matrix_translate(matrix, cx, cy, 0.0f); -- wl_list_insert(&view->geometry.transformation_list, -- &ivisurf->surface_rotation.link); -- -- weston_view_set_transform_parent(view, NULL); -- weston_view_update_transform(view); - } - - static void --update_layer_orientation(struct ivi_layout_layer *ivilayer, -- struct ivi_layout_surface *ivisurf) --{ -- struct weston_surface *es = ivisurf->surface; -- struct weston_view *view; -- struct weston_matrix *matrix = &ivisurf->layer_rotation.matrix; -- struct weston_output *output = NULL; -- float width = 0.0f; -- float height = 0.0f; -- float v_sin = 0.0f; -- float v_cos = 0.0f; -- float cx = 0.0f; -- float cy = 0.0f; -- float sx = 1.0f; -- float sy = 1.0f; -- -- wl_list_for_each(view, &ivisurf->surface->views, surface_link) { -- if (view != NULL) { -- break; -- } -- } -- -- if (es == NULL || view == NULL) { -- return; -- } -- -- output = es->output; -- if (output == NULL) { -- return; -- } -- if ((output->width == 0) || (output->height == 0)) { -- return; -- } -- width = (float)output->width; -- height = (float)output->height; -- -- switch (ivilayer->prop.orientation) { -- case WL_OUTPUT_TRANSFORM_NORMAL: -- v_sin = 0.0f; -- v_cos = 1.0f; -- break; -+get_scale(enum wl_output_transform orientation, -+ float dest_width, -+ float dest_height, -+ float source_width, -+ float source_height, -+ float *scale_x, -+ float *scale_y) -+{ -+ switch (orientation) { - case WL_OUTPUT_TRANSFORM_90: -- v_sin = 1.0f; -- v_cos = 0.0f; -- sx = width / height; -- sy = height / width; -+ *scale_x = dest_width / source_height; -+ *scale_y = dest_height / source_width; - break; - case WL_OUTPUT_TRANSFORM_180: -- v_sin = 0.0f; -- v_cos = -1.0f; -+ *scale_x = dest_width / source_width; -+ *scale_y = dest_height / source_height; - break; - case WL_OUTPUT_TRANSFORM_270: -+ *scale_x = dest_width / source_height; -+ *scale_y = dest_height / source_width; -+ break; -+ case WL_OUTPUT_TRANSFORM_NORMAL: - default: -- v_sin = -1.0f; -- v_cos = 0.0f; -- sx = width / height; -- sy = height / width; -+ *scale_x = dest_width / source_width; -+ *scale_y = dest_height / source_height; - break; - } -- wl_list_remove(&ivisurf->layer_rotation.link); -- weston_view_geometry_dirty(view); -- -- weston_matrix_init(matrix); -- cx = 0.5f * width; -- cy = 0.5f * height; -- weston_matrix_translate(matrix, -cx, -cy, 0.0f); -- weston_matrix_rotate_xy(matrix, v_cos, v_sin); -- weston_matrix_scale(matrix, sx, sy, 1.0); -- weston_matrix_translate(matrix, cx, cy, 0.0f); -- wl_list_insert(&view->geometry.transformation_list, -- &ivisurf->layer_rotation.link); -+} - -- weston_view_set_transform_parent(view, NULL); -- weston_view_update_transform(view); -+static void -+calc_transformation_matrix(struct ivi_rectangle *source_rect, -+ struct ivi_rectangle *dest_rect, -+ enum wl_output_transform orientation, -+ struct weston_matrix *m) -+{ -+ float source_center_x; -+ float source_center_y; -+ float vsin; -+ float vcos; -+ float scale_x; -+ float scale_y; -+ float translate_x; -+ float translate_y; -+ -+ source_center_x = source_rect->x + source_rect->width * 0.5f; -+ source_center_y = source_rect->y + source_rect->height * 0.5f; -+ weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f); -+ -+ get_rotate_values(orientation, &vsin, &vcos); -+ weston_matrix_rotate_xy(m, vcos, vsin); -+ -+ get_scale(orientation, -+ dest_rect->width, -+ dest_rect->height, -+ source_rect->width, -+ source_rect->height, -+ &scale_x, -+ &scale_y); -+ weston_matrix_scale(m, scale_x, scale_y, 1.0f); -+ -+ translate_x = dest_rect->width * 0.5f + dest_rect->x; -+ translate_y = dest_rect->height * 0.5f + dest_rect->y; -+ weston_matrix_translate(m, translate_x, translate_y, 0.0f); - } - -+/* -+ * This computes intersected rect_output from two ivi_rectangles -+ */ - static void --update_surface_position(struct ivi_layout_surface *ivisurf) -+ivi_rectangle_intersect(const struct ivi_rectangle *rect1, -+ const struct ivi_rectangle *rect2, -+ struct ivi_rectangle *rect_output) - { -- struct weston_view *view; -- float tx = (float)ivisurf->prop.dest_x; -- float ty = (float)ivisurf->prop.dest_y; -- struct weston_matrix *matrix = &ivisurf->surface_pos.matrix; -+ int32_t rect1_right = rect1->x + rect1->width; -+ int32_t rect1_bottom = rect1->y + rect1->height; -+ int32_t rect2_right = rect2->x + rect2->width; -+ int32_t rect2_bottom = rect2->y + rect2->height; - -- wl_list_for_each(view, &ivisurf->surface->views, surface_link) { -- if (view != NULL) { -- break; -- } -- } -+ rect_output->x = max(rect1->x, rect2->x); -+ rect_output->y = max(rect1->y, rect2->y); -+ rect_output->width = rect1_right < rect2_right ? -+ rect1_right - rect_output->x : -+ rect2_right - rect_output->x; -+ rect_output->height = rect1_bottom < rect2_bottom ? -+ rect1_bottom - rect_output->y : -+ rect2_bottom - rect_output->y; - -- if (view == NULL) { -- return; -+ if (rect_output->width < 0 || rect_output->height < 0) { -+ rect_output->width = 0; -+ rect_output->height = 0; - } -- -- wl_list_remove(&ivisurf->surface_pos.link); -- -- weston_matrix_init(matrix); -- weston_matrix_translate(matrix, tx, ty, 0.0f); -- wl_list_insert(&view->geometry.transformation_list, -- &ivisurf->surface_pos.link); -- -- weston_view_set_transform_parent(view, NULL); -- weston_view_update_transform(view); - } - -+/* -+ * Transform rect_input by the inverse of matrix, intersect with boundingbox, -+ * and store the result in rect_output. -+ * The boundingbox must be given in the same coordinate space as rect_output. -+ * Additionally, there are the following restrictions on the matrix: -+ * - no projective transformations -+ * - no skew -+ * - only multiples of 90-degree rotations supported -+ * -+ * In failure case of weston_matrix_invert, rect_output is set to boundingbox -+ * as a fail-safe with log. -+ */ - static void --update_layer_position(struct ivi_layout_layer *ivilayer, -- struct ivi_layout_surface *ivisurf) -+calc_inverse_matrix_transform(const struct weston_matrix *matrix, -+ const struct ivi_rectangle *rect_input, -+ const struct ivi_rectangle *boundingbox, -+ struct ivi_rectangle *rect_output) - { -- struct weston_view *view; -- struct weston_matrix *matrix = &ivisurf->layer_pos.matrix; -- float tx = (float)ivilayer->prop.dest_x; -- float ty = (float)ivilayer->prop.dest_y; -+ struct weston_matrix m; -+ struct weston_vector top_left; -+ struct weston_vector bottom_right; - -- wl_list_for_each(view, &ivisurf->surface->views, surface_link) { -- if (view != NULL) { -- break; -- } -- } -+ assert(boundingbox != rect_output); - -- if (view == NULL) { -- return; -+ if (weston_matrix_invert(&m, matrix) < 0) { -+ weston_log("ivi-shell: calc_inverse_matrix_transform fails to invert a matrix.\n"); -+ weston_log("ivi-shell: boundingbox is set to the rect_output.\n"); -+ rect_output->x = boundingbox->x; -+ rect_output->y = boundingbox->y; -+ rect_output->width = boundingbox->width; -+ rect_output->height = boundingbox->height; - } - -- wl_list_remove(&ivisurf->layer_pos.link); -+ /* The vectors and matrices involved will always produce f[3] == 1.0. */ -+ top_left.f[0] = rect_input->x; -+ top_left.f[1] = rect_input->y; -+ top_left.f[2] = 0.0f; -+ top_left.f[3] = 1.0f; - -- weston_matrix_init(matrix); -- weston_matrix_translate(matrix, tx, ty, 0.0f); -- wl_list_insert(&view->geometry.transformation_list, -- &ivisurf->layer_pos.link); -+ bottom_right.f[0] = rect_input->x + rect_input->width; -+ bottom_right.f[1] = rect_input->y + rect_input->height; -+ bottom_right.f[2] = 0.0f; -+ bottom_right.f[3] = 1.0f; - -- weston_view_set_transform_parent(view, NULL); -- weston_view_update_transform(view); --} -+ weston_matrix_transform(&m, &top_left); -+ weston_matrix_transform(&m, &bottom_right); - --static void --update_scale(struct ivi_layout_layer *ivilayer, -- struct ivi_layout_surface *ivisurf) --{ -- struct weston_view *view; -- struct weston_matrix *matrix = &ivisurf->scaling.matrix; -- float sx = 0.0f; -- float sy = 0.0f; -- float lw = 0.0f; -- float sw = 0.0f; -- float lh = 0.0f; -- float sh = 0.0f; -- -- wl_list_for_each(view, &ivisurf->surface->views, surface_link) { -- if (view != NULL) { -- break; -- } -+ if (top_left.f[0] < bottom_right.f[0]) { -+ rect_output->x = top_left.f[0]; -+ rect_output->width = bottom_right.f[0] - rect_output->x; -+ } else { -+ rect_output->x = bottom_right.f[0]; -+ rect_output->width = top_left.f[0] - rect_output->x; - } - -- if (view == NULL) { -- return; -+ if (top_left.f[1] < bottom_right.f[1]) { -+ rect_output->y = top_left.f[1]; -+ rect_output->height = bottom_right.f[1] - rect_output->y; -+ } else { -+ rect_output->y = bottom_right.f[1]; -+ rect_output->height = top_left.f[1] - rect_output->y; - } - -- if (ivisurf->prop.source_width == 0 || ivisurf->prop.source_height == 0) { -- weston_log("ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n"); -- return; -- } -+ ivi_rectangle_intersect(rect_output, boundingbox, rect_output); -+} - -- if (ivisurf->prop.dest_width == 0 || ivisurf->prop.dest_height == 0) { -- weston_log("ivi-shell: destination rectangle is not yet set by ivi_layout_surface_set_destination_rectangle\n"); -- return; -- } -+/** -+ * This computes the whole transformation matrix:m from surface-local -+ * coordinates to global coordinates. It is assumed that -+ * weston_view::geometry.{x,y} are zero. -+ * -+ * Additionally, this computes the mask on surface-local coordinates as a -+ * ivi_rectangle. This can be set to weston_view_set_mask. -+ * -+ * The mask is computed by following steps -+ * - destination rectangle of layer is inversed to surface-local cooodinates -+ * by inversed matrix:m. -+ * - the area is intersected by intersected area between weston_surface and -+ * source rectangle of ivi_surface. -+ */ -+static void -+calc_surface_to_global_matrix_and_mask_to_weston_surface( -+ struct ivi_layout_layer *ivilayer, -+ struct ivi_layout_surface *ivisurf, -+ struct weston_matrix *m, -+ struct ivi_rectangle *result) -+{ -+ const struct ivi_layout_surface_properties *sp = &ivisurf->prop; -+ const struct ivi_layout_layer_properties *lp = &ivilayer->prop; -+ struct ivi_rectangle weston_surface_rect = { 0, -+ 0, -+ ivisurf->surface->width, -+ ivisurf->surface->height }; -+ struct ivi_rectangle surface_source_rect = { sp->source_x, -+ sp->source_y, -+ sp->source_width, -+ sp->source_height }; -+ struct ivi_rectangle surface_dest_rect = { sp->dest_x, -+ sp->dest_y, -+ sp->dest_width, -+ sp->dest_height }; -+ struct ivi_rectangle layer_source_rect = { lp->source_x, -+ lp->source_y, -+ lp->source_width, -+ lp->source_height }; -+ struct ivi_rectangle layer_dest_rect = { lp->dest_x, -+ lp->dest_y, -+ lp->dest_width, -+ lp->dest_height }; -+ struct ivi_rectangle surface_result; - -- lw = ((float)ivilayer->prop.dest_width / (float)ivilayer->prop.source_width ); -- sw = ((float)ivisurf->prop.dest_width / (float)ivisurf->prop.source_width ); -- lh = ((float)ivilayer->prop.dest_height / (float)ivilayer->prop.source_height); -- sh = ((float)ivisurf->prop.dest_height / (float)ivisurf->prop.source_height ); -- sx = sw * lw; -- sy = sh * lh; -+ /* -+ * the whole transformation matrix:m from surface-local -+ * coordinates to global coordinates, which is computed by -+ * two steps, -+ * - surface-local coordinates to layer-local coordinates -+ * - layer-local coordinates to global coordinates -+ */ -+ calc_transformation_matrix(&surface_source_rect, -+ &surface_dest_rect, -+ sp->orientation, m); - -- wl_list_remove(&ivisurf->scaling.link); -- weston_matrix_init(matrix); -- weston_matrix_scale(matrix, sx, sy, 1.0f); -+ calc_transformation_matrix(&layer_source_rect, -+ &layer_dest_rect, -+ lp->orientation, m); - -- wl_list_insert(&view->geometry.transformation_list, -- &ivisurf->scaling.link); -+ /* this intersected ivi_rectangle would be used for masking -+ * weston_surface -+ */ -+ ivi_rectangle_intersect(&surface_source_rect, &weston_surface_rect, -+ &surface_result); - -- weston_view_set_transform_parent(view, NULL); -- weston_view_update_transform(view); -+ /* calc masking area of weston_surface from m */ -+ calc_inverse_matrix_transform(m, -+ &layer_dest_rect, -+ &surface_result, -+ result); - } - - static void - update_prop(struct ivi_layout_layer *ivilayer, - struct ivi_layout_surface *ivisurf) - { -- if (ivilayer->event_mask | ivisurf->event_mask) { -- struct weston_view *tmpview; -- update_opacity(ivilayer, ivisurf); -- update_layer_orientation(ivilayer, ivisurf); -- update_layer_position(ivilayer, ivisurf); -- update_surface_position(ivisurf); -- update_surface_orientation(ivilayer, ivisurf); -- update_scale(ivilayer, ivisurf); -+ struct weston_view *tmpview; -+ struct ivi_rectangle r; -+ bool can_calc = true; - -- ivisurf->update_count++; -+ if (!ivilayer->event_mask && !ivisurf->event_mask) { -+ return; -+ } - -- wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) { -- if (tmpview != NULL) { -- break; -- } -- } -+ update_opacity(ivilayer, ivisurf); - -+ wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) { - if (tmpview != NULL) { -- weston_view_geometry_dirty(tmpview); -+ break; - } -+ } - -- if (ivisurf->surface != NULL) { -- weston_surface_damage(ivisurf->surface); -+ if (ivisurf->prop.source_width == 0 || ivisurf->prop.source_height == 0) { -+ weston_log("ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n"); -+ can_calc = false; -+ } -+ -+ if (ivisurf->prop.dest_width == 0 || ivisurf->prop.dest_height == 0) { -+ weston_log("ivi-shell: destination rectangle is not yet set by ivi_layout_surface_set_destination_rectangle\n"); -+ can_calc = false; -+ } -+ -+ if (can_calc) { -+ wl_list_remove(&ivisurf->transform.link); -+ weston_matrix_init(&ivisurf->transform.matrix); -+ -+ calc_surface_to_global_matrix_and_mask_to_weston_surface( -+ ivilayer, ivisurf, &ivisurf->transform.matrix, &r); -+ -+ if (tmpview != NULL) { -+ weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height); -+ wl_list_insert(&tmpview->geometry.transformation_list, -+ &ivisurf->transform.link); -+ -+ weston_view_set_transform_parent(tmpview, NULL); - } - } -+ -+ ivisurf->update_count++; -+ -+ if (tmpview != NULL) { -+ weston_view_geometry_dirty(tmpview); -+ } -+ -+ if (ivisurf->surface != NULL) { -+ weston_surface_damage(ivisurf->surface); -+ } - } - - static void -@@ -810,7 +819,7 @@ commit_surface_list(struct ivi_layout *layout) - int32_t configured = 0; - - wl_list_for_each(ivisurf, &layout->surface_list, link) { -- if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEFAULT) { -+ if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEFAULT) { - dest_x = ivisurf->prop.dest_x; - dest_y = ivisurf->prop.dest_y; - dest_width = ivisurf->prop.dest_width; -@@ -823,7 +832,7 @@ commit_surface_list(struct ivi_layout *layout) - ivisurf->pending.prop.dest_height, - ivisurf->pending.prop.transition_duration); - -- if(ivisurf->pending.prop.visibility) { -+ if (ivisurf->pending.prop.visibility) { - ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration); - } else { - ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration); -@@ -837,7 +846,7 @@ commit_surface_list(struct ivi_layout *layout) - ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; - ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; - -- } else if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY){ -+ } else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY) { - dest_x = ivisurf->prop.dest_x; - dest_y = ivisurf->prop.dest_y; - dest_width = ivisurf->prop.dest_width; -@@ -859,9 +868,9 @@ commit_surface_list(struct ivi_layout *layout) - ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; - ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; - -- } else if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY){ -+ } else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY) { - configured = 0; -- if(ivisurf->pending.prop.visibility) { -+ if (ivisurf->pending.prop.visibility) { - ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration); - } else { - ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration); -@@ -903,9 +912,9 @@ commit_layer_list(struct ivi_layout *layout) - struct ivi_layout_surface *next = NULL; - - wl_list_for_each(ivilayer, &layout->layer_list, link) { -- if(ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_MOVE) { -+ if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_MOVE) { - ivi_layout_transition_move_layer(ivilayer, ivilayer->pending.prop.dest_x, ivilayer->pending.prop.dest_y, ivilayer->pending.prop.transition_duration); -- } else if(ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_FADE) { -+ } else if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_FADE) { - ivi_layout_transition_fade_layer(ivilayer,ivilayer->pending.prop.is_fade_in, - ivilayer->pending.prop.start_alpha,ivilayer->pending.prop.end_alpha, - NULL, NULL, -@@ -915,53 +924,30 @@ commit_layer_list(struct ivi_layout *layout) - - ivilayer->prop = ivilayer->pending.prop; - -- if (!(ivilayer->event_mask & -- (IVI_NOTIFICATION_ADD | IVI_NOTIFICATION_REMOVE)) ) { -+ if (!ivilayer->order.dirty) { - continue; - } - -- if (ivilayer->event_mask & IVI_NOTIFICATION_REMOVE) { -- wl_list_for_each_safe(ivisurf, next, -- &ivilayer->order.surface_list, order.link) { -- remove_ordersurface_from_layer(ivisurf); -- -- if (!wl_list_empty(&ivisurf->order.link)) { -- wl_list_remove(&ivisurf->order.link); -- } -- -- wl_list_init(&ivisurf->order.link); -- ivisurf->event_mask |= IVI_NOTIFICATION_REMOVE; -- } -- -- wl_list_init(&ivilayer->order.surface_list); -+ wl_list_for_each_safe(ivisurf, next, &ivilayer->order.surface_list, -+ order.link) { -+ remove_ordersurface_from_layer(ivisurf); -+ wl_list_remove(&ivisurf->order.link); -+ wl_list_init(&ivisurf->order.link); -+ ivisurf->event_mask |= IVI_NOTIFICATION_REMOVE; - } - -- if (ivilayer->event_mask & IVI_NOTIFICATION_ADD) { -- wl_list_for_each_safe(ivisurf, next, -- &ivilayer->order.surface_list, order.link) { -- remove_ordersurface_from_layer(ivisurf); -- -- if (!wl_list_empty(&ivisurf->order.link)) { -- wl_list_remove(&ivisurf->order.link); -- } -- -- wl_list_init(&ivisurf->order.link); -- } -+ assert(wl_list_empty(&ivilayer->order.surface_list)); - -- wl_list_init(&ivilayer->order.surface_list); -- wl_list_for_each(ivisurf, &ivilayer->pending.surface_list, -+ wl_list_for_each(ivisurf, &ivilayer->pending.surface_list, - pending.link) { -- if(!wl_list_empty(&ivisurf->order.link)){ -- wl_list_remove(&ivisurf->order.link); -- wl_list_init(&ivisurf->order.link); -- } -- -- wl_list_insert(&ivilayer->order.surface_list, -- &ivisurf->order.link); -- add_ordersurface_to_layer(ivisurf, ivilayer); -- ivisurf->event_mask |= IVI_NOTIFICATION_ADD; -- } -+ wl_list_remove(&ivisurf->order.link); -+ wl_list_insert(&ivilayer->order.surface_list, -+ &ivisurf->order.link); -+ add_ordersurface_to_layer(ivisurf, ivilayer); -+ ivisurf->event_mask |= IVI_NOTIFICATION_ADD; - } -+ -+ ivilayer->order.dirty = 0; - } - } - -@@ -974,33 +960,17 @@ commit_screen_list(struct ivi_layout *layout) - struct ivi_layout_surface *ivisurf = NULL; - - wl_list_for_each(iviscrn, &layout->screen_list, link) { -- if (iviscrn->event_mask & IVI_NOTIFICATION_REMOVE) { -+ if (iviscrn->order.dirty) { - wl_list_for_each_safe(ivilayer, next, - &iviscrn->order.layer_list, order.link) { - remove_orderlayer_from_screen(ivilayer); -- -- if (!wl_list_empty(&ivilayer->order.link)) { -- wl_list_remove(&ivilayer->order.link); -- } -- -+ wl_list_remove(&ivilayer->order.link); - wl_list_init(&ivilayer->order.link); - ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; - } -- } - -- if (iviscrn->event_mask & IVI_NOTIFICATION_ADD) { -- wl_list_for_each_safe(ivilayer, next, -- &iviscrn->order.layer_list, order.link) { -- remove_orderlayer_from_screen(ivilayer); -+ assert(wl_list_empty(&iviscrn->order.layer_list)); - -- if (!wl_list_empty(&ivilayer->order.link)) { -- wl_list_remove(&ivilayer->order.link); -- } -- -- wl_list_init(&ivilayer->order.link); -- } -- -- wl_list_init(&iviscrn->order.layer_list); - wl_list_for_each(ivilayer, &iviscrn->pending.layer_list, - pending.link) { - wl_list_insert(&iviscrn->order.layer_list, -@@ -1008,9 +978,9 @@ commit_screen_list(struct ivi_layout *layout) - add_orderlayer_to_screen(ivilayer, iviscrn); - ivilayer->event_mask |= IVI_NOTIFICATION_ADD; - } -- } - -- iviscrn->event_mask = 0; -+ iviscrn->order.dirty = 0; -+ } - - /* Clear view list of layout ivi_layer */ - wl_list_init(&layout->layout_layer.view_list.link); -@@ -1046,7 +1016,7 @@ commit_screen_list(struct ivi_layout *layout) - static void - commit_transition(struct ivi_layout* layout) - { -- if(wl_list_empty(&layout->pending_transition_list)){ -+ if (wl_list_empty(&layout->pending_transition_list)) { - return; - } - -@@ -1079,11 +1049,13 @@ send_prop(struct ivi_layout *layout) - struct ivi_layout_surface *ivisurf = NULL; - - wl_list_for_each_reverse(ivilayer, &layout->layer_list, link) { -- send_layer_prop(ivilayer); -+ if (ivilayer->event_mask) -+ send_layer_prop(ivilayer); - } - - wl_list_for_each_reverse(ivisurf, &layout->surface_list, link) { -- send_surface_prop(ivisurf); -+ if (ivisurf->event_mask) -+ send_surface_prop(ivisurf); - } - } - -@@ -1095,14 +1067,9 @@ clear_surface_pending_list(struct ivi_layout_layer *ivilayer) - - wl_list_for_each_safe(surface_link, surface_next, - &ivilayer->pending.surface_list, pending.link) { -- if (!wl_list_empty(&surface_link->pending.link)) { -- wl_list_remove(&surface_link->pending.link); -- } -- -+ wl_list_remove(&surface_link->pending.link); - wl_list_init(&surface_link->pending.link); - } -- -- ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; - } - - static void -@@ -1113,14 +1080,9 @@ clear_surface_order_list(struct ivi_layout_layer *ivilayer) - - wl_list_for_each_safe(surface_link, surface_next, - &ivilayer->order.surface_list, order.link) { -- if (!wl_list_empty(&surface_link->order.link)) { -- wl_list_remove(&surface_link->order.link); -- } -- -+ wl_list_remove(&surface_link->order.link); - wl_list_init(&surface_link->order.link); - } -- -- ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; - } - - static void -@@ -1287,9 +1249,7 @@ remove_notification(struct wl_list *listener_list, void *callback, void *userdat - continue; - } - -- if (!wl_list_empty(&listener->link)) { -- wl_list_remove(&listener->link); -- } -+ wl_list_remove(&listener->link); - - free(notification->userdata); - free(notification); -@@ -1480,6 +1440,12 @@ ivi_layout_get_id_of_layer(struct ivi_layout_layer *ivilayer) - return ivilayer->id_layer; - } - -+static uint32_t -+ivi_layout_get_id_of_screen(struct ivi_layout_screen *iviscrn) -+{ -+ return iviscrn->id_screen; -+} -+ - static struct ivi_layout_layer * - ivi_layout_get_layer_from_id(uint32_t id_layer) - { -@@ -1531,7 +1497,7 @@ ivi_layout_get_screen_resolution(struct ivi_layout_screen *iviscrn, - { - struct weston_output *output = NULL; - -- if (pWidth == NULL || pHeight == NULL) { -+ if (iviscrn == NULL || pWidth == NULL || pHeight == NULL) { - weston_log("ivi_layout_get_screen_resolution: invalid argument\n"); - return IVI_FAILED; - } -@@ -1605,7 +1571,7 @@ ivi_layout_get_screens(int32_t *pLength, struct ivi_layout_screen ***ppArray) - - length = wl_list_length(&layout->screen_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_screen *)); - if (*ppArray == NULL) { -@@ -1639,7 +1605,7 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer, - - length = wl_list_length(&ivilayer->screen_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_screen *)); - if (*ppArray == NULL) { -@@ -1672,7 +1638,7 @@ ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray) - - length = wl_list_length(&layout->layer_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); - if (*ppArray == NULL) { -@@ -1706,7 +1672,7 @@ ivi_layout_get_layers_on_screen(struct ivi_layout_screen *iviscrn, - - length = wl_list_length(&iviscrn->order.layer_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); - if (*ppArray == NULL) { -@@ -1714,7 +1680,7 @@ ivi_layout_get_layers_on_screen(struct ivi_layout_screen *iviscrn, - return IVI_FAILED; - } - -- wl_list_for_each(ivilayer, &iviscrn->order.layer_list, link) { -+ wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { - (*ppArray)[n++] = ivilayer; - } - } -@@ -1740,7 +1706,7 @@ ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf, - - length = wl_list_length(&ivisurf->layer_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); - if (*ppArray == NULL) { -@@ -1774,7 +1740,7 @@ ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray) - - length = wl_list_length(&layout->surface_list); - -- if (length != 0){ -+ if (length != 0) { - /* the Array must be free by module which called this function */ - *ppArray = calloc(length, sizeof(struct ivi_layout_surface *)); - if (*ppArray == NULL) { -@@ -1836,6 +1802,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer, - ivilayer = get_layer(&layout->layer_list, id_layer); - if (ivilayer != NULL) { - weston_log("id_layer is already created\n"); -+ ++ivilayer->ref_count; - return ivilayer; - } - -@@ -1845,7 +1812,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer, - return NULL; - } - -- wl_list_init(&ivilayer->link); -+ ivilayer->ref_count = 1; - wl_signal_init(&ivilayer->property_changed); - wl_list_init(&ivilayer->screen_list); - wl_list_init(&ivilayer->link_to_surface); -@@ -1881,7 +1848,20 @@ ivi_layout_layer_remove_notification(struct ivi_layout_layer *ivilayer) - } - - static void --ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer) -+ivi_layout_layer_remove_notification_by_callback(struct ivi_layout_layer *ivilayer, -+ layer_property_notification_func callback, -+ void *userdata) -+{ -+ if (ivilayer == NULL) { -+ weston_log("ivi_layout_layer_remove_notification_by_callback: invalid argument\n"); -+ return; -+ } -+ -+ remove_notification(&ivilayer->property_changed.listener_list, callback, userdata); -+} -+ -+static void -+ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer) - { - struct ivi_layout *layout = get_instance(); - -@@ -1890,20 +1870,18 @@ ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer) - return; - } - -+ if (--ivilayer->ref_count > 0) -+ return; -+ - wl_signal_emit(&layout->layer_notification.removed, ivilayer); - - clear_surface_pending_list(ivilayer); - clear_surface_order_list(ivilayer); - -- if (!wl_list_empty(&ivilayer->pending.link)) { -- wl_list_remove(&ivilayer->pending.link); -- } -- if (!wl_list_empty(&ivilayer->order.link)) { -- wl_list_remove(&ivilayer->order.link); -- } -- if (!wl_list_empty(&ivilayer->link)) { -- wl_list_remove(&ivilayer->link); -- } -+ wl_list_remove(&ivilayer->pending.link); -+ wl_list_remove(&ivilayer->order.link); -+ wl_list_remove(&ivilayer->link); -+ - remove_orderlayer_from_screen(ivilayer); - remove_link_to_surface(ivilayer); - ivi_layout_layer_remove_notification(ivilayer); -@@ -1925,7 +1903,10 @@ ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, - prop = &ivilayer->pending.prop; - prop->visibility = newVisibility; - -- ivilayer->event_mask |= IVI_NOTIFICATION_VISIBILITY; -+ if (ivilayer->prop.visibility != newVisibility) -+ ivilayer->event_mask |= IVI_NOTIFICATION_VISIBILITY; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; - - return IVI_SUCCEEDED; - } -@@ -1947,7 +1928,9 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, - { - struct ivi_layout_layer_properties *prop = NULL; - -- if (ivilayer == NULL) { -+ if (ivilayer == NULL || -+ opacity < wl_fixed_from_double(0.0) || -+ wl_fixed_from_double(1.0) < opacity) { - weston_log("ivi_layout_layer_set_opacity: invalid argument\n"); - return IVI_FAILED; - } -@@ -1955,7 +1938,10 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, - prop = &ivilayer->pending.prop; - prop->opacity = opacity; - -- ivilayer->event_mask |= IVI_NOTIFICATION_OPACITY; -+ if (ivilayer->prop.opacity != opacity) -+ ivilayer->event_mask |= IVI_NOTIFICATION_OPACITY; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_OPACITY; - - return IVI_SUCCEEDED; - } -@@ -1989,7 +1975,12 @@ ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer, - prop->source_width = width; - prop->source_height = height; - -- ivilayer->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; -+ if (ivilayer->prop.source_x != x || ivilayer->prop.source_y != y || -+ ivilayer->prop.source_width != width || -+ ivilayer->prop.source_height != height) -+ ivilayer->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; - - return IVI_SUCCEEDED; - } -@@ -2012,7 +2003,12 @@ ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, - prop->dest_width = width; - prop->dest_height = height; - -- ivilayer->event_mask |= IVI_NOTIFICATION_DEST_RECT; -+ if (ivilayer->prop.dest_x != x || ivilayer->prop.dest_y != y || -+ ivilayer->prop.dest_width != width || -+ ivilayer->prop.dest_height != height) -+ ivilayer->event_mask |= IVI_NOTIFICATION_DEST_RECT; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; - - return IVI_SUCCEEDED; - } -@@ -2048,7 +2044,11 @@ ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer, - prop->dest_width = dest_width; - prop->dest_height = dest_height; - -- ivilayer->event_mask |= IVI_NOTIFICATION_DIMENSION; -+ if (ivilayer->prop.dest_width != dest_width || -+ ivilayer->prop.dest_height != dest_height) -+ ivilayer->event_mask |= IVI_NOTIFICATION_DIMENSION; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_DIMENSION; - - return IVI_SUCCEEDED; - } -@@ -2083,7 +2083,10 @@ ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, - prop->dest_x = dest_x; - prop->dest_y = dest_y; - -- ivilayer->event_mask |= IVI_NOTIFICATION_POSITION; -+ if (ivilayer->prop.dest_x != dest_x || ivilayer->prop.dest_y != dest_y) -+ ivilayer->event_mask |= IVI_NOTIFICATION_POSITION; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_POSITION; - - return IVI_SUCCEEDED; - } -@@ -2102,7 +2105,10 @@ ivi_layout_layer_set_orientation(struct ivi_layout_layer *ivilayer, - prop = &ivilayer->pending.prop; - prop->orientation = orientation; - -- ivilayer->event_mask |= IVI_NOTIFICATION_ORIENTATION; -+ if (ivilayer->prop.orientation != orientation) -+ ivilayer->event_mask |= IVI_NOTIFICATION_ORIENTATION; -+ else -+ ivilayer->event_mask &= ~IVI_NOTIFICATION_ORIENTATION; - - return IVI_SUCCEEDED; - } -@@ -2134,17 +2140,7 @@ ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, - return IVI_FAILED; - } - -- if (pSurface == NULL) { -- wl_list_for_each_safe(ivisurf, next, &ivilayer->pending.surface_list, pending.link) { -- if (!wl_list_empty(&ivisurf->pending.link)) { -- wl_list_remove(&ivisurf->pending.link); -- } -- -- wl_list_init(&ivisurf->pending.link); -- } -- ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; -- return IVI_SUCCEEDED; -- } -+ clear_surface_pending_list(ivilayer); - - for (i = 0; i < number; i++) { - id_surface = &pSurface[i]->id_surface; -@@ -2154,17 +2150,14 @@ ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, - continue; - } - -- if (!wl_list_empty(&ivisurf->pending.link)) { -- wl_list_remove(&ivisurf->pending.link); -- } -- wl_list_init(&ivisurf->pending.link); -+ wl_list_remove(&ivisurf->pending.link); - wl_list_insert(&ivilayer->pending.surface_list, - &ivisurf->pending.link); - break; - } - } - -- ivilayer->event_mask |= IVI_NOTIFICATION_ADD; -+ ivilayer->order.dirty = 1; - - return IVI_SUCCEEDED; - } -@@ -2183,7 +2176,10 @@ ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, - prop = &ivisurf->pending.prop; - prop->visibility = newVisibility; - -- ivisurf->event_mask |= IVI_NOTIFICATION_VISIBILITY; -+ if (ivisurf->prop.visibility != newVisibility) -+ ivisurf->event_mask |= IVI_NOTIFICATION_VISIBILITY; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; - - return IVI_SUCCEEDED; - } -@@ -2205,7 +2201,9 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, - { - struct ivi_layout_surface_properties *prop = NULL; - -- if (ivisurf == NULL) { -+ if (ivisurf == NULL || -+ opacity < wl_fixed_from_double(0.0) || -+ wl_fixed_from_double(1.0) < opacity) { - weston_log("ivi_layout_surface_set_opacity: invalid argument\n"); - return IVI_FAILED; - } -@@ -2213,7 +2211,10 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, - prop = &ivisurf->pending.prop; - prop->opacity = opacity; - -- ivisurf->event_mask |= IVI_NOTIFICATION_OPACITY; -+ if (ivisurf->prop.opacity != opacity) -+ ivisurf->event_mask |= IVI_NOTIFICATION_OPACITY; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_OPACITY; - - return IVI_SUCCEEDED; - } -@@ -2251,7 +2252,12 @@ ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, - prop->dest_width = width; - prop->dest_height = height; - -- ivisurf->event_mask |= IVI_NOTIFICATION_DEST_RECT; -+ if (ivisurf->prop.dest_x != x || ivisurf->prop.dest_y != y || -+ ivisurf->prop.dest_width != width || -+ ivisurf->prop.dest_height != height) -+ ivisurf->event_mask |= IVI_NOTIFICATION_DEST_RECT; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; - - return IVI_SUCCEEDED; - } -@@ -2271,7 +2277,11 @@ ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf, - prop->dest_width = dest_width; - prop->dest_height = dest_height; - -- ivisurf->event_mask |= IVI_NOTIFICATION_DIMENSION; -+ if (ivisurf->prop.dest_width != dest_width || -+ ivisurf->prop.dest_height != dest_height) -+ ivisurf->event_mask |= IVI_NOTIFICATION_DIMENSION; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_DIMENSION; - - return IVI_SUCCEEDED; - } -@@ -2306,7 +2316,10 @@ ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf, - prop->dest_x = dest_x; - prop->dest_y = dest_y; - -- ivisurf->event_mask |= IVI_NOTIFICATION_POSITION; -+ if (ivisurf->prop.dest_x != dest_x || ivisurf->prop.dest_y != dest_y) -+ ivisurf->event_mask |= IVI_NOTIFICATION_POSITION; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_POSITION; - - return IVI_SUCCEEDED; - } -@@ -2340,7 +2353,10 @@ ivi_layout_surface_set_orientation(struct ivi_layout_surface *ivisurf, - prop = &ivisurf->pending.prop; - prop->orientation = orientation; - -- ivisurf->event_mask |= IVI_NOTIFICATION_ORIENTATION; -+ if (ivisurf->prop.orientation != orientation) -+ ivisurf->event_mask |= IVI_NOTIFICATION_ORIENTATION; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_ORIENTATION; - - return IVI_SUCCEEDED; - } -@@ -2378,17 +2394,14 @@ ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn, - - wl_list_for_each_safe(ivilayer, next, &layout->layer_list, link) { - if (ivilayer->id_layer == addlayer->id_layer) { -- if (!wl_list_empty(&ivilayer->pending.link)) { -- wl_list_remove(&ivilayer->pending.link); -- } -- wl_list_init(&ivilayer->pending.link); -+ wl_list_remove(&ivilayer->pending.link); - wl_list_insert(&iviscrn->pending.layer_list, - &ivilayer->pending.link); - break; - } - } - -- iviscrn->event_mask |= IVI_NOTIFICATION_ADD; -+ iviscrn->order.dirty = 1; - - return IVI_SUCCEEDED; - } -@@ -2411,23 +2424,11 @@ ivi_layout_screen_set_render_order(struct ivi_layout_screen *iviscrn, - - wl_list_for_each_safe(ivilayer, next, - &iviscrn->pending.layer_list, pending.link) { -+ wl_list_remove(&ivilayer->pending.link); - wl_list_init(&ivilayer->pending.link); - } - -- wl_list_init(&iviscrn->pending.layer_list); -- -- if (pLayer == NULL) { -- wl_list_for_each_safe(ivilayer, next, &iviscrn->pending.layer_list, pending.link) { -- if (!wl_list_empty(&ivilayer->pending.link)) { -- wl_list_remove(&ivilayer->pending.link); -- } -- -- wl_list_init(&ivilayer->pending.link); -- } -- -- iviscrn->event_mask |= IVI_NOTIFICATION_REMOVE; -- return IVI_SUCCEEDED; -- } -+ assert(wl_list_empty(&iviscrn->pending.layer_list)); - - for (i = 0; i < number; i++) { - id_layer = &pLayer[i]->id_layer; -@@ -2436,17 +2437,14 @@ ivi_layout_screen_set_render_order(struct ivi_layout_screen *iviscrn, - continue; - } - -- if (!wl_list_empty(&ivilayer->pending.link)) { -- wl_list_remove(&ivilayer->pending.link); -- } -- wl_list_init(&ivilayer->pending.link); -+ wl_list_remove(&ivilayer->pending.link); - wl_list_insert(&iviscrn->pending.layer_list, - &ivilayer->pending.link); - break; - } - } - -- iviscrn->event_mask |= IVI_NOTIFICATION_ADD; -+ iviscrn->order.dirty = 1; - - return IVI_SUCCEEDED; - } -@@ -2555,17 +2553,14 @@ ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer, - - wl_list_for_each_safe(ivisurf, next, &layout->surface_list, link) { - if (ivisurf->id_surface == addsurf->id_surface) { -- if (!wl_list_empty(&ivisurf->pending.link)) { -- wl_list_remove(&ivisurf->pending.link); -- } -- wl_list_init(&ivisurf->pending.link); -+ wl_list_remove(&ivisurf->pending.link); - wl_list_insert(&ivilayer->pending.surface_list, - &ivisurf->pending.link); - break; - } - } - -- ivilayer->event_mask |= IVI_NOTIFICATION_ADD; -+ ivilayer->order.dirty = 1; - - return IVI_SUCCEEDED; - } -@@ -2585,15 +2580,13 @@ ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer, - wl_list_for_each_safe(ivisurf, next, - &ivilayer->pending.surface_list, pending.link) { - if (ivisurf->id_surface == remsurf->id_surface) { -- if (!wl_list_empty(&ivisurf->pending.link)) { -- wl_list_remove(&ivisurf->pending.link); -- } -+ wl_list_remove(&ivisurf->pending.link); - wl_list_init(&ivisurf->pending.link); - break; - } - } - -- remsurf->event_mask |= IVI_NOTIFICATION_REMOVE; -+ ivilayer->order.dirty = 1; - } - - static int32_t -@@ -2614,7 +2607,12 @@ ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf, - prop->source_width = width; - prop->source_height = height; - -- ivisurf->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; -+ if (ivisurf->prop.source_x != x || ivisurf->prop.source_y != y || -+ ivisurf->prop.source_width != width || -+ ivisurf->prop.source_height != height) -+ ivisurf->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; -+ else -+ ivisurf->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; - - return IVI_SUCCEEDED; - } -@@ -2731,7 +2729,7 @@ ivi_layout_get_weston_view(struct ivi_layout_surface *surface) - { - struct weston_view *tmpview = NULL; - -- if(surface == NULL) -+ if (surface == NULL) - return NULL; - - wl_list_for_each(tmpview, &surface->surface->views, surface_link) -@@ -2796,7 +2794,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, - return NULL; - } - -- wl_list_init(&ivisurf->link); - wl_signal_init(&ivisurf->property_changed); - wl_signal_init(&ivisurf->configured); - wl_list_init(&ivisurf->layer_list); -@@ -2804,10 +2801,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, - ivisurf->layout = layout; - - ivisurf->surface = wl_surface; -- ivisurf->surface_destroy_listener.notify = -- westonsurface_destroy_from_ivisurface; -- wl_resource_add_destroy_listener(wl_surface->resource, -- &ivisurf->surface_destroy_listener); - - tmpview = weston_view_create(wl_surface); - if (tmpview == NULL) { -@@ -2817,17 +2810,8 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, - ivisurf->surface->width_from_buffer = 0; - ivisurf->surface->height_from_buffer = 0; - -- weston_matrix_init(&ivisurf->surface_rotation.matrix); -- weston_matrix_init(&ivisurf->layer_rotation.matrix); -- weston_matrix_init(&ivisurf->surface_pos.matrix); -- weston_matrix_init(&ivisurf->layer_pos.matrix); -- weston_matrix_init(&ivisurf->scaling.matrix); -- -- wl_list_init(&ivisurf->surface_rotation.link); -- wl_list_init(&ivisurf->layer_rotation.link); -- wl_list_init(&ivisurf->surface_pos.link); -- wl_list_init(&ivisurf->layer_pos.link); -- wl_list_init(&ivisurf->scaling.link); -+ weston_matrix_init(&ivisurf->transform.matrix); -+ wl_list_init(&ivisurf->transform.link); - - init_surface_properties(&ivisurf->prop); - ivisurf->event_mask = 0; -@@ -2927,7 +2911,7 @@ static struct ivi_controller_interface ivi_controller_interface = { - .add_notification_remove_layer = ivi_layout_add_notification_remove_layer, - .remove_notification_remove_layer = ivi_layout_remove_notification_remove_layer, - .layer_create_with_dimension = ivi_layout_layer_create_with_dimension, -- .layer_remove = ivi_layout_layer_remove, -+ .layer_destroy = ivi_layout_layer_destroy, - .get_layers = ivi_layout_get_layers, - .get_id_of_layer = ivi_layout_get_id_of_layer, - .get_layer_from_id = ivi_layout_get_layer_from_id, -@@ -2954,7 +2938,7 @@ static struct ivi_controller_interface ivi_controller_interface = { - .layer_set_transition = ivi_layout_layer_set_transition, - - /** -- * screen controller interfaces -+ * screen controller interfaces part1 - */ - .get_screen_from_id = ivi_layout_get_screen_from_id, - .get_screen_resolution = ivi_layout_get_screen_resolution, -@@ -2975,6 +2959,17 @@ static struct ivi_controller_interface ivi_controller_interface = { - */ - .surface_get_size = ivi_layout_surface_get_size, - .surface_dump = ivi_layout_surface_dump, -+ -+ /** -+ * remove notification by callback on property changes of ivi_surface/layer -+ */ -+ .surface_remove_notification_by_callback = ivi_layout_surface_remove_notification_by_callback, -+ .layer_remove_notification_by_callback = ivi_layout_layer_remove_notification_by_callback, -+ -+ /** -+ * screen controller interfaces part2 -+ */ -+ .get_id_of_screen = ivi_layout_get_id_of_screen - }; - - int -diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c -index 4a688cc..4c63410 100644 ---- a/ivi-shell/ivi-shell.c -+++ b/ivi-shell/ivi-shell.c -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2013 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - /* -@@ -126,6 +129,22 @@ ivi_shell_surface_configure(struct weston_surface *surface, - } - } - -+static void -+layout_surface_cleanup(struct ivi_shell_surface *ivisurf) -+{ -+ assert(ivisurf->layout_surface != NULL); -+ -+ ivi_layout_surface_destroy(ivisurf->layout_surface); -+ ivisurf->layout_surface = NULL; -+ -+ ivisurf->surface->configure = NULL; -+ ivisurf->surface->configure_private = NULL; -+ ivisurf->surface = NULL; -+ -+ // destroy weston_surface destroy signal. -+ wl_list_remove(&ivisurf->surface_destroy_listener.link); -+} -+ - /* - * The ivi_surface wl_resource destructor. - * -@@ -135,9 +154,18 @@ static void - shell_destroy_shell_surface(struct wl_resource *resource) - { - struct ivi_shell_surface *ivisurf = wl_resource_get_user_data(resource); -- if (ivisurf != NULL) { -- ivisurf->resource = NULL; -- } -+ -+ if (ivisurf == NULL) -+ return; -+ -+ assert(ivisurf->resource == resource); -+ -+ if (ivisurf->layout_surface != NULL) -+ layout_surface_cleanup(ivisurf); -+ -+ wl_list_remove(&ivisurf->link); -+ -+ free(ivisurf); - } - - /* Gets called through the weston_surface destroy signal. */ -@@ -150,21 +178,8 @@ shell_handle_surface_destroy(struct wl_listener *listener, void *data) - - assert(ivisurf != NULL); - -- if (ivisurf->surface!=NULL) { -- ivisurf->surface->configure = NULL; -- ivisurf->surface->configure_private = NULL; -- ivisurf->surface = NULL; -- } -- -- wl_list_remove(&ivisurf->surface_destroy_listener.link); -- wl_list_remove(&ivisurf->link); -- -- if (ivisurf->resource != NULL) { -- wl_resource_set_user_data(ivisurf->resource, NULL); -- ivisurf->resource = NULL; -- } -- free(ivisurf); -- -+ if (ivisurf->layout_surface != NULL) -+ layout_surface_cleanup(ivisurf); - } - - /* Gets called, when a client sends ivi_surface.destroy request. */ -@@ -219,7 +234,7 @@ application_surface_create(struct wl_client *client, - layout_surface = ivi_layout_surface_create(weston_surface, id_surface); - - /* check if id_ivi is already used for wl_surface*/ -- if (layout_surface == NULL){ -+ if (layout_surface == NULL) { - wl_resource_post_error(resource, - IVI_APPLICATION_ERROR_IVI_ID, - "surface_id is already assigned " -@@ -338,8 +353,8 @@ shell_destroy(struct wl_listener *listener, void *data) - } - - static void --terminate_binding(struct weston_seat *seat, uint32_t time, uint32_t key, -- void *data) -+terminate_binding(struct weston_seat *seat, uint32_t time, -+ uint32_t key, void *data) - { - struct weston_compositor *compositor = data; - -@@ -423,6 +438,8 @@ module_init(struct weston_compositor *compositor, - if (input_panel_setup(shell) < 0) - goto out_settings; - -+ text_backend_init(compositor); -+ - if (wl_global_create(compositor->wl_display, - &ivi_application_interface, 1, - shell, bind_ivi_application) == NULL) -diff --git a/ivi-shell/ivi-shell.h b/ivi-shell/ivi-shell.h -index 2f42173..9a05eb2 100644 ---- a/ivi-shell/ivi-shell.h -+++ b/ivi-shell/ivi-shell.h -@@ -1,23 +1,26 @@ - /* - * Copyright (C) 2013 DENSO CORPORATION - * -- * 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. -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: - * -- * 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. -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. - */ - - #include -@@ -32,6 +35,8 @@ struct ivi_shell - - struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */ - -+ struct text_backend *text_backend; -+ - struct wl_listener show_input_panel_listener; - struct wl_listener hide_input_panel_listener; - struct wl_listener update_input_panel_listener; --- -1.8.3.1 - diff --git a/meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0002-IVI-Shell-use-primary-screen-for-resolution.patch b/meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-use-primary-screen-for-resolution.patch similarity index 100% rename from meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0002-IVI-Shell-use-primary-screen-for-resolution.patch rename to meta-ivi-common/recipes-graphics/wayland/weston-ivi-shell/0001-IVI-Shell-use-primary-screen-for-resolution.patch diff --git a/meta-ivi-common/recipes-graphics/wayland/weston_1.8.0.bbappend b/meta-ivi-common/recipes-graphics/wayland/weston_1.9.0.bbappend similarity index 52% rename from meta-ivi-common/recipes-graphics/wayland/weston_1.8.0.bbappend rename to meta-ivi-common/recipes-graphics/wayland/weston_1.9.0.bbappend index 993d8263d..c2f4b5bc9 100644 --- a/meta-ivi-common/recipes-graphics/wayland/weston_1.8.0.bbappend +++ b/meta-ivi-common/recipes-graphics/wayland/weston_1.9.0.bbappend @@ -2,8 +2,7 @@ FILESEXTRAPATHS_prepend := ":${THISDIR}/weston-ivi-shell:" SRC_URI_append = " \ - file://0001-IVI-Shell-Backport-from-Weston-1.9.0-to-1.8.0.patch \ - file://0002-IVI-Shell-use-primary-screen-for-resolution.patch \ + file://0001-IVI-Shell-use-primary-screen-for-resolution.patch \ " EXTRA_OECONF_append = " --enable-ivi-shell" -- 2.16.6 From 59e41f594b47570c7d59738c9c38eac42b4cd0d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Wed, 23 Mar 2016 14:33:26 +0100 Subject: [PATCH 07/16] security-manager: Removes agl only adaptations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These adaptations are now part of meta-intel-iot-security and thus are no more needed here. Change-Id: I0acfb3b7ea572b9805c2d53f70ea0eab0026cdae Signed-off-by: José Bollo --- .../recipes-security/security-manager/README.md | 36 ---- .../Removing-tizen-platform-config.patch | 196 --------------------- .../removes-dependency-to-libslp-db-utils.patch | 78 -------- .../security-manager/security-manager_git.bbappend | 20 --- 4 files changed, 330 deletions(-) delete mode 100644 meta-agl-security/recipes-security/security-manager/README.md delete mode 100644 meta-agl-security/recipes-security/security-manager/security-manager/Removing-tizen-platform-config.patch delete mode 100644 meta-agl-security/recipes-security/security-manager/security-manager/removes-dependency-to-libslp-db-utils.patch delete mode 100644 meta-agl-security/recipes-security/security-manager/security-manager_git.bbappend diff --git a/meta-agl-security/recipes-security/security-manager/README.md b/meta-agl-security/recipes-security/security-manager/README.md deleted file mode 100644 index aeb45d260..000000000 --- a/meta-agl-security/recipes-security/security-manager/README.md +++ /dev/null @@ -1,36 +0,0 @@ -security-manager adaptation for Automotive Grade Linux Distribution -=================================================================== - -This recipe complements the recipes security-manager of the -meta yocto layers: meta-intel-iot-security (see -https://github.com/01org/meta-intel-iot-security) - -This patches are removing dependencies that are specific to Tizen: -* tizen-platform-config -* libslp-db-utils - -The advantages is that this modules are not needed for AGL. - -The -temporary- drawbacks is that the user "userapp" is -hard coded for security-manager. - - -Layer Dependencies ------------------- -URI: git@github.com:01org/meta-intel-iot-security.git -> branch: master -> revision: 0ca70e4954aaeb0e3e3ad502b462bb077023f7e5 - -Enabling --------- - -To enable security manager for AGL, in the local.conf - - IMAGE_INSTALL_append = " security-manager" - -To enable smack see https://github.com/01org/meta-intel-iot-security/tree/master/meta-security-smack -In brief, in the local.conf: - - OVERRIDES .= ":smack" - DISTRO_FEATURES_append = " smack" - diff --git a/meta-agl-security/recipes-security/security-manager/security-manager/Removing-tizen-platform-config.patch b/meta-agl-security/recipes-security/security-manager/security-manager/Removing-tizen-platform-config.patch deleted file mode 100644 index 4baea6572..000000000 --- a/meta-agl-security/recipes-security/security-manager/security-manager/Removing-tizen-platform-config.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 72e66d0e42f3bb6efd689ce33b1df407d94b3c60 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= -Date: Mon, 16 Nov 2015 14:26:25 +0100 -Subject: [PATCH] Removing tizen-platform-config - -Change-Id: Ic832a2b75229517b09faba969c27fb1a4b490121 ---- - policy/security-manager-policy-reload | 2 +- - src/common/file-lock.cpp | 4 +--- - src/common/include/file-lock.h | 1 - - src/common/include/privilege_db.h | 3 +-- - src/common/service_impl.cpp | 39 +++++++++++------------------------ - src/common/smack-rules.cpp | 12 ++++------- - 6 files changed, 19 insertions(+), 42 deletions(-) - -diff --git a/policy/security-manager-policy-reload b/policy/security-manager-policy-reload -index 6f211c6..ed8047a 100755 ---- a/policy/security-manager-policy-reload -+++ b/policy/security-manager-policy-reload -@@ -2,7 +2,7 @@ - - POLICY_PATH=/usr/share/security-manager/policy - PRIVILEGE_GROUP_MAPPING=$POLICY_PATH/privilege-group.list --DB_FILE=`tzplatform-get TZ_SYS_DB | cut -d= -f2`/.security-manager.db -+DB_FILE=/usr/dbspace/.security-manager.db - - # Create default buckets - while read bucket default_policy -diff --git a/src/common/file-lock.cpp b/src/common/file-lock.cpp -index 6f3996c..1dada17 100644 ---- a/src/common/file-lock.cpp -+++ b/src/common/file-lock.cpp -@@ -30,9 +30,7 @@ - - namespace SecurityManager { - --char const * const SERVICE_LOCK_FILE = tzplatform_mkpath3(TZ_SYS_RUN, -- "lock", -- "security-manager.lock"); -+char const * const SERVICE_LOCK_FILE = "/var/run/lock/security-manager.lock"; - - FileLocker::FileLocker(const std::string &lockFile, bool blocking) - { -diff --git a/src/common/include/file-lock.h b/src/common/include/file-lock.h -index 604b019..21a86a0 100644 ---- a/src/common/include/file-lock.h -+++ b/src/common/include/file-lock.h -@@ -29,7 +29,6 @@ - - #include - #include --#include - - namespace SecurityManager { - -diff --git a/src/common/include/privilege_db.h b/src/common/include/privilege_db.h -index 4d73d90..03c6680 100644 ---- a/src/common/include/privilege_db.h -+++ b/src/common/include/privilege_db.h -@@ -34,14 +34,13 @@ - #include - - #include --#include - - #ifndef PRIVILEGE_DB_H_ - #define PRIVILEGE_DB_H_ - - namespace SecurityManager { - --const char *const PRIVILEGE_DB_PATH = tzplatform_mkpath(TZ_SYS_DB, ".security-manager.db"); -+const char *const PRIVILEGE_DB_PATH = "/usr/dbspace/.security-manager.db"; - - enum class QueryType { - EGetPkgPrivileges, -diff --git a/src/common/service_impl.cpp b/src/common/service_impl.cpp -index ae305d3..65cc8b5 100644 ---- a/src/common/service_impl.cpp -+++ b/src/common/service_impl.cpp -@@ -32,7 +32,6 @@ - #include - - #include --#include - - #include "protocols.h" - #include "privilege_db.h" -@@ -131,7 +130,13 @@ static inline int validatePolicy(policy_entry &policyEntry, std::string uidStr, - - static uid_t getGlobalUserId(void) - { -- static uid_t globaluid = tzplatform_getuid(TZ_SYS_GLOBALAPP_USER); -+ static uid_t globaluid = 0; -+ if (!globaluid) { -+ struct passwd pw, *p; -+ char buf[4096]; -+ int rc = getpwnam_r("userapp", &pw, buf, sizeof buf, &p); -+ globaluid = (rc || p == NULL) ? 555 : p->pw_uid; -+ } - return globaluid; - } - -@@ -161,37 +166,17 @@ static inline bool isSubDir(const char *parent, const char *subdir) - - static bool getUserAppDir(const uid_t &uid, std::string &userAppDir) - { -- struct tzplatform_context *tz_ctx = nullptr; -- -- if (tzplatform_context_create(&tz_ctx)) -- return false; -- -- if (tzplatform_context_set_user(tz_ctx, uid)) { -- tzplatform_context_destroy(tz_ctx); -- tz_ctx = nullptr; -+ struct passwd pw, *p; -+ char buf[4096]; -+ int rc = getpwuid_r(uid, &pw, buf, sizeof buf, &p); -+ if (rc || p == NULL) - return false; -- } -- -- enum tzplatform_variable id = -- (uid == getGlobalUserId()) ? TZ_SYS_RW_APP : TZ_USER_APP; -- const char *appDir = tzplatform_context_getenv(tz_ctx, id); -- if (!appDir) { -- tzplatform_context_destroy(tz_ctx); -- tz_ctx = nullptr; -- return false; -- } -- -- userAppDir = appDir; -- -- tzplatform_context_destroy(tz_ctx); -- tz_ctx = nullptr; -- -+ userAppDir = p->pw_dir; - return true; - } - - static inline bool installRequestAuthCheck(const app_inst_req &req, uid_t uid, bool &isCorrectPath, std::string &appPath) - { -- std::string userHome; - std::string userAppDir; - std::stringstream correctPath; - -diff --git a/src/common/smack-rules.cpp b/src/common/smack-rules.cpp -index d834e42..8b5728b 100644 ---- a/src/common/smack-rules.cpp -+++ b/src/common/smack-rules.cpp -@@ -34,7 +34,6 @@ - #include - - #include --#include - - #include "smack-labels.h" - #include "smack-rules.h" -@@ -43,7 +42,7 @@ namespace SecurityManager { - - const char *const SMACK_APP_LABEL_TEMPLATE = "~APP~"; - const char *const SMACK_PKG_LABEL_TEMPLATE = "~PKG~"; --const char *const APP_RULES_TEMPLATE_FILE_PATH = tzplatform_mkpath4(TZ_SYS_SHARE, "security-manager", "policy", "app-rules-template.smack"); -+const char *const APP_RULES_TEMPLATE_FILE_PATH = "/usr/share/security-manager/policy/app-rules-template.smack"; - const char *const SMACK_APP_IN_PACKAGE_PERMS = "rwxat"; - - SmackRules::SmackRules() -@@ -237,14 +236,12 @@ void SmackRules::generatePackageCrossDeps(const std::vector &pkgCon - - std::string SmackRules::getPackageRulesFilePath(const std::string &pkgId) - { -- std::string path(tzplatform_mkpath3(TZ_SYS_SMACK, "accesses.d", ("pkg_" + pkgId).c_str())); -- return path; -+ return "/etc/smack/accesses.d/pkg_" + pkgId; - } - - std::string SmackRules::getApplicationRulesFilePath(const std::string &appId) - { -- std::string path(tzplatform_mkpath3(TZ_SYS_SMACK, "accesses.d", ("app_" + appId).c_str())); -- return path; -+ return "/etc/smack/accesses.d/app_" + appId; - } - void SmackRules::installApplicationPrivilegesRules(const std::string &appId, const std::string &pkgId, - const std::vector &pkgContents, const std::vector &privileges) -@@ -256,8 +253,7 @@ void SmackRules::installApplicationPrivilegesRules(const std::string &appId, con - for (auto privilege : privileges) { - if (privilege.empty()) - continue; -- std::string fprivilege ( privilege + "-template.smack"); -- std::string path(tzplatform_mkpath4(TZ_SYS_SHARE, "security-manager", "policy", fprivilege.c_str())); -+ std::string path = "/usr/share/security-manager/policy/" + privilege + "-template.smack"; - if( stat(path.c_str(), &buffer) == 0) - smackRules.addFromTemplateFile(appId, pkgId, path); - } --- -2.1.4 - diff --git a/meta-agl-security/recipes-security/security-manager/security-manager/removes-dependency-to-libslp-db-utils.patch b/meta-agl-security/recipes-security/security-manager/security-manager/removes-dependency-to-libslp-db-utils.patch deleted file mode 100644 index f94973074..000000000 --- a/meta-agl-security/recipes-security/security-manager/security-manager/removes-dependency-to-libslp-db-utils.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 1e2f8f58d4320afa1d83a6f94822e53346108ee8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= -Date: Mon, 16 Nov 2015 15:56:27 +0100 -Subject: [PATCH] removes dependency to libslp-db-utils - -Change-Id: I90471e77d20e04bae58cc42eb2639e4aef97fdec ---- - src/common/CMakeLists.txt | 1 ++- - src/dpl/db/src/sql_connection.cpp | 17 +---------------- - 2 files changed, 3 additions(+), 17 deletions(-) - -diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt -index 968c7c1..d1fe644 100644 ---- a/src/common/CMakeLists.txt -+++ b/src/common/CMakeLists.txt -@@ -5,7 +5,8 @@ PKG_CHECK_MODULES(COMMON_DEP - REQUIRED - libsystemd - libsmack -- db-util -+ sqlite3 -+ icu-i18n - cynara-admin - cynara-client - ) -diff --git a/src/dpl/db/src/sql_connection.cpp b/src/dpl/db/src/sql_connection.cpp -index fdb4fe4..1fb97be 100644 ---- a/src/dpl/db/src/sql_connection.cpp -+++ b/src/dpl/db/src/sql_connection.cpp -@@ -26,7 +26,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -606,16 +605,7 @@ void SqlConnection::Connect(const std::string &address, - - // Connect to database - int result; -- if (type & Flag::UseLucene) { -- result = db_util_open_with_options( -- address.c_str(), -- &m_connection, -- flag, -- NULL); -- -- m_usingLucene = true; -- LogPedantic("Lucene index enabled"); -- } else { -+ (void)type; - result = sqlite3_open_v2( - address.c_str(), - &m_connection, -@@ -624,7 +614,6 @@ void SqlConnection::Connect(const std::string &address, - - m_usingLucene = false; - LogPedantic("Lucene index disabled"); -- } - - if (result == SQLITE_OK) { - LogPedantic("Connected to DB"); -@@ -653,11 +642,7 @@ void SqlConnection::Disconnect() - - int result; - -- if (m_usingLucene) { -- result = db_util_close(m_connection); -- } else { - result = sqlite3_close(m_connection); -- } - - if (result != SQLITE_OK) { - const char *error = sqlite3_errmsg(m_connection); --- -2.1.4 - diff --git a/meta-agl-security/recipes-security/security-manager/security-manager_git.bbappend b/meta-agl-security/recipes-security/security-manager/security-manager_git.bbappend deleted file mode 100644 index 28050e817..000000000 --- a/meta-agl-security/recipes-security/security-manager/security-manager_git.bbappend +++ /dev/null @@ -1,20 +0,0 @@ - -FILESEXTRAPATHS_append := ":${THISDIR}/security-manager" - -SRC_URI += " \ - file://Removing-tizen-platform-config.patch \ - file://removes-dependency-to-libslp-db-utils.patch \ -" - -DEPENDS = " \ -attr \ -boost \ -cynara \ -icu \ -libcap \ -smack \ -sqlite3 \ -sqlite3-native \ -systemd \ -" - -- 2.16.6 From 3656c6b2a718609e0663d78e55a45ec11ccb7c03 Mon Sep 17 00:00:00 2001 From: Yannick Gicquel Date: Thu, 31 Mar 2016 14:09:20 +0200 Subject: [PATCH 08/16] p7zip: add native build support This is a host dependency to himeno benchmark recipe Change-Id: Ibf0dcaa866d94e533fc43d5a84ca38fa3a08ea07 Signed-off-by: Yannick Gicquel --- .../recipes-extended/p7zip/p7zip_9.20.1.bbappend | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 meta-ivi-common/recipes-extended/p7zip/p7zip_9.20.1.bbappend diff --git a/meta-ivi-common/recipes-extended/p7zip/p7zip_9.20.1.bbappend b/meta-ivi-common/recipes-extended/p7zip/p7zip_9.20.1.bbappend new file mode 100644 index 000000000..98a51a1e9 --- /dev/null +++ b/meta-ivi-common/recipes-extended/p7zip/p7zip_9.20.1.bbappend @@ -0,0 +1,22 @@ +# This bbappend is to implement native package built +# +# native support has been submitted upstream, and may land in meta-openembedded: +# http://lists.openembedded.org/pipermail/openembedded-devel/2016-March/106755.html + +# all3: to build bin/7za, bin/7z (with its plugins), bin/7zr and bin/7zCon.sfx +EXTRA_OEMAKE_class-native = "all3" + +do_install_class-native() { + install -d ${D}${bindir} + install -d ${D}${bindir}/Codecs + install -m 0755 ${S}/bin/7* ${D}${bindir} + install -m 0755 ${S}/bin/Codecs/* ${D}${bindir}/Codecs + + # Create a shell script wrapper to execute next to 7z.so + mv ${D}${bindir}/7z ${D}${bindir}/7z.bin + echo "#! /bin/sh" > ${D}${bindir}/7z + echo "exec ${D}${bindir}/7z.bin \"\$@\"" >> ${D}${bindir}/7z + chmod 0755 ${D}${bindir}/7z +} + +BBCLASSEXTEND += "native" -- 2.16.6 From 40c365f17dc535b126c4e952b2fd126948b035fb Mon Sep 17 00:00:00 2001 From: Yannick Gicquel Date: Thu, 31 Mar 2016 14:18:33 +0200 Subject: [PATCH 09/16] Add new recipe for Himeno Benchmark Please refer to http://accc.riken.jp/en/supercom/himenobmt/ for more details on this benchmark. Change-Id: Ia1261940035549086d0c93d61fd5a5d75e83fbcb Signed-off-by: Yannick Gicquel --- meta-ivi-common/recipes-test/himeno/himeno_2.0.bb | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 meta-ivi-common/recipes-test/himeno/himeno_2.0.bb diff --git a/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb b/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb new file mode 100644 index 000000000..56177b9a6 --- /dev/null +++ b/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "Himeno Benchmark" +LICENSE = "LGPL-2.0" +URL = "http://accc.riken.jp/en/supercom/himenobmt/" + +SRC_URI = "http://accc.riken.jp/en/wp-content/uploads/sites/2/2015/07/himenobmt.c.zip" +SRC_URI[md5sum] = "8d8e837dfc3e00a3b322eb4ae3edd551" +SRC_URI[sha256sum] = "8780bfbdacb0d4dcab2931e65cadd69411731e3f2afcc1231d0743a036298077" + +LIC_FILES_CHKSUM = "file://himenoBMT.c;md5=8e8771ddc01c6d1a795e088e2d6dee78" + +# Upstream ZIP file contains an LZH archive, thus a 2 steps "unpack" is required. +# The LZH archive is unpacked after native tools dependency resolution, +# thus. after "configure" task in our case: + +DEPENDS = "p7zip-native" + +do_configure_append() { + 7z x -y -o${S} ${WORKDIR}/himenobmt.c.lzh +} + +do_install () { + install -d ${D}${bindir} + install -m 0755 bmt ${D}${bindir} +} -- 2.16.6 From 7a0588cdc35429e3d960bc9d37fe26ea4d28d22f Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Thu, 31 Mar 2016 18:13:20 +0200 Subject: [PATCH 10/16] Add recipe for ebizzy package for QA Change-Id: Iafcdfc58636eb5b42b6251f46baac96a55e28ed7 Signed-off-by: Stephane Desneux --- meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb diff --git a/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb b/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb new file mode 100644 index 000000000..19960417b --- /dev/null +++ b/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "Benchmark tool that generates a workload resembling common web application server workloads" +HOMEPAGE = "http://ebizzy.sourceforge.net/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" + +SRC_URI = "http://downloads.sourceforge.net/project/ebizzy/ebizzy/${PV}/ebizzy-${PV}.tar.gz" +SRC_URI[md5sum] = "af038bc506066bb3d28db08aba62bc38" +SRC_URI[sha256sum] = "77286029d6348f3d9b3f04eae1feadb5ad1ad07b9f688f4d9f002960862467f2" + +do_compile () { + ${CC} -Wall -Wshadow -lpthread -o ebizzy ebizzy.c +} + +do_install () { + install -d ${D}${bindir} + install -m 0755 ebizzy ${D}${bindir} +} + -- 2.16.6 From 9aa02c372cbc12fdd9064ec503b7136f4e70d885 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Tue, 22 Mar 2016 22:57:36 +0100 Subject: [PATCH 11/16] Add recipe for netpipe package for QA MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds a recipe for netpipe (NPtcp, NPtcp6, NPmemcpy) to be used in QA tests like JTA and others. Change-Id: I8b5c1bc8500498de6d72bfab8b624ecb4efa8ec6 Signed-off-by: Jan-Simon Möller --- .../netpipe/files/netpipe-makefile.patch | 245 +++++++++++++++++++++ .../recipes-test/netpipe/netpipe_3.7.2.bb | 26 +++ 2 files changed, 271 insertions(+) create mode 100644 meta-ivi-common/recipes-test/netpipe/files/netpipe-makefile.patch create mode 100644 meta-ivi-common/recipes-test/netpipe/netpipe_3.7.2.bb diff --git a/meta-ivi-common/recipes-test/netpipe/files/netpipe-makefile.patch b/meta-ivi-common/recipes-test/netpipe/files/netpipe-makefile.patch new file mode 100644 index 000000000..500ef0545 --- /dev/null +++ b/meta-ivi-common/recipes-test/netpipe/files/netpipe-makefile.patch @@ -0,0 +1,245 @@ +diff -Napur NetPIPE-3.7.2.orig/makefile NetPIPE-3.7.2/makefile +--- NetPIPE-3.7.2.orig/makefile 2010-08-19 22:34:26.000000000 +0200 ++++ NetPIPE-3.7.2/makefile 2016-03-22 22:30:50.752197933 +0100 +@@ -21,8 +21,8 @@ + # + ######################################################################## + +-CC = cc +-CFLAGS = -O -g ++CC ?= gcc ++CFLAGS ?= -O -g + SRC = ./src + + # For MPI, mpicc will set up the proper include and library paths +@@ -91,51 +91,51 @@ clean: + + + tcp: $(SRC)/tcp.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/tcp.c -DTCP -o NPtcp -I$(SRC) ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/tcp.c -DTCP -o NPtcp -I$(SRC) + + tcp6: $(SRC)/tcp.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/tcp6.c -DTCP6 \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/tcp6.c -DTCP6 \ + -o NPtcp6 -I$(SRC) + + sctp: $(SRC)/sctp.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/sctp.c -DSCTP \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/sctp.c -DSCTP \ + -o NPsctp -I$(SRC) + + sctp6: $(SRC)/sctp6.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/sctp6.c -DSCTP6 \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/sctp6.c -DSCTP6 \ + -o NPsctp6 -I$(SRC) + + ipx: $(SRC)/ipx.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/ipx.c -DIPX \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/ipx.c -DIPX \ + -o NPipx -I$(SRC) -lipx + + memcpy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/memcpy.c \ + -DMEMCPY -o NPmemcpy -I$(SRC) + + MP_memcpy: $(SRC)/memcpy.c $(SRC)/netpipe.c $(SRC)/netpipe.h $(SRC)/MP_memcpy.c +- $(CC) $(CFLAGS) -mmmx -msse $(SRC)/netpipe.c $(SRC)/memcpy.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -mmmx -msse $(SRC)/netpipe.c $(SRC)/memcpy.c \ + $(SRC)/MP_memcpy.c -DMEMCPY -DUSE_MP_MEMCPY -o NPmemcpy -I$(SRC) + + disk: $(SRC)/disk.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/disk.c -DDISK -o NPdisk -I$(SRC) ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/disk.c -DDISK -o NPdisk -I$(SRC) + + sync: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd ~/mplite; make clean; make sync; ) +- $(CC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmplite \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmplite \ + -I$(SRC) -I$(MP_Lite_home) $(MP_Lite_home)/libmplite.a + + debug2: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd ~/mplite; make debug2; ) +- $(CC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmplite \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmplite \ + -I$(SRC) -I$(MP_Lite_home) $(MP_Lite_home)/libmplite.a + + mpi: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(MPICC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpi -I$(SRC) ++ $(MPICC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c -o NPmpi -I$(SRC) + @ rm -f netpipe.o mpi.o + + mpipro: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpicc $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ ++ mpicc $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ + -o NPmpipro -I$(SRC) + @ rm -f netpipe.o mpi.o + +@@ -146,138 +146,138 @@ mpipro-gm: $(SRC)/mpi.c $(SRC)/netpipe.c + -L $HOME/np/packs/gm/binary/lib -lgm -lm -lpthread + + mpich: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichcc $(CFLAGS) -DMPI $(SRC)/netpipe.c \ ++ mpichcc $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmpich -I$(SRC) + @ rm -f netpipe.o mpi.o + + mpich-trace: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichcc $(CFLAGS) -mpitrace -DMPI $(SRC)/netpipe.c \ ++ mpichcc $(CFLAGS) $(LDFLAGS) -mpitrace -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmpich -I$(SRC) + @ rm -f netpipe.o mpi.o + + mpich-log: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichcc $(CFLAGS) -mpilog -DMPI $(SRC)/netpipe.c \ ++ mpichcc $(CFLAGS) $(LDFLAGS) -mpilog -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmpich -I$(SRC) + @ rm -f netpipe.o mpi.o + + mpich-gm: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichgmcc $(CFLAGS) -DMPI $(SRC)/netpipe.c \ ++ mpichgmcc $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmpich-gm -I$(SRC) + @ rm -f netpipe.o mpi.o + + mx: $(SRC)/mx.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DMX $(SRC)/netpipe.c $(SRC)/mx.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMX $(SRC)/netpipe.c $(SRC)/mx.c \ + -o NPmx -I$(SRC) -I$(MX_INC) \ + $(MX_LIB) -static + + gm: $(SRC)/gm.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DGM $(SRC)/netpipe.c $(SRC)/gm.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DGM $(SRC)/netpipe.c $(SRC)/gm.c \ + -o NPgm -I$(SRC) -I$(GM_INC) -I$(GM_DRI) \ + $(GM_LIB) -static + + mvich: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mvichcc $(CFLAGS) -DMPI $(SRC)/netpipe.c \ ++ mvichcc $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmvich -I$(SRC) -lvipl + @ rm -f netpipe.o mpi.o + + mvich-gn: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mvichcc $(CFLAGS) -DMPI $(SRC)/netpipe.c \ ++ mvichcc $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPmvich-gn -I$(SRC) -lgnivipl + @ rm -f netpipe.o mpi.o + + mplite MP_Lite sigio: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd $(MP_Lite_home); make; ) +- $(CC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ + -o NPmplite -I$(SRC) -I$(MP_Lite_home) $(MP_Lite_home)/libmplite.a + + mplite-mvia: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd ~/mplite; make mvia; ) +- $(CC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ + -o NPmplite-mvia -I$(SRC) -I$(MP_Lite_home) \ + $(MP_Lite_home)/libmplite.a -lvipl -lpthread + + mplite-gn: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd ~/mplite; make giganet; ) +- $(CC) $(CFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ + -o NPmplite-gn -I$(SRC) -I$(MP_Lite_home) \ + $(MP_Lite_home)/libmplite.a -lgnivipl -lpthread + + mplite-ib: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h + ( cd $(MP_Lite_home); make ib; ) +- $(CC) $(CFLAGS) -g -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -g -DMPI $(SRC)/netpipe.c $(SRC)/mpi.c \ + -o NPmplite-ib -I$(SRC) -I$(MP_Lite_home) \ + $(MP_Lite_home)/libmplite.a -L/usr/mellanox/lib \ + -lmpga -lvapi -lpthread + + pvm: $(SRC)/pvm.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DPVM $(SRC)/netpipe.c $(SRC)/pvm.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DPVM $(SRC)/netpipe.c $(SRC)/pvm.c \ + -o NPpvm -I$(SRC) -I$(PVM_HOME)/include \ + -L $(PVM_HOME)/lib/$(PVM_ARCH)/ -lpvm3 -lgpvm3 + + tcgmsg: $(SRC)/tcgmsg.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DTCGMSG $(SRC)/netpipe.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DTCGMSG $(SRC)/netpipe.c \ + $(SRC)/tcgmsg.c -o NPtcgmsg -I$(SRC) -I$(TCGMSG_INC) $(TCGMSG_LIB) + + tcgmsg-mpich: $(SRC)/tcgmsg.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichcc $(CFLAGS) -DTCGMSG $(SRC)/netpipe.c \ ++ mpichcc $(CFLAGS) $(LDFLAGS) -DTCGMSG $(SRC)/netpipe.c \ + $(SRC)/tcgmsg.c -o NPtcgmsg.mpich -I$(SRC) -I$(TCGMSG_MPI_INC) \ + $(TCGMSG_MPI_LIB) $(TCGMSG_ARMCI_LIB) + + lapi: $(SRC)/lapi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpcc_r $(CFLAGS) -DLAPI $(SRC)/netpipe.c \ ++ mpcc_r $(CFLAGS) $(LDFLAGS) -DLAPI $(SRC)/netpipe.c \ + $(SRC)/lapi.c -o NPlapi + + t3e: $(SRC)/shmem.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DSHMEM $(SRC)/netpipe.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DSHMEM $(SRC)/netpipe.c \ + $(SRC)/shmem.c -o NPshmem + + shmem: $(SRC)/shmem.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DSHMEM $(SRC)/netpipe.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DSHMEM $(SRC)/netpipe.c \ + $(SRC)/shmem.c -o NPshmem -lsma + + gpshmem: $(SRC)/gpshmem.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- mpichcc $(CFLAGS) -DGPSHMEM -DSHMEM $(SRC)/netpipe.c \ ++ mpichcc $(CFLAGS) $(LDFLAGS) -DGPSHMEM -DSHMEM $(SRC)/netpipe.c \ + $(SRC)/gpshmem.c -I$(GPSHMEM_INC) -o NPgpshmem $(GPSHMEM_LIB) \ + $(ARMCI_LIB) + @ rm -f netpipe.o gpshmem.o + + paragon: $(SRC)/mpi.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) -nx $(CFLAGS) -DMPI $(SRC)/netpipe.c \ ++ $(CC) -nx $(CFLAGS) $(LDFLAGS) -DMPI $(SRC)/netpipe.c \ + $(SRC)/mpi.c -o NPparagon -I$(SRC) -lmpi + @ echo "On the Paragon, the buffer alignment does not work." + @ echo "Run using NPparagon -A 0." + + armci: $(SRC)/armci.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(MPICC) $(CFLAGS) -DARMCI $(SRC)/netpipe.c \ ++ $(MPICC) $(CFLAGS) $(LDFLAGS) -DARMCI $(SRC)/netpipe.c \ + $(SRC)/armci.c -o NParmci -I$(ARMCI_INC) $(ARMCI_LIB) + + mpi2: $(SRC)/mpi2.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(MPI2CC) $(CFLAGS) -DMPI -DMPI2 $(SRC)/netpipe.c \ ++ $(MPI2CC) $(CFLAGS) $(LDFLAGS) -DMPI -DMPI2 $(SRC)/netpipe.c \ + $(SRC)/mpi2.c -o NPmpi2 -I$(MPI2_INC) $(MPI2_LIB) + + ib: $(SRC)/ib.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/ib.c $(SRC)/netpipe.c -o NPib \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/ib.c $(SRC)/netpipe.c -o NPib \ + -DINFINIBAND -DTCP -I $(VAPI_INC) -L $(VAPI_LIB) \ + -lmpga -lvapi -lpthread + + ibv: $(SRC)/ibv.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/ibv.c $(SRC)/netpipe.c -o NPibv \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/ibv.c $(SRC)/netpipe.c -o NPibv \ + -DOPENIB -DTCP -I $(IBV_INC) -L $(IBV_LIB) -libverbs + + atoll: $(SRC)/atoll.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) -DATOLL $(SRC)/netpipe.c \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -DATOLL $(SRC)/netpipe.c \ + $(SRC)/atoll.c -o NPatoll \ + -I$(PALMS_PATH)/include -L$(PALMS_PATH)/lib -latoll + + udapl: $(SRC)/udapl.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CFLAGS) $(SRC)/udapl.c $(SRC)/netpipe.c -o NPudapl \ ++ $(CC) $(CFLAGS) $(LDFLAGS) $(SRC)/udapl.c $(SRC)/netpipe.c -o NPudapl \ + -DDAT -DTCP -DUSE_VOLATILE_RPTR -I $(UDAPL_INC) -L $(UDAPL_LIB) \ + -ldat -lpthread + + vmsplice: $(SRC)/vmsplice.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CPPFLAGS) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/vmsplice.c \ ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/vmsplice.c \ + -DVMSPLICE -o NPvmsplice -I$(SRC) + + knem: $(SRC)/knem.c $(SRC)/netpipe.c $(SRC)/netpipe.h +- $(CC) $(CPPFLAGS) $(CFLAGS) $(SRC)/netpipe.c $(SRC)/knem.c \ ++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SRC)/netpipe.c $(SRC)/knem.c \ + -DKNEM -o NPknem -I$(SRC) diff --git a/meta-ivi-common/recipes-test/netpipe/netpipe_3.7.2.bb b/meta-ivi-common/recipes-test/netpipe/netpipe_3.7.2.bb new file mode 100644 index 000000000..6a4004ea8 --- /dev/null +++ b/meta-ivi-common/recipes-test/netpipe/netpipe_3.7.2.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "Network Protocol Independent Performance Evaluator" +LICENSE = "GPL-1.0" +URL = "http://bitspjoule.org/netpipe" + +# PV from recipe filename +SRC_URI = "http://bitspjoule.org/netpipe/code/NetPIPE-${PV}.tar.gz" +# change makefile to support env variables of bitbake +SRC_URI += "file://netpipe-makefile.patch" + +SRC_URI[md5sum] = "653071f785404bb68f8aaeff89fb1f33" +SRC_URI[sha256sum] = "13dac884ff52951636f651c421f5ff4a853218a95aa28a4a852402ee385a2ab8" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-1.0;md5=e9e36a9de734199567a4d769498f743d" + +# bitbake expects ${PN}-${PV} which would be netpipe-3.7.2 but the tarball has: +S = "${WORKDIR}/NetPIPE-${PV}" + +# added after 'make' as argument +EXTRA_OEMAKE = "tcp tcp6 memcpy" + +do_install () { + install -d ${D}${bindir} + install -m 0755 NPtcp ${D}${bindir} + install -m 0755 NPtcp6 ${D}${bindir} + install -m 0755 NPmemcpy ${D}${bindir} +} -- 2.16.6 From 847a79109e5a234b60a905bf677b74b88b40d134 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Tue, 22 Mar 2016 22:05:33 +0100 Subject: [PATCH 12/16] Add package bc to packagegroup-ivi-common-test.bb MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds the package 'bc' to the packagegroup-ivi-common-test . It is used in the JTA test Benchmark.bc . Change-Id: I14bffad3a5cb18264c755f4f94fb4320bfc26bf7 Signed-off-by: Jan-Simon Möller --- .../recipes-test/packagegroups/packagegroup-ivi-common-test.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb b/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb index e613d43b0..420b06133 100644 --- a/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb +++ b/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb @@ -12,4 +12,5 @@ PACKAGES = "\ ALLOW_EMPTY_${PN} = "1" RDEPENDS_${PN} += "\ + bc \ " -- 2.16.6 From 8bd4c311799c5d6231de9210ac7dd768a9420eaf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan-Simon=20M=C3=B6ller?= Date: Tue, 22 Mar 2016 22:01:59 +0100 Subject: [PATCH 13/16] Add agl-image-minimal-qa.bb MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add a minimal image enhanced by the binaries needed to run the QA tests. This image is intended to work w/o the graphics drivers and thus additional files are needed. Pure open userspace. Change-Id: I6a38cf9cd929eab9a72ea09e9a23ee7592692175 Signed-off-by: Jan-Simon Möller --- meta-agl/recipes-core/images/agl-image-minimal-qa.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 meta-agl/recipes-core/images/agl-image-minimal-qa.bb diff --git a/meta-agl/recipes-core/images/agl-image-minimal-qa.bb b/meta-agl/recipes-core/images/agl-image-minimal-qa.bb new file mode 100644 index 000000000..c5832f257 --- /dev/null +++ b/meta-agl/recipes-core/images/agl-image-minimal-qa.bb @@ -0,0 +1,10 @@ +SUMMARY = "An AGL small image just capable of allowing a device to boot and run tests." + +DESCRIPTION = "A minimal set of AGL Distribution. This image also has additional \ +packages (e.g. commandline tools) for Quality Assurance(QA)." + +require agl-image-minimal.bb + +IMAGE_INSTALL_append = " \ + packagegroup-ivi-common-test \ + " -- 2.16.6 From c2a3d0a1fac09ca9396c637ed9429889e4afe071 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Fri, 1 Apr 2016 15:59:50 +0200 Subject: [PATCH 14/16] Add recipe for blobsallad package (JTA QA requirement) Change-Id: I17e0b7ca6335cb90fecf4ff4f3e88607f8055e8b Signed-off-by: Stephane Desneux --- .../blobsallad/blobsallad/0001-Makefile.patch | 53 ++++++++++++ .../blobsallad/blobsallad/0002-auto.patch | 95 ++++++++++++++++++++++ .../blobsallad/blobsallad/0003-printcleanup.patch | 11 +++ .../blobsallad/blobsallad/0004-bs_main.c.patch | 15 ++++ .../blobsallad/blobsallad_2006-11-14-23-57.bb | 34 ++++++++ 5 files changed, 208 insertions(+) create mode 100755 meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch create mode 100755 meta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch create mode 100755 meta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch create mode 100755 meta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch create mode 100644 meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch new file mode 100755 index 000000000..0ae56cee1 --- /dev/null +++ b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch @@ -0,0 +1,53 @@ +--- a/Makefile.orig 2016-04-01 15:50:20.636358716 +0200 ++++ b/Makefile 2016-04-01 15:51:58.916361191 +0200 +@@ -1,3 +1,9 @@ ++INCDIR = $(SDKROOT)/usr/include ++LIBDIR = $(SDKROOT)/usr/lib ++ ++EXTRA_CFLAGS=-I$(INCDIR) ++EXTRA_LDFLAGS=-Wl,-rpath-link=$(LIBDIR) -L$(LIBDIR) ++ + OBJECTS = bs_main.o \ + bs_vector.o \ + bs_pointmass.o \ +@@ -15,21 +21,21 @@ + bs_profiler.o \ + bs_rubberband.o + +-CC = gcc ++#CC = gcc + + DISTDIR = blobsallad-src + +-CFLAGS = `pkg-config --cflags cairo; sdl-config --cflags` +-LIBS = `pkg-config --libs cairo; sdl-config --libs` -lm -lGL -lGLU ++EXTRA_CFLAGS += -I$(INCDIR)/cairo -I$(INCDIR)/SDL -D_GNU_SOURCE=1 -D_REENTRANT ++EXTRA_LDFLAGS += -lcairo -lSDL -lpthread -lm + + all: $(OBJECTS) +- $(CC) -g -o blobsallad $(OBJECTS) $(LIBS) ++ $(CC) -g -o blobsallad $(OBJECTS) $(EXTRA_LDFLAGS) + + map: +- gcc -o createmap create_testdata.c -Wall -g -lm ++ $(CC) -o createmap create_testdata.c -Wall -g -lm + + octree: +- gcc -o test_octree test_octree.c bs_octree.c bs_list.c bs_vector.c bs_vector_util.c bs_timer.c bs_array.c -Wall -O2 $(LIBS) $(CFLAGS) ++ $(CC) -o test_octree test_octree.c bs_octree.c bs_list.c bs_vector.c bs_vector_util.c bs_timer.c bs_array.c -Wall -O2 $(EXTRA_LDFLAGS) $(EXTRA_CFLAGS) + + GFX_OBJECTS = gfx_main.o \ + bs_gfx.o \ +@@ -41,10 +47,10 @@ + bs_list.o + + gfx: $(GFX_OBJECTS) +- gcc -o gfx_main -Wall -g $(GFX_OBJECTS) $(LIBS) ++ $(CC) -o gfx_main -Wall -g $(GFX_OBJECTS) $(EXTRA_LDFLAGS) + + .c.o: +- $(CC) -g -Wall $(CFLAGS) $ -c $< ++ $(CC) -g -Wall $(EXTRA_CFLAGS) $ -c $< + + clean: + rm -f *.o; rm -f blobsallad; diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch new file mode 100755 index 000000000..b61da2c1f --- /dev/null +++ b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch @@ -0,0 +1,95 @@ +--- a/bs_main.c ++++ b/bs_main.c +@@ -11,6 +11,9 @@ + #include "bs_profiler.h" + #include "bs_rubberband.h" + ++static struct timeval beginTime; /* Time of the benchmark start */ ++static int cur_step; /* Current benchmark phase. Used to subsequently increase number of objects each 10 seconds */ ++ + typedef struct bs_main_data_st + { + bs_cairo_sdl_t *pCairoSdl; +@@ -113,7 +116,9 @@ + SDL_Event event; + SDL_UserEvent userevent; + bs_main_data_t *pMainData; +- ++ struct timeval curTime; ++ int hunsec; ++ + pMainData = (bs_main_data_t*) pUserData; + + userevent.type = SDL_USEREVENT; +@@ -121,6 +126,20 @@ + userevent.data1 = NULL; + userevent.data2 = NULL; + ++ gettimeofday(&curTime, NULL); ++ hunsec = curTime.tv_sec - beginTime.tv_sec; ++ ++ /* increase cur_step each 10 seconds */ ++ if (cur_step < hunsec / 10) { ++ printf("%d objects = %.2f fps\n", 1 << (cur_step + 1), pMainData->fps); ++ userevent.code = 2; /* add more objects */ ++ cur_step++; ++ } ++ ++ /* exit if requested number of objects is reached */ ++ if (cur_step == 4) ++ userevent.code = 3; ++ + event.type = SDL_USEREVENT; + event.user = userevent; + +@@ -152,14 +171,19 @@ + pMainData->newTimerInterval = 50; + pMainData->fps = 20.0; + pMainData->running = TRUE; +- ++ ++ cur_step = 0; ++ + bs_profiler_init(); + ++ gettimeofday(&beginTime, NULL); + gettimeofday(&startTime, NULL); + pMainData->lastFrameTimeStamp = startTime.tv_sec * 1000 + startTime.tv_usec / 1000; + + SDL_AddTimer(50, bs_main_sdl_timer_callback, pMainData); + ++ bs_blob_collective_split(pMainData->pCollective); ++ + for(;;) + { + SDL_WaitEvent(&event); +@@ -253,8 +277,7 @@ + break; + + case SDL_USEREVENT: +- if(event.user.code == 1) +- { ++ if (event.user.code == 1) { + gettimeofday(&startTime, NULL); + bs_main_update_simulation(pMainData); + bs_main_redraw(pMainData); +@@ -268,10 +291,15 @@ + usedTime = 50; + } + +- pMainData->newTimerInterval = usedTime; +- } +- break; +- ++ pMainData->newTimerInterval = usedTime; ++ } else if (event.user.code == 2) { ++ int i; ++ for (i = 0; i < (1 << cur_step); i++) ++ bs_blob_collective_split(pMainData->pCollective); ++ } else if (event.user.code == 3) { ++ exit(0); ++ } ++ break; + case SDL_QUIT: + exit(0); + break; diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch new file mode 100755 index 000000000..630871dfd --- /dev/null +++ b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch @@ -0,0 +1,11 @@ +--- a/bs_blob_collective.c ++++ b/bs_blob_collective.c +@@ -152,7 +152,7 @@ + + bs_list_unlink_p_cont(pCollective->pBlobs, bs_blob_collective_remove_blob_cb, findData.pMotherBlob); + +- printf("number of blobs: %d\n", bs_list_get_length(pCollective->pBlobs)); ++/* printf("number of blobs: %d\n", bs_list_get_length(pCollective->pBlobs)); */ + } + + typedef struct bs_blob_collective_join_find_smallest_st diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch new file mode 100755 index 000000000..ae15408de --- /dev/null +++ b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch @@ -0,0 +1,15 @@ +--- a/bs_main.c ++++ b/bs_main.c +@@ -165,9 +165,9 @@ + //pMainData->pRubberband = bs_rubberband_create(2.5f, 3.0f); + pMainData->pEnv = bs_env_create(0.0f, 0.0f, 6.0f, 4.0f); + pMainData->pGravity = bs_vector_create(0.0f, 10.0f); +- pMainData->pCairoSdl = bs_cairo_sdl_create(600, 400); +- pMainData->width = 600.0; +- pMainData->height = 400.0; ++ pMainData->pCairoSdl = bs_cairo_sdl_create(1600, 1024); ++ pMainData->width = 1600.0; ++ pMainData->height = 1024.0; + pMainData->newTimerInterval = 50; + pMainData->fps = 20.0; + pMainData->running = TRUE; diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb b/meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb new file mode 100644 index 000000000..c3d744350 --- /dev/null +++ b/meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb @@ -0,0 +1,34 @@ +DESCRIPTION = "" +HOMEPAGE = "http://blobsallad.se/" +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "" + +SRC_URI = " \ + http://blobsallad.se/src/blobsallad-src-${PV}.tar.gz \ + file://0001-Makefile.patch \ + file://0002-auto.patch \ + file://0003-printcleanup.patch \ + file://0004-bs_main.c.patch" + +SRC_URI[md5sum] = "a2e3342cbf0f3a4a9b110af2663bed36" +SRC_URI[sha256sum] = "cd6309df1929d3e6b7bce1dbecc751849aeaafe17c01e05fd2567dc4267faaa2" + +DEPENDS = "cairo virtual/libsdl" + +S = "${WORKDIR}/blobsallad-src" + +do_configure () { + # Specify any needed configure commands here + : +} + +do_compile () { + # You will almost certainly need to add additional arguments here + oe_runmake SDKROOT=${STAGING_DIR_HOST} +} + +do_install () { + install -d ${D}${bindir} + install -m 0755 blobsallad ${D}${bindir} +} + -- 2.16.6 From d22223f322b261dd3d2b81440f1306af8b996b25 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Fri, 1 Apr 2016 14:32:50 +0200 Subject: [PATCH 15/16] Add recipe for ffsb package (JTA QA requirement) Change-Id: I667d3ab23ac09fd2c65b38c72e9d38d3b08c11c2 Signed-off-by: Stephane Desneux --- meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb diff --git a/meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb b/meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb new file mode 100644 index 000000000..66db133e3 --- /dev/null +++ b/meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "Flexible File System Benchmark" +HOMEPAGE = "https://sourceforge.net/projects/ffsb/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fd5d9bcabd8ed5a54a01ce8d183d592a" + +SRC_URI = "http://downloads.sourceforge.net/project/ffsb/ffsb/ffsb-${PV}/ffsb-${PV}.tar.bz2" +SRC_URI[md5sum] = "cabfc1021c2ec6c6b168fefc84210891" +SRC_URI[sha256sum] = "e5867692aae8c9bfbcdc774599022289c4d89c1d90f4dd7101fb9865ac773c71" + +inherit autotools + +# extra args to configure +EXTRA_OECONF = "" + -- 2.16.6 From b4c97bef6094e0965be6b1b61b898d256271190a Mon Sep 17 00:00:00 2001 From: Yannick Gicquel Date: Thu, 31 Mar 2016 16:59:46 +0200 Subject: [PATCH 16/16] Add new recipe for Interbench Change-Id: Ie8f4402a7877714db06858abef0a57869f7ae803 Signed-off-by: Yannick Gicquel --- .../recipes-test/interbench/interbench_0.31.bb | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 meta-ivi-common/recipes-test/interbench/interbench_0.31.bb diff --git a/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb b/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb new file mode 100644 index 000000000..eca0e8545 --- /dev/null +++ b/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb @@ -0,0 +1,27 @@ +DESCRIPTION = "The Linux interactivity benchmark" +HOMEPAGE = "http://users.tpg.com.au/ckolivas/interbench/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" +SRC_URI = "http://ck.kolivas.org/apps/interbench/interbench-${PV}.tar.bz2" + +inherit autotools + +B = "${S}" +EXTRA_OEMAKE = "CC='${CC}'" + +# upstream tarball contains x86_64 binaries, we need a clean source tree +do_compile() { + oe_runmake clean + oe_runmake +} + +do_install() { + install -d ${D}${bindir} ${D}${datadir}/doc/${PN}/ ${D}${mandir}/man8/ + install -m 0755 ${B}/interbench ${D}${bindir} + install -m 0644 ${S}/readme* ${D}${datadir}/doc/${PN}/ + install -m 0644 ${S}/interbench.8 ${D}${mandir}/man8/ +} + +SRC_URI[md5sum] = "832254d7fd1255c548ebea7b97f01015" +SRC_URI[sha256sum] = "89d438b28aef22d26e79812762a57a9f9344a8dd8826edebfe60dad48ee1c784" + -- 2.16.6