summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab/issue_templates/default.md2
-rw-r--r--.gitlab/issue_templates/mytemplate.md3
-rw-r--r--.gitlab/merge_request_templates/default.md2
-rw-r--r--.gitlab/merge_request_templates/mytemplate.md3
-rw-r--r--.gitreview1
-rw-r--r--LICENSE20
-rw-r--r--LICENSE.GPL-2.0-only288
-rw-r--r--LICENSE.MIT25
-rw-r--r--README-AGL.md450
l---------[-rw-r--r--]README.md158
-rwxr-xr-xagl-layers-overview.md24
-rw-r--r--docs/devguides-book.yml15
-rw-r--r--docs/profiles.md146
-rw-r--r--meta-agl-bsp/LICENSE20
-rw-r--r--meta-agl-bsp/LICENSE.GPL-2.0-only288
-rw-r--r--meta-agl-bsp/LICENSE.MIT25
-rw-r--r--meta-agl-bsp/README19
-rw-r--r--meta-agl-bsp/classes/sdcard_image-rpi.bbclass184
-rw-r--r--meta-agl-bsp/conf/include/agl_am62xx-evm.inc8
-rw-r--r--meta-agl-bsp/conf/include/agl_bbe.inc24
-rw-r--r--meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_beaglebone.inc42
-rw-r--r--meta-agl-bsp/conf/include/agl_beagleplay.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_cubox-i.inc15
-rw-r--r--meta-agl-bsp/conf/include/agl_cyclone5.inc4
-rw-r--r--meta-agl-bsp/conf/include/agl_dra7xx-evm.inc49
-rw-r--r--meta-agl-bsp/conf/include/agl_dragonboard-410c.inc2
-rw-r--r--meta-agl-bsp/conf/include/agl_ebisu.inc13
-rw-r--r--meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc9
-rw-r--r--meta-agl-bsp/conf/include/agl_h3-salvator-x.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc25
-rw-r--r--meta-agl-bsp/conf/include/agl_h3ulcb.inc53
-rw-r--r--meta-agl-bsp/conf/include/agl_imx-common.inc8
-rw-r--r--meta-agl-bsp/conf/include/agl_imx6-common.inc14
-rw-r--r--meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc5
-rw-r--r--meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc35
-rw-r--r--meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc8
-rw-r--r--meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc8
-rw-r--r--meta-agl-bsp/conf/include/agl_imx8mq-evk.inc23
-rw-r--r--meta-agl-bsp/conf/include/agl_intel-corei7-64.inc25
-rw-r--r--meta-agl-bsp/conf/include/agl_j721e-evm.inc11
-rw-r--r--meta-agl-bsp/conf/include/agl_joule.inc11
-rw-r--r--meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_m3-salvator-x.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc30
-rw-r--r--meta-agl-bsp/conf/include/agl_m3ulcb.inc56
-rw-r--r--meta-agl-bsp/conf/include/agl_porter-nogfx.inc24
-rw-r--r--meta-agl-bsp/conf/include/agl_porter.inc183
-rw-r--r--meta-agl-bsp/conf/include/agl_qemuarm.inc20
-rw-r--r--meta-agl-bsp/conf/include/agl_qemuarm64.inc20
-rw-r--r--meta-agl-bsp/conf/include/agl_qemuriscv64.inc11
-rw-r--r--meta-agl-bsp/conf/include/agl_qemux86-64.inc41
-rw-r--r--meta-agl-bsp/conf/include/agl_qemux86.inc25
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi2.inc40
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc37
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi3.inc40
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi4.inc37
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi5.inc34
-rw-r--r--meta-agl-bsp/conf/include/agl_rcar-nogfx.inc60
-rw-r--r--meta-agl-bsp/conf/include/agl_rcar.inc61
-rw-r--r--meta-agl-bsp/conf/include/agl_refhw-h3.inc16
-rw-r--r--meta-agl-bsp/conf/include/agl_s4sk.inc9
-rw-r--r--meta-agl-bsp/conf/include/agl_salvator-nogfx.inc17
-rw-r--r--meta-agl-bsp/conf/include/agl_salvator.inc6
-rw-r--r--meta-agl-bsp/conf/include/agl_unmatched.inc4
-rw-r--r--meta-agl-bsp/conf/include/agl_virtio-aarch64.inc14
-rw-r--r--meta-agl-bsp/conf/layer.conf4
-rw-r--r--meta-agl-bsp/conf/machine/include/virtio.inc23
-rw-r--r--meta-agl-bsp/conf/machine/virtio-aarch64.conf36
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw5
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh35
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak32
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf2
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend33
-rw-r--r--meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg4
-rw-r--r--meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg4
-rw-r--r--meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg3
-rw-r--r--meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg5
-rw-r--r--meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend33
-rw-r--r--meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch637
-rw-r--r--meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend4
-rw-r--r--meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend3
-rw-r--r--meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc7
-rw-r--r--meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc3
-rwxr-xr-xmeta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg17
-rwxr-xr-xmeta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend5
-rw-r--r--meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch35
-rw-r--r--meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend8
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service9
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh48
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb30
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend9
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend10
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg6
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg6
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg1
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg13
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg9
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg1
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg2
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg5
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch22
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch22
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg4
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend110
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc22
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch17
-rw-r--r--meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend5
-rw-r--r--meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend4
-rw-r--r--meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend11
-rw-r--r--meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc3
-rw-r--r--meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend20
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb27
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg4
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg1
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg4
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg3
-rw-r--r--meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend30
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend1
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend47
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd45
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend18
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt28
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt28
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch29
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch17
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb13
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc191
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb17
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend4
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb43
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend3
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch154
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch900
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch51
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch52
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch935
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch51
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch52
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch65
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch48
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch43
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch39
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg12
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg1
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg5
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg50
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend121
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend11
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend8
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend2
-rw-r--r--meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend11
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux1
l---------meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES74
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc20
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service10
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch184
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend6
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service10
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch114
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend29
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher4
-rw-r--r--meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend23
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc25
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc16
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md7
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch42
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch252
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch107
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch54
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop10
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch71
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb39
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc56
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc46
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch33
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch26
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb20
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb38
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb68
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc43
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch30
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb11
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb25
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc148
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch57
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch32
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch27
-rwxr-xr-xmeta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch35
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch30
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch64
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch86
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb65
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc50
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch168
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch298
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch225
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch27
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch69
-rwxr-xr-xmeta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch143
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch32
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch44
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch47
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb25
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb27
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc53
-rwxr-xr-xmeta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch62
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch44
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch40
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb15
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc31
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb13
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb41
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc40
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc24
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch27
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb6
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc58
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb14
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb30
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb16
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend6
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state321
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend11
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch26
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt (renamed from meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota.txt)5
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb (renamed from meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/m3ulcb-ota-bootfiles.bb)12
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch29
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb61
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch41
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c1033
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h10
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c1024
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h10
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend28
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff13
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb55
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb57
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch86
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend9
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch37
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb20
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend5
l---------meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc1
l---------meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend3
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb7
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend19
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg11
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg7
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg12
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend7
l---------meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc1
l---------meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend6
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend3
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend3
l---------meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc1
l---------meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend2
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend2
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch935
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch51
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch52
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch158
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg2
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg37
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg4
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts91
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg6
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend32
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend18
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend5
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend11
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend11
l---------meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc1
l---------meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc1
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend4
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff13
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend8
-rw-r--r--meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh94
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch27
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch101
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch650
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch909
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch95
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch1058
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch91
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch1352
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend13
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend5
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend7
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch38
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend44
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch30
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch52
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch33
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg2
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg2
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch17
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg9
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch853
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch110
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch1529
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch88
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch32
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch56
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch25
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch113
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch127
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch69
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch414
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch62
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch238
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch375
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch230
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch168
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch41
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch83
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg10
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg6
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg2
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg4
-rwxr-xr-xmeta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg2
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch155
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend4
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch101
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend4
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch26
-rw-r--r--meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend2
-rw-r--r--meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend3
-rw-r--r--meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg1
-rw-r--r--meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg1
-rw-r--r--meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend6
-rw-r--r--meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch46
-rw-r--r--meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend3
-rw-r--r--meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg19
-rw-r--r--meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend6
-rw-r--r--meta-agl-bsp/meta-ti-bsp/.gitkeep (renamed from meta-agl-bsp/meta-ti/.gitkeep)0
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend3
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend1
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc1
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend2
-rw-r--r--meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend2
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb15
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc23
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf1
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb18
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch404
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch482
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch408
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch89
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch96
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch146
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch1592
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch81
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch1728
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch65
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend49
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb33
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch3570
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch112
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch125
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch37
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch31
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch39
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch36
-rw-r--r--meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend22
-rwxr-xr-xmeta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt1
-rw-r--r--meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend16
-rw-r--r--meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend7
-rw-r--r--meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch13
-rw-r--r--meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend5
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg4
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg6
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg2
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg5
-rw-r--r--meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend33
-rw-r--r--meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend4
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch41
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch86
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch138
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb25
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb13
-rw-r--r--meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend6
-rw-r--r--meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend17
-rw-r--r--meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini28
-rw-r--r--meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend3
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend5
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch206
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch899
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg4
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg3
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg1
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg4
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg3
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend23
-rw-r--r--meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg39
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch28
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb29
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend11
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend18
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch34
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend3
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend10
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc13
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg3
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg3
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend17
-rw-r--r--meta-agl-bsp/wic/directdisk.wks.in9
-rw-r--r--meta-agl-bsp/wic/sdimage-bootpart-uuid.wks6
-rw-r--r--meta-agl-bsp/wic/singlepart-noloader.wks5
-rw-r--r--meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks23
-rw-r--r--meta-agl-core/LICENSE20
-rw-r--r--meta-agl-core/LICENSE.GPL-2.0-only288
-rw-r--r--meta-agl-core/LICENSE.MIT25
l---------meta-agl-core/README1
-rw-r--r--meta-agl-core/README-AGL.md33
-rw-r--r--meta-agl-core/classes/agl-core-image.bbclass32
-rw-r--r--meta-agl-core/classes/agl-crosssdk.bbclass9
-rw-r--r--meta-agl-core/classes/cloc.bbclass33
-rw-r--r--meta-agl-core/classes/image_types_wic_workaround.bbclass32
-rw-r--r--meta-agl-core/classes/sanity-meta-agl-core.bbclass10
-rw-r--r--meta-agl-core/conf/bblayers.conf.sample12
-rw-r--r--meta-agl-core/conf/distro/include/aarch64-tune.inc (renamed from meta-agl-distro/conf/distro/include/aarch64-tune.inc)4
-rw-r--r--meta-agl-core/conf/distro/include/arc-tune.inc3
-rw-r--r--meta-agl-core/conf/distro/include/arm-tune.inc (renamed from meta-agl-distro/conf/distro/include/arm-tune.inc)10
-rw-r--r--meta-agl-core/conf/distro/include/riscv64-tune.inc8
-rw-r--r--meta-agl-core/conf/distro/include/x86_64-tune.inc56
-rw-r--r--meta-agl-core/conf/distro/poky-agl.conf143
-rw-r--r--meta-agl-core/conf/include/agl-create-spdx.inc1
-rw-r--r--meta-agl-core/conf/include/agl-devel.inc16
-rw-r--r--meta-agl-core/conf/include/agl-package-management.inc6
-rw-r--r--meta-agl-core/conf/include/agl-selinux.inc20
-rw-r--r--meta-agl-core/conf/include/base-agl.inc18
-rw-r--r--meta-agl-core/conf/layer.conf28
-rw-r--r--meta-agl-core/conf/local.conf.sample (renamed from templates/base/local.conf.sample)98
-rw-r--r--meta-agl-core/conf/templates/base/bblayers.conf.sample (renamed from templates/base/bblayers.conf.sample)46
-rw-r--r--meta-agl-core/conf/templates/base/conf-notes.txt35
-rw-r--r--meta-agl-core/conf/templates/base/local.conf.sample339
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend1
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc1
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-shell-activator_git.bb22
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc6
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend1
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc1
-rw-r--r--meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend3
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_%.bbappend1
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_aglcore.inc10
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch47
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend1
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc14
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.service12
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.sh12
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/systemd-selinux-relabel_1.0.bb25
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-platform/packagegroups/packagegroup-agl-core-selinux.bb57
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_0.1.bbappend1
-rw-r--r--meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_aglcore.inc4
-rw-r--r--meta-agl-core/files/group (renamed from meta-agl/files/group)24
-rw-r--r--meta-agl-core/files/passwd (renamed from meta-agl/files/passwd)20
-rw-r--r--meta-agl-core/recipes-config/agl-users/agl-users.inc14
-rw-r--r--meta-agl-core/recipes-config/agl-users/agl-users_1.0.bb9
-rw-r--r--meta-agl-core/recipes-connectivity/busybox/busybox_%.bbappend1
-rw-r--r--meta-agl-core/recipes-connectivity/busybox/busybox_aglcore.inc3
-rw-r--r--meta-agl-core/recipes-connectivity/busybox/files/enable-wget-https.cfg (renamed from meta-agl/recipes-connectivity/busybox/files/enable-wget-https.cfg)0
-rw-r--r--meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Do-not-overwrite-CFLAGS.patch37
-rw-r--r--meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Initialize-variables.patch39
-rw-r--r--meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/stdbool-fixes.patch53
-rw-r--r--meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb (renamed from meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb)14
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman-conf.bbappend1
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman-conf/main.conf3
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman-conf_aglcore.inc9
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman/0001-disable-when-booting-over-nfs.patch14
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman_%.bbappend1
-rw-r--r--meta-agl-core/recipes-connectivity/connman/connman_aglcore.inc (renamed from meta-agl/recipes-connectivity/connman/connman_%.bbappend)2
-rw-r--r--meta-agl-core/recipes-core/systemd/.appends.core (renamed from meta-agl/recipes-connectivity/connman/.appends.core)0
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network12
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link11
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network6
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network5
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb32
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend1
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc4
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf (renamed from meta-agl/recipes-core/systemd/systemd/e2fsck.conf)0
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf3
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd/wired.network8
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd_%.bbappend1
-rw-r--r--meta-agl-core/recipes-core/systemd/systemd_aglcore.inc36
-rw-r--r--meta-agl-core/recipes-devtools/gdb/.appends.core (renamed from meta-agl/recipes-core/dbus/.appends.core)0
-rw-r--r--meta-agl-core/recipes-devtools/gdb/gdb_%.bbappend1
-rw-r--r--meta-agl-core/recipes-devtools/gdb/gdb_aglcore.inc1
-rw-r--r--meta-agl-core/recipes-devtools/qemu/qemu_%.bbappend1
-rw-r--r--meta-agl-core/recipes-devtools/qemu/qemu_aglcore.inc5
-rw-r--r--meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend1
-rw-r--r--meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc3
-rw-r--r--meta-agl-core/recipes-graphics/rba/librba_1.0.bb24
-rw-r--r--meta-agl-core/recipes-graphics/rba/rba-config.bb15
-rw-r--r--meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json320
-rw-r--r--meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf43
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb61
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin11
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in3
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service72
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket10
-rw-r--r--meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb57
-rw-r--r--meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb16
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb156
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend12
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg4
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg3
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg4
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg5
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg6
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg.in5
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg3
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg3
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg4
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg4
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg4
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-init.bbappend1
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc8
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch30
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch60
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend1
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc29
-rw-r--r--meta-agl-core/recipes-kernel/linux/kernel-devsrc.bbappend1
-rw-r--r--meta-agl-core/recipes-kernel/linux/kernel-devsrc_agl.inc6
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-4.14/net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch25
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-agl-4.14.inc6
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-agl-4.19.inc5
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-agl-config.inc94
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-agl.inc24
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-yocto-agl.inc12
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux-yocto_%.bbappend1
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/audit.cfg2
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/can-bus.cfg10
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/fanotify.cfg (renamed from meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg)0
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/lttng.cfg1
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/nbd.cfg3
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch75
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/overlayfs.cfg7
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/qemu-drm.cfg (renamed from meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg)0
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/qemu-virtio.cfg6
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/qemuarm.cfg8
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/ramdisk.cfg2
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/selinux.cfg14
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/sound-hda.cfg20
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/sound.cfg7
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/systemd-required.cfg42
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/systemd-sandbox.cfg9
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/systemtap.cfg9
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/vbox-vmware-sata.cfg (renamed from meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg)4
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg (renamed from meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg)19
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/x86-net-devices.cfg3
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/x86-security-tpm.cfg (renamed from meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg)0
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/x86-upsquare.cfg11
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/x86-usb-devices.cfg (renamed from meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg)4
-rw-r--r--meta-agl-core/recipes-kernel/linux/linux/xen_domu.cfg25
-rw-r--r--meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/files/0001-Added-appid-and-title-support.patch169
-rw-r--r--meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_%.bbappend1
-rw-r--r--meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_aglcore.inc9
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-boot.bb5
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-compositor.bb15
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-core-autobuilder.bb15
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-minimal-crosssdk.bb9
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-minimal.bb9
-rw-r--r--meta-agl-core/recipes-platform/images/agl-image-weston.bb15
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb26
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb19
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-devel.bb (renamed from meta-agl/recipes-devtools/packagegroups/packagegroup-agl-devel.bb)17
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-compositor.bb9
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb9
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-minimal.bb18
-rw-r--r--meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-profile-graphical.bb17
-rw-r--r--meta-agl-core/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch152
-rw-r--r--meta-agl-core/recipes-support/ptest-runner/ptest-runner_2.%.bbappend2
-rw-r--r--meta-agl-core/recipes-support/ptest-runner/ptest-runner_agl.inc3
-rwxr-xr-xmeta-agl-core/scripts/oe-depends-dot121
-rwxr-xr-xmeta-agl-core/scripts/run-yocto-check-layer.sh40
-rw-r--r--meta-agl-distro/conf/distro/include/x86_64-tune.inc56
-rw-r--r--meta-agl-distro/conf/distro/poky-agl.conf128
-rw-r--r--meta-agl-distro/conf/layer.conf10
-rw-r--r--meta-agl-ic/.empty (renamed from meta-agl/classes/.gitkeep)0
-rw-r--r--meta-agl-ivi/.empty (renamed from meta-agl/recipes-automotive/.gitkeep)0
-rwxr-xr-xmeta-agl.md99
-rw-r--r--meta-agl/classes/agl-graphical.bbclass7
-rw-r--r--meta-agl/conf/include/agl-devel.inc13
-rw-r--r--meta-agl/conf/include/base-agl.inc19
-rw-r--r--meta-agl/conf/layer.conf10
-rw-r--r--meta-agl/recipes-bsp/.gitkeep0
-rw-r--r--meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb47
-rw-r--r--meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd3
-rw-r--r--meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service18
-rw-r--r--meta-agl/recipes-config/agl-login-manager/files/user-config.path8
-rw-r--r--meta-agl/recipes-config/agl-login-manager/files/user-config.service8
-rw-r--r--meta-agl/recipes-connectivity/bluez5/.replaces.core0
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5.inc121
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch63
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf39
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/init68
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/out-of-tree.patch26
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/run-ptest31
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5_5.43.bb55
-rw-r--r--meta-agl/recipes-connectivity/busybox/busybox_%.bbappend2
-rw-r--r--meta-agl/recipes-connectivity/connman/files/0001-disable-when-booting-over-nfs.patch10
-rw-r--r--meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr/0001-remove-I-usr-include-in-pkg-config.patch40
-rw-r--r--meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb26
-rw-r--r--meta-agl/recipes-connectivity/rygel/.appends.meta-multimedia0
-rw-r--r--meta-agl/recipes-connectivity/rygel/files/0001-Add-LightMediaScanner-plugin.patch2541
-rw-r--r--meta-agl/recipes-connectivity/rygel/files/0001-Fix-missing-link-to-unistring-for-lms-plugin.patch28
-rw-r--r--meta-agl/recipes-connectivity/rygel/files/0002-lms-add-C-source-files.patch9455
-rw-r--r--meta-agl/recipes-connectivity/rygel/files/rygel.service13
-rw-r--r--meta-agl/recipes-connectivity/rygel/rygel_%.bbappend32
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus.service10
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus.socket9
-rw-r--r--meta-agl/recipes-core/dbus/dbus/dbus_env.conf5
-rw-r--r--meta-agl/recipes-core/dbus/dbus_%.bbappend28
-rw-r--r--meta-agl/recipes-core/glibc/.appends.core0
-rw-r--r--meta-agl/recipes-core/glibc/glibc/arm/local-arm-futex.diff23
-rw-r--r--meta-agl/recipes-core/glibc/glibc_2.2%.bbappend3
-rw-r--r--meta-agl/recipes-core/images/agl-image-minimal-qa.bb12
-rw-r--r--meta-agl/recipes-core/images/agl-image-minimal.bb9
-rw-r--r--meta-agl/recipes-core/images/agl-image-minimal.inc10
-rw-r--r--meta-agl/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend2
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-automotive.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-connectivity.bb15
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-graphics.bb10
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-kernel.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-navi-lbs.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-os-commonlibs.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-security.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-core-speech-services.bb13
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-agl-image-minimal.bb27
-rw-r--r--meta-agl/recipes-core/packagegroups/packagegroup-core-boot-agl.bb49
-rw-r--r--meta-agl/recipes-core/psplash/.appends.core0
-rw-r--r--meta-agl/recipes-core/psplash/files/psplash-colors.h34
-rw-r--r--meta-agl/recipes-core/psplash/files/psplash-poky-img.h5411
-rw-r--r--meta-agl/recipes-core/psplash/files/psplash-quit.service11
-rw-r--r--meta-agl/recipes-core/psplash/files/psplash-start.service12
-rw-r--r--meta-agl/recipes-core/psplash/psplash_git.bbappend25
-rw-r--r--meta-agl/recipes-core/systemd/.appends.core0
-rw-r--r--meta-agl/recipes-core/systemd/systemd/wired.network5
-rw-r--r--meta-agl/recipes-core/systemd/systemd_%.bbappend22
-rw-r--r--meta-agl/recipes-core/xmlsec1/xmlsec1_1.2.20.bb40
-rw-r--r--meta-agl/recipes-devtools/python/python-pycrypto/cross-compiling.patch23
-rw-r--r--meta-agl/recipes-devtools/python/python-pycrypto_2.6.1.bb23
-rwxr-xr-xmeta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts41
-rw-r--r--meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service16
-rw-r--r--meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb47
-rw-r--r--meta-agl/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service12
-rw-r--r--meta-agl/recipes-devtools/tcf-agent/tcf-agent_git.bbappend3
-rw-r--r--meta-agl/recipes-extended/ltp/.appends.core0
-rw-r--r--meta-agl/recipes-extended/ltp/ltp_%.bbappend3
-rw-r--r--meta-agl/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb21
-rw-r--r--meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.path8
-rw-r--r--meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.service12
-rw-r--r--meta-agl/recipes-graphics/images/agl-image-weston.bb12
-rw-r--r--meta-agl/recipes-graphics/images/agl-image-weston.inc7
-rw-r--r--meta-agl/recipes-graphics/packagegroups/packagegroup-agl-image-weston.bb17
-rw-r--r--meta-agl/recipes-graphics/wayland/Readme.weston-ini-conf36
-rw-r--r--meta-agl/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch29
-rw-r--r--meta-agl/recipes-graphics/wayland/wayland_%.bbappend5
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf.bb58
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc4
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc2
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc4
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc2
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_qemu.inc16
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-init.bbappend71
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-init/weston.service.add7
-rw-r--r--meta-agl/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf6
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston.patch46
-rw-r--r--meta-agl/recipes-graphics/wayland/weston/0001-compositor-drm.c-Launch-without-input-devices.patch28
-rw-r--r--meta-agl/recipes-graphics/wayland/weston_%.bbappend8
-rw-r--r--meta-agl/recipes-ivi/images/agl-image-ivi-crosssdk.bb19
-rw-r--r--meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb14
-rw-r--r--meta-agl/recipes-ivi/images/agl-image-ivi.bb17
-rw-r--r--meta-agl/recipes-ivi/images/agl-image-ivi.inc3
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-image-ivi.bb32
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-automotive.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-connectivity.bb19
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-graphics.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-kernel.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-multimedia.bb17
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-navi-lbs.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-os-commonlibs.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-security.bb14
-rw-r--r--meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-speech-services.bb14
-rw-r--r--meta-agl/recipes-multimedia/faac/faac_%.bbappend4
-rw-r--r--meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch26
-rw-r--r--meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch28
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/.appends.meta-efl0
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/dbus-lightmediascanner.conf7
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service11
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/files/plugin-ogg-fix-chucksize-issue.patch53
-rw-r--r--meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend33
-rw-r--r--meta-agl/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb28
-rw-r--r--meta-agl/recipes-navi-lbs/.gitkeep0
-rw-r--r--meta-agl/recipes-support/.gitkeep0
-rw-r--r--meta-agl/recipes-support/gpm/.appends.meta-oe0
-rw-r--r--meta-agl/recipes-support/gpm/gpm_1.99.7.bbappend7
-rw-r--r--meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb15
l---------meta-app-framework/README1
-rw-r--r--meta-app-framework/README-AGL.md31
-rw-r--r--meta-app-framework/classes/agl-app.bbclass83
-rw-r--r--meta-app-framework/classes/aglwgt.bbclass61
-rw-r--r--meta-app-framework/conf/include/agl-app-framework.inc2
-rw-r--r--meta-app-framework/conf/include/agl-appfw-smack.inc16
-rw-r--r--meta-app-framework/conf/layer.conf8
-rw-r--r--meta-app-framework/recipes-config/agl-users/agl-users_0.1.bb20
-rw-r--r--meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules7
-rw-r--r--meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb21
-rw-r--r--meta-app-framework/recipes-core/af-binder/af-binder_1.0.bb84
-rw-r--r--meta-app-framework/recipes-core/af-main/af-main/Hack-to-allow-the-debugging.patch29
-rwxr-xr-xmeta-app-framework/recipes-core/af-main/af-main/afm-install45
-rw-r--r--meta-app-framework/recipes-core/af-main/af-main_1.0.bb121
-rw-r--r--meta-app-framework/recipes-core/af-main/af-main_1.0.inc26
-rw-r--r--meta-app-framework/recipes-core/af-main/nativesdk-af-main_1.0.bb26
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service12
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service11
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app@.service8
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service13
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/no-network.conf2
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd/private-tmp.conf2
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb78
-rw-r--r--meta-app-framework/recipes-core/base-files/base-files_%.bbappend29
-rw-r--r--meta-app-framework/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend2
-rw-r--r--meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework-examples.bb16
-rw-r--r--meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework.bb20
-rw-r--r--meta-app-framework/recipes-core/packagegroups/packagegroup-agl-core-security.bbappend9
-rw-r--r--meta-app-framework/recipes-core/packagegroups/packagegroup-agl-image-minimal.bbappend3
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/0001-Adapt-rules-to-AGL.patch50
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-Cmake-conf-for-gcc6-build.patch40
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-gcc6-build.patch38
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/Removing-tizen-platform-config.patch196
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.service15
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.sh6
-rw-r--r--meta-app-framework/recipes-core/security-manager/security-manager_%.bbappend22
-rwxr-xr-xmeta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime2
-rw-r--r--meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime-webkit.qml13
-rw-r--r--meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime.qml13
-rw-r--r--meta-app-framework/recipes-core/web-runtime/web-runtime_0.1.bb43
-rw-r--r--meta-app-framework/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend1
-rw-r--r--meta-app-framework/recipes-example/afb-client/afb-client_1.0.bb29
-rw-r--r--meta-app-framework/recipes-example/afb-client/files/afb-client7
-rw-r--r--meta-app-framework/recipes-example/afm-client/afm-client_1.0.bb40
-rw-r--r--meta-app-framework/recipes-example/afm-client/files/afm-client7
-rw-r--r--meta-app-framework/recipes-example/afm-client/files/afm-client.service11
-rw-r--r--meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home-native.patch45
-rw-r--r--meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch45
-rw-r--r--meta-app-framework/recipes-extended/shadow/shadow_%.bbappend4
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux-%.bbappend3
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux-yocto_4.1.bbappend12
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux-yocto_4.4.bbappend11
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/audit.cfg2
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0001-Smack-File-receive-for-sockets.patch62
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0002-smack-fix-cache-of-access-labels.patch43
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0003-Smack-ignore-null-signal-in-smack_task_kill.patch39
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0001-Smack-File-receive-for-sockets.patch65
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0002-smack-fix-cache-of-access-labels.patch43
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0003-Smack-ignore-null-signal-in-smack_task_kill.patch39
-rw-r--r--meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch49
-rw-r--r--meta-app-framework/recipes-support/libcap/libcap/removing-capability-enforcement.patch87
-rw-r--r--meta-app-framework/recipes-support/libcap/libcap_%.bbappend5
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.55.bb25
-rw-r--r--meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb32
-rw-r--r--meta-app-framework/recipes-support/xmlsec1/xmlsec1/Only-require-libxslt-in-.pc-files-when-necessary.patch115
-rw-r--r--meta-app-framework/recipes-support/xmlsec1/xmlsec1_1.%.bbappend6
-rwxr-xr-xmeta-app-framework/scripts/run-yocto-check-layer.sh43
-rw-r--r--meta-ivi-common/classes/.gitkeep0
-rw-r--r--meta-ivi-common/conf/layer.conf10
-rw-r--r--meta-ivi-common/recipes-connectivity/.gitkeep0
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-automotive.bb14
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-connectivity.bb15
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-graphics.bb17
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-kernel.bb15
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb29
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-navi-lbs.bb15
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-os-commonlibs.bb16
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-security.bb15
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-speech-services.bb15
-rw-r--r--meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core.bb23
-rw-r--r--meta-ivi-common/recipes-devtools/.gitkeep0
-rw-r--r--meta-ivi-common/recipes-extended/.gitkeep0
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch30
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch81
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0003-systemd-unit-type-should-be-in-lowercase-so-use-Type.patch98
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch24
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.11.1.bb53
-rw-r--r--meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.15.0.bb51
-rw-r--r--meta-ivi-common/recipes-graphics/.gitkeep0
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Fix-ivi-application-lib-install.patch30
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch13
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb22
-rwxr-xr-xmeta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend12
-rw-r--r--meta-ivi-common/recipes-graphics/wayland/weston_%.bbappend1
-rw-r--r--meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/0001-Fix-duplicated-command-line-arg-t.patch25
-rw-r--r--meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/audiomanager.service17
-rw-r--r--meta-ivi-common/recipes-multimedia/audiomanager/audiomanager_7.4.bb56
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0001-install-files-for-a-module-development.patch78
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0002-volume-ramp-additions-to-the-low-level-infra.patch566
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch189
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch62
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch299
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch63
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/enable-ofono-hfp-backend.patch11
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0008-install-files-for-a-module-development.patch53
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0010-volume-ramp-additions-to-the-low-level-infra.patch503
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0011-volume-ramp-adding-volume-ramping-to-sink-input.patch159
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0012-volume-ramp-add-volume-ramping-to-sink.patch159
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0013-add-internal-corking-state-for-sink-input.patch72
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0020-core-util-Add-pa_join.patch37
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0021-dynarray-Add-pa_dynarray_get_raw_array.patch21
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0022-device-port-Add-pa_device_port.active.patch198
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0030-volume-api-Add-libvolume-api.patch6118
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0031-Add-module-main-volume-policy.patch1418
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0039-main-volume-policy-adapt-to-pa6rev.patch11
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend28
-rw-r--r--meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_9.0.bbappend15
-rw-r--r--meta-ivi-common/recipes-support/.gitkeep0
-rw-r--r--meta-ivi-common/recipes-test/aiostress/aiostress_0.22.bb24
-rwxr-xr-xmeta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch53
-rwxr-xr-xmeta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch95
-rwxr-xr-xmeta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch11
-rwxr-xr-xmeta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch15
-rw-r--r--meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb36
-rw-r--r--meta-ivi-common/recipes-test/dung/dung_3.4.25-m2.bb18
-rw-r--r--meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb20
-rw-r--r--meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb14
-rw-r--r--meta-ivi-common/recipes-test/fontconfig/fontconfig_%.bbappend17
-rw-r--r--meta-ivi-common/recipes-test/freetype/files/0001-Makefile-dont-build-gfx-demos.patch32
-rw-r--r--meta-ivi-common/recipes-test/freetype/files/0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch30
-rw-r--r--meta-ivi-common/recipes-test/freetype/freetype_%.bbappend32
-rw-r--r--meta-ivi-common/recipes-test/fsfuzzer/files/0001-fix_missing_header_sys_stat.patch11
-rw-r--r--meta-ivi-common/recipes-test/fsfuzzer/fsfuzzer_0.7.bb18
-rw-r--r--meta-ivi-common/recipes-test/glmark2/glmark2_%.bbappend2
-rw-r--r--meta-ivi-common/recipes-test/himeno/himeno_2.0.bb27
-rwxr-xr-xmeta-ivi-common/recipes-test/interbench/files/interbench.c.patch68
-rw-r--r--meta-ivi-common/recipes-test/interbench/interbench_0.31.bb31
-rw-r--r--meta-ivi-common/recipes-test/ipv6connect/ipv6connect.bb24
-rw-r--r--meta-ivi-common/recipes-test/linpack/linpack.bb21
-rw-r--r--meta-ivi-common/recipes-test/linus-stress/linus-stress.bb23
-rw-r--r--meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb53
-rw-r--r--meta-ivi-common/recipes-test/trinity/trinity_git.bb42
-rw-r--r--meta-ivi-common/recipes-test/wayland/wayland-fits_%.bbappend5
-rw-r--r--meta-ivi-common/recipes-test/wayland/wayland-fits_git.bbappend2
-rw-r--r--meta-netboot/LICENSE20
-rw-r--r--meta-netboot/LICENSE.GPL-2.0-only288
-rw-r--r--meta-netboot/LICENSE.MIT25
-rw-r--r--meta-netboot/README53
-rw-r--r--meta-netboot/README.renesas-gen370
-rw-r--r--meta-netboot/README.renesas-porter41
-rw-r--r--meta-netboot/classes/netboot.bbclass40
-rw-r--r--meta-netboot/conf/include/agl-netboot.inc7
-rw-r--r--meta-netboot/conf/layer.conf8
-rw-r--r--meta-netboot/recipes-core/busybox/busybox_%.bbappend7
-rw-r--r--meta-netboot/recipes-core/busybox/busybox_netboot.inc6
-rw-r--r--meta-netboot/recipes-core/images/initramfs-netboot-image.bb20
-rw-r--r--meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc23
-rw-r--r--meta-netboot/recipes-core/initramfs-netboot/files/init.sh81
-rw-r--r--meta-netboot/recipes-core/initramfs-netboot/initramfs-netboot_1.0.bb12
-rw-r--r--meta-netboot/recipes-core/systemd/files/resolv-conf-relabel.service14
-rw-r--r--meta-netboot/recipes-core/systemd/resolv-conf-relabel.bb21
-rw-r--r--meta-netboot/recipes-kernel/linux/files/nbd.cfg1
-rw-r--r--meta-netboot/recipes-kernel/linux/files/ramdisk.cfg1
-rw-r--r--meta-netboot/recipes-kernel/linux/linux-yocto_%.bbappend6
-rw-r--r--meta-netboot/recipes-support/nbd/nbd_%.bbappend1
-rw-r--r--meta-netboot/recipes-support/nbd/nbd_netboot.inc5
-rwxr-xr-xmeta-netboot/scripts/run-yocto-check-layer.sh44
-rw-r--r--meta-pipewire/README16
-rw-r--r--meta-pipewire/conf/include/agl-pipewire.inc1
-rw-r--r--meta-pipewire/conf/layer.conf16
-rw-r--r--meta-pipewire/licenses/GPL-2.0-only132
-rw-r--r--meta-pipewire/licenses/LGPL-2.1-or-later468
-rw-r--r--meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire-base.bb17
-rw-r--r--meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb24
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch35
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb329
-rw-r--r--meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend25
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/00-functions.lua27
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/alsa-suspend.lua45
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.conf74
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua110
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-alsa-monitor.lua151
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-v4l2-monitor.lua48
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua26
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/90-enable-all.lua20
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber-bluetooth.conf13
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber.conf115
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl_git.bb61
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/00-functions.lua27
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.conf73
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.lua.d/10-default-policy.lua137
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bb41
-rw-r--r--meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb85
-rwxr-xr-xmeta-pipewire/scripts/run-yocto-check-layer.sh42
-rwxr-xr-xscripts/.aglsetup_genconfig.bash183
-rw-r--r--scripts/README-mkefi-agl.md16
-rw-r--r--scripts/aglsetup.sh8
-rwxr-xr-xscripts/ci-yocto-check-layer.sh22
-rwxr-xr-xscripts/distro-manifest-generator.sh310
-rw-r--r--scripts/envsetup.sh2
-rwxr-xr-xscripts/mkefi-agl.sh417
-rw-r--r--templates/base/00_local.conf.agl.inc2
-rw-r--r--templates/base/01_setup_pkg_revision.sh68
-rw-r--r--templates/base/99_local.conf.inc33
-rw-r--r--templates/base/conf-notes.txt17
-rw-r--r--templates/feature/agl-all-features/README_feature_agl-all-features.md16
-rw-r--r--templates/feature/agl-all-features/included.dep2
-rw-r--r--templates/feature/agl-app-framework/50_bblayers.conf.inc4
-rw-r--r--templates/feature/agl-app-framework/50_local.conf.inc2
-rw-r--r--templates/feature/agl-appfw-smack/50_bblayers.conf.inc6
-rw-r--r--templates/feature/agl-appfw-smack/50_local.conf.inc2
-rw-r--r--templates/feature/agl-archiver/50_local.conf.inc2
-rw-r--r--templates/feature/agl-archiver/README_feature_agl-archiver.md9
-rw-r--r--templates/feature/agl-buildstats/50_local.conf.inc2
-rw-r--r--templates/feature/agl-buildstats/README_feature_agl-buildstats.md9
-rw-r--r--templates/feature/agl-ci-change-features-nogfx/README_feature_agl-ci-change-features-nogfx.md19
-rw-r--r--templates/feature/agl-ci-change-features-nogfx/included.dep2
-rw-r--r--templates/feature/agl-ci-change-features/README_feature_agl-ci-change-features.md20
-rw-r--r--templates/feature/agl-ci-change-features/included.dep2
-rw-r--r--templates/feature/agl-ci-snapshot-features-nogfx/README_feature_agl-ci-snapshot-features-nogfx.md20
-rw-r--r--templates/feature/agl-ci-snapshot-features-nogfx/included.dep2
-rw-r--r--templates/feature/agl-ci-snapshot-features/README_feature_agl-ci-snapshot-features.md21
-rw-r--r--templates/feature/agl-ci-snapshot-features/included.dep2
-rw-r--r--templates/feature/agl-ci/99_local.conf.inc32
-rw-r--r--templates/feature/agl-ci/README_feature_agl-ci.md9
-rw-r--r--templates/feature/agl-ci/included.dep1
-rw-r--r--templates/feature/agl-create-spdx/50_local.conf.inc2
-rw-r--r--templates/feature/agl-create-spdx/README_feature_agl-create-spdx.md7
-rw-r--r--templates/feature/agl-devel/README_feature_agl-devel.md42
-rw-r--r--templates/feature/agl-devel/agl-devel.md40
-rw-r--r--templates/feature/agl-devel/included.dep1
-rw-r--r--templates/feature/agl-fossdriver/50_bblayers.conf.inc1
-rw-r--r--templates/feature/agl-fossdriver/50_local.conf.inc1
-rw-r--r--templates/feature/agl-fossdriver/README_feature_agl-fossdriver.md13
-rw-r--r--templates/feature/agl-isafw/50_bblayers.conf.inc1
-rw-r--r--templates/feature/agl-isafw/50_local.conf.inc1
-rw-r--r--templates/feature/agl-localdev/80_bblayers.conf.inc3
-rw-r--r--templates/feature/agl-localdev/80_local.conf.inc2
-rw-r--r--templates/feature/agl-localdev/README_feature_agl-localdev.md9
-rw-r--r--templates/feature/agl-netboot/50_bblayers.conf.inc8
-rw-r--r--templates/feature/agl-netboot/README_feature_agl-netboot.md9
-rw-r--r--templates/feature/agl-package-management/50_local.conf.inc2
-rw-r--r--templates/feature/agl-package-management/README_feature_agl-package-management.md8
-rw-r--r--templates/feature/agl-pipewire/50_bblayers.conf.inc7
-rw-r--r--templates/feature/agl-pipewire/50_local.conf.inc2
-rw-r--r--templates/feature/agl-pipewire/README_feature_agl-pipewire.md9
-rw-r--r--templates/feature/agl-ptest/90_local.conf.inc9
-rw-r--r--templates/feature/agl-ptest/README_feature_agl-ptest.md9
-rw-r--r--templates/feature/agl-refhw-h3/50_bblayers.conf.inc3
-rw-r--r--templates/feature/agl-refhw-h3/50_local.conf.inc2
-rw-r--r--templates/feature/agl-refhw-h3/README_feature_agl-refhw-h3.md8
-rw-r--r--templates/feature/agl-selinux/50_bblayers.conf.inc5
-rw-r--r--templates/feature/agl-selinux/50_local.conf.inc2
-rw-r--r--templates/feature/agl-selinux/README_feature_agl-selinux.md9
-rw-r--r--templates/feature/agl-sota/50_bblayers.conf.inc8
-rw-r--r--templates/feature/agl-sota/50_local.conf.inc2
-rw-r--r--templates/feature/agl-virt-guest-xen/50_local.conf.inc3
-rw-r--r--templates/feature/agl-virt-xen/50_local.conf.inc3
-rw-r--r--templates/feature/agl-virt-xen/included.dep1
-rw-r--r--templates/feature/agl-virt/50_bblayers.conf.inc5
-rw-r--r--templates/feature/agl-virt/50_local.conf.inc3
-rw-r--r--templates/feature/agl-weston-remoting/50_local.conf.inc1
-rw-r--r--templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md9
-rw-r--r--templates/feature/agl-weston-remoting/included.dep1
-rw-r--r--templates/machine/am62xx-evm/50_bblayers.conf.inc5
-rw-r--r--templates/machine/am62xx-evm/50_local.conf.inc3
-rw-r--r--templates/machine/aws-ec2-arm64/50_bblayers.conf.inc8
-rw-r--r--templates/machine/aws-ec2-arm64/50_local.conf.inc21
-rw-r--r--templates/machine/aws-ec2-x86-64/50_bblayers.conf.inc8
-rw-r--r--templates/machine/aws-ec2-x86-64/50_local.conf.inc21
-rw-r--r--templates/machine/bbe/50_bblayers.conf.inc7
-rw-r--r--templates/machine/bbe/50_local.conf.inc2
-rw-r--r--templates/machine/bbe/README_machine_bbe.md12
-rw-r--r--templates/machine/beaglebone-ai64/50_bblayers.conf.inc5
-rw-r--r--templates/machine/beaglebone-ai64/50_local.conf.inc3
-rw-r--r--templates/machine/beaglebone-ai64/README_machine_beaglebone-ai64.md9
-rw-r--r--templates/machine/beaglebone/50_bblayers.conf.inc6
-rw-r--r--templates/machine/beaglebone/README_machine_beaglebone.md9
-rw-r--r--templates/machine/beagleplay/50_bblayers.conf.inc5
-rw-r--r--templates/machine/beagleplay/50_local.conf.inc3
-rw-r--r--templates/machine/beagleplay/README_machine_beagleplay.md9
-rw-r--r--templates/machine/cubox-i/40_bblayers.conf.inc (renamed from templates/machine/imx6qsabreauto/40_bblayers.conf.inc)5
-rw-r--r--templates/machine/cubox-i/50_local.conf.inc4
-rw-r--r--templates/machine/cubox-i/50_setup.sh2
-rw-r--r--templates/machine/cubox-i/README_machine_cubox-i.md9
-rw-r--r--templates/machine/cyclone5/50_bblayers.conf.inc1
-rw-r--r--templates/machine/cyclone5/50_local.conf.inc3
-rw-r--r--templates/machine/dra7xx-evm/50_bblayers.conf.inc1
-rw-r--r--templates/machine/dra7xx-evm/50_local.conf.inc3
-rw-r--r--templates/machine/dra7xx-evm/test/hwtest.enable1
-rw-r--r--templates/machine/dra7xx-evm/test/hwtest.short.enable1
-rw-r--r--templates/machine/dra7xx-evm/test/hwtest.short.environment11
-rw-r--r--templates/machine/dra7xx-evm/test/testjob_short.yaml51
-rw-r--r--templates/machine/dragonboard-410c/50_bblayers.conf.inc1
-rw-r--r--templates/machine/dragonboard-410c/50_local.conf.inc3
-rw-r--r--templates/machine/dragonboard-410c/50_setup.sh1
-rw-r--r--templates/machine/ebisu/50_bblayers.conf.inc4
-rw-r--r--templates/machine/ebisu/50_local.conf.inc3
-rw-r--r--templates/machine/ebisu/50_setup.sh45
-rw-r--r--templates/machine/ebisu/README_machine_ebisu.md44
-rw-r--r--templates/machine/generic-arm64/50_bblayers.conf.inc4
-rw-r--r--templates/machine/generic-arm64/50_local.conf.inc2
-rw-r--r--templates/machine/generic-arm64/README_machine_generic-arm64.md10
-rw-r--r--templates/machine/h3-salvator-x/50_bblayers.conf.inc4
-rw-r--r--templates/machine/h3-salvator-x/50_local.conf.inc4
-rw-r--r--templates/machine/h3-salvator-x/50_setup.sh10
-rw-r--r--templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md11
-rw-r--r--templates/machine/h3ulcb-kf/50_bblayers.conf.inc5
-rw-r--r--templates/machine/h3ulcb-kf/50_local.conf.inc7
-rw-r--r--templates/machine/h3ulcb-kf/50_setup.sh10
-rw-r--r--templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md12
-rw-r--r--templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc4
-rw-r--r--templates/machine/h3ulcb-nogfx/50_local.conf.inc3
-rw-r--r--templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md11
-rw-r--r--templates/machine/h3ulcb/50_bblayers.conf.inc3
-rw-r--r--templates/machine/h3ulcb/README_machine_h3ulcb.md11
-rw-r--r--templates/machine/imx6qdlsabreauto/40_bblayers.conf.inc5
-rw-r--r--templates/machine/imx6qdlsabreauto/50_local.conf.inc4
-rw-r--r--templates/machine/imx6qdlsabreauto/50_setup.sh2
-rw-r--r--templates/machine/imx6qdlsabreauto/README_machine_imx6qdlsabreauto.md9
-rw-r--r--templates/machine/imx6qsabreauto/50_local.conf.inc4
-rw-r--r--templates/machine/imx6qsabreauto/50_setup.sh2
-rw-r--r--templates/machine/imx6qsabrelite/50_bblayers.conf.inc4
-rw-r--r--templates/machine/imx6qsabrelite/50_local.conf.inc2
-rw-r--r--templates/machine/imx6qsabrelite/50_setup.sh2
-rw-r--r--templates/machine/imx8mq-evk-viv/40_bblayers.conf.inc5
-rw-r--r--templates/machine/imx8mq-evk-viv/50_local.conf.inc3
-rw-r--r--templates/machine/imx8mq-evk-viv/50_setup.sh2
-rw-r--r--templates/machine/imx8mq-evk-viv/README_machine_imx8mq-evk-viv.md9
-rw-r--r--templates/machine/imx8mq-evk/40_bblayers.conf.inc5
-rw-r--r--templates/machine/imx8mq-evk/50_local.conf.inc3
-rw-r--r--templates/machine/imx8mq-evk/50_setup.sh2
-rw-r--r--templates/machine/imx8mq-evk/README_machine_imx8mq-evk.md13
l---------templates/machine/intel-corei7-641
-rw-r--r--templates/machine/intel-corei7-64/50_bblayers.conf.inc1
-rw-r--r--templates/machine/intel-corei7-64/50_local.conf.inc3
-rw-r--r--templates/machine/j721e-evm/50_bblayers.conf.inc5
-rw-r--r--templates/machine/j721e-evm/50_local.conf.inc3
-rw-r--r--templates/machine/j721e-evm/README_machine_j721e-evm.md9
-rw-r--r--templates/machine/joule/50_bblayers.conf.inc1
-rw-r--r--templates/machine/joule/50_local.conf.inc3
-rw-r--r--templates/machine/m3-salvator-x/50_bblayers.conf.inc4
-rw-r--r--templates/machine/m3-salvator-x/50_local.conf.inc4
-rw-r--r--templates/machine/m3-salvator-x/50_setup.sh10
-rw-r--r--templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md11
-rw-r--r--templates/machine/m3ulcb-kf/50_bblayers.conf.inc5
-rw-r--r--templates/machine/m3ulcb-kf/50_local.conf.inc6
-rw-r--r--templates/machine/m3ulcb-kf/50_setup.sh10
-rw-r--r--templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md12
-rw-r--r--templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc3
-rw-r--r--templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md11
-rw-r--r--templates/machine/m3ulcb-nogfx/test/hwtest.short.environment9
-rw-r--r--templates/machine/m3ulcb-nogfx/test/testjob_short.yaml48
-rw-r--r--templates/machine/m3ulcb/50_bblayers.conf.inc3
-rw-r--r--templates/machine/m3ulcb/README_machine_m3ulcb.md11
-rw-r--r--templates/machine/nitrogen6x/50_bblayers.conf.inc5
-rw-r--r--templates/machine/nitrogen6x/50_local.conf.inc2
-rw-r--r--templates/machine/nitrogen6x/50_setup.sh2
-rw-r--r--templates/machine/porter-nogfx/50_bblayers.conf.inc5
-rw-r--r--templates/machine/porter-nogfx/50_local.conf.inc3
-rw-r--r--templates/machine/porter-nogfx/test/hwtest.enable1
-rw-r--r--templates/machine/porter-nogfx/test/hwtest.short.enable1
-rw-r--r--templates/machine/porter-nogfx/test/hwtest.short.environment11
-rw-r--r--templates/machine/porter-nogfx/test/testjob_short.yaml49
-rw-r--r--templates/machine/porter/50_bblayers.conf.inc5
-rw-r--r--templates/machine/porter/50_local.conf.inc3
-rw-r--r--templates/machine/porter/50_setup.sh14
-rw-r--r--templates/machine/qemuarm/50_local.conf.inc3
-rw-r--r--templates/machine/qemuarm/README_machine_qemuarm.md9
-rw-r--r--templates/machine/qemuarm64/50_local.conf.inc3
-rw-r--r--templates/machine/qemuarm64/README_machine_qemuarm64.md9
-rw-r--r--templates/machine/qemuriscv64/50_local.conf.inc3
-rw-r--r--templates/machine/qemuriscv64/README_machine_qemuriscv64.md9
-rw-r--r--templates/machine/qemux86-64/README_machine_qemux86-64.md9
-rw-r--r--templates/machine/qemux86/50_local.conf.inc3
-rw-r--r--templates/machine/raspberrypi2/50_bblayers.conf.inc1
-rw-r--r--templates/machine/raspberrypi2/50_local.conf.inc3
l---------templates/machine/raspberrypi3-64/50_bblayers.conf.inc1
-rw-r--r--templates/machine/raspberrypi3-64/50_local.conf.inc3
-rw-r--r--templates/machine/raspberrypi3-64/test/hwtest.short.environment10
-rw-r--r--templates/machine/raspberrypi3-64/test/testjob_short.yaml49
-rw-r--r--templates/machine/raspberrypi3/50_bblayers.conf.inc1
-rw-r--r--templates/machine/raspberrypi3/50_local.conf.inc3
-rw-r--r--templates/machine/raspberrypi3/test/hwtest.enable1
-rw-r--r--templates/machine/raspberrypi3/test/hwtest.short.enable1
-rw-r--r--templates/machine/raspberrypi3/test/hwtest.short.environment10
-rw-r--r--templates/machine/raspberrypi3/test/testjob_short.yaml49
-rw-r--r--templates/machine/raspberrypi4/50_bblayers.conf.inc1
-rw-r--r--templates/machine/raspberrypi4/50_local.conf.inc4
-rw-r--r--templates/machine/raspberrypi5/50_bblayers.conf.inc1
-rw-r--r--templates/machine/raspberrypi5/50_local.conf.inc4
-rw-r--r--templates/machine/s4sk/50_bblayers.conf.inc7
-rw-r--r--templates/machine/s4sk/50_local.conf.inc4
-rw-r--r--templates/machine/s4sk/README_machine_s4sk.md11
-rw-r--r--templates/machine/unmatched/50_bblayers.conf.inc6
-rw-r--r--templates/machine/unmatched/50_local.conf.inc4
-rw-r--r--templates/machine/virtio-aarch64/50_bblayers.conf.inc6
-rw-r--r--templates/machine/virtio-aarch64/50_local.conf.inc3
-rw-r--r--templates/machine/virtio-aarch64/README_machine_virtio-aarch64.md10
-rw-r--r--templates/machine/wandboard/50_bblayers.conf.inc4
-rw-r--r--templates/machine/wandboard/50_local.conf.inc2
1144 files changed, 13050 insertions, 66758 deletions
diff --git a/.gitlab/issue_templates/default.md b/.gitlab/issue_templates/default.md
new file mode 100644
index 000000000..bca6c09e4
--- /dev/null
+++ b/.gitlab/issue_templates/default.md
@@ -0,0 +1,2 @@
+**Please use https://jira.automotivelinux.org for issues.**
+See also: https://docs.automotivelinux.org/ chapter "How to contribute".
diff --git a/.gitlab/issue_templates/mytemplate.md b/.gitlab/issue_templates/mytemplate.md
new file mode 100644
index 000000000..25d91d81d
--- /dev/null
+++ b/.gitlab/issue_templates/mytemplate.md
@@ -0,0 +1,3 @@
+**Please use https://gerrit.automotivelinux.org for code contributions.**
+See also: https://docs.automotivelinux.org/ chapter "How to contribute".
+
diff --git a/.gitlab/merge_request_templates/default.md b/.gitlab/merge_request_templates/default.md
new file mode 100644
index 000000000..5b02effeb
--- /dev/null
+++ b/.gitlab/merge_request_templates/default.md
@@ -0,0 +1,2 @@
+**Please use https://gerrit.automotivelinux.org for code contributions.**
+See also: https://docs.automotivelinux.org/ chapter "How to contribute".
diff --git a/.gitlab/merge_request_templates/mytemplate.md b/.gitlab/merge_request_templates/mytemplate.md
new file mode 100644
index 000000000..25d91d81d
--- /dev/null
+++ b/.gitlab/merge_request_templates/mytemplate.md
@@ -0,0 +1,3 @@
+**Please use https://gerrit.automotivelinux.org for code contributions.**
+See also: https://docs.automotivelinux.org/ chapter "How to contribute".
+
diff --git a/.gitreview b/.gitreview
index 8b5a8f7de..9e6f9aef4 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,3 +2,4 @@
host=gerrit.automotivelinux.org
port=29418
project=AGL/meta-agl
+defaultbranch=master
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..e8758f89c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Different components of the AGL layers are under different licenses (a mix
+of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further
+details of the individual licenses.
+
+All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar)
+is MIT licensed unless otherwise stated.
+Source code included in tree for individual recipes (e.g. patches) are under
+the LICENSE stated in the associated recipe (.bb file) unless otherwise stated.
+
+License information for any other files (scripts) is either explicitly stated
+or defaults to GPL version 2 only.
+
+Individual files can contain the following style tags instead of the full
+license text to identify their license:
+
+ SPDX-License-Identifier: GPL-2.0-only
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/LICENSE.GPL-2.0-only b/LICENSE.GPL-2.0-only
new file mode 100644
index 000000000..5db3c0a21
--- /dev/null
+++ b/LICENSE.GPL-2.0-only
@@ -0,0 +1,288 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: GPL-2.0-only
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/LICENSE.MIT b/LICENSE.MIT
new file mode 100644
index 000000000..a6919eb7e
--- /dev/null
+++ b/LICENSE.MIT
@@ -0,0 +1,25 @@
+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 above copyright notice and this permission notice 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.
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/README-AGL.md b/README-AGL.md
index bb6e8aa63..92a2c46a2 100644
--- a/README-AGL.md
+++ b/README-AGL.md
@@ -1,436 +1,34 @@
-?README-AGL.md: The Automotive Grade Linux Distribution
-======================================================
+Overview
+========
-AGL is creating an automotive specific Linux distribution (AGL UCB)
-that unifies the software that has been written in a number of places already,
-such as GENIVI and Tizen IVI.
+The
+[AGL Project](https://www.automotivelinux.org/) is an automotive-specific
+development environment that provides a Linux distribution
+[AGL UCB](https://www.automotivelinux.org/software/unified-code-base).
-The layer 'meta-agl' provides a minimal set of software
-to boot system of AGL Distribution. 'meta-agl' is the minimal
-core which is used build AGL profiles on top of it.
+AGL uses layers designed to be compatible with the
+[Yocto Project](https://www.yoctoproject.org) and the
+[OpenEmbedded Project (OE)](https://www.openembedded.org/wiki/Main_Page).
-The reference UI is part of 'meta-agl-demo'.
+This section provides information about the layers used by the AGL Project:
-Additional components like the security framework are part of 'meta-agl-extra'.
+* **`meta-agl`**: Minimal set of software needed to create an AGL distribution
+ used to boot a system.
+ AGL profiles are built on top of this minimal set of software.
-The AGL community appreciates feedback, ideas, suggestion, bugs and
-documentation just as much as code. Please join the irc conversation
-at the #automotive channel on irc.freenode.net and our mailing list.
+* **`meta-agl-demo`**: Provides a reference or demo platform and applications
+ for the AGL Distribution.
+ The reference UI is part of the `meta-agl-demo` layer.
-For infomation for subscribing to the mailing list
- [automotive-discussions](http://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions)
-For information about AGL Distribution, see the
- [AGL Distribution](https://wiki.automotivelinux.org/agl-distro)
-For information abount Getting started with AGL
- [here](https://wiki.automotivelinux.org/start/getting-started)
-For information about contributing to the AGL Distro
- [here](https://wiki.automotivelinux.org/agl-distro/contributing)
+* **`meta-agl-devel`**: Contains components under development or being tested.
+ This layer also contains software packages that OEMs need but do not exist
+ in AGL.
-Quick start guide
------------------
-The latest version is available at [AGL wiki](https://wiki.automotivelinux.org/agl-distro/source-code) for the following targets:
-* [QEMU](https://wiki.automotivelinux.org/agl-distro/source-code)
-* [Renesas Porter board](https://wiki.automotivelinux.org/start/building_for_the_renesas_r-car_m2)
-* [Raspberry Pi 2/3](https://wiki.automotivelinux.org/agl-distro/agl-raspberrypi)
+**WRITER NOTES:** The content for this section is the `README-AGL.md`
+ file that is in the `meta-agl` layer, which is a Gerrit layer.
+ You can clone the layer using this command:
-To build an image from 'meta-agl'
-
-1. Prepare repo:
- > $ mkdir ~/bin
- > $ export PATH=~/bin:$PATH
- > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
- > $ chmod a+x ~/bin/repo
-
-2. Get all layers:
- > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
- > $ repo sync
-
-3. Check available targets and extensions, select target machine:
- > $ source meta-agl/scripts/aglsetup.sh -h
- > $ source meta-agl/scripts/aglsetup.sh -m porter
-
-4. Build agl-image-ivi
- > $ bitbake agl-image-ivi
-
-To build the agl-demo-platform (as demo'ed @ALS) replace 3. and 4. with:
-3. Check available targets and extensions, select target machine:
- > $ source meta-agl/scripts/aglsetup.sh -h
- > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo [agl-appfw-smack] [agl-devel] [agl-netboot]
-
-4. Build agl-demo-platform
- > $ bitbake agl-demo-platform
-Note: this uses more layers and not only meta-agl
-
-AGL Layers and dependencies:
-----------------------------
-Check the README.md of the respective layers:
-- meta-agl (= core, no UI)
-- meta-agl-demo (= reference UI)
-- meta-agl-extra (= extra components)
-
-In addition, the reference hardware (Renesas R-Car Gen2 / porter) has this dependency:
-
-URI: https://gerrit.automotivelinux.org/gerrit/AGL/meta-renesas
-> branch: agl-1.0-bsp-1.8.0
-> tested revision: 82611ccadef36ab0b8a6fd6fb1cf055e115f1ef5
-
-
-Supported Machines
-------------------
-
-Reference hardware:
-
-* QEMU (x86-64) - emulated machine: qemux86-64
-* Renesas R-Car Gen2 (R-Car M2) - machine: porter
-
-Community contributed hardware:
-
-* See: https://wiki.automotivelinux.org/agl-distro#supported_hardware
-
-
-Supported Target of bitbake
----------------------------
-
-meta-agl:
-
-* `agl-image-ivi` The baseline image of AGL Distributions (console only)
-
-* `agl-image-minimal` For internal use to develop distribution (experimental)
-* `agl-image-weston` For internal use to develop distribution (experimental)
-
-meta-agl-demo:
-
-* `agl-demo-platform` The demo/reference image (with graphical UI)
-
-Run this command for a full list of machines, features and targets:
- > $ source ./meta-agl/scripts/aglsetup.sh -h
-
-
-Supposed Directory Tree of Layers to build
--------------------------------------------
-
- > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
- > $ repo sync
- > $ tree -L 1
- .
- |-- meta-agl
- |-- meta-agl-demo
- |-- meta-agl-devel
- |-- meta-agl-extra
- |-- meta-amb
- |-- meta-fsl-arm
- |-- meta-fsl-arm-extra
- |-- meta-intel
- |-- meta-intel-iot-security
- |-- meta-openembedded
- |-- meta-qcom
- |-- meta-qt5
- |-- meta-raspberrypi
- |-- meta-renesas
- |-- meta-rust
- |-- meta-security-isafw
- |-- meta-ti
- `-- poky
- 18 directories, 0 files
-
-
-Build a QEMU image
-------------------
-
-You can build a QEMU image using the following steps:
-
-(latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
-To build an image from 'meta-agl'
-
-1. Prepare repo:
- > $ mkdir ~/bin
- > $ export PATH=~/bin:$PATH
- > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
- > $ chmod a+x ~/bin/repo
-
-2. Get all layers:
- > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
- > $ repo sync
-
-3. Check available targets and extensions, select target machine:
- > $ source meta-agl/scripts/aglsetup.sh -h
- > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64
-
- Alternatively, to enable the reference UI feature ('agl-demo'):
- > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo
-
- Alternatively, to also enable also the security framework ('agl-appfw-smack'):
- > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack
-
- Alternatively, to also enable debugging tools ('agl-devel') and the network-boot (nbd) capabilities ('agl-netboot'):
- > $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl agl-appfw-smack agl-devel agl-netboot
-
-4. Build agl-image-ivi
- > $ bitbake agl-image-ivi
-
- or alternatively, if you enabled the 'agl-demo' feature:
- > $ bitbake agl-demo-platform
-
- - If you want to run QEMU directly as VM in Virtual Box or your other favorite VM software then add this line to your "conf/local.conf" file.
- > IMAGE_FSTYPES += "vmdk"
-
-5. Run in the emulator
- > $ runqemu agl-image-ivi qemux86-64
- > or
- > $ runqemu agl-demo-platform qemux86-64
-
- For a large screen:
- > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32"
-
- To extend the amount of memory, add to runqemu:
- qemuparams="-m 512"
- > $ runqemu agl-image-ivi qemux86-64 qemuparame="-m 512" bootparams="uvesafb.mode_option=1280x720-32"
-
-
- To separate console from VGA screen (to avoid corrupt screen while booting),
- add to runqemu:
- serial
- > $ runqemu agl-image-ivi qemux86-64 bootparams="uvesafb.mode_option=1280x720-32" serial
-
- **Or use the virtual disk in Virtual Box from this location:**
- > tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.vmdk
-
-6. Some weston samples are available from weston terminal (click top left icon).
- Check the folder `/opt/AGL/ALS2016`.
-
-Build a R-Car M2 (porter) image
--------------------------------
-
-### Software setup
-
-NOTE: You will need to download the matching binary driver package from renesas.
- As of this writing, the version from 20151228.
- The main URL to retrieve these is:
-
- - https://www.renesas.com/en-eu/solutions/automotive/rcar-demoboard.html
-
- As of this writing, the necessary libary and driver packages linked to
- by above site are:
- - The subpage for the library is:
- - https://www.renesas.com/en-eu/software/D3017410.html (registration/login required)
-
- - The sub-page for the driver is:
- - https://www.renesas.com/en-eu/media/secret/solutions/automotive/rcar-demoboard/R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.zip
-
- !!! The files need to be in `${HOME}/Downloads` ( `$XDG_DOWNLOAD_DIR` ) !!!
-
-#### Getting Source Code and Build image
-
-(latest version here: https://wiki.automotivelinux.org/agl-distro/source-code)
-To build an image from 'meta-agl' only:
-
-1. Prepare repo:
- > $ mkdir ~/bin
- > $ export PATH=~/bin:$PATH
- > $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
- > $ chmod a+x ~/bin/repo
-
-2. Get all layers:
- > $ repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo
- > $ repo sync
-
-3. Check available targets and extensions, select target machine:
- > $ source meta-agl/scripts/aglsetup.sh -h
- > $ source meta-agl/scripts/aglsetup.sh -m porter
-
- Alternatively, to enable the reference UI:
- > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo
-
- Alternatively, to also enable also the security framework:
- > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack
-
- Alternatively, to also enable debugging tools and the network-boot (nbd) capabilities:
- > $ source meta-agl/scripts/aglsetup.sh -m porter agl-demo agl agl-appfw-smack agl-devel agl-netboot
-
-4. (optional) edit conf/local.conf )* see below
- > $ vi conf/local.conf
-
-5. Build agl-image-ivi
- > $ bitbake agl-image-ivi
-
- or alternatively, if you enabled the 'agl-demo' feature:
- > $ bitbake agl-demo-platform
-
-
-)* :
-
- 4 . Optional edits to conf/local.conf
-
- * If you want to use multimedia accelerations, uncomment
- manually 4 `IMAGE_INSTALL_append_porter` in conf/local.conf.
-
- > #IMAGE_INSTALL_append_porter = " \
- > # gstreamer1.0-plugins-bad-waylandsink \
- > # "
- > #IMAGE_INSTALL_append_porter = " \
- > # gstreamer1.0-plugins-base-videorate \
- > ...
- > #"
- > #IMAGE_INSTALL_append_porter = " \
- > # libegl libegl-dev libgbm-dev \
- > ...
- > # "
- > #IMAGE_INSTALL_append_porter = " \
- > # packagegroup-rcar-gen2-multimedia \
- > ...
- > # "
-
-* Also it is needed to uncomment this:
- > #MACHINE_FEATURES_append = " multimedia"
-
- This `multimedia` MACHINE_FEATURES enables the meta-renesas's specific multimedia configuration.
- The version of GStreamer1.0 which AGL distro will use is changed
- to 1.2.3 (meta-renesas prefers it) over 1.4.1 (meta-agl default)
- by this switch.
-
-* If you want to install various Qt5 examples, add below
- configuration to your local.conf.
-> IMAGE_INSTALL_append = " \
-> packagegroup-agl-demo-qt-examples \
-> "
-> PACKAGECONFIG_append_pn-qtbase = " examples"
->
-> IMPORTANT NOTE:
-> To run examples with wayland-egl plugin,
-> use ``LD_PRELOAD=/usr/lib/libEGL.so <command>``.
-> If not, programs should not launch by error,
-> 'EGL not available'.
-
-
-### Deployment (SDCARD)
-
-#### Instructions on the host
-
-1. Format SD-Card and then, create single EXT4 partition on it.
-
-2. Mount the SD-Card, for example `/media/$SDCARD_LABEL`.
-
-3. Copy AGL root file system onto the SD-Card
- 1. Go to build directory
- > $ cd $AGL_TOP/build/tmp/deploy/images/porter
-
- 2. Extract the root file system into the SD-Card
- > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
- > --totals --directory=/media/$SDCARD_LABEL --file=agl-image-ivi-porter.tar.bz2
-
- 3. Copy kernel and DTB into the `/boot` of the SD-Card
- > $ sudo cp uImage uImage-r8a7791-porter.dtb /media/$SDCARD_LABEL/boot
-
-4. After the copy finished, unmount SD-Card and insert it into the SD-Card slot of the porter board.
-
-#### Instructions on the target
-
-NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
-
-NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
-
-##### Change U-Boot parameters to boot from SD card
-
-1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
-
- ``Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.**
-
-2. Set the follow environment variables and save them
-> => setenv bootargs_console console=ttySC6,${baudrate}
-> => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
-> => setenv bootcmd_sd 'ext4load mmc 0:1 0x40007fc0 boot/uImage;ext4load mmc 0:1 0x40f00000 boot/uImage-r8a7791-porter.dtb'
-> => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} root=/dev/mmcblk0p1 rw rootfstype=ext4;run bootcmd_sd;bootm 0x40007fc0 - 0x40f00000'
-> => saveenv
-
-##### Boot from SD card
-
-1. After board reset, U-Boot is started and after a countdown, ...
- Linux boot message should be displayed. Please wait a moment.
-
-2. Then weston is booted automatically, and weston-terminal appears.
-
-3. Have fun! :)
-
-### Deployment (TFTP/NFS)
-
-NOTE: These instructions are based on Embedded Linux Wiki, [here](http://www.elinux.org/R-Car/Boards/Yocto#Loading_kernel_via_TFTP_and_rootfs_via_NFS). And a Debian (wheezy, ip: 192.168.30.70) is used as the host for this instructions.
-
-#### Instructions on the host
-1. Setup a TFTP server
- 1. Install necessary packages
- > $ sudo apt-get install tftp tftpd-hpa
-
- 2. Go to build directory, and copy kernel and DTB into TFTP server root (default server dir: /srv/tftp)
- > $cd $AGL_TOP/build/tmp/deploy/images/porter
- > $ sudo cp uImage uImage-r8a7791-porter.dtb /srv/tftp
-
- 3. Verify TFTP server is working
- > $ ls uImage
- ls: cannot access uImage: No such file or directory
-
- > $ cd /tmp/
- > $ tftp 192.168.30.70
- > tftp> get uImage
- > Received 3583604 bytes in 0.2 seconds
- > tftp> q
- > $ ls uImage
- > uImage
-
-2. set NFS server
- 1. Install necessary packages
- > $ sudo apt-get install nfs-kernel-server nfs-common
-
- 2. Go to build directory, and extract the root file system into a dedicated directory (here we use /nfs/porter)
- > $ cd $AGL_TOP/build/tmp/deploy/images/porter
- > $ sudo mkdir -p /nfs/porter
- > $ sudo tar --extract --numeric-owner --preserve-permissions --preserve-order \
- > --totals --directory=/nfs/porter --file=agl-demo-platform-porter.tar.bz2
-
- 3. Edit /etc/exports
- > $ sudo vi /etc/exports
- Add
- >
- > /nfs/porter *(rw,no_subtree_check,sync,no_root_squash,no_all_squash)
- >
- Save the file and exit.
-
- 4. Restart nfs service
- > $ sudo service nfs-kernel-server restart
-
- 5. Verify NFS server is working
- > $ sudo mount -t nfs 192.168.30.70:/nfs/porter /tmp/
- > $ ls /tmp
- > bin boot dev etc home lib media mnt proc run sbin sys tmp usr var
-
-#### Instructions on the target board
-
-NOTE: There is details about porter board [here](http://elinux.org/R-Car/Boards/Porter).
-
-NOTE: To boot weston on porter board, we need keyboard and mouse. (USB2.0 can be use for this)
-
-##### Change U-Boot parameters to boot from TFTP/NFS
-
-1. Power up the board and, using your preferred terminal emulator, stop the board's autoboot by hitting any key.
-
- > Debug serial settings are 38400 8N1. Any standard terminal emulator program can be used.
-
-2. Set the follow environment variables and save them
-> => setenv ipaddr <board-ip>
-> => setenv serverip <host-ip>
-> => setenv bootargs_console console=ttySC6,${baudrate}
-> => setenv bootargs_video vmalloc=384M video=HDMI-A-1:1024x768-32@60
-> => setenv bootcmd_net 'tftp 0x40007fc0 uImage; tftp 0x40f00000 uImage-r8a7791-porter.dtb'
-> => setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ip=${ipaddr} root=/dev/nfs nfsroot=${serverip}:/nfs/porter,vers=3;run bootcmd_net;bootm 0x40007fc0 - 0x40f00000'
-> => saveenv
-
- Replace <board-ip> with a proper IP address for the board, like 192.168.30.60.
- Replace <host-ip> with the IP address of the host, here we use 192.168.30.70.
-
-##### Boot from TFTP/NFS
-
-1. After board reset, U-Boot is started and after a countdown, ...
- Linux boot message should be displayed. Please wait a moment.
-2. Then weston is booted automatically, and weston-terminal appears.
-3. Have fun! :)
+ ```
+ $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl
diff --git a/README.md b/README.md
index fc6a06967..7c9cc95ec 100644..120000
--- a/README.md
+++ b/README.md
@@ -1,157 +1 @@
-**README.md for the 'meta-agl' layer.**
-
-**See README-AGL.md for general information about Automotive Grade Linux.**
-
-
-meta-agl, the core layer for Automotive Grade Linux Distribution
-================================================================
-
-AGL is creating an automotive specific Linux distribution that unifies
-the software that has been written in a number of places already,
-such as GENIVI and Tizen IVI.
-
-The layer 'meta-agl' provides a minimal set of software
-to boot system of AGL Distribution. 'meta-agl' is the minimal
-core which is used build AGL profiles on top of it.
-
-Especially there is no reference UI included which is part of 'meta-agl-demo'.
-
-Additional components like the security framework are part of 'meta-agl-extra'.
-
-The AGL community appreciates feedback, ideas, suggestion, bugs and
-documentation just as much as code. Please join the irc conversation
-at the #automotive channel on irc.freenode.net and our mailing list.
-
-For infomation for subscribing to the mailing list
- [automotive-discussions](http://lists.linuxfoundation.org/mailman/listinfo/automotive-discussions)
-For information about AGL Distribution, see the
- [AGL Distribution](https://wiki.automotivelinux.org/agl-distro)
-For information abount Getting started with AGL
- [here](https://wiki.automotivelinux.org/start/getting-started)
-For information about contributing to the AGL Distro
- [here](https://wiki.automotivelinux.org/agl-distro/contributing)
-
-Quick start guide
------------------
-See README-AGL.md
-
-
-'meta-agl' Layer Dependencies
------------------------------
-* poky
-> URI: git://git.yoctoproject.org/poky
-> branch : jethro
-> tested revision: 40376446904ae3529be41737fed9a0b650ed167d
-
-* meta-openembedded
-> URI: git://git.openembedded.org/meta-openembedded
-> layer : meta-openembedded
-> branch : jethro
-> tested revision: 8ab04afbffb4bc5184cfe0655049de6f44269990
-
- Specifically out of meta-openembedded these sub-layers are used:
- * meta-openembedded/meta-oe
- * meta-openembedded/meta-multimedia
- * meta-openembedded/meta-efl
- * meta-openembedded/meta-networking
- * meta-openembedded/meta-python
-
-Layers
-------
-
-There are 5 layers in top-level `meta-agl`.
-
-* `meta-agl/meta-ivi-common`
-`meta-ivi-common` is a layer which contains common packages to AGL
-Distribution and other platforms for In-Vehicle Infotainment system.
-
-* `meta-agl/meta-agl`
-`meta-agl` is a layer which contains AGL common and middleware packages.
-
-* `meta-agl/meta-agl-bsp`
-`meta-agl-bsp` is a layer which contains required packages to boot AGL
-distribution on an emulated machine(QEMU).
-
-* `meta-agl/meta-netboot`
-`meta-netboot` contains the netboot initrd support recipes. This is needed
-in case of booting over the network as NFS does not support the securitylabels.
-
-Packagegroups
--------------
-
-AGL package group design:
-
-* packagegroup-agl-image-minimal
-
- packagegroup-agl-core-automotive.bb
- packagegroup-agl-core-connectivity.bb
- packagegroup-agl-core-graphics.bb
- packagegroup-agl-core-kernel.bb
- packagegroup-agl-core-multimedia.bb
- packagegroup-agl-core-navi-lbs.bb
- packagegroup-agl-core-os-commonlibs.bb
- packagegroup-agl-core-security.bb
- packagegroup-agl-core-speech-services.bb
-
-These are for making image ``agl-image-minimal`` which is small image just
-capable of allowing a device to boot.
-
-Subsystem should maintain packagegroup-agl-core-[subsystem].bb which should
-hold sufficient packages to build ``agl-image-minimal``.
-
-* packagegroup-agl-image-ivi
-
- packagegroup-agl-ivi-automotive.bb
- packagegroup-agl-ivi-connectivity.bb
- packagegroup-agl-ivi-graphics.bb
- packagegroup-agl-ivi-kernel.bb
- packagegroup-agl-ivi-multimedia.bb
- packagegroup-agl-ivi-navi-lbs.bb
- packagegroup-agl-ivi-os-commonlibs.bb
- packagegroup-agl-ivi-security.bb
- packagegroup-agl-ivi-speech-services.bb
-
-These are for making image ``agl-image-ivi`` which is baseline for the profiles
-of AGL distro. 'Baseline' means Service Layer and Operating System Layer defined
-in AGL Spec v1.0.
-
-* packagegroup-agl-test.bb
-
-Additional tools used in QA tests (for agl-image*-qa).
-
-* packagegroup-ivi-common*
-
- packagegroup-ivi-common-core-automotive.bb
- packagegroup-ivi-common-core.bb
- packagegroup-ivi-common-core-connectivity.bb
- packagegroup-ivi-common-core-graphics.bb
- packagegroup-ivi-common-core-kernel.bb
- packagegroup-ivi-common-core-multimedia.bb
- packagegroup-ivi-common-core-navi-lbs.bb
- packagegroup-ivi-common-core-os-commonlibs.bb
- packagegroup-ivi-common-core-security.bb
- packagegroup-ivi-common-core-speech-services.bb
- packagegroup-ivi-common-test.bb
-
-These are for picking up some packages from upstreams like GENIVI/Tizen/Others.
-The layer of ``meta-ivi-common`` has no image to build, all packagegroups are
-aggregated to ``packagegroup-ivi-common-core' and it is included by images,
-``agl-image-ivi.bb`` and ``agl-demo-platform.bb``.
-
-
-Supported Machines
-------------------
-
-See README-AGL.md
-
-
-Supported Target for bitbake
-----------------------------
-
-meta-agl:
-
-* `agl-image-ivi` The baseline image of AGL Distributions (console only)
-* `agl-image-minimal` For internal use to develop distribution (experimental)
-* `agl-image-weston` For internal use to develop distribution (experimental)
-
-
+meta-agl.md \ No newline at end of file
diff --git a/agl-layers-overview.md b/agl-layers-overview.md
new file mode 100755
index 000000000..e84f875bf
--- /dev/null
+++ b/agl-layers-overview.md
@@ -0,0 +1,24 @@
+Overview
+========
+
+The
+[AGL Project](https://www.automotivelinux.org/) is an automotive-specific
+development environment that provides a Linux distribution
+[(AGL UCB](https://www.automotivelinux.org/software/unified-code-base)).
+
+AGL uses layers designed to be compatible with the
+[Yocto Project](https://www.yoctoproject.org) and the
+[OpenEmbedded Project (OE)](https://www.openembedded.org/wiki/Main_Page).
+
+This section provides information about the layers used by the AGL Project:
+
+* **`meta-agl`**: Minimal set of software needed to create an AGL distribution
+ used to boot a system.
+
+* **`meta-agl-demo`**: Provides a reference or demo platform and applications
+ for the AGL Distribution.
+ The reference UI is part of the `meta-agl-demo` layer.
+
+* **`meta-agl-devel`**: Contains components under development or being tested.
+ This layer also contains software packages that OEMs need but do not exist
+ in AGL.
diff --git a/docs/devguides-book.yml b/docs/devguides-book.yml
new file mode 100644
index 000000000..34a99cb1d
--- /dev/null
+++ b/docs/devguides-book.yml
@@ -0,0 +1,15 @@
+type: books
+books:
+-
+ id: meta-agl
+ title: AGL Layers
+ description: Meta AGL documentation
+ keywords:
+ author: "AGL"
+ version: master
+ chapters:
+ - url: ../agl-layers-overview.md
+ name: Overview
+ - url: ../meta-agl.md
+ destination: meta-agl.md
+ name: meta-agl
diff --git a/docs/profiles.md b/docs/profiles.md
new file mode 100644
index 000000000..5d0f89d4f
--- /dev/null
+++ b/docs/profiles.md
@@ -0,0 +1,146 @@
+# AGL Profiles
+
+The AGL Profiles cover the different use-cases that the AGL platform serves.\
+This ranges from minimal systems without display, telematic systems, HUD, IVI, ADAS and more.\
+Common to all of them is the use of the AGL APIs (agl-service-*).
+
+All systems have the 'core' profile in common.\
+This small set of libraries and binaries is the essential set including the AGL APIs that every AGL system needs.\
+All other profiles reuse the 'core' profile.
+
+The other profiles and their dependencies are currently:
+
+* agl-profile-core
+ * agl-profile-telematics
+ * agl-profile-hud
+ * agl-profile-graphical
+ * agl-profile-graphical-html5
+ * agl-profile-graphical-qt5
+ * agl-demo-platform
+
+## agl-profile-core
+
+This profile contains the following images:
+
+* agl-image-boot
+ * agl-image-minimal
+ * agl-image-minimal-crosssdk
+
+### agl-image-boot
+
+This image is only meant to boot the target device and provide network, package-management and a shell.\
+All other functionality needs to be installed at runtime through 'dnf' using the provided package feeds and package-groups (e.g. dnf install profile-graphical-qt5)
+
+### agl-image-minimal
+
+This is the smallest image that includes all (non-graphical) AGL APIs.
+
+### agl-image-minimal-crosssdk
+
+This is the SDK for systems without display including the AGL APIs.
+
+## agl-profile-telematics
+
+N.N.
+
+## agl-profile-hud
+
+N.N.
+
+## agl-profile-graphical
+
+This profile contains a basic graphical system with wayland/weston.\
+It is used as a base for the more targeted profiles:
+
+* agl-profile-graphical-html5
+* agl-profile-graphical-qt5
+
+Part of this layer are the following images:
+
+* agl-image-weston
+
+### agl-image-weston
+
+Pure wayland + weston image but with all AGL service APIs.
+
+## agl-profile-graphical-html5
+
+This profile contains all components to build a html5 / web-based system and should be used as a base layer for further projects.\
+All AGL APIs are included.
+
+## agl-profile-graphical-qt5
+
+This profile is used as base for all projects that build on qt5 like the agl-demo-platform.\
+Part of this layer are the ffollowing images:
+
+* agl-image-graphical-qt5
+* agl-image-graphical-qt5-crosssdk\
+ (THIS IS THE SDK TARGET WE AIM TO USE FOR AGL-DEMO-PLATFORM IN THE END)
+
+All AGL APIs are included.
+
+### agl-image-graphical-qt5
+
+Image with wayland/weston and the qt5 packages installed.
+
+### agl-image-graphical-qt5-crosssdk
+
+SDK based on agl-image-graphical-qt5 suitable for development under qt5.
+
+## agl-demo-platform
+
+This layer builds on-top of agl-profile-graphical-qt5 and builds the full AGL demonstrator image.\
+It hosts these images:
+
+* agl-demo-platform
+* agl-demo-platform-crosssdk
+* agl-demo-platform-qa
+
+TLDR:
+
+```tree
+meta-agl/meta-agl-profile-core/recipes-platform
+|-- images
+| |-- agl-image-boot.bb
+| |-- agl-image-boot.inc
+| |-- agl-image-minimal-crosssdk.bb
+| |-- agl-image-minimal-qa.bb
+| |-- agl-image-minimal.bb
+| `-- agl-image-minimal.inc
+`-- packagegroups
+ |-- packagegroup-agl-core-boot.bb
+ |-- packagegroup-agl-core-connectivity.bb
+ |-- packagegroup-agl-core-multimedia.bb
+ |-- packagegroup-agl-core-navigation.bb
+ |-- packagegroup-agl-core-os-commonlibs.bb
+ |-- packagegroup-agl-core-security.bb
+ |-- packagegroup-agl-core-services.bb
+ |-- packagegroup-agl-image-boot.bb
+ `-- packagegroup-agl-image-minimal.bb
+
+ meta-agl/meta-agl-profile-graphical/recipes-platform
+|-- images
+| |-- agl-image-weston.bb
+| `-- agl-image-weston.inc
+`-- packagegroups
+ |-- packagegroup-agl-graphical-services.bb
+ `-- packagegroup-agl-image-weston.bb
+
+ meta-agl/meta-agl-profile-graphical-html5/recipes-platform
+|-- images
+| |-- agl-demo-platform-html5-crosssdk.bb
+| |-- agl-demo-platform-html5.bb
+| `-- agl-demo-platform-html5.inc
+`-- packagegroups
+ `-- packagegroup-agl-demo-platform-html5.bb
+
+ meta-agl/meta-agl-profile-graphical-qt5/recipes-platform
+|-- images
+| |-- agl-image-graphical-qt5-crosssdk.bb
+| |-- agl-image-graphical-qt5.bb
+| `-- agl-image-graphical-qt5.inc
+`-- packagegroups
+ |-- packagegroup-agl-demo-qt-examples.bb
+ |-- packagegroup-agl-profile-graphical-qt5.bb
+ `-- packagegroup-qt5-toolchain-target.bbappend
+```
diff --git a/meta-agl-bsp/LICENSE b/meta-agl-bsp/LICENSE
new file mode 100644
index 000000000..e8758f89c
--- /dev/null
+++ b/meta-agl-bsp/LICENSE
@@ -0,0 +1,20 @@
+Different components of the AGL layers are under different licenses (a mix
+of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further
+details of the individual licenses.
+
+All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar)
+is MIT licensed unless otherwise stated.
+Source code included in tree for individual recipes (e.g. patches) are under
+the LICENSE stated in the associated recipe (.bb file) unless otherwise stated.
+
+License information for any other files (scripts) is either explicitly stated
+or defaults to GPL version 2 only.
+
+Individual files can contain the following style tags instead of the full
+license text to identify their license:
+
+ SPDX-License-Identifier: GPL-2.0-only
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-bsp/LICENSE.GPL-2.0-only b/meta-agl-bsp/LICENSE.GPL-2.0-only
new file mode 100644
index 000000000..5db3c0a21
--- /dev/null
+++ b/meta-agl-bsp/LICENSE.GPL-2.0-only
@@ -0,0 +1,288 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: GPL-2.0-only
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-bsp/LICENSE.MIT b/meta-agl-bsp/LICENSE.MIT
new file mode 100644
index 000000000..a6919eb7e
--- /dev/null
+++ b/meta-agl-bsp/LICENSE.MIT
@@ -0,0 +1,25 @@
+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 above copyright notice and this permission notice 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.
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-bsp/README b/meta-agl-bsp/README
new file mode 100644
index 000000000..69ca72c9d
--- /dev/null
+++ b/meta-agl-bsp/README
@@ -0,0 +1,19 @@
+This is meta-agl-bsp.
+
+This layer holds the 'impedance-mismatch' between AGL and the BSP's.
+
+/dream on
+In an ideal world, this would be empty!
+/dream off
+
+Maintenance
+-----------
+
+All patches must be submitted via the AGL Gerrit instance at
+https://gerrit.automotivelinux.org. See this wiki page for
+details:
+
+https://wiki.automotivelinux.org/agl-distro/contributing
+
+Layer maintainers:
+ Jan-Simon Möller <jsmoeller@linuxfoundation.org>
diff --git a/meta-agl-bsp/classes/sdcard_image-rpi.bbclass b/meta-agl-bsp/classes/sdcard_image-rpi.bbclass
deleted file mode 100644
index c22a6f880..000000000
--- a/meta-agl-bsp/classes/sdcard_image-rpi.bbclass
+++ /dev/null
@@ -1,184 +0,0 @@
-inherit image_types
-inherit linux-raspberrypi-base
-
-#
-# Create an image that can by written onto a SD card using dd.
-#
-# The disk layout used is:
-#
-# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved for other data
-# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - bootloader and kernel
-# BOOT_SPACE -> SDIMG_SIZE - rootfs
-#
-
-# Default Free space = 1.3x
-# Use IMAGE_OVERHEAD_FACTOR to add more space
-# <--------->
-# 4MiB 40MiB SDIMG_ROOTFS
-# <-----------------------> <----------> <---------------------->
-# ------------------------ ------------ ------------------------
-# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE |
-# ------------------------ ------------ ------------------------
-# ^ ^ ^ ^
-# | | | |
-# 0 4MiB 4MiB + 40MiB 4MiB + 40Mib + SDIMG_ROOTFS
-
-# This image depends on the rootfs image
-IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}"
-
-# Set kernel and boot loader
-IMAGE_BOOTLOADER ?= "bcm2835-bootfiles"
-
-# Set initramfs extension
-KERNEL_INITRAMFS ?= ""
-
-# Kernel image name
-SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img"
-SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img"
-SDIMG_KERNELIMAGE_raspberrypi3-64 ?= "kernel8.img"
-
-# Boot partition volume id
-BOOTDD_VOLUME_ID ?= "${MACHINE}"
-
-# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT)
-BOOT_SPACE ?= "40960"
-
-# Set alignment to 4MB [in KiB]
-IMAGE_ROOTFS_ALIGNMENT = "4096"
-
-# Use an uncompressed ext3 by default as rootfs
-SDIMG_ROOTFS_TYPE ?= "ext3"
-SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}"
-
-IMAGE_DEPENDS_rpi-sdimg = " \
- parted-native \
- mtools-native \
- dosfstools-native \
- virtual/kernel:do_deploy \
- ${IMAGE_BOOTLOADER} \
- ${@bb.utils.contains('KERNEL_IMAGETYPE', 'uImage', 'u-boot', '',d)} \
- "
-
-# SD card image name
-SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg"
-
-# Compression method to apply to SDIMG after it has been created. Supported
-# compression formats are "gzip", "bzip2" or "xz". The original .rpi-sdimg file
-# is kept and a new compressed file is created if one of these compression
-# formats is chosen. If SDIMG_COMPRESSION is set to any other value it is
-# silently ignored.
-#SDIMG_COMPRESSION ?= ""
-
-# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
-FATPAYLOAD ?= ""
-
-IMAGE_CMD_rpi-sdimg () {
-
- # Align partitions
- BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1)
- BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
- SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE)
-
- echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"
-
- # Check if we are building with device tree support
- DTS="${@get_dts(d)}"
-
- # Initialize sdcard image file
- dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
-
- # Create partition table
- parted -s ${SDIMG} mklabel msdos
- # Create boot partition and mark it as bootable
- parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT})
- parted -s ${SDIMG} set 1 boot on
- # Create rootfs partition to the end of disk
- parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s
- parted ${SDIMG} print
-
- # Create a vfat image with boot files
- BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
- rm -f ${WORKDIR}/boot.img
- mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
- if test -n "${DTS}"; then
- # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder
- DT_OVERLAYS="${@split_overlays(d, 0)}"
- DT_ROOT="${@split_overlays(d, 1)}"
-
- # Copy board device trees to root folder
- for DTB in ${DT_ROOT}; do
- DTB_BASE_NAME=`basename ${DTB} .dtb`
-
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
- done
-
- # Copy device tree overlays to dedicated folder
- mmd -i ${WORKDIR}/boot.img overlays
- for DTB in ${DT_OVERLAYS}; do
- DTB_EXT=${DTB##*.}
- DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
-
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT}
- done
- fi
- case "${KERNEL_IMAGETYPE}" in
- "uImage")
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE}
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage
- mcopy -o -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr
- ;;
- *)
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE}
- ;;
- esac
-
- if [ -n ${FATPAYLOAD} ] ; then
- echo "Copying payload into VFAT"
- for entry in ${FATPAYLOAD} ; do
- # add the || true to stop aborting on vfat issues like not supporting .~lock files
- mcopy -i ${WORKDIR}/boot.img -s -v ${IMAGE_ROOTFS}$entry :: || true
- done
- fi
-
- # Add stamp file
- echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info
- mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info ::
-
- # Burn Partitions
- dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
- # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
- if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
- then
- xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
- else
- dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
- fi
-
- # Optionally apply compression
- case "${SDIMG_COMPRESSION}" in
- "gzip")
- gzip -k9 "${SDIMG}"
- ;;
- "bzip2")
- bzip2 -k9 "${SDIMG}"
- ;;
- "xz")
- xz -k "${SDIMG}"
- ;;
- esac
-}
-
-ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; "
-
-rpi_generate_sysctl_config() {
- # systemd sysctl config
- test -d ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d && \
- echo "vm.min_free_kbytes = 8192" > ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d/rpi-vm.conf
-
- # sysv sysctl config
- IMAGE_SYSCTL_CONF="${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf"
- test -e ${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf && \
- sed -e "/vm.min_free_kbytes/d" -i ${IMAGE_SYSCTL_CONF}
- echo "" >> ${IMAGE_SYSCTL_CONF} && echo "vm.min_free_kbytes = 8192" >> ${IMAGE_SYSCTL_CONF}
-}
diff --git a/meta-agl-bsp/conf/include/agl_am62xx-evm.inc b/meta-agl-bsp/conf/include/agl_am62xx-evm.inc
new file mode 100644
index 000000000..24fd95141
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_am62xx-evm.inc
@@ -0,0 +1,8 @@
+# am62xx-evm has a k3r5 BBMULTICONFIG to build its bootloader
+# firmware, need to use an override to set DEFAULTTUNE back to
+# what that machine configuration needs.
+DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf"
+
+# meta-ti-bsp layer conf does break expectations wrt common folders
+# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti"
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
diff --git a/meta-agl-bsp/conf/include/agl_bbe.inc b/meta-agl-bsp/conf/include/agl_bbe.inc
new file mode 100644
index 000000000..5252c558b
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_bbe.inc
@@ -0,0 +1,24 @@
+# This config is for the Sancloud BBE, adapted from the config provider for the
+# standard Beaglebone
+
+#AGL_DEFAULT_IMAGE_FSTYPES += "tar.xz"
+
+CORE_IMAGE_EXTRA_INSTALL += "packagegroup-machine-base"
+
+#-------------------------------------------------
+## Multimedia section ##
+#-------------------------------------------------
+
+# DEFAULTTUNE for cortex-a8
+DISTRO_FEATURES:append = " agl-medium-arm-compiler"
+
+SECURITY_CFLAGS:pn-mozjs = ""
+SECURITY_LDFLAGS:pn-mozjs = ""
+SECURITY_CFLAGS:pn-gpm = ""
+SECURITY_LDFLAGS:pn-gpm = ""
+SECURITY_CFLAGS:pn-libatasmart = ""
+SECURITY_LDFLAGS:pn-libatasmart = ""
+
+# meta-ti-bsp layer conf does break expectations wrt common folders
+# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti"
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy" \ No newline at end of file
diff --git a/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc b/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc
new file mode 100644
index 000000000..1e03b70ff
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc
@@ -0,0 +1,6 @@
+# beaglebone-ai64 has a k3r5 BBMULTICONFIG to build its bootloader
+# and firmware, need to use an override to set DEFAULTTUNE back to
+# what that machine configuration needs.
+DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf"
+
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
diff --git a/meta-agl-bsp/conf/include/agl_beaglebone.inc b/meta-agl-bsp/conf/include/agl_beaglebone.inc
index be9785a5a..ec3a3a448 100644
--- a/meta-agl-bsp/conf/include/agl_beaglebone.inc
+++ b/meta-agl-bsp/conf/include/agl_beaglebone.inc
@@ -1,42 +1,10 @@
# This config is for the beaglebone (inspired from the vayu config).
-#-------------------------------------------------
-## Graphics section ##
-#-------------------------------------------------
-PACKAGES_GFX = "omapdrm-pvr"
-IMAGE_INSTALL_append = " ${PACKAGES_GFX}"
-
-
-# Enable Gfx Pkgs
-MACHINE_FEATURES_append = " sgx"
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-DEPENDS_remove = "virtual/libgl"
-
-# Preferred providers
-PREFERRED_PROVIDER_virtual/libgles1 = ""
-PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
-PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
-PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
-PREFERRED_PROVIDER_libgbm = "libgbm"
-
-#Preferred versions
-PREFERRED_VERSION_libgbm = "10.0.0"
-
-#-------------------------------------------------
-## Multimedia section ##
-#-------------------------------------------------
-
-PREFERRED_PROVIDER_virtual/kernel = "linux-ti-staging"
-PREFERRED_VERSION_virtual/kernel = "4.9"
-
# DEFAULTTUNE for cortex-a8
-DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+DISTRO_FEATURES:append = " agl-medium-arm-compiler"
-SECURITY_CFLAGS_pn-mozjs = ""
-SECURITY_LDFLAGS_pn-mozjs = ""
-SECURITY_CFLAGS_pn-gpm = ""
-SECURITY_LDFLAGS_pn-gpm = ""
-SECURITY_CFLAGS_pn-libatasmart = ""
-SECURITY_LDFLAGS_pn-libatasmart = ""
+WKS_FILE = "sdimage-bootpart-uuid.wks"
+# meta-ti-bsp layer conf does break expectations wrt common folders
+# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti"
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy" \ No newline at end of file
diff --git a/meta-agl-bsp/conf/include/agl_beagleplay.inc b/meta-agl-bsp/conf/include/agl_beagleplay.inc
new file mode 100644
index 000000000..77b669bb7
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_beagleplay.inc
@@ -0,0 +1,6 @@
+# beagleplay has a k3r5 BBMULTICONFIG to build its bootloader
+# and firmware, need to use an override to set DEFAULTTUNE back to
+# what that machine configuration needs.
+DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf"
+
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy"
diff --git a/meta-agl-bsp/conf/include/agl_cubox-i.inc b/meta-agl-bsp/conf/include/agl_cubox-i.inc
new file mode 100644
index 000000000..ee5e759e4
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_cubox-i.inc
@@ -0,0 +1,15 @@
+require agl_imx6-common.inc
+
+# Force use of the community supported LTS kernel instead of the
+# default linux-fslc
+PREFERRED_PROVIDER_virtual/kernel = "linux-fslc-lts"
+
+# Include devicetrees for SOM 1.5 and Hummingboard 2 hardware
+KERNEL_DEVICETREE:append = " \
+ imx6dl-hummingboard-som-v15.dtb \
+ imx6q-hummingboard-som-v15.dtb \
+ imx6dl-hummingboard2.dtb \
+ imx6q-hummingboard2.dtb \
+ imx6dl-hummingboard2-som-v15.dtb \
+ imx6q-hummingboard2-som-v15.dtb \
+"
diff --git a/meta-agl-bsp/conf/include/agl_cyclone5.inc b/meta-agl-bsp/conf/include/agl_cyclone5.inc
index 8accf7dca..3f12a2a92 100644
--- a/meta-agl-bsp/conf/include/agl_cyclone5.inc
+++ b/meta-agl-bsp/conf/include/agl_cyclone5.inc
@@ -1,5 +1,7 @@
OSTREE_BOOTLOADER ?= "u-boot"
# DEFAULTTUNE for cortex-a9
-DISTRO_FEATURES_append = " agl-medium-arm-compiler"
+DISTRO_FEATURES:append = " agl-medium-arm-compiler"
+# Use the AGL default ext4.xz to generate the rpi-sdimg
+SDIMG_ROOTFS_TYPE = "ext4.xz"
diff --git a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc b/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
deleted file mode 100644
index f3abe4cc5..000000000
--- a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-
-#-------------------------------------------------
-## Graphics section ##
-#-------------------------------------------------
-PACKAGES_GFX_${MACHINE} = "omapdrm-pvr"
-
-# Enable Gfx Pkgs
-MACHINE_FEATURES_append = " sgx"
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-DEPENDS_remove = "virtual/libgl"
-
-# Preferred providers
-PREFERRED_PROVIDER_virtual/libgles1 = ""
-PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
-PREFERRED_PROVIDER_virtual/egl = "ti-sgx-ddk-um"
-PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
-PREFERRED_PROVIDER_libgbm = "libgbm"
-
-#Preferred versions
-PREFERRED_VERSION_libgbm = "10.0.0"
-
-#-------------------------------------------------
-## Multimedia section ##
-#-------------------------------------------------
-
-GSTREAMER_PLUGINS = " \
- gstreamer1.0-plugins-bad-meta \
- gstreamer1.0-plugins-ducati \
- gstreamer1.0-plugins-vpe \
-"
-
-PACKAGES_MULTIMEDIA = " \
- ipumm-fw \
- pulseaudio-misc \
- ${GSTREAMER_PLUGINS} \
-"
-
-PREFERRED_VERSION_ipumm-fw = "3.00.13.00"
-
-PREFERRED_PROVIDER_virtual/kernel = "linux-ti-staging"
-PREFERRED_VERSION_virtual/kernel = "4.9"
-
-# Distribution-specific runtime components
-IMAGE_INSTALL_append = " \
- ${PACKAGES_GFX} \
- ${PACKAGES_MULTIMEDIA} \
- cmem \
-"
diff --git a/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc b/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc
deleted file mode 100644
index f74d703fa..000000000
--- a/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-# Install 96boards-tools for resizing partition
-IMAGE_INSTALL_append = " 96boards-tools"
diff --git a/meta-agl-bsp/conf/include/agl_ebisu.inc b/meta-agl-bsp/conf/include/agl_ebisu.inc
new file mode 100644
index 000000000..d684f814d
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_ebisu.inc
@@ -0,0 +1,13 @@
+require conf/include/agl_rcar.inc
+SOC_FAMILY = "r8a77990"
+BOARD_NAME = "ebisu"
+
+DTB_SUFFIX = "r8a77990-ebisu"
+
+DISTRO_FEATURES:remove = " use_eva_pkg"
+
+# Configuration for USB 3.0
+MACHINE_FEATURES:append = " usb3"
+
+IMAGE_INSTALL:append = " gstreamer1.0-omx gstreamer1.0-plugin-vspfilter"
+IMAGE_INSTALL:append = " kernel-module-mmngr kernel-module-mmngrbuf kernel-module-uvcs-drv kernel-module-vspm-if"
diff --git a/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc b/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc
new file mode 100644
index 000000000..4ff103df8
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_h3-salvator-x-nogfx.inc
@@ -0,0 +1,9 @@
+require conf/include/agl_salvator-nogfx.inc
+SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3-salvator-x"
+
+DTB_SUFFIX = "r8a77951-salvator-xs"
+
+# do use software rendering to display the compositor
+# used for images w/o binary-only driver
+WESTON_USE_PIXMAN = "1"
diff --git a/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc b/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc
new file mode 100644
index 000000000..134b1dd1f
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc
@@ -0,0 +1,6 @@
+require conf/include/agl_salvator.inc
+SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3-salvator-x"
+
+DTB_SUFFIX = "r8a77951-salvator-xs"
+
diff --git a/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc b/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc
new file mode 100644
index 000000000..5f288fca5
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc
@@ -0,0 +1,25 @@
+require conf/include/agl_rcar-nogfx.inc
+SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3ulcb"
+
+DTB_SUFFIX = "r8a77951-ulcb"
+
+# Mask graphic Pkgs
+BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
+# Mask MMP recipes
+BBMASK += "kernel-module-uvcs-drv|omx-user-module"
+
+# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3
+# when building without the proprietary driver stack. Masking out the
+# weston_%.bbappend seems the simplest approach for now, as forcing
+# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to
+# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due
+# to that being a component specific to the proprietary stack we are
+# explicitly disabling. If the "libgbm" usage in the bbappend was
+# instead "virtual/libgbm" as is now used in poky, it might be possible
+# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa".
+BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend"
+
+# do use software rendering to display the compositor
+# used for images w/o binary-only driver
+WESTON_USE_PIXMAN = "1"
diff --git a/meta-agl-bsp/conf/include/agl_h3ulcb.inc b/meta-agl-bsp/conf/include/agl_h3ulcb.inc
index 7cafb833e..b958d767c 100644
--- a/meta-agl-bsp/conf/include/agl_h3ulcb.inc
+++ b/meta-agl-bsp/conf/include/agl_h3ulcb.inc
@@ -1,51 +1,6 @@
+require conf/include/agl_rcar.inc
SOC_FAMILY = "r8a7795"
+BOARD_NAME = "h3ulcb"
-# for Wayland/Weston weston-laucher
-DISTRO_FEATURES_append = " pam"
-
-# Enable Gfx Pkgs
-MACHINE_FEATURES_append = " gsx"
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-# for Wayland/Weston
-PREFERRED_PROVIDER_virtual/libgles1 = ""
-PREFERRED_PROVIDER_virtual/libgles2 = "gles-user-module"
-PREFERRED_PROVIDER_virtual/egl = "gles-user-module"
-PREFERRED_PROVIDER_virtual/libgl = ""
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_libgbm = "libgbm"
-PREFERRED_RPROVIDER_libgbm-dev = "libgbm"
-
-# Mask the gstreamer recipe for MMP
-BBMASK = "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer"
-
-# Add for gstreamer plugins ugly
-LICENSE_FLAGS_WHITELIST = "commercial"
-
-PREFERRED_VERSION_gstreamer1.0 = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-libav = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-vspfilter = "1.0%"
-
-MACHINE_FEATURES_append = " multimedia"
-
-DISTRO_FEATURES_append = " use_eva_pkg"
-
-#DISTRO_FEATURES_append = " h265dec_lib mpeg2dec_lib"
-DISTRO_FEATURES_append = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw"
-
-DISTRO_FEATURES_BACKFILL_remove = "gobject-introspection-data"
-
-IMAGE_INSTALL_append_rcar-gen3 = " \
- kernel-module-pvrsrvkm \
- kernel-module-vsp2 \
- kernel-module-vspm-if \
- omx-user-module \
- weston-bin \
-"
-
-BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/"
-OSTREE_BOOTLOADER ?= "u-boot"
+#ws2.0
+DTB_SUFFIX = "r8a77951-ulcb"
diff --git a/meta-agl-bsp/conf/include/agl_imx-common.inc b/meta-agl-bsp/conf/include/agl_imx-common.inc
new file mode 100644
index 000000000..b58a99589
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx-common.inc
@@ -0,0 +1,8 @@
+# Disable meta-freescale package architecure mangling, as it causes
+# issues with AGL's explicit setting of DEFAULTTUNE.
+INHERIT:remove = "fsl-dynamic-packagearch"
+MACHINE_SOCARCH = "${TUNE_PKGARCH}"
+
+# Disable the meta-freescale weston-init bbappend as it conflicts
+# with AGL's.
+BBMASK += "meta-freescale/recipes-graphics/wayland/weston-init"
diff --git a/meta-agl-bsp/conf/include/agl_imx6-common.inc b/meta-agl-bsp/conf/include/agl_imx6-common.inc
new file mode 100644
index 000000000..7b22282dd
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx6-common.inc
@@ -0,0 +1,14 @@
+require agl_imx-common.inc
+
+DISTRO_FEATURES:append = " agl-medium-arm-compiler"
+
+# This disables the Freescale/NXP Vivante GPU driver and enables
+# etnaviv support. This is the default for the i.MX6 platforms in
+# meta-freescale, but not for all the ones in meta-freescale-3rdparty,
+# so set it here to give a consistent default.
+IMX_DEFAULT_BSP = "mainline"
+
+# Set CMA size large enough to work with AGL
+UBOOT_EXTLINUX_KERNEL_ARGS:append = " cma=512M"
+
+AGL_DEFAULT_INITRAMFS_FSTYPES := ""
diff --git a/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc b/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc
new file mode 100644
index 000000000..f058ba1a5
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx6qdlsabreauto.inc
@@ -0,0 +1,5 @@
+require agl_imx6-common.inc
+
+# Force use of the community supported LTS kernel instead of the
+# default linux-fslc
+IMX_DEFAULT_KERNEL:imx6qdlsabreauto = "linux-fslc-lts"
diff --git a/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc b/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc
deleted file mode 100644
index 74879dbbf..000000000
--- a/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc
+++ /dev/null
@@ -1,35 +0,0 @@
-# Caution: Hand-merge needed when original recipes are updated
-#
-# Here we only have selected lines from the following (and
-# their included) files
-#
-# fslc-wayland.conf
-# fsl-image-multimedia-full.bb
-#
-
-# fslc-wayland.conf
-
-#
-# Followings were intentionally removed from the original recipe
-# to make our set simpler
-#
-# gtk+3-demo clutter-1.0-examples
-#
-
-IMAGE_INSTALL_append = " \
- packagegroup-fsl-tools-gpu \
- packagegroup-fsl-gstreamer1.0 \
- packagegroup-imx-tools-audio \
- weston weston-init weston-examples \
-"
-
-# fsl-image-multimedia-full.bb
-
-IMAGE_INSTALL_append = " \
- packagegroup-fsl-gstreamer1.0-full \
-"
-
-# fix build error
-
-SECURITY_CFLAGS_pn-devil = "${SECURITY_NO_PIE_CFLAGS}"
-
diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc
new file mode 100644
index 000000000..b3faadd0a
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk-common.inc
@@ -0,0 +1,8 @@
+require agl_imx-common.inc
+
+# Add helper to drive setting up HCI UART device
+# NOTE: Disabled 2023/05 due to kernel oops, further investigation
+# required, see SPEC-4807 in JIRA.
+#MACHINE_EXTRA_RRECOMMENDS:append = " hci-uart-helper"
+
+AGL_DEFAULT_INITRAMFS_FSTYPES := ""
diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc
new file mode 100644
index 000000000..3988fcd6f
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc
@@ -0,0 +1,8 @@
+require agl_imx8mq-evk-common.inc
+
+IMX_DEFAULT_BSP = "nxp"
+
+# NOTE:
+# There is some potential benefit to using the community supported
+# linux-fslc-imx hybrid kernel here, but keeping the configuration
+# close to upstream to ease maintenance seems worthwhile.
diff --git a/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc b/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc
new file mode 100644
index 000000000..620ee0fdd
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc
@@ -0,0 +1,23 @@
+require agl_imx8mq-evk-common.inc
+
+# NOTE:
+# Currently using the upstream default of IMX_DEFAULT_BSP = "mainline",
+# since we want to use the etnaviv driver and upstream Mesa + weston
+# stack. More tweaks are required to accomplish that if the BSP is set
+# to "nxp".
+
+# Force use of the community supported hybrid NXP/LTS kernel instead of
+# the default linux-fslc. This is required to get the drivers required
+# for HDMI output.
+IMX_DEFAULT_KERNEL:imx8mq-evk = "linux-fslc-imx"
+
+# Tweaks to allow using linux-fslc-imx on its own without the whole
+# NXP BSP. Just the DISTROOVERRIDES change on its own is not enough,
+# as COMPATIBLE_MACHINE is evaluated early enough that the recipe is
+# not seen as compatible without an explicit override.
+COMPATIBLE_MACHINE:pn-linux-fslc-imx = "(imx8mq-evk)"
+DISTROOVERRIDES:pn-linux-fslc-imx:append = "mx8-nxp-bsp"
+
+# Add our own over-ride for use in a few recipes where there is
+# conflicting Vivante vs etnaviv configuration.
+MACHINEOVERRIDES .= ":etnaviv"
diff --git a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc b/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
deleted file mode 100644
index c31ac2759..000000000
--- a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-# Configurations to run on VirtualBox/VMWare
-#
-# To get wide screen than default, there are a selection of resolutions
-# available:
-#
-#APPEND += "uvesafb.mode_option=1024x768-32"
-#APPEND += "uvesafb.mode_option=1280x1024-32"
-#APPEND += "uvesafb.mode_option=1600x1200-32"
-#
-# To avoid corrupt boot screen by systemd message, you can use serial
-# console separated from VGA console or disable all boot messages by
-# kernel command line.
-#
-# Configuration for serial console
-APPEND += "console=ttyS0,115200n8 reboot=efi"
-#
-# All boot message will be off
-#APPEND += "quiet"
-
-# Enable Libvaapi for HW accelerated video support
-#
-IMAGE_INSTALL_append = " \
- libva \
- va-intel \
- gstreamer-vaapi-1.0 "
diff --git a/meta-agl-bsp/conf/include/agl_j721e-evm.inc b/meta-agl-bsp/conf/include/agl_j721e-evm.inc
new file mode 100644
index 000000000..963b5697d
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_j721e-evm.inc
@@ -0,0 +1,11 @@
+# j721e-evm has a k3r5 BBMULTICONFIG to build its bootloader
+# firmware, need to use an override to set DEFAULTTUNE back to
+# what that machine configuration needs.
+DEFAULTTUNE:k3r5:forcedefaulttune = "armv7athf"
+
+# Workaround for recipe assumption of poky location
+LIC_FILES_CHKSUM:pn-ti-rtos-firmware = "file://${THISDIR}/../../licenses/TI-TFL;md5=a1b59cb7ba626b9dbbcbf00f3fbc438a"
+
+# meta-ti-bsp layer conf does break expectations wrt common folders
+# meta-ti-bsp/conf/layer.conf:TI_COMMON_DEPLOY ?= "${TOPDIR}/deploy-ti"
+TI_COMMON_DEPLOY := "${TMPDIR}/deploy" \ No newline at end of file
diff --git a/meta-agl-bsp/conf/include/agl_joule.inc b/meta-agl-bsp/conf/include/agl_joule.inc
deleted file mode 100644
index 212cb15af..000000000
--- a/meta-agl-bsp/conf/include/agl_joule.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-INTEL_MACHINE_SUBTYPE = "broxton-m"
-PREFERRED_VERSION_linux-yocto_intel-corei7-64 ?= "4.4%"
-
-APPEND += "console=ttyS2,115200n8 video=efifb maxcpus=4 noxsave reboot=efi kmemleak=off"
-
-IMAGE_INSTALL_append = " linux-firmware-iwlwifi-8000c linux-firmware-ibt-11-5"
-IMAGE_INSTALL_append = " \
- libva \
- va-intel \
- gstreamer-vaapi-1.0 "
-OSTREE_BOOTLOADER ?= "u-boot"
diff --git a/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc b/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc
new file mode 100644
index 000000000..ebbb3006a
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_m3-salvator-x-nogfx.inc
@@ -0,0 +1,6 @@
+require conf/include/agl_salvator-nogfx.inc
+SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3-salvator-x"
+
+DTB_SUFFIX = "r8a7796-salvator-xs"
+
diff --git a/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc b/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc
new file mode 100644
index 000000000..355040ba9
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc
@@ -0,0 +1,6 @@
+require conf/include/agl_salvator.inc
+SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3-salvator-x"
+
+DTB_SUFFIX = "r8a7796-salvator-xs"
+
diff --git a/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc b/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc
index f1f9b87fd..31d99c342 100644
--- a/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc
+++ b/meta-agl-bsp/conf/include/agl_m3ulcb-nogfx.inc
@@ -1,16 +1,28 @@
+require conf/include/agl_rcar-nogfx.inc
SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3ulcb"
-IMAGE_INSTALL_append = " \
- weston-bin \
-"
+DTB_SUFFIX = "r8a77960-ulcb"
# Mask graphic Pkgs
-BBMASK = "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
+BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
# Mask MMP recipes
-BBMASK .= "|kernel-module-uvcs-drv|omx-user-module"
+BBMASK += "kernel-module-uvcs-drv|omx-user-module"
-BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/"
+# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3
+# when building without the proprietary driver stack. Masking out the
+# weston_%.bbappend seems the simplest approach for now, as forcing
+# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to
+# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due
+# to that being a component specific to the proprietary stack we are
+# explicitly disabling. If the "libgbm" usage in the bbappend was
+# instead "virtual/libgbm" as is now used in poky, it might be possible
+# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa".
+BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend"
-OSTREE_KERNEL = "Image"
-IMAGE_BOOT_FILES_sota = "m3ulcb-ota-bootfiles/* Image-r8a7796-m3ulcb.dtb"
-OSTREE_BOOTLOADER ?= "u-boot"
+# do use software rendering to display the compositor
+# used for images w/o binary-only driver
+WESTON_USE_PIXMAN = "1"
+
+DISTRO_FEATURES:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}"
+IMAGE_INSTALL:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}"
diff --git a/meta-agl-bsp/conf/include/agl_m3ulcb.inc b/meta-agl-bsp/conf/include/agl_m3ulcb.inc
index 9b9bc7548..4f788324c 100644
--- a/meta-agl-bsp/conf/include/agl_m3ulcb.inc
+++ b/meta-agl-bsp/conf/include/agl_m3ulcb.inc
@@ -1,54 +1,8 @@
+require conf/include/agl_rcar.inc
SOC_FAMILY = "r8a7796"
+BOARD_NAME = "m3ulcb"
-# for Wayland/Weston weston-laucher
-DISTRO_FEATURES_append = " pam"
+DTB_SUFFIX = "r8a77960-ulcb"
-# Enable Gfx Pkgs
-MACHINE_FEATURES_append = " gsx"
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-# for Wayland/Weston
-PREFERRED_PROVIDER_virtual/libgles1 = ""
-PREFERRED_PROVIDER_virtual/libgles2 = "gles-user-module"
-PREFERRED_PROVIDER_virtual/egl = "gles-user-module"
-PREFERRED_PROVIDER_virtual/libgl = ""
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_libgbm = "libgbm"
-PREFERRED_RPROVIDER_libgbm-dev = "libgbm"
-
-# Mask the gstreamer recipe for MMP
-BBMASK = "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer"
-
-# Add for gstreamer plugins ugly
-LICENSE_FLAGS_WHITELIST = "commercial"
-
-PREFERRED_VERSION_gstreamer1.0 = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-libav = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-base = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-bad = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-good = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-ugly = "1.6.3"
-PREFERRED_VERSION_gstreamer1.0-plugins-vspfilter = "1.0%"
-
-MACHINE_FEATURES_append = " multimedia"
-
-DISTRO_FEATURES_append = " use_eva_pkg"
-
-#DISTRO_FEATURES_append = " h265dec_lib mpeg2dec_lib"
-DISTRO_FEATURES_append = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw"
-
-DISTRO_FEATURES_BACKFILL_remove = "gobject-introspection-data"
-
-IMAGE_INSTALL_append_rcar-gen3 = " \
- kernel-module-pvrsrvkm \
- kernel-module-vsp2 \
- kernel-module-vspm-if \
- omx-user-module \
- weston-bin \
-"
-
-BBMASK .= "|meta-renesas-rcar-gen3/meta-rcar-gen3/recipes-forward-port/"
-
-OSTREE_KERNEL = "Image"
-IMAGE_BOOT_FILES_sota = "m3ulcb-ota-bootfiles/* Image-r8a7796-m3ulcb.dtb"
-OSTREE_BOOTLOADER ?= "u-boot"
+DISTRO_FEATURES:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}"
+IMAGE_INSTALL:append = "${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen-base xen-mkimage', '', d)}"
diff --git a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc b/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
deleted file mode 100644
index cb7b4a560..000000000
--- a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-MACHINE = "porter"
-
-# For Bluetooth hardware support
-BT_KERNEL_MODULES = " \
- kernel-module-btusb \
- kernel-module-bnep \
- kernel-module-rfcomm \
- kernel-module-rfkill \
- "
-
-# Distribution-specific runtime components
-IMAGE_INSTALL_append = " \
- ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "${BT_KERNEL_MODULES}", "", d)} \
- "
-
-# Setting for u-boot Wayland
-UBOOT_MACHINE = "porter_vin_config"
-
-PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
-PREFERRED_PROVIDER_virtual/egl = "mesa"
-
-# Build updatable image. Only takes effect when sota.bbclass is inherited
-DISTRO_FEATURES_append = " sota"
-
diff --git a/meta-agl-bsp/conf/include/agl_porter.inc b/meta-agl-bsp/conf/include/agl_porter.inc
deleted file mode 100644
index 06dcb8e51..000000000
--- a/meta-agl-bsp/conf/include/agl_porter.inc
+++ /dev/null
@@ -1,183 +0,0 @@
-
-# For running GStreamer on wayland (experimental).
-#
-# Uncoment below if want to use multimedia acceleration on wayland
-#
-IMAGE_INSTALL_append_porter = " \
- gstreamer1.0-plugins-bad-waylandsink \
- "
-
-# Additional plugins to test multimedia acceleration (experimental)
-#
-# Uncoment below if want to use multimedia acceleration
-#
-IMAGE_INSTALL_append_porter = " \
- gstreamer1.0-plugins-base-videorate \
- gstreamer1.0-plugins-base-videotestsrc \
- gstreamer1.0-plugins-base-audiotestsrc \
- gstreamer1.0-plugins-base-alsa \
- gstreamer1.0-plugins-good-autodetect \
- gstreamer1.0-plugins-good-isomp4 \
- gstreamer1.0-plugins-good-videocrop \
- gstreamer1.0-plugins-bad-asfmux \
- gstreamer1.0-plugins-bad-fbdevsink \
- gstreamer1.0-plugins-bad-faad \
- gstreamer1.0-plugins-bad-videoparsersbad \
-"
-# gstreamer1.0-plugins-good-video4linux2 (temp disabled)
-
-# for graphics acceleration
-#
-# Uncoment below if want to use multimedia acceleration
-#
-IMAGE_INSTALL_append_porter = " \
- libegl libegl-dev libgbm-dev \
- gles-kernel-module gles-user-module \
- libdrm-tests \
- libdrm-kms \
- "
-
-# for multimedia acceleration
-#
-# Uncoment below if want to use multimedia acceleration
-#
-IMAGE_INSTALL_append_porter = " \
- packagegroup-rcar-gen2-multimedia \
- packagegroup-lcb-oss-codecs \
- alsa-utils alsa-utils-config alsa-tools \
-"
-
-IMAGE_INSTALL_append_porter = " \
- gles-kernel-module \
- libegl \
- libgbm-dev \
- "
-
-# For Bluetooth hardware support
-BT_KERNEL_MODULES = " \
- kernel-module-btusb \
- kernel-module-bnep \
- kernel-module-rfcomm \
- kernel-module-rfkill \
- "
-
-# Distribution-specific runtime components
-IMAGE_INSTALL_append = " \
- ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "${BT_KERNEL_MODULES}", "", d)} \
- "
-
-# TODO: When booting weston, someone try to load 'libgbm_kms.so' then
-# fail to boot. It should be 'libgbm_kms.so.1'.
-# Tentatively, it is to install 'libgbm-dev' pkg.
-#IMAGE_INSTALL_append = "libgbm-dev"
-# this is not recommended and should be done in the recipe requiring this module (gles-user-module)
-
-LICENSE_FLAGS_WHITELIST = "commercial"
-
-# Define the name of multimedia, dtv, graphic test, multimedia-test for bbmask
-BB_MULTIMEDIA_KERNEL_MODULE = "fdpm-kernel-module|mmngr-kernel-module|mmngrbuf-kernel-module|s3ctl-kernel-module|uvcs-kernel-module|vspm-kernel-module"
-BB_MULTIMEDIA_USER_MODULE = "fdpm-user-module|mmngr-user-module|mmngrbuf-user-module|omx-user-module|s3ctl-user-module|vspm-user-module|libmemcpy"
-BB_MULTIMEDIA_TEST_MODULE = "fdpm-tp-user-module|mmngr-tp-user-module|mmngrbuf-tp-user-module|s3ctl-tp-user-module|vspm-tp-user-module"
-
-BB_GST_PLUGINS = "meta-renesas/meta-rcar-gen2/recipes-multimedia/gstreamer"
-MULTIMEDIA_BB = "${BB_MULTIMEDIA_KERNEL_MODULE}|${BB_MULTIMEDIA_USER_MODULE}|\
- ${BB_MULTIMEDIA_TEST_MODULE}|${BB_GST_PLUGINS}"
-
-# Enable Multimedia standard pkg
-MACHINE_FEATURES_append = " multimedia"
-
-# UnMask the multimedia kernel modules
-#BBMASK .= "|${BB_MULTIMEDIA_KERNEL_MODULE}"
-
-# UnMask the multimedia user modules
-#BBMASK .= "|${BB_MULTIMEDIA_USER_MODULE}"
-
-# Include static library in SDK
-SDKIMAGE_FEATURES_append = " staticdev-pkgs"
-
-# Mask the DTV pkgs
-#MACHINE_FEATURES_append = " dtv"
-BBMASK = "dtv-module|ssp-module|scu-module"
-
-# Enable graphic pkgs
-#BBMASK .= "|gles-kernel-module|gles-user-module"
-
-# Mask the multimedia-test
-BBMASK .= "|${BB_MULTIMEDIA_TEST_MODULE}"
-
-# Mask the graphic test
-BBMASK .= "|gles-test-module"
-
-#DISTRO_FEATURES_append = " mm-test"
-#DISTRO_FEATURES_append = " gles-test"
-
-# Enable Gfx Pkgs
-MACHINE_FEATURES_append = " sgx"
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-# for Wayland/Weston
-
-PREFERRED_PROVIDER_virtual/libgles1 = ""
-PREFERRED_PROVIDER_virtual/libgles2 = "gles-user-module"
-PREFERRED_PROVIDER_virtual/egl = "libegl"
-PREFERRED_PROVIDER_virtual/libgl = ""
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_libgbm = "libgbm"
-PREFERRED_RPROVIDER_libgbm-dev = "libgbm"
-
-# Setting for u-boot Wayland
-UBOOT_MACHINE = "porter_vin_config"
-
-# Addtional Configurations of Optional OMX modules
-
-# OMX Media Component H263 Decoder Library
-#DISTRO_FEATURES_append = " h263dec_lib"
-# OMX Media Component VC-1 Decoder Library
-#DISTRO_FEATURES_append = " vc1dec_lib"
-# OMX Media Component MPEG-4 Decoder Library
-#DISTRO_FEATURES_append = " mpeg4dec_lib"
-# VCP3 Driver Adapted for Linux MPEG-2 Decoder Library
-#DISTRO_FEATURES_append = " mpeg2dec_lib"
-# DivX Decoder Library for Linux
-#DISTRO_FEATURES_append = " divxdec_lib"
-# Encoder Library for Linux
-DISTRO_FEATURES_append = " h264avcenc_lib"
-
-# Configurations of Optional Audio Decoders
-# ARM 5.1ch aacPlus V2 Decoder for Linux
-#DISTRO_FEATURES_append = " aacp2dec_lib"
-# ARM MP3 Decoder for Linux
-#DISTRO_FEATURES_append = " mp3dec_lib"
-# ARM WMA Decoder for Linux
-#DISTRO_FEATURES_append = " wmadec_lib"
-# ARM 5.1ch Dolby Digital Decoder for Linux
-#DISTRO_FEATURES_append = " ddddec_lib"
-# ARM ALAC Decoder for Linux
-#DISTRO_FEATURES_append = " alacdec_lib"
-# ARM FLAC Decoder for Linux
-#DISTRO_FEATURES_append = " flacdec_lib"
-# ARM AAC-LC Decoder Library Sample for Linux
-#DISTRO_FEATURES_append = " aaclcsdec_lib"
-# ARM AAC Encoder for Linux
-#DISTRO_FEATURES_append = " aacenc_lib"
-
-# Configurations of Optional Audio Middlewares
-# ARM 5.1ch aacPlus V2 Decode Middleware for Linux
-#DISTRO_FEATURES_append = " armaccp2dec_mdw"
-# ARM MP3 Decode Middleware for Linux
-#DISTRO_FEATURES_append = " mp3dec_mdw"
-# ARM WMA Decode Middleware for Linux
-#DISTRO_FEATURES_append = " wmadec_mdw"
-# ARM 5.1ch Dolby Digital Decode Middleware for Linux
-#DISTRO_FEATURES_append = " ddddec_mdw"
-# ARM ALAC Decode Middleware for Linux
-#DISTRO_FEATURES_append = " alacdec_mdw"
-# ARM FLAC Decode Middleware for Linux
-#DISTRO_FEATURES_append = " flacdec_mdw"
-# ARM AAC Decode Middleware Sample for Linux
-#DISTRO_FEATURES_append = " aacsdec_mdw"
-# ARM AAC Encode Middleware for Linux
-#DISTRO_FEATURES_append = " aacenc_mdw"
-
-# Build updatable image. Only takes effect when sota.bbclass is inherited
-DISTRO_FEATURES_append = " sota"
diff --git a/meta-agl-bsp/conf/include/agl_qemuarm.inc b/meta-agl-bsp/conf/include/agl_qemuarm.inc
new file mode 100644
index 000000000..2449e1800
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_qemuarm.inc
@@ -0,0 +1,20 @@
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+#DISTRO_FEATURES:append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
+
+# Use pixman as software renderer to avoid high cpu consumption by GL-renderer
+WESTON_USE_PIXMAN = "1"
+
+# Over-ride setting in oe-core's qemuboot.bbclass
+QB_MEM:qemuarm = "-m 2048"
+
+# Changes to make runqemu work out-of-the-box
+QB_AUDIO_DRV:qemuarm := "alsa"
+QB_MACHINE:qemuarm := "-machine virt-2.11 -smp 4"
+QB_OPT_APPEND:qemuarm := "-show-cursor -device VGA,vgamem_mb=64,edid=on -device qemu-xhci -device usb-tablet -device usb-kbd -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
+QB_KERNEL_CMDLINE_APPEND:qemuarm := "console=ttyAMA0 verbose vmalloc=256M"
diff --git a/meta-agl-bsp/conf/include/agl_qemuarm64.inc b/meta-agl-bsp/conf/include/agl_qemuarm64.inc
new file mode 100644
index 000000000..46d3b4c39
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_qemuarm64.inc
@@ -0,0 +1,20 @@
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+#DISTRO_FEATURES:append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
+
+# Use pixman as software renderer to avoid high cpu consumption by GL-renderer
+WESTON_USE_PIXMAN = "1"
+
+# Over-ride setting in oe-core's qemuboot.bbclass
+QB_MEM:qemuarm64 = "-m 2048"
+
+# Changes to make runqemu work out-of-the-box
+QB_AUDIO_DRV:qemuarm64 := "alsa"
+QB_MACHINE:qemuarm64 := "-machine virt -smp 4"
+QB_OPT_APPEND:qemuarm64 := " -show-cursor -device VGA,vgamem_mb=64,edid=on -device qemu-xhci -device usb-tablet -device usb-kbd -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
+QB_KERNEL_CMDLINE_APPEND:qemuarm64 := "console=ttyAMA0,115200n8 verbose" \ No newline at end of file
diff --git a/meta-agl-bsp/conf/include/agl_qemuriscv64.inc b/meta-agl-bsp/conf/include/agl_qemuriscv64.inc
new file mode 100644
index 000000000..1ffc3cf0e
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_qemuriscv64.inc
@@ -0,0 +1,11 @@
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES:append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Over-ride setting in oe-core's qemuriscv64.conf
+QB_MEM:qemuriscv64 = "-m 2048"
+
+# Use our own wks file
+WKS_FILE="directdisk.wks.in"
diff --git a/meta-agl-bsp/conf/include/agl_qemux86-64.inc b/meta-agl-bsp/conf/include/agl_qemux86-64.inc
index f058c6bfc..cb40b8b37 100644
--- a/meta-agl-bsp/conf/include/agl_qemux86-64.inc
+++ b/meta-agl-bsp/conf/include/agl_qemux86-64.inc
@@ -1,23 +1,50 @@
-
# Configurations to run on VirtualBox/VMWare
#
# To get wide screen than default, there are a selection of resolutions
# available:
#
-#APPEND += "uvesafb.mode_option=1024x768-32"
-APPEND += "uvesafb.mode_option=1280x1024-32"
-#APPEND += "uvesafb.mode_option=1600x1200-32"
+#UVESA_MODE = "1024x768-32"
+UVESA_MODE = "1280x1024-32"
+#UVESA_MODE = "1600x1200-32"
#
# To avoid corrupt boot screen by systemd message, you can use serial
# console separated from VGA console or disable all boot messages by
# kernel command line.
#
# Configuration for serial console
-APPEND += "console=ttyS0,115200n8"
+QB_KERNEL_CMDLINE_APPEND:append = " console=ttyS0,115200n8"
#
# All boot message will be off
-APPEND += "quiet"
+QB_KERNEL_CMDLINE_APPEND:append = " quiet"
# Build updatable image. Only takes effect when sota.bbclass is inherited
-DISTRO_FEATURES_append = " sota"
+DISTRO_FEATURES:append = " sota"
+
+# Add firmware required by Up^2 board and default Intel mPCIe wifi card
+# sold by upshop.org
+MACHINE_EXTRA_RRECOMMENDS:append = " \
+ linux-firmware-i915 \
+ linux-firmware-rtl8168 \
+ linux-firmware-ibt-hw-37-8 \
+ linux-firmware-iwlwifi-7265d \
+ wireless-regdb-static \
+"
+
+# Image support
+# NOTE: wic.{xz,bmap} are here since qemu targets override
+# AGL_DEFAULT_IMAGE_FSTYPES to not include them, but for Intel
+# we actually do want them for use on physical hardware.
+AGL_EXTRA_IMAGE_FSTYPES = "wic.xz wic.bmap ${@bb.utils.contains('AGL_FEATURES', 'AGLCI', 'wic.vmdk.xz', 'wic.vmdk', d)}"
+IMAGE_BOOT_FILES:sota = "u-boot-qemux86-64.rom"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Force the virtio video device as 'vmware' doesn't always work
+QB_OPT_APPEND:append = " -vga virtio"
+
+# DRM device weston/compositor systemd unit should depend upon
+WESTON_DRM_DEVICE = "dev-dri-card0.device"
+# Use our own wks file
+WKS_FILE="systemd-intel-corei7-64-bootdisk.wks"
diff --git a/meta-agl-bsp/conf/include/agl_qemux86.inc b/meta-agl-bsp/conf/include/agl_qemux86.inc
deleted file mode 100644
index ae284b3f7..000000000
--- a/meta-agl-bsp/conf/include/agl_qemux86.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-
-# Configurations to run on VirtualBox/VMWare
-#
-# To get wide screen than default, there are a selection of resolutions
-# available:
-#
-#APPEND += "uvesafb.mode_option=1024x768-32"
-APPEND += "uvesafb.mode_option=1280x1024-32"
-#APPEND += "uvesafb.mode_option=1600x1200-32"
-#
-# To avoid corrupt boot screen by systemd message, you can use serial
-# console separated from VGA console or disable all boot messages by
-# kernel command line.
-#
-# Configuration for serial console
-APPEND += "console=ttyS0,115200n8"
-#
-# All boot message will be off
-APPEND += "quiet"
-
-# U-Boot support for SOTA
-PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota"
-UBOOT_MACHINE_sota = "qemu-x86_defconfig"
-OSTREE_BOOTLOADER ?= "u-boot"
-OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda"
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc b/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
deleted file mode 100644
index 2cd9ec2a9..000000000
--- a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-# Maximum memory allowed to be assigned
-GPU_MEM = "255"
-
-ENABLE_CMA = "1"
-CMA_LWM = "16"
-CMA_HWM = "32"
-
-CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
-
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-KERNEL_IMAGETYPE = "Image"
-KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb"
-PREFERRED_VERSION_linux-raspberrypi = "4.4.%"
-PREFERRED_VERSION_mesa = "12.%"
-
-PREFERRED_PROVIDER_virtual/egl = "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
-PREFERRED_PROVIDER_virtual/libgl = "mesa"
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_jpeg = "jpeg"
-
-MACHINE_FEATURES += "vc4graphics"
-
-# For libomxil
-#LICENSE_FLAGS_WHITELIST = "commercial"
-
-IMAGE_INSTALL_append = " kernel-modules linux-firmware "
-
-# Psplash causes crash on first boot on RPi
-IMAGE_FEATURES_remove = "splash"
-
-# Build updatable image. Only takes effect when sota.bbclass is inherited
-DISTRO_FEATURES_append = " sota"
-
-# Add the custom rpi-sdimg output format
-AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz"
-
-# Use the AGL default ext4.xz to generate the rpi-sdimg
-SDIMG_ROOTFS_TYPE = "ext4.xz"
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc
deleted file mode 100644
index cfa36afed..000000000
--- a/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-# Maximum memory allowed to be assigned
-GPU_MEM = "255"
-
-ENABLE_CMA = "1"
-CMA_LWM = "16"
-CMA_HWM = "32"
-
-CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
-
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-KERNEL_IMAGETYPE = "Image"
-KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb"
-PREFERRED_VERSION_linux-raspberrypi = "4.9.%"
-PREFERRED_VERSION_mesa = "12.%"
-
-PREFERRED_PROVIDER_virtual/egl = "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
-PREFERRED_PROVIDER_virtual/libgl = "mesa"
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_jpeg = "jpeg"
-
-MACHINE_FEATURES += "vc4graphics"
-
-# For libomxil
-#LICENSE_FLAGS_WHITELIST = "commercial"
-
-IMAGE_INSTALL_append = " kernel-modules linux-firmware "
-
-# Psplash causes crash on first boot on RPi
-IMAGE_FEATURES_remove = "splash"
-
-# Add the custom rpi-sdimg output format
-AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz"
-
-# Use the AGL default ext4.xz to generate the rpi-sdimg
-SDIMG_ROOTFS_TYPE = "ext4.xz"
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
deleted file mode 100644
index 2cd9ec2a9..000000000
--- a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-# Maximum memory allowed to be assigned
-GPU_MEM = "255"
-
-ENABLE_CMA = "1"
-CMA_LWM = "16"
-CMA_HWM = "32"
-
-CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
-
-MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
-
-KERNEL_IMAGETYPE = "Image"
-KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb"
-PREFERRED_VERSION_linux-raspberrypi = "4.4.%"
-PREFERRED_VERSION_mesa = "12.%"
-
-PREFERRED_PROVIDER_virtual/egl = "mesa"
-PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
-PREFERRED_PROVIDER_virtual/libgl = "mesa"
-PREFERRED_PROVIDER_virtual/mesa = "mesa"
-PREFERRED_PROVIDER_jpeg = "jpeg"
-
-MACHINE_FEATURES += "vc4graphics"
-
-# For libomxil
-#LICENSE_FLAGS_WHITELIST = "commercial"
-
-IMAGE_INSTALL_append = " kernel-modules linux-firmware "
-
-# Psplash causes crash on first boot on RPi
-IMAGE_FEATURES_remove = "splash"
-
-# Build updatable image. Only takes effect when sota.bbclass is inherited
-DISTRO_FEATURES_append = " sota"
-
-# Add the custom rpi-sdimg output format
-AGL_EXTRA_IMAGE_FSTYPES_append = " rpi-sdimg.xz"
-
-# Use the AGL default ext4.xz to generate the rpi-sdimg
-SDIMG_ROOTFS_TYPE = "ext4.xz"
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi4.inc b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc
new file mode 100644
index 000000000..4ba7ff0f6
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc
@@ -0,0 +1,37 @@
+# Maximum memory allowed to be assigned
+GPU_MEM = "256"
+
+# Add CMA to the kernel arguments for SOTA
+OSTREE_KERNEL_ARGS:sota:append = " cma=256M"
+
+# use u-boot always
+RPI_USE_U_BOOT = "1"
+
+# Use UART for serial console
+ENABLE_UART ?= "1"
+
+# For libomxil
+#LICENSE_FLAGS_ACCEPTED += "commercial"
+
+# For linux-firmware-rpidistro
+LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch"
+
+IMAGE_INSTALL:append = " kernel-modules linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 create-combined-dtb "
+
+# Psplash causes crash on first boot on RPi
+IMAGE_FEATURES:remove = "splash"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES:append = " sota"
+
+# Add xen build, if the xen feature activated
+DISTRO_FEATURES:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}"
+
+# add xen-tools to build
+IMAGE_INSTALL:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', 'xen-tools xen-mkimage-rpi4', '', d)}"
+
+# Add xen-raspberry binary to boot files
+IMAGE_BOOT_FILES:append = " ${@bb.utils.contains('AGL_XEN_WANTED','1', 'xen-${MACHINE}', '',d)}"
+
+#DISPLAY CONFIGURATION
+WESTON_DISPLAYS:raspberrypi4 = " hdmi-a-1-90 hdmi-a-2-90"
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi5.inc b/meta-agl-bsp/conf/include/agl_raspberrypi5.inc
new file mode 100644
index 000000000..a0e675956
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_raspberrypi5.inc
@@ -0,0 +1,34 @@
+# Maximum memory allowed to be assigned
+GPU_MEM = "256"
+
+# Add CMA to the kernel arguments for SOTA
+OSTREE_KERNEL_ARGS:sota:append = " cma=256M"
+
+# use u-boot always (RPi5 U-boot is not ready yet)
+RPI_USE_U_BOOT = "0"
+
+# Use UART for serial console
+ENABLE_UART ?= "1"
+
+# For libomxil
+#LICENSE_FLAGS_ACCEPTED = "commercial"
+
+IMAGE_INSTALL:append = " kernel-modules linux-firmware-rpidistro-bcm43430 linux-firmware-rpidistro-bcm43455 create-combined-dtb "
+
+# Psplash causes crash on first boot on RPi
+IMAGE_FEATURES:remove = "splash"
+
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES:append = " sota"
+
+# Add xen build, if the xen feature activated
+DISTRO_FEATURES:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', ' xen', '', d)}"
+
+# add xen-tools to build
+IMAGE_INSTALL:append = " ${@bb.utils.contains('AGL_XEN_WANTED', '1', 'xen-tools xen-mkimage-rpi4', '', d)}"
+
+# Add xen-raspberry binary to boot files
+IMAGE_BOOT_FILES:append = " ${@bb.utils.contains('AGL_XEN_WANTED','1', 'xen-${MACHINE}', '',d)}"
+
+#DISPLAY CONFIGURATION
+WESTON_DISPLAYS:raspberrypi5 = " hdmi-a-1-90 hdmi-a-2-90"
diff --git a/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc b/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc
new file mode 100644
index 000000000..fb67fd976
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_rcar-nogfx.inc
@@ -0,0 +1,60 @@
+DISTRO_FEATURES:append = " sota"
+
+OSTREE_KERNEL = "Image"
+IMAGE_BOOT_FILES:sota = "renesas-ota-bootfiles/* ${DTB_SUFFIX}.dtb"
+OSTREE_BOOTLOADER ?= "u-boot"
+
+WKS_FILE:rcar-gen3 = "singlepart-noloader.wks"
+
+RENESAS_DATADIR = "/usr"
+
+IMAGE_INSTALL:append:rcar-gen3 = " \
+ kernel-devicetree \
+"
+
+#
+# Workaround to avoid pseudo aborts triggered by the kernel module
+# recipes writing to KERNELSRC in do_install, errors are of the form
+# (from pseudo.log):
+#
+# path mismatch [27 links]: ino 19366408 db 'NAMELESS FILE' req 'build/tmp/work-shared/h3ulcb/kernel-source/include'.
+#
+# See the commit messages in poky commits 4e7c211 and 3b7f2c6 and the
+# wiki page at:
+#
+# https://wiki.yoctoproject.org/wiki/Pseudo_Abort
+#
+# for details on the pseudo change. These can potentially be moved
+# to the recipes in the BSP, or removed if the recipes are changed to
+# shift the module headers and symbols to their dev packages.
+#
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-mch = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-mse = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-avb-streaming = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-scu-src = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-ssp = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-tddmac = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-tsif = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-mmngr = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-mmngrbuf = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-qos = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vsp2driver = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vspmif = ",${KERNELSRC}"
+PSEUDO_IGNORE_PATHS:append:pn-kernel-module-vspm = ",${KERNELSRC}"
+
+# Mask out base-files and systemd bbappends to avoid changing systemd-tmpfiles
+# behavior, see SPEC-4256 for a more involved explanation.
+BBMASK += "meta-renesas/meta-rcar-gen3/recipes-core/base-files/ meta-renesas/meta-rcar-gen3/recipes-core/systemd/"
+
+# Mask out cogl bbappend to avoid meta-gnome dependency
+BBMASK += "meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend"
+
+# Provide default value that avoids errors from a new packaging QA
+# check with respect to packagegroups depending on versioned library
+# packages needing to be machine-specific.
+#
+# Note that this needs to be done here in global configuration space as
+# opposed to in a bbappend because the value needs to be set before the
+# packagegroup bbclass is inherited. This can be removed when upstream
+# is fixed to add the required PACKAGE_ARCH = "${MACHINE_ARCH}".
+PACKAGE_ARCH:pn-packagegroup-multimedia-libs = "${MACHINE_ARCH}"
diff --git a/meta-agl-bsp/conf/include/agl_rcar.inc b/meta-agl-bsp/conf/include/agl_rcar.inc
new file mode 100644
index 000000000..01314f8c9
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_rcar.inc
@@ -0,0 +1,61 @@
+require conf/include/agl_rcar-nogfx.inc
+
+# Enable AGL virtualization features
+MACHINE_FEATURES:append:rcar-gen3 = " agl-egvirt"
+
+# Enable Gfx Pkgs
+MACHINE_FEATURES:append:rcar-gen3 = " gsx"
+BB_MULTI_PROVIDER_ALLOWED:append:rcar-gen3 = " virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
+
+# for Wayland/Weston
+PREFERRED_PROVIDER_virtual/libgles1:rcar-gen3 = ""
+PREFERRED_PROVIDER_virtual/libgles2:rcar-gen3 = "virtual-gles-user-module"
+PREFERRED_PROVIDER_virtual/egl:rcar-gen3 = "virtual-gles-user-module"
+PREFERRED_PROVIDER_virtual/libgl:rcar-gen3 = ""
+PREFERRED_PROVIDER_virtual/mesa:rcar-gen3 = "mesa"
+
+PREFERRED_PROVIDER_libgbm:rcar-gen3 = "libgbm"
+PREFERRED_PROVIDER_virtual/libgbm:rcar-gen3 = "libgbm"
+PREFERRED_RPROVIDER_libgbm-dev:rcar-gen3 = "libgbm"
+
+PREFERRED_RPROVIDER_libomxil:rcar-gen3 = "omx-user-module"
+PREFERRED_PROVIDER_virtual/libomxil:rcar-gen3 = "omx-user-module"
+VIRTUAL-RUNTIME_libomxil:rcar-gen3 = "omx-user-module"
+
+# Add for gstreamer plugins ugly
+LICENSE_FLAGS_ACCEPTED:rcar-gen3 = "commercial"
+
+MACHINE_FEATURES:append:rcar-gen3 = " multimedia"
+
+DISTRO_FEATURES:append:rcar-gen3 = " use_eva_pkg"
+
+#DISTRO_FEATURES:append:rcar-gen3 = " h265dec_lib mpeg2dec_lib"
+DISTRO_FEATURES:append:rcar-gen3 = " h264dec_lib h264enc_lib aaclcdec_lib aaclcdec_mdw"
+
+# Mask out meta-renesas-rcar-gen3's tweaks to weston-init, as they do
+# not seem necessary for anything in AGL, and the addition of
+# dbus.service and multi-user.target dependencies to the weston systemd
+# unit that is done is problematic with respect to potentially blocking
+# weston if any user units like application framework "platform"
+# services fail. They also likely affect boot up speed with respect to
+# getting weston started. There is no clear rationale expressed in the
+# meta-renesas-rcar-gen3 commit history for the extra dependencies, and
+# testing shows no issues on H3ULCB when not having them.
+BBMASK += "meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend"
+
+# Add graphics and decoder drivers to packagegroup-machine-base
+# recommendation.
+MACHINE_EXTRA_RRECOMMENDS:append:rcar-gen3 = " \
+ kernel-module-pvrsrvkm \
+ kernel-module-vsp2 \
+ kernel-module-vspm \
+ kernel-module-vspm-if \
+ omx-user-module \
+"
+
+# Mask out BSP layer gstreamer* 1.22.x bbappends for now, as the BSP
+# effectively is building 1.20.x plugins and packaging them as 1.22,
+# which breaks building various things. The whole directory is not
+# commented out because we still want the vspfilter plugin.
+BBMASK += "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-omx"
+BBMASK += "meta-renesas/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-"
diff --git a/meta-agl-bsp/conf/include/agl_refhw-h3.inc b/meta-agl-bsp/conf/include/agl_refhw-h3.inc
new file mode 100644
index 000000000..6eee8149f
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_refhw-h3.inc
@@ -0,0 +1,16 @@
+AGL_FEATURES:append:h3ulcb = " agl-refhw-h3"
+
+# Reference hardware has USB3
+MACHINE_FEATURES:append:h3ulcb = " usb3"
+
+KERNEL_DEVICETREE:append:h3ulcb = " renesas/r8a77951-agl-refhw.dtb"
+
+UBOOT_CONFIG:append:h3ulcb = " agl-refhw"
+UBOOT_CONFIG[agl-refhw] = "rcar3_salvator-x_defconfig"
+
+MACHINE_EXTRA_RRECOMMENDS:append:h3ulcb = " \
+ linux-firmware-wl18xx \
+ ti-bt-firmware \
+ wlconf \
+ wireless-regdb-static \
+"
diff --git a/meta-agl-bsp/conf/include/agl_s4sk.inc b/meta-agl-bsp/conf/include/agl_s4sk.inc
new file mode 100644
index 000000000..8f4a91b44
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_s4sk.inc
@@ -0,0 +1,9 @@
+SOC_FAMILY = "r8a779f0"
+BOARD_NAME = "s4sk"
+
+#ws2.0
+DTB_SUFFIX = "r8a779f0-s4sk"
+WKS_FILE = "singlepart-noloader.wks"
+IMAGE_INSTALL:append = " \
+ kernel-devicetree \
+"
diff --git a/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc b/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc
new file mode 100644
index 000000000..06e635ca0
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_salvator-nogfx.inc
@@ -0,0 +1,17 @@
+require conf/include/agl_rcar-nogfx.inc
+
+# Mask graphic Pkgs
+BBMASK += "gles-user-module|kernel-module-gles|wayland-kms|libgbm"
+# Mask MMP recipes
+BBMASK += "kernel-module-uvcs-drv|omx-user-module"
+# Work around use of obsolete Weston backend-fbdev in meta-rcar-gen3
+# when building without the proprietary driver stack. Masking out the
+# weston_%.bbappend seems the simplest approach for now, as forcing
+# USE_GLES = "1" to disable the adding of -Dbackend-default="fbdev" to
+# EXTRA_OEMESON triggers adding "libgbm" to DEPENDS, which breaks due
+# to that being a component specific to the proprietary stack we are
+# explicitly disabling. If the "libgbm" usage in the bbappend was
+# instead "virtual/libgbm" as is now used in poky, it might be possible
+# to just tweak PREFERRED_PROVIDER_virtual/libgbm = "mesa".
+BBMASK += "meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend"
+
diff --git a/meta-agl-bsp/conf/include/agl_salvator.inc b/meta-agl-bsp/conf/include/agl_salvator.inc
new file mode 100644
index 000000000..78457868a
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_salvator.inc
@@ -0,0 +1,6 @@
+require conf/include/agl_rcar.inc
+
+IMAGE_INSTALL:append:rcar-gen3 = " \
+ kernel-module-vspm-if \
+"
+
diff --git a/meta-agl-bsp/conf/include/agl_unmatched.inc b/meta-agl-bsp/conf/include/agl_unmatched.inc
new file mode 100644
index 000000000..f7c9f75f2
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_unmatched.inc
@@ -0,0 +1,4 @@
+# firmware for graphics
+MACHINE_EXTRA_RRECOMMENDS:append = " linux-firmware-radeon linux-firmware-amdgpu "
+
+#
diff --git a/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc b/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc
new file mode 100644
index 000000000..5093d0bd5
--- /dev/null
+++ b/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc
@@ -0,0 +1,14 @@
+# Build updatable image. Only takes effect when sota.bbclass is inherited
+DISTRO_FEATURES:append = " sota"
+
+# Root device
+ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+
+# Use our own wks file
+WKS_FILE = "directdisk.wks.in"
+
+# Simplest possible option
+AGL_DEFAULT_IMAGE_FSTYPES = "ext4"
+
+# Need to run QEMU with virtio-gpu device
+PACKAGECONFIG:append:pn-qemu-system-native = " virglrenderer glx gtk+"
diff --git a/meta-agl-bsp/conf/layer.conf b/meta-agl-bsp/conf/layer.conf
index 031c4f2be..036cde7a7 100644
--- a/meta-agl-bsp/conf/layer.conf
+++ b/meta-agl-bsp/conf/layer.conf
@@ -21,4 +21,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "aglbsp"
BBFILE_PATTERN_aglbsp = "^${LAYERDIR}/"
-BBFILE_PRIORITY_aglbsp = "10"
+BBFILE_PRIORITY_aglbsp = "60"
+
+LAYERSERIES_COMPAT_aglbsp = "scarthgap"
diff --git a/meta-agl-bsp/conf/machine/include/virtio.inc b/meta-agl-bsp/conf/machine/include/virtio.inc
new file mode 100644
index 000000000..6f8a638a0
--- /dev/null
+++ b/meta-agl-bsp/conf/machine/include/virtio.inc
@@ -0,0 +1,23 @@
+PREFERRED_PROVIDER_virtual/egl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+MACHINE_FEATURES = "alsa usbgadget screen vfat"
+
+MACHINEOVERRIDES =. "virtio-all:"
+
+IMAGE_FSTYPES += "tar.bz2 ext4"
+
+# Don't include kernels in standard images
+RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""
+
+# Use a common kernel recipe for all VirtIO machines
+PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
+
+# Use newer kernel
+PREFERRED_VERSION_linux-yocto = "5.15.%"
+
+EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+
+IMAGE_CLASSES += "qemuboot"
diff --git a/meta-agl-bsp/conf/machine/virtio-aarch64.conf b/meta-agl-bsp/conf/machine/virtio-aarch64.conf
new file mode 100644
index 000000000..d92d43943
--- /dev/null
+++ b/meta-agl-bsp/conf/machine/virtio-aarch64.conf
@@ -0,0 +1,36 @@
+#@TYPE: Machine
+#@NAME: VirtIO ARMv8 machine
+#@DESCRIPTION: Machine configuration for running an ARMv8 system on VirtIO based platform
+
+require conf/machine/include/arm/arch-armv8a.inc
+require conf/machine/include/virtio.inc
+
+KERNEL_IMAGETYPE = "Image"
+
+SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0"
+SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
+
+# For runqemu
+QB_SYSTEM_NAME = "qemu-system-aarch64"
+QB_MACHINE = "-machine virt"
+QB_CPU = "-cpu cortex-a57"
+QB_CPU_KVM = "-cpu host -machine gic-version=3"
+QB_MEM = "-m 2048"
+# Standard Serial console
+QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0"
+# Ensure virtio-mmio support VirtIO 1.0 required by virtio-gpu
+QB_OPT_APPEND = "-global virtio-mmio.force-legacy=false"
+# TODO: upstream to OE-core runqemu
+QB_OPT_APPEND += "-device virtio-gpu-device -display gtk,gl=on -show-cursor"
+# Virtio input
+QB_OPT_APPEND += "-device virtio-mouse-device -device virtio-keyboard-device"
+# Add the 'virtio-rng-device' device otherwise the guest may run out of entropy
+QB_OPT_APPEND += "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0"
+# Virtio Networking support
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
+QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
+# Virtio block device
+QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
+# Virtio serial console
+QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
+QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw
new file mode 100644
index 000000000..d22970681
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/gpsd.refhw
@@ -0,0 +1,5 @@
+# Default settings for gpsd.
+START_DAEMON="true"
+GPSD_OPTIONS=""
+DEVICES="/dev/ttySC3"
+GPSD_SOCKET="/var/run/gpsd.sock"
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh
new file mode 100644
index 000000000..d183ba43c
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Script to detect AGL Reference Hardware and switch gpsd
+# configuration as necessary.
+#
+# NOTE:
+# For the most part errors are ignored and the script returns
+# 0/success so gpsd still be started if the script is somehow
+# run on a board without the expected hardware.
+
+COMPAT=/sys/firmware/devicetree/base/compatible
+GPSTTY=/dev/ttySC3
+
+#if [ ! \( -f "$COMPAT" -a -c "$GPSTTY" -a -f /etc/default/gpsd.refhw \) ]; then
+if [ ! \( -f "$COMPAT" -a -f /etc/default/gpsd.refhw \) ]; then
+ exit 0
+fi
+
+found=false
+for c in `cat $COMPAT | tr '\0' ' '`; do
+ if echo $c | grep -q '^agl,refhw-h3$'; then
+ found=true
+ break
+ fi
+done
+
+if $found; then
+ if [ ! -c "$GPSTTY" ]; then
+ exit 0
+ fi
+ update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20
+else
+ update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 5
+fi
+exit 0
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak
new file mode 100644
index 000000000..2c9089aa0
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw-gpsd-helper.sh.bak
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Script to detect AGL Reference Hardware and switch gpdf configuration
+# as needed.
+#
+# NOTE:
+# For the most part errors are ignored and the script returns
+# 0/success so gpsd still be started if the script is somehow
+# run on a board without the expected hardware.
+
+COMPAT=/sys/firmware/devicetree/base/compatible
+GPSTTY=/dev/ttySC3
+
+if [ ! \( -f "$COMPAT" -a -c "$GPSTTY" -a -f /etc/default/gpsd.refhw \) ]; then
+ exit 0
+fi
+
+found=false
+for c in `cat $COMPAT | tr '\0' ' '`; do
+ echo "c = $c"
+ if echo $c | grep -q '^agl,refhw-h3$'; then
+ found=true
+ break
+ fi
+done
+
+if $found; then
+ update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20
+else
+ update-alternatives --remove gpsd-defaults /etc/default/gpsd.refhw
+fi
+exit 0
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf
new file mode 100644
index 000000000..b7e3a7b0d
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/files/refhw.conf
@@ -0,0 +1,2 @@
+[Service]
+ExecStartPre=-/usr/sbin/refhw-gpsd-helper.sh
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend
new file mode 100644
index 000000000..3cd5aa7de
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend
@@ -0,0 +1,33 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI = "file://gpsd.refhw \
+ file://refhw-gpsd-helper.sh \
+ file://refhw.conf \
+"
+
+inherit update-alternatives
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -D -m 0644 ${WORKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh
+ install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d
+ install -D -m 0644 ${WORKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf
+ fi
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES:${PN} = "${sysconfdir}/default/gpsd.refhw"
+
+ALTERNATIVE:${PN} = "gpsd-defaults"
+ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
+ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.refhw"
+# NOTE: Priority needs to be below default of 10 to avoid overriding the
+# default configuration. The script run by the systemd drop-in
+# will tweak things on boot to handle h3ulcb vs refhw.
+ALTERNATIVE_PRIORITY[gpsd-defaults] = "5"
diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg
deleted file mode 100644
index 6f7d49880..000000000
--- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/ath9k_htc.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_CFG80211=m
-CONFIG_MAC80211=m
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg
deleted file mode 100644
index 9c2a82d99..000000000
--- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/btusb.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_BT_INTEL=m
-CONFIG_BT_BCM=m
-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBTUSB_BCM=y \ No newline at end of file
diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg
deleted file mode 100644
index 95de5181e..000000000
--- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/hid.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_USB_HID=y
-# CONFIG_HID_PID is not set
-CONFIG_HID_MULTITOUCH=y
diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg
deleted file mode 100644
index df5a871ef..000000000
--- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/files/rtl_sdr.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_I2C_MUX=y
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend b/meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend
deleted file mode 100644
index 5dbd457df..000000000
--- a/meta-agl-bsp/meta-boundary/recipes-kernel/linux/linux-boundary_4.1.15.bbappend
+++ /dev/null
@@ -1,33 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-DEPENDS += "kern-tools-native"
-
-# Enable support for AR9271
-SRC_URI_append = " file://ath9k_htc.cfg"
-
-# Enable support for Bluetooth HCI USB devices
-SRC_URI_append = " file://btusb.cfg"
-
-# Enable support for Bluetooth HCI USB devices
-SRC_URI_append = " file://btusb.cfg"
-
-# Enable support for HID multitouch
-SRC_URI_append = " file://hid.cfg"
-
-# Enable support for RTLSDR
-SRC_URI_append = " file://rtl_sdr.cfg"
-
-# returns all the elements from the src uri that are .cfg files
-def find_cfgs(d):
- sources=src_patches(d, True)
- sources_list=[]
- for s in sources:
- if s.endswith('.cfg'):
- sources_list.append(s)
-
- return sources_list
-
-do_configure_prepend () {
- cp -a ${WORKDIR}/defconfig .config
- merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
-} \ No newline at end of file
diff --git a/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch b/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch
deleted file mode 100644
index f06f85c62..000000000
--- a/meta-agl-bsp/meta-core/recipes-core/glibc/files/0028-Bug-20116-Fix-use-after-free-in-pthread_create.patch
+++ /dev/null
@@ -1,637 +0,0 @@
-From e7ba24f05d86acf7072e066ea6d7b235a106688c Mon Sep 17 00:00:00 2001
-From: Carlos O'Donell <carlos@redhat.com>
-Date: Sat, 28 Jan 2017 19:13:34 -0500
-Subject: [PATCH] Bug 20116: Fix use after free in pthread_create()
-
-The commit documents the ownership rules around 'struct pthread' and
-when a thread can read or write to the descriptor. With those ownership
-rules in place it becomes obvious that pd->stopped_start should not be
-touched in several of the paths during thread startup, particularly so
-for detached threads. In the case of detached threads, between the time
-the thread is created by the OS kernel and the creating thread checks
-pd->stopped_start, the detached thread might have already exited and the
-memory for pd unmapped. As a regression test we add a simple test which
-exercises this exact case by quickly creating detached threads with
-large enough stacks to ensure the thread stack cache is bypassed and the
-stacks are unmapped. Before the fix the testcase segfaults, after the
-fix it works correctly and completes without issue.
-
-For a detailed discussion see:
-https://www.sourceware.org/ml/libc-alpha/2017-01/msg00505.html
-
-(cherry-picked from commit f8bf15febcaf137bbec5a61101e88cd5a9d56ca8)
-
-Upstream-Status: Backport [master]
-Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
----
- ChangeLog | 23 ++++
- nptl/Makefile | 3 +-
- nptl/createthread.c | 10 +-
- nptl/pthread_create.c | 207 +++++++++++++++++++++++++++------
- nptl/pthread_getschedparam.c | 1 +
- nptl/pthread_setschedparam.c | 1 +
- nptl/pthread_setschedprio.c | 1 +
- nptl/tpp.c | 2 +
- nptl/tst-create-detached.c | 137 ++++++++++++++++++++++
- sysdeps/nacl/createthread.c | 10 +-
- sysdeps/unix/sysv/linux/createthread.c | 16 ++-
- 11 files changed, 356 insertions(+), 55 deletions(-)
- create mode 100644 nptl/tst-create-detached.c
-
-diff --git a/nptl/Makefile b/nptl/Makefile
-index 0d8aadebed..7dec4edb53 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -290,7 +290,8 @@ tests = tst-typesizes \
- tst-initializers1 $(addprefix tst-initializers1-,\
- c89 gnu89 c99 gnu99 c11 gnu11) \
- tst-bad-schedattr \
-- tst-thread_local1 tst-mutex-errorcheck tst-robust10
-+ tst-thread_local1 tst-mutex-errorcheck tst-robust10 \
-+ tst-create-detached \
- xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
- tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
- test-srcs = tst-oddstacklimit
-diff --git a/nptl/createthread.c b/nptl/createthread.c
-index ba2f9c7167..328f85865d 100644
---- a/nptl/createthread.c
-+++ b/nptl/createthread.c
-@@ -25,16 +25,14 @@
-
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
-- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
- /* If the implementation needs to do some tweaks to the thread after
- it has been created at the OS level, it can set STOPPED_START here. */
-
-- pd->stopped_start = stopped_start;
-- if (__glibc_unlikely (stopped_start))
-- /* We make sure the thread does not run far by forcing it to get a
-- lock. We lock it here too so that the new thread cannot continue
-- until we tell it to. */
-+ pd->stopped_start = *stopped_start;
-+ if (__glibc_unlikely (*stopped_start))
-+ /* See CONCURRENCY NOTES in nptl/pthread_create.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- return ENOSYS;
-diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
-index a834063ad5..44b17bec86 100644
---- a/nptl/pthread_create.c
-+++ b/nptl/pthread_create.c
-@@ -54,25 +54,141 @@ unsigned int __nptl_nthreads = 1;
- /* Code to allocate and deallocate a stack. */
- #include "allocatestack.c"
-
--/* createthread.c defines this function, and two macros:
-+/* CONCURRENCY NOTES:
-+
-+ Understanding who is the owner of the 'struct pthread' or 'PD'
-+ (refers to the value of the 'struct pthread *pd' function argument)
-+ is critically important in determining exactly which operations are
-+ allowed and which are not and when, particularly when it comes to the
-+ implementation of pthread_create, pthread_join, pthread_detach, and
-+ other functions which all operate on PD.
-+
-+ The owner of PD is responsible for freeing the final resources
-+ associated with PD, and may examine the memory underlying PD at any
-+ point in time until it frees it back to the OS or to reuse by the
-+ runtime.
-+
-+ The thread which calls pthread_create is called the creating thread.
-+ The creating thread begins as the owner of PD.
-+
-+ During startup the new thread may examine PD in coordination with the
-+ owner thread (which may be itself).
-+
-+ The four cases of ownership transfer are:
-+
-+ (1) Ownership of PD is released to the process (all threads may use it)
-+ after the new thread starts in a joinable state
-+ i.e. pthread_create returns a usable pthread_t.
-+
-+ (2) Ownership of PD is released to the new thread starting in a detached
-+ state.
-+
-+ (3) Ownership of PD is dynamically released to a running thread via
-+ pthread_detach.
-+
-+ (4) Ownership of PD is acquired by the thread which calls pthread_join.
-+
-+ Implementation notes:
-+
-+ The PD->stopped_start and thread_ran variables are used to determine
-+ exactly which of the four ownership states we are in and therefore
-+ what actions can be taken. For example after (2) we cannot read or
-+ write from PD anymore since the thread may no longer exist and the
-+ memory may be unmapped. The most complicated cases happen during
-+ thread startup:
-+
-+ (a) If the created thread is in a detached (PTHREAD_CREATE_DETACHED),
-+ or joinable (default PTHREAD_CREATE_JOINABLE) state and
-+ STOPPED_START is true, then the creating thread has ownership of
-+ PD until the PD->lock is released by pthread_create. If any
-+ errors occur we are in states (c), (d), or (e) below.
-+
-+ (b) If the created thread is in a detached state
-+ (PTHREAD_CREATED_DETACHED), and STOPPED_START is false, then the
-+ creating thread has ownership of PD until it invokes the OS
-+ kernel's thread creation routine. If this routine returns
-+ without error, then the created thread owns PD; otherwise, see
-+ (c) and (e) below.
-+
-+ (c) If the detached thread setup failed and THREAD_RAN is true, then
-+ the creating thread releases ownership to the new thread by
-+ sending a cancellation signal. All threads set THREAD_RAN to
-+ true as quickly as possible after returning from the OS kernel's
-+ thread creation routine.
-+
-+ (d) If the joinable thread setup failed and THREAD_RAN is true, then
-+ then the creating thread retains ownership of PD and must cleanup
-+ state. Ownership cannot be released to the process via the
-+ return of pthread_create since a non-zero result entails PD is
-+ undefined and therefore cannot be joined to free the resources.
-+ We privately call pthread_join on the thread to finish handling
-+ the resource shutdown (Or at least we should, see bug 19511).
-+
-+ (e) If the thread creation failed and THREAD_RAN is false, then the
-+ creating thread retains ownership of PD and must cleanup state.
-+ No waiting for the new thread is required because it never
-+ started.
-+
-+ The nptl_db interface:
-+
-+ The interface with nptl_db requires that we enqueue PD into a linked
-+ list and then call a function which the debugger will trap. The PD
-+ will then be dequeued and control returned to the thread. The caller
-+ at the time must have ownership of PD and such ownership remains
-+ after control returns to thread. The enqueued PD is removed from the
-+ linked list by the nptl_db callback td_thr_event_getmsg. The debugger
-+ must ensure that the thread does not resume execution, otherwise
-+ ownership of PD may be lost and examining PD will not be possible.
-+
-+ Note that the GNU Debugger as of (December 10th 2015) commit
-+ c2c2a31fdb228d41ce3db62b268efea04bd39c18 no longer uses
-+ td_thr_event_getmsg and several other related nptl_db interfaces. The
-+ principal reason for this is that nptl_db does not support non-stop
-+ mode where other threads can run concurrently and modify runtime
-+ structures currently in use by the debugger and the nptl_db
-+ interface.
-+
-+ Axioms:
-+
-+ * The create_thread function can never set stopped_start to false.
-+ * The created thread can read stopped_start but never write to it.
-+ * The variable thread_ran is set some time after the OS thread
-+ creation routine returns, how much time after the thread is created
-+ is unspecified, but it should be as quickly as possible.
-+
-+*/
-+
-+/* CREATE THREAD NOTES:
-+
-+ createthread.c defines the create_thread function, and two macros:
- START_THREAD_DEFN and START_THREAD_SELF (see below).
-
-- create_thread is obliged to initialize PD->stopped_start. It
-- should be true if the STOPPED_START parameter is true, or if
-- create_thread needs the new thread to synchronize at startup for
-- some other implementation reason. If PD->stopped_start will be
-- true, then create_thread is obliged to perform the operation
-- "lll_lock (PD->lock, LLL_PRIVATE)" before starting the thread.
-+ create_thread must initialize PD->stopped_start. It should be true
-+ if the STOPPED_START parameter is true, or if create_thread needs the
-+ new thread to synchronize at startup for some other implementation
-+ reason. If STOPPED_START will be true, then create_thread is obliged
-+ to lock PD->lock before starting the thread. Then pthread_create
-+ unlocks PD->lock which synchronizes-with START_THREAD_DEFN in the
-+ child thread which does an acquire/release of PD->lock as the last
-+ action before calling the user entry point. The goal of all of this
-+ is to ensure that the required initial thread attributes are applied
-+ (by the creating thread) before the new thread runs user code. Note
-+ that the the functions pthread_getschedparam, pthread_setschedparam,
-+ pthread_setschedprio, __pthread_tpp_change_priority, and
-+ __pthread_current_priority reuse the same lock, PD->lock, for a
-+ similar purpose e.g. synchronizing the setting of similar thread
-+ attributes. These functions are never called before the thread is
-+ created, so don't participate in startup syncronization, but given
-+ that the lock is present already and in the unlocked state, reusing
-+ it saves space.
-
- The return value is zero for success or an errno code for failure.
- If the return value is ENOMEM, that will be translated to EAGAIN,
- so create_thread need not do that. On failure, *THREAD_RAN should
- be set to true iff the thread actually started up and then got
-- cancelled before calling user code (*PD->start_routine), in which
-- case it is responsible for doing its own cleanup. */
--
-+ canceled before calling user code (*PD->start_routine). */
- static int create_thread (struct pthread *pd, const struct pthread_attr *attr,
-- bool stopped_start, STACK_VARIABLES_PARMS,
-+ bool *stopped_start, STACK_VARIABLES_PARMS,
- bool *thread_ran);
-
- #include <createthread.c>
-@@ -314,12 +430,19 @@ START_THREAD_DEFN
- /* Store the new cleanup handler info. */
- THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf);
-
-+ /* We are either in (a) or (b), and in either case we either own
-+ PD already (2) or are about to own PD (1), and so our only
-+ restriction would be that we can't free PD until we know we
-+ have ownership (see CONCURRENCY NOTES above). */
- if (__glibc_unlikely (pd->stopped_start))
- {
- int oldtype = CANCEL_ASYNC ();
-
- /* Get the lock the parent locked to force synchronization. */
- lll_lock (pd->lock, LLL_PRIVATE);
-+
-+ /* We have ownership of PD now. */
-+
- /* And give it up right away. */
- lll_unlock (pd->lock, LLL_PRIVATE);
-
-@@ -378,7 +501,8 @@ START_THREAD_DEFN
- pd, pd->nextevent));
- }
-
-- /* Now call the function to signal the event. */
-+ /* Now call the function which signals the event. See
-+ CONCURRENCY NOTES for the nptl_db interface comments. */
- __nptl_death_event ();
- }
- }
-@@ -642,19 +766,28 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
- that cares whether the thread count is correct. */
- atomic_increment (&__nptl_nthreads);
-
-- bool thread_ran = false;
-+ /* Our local value of stopped_start and thread_ran can be accessed at
-+ any time. The PD->stopped_start may only be accessed if we have
-+ ownership of PD (see CONCURRENCY NOTES above). */
-+ bool stopped_start = false; bool thread_ran = false;
-
- /* Start the thread. */
- if (__glibc_unlikely (report_thread_creation (pd)))
- {
-- /* Create the thread. We always create the thread stopped
-- so that it does not get far before we tell the debugger. */
-- retval = create_thread (pd, iattr, true, STACK_VARIABLES_ARGS,
-- &thread_ran);
-+ stopped_start = true;
-+
-+ /* We always create the thread stopped at startup so we can
-+ notify the debugger. */
-+ retval = create_thread (pd, iattr, &stopped_start,
-+ STACK_VARIABLES_ARGS, &thread_ran);
- if (retval == 0)
- {
-- /* create_thread should have set this so that the logic below can
-- test it. */
-+ /* We retain ownership of PD until (a) (see CONCURRENCY NOTES
-+ above). */
-+
-+ /* Assert stopped_start is true in both our local copy and the
-+ PD copy. */
-+ assert (stopped_start);
- assert (pd->stopped_start);
-
- /* Now fill in the information about the new thread in
-@@ -671,26 +804,30 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
- pd, pd->nextevent)
- != 0);
-
-- /* Now call the function which signals the event. */
-+ /* Now call the function which signals the event. See
-+ CONCURRENCY NOTES for the nptl_db interface comments. */
- __nptl_create_event ();
- }
- }
- else
-- retval = create_thread (pd, iattr, false, STACK_VARIABLES_ARGS,
-- &thread_ran);
-+ retval = create_thread (pd, iattr, &stopped_start,
-+ STACK_VARIABLES_ARGS, &thread_ran);
-
- if (__glibc_unlikely (retval != 0))
- {
-- /* If thread creation "failed", that might mean that the thread got
-- created and ran a little--short of running user code--but then
-- create_thread cancelled it. In that case, the thread will do all
-- its own cleanup just like a normal thread exit after a successful
-- creation would do. */
--
- if (thread_ran)
-- assert (pd->stopped_start);
-+ /* State (c) or (d) and we may not have PD ownership (see
-+ CONCURRENCY NOTES above). We can assert that STOPPED_START
-+ must have been true because thread creation didn't fail, but
-+ thread attribute setting did. */
-+ /* See bug 19511 which explains why doing nothing here is a
-+ resource leak for a joinable thread. */
-+ assert (stopped_start);
- else
- {
-+ /* State (e) and we have ownership of PD (see CONCURRENCY
-+ NOTES above). */
-+
- /* Oops, we lied for a second. */
- atomic_decrement (&__nptl_nthreads);
-
-@@ -710,10 +847,14 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
- }
- else
- {
-- if (pd->stopped_start)
-- /* The thread blocked on this lock either because we're doing TD_CREATE
-- event reporting, or for some other reason that create_thread chose.
-- Now let it run free. */
-+ /* We don't know if we have PD ownership. Once we check the local
-+ stopped_start we'll know if we're in state (a) or (b) (see
-+ CONCURRENCY NOTES above). */
-+ if (stopped_start)
-+ /* State (a), we own PD. The thread blocked on this lock either
-+ because we're doing TD_CREATE event reporting, or for some
-+ other reason that create_thread chose. Now let it run
-+ free. */
- lll_unlock (pd->lock, LLL_PRIVATE);
-
- /* We now have for sure more than one thread. The main thread might
-diff --git a/nptl/pthread_getschedparam.c b/nptl/pthread_getschedparam.c
-index b887881baf..de71171a08 100644
---- a/nptl/pthread_getschedparam.c
-+++ b/nptl/pthread_getschedparam.c
-@@ -35,6 +35,7 @@ __pthread_getschedparam (pthread_t threadid, int *policy,
-
- int result = 0;
-
-+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- /* The library is responsible for maintaining the values at all
-diff --git a/nptl/pthread_setschedparam.c b/nptl/pthread_setschedparam.c
-index dfb52b9dbf..dcb520f1c8 100644
---- a/nptl/pthread_setschedparam.c
-+++ b/nptl/pthread_setschedparam.c
-@@ -36,6 +36,7 @@ __pthread_setschedparam (pthread_t threadid, int policy,
-
- int result = 0;
-
-+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- struct sched_param p;
-diff --git a/nptl/pthread_setschedprio.c b/nptl/pthread_setschedprio.c
-index cefc6481d6..8134b50560 100644
---- a/nptl/pthread_setschedprio.c
-+++ b/nptl/pthread_setschedprio.c
-@@ -38,6 +38,7 @@ pthread_setschedprio (pthread_t threadid, int prio)
- struct sched_param param;
- param.sched_priority = prio;
-
-+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- /* If the thread should have higher priority because of some
-diff --git a/nptl/tpp.c b/nptl/tpp.c
-index e175bf4d53..223bd6bbee 100644
---- a/nptl/tpp.c
-+++ b/nptl/tpp.c
-@@ -114,6 +114,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
- if (priomax == newpriomax)
- return 0;
-
-+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */
- lll_lock (self->lock, LLL_PRIVATE);
-
- tpp->priomax = newpriomax;
-@@ -165,6 +166,7 @@ __pthread_current_priority (void)
-
- int result = 0;
-
-+ /* See CREATE THREAD NOTES in nptl/pthread_create.c. */
- lll_lock (self->lock, LLL_PRIVATE);
-
- if ((self->flags & ATTR_FLAG_SCHED_SET) == 0)
-diff --git a/nptl/tst-create-detached.c b/nptl/tst-create-detached.c
-new file mode 100644
-index 0000000000..ea93e441c7
---- /dev/null
-+++ b/nptl/tst-create-detached.c
-@@ -0,0 +1,137 @@
-+/* Bug 20116: Test rapid creation of detached threads.
-+ Copyright (C) 2017 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; see the file COPYING.LIB. If
-+ not, see <http://www.gnu.org/licenses/>. */
-+
-+/* The goal of the test is to trigger a failure if the parent touches
-+ any part of the thread descriptor after the detached thread has
-+ exited. We test this by creating many detached threads with large
-+ stacks. The stacks quickly fill the the stack cache and subsequent
-+ threads will start to cause the thread stacks to be immediately
-+ unmapped to satisfy the stack cache max. With the stacks being
-+ unmapped the parent's read of any part of the thread descriptor will
-+ trigger a segfault. That segfault is what we are trying to cause,
-+ since any segfault is a defect in the implementation. */
-+
-+#include <pthread.h>
-+#include <stdio.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <stdbool.h>
-+#include <sys/resource.h>
-+#include <support/xthread.h>
-+
-+/* Number of threads to create. */
-+enum { threads_to_create = 100000 };
-+
-+/* Number of threads which should spawn other threads. */
-+enum { creator_threads = 2 };
-+
-+/* Counter of threads created so far. This is incremented by all the
-+ running creator threads. */
-+static unsigned threads_created;
-+
-+/* Thread callback which does nothing, so that the thread exits
-+ immediatedly. */
-+static void *
-+do_nothing (void *arg)
-+{
-+ return NULL;
-+}
-+
-+/* Attribute indicating that the thread should be created in a detached
-+ fashion. */
-+static pthread_attr_t detached;
-+
-+/* Barrier to synchronize initialization. */
-+static pthread_barrier_t barrier;
-+
-+static void *
-+creator_thread (void *arg)
-+{
-+ int ret;
-+ xpthread_barrier_wait (&barrier);
-+
-+ while (true)
-+ {
-+ pthread_t thr;
-+ /* Thread creation will fail if the kernel does not free old
-+ threads quickly enough, so we do not report errors. */
-+ ret = pthread_create (&thr, &detached, do_nothing, NULL);
-+ if (ret == 0 && __atomic_add_fetch (&threads_created, 1, __ATOMIC_SEQ_CST)
-+ >= threads_to_create)
-+ break;
-+ }
-+
-+ return NULL;
-+}
-+
-+static int
-+do_test (void)
-+{
-+ /* Limit the size of the process, so that memory allocation will
-+ fail without impacting the entire system. */
-+ {
-+ struct rlimit limit;
-+ if (getrlimit (RLIMIT_AS, &limit) != 0)
-+ {
-+ printf ("FAIL: getrlimit (RLIMIT_AS) failed: %m\n");
-+ return 1;
-+ }
-+ /* This limit, 800MB, is just a heuristic. Any value can be
-+ picked. */
-+ long target = 800 * 1024 * 1024;
-+ if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target)
-+ {
-+ limit.rlim_cur = target;
-+ if (setrlimit (RLIMIT_AS, &limit) != 0)
-+ {
-+ printf ("FAIL: setrlimit (RLIMIT_AS) failed: %m\n");
-+ return 1;
-+ }
-+ }
-+ }
-+
-+ xpthread_attr_init (&detached);
-+
-+ xpthread_attr_setdetachstate (&detached, PTHREAD_CREATE_DETACHED);
-+
-+ /* A large thread stack seems beneficial for reproducing a race
-+ condition in detached thread creation. The goal is to reach the
-+ limit of the runtime thread stack cache such that the detached
-+ thread's stack is unmapped after exit and causes a segfault when
-+ the parent reads the thread descriptor data stored on the the
-+ unmapped stack. */
-+ xpthread_attr_setstacksize (&detached, 16 * 1024 * 1024);
-+
-+ xpthread_barrier_init (&barrier, NULL, creator_threads);
-+
-+ pthread_t threads[creator_threads];
-+
-+ for (int i = 0; i < creator_threads; ++i)
-+ threads[i] = xpthread_create (NULL, creator_thread, NULL);
-+
-+ for (int i = 0; i < creator_threads; ++i)
-+ xpthread_join (threads[i]);
-+
-+ xpthread_attr_destroy (&detached);
-+
-+ xpthread_barrier_destroy (&barrier);
-+
-+ return 0;
-+}
-+
-+#include <support/test-driver.c>
-diff --git a/sysdeps/nacl/createthread.c b/sysdeps/nacl/createthread.c
-index 7b571c34e2..5465558cc1 100644
---- a/sysdeps/nacl/createthread.c
-+++ b/sysdeps/nacl/createthread.c
-@@ -32,15 +32,13 @@ static void start_thread (void) __attribute__ ((noreturn));
-
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
-- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
- pd->tid = __nacl_get_tid (pd);
-
-- pd->stopped_start = stopped_start;
-- if (__glibc_unlikely (stopped_start))
-- /* We make sure the thread does not run far by forcing it to get a
-- lock. We lock it here too so that the new thread cannot continue
-- until we tell it to. */
-+ pd->stopped_start = *stopped_start;
-+ if (__glibc_unlikely (*stopped_start))
-+ /* See CONCURRENCY NOTES in nptl/pthread_create.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- TLS_DEFINE_INIT_TP (tp, pd);
-diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
-index 6d32cece48..66ddae61d4 100644
---- a/sysdeps/unix/sysv/linux/createthread.c
-+++ b/sysdeps/unix/sysv/linux/createthread.c
-@@ -46,7 +46,7 @@ static int start_thread (void *arg) __attribute__ ((noreturn));
-
- static int
- create_thread (struct pthread *pd, const struct pthread_attr *attr,
-- bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
-+ bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
- {
- /* Determine whether the newly created threads has to be started
- stopped since we have to set the scheduling parameters or set the
-@@ -54,13 +54,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
- if (attr != NULL
- && (__glibc_unlikely (attr->cpuset != NULL)
- || __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)))
-- stopped_start = true;
-+ *stopped_start = true;
-
-- pd->stopped_start = stopped_start;
-- if (__glibc_unlikely (stopped_start))
-- /* We make sure the thread does not run far by forcing it to get a
-- lock. We lock it here too so that the new thread cannot continue
-- until we tell it to. */
-+ pd->stopped_start = *stopped_start;
-+ if (__glibc_unlikely (*stopped_start))
-+ /* See CONCURRENCY NOTES in nptl/pthread_creat.c. */
- lll_lock (pd->lock, LLL_PRIVATE);
-
- /* We rely heavily on various flags the CLONE function understands:
-@@ -117,7 +115,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
- /* Set the affinity mask if necessary. */
- if (attr->cpuset != NULL)
- {
-- assert (stopped_start);
-+ assert (*stopped_start);
-
- res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid,
- attr->cpusetsize, attr->cpuset);
-@@ -140,7 +138,7 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
- /* Set the scheduling parameters. */
- if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)
- {
-- assert (stopped_start);
-+ assert (*stopped_start);
-
- res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid,
- pd->schedpolicy, &pd->schedparam);
---
-2.11.0
-
diff --git a/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend b/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend
deleted file mode 100644
index a9f2a238d..000000000
--- a/meta-agl-bsp/meta-core/recipes-core/glibc/glibc_2.24.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-# include fix for CVE-2017-1000366
-SRCREV = "86ac4a78a9218d1e1dcfbacc6f7d09957c1fe3a4" \ No newline at end of file
diff --git a/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 000000000..fb797a436
--- /dev/null
+++ b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)}
diff --git a/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc
new file mode 100644
index 000000000..e74761317
--- /dev/null
+++ b/meta-agl-bsp/meta-core/recipes-graphics/mesa/mesa_agl.inc
@@ -0,0 +1,7 @@
+# The gallium-llvm is recommended as software 3D graphics renderer
+GALLIUM_LLVM = "gallium-llvm"
+PACKAGECONFIG:append:qemux86 = " gallium ${GALLIUM_LLVM}"
+PACKAGECONFIG:append:qemux86-64 = " gallium ${GALLIUM_LLVM}"
+PACKAGECONFIG:append:intel-corei7-64 = " gallium ${GALLIUM_LLVM}"
+
+DRIDRIVERS:append:intel-corei7-64 = ",i965"
diff --git a/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 000000000..3d5903d85
--- /dev/null
+++ b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)}
diff --git a/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc
new file mode 100644
index 000000000..e3b36034f
--- /dev/null
+++ b/meta-agl-bsp/meta-core/recipes-graphics/wayland/weston_agl.inc
@@ -0,0 +1,3 @@
+RDEPENDS:${PN}:append:qemux86 = " mesa-megadriver"
+RDEPENDS:${PN}:append:qemux86-64 = " mesa-megadriver"
+RDEPENDS:${PN}:append:intel-corei7-64 = " mesa-megadriver"
diff --git a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg b/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg
deleted file mode 100755
index c9c4fe2ed..000000000
--- a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto/hciattach.cfg
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Bluetooth device drivers
-#
-CONFIG_BT_INTEL=m
-CONFIG_BT_BCM=m
-CONFIG_BT_RTL=m
-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBTUSB_BCM=y
-CONFIG_BT_HCIBTUSB_RTL=y
-CONFIG_BT_HCIUART=m
-CONFIG_BT_HCIUART_H4=y
-CONFIG_BT_HCIUART_BCSP=y
-
-#
-# USB port drivers
-#
-CONFIG_USB_SERIAL_CP210X=y
diff --git a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend
deleted file mode 100755
index 99c9581b2..000000000
--- a/meta-agl-bsp/meta-core/recipes-kernel/linux/linux-yocto_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
-
-# Extra configuration options for the QEMU kernel
-SRC_URI += "file://hciattach.cfg \
- "
diff --git a/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch b/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch
deleted file mode 100644
index 535c22af1..000000000
--- a/meta-agl-bsp/meta-core/recipes-support/gnutls/files/check_SYS_getrandom.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
-Date: Mon, 22 Aug 2016 16:32:34 +0200
-Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined
-
-This allows to compile the getrandom() code in old Linux systems
-which do not have the system call defined.
----
-
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- lib/nettle/rnd-linux.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c
-index d7f07a6..7a24d05 100644
---- a/lib/nettle/rnd-linux.c
-+++ b/lib/nettle/rnd-linux.c
-@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;
- # else
- # include <sys/syscall.h>
- # undef getrandom
--# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)
-+# if defined(SYS_getrandom)
-+# define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)
-+# else
-+# define getrandom(dst,s,flags) -1
-+# endif
- # endif
-
- static unsigned have_getrandom(void)
---
-libgit2 0.24.0
-
diff --git a/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend b/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend
deleted file mode 100644
index dc67743fc..000000000
--- a/meta-agl-bsp/meta-core/recipes-support/gnutls/gnutls_3.5.3.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/files"
-
-SRC_URI_append = "\
- file://check_SYS_getrandom.patch \
- "
-
-
-# backport from https://patchwork.openembedded.org/patch/133002/
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service
new file mode 100644
index 000000000..f8eda0cba
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Bluetooth HCI UART support
+Requires=dev-ttymxc2.device
+After=dev-ttymxc2.device
+Before=bluetooth.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/hci-uart-helper.sh
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh
new file mode 100644
index 000000000..e1aa31c06
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/files/hci-uart-helper.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Script to attach HCI UART devices on i.MX8MQ EVK/EVKB
+#
+# NOTE:
+# For the most part errors are ignored and the script returns
+# 0/success so BlueZ will still be started if the script is somehow
+# run on a board without the expected hardware. However, if the
+# various probing succeeds and hciattach is run, the script returns
+# the resulting exit code if hciattach fails.
+
+COMPAT=/sys/firmware/devicetree/base/compatible
+HCITTY=/dev/ttymxc2
+PCIDEV=/sys/bus/pci/devices/0000:01:00.0
+
+if [ ! \( -f "$COMPAT" -a -c "$HCITTY" \) ]; then
+ exit 0
+fi
+
+found=false
+for c in `cat $COMPAT | tr '\0' ' '`; do
+ echo "c = $c"
+ if echo $c | grep -q '^fsl,imx8mq-evk$'; then
+ found=true
+ break
+ fi
+done
+if ! $found; then
+ echo "i.MX8MQ EVK not found!"
+ exit 0
+fi
+
+if [ -f "$PCIDEV/vendor" -a -f "$PCIDEV/device" ]; then
+ vendor=`cat $PCIDEV/vendor`
+ device=`cat $PCIDEV/device`
+fi
+
+rc=0
+if [ "$vendor" = "0x14e4" -a "$device" = "0x43ec" ]; then
+ # Broadcom 5436 on EVKB
+ hciattach $HCITTY bcm43xx
+ rc=$?
+elif [ "$vendor" = "0x168c" -a "$device" = "0x003e" ]; then
+ # Qualcomm (nee Atheros) 6174 on EVK
+ hciattach $HCITTY qualcomm
+ rc=$?
+fi
+exit $rc
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb
new file mode 100644
index 000000000..798fcebe6
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-connectivity/hci-uart-helper/hci-uart-helper_1.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Helper for enabling UART connected HCI Bluetooth devices"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd allarch
+
+SRC_URI = "file://hci-uart-helper.service \
+ file://hci-uart-helper.sh \
+"
+
+COMPATIBLE_MACHINE = "imx8mq-evk"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ # Install helper script
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/hci-uart-helper.sh ${D}${sbindir}/
+
+ # Install systemd unit
+ install -d ${D}${systemd_system_unitdir}/
+ install -m 0644 ${WORKDIR}/hci-uart-helper.service ${D}${systemd_system_unitdir}/
+ install -d ${D}${systemd_system_unitdir}/bluetooth.service.wants
+ ln -s ../hci-uart-helper.service ${D}${systemd_system_unitdir}/bluetooth.service.wants/
+}
+
+FILES:${PN} += "${systemd_system_unitdir}"
+
+RDEPENDS:${PN} += "bluez5"
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend
deleted file mode 100644
index e736dddd2..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-# Currently only works with fbdev backend
-# and only one default output
-
-WESTONCORE[backend] = "fbdev-backend.so"
-
-SCREEN_fbdev[name] = "fbdev"
-SCREEN_fbdev[transform] = "270"
-WESTONOUTPUT1[agl_screen] = "SCREEN_fbdev"
-
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend
new file mode 100644
index 000000000..07a43f958
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-graphics/wayland/weston_10.0.1.imx.bbappend
@@ -0,0 +1,10 @@
+# Work around PACKAGECONFIG:remove of "x11 wayland" added to the recipe
+# in meta-freescale commit 5a5c5dd. This can be removed once the issue
+# has been resolved by a revert of that breakage upstream.
+# What is done below is effectively a disabling of the "wayland"
+# PACKAGECONFIG option and then open coding what its effects would
+# normally be, since the :remove prevents specifying it in the usual way.
+PACKAGECONFIG[wayland] = ""
+DEPENDS:append = " virtual/egl virtual/libgles2"
+PACKAGECONFIG_CONFARGS:append = " -Dbackend-wayland=true"
+
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index 1b17bc73f..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index e45f0a3..a3f3ccc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2107,8 +2107,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg
deleted file mode 100644
index 001587bcd..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ath9k_htc.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-# build errors if built as module
-#CONFIG_CFG80211=m
-CONFIG_CFG80211=y
-CONFIG_MAC80211=m
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg
deleted file mode 100644
index 5f18d8223..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/btusb.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_BT_INTEL=m
-CONFIG_BT_BCM=m
-CONFIG_BT_RTL=m
-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBTUSB_BCM=y
-CONFIG_BT_HCIBTUSB_RTL=y
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg
new file mode 100644
index 000000000..3550a7bf6
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cfg80211.cfg
@@ -0,0 +1 @@
+CONFIG_CFG80211=y
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg
index 9f168b4f9..14984ccd9 100644
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/cgroup.cfg
@@ -1,17 +1,24 @@
+CONFIG_BPF=y
+CONFIG_BPF_SYSCALL=y
CONFIG_CGROUPS=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_SWAP=y
+CONFIG_MEMCG_SWAP_ENABLED=y
+CONFIG_MEMCG_KMEM=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
-# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
# CONFIG_CGROUP_HUGETLB is not set
-# CONFIG_CGROUP_PERF is not set
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_BPF=y
CONFIG_CGROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CGROUP_WRITEBACK=y
# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set
CONFIG_NET_CLS_CGROUP=y
-# CONFIG_CGROUP_NET_PRIO is not set
+CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg
new file mode 100644
index 000000000..29a25b798
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/fixups.cfg
@@ -0,0 +1,9 @@
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_FW_LOADER_USER_HELPER is not set
+# CONFIG_BTRFS_FS is not set
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg
new file mode 100644
index 000000000..92915921f
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/imx8mq-evkb.cfg
@@ -0,0 +1 @@
+CONFIG_BRCMSMAC=m
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg
deleted file mode 100644
index ef498669d..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/ramblock_nbd.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_NBD=y
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg
deleted file mode 100644
index df5a871ef..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/files/rtl_sdr.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_I2C_MUX=y
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch
new file mode 100644
index 000000000..f95891a2f
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0001-enable-mhdp-with-etnaviv.patch
@@ -0,0 +1,22 @@
+Tweak MHDP driver Kconfig so it can be enabled with etnaviv
+
+The MHDP driver is needed for using HDMI on the i.MX8MQ EVK, tweak its
+Kconfig entry so that it can be enabled when using etnaviv, not just
+Vivante.
+
+Upstream-Status: pending
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+
+diff --git a/drivers/gpu/drm/imx/mhdp/Kconfig b/drivers/gpu/drm/imx/mhdp/Kconfig
+index 225ccc3638a8..164b42f04e94 100644
+--- a/drivers/gpu/drm/imx/mhdp/Kconfig
++++ b/drivers/gpu/drm/imx/mhdp/Kconfig
+@@ -7,6 +7,6 @@ config DRM_IMX_CDNS_MHDP
+ select DRM_CDNS_HDMI
+ select DRM_CDNS_AUDIO
+ select DRM_CDNS_HDMI_HDCP
+- depends on DRM_IMX
++ depends on DRM_IMX || DRM_ETNAVIV
+ help
+ Choose this if you want to use HDMI on i.MX8.
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch
new file mode 100644
index 000000000..4ed4b685e
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/0002-dts-enable-etnaviv.patch
@@ -0,0 +1,22 @@
+Enable etnaviv support in i.MX8MQ EVK devicetree
+
+Some further investigation is required into how to manage this upstream
+in meta-freescale, as it is not required for the i.MX6 platforms AFAIK.
+
+Upstream-Status: pending
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+
+diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+index c3f8a24c3943..754fbfe30f0a 100755
+--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
++++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+@@ -1224,7 +1224,7 @@ &vpu_v4l2 {
+ status = "okay";
+ };
+
+-&gpu3d {
++&gpu {
+ status = "okay";
+ };
+
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg
new file mode 100644
index 000000000..35602c6d8
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx/etnaviv.cfg
@@ -0,0 +1,4 @@
+CONFIG_DRM_IMX=n
+CONFIG_DRM_IMX_CDNS_MHDP=y
+CONFIG_DRM_ROCKCHIP=n
+CONFIG_DRM_ETNAVIV=y
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend
index 5fe15cb97..0772a98a8 100644
--- a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-imx_%.bbappend
@@ -1,103 +1,17 @@
-# Borrowed fragments logic from linaro kernel configuration
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-KERNEL_CONFIG_FRAGMENTS ?= ""
+require linux-fslc.inc
-kernel_conf_variable() {
- CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
- if test "$2" = "n"
- then
- echo "# CONFIG_$1 is not set" >> ${B}/.config
- else
- echo "CONFIG_$1=$2" >> ${B}/.config
- fi
-}
-
-do_configure_append() {
-
- CONF_SED_SCRIPT=""
-
- # kernel_conf_variable NAME y/n lines here
-
- if [ -f '${WORKDIR}/defconfig' ]; then
- sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'
- else
- sed -e "${CONF_SED_SCRIPT}" < '${KERNEL_DEFCONFIG}' >> '${B}/.config'
- fi
-
- # Check for kernel config fragments. The assumption is that the config
- # fragment will be specified with the absolute path. For example:
- # * ${WORKDIR}/config1.cfg
- # * ${S}/config2.cfg
- # Iterate through the list of configs and make sure that you can find
- # each one. If not then error out.
- # NOTE: If you want to override a configuration that is kept in the kernel
- # with one from the OE meta data then you should make sure that the
- # OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed
- # after the in kernel configuration fragment.
- # Check if any config fragments are specified.
- if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
- then
- for f in ${KERNEL_CONFIG_FRAGMENTS}
- do
- # Check if the config fragment was copied into the WORKDIR from
- # the OE meta data
- if [ ! -e "$f" ]
- then
- echo "Could not find kernel config fragment $f"
- exit 1
- fi
- done
-
-# # Now that all the fragments are located merge them.
-# ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
-#
-
- cat ${KERNEL_CONFIG_FRAGMENTS} >> ${B}/.config
- fi
-
- yes '' | oe_runmake -C ${S} O=${B} oldconfig
- oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved
-}
-
-# Make sure these are enabled so that AGL configurations work
-
-SRC_URI_append = " file://tmpfs.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/tmpfs.cfg"
-SRC_URI_append = " file://namespace.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/namespace.cfg"
-SRC_URI_append = " file://cgroup.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/cgroup.cfg"
-
-# Fragments common to AGL demo platform (make sure they are added)
-
-# Enable support for USB HID touch display
-SRC_URI_append = " file://touchscreen.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/touchscreen.cfg"
-
-# Enable support for TP-Link TL-W722N USB Wifi adapter
-SRC_URI_append = " file://ath9k_htc.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg"
-
-# Enable support for RTLSDR
-SRC_URI_append = " file://rtl_sdr.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg"
-
-# Enable support for Bluetooth HCI USB devices
-SRC_URI_append = " file://btusb.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
+# These patches and the configuration fragment below will need to be
+# revisited if/when using IMX_DEFAULT_BSP = "mainline" with i.MX8
+# becomes more feasible with upstream meta-freescale.
+SRC_URI:append:etnaviv = " \
+ file://0001-enable-mhdp-with-etnaviv.patch \
+ file://0002-dts-enable-etnaviv.patch \
"
-# Enable support for smack
-KERNEL_CONFIG_FRAGMENTS_append_smack = "\
- ${WORKDIR}/audit.cfg \
- ${WORKDIR}/smack.cfg \
- ${WORKDIR}/smack-default-lsm.cfg \
-"
+# Support for i.MX8MQ EVKB (e.g. Broadcom wifi)
+AGL_KCONFIG_FRAGMENTS:append:imx8mq-evk = " imx8mq-evkb.cfg"
+# Build in etnaviv if required
+AGL_KCONFIG_FRAGMENTS:append:etnaviv = " etnaviv.cfg"
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend
new file mode 100644
index 000000000..1007f3c7c
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc-lts_%.bbappend
@@ -0,0 +1 @@
+require linux-fslc.inc
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc
new file mode 100644
index 000000000..948b8c22c
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc.inc
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-yocto-agl.inc
+
+# Make sure these are enabled so that AGL systemd configuration works
+AGL_KCONFIG_FRAGMENTS += " \
+ tmpfs.cfg \
+ namespace.cfg \
+ cgroup.cfg \
+"
+
+# Support for CFG80211 subsystem
+AGL_KCONFIG_FRAGMENTS += "cfg80211.cfg"
+
+# Turn off a couple of things enabled by default by Freescale
+# (lock debugging and userspace firmware loader fallback)
+AGL_KCONFIG_FRAGMENTS += "fixups.cfg"
+
+do_install:append:cubox-i() {
+ # Add symlink to work with default Hummingboard 2 u-boot configuration
+ ln -sf imx6q-hummingboard2.dtb ${D}/boot/imx6q-hummingboard2-emmc.dtb
+}
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend
new file mode 100644
index 000000000..1007f3c7c
--- /dev/null
+++ b/meta-agl-bsp/meta-freescale-layer/recipes-kernel/linux/linux-fslc_%.bbappend
@@ -0,0 +1 @@
+require linux-fslc.inc
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch b/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch
deleted file mode 100644
index 8489b6f39..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase/0014-Add-IMX-GPU-support.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: git/mkspecs/linux-oe-g++/qmake.conf
-===================================================================
---- git.orig/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 16:51:48.468955533 -0600
-+++ git/mkspecs/linux-oe-g++/qmake.conf 2016-12-14 17:03:17.000000000 -0600
-@@ -39,5 +39,12 @@ isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG
-
- include(../oe-device-extra.pri)
-
-+QMAKE_CFLAGS += -DLINUX=1 -DEGL_API_FB=1
-+QMAKE_CXXFLAGS += -DLINUX=1 -DEGL_API_FB=1
-+
-+QMAKE_LIBS_EGL += -lEGL
-+QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGLESv2
-+QMAKE_LIBS_OPENVG += -lEGL -lOpenVG
-+
- load(device_config)
- load(qt_config)
diff --git a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend
deleted file mode 100644
index c4afc30eb..000000000
--- a/meta-agl-bsp/meta-freescale-layer/recipes-qt/qt5/qtbase_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-
-# Fixing Qt5.8 build breaks by overriding original patches with ours
-# This will be fixed in the latest meta-freescale upstream
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
diff --git a/meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend b/meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend
deleted file mode 100644
index eda8de38a..000000000
--- a/meta-agl-bsp/meta-intel/recipes-graphics/wayland/libva_%.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-# This patch correct a bug in libva1_1.7.0.bb 1.8 inmeta-intel (no clue when it will be fixed)
-# libva.bb calls for an x11 runtime dependency even if wayland is selected
-#
-RDEPENDS_${PN}-egl_remove = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "${PN}-x11", d)}"
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend b/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
deleted file mode 100644
index d7052afae..000000000
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-LICENSE_${PN}-ibt-license = "Firmware-ibt_firmware"
-LICENSE_${PN}-ibt-11-5 = "Firmware-ibt_firmware"
-FILES_${PN}-ibt-license = "/lib/firmware/LICENCE.ibt_firmware"
-FILES_${PN}-ibt-11-5 = " \
- /lib/firmware/intel/ibt-11-5.sfi \
- /lib/firmware/intel/ibt-11-5.ddc \
-"
-
-RDEPENDS_${PN}-ibt-11-5 += "${PN}-ibt-license"
-
-PACKAGES =+ " ${PN}-ibt-license ${PN}-ibt-11-5 "
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc b/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc
deleted file mode 100644
index d94108d9f..000000000
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/fix_branch.scc
+++ /dev/null
@@ -1,3 +0,0 @@
-
-branch bxt-rebase
-mark patching start
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend b/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend
deleted file mode 100644
index f94b638b0..000000000
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/linux-yocto_4.4%.bbappend
+++ /dev/null
@@ -1,20 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-# adding most supported USB Bluetooth, Wifiand Ehternet devices
-SRC_URI_append = " file://usb-devices.cfg"
-
-# adding support for other graphic cards to work on more PC HW
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/usb-devices.cfg"
-SRC_URI_append = " file://extra-graphic-devices.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/extra-graphic-devices.cfg"
-
-# Configurations for Joule
-LINUX_VERSION_INTEL_COMMON_forcevariable = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', '4.4.36', '4.4.26', d)}"
-KBRANCH_corei7-64-intel-common_forcevariable = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'standard/intel/bxt-rebase;rebaseable=1', 'standard/intel/base', d)}"
-SRCREV_machine_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', '5ec33015d3f01a8059f16715dd5bb34fac24c50c', '${SRCREV_MACHINE_INTEL_COMMON}', d)}"
-SRCREV_meta_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'b846fc6436aa5d4c747d620e83dfda969854d10c', '${SRCREV_META_INTEL_COMMON}', d)}"
-
-SRC_URI_prepend_intel-corei7-64 = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'file://fix_branch.scc ', '', d)}"
-KERNEL_FEATURES_remove_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', 'features/amt/mei/mei.scc', '', d)}"
-KERNEL_FEATURES_append_corei7-64-intel-common = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', ' features/mei/mei-spd.scc', '', d)}"
-SRC_URI_append = "${@bb.utils.contains('INTEL_MACHINE_SUBTYPE', 'broxton-m', ' file://security-tpm.cfg', '', d)}"
diff --git a/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb b/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb
deleted file mode 100644
index 36a983198..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-bsp/96boards-tools/96boards-tools_0.7.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Useful bits an pieces to make 96Boards more standard across the board"
-HOMEPAGE = "https://github.com/96boards/96boards-tools"
-SECTION = "devel"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-
-SRCREV = "193f355823d9dc38f370759153ac950a2833b0e2"
-SRC_URI = "git://github.com/96boards/96boards-tools;branch=master;protocol=https"
-
-S = "${WORKDIR}/git"
-
-inherit systemd allarch
-
-do_install () {
- install -d ${D}${sysconfdir}/udev/rules.d
- install -m 0755 ${S}/*.rules ${D}${sysconfdir}/udev/rules.d/
-
- install -d ${D}${systemd_unitdir}/system
- install -m 0644 ${S}/resize-helper.service ${D}${systemd_unitdir}/system
-
- install -d ${D}${sbindir}
- install -m 0755 ${S}/resize-helper ${D}${sbindir}
-}
-
-SYSTEMD_SERVICE_${PN} = "resize-helper.service"
-RDEPENDS_${PN} += "e2fsprogs-resize2fs gptfdisk parted util-linux udev"
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index a1eeac3d7..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index cf8a93f..21651bc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg
deleted file mode 100644
index 6f7d49880..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/ath9k_htc.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_CFG80211=m
-CONFIG_MAC80211=m
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg
deleted file mode 100644
index 327c753ae..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/hid.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_HID_MULTITOUCH=y
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg
deleted file mode 100644
index d4574700a..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/rtl_sdr.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg
deleted file mode 100644
index 7996ef1dd..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/uinput.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable the User-level Input driver (required by "wayland-fits")
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=m
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend b/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend
deleted file mode 100644
index 854b7592f..000000000
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/linux-linaro-qcomlt_4.9.bbappend
+++ /dev/null
@@ -1,30 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-# smack patches for handling bluetooth
-SRC_URI_append_smack = "\
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
-
-# Extra configuration options
-SRC_URI += "file://fanotify.cfg \
- file://uinput.cfg \
- file://hid.cfg "
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/fanotify.cfg ${WORKDIR}/uinput.cfg ${WORKDIR}/hid.cfg"
-
-# Enable support for TP-Link TL-W722N USB Wifi adapter
-SRC_URI += " file://ath9k_htc.cfg "
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg"
-
-# Enable support for RTLSDR
-SRC_URI += " file://rtl_sdr.cfg "
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg"
-
-# Enable support for smack
-KERNEL_CONFIG_FRAGMENTS_append_smack = "\
- ${WORKDIR}/audit.cfg \
- ${WORKDIR}/smack.cfg \
- ${WORKDIR}/smack-default-lsm.cfg \
-"
-
-# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend
deleted file mode 100644
index adb19c09c..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-RDEPENDS_${PN}_append_sota += " u-boot-otascript"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
index 9222fd52a..248623699 100644
--- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
@@ -1,23 +1,46 @@
DISABLE_OVERSCAN = "1"
+TOTAL_BOARD_MEM = "3072"
-do_deploy_append() {
+do_deploy:append:raspberrypi4() {
+ # ENABLE CAN
+ if [ "${ENABLE_CAN}" = "1" ]; then
+ echo "# Enable CAN" >>${DEPLOYDIR}/bootfiles/config.txt
+ echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bootfiles/config.txt
+ fi
+
+ # Handle setup with armstub file
+ if [ -n "${ARMSTUB}" ]; then
+ echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "armstub=${ARMSTUB}" >> ${DEPLOYDIR}/bootfiles/config.txt
+ case "${ARMSTUB}" in
+ *-gic.bin)
+ echo "enable_gic=1" >> ${DEPLOYDIR}/bootfiles/config.txt
+ ;;
+ esac
+ fi
+
+ if [ "${AGL_XEN_WANTED}" = "1" ]; then
+ echo "total_mem=${TOTAL_BOARD_MEM}" >> ${DEPLOYDIR}/bootfiles/config.txt
+ fi
+}
+
+do_deploy:append() {
if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then
- sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bootfiles/config.txt
fi
if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then
- sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bootfiles/config.txt
fi
- echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
- echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
- echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
- echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
- echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+ echo "avoid_warnings=2" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "dtparam=audio=on" >> ${DEPLOYDIR}/bootfiles/config.txt
}
-do_deploy_append_sota() {
- echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+do_deploy:append:raspberrypi4() {
+ echo -e "\n[pi4]" >> ${DEPLOYDIR}/bootfiles/config.txt
+ echo "max_framebuffers=2" >> ${DEPLOYDIR}/bootfiles/config.txt
}
-
-ENABLE_UART_raspberrypi3 = "1"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd
new file mode 100644
index 000000000..24cfb1658
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot_xen.cmd
@@ -0,0 +1,45 @@
+#
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2020, MERA
+#
+# Author: Leonid Lazarev
+#
+# Xen Boot Script
+#
+# https://www.raspberrypi.org/documentation/configuration/device-tree.md
+# We do not set fdt_addr, because device tree initially is loaded by raspberry pi firmware loader and the particular
+# modification are performed. The prepared DTS is propagated to u-boot and this prepared device tree has to be reused.
+
+setenv kernel_addr_r 0x00480000 # 16M
+setenv xen_addr_r 0x00200000 # 2M
+
+# Load xen to ${xen_addr_r}.
+fatload mmc 0:1 ${xen_addr_r} /xen-@@MACHINE@@
+
+#configure dom0
+fdt addr ${fdt_addr}
+
+#read prepared bootargs, rapsberry pi prepared initial list of the parameters for loading
+fdt get value bootargs /chosen bootargs
+fdt resize 8192
+
+# add device type for raspberry
+fdt set pcie0 device_type "pci"
+
+fdt chosen
+fdt set /chosen \#address-cells <1>
+fdt set /chosen \#size-cells <1>
+
+# Load Linux Image to ${kernel_addr_r}
+fatload mmc 0:1 ${kernel_addr_r} /@@KERNEL_IMAGETYPE@@
+
+# we load dom0 with 1512 MB of memory
+fdt mknod /chosen dom0
+fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/soc/serial@7e215040 sync_console dom0_mem=1512M bootscrub=0"
+fdt set /chosen xen,dom0-bootargs "${bootargs}"
+
+fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module"
+fdt set /chosen/dom0 reg <${kernel_addr_r} 0x${filesize} >
+
+@@KERNEL_BOOTCMD@@ ${xen_addr_r} - ${fdt_addr}
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
new file mode 100644
index 000000000..1e9f47d23
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append =" \
+ ${@bb.utils.contains('AGL_XEN_WANTED','1',' file://boot_xen.cmd','',d)} \
+"
+
+do_compile:append() {
+
+ # if xen feature is activated we overwirte the boot script with xen specific one
+ if [ "${AGL_XEN_WANTED}" = "1" ]; then
+ sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \
+ -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \
+ -e 's/@@MACHINE@@/${MACHINE}/' \
+ "${WORKDIR}/boot_xen.cmd" > "${WORKDIR}/boot.cmd"
+
+ mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr
+ fi
+} \ No newline at end of file
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
index 611119f09..062bddb93 100644
--- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
@@ -1,7 +1,21 @@
-fdt_addr_r=0x0c800000
-bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs
-bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
-bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 coherent_pool=6M smsc95xx.turbo_mode=N"
-bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image
-bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
-bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run
+bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
+bootcmd_otenv=run bootcmd_resetvars; load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}
+
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1 coherent_pool=6M smsc95xx.turbo_mode=N"
+
+bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
+
+bootcmd_fitconf=run bootcmd_getroot; if test -e mmc 0:2 "${ostree_root}/usr/lib/fit_conf"; then load mmc 0:2 $loadaddr "${ostree_root}/usr/lib/fit_conf"; env import -t $loadaddr $filesize; fi
+
+bootcmd_load=load mmc 0:2 $ramdisk_addr_r "/boot"$kernel_image
+bootcmd_run=bootm "${ramdisk_addr_r}${fit_conf}"
+
+bootcmd_create_envfile=if test ! -e mmc 0:1 uboot.env; then saveenv; fi;
+
+bootlimit=3
+
+bootcmd=if test "${rollback}" = "1"; then run altbootcmd; else run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; if ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
+
+bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi
+altbootcmd=run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_set_rollback; if test -n "${kernel_image2}"; then run bootcmd_rollbackenv; fi; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; reset
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
index f6c05709b..436fe95fe 100644
--- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
@@ -1,7 +1,21 @@
-fdt_addr_r=0x0c800000
-bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs
-bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
-bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192"
-bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image
-bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
-bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run
+bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
+bootcmd_otenv=run bootcmd_resetvars; load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}
+
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1"
+
+bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
+
+bootcmd_fitconf=run bootcmd_getroot; if test -e mmc 0:2 "${ostree_root}/usr/lib/fit_conf"; then load mmc 0:2 $loadaddr "${ostree_root}/usr/lib/fit_conf"; env import -t $loadaddr $filesize; fi
+
+bootcmd_load=load mmc 0:2 $ramdisk_addr_r "/boot"$kernel_image
+bootcmd_run=bootm "${ramdisk_addr_r}${fit_conf}"
+
+bootcmd_create_envfile=if test ! -e mmc 0:1 uboot.env; then saveenv; fi;
+
+bootlimit=3
+
+bootcmd=if test "${rollback}" = "1"; then run altbootcmd; else run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; if ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
+
+bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi
+altbootcmd=run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_set_rollback; if test -n "${kernel_image2}"; then run bootcmd_rollbackenv; fi; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; reset
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch
deleted file mode 100644
index d2d67558b..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Configure checks for compiler to be gcc and then it enables asm_offsets
-generation. see
-
-https://cgit.freedesktop.org/mesa/mesa/commit/?id=73c9b4b0e05fc66629ba250846948dc55c0e7a0d
-
-However, we missed the check when enabling this on cross compilation
-when architecture for both host and target is x86
-
-Fixes errors like
-./gen_matypes > matypes.h
-/bin/bash: ./gen_matypes: No such file or directory
-
--Khem
-
-Upstream-Status: Submitted
-
-Index: mesa-12.0.1/configure.ac
-===================================================================
---- mesa-12.0.1.orig/configure.ac
-+++ mesa-12.0.1/configure.ac
-@@ -732,7 +732,7 @@ test "x$enable_asm" = xno && AC_MSG_RESU
- if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then
- case "$host_cpu" in
- i?86 | x86_64 | amd64)
-- if test "x$host_cpu" != "x$target_cpu"; then
-+ if test "x$host_cpu" != "x$target_cpu" -o "x$acv_mesa_CLANG" = xyes; then
- enable_asm=no
- AC_MSG_RESULT([no, cross compiling])
- fi
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
deleted file mode 100644
index e4461ef17..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-endianness check is OS wide and not specific to libc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-Index: mesa-11.1.1/src/gallium/include/pipe/p_config.h
-===================================================================
---- mesa-11.1.1.orig/src/gallium/include/pipe/p_config.h
-+++ mesa-11.1.1/src/gallium/include/pipe/p_config.h
-@@ -130,7 +130,7 @@
- * Endian detection.
- */
-
--#ifdef __GLIBC__
-+#if defined(__linux__)
- #include <endian.h>
-
- #if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb
deleted file mode 100644
index f06a3e9b5..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-gl_12.0.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require mesa_${PV}.bb
-
-SUMMARY += " (OpenGL only, no EGL/GLES)"
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
-
-PROVIDES = "virtual/libgl virtual/mesa"
-
-S = "${WORKDIR}/mesa-${PV}"
-
-PACKAGECONFIG ??= "dri ${MESA_CRYPTO} ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-
-EXCLUDE_FROM_WORLD = "1"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc
deleted file mode 100644
index e4880ffed..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa.inc
+++ /dev/null
@@ -1,191 +0,0 @@
-SUMMARY = "A free implementation of the OpenGL API"
-DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
-a system for rendering interactive 3D graphics. \
-A variety of device drivers allows Mesa to be used in many different environments \
-ranging from software emulation to complete hardware acceleration for modern GPUs. \
-Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
-environment."
-
-HOMEPAGE = "http://mesa3d.org"
-BUGTRACKER = "https://bugs.freedesktop.org"
-SECTION = "x11"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://docs/license.html;md5=899fbe7e42d494c7c8c159c7001693d5"
-
-PE = "2"
-
-DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
-
-PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
-
-inherit autotools pkgconfig pythonnative gettext distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "opengl"
-
-EXTRA_OECONF = "--enable-shared-glapi"
-
-PACKAGECONFIG ??= "gbm egl gles dri ${MESA_CRYPTO} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
- ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
- "
-
-PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm"
-
-X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
-PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
-PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
-PACKAGECONFIG[wayland] = ",,wayland-native wayland"
-
-DRIDRIVERS = "swrast"
-DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
-DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
-PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
-PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
-
-PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
-
-EGL_PLATFORMS = "drm"
-EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
-EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
-PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
-
-GALLIUMDRIVERS = "swrast"
-GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
-PACKAGECONFIG[r600] = ""
-GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
-GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
-GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers
-PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
-MESA_LLVM_RELEASE ?= "3.3"
-PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
- ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
-export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
-PACKAGECONFIG[xa] = "--enable-xa, --disable-xa"
-
-# Mesa requires one of the following crypto implementation, pick one of them
-MESA_CRYPTO ??= "openssl"
-PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
-PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
-PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
-
-# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
-FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
-
-# Multiple virtual/gl providers being built breaks staging
-EXCLUDE_FROM_WORLD = "1"
-
-# Remove the mesa dependency on mesa-dev, as mesa is empty
-RDEPENDS_${PN}-dev = ""
-
-PACKAGES =+ "libegl-mesa libegl-mesa-dev \
- libosmesa libosmesa-dev \
- libgl-mesa libgl-mesa-dev \
- libglapi libglapi-dev \
- libgbm libgbm-dev \
- libgles1-mesa libgles1-mesa-dev \
- libgles2-mesa libgles2-mesa-dev \
- libgles3-mesa libgles3-mesa-dev \
- libwayland-egl libwayland-egl-dev \
- libxvmcsoftpipe libxvmcsoftpipe-dev \
- libxatracker libxatracker-dev \
- mesa-megadriver \
- "
-
-do_install_append () {
- # Drivers never need libtool .la files
- rm -f ${D}${libdir}/dri/*.la
- rm -f ${D}${libdir}/egl/*.la
- rm -f ${D}${libdir}/gallium-pipe/*.la
- rm -f ${D}${libdir}/gbm/*.la
-
- # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
- rm -f ${D}${sysconfdir}/drirc
-}
-
-# For the packages that make up the OpenGL interfaces, inject variables so that
-# they don't get Debian-renamed (which would remove the -mesa suffix), and
-# RPROVIDEs/RCONFLICTs on the generic libgl name.
-python __anonymous() {
- pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
- for p in (("egl", "libegl", "libegl1"),
- ("dri", "libgl", "libgl1"),
- ("gles", "libgles1", "libglesv1-cm1"),
- ("gles", "libgles2", "libglesv2-2"),
- ("gles", "libgles3",)):
- if not p[0] in pkgconfig:
- continue
- fullp = p[1] + "-mesa"
- pkgs = " ".join(p[1:])
- d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
- d.appendVar("RREPLACES_" + fullp, pkgs)
- d.appendVar("RPROVIDES_" + fullp, pkgs)
- d.appendVar("RCONFLICTS_" + fullp, pkgs)
-
- d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver")
-
- # For -dev, the first element is both the Debian and original name
- fullp += "-dev"
- pkgs = p[1] + "-dev"
- d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
- d.appendVar("RREPLACES_" + fullp, pkgs)
- d.appendVar("RPROVIDES_" + fullp, pkgs)
- d.appendVar("RCONFLICTS_" + fullp, pkgs)
-}
-
-python mesa_populate_packages() {
- pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
- for pkg in pkgs:
- d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
- d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
- d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
-
- import re
- dri_drivers_root = oe.path.join(d.getVar('PKGD', True), d.getVar('libdir', True), "dri")
- if os.path.isdir(dri_drivers_root):
- dri_pkgs = os.listdir(dri_drivers_root)
- lib_name = d.expand("${MLPREFIX}mesa-megadriver")
- for p in dri_pkgs:
- m = re.match('^(.*)_dri\.so$', p)
- if m:
- pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
- d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
- d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
- d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
-
- pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
- do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
-}
-
-PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
-
-PACKAGES_DYNAMIC += "^mesa-driver-.*"
-
-FILES_${PN} += "${sysconfdir}/drirc"
-FILES_mesa-megadriver = "${libdir}/dri/*"
-FILES_libegl-mesa = "${libdir}/libEGL.so.*"
-FILES_libgbm = "${libdir}/libgbm.so.*"
-FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
-FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
-FILES_libgl-mesa = "${libdir}/libGL.so.*"
-FILES_libglapi = "${libdir}/libglapi.so.*"
-FILES_libosmesa = "${libdir}/libOSMesa.so.*"
-FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
-FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
-FILES_libxatracker = "${libdir}/libxatracker.so.*"
-
-FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
-FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
-FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
-FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
-FILES_libglapi-dev = "${libdir}/libglapi.*"
-FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
-FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
-FILES_libgles3-mesa-dev = "${includedir}/GLES3"
-FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
-FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
-FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
-FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
- ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
- ${libdir}/pkgconfig/xatracker.pc"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb
deleted file mode 100644
index acc8353dd..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa_12.0.3.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-require ${BPN}.inc
-
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz \
- file://replace_glibc_check_with_linux.patch \
- file://disable-asm-on-non-gcc.patch \
-"
-
-SRC_URI[md5sum] = "1113699c714042d8c4df4766be8c57d8"
-SRC_URI[sha256sum] = "1dc86dd9b51272eee1fad3df65e18cda2e556ef1bc0b6e07cd750b9757f493b1"
-
-#because we cannot rely on the fact that all apps will use pkgconfig,
-#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
-do_install_append() {
- if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
- sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
- fi
-}
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend
deleted file mode 100644
index 14b858d45..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-# Disable LVDS
-WESTONOUTPUT2[agl_screen] ??= "SCREEN_DSI"
-
-WESTONSECTION[WESTONOUTPUT2] = "output"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
new file mode 100644
index 000000000..c5edbe1dc
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Combine dtb and dtbo"
+DESCRIPTION = "Combine specified dtb and one or more dtbo into specified filename found in deploydir"
+SECTION = "bootloader"
+PR = "r1"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "dtc-native"
+
+ALLOW_EMPTY:${PN} = "1"
+FILES:${PN} = ""
+
+S = "${WORKDIR}"
+
+do_compile[depends] += "virtual/kernel:do_deploy"
+
+do_compile () {
+ # Plain VC4 (HDMI)
+ if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" ]; then
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4.dtb \
+ ${DEPLOY_DIR_IMAGE}/${VC4DTBO}-pi4.dtbo
+ fi
+
+ # VC4 + LCD
+ if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" -a -f "${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo" ]; then
+ fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4+ft5406.dtb \
+ ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo \
+ ${DEPLOY_DIR_IMAGE}/${VC4DTBO}-pi4.dtbo
+ fi
+
+}
+
+do_deploy () {
+ install -d ${DEPLOY_DIR_IMAGE}
+ if [ -f "${S}/bcm2711-rpi-4-b+vc4+ft5406.dtb" ]; then
+ install -m 0644 ${S}/bcm2711-rpi-4-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+ if [ -f "${S}/bcm2711-rpi-4-b+vc4.dtb" ]; then
+ install -m 0644 ${S}/bcm2711-rpi-4-b+vc4.dtb ${DEPLOY_DIR_IMAGE}
+ fi
+}
+
+addtask deploy after do_install
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend
new file mode 100644
index 000000000..a28a9e748
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/dtc_1.7.0.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch
new file mode 100644
index 000000000..0f275f1ac
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/dtc/files/0001-fdtoverlay-Prevent-overlays-from-modifying-phandle-p.patch
@@ -0,0 +1,154 @@
+From caba0117dc30f2357eac6d04f3510095dcbaa7f4 Mon Sep 17 00:00:00 2001
+From: Paul Barker <pbarker@konsulko.com>
+Date: Fri, 18 Dec 2020 23:00:07 +0000
+Subject: [PATCH] fdtoverlay: Prevent overlays from modifying phandle
+ properties
+To: David Gibson <david@gibson.dropbear.id.au>,
+ Jon Loeliger <jdl@jdl.com>,
+ devicetree-compiler@vger.kernel.org
+Cc: Rob Herring <robh@kernel.org>,
+ Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
+ Scott Murray <scott.murray@konsulko.com>,
+ Jan Simon Moeller <jsmoeller@linuxfoundation.org>
+
+When applying an overlay fragment, we should take care not to overwrite
+an existing phandle property of the target node as this could break
+references to the target node elsewhere in the base dtb.
+
+In addition to potentially breaking references within the resulting fdt,
+if the overlay is built with symbols enabled (`-@` option to dtc) then
+fdtoverlay will be unable to merge the overlay with a base dtb file.
+
+A new test case is added to check how fdtoverlay handles this case.
+Attempting to apply this test overlay without the fix in this patch
+results in the following output:
+
+ input = tests/overlay_base_ref.test.dtb
+ output = tests/overlay_overlay_ref.fdtoverlay.dtb
+ overlay[0] = tests/overlay_overlay_ref.test.dtb
+
+ Failed to apply 'tests/overlay_overlay_ref.test.dtb': FDT_ERR_NOTFOUND
+
+In this test case the __overlay__ node in question does not explicitly
+contain a phandle property in the dts file, the phandle is added during
+compilation as it is referenced by another node within the overlay dts.
+
+This failure occurs due to a sequence of events in the functions called
+by fdt_overlay_apply():
+
+1) In overlay_fixup_phandles(), the target of the overlay fragment is
+ looked up and the target property is set to the phandle of the target
+ node.
+
+2) In overlay_merge(), the target node is looked up by phandle via
+ overlay_get_target(). As the __overlay__ node in this test case
+ itself has a phandle property, the phandle of the target node is
+ modified.
+
+3) In overlay_symbol_update(), the target node is again looked up by
+ phandle via overlay_get_target(). But this time the target node
+ cannot be found as its phandle property was modified.
+
+The fix for this issue is to skip modification of the phandle property
+of the target node in step (2) of the above sequence. If the target node
+doesn't already contain a phandle property, we can add one without risk.
+
+Upstream-Status: Submitted
+ https://www.spinics.net/lists/devicetree-compiler/msg03537.html
+Signed-off-by: Paul Barker <pbarker@konsulko.com>
+---
+ libfdt/fdt_overlay.c | 2 ++
+ tests/overlay_base_ref.dts | 19 +++++++++++++++++++
+ tests/overlay_overlay_ref.dts | 24 ++++++++++++++++++++++++
+ tests/run_tests.sh | 5 +++++
+ 4 files changed, 50 insertions(+)
+ create mode 100644 tests/overlay_base_ref.dts
+ create mode 100644 tests/overlay_overlay_ref.dts
+
+diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
+index d217e79..b3c217a 100644
+--- a/libfdt/fdt_overlay.c
++++ b/libfdt/fdt_overlay.c
+@@ -573,6 +573,8 @@ static int overlay_apply_node(void *fdt, int target,
+ if (prop_len < 0)
+ return prop_len;
+
++ if (!strcmp(name, "phandle") && fdt_getprop(fdt, target, name, NULL))
++ continue;
+ ret = fdt_setprop(fdt, target, name, prop, prop_len);
+ if (ret)
+ return ret;
+diff --git a/tests/overlay_base_ref.dts b/tests/overlay_base_ref.dts
+new file mode 100644
+index 0000000..1fc02a2
+--- /dev/null
++++ b/tests/overlay_base_ref.dts
+@@ -0,0 +1,19 @@
++/*
++ * Copyright (c) 2016 NextThing Co
++ * Copyright (c) 2016 Free Electrons
++ * Copyright (c) 2016 Konsulko Inc.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/dts-v1/;
++
++/ {
++ test: test-node {
++ test-int-property = <42>;
++ };
++
++ test-refs {
++ refs = <&test>;
++ };
++};
+diff --git a/tests/overlay_overlay_ref.dts b/tests/overlay_overlay_ref.dts
+new file mode 100644
+index 0000000..a45c95d
+--- /dev/null
++++ b/tests/overlay_overlay_ref.dts
+@@ -0,0 +1,24 @@
++/*
++ * Copyright (c) 2016 NextThing Co
++ * Copyright (c) 2016 Free Electrons
++ * Copyright (c) 2016 Konsulko Inc.
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ */
++
++/dts-v1/;
++/plugin/;
++
++/ {
++ fragment@0 {
++ target = <&test>;
++
++ frag0: __overlay__ {
++ test-int-property = <43>;
++ };
++ };
++
++ test-ref {
++ ref = <&frag0>;
++ };
++};
+diff --git a/tests/run_tests.sh b/tests/run_tests.sh
+index 294585b..a65b166 100755
+--- a/tests/run_tests.sh
++++ b/tests/run_tests.sh
+@@ -329,6 +329,11 @@ dtc_overlay_tests () {
+ run_test check_path overlay_base_with_aliases.dtb not-exists "/__symbols__"
+ run_test check_path overlay_base_with_aliases.dtb not-exists "/__fixups__"
+ run_test check_path overlay_base_with_aliases.dtb not-exists "/__local_fixups__"
++
++ # Test taking a reference to an overlay fragment
++ run_dtc_test -@ -I dts -O dtb -o overlay_base_ref.test.dtb "$SRCDIR/overlay_base_ref.dts"
++ run_dtc_test -@ -I dts -O dtb -o overlay_overlay_ref.test.dtb "$SRCDIR/overlay_overlay_ref.dts"
++ run_wrap_test $FDTOVERLAY -i overlay_base_ref.test.dtb overlay_overlay_ref.test.dtb -o overlay_overlay_ref.fdtoverlay.dtb
+ }
+
+ tree1_tests () {
+--
+2.26.2
+
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch
deleted file mode 100644
index e9fafad74..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-mm-larger-stack-guard-gap-between-vmas.patch
+++ /dev/null
@@ -1,900 +0,0 @@
-From 3982d0807e02909957990f194c5ed2ffb6ab6c35 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Mon, 19 Jun 2017 04:03:24 -0700
-Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas
-
-commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream.
-
-Stack guard page is a useful feature to reduce a risk of stack smashing
-into a different mapping. We have been using a single page gap which
-is sufficient to prevent having stack adjacent to a different mapping.
-But this seems to be insufficient in the light of the stack usage in
-userspace. E.g. glibc uses as large as 64kB alloca() in many commonly
-used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX]
-which is 256kB or stack strings with MAX_ARG_STRLEN.
-
-This will become especially dangerous for suid binaries and the default
-no limit for the stack size limit because those applications can be
-tricked to consume a large portion of the stack and a single glibc call
-could jump over the guard page. These attacks are not theoretical,
-unfortunatelly.
-
-Make those attacks less probable by increasing the stack guard gap
-to 1MB (on systems with 4k pages; but make it depend on the page size
-because systems with larger base pages might cap stack allocations in
-the PAGE_SIZE units) which should cover larger alloca() and VLA stack
-allocations. It is obviously not a full fix because the problem is
-somehow inherent, but it should reduce attack space a lot.
-
-One could argue that the gap size should be configurable from userspace,
-but that can be done later when somebody finds that the new 1MB is wrong
-for some special case applications. For now, add a kernel command line
-option (stack_guard_gap) to specify the stack gap size (in page units).
-
-Implementation wise, first delete all the old code for stack guard page:
-because although we could get away with accounting one extra page in a
-stack vma, accounting a larger gap can break userspace - case in point,
-a program run with "ulimit -S -v 20000" failed when the 1MB gap was
-counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK
-and strict non-overcommit mode.
-
-Instead of keeping gap inside the stack vma, maintain the stack guard
-gap as a gap between vmas: using vm_start_gap() in place of vm_start
-(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few
-places which need to respect the gap - mainly arch_get_unmapped_area(),
-and and the vma tree's subtree_gap support for that.
-
-Original-patch-by: Oleg Nesterov <oleg@redhat.com>
-Original-patch-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Tested-by: Helge Deller <deller@gmx.de> # parisc
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-[wt: backport to 4.11: adjust context]
-[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide]
-[wt: backport to 4.4: adjust context ; drop ppc hugetlb_radix changes]
-Signed-off-by: Willy Tarreau <w@1wt.eu>
-[gkh: minor build fixes for 4.4]
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- Documentation/kernel-parameters.txt | 7 ++
- arch/arc/mm/mmap.c | 2 +-
- arch/arm/mm/mmap.c | 4 +-
- arch/frv/mm/elf-fdpic.c | 2 +-
- arch/mips/mm/mmap.c | 2 +-
- arch/parisc/kernel/sys_parisc.c | 15 ++--
- arch/powerpc/mm/slice.c | 2 +-
- arch/s390/mm/mmap.c | 4 +-
- arch/sh/mm/mmap.c | 4 +-
- arch/sparc/kernel/sys_sparc_64.c | 4 +-
- arch/sparc/mm/hugetlbpage.c | 2 +-
- arch/tile/mm/hugetlbpage.c | 2 +-
- arch/x86/kernel/sys_x86_64.c | 4 +-
- arch/x86/mm/hugetlbpage.c | 2 +-
- arch/xtensa/kernel/syscall.c | 2 +-
- fs/hugetlbfs/inode.c | 2 +-
- fs/proc/task_mmu.c | 4 -
- include/linux/mm.h | 53 ++++++-------
- mm/gup.c | 5 --
- mm/memory.c | 38 ---------
- mm/mmap.c | 149 +++++++++++++++++++++---------------
- 21 files changed, 149 insertions(+), 160 deletions(-)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index c360f80..9738c8b 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -3576,6 +3576,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- spia_pedr=
- spia_peddr=
-
-+ stack_guard_gap= [MM]
-+ override the default stack gap protection. The value
-+ is in page units and it defines how many pages prior
-+ to (for stacks growing down) resp. after (for stacks
-+ growing up) the main stack are reserved for no other
-+ mapping. Default value is 256 pages.
-+
- stacktrace [FTRACE]
- Enabled the stack tracer on boot up.
-
-diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c
-index 2e06d56..cf4ae69 100644
---- a/arch/arc/mm/mmap.c
-+++ b/arch/arc/mm/mmap.c
-@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 407dc78..c469c06 100644
---- a/arch/arm/mm/mmap.c
-+++ b/arch/arm/mm/mmap.c
-@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
-index 836f147..efa59f1 100644
---- a/arch/frv/mm/elf-fdpic.c
-+++ b/arch/frv/mm/elf-fdpic.c
-@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
- addr = PAGE_ALIGN(addr);
- vma = find_vma(current->mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- goto success;
- }
-
-diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
-index 5c81fdd..025cb31 100644
---- a/arch/mips/mm/mmap.c
-+++ b/arch/mips/mm/mmap.c
-@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
-index 5aba01a..4dda73c 100644
---- a/arch/parisc/kernel/sys_parisc.c
-+++ b/arch/parisc/kernel/sys_parisc.c
-@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- unsigned long task_size = TASK_SIZE;
- int do_color_align, last_mmap;
- struct vm_unmapped_area_info info;
-@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- else
- addr = PAGE_ALIGN(addr);
-
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- int do_color_align, last_mmap;
-@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = COLOR_ALIGN(addr, last_mmap, pgoff);
- else
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index 0f432a7..6ad12b2 100644
---- a/arch/powerpc/mm/slice.c
-+++ b/arch/powerpc/mm/slice.c
-@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
- if ((mm->task_size - len) < addr)
- return 0;
- vma = find_vma(mm, addr);
-- return (!vma || (addr + len) <= vma->vm_start);
-+ return (!vma || (addr + len) <= vm_start_gap(vma));
- }
-
- static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index f2b6b1d..126c4a9 100644
---- a/arch/s390/mm/mmap.c
-+++ b/arch/s390/mm/mmap.c
-@@ -97,7 +97,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -135,7 +135,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
-index 6777177..7df7d59 100644
---- a/arch/sh/mm/mmap.c
-+++ b/arch/sh/mm/mmap.c
-@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index c690c8e..7f0f7c01 100644
---- a/arch/sparc/kernel/sys_sparc_64.c
-+++ b/arch/sparc/kernel/sys_sparc_64.c
-@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
-index da11424..ffa842b 100644
---- a/arch/sparc/mm/hugetlbpage.c
-+++ b/arch/sparc/mm/hugetlbpage.c
-@@ -115,7 +115,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, HPAGE_SIZE);
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
-index c034dc3..c97ee6c 100644
---- a/arch/tile/mm/hugetlbpage.c
-+++ b/arch/tile/mm/hugetlbpage.c
-@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (current->mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index 10e0272..136ad7c 100644
---- a/arch/x86/kernel/sys_x86_64.c
-+++ b/arch/x86/kernel/sys_x86_64.c
-@@ -143,7 +143,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (end - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -186,7 +186,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
-index 42982b2..39bdaf3 100644
---- a/arch/x86/mm/hugetlbpage.c
-+++ b/arch/x86/mm/hugetlbpage.c
-@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c
-index 83cf496..3aaaae1 100644
---- a/arch/xtensa/kernel/syscall.c
-+++ b/arch/xtensa/kernel/syscall.c
-@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- /* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_SIZE - len < addr)
- return -ENOMEM;
-- if (!vmm || addr + len <= vmm->vm_start)
-+ if (!vmm || addr + len <= vm_start_gap(vmm))
- return addr;
- addr = vmm->vm_end;
- if (flags & MAP_SHARED)
-diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index 595ebdb..a17da8b5 100644
---- a/fs/hugetlbfs/inode.c
-+++ b/fs/hugetlbfs/inode.c
-@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index d598b9c..cb7020c 100644
---- a/fs/proc/task_mmu.c
-+++ b/fs/proc/task_mmu.c
-@@ -295,11 +295,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
-
- /* We don't show the stack guard page in /proc/maps */
- start = vma->vm_start;
-- if (stack_guard_page_start(vma, start))
-- start += PAGE_SIZE;
- end = vma->vm_end;
-- if (stack_guard_page_end(vma, end))
-- end -= PAGE_SIZE;
-
- seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
- seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
-diff --git a/include/linux/mm.h b/include/linux/mm.h
-index f0ffa01..55f950a 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1278,39 +1278,11 @@ int clear_page_dirty_for_io(struct page *page);
-
- int get_cmdline(struct task_struct *task, char *buffer, int buflen);
-
--/* Is the vma a continuation of the stack vma above it? */
--static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
--}
--
- static inline bool vma_is_anonymous(struct vm_area_struct *vma)
- {
- return !vma->vm_ops;
- }
-
--static inline int stack_guard_page_start(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSDOWN) &&
-- (vma->vm_start == addr) &&
-- !vma_growsdown(vma->vm_prev, addr);
--}
--
--/* Is the vma a continuation of the stack vma below it? */
--static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP);
--}
--
--static inline int stack_guard_page_end(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSUP) &&
-- (vma->vm_end == addr) &&
-- !vma_growsup(vma->vm_next, addr);
--}
--
- int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t);
-
- extern unsigned long move_page_tables(struct vm_area_struct *vma,
-@@ -2012,6 +1984,7 @@ void page_cache_async_readahead(struct address_space *mapping,
- pgoff_t offset,
- unsigned long size);
-
-+extern unsigned long stack_guard_gap;
- /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
- extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
-
-@@ -2040,6 +2013,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
- return vma;
- }
-
-+static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_start = vma->vm_start;
-+
-+ if (vma->vm_flags & VM_GROWSDOWN) {
-+ vm_start -= stack_guard_gap;
-+ if (vm_start > vma->vm_start)
-+ vm_start = 0;
-+ }
-+ return vm_start;
-+}
-+
-+static inline unsigned long vm_end_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_end = vma->vm_end;
-+
-+ if (vma->vm_flags & VM_GROWSUP) {
-+ vm_end += stack_guard_gap;
-+ if (vm_end < vma->vm_end)
-+ vm_end = -PAGE_SIZE;
-+ }
-+ return vm_end;
-+}
-+
- static inline unsigned long vma_pages(struct vm_area_struct *vma)
- {
- return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-diff --git a/mm/gup.c b/mm/gup.c
-index 4b0b7e7..b599526 100644
---- a/mm/gup.c
-+++ b/mm/gup.c
-@@ -312,11 +312,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
- /* mlock all present pages, but do not fault in new pages */
- if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK)
- return -ENOENT;
-- /* For mm_populate(), just skip the stack guard page. */
-- if ((*flags & FOLL_POPULATE) &&
-- (stack_guard_page_start(vma, address) ||
-- stack_guard_page_end(vma, address + PAGE_SIZE)))
-- return -ENOENT;
- if (*flags & FOLL_WRITE)
- fault_flags |= FAULT_FLAG_WRITE;
- if (nonblocking)
-diff --git a/mm/memory.c b/mm/memory.c
-index 76dcee3..e6fa134 100644
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -2662,40 +2662,6 @@ out_release:
- }
-
- /*
-- * This is like a special single-page "expand_{down|up}wards()",
-- * except we must first make sure that 'address{-|+}PAGE_SIZE'
-- * doesn't hit another vma.
-- */
--static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
--{
-- address &= PAGE_MASK;
-- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
-- struct vm_area_struct *prev = vma->vm_prev;
--
-- /*
-- * Is there a mapping abutting this one below?
-- *
-- * That's only ok if it's the same stack mapping
-- * that has gotten split..
-- */
-- if (prev && prev->vm_end == address)
-- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
--
-- return expand_downwards(vma, address - PAGE_SIZE);
-- }
-- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
-- struct vm_area_struct *next = vma->vm_next;
--
-- /* As VM_GROWSDOWN but s/below/above/ */
-- if (next && next->vm_start == address + PAGE_SIZE)
-- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
--
-- return expand_upwards(vma, address + PAGE_SIZE);
-- }
-- return 0;
--}
--
--/*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2715,10 +2681,6 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
- if (vma->vm_flags & VM_SHARED)
- return VM_FAULT_SIGBUS;
-
-- /* Check if we need to add a guard page to the stack */
-- if (check_stack_guard_page(vma, address) < 0)
-- return VM_FAULT_SIGSEGV;
--
- /* Use the zero-page for reads */
- if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm)) {
- entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 455772a..5e043dd 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -288,6 +288,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- unsigned long retval;
- unsigned long newbrk, oldbrk;
- struct mm_struct *mm = current->mm;
-+ struct vm_area_struct *next;
- unsigned long min_brk;
- bool populate;
-
-@@ -332,7 +333,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- }
-
- /* Check against existing mmap mappings. */
-- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE))
-+ next = find_vma(mm, oldbrk);
-+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next))
- goto out;
-
- /* Ok, looks good - let it rip. */
-@@ -355,10 +357,22 @@ out:
-
- static long vma_compute_subtree_gap(struct vm_area_struct *vma)
- {
-- unsigned long max, subtree_gap;
-- max = vma->vm_start;
-- if (vma->vm_prev)
-- max -= vma->vm_prev->vm_end;
-+ unsigned long max, prev_end, subtree_gap;
-+
-+ /*
-+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we
-+ * allow two stack_guard_gaps between them here, and when choosing
-+ * an unmapped area; whereas when expanding we only require one.
-+ * That's a little inconsistent, but keeps the code here simpler.
-+ */
-+ max = vm_start_gap(vma);
-+ if (vma->vm_prev) {
-+ prev_end = vm_end_gap(vma->vm_prev);
-+ if (max > prev_end)
-+ max -= prev_end;
-+ else
-+ max = 0;
-+ }
- if (vma->vm_rb.rb_left) {
- subtree_gap = rb_entry(vma->vm_rb.rb_left,
- struct vm_area_struct, vm_rb)->rb_subtree_gap;
-@@ -451,7 +465,7 @@ static void validate_mm(struct mm_struct *mm)
- anon_vma_unlock_read(anon_vma);
- }
-
-- highest_address = vma->vm_end;
-+ highest_address = vm_end_gap(vma);
- vma = vma->vm_next;
- i++;
- }
-@@ -620,7 +634,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = vma->vm_end;
-+ mm->highest_vm_end = vm_end_gap(vma);
-
- /*
- * vma->vm_prev wasn't known when we followed the rbtree to find the
-@@ -866,7 +880,7 @@ again: remove_next = 1 + (end > next->vm_end);
- vma_gap_update(vma);
- if (end_changed) {
- if (!next)
-- mm->highest_vm_end = end;
-+ mm->highest_vm_end = vm_end_gap(vma);
- else if (!adjust_next)
- vma_gap_update(next);
- }
-@@ -909,7 +923,7 @@ again: remove_next = 1 + (end > next->vm_end);
- else if (next)
- vma_gap_update(next);
- else
-- mm->highest_vm_end = end;
-+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
- }
- if (insert && file)
- uprobe_mmap(insert);
-@@ -1741,7 +1755,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit left subtree if it looks promising */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end >= low_limit && vma->vm_rb.rb_left) {
- struct vm_area_struct *left =
- rb_entry(vma->vm_rb.rb_left,
-@@ -1752,7 +1766,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- }
- }
-
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- check_current:
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
-@@ -1779,8 +1793,8 @@ check_current:
- vma = rb_entry(rb_parent(prev),
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_left) {
-- gap_start = vma->vm_prev->vm_end;
-- gap_end = vma->vm_start;
-+ gap_start = vm_end_gap(vma->vm_prev);
-+ gap_end = vm_start_gap(vma);
- goto check_current;
- }
- }
-@@ -1844,7 +1858,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit right subtree if it looks promising */
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- if (gap_start <= high_limit && vma->vm_rb.rb_right) {
- struct vm_area_struct *right =
- rb_entry(vma->vm_rb.rb_right,
-@@ -1857,7 +1871,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- check_current:
- /* Check if current node has a suitable gap */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
- if (gap_start <= high_limit && gap_end - gap_start >= length)
-@@ -1883,7 +1897,7 @@ check_current:
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_right) {
- gap_start = vma->vm_prev ?
-- vma->vm_prev->vm_end : 0;
-+ vm_end_gap(vma->vm_prev) : 0;
- goto check_current;
- }
- }
-@@ -1921,7 +1935,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct vm_unmapped_area_info info;
-
- if (len > TASK_SIZE - mmap_min_addr)
-@@ -1932,9 +1946,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -1957,7 +1972,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- struct vm_unmapped_area_info info;
-@@ -1972,9 +1987,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- /* requesting a specific address */
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -2099,21 +2115,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
- * update accounting. This is shared with both the
- * grow-up and grow-down cases.
- */
--static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow)
-+static int acct_stack_growth(struct vm_area_struct *vma,
-+ unsigned long size, unsigned long grow)
- {
- struct mm_struct *mm = vma->vm_mm;
- struct rlimit *rlim = current->signal->rlim;
-- unsigned long new_start, actual_size;
-+ unsigned long new_start;
-
- /* address space limit tests */
- if (!may_expand_vm(mm, grow))
- return -ENOMEM;
-
- /* Stack limit test */
-- actual_size = size;
-- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
-- actual_size -= PAGE_SIZE;
-- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
-+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
- return -ENOMEM;
-
- /* mlock limit tests */
-@@ -2151,17 +2165,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
- int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *next;
-+ unsigned long gap_addr;
- int error = 0;
-
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
- /* Guard against wrapping around to address 0. */
-- if (address < PAGE_ALIGN(address+4))
-- address = PAGE_ALIGN(address+4);
-- else
-+ address &= PAGE_MASK;
-+ address += PAGE_SIZE;
-+ if (!address)
- return -ENOMEM;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address + stack_guard_gap;
-+ if (gap_addr < address)
-+ return -ENOMEM;
-+ next = vma->vm_next;
-+ if (next && next->vm_start < gap_addr) {
-+ if (!(next->vm_flags & VM_GROWSUP))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2206,7 +2233,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = address;
-+ mm->highest_vm_end = vm_end_gap(vma);
- spin_unlock(&mm->page_table_lock);
-
- perf_event_mmap(vma);
-@@ -2227,6 +2254,8 @@ int expand_downwards(struct vm_area_struct *vma,
- unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *prev;
-+ unsigned long gap_addr;
- int error;
-
- address &= PAGE_MASK;
-@@ -2234,6 +2263,17 @@ int expand_downwards(struct vm_area_struct *vma,
- if (error)
- return error;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address - stack_guard_gap;
-+ if (gap_addr > address)
-+ return -ENOMEM;
-+ prev = vma->vm_prev;
-+ if (prev && prev->vm_end > gap_addr) {
-+ if (!(prev->vm_flags & VM_GROWSDOWN))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2289,28 +2329,25 @@ int expand_downwards(struct vm_area_struct *vma,
- return error;
- }
-
--/*
-- * Note how expand_stack() refuses to expand the stack all the way to
-- * abut the next virtual mapping, *unless* that mapping itself is also
-- * a stack mapping. We want to leave room for a guard page, after all
-- * (the guard page itself is not added here, that is done by the
-- * actual page faulting logic)
-- *
-- * This matches the behavior of the guard page logic (see mm/memory.c:
-- * check_stack_guard_page()), which only allows the guard page to be
-- * removed under these circumstances.
-- */
-+/* enforced gap between the expanding stack and other mappings. */
-+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT;
-+
-+static int __init cmdline_parse_stack_guard_gap(char *p)
-+{
-+ unsigned long val;
-+ char *endptr;
-+
-+ val = simple_strtoul(p, &endptr, 10);
-+ if (!*endptr)
-+ stack_guard_gap = val << PAGE_SHIFT;
-+
-+ return 0;
-+}
-+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap);
-+
- #ifdef CONFIG_STACK_GROWSUP
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *next;
--
-- address &= PAGE_MASK;
-- next = vma->vm_next;
-- if (next && next->vm_start == address + PAGE_SIZE) {
-- if (!(next->vm_flags & VM_GROWSUP))
-- return -ENOMEM;
-- }
- return expand_upwards(vma, address);
- }
-
-@@ -2332,14 +2369,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
- #else
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *prev;
--
-- address &= PAGE_MASK;
-- prev = vma->vm_prev;
-- if (prev && prev->vm_end == address) {
-- if (!(prev->vm_flags & VM_GROWSDOWN))
-- return -ENOMEM;
-- }
- return expand_downwards(vma, address);
- }
-
-@@ -2437,7 +2466,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
- vma->vm_prev = prev;
- vma_gap_update(vma);
- } else
-- mm->highest_vm_end = prev ? prev->vm_end : 0;
-+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0;
- tail_vma->vm_next = NULL;
-
- /* Kill the cache */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
deleted file mode 100644
index d0c94cef2..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From cd20f002742028366c33b38b3ca613eaee4582c9 Mon Sep 17 00:00:00 2001
-From: Helge Deller <deller@gmx.de>
-Date: Mon, 19 Jun 2017 17:34:05 +0200
-Subject: [PATCH 2/3] Allow stack to grow up to address space limit
-
-commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream.
-
-Fix expand_upwards() on architectures with an upward-growing stack (parisc,
-metag and partly IA-64) to allow the stack to reliably grow exactly up to
-the address space limit given by TASK_SIZE.
-
-Signed-off-by: Helge Deller <deller@gmx.de>
-Acked-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 5e043dd..fcf4c88 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -2172,16 +2172,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
-- /* Guard against wrapping around to address 0. */
-+ /* Guard against exceeding limits of the address space. */
- address &= PAGE_MASK;
-- address += PAGE_SIZE;
-- if (!address)
-+ if (address >= TASK_SIZE)
- return -ENOMEM;
-+ address += PAGE_SIZE;
-
- /* Enforce stack_guard_gap */
- gap_addr = address + stack_guard_gap;
-- if (gap_addr < address)
-- return -ENOMEM;
-+
-+ /* Guard against overflow */
-+ if (gap_addr < address || gap_addr > TASK_SIZE)
-+ gap_addr = TASK_SIZE;
-+
- next = vma->vm_next;
- if (next && next->vm_start < gap_addr) {
- if (!(next->vm_flags & VM_GROWSUP))
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
deleted file mode 100644
index 3f0acfa29..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 1c182004bcb1cd619b58ba6631b9d88052d18e02 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Tue, 20 Jun 2017 02:10:44 -0700
-Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown()
-
-commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream.
-
-Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of
-mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the
-end of unmapped_area_topdown(). Linus points out how MAP_FIXED
-(which does not have to respect our stack guard gap intentions)
-could result in gap_end below gap_start there. Fix that, and
-the similar case in its alternative, unmapped_area().
-
-Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
-Reported-by: Dave Jones <davej@codemonkey.org.uk>
-Debugged-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index fcf4c88..0990f8b 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -1771,7 +1771,8 @@ check_current:
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
- return -ENOMEM;
-- if (gap_end >= low_limit && gap_end - gap_start >= length)
-+ if (gap_end >= low_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit right subtree if it looks promising */
-@@ -1874,7 +1875,8 @@ check_current:
- gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
-- if (gap_start <= high_limit && gap_end - gap_start >= length)
-+ if (gap_start <= high_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit left subtree if it looks promising */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch
deleted file mode 100644
index 06fed097b..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0001-mm-larger-stack-guard-gap-between-vmas.patch
+++ /dev/null
@@ -1,935 +0,0 @@
-From d2fe80af1664f169498f6e624a8ea01e4e28efe2 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Mon, 19 Jun 2017 04:03:24 -0700
-Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas
-
-commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream.
-
-Stack guard page is a useful feature to reduce a risk of stack smashing
-into a different mapping. We have been using a single page gap which
-is sufficient to prevent having stack adjacent to a different mapping.
-But this seems to be insufficient in the light of the stack usage in
-userspace. E.g. glibc uses as large as 64kB alloca() in many commonly
-used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX]
-which is 256kB or stack strings with MAX_ARG_STRLEN.
-
-This will become especially dangerous for suid binaries and the default
-no limit for the stack size limit because those applications can be
-tricked to consume a large portion of the stack and a single glibc call
-could jump over the guard page. These attacks are not theoretical,
-unfortunatelly.
-
-Make those attacks less probable by increasing the stack guard gap
-to 1MB (on systems with 4k pages; but make it depend on the page size
-because systems with larger base pages might cap stack allocations in
-the PAGE_SIZE units) which should cover larger alloca() and VLA stack
-allocations. It is obviously not a full fix because the problem is
-somehow inherent, but it should reduce attack space a lot.
-
-One could argue that the gap size should be configurable from userspace,
-but that can be done later when somebody finds that the new 1MB is wrong
-for some special case applications. For now, add a kernel command line
-option (stack_guard_gap) to specify the stack gap size (in page units).
-
-Implementation wise, first delete all the old code for stack guard page:
-because although we could get away with accounting one extra page in a
-stack vma, accounting a larger gap can break userspace - case in point,
-a program run with "ulimit -S -v 20000" failed when the 1MB gap was
-counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK
-and strict non-overcommit mode.
-
-Instead of keeping gap inside the stack vma, maintain the stack guard
-gap as a gap between vmas: using vm_start_gap() in place of vm_start
-(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few
-places which need to respect the gap - mainly arch_get_unmapped_area(),
-and and the vma tree's subtree_gap support for that.
-
-Original-patch-by: Oleg Nesterov <oleg@redhat.com>
-Original-patch-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Tested-by: Helge Deller <deller@gmx.de> # parisc
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-[wt: backport to 4.11: adjust context]
-[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide]
-Signed-off-by: Willy Tarreau <w@1wt.eu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- Documentation/kernel-parameters.txt | 7 ++
- arch/arc/mm/mmap.c | 2 +-
- arch/arm/mm/mmap.c | 4 +-
- arch/frv/mm/elf-fdpic.c | 2 +-
- arch/mips/mm/mmap.c | 2 +-
- arch/parisc/kernel/sys_parisc.c | 15 ++--
- arch/powerpc/mm/hugetlbpage-radix.c | 2 +-
- arch/powerpc/mm/mmap.c | 4 +-
- arch/powerpc/mm/slice.c | 2 +-
- arch/s390/mm/mmap.c | 4 +-
- arch/sh/mm/mmap.c | 4 +-
- arch/sparc/kernel/sys_sparc_64.c | 4 +-
- arch/sparc/mm/hugetlbpage.c | 2 +-
- arch/tile/mm/hugetlbpage.c | 2 +-
- arch/x86/kernel/sys_x86_64.c | 4 +-
- arch/x86/mm/hugetlbpage.c | 2 +-
- arch/xtensa/kernel/syscall.c | 2 +-
- fs/hugetlbfs/inode.c | 2 +-
- fs/proc/task_mmu.c | 4 -
- include/linux/mm.h | 53 ++++++-------
- mm/gup.c | 5 --
- mm/memory.c | 38 ---------
- mm/mmap.c | 149 +++++++++++++++++++++---------------
- 23 files changed, 152 insertions(+), 163 deletions(-)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 65b05ba..29de8cf 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -3922,6 +3922,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- spia_pedr=
- spia_peddr=
-
-+ stack_guard_gap= [MM]
-+ override the default stack gap protection. The value
-+ is in page units and it defines how many pages prior
-+ to (for stacks growing down) resp. after (for stacks
-+ growing up) the main stack are reserved for no other
-+ mapping. Default value is 256 pages.
-+
- stacktrace [FTRACE]
- Enabled the stack tracer on boot up.
-
-diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c
-index 2e06d56..cf4ae69 100644
---- a/arch/arc/mm/mmap.c
-+++ b/arch/arc/mm/mmap.c
-@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 66353ca..641334e 100644
---- a/arch/arm/mm/mmap.c
-+++ b/arch/arm/mm/mmap.c
-@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
-index 836f147..efa59f1 100644
---- a/arch/frv/mm/elf-fdpic.c
-+++ b/arch/frv/mm/elf-fdpic.c
-@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
- addr = PAGE_ALIGN(addr);
- vma = find_vma(current->mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- goto success;
- }
-
-diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
-index d08ea3f..a44052c 100644
---- a/arch/mips/mm/mmap.c
-+++ b/arch/mips/mm/mmap.c
-@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
-index 0a393a0..1d7691f 100644
---- a/arch/parisc/kernel/sys_parisc.c
-+++ b/arch/parisc/kernel/sys_parisc.c
-@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- unsigned long task_size = TASK_SIZE;
- int do_color_align, last_mmap;
- struct vm_unmapped_area_info info;
-@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- else
- addr = PAGE_ALIGN(addr);
-
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- int do_color_align, last_mmap;
-@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = COLOR_ALIGN(addr, last_mmap, pgoff);
- else
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c
-index 35254a6..a2b2d97 100644
---- a/arch/powerpc/mm/hugetlbpage-radix.c
-+++ b/arch/powerpc/mm/hugetlbpage-radix.c
-@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- /*
-diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
-index 2f1e443..5bc2845 100644
---- a/arch/powerpc/mm/mmap.c
-+++ b/arch/powerpc/mm/mmap.c
-@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index 2b27458..c4d5c9c 100644
---- a/arch/powerpc/mm/slice.c
-+++ b/arch/powerpc/mm/slice.c
-@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
- if ((mm->task_size - len) < addr)
- return 0;
- vma = find_vma(mm, addr);
-- return (!vma || (addr + len) <= vma->vm_start);
-+ return (!vma || (addr + len) <= vm_start_gap(vma));
- }
-
- static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index eb9df28..812368f 100644
---- a/arch/s390/mm/mmap.c
-+++ b/arch/s390/mm/mmap.c
-@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
-index 6777177..7df7d59 100644
---- a/arch/sh/mm/mmap.c
-+++ b/arch/sh/mm/mmap.c
-@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index fe8b8ee..02e05e2 100644
---- a/arch/sparc/kernel/sys_sparc_64.c
-+++ b/arch/sparc/kernel/sys_sparc_64.c
-@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
-index 988acc8b..58cde8d 100644
---- a/arch/sparc/mm/hugetlbpage.c
-+++ b/arch/sparc/mm/hugetlbpage.c
-@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, HPAGE_SIZE);
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
-index 77ceaa3..67508b2 100644
---- a/arch/tile/mm/hugetlbpage.c
-+++ b/arch/tile/mm/hugetlbpage.c
-@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (current->mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index a55ed63..1119414 100644
---- a/arch/x86/kernel/sys_x86_64.c
-+++ b/arch/x86/kernel/sys_x86_64.c
-@@ -140,7 +140,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (end - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
-index 2ae8584..fe342e8 100644
---- a/arch/x86/mm/hugetlbpage.c
-+++ b/arch/x86/mm/hugetlbpage.c
-@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c
-index 83cf496..3aaaae1 100644
---- a/arch/xtensa/kernel/syscall.c
-+++ b/arch/xtensa/kernel/syscall.c
-@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- /* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_SIZE - len < addr)
- return -ENOMEM;
-- if (!vmm || addr + len <= vmm->vm_start)
-+ if (!vmm || addr + len <= vm_start_gap(vmm))
- return addr;
- addr = vmm->vm_end;
- if (flags & MAP_SHARED)
-diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index 4fb7b10..704fa0b 100644
---- a/fs/hugetlbfs/inode.c
-+++ b/fs/hugetlbfs/inode.c
-@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 35b92d8..c5f2136 100644
---- a/fs/proc/task_mmu.c
-+++ b/fs/proc/task_mmu.c
-@@ -299,11 +299,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
-
- /* We don't show the stack guard page in /proc/maps */
- start = vma->vm_start;
-- if (stack_guard_page_start(vma, start))
-- start += PAGE_SIZE;
- end = vma->vm_end;
-- if (stack_guard_page_end(vma, end))
-- end -= PAGE_SIZE;
-
- seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
- seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
-diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 0b5b2e4..6c9e1ad 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1356,39 +1356,11 @@ int clear_page_dirty_for_io(struct page *page);
-
- int get_cmdline(struct task_struct *task, char *buffer, int buflen);
-
--/* Is the vma a continuation of the stack vma above it? */
--static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
--}
--
- static inline bool vma_is_anonymous(struct vm_area_struct *vma)
- {
- return !vma->vm_ops;
- }
-
--static inline int stack_guard_page_start(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSDOWN) &&
-- (vma->vm_start == addr) &&
-- !vma_growsdown(vma->vm_prev, addr);
--}
--
--/* Is the vma a continuation of the stack vma below it? */
--static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP);
--}
--
--static inline int stack_guard_page_end(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSUP) &&
-- (vma->vm_end == addr) &&
-- !vma_growsup(vma->vm_next, addr);
--}
--
- int vma_is_stack_for_current(struct vm_area_struct *vma);
-
- extern unsigned long move_page_tables(struct vm_area_struct *vma,
-@@ -2127,6 +2099,7 @@ void page_cache_async_readahead(struct address_space *mapping,
- pgoff_t offset,
- unsigned long size);
-
-+extern unsigned long stack_guard_gap;
- /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
- extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
-
-@@ -2155,6 +2128,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
- return vma;
- }
-
-+static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_start = vma->vm_start;
-+
-+ if (vma->vm_flags & VM_GROWSDOWN) {
-+ vm_start -= stack_guard_gap;
-+ if (vm_start > vma->vm_start)
-+ vm_start = 0;
-+ }
-+ return vm_start;
-+}
-+
-+static inline unsigned long vm_end_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_end = vma->vm_end;
-+
-+ if (vma->vm_flags & VM_GROWSUP) {
-+ vm_end += stack_guard_gap;
-+ if (vm_end < vma->vm_end)
-+ vm_end = -PAGE_SIZE;
-+ }
-+ return vm_end;
-+}
-+
- static inline unsigned long vma_pages(struct vm_area_struct *vma)
- {
- return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-diff --git a/mm/gup.c b/mm/gup.c
-index ec4f827..c63a034 100644
---- a/mm/gup.c
-+++ b/mm/gup.c
-@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
- /* mlock all present pages, but do not fault in new pages */
- if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK)
- return -ENOENT;
-- /* For mm_populate(), just skip the stack guard page. */
-- if ((*flags & FOLL_POPULATE) &&
-- (stack_guard_page_start(vma, address) ||
-- stack_guard_page_end(vma, address + PAGE_SIZE)))
-- return -ENOENT;
- if (*flags & FOLL_WRITE)
- fault_flags |= FAULT_FLAG_WRITE;
- if (*flags & FOLL_REMOTE)
-diff --git a/mm/memory.c b/mm/memory.c
-index cbb1e5e..e6a5a1f 100644
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -2699,40 +2699,6 @@ int do_swap_page(struct fault_env *fe, pte_t orig_pte)
- }
-
- /*
-- * This is like a special single-page "expand_{down|up}wards()",
-- * except we must first make sure that 'address{-|+}PAGE_SIZE'
-- * doesn't hit another vma.
-- */
--static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
--{
-- address &= PAGE_MASK;
-- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
-- struct vm_area_struct *prev = vma->vm_prev;
--
-- /*
-- * Is there a mapping abutting this one below?
-- *
-- * That's only ok if it's the same stack mapping
-- * that has gotten split..
-- */
-- if (prev && prev->vm_end == address)
-- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
--
-- return expand_downwards(vma, address - PAGE_SIZE);
-- }
-- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
-- struct vm_area_struct *next = vma->vm_next;
--
-- /* As VM_GROWSDOWN but s/below/above/ */
-- if (next && next->vm_start == address + PAGE_SIZE)
-- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
--
-- return expand_upwards(vma, address + PAGE_SIZE);
-- }
-- return 0;
--}
--
--/*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2748,10 +2714,6 @@ static int do_anonymous_page(struct fault_env *fe)
- if (vma->vm_flags & VM_SHARED)
- return VM_FAULT_SIGBUS;
-
-- /* Check if we need to add a guard page to the stack */
-- if (check_stack_guard_page(vma, fe->address) < 0)
-- return VM_FAULT_SIGSEGV;
--
- /*
- * Use pte_alloc() instead of pte_alloc_map(). We can't run
- * pte_offset_map() on pmds where a huge pmd might be created
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 1af87c1..26542b3 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -183,6 +183,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- unsigned long retval;
- unsigned long newbrk, oldbrk;
- struct mm_struct *mm = current->mm;
-+ struct vm_area_struct *next;
- unsigned long min_brk;
- bool populate;
-
-@@ -228,7 +229,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- }
-
- /* Check against existing mmap mappings. */
-- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE))
-+ next = find_vma(mm, oldbrk);
-+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next))
- goto out;
-
- /* Ok, looks good - let it rip. */
-@@ -251,10 +253,22 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
-
- static long vma_compute_subtree_gap(struct vm_area_struct *vma)
- {
-- unsigned long max, subtree_gap;
-- max = vma->vm_start;
-- if (vma->vm_prev)
-- max -= vma->vm_prev->vm_end;
-+ unsigned long max, prev_end, subtree_gap;
-+
-+ /*
-+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we
-+ * allow two stack_guard_gaps between them here, and when choosing
-+ * an unmapped area; whereas when expanding we only require one.
-+ * That's a little inconsistent, but keeps the code here simpler.
-+ */
-+ max = vm_start_gap(vma);
-+ if (vma->vm_prev) {
-+ prev_end = vm_end_gap(vma->vm_prev);
-+ if (max > prev_end)
-+ max -= prev_end;
-+ else
-+ max = 0;
-+ }
- if (vma->vm_rb.rb_left) {
- subtree_gap = rb_entry(vma->vm_rb.rb_left,
- struct vm_area_struct, vm_rb)->rb_subtree_gap;
-@@ -350,7 +364,7 @@ static void validate_mm(struct mm_struct *mm)
- anon_vma_unlock_read(anon_vma);
- }
-
-- highest_address = vma->vm_end;
-+ highest_address = vm_end_gap(vma);
- vma = vma->vm_next;
- i++;
- }
-@@ -539,7 +553,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = vma->vm_end;
-+ mm->highest_vm_end = vm_end_gap(vma);
-
- /*
- * vma->vm_prev wasn't known when we followed the rbtree to find the
-@@ -854,7 +868,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
- vma_gap_update(vma);
- if (end_changed) {
- if (!next)
-- mm->highest_vm_end = end;
-+ mm->highest_vm_end = vm_end_gap(vma);
- else if (!adjust_next)
- vma_gap_update(next);
- }
-@@ -939,7 +953,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
- * mm->highest_vm_end doesn't need any update
- * in remove_next == 1 case.
- */
-- VM_WARN_ON(mm->highest_vm_end != end);
-+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
- }
- }
- if (insert && file)
-@@ -1783,7 +1797,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit left subtree if it looks promising */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end >= low_limit && vma->vm_rb.rb_left) {
- struct vm_area_struct *left =
- rb_entry(vma->vm_rb.rb_left,
-@@ -1794,7 +1808,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- }
- }
-
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- check_current:
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
-@@ -1821,8 +1835,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- vma = rb_entry(rb_parent(prev),
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_left) {
-- gap_start = vma->vm_prev->vm_end;
-- gap_end = vma->vm_start;
-+ gap_start = vm_end_gap(vma->vm_prev);
-+ gap_end = vm_start_gap(vma);
- goto check_current;
- }
- }
-@@ -1886,7 +1900,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit right subtree if it looks promising */
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- if (gap_start <= high_limit && vma->vm_rb.rb_right) {
- struct vm_area_struct *right =
- rb_entry(vma->vm_rb.rb_right,
-@@ -1899,7 +1913,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- check_current:
- /* Check if current node has a suitable gap */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
- if (gap_start <= high_limit && gap_end - gap_start >= length)
-@@ -1925,7 +1939,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_right) {
- gap_start = vma->vm_prev ?
-- vma->vm_prev->vm_end : 0;
-+ vm_end_gap(vma->vm_prev) : 0;
- goto check_current;
- }
- }
-@@ -1963,7 +1977,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct vm_unmapped_area_info info;
-
- if (len > TASK_SIZE - mmap_min_addr)
-@@ -1974,9 +1988,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -1999,7 +2014,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- struct vm_unmapped_area_info info;
-@@ -2014,9 +2029,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- /* requesting a specific address */
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -2151,21 +2167,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
- * update accounting. This is shared with both the
- * grow-up and grow-down cases.
- */
--static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow)
-+static int acct_stack_growth(struct vm_area_struct *vma,
-+ unsigned long size, unsigned long grow)
- {
- struct mm_struct *mm = vma->vm_mm;
- struct rlimit *rlim = current->signal->rlim;
-- unsigned long new_start, actual_size;
-+ unsigned long new_start;
-
- /* address space limit tests */
- if (!may_expand_vm(mm, vma->vm_flags, grow))
- return -ENOMEM;
-
- /* Stack limit test */
-- actual_size = size;
-- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
-- actual_size -= PAGE_SIZE;
-- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
-+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
- return -ENOMEM;
-
- /* mlock limit tests */
-@@ -2203,17 +2217,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
- int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *next;
-+ unsigned long gap_addr;
- int error = 0;
-
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
- /* Guard against wrapping around to address 0. */
-- if (address < PAGE_ALIGN(address+4))
-- address = PAGE_ALIGN(address+4);
-- else
-+ address &= PAGE_MASK;
-+ address += PAGE_SIZE;
-+ if (!address)
- return -ENOMEM;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address + stack_guard_gap;
-+ if (gap_addr < address)
-+ return -ENOMEM;
-+ next = vma->vm_next;
-+ if (next && next->vm_start < gap_addr) {
-+ if (!(next->vm_flags & VM_GROWSUP))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2257,7 +2284,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = address;
-+ mm->highest_vm_end = vm_end_gap(vma);
- spin_unlock(&mm->page_table_lock);
-
- perf_event_mmap(vma);
-@@ -2278,6 +2305,8 @@ int expand_downwards(struct vm_area_struct *vma,
- unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *prev;
-+ unsigned long gap_addr;
- int error;
-
- address &= PAGE_MASK;
-@@ -2285,6 +2314,17 @@ int expand_downwards(struct vm_area_struct *vma,
- if (error)
- return error;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address - stack_guard_gap;
-+ if (gap_addr > address)
-+ return -ENOMEM;
-+ prev = vma->vm_prev;
-+ if (prev && prev->vm_end > gap_addr) {
-+ if (!(prev->vm_flags & VM_GROWSDOWN))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2339,28 +2379,25 @@ int expand_downwards(struct vm_area_struct *vma,
- return error;
- }
-
--/*
-- * Note how expand_stack() refuses to expand the stack all the way to
-- * abut the next virtual mapping, *unless* that mapping itself is also
-- * a stack mapping. We want to leave room for a guard page, after all
-- * (the guard page itself is not added here, that is done by the
-- * actual page faulting logic)
-- *
-- * This matches the behavior of the guard page logic (see mm/memory.c:
-- * check_stack_guard_page()), which only allows the guard page to be
-- * removed under these circumstances.
-- */
-+/* enforced gap between the expanding stack and other mappings. */
-+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT;
-+
-+static int __init cmdline_parse_stack_guard_gap(char *p)
-+{
-+ unsigned long val;
-+ char *endptr;
-+
-+ val = simple_strtoul(p, &endptr, 10);
-+ if (!*endptr)
-+ stack_guard_gap = val << PAGE_SHIFT;
-+
-+ return 0;
-+}
-+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap);
-+
- #ifdef CONFIG_STACK_GROWSUP
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *next;
--
-- address &= PAGE_MASK;
-- next = vma->vm_next;
-- if (next && next->vm_start == address + PAGE_SIZE) {
-- if (!(next->vm_flags & VM_GROWSUP))
-- return -ENOMEM;
-- }
- return expand_upwards(vma, address);
- }
-
-@@ -2382,14 +2419,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
- #else
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *prev;
--
-- address &= PAGE_MASK;
-- prev = vma->vm_prev;
-- if (prev && prev->vm_end == address) {
-- if (!(prev->vm_flags & VM_GROWSDOWN))
-- return -ENOMEM;
-- }
- return expand_downwards(vma, address);
- }
-
-@@ -2487,7 +2516,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
- vma->vm_prev = prev;
- vma_gap_update(vma);
- } else
-- mm->highest_vm_end = prev ? prev->vm_end : 0;
-+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0;
- tail_vma->vm_next = NULL;
-
- /* Kill the cache */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
deleted file mode 100644
index 2a20abb57..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 88aa347d26911cffd84ac3dd2a8341f1ba7e3444 Mon Sep 17 00:00:00 2001
-From: Helge Deller <deller@gmx.de>
-Date: Mon, 19 Jun 2017 17:34:05 +0200
-Subject: [PATCH 2/3] Allow stack to grow up to address space limit
-
-commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream.
-
-Fix expand_upwards() on architectures with an upward-growing stack (parisc,
-metag and partly IA-64) to allow the stack to reliably grow exactly up to
-the address space limit given by TASK_SIZE.
-
-Signed-off-by: Helge Deller <deller@gmx.de>
-Acked-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 26542b3..d71a61e 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -2224,16 +2224,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
-- /* Guard against wrapping around to address 0. */
-+ /* Guard against exceeding limits of the address space. */
- address &= PAGE_MASK;
-- address += PAGE_SIZE;
-- if (!address)
-+ if (address >= TASK_SIZE)
- return -ENOMEM;
-+ address += PAGE_SIZE;
-
- /* Enforce stack_guard_gap */
- gap_addr = address + stack_guard_gap;
-- if (gap_addr < address)
-- return -ENOMEM;
-+
-+ /* Guard against overflow */
-+ if (gap_addr < address || gap_addr > TASK_SIZE)
-+ gap_addr = TASK_SIZE;
-+
- next = vma->vm_next;
- if (next && next->vm_start < gap_addr) {
- if (!(next->vm_flags & VM_GROWSUP))
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
deleted file mode 100644
index 7dc79192b..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.9/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 00d15368d611f12f3c4980dce63b68b08ea89a09 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Tue, 20 Jun 2017 02:10:44 -0700
-Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown()
-
-commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream.
-
-Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of
-mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the
-end of unmapped_area_topdown(). Linus points out how MAP_FIXED
-(which does not have to respect our stack guard gap intentions)
-could result in gap_end below gap_start there. Fix that, and
-the similar case in its alternative, unmapped_area().
-
-Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
-Reported-by: Dave Jones <davej@codemonkey.org.uk>
-Debugged-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index d71a61e..145d3d5 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -1813,7 +1813,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
- return -ENOMEM;
-- if (gap_end >= low_limit && gap_end - gap_start >= length)
-+ if (gap_end >= low_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit right subtree if it looks promising */
-@@ -1916,7 +1917,8 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
- gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
-- if (gap_start <= high_limit && gap_end - gap_start >= length)
-+ if (gap_start <= high_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit left subtree if it looks promising */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch
deleted file mode 100644
index 4021e5d38..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 2b206c36b16e72cfe41cd22448d8527359ffd962 Mon Sep 17 00:00:00 2001
-From: Casey Schaufler <casey@schaufler-ca.com>
-Date: Mon, 7 Dec 2015 14:34:32 -0800
-Subject: [PATCH 1/4] Smack: File receive for sockets
-
-The existing file receive hook checks for access on
-the file inode even for UDS. This is not right, as
-the inode is not used by Smack to make access checks
-for sockets. This change checks for an appropriate
-access relationship between the receiving (current)
-process and the socket. If the process can't write
-to the socket's send label or the socket's receive
-label can't write to the process fail.
-
-This will allow the legitimate cases, where the
-socket sender and socket receiver can freely communicate.
-Only strangly set socket labels should cause a problem.
-
-Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index ff81026..b20ef06 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file)
- int may = 0;
- struct smk_audit_info ad;
- struct inode *inode = file_inode(file);
-+ struct socket *sock;
-+ struct task_smack *tsp;
-+ struct socket_smack *ssp;
-
- if (unlikely(IS_PRIVATE(inode)))
- return 0;
-
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
- smk_ad_setfield_u_fs_path(&ad, file->f_path);
-+
-+ if (S_ISSOCK(inode->i_mode)) {
-+ sock = SOCKET_I(inode);
-+ ssp = sock->sk->sk_security;
-+ tsp = current_security();
-+ /*
-+ * If the receiving process can't write to the
-+ * passed socket or if the passed socket can't
-+ * write to the receiving process don't accept
-+ * the passed socket.
-+ */
-+ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ if (rc < 0)
-+ return rc;
-+ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ return rc;
-+ }
- /*
- * This code relies on bitmasks.
- */
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch
new file mode 100644
index 000000000..7f0979ca9
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-mconf-menuconfig.patch
@@ -0,0 +1,48 @@
+From bebd63730a433ba62549a80114a9851328aa8897 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Mon, 2 Jul 2018 23:10:28 -0400
+Subject: [PATCH] menuconfig,mconf-cfg: Allow specification of ncurses location
+
+In some cross build environments such as the Yocto Project build
+environment it provides an ncurses library that is compiled
+differently than the host's version. This causes display corruption
+problems when the host's curses includes are used instead of the
+includes from the provided compiler are overridden. There is a second
+case where there is no curses libraries at all on the host system and
+menuconfig will just fail entirely.
+
+The solution is simply to allow an override variable in
+check-lxdialog.sh for environments such as the Yocto Project. Adding
+a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
+compiling and linking against the right headers and libraries.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+cc: Michal Marek <mmarek@suse.cz>
+cc: linux-kbuild@vger.kernel.org
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ scripts/kconfig/mconf-cfg.sh | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
+index c812872d7f9d..42d20819025c 100755
+--- a/scripts/kconfig/mconf-cfg.sh
++++ b/scripts/kconfig/mconf-cfg.sh
+@@ -4,6 +4,14 @@
+ PKG="ncursesw"
+ PKG2="ncurses"
+
++if [ "$CROSS_CURSES_LIB" != "" ]; then
++ echo libs=\'$CROSS_CURSES_LIB\'
++ if [ x"$CROSS_CURSES_INC" != x ]; then
++ echo cflags=\'$CROSS_CURSES_INC\'
++ fi
++ exit 0
++fi
++
+ if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
+ if ${HOSTPKG_CONFIG} --exists $PKG; then
+ echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
+--
+2.17.1
+
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch
deleted file mode 100644
index c516f3aa5..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 99267706991ab84bd44ceaea9a7ec886bbdd58e0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jobol@nonadev.net>
-Date: Tue, 12 Jan 2016 21:23:40 +0100
-Subject: [PATCH 2/4] smack: fix cache of access labels
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before this commit, removing the access property of
-a file, aka, the extended attribute security.SMACK64
-was not effictive until the cache had been cleaned.
-
-This patch fixes that problem.
-
-Signed-off-by: José Bollo <jobol@nonadev.net>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b20ef06..b2bcb14 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1444,9 +1444,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name)
- * Don't do anything special for these.
- * XATTR_NAME_SMACKIPIN
- * XATTR_NAME_SMACKIPOUT
-- * XATTR_NAME_SMACKEXEC
- */
-- if (strcmp(name, XATTR_NAME_SMACK) == 0)
-+ if (strcmp(name, XATTR_NAME_SMACK) == 0) {
-+ struct super_block *sbp = d_backing_inode(dentry)->i_sb;
-+ struct superblock_smack *sbsp = sbp->s_security;
-+
-+ isp->smk_inode = sbsp->smk_default;
-+ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0)
- isp->smk_task = NULL;
- else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0)
- isp->smk_mmap = NULL;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
deleted file mode 100644
index c9180bb9f..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From ec4eb03af07b0fbc330aecca6ac4ebd6accd8825 Mon Sep 17 00:00:00 2001
-From: Rafal Krypa <r.krypa@samsung.com>
-Date: Mon, 4 Apr 2016 11:14:53 +0200
-Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill
-
-Kill with signal number 0 is commonly used for checking PID existence.
-Smack treated such cases like any other kills, although no signal is
-actually delivered when sig == 0.
-
-Checking permissions when sig == 0 didn't prevent an unprivileged caller
-from learning whether PID exists or not. When it existed, kernel returned
-EPERM, when it didn't - ESRCH. The only effect of policy check in such
-case is noise in audit logs.
-
-This change lets Smack silently ignore kill() invocations with sig == 0.
-
-Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b2bcb14..cf8a93f 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2239,6 +2239,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
- struct smack_known *tkp = smk_of_task_struct(p);
- int rc;
-
-+ if (!sig)
-+ return 0; /* null signal; existence test */
-+
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
- smk_ad_setfield_u_tsk(&ad, p);
- /*
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index a1eeac3d7..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index cf8a93f..21651bc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg
new file mode 100644
index 000000000..eac59dbdf
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-hciuart.cfg
@@ -0,0 +1,12 @@
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIUART_ATH3K is not set
+# CONFIG_BT_HCIUART_LL is not set
+CONFIG_BT_HCIUART_3WIRE=y
+# CONFIG_BT_HCIUART_INTEL is not set
+CONFIG_BT_HCIUART_BCM=y
+# CONFIG_BT_HCIUART_QCA is not set
+# CONFIG_BT_HCIUART_AG6XX is not set
+# CONFIG_BT_HCIUART_MRVL is not set
+# CONFIG_BT_HCIBPA10X is not set
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg
new file mode 100644
index 000000000..8c573578c
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi-panel.cfg
@@ -0,0 +1 @@
+CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=y
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg
new file mode 100644
index 000000000..993d15084
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi_network.cfg
@@ -0,0 +1,5 @@
+CONFIG_NETDEVICES=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_DRIVERS=y
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_SMSC75XX=y
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg
new file mode 100644
index 000000000..36f390187
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/xen-be.cfg
@@ -0,0 +1,50 @@
+# global stuff - these enable us to allow some
+# of the not so generic stuff below for xen
+CONFIG_PARAVIRT=y
+CONFIG_NET=y
+CONFIG_NET_CORE=y
+CONFIG_NETDEVICES=y
+CONFIG_BLOCK=y
+CONFIG_WATCHDOG=y
+CONFIG_TARGET_CORE=y
+CONFIG_SCSI=y
+CONFIG_FB=y
+CONFIG_INPUT_MISC=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_TTY=y
+# Technically not required but otherwise produces
+# pretty useless systems starting from allnoconfig
+# You want TCP/IP and ELF binaries right?
+CONFIG_INET=y
+CONFIG_BINFMT_ELF=y
+# generic config
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+# backend drivers
+CONFIG_XEN_BACKEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_HVC_XEN=y
+CONFIG_XEN_WDT=m
+CONFIG_XEN_SCSI_BACKEND=m
+# frontend drivers
+CONFIG_XEN_FBDEV_FRONTEND=m
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m
+CONFIG_XEN_SCSI_FRONTEND=m
+# others
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=m
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XENFS=m
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=m
+CONFIG_XEN_GRANT_DEV_ALLOC=m
+CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PRIVCMD=m
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_POINTER=y
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
index 6557ce03c..ec3fa910b 100644
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
@@ -1,113 +1,46 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
-SRC_URI_append = "\
- ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \
-"
+require recipes-kernel/linux/linux-yocto-agl.inc
-# Fix CVE-2017-1000364
-SRC_URI_append = "\
- file://0001-mm-larger-stack-guard-gap-between-vmas.patch \
- file://0002-Allow-stack-to-grow-up-to-address-space-limit.patch \
- file://0003-mm-fix-new-crash-in-unmapped_area_topdown.patch \
+SRC_URI:append = " \
+ ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \
+ file://0001-mconf-menuconfig.patch \
"
+# Enable support for Pi foundation touchscreen
+AGL_KCONFIG_FRAGMENTS += "raspberrypi-panel.cfg"
-do_configure_append_smack() {
- # SMACK and Co
- kernel_configure_variable IP_NF_SECURITY m
- kernel_configure_variable IP6_NF_SECURITY m
- kernel_configure_variable EXT2_FS_SECURITY y
- kernel_configure_variable EXT3_FS_SECURITY y
- kernel_configure_variable EXT4_FS_SECURITY y
- kernel_configure_variable SECURITY y
- kernel_configure_variable SECURITY_SMACK y
- kernel_configure_variable TMPFS_XATTR y
- kernel_configure_variable DEFAULT_SECURITY "smack"
- kernel_configure_variable DEFAULT_SECURITY_SMACK y
- kernel_configure_variable FANOTIFY_ACCESS_PERMISSIONS y
-}
-
-do_configure_append_netboot() {
- # NBD for netboot
- kernel_configure_variable BLK_DEV_NBD y
- # ramblk for inird
- kernel_configure_variable BLK_DEV_RAM y
-}
-
-do_configure_append_sota() {
- # ramblk for inird
- kernel_configure_variable BLK_DEV_RAM y
-}
-
-# can
-do_configure_append() {
-
- kernel_configure_variable TASKSTATS y
- kernel_configure_variable TASK_DELAY_ACCT y
- kernel_configure_variable USER_RETURN_NOTIFIER y
- kernel_configure_variable PREEMPT_NOTIFIERS y
- kernel_configure_variable CAN m
- kernel_configure_variable CAN_RAW m
- kernel_configure_variable CAN_BCM m
- kernel_configure_variable CAN_GW m
- kernel_configure_variable CAN_VCAN m
- kernel_configure_variable CAN_SLCAN m
- kernel_configure_variable CAN_DEV m
- kernel_configure_variable CAN_CALC_BITTIMING y
- kernel_configure_variable CAN_MCP251X m
- kernel_configure_variable CAN_ESD_USB2 m
- kernel_configure_variable CAN_GS_USB m
- kernel_configure_variable CAN_KVASER_USB m
- kernel_configure_variable CAN_PEAK_USB m
- kernel_configure_variable CAN_8DEV_USB m
+# Enable bt hci uart
+AGL_KCONFIG_FRAGMENTS += "raspberrypi-hciuart.cfg"
-# not enabled, yet ?
-# kernel_configure_variable CAN_LEDS is not set
-# kernel_configure_variable CAN_SJA1000 is not set
-# kernel_configure_variable CAN_C_CAN is not set
-# kernel_configure_variable CAN_M_CAN is not set
-# kernel_configure_variable CAN_CC770 is not set
-# kernel_configure_variable CAN_EMS_USB is not set
-# kernel_configure_variable CAN_SOFTING is not set
-# kernel_configure_variable CAN_DEBUG_DEVICES is not set
-}
+# ENABLE NETWORK (built-in)
+AGL_KCONFIG_FRAGMENTS += "raspberrypi_network.cfg"
-do_configure_append() {
+# For Xen
+AGL_KCONFIG_FRAGMENTS += " \
+ ${@bb.utils.contains('AGL_XEN_WANTED','1','xen-be.cfg','',d)} \
+"
- # VC4 Wayland/Weston
- kernel_configure_variable I2C_BCM2835 y
- kernel_configure_variable DRM y
- kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y
- kernel_configure_variable DRM_VC4 y
- kernel_configure_variable FB_BCM2708 n
+# Take in account that linux under Xen should use the hvc0 console
+SERIAL_OPTION = "${@bb.utils.contains('AGL_XEN_WANTED','1','hvc0','ttyS0,115200',d)}"
+SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=${SERIAL_OPTION}", "", d)}"
- # Enable support for TP-Link TL-W722N USB Wifi adapter
- kernel_configure_variable ATH_CARDS m
- kernel_configure_variable ATH9K_HTC m
+CMDLINE_DEBUG = ""
- # Enable support for RTLSDR
- kernel_configure_variable MEDIA_USB_SUPPORT y
- kernel_configure_variable MEDIA_DIGITAL_TV_SUPPORT y
- kernel_configure_variable DVB_USB_V2 m
- kernel_configure_variable DVB_USB_RTL28XXU m
+# Xen related option
+CMDLINE:append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','clk_ignore_unused','',d)}'
- # KEEP until fixed upstream:
- # Keep this the last line
- # Remove all modified configs and add the rest to .config
- sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'
+# Workaround for crash during brcmfmac loading. Disable it at this moment
+CMDLINE:append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','modprobe.blacklist=brcmfmac','',d)}'
- yes '' | oe_runmake oldconfig
- kernel_do_configure
-}
-
-CMDLINE_DEBUG = ""
-CMDLINE_append = " usbhid.mousepoll=0"
+CMDLINE:append = " usbhid.mousepoll=0"
# Add options to allow CMA to operate
-CMDLINE_append = ' ${@base_conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}'
+CMDLINE:append = '${@oe.utils.conditional("ENABLE_CMA", "1", " coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}'
KERNEL_MODULE_AUTOLOAD += "snd-bcm2835"
KERNEL_MODULE_AUTOLOAD += "hid-multitouch"
-RDEPENDS_${PN} += "kernel-module-snd-bcm2835"
PACKAGES += "kernel-module-snd-bcm2835"
+
+RDEPENDS:${PN} += "kernel-module-snd-bcm2835"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend
deleted file mode 100644
index c96635ecd..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-4.4:"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0001-Smack-File-receive-for-sockets.patch \
- file://0002-smack-fix-cache-of-access-labels.patch \
- file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend
deleted file mode 100644
index 3dc9a9561..000000000
--- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-4.9:"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
new file mode 100644
index 000000000..2e045c1f2
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
@@ -0,0 +1,2 @@
+# Disable faad by default to avoid licensing issues
+PACKAGECONFIG:remove:rpi = "faad"
diff --git a/meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend
new file mode 100644
index 000000000..d565da8ac
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gateway/recipes-kernel/linux/linux-renesas_%.bbappend
@@ -0,0 +1,11 @@
+do_install:append () {
+
+ # Remove firmware file that is not packaged in the kernel.
+ # It throws an error during do_package.
+ # It seems to be moved out of the kernel in later BSP versions.
+ rm -rf ${D}/lib/firmware/r8a779f0_ufs.bin
+ rm -rf ${D}/lib/firmware
+ rm -rf ${D}/lib
+
+}
+
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware
new file mode 120000
index 000000000..133ef4917
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/arm-trusted-firmware
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/arm-trusted-firmware/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools
new file mode 120000
index 000000000..9065d9e99
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/si-tools
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/si-tools/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt
new file mode 120000
index 000000000..13ea60b90
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware
new file mode 120000
index 000000000..b6dd66919
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/ti-bt-firmware
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot
new file mode 120000
index 000000000..857cd50d2
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-bsp/u-boot
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-bsp/u-boot/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo
new file mode 120000
index 000000000..cc44ec53f
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-graphics/cairo
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-graphics/cairo/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux
new file mode 120000
index 000000000..4feae94d0
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-kernel/linux
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-kernel/linux \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer
new file mode 120000
index 000000000..ef3ed76fd
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/cogent-symlinks/recipes-multimedia/gstreamer
@@ -0,0 +1 @@
+../../../../../bsp/meta-rcar/meta-rcar-gen3-adas/recipes-multimedia/gstreamer/ \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES b/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES
new file mode 100644
index 000000000..296dd5e19
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/NOTES
@@ -0,0 +1,74 @@
+#### These are notes for future reference
+
+# TODO: follow-up patch: Need to do other mechanism for package inclusion
+# TODO2: include or leave-out the kernel modules packages
+
+# E.g. MACHINE_FEATURE. Should *not* be in layer.conf !!
+# Radio packages
+#IMAGE_INSTALL:append:rcar-gen3 = " \
+# si-tools \
+# si-init \
+# linux-firmware-wl18xx \
+# ti-bt \
+# ti-bt-firmware \
+# bluez5 \
+# bluez5-testtools \
+# ofono \
+# ofono-tests \
+#"
+# E.g. MACHINE_FEATURE
+#IMAGE_INSTALL:append:r8a7797 += " \
+# kernel-module-uio-imp \
+# kernel-module-cmemdrv \
+# udev-rules-cvlib \
+#"
+# E.g. MACHINE_FEATURE
+#IMAGE_INSTALL:append:r8a7798 += " \
+# kernel-module-uio-imp \
+# kernel-module-cmemdrv \
+# udev-rules-cvlib \
+#"
+# This is a special use case. Should be enabled by user.
+#DISTRO_FEATURES:append = " surroundview "
+
+
+#### BBMASK
+# not required for AGL
+BBMASK += "/meta-rcar-gen3-adas/recipes-benchmark/"
+
+# Do not interfer with the distro configuration
+BBMASK += "/meta-rcar-gen3-adas/recipes-connectivity/bluez/"
+
+# We do not need the network config done here
+BBMASK += "/meta-rcar-gen3-adas/recipes-core/systemd/"
+
+# These changes are applied unconditionally when the layer is present.
+# These are not required for AGL
+BBMASK += "/meta-rcar-gen3-adas/recipes-core/images/"
+BBMASK += "/meta-rcar-gen3-adas/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend"
+
+# Upstream does have this change already, so this is not required.
+# poky/meta/classes/cmake.bbclass: -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1
+BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/cmake/"
+
+# Upstream has a more recent valgrind (3.15.0 vs 3.12.0)
+BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/valgrind/"
+
+# This is already part of upstream and no bbappend is required
+BBMASK += "/meta-rcar-gen3-adas/recipes-devtools/gcc/"
+
+# libpng in upstream already enabled neon
+# poky/meta/recipes-multimedia/libpng/libpng_1.6.37.bb:EXTRA_OECONF:append:class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
+BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/libpng/"
+
+# opencv in upstream is newer
+BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/opencv/"
+
+# unclear patch status
+BBMASK += "/meta-rcar-gen3-adas/recipes-graphics/wayland/"
+
+# not required in AGL
+BBMASK += "/meta-rcar-gen3-adas/recipes-multimedia/pulseaudio/"
+
+# not required in AGL
+BBMASK += "/meta-rcar-gen3-adas/recipes-support/"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc b/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
new file mode 100644
index 000000000..0c344a471
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
@@ -0,0 +1,20 @@
+#Keep this as a reminder
+#MACHINEOVERRIDES .= ":kingfisher"
+#PACKAGE_EXTRA_ARCHS:append = " kingfisher"
+
+# Add a feature as a low-impact way to detect Kingfisher support in
+# recipes.
+AGL_FEATURES:append:rcar-gen3 = " kingfisher"
+
+IMAGE_NAME:rcar-gen3 = "${IMAGE_BASENAME}-${MACHINE}-kf${IMAGE_VERSION_SUFFIX}"
+IMAGE_LINK_NAME:rcar-gen3 = "${IMAGE_BASENAME}-${MACHINE}-kf"
+TOOLCHAIN_OUTPUTNAME:rcar-gen3 = "${SDK_NAME}-kf-toolchain-${SDK_VERSION}"
+
+# Radio packages
+IMAGE_INSTALL:append:rcar-gen3 = " \
+ si-tools \
+ si-init \
+ linux-firmware-wl18xx \
+ ti-bt \
+ ti-bt-firmware \
+"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf b/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf
new file mode 100644
index 000000000..bae421a50
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/conf/layer.conf
@@ -0,0 +1,18 @@
+# We have a conf and classes directory, append to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+# 1) the first directory symlinks necessary files out of the cogent repo
+# 2) the 2nd directory is our local glue and appends
+BBFILES += " \
+ ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bb \
+ ${LAYERDIR}/cogent-symlinks/recipes-*/*/*.bbappend \
+ ${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend \
+"
+
+BBFILE_COLLECTIONS += "rcar-gen3-cogent"
+BBFILE_PATTERN_rcar-gen3-cogent := "^${LAYERDIR}/"
+BBFILE_PRIORITY_rcar-gen3-cogent = "7"
+
+LAYERSERIES_COMPAT_rcar-gen3-cogent = "scarthgap"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service
new file mode 100644
index 000000000..d2204cb6a
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-init.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Initialize Si468x radio
+ConditionPathExists=/sys/firmware/devicetree/base/si468x@0/compatible
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/si_init
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch
new file mode 100644
index 000000000..9bbccadd3
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/files/si-tools-fm-improvements.patch
@@ -0,0 +1,184 @@
+FM configuration improvements
+
+Changes include:
+- Add command-line option for selecting FM band plan. The default
+ band plan is US / Canada.
+- Add command-line options for setting FM scanning valid SNR and RSSI
+ thresholds to allow tweaking sensitivity in poor radio environments.
+- Increased seeking scan timeout to 3 seconds, which seems to improve
+ behavior in poor radio environments where powerful stations may be
+ far apart.
+- Removed explicit setting of FM_SOFTMUTE_SNR_LIMITS, as it seemed
+ like it might be resulting in odd muting behavior when scanning.
+- Changed initial FM frequency if not specified to the minimum of the
+ band plan.
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+diff --git a/si46xx.h b/si46xx.h
+index 172ea8b..c32fca4 100644
+--- a/si46xx.h
++++ b/si46xx.h
+@@ -83,6 +83,7 @@
+ #define SI46XX_PIN_CONFIG_ENABLE 0x0800
+ #define SI46XX_FM_SEEK_BAND_BOTTOM 0x3100
+ #define SI46XX_FM_SEEK_BAND_TOP 0x3101
++#define SI46XX_FM_SEEK_FREQUENCY_SPACING 0x3102
+ #define SI46XX_FM_VALID_MAX_TUNE_ERROR 0x3200
+ #define SI46XX_FM_VALID_RSSI_TIME 0x3201
+ #define SI46XX_FM_VALID_RSSI_THRESHOLD 0x3202
+@@ -150,7 +151,7 @@
+ #define MAX_SERVICES 32
+ #define MAX_COMPONENTS 15
+
+-#define TIMEOUT_SEEK 2000 /* mS = 2S */
++#define TIMEOUT_SEEK 3000 /* mS = 3S */
+ #define TIMEOUT_TUNE 500 /* mS = .5S */
+
+ struct dab_service_t{
+diff --git a/si_ctl.c b/si_ctl.c
+index 59dfaf2..f168218 100644
+--- a/si_ctl.c
++++ b/si_ctl.c
+@@ -101,6 +101,26 @@ uint32_t frequency_list_ch[] = { CHAN_12A,
+ CHAN_9D,
+ CHAN_8B};
+
++// Structure to describe FM band plans, all values in Hz.
++typedef struct {
++ char *name;
++ uint32_t min;
++ uint32_t max;
++ uint32_t step;
++} fm_band_plan_t;
++
++static fm_band_plan_t known_fm_band_plans[5] = {
++ { .name = "US", .min = 87900000, .max = 107900000, .step = 200000 },
++ { .name = "JP", .min = 76000000, .max = 95000000, .step = 100000 },
++ { .name = "EU", .min = 87500000, .max = 108000000, .step = 50000 },
++ { .name = "ITU-1", .min = 87500000, .max = 108000000, .step = 50000 },
++ { .name = "ITU-2", .min = 87900000, .max = 107900000, .step = 50000 }
++};
++
++static unsigned int fm_band_plan;
++static int fm_snr_threshold = 128;
++static int fm_rssi_threshold = 128;
++
+ int init_am(int offset)
+ {
+ int ret;
+@@ -160,12 +180,32 @@ int init_fm(int offset)
+ * enable I2S output
+ */
+ si46xx_set_property(SI46XX_PIN_CONFIG_ENABLE, 0x0003);
+- //si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD,0x0000);
+- //si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD,0x0000);
+- si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
++ //si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
+ si46xx_set_property(SI46XX_FM_TUNE_FE_CFG, 0x0000); // front end switch open
+- si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
+- si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
++
++ //si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
++ //si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
++ if (verbose)
++ fprintf(stderr, "Using FM Bandplan: %s\n", known_fm_band_plans[fm_band_plan].name);
++ si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, known_fm_band_plans[fm_band_plan].min / 10000);
++ si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, known_fm_band_plans[fm_band_plan].max / 10000);
++ if (verbose)
++ fprintf(stderr, "Using FM band: %d - %d, %d spacing\n",
++ known_fm_band_plans[fm_band_plan].min / 10000,
++ known_fm_band_plans[fm_band_plan].max / 10000,
++ known_fm_band_plans[fm_band_plan].step / 10000);
++ si46xx_set_property(SI46XX_FM_SEEK_FREQUENCY_SPACING, known_fm_band_plans[fm_band_plan].step / 10000);
++ if (fm_snr_threshold != 128) {
++ if (verbose)
++ fprintf(stderr, "Setting FM valid SNR threshold to %d dB\n", fm_snr_threshold);
++ si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD, fm_snr_threshold);
++ }
++ if (fm_rssi_threshold != 128) {
++ if (verbose)
++ fprintf(stderr, "Setting FM valid RSSI threshold to %d dB\n", fm_rssi_threshold);
++ si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD, fm_rssi_threshold);
++ }
++
+ /*
+ * rate
+ */
+@@ -190,6 +230,7 @@ int init_fm(int offset)
+
+ return 0;
+ }
++
+ int init_dab(int offset)
+ {
+ int ret;
+@@ -245,6 +286,10 @@ int output_help(char *prog_name)
+ printf(" -l up|down FM/AM seek next station\n");
+ printf(" -d FM/AM RSQ status\n");
+ printf(" -m FM rds status\n");
++ printf("Common FM:\n");
++ printf(" -p bandplan FM bandplan (us, jp, eu, itu-1, itu-2\n");
++ printf(" -t SNR FM scan valid SNR threshold (-127 to 127 dB)\n");
++ printf(" -u RSSI FM scan valid RSSI threshold (-127 to 127 dBuV)\n");
+ printf("DAB only:\n");
+ printf(" -e dab status\n");
+ printf(" -f service start service of dab service list\n");
+@@ -354,6 +399,7 @@ int main(int argc, char **argv)
+ int offset = - 1;
+ int mode;
+ int tmp;
++ unsigned int i;
+ struct dab_digrad_status_t dab_digrad_status;
+ bool init = false;
+ bool seek_up = false;
+@@ -374,7 +420,7 @@ int main(int argc, char **argv)
+
+ optind = 0;
+ while (optind < argc) {
+- if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnosv")) != -1) {
++ if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnop:st:u:v")) != -1) {
+ switch(c){
+ /* init */
+ case 'a':
+@@ -422,6 +468,31 @@ int main(int argc, char **argv)
+ case 'c':
+ frequency = atoi(optarg);
+ break;
++ /* FM */
++ case 'p':
++ for(i = 0;
++ i < sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t);
++ i++) {
++ if(!strcasecmp(optarg, known_fm_band_plans[i].name)) {
++ fm_band_plan = i;
++ break;
++ }
++ }
++ if(i >= (sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t))) {
++ printf("Invalid mode: %s\n", optarg);
++ return -EINVAL;
++ }
++ break;
++ case 't':
++ fm_snr_threshold = atoi(optarg);
++ if(fm_snr_threshold < -128 || fm_snr_threshold > 127)
++ fm_snr_threshold = 128; // use firmware default
++ break;
++ case 'u':
++ fm_rssi_threshold = atoi(optarg);
++ if(fm_rssi_threshold < -128 || fm_rssi_threshold > 127)
++ fm_rssi_threshold = 128; // use firmware default
++ break;
+ /* DAB stuff. TODO: rework */
+ case 'e':
+ si46xx_dab_digrad_status(&dab_digrad_status);
+@@ -473,7 +544,7 @@ int main(int argc, char **argv)
+ case SI46XX_MODE_FM:
+ ret = init_fm(offset);
+ if (frequency < 0)
+- frequency = 105500;
++ frequency = known_fm_band_plans[fm_band_plan].min / 1000;
+ break;
+ case SI46XX_MODE_AM:
+ ret = init_am(offset);
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb
new file mode 100644
index 000000000..b53504400
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-init_1.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Systemd service unit for Si468x radio initialization"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd
+
+SRC_URI = "file://si-init.service"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/si-init.service ${D}${systemd_system_unitdir}
+
+ # Add symlink to sysinit.target.wants
+ install -d ${D}${sysconfdir}/systemd/system/sysinit.target.wants
+ ln -s ${systemd_system_unitdir}/si-init.service ${D}${sysconfdir}/systemd/system/sysinit.target.wants/
+
+ # Add a rule to ensure the 'audio' user has permission to access
+ # the Si468x device via i2c
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >${D}${sysconfdir}/udev/rules.d/zz-radio-si.rules <<'EOF'
+KERNEL=="i2c-12", MODE="0660", GROUP="audio"
+EOF
+}
+
+FILES:${PN} += "${systemd_system_unitdir}"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend
new file mode 100644
index 000000000..7121bd168
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/si-tools/si-tools.bbappend
@@ -0,0 +1,28 @@
+FILESEXTRAPATHS:append := ":${THISDIR}/files"
+
+SRC_URI += " \
+ file://si-tools-fm-improvements.patch \
+"
+
+EXTRA_OEMAKE:append = " 'LDFLAGS=${LDFLAGS}'"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -d ${D}${nonarch_base_libdir}/firmware/radio/
+
+ install -m 755 si_ctl ${D}${bindir}
+ install -m 755 si_flash ${D}${bindir}
+ for file in ${SCRIPTS}; do
+ install -m 755 ${S}/scripts/$file ${D}${bindir}
+ sed -e 's,^\(SI_ARGS\s*=\s*\).*,\1"/dev/i2c-12 0x65",' -i ${D}${bindir}/$file
+ done
+
+ for file in ${FIRMWARE}; do
+ install -m 644 ${S}/firmware/$file ${D}${nonarch_base_libdir}/firmware/radio/
+ done
+}
+
+FILES:${PN} = " \
+ ${bindir} \
+ ${nonarch_base_libdir}/firmware/radio \
+"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend
new file mode 100644
index 000000000..52bee656d
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt-firmware/ti-bt-firmware_git.bbappend
@@ -0,0 +1,6 @@
+do_install() {
+ install -d ${D}${nonarch_base_libdir}/firmware/ti-connectivity/
+ cp *.bts ${D}${nonarch_base_libdir}/firmware/ti-connectivity/
+}
+
+FILES:${PN} = "${nonarch_base_libdir}/firmware/ti-connectivity/*"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service
new file mode 100644
index 000000000..214e60707
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt/ti-uim.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=User Mode Init Manager for TI shared transport
+Before=bluetooth.service
+
+[Service]
+ExecStartPre=-/sbin/modprobe -q btwilink
+ExecStart=/usr/bin/uim -f /sys/devices/platform/kim
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend
new file mode 100644
index 000000000..55d570fc7
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-bsp/ti-bt/ti-bt_%.bbappend
@@ -0,0 +1,18 @@
+inherit systemd
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://ti-uim.service"
+
+SYSTEMD_SERVICE:${PN} = "ti-uim.service"
+
+PR = "r0"
+PV = "0.1+git${SRCPV}"
+
+do_install:append() {
+ # We do not want the blacklist
+ rm -f ${D}/${sysconfdir}/modprobe.d/ti_bt.conf
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/ti-uim.service ${D}${systemd_unitdir}/system
+}
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch
new file mode 100644
index 000000000..d3a3229b4
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch
@@ -0,0 +1,114 @@
+From 71c2e7bc6ecf872dd3b45480859dce0f2e941b03 Mon Sep 17 00:00:00 2001
+From: Matt Porter <mporter@konsulko.com>
+Date: Wed, 13 Dec 2017 12:49:20 -0500
+Subject: [PATCH] arm64: dts: renesas: preserve drm HDMI connector naming on KF
+
+Kingfisher adds encoders on ports 0 and 2 of the R-Car
+display unit. The bare ULCB SK has only an HDMI encoder
+in use on port 1. When the system is booted with an SK
+dtb, port 1's HDMI encoder is assigned as HDMI-A-1 because
+it is the first (and only) encoder present. When booting
+a KF dtb, port 0's HDMI encoder preceeds port1 in the dtb due
+to incremental ordering of the endpoint port nodes. This causes
+the KF HDMI to be assigned HDMI-A-1 and the SK HDMI to be assigned
+as HDMI-A-2. In order to preserve the SK's HDMI output naming as
+connector HDMI-A-1, reorder the endpoint port nodes so that port1
+is first.
+
+Change-Id: Ibbb1975c2383a526a54c257fb7d68d32a042d468
+Signed-off-by: Matt Porter <mporter@konsulko.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
+---
+ arch/arm64/boot/dts/renesas/r8a77951.dtsi | 10 +++++-----
+ arch/arm64/boot/dts/renesas/r8a77960.dtsi | 10 +++++-----
+ arch/arm64/boot/dts/renesas/r8a77961.dtsi | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+index 12e78097533e..9ead58e8a7c2 100644
+--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
++++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+@@ -3943,11 +3943,6 @@ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- port@0 {
+- reg = <0>;
+- du_out_rgb: endpoint {
+- };
+- };
+ port@1 {
+ reg = <1>;
+ du_out_hdmi0: endpoint {
+@@ -3966,6 +3961,11 @@ du_out_lvds0: endpoint {
+ remote-endpoint = <&lvds0_in>;
+ };
+ };
++ port@0 {
++ reg = <0>;
++ du_out_rgb: endpoint {
++ };
++ };
+ };
+ };
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a77960.dtsi b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
+index 66ab48b3a704..a5481dc4a3f1 100644
+--- a/arch/arm64/boot/dts/renesas/r8a77960.dtsi
++++ b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
+@@ -3628,11 +3628,6 @@ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- port@0 {
+- reg = <0>;
+- du_out_rgb: endpoint {
+- };
+- };
+ port@1 {
+ reg = <1>;
+ du_out_hdmi0: endpoint {
+@@ -3645,6 +3640,11 @@ du_out_lvds0: endpoint {
+ remote-endpoint = <&lvds0_in>;
+ };
+ };
++ port@0 {
++ reg = <0>;
++ du_out_rgb: endpoint {
++ };
++ };
+ };
+ };
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+index ef2cb77f3c32..032ef1ca0633 100644
+--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
++++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+@@ -3434,11 +3434,6 @@ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+- port@0 {
+- reg = <0>;
+- du_out_rgb: endpoint {
+- };
+- };
+ port@1 {
+ reg = <1>;
+ du_out_hdmi0: endpoint {
+@@ -3451,6 +3446,11 @@ du_out_lvds0: endpoint {
+ remote-endpoint = <&lvds0_in>;
+ };
+ };
++ port@0 {
++ reg = <0>;
++ du_out_rgb: endpoint {
++ };
++ };
+ };
+ };
+
+--
+2.25.1
+
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend
new file mode 100644
index 000000000..20682e4f0
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas_%.bbappend
@@ -0,0 +1,29 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI:append:ulcb = " \
+ file://0001-arm64-dts-renesas-preserve-drm-HDMI-connector-naming.patch \
+"
+
+KERNEL_DEVICETREE:remove:h3ulcb = " \
+ renesas/r8a7795-es1-h3ulcb-view.dtb \
+ renesas/r8a7795-es1-h3ulcb-had-alfa.dtb \
+ renesas/r8a7795-es1-h3ulcb-had-beta.dtb \
+ renesas/r8a7795-es1-h3ulcb-vb.dtb \
+ renesas/r8a7795-es1-h3ulcb-vb2.dtb \
+ renesas/r8a7795-es1-h3ulcb-vbm.dtb \
+ renesas/r8a7795-h3ulcb-view.dtb \
+ renesas/r8a7795-h3ulcb-had-alfa.dtb \
+ renesas/r8a7795-h3ulcb-had-beta.dtb \
+ renesas/r8a7795-h3ulcb-vb.dtb \
+ renesas/r8a7795-h3ulcb-vb2.dtb \
+ renesas/r8a7795-h3ulcb-vb2.1.dtb \
+ renesas/r8a7795-h3ulcb-vbm.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb2.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vb2.1.dtb \
+ renesas/r8a7795-h3ulcb-4x2g-vbm.dtb \
+"
+
+# The meta-rcar layer actives by default the configuration MTD_RENESAS_RPC_HYPERFLASH
+# in the kernel. We need to set DISABLE_RPC_ACCESS to deactivate it.
+DISABLE_RPC_ACCESS ?= "1"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher
new file mode 100644
index 000000000..7e991dc0f
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/files/gpsd.kingfisher
@@ -0,0 +1,4 @@
+# If you must specify a non-NMEA driver, uncomment and modify the next line
+GPSD_SOCKET="/var/run/gpsd.sock"
+GPSD_OPTIONS=""
+GPS_DEVICES="/dev/ttySC2"
diff --git a/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend
new file mode 100644
index 000000000..51604706c
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3-adas/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI = "file://gpsd.kingfisher"
+
+inherit update-alternatives
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}/${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/gpsd.kingfisher ${D}/${sysconfdir}/default/gpsd.kingfisher
+}
+
+COMPATIBLE_MACHINE = "ulcb"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES:${PN} = "${sysconfdir}/default/gpsd.kingfisher"
+
+ALTERNATIVE:${PN} = "gpsd-defaults"
+ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
+ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.kingfisher"
+ALTERNATIVE_PRIORITY[gpsd-defaults] = "20"
diff --git a/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
new file mode 100644
index 000000000..3e2bf8f1c
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control.inc
@@ -0,0 +1,25 @@
+require checksum_control_files.inc
+
+python do_checksum_control() {
+ to_check_dico = d.getVarFlags("CTL_CHECKSUM")
+ if to_check_dico is None:
+ return 0
+
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ for s in src_uri:
+ c_source=os.path.basename(s)
+ bb.note("Check source: %s " % (c_source))
+ if c_source in to_check_dico:
+ f_data = bb.fetch2.FetchData(s, d, True)
+ f_data.setup_localpath(d)
+ if os.path.exists(f_data.localpath):
+ mdr5_sum=bb.utils.md5_file(f_data.localpath)
+ mdr5_ctl=to_check_dico[c_source]
+ if mdr5_sum != mdr5_ctl:
+ bb.fatal( "File %s hash should be %s but %s find, please update your driver files." % (c_source, mdr5_ctl, mdr5_sum))
+}
+
+do_checksum_control[doc] = "Do a checksum of the archives source files"
+do_checksum_control[vardeps] = "CTL_CHECKSUM"
+
+addtask do_checksum_control before do_unpack after do_fetch
diff --git a/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc
new file mode 100644
index 000000000..6c9f49c3b
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/include/checksum_control_files.inc
@@ -0,0 +1,16 @@
+CTL_CHECKSUM[r8a77951_linux_gsx_binaries_gles.tar.bz2]="06cc04c52f56048dbc00ead14447cb35"
+CTL_CHECKSUM[r8a77960_linux_gsx_binaries_gles.tar.bz2]="a24be039f1c294035416dbd77fa10f4a"
+CTL_CHECKSUM[GSX_KM_H3.tar.bz2]="563ff3f5d5dc8b40d19d0b6e7484bf22"
+CTL_CHECKSUM[GSX_KM_M3.tar.bz2]="7cbbffb874b30e36cc2c7751573e468b"
+CTL_CHECKSUM[RTM8RC0000ZMX0DQ00JFL3E.tar.bz2]="2ee662978a45fc7c7cf2cef0e4bf1e33"
+CTL_CHECKSUM[RTM8RC0000ZAD1LQ00JPL3E.tar.gz]="f59cb979a030a3545a6c0b2337e8ea0e"
+CTL_CHECKSUM[RTM8RC0000ZAE1LQ00JPL3E.tar.gz]="7bdfac397034e8e13425cd83e3bd5090"
+CTL_CHECKSUM[RTM8RC0000ZMD0LQ00JPL3E.tar.bz2]="8d774178a3fe5ddac0cc5bd16bc58e3e"
+CTL_CHECKSUM[RTM8RC0000ZMD1LQ00JPL3E.tar.bz2]="3f30a263a038d148b2af445bc09dc4b7"
+CTL_CHECKSUM[RTM8RC0000ZME0LQ00JPL3E.tar.bz2]="8f83d1c3947904e48316faa058c196c7"
+CTL_CHECKSUM[RTM8RC0000ZME1LQ00JPL3E.tar.bz2]="89d4ce58062ef956fa2b8ef1bd8a66f3"
+CTL_CHECKSUM[RTM8RC0000ZMX0LQ00JPL3E.tar.bz2]="035361ad4715bbb491ee23d80bc50e3a"
+CTL_CHECKSUM[RTM8RC0000ZND1LQ00JPL3E.tar.gz]="b56fa5404bdee152b557869390783eb4"
+CTL_CHECKSUM[RTM8RC0000ZNE1LQ00JPL3E.tar.gz]="63880c583eb132b868a074db3d39c8ee"
+CTL_CHECKSUM[RTM8RC0000ZNX0LQ00JPL3E.tar.gz]="53ff1eb5de6c5345bd24e8e3605eb82d"
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md
deleted file mode 100644
index 49ab7cc9d..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# back port from poky
-## gstreamer
- src: poky/meta/recipes-multimedia/gstreamer/ ae9b341ecfcc60e970f29cfe04306411ad26c0cf
-
-# port from meta-linaro
-## python-wand
- src: meta-linaro/meta-optee/recipes-devtools/python/python-wand_0.4.3.bb b6d0b81584c3395708b27ffe7b8fe248ef674839
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
deleted file mode 100644
index 2cab87f9e..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 90916f96262fa7b27a0a99788c69f9fd6df11000 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 24 Nov 2015 16:46:27 +0200
-Subject: [PATCH] introspection.m4: prefix pkgconfig paths with
- PKG_CONFIG_SYSROOT_DIR
-
-We can't use our tweaked introspection.m4 from gobject-introspection tarball
-because gstreamer also defines INTROSPECTION_INIT in its introspection.m4, which
-is later supplied to g-ir-scanner.
-
-Upstream-Status: Pending [review on oe-core list]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- common/m4/introspection.m4 | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4
-index 162be57..217a6ae 100644
---- a/common/m4/introspection.m4
-+++ b/common/m4/introspection.m4
-@@ -54,14 +54,14 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
- INTROSPECTION_GIRDIR=
- INTROSPECTION_TYPELIBDIR=
- if test "x$found_introspection" = "xyes"; then
-- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-+ INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-+ INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-+ INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
-- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
-+ INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
- INTROSPECTION_INIT="extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);"
- fi
- AC_SUBST(INTROSPECTION_SCANNER)
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch
deleted file mode 100644
index 712d46daa..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Add-error-signal-emission-for-missing-plugins.patch
+++ /dev/null
@@ -1,252 +0,0 @@
-From d64c7edb66f4a64ff49c4306cf77fd269b7079ab Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Mon, 16 Mar 2015 13:45:30 +0200
-Subject: [PATCH] Add error signal emission for missing plugins
-
-Add a missing plugins error signal to gst-player. Note that this error
-does not necessarily mean the playback has completely failed, but in
-practice the user experience will be bad (think, e.g. of a mp4 file
-where H.264 codec is missing: AAC playback still works...).
-
-Use the signal in gtk-play to show a infobar if plugins are missing.
-
-Submitted upstream at https://github.com/sdroege/gst-player/pull/11
-
-Upstream-Status: Submitted
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- configure.ac | 2 +-
- gtk/gtk-play.c | 54 +++++++++++++++++++++++++++++++++++++++++++++-
- lib/gst/player/gstplayer.c | 22 +++++++++++++++++++
- lib/gst/player/gstplayer.h | 3 ++-
- 4 files changed, 78 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 90ab74c..6cdb4eb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -53,7 +53,7 @@ AC_SUBST(LT_AGE)
- PKG_PROG_PKG_CONFIG
-
- PKG_CHECK_MODULES(GLIB, [glib-2.0 gobject-2.0])
--PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4])
-+PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4 gstreamer-pbutils-1.0])
-
- GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
- AC_SUBST(GLIB_PREFIX)
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index b92773b..e2b605a 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -30,6 +30,8 @@ typedef struct
- GtkWidget *prev_button, *next_button;
- GtkWidget *seekbar;
- GtkWidget *video_area;
-+ GtkWidget *info_label;
-+ GtkWidget *info_bar;
- GtkWidget *volume_button;
- gulong seekbar_value_changed_signal_id;
- gboolean playing;
-@@ -141,6 +143,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
- }
-
- static void
-+clear_missing_plugins (GtkPlay * play)
-+{
-+ gtk_label_set_text (GTK_LABEL (play->info_label), "");
-+ gtk_widget_hide (play->info_bar);
-+}
-+
-+static void
- skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
- {
- GList *prev;
-@@ -155,6 +164,7 @@ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
-
- gtk_widget_set_sensitive (play->next_button, TRUE);
- gst_player_set_uri (play->player, prev->data);
-+ clear_missing_plugins (play);
- gst_player_play (play->player);
- set_title (play, prev->data);
- gtk_widget_set_sensitive (play->prev_button, g_list_previous (prev) != NULL);
-@@ -175,6 +185,7 @@ skip_next_clicked_cb (GtkButton * button, GtkPlay * play)
-
- gtk_widget_set_sensitive (play->prev_button, TRUE);
- gst_player_set_uri (play->player, next->data);
-+ clear_missing_plugins (play);
- gst_player_play (play->player);
- set_title (play, next->data);
- gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
-@@ -193,10 +204,16 @@ volume_changed_cb (GtkScaleButton * button, gdouble value, GtkPlay * play)
- gst_player_set_volume (play->player, value);
- }
-
-+void
-+info_bar_response_cb (GtkInfoBar * bar, gint response, GtkPlay * play)
-+{
-+ gtk_widget_hide (GTK_WIDGET (bar));
-+}
-+
- static void
- create_ui (GtkPlay * play)
- {
-- GtkWidget *controls, *main_hbox, *main_vbox;
-+ GtkWidget *controls, *main_hbox, *main_vbox, *info_bar, *content_area;
-
- play->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_signal_connect (G_OBJECT (play->window), "delete-event",
-@@ -208,6 +225,20 @@ create_ui (GtkPlay * play)
- g_signal_connect (play->video_area, "realize",
- G_CALLBACK (video_area_realize_cb), play);
-
-+ play->info_bar = gtk_info_bar_new ();
-+ gtk_info_bar_set_message_type (GTK_INFO_BAR (play->info_bar),
-+ GTK_MESSAGE_WARNING);
-+ //gtk_info_bar_set_show_close_button (GTK_INFO_BAR (play->info_bar),
-+ // TRUE);
-+ gtk_widget_set_no_show_all (play->info_bar, TRUE);
-+ g_signal_connect (play->info_bar, "response",
-+ G_CALLBACK (info_bar_response_cb), play);
-+
-+ content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (play->info_bar));
-+ play->info_label = gtk_label_new ("");
-+ gtk_container_add (GTK_CONTAINER (content_area), play->info_label);
-+ gtk_widget_show (play->info_label);
-+
- /* Unified play/pause button */
- play->play_pause_button =
- gtk_button_new_from_icon_name ("media-playback-pause",
-@@ -258,6 +289,7 @@ create_ui (GtkPlay * play)
-
- main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, TRUE, 0);
-+ gtk_box_pack_start (GTK_BOX (main_vbox), play->info_bar, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (main_vbox), controls, FALSE, FALSE, 0);
- gtk_container_add (GTK_CONTAINER (play->window), main_vbox);
-
-@@ -322,6 +354,7 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
- gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
-
- gst_player_set_uri (play->player, next->data);
-+ clear_missing_plugins (play);
- gst_player_play (play->player);
- set_title (play, next->data);
- } else {
-@@ -330,6 +363,24 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
- }
- }
-
-+static void
-+error_cb (GstPlayer * player, GError * err, GtkPlay * play)
-+{
-+ char *message;
-+
-+ if (g_error_matches (err, gst_player_error_quark (),
-+ GST_PLAYER_ERROR_MISSING_PLUGIN)) {
-+ // add message to end of any existing message: there may be
-+ // multiple missing plugins.
-+ message = g_strdup_printf ("%s%s. ",
-+ gtk_label_get_text (GTK_LABEL (play->info_label)), err->message);
-+ gtk_label_set_text (GTK_LABEL (play->info_label), message);
-+ g_free (message);
-+
-+ gtk_widget_show (play->info_bar);
-+ }
-+}
-+
- int
- main (gint argc, gchar ** argv)
- {
-@@ -422,6 +473,7 @@ main (gint argc, gchar ** argv)
- g_signal_connect (play.player, "video-dimensions-changed",
- G_CALLBACK (video_dimensions_changed_cb), &play);
- g_signal_connect (play.player, "end-of-stream", G_CALLBACK (eos_cb), &play);
-+ g_signal_connect (play.player, "error", G_CALLBACK (error_cb), &play);
-
- /* We have file(s) that need playing. */
- set_title (&play, g_list_first (play.uris)->data);
-diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
-index bd682d9..78e7ba1 100644
---- a/lib/gst/player/gstplayer.c
-+++ b/lib/gst/player/gstplayer.c
-@@ -47,6 +47,7 @@
-
- #include <gst/gst.h>
- #include <gst/video/video.h>
-+#include <gst/pbutils/missing-plugins.h>
-
- GST_DEBUG_CATEGORY_STATIC (gst_player_debug);
- #define GST_CAT_DEFAULT gst_player_debug
-@@ -238,6 +239,7 @@ gst_player_class_init (GstPlayerClass * klass)
- g_signal_new ("video-dimensions-changed", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL,
- NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-+
- }
-
- static void
-@@ -619,6 +621,21 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
- g_mutex_unlock (&self->priv->lock);
- }
-
-+static void
-+element_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
-+{
-+ GstPlayer *self = GST_PLAYER (user_data);
-+
-+ if (gst_is_missing_plugin_message (msg)) {
-+ gchar *desc;
-+
-+ desc = gst_missing_plugin_message_get_description (msg);
-+ emit_error (self, g_error_new (GST_PLAYER_ERROR,
-+ GST_PLAYER_ERROR_MISSING_PLUGIN, "Missing plugin '%s'", desc));
-+ g_free (desc);
-+ }
-+}
-+
- static gboolean
- eos_dispatch (gpointer user_data)
- {
-@@ -1059,6 +1076,8 @@ gst_player_main (gpointer data)
- NULL, NULL);
- g_source_attach (bus_source, self->priv->context);
-
-+ g_signal_connect (G_OBJECT (bus), "message::element",
-+ G_CALLBACK (element_cb), self);
- g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb),
- self);
- g_signal_connect (G_OBJECT (bus), "message::eos", G_CALLBACK (eos_cb), self);
-@@ -1560,6 +1579,7 @@ gst_player_error_get_type (void)
- static gsize id = 0;
- static const GEnumValue values[] = {
- {C_ENUM (GST_PLAYER_ERROR_FAILED), "GST_PLAYER_ERROR_FAILED", "failed"},
-+ {C_ENUM (GST_PLAYER_ERROR_MISSING_PLUGIN), "GST_PLAYER_ERROR_MISSING_PLUGIN", "missing-plugin"},
- {0, NULL, NULL}
- };
-
-@@ -1577,6 +1597,8 @@ gst_player_error_get_name (GstPlayerError error)
- switch (error) {
- case GST_PLAYER_ERROR_FAILED:
- return "failed";
-+ case GST_PLAYER_ERROR_MISSING_PLUGIN:
-+ return "missing-plugin";
- }
-
- g_assert_not_reached ();
-diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
-index c438513..35fb5bb 100644
---- a/lib/gst/player/gstplayer.h
-+++ b/lib/gst/player/gstplayer.h
-@@ -44,7 +44,8 @@ GType gst_player_error_get_type (void);
- #define GST_TYPE_PLAYER_ERROR (gst_player_error_get_type ())
-
- typedef enum {
-- GST_PLAYER_ERROR_FAILED = 0
-+ GST_PLAYER_ERROR_FAILED = 0,
-+ GST_PLAYER_ERROR_MISSING_PLUGIN
- } GstPlayerError;
-
- const gchar *gst_player_error_get_name (GstPlayerError error);
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch
deleted file mode 100644
index 783c42ad7..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/Fix-pause-play.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-Fix pause/play
-
-The current player state is now notified via the state-changed signal,
-and in the GTK UI it was only used to keep track of the desired state.
-
-This is a backport of upstream commit 738479c7a0.
-
-Upstream-Status: Backport
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
----
- gtk/gtk-play.c | 8 ++++++--
- lib/gst/player/gstplayer.c | 12 ------------
- lib/gst/player/gstplayer.h | 2 --
- 3 files changed, 6 insertions(+), 16 deletions(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index 6e7a098..e2b605a 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -34,6 +34,7 @@ typedef struct
- GtkWidget *info_bar;
- GtkWidget *volume_button;
- gulong seekbar_value_changed_signal_id;
-+ gboolean playing;
- } GtkPlay;
-
- /* Compat stubs */
-@@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
- {
- GtkWidget *image;
-
-- if (gst_player_is_playing (play->player)) {
-+ if (play->playing) {
- gst_player_pause (play->player);
- image =
- gtk_image_new_from_icon_name ("media-playback-start",
- GTK_ICON_SIZE_BUTTON);
- gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
-+ play->playing = FALSE;
- } else {
- gchar *title;
-
-@@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
- title = gst_player_get_uri (play->player);
- set_title (play, title);
- g_free (title);
-+ play->playing = TRUE;
- }
- }
-
-@@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
- static void
- eos_cb (GstPlayer * unused, GtkPlay * play)
- {
-- if (gst_player_is_playing (play->player)) {
-+ if (play->playing) {
- GList *next = NULL;
- gchar *uri;
-
-@@ -452,6 +455,7 @@ main (gint argc, gchar ** argv)
- }
-
- play.player = gst_player_new ();
-+ play.playing = TRUE;
-
- g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
-
-diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
-index 069b284..78e7ba1 100644
---- a/lib/gst/player/gstplayer.c
-+++ b/lib/gst/player/gstplayer.c
-@@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val)
- g_object_set (self, "uri", val, NULL);
- }
-
--gboolean
--gst_player_is_playing (GstPlayer * self)
--{
-- gboolean val;
--
-- g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
--
-- g_object_get (self, "is-playing", &val, NULL);
--
-- return val;
--}
--
- GstClockTime
- gst_player_get_position (GstPlayer * self)
- {
-diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
-index 6933dd7..35fb5bb 100644
---- a/lib/gst/player/gstplayer.h
-+++ b/lib/gst/player/gstplayer.h
-@@ -93,8 +93,6 @@ gchar * gst_player_get_uri (GstPlayer * player);
- void gst_player_set_uri (GstPlayer * player,
- const gchar * uri);
-
--gboolean gst_player_is_playing (GstPlayer * player);
--
- GstClockTime gst_player_get_position (GstPlayer * player);
- GstClockTime gst_player_get_duration (GstPlayer * player);
-
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch
deleted file mode 100644
index 7bf1b034b..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/filechooser.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From 43d4b19ab611d844156e26c4840cc54ddb73ae03 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Thu, 26 Feb 2015 17:17:05 +0000
-Subject: [PATCH] gtk-play: show a file chooser if no URIs were passed
-
----
- gtk/gtk-play.c | 28 ++++++++++++++++++++++++++--
- 1 file changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index f015077..9766a72 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -319,8 +319,32 @@ main (gint argc, gchar ** argv)
- // FIXME: Add support for playlists and stuff
- /* Parse the list of the file names we have to play. */
- if (!file_names) {
-- g_print ("Usage: %s FILE(s)|URI(s)\n", APP_NAME);
-- return 1;
-+ GtkWidget *chooser;
-+ int res;
-+
-+ chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL,
-+ GTK_FILE_CHOOSER_ACTION_OPEN,
-+ "_Cancel", GTK_RESPONSE_CANCEL,
-+ "_Open", GTK_RESPONSE_ACCEPT,
-+ NULL);
-+ g_object_set (chooser,
-+ "local-only", FALSE,
-+ "select-multiple", TRUE,
-+ NULL);
-+
-+ res = gtk_dialog_run (GTK_DIALOG (chooser));
-+ if (res == GTK_RESPONSE_ACCEPT) {
-+ GSList *l;
-+
-+ l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
-+ while (l) {
-+ play.uris = g_list_append (play.uris, l->data);
-+ l = g_slist_delete_link (l, l);
-+ }
-+ } else {
-+ return 0;
-+ }
-+ gtk_widget_destroy (chooser);
- } else {
- guint i;
-
---
-1.7.10.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop
deleted file mode 100644
index 9fd207b38..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gst-player.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Name=Media Player
-Comment=Basic media player
-Icon=audio-player
-TryExec=gtk-play
-Exec=gtk-play
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=GTK;AudioVideo;
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch
deleted file mode 100644
index 2cd18bbc9..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player/gtk2.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-As the rest of Sato is GTK+ 2, patch gtk-play to use GTK+ 2. When the rest of
-Sato has been ported to GTK+ 3 this patch can be dropped.
-
-Upstream-Status: Inappropriate
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-
-diff --git a/configure.ac b/configure.ac
-index b8af13b..90ab74c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -60,7 +60,7 @@ AC_SUBST(GLIB_PREFIX)
- GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-1.0`"
- AC_SUBST(GST_PREFIX)
-
--PKG_CHECK_MODULES(GTK, [gtk+-3.0], [have_gtk="yes"], [have_gtk="no"])
-+PKG_CHECK_MODULES(GTK, [gtk+-2.0], [have_gtk="yes"], [have_gtk="no"])
- AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" != "xno")
-
- GOBJECT_INTROSPECTION_CHECK([1.31.1])
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index f015077..954d6fb 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -34,6 +34,46 @@ typedef struct
- gulong seekbar_value_changed_signal_id;
- } GtkPlay;
-
-+/* Compat stubs */
-+GtkWidget *
-+gtk_box_new (GtkOrientation orientation,
-+ gint spacing)
-+{
-+ switch (orientation) {
-+ case GTK_ORIENTATION_HORIZONTAL:
-+ return gtk_hbox_new (FALSE, spacing);
-+ case GTK_ORIENTATION_VERTICAL:
-+ return gtk_vbox_new (FALSE, spacing);
-+ }
-+}
-+
-+GtkWidget*
-+gtk_button_new_from_icon_name (const gchar *icon_name,
-+ GtkIconSize size)
-+{
-+ GtkWidget *button;
-+ GtkWidget *image;
-+
-+ image = gtk_image_new_from_icon_name (icon_name, size);
-+ button = g_object_new (GTK_TYPE_BUTTON,
-+ "image", image,
-+ NULL);
-+ return button;
-+}
-+
-+GtkWidget *
-+gtk_scale_new_with_range (GtkOrientation orientation,
-+ gdouble min,
-+ gdouble max,
-+ gdouble step)
-+{
-+ switch (orientation) {
-+ case GTK_ORIENTATION_HORIZONTAL:
-+ return gtk_hscale_new_with_range (min, max, step);
-+ case GTK_ORIENTATION_VERTICAL:
-+ return gtk_vscale_new_with_range (min, max, step);
-+ }
-+}
-
- static void
- set_title (GtkPlay * play, const gchar * title)
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb
deleted file mode 100644
index 8129169c5..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-player_git.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-SUMMARY = "GStreamer playback helper library and examples"
-LICENSE = "LGPL-2.0+"
-LIC_FILES_CHKSUM = "file://lib/gst/player/gstplayer.c;beginline=1;endline=19;md5=03aeca9d8295f811817909075a15ff65"
-
-DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gtk+"
-
-SRC_URI = "git://github.com/sdroege/gst-player.git \
- file://filechooser.patch \
- file://gtk2.patch \
- file://Fix-pause-play.patch \
- file://Add-error-signal-emission-for-missing-plugins.patch \
- file://gst-player.desktop"
-
-SRCREV = "5386c5b984d40ef5434673ed62204e69aaf52645"
-
-S = "${WORKDIR}/git"
-
-inherit autotools gtk-doc lib_package pkgconfig distro_features_check gobject-introspection
-
-ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
-
-do_configure_prepend() {
- touch ${S}/ChangeLog
-}
-
-EXTRA_OECONF += "ac_cv_path_VALGRIND=no ac_cv_path_GDB=no"
-
-do_install_append() {
- install -m 0644 -D ${WORKDIR}/gst-player.desktop ${D}${datadir}/applications/gst-player.desktop
-}
-
-FILES_${PN}-bin += "${datadir}/applications/*.desktop"
-
-RDEPENDS_${PN}-bin = "gstreamer1.0-plugins-base-playback"
-RRECOMMENDS_${PN}-bin = "gstreamer1.0-plugins-base-meta \
- gstreamer1.0-plugins-good-meta \
- gstreamer1.0-plugins-bad-meta \
- ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-libav", "", d)} \
- ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-plugins-ugly-meta", "", d)}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc
deleted file mode 100644
index c24493e1e..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gst-plugins-package.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
-PACKAGESPLITFUNCS_append = " set_metapkg_rdepends "
-
-python split_gstreamer10_packages () {
- gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
- postinst = d.getVar('plugin_postinst', True)
- glibdir = d.getVar('libdir', True)
-
- do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
- do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
- do_split_packages(d, glibdir+'/girepository-1.0', 'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer typelib file for %s', postinst=postinst, extra_depends='')
- do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends='${PN}-dev')
- do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends='${PN}-staticdev')
-}
-
-python set_metapkg_rdepends () {
- import os
-
- pn = d.getVar('PN', True)
- metapkg = pn + '-meta'
- d.setVar('ALLOW_EMPTY_' + metapkg, "1")
- d.setVar('FILES_' + metapkg, "")
- blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ]
- metapkg_rdepends = []
- packages = d.getVar('PACKAGES', True).split()
- pkgdest = d.getVar('PKGDEST', True)
- for pkg in packages[1:]:
- if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
- # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
- # If this subdirectory is empty, then the package is.
- # Empty packages do not get added to the meta package's RDEPENDS
- pkgdir = os.path.join(pkgdest, pkg)
- if os.path.exists(pkgdir):
- dir_contents = os.listdir(pkgdir) or []
- else:
- dir_contents = []
- is_empty = len(dir_contents) == 0
- if not is_empty:
- metapkg_rdepends.append(pkg)
- d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
- d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
-}
-
-# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
-# so we need them even when empty (like in gst-plugins-good case)
-ALLOW_EMPTY_${PN} = "1"
-ALLOW_EMPTY_${PN}-dev = "1"
-ALLOW_EMPTY_${PN}-staticdev = "1"
-
-PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
-
-FILES_${PN} = ""
-FILES_${PN}-apps = "${bindir}"
-FILES_${PN}-glib = "${datadir}/glib-2.0"
-
-RRECOMMENDS_${PN} += "${PN}-meta"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc
deleted file mode 100644
index 363101e1a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav.inc
+++ /dev/null
@@ -1,46 +0,0 @@
-SUMMARY = "Libav-based GStreamer 1.x plugin"
-HOMEPAGE = "http://gstreamer.freedesktop.org/"
-SECTION = "multimedia"
-
-LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
-LICENSE_FLAGS = "commercial"
-
-DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base zlib bzip2 xz"
-
-inherit autotools pkgconfig upstream-version-is-even
-
-# CAUTION: Using the system libav is not recommended. Since the libav API is changing all the time,
-# compilation errors (and other, more subtle bugs) can happen. It is usually better to rely on the
-# libav copy included in the gst-libav package.
-PACKAGECONFIG ??= "orc yasm"
-
-PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl,"
-PACKAGECONFIG[libav] = "--with-system-libav,,libav"
-PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
-PACKAGECONFIG[yasm] = "--enable-yasm,--disable-yasm,yasm-native"
-
-GSTREAMER_1_0_DEBUG ?= "--disable-debug"
-
-LIBAV_EXTRA_CONFIGURE = "--with-libav-extra-configure"
-
-LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
- --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
- --ranlib='${RANLIB}' \
- ${GSTREAMER_1_0_DEBUG} \
- --cross-prefix='${HOST_PREFIX}'"
-
-LIBAV_EXTRA_CONFIGURE_COMMON = \
-'${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"'
-
-EXTRA_OECONF = "${LIBAV_EXTRA_CONFIGURE_COMMON}"
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
-FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
-
-# http://errors.yoctoproject.org/Errors/Details/20493/
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-# ffmpeg/libav disables PIC on some platforms (e.g. x86-32)
-INSANE_SKIP_${PN} = "textrel"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
deleted file mode 100644
index 1d99ad125..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 54bba228ea52d01fd84941d97be23c03f9862b64 Mon Sep 17 00:00:00 2001
-From: Carlos Rafael Giani <dv@pseudoterminal.org>
-Date: Sat, 6 Apr 2013 01:22:22 +0200
-Subject: [PATCH] Disable yasm for libav when --disable-yasm
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Shane Wang <shane.wang@intel.com>
-Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
----
- configure.ac | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 22ede88..ef3c050 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -305,6 +305,12 @@ else
- emblibav_configure_args="$emblibav_configure_args --enable-gpl"
- fi
-
-+ AC_ARG_ENABLE(yasm,
-+ [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])])
-+ if test "x$enable_yasm" = "xno"; then
-+ emblibav_configure_args="$emblibav_configure_args --disable-yasm"
-+ fi
-+
- # if we are cross-compiling, tell libav so
- case $host in
- *android*)
---
-1.8.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
deleted file mode 100644
index 36abf8607..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Description: Workaround to build libav for i586 with gcc 4.9.2 by avoiding memset
-Author: Bernhard belacker <bernhardu@vr-web.de>
-
----
-Bug-Debian: https://bugs.debian.org/783082
-Last-Update: 2015-04-28
-
-Upstream-Status: Backport [debian]
-
-Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-
---- gst-libav-1.4.5.orig/gst-libs/ext/libav/libavcodec/h264_cabac.c
-+++ gst-libav-1.4.5/gst-libs/ext/libav/libavcodec/h264_cabac.c
-@@ -2020,7 +2020,11 @@ decode_intra_mb:
- // In deblocking, the quantizer is 0
- h->cur_pic.qscale_table[mb_xy] = 0;
- // All coeffs are present
-- memset(h->non_zero_count[mb_xy], 16, 48);
-+ /*memset(h->non_zero_count[mb_xy], 16, 48);*/
-+ /* avoiding this memset because it leads at least with gcc4.9.2 to error: 'asm' operand has impossible constraints */
-+ for (size_t i = 0; i < 48; i++) {
-+ ( (unsigned char*)(h->non_zero_count[mb_xy]) ) [i] = 16;
-+ }
- h->cur_pic.mb_type[mb_xy] = mb_type;
- sl->last_qscale_diff = 0;
- return 0;
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb
deleted file mode 100644
index 687230a8f..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_1.6.3.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-include gstreamer1.0-libav.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
- file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
- file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
- file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
- file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
- file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
- file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
-"
-
-SRC_URI[md5sum] = "cfe9a06913d4fd4067e9e47f6e05fac2"
-SRC_URI[sha256sum] = "857b9c060a0337de38c6d26238c47352433c02eabf26c2f860c854dbc35bd4ab"
-
-S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb
deleted file mode 100644
index ebc8a5ef2..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-libav_git.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-libav.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
- file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
- file://gst-libs/ext/libav/LICENSE.md;md5=acda96fe91ccaabc9cd9d541806a0d37 \
- file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
- file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
- file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
- file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-# To build using the system libav/ffmpeg, append "libav" to PACKAGECONFIG
-# and remove the ffmpeg sources from SRC_URI below. However, first note the
-# warnings in gstreamer1.0-libav.inc
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-libav;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
- git://source.ffmpeg.org/ffmpeg;destsuffix=git/gst-libs/ext/libav;name=ffmpeg;branch=release/3.0 \
- file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
- file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "6c4878b6abc916b7f6f25b8926c4859119acf1ec"
-SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
-SRCREV_ffmpeg = "c40983a6f631d22fede713d535bb9c31d5c9740c"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb
deleted file mode 100644
index c542b13f0..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-meta-base.bb
+++ /dev/null
@@ -1,68 +0,0 @@
-SUMMARY = "Gstreamer1.0 package groups"
-LICENSE = "MIT"
-
-# Due to use of COMBINED_FEATURES
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-inherit packagegroup
-
-COMMERCIAL_PLUGINS = "${COMMERCIAL_AUDIO_PLUGINS} ${COMMERCIAL_VIDEO_PLUGINS}"
-DEPENDS_UGLY="${@'gstreamer1.0-plugins-ugly' if 'ugly' in COMMERCIAL_PLUGINS.split('-') else ''}"
-DEPENDS_BAD="${@'gstreamer1.0-plugins-bad' if 'bad' in COMMERCIAL_PLUGINS.split('-') else ''}"
-DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good ${DEPENDS_UGLY} ${DEPENDS_BAD}"
-
-PACKAGES = "\
- gstreamer1.0-meta-base \
- gstreamer1.0-meta-x11-base \
- gstreamer1.0-meta-audio \
- gstreamer1.0-meta-debug \
- gstreamer1.0-meta-video"
-
-ALLOW_EMPTY_gstreamer1.0-meta-base = "1"
-ALLOW_EMPTY_gstreamer1.0-meta-x11-base = "1"
-ALLOW_EMPTY_gstreamer1.0-meta-audio = "1"
-ALLOW_EMPTY_gstreamer1.0-meta-debug = "1"
-ALLOW_EMPTY_gstreamer1.0-meta-video = "1"
-
-RDEPENDS_gstreamer1.0-meta-base = "\
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gstreamer1.0-meta-x11-base', '', d)} \
- gstreamer1.0 \
- gstreamer1.0-plugins-base-playback \
- gstreamer1.0-plugins-base-gio \
- ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'gstreamer1.0-plugins-base-alsa', '',d)} \
- gstreamer1.0-plugins-base-volume \
- gstreamer1.0-plugins-base-audioconvert \
- gstreamer1.0-plugins-base-audioresample \
- gstreamer1.0-plugins-base-typefindfunctions \
- gstreamer1.0-plugins-base-videoscale \
- gstreamer1.0-plugins-base-videoconvert \
- gstreamer1.0-plugins-good-autodetect \
- gstreamer1.0-plugins-good-souphttpsrc"
-
-RRECOMMENDS_gstreamer1.0-meta-x11-base = "\
- gstreamer1.0-plugins-base-ximagesink \
- gstreamer1.0-plugins-base-xvimagesink"
-
-RDEPENDS_gstreamer1.0-meta-audio = "\
- gstreamer1.0-meta-base \
- gstreamer1.0-plugins-base-vorbis \
- gstreamer1.0-plugins-base-ogg \
- gstreamer1.0-plugins-good-wavparse \
- gstreamer1.0-plugins-good-flac \
- ${COMMERCIAL_AUDIO_PLUGINS}"
-
-RDEPENDS_gstreamer1.0-meta-debug = "\
- gstreamer1.0-meta-base \
- gstreamer1.0-plugins-good-debug \
- gstreamer1.0-plugins-base-audiotestsrc \
- gstreamer1.0-plugins-base-videotestsrc"
-
-RDEPENDS_gstreamer1.0-meta-video = "\
- gstreamer1.0-meta-base \
- gstreamer1.0-plugins-good-avi \
- gstreamer1.0-plugins-good-matroska \
- gstreamer1.0-plugins-base-theora \
- ${COMMERCIAL_VIDEO_PLUGINS}"
-
-RRECOMMENDS_gstreamer1.0-meta-video = "\
- gstreamer1.0-meta-audio"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc
deleted file mode 100644
index 0fff612ee..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "OpenMAX IL plugins for GStreamer"
-HOMEPAGE = "http://gstreamer.freedesktop.org/"
-SECTION = "multimedia"
-
-LICENSE = "LGPLv2.1"
-LICENSE_FLAGS = "commercial"
-
-DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
-
-inherit autotools pkgconfig gettext
-
-acpaths = "-I ${S}/common/m4 -I ${S}/m4"
-
-PR = "r1"
-
-GSTREAMER_1_0_OMX_TARGET ?= "bellagio"
-GSTREAMER_1_0_OMX_CORE_NAME ?= "${libdir}/libomxil-bellagio.so.0"
-
-EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}"
-
-python __anonymous () {
- omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET", True)
- if omx_target in ['generic', 'bellagio']:
- # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,#
- # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros);
- # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this
- d.appendVar("CFLAGS", " -I${S}/omx/openmax")
- elif omx_target == "rpi":
- # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific
- d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH", True))
-}
-
-set_omx_core_name() {
- sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf"
-}
-
-do_install[postfuncs] += " set_omx_core_name "
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
-FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
-
-RDEPENDS_${PN} = "libomxil"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
deleted file mode 100644
index a428ac9c9..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f629e041e9f678fcd86ad764a15117dff63c271c Mon Sep 17 00:00:00 2001
-From: Carlos Rafael Giani <dv@pseudoterminal.org>
-Date: Sat, 27 Apr 2013 02:50:25 +0200
-Subject: [PATCH] omx: fixed type error in printf call
-
-%zu expects size_t
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=699008]
-
-Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
----
- omx/gstomx.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/omx/gstomx.c b/omx/gstomx.c
-index a2945ed..1eca7cc 100644
---- a/omx/gstomx.c
-+++ b/omx/gstomx.c
-@@ -1630,7 +1630,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
-
- GST_INFO_OBJECT (comp->parent,
- "Allocating %d buffers of size %zu for %s port %u", n,
-- port->port_def.nBufferSize, comp->name, (guint) port->index);
-+ (size_t) (port->port_def.nBufferSize), comp->name, (guint) port->index);
-
- if (!port->buffers)
- port->buffers = g_ptr_array_sized_new (n);
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb
deleted file mode 100644
index 74358a724..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_1.2.0.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-include gstreamer1.0-omx.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
- file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
-
-SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "d24e8c0153c35dfefee3e26b1c2c35f8"
-SRC_URI[sha256sum] = "0b4874961e6488ad9e5808114bd486ea981c540907262caab1419355fd82d745"
-
-S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb
deleted file mode 100644
index 970554352..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-omx_git.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-omx.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
- file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-omx;branch=master;name=gst-omx \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;branch=master;name=common \
- file://0001-omx-fixed-type-error-in-printf-call.patch \
-"
-
-SRCREV_gst-omx = "a2db76b048db278ef0aa798e106b7594264e06c0"
-SRCREV_common = "5edcd857b2107cd8b78c16232dd10877513ec157"
-
-SRCREV_FORMAT = "gst-omx"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
- cd ${S}
- ./autogen.sh --noconfigure
- cd ${B}
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc
deleted file mode 100644
index 9e2b94ede..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad.inc
+++ /dev/null
@@ -1,148 +0,0 @@
-require gstreamer1.0-plugins.inc
-
-LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+"
-
-DEPENDS += "gstreamer1.0-plugins-base libpng jpeg"
-
-inherit gettext bluetooth
-
-SRC_URI_append = " \
- file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
-"
-
-# opengl packageconfig factored out to make it easy for distros
-# and BSP layers to pick either (desktop) opengl, gles2, or no GL
-PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
-
-# gtk is not in the PACKAGECONFIG variable by default until
-# the transition to gtk+3 is finished
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${PACKAGECONFIG_GL} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
- bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp \
-"
-
-PACKAGECONFIG[assrender] = "--enable-assrender,--disable-assrender,libass"
-PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
-PACKAGECONFIG[bz2] = "--enable-bz2,--disable-bz2,bzip2"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
-PACKAGECONFIG[dash] = "--enable-dash,--disable-dash,libxml2"
-PACKAGECONFIG[directfb] = "--enable-directfb,--disable-directfb,directfb"
-PACKAGECONFIG[dtls] = "--enable-dtls,--disable-dtls,openssl"
-PACKAGECONFIG[faac] = "--enable-faac,--disable-faac,faac"
-PACKAGECONFIG[faad] = "--enable-faad,--disable-faad,faad2"
-PACKAGECONFIG[flite] = "--enable-flite,--disable-flite,flite-alsa"
-PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
-PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
-PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
-PACKAGECONFIG[hls] = "--enable-hls,--disable-hls,nettle"
-PACKAGECONFIG[libmms] = "--enable-libmms,--disable-libmms,libmms"
-PACKAGECONFIG[libssh2] = "--enable-libssh2,--disable-libssh2,libssh2"
-PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
-PACKAGECONFIG[neon] = "--enable-neon,--disable-neon,neon"
-PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
-PACKAGECONFIG[opencv] = "--enable-opencv,--disable-opencv,opencv"
-PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,virtual/libgl libglu"
-PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus"
-PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdread libdvdnav"
-PACKAGECONFIG[rsvg] = "--enable-rsvg,--disable-rsvg,librsvg"
-PACKAGECONFIG[rtmp] = "--enable-rtmp,--disable-rtmp,rtmpdump"
-PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc"
-PACKAGECONFIG[schroedinger] = "--enable-schro,--disable-schro,schroedinger"
-PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2"
-PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
-PACKAGECONFIG[srtp] = "--enable-srtp,--disable-srtp,libsrtp"
-PACKAGECONFIG[uvch264] = "--enable-uvch264,--disable-uvch264,libusb1 libgudev"
-PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
-PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
-PACKAGECONFIG[wayland] = "--enable-wayland --enable-egl,--disable-wayland --disable-egl,wayland virtual/egl"
-PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
-
-# these plugins have not been ported to 1.0 (yet):
-# apexsink dc1394 lv2 linsys musepack nas timidity teletextdec sdl xvid wininet
-# acm gsettings sndio cdxaparse dccp faceoverlay hdvparse tta mve nuvdemux
-# patchdetect real sdi videomeasure gsettings
-
-# these plugins have no corresponding library in OE-core or meta-openembedded:
-# openni2 winks direct3d directsound winscreencap
-# apple_media android_media avc bs2b chromaprint daala dts gme gsm kate ladspa
-# libde265 mimic mpeg2enc mplex ofa openh264 opensles pvr soundtouch spandsp
-# spc vdpau wasapi x265 zbar
-
-# qt5 support is disabled, because it is not present in OE core, and requires more work than
-# just adding a packageconfig (it requires access to moc, uic, rcc, and qmake paths).
-# This is better done in a separate qt5 layer (which then should add a "qt5" packageconfig
-# in a gstreamer1.0-plugins-bad bbappend).
-
-EXTRA_OECONF += " \
- --enable-decklink \
- --enable-dvb \
- --enable-fbdev \
- --enable-shm \
- --enable-vcd \
- --disable-acm \
- --disable-android_media \
- --disable-apexsink \
- --disable-apple_media \
- --disable-avc \
- --disable-bs2b \
- --disable-chromaprint \
- --disable-cocoa \
- --disable-daala \
- --disable-dc1394 \
- --disable-direct3d \
- --disable-directsound \
- --disable-dts \
- --disable-gme \
- --disable-gsm \
- --disable-kate \
- --disable-ladspa \
- --disable-libde265 \
- --disable-libvisual \
- --disable-linsys \
- --disable-lv2 \
- --disable-mimic \
- --disable-mpeg2enc \
- --disable-mplex \
- --disable-musepack \
- --disable-nas \
- --disable-ofa \
- --disable-openexr \
- --disable-openh264 \
- --disable-openjpeg \
- --disable-openni2 \
- --disable-opensles \
- --disable-pvr \
- --disable-qt \
- --disable-sdl \
- --disable-sdltest \
- --disable-sndio \
- --disable-soundtouch \
- --disable-spandsp \
- --disable-spc \
- --disable-teletextdec \
- --disable-timidity \
- --disable-vdpau \
- --disable-wasapi \
- --disable-wildmidi \
- --disable-wininet \
- --disable-winks \
- --disable-winscreencap \
- --disable-x265 \
- --disable-xvid \
- --disable-zbar \
- ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \
-"
-
-export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}"
-
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-FILES_${PN}-dev += "${libdir}/gstreamer-${LIBV}/include/gst/gl/gstglconfig.h"
-FILES_${PN}-freeverb += "${datadir}/gstreamer-${LIBV}/presets/GstFreeverb.prs"
-FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/${LIBV}/opencv*"
-FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-${LIBV}/presets/GstVoAmrwbEnc.prs"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
deleted file mode 100644
index 154d340e4..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From cff6fbf555a072408c21da1e818209c9d3814dd3 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 27 Oct 2015 14:36:58 +0200
-Subject: [PATCH] Makefile.am: don't hardcode libtool name when running
- introspection tools
-
-Upstream-Status: Pending [review on oe-core list]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
-
----
- gst-libs/gst/gl/Makefile.am | 2 +-
- gst-libs/gst/insertbin/Makefile.am | 2 +-
- gst-libs/gst/mpegts/Makefile.am | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
-index f968357..7cc2c7a 100644
---- a/gst-libs/gst/gl/Makefile.am
-+++ b/gst-libs/gst/gl/Makefile.am
-@@ -149,7 +149,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
- --library=libgstgl-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
-index 09eb97c..b746885 100644
---- a/gst-libs/gst/insertbin/Makefile.am
-+++ b/gst-libs/gst/insertbin/Makefile.am
-@@ -43,7 +43,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS
- --library=libgstinsertbin-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-insertbin-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am
-index 2511d49..c1cbce6 100644
---- a/gst-libs/gst/mpegts/Makefile.am
-+++ b/gst-libs/gst/mpegts/Makefile.am
-@@ -78,7 +78,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \
- --library=libgstmpegts-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
- --pkg-export gstreamer-mpegts-@GST_API_VERSION@ \
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch
deleted file mode 100644
index 1085e95e8..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-glimagesink-Downrank-to-marginal.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From c6b37a80806f9128de47f1ccc3f2354f8d436bb6 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Thu, 24 Sep 2015 19:47:32 +0300
-Subject: [PATCH] glimagesink: Downrank to marginal
-
-On desktop, where there is good OpenGL, xvimagesink will come up first,
-on other platforms, OpenGL can't be trusted because it's either software (like
-in a VM) or broken (like on embedded)., so let ximagesink come above.
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=751684]
-
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- ext/gl/gstopengl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c
-index a4b2540..0ccaacd 100644
---- a/ext/gl/gstopengl.c
-+++ b/ext/gl/gstopengl.c
-@@ -101,7 +101,7 @@ plugin_init (GstPlugin * plugin)
- #endif
-
- if (!gst_element_register (plugin, "glimagesink",
-- GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) {
-+ GST_RANK_MARGINAL, gst_gl_image_sink_bin_get_type ())) {
- return FALSE;
- }
-
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
deleted file mode 100644
index e81b06570..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From a93ca63d01e7cd1e40b5be576992f77fac364bd5 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 21 Mar 2016 18:21:17 +0200
-Subject: [PATCH] gstreamer-gl.pc.in: don't append GL_CFLAGS to CFLAGS
-
-Dependencies' include directories should not be added in this way;
-it causes problems when cross-compiling in sysroot environments.
-
-Upstream-Status: Pending
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- pkgconfig/gstreamer-gl.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in
-index 5589e2a..b986450 100644
---- a/pkgconfig/gstreamer-gl.pc.in
-+++ b/pkgconfig/gstreamer-gl.pc.in
-@@ -10,4 +10,4 @@ Version: @VERSION@
- Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@
-
- Libs: -L${libdir} -lgstgl-@GST_API_VERSION@ @GL_LIBS@
--Cflags: -I${includedir} @GL_CFLAGS@
-+Cflags: -I${includedir}
---
-2.7.0
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch
deleted file mode 100755
index 3491a15e6..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 95cda7fbcf1a81289d9315c801c8e2b3d896f4cb Mon Sep 17 00:00:00 2001
-From: Haihua Hu <b55597@freescale.com>
-Date: Mon, 30 Nov 2015 09:36:09 +0800
-Subject: [PATCH 2/5] [glplugin] glwindow: fix memory leak of navigation
- thread
-
-When exit navigation thread, call g_thread_join() to release
-the resource hold by it.
-
-Upstream-Status: Backport [1.7.1]
-
-bugzilla URL: https://bugzilla.gnome.org/show_bug.cgi?id=758820
-
-Signed-off-by: Haihua Hu <b55597@freescale.com>
----
- gst-libs/gst/gl/gstglwindow.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c
-index 44b74ca..42ef296 100644
---- a/gst-libs/gst/gl/gstglwindow.c
-+++ b/gst-libs/gst/gl/gstglwindow.c
-@@ -343,6 +343,9 @@ gst_gl_window_finalize (GObject * object)
- while (window->nav_alive) {
- g_cond_wait (&window->nav_destroy_cond, &window->nav_lock);
- }
-+ /* release resource hold by navigation thread */
-+ g_thread_join(window->priv->navigation_thread);
-+ window->priv->navigation_thread = NULL;
- g_mutex_unlock (&window->nav_lock);
- }
-
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
deleted file mode 100644
index 357fd7800..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 72561a0fca562d03567ace7b4cfc94992cd6525c Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Wed, 3 Feb 2016 18:05:41 -0800
-Subject: [PATCH] avoid including <sys/poll.h> directly
-
-musl libc generates warnings if <sys/poll.h> is included directly.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- sys/dvb/gstdvbsrc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c
-index b93255f..49f145a 100644
---- a/sys/dvb/gstdvbsrc.c
-+++ b/sys/dvb/gstdvbsrc.c
-@@ -93,7 +93,7 @@
- #include <gst/gst.h>
- #include <gst/glib-compat-private.h>
- #include <sys/ioctl.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <stdio.h>
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
deleted file mode 100644
index d52afd5d5..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From f59c5269f92d59a5296cbfeeb682d42095cd88ad Mon Sep 17 00:00:00 2001
-From: Wenzong Fan <wenzong.fan@windriver.com>
-Date: Thu, 18 Sep 2014 02:24:07 -0400
-Subject: [PATCH] gstreamer1.0-plugins-bad: allow to disable libssh2
-
-libssh2 is automatically linked to if present, this undetermined
-dependency may cause build errors like:
-
- .../x86_64-poky-linux/4.9.0/ld: cannot find -lssh2
-
-libssh2 isn't an oe-core recipe, so allow to disable it from
-configure.
-
-Upstream-Status: Pending
-
-Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
----
- configure.ac | 23 +++++++++++++++++------
- 1 file changed, 17 insertions(+), 6 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0e95c5c..12153b4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1901,6 +1901,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
- ])
-
- dnl *** Curl ***
-+AC_ARG_ENABLE([libssh2],
-+ [ --enable-libssh2 enable LIBSSH2 support @<:@default=auto@:>@],
-+ [case "${enableval}" in
-+ yes) NEED_SSH2=yes ;;
-+ no) NEED_SSH2=no ;;
-+ auto) NEED_SSH2=auto ;;
-+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libssh2]) ;;
-+ esac],[NEED_SSH2=auto])
-+
- translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
- AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
- PKG_CHECK_MODULES(CURL, libcurl >= 7.21.0, [
-@@ -1915,12 +1924,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
- ])
- AC_SUBST(CURL_CFLAGS)
- AC_SUBST(CURL_LIBS)
-- PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
-- HAVE_SSH2="yes"
-- AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
-- ], [
-- HAVE_SSH2="no"
-- ])
-+ if test "x$NEED_SSH2" != "xno"; then
-+ PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
-+ HAVE_SSH2="yes"
-+ AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
-+ ], [
-+ HAVE_SSH2="no"
-+ ])
-+ fi
- AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
- AC_SUBST(SSH2_CFLAGS)
- AC_SUBST(SSH2_LIBS)
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
deleted file mode 100644
index 369ff93ac..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 2262ba4b686d5cc0d3e894707fe1d31619a3a8f1 Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Tue, 9 Feb 2016 14:00:00 -0800
-Subject: [PATCH] ensure valid sentinals for gst_structure_get() etc
-
-For GStreamer functions declared with G_GNUC_NULL_TERMINATED,
-ie __attribute__((__sentinel__)), gcc will generate a warning if the
-last parameter passed to the function is not NULL (where a valid NULL
-in this context is defined as zero with any pointer type).
-
-The C callers to such functions within gst-plugins-bad use the C NULL
-definition (ie ((void*)0)), which is a valid sentinel.
-
-However the C++ NULL definition (ie 0L), is not a valid sentinel
-without an explicit cast to a pointer type.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- sys/decklink/gstdecklink.cpp | 10 +++++-----
- sys/decklink/gstdecklinkaudiosrc.cpp | 2 +-
- sys/decklink/gstdecklinkvideosink.cpp | 2 +-
- 3 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp
-index 64637f1..bac956f 100644
---- a/sys/decklink/gstdecklink.cpp
-+++ b/sys/decklink/gstdecklink.cpp
-@@ -324,22 +324,22 @@ gst_decklink_mode_get_structure (GstDecklinkModeEnum e, BMDPixelFormat f)
- "height", G_TYPE_INT, mode->height,
- "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
- "interlace-mode", G_TYPE_STRING, mode->interlaced ? "interleaved" : "progressive",
-- "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, NULL);
-+ "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void *) NULL);
-
- switch (f) {
- case bmdFormat8BitYUV: /* '2vuy' */
- gst_structure_set (s, "format", G_TYPE_STRING, "UYVY",
- "colorimetry", G_TYPE_STRING, mode->colorimetry,
-- "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
-+ "chroma-site", G_TYPE_STRING, "mpeg2", (void *) NULL);
- break;
- case bmdFormat10BitYUV: /* 'v210' */
-- gst_structure_set (s, "format", G_TYPE_STRING, "v210", NULL);
-+ gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void *) NULL);
- break;
- case bmdFormat8BitARGB: /* 'ARGB' */
-- gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", NULL);
-+ gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void *) NULL);
- break;
- case bmdFormat8BitBGRA: /* 'BGRA' */
-- gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", NULL);
-+ gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void *) NULL);
- break;
- case bmdFormat10BitRGB: /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */
- case bmdFormat12BitRGB: /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */
-diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
-index 9a701ee..26fb7ec 100644
---- a/sys/decklink/gstdecklinkaudiosrc.cpp
-+++ b/sys/decklink/gstdecklinkaudiosrc.cpp
-@@ -312,7 +312,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
- g_mutex_unlock (&self->input->lock);
-
- if (videosrc) {
-- g_object_get (videosrc, "connection", &vconn, NULL);
-+ g_object_get (videosrc, "connection", &vconn, (void *) NULL);
- gst_object_unref (videosrc);
-
- switch (vconn) {
-diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
-index eebeff3..da6e486 100644
---- a/sys/decklink/gstdecklinkvideosink.cpp
-+++ b/sys/decklink/gstdecklinkvideosink.cpp
-@@ -158,7 +158,7 @@ reset_framerate (GstCapsFeatures * features, GstStructure * structure,
- gpointer user_data)
- {
- gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
-- G_MAXINT, 1, NULL);
-+ G_MAXINT, 1, (void *) NULL);
-
- return TRUE;
- }
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
deleted file mode 100644
index 5ce57714e..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From a67781000e82bd9ae3813da29401e8c0c852328a Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Tue, 26 Jan 2016 15:16:01 -0800
-Subject: [PATCH] fix maybe-uninitialized warnings when compiling with -Os
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- gst-libs/gst/codecparsers/gstvc1parser.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c
-index fd16ee0..ddb890c 100644
---- a/gst-libs/gst/codecparsers/gstvc1parser.c
-+++ b/gst-libs/gst/codecparsers/gstvc1parser.c
-@@ -1729,7 +1729,7 @@ gst_vc1_parse_sequence_layer (const guint8 * data, gsize size,
- GstVC1SeqLayer * seqlayer)
- {
- guint32 tmp;
-- guint8 tmp8;
-+ guint8 tmp8 = 0;
- guint8 structA[8] = { 0, };
- guint8 structB[12] = { 0, };
- GstBitReader br;
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb
deleted file mode 100644
index 8eb47c265..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_1.6.3.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-include gstreamer1.0-plugins-bad.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
- file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
- file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
- file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
-
-# Note: The mpg123 plugin was moved to gst-plugins-ugly prior to the 1.7.2
-# release, so this line should be removed during the update to 1.8.x
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664
-PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
-
-# Note: The gsettings plug-in was dropped prior to the 1.7.2 release,
-# so this line should be removed during the update to 1.8.x
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=914291808ad10621d6a74031f3d46d45eef5a3a3
-EXTRA_OECONF += "--disable-gsettings"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
- file://configure-allow-to-disable-libssh2.patch \
- file://0001-glimagesink-Downrank-to-marginal.patch \
- file://0002-glplugin-glwindow-fix-memory-leak-of-navigation-thre.patch \
-"
-
-SRC_URI[md5sum] = "4857adcafe41e4b9b8805cf88303bd55"
-SRC_URI[sha256sum] = "971b29101d6a9c5e3fe94d99d977a227f58f0b2d29b6ca2c7f292052542b3a61"
-
-S = "${WORKDIR}/gst-plugins-bad-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb
deleted file mode 100644
index ef6581b2a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-bad_git.bb
+++ /dev/null
@@ -1,65 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-bad.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
- file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
- file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
- file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-plugins-bad;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
- file://configure-allow-to-disable-libssh2.patch \
- file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
- file://avoid-including-sys-poll.h-directly.patch \
- file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
- file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "50ae46cc0f8827bf966920d9c221e5cf86e811ba"
-SRCREV_common = "a25397448942079002622be231e9ec49b985745a"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-# over-ride the default hls PACKAGECONFIG in gstreamer1.0-plugins-bad.inc to
-# pass an additional --with-hls-crypto=XXX option (new in 1.7.x) and switch HLS
-# AES decryption from nettle to openssl (ie a shared dependency with dtls).
-# This should move back to the common .inc once the main recipe updates to 1.8.x
-PACKAGECONFIG[hls] = "--enable-hls --with-hls-crypto=openssl,--disable-hls,openssl"
-
-# The tinyalsa plugin was added prior to the 1.7.2 release
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c8bd74fa9a81398f57d976c478d2043f30188684
-PACKAGECONFIG[tinyalsa] = "--enable-tinyalsa,--disable-tinyalsa,tinyalsa"
-
-# The vulkan based video sink plugin was added prior to the 1.7.2 release
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=5de6dd9f40629562acf90e35e1fa58464d66617d
-PACKAGECONFIG[vulkan] = "--enable-vulkan,--disable-vulkan,libxcb"
-
-# The dependency-less netsim plugin was added prior to the 1.7.2 release
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e3f9e854f08e82bfab11182c5a2aa6f9a0c73cd5
-EXTRA_OECONF += " \
- --enable-netsim \
-"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
-
-# In 1.6.2, the "--enable-hls" configure option generated an installable package
-# called "gstreamer1.0-plugins-bad-fragmented". In 1.7.1 that HLS plugin package
-# has become "gstreamer1.0-plugins-bad-hls". See:
-# http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=efe62292a3d045126654d93239fdf4cc8e48ae08
-
-PACKAGESPLITFUNCS_append = " handle_hls_rename "
-
-python handle_hls_rename () {
- d.setVar('RPROVIDES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
- d.setVar('RREPLACES_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
- d.setVar('RCONFLICTS_gstreamer1.0-plugins-bad-hls', 'gstreamer1.0-plugins-bad-fragmented')
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc
deleted file mode 100644
index 7381458f4..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-require gstreamer1.0-plugins.inc
-
-SRC_URI_append = "\
- file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
- file://0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch \
- file://0003-riff-add-missing-include-directories-when-calling-in.patch \
- file://0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch \
-"
-
-LICENSE = "GPLv2+ & LGPLv2+"
-
-DEPENDS += "iso-codes util-linux zlib"
-
-inherit gettext
-
-PACKAGES_DYNAMIC =+ "^libgst.*"
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
- gio-unix-2.0 ivorbis ogg pango theora vorbis \
-"
-
-X11DEPENDS = "virtual/libx11 libsm libxrender libxv"
-X11ENABLEOPTS = "--enable-x --enable-xvideo --enable-xshm"
-X11DISABLEOPTS = "--disable-x --disable-xvideo --disable-xshm"
-
-PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
-PACKAGECONFIG[cdparanoia] = "--enable-cdparanoia,--disable-cdparanoia,cdparanoia"
-PACKAGECONFIG[gio-unix-2.0] = "--enable-gio_unix_2_0,--disable-gio_unix_2_0,glib-2.0"
-PACKAGECONFIG[ivorbis] = "--enable-ivorbis,--disable-ivorbis,tremor"
-PACKAGECONFIG[ogg] = "--enable-ogg,--disable-ogg,libogg"
-PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
-PACKAGECONFIG[theora] = "--enable-theora,--disable-theora,libtheora"
-PACKAGECONFIG[visual] = "--enable-libvisual,--disable-libvisual,libvisual"
-PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis"
-PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
-
-EXTRA_OECONF += " \
- --enable-zlib \
-"
-
-CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
-
-FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict"
-
-do_compile_prepend() {
- export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/tag/.libs:${B}/gst-libs/gst/video/.libs:${B}/gst-libs/gst/audio/.libs:${B}/gst-libs/gst/rtp/.libs"
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
deleted file mode 100644
index 781e4d801..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From f1d9652351e7754c63003104eceb526af424c7e0 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Fri, 20 Nov 2015 16:53:04 +0200
-Subject: [PATCH 1/4] Makefile.am: don't hardcode libtool name when running
- introspection tools
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/allocators/Makefile.am | 2 +-
- gst-libs/gst/app/Makefile.am | 2 +-
- gst-libs/gst/audio/Makefile.am | 2 +-
- gst-libs/gst/fft/Makefile.am | 2 +-
- gst-libs/gst/pbutils/Makefile.am | 2 +-
- gst-libs/gst/riff/Makefile.am | 2 +-
- gst-libs/gst/rtp/Makefile.am | 2 +-
- gst-libs/gst/rtsp/Makefile.am | 2 +-
- gst-libs/gst/sdp/Makefile.am | 2 +-
- gst-libs/gst/tag/Makefile.am | 2 +-
- gst-libs/gst/video/Makefile.am | 2 +-
- 11 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
-index 9361bf9..bc7f53a 100644
---- a/gst-libs/gst/allocators/Makefile.am
-+++ b/gst-libs/gst/allocators/Makefile.am
-@@ -37,7 +37,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstallocators-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg-export gstreamer-allocators-@GST_API_VERSION@ \
- --output $@ \
-diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
-index 6d6de8d..dcc2fe0 100644
---- a/gst-libs/gst/app/Makefile.am
-+++ b/gst-libs/gst/app/Makefile.am
-@@ -52,7 +52,7 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
- --library=libgstapp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-app-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
-index 275d222..2374196 100644
---- a/gst-libs/gst/audio/Makefile.am
-+++ b/gst-libs/gst/audio/Makefile.am
-@@ -106,7 +106,7 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
- --include=GstTag-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-audio-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am
-index 09b3d68..f545354 100644
---- a/gst-libs/gst/fft/Makefile.am
-+++ b/gst-libs/gst/fft/Makefile.am
-@@ -64,7 +64,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstfft-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg-export gstreamer-fft-@GST_API_VERSION@ \
- --output $@ \
-diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
-index 64d5eb0..91dc214 100644
---- a/gst-libs/gst/pbutils/Makefile.am
-+++ b/gst-libs/gst/pbutils/Makefile.am
-@@ -94,7 +94,7 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
- --include=GstTag-@GST_API_VERSION@ \
- --include=GstVideo-@GST_API_VERSION@ \
- --include=GstAudio-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-tag-@GST_API_VERSION@ \
- --pkg gstreamer-video-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index 83d83cb..3bd8fc0 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -47,7 +47,7 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --include=GstAudio-@GST_API_VERSION@ \
- # --include=GstTag-@GST_API_VERSION@ \
- # --include=Gst-@GST_API_VERSION@ \
--# --libtool="$(top_builddir)/libtool" \
-+# --libtool="$(LIBTOOL)" \
- # --pkg gstreamer-@GST_API_VERSION@ \
- # --pkg gstreamer-tag-@GST_API_VERSION@ \
- # --pkg gstreamer-audio-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
-index fdd01c1..f5445c1 100644
---- a/gst-libs/gst/rtp/Makefile.am
-+++ b/gst-libs/gst/rtp/Makefile.am
-@@ -64,7 +64,7 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
- --library=libgstrtp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-rtp-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index ede5706..9b0b258 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -71,7 +71,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- --include=Gio-2.0 \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstSdp-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gio-2.0 \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-sdp-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
-index a90f30b..0e149b8 100644
---- a/gst-libs/gst/sdp/Makefile.am
-+++ b/gst-libs/gst/sdp/Makefile.am
-@@ -31,7 +31,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstsdp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg-export gstreamer-sdp-@GST_API_VERSION@ \
- --output $@ \
-diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
-index c534a4d..cafafd3 100644
---- a/gst-libs/gst/tag/Makefile.am
-+++ b/gst-libs/gst/tag/Makefile.am
-@@ -44,7 +44,7 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
- --library=libgsttag-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-tag-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
-index 5d31fa1..ac64eb3 100644
---- a/gst-libs/gst/video/Makefile.am
-+++ b/gst-libs/gst/video/Makefile.am
-@@ -113,7 +113,7 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
- --library=libgstvideo-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-base-@GST_API_VERSION@ \
- --pkg-export gstreamer-video-@GST_API_VERSION@ \
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
deleted file mode 100644
index 85fcacb55..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
+++ /dev/null
@@ -1,298 +0,0 @@
-From 990b653c7b6de1937ec759019982d6c5f15770f7 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Oct 2015 16:38:18 +0200
-Subject: [PATCH 2/4] Makefile.am: prefix calls to pkg-config with
- PKG_CONFIG_SYSROOT_DIR
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/allocators/Makefile.am | 4 ++--
- gst-libs/gst/app/Makefile.am | 4 ++--
- gst-libs/gst/audio/Makefile.am | 12 ++++++------
- gst-libs/gst/fft/Makefile.am | 4 ++--
- gst-libs/gst/pbutils/Makefile.am | 12 ++++++------
- gst-libs/gst/riff/Makefile.am | 8 ++++----
- gst-libs/gst/rtp/Makefile.am | 8 ++++----
- gst-libs/gst/rtsp/Makefile.am | 4 ++--
- gst-libs/gst/sdp/Makefile.am | 4 ++--
- gst-libs/gst/tag/Makefile.am | 8 ++++----
- gst-libs/gst/video/Makefile.am | 8 ++++----
- 11 files changed, 38 insertions(+), 38 deletions(-)
-
-diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
-index bc7f53a..0ef5f86 100644
---- a/gst-libs/gst/allocators/Makefile.am
-+++ b/gst-libs/gst/allocators/Makefile.am
-@@ -34,7 +34,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
- --c-include "gst/allocators/allocators.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstallocators-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
-@@ -58,7 +58,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
-index dcc2fe0..dc076cb 100644
---- a/gst-libs/gst/app/Makefile.am
-+++ b/gst-libs/gst/app/Makefile.am
-@@ -47,8 +47,8 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
- --c-include "gst/app/app.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstapp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
-index 2374196..295eb42 100644
---- a/gst-libs/gst/audio/Makefile.am
-+++ b/gst-libs/gst/audio/Makefile.am
-@@ -96,12 +96,12 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
- --c-include "gst/audio/audio.h" \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
- --library=libgstaudio-@GST_API_VERSION@.la \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
- --library-path="$(top_builddir)/gst-libs/gst/tag/" \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -130,8 +130,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
- --includedir="$(top_builddir)/gst-libs/gst/tag/" \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am
-index f545354..1bb6243 100644
---- a/gst-libs/gst/fft/Makefile.am
-+++ b/gst-libs/gst/fft/Makefile.am
-@@ -61,7 +61,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO
- --c-include "gst/fft/fft.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstfft-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
-@@ -85,7 +85,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
-index 91dc214..dc8e1d3 100644
---- a/gst-libs/gst/pbutils/Makefile.am
-+++ b/gst-libs/gst/pbutils/Makefile.am
-@@ -79,14 +79,14 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
- --c-include "gst/pbutils/pbutils.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
- --add-include-path="$(top_builddir)/gst-libs/gst/video/" \
- --add-include-path="$(top_builddir)/gst-libs/gst/audio/" \
- --library=libgstpbutils-@GST_API_VERSION@.la \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
-+ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
- --library-path="$(top_builddir)/gst-libs/gst/tag/" \
- --library-path="$(top_builddir)/gst-libs/gst/video/" \
- --library-path="$(top_builddir)/gst-libs/gst/audio/" \
-@@ -119,8 +119,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --includedir="$(top_builddir)/gst-libs/gst/tag/" \
- --includedir="$(top_builddir)/gst-libs/gst/video/" \
- --includedir="$(top_builddir)/gst-libs/gst/audio/" \
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index 3bd8fc0..0a115cc 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -41,8 +41,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --c-include "gst/riff/riff.h" \
- # --add-include-path=$(builddir)/../tag \
- # --add-include-path=$(builddir)/../audio \
--# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
--# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- # --library=libgstriff-@GST_API_VERSION@.la \
- # --include=GstAudio-@GST_API_VERSION@ \
- # --include=GstTag-@GST_API_VERSION@ \
-@@ -73,8 +73,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --includedir=$(builddir) \
- # --includedir=$(builddir)/../tag \
- # --includedir=$(builddir)/../audio \
--# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
--# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- # $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
- #
- #CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
-index f5445c1..527c0b4 100644
---- a/gst-libs/gst/rtp/Makefile.am
-+++ b/gst-libs/gst/rtp/Makefile.am
-@@ -59,8 +59,8 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
- --c-include "gst/rtp/rtp.h" \
- -I$(top_builddir)/gst-libs \
- -I$(top_srcdir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstrtp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -87,8 +87,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index 9b0b258..4f6d9f8 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -66,7 +66,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- -I$(top_builddir)/gst-libs \
- -I$(top_srcdir)/gst-libs \
- --add-include-path=$(builddir)/../sdp \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstrtsp-@GST_API_VERSION@.la \
- --include=Gio-2.0 \
- --include=Gst-@GST_API_VERSION@ \
-@@ -96,7 +96,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
- --includedir=$(builddir)/../sdp \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
-index 0e149b8..9aa0512 100644
---- a/gst-libs/gst/sdp/Makefile.am
-+++ b/gst-libs/gst/sdp/Makefile.am
-@@ -28,7 +28,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
- --warn-all \
- --c-include "gst/sdp/sdp.h" \
- -I$(top_srcdir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- --library=libgstsdp-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --libtool="$(LIBTOOL)" \
-@@ -52,7 +52,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
-index cafafd3..ba99279 100644
---- a/gst-libs/gst/tag/Makefile.am
-+++ b/gst-libs/gst/tag/Makefile.am
-@@ -39,8 +39,8 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
- --c-include "gst/tag/tag.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgsttag-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -67,8 +67,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
-diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
-index ac64eb3..342c8c6 100644
---- a/gst-libs/gst/video/Makefile.am
-+++ b/gst-libs/gst/video/Makefile.am
-@@ -108,8 +108,8 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
- --c-include "gst/video/video.h" \
- -I$(top_srcdir)/gst-libs \
- -I$(top_builddir)/gst-libs \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- --library=libgstvideo-@GST_API_VERSION@.la \
- --include=Gst-@GST_API_VERSION@ \
- --include=GstBase-@GST_API_VERSION@ \
-@@ -136,8 +136,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
- $(INTROSPECTION_COMPILER) \
- --includedir=$(srcdir) \
- --includedir=$(builddir) \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
-+ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
- $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
-
- CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch
deleted file mode 100644
index 9b66f7f49..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3c2c2d5dd08aa30ed0e8acd8566ec99412bb8209 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Oct 2015 17:29:37 +0200
-Subject: [PATCH 3/4] riff: add missing include directories when calling
- introspection scanner
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/riff/Makefile.am | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
-index 0a115cc..5057a58 100644
---- a/gst-libs/gst/riff/Makefile.am
-+++ b/gst-libs/gst/riff/Makefile.am
-@@ -39,6 +39,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
- # --strip-prefix=Gst \
- # --warn-all \
- # --c-include "gst/riff/riff.h" \
-+# -I$(top_srcdir)/gst-libs \
-+# -I$(top_builddir)/gst-libs \
- # --add-include-path=$(builddir)/../tag \
- # --add-include-path=$(builddir)/../audio \
- # --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
deleted file mode 100644
index 9fbebd570..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
+++ /dev/null
@@ -1,225 +0,0 @@
-From be6163cfa3a255493f9d75bad9541cbfe1723fee Mon Sep 17 00:00:00 2001
-From: Mingke Wang <mingke.wang@freescale.com>
-Date: Thu, 19 Mar 2015 14:17:10 +0800
-Subject: [PATCH 3/4] ssaparse: enhance SSA text lines parsing.
-
-some parser will pass in the original ssa text line which starts with "Dialog:"
-and there's are maybe multiple Dialog lines in one input buffer.
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747496]
-
-Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
-
-diff --git a/gst/subparse/gstssaparse.c b/gst/subparse/gstssaparse.c
-old mode 100644
-new mode 100755
-index 06ecef9..0ab5dce
---- a/gst/subparse/gstssaparse.c
-+++ b/gst/subparse/gstssaparse.c
-@@ -260,6 +260,7 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
- * gst_ssa_parse_push_line:
- * @parse: caller element
- * @txt: text to push
-+ * @size: text size need to be parse
- * @start: timestamp for the buffer
- * @duration: duration for the buffer
- *
-@@ -269,27 +270,133 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
- * Returns: result of the push of the created buffer
- */
- static GstFlowReturn
--gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
-+gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, gint size,
- GstClockTime start, GstClockTime duration)
- {
- GstFlowReturn ret;
- GstBuffer *buf;
-- gchar *t, *escaped;
-+ gchar *t, *text, *p, *escaped, *p_start, *p_end;
- gint num, i, len;
-+ GstClockTime start_time = G_MAXUINT64, end_time = 0;
-
-- num = atoi (txt);
-- GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
-- num, GST_TIME_ARGS (start));
--
-- /* skip all non-text fields before the actual text */
-+ p = text = g_malloc(size + 1);
-+ *p = '\0';
- t = txt;
-- for (i = 0; i < 8; ++i) {
-- t = strchr (t, ',');
-+
-+ /* there are may have multiple dialogue lines at a time */
-+ while (*t) {
-+ /* ignore leading white space characters */
-+ while (isspace(*t))
-+ t++;
-+
-+ /* ignore Format: and Style: lines */
-+ if (strncmp(t, "Format:", 7) == 0 || strncmp(t, "Style:", 6) == 0) {
-+ while (*t != '\0' && *t != '\n') {
-+ t++;
-+ }
-+ }
-+
-+ if (*t == '\0')
-+ break;
-+
-+ /* continue with next line */
-+ if (*t == '\n') {
-+ t++;
-+ continue;
-+ }
-+
-+ if(strncmp(t, "Dialogue:", 9) != 0) {
-+ /* not started with "Dialogue:", it must be a line trimmed by demuxer */
-+ num = atoi (t);
-+ GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
-+ num, GST_TIME_ARGS (start));
-+
-+ /* skip all non-text fields before the actual text */
-+ for (i = 0; i < 8; ++i) {
-+ t = strchr (t, ',');
-+ if (t == NULL)
-+ break;
-+ ++t;
-+ }
-+ } else {
-+ /* started with "Dialogue:", update timestamp and duration */
-+ /* time format are like Dialog:Mark,0:00:01.02,0:00:03.04,xx,xxx,... */
-+ guint hour, min, sec, msec, len;
-+ GstClockTime tmp;
-+ gchar t_str[12] = {0};
-+
-+ /* find the first ',' */
-+ p_start = strchr (t, ',');
-+ if (p_start)
-+ p_end = strchr (++p_start, ',');
-+
-+ if (p_start && p_end) {
-+ /* copy text between first ',' and second ',' */
-+ strncpy(t_str, p_start, p_end - p_start);
-+ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
-+ tmp = ((hour*3600) + (min*60) + sec) * GST_SECOND + msec*GST_MSECOND;
-+ GST_DEBUG_OBJECT (parse, "Get start time:%02d:%02d:%02d:%03d\n",
-+ hour, min, sec, msec);
-+ if (start_time > tmp)
-+ start_time = tmp;
-+ } else {
-+ GST_WARNING_OBJECT (parse,
-+ "failed to parse ssa start timestamp string :%s", t_str);
-+ }
-+
-+ p_start = p_end;
-+ p_end = strchr (++p_start, ',');
-+ if (p_end) {
-+ /* copy text between second ',' and third ',' */
-+ strncpy(t_str, p_start, p_end - p_start);
-+ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
-+ tmp = ((hour*3600) + (min*60) + sec)*GST_SECOND + msec*GST_MSECOND;
-+ GST_DEBUG_OBJECT(parse, "Get end time:%02d:%02d:%02d:%03d\n",
-+ hour, min, sec, msec);
-+ if (end_time < tmp)
-+ end_time = tmp;
-+ } else {
-+ GST_WARNING_OBJECT (parse,
-+ "failed to parse ssa end timestamp string :%s", t_str);
-+ }
-+ }
-+ }
-+
-+ /* now skip all non-text fields before the actual text */
-+ for (i = 0; i <= 8; ++i) {
-+ t = strchr (t, ',');
-+ if (t == NULL)
-+ break;
-+ ++t;
-+ }
-+ }
-+
-+ /* line end before expected number of ',', not a Dialogue line */
- if (t == NULL)
-- return GST_FLOW_ERROR;
-- ++t;
-+ break;
-+
-+ /* if not the first line, and the last character of previous line is '\0',
-+ * then replace it with '\N' */
-+ if (p != text && *p == '\0') {
-+ *p++ = '\\';
-+ *p++ = 'N';
-+ }
-+
-+ /* copy all actual text of this line */
-+ while ((*t != '\0') && (*t != '\n'))
-+ *p++ = *t++;
-+
-+ /* add a terminator at the end */
-+ *p = '\0';
-+ }
-+
-+ /* not valid text found in this buffer return OK to let caller unref buffer */
-+ if (strlen(text) <= 0) {
-+ GST_WARNING_OBJECT (parse, "Not valid text found in this buffer\n");
-+ return GST_FLOW_ERROR;
- }
-
-+ t = text;
- GST_LOG_OBJECT (parse, "Text : %s", t);
-
- if (gst_ssa_parse_remove_override_codes (parse, t)) {
-@@ -307,13 +414,22 @@ gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
- gst_buffer_fill (buf, 0, escaped, len + 1);
- gst_buffer_set_size (buf, len);
- g_free (escaped);
-+ g_free(t);
-+
-+ if (start_time != G_MAXUINT64)
-+ GST_BUFFER_TIMESTAMP (buf) = start_time;
-+ else
-+ GST_BUFFER_TIMESTAMP (buf) = start;
-
-- GST_BUFFER_TIMESTAMP (buf) = start;
-- GST_BUFFER_DURATION (buf) = duration;
-+ if (end_time > start_time)
-+ GST_BUFFER_DURATION (buf) = end_time - start_time;
-+ else
-+ GST_BUFFER_DURATION (buf) = duration;
-
- GST_LOG_OBJECT (parse, "Pushing buffer with timestamp %" GST_TIME_FORMAT
-- " and duration %" GST_TIME_FORMAT, GST_TIME_ARGS (start),
-- GST_TIME_ARGS (duration));
-+ " and duration %" GST_TIME_FORMAT,
-+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
-+ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
-
- ret = gst_pad_push (parse->srcpad, buf);
-
-@@ -333,6 +449,7 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
- GstClockTime ts;
- gchar *txt;
- GstMapInfo map;
-+ gint size;
-
- if (G_UNLIKELY (!parse->framed))
- goto not_framed;
-@@ -350,13 +467,14 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
- /* make double-sure it's 0-terminated and all */
- gst_buffer_map (buf, &map, GST_MAP_READ);
- txt = g_strndup ((gchar *) map.data, map.size);
-+ size = map.size;
- gst_buffer_unmap (buf, &map);
-
- if (txt == NULL)
- goto empty_text;
-
- ts = GST_BUFFER_TIMESTAMP (buf);
-- ret = gst_ssa_parse_push_line (parse, txt, ts, GST_BUFFER_DURATION (buf));
-+ ret = gst_ssa_parse_push_line (parse, txt, size, ts, GST_BUFFER_DURATION (buf));
-
- if (ret != GST_FLOW_OK && GST_CLOCK_TIME_IS_VALID (ts)) {
- GstSegment segment;
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
deleted file mode 100644
index 42d99c1db..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Oct 2015 17:30:14 +0200
-Subject: [PATCH 4/4] rtsp: drop incorrect reference to gstreamer-sdp in
- Makefile.am
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst-libs/gst/rtsp/Makefile.am | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
-index 4f6d9f8..0afa370 100644
---- a/gst-libs/gst/rtsp/Makefile.am
-+++ b/gst-libs/gst/rtsp/Makefile.am
-@@ -74,7 +74,6 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
- --libtool="$(LIBTOOL)" \
- --pkg gio-2.0 \
- --pkg gstreamer-@GST_API_VERSION@ \
-- --pkg gstreamer-sdp-@GST_API_VERSION@ \
- --pkg-export gstreamer-rtsp-@GST_API_VERSION@ \
- --add-init-section="$(INTROSPECTION_INIT)" \
- --output $@ \
---
-2.6.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
deleted file mode 100644
index 7813915d8..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From ed09c8fd2c9c2b5384b72cc70af3728be6694e64 Mon Sep 17 00:00:00 2001
-From: Mingke Wang <mingke.wang@freescale.com>
-Date: Thu, 19 Mar 2015 14:20:26 +0800
-Subject: [PATCH 4/4] subparse: set need_segment after sink pad received
- GST_EVENT_SEGMENT
-
-subparse works in push mode, chain funciton will be called once
-up stream element finished the seeking and flushing.
-if set need_segment flag in src pad event handler, the segment
-event will be pushed earlier, result in the subtitle text will
-be send out to down stream from the beginning.
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747498]
-
-Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
-
-diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
-old mode 100644
-new mode 100755
-index b565e93..7741ccc
---- a/gst/subparse/gstsubparse.c
-+++ b/gst/subparse/gstsubparse.c
-@@ -266,22 +266,20 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
- goto beach;
- }
-
-+ /* Apply the seek to our segment */
-+ gst_segment_do_seek (&self->segment, rate, format, flags,
-+ start_type, start, stop_type, stop, &update);
-+
-+ GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
-+ &self->segment);
-+
- /* Convert that seek to a seeking in bytes at position 0,
- FIXME: could use an index */
- ret = gst_pad_push_event (self->sinkpad,
- gst_event_new_seek (rate, GST_FORMAT_BYTES, flags,
- GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0));
-
-- if (ret) {
-- /* Apply the seek to our segment */
-- gst_segment_do_seek (&self->segment, rate, format, flags,
-- start_type, start, stop_type, stop, &update);
--
-- GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
-- &self->segment);
--
-- self->need_segment = TRUE;
-- } else {
-+ if (!ret) {
- GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
- }
-
-@@ -1632,8 +1630,10 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
- gst_event_parse_segment (event, &s);
- if (s->format == GST_FORMAT_TIME)
- gst_event_copy_segment (event, &self->segment);
-- GST_DEBUG_OBJECT (self, "newsegment (%s)",
-- gst_format_get_name (self->segment.format));
-+ GST_DEBUG_OBJECT (self, "newsegment (%s) %" GST_SEGMENT_FORMAT,
-+ gst_format_get_name (self->segment.format), &self->segment);
-+
-+ self->need_segment = TRUE;
-
- /* if not time format, we'll either start with a 0 timestamp anyway or
- * it's following a seek in which case we'll have saved the requested
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch
deleted file mode 100755
index 096a6f4cb..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/0005-convertframe-Support-video-crop-when-convert-frame.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 5be6ed00aad028d9cbb4e0c63af0be69d335c71e Mon Sep 17 00:00:00 2001
-From: Song Bing <b06498@freescale.com>
-Date: Fri, 11 Dec 2015 21:42:00 +0800
-Subject: [PATCH] convertframe: Support video crop when convert frame
-
-Get thumbnail will user convertframe to convert video frame to
-desired video format and size. But haven't process crop meta on
-the video buffer. Add support video crop.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=759329
-
-Upstream-Status: Backport [1.7.1]
-
----
- gst-libs/gst/video/convertframe.c | 65 +++++++++++++++++++++++++++++++++------
- 1 file changed, 56 insertions(+), 9 deletions(-)
-
-diff --git a/gst-libs/gst/video/convertframe.c b/gst-libs/gst/video/convertframe.c
-index aa9c3d3..942a51e 100644
---- a/gst-libs/gst/video/convertframe.c
-+++ b/gst-libs/gst/video/convertframe.c
-@@ -110,12 +110,23 @@ fail:
- static GstElement *
- build_convert_frame_pipeline (GstElement ** src_element,
- GstElement ** sink_element, const GstCaps * from_caps,
-- const GstCaps * to_caps, GError ** err)
-+ GstVideoCropMeta * cmeta, const GstCaps * to_caps, GError ** err)
- {
-- GstElement *src = NULL, *csp = NULL, *vscale = NULL;
-- GstElement *sink = NULL, *encoder = NULL, *pipeline;
-+ GstElement *vcrop = NULL, *csp = NULL, *csp2 = NULL, *vscale = NULL;
-+ GstElement *src = NULL, *sink = NULL, *encoder = NULL, *pipeline;
-+ GstVideoInfo info;
- GError *error = NULL;
-
-+ if (cmeta) {
-+ if (!create_element ("videocrop", &vcrop, &error)) {
-+ g_warning
-+ ("build_convert_frame_pipeline: Buffer has crop metadata but videocrop element is not found. Cropping will be disabled");
-+ } else {
-+ if (!create_element ("videoconvert", &csp2, &error))
-+ goto no_elements;
-+ }
-+ }
-+
- /* videoscale is here to correct for the pixel-aspect-ratio for us */
- GST_DEBUG ("creating elements");
- if (!create_element ("appsrc", &src, &error) ||
-@@ -133,15 +144,42 @@ build_convert_frame_pipeline (GstElement ** src_element,
-
- GST_DEBUG ("adding elements");
- gst_bin_add_many (GST_BIN (pipeline), src, csp, vscale, sink, NULL);
-+ if (vcrop)
-+ gst_bin_add_many (GST_BIN (pipeline), vcrop, csp2, NULL);
-
- /* set caps */
- g_object_set (src, "caps", from_caps, NULL);
-+ if (vcrop) {
-+ gst_video_info_from_caps (&info, from_caps);
-+ g_object_set (vcrop, "left", cmeta->x, NULL);
-+ g_object_set (vcrop, "top", cmeta->y, NULL);
-+ g_object_set (vcrop, "right", GST_VIDEO_INFO_WIDTH (&info) - cmeta->width,
-+ NULL);
-+ g_object_set (vcrop, "bottom",
-+ GST_VIDEO_INFO_HEIGHT (&info) - cmeta->height, NULL);
-+ GST_DEBUG ("crop meta [x,y,width,height]: %d %d %d %d", cmeta->x, cmeta->y,
-+ cmeta->width, cmeta->height);
-+ }
- g_object_set (sink, "caps", to_caps, NULL);
-
- /* FIXME: linking is still way too expensive, profile this properly */
-- GST_DEBUG ("linking src->csp");
-- if (!gst_element_link_pads (src, "src", csp, "sink"))
-- goto link_failed;
-+ if (vcrop) {
-+ GST_DEBUG ("linking src->csp2");
-+ if (!gst_element_link_pads (src, "src", csp2, "sink"))
-+ goto link_failed;
-+
-+ GST_DEBUG ("linking csp2->vcrop");
-+ if (!gst_element_link_pads (csp2, "src", vcrop, "sink"))
-+ goto link_failed;
-+
-+ GST_DEBUG ("linking vcrop->csp");
-+ if (!gst_element_link_pads (vcrop, "src", csp, "sink"))
-+ goto link_failed;
-+ } else {
-+ GST_DEBUG ("linking src->csp");
-+ if (!gst_element_link_pads (src, "src", csp, "sink"))
-+ goto link_failed;
-+ }
-
- GST_DEBUG ("linking csp->vscale");
- if (!gst_element_link_pads_full (csp, "src", vscale, "sink",
-@@ -193,8 +231,12 @@ no_elements:
- {
- if (src)
- gst_object_unref (src);
-+ if (vcrop)
-+ gst_object_unref (vcrop);
- if (csp)
- gst_object_unref (csp);
-+ if (csp2)
-+ gst_object_unref (csp2);
- if (vscale)
- gst_object_unref (vscale);
- if (sink)
-@@ -209,7 +251,11 @@ no_elements:
- no_pipeline:
- {
- gst_object_unref (src);
-+ if (vcrop)
-+ gst_object_unref (vcrop);
- gst_object_unref (csp);
-+ if (csp2)
-+ gst_object_unref (csp2);
- gst_object_unref (vscale);
- gst_object_unref (sink);
-
-@@ -282,7 +328,8 @@ gst_video_convert_sample (GstSample * sample, const GstCaps * to_caps,
- }
-
- pipeline =
-- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy, &err);
-+ build_convert_frame_pipeline (&src, &sink, from_caps,
-+ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &err);
- if (!pipeline)
- goto no_pipeline;
-
-@@ -646,8 +693,8 @@ gst_video_convert_sample_async (GstSample * sample,
- }
-
- pipeline =
-- build_convert_frame_pipeline (&src, &sink, from_caps, to_caps_copy,
-- &error);
-+ build_convert_frame_pipeline (&src, &sink, from_caps,
-+ gst_buffer_get_video_crop_meta (buf), to_caps_copy, &error);
- if (!pipeline)
- goto no_pipeline;
-
---
-2.5.0
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
deleted file mode 100644
index 325671721..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 540e02c92c75e08b90326863dc787fa5cadf9da6 Mon Sep 17 00:00:00 2001
-From: Song Bing <b06498@freescale.com>
-Date: Fri, 13 Mar 2015 18:04:31 +0800
-Subject: [PATCH] encodebin: Need more buffers in output queue for better
- performance
-
-Need more buffers in output queue for better performance
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=744191]
-
-Signed-off-by: Song Bing <b06498@freescale.com>
----
- gst/encoding/gstencodebin.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c
-index 6728e58..32daae4 100644
---- a/gst/encoding/gstencodebin.c
-+++ b/gst/encoding/gstencodebin.c
-@@ -1138,8 +1138,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
- * We only use a 1buffer long queue here, the actual queueing will be done
- * in the input queue */
- last = sgroup->outqueue = gst_element_factory_make ("queue", NULL);
-- g_object_set (sgroup->outqueue, "max-size-buffers", (guint32) 1,
-- "max-size-bytes", (guint32) 0, "max-size-time", (guint64) 0,
-+ g_object_set (sgroup->outqueue, "max-size-time", (guint64) 0,
- "silent", TRUE, NULL);
-
- gst_bin_add (GST_BIN (ebin), sgroup->outqueue);
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
deleted file mode 100644
index 284abbe94..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From af0dac26f62aaceb4bf266720911953793e0fc5d Mon Sep 17 00:00:00 2001
-From: zhouming <b42586@freescale.com>
-Date: Wed, 14 May 2014 10:16:20 +0800
-Subject: [PATCH] ENGR00312515: get caps from src pad when query caps
-
-https://bugzilla.gnome.org/show_bug.cgi?id=728312
-
-Upstream-Status: Pending
-
-Signed-off-by: zhouming <b42586@freescale.com>
----
- gst-libs/gst/tag/gsttagdemux.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
- mode change 100644 => 100755 gst-libs/gst/tag/gsttagdemux.c
-
-diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c
-old mode 100644
-new mode 100755
-index 9b6c478..ae2294a
---- a/gst-libs/gst/tag/gsttagdemux.c
-+++ b/gst-libs/gst/tag/gsttagdemux.c
-@@ -1708,6 +1708,19 @@ gst_tag_demux_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
- }
- break;
- }
-+ case GST_QUERY_CAPS:
-+ {
-+
-+ /* We can hijack caps query if we typefind already */
-+ if (demux->priv->src_caps) {
-+ gst_query_set_caps_result (query, demux->priv->src_caps);
-+ res = TRUE;
-+ } else {
-+ res = gst_pad_query_default (pad, parent, query);
-+ }
-+ break;
-+ }
-+
- default:
- res = gst_pad_query_default (pad, parent, query);
- break;
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch
deleted file mode 100644
index 01e944ddd..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 10d2a977ee1d469f0bf9059bb2d0b55fd2eecbac Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Wed, 20 Jan 2016 13:00:00 -0800
-Subject: [PATCH] make gio_unix_2_0 dependency configurable
-
-Prior to 1.7.1, gst-plugins-base accepted a configure option to
-disable gio_unix_2_0, however it was implemented incorrectly using
-AG_GST_CHECK_FEATURE. That was fixed in 1.7.1 by making the
-dependency unconditional.
-
- http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=aadefefba88afe4acbe64454650f24e7ce7c8d70
-
-To make builds deterministic, re-instate support for
---disable-gio_unix_2_0, but implement it using the AC_ARG_ENABLE
-instead of AG_GST_CHECK_FEATURE.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- configure.ac | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 9c52aeb..26cacd6 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -747,9 +747,16 @@ AC_SUBST(FT2_CFLAGS)
- AC_SUBST(FT2_LIBS)
-
- dnl *** gio-unix-2.0 for tests/check/pipelines/tcp.c ***
-+AC_ARG_ENABLE([gio_unix_2_0],
-+ [AS_HELP_STRING([--disable-gio_unix_2_0],[disable use of gio_unix_2_0])],
-+ [],
-+ [enable_gio_unix_2_0=yes])
-+
-+if test "x${enable_gio_unix_2_0}" != "xno"; then
- PKG_CHECK_MODULES(GIO_UNIX_2_0, gio-unix-2.0 >= 2.24,
- HAVE_GIO_UNIX_2_0="yes",
- HAVE_GIO_UNIX_2_0="no")
-+fi
- AM_CONDITIONAL(USE_GIO_UNIX_2_0, test "x$HAVE_GIO_UNIX_2_0" = "xyes")
-
- dnl *** finalize CFLAGS, LDFLAGS, LIBS
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb
deleted file mode 100644
index 429dc9338..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_1.6.3.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-include gstreamer1.0-plugins-base.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
- file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
-
-# Note: The dependency on freetype was dropped shortly after the 1.7.1 release
-# so these lines should be removed during the update to 1.8.x
-# http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=183610c035dd6955c9b3540b940aec50474af031
-DEPENDS += "freetype"
-EXTRA_OECONF += "--disable-freetypetest"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \
- file://get-caps-from-src-pad-when-query-caps.patch \
- file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
- file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
- file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
- file://0005-convertframe-Support-video-crop-when-convert-frame.patch \
-"
-
-SRC_URI[md5sum] = "3ddde0ad598ef69f58d6a2e87f8b460f"
-SRC_URI[sha256sum] = "b6154f8fdba4877e95efd94610ef0ada4f0171cd12eb829a3c3c97345d9c7a75"
-
-S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb
deleted file mode 100644
index 38a9fcc29..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-base_git.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-base.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
- file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-plugins-base;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
- file://make-gio_unix_2_0-dependency-configurable.patch \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "97e108bebaa58821f4566a74cbf0135e93407c01"
-SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc
deleted file mode 100644
index 4621bf894..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good.inc
+++ /dev/null
@@ -1,53 +0,0 @@
-require gstreamer1.0-plugins.inc
-
-LICENSE = "GPLv2+ & LGPLv2.1+"
-
-DEPENDS += "gstreamer1.0-plugins-base libcap zlib bzip2"
-
-inherit gettext
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
- cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib v4l2 \
-"
-
-X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
-
-PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo"
-PACKAGECONFIG[dv1394] = "--enable-dv1394,--disable-dv1394,libiec61883 libavc1394 libraw1394"
-PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
-PACKAGECONFIG[gdk-pixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf"
-PACKAGECONFIG[gudev] = "--with-gudev,--without-gudev,libgudev"
-PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
-PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
-PACKAGECONFIG[libpng] = "--enable-libpng,--disable-libpng,libpng"
-PACKAGECONFIG[libv4l2] = "--with-libv4l2,--without-libv4l2,libv4l2"
-PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
-PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4"
-PACKAGECONFIG[speex] = "--enable-speex,--disable-speex,speex"
-PACKAGECONFIG[taglib] = "--enable-taglib,--disable-taglib,taglib"
-PACKAGECONFIG[v4l2] = "--enable-gst_v4l2,--disable-gst_v4l2"
-PACKAGECONFIG[vpx] = "--enable-vpx,--disable-vpx,libvpx"
-PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
-PACKAGECONFIG[x11] = "--enable-x,--disable-x,${X11DEPENDS}"
-
-EXTRA_OECONF += " \
- --enable-bz2 \
- --enable-oss \
- --enable-zlib \
- --disable-aalib \
- --disable-aalibtest \
- --disable-directsound \
- --disable-libcaca \
- --disable-libdv \
- --disable-oss4 \
- --disable-osx_audio \
- --disable-osx_video \
- --disable-shout2 \
- --disable-sunaudio \
- --disable-waveform \
-"
-
-FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
deleted file mode 100755
index d1973d439..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From c782a30482908a4b4dd9cd4abff9f9bc4016698f Mon Sep 17 00:00:00 2001
-From: Song Bing <b06498@freescale.com>
-Date: Tue, 5 Aug 2014 14:40:46 +0800
-Subject: [PATCH] gstrtpmp4gpay: set dafault value for MPEG4 without codec
- data in caps.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=734263
-
-Upstream-Status: Submitted
-
-Signed-off-by: Song Bing <b06498@freescale.com>
----
- gst/rtp/gstrtpmp4gpay.c | 19 ++++++++++++++++++-
- 1 file changed, 18 insertions(+), 1 deletion(-)
-
-diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
-index 7913d9a..1749d39 100644
---- a/gst/rtp/gstrtpmp4gpay.c
-+++ b/gst/rtp/gstrtpmp4gpay.c
-@@ -390,6 +390,7 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
- const GValue *codec_data;
- const gchar *media_type = NULL;
- gboolean res;
-+ const gchar *name;
-
- rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
-
-@@ -400,7 +401,6 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
- GST_LOG_OBJECT (rtpmp4gpay, "got codec_data");
- if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
- GstBuffer *buffer;
-- const gchar *name;
-
- buffer = gst_value_get_buffer (codec_data);
- GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data");
-@@ -426,6 +426,23 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
-
- rtpmp4gpay->config = gst_buffer_copy (buffer);
- }
-+ } else {
-+ name = gst_structure_get_name (structure);
-+
-+ if (!strcmp (name, "video/mpeg")) {
-+ rtpmp4gpay->profile = g_strdup ("1");
-+
-+ /* fixed rate */
-+ rtpmp4gpay->rate = 90000;
-+ /* video stream type */
-+ rtpmp4gpay->streamtype = "4";
-+ /* no params for video */
-+ rtpmp4gpay->params = NULL;
-+ /* mode */
-+ rtpmp4gpay->mode = "generic";
-+
-+ media_type = "video";
-+ }
- }
- if (media_type == NULL)
- goto config_failed;
---
-1.7.9.5
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch
deleted file mode 100644
index c7f3630ec..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 4bfe2c8570a4a7080ec662504882969054d8a072 Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Wed, 3 Feb 2016 18:12:38 -0800
-Subject: [PATCH] avoid including <sys/poll.h> directly
-
-musl libc generates warnings if <sys/poll.h> is included directly.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- ext/raw1394/gstdv1394src.c | 2 +-
- ext/raw1394/gsthdv1394src.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c
-index dbc7607..3c42b41 100644
---- a/ext/raw1394/gstdv1394src.c
-+++ b/ext/raw1394/gstdv1394src.c
-@@ -37,7 +37,7 @@
- #include "config.h"
- #endif
- #include <unistd.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/socket.h>
- #include <errno.h>
- #include <fcntl.h>
-diff --git a/ext/raw1394/gsthdv1394src.c b/ext/raw1394/gsthdv1394src.c
-index 0b07a37..9785a15 100644
---- a/ext/raw1394/gsthdv1394src.c
-+++ b/ext/raw1394/gsthdv1394src.c
-@@ -36,7 +36,7 @@
- #include "config.h"
- #endif
- #include <unistd.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/socket.h>
- #include <errno.h>
- #include <fcntl.h>
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch
deleted file mode 100644
index bc7ac0b6a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 2169f2205c0205a220d826d7573e5a863bd36e0a Mon Sep 17 00:00:00 2001
-From: Andre McCurdy <armccurdy@gmail.com>
-Date: Tue, 9 Feb 2016 14:00:00 -0800
-Subject: [PATCH] ensure valid sentinal for gst_structure_get()
-
-gst_structure_get() is declared with G_GNUC_NULL_TERMINATED, ie
-__attribute__((__sentinel__)), which means gcc will generate a
-warning if the last parameter passed to the function is not NULL
-(where a valid NULL in this context is defined as zero with any
-pointer type).
-
-The C code callers to gst_structure_get() within gst-plugins-good
-use the C NULL definition (ie ((void*)0)), which is a valid sentinel.
-
-However gstid3v2mux.cc uses the C++ NULL definition (ie 0L), which
-is not a valid sentinel without an explicit cast to a pointer type.
-
-Upstream-Status: Pending
-
-Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
----
- ext/taglib/gstid3v2mux.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc
-index 8651e77..a87234f 100644
---- a/ext/taglib/gstid3v2mux.cc
-+++ b/ext/taglib/gstid3v2mux.cc
-@@ -465,7 +465,7 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
-
- if (info_struct) {
- if (gst_structure_get (info_struct, "image-type",
-- GST_TYPE_TAG_IMAGE_TYPE, &image_type, NULL)) {
-+ GST_TYPE_TAG_IMAGE_TYPE, &image_type, (void *) NULL)) {
- if (image_type > 0 && image_type <= 18) {
- image_type += 2;
- } else {
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb
deleted file mode 100644
index 0b4f43690..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_1.6.3.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-include gstreamer1.0-plugins-good.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
- file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \
- file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
-"
-
-SRC_URI[md5sum] = "a1958df7aa498b42793e2f2048673815"
-SRC_URI[sha256sum] = "24b19db70b2a83461ebddfe20033db432dadfdb5d4b54ffb1dfa0d830134a177"
-
-S = "${WORKDIR}/gst-plugins-good-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb
deleted file mode 100644
index 9cadc9afc..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-good_git.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-good.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
- file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
- file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-plugins-good;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
- file://avoid-including-sys-poll.h-directly.patch \
- file://ensure-valid-sentinel-for-gst_structure_get.patch \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "1b6fdce67c15d59957e395b1957aa625322092d4"
-SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc
deleted file mode 100644
index aff223072..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-require gstreamer1.0-plugins.inc
-
-LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
-LICENSE_FLAGS = "commercial"
-
-DEPENDS += "gstreamer1.0-plugins-base libid3tag"
-
-inherit gettext
-
-PACKAGECONFIG ??= " \
- ${GSTREAMER_ORC} \
- a52dec lame mad mpeg2dec \
-"
-
-PACKAGECONFIG[a52dec] = "--enable-a52dec,--disable-a52dec,liba52"
-PACKAGECONFIG[amrnb] = "--enable-amrnb,--disable-amrnb,opencore-amr"
-PACKAGECONFIG[amrwb] = "--enable-amrwb,--disable-amrwb,opencore-amr"
-PACKAGECONFIG[cdio] = "--enable-cdio,--disable-cdio,libcdio"
-PACKAGECONFIG[dvdread] = "--enable-dvdread,--disable-dvdread,libdvdread"
-PACKAGECONFIG[lame] = "--enable-lame,--disable-lame,lame"
-PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
-PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec"
-PACKAGECONFIG[x264] = "--enable-x264,--disable-x264,x264"
-
-EXTRA_OECONF += " \
- --disable-sidplay \
- --disable-twolame \
-"
-
-FILES_${PN}-amrnb += "${datadir}/gstreamer-1.0/presets/GstAmrnbEnc.prs"
-FILES_${PN}-x264 += "${datadir}/gstreamer-1.0/presets/GstX264Enc.prs"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb
deleted file mode 100644
index 7edfb81d2..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_1.6.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-include gstreamer1.0-plugins-ugly.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
- file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
-"
-
-SRC_URI[md5sum] = "dbd92afb3816cbfa90ab1f197144a2e2"
-SRC_URI[sha256sum] = "2fecf7b7c7882f8f62f1900048f4013f98c214fb3d3303d8d812245bb41fd064"
-
-S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb
deleted file mode 100644
index 69afe4cfb..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins-ugly_git.bb
+++ /dev/null
@@ -1,41 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0-plugins-ugly.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
- file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gst-plugins-ugly;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "8bdb68edbc605e21314b608e7a39bdbaab7302b8"
-SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-# The mpg123 plugin was added prior to the 1.7.2 release
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1
-PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
-
-# In 1.7.2, the mpg123 plugin was moved from -bad to -ugly
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=08d8aefcdaaf89ecb6dd53ec1e4f95cd42d01664
-# https://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=43bd45ba991ef3247957ca37cdcb52f4b8c0acb1
-
-PACKAGESPLITFUNCS_append = " handle_mpg123_rename "
-
-python handle_mpg123_rename () {
- d.setVar('RPROVIDES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
- d.setVar('RREPLACES_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
- d.setVar('RCONFLICTS_gstreamer1.0-plugins-ugly-mpg123', 'gstreamer1.0-plugins-bad-mpg123')
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc
deleted file mode 100644
index 2dcec509d..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-plugins.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "Plugins for the GStreamer multimedia framework 1.x"
-HOMEPAGE = "http://gstreamer.freedesktop.org/"
-BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
-SECTION = "multimedia"
-
-DEPENDS = "gstreamer1.0 glib-2.0-native"
-
-inherit autotools pkgconfig upstream-version-is-even gobject-introspection
-
-acpaths = "-I ${S}/common/m4 -I ${S}/m4"
-
-LIBV = "1.0"
-require gst-plugins-package.inc
-
-# Orc enables runtime JIT compilation of data processing routines from Orc
-# bytecode to SIMD instructions for various architectures (currently SSE, MMX,
-# MIPS, Altivec and NEON are supported).
-
-GSTREAMER_ORC ?= "orc"
-
-PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
-PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc orc-native"
-PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
-
-export ORCC = "${STAGING_DIR_NATIVE}${bindir}/orcc"
-
-EXTRA_OECONF = " \
- --disable-examples \
-"
-
-SRC_URI_append = " file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch"
-
-delete_pkg_m4_file() {
- # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
- rm "${S}/common/m4/pkg.m4" || true
-}
-
-do_configure[prefuncs] += " delete_pkg_m4_file"
-
-PACKAGES_DYNAMIC = "^${PN}-.*"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc
deleted file mode 100644
index ae6d36477..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "A library on top of GStreamer for building an RTSP server"
-HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/"
-SECTION = "multimedia"
-LICENSE = "LGPLv2"
-
-DEPENDS = "gstreamer1.0 libcgroup gstreamer1.0-plugins-base"
-
-PNREAL = "gst-rtsp-server"
-
-SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz \
- file://0001-Don-t-hardcode-libtool-name-when-using-introspection.patch \
- file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch"
-
-S = "${WORKDIR}/${PNREAL}-${PV}"
-
-inherit autotools pkgconfig upstream-version-is-even gobject-introspection
-
-delete_pkg_m4_file() {
- # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
- rm "${S}/common/m4/pkg.m4" || true
-}
-
-do_configure[prefuncs] += " delete_pkg_m4_file"
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch
deleted file mode 100644
index 89d6384ad..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 4a12569e5ae5be63cd92a9b178860026a99746b1 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 27 Oct 2015 16:55:45 +0200
-Subject: [PATCH] Don't hardcode libtool name when using introspection
-
-Upstream-Status: Pending [review on oe-core maillist]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- gst/rtsp-server/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gst/rtsp-server/Makefile.am b/gst/rtsp-server/Makefile.am
-index 4fcd366..c67f5ab 100644
---- a/gst/rtsp-server/Makefile.am
-+++ b/gst/rtsp-server/Makefile.am
-@@ -87,7 +87,7 @@ GstRtspServer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtspserver-@
- --include=Gst-@GST_API_VERSION@ \
- --include=GstRtsp-@GST_API_VERSION@ \
- --include=GstNet-@GST_API_VERSION@ \
-- --libtool="$(top_builddir)/libtool" \
-+ --libtool="$(LIBTOOL)" \
- --pkg gstreamer-@GST_API_VERSION@ \
- --pkg gstreamer-rtsp-@GST_API_VERSION@ \
- --pkg gstreamer-net-@GST_API_VERSION@ \
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb
deleted file mode 100644
index 5bdae6cf9..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0-rtsp-server_1.6.2.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-include gstreamer1.0-rtsp-server.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
-
-SRC_URI[md5sum] = "a1cafefb5fc14ac5d7e7d8cdbdfa9694"
-SRC_URI[sha256sum] = "0f51f9879556c0950203c766b09a1b62f1f25b17f9a7d516e01b13ecf93c8858"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc
deleted file mode 100644
index 10b4668e5..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0.inc
+++ /dev/null
@@ -1,58 +0,0 @@
-SUMMARY = "GStreamer 1.0 multimedia framework"
-DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
-It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
-HOMEPAGE = "http://gstreamer.freedesktop.org/"
-BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
-SECTION = "multimedia"
-LICENSE = "LGPLv2+"
-
-DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native"
-
-inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection
-
-# This way common/m4/introspection.m4 will come first
-# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file)
-acpaths = "-I ${S}/common/m4 -I ${S}/m4"
-
-SRC_URI_append = " \
- file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
-"
-
-PACKAGECONFIG ??= ""
-
-PACKAGECONFIG[check] = "--enable-check,--disable-check"
-PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
-PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
-PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
-
-EXTRA_OECONF = " \
- --disable-dependency-tracking \
- --disable-docbook \
- --disable-examples \
- --disable-gtk-doc \
-"
-
-CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no"
-
-# musl libc generates warnings if <sys/poll.h> is included directly
-CACHED_CONFIGUREVARS += "ac_cv_header_sys_poll_h=no"
-
-PACKAGES += "${PN}-bash-completion"
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
-FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la ${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include"
-FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*"
-
-RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
-RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
-
-delete_pkg_m4_file() {
- # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
- rm "${S}/common/m4/pkg.m4" || true
-}
-
-do_configure[prefuncs] += " delete_pkg_m4_file"
-
-do_compile_prepend() {
- export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs"
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
deleted file mode 100644
index 94f5cc56e..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6b26f3dbf9bf577d71534ab7410de66d06e46ba2 Mon Sep 17 00:00:00 2001
-From: Carlos Rafael Giani <dv@pseudoterminal.org>
-Date: Sat, 6 Apr 2013 23:52:11 +0200
-Subject: [PATCH] Fix crash with gst-inspect Chris Lord <chris@openedhand.com>
-
-Upstream-Status: Pending
-
-Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
----
- tools/gst-inspect.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
-index 23b7c44..b79b02e 100644
---- a/tools/gst-inspect.c
-+++ b/tools/gst-inspect.c
-@@ -1556,7 +1556,7 @@ main (int argc, char *argv[])
- g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
- g_option_context_add_group (ctx, gst_init_get_option_group ());
- if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
-- g_printerr ("Error initializing: %s\n", err->message);
-+ g_printerr ("Error initializing: %s\n", err ? err->message : "(null)");
- return -1;
- }
- g_option_context_free (ctx);
---
-1.8.2
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb
deleted file mode 100644
index ba1b83b08..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_1.6.3.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-include gstreamer1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
- file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-SRC_URI = " \
- http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
- file://0001-Fix-crash-with-gst-inspect.patch \
-"
-
-SRC_URI[md5sum] = "b4cdeb2b9cb20dd6ac022a4f417eae0d"
-SRC_URI[sha256sum] = "22f9568d67b87cf700a111f381144bd37cb93790a77e4e331db01fe854a37f24"
-
-S = "${WORKDIR}/gstreamer-${PV}"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb
deleted file mode 100644
index 7715bb202..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/gstreamer_bp_krogoth/gstreamer1.0_git.bb
+++ /dev/null
@@ -1,30 +0,0 @@
-DEFAULT_PREFERENCE = "-1"
-
-include gstreamer1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
- file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-SRC_URI = " \
- git://anongit.freedesktop.org/gstreamer/gstreamer;name=base \
- git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \
-"
-
-PV = "1.7.2+git${SRCPV}"
-
-UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
-
-SRCREV_base = "9e33bfa2c7a5f43da2c49b0a8235fd43cba9feaf"
-SRCREV_common = "b64f03f6090245624608beb5d2fff335e23a01c0"
-SRCREV_FORMAT = "base"
-
-S = "${WORKDIR}/git"
-
-# The option to configure tracer hooks was added prior to the 1.7.2 release
-# https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=e5ca47236e4df4683707f0bcf99181a937d358d5
-PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
-PACKAGECONFIG[trace-historic] = "--enable-trace,--disable-trace,"
-
-do_configure_prepend() {
- ${S}/autogen.sh --noconfigure
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb
deleted file mode 100644
index cc91892aa..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-backport/python_bp/python-wand_0.4.3.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-DESCRIPTION = "Magic wand library"
-HOMEPAGE = "http://docs.wand-py.org/en/0.4.3/"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=170eafd687d4a2b950819cd5e067e6d5"
-
-SRCNAME = "wand"
-
-SRC_URI = "git://github.com/dahlia/wand.git;tag=${PV}"
-S = "${WORKDIR}/git"
-
-inherit setuptools
-
-DEPENDS += " imagemagick-native"
-
-BBCLASSEXTEND = "native"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend
new file mode 100644
index 000000000..86ab018da
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state.bbappend
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 000000000..5779dee36
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1,321 @@
+state.ak4613 {
+ control.1 {
+ iface MIXER
+ name 'Digital Playback Volume1'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.2 {
+ iface MIXER
+ name 'Digital Playback Volume2'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.3 {
+ iface MIXER
+ name 'Digital Playback Volume3'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.4 {
+ iface MIXER
+ name 'Digital Playback Volume4'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.5 {
+ iface MIXER
+ name 'Digital Playback Volume5'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.6 {
+ iface MIXER
+ name 'Digital Playback Volume6'
+ value.0 204
+ value.1 204
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 255'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2550
+ dbvalue.1 -2550
+ }
+ }
+ control.7 {
+ iface MIXER
+ name 'DVC Out Playback Volume'
+ value.0 1677647
+ value.1 1677647
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 8388607'
+ }
+ }
+ control.8 {
+ iface MIXER
+ name 'DVC Out Mute Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.9 {
+ iface MIXER
+ name 'DVC Out Ramp Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.10 {
+ iface MIXER
+ name 'DVC Out Ramp Up Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.11 {
+ iface MIXER
+ name 'DVC Out Ramp Down Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.12 {
+ iface MIXER
+ name 'SRC Out Rate Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.13 {
+ iface MIXER
+ name 'SRC Out Rate'
+ value 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 192000'
+ }
+ }
+ control.14 {
+ iface MIXER
+ name 'DVC In Capture Volume'
+ value.0 838870
+ value.1 838870
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 8388607'
+ }
+ }
+ control.15 {
+ iface MIXER
+ name 'DVC In Mute Switch'
+ value.0 false
+ value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
+ }
+ control.16 {
+ iface MIXER
+ name 'DVC In Ramp Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.17 {
+ iface MIXER
+ name 'DVC In Ramp Up Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+ control.18 {
+ iface MIXER
+ name 'DVC In Ramp Down Rate'
+ value '128 dB/1 step'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '128 dB/1 step'
+ item.1 '64 dB/1 step'
+ item.2 '32 dB/1 step'
+ item.3 '16 dB/1 step'
+ item.4 '8 dB/1 step'
+ item.5 '4 dB/1 step'
+ item.6 '2 dB/1 step'
+ item.7 '1 dB/1 step'
+ item.8 '0.5 dB/1 step'
+ item.9 '0.25 dB/1 step'
+ item.10 '0.125 dB/1 step'
+ item.11 '0.125 dB/2 steps'
+ item.12 '0.125 dB/4 steps'
+ item.13 '0.125 dB/8 steps'
+ item.14 '0.125 dB/16 steps'
+ item.15 '0.125 dB/32 steps'
+ item.16 '0.125 dB/64 steps'
+ item.17 '0.125 dB/128 steps'
+ item.18 '0.125 dB/256 steps'
+ item.19 '0.125 dB/512 steps'
+ item.20 '0.125 dB/1024 steps'
+ item.21 '0.125 dB/2048 steps'
+ item.22 '0.125 dB/4096 steps'
+ item.23 '0.125 dB/8192 steps'
+ }
+ }
+}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend
index 47c0fec7b..f4d086938 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend
@@ -1,4 +1,9 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI_append = " file://0001-fix-arm-trusted-firmware-build-for-gcc6.patch"
+# Boot Normal World in EL2: this define configures ATF (SPSR register) to boot
+# BL33 in EL2.
+EXTRA_OEMAKE += " RCAR_BL33_EXECUTION_EL=1"
+do_ipl_opt_deploy:prepend () {
+ # Work around bug in BSP recipe, it can fail if nothing else has
+ # happened to run first and create the directory.
+ install -d ${DEPLOY_DIR_IMAGE}
+}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch
deleted file mode 100644
index 744f9f5f5..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/arm-trusted-firmware/files/0001-fix-arm-trusted-firmware-build-for-gcc6.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 26927f2aff43607b422ce5cb463ee4eccbdaef5a Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Thu, 23 Feb 2017 14:18:06 +0100
-Subject: [PATCH] Fix arm-trusted-firmware build for gcc6
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- include/lib/smcc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/lib/smcc.h b/include/lib/smcc.h
-index c415ba1..e648692 100644
---- a/include/lib/smcc.h
-+++ b/include/lib/smcc.h
-@@ -57,7 +57,7 @@
- #define SMC_64 1
- #define SMC_32 0
- #define SMC_UNK 0xffffffff
--#define SMC_TYPE_FAST 1
-+#define SMC_TYPE_FAST 1U
- #define SMC_TYPE_STD 0
- #define SMC_PREEMPTED 0xfffffffe
- /*******************************************************************************
---
-2.6.6
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt
index 87d362a37..9a8dc560d 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota.txt
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3-salvator-x.txt
@@ -4,7 +4,6 @@ bootiaddr=0x5C3F9520
bootargs_console=console=ttySC0,115200 ignore_loglevel
bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
-bootargs_video=vmalloc=384M video=HDMI-A-1:1280x960-32@60
bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
bootmmc=0:1
@@ -13,7 +12,7 @@ rootmmc=0:2
booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
-bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} Image-r8a7796-m3ulcb.dtb
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7795-salvator-xs.dtb
-bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_video} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt
new file mode 100644
index 000000000..9cc3eb9d2
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-h3ulcb.txt
@@ -0,0 +1,18 @@
+bootkaddr=0x49090000
+bootdaddr=0x48000000
+bootiaddr=0x5C3F9520
+
+bootargs_console=console=ttySC0,115200 ignore_loglevel
+bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
+bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
+
+bootmmc=0:1
+rootmmc=0:2
+
+booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
+bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
+bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a77951-ulcb.dtb
+
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt
new file mode 100644
index 000000000..7b76e1ef9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3-salvator-x.txt
@@ -0,0 +1,18 @@
+bootkaddr=0x49090000
+bootdaddr=0x48000000
+bootiaddr=0x5C3F9520
+
+bootargs_console=console=ttySC0,115200 ignore_loglevel
+bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
+bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
+
+bootmmc=0:1
+rootmmc=0:2
+
+booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
+bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
+bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a7796-salvator-xs.dtb
+
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt
new file mode 100644
index 000000000..145f82eae
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/files/uEnv-ota-m3ulcb.txt
@@ -0,0 +1,18 @@
+bootkaddr=0x49090000
+bootdaddr=0x48000000
+bootiaddr=0x5C3F9520
+
+bootargs_console=console=ttySC0,115200 ignore_loglevel
+bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2
+bootargs_root=ostree_root=/dev/mmcblk1p2 root=/dev/ram0 ramdisk_size=16384
+
+bootmmc=0:1
+rootmmc=0:2
+
+booteload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize}
+bootkload_sd=ext4load mmc ${rootmmc} ${bootkaddr} boot/${kernel_image}
+bootiload_sd=ext4load mmc ${rootmmc} ${bootiaddr} boot/${ramdisk_image}; setenv ramdisk_size ${filesize}
+bootdload_sd=fatload mmc ${bootmmc} ${bootdaddr} r8a77960-ulcb.dtb
+
+bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; run bootdload_sd; booti ${bootkaddr} ${bootiaddr}:${ramdisk_size} ${bootdaddr}
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/m3ulcb-ota-bootfiles.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb
index f0e04c06a..d46f4d885 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/m3ulcb-ota-bootfiles.bb
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/bootfiles/renesas-ota-bootfiles.bb
@@ -4,18 +4,20 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384
inherit deploy
-COMPATIBLE_MACHINE = "m3ulcb"
+COMPATIBLE_MACHINE = "(salvator-x|m3ulcb|h3ulcb|ebisu)"
S = "${WORKDIR}"
-SRC_URI_append_sota = "file://uEnv-ota.txt"
-
+SRC_URI:append:sota = " file://uEnv-ota-m3ulcb.txt \
+ file://uEnv-ota-h3ulcb.txt \
+ file://uEnv-ota-h3-salvator-xs \
+ file://uEnv-ota-m3-salvator-xs"
do_deploy() {
install -d ${DEPLOYDIR}/${PN}
}
-do_deploy_append_sota() {
- install -m 0755 ${WORKDIR}/uEnv-ota.txt ${DEPLOYDIR}/${PN}/uEnv.txt
+do_deploy:append:sota() {
+ install -m 0755 ${WORKDIR}/uEnv-ota-${BOARD_NAME}.txt ${DEPLOYDIR}/${PN}/uEnv.txt
}
addtask deploy before do_package after do_install
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch
new file mode 100644
index 000000000..7627a0660
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples/0001-secure_storage-ta-Add-a-missing-include-file.patch
@@ -0,0 +1,29 @@
+From be7079678aeb1503e0f681d977c47c44fd7b4f8c Mon Sep 17 00:00:00 2001
+From: Pierre Marzin <pierre.marzin@iot.bzh>
+Date: Mon, 19 Aug 2019 09:33:17 +0000
+Subject: [PATCH] secure_storage: ta: Add a missing include file
+
+The commit 9890a50d3c26b377dcb27f5db680018e15a5a3de fix a size type by
+using a format macro contant 'PRIu32' into a printf. This needs the
+inttypes.h header file to build correctly with aarch64-linux-gnu-gcc.
+
+Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
+---
+ secure_storage/ta/secure_storage_ta.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/secure_storage/ta/secure_storage_ta.c b/secure_storage/ta/secure_storage_ta.c
+index 3ccc12d..cfdfbb6 100644
+--- a/secure_storage/ta/secure_storage_ta.c
++++ b/secure_storage/ta/secure_storage_ta.c
+@@ -28,6 +28,7 @@
+ #include <secure_storage_ta.h>
+ #include <tee_internal_api.h>
+ #include <tee_internal_api_extensions.h>
++#include <inttypes.h>
+
+ static TEE_Result delete_object(uint32_t param_types, TEE_Param params[4])
+ {
+--
+2.11.0
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb
new file mode 100644
index 000000000..7ff677c80
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-examples_git.bb
@@ -0,0 +1,61 @@
+SUMMARY = "OP-TEE examples"
+
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
+
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit python3native
+
+PV = "3.6.0+git${SRCPV}"
+
+SRCREV = "292da2fd8db0176e0e96989268c63ef9ab910a6c"
+
+SRC_URI = " \
+ git://github.com/linaro-swg/optee_examples;branch=master;name=master;protocol=https \
+ file://0001-secure_storage-ta-Add-a-missing-include-file.patch \
+"
+
+COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)"
+PLATFORM = "rcar"
+
+DEPENDS = "optee-os optee-client python-pycrypto-native"
+
+CFLAGS += "-Wno-extra -Wno-error=format"
+TARGET_CFLAGS += "-Wno-extra -Wno-error=format"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+INSANE_SKIP:${PN} = "ldflags"
+
+TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64"
+
+OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr"
+
+TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr"
+
+S = "${WORKDIR}/git"
+EXTRA_OEMAKE = "\
+ TEEC_EXPORT=${TEEC_EXPORT} \
+ OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
+ TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
+ HOST_CROSS_COMPILE=${TARGET_PREFIX} \
+ TA_CROSS_COMPILE=${TARGET_PREFIX} \
+ PLATFORM=${PLATFORM} \
+ V=1 \
+ "
+
+do_compile() {
+ oe_runmake
+}
+
+do_install () {
+ mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
+ mkdir -p ${D}${bindir}
+ install -D -p -m0755 ${S}/out/ca/* ${D}${bindir}
+ install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz
+ mkdir -p ${D}${includedir}
+ cp ${S}/hello_world/ta/include/* ${D}${includedir}
+}
+
+FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch
deleted file mode 100644
index 14b91699a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/0001-Remove-the-file-generation-and-directly-copy-the-fil.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From f9e26ca66938281a635cdac2fbeda7418488aac8 Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Thu, 23 Mar 2017 15:20:45 +0100
-Subject: [PATCH] Remove the file generation and directly copy the files.
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- lib/libutee/tui/sub.mk | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/lib/libutee/tui/sub.mk b/lib/libutee/tui/sub.mk
-index 517cde4..d55340c 100644
---- a/lib/libutee/tui/sub.mk
-+++ b/lib/libutee/tui/sub.mk
-@@ -11,19 +11,15 @@ produce-additional-default_bold = default_bold.h
- produce-default_bold = default_bold.c
- depends-default_bold := scripts/render_font.py \
- $(sub-dir)/fonts/amble/Amble-Bold.ttf
--recipe-default_bold := scripts/render_font.py \
-- --font_file $(sub-dir)/fonts/amble/Amble-Bold.ttf \
-- --font_size 20 --font_name default_bold \
-- --out_dir $(sub-dir-out)
-+recipe-default_bold := cp $(sub-dir)/fonts/amble/default_bold.{c,h} \
-+ $(sub-dir-out)
-
- gensrcs-y += default_regular
- produce-additional-default_regular = default_regular.h
- produce-default_regular = default_regular.c
- depends-default_regular := scripts/render_font.py \
- $(sub-dir)/fonts/amble/Amble-Regular.ttf
--recipe-default_regular := scripts/render_font.py \
-- --font_file $(sub-dir)/fonts/amble/Amble-Regular.ttf \
-- --font_size 20 --font_name default_regular \
-- --out_dir $(sub-dir-out)
-+recipe-default_regular := cp $(sub-dir)/fonts/amble/default_regular.{c,h} \
-+ $(sub-dir-out)
-
-
---
-2.6.6
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c
deleted file mode 100644
index 4fbbadddd..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.c
+++ /dev/null
@@ -1,1033 +0,0 @@
-/*
- * This file is auto generated with
- * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Bold.ttf --font_size 20 --font_name default_bold --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui
- * do not edit.
- */
-#include "font.h"
-
-static const unsigned char letter_20[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_21[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_22[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x6c, 0x00,
- 0x6c, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_23[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0e, 0x60, 0x0e, 0x60, 0x0e, 0xe0,
- 0x3f, 0xf8, 0x3f, 0xf8, 0x0c, 0xe0, 0x0c, 0xe0,
- 0x1c, 0xc0, 0x7f, 0xf8, 0x7f, 0xf8, 0x1c, 0xc0,
- 0x19, 0xc0, 0x19, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_24[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x0f, 0x80, 0x3f, 0xc0, 0x3d, 0xc0,
- 0x78, 0x00, 0x78, 0x00, 0x3c, 0x00, 0x1f, 0x00,
- 0x0f, 0xc0, 0x01, 0xc0, 0x00, 0xe0, 0x00, 0xe0,
- 0x3f, 0xc0, 0x3f, 0x80, 0x0f, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_25[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
- 0x18, 0x00, 0x7e, 0x30, 0x00, 0x66, 0x20, 0x00,
- 0x66, 0x60, 0x00, 0x3c, 0xc0, 0x00, 0x01, 0x80,
- 0x00, 0x01, 0x80, 0x00, 0x03, 0x3c, 0x00, 0x06,
- 0x6c, 0x00, 0x06, 0x66, 0x00, 0x0c, 0x66, 0x00,
- 0x18, 0x7c, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_26[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x00, 0x1f, 0xc0, 0x39, 0xc0,
- 0x39, 0xc0, 0x1f, 0x80, 0x1f, 0x00, 0x1f, 0x00,
- 0x3f, 0x80, 0x73, 0xf0, 0x71, 0xf0, 0x79, 0xf0,
- 0x3f, 0xf8, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_27[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_28[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x0c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x38, 0x00,
- 0x38, 0x00, 0x30, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x30, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x18, 0x00, 0x1c, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_29[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
- 0x70, 0x00, 0x30, 0x00, 0x38, 0x00, 0x18, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x18, 0x00, 0x38, 0x00, 0x38, 0x00, 0x30, 0x00,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x6d, 0x80,
- 0x7f, 0x80, 0x0e, 0x00, 0x1f, 0x00, 0x3b, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x7f, 0xc0,
- 0x7f, 0xc0, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x38, 0x30, 0x30, 0x70, 0x60, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_2d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x7e, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_2f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x38, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x60, 0x00, 0x60, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_30[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x00, 0x3f, 0x80, 0x39, 0xc0,
- 0x71, 0xc0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x71, 0xc0, 0x39, 0xc0,
- 0x3f, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_31[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x00, 0x3f, 0x00, 0x37, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x3f, 0xc0, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_32[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x7f, 0xc0, 0x33, 0xc0,
- 0x01, 0xe0, 0x01, 0xc0, 0x01, 0xc0, 0x07, 0x80,
- 0x0f, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x70, 0x00,
- 0x7f, 0xe0, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_33[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x00, 0x7f, 0x80, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0xc0, 0x1f, 0x80, 0x1f, 0x80,
- 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x21, 0xc0,
- 0x7f, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_34[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x03, 0x80, 0x07, 0x80, 0x07, 0x80,
- 0x0f, 0x80, 0x1d, 0x80, 0x19, 0x80, 0x39, 0x80,
- 0x31, 0x80, 0x73, 0xc0, 0x7f, 0xe0, 0x7f, 0xe0,
- 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_35[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0xc0, 0x3f, 0xc0, 0x30, 0x00,
- 0x30, 0x00, 0x7f, 0x00, 0x7f, 0xc0, 0x01, 0xc0,
- 0x00, 0xe0, 0x00, 0xe0, 0x01, 0xe0, 0x03, 0xc0,
- 0x7f, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_36[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x80, 0x1f, 0x80, 0x3c, 0x00,
- 0x38, 0x00, 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x78, 0xe0, 0x39, 0xc0,
- 0x1f, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_37[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xe0, 0x7f, 0xe0, 0x01, 0xc0,
- 0x01, 0xc0, 0x01, 0x80, 0x03, 0x80, 0x03, 0x80,
- 0x07, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x0e, 0x00,
- 0x0c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_38[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3f, 0xc0, 0x79, 0xc0,
- 0x71, 0xc0, 0x39, 0xc0, 0x3f, 0x80, 0x3f, 0x80,
- 0x71, 0xc0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0,
- 0x3f, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_39[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3f, 0x80, 0x71, 0xc0,
- 0x71, 0xc0, 0x70, 0xe0, 0x71, 0xe0, 0x3f, 0xe0,
- 0x1f, 0xe0, 0x01, 0xc0, 0x01, 0xc0, 0x03, 0xc0,
- 0x1f, 0x80, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_3b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30,
- 0x30, 0x70, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_3c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0xc0, 0x0f, 0xc0, 0x3f, 0x00,
- 0x78, 0x00, 0x78, 0x00, 0x3f, 0x00, 0x0f, 0xc0,
- 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x00, 0x7c, 0x00, 0x1f, 0x80,
- 0x07, 0xc0, 0x07, 0xc0, 0x1f, 0x80, 0x7c, 0x00,
- 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3e, 0x00, 0x7f, 0x80, 0x43, 0x80,
- 0x03, 0x80, 0x03, 0x80, 0x07, 0x00, 0x0e, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_40[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- 0xf8, 0x00, 0x0f, 0xbc, 0x00, 0x1c, 0x06, 0x00,
- 0x18, 0x03, 0x00, 0x31, 0xf1, 0x80, 0x33, 0xf9,
- 0x80, 0x63, 0x19, 0x80, 0x66, 0x19, 0x80, 0x66,
- 0x31, 0x80, 0x66, 0x31, 0x80, 0x66, 0x31, 0x80,
- 0x67, 0xff, 0x00, 0x63, 0x9e, 0x00, 0x30, 0x00,
- 0x00, 0x38, 0x00, 0x00, 0x1c, 0x10, 0x00, 0x07,
- 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_41[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0x00, 0x07, 0x80, 0x0f, 0x80,
- 0x0f, 0x80, 0x1d, 0xc0, 0x1c, 0xc0, 0x18, 0xe0,
- 0x38, 0xe0, 0x3f, 0xe0, 0x3f, 0xf0, 0x70, 0x70,
- 0x70, 0x70, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_42[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x79, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x7f, 0xc0, 0x7f, 0xc0,
- 0x70, 0xe0, 0x70, 0x70, 0x70, 0x70, 0x78, 0xe0,
- 0x7f, 0xe0, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_43[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0xc0, 0x1f, 0xc0, 0x3c, 0x00,
- 0x38, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x38, 0x00, 0x3c, 0x00,
- 0x1f, 0xc0, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_44[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x71, 0xe0,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x38,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x71, 0xe0,
- 0x7f, 0xc0, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_45[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x7f, 0x80, 0x7f, 0x80,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_46[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x7f, 0x80, 0x7f, 0x80,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_47[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0xe0, 0x1f, 0xe0, 0x3c, 0x00,
- 0x38, 0x00, 0x70, 0x00, 0x70, 0x00, 0x71, 0xf0,
- 0x71, 0xf0, 0x70, 0x30, 0x38, 0x30, 0x3c, 0x70,
- 0x1f, 0xf0, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_48[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x7f, 0xf8, 0x7f, 0xf8,
- 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_49[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7e, 0x00, 0x7e, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x7e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x0f, 0x00,
- 0x7e, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0xe0, 0x70, 0xe0, 0x71, 0xc0,
- 0x71, 0xc0, 0x73, 0x80, 0x7f, 0x80, 0x7f, 0x80,
- 0x73, 0x80, 0x71, 0xc0, 0x71, 0xc0, 0x70, 0xe0,
- 0x70, 0xf0, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
- 0x0e, 0x00, 0x7c, 0x1e, 0x00, 0x7c, 0x3e, 0x00,
- 0x7e, 0x3e, 0x00, 0x7e, 0x7e, 0x00, 0x77, 0x6e,
- 0x00, 0x73, 0xee, 0x00, 0x73, 0xce, 0x00, 0x71,
- 0xce, 0x00, 0x70, 0x0e, 0x00, 0x70, 0x0e, 0x00,
- 0x70, 0x0e, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x78, 0x38, 0x78, 0x38, 0x7c, 0x38,
- 0x7e, 0x38, 0x7e, 0x38, 0x77, 0x38, 0x73, 0xb8,
- 0x71, 0xb8, 0x71, 0xf8, 0x70, 0xf8, 0x70, 0xf8,
- 0x70, 0x78, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xe0, 0x3c, 0xf0,
- 0x70, 0x78, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x78, 0x78, 0x3c, 0xf0,
- 0x1f, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_50[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xe0, 0x70, 0xe0,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0xe0, 0x7f, 0xe0,
- 0x7f, 0x80, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_51[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xe0, 0x3c, 0xf0,
- 0x70, 0x78, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x78, 0x78, 0x3c, 0xf0,
- 0x1f, 0xe0, 0x0f, 0xf0, 0x00, 0x78, 0x00, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_52[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x7f, 0xc0,
- 0x7f, 0xc0, 0x71, 0xc0, 0x71, 0xc0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0x70, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_53[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3f, 0xc0, 0x79, 0x80,
- 0x70, 0x00, 0x70, 0x00, 0x7c, 0x00, 0x1f, 0x00,
- 0x07, 0x80, 0x01, 0xc0, 0x01, 0xc0, 0x73, 0xc0,
- 0x7f, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_54[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xff, 0xe0, 0xff, 0xe0, 0x0e, 0x00,
- 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
- 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00,
- 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_55[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x70, 0x38, 0x70, 0x38,
- 0x70, 0x38, 0x70, 0x38, 0x38, 0x70, 0x3c, 0xf0,
- 0x1f, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_56[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
- 0x38, 0xe0, 0x38, 0xe0, 0x38, 0xe0, 0x19, 0xc0,
- 0x1d, 0xc0, 0x1d, 0xc0, 0x0f, 0x80, 0x0f, 0x80,
- 0x0f, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_57[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
- 0xc1, 0xc0, 0x71, 0xe3, 0x80, 0x71, 0xe3, 0x80,
- 0x71, 0xe3, 0x80, 0x71, 0xf3, 0x80, 0x33, 0xf3,
- 0x00, 0x3b, 0x37, 0x00, 0x3b, 0x37, 0x00, 0x3f,
- 0x3f, 0x00, 0x1f, 0x1f, 0x00, 0x1e, 0x1e, 0x00,
- 0x1e, 0x1e, 0x00, 0x1e, 0x1e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_58[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0xe0, 0x70, 0xe0, 0x39, 0xc0,
- 0x1d, 0xc0, 0x1f, 0x80, 0x0f, 0x00, 0x0f, 0x00,
- 0x0f, 0x00, 0x1f, 0x80, 0x3d, 0xc0, 0x39, 0xc0,
- 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_59[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x70, 0x70, 0x70, 0xe0, 0x38, 0xe0,
- 0x39, 0xc0, 0x19, 0xc0, 0x1f, 0x80, 0x0f, 0x80,
- 0x0f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x7f, 0xc0, 0x01, 0xc0,
- 0x03, 0x80, 0x07, 0x80, 0x07, 0x00, 0x0e, 0x00,
- 0x0e, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x7f, 0xe0, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5b[] = {
- 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x38, 0x38, 0x38,
- 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
- 0x38, 0x38, 0x38, 0x3e, 0x3e, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_5c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0e, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00,
- 0x7c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x7c, 0x00,
- 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x1c, 0x00, 0x1e, 0x00, 0x3e, 0x00,
- 0x37, 0x00, 0x33, 0x00, 0x63, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xe0,
- 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_60[] = {
- 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x18, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_61[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x3f, 0x80, 0x23, 0xc0, 0x01, 0xc0,
- 0x1f, 0xc0, 0x7f, 0xc0, 0x71, 0xc0, 0x71, 0xc0,
- 0x7f, 0xc0, 0x3d, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_62[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x7f, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0,
- 0x7f, 0xc0, 0x77, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_63[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3f, 0x00, 0x78, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x78, 0x00,
- 0x3f, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_64[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
- 0x1f, 0xe0, 0x3f, 0xe0, 0x79, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0,
- 0x3f, 0xe0, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_65[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x3f, 0x80, 0x79, 0xc0, 0x71, 0xc0,
- 0x7f, 0xc0, 0x7f, 0xc0, 0x70, 0x00, 0x78, 0x00,
- 0x3f, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_66[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3f, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0xfe, 0x00, 0x7e, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_67[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0xe0, 0x3f, 0xe0, 0x71, 0xc0, 0x71, 0xc0,
- 0x71, 0xc0, 0x3f, 0xc0, 0x3f, 0x00, 0x30, 0x00,
- 0x3f, 0x80, 0x3f, 0xc0, 0x70, 0xe0, 0xf0, 0xe0,
- 0x7f, 0xe0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_68[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_69[] = {
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00,
- 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
- 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_6a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,
- 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x71, 0xc0, 0x73, 0xc0, 0x73, 0x80, 0x77, 0x00,
- 0x7f, 0x00, 0x7f, 0x00, 0x73, 0x80, 0x73, 0x80,
- 0x71, 0xc0, 0x71, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38,
- 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
- 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_6d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x77, 0xdf, 0x00, 0x7f, 0xff, 0x00, 0x78, 0xe3,
- 0x80, 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x70,
- 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80,
- 0x70, 0xe3, 0x80, 0x70, 0xe3, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x77, 0x80, 0x7f, 0xc0, 0x78, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3f, 0xc0, 0x79, 0xc0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xc0,
- 0x3f, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_70[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x77, 0x80, 0x7f, 0xc0, 0x79, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0,
- 0x7f, 0xc0, 0x7f, 0x80, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_71[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1e, 0xe0, 0x3f, 0xe0, 0x79, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x79, 0xe0,
- 0x3f, 0xe0, 0x1f, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
- 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_72[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x77, 0x00, 0x7e, 0x00, 0x78, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_73[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x7f, 0x00, 0x70, 0x00, 0x70, 0x00,
- 0x3e, 0x00, 0x1f, 0x00, 0x07, 0x80, 0x47, 0x80,
- 0x7f, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_74[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0xff, 0x00, 0xfe, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x3f, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_75[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
- 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x39, 0xe0,
- 0x3f, 0xe0, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_76[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe1, 0xc0, 0x71, 0xc0, 0x73, 0x80, 0x73, 0x80,
- 0x33, 0x00, 0x3b, 0x00, 0x3f, 0x00, 0x1e, 0x00,
- 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_77[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x63, 0x8c, 0x00, 0x73, 0x9c, 0x00, 0x73, 0x9c,
- 0x00, 0x77, 0xdc, 0x00, 0x36, 0xd8, 0x00, 0x36,
- 0xd8, 0x00, 0x3e, 0xf8, 0x00, 0x3c, 0x78, 0x00,
- 0x1c, 0x70, 0x00, 0x1c, 0x70, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_78[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x71, 0xc0, 0x3b, 0x80, 0x3b, 0x80, 0x1f, 0x00,
- 0x0e, 0x00, 0x1e, 0x00, 0x1f, 0x00, 0x3b, 0x80,
- 0x73, 0x80, 0x71, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_79[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe1, 0xc0, 0x71, 0xc0, 0x71, 0x80, 0x33, 0x80,
- 0x3b, 0x80, 0x3b, 0x00, 0x1f, 0x00, 0x1f, 0x00,
- 0x1e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x1c, 0x00,
- 0x3c, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0x00, 0x7f, 0x00, 0x0f, 0x00, 0x0e, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x38, 0x00, 0x78, 0x00,
- 0x7f, 0x80, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00,
- 0x1c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x38, 0x00,
- 0x70, 0x00, 0x70, 0x00, 0x38, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1c, 0x00,
- 0x1e, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7c[] = {
- 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x70, 0x70,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_7d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
- 0x78, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x18, 0x00, 0x1c, 0x00,
- 0x0e, 0x00, 0x1e, 0x00, 0x1c, 0x00, 0x18, 0x00,
- 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00,
- 0x78, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const struct font_letter letters[] = {
- { letter_20, sizeof(letter_20), 7},
- { letter_21, sizeof(letter_21), 6},
- { letter_22, sizeof(letter_22), 9},
- { letter_23, sizeof(letter_23), 15},
- { letter_24, sizeof(letter_24), 13},
- { letter_25, sizeof(letter_25), 17},
- { letter_26, sizeof(letter_26), 16},
- { letter_27, sizeof(letter_27), 6},
- { letter_28, sizeof(letter_28), 9},
- { letter_29, sizeof(letter_29), 9},
- { letter_2a, sizeof(letter_2a), 12},
- { letter_2b, sizeof(letter_2b), 13},
- { letter_2c, sizeof(letter_2c), 7},
- { letter_2d, sizeof(letter_2d), 9},
- { letter_2e, sizeof(letter_2e), 7},
- { letter_2f, sizeof(letter_2f), 11},
- { letter_30, sizeof(letter_30), 13},
- { letter_31, sizeof(letter_31), 12},
- { letter_32, sizeof(letter_32), 13},
- { letter_33, sizeof(letter_33), 13},
- { letter_34, sizeof(letter_34), 14},
- { letter_35, sizeof(letter_35), 13},
- { letter_36, sizeof(letter_36), 13},
- { letter_37, sizeof(letter_37), 13},
- { letter_38, sizeof(letter_38), 13},
- { letter_39, sizeof(letter_39), 13},
- { letter_3a, sizeof(letter_3a), 6},
- { letter_3b, sizeof(letter_3b), 7},
- { letter_3c, sizeof(letter_3c), 12},
- { letter_3d, sizeof(letter_3d), 13},
- { letter_3e, sizeof(letter_3e), 12},
- { letter_3f, sizeof(letter_3f), 12},
- { letter_40, sizeof(letter_40), 20},
- { letter_41, sizeof(letter_41), 16},
- { letter_42, sizeof(letter_42), 14},
- { letter_43, sizeof(letter_43), 13},
- { letter_44, sizeof(letter_44), 15},
- { letter_45, sizeof(letter_45), 13},
- { letter_46, sizeof(letter_46), 12},
- { letter_47, sizeof(letter_47), 15},
- { letter_48, sizeof(letter_48), 15},
- { letter_49, sizeof(letter_49), 10},
- { letter_4a, sizeof(letter_4a), 10},
- { letter_4b, sizeof(letter_4b), 15},
- { letter_4c, sizeof(letter_4c), 12},
- { letter_4d, sizeof(letter_4d), 18},
- { letter_4e, sizeof(letter_4e), 15},
- { letter_4f, sizeof(letter_4f), 16},
- { letter_50, sizeof(letter_50), 14},
- { letter_51, sizeof(letter_51), 16},
- { letter_52, sizeof(letter_52), 15},
- { letter_53, sizeof(letter_53), 13},
- { letter_54, sizeof(letter_54), 14},
- { letter_55, sizeof(letter_55), 15},
- { letter_56, sizeof(letter_56), 16},
- { letter_57, sizeof(letter_57), 21},
- { letter_58, sizeof(letter_58), 15},
- { letter_59, sizeof(letter_59), 15},
- { letter_5a, sizeof(letter_5a), 13},
- { letter_5b, sizeof(letter_5b), 8},
- { letter_5c, sizeof(letter_5c), 12},
- { letter_5d, sizeof(letter_5d), 9},
- { letter_5e, sizeof(letter_5e), 11},
- { letter_5f, sizeof(letter_5f), 13},
- { letter_60, sizeof(letter_60), 8},
- { letter_61, sizeof(letter_61), 12},
- { letter_62, sizeof(letter_62), 14},
- { letter_63, sizeof(letter_63), 11},
- { letter_64, sizeof(letter_64), 13},
- { letter_65, sizeof(letter_65), 13},
- { letter_66, sizeof(letter_66), 11},
- { letter_67, sizeof(letter_67), 15},
- { letter_68, sizeof(letter_68), 13},
- { letter_69, sizeof(letter_69), 6},
- { letter_6a, sizeof(letter_6a), 9},
- { letter_6b, sizeof(letter_6b), 13},
- { letter_6c, sizeof(letter_6c), 6},
- { letter_6d, sizeof(letter_6d), 19},
- { letter_6e, sizeof(letter_6e), 13},
- { letter_6f, sizeof(letter_6f), 14},
- { letter_70, sizeof(letter_70), 14},
- { letter_71, sizeof(letter_71), 13},
- { letter_72, sizeof(letter_72), 10},
- { letter_73, sizeof(letter_73), 11},
- { letter_74, sizeof(letter_74), 11},
- { letter_75, sizeof(letter_75), 13},
- { letter_76, sizeof(letter_76), 14},
- { letter_77, sizeof(letter_77), 18},
- { letter_78, sizeof(letter_78), 14},
- { letter_79, sizeof(letter_79), 14},
- { letter_7a, sizeof(letter_7a), 11},
- { letter_7b, sizeof(letter_7b), 9},
- { letter_7c, sizeof(letter_7c), 6},
- { letter_7d, sizeof(letter_7d), 10},
-};
-
-const struct font font_default_bold = {
- .first = 0x20,
- .last = 0x7d,
- .letters = letters,
- .height = 26,
- .max_width = 22.0,
-};
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h
deleted file mode 100644
index dbc58301f..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_bold.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * This file is auto generated with
- * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Bold.ttf --font_size 20 --font_name default_bold --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui
- * do not edit.
- */
-#ifndef __DEFAULT_BOLD_H
-#define __DEFAULT_BOLD_H
-#include "font.h"
-extern const struct font font_default_bold;
-#endif /*__DEFAULT_BOLD_H*/
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c
deleted file mode 100644
index 96e65cf61..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.c
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
- * This file is auto generated with
- * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Regular.ttf --font_size 20 --font_name default_regular --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui
- * do not edit.
- */
-#include "font.h"
-
-static const unsigned char letter_20[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_21[] = {
- 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00,
- 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_22[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x68, 0x48,
- 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_23[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x04, 0xc0, 0x0c, 0xc0, 0x0c, 0xc0,
- 0x3f, 0xf0, 0x1d, 0xc0, 0x0c, 0xc0, 0x0c, 0xc0,
- 0x1d, 0xc0, 0x7f, 0xf0, 0x19, 0x80, 0x19, 0x80,
- 0x19, 0x80, 0x19, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_24[] = {
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x0f, 0x80, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x38, 0x00, 0x1e, 0x00, 0x07, 0x80,
- 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x3f, 0x80, 0x1f, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_25[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
- 0x08, 0x00, 0x36, 0x10, 0x00, 0x63, 0x30, 0x00,
- 0x22, 0x20, 0x00, 0x3e, 0x40, 0x00, 0x00, 0xc0,
- 0x00, 0x01, 0x80, 0x00, 0x01, 0x3c, 0x00, 0x03,
- 0x66, 0x00, 0x06, 0x66, 0x00, 0x04, 0x66, 0x00,
- 0x0c, 0x76, 0x00, 0x18, 0x3c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_26[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x00, 0x3b, 0x80, 0x31, 0x80,
- 0x31, 0x80, 0x1b, 0x00, 0x1e, 0x00, 0x1e, 0x00,
- 0x37, 0x00, 0x63, 0xb0, 0x61, 0xe0, 0x60, 0xe0,
- 0x3f, 0xe0, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_27[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x40, 0x40,
- 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_28[] = {
- 0x00, 0x00, 0x00, 0x08, 0x08, 0x18, 0x30, 0x30,
- 0x30, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x30, 0x30, 0x10, 0x18, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_29[] = {
- 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x10, 0x18,
- 0x18, 0x08, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18,
- 0x18, 0x18, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_2a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x6b, 0x00,
- 0x3e, 0x00, 0x1c, 0x00, 0x16, 0x00, 0x32, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x7f, 0x80,
- 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x30, 0x20, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_2d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x7e, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_2e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_2f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x20, 0x00, 0x60, 0x00, 0x60, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_30[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x00, 0x1b, 0x80, 0x30, 0xc0,
- 0x60, 0xc0, 0x60, 0xc0, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0,
- 0x3b, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_31[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0e, 0x00, 0x3e, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x07, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_32[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3b, 0x80, 0x00, 0xc0,
- 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00,
- 0x0e, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_33[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x00, 0x33, 0x80, 0x00, 0xc0,
- 0x00, 0xc0, 0x01, 0x80, 0x1f, 0x00, 0x03, 0x80,
- 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x77, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_34[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x03, 0x80, 0x03, 0x80, 0x07, 0x80,
- 0x0d, 0x80, 0x0d, 0x80, 0x19, 0x80, 0x31, 0x80,
- 0x31, 0x80, 0x61, 0x80, 0x7f, 0xe0, 0x01, 0x80,
- 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_35[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x20, 0x00, 0x3f, 0x00, 0x31, 0xc0,
- 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x33, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_36[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0x80, 0x1e, 0x80, 0x30, 0x00,
- 0x30, 0x00, 0x6f, 0x80, 0x79, 0xc0, 0x60, 0xc0,
- 0x60, 0x60, 0x60, 0x60, 0x30, 0x60, 0x30, 0xc0,
- 0x1d, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_37[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x03, 0x00,
- 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0c, 0x00,
- 0x0c, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_38[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3b, 0xc0, 0x70, 0xc0,
- 0x60, 0xc0, 0x31, 0xc0, 0x1f, 0x80, 0x39, 0xc0,
- 0x60, 0xc0, 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0,
- 0x3b, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_39[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x00, 0x3b, 0x80, 0x60, 0xc0,
- 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x31, 0xc0,
- 0x1f, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0x80,
- 0x37, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_3b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x30, 0x20, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_3c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x1e, 0x00,
- 0x78, 0x00, 0x70, 0x00, 0x1e, 0x00, 0x07, 0x80,
- 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x1e, 0x00,
- 0x03, 0x80, 0x03, 0x80, 0x0f, 0x00, 0x78, 0x00,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_3f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3e, 0x00, 0x77, 0x00, 0x01, 0x80,
- 0x01, 0x80, 0x01, 0x80, 0x03, 0x00, 0x0e, 0x00,
- 0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_40[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- 0xf0, 0x00, 0x06, 0x0c, 0x00, 0x18, 0x06, 0x00,
- 0x10, 0x03, 0x00, 0x31, 0xf1, 0x00, 0x23, 0x91,
- 0x00, 0x63, 0x11, 0x80, 0x66, 0x11, 0x80, 0x66,
- 0x11, 0x80, 0x66, 0x31, 0x80, 0x66, 0x31, 0x00,
- 0x67, 0xf3, 0x00, 0x23, 0x9c, 0x00, 0x30, 0x00,
- 0x00, 0x18, 0x00, 0x00, 0x0c, 0x10, 0x00, 0x03,
- 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_41[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
- 0x0d, 0x80, 0x0c, 0x80, 0x18, 0xc0, 0x18, 0xc0,
- 0x18, 0x40, 0x3f, 0xe0, 0x30, 0x60, 0x20, 0x20,
- 0x60, 0x30, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_42[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x00, 0x33, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x3f, 0x80, 0x30, 0xc0,
- 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60,
- 0x31, 0xc0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_43[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0xc0, 0x1e, 0xc0, 0x30, 0x00,
- 0x30, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00,
- 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x38, 0x00,
- 0x1e, 0xc0, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_44[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60,
- 0x33, 0xc0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_45[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0xc0, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3f, 0x80,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_46[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x80, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3f, 0x80,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_47[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0xe0, 0x1e, 0x60, 0x38, 0x00,
- 0x30, 0x00, 0x20, 0x00, 0x60, 0x00, 0x61, 0xf0,
- 0x60, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x30,
- 0x1e, 0x70, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_48[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0xf0,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_49[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7e, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00,
- 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00,
- 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00,
- 0x6e, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0,
- 0x31, 0x80, 0x33, 0x80, 0x33, 0x00, 0x3e, 0x00,
- 0x33, 0x00, 0x31, 0x80, 0x31, 0x80, 0x30, 0xc0,
- 0x30, 0x60, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
- 0x0e, 0x00, 0x38, 0x1e, 0x00, 0x3c, 0x1e, 0x00,
- 0x3c, 0x36, 0x00, 0x36, 0x36, 0x00, 0x33, 0x66,
- 0x00, 0x33, 0xc6, 0x00, 0x31, 0xc6, 0x00, 0x30,
- 0x86, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00,
- 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x10, 0x38, 0x10, 0x38, 0x10,
- 0x3c, 0x10, 0x36, 0x10, 0x36, 0x10, 0x33, 0x10,
- 0x31, 0x90, 0x31, 0x90, 0x30, 0xf0, 0x30, 0x70,
- 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_4f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x80, 0x1c, 0xe0, 0x30, 0x70,
- 0x30, 0x30, 0x60, 0x10, 0x60, 0x18, 0x60, 0x18,
- 0x60, 0x18, 0x60, 0x10, 0x30, 0x30, 0x30, 0x70,
- 0x1d, 0xe0, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_50[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60,
- 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0,
- 0x3f, 0x80, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_51[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x0f, 0x80, 0x1d, 0xe0, 0x30, 0x60,
- 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x10,
- 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x30, 0x60,
- 0x1d, 0xe0, 0x0f, 0xe0, 0x00, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_52[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3f, 0x80, 0x33, 0xc0, 0x30, 0x60,
- 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x3f, 0x80,
- 0x31, 0x80, 0x31, 0x80, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0x60, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_53[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x1f, 0x80, 0x3b, 0x80, 0x60, 0x00,
- 0x60, 0x00, 0x60, 0x00, 0x38, 0x00, 0x1f, 0x00,
- 0x03, 0x80, 0x01, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x73, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_54[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xe0, 0x0e, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_55[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x1d, 0xe0, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_56[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x30, 0x60, 0x30, 0x30, 0x60,
- 0x30, 0x60, 0x30, 0x60, 0x18, 0xc0, 0x18, 0xc0,
- 0x18, 0x80, 0x0d, 0x80, 0x0d, 0x80, 0x07, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_57[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
- 0xc1, 0x80, 0x60, 0xc1, 0x80, 0x61, 0xe1, 0x80,
- 0x31, 0xe3, 0x00, 0x31, 0xe3, 0x00, 0x31, 0x33,
- 0x00, 0x33, 0x33, 0x00, 0x13, 0x32, 0x00, 0x1a,
- 0x16, 0x00, 0x1e, 0x1e, 0x00, 0x1e, 0x1e, 0x00,
- 0x0c, 0x0c, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_58[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x60, 0x30, 0xc0, 0x31, 0x80,
- 0x19, 0x80, 0x1b, 0x00, 0x0f, 0x00, 0x0e, 0x00,
- 0x0f, 0x00, 0x1b, 0x00, 0x19, 0x80, 0x31, 0x80,
- 0x30, 0xc0, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_59[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x60, 0x60, 0xc0, 0x30, 0xc0,
- 0x31, 0x80, 0x19, 0x80, 0x1b, 0x00, 0x0f, 0x00,
- 0x0e, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0xe0, 0x00, 0xc0, 0x01, 0xc0,
- 0x01, 0x80, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00,
- 0x0c, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x1c, 0x18, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x18, 0x1c, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_5c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x10, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00,
- 0x06, 0x00, 0x06, 0x00, 0x02, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x78, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x36, 0x00,
- 0x36, 0x00, 0x63, 0x00, 0x63, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_5f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_60[] = {
- 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x18, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_61[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x3f, 0x80, 0x01, 0x80, 0x01, 0x80,
- 0x1f, 0x80, 0x31, 0x80, 0x61, 0x80, 0x61, 0x80,
- 0x73, 0x80, 0x3c, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_62[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x3f, 0x00, 0x3b, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0,
- 0x3f, 0x80, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_63[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3d, 0x00, 0x30, 0x00, 0x60, 0x00,
- 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00,
- 0x3d, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_64[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x1e, 0xc0, 0x3b, 0xc0, 0x30, 0xc0, 0x60, 0xc0,
- 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0,
- 0x3f, 0xc0, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_65[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3b, 0x80, 0x30, 0xc0, 0x60, 0xc0,
- 0x7f, 0xc0, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00,
- 0x3d, 0x80, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_66[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x7e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_67[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0xe0, 0x3b, 0xc0, 0x70, 0xc0, 0x60, 0xc0,
- 0x31, 0xc0, 0x1f, 0x80, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x3f, 0xc0, 0x60, 0xc0, 0x60, 0x60,
- 0x7b, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_68[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x37, 0x80, 0x3d, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_69[] = {
- 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_6a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x38, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x31, 0x80, 0x31, 0x80, 0x33, 0x00, 0x36, 0x00,
- 0x3e, 0x00, 0x36, 0x00, 0x33, 0x00, 0x33, 0x00,
- 0x31, 0x80, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6c[] = {
- 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_6d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3f, 0x9e, 0x00, 0x38, 0xe3, 0x00, 0x30, 0xc3,
- 0x00, 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x30,
- 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00,
- 0x30, 0xc3, 0x00, 0x30, 0xc3, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6e[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x37, 0x80, 0x39, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_6f[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x3b, 0x80, 0x30, 0xc0, 0x60, 0xc0,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0, 0x30, 0xc0,
- 0x3b, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_70[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3f, 0x00, 0x39, 0xc0, 0x30, 0xc0, 0x30, 0x40,
- 0x30, 0x60, 0x30, 0x60, 0x30, 0xc0, 0x30, 0xc0,
- 0x3f, 0x80, 0x3f, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_71[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1e, 0xc0, 0x3b, 0xc0, 0x30, 0xc0, 0x60, 0xc0,
- 0x60, 0xc0, 0x60, 0xc0, 0x60, 0xc0, 0x30, 0xc0,
- 0x3f, 0xc0, 0x1e, 0xc0, 0x00, 0xc0, 0x00, 0xc0,
- 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_72[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x26, 0x00, 0x3c, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_73[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x33, 0x00, 0x60, 0x00, 0x60, 0x00,
- 0x3c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x03, 0x00,
- 0x77, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_74[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x7e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x3a, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_75[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0, 0x30, 0xc0,
- 0x31, 0xc0, 0x1e, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_76[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x61, 0x80, 0x61, 0x80, 0x61, 0x80, 0x33, 0x00,
- 0x33, 0x00, 0x33, 0x00, 0x16, 0x00, 0x1e, 0x00,
- 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_77[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x61, 0x0c, 0x00, 0x63, 0x8c, 0x00, 0x63, 0x8c,
- 0x00, 0x23, 0x88, 0x00, 0x26, 0xd8, 0x00, 0x36,
- 0xd8, 0x00, 0x34, 0x58, 0x00, 0x1c, 0x70, 0x00,
- 0x18, 0x70, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_78[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x61, 0x80, 0x31, 0x80, 0x13, 0x00, 0x1e, 0x00,
- 0x0c, 0x00, 0x0e, 0x00, 0x1e, 0x00, 0x33, 0x00,
- 0x31, 0x80, 0x61, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_79[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x60, 0x80, 0x61, 0x80, 0x61, 0x80, 0x31, 0x00,
- 0x33, 0x00, 0x13, 0x00, 0x1a, 0x00, 0x1e, 0x00,
- 0x0e, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00,
- 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7a[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0x80, 0x03, 0x80, 0x03, 0x00, 0x06, 0x00,
- 0x0c, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x30, 0x00,
- 0x70, 0x00, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7b[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x10, 0x00, 0x30, 0x00, 0x30, 0x00,
- 0x60, 0x00, 0x30, 0x00, 0x30, 0x00, 0x10, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const unsigned char letter_7c[] = {
- 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00,
- 0x00, 0x00,
-};
-
-static const unsigned char letter_7d[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
- 0x30, 0x00, 0x30, 0x00, 0x10, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x0c, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00,
- 0x18, 0x00, 0x18, 0x00, 0x10, 0x00, 0x30, 0x00,
- 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-};
-
-static const struct font_letter letters[] = {
- { letter_20, sizeof(letter_20), 7},
- { letter_21, sizeof(letter_21), 6},
- { letter_22, sizeof(letter_22), 8},
- { letter_23, sizeof(letter_23), 15},
- { letter_24, sizeof(letter_24), 12},
- { letter_25, sizeof(letter_25), 18},
- { letter_26, sizeof(letter_26), 15},
- { letter_27, sizeof(letter_27), 5},
- { letter_28, sizeof(letter_28), 8},
- { letter_29, sizeof(letter_29), 8},
- { letter_2a, sizeof(letter_2a), 11},
- { letter_2b, sizeof(letter_2b), 12},
- { letter_2c, sizeof(letter_2c), 7},
- { letter_2d, sizeof(letter_2d), 9},
- { letter_2e, sizeof(letter_2e), 6},
- { letter_2f, sizeof(letter_2f), 11},
- { letter_30, sizeof(letter_30), 13},
- { letter_31, sizeof(letter_31), 12},
- { letter_32, sizeof(letter_32), 13},
- { letter_33, sizeof(letter_33), 13},
- { letter_34, sizeof(letter_34), 13},
- { letter_35, sizeof(letter_35), 13},
- { letter_36, sizeof(letter_36), 13},
- { letter_37, sizeof(letter_37), 13},
- { letter_38, sizeof(letter_38), 13},
- { letter_39, sizeof(letter_39), 13},
- { letter_3a, sizeof(letter_3a), 6},
- { letter_3b, sizeof(letter_3b), 7},
- { letter_3c, sizeof(letter_3c), 12},
- { letter_3d, sizeof(letter_3d), 13},
- { letter_3e, sizeof(letter_3e), 12},
- { letter_3f, sizeof(letter_3f), 11},
- { letter_40, sizeof(letter_40), 19},
- { letter_41, sizeof(letter_41), 15},
- { letter_42, sizeof(letter_42), 13},
- { letter_43, sizeof(letter_43), 13},
- { letter_44, sizeof(letter_44), 14},
- { letter_45, sizeof(letter_45), 11},
- { letter_46, sizeof(letter_46), 11},
- { letter_47, sizeof(letter_47), 14},
- { letter_48, sizeof(letter_48), 14},
- { letter_49, sizeof(letter_49), 9},
- { letter_4a, sizeof(letter_4a), 10},
- { letter_4b, sizeof(letter_4b), 14},
- { letter_4c, sizeof(letter_4c), 11},
- { letter_4d, sizeof(letter_4d), 17},
- { letter_4e, sizeof(letter_4e), 14},
- { letter_4f, sizeof(letter_4f), 15},
- { letter_50, sizeof(letter_50), 12},
- { letter_51, sizeof(letter_51), 16},
- { letter_52, sizeof(letter_52), 13},
- { letter_53, sizeof(letter_53), 12},
- { letter_54, sizeof(letter_54), 13},
- { letter_55, sizeof(letter_55), 14},
- { letter_56, sizeof(letter_56), 15},
- { letter_57, sizeof(letter_57), 20},
- { letter_58, sizeof(letter_58), 13},
- { letter_59, sizeof(letter_59), 13},
- { letter_5a, sizeof(letter_5a), 14},
- { letter_5b, sizeof(letter_5b), 7},
- { letter_5c, sizeof(letter_5c), 11},
- { letter_5d, sizeof(letter_5d), 9},
- { letter_5e, sizeof(letter_5e), 11},
- { letter_5f, sizeof(letter_5f), 12},
- { letter_60, sizeof(letter_60), 8},
- { letter_61, sizeof(letter_61), 12},
- { letter_62, sizeof(letter_62), 12},
- { letter_63, sizeof(letter_63), 11},
- { letter_64, sizeof(letter_64), 13},
- { letter_65, sizeof(letter_65), 12},
- { letter_66, sizeof(letter_66), 10},
- { letter_67, sizeof(letter_67), 13},
- { letter_68, sizeof(letter_68), 12},
- { letter_69, sizeof(letter_69), 6},
- { letter_6a, sizeof(letter_6a), 9},
- { letter_6b, sizeof(letter_6b), 12},
- { letter_6c, sizeof(letter_6c), 6},
- { letter_6d, sizeof(letter_6d), 18},
- { letter_6e, sizeof(letter_6e), 12},
- { letter_6f, sizeof(letter_6f), 13},
- { letter_70, sizeof(letter_70), 12},
- { letter_71, sizeof(letter_71), 13},
- { letter_72, sizeof(letter_72), 9},
- { letter_73, sizeof(letter_73), 11},
- { letter_74, sizeof(letter_74), 10},
- { letter_75, sizeof(letter_75), 12},
- { letter_76, sizeof(letter_76), 13},
- { letter_77, sizeof(letter_77), 17},
- { letter_78, sizeof(letter_78), 12},
- { letter_79, sizeof(letter_79), 12},
- { letter_7a, sizeof(letter_7a), 12},
- { letter_7b, sizeof(letter_7b), 9},
- { letter_7c, sizeof(letter_7c), 5},
- { letter_7d, sizeof(letter_7d), 9},
-};
-
-const struct font font_default_regular = {
- .first = 0x20,
- .last = 0x7d,
- .letters = letters,
- .height = 26,
- .max_width = 21.0,
-};
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h
deleted file mode 100644
index 28ae28420..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os/default_regular.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * This file is auto generated with
- * scripts/render_font.py --font_file lib/libutee/tui/fonts/amble/Amble-Regular.ttf --font_size 20 --font_name default_regular --out_dir out/arm-plat-rcar/ta_arm64-lib/libutee/tui
- * do not edit.
- */
-#ifndef __DEFAULT_REGULAR_H
-#define __DEFAULT_REGULAR_H
-#include "font.h"
-extern const struct font font_default_regular;
-#endif /*__DEFAULT_REGULAR_H*/
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend
index 135b2a430..52a68e174 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-os_git.bbappend
@@ -1,23 +1,7 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-inherit pythonnative
-DEPENDS += " python-pycrypto-native"
-
-#Need for gcc 6.2
-CFLAGS += " -fno-strict-aliasing -Wno-unused-variable -Wno-shift-negative-value"
-
-SRC_URI_append = " \
- file://default_bold.c \
- file://default_bold.h \
- file://default_regular.c \
- file://default_regular.h \
- file://0001-Remove-the-file-generation-and-directly-copy-the-fil.patch \
- "
-
-
-do_compile_prepend() {
- GENDIRECTORY=${S}/lib/libutee/tui/fonts/amble/
- cp ${WORKDIR}/default_bold.c ${GENDIRECTORY}
- cp ${WORKDIR}/default_bold.h ${GENDIRECTORY}
- cp ${WORKDIR}/default_regular.c ${GENDIRECTORY}
- cp ${WORKDIR}/default_regular.h ${GENDIRECTORY}
+do_install() {
+ install -d ${D}/usr/share/optee
+ cp -r ${S}/out/arm-plat-${PLATFORM}/export-ta_arm64 ${D}/usr/share/optee
}
+
+FILES:${PN}-staticdev += "${datadir}/optee/export-ta_arm64/lib/*.a"
+FILES:${PN}-dev += "${datadir}/optee/export-ta_arm64"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff
new file mode 100644
index 000000000..5067086f1
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test/optee_xtest_fix.diff
@@ -0,0 +1,13 @@
+diff --git a/host/xtest/regression_6000.c b/host/xtest/regression_6000.c
+index 336ea14..2379e43 100644
+--- a/host/xtest/regression_6000.c
++++ b/host/xtest/regression_6000.c
+@@ -82,6 +82,8 @@ static uint32_t fs_id_for_tee_storage_private(void)
+ return TEE_STORAGE_PRIVATE_REE;
+ #elif defined(CFG_RPMB_FS)
+ return TEE_STORAGE_PRIVATE_RPMB;
++#else
++ return TEE_STORAGE_PRIVATE;
+ #endif
+ }
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb
new file mode 100644
index 000000000..b66f0676e
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-test_git.bb
@@ -0,0 +1,55 @@
+DESCRIPTION = "OP-TEE TEST"
+
+LICENSE = "GPL-2.0-only & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://${S}/host/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit python3native
+
+PV = "3.1.0+git${SRCPV}"
+
+SRCREV = "45218eb59b006ad20cc7610904f291dd85157a43"
+
+SRC_URI = " \
+ git://github.com/OP-TEE/optee_test.git;branch=master;name=master;protocol=https \
+ file://optee_xtest_fix.diff \
+"
+
+COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)"
+PLATFORM = "rcar"
+
+DEPENDS = "optee-os optee-client python3-pycrypto-native"
+
+export CROSS_COMPILE64="${TARGET_PREFIX}"
+
+# Let the Makefile handle setting up the flags as it is a standalone application
+LD[unexport] = "1"
+LDFLAGS[unexport] = "1"
+export CCcore="${CC}"
+export LDcore="${LD}"
+libdir[unexport] = "1"
+
+CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds"
+TARGET_CFLAGS += "-Wno-extra -Wno-error=stringop-overflow -Wno-error=array-bounds"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+INSANE_SKIP:${PN} = "ldflags"
+
+S = "${WORKDIR}/git"
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile() {
+ oe_runmake CROSS_COMPILE=${CROSS_COMPILE64} PLATFORM=${PLATFORM} OPTEE_CLIENT_EXPORT=${STAGING_DIR_TARGET}/usr --no-builtin-variables TA_DEV_KIT_DIR="${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64"
+}
+
+do_install () {
+ install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest
+
+ # install path should match the value set in optee-client/tee-supplicant
+ # default TEEC_LOAD_PATH is /lib
+ mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
+ install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
+}
+
+FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb
new file mode 100644
index 000000000..2b93af710
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/optee/optee-user-app-template_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "OP-TEE user_app_template"
+
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit python3native
+
+PV = "0.1+git${SRCPV}"
+
+SRCREV = "0.1"
+
+SRC_URI = " \
+ git://github.com/iotbzh/optee_user_app_template;branch=master;protocol=https \
+"
+
+COMPATIBLE_MACHINE = "(salvator-x|h3ulcb|m3ulcb|m3nulcb|ebisu)"
+PLATFORM = "rcar"
+
+DEPENDS = "optee-os optee-client python-pycrypto-native"
+
+CFLAGS += "-Wno-extra -Wno-error=format"
+TARGET_CFLAGS += "-Wno-extra -Wno-error=format"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+INSANE_SKIP:${PN} = "ldflags"
+
+TA_DEV_KIT_DIR = "${STAGING_DIR_TARGET}/usr/share/optee/export-ta_arm64"
+
+OPTEE_CLIENT_EXPORT = "${STAGING_DIR_TARGET}/usr"
+
+TEEC_EXPORT = "${STAGING_DIR_TARGET}/usr"
+
+S = "${WORKDIR}/git"
+EXTRA_OEMAKE = "\
+ TEEC_EXPORT=${TEEC_EXPORT} \
+ OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
+ TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
+ HOST_CROSS_COMPILE=${TARGET_PREFIX} \
+ TA_CROSS_COMPILE=${TARGET_PREFIX} \
+ PLATFORM=${PLATFORM} \
+ V=1 \
+ "
+
+do_compile() {
+ oe_runmake
+}
+
+do_install () {
+ mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
+ mkdir -p ${D}${bindir}
+ install -D -p -m0755 ${S}/out/ca/* ${D}${bindir}
+ install -D -p -m0444 ${S}/out/ta/* ${D}${nonarch_base_libdir}/optee_armtz
+}
+
+FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch
deleted file mode 100644
index df1f786c6..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot/0001-fixup-build-with-gcc6.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ba619c7ec7820e80d1b5b520440fdb81c31c0baf Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Fri, 14 Oct 2016 09:03:11 +0200
-Subject: [PATCH] fix gcc6 build
-
-Signed-off-by: ronan <ronan@linux-pgnz.suse>
----
- include/linux/compiler-gcc6.h | 66 +++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 66 insertions(+)
- create mode 100644 include/linux/compiler-gcc6.h
-
-diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
-new file mode 100644
-index 0000000..a3d00d8
---- /dev/null
-+++ b/include/linux/compiler-gcc6.h
-@@ -0,0 +1,66 @@
-+#ifndef __LINUX_COMPILER_H
-+#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
-+#endif
-+
-+#define __used __attribute__((__used__))
-+#define __must_check __attribute__((warn_unused_result))
-+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
-+
-+/* Mark functions as cold. gcc will assume any path leading to a call
-+ to them will be unlikely. This means a lot of manual unlikely()s
-+ are unnecessary now for any paths leading to the usual suspects
-+ like BUG(), printk(), panic() etc. [but let's keep them for now for
-+ older compilers]
-+
-+ Early snapshots of gcc 4.3 don't support this and we can't detect this
-+ in the preprocessor, but we can live with this because they're unreleased.
-+ Maketime probing would be overkill here.
-+
-+ gcc also has a __attribute__((__hot__)) to move hot functions into
-+ a special section, but I don't see any sense in this right now in
-+ the kernel context */
-+#define __cold __attribute__((__cold__))
-+
-+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-+
-+#ifndef __CHECKER__
-+# define __compiletime_warning(message) __attribute__((warning(message)))
-+# define __compiletime_error(message) __attribute__((error(message)))
-+#endif /* __CHECKER__ */
-+
-+/*
-+ * Mark a position in code as unreachable. This can be used to
-+ * suppress control flow warnings after asm blocks that transfer
-+ * control elsewhere.
-+ *
-+ * Early snapshots of gcc 4.5 don't support this and we can't detect
-+ * this in the preprocessor, but we can live with this because they're
-+ * unreleased. Really, we need to have autoconf for the kernel.
-+ */
-+#define unreachable() __builtin_unreachable()
-+
-+/* Mark a function definition as prohibited from being cloned. */
-+#define __noclone __attribute__((__noclone__))
-+
-+/*
-+ * Tell the optimizer that something else uses this function or variable.
-+ */
-+#define __visible __attribute__((externally_visible))
-+
-+/*
-+ * GCC 'asm goto' miscompiles certain code sequences:
-+ *
-+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
-+ *
-+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
-+ * Fixed in GCC 4.8.2 and later versions.
-+ *
-+ * (asm goto is automatically volatile - the naming reflects this.)
-+ */
-+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
-+
-+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
-+#define __HAVE_BUILTIN_BSWAP32__
-+#define __HAVE_BUILTIN_BSWAP64__
-+#define __HAVE_BUILTIN_BSWAP16__
-+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
---
-2.6.6
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend
deleted file mode 100644
index 36d8c24b8..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-bsp/u-boot/u-boot_2015.04.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:"
-
-SRC_URI_append = " \
- file://0001-fixup-build-with-gcc6.patch \
-"
-
-do_deploy_prepend() {
- ln -s ${B}/${UBOOT_SREC} ${S}/${UBOOT_SREC}
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch
deleted file mode 100644
index b1d96ae5a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From af485c638c61fa883212ea424e676fbf90bee594 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <otavio@ossystems.com.br>
-Date: Tue, 1 Jul 2014 17:37:31 -0300
-Subject: [PATCH] build: Allow CC and prefix to be overriden
-
-Upstream-Status: Pending
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
----
- makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/makefile b/makefile
-index 22e7d0d..809cc8f 100644
---- a/makefile
-+++ b/makefile
-@@ -18,7 +18,7 @@
- KBUILD_OUTPUT =
-
- DEBUG =
--CC = $(CROSS_COMPILE)gcc
-+CC ?= $(CROSS_COMPILE)gcc
- VER = -DVER=$(version)
- CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS)
- LDLIBS = -lm -lrt $(EXTRA_LDFLAGS)
-@@ -35,7 +35,7 @@ incdefs := $(shell $(srcdir)/incdefs.sh)
- version := $(shell $(srcdir)/version.sh $(srcdir))
- VPATH = $(srcdir)
-
--prefix = /usr/local
-+prefix ?= /usr/local
- sbindir = $(prefix)/sbin
- mandir = $(prefix)/man
- man8dir = $(mandir)/man8
---
-1.7.10.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb
deleted file mode 100644
index 4ee0c8873..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-connectivity/linuxptp/linuxptp_1.4.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz \
- file://build-Allow-CC-and-prefix-to-be-overriden.patch"
-
-SRC_URI[md5sum] = "a37ad2b2ef7d1ebc4d64a66d3fe55cdf"
-SRC_URI[sha256sum] = "6cfd5291fb7394cc9f25458927874a203971b66b76d1c9d6568e007d0cbd81f2"
-
-EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} \
- EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC ${CFLAGS}'"
-
-do_install () {
- install -d ${D}/${bindir}
- install -p ${S}/ptp4l ${D}/${bindir}
- install -p ${S}/pmc ${D}/${bindir}
- install -p ${S}/phc2sys ${D}/${bindir}
- install -p ${S}/hwstamp_ctl ${D}/${bindir}
-}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend
deleted file mode 100644
index 6d9415d33..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-RDEPENDS_${PN} += "\
- ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-multimedia-kernel-modules','',d)} \
- ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-multimedia-libs','',d)} \
- ${@bb.utils.contains('MACHINE_FEATURES','multimedia','packagegroup-gstreamer1.0-plugins','',d)} \
-"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc
new file mode 120000
index 000000000..8c7e36ff9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control.inc
@@ -0,0 +1 @@
+../../include/checksum_control.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc
new file mode 120000
index 000000000..ff4e9a898
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/checksum_control_files.inc
@@ -0,0 +1 @@
+../../include/checksum_control_files.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend
new file mode 100644
index 000000000..8f2d47adc
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bbappend
@@ -0,0 +1,3 @@
+require checksum_control.inc
+
+RDEPENDS:${PN}:append = " wayland-wsegl"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb
new file mode 100644
index 000000000..76d3ea88f
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/virtual-gles-user-module/virtual-gles-user-module.bb
@@ -0,0 +1,7 @@
+DESCRIPTION = "Virtual gles-module"
+
+LICENSE="GPL-2.0-only"
+
+DEPENDS = "gles-user-module wayland-kms libgbm"
+
+PROVIDES = "virtual/libgles2 virtual/egl"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend
new file mode 100644
index 000000000..9a0eb73a3
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/wayland-wsegl.bbappend
@@ -0,0 +1 @@
+DEPENDS:append = " wayland-protocols"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
index e46b10ef7..4a76dda04 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -1,12 +1,15 @@
-WESTONCORE[repaint-window] ??= "34"
+FILESEXTRAPATHS:prepend:rcar-gen3 := "${THISDIR}/${PN}:"
-WESTONIVISHELL[transition-duration] ??= "300"
-WESTONIVISHELL[cursor-theme] ??= "default"
+SRC_URI:append:rcar-gen3 = " \
+ file://kingfisher_output.cfg \
+ file://ebisu_output.cfg \
+ file://salvator-x_output.cfg \
+"
-WESTONV4L2RENDERER[device] ??= "/dev/media0"
-WESTONV4L2RENDERER[device-module] ??= "vsp2"
+WESTON_FRAGMENTS:append:ulcb = " kingfisher_output"
+WESTON_FRAGMENTS:append:ebisu = " ebisu_output"
+WESTON_FRAGMENTS:append:salvator-x = " salvator-x_output"
-python() {
- if "multimedia" in d.getVar("MACHINE_FEATURES", True).split(" "):
- d.setVarFlag("WESTONSECTION", "WESTONV4L2RENDERER", "v4l2-renderer")
+do_configure:append:rcar-gen3() {
+ echo repaint-window=34 >> ${WORKDIR}/core.cfg
}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg
new file mode 100644
index 000000000..2bca54f02
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/ebisu_output.cfg
@@ -0,0 +1,11 @@
+[output]
+name=HDMI-A-2
+mode=off
+
+[output]
+name=LVDS-1
+mode=off
+
+[output]
+name=VGA-1
+mode=off
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg
new file mode 100644
index 000000000..99fde3063
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/kingfisher_output.cfg
@@ -0,0 +1,7 @@
+[output]
+name=HDMI-A-2
+mode=off
+
+[output]
+name=LVDS-1
+mode=off
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg
new file mode 100644
index 000000000..7359e6ec9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston-ini-conf/salvator-x_output.cfg
@@ -0,0 +1,12 @@
+[output]
+name=HDMI-A-2
+mode=off
+
+[output]
+name=LVDS-1
+mode=off
+
+[output]
+name=VGA-1
+mode=off
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
deleted file mode 100644
index 079ff496a..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
-FILES_${PN}_append_rcar-gen3 = " \
- ${libexecdir}/weston-screenshooter \
- ${libexecdir}/weston-ivi-shell-user-interface \
- ${libexecdir}/weston-keyboard \
- ${libexecdir}/weston-simple-im \
- ${libexecdir}/weston-desktop-shell \
-"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc
new file mode 120000
index 000000000..8c7e36ff9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control.inc
@@ -0,0 +1 @@
+../../include/checksum_control.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc
new file mode 120000
index 000000000..ff4e9a898
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/checksum_control_files.inc
@@ -0,0 +1 @@
+../../include/checksum_control_files.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend
index 8a4176fc1..b8882ae49 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles.bbappend
@@ -1,4 +1,6 @@
-module_do_compile_prepend() {
+require checksum_control.inc
+
+module_do_compile:prepend() {
cd ${S}/build/linux/config/compilers
- cp aarch64-poky-linux.mk ${TARGET_SYS}.mk
+ cp aarch64-linux-gnu.mk ${TARGET_SYS}.mk
}
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend
index 13163e495..98b8e92c3 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngr.bbappend
@@ -1 +1,2 @@
-KERNEL_MODULE_AUTOLOAD = "mmngr"
+KERNEL_MODULE_AUTOLOAD:append = " mmngr"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend
index 1587b25b6..fbff56fff 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-mmngr/kernel-module-mmngrbuf.bbappend
@@ -1 +1,2 @@
-KERNEL_MODULE_AUTOLOAD = "mmngrbuf"
+KERNEL_MODULE_AUTOLOAD:append = " mmngrbuf"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc
new file mode 120000
index 000000000..8c7e36ff9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control.inc
@@ -0,0 +1 @@
+../../include/checksum_control.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc
new file mode 120000
index 000000000..ff4e9a898
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/checksum_control_files.inc
@@ -0,0 +1 @@
+../../include/checksum_control_files.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend
index f1450747e..1fa00a859 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-uvcs/kernel-module-uvcs-drv.bbappend
@@ -1 +1,3 @@
+require checksum_control.inc
+
KERNEL_MODULE_AUTOLOAD = "uvcs_drv"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend
new file mode 100644
index 000000000..5efe01045
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspm-if.bbappend
@@ -0,0 +1,2 @@
+KERNEL_MODULE_AUTOLOAD:append = " vspm_if"
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend
deleted file mode 100644
index 098e1b0a9..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/kernel-module-vspmif/kernel-module-vspmif.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-KERNEL_MODULE_AUTOLOAD = "vspm_if"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch
deleted file mode 100644
index 08a4ec717..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0001-mm-larger-stack-guard-gap-between-vmas.patch
+++ /dev/null
@@ -1,935 +0,0 @@
-From 0f637a08fa3b048f1e0b0d3dc8f5cb9df3368b5d Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Mon, 19 Jun 2017 04:03:24 -0700
-Subject: [PATCH 1/3] mm: larger stack guard gap, between vmas
-
-commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream.
-
-Stack guard page is a useful feature to reduce a risk of stack smashing
-into a different mapping. We have been using a single page gap which
-is sufficient to prevent having stack adjacent to a different mapping.
-But this seems to be insufficient in the light of the stack usage in
-userspace. E.g. glibc uses as large as 64kB alloca() in many commonly
-used functions. Others use constructs liks gid_t buffer[NGROUPS_MAX]
-which is 256kB or stack strings with MAX_ARG_STRLEN.
-
-This will become especially dangerous for suid binaries and the default
-no limit for the stack size limit because those applications can be
-tricked to consume a large portion of the stack and a single glibc call
-could jump over the guard page. These attacks are not theoretical,
-unfortunatelly.
-
-Make those attacks less probable by increasing the stack guard gap
-to 1MB (on systems with 4k pages; but make it depend on the page size
-because systems with larger base pages might cap stack allocations in
-the PAGE_SIZE units) which should cover larger alloca() and VLA stack
-allocations. It is obviously not a full fix because the problem is
-somehow inherent, but it should reduce attack space a lot.
-
-One could argue that the gap size should be configurable from userspace,
-but that can be done later when somebody finds that the new 1MB is wrong
-for some special case applications. For now, add a kernel command line
-option (stack_guard_gap) to specify the stack gap size (in page units).
-
-Implementation wise, first delete all the old code for stack guard page:
-because although we could get away with accounting one extra page in a
-stack vma, accounting a larger gap can break userspace - case in point,
-a program run with "ulimit -S -v 20000" failed when the 1MB gap was
-counted for RLIMIT_AS; similar problems could come with RLIMIT_MLOCK
-and strict non-overcommit mode.
-
-Instead of keeping gap inside the stack vma, maintain the stack guard
-gap as a gap between vmas: using vm_start_gap() in place of vm_start
-(or vm_end_gap() in place of vm_end if VM_GROWSUP) in just those few
-places which need to respect the gap - mainly arch_get_unmapped_area(),
-and and the vma tree's subtree_gap support for that.
-
-Original-patch-by: Oleg Nesterov <oleg@redhat.com>
-Original-patch-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Tested-by: Helge Deller <deller@gmx.de> # parisc
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-[wt: backport to 4.11: adjust context]
-[wt: backport to 4.9: adjust context ; kernel doc was not in admin-guide]
-Signed-off-by: Willy Tarreau <w@1wt.eu>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- Documentation/kernel-parameters.txt | 7 ++
- arch/arc/mm/mmap.c | 2 +-
- arch/arm/mm/mmap.c | 4 +-
- arch/frv/mm/elf-fdpic.c | 2 +-
- arch/mips/mm/mmap.c | 2 +-
- arch/parisc/kernel/sys_parisc.c | 15 ++--
- arch/powerpc/mm/hugetlbpage-radix.c | 2 +-
- arch/powerpc/mm/mmap.c | 4 +-
- arch/powerpc/mm/slice.c | 2 +-
- arch/s390/mm/mmap.c | 4 +-
- arch/sh/mm/mmap.c | 4 +-
- arch/sparc/kernel/sys_sparc_64.c | 4 +-
- arch/sparc/mm/hugetlbpage.c | 2 +-
- arch/tile/mm/hugetlbpage.c | 2 +-
- arch/x86/kernel/sys_x86_64.c | 4 +-
- arch/x86/mm/hugetlbpage.c | 2 +-
- arch/xtensa/kernel/syscall.c | 2 +-
- fs/hugetlbfs/inode.c | 2 +-
- fs/proc/task_mmu.c | 4 -
- include/linux/mm.h | 53 ++++++-------
- mm/gup.c | 5 --
- mm/memory.c | 38 ---------
- mm/mmap.c | 149 +++++++++++++++++++++---------------
- 23 files changed, 152 insertions(+), 163 deletions(-)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 38556cd..bf3ecf8 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -3918,6 +3918,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- spia_pedr=
- spia_peddr=
-
-+ stack_guard_gap= [MM]
-+ override the default stack gap protection. The value
-+ is in page units and it defines how many pages prior
-+ to (for stacks growing down) resp. after (for stacks
-+ growing up) the main stack are reserved for no other
-+ mapping. Default value is 256 pages.
-+
- stacktrace [FTRACE]
- Enabled the stack tracer on boot up.
-
-diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c
-index 2e06d56..cf4ae69 100644
---- a/arch/arc/mm/mmap.c
-+++ b/arch/arc/mm/mmap.c
-@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 66353ca..641334e 100644
---- a/arch/arm/mm/mmap.c
-+++ b/arch/arm/mm/mmap.c
-@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
-index 836f147..efa59f1 100644
---- a/arch/frv/mm/elf-fdpic.c
-+++ b/arch/frv/mm/elf-fdpic.c
-@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
- addr = PAGE_ALIGN(addr);
- vma = find_vma(current->mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- goto success;
- }
-
-diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
-index d08ea3f..a44052c 100644
---- a/arch/mips/mm/mmap.c
-+++ b/arch/mips/mm/mmap.c
-@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
-index 0a393a0..1d7691f 100644
---- a/arch/parisc/kernel/sys_parisc.c
-+++ b/arch/parisc/kernel/sys_parisc.c
-@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- unsigned long task_size = TASK_SIZE;
- int do_color_align, last_mmap;
- struct vm_unmapped_area_info info;
-@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- else
- addr = PAGE_ALIGN(addr);
-
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- int do_color_align, last_mmap;
-@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = COLOR_ALIGN(addr, last_mmap, pgoff);
- else
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c
-index 35254a6..a2b2d97 100644
---- a/arch/powerpc/mm/hugetlbpage-radix.c
-+++ b/arch/powerpc/mm/hugetlbpage-radix.c
-@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- /*
-diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
-index 2f1e443..5bc2845 100644
---- a/arch/powerpc/mm/mmap.c
-+++ b/arch/powerpc/mm/mmap.c
-@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index 2b27458..c4d5c9c 100644
---- a/arch/powerpc/mm/slice.c
-+++ b/arch/powerpc/mm/slice.c
-@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
- if ((mm->task_size - len) < addr)
- return 0;
- vma = find_vma(mm, addr);
-- return (!vma || (addr + len) <= vma->vm_start);
-+ return (!vma || (addr + len) <= vm_start_gap(vma));
- }
-
- static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index eb9df28..812368f 100644
---- a/arch/s390/mm/mmap.c
-+++ b/arch/s390/mm/mmap.c
-@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
-index 6777177..7df7d59 100644
---- a/arch/sh/mm/mmap.c
-+++ b/arch/sh/mm/mmap.c
-@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index fe8b8ee..02e05e2 100644
---- a/arch/sparc/kernel/sys_sparc_64.c
-+++ b/arch/sparc/kernel/sys_sparc_64.c
-@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
-index 988acc8..58cde8d 100644
---- a/arch/sparc/mm/hugetlbpage.c
-+++ b/arch/sparc/mm/hugetlbpage.c
-@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, HPAGE_SIZE);
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
-index 77ceaa3..67508b2 100644
---- a/arch/tile/mm/hugetlbpage.c
-+++ b/arch/tile/mm/hugetlbpage.c
-@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (current->mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index a55ed63..1119414 100644
---- a/arch/x86/kernel/sys_x86_64.c
-+++ b/arch/x86/kernel/sys_x86_64.c
-@@ -140,7 +140,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (end - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
-index 2ae8584..fe342e8 100644
---- a/arch/x86/mm/hugetlbpage.c
-+++ b/arch/x86/mm/hugetlbpage.c
-@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c
-index 83cf496..3aaaae1 100644
---- a/arch/xtensa/kernel/syscall.c
-+++ b/arch/xtensa/kernel/syscall.c
-@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- /* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_SIZE - len < addr)
- return -ENOMEM;
-- if (!vmm || addr + len <= vmm->vm_start)
-+ if (!vmm || addr + len <= vm_start_gap(vmm))
- return addr;
- addr = vmm->vm_end;
- if (flags & MAP_SHARED)
-diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index 4fb7b10..704fa0b 100644
---- a/fs/hugetlbfs/inode.c
-+++ b/fs/hugetlbfs/inode.c
-@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 35b92d8..c5f2136 100644
---- a/fs/proc/task_mmu.c
-+++ b/fs/proc/task_mmu.c
-@@ -299,11 +299,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
-
- /* We don't show the stack guard page in /proc/maps */
- start = vma->vm_start;
-- if (stack_guard_page_start(vma, start))
-- start += PAGE_SIZE;
- end = vma->vm_end;
-- if (stack_guard_page_end(vma, end))
-- end -= PAGE_SIZE;
-
- seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
- seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
-diff --git a/include/linux/mm.h b/include/linux/mm.h
-index a92c8d7..451251b 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1354,39 +1354,11 @@ int clear_page_dirty_for_io(struct page *page);
-
- int get_cmdline(struct task_struct *task, char *buffer, int buflen);
-
--/* Is the vma a continuation of the stack vma above it? */
--static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
--}
--
- static inline bool vma_is_anonymous(struct vm_area_struct *vma)
- {
- return !vma->vm_ops;
- }
-
--static inline int stack_guard_page_start(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSDOWN) &&
-- (vma->vm_start == addr) &&
-- !vma_growsdown(vma->vm_prev, addr);
--}
--
--/* Is the vma a continuation of the stack vma below it? */
--static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP);
--}
--
--static inline int stack_guard_page_end(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSUP) &&
-- (vma->vm_end == addr) &&
-- !vma_growsup(vma->vm_next, addr);
--}
--
- int vma_is_stack_for_current(struct vm_area_struct *vma);
-
- extern unsigned long move_page_tables(struct vm_area_struct *vma,
-@@ -2125,6 +2097,7 @@ void page_cache_async_readahead(struct address_space *mapping,
- pgoff_t offset,
- unsigned long size);
-
-+extern unsigned long stack_guard_gap;
- /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
- extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
-
-@@ -2153,6 +2126,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
- return vma;
- }
-
-+static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_start = vma->vm_start;
-+
-+ if (vma->vm_flags & VM_GROWSDOWN) {
-+ vm_start -= stack_guard_gap;
-+ if (vm_start > vma->vm_start)
-+ vm_start = 0;
-+ }
-+ return vm_start;
-+}
-+
-+static inline unsigned long vm_end_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_end = vma->vm_end;
-+
-+ if (vma->vm_flags & VM_GROWSUP) {
-+ vm_end += stack_guard_gap;
-+ if (vm_end < vma->vm_end)
-+ vm_end = -PAGE_SIZE;
-+ }
-+ return vm_end;
-+}
-+
- static inline unsigned long vma_pages(struct vm_area_struct *vma)
- {
- return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-diff --git a/mm/gup.c b/mm/gup.c
-index ec4f827..c63a034 100644
---- a/mm/gup.c
-+++ b/mm/gup.c
-@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
- /* mlock all present pages, but do not fault in new pages */
- if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK)
- return -ENOENT;
-- /* For mm_populate(), just skip the stack guard page. */
-- if ((*flags & FOLL_POPULATE) &&
-- (stack_guard_page_start(vma, address) ||
-- stack_guard_page_end(vma, address + PAGE_SIZE)))
-- return -ENOENT;
- if (*flags & FOLL_WRITE)
- fault_flags |= FAULT_FLAG_WRITE;
- if (*flags & FOLL_REMOTE)
-diff --git a/mm/memory.c b/mm/memory.c
-index e18c57b..2868911 100644
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -2699,40 +2699,6 @@ int do_swap_page(struct fault_env *fe, pte_t orig_pte)
- }
-
- /*
-- * This is like a special single-page "expand_{down|up}wards()",
-- * except we must first make sure that 'address{-|+}PAGE_SIZE'
-- * doesn't hit another vma.
-- */
--static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
--{
-- address &= PAGE_MASK;
-- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
-- struct vm_area_struct *prev = vma->vm_prev;
--
-- /*
-- * Is there a mapping abutting this one below?
-- *
-- * That's only ok if it's the same stack mapping
-- * that has gotten split..
-- */
-- if (prev && prev->vm_end == address)
-- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
--
-- return expand_downwards(vma, address - PAGE_SIZE);
-- }
-- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
-- struct vm_area_struct *next = vma->vm_next;
--
-- /* As VM_GROWSDOWN but s/below/above/ */
-- if (next && next->vm_start == address + PAGE_SIZE)
-- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
--
-- return expand_upwards(vma, address + PAGE_SIZE);
-- }
-- return 0;
--}
--
--/*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2748,10 +2714,6 @@ static int do_anonymous_page(struct fault_env *fe)
- if (vma->vm_flags & VM_SHARED)
- return VM_FAULT_SIGBUS;
-
-- /* Check if we need to add a guard page to the stack */
-- if (check_stack_guard_page(vma, fe->address) < 0)
-- return VM_FAULT_SIGSEGV;
--
- /*
- * Use pte_alloc() instead of pte_alloc_map(). We can't run
- * pte_offset_map() on pmds where a huge pmd might be created
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 1af87c1..26542b3 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -183,6 +183,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- unsigned long retval;
- unsigned long newbrk, oldbrk;
- struct mm_struct *mm = current->mm;
-+ struct vm_area_struct *next;
- unsigned long min_brk;
- bool populate;
-
-@@ -228,7 +229,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- }
-
- /* Check against existing mmap mappings. */
-- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE))
-+ next = find_vma(mm, oldbrk);
-+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next))
- goto out;
-
- /* Ok, looks good - let it rip. */
-@@ -251,10 +253,22 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
-
- static long vma_compute_subtree_gap(struct vm_area_struct *vma)
- {
-- unsigned long max, subtree_gap;
-- max = vma->vm_start;
-- if (vma->vm_prev)
-- max -= vma->vm_prev->vm_end;
-+ unsigned long max, prev_end, subtree_gap;
-+
-+ /*
-+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we
-+ * allow two stack_guard_gaps between them here, and when choosing
-+ * an unmapped area; whereas when expanding we only require one.
-+ * That's a little inconsistent, but keeps the code here simpler.
-+ */
-+ max = vm_start_gap(vma);
-+ if (vma->vm_prev) {
-+ prev_end = vm_end_gap(vma->vm_prev);
-+ if (max > prev_end)
-+ max -= prev_end;
-+ else
-+ max = 0;
-+ }
- if (vma->vm_rb.rb_left) {
- subtree_gap = rb_entry(vma->vm_rb.rb_left,
- struct vm_area_struct, vm_rb)->rb_subtree_gap;
-@@ -350,7 +364,7 @@ static void validate_mm(struct mm_struct *mm)
- anon_vma_unlock_read(anon_vma);
- }
-
-- highest_address = vma->vm_end;
-+ highest_address = vm_end_gap(vma);
- vma = vma->vm_next;
- i++;
- }
-@@ -539,7 +553,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = vma->vm_end;
-+ mm->highest_vm_end = vm_end_gap(vma);
-
- /*
- * vma->vm_prev wasn't known when we followed the rbtree to find the
-@@ -854,7 +868,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
- vma_gap_update(vma);
- if (end_changed) {
- if (!next)
-- mm->highest_vm_end = end;
-+ mm->highest_vm_end = vm_end_gap(vma);
- else if (!adjust_next)
- vma_gap_update(next);
- }
-@@ -939,7 +953,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
- * mm->highest_vm_end doesn't need any update
- * in remove_next == 1 case.
- */
-- VM_WARN_ON(mm->highest_vm_end != end);
-+ VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
- }
- }
- if (insert && file)
-@@ -1783,7 +1797,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit left subtree if it looks promising */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end >= low_limit && vma->vm_rb.rb_left) {
- struct vm_area_struct *left =
- rb_entry(vma->vm_rb.rb_left,
-@@ -1794,7 +1808,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- }
- }
-
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- check_current:
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
-@@ -1821,8 +1835,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- vma = rb_entry(rb_parent(prev),
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_left) {
-- gap_start = vma->vm_prev->vm_end;
-- gap_end = vma->vm_start;
-+ gap_start = vm_end_gap(vma->vm_prev);
-+ gap_end = vm_start_gap(vma);
- goto check_current;
- }
- }
-@@ -1886,7 +1900,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit right subtree if it looks promising */
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- if (gap_start <= high_limit && vma->vm_rb.rb_right) {
- struct vm_area_struct *right =
- rb_entry(vma->vm_rb.rb_right,
-@@ -1899,7 +1913,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- check_current:
- /* Check if current node has a suitable gap */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
- if (gap_start <= high_limit && gap_end - gap_start >= length)
-@@ -1925,7 +1939,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_right) {
- gap_start = vma->vm_prev ?
-- vma->vm_prev->vm_end : 0;
-+ vm_end_gap(vma->vm_prev) : 0;
- goto check_current;
- }
- }
-@@ -1963,7 +1977,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct vm_unmapped_area_info info;
-
- if (len > TASK_SIZE - mmap_min_addr)
-@@ -1974,9 +1988,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -1999,7 +2014,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- struct vm_unmapped_area_info info;
-@@ -2014,9 +2029,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- /* requesting a specific address */
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -2151,21 +2167,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
- * update accounting. This is shared with both the
- * grow-up and grow-down cases.
- */
--static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow)
-+static int acct_stack_growth(struct vm_area_struct *vma,
-+ unsigned long size, unsigned long grow)
- {
- struct mm_struct *mm = vma->vm_mm;
- struct rlimit *rlim = current->signal->rlim;
-- unsigned long new_start, actual_size;
-+ unsigned long new_start;
-
- /* address space limit tests */
- if (!may_expand_vm(mm, vma->vm_flags, grow))
- return -ENOMEM;
-
- /* Stack limit test */
-- actual_size = size;
-- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
-- actual_size -= PAGE_SIZE;
-- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
-+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
- return -ENOMEM;
-
- /* mlock limit tests */
-@@ -2203,17 +2217,30 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
- int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *next;
-+ unsigned long gap_addr;
- int error = 0;
-
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
- /* Guard against wrapping around to address 0. */
-- if (address < PAGE_ALIGN(address+4))
-- address = PAGE_ALIGN(address+4);
-- else
-+ address &= PAGE_MASK;
-+ address += PAGE_SIZE;
-+ if (!address)
- return -ENOMEM;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address + stack_guard_gap;
-+ if (gap_addr < address)
-+ return -ENOMEM;
-+ next = vma->vm_next;
-+ if (next && next->vm_start < gap_addr) {
-+ if (!(next->vm_flags & VM_GROWSUP))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2257,7 +2284,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = address;
-+ mm->highest_vm_end = vm_end_gap(vma);
- spin_unlock(&mm->page_table_lock);
-
- perf_event_mmap(vma);
-@@ -2278,6 +2305,8 @@ int expand_downwards(struct vm_area_struct *vma,
- unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *prev;
-+ unsigned long gap_addr;
- int error;
-
- address &= PAGE_MASK;
-@@ -2285,6 +2314,17 @@ int expand_downwards(struct vm_area_struct *vma,
- if (error)
- return error;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address - stack_guard_gap;
-+ if (gap_addr > address)
-+ return -ENOMEM;
-+ prev = vma->vm_prev;
-+ if (prev && prev->vm_end > gap_addr) {
-+ if (!(prev->vm_flags & VM_GROWSDOWN))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2339,28 +2379,25 @@ int expand_downwards(struct vm_area_struct *vma,
- return error;
- }
-
--/*
-- * Note how expand_stack() refuses to expand the stack all the way to
-- * abut the next virtual mapping, *unless* that mapping itself is also
-- * a stack mapping. We want to leave room for a guard page, after all
-- * (the guard page itself is not added here, that is done by the
-- * actual page faulting logic)
-- *
-- * This matches the behavior of the guard page logic (see mm/memory.c:
-- * check_stack_guard_page()), which only allows the guard page to be
-- * removed under these circumstances.
-- */
-+/* enforced gap between the expanding stack and other mappings. */
-+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT;
-+
-+static int __init cmdline_parse_stack_guard_gap(char *p)
-+{
-+ unsigned long val;
-+ char *endptr;
-+
-+ val = simple_strtoul(p, &endptr, 10);
-+ if (!*endptr)
-+ stack_guard_gap = val << PAGE_SHIFT;
-+
-+ return 0;
-+}
-+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap);
-+
- #ifdef CONFIG_STACK_GROWSUP
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *next;
--
-- address &= PAGE_MASK;
-- next = vma->vm_next;
-- if (next && next->vm_start == address + PAGE_SIZE) {
-- if (!(next->vm_flags & VM_GROWSUP))
-- return -ENOMEM;
-- }
- return expand_upwards(vma, address);
- }
-
-@@ -2382,14 +2419,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
- #else
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *prev;
--
-- address &= PAGE_MASK;
-- prev = vma->vm_prev;
-- if (prev && prev->vm_end == address) {
-- if (!(prev->vm_flags & VM_GROWSDOWN))
-- return -ENOMEM;
-- }
- return expand_downwards(vma, address);
- }
-
-@@ -2487,7 +2516,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
- vma->vm_prev = prev;
- vma_gap_update(vma);
- } else
-- mm->highest_vm_end = prev ? prev->vm_end : 0;
-+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0;
- tail_vma->vm_next = NULL;
-
- /* Kill the cache */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
deleted file mode 100644
index 10e247197..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0002-Allow-stack-to-grow-up-to-address-space-limit.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 9e8b9c4bd3b16bd70d8be10c465bd0a91ac569fa Mon Sep 17 00:00:00 2001
-From: Helge Deller <deller@gmx.de>
-Date: Mon, 19 Jun 2017 17:34:05 +0200
-Subject: [PATCH 2/3] Allow stack to grow up to address space limit
-
-commit bd726c90b6b8ce87602208701b208a208e6d5600 upstream.
-
-Fix expand_upwards() on architectures with an upward-growing stack (parisc,
-metag and partly IA-64) to allow the stack to reliably grow exactly up to
-the address space limit given by TASK_SIZE.
-
-Signed-off-by: Helge Deller <deller@gmx.de>
-Acked-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 26542b3..d71a61e 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -2224,16 +2224,19 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
-- /* Guard against wrapping around to address 0. */
-+ /* Guard against exceeding limits of the address space. */
- address &= PAGE_MASK;
-- address += PAGE_SIZE;
-- if (!address)
-+ if (address >= TASK_SIZE)
- return -ENOMEM;
-+ address += PAGE_SIZE;
-
- /* Enforce stack_guard_gap */
- gap_addr = address + stack_guard_gap;
-- if (gap_addr < address)
-- return -ENOMEM;
-+
-+ /* Guard against overflow */
-+ if (gap_addr < address || gap_addr > TASK_SIZE)
-+ gap_addr = TASK_SIZE;
-+
- next = vma->vm_next;
- if (next && next->vm_start < gap_addr) {
- if (!(next->vm_flags & VM_GROWSUP))
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
deleted file mode 100644
index cb6614964..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0003-mm-fix-new-crash-in-unmapped_area_topdown.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 6c98443e18289db3ff9afb68575a607cea468ae0 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Tue, 20 Jun 2017 02:10:44 -0700
-Subject: [PATCH 3/3] mm: fix new crash in unmapped_area_topdown()
-
-commit f4cb767d76cf7ee72f97dd76f6cfa6c76a5edc89 upstream.
-
-Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of
-mmap testing. That's the VM_BUG_ON(gap_end < gap_start) at the
-end of unmapped_area_topdown(). Linus points out how MAP_FIXED
-(which does not have to respect our stack guard gap intentions)
-could result in gap_end below gap_start there. Fix that, and
-the similar case in its alternative, unmapped_area().
-
-Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
-Reported-by: Dave Jones <davej@codemonkey.org.uk>
-Debugged-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Michal Hocko <mhocko@suse.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/mmap.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/mm/mmap.c b/mm/mmap.c
-index d71a61e..145d3d5 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -1813,7 +1813,8 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
- return -ENOMEM;
-- if (gap_end >= low_limit && gap_end - gap_start >= length)
-+ if (gap_end >= low_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit right subtree if it looks promising */
-@@ -1916,7 +1917,8 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
- gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
-- if (gap_start <= high_limit && gap_end - gap_start >= length)
-+ if (gap_start <= high_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit left subtree if it looks promising */
---
-2.1.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
new file mode 100644
index 000000000..9c7f01b26
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
@@ -0,0 +1,158 @@
+From 274657edb779d77ad0fe5ccb52b51634d075adf8 Mon Sep 17 00:00:00 2001
+From: invalid_git config <unknown@unknown>
+Date: Wed, 6 Oct 2021 14:42:47 +0000
+Subject: [PATCH 2/2] The ADSP on Renesas SoCs required a reserved memory area
+ to become enabled, and this needs to be done manually.
+
+This patch adds sound hardware abstraction information for the m3ulcb
+and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the
+ADSP for dynamically determining sound hardware at runtime, allowing
+single binaries to be used between the two boards.
+
+Future work will incorporate the h3ulcb and Salvator boards into the
+abstraction.
+
+Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
+---
+ arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts | 45 ++++++++++++++++++-
+ arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts | 45 ++++++++++++++++++-
+ 2 files changed, 88 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
+index fbc8c9af6e52..df3bd589d9bb 100644
+--- a/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
++++ b/arch/arm64/boot/dts/renesas/r8a77960-ulcb.dts
+@@ -62,11 +62,18 @@ lossy_decompress: linux,lossy_decompress@54000000 {
+ reg = <0x00000000 0x54000000 0x0 0x03000000>;
+ };
+
++ /* For Audio DSP */
++ adsp_reserved: linux,adsp {
++ compatible = "shared-dma-pool";
++ reusable;
++ reg = <0x00000000 0x57000000 0x0 0x01000000>;
++ };
++
+ /* global autoconfigured region for contiguous allocations */
+ linux,cma@57000000 {
+ compatible = "shared-dma-pool";
+ reusable;
+- reg = <0x00000000 0x57000000 0x0 0x19000000>;
++ reg = <0x00000000 0x58000000 0x0 0x18000000>;
+ linux,cma-default;
+ };
+
+@@ -126,6 +133,42 @@ &du {
+ "dclkin.0", "dclkin.1", "dclkin.2";
+ };
+
++&adsp {
++ status = "okay";
++ clock-frequency = <12288000 11289600>;
++ audio-clocks = <22579200 24576000>;
++ memory-region = <&adsp_reserved>;
++
++ /* ADSP playback setting for ak4613 */
++ adsp_playback0: adsp,playback {
++ mode = "i2s";
++ clock-mode = "master";
++ bus-width = <16>;
++ ssi = <0>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <1>;
++ };
++
++ /* ADSP capture setting for ak4613 */
++ adsp_capture0: adsp,capture {
++ mode = "i2s";
++ clock-mode = "slave";
++ bus-width = <16>;
++ ssi = <1>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <0>;
++ };
++
++ adsp,ports {
++ port@0 {
++ playback = <&adsp_playback0>;
++ capture = <&adsp_capture0>;
++ };
++ };
++};
++
+ &vspb {
+ status = "okay";
+ };
+diff --git a/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
+index e57dd7bb43f7..f583cc6c18bf 100644
+--- a/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
++++ b/arch/arm64/boot/dts/renesas/r8a77961-ulcb.dts
+@@ -41,11 +41,18 @@ lossy_decompress: linux,lossy_decompress@54000000 {
+ reg = <0x00000000 0x54000000 0x0 0x03000000>;
+ };
+
++ /* For Audio DSP */
++ adsp_reserved: linux,adsp {
++ compatible = "shared-dma-pool";
++ reusable;
++ reg = <0x00000000 0x57000000 0x0 0x01000000>;
++ };
++
+ /* global autoconfigured region for contiguous allocations */
+ linux,cma@57000000 {
+ compatible = "shared-dma-pool";
+ reusable;
+- reg = <0x00000000 0x57000000 0x0 0x19000000>;
++ reg = <0x00000000 0x58000000 0x0 0x18000000>;
+ linux,cma-default;
+ };
+
+@@ -89,6 +96,42 @@ &du {
+ "dclkin.0", "dclkin.1", "dclkin.2";
+ };
+
++&adsp {
++ status = "okay";
++ clock-frequency = <12288000 11289600>;
++ audio-clocks = <22579200 24576000>;
++ memory-region = <&adsp_reserved>;
++
++ /* ADSP playback setting for ak4613 */
++ adsp_playback0: adsp,playback {
++ mode = "i2s";
++ clock-mode = "master";
++ bus-width = <16>;
++ ssi = <0>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <1>;
++ };
++
++ /* ADSP capture setting for ak4613 */
++ adsp_capture0: adsp,capture {
++ mode = "i2s";
++ clock-mode = "slave";
++ bus-width = <16>;
++ ssi = <1>;
++ bus-if = <0>;
++ channels = <2>;
++ pin-share-ssi = <0>;
++ };
++
++ adsp,ports {
++ port@0 {
++ playback = <&adsp_playback0>;
++ capture = <&adsp_capture0>;
++ };
++ };
++};
++
+ &vspb {
+ status = "okay";
+ };
+--
+2.31.1
+
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index a1eeac3d7..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index cf8a93f..21651bc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg
new file mode 100644
index 000000000..b020174e8
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/Set_GOV_PERFORMANCE.cfg
@@ -0,0 +1,2 @@
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg
deleted file mode 100644
index dd7c460bb..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/bluetooth.cfg
+++ /dev/null
@@ -1,37 +0,0 @@
-CONFIG_BT=m
-CONFIG_BT_BREDR=y
-CONFIG_BT_RFCOMM=m
-CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=m
-CONFIG_BT_BNEP_MC_FILTER=y
-CONFIG_BT_BNEP_PROTO_FILTER=y
-CONFIG_BT_HIDP=m
-CONFIG_BT_HS=y
-CONFIG_BT_LE=y
-CONFIG_BT_LEDS=y
-# CONFIG_BT_SELFTEST is not set
-CONFIG_BT_DEBUGFS=y
-
-#
-# Bluetooth device drivers
-#
-CONFIG_BT_INTEL=m
-CONFIG_BT_BCM=m
-CONFIG_BT_RTL=m
-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBTUSB_BCM=y
-CONFIG_BT_HCIBTUSB_RTL=y
-# CONFIG_BT_HCIBTSDIO is not set
-# CONFIG_BT_HCIUART is not set
-CONFIG_BT_HCIBCM203X=m
-CONFIG_BT_HCIBFUSB=m
-# CONFIG_BT_HCIVHCI is not set
-# CONFIG_BT_MRVL is not set
-# CONFIG_BT_ATH3K is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CMAC=m
-
-#
-# Bluetooth AVRCP support
-#
-CONFIG_INPUT_UINPUT=y
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg
deleted file mode 100644
index bc5299acd..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/disable_ipv6.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-# CONFIG_NET_IP_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
-# CONFIG_IPV6 is not set
-# CONFIG_DST_CACHE is not set
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg
deleted file mode 100644
index af37685e4..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/nbd.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_BLK_DEV_NBD=y
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts
new file mode 100644
index 000000000..6947a62c2
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/r8a77960-ulcb-xen.dts
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the M3ULCB (R-Car Starter Kit Pro) board
+ *
+ * Copyright (C) 2016-2018 Renesas Electronics Corp.
+ * Copyright (C) 2016 Cogent Embedded, Inc.
+ */
+
+/dts-v1/;
+#include "r8a77960.dtsi"
+#include "ulcb.dtsi"
+
+/ {
+ model = "Renesas M3ULCB board based on r8a7796";
+ compatible = "renesas,m3ulcb", "renesas,r8a7796";
+
+
+ chosen {
+ /delete-property/ bootargs;
+ xen,xen-bootargs = "dom0_mem=752M console=dtuart dtuart=serial0 dom0_max_vcpus=4";
+ xen,dom0-bootargs = "console=hvc0 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait ignore_loglevel cma=32M earlyprintk";
+
+ #address-cells = <2>;
+ #size-cells = <2>;
+ modules {
+ module@0 {
+ compatible = "xen,linux-zimage",
+ "xen,multiboot-module";
+ reg = <0x0 0x7a000000 0x0 0x02000000>;
+ };
+ };
+ };
+
+ cpus {
+ idle-states {
+ /delete-node/ cpu-sleep-1;
+ };
+ };
+
+ memory@48000000 {
+ device_type = "memory";
+ /* first 128MB is reserved for secure area. */
+ reg = <0x0 0x48000000 0x0 0x38000000>, <0x6 0x00000000 0x0 0x40000000>;
+ };
+
+ vspm_if {
+ compatible = "renesas,vspm_if";
+ };
+
+ versaclock5_out3: versaclk-3 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ /* Initial value of versaclock out3 */
+ clock-frequency = <33000000>;
+ };
+};
+
+&a53_0 {
+ /delete-property/ cpu-idle-states;
+};
+
+&a53_1 {
+ /delete-property/ cpu-idle-states;
+};
+
+&a53_2 {
+ /delete-property/ cpu-idle-states;
+};
+
+&a53_3 {
+ /delete-property/ cpu-idle-states;
+};
+
+&du {
+ clocks = <&cpg CPG_MOD 724>,
+ <&cpg CPG_MOD 723>,
+ <&cpg CPG_MOD 722>,
+ <&versaclock5 1>,
+ <&versaclock5_out3>,
+ <&versaclock5 2>;
+ clock-names = "du.0", "du.1", "du.2",
+ "dclkin.0", "dclkin.1", "dclkin.2";
+};
+
+&vspb {
+ status = "okay";
+};
+
+&vspi0 {
+ status = "okay";
+};
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg
deleted file mode 100644
index 41530dd6e..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/ramdisk.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_BLK_DEV_RAM=y
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg
new file mode 100644
index 000000000..3c3574346
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/vivid.cfg
@@ -0,0 +1,6 @@
+CONFIG_V4L_TEST_DRIVERS=y
+CONFIG_MEDIA_CONTROLLER_REQUEST_API=y
+CONFIG_MEDIA_TEST_SUPPORT=y
+CONFIG_VIDEO_V4L2_TPG=m
+CONFIG_VIDEO_VIVID=m
+CONFIG_VIDEO_VIVID_MAX_DEVS=64
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg
new file mode 100644
index 000000000..c9fc6d756
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/xen-be.cfg
@@ -0,0 +1 @@
+CONFIG_XEN_BLKDEV_BACKEND=y
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend
index 44f802218..78996bf0a 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_%.bbappend
@@ -1,8 +1,24 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI_append = " file://namespace_fix.cfg \
- file://nbd.cfg \
- file://ramdisk.cfg \
- file://bluetooth.cfg \
- file://disable_ipv6.cfg \
- "
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+require recipes-kernel/linux/linux-yocto-agl.inc
+
+# Add ADSP patch to enable and add sound hardware abstraction
+SRC_URI:append = " \
+ file://0004-ADSP-enable-and-add-sound-hardware-abstraction.patch \
+"
+
+AGL_KCONFIG_FRAGMENTS += "namespace_fix.cfg"
+AGL_KCONFIG_FRAGMENTS += "Set_GOV_PERFORMANCE.cfg"
+AGL_KCONFIG_FRAGMENTS += "vivid.cfg"
+
+# For Xen
+AGL_KCONFIG_FRAGMENTS += " \
+ ${@bb.utils.contains('AGL_XEN_WANTED','1','xen-be.cfg','',d)} \
+"
+
+SRC_URI:append:m3ulcb = " \
+ ${@bb.utils.contains('AGL_XEN_WANTED','1','file://r8a77960-ulcb-xen.dts;subdir=git/arch/${ARCH}/boot/dts/renesas','',d)} \
+"
+KERNEL_DEVICETREE:append:m3ulcb = " \
+ ${@bb.utils.contains('AGL_XEN_WANTED','1','renesas/r8a77960-ulcb-xen.dtb','',d)} \
+"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend
deleted file mode 100644
index 634a91233..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.9.bbappend
+++ /dev/null
@@ -1,18 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
-
-
-#-------------------------------------------------------------------------
-# Fix for CVE-2017-1000364 by backporting the upstream patches.
-
-SRC_URI_append = "\
- file://0001-mm-larger-stack-guard-gap-between-vmas.patch \
- file://0002-Allow-stack-to-grow-up-to-address-space-limit.patch \
- file://0003-mm-fix-new-crash-in-unmapped_area_topdown.patch \
-"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend
new file mode 100644
index 000000000..eee123cf4
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.22.%.bbappend
@@ -0,0 +1,5 @@
+# Enable here for now due to meta-rcar-gen3 bbappends being masked
+# out, can be removed once gstreamer 1.22.x is properly supported
+# there.
+EXTRA_OECONF += "--enable-kms"
+PACKAGECONFIG:append = " kms"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend
new file mode 100644
index 000000000..9d3f5c670
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngr-user-module.bbappend
@@ -0,0 +1,11 @@
+do_install:append() {
+ # Add a rule to ensure the 'video' user has permission to access
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >${D}${sysconfdir}/udev/rules.d/56-rgnmm.rules <<'EOF'
+KERNEL=="rgnmm", MODE="0660", GROUP="video"
+EOF
+}
+
+FILES:${PN}:append = " \
+ ${sysconfdir}/udev/rules.d/*.rules \
+"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend
new file mode 100644
index 000000000..640e52651
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/mmngr-module/mmngrbuf-user-module.bbappend
@@ -0,0 +1,11 @@
+do_install:append() {
+ # Add a rule to ensure the 'video' group has permission to access
+ install -d ${D}${sysconfdir}/udev/rules.d
+ cat >${D}${sysconfdir}/udev/rules.d/56-rgnmmbuf.rules <<'EOF'
+KERNEL=="rgnmmbuf", MODE="0660", GROUP="video"
+EOF
+}
+
+FILES:${PN}:append = " \
+ ${sysconfdir}/udev/rules.d/*.rules \
+"
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc
new file mode 120000
index 000000000..8c7e36ff9
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control.inc
@@ -0,0 +1 @@
+../../include/checksum_control.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc
new file mode 120000
index 000000000..ff4e9a898
--- /dev/null
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/checksum_control_files.inc
@@ -0,0 +1 @@
+../../include/checksum_control_files.inc \ No newline at end of file
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend
index b35c614c3..a712aaa95 100644
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend
+++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/omx-module/omx-user-module.bbappend
@@ -1,3 +1,7 @@
+require checksum_control.inc
+
+PROVIDES += "virtual/libomxil"
+
setup_build_tree() {
for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC}
do
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff
deleted file mode 100644
index e8523df40..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp/disabled_arm_neon_for_0.5.1.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/dsp/dsp.h b/src/dsp/dsp.h
-index 1faac27..8aae380 100644
---- a/src/dsp/dsp.h
-+++ b/src/dsp/dsp.h
-@@ -77,7 +77,7 @@ extern "C" {
- #if (defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON) || \
- defined(__aarch64__) || defined(WEBP_HAVE_NEON)) && \
- !defined(__native_client__)
--#define WEBP_USE_NEON
-+//#define WEBP_USE_NEON
- #endif
-
- #if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM)
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend
deleted file mode 100644
index bfeb4c50b..000000000
--- a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/webp/libwebp_%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-# Add W/A patch for linaro gcc.
-# This patch disabled neon. (undefined #WEBP_USE_NEON)
-
-SRC_URI_append = " file://disabled_arm_neon_for_0.5.1.diff"
-#Remove patch for 0.5.0
-SRC_URI_remove = " file://disabled_arm_neon.diff"
diff --git a/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh b/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
index 8bc2c3574..3e8a2f242 100644
--- a/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
+++ b/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170427.zip"
-ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170427.zip"
+ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20220121.zip"
+ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20220121.zip"
-COPY_SCRIPT="$METADIR/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh"
+COPY_SCRIPT="$METADIR/bsp/meta-renesas/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh"
test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
@@ -12,14 +12,18 @@ EXTRACT_DIR=$METADIR/binary-tmp
stdout_in_terminal=1
[[ -t 1 ]] && stdout_in_terminal=1
function color {
- [[ $stdout_in_terminal == 0 ]] && return
- for k in $*; do
- case $k in
- bold) tput bold 2>/dev/null;;
- none) tput sgr0 2>/dev/null;;
- *) tput setaf $k 2>/dev/null;;
- esac
- done
+ [[ $stdout_in_terminal == 0 ]] && return
+ for k in $*; do
+ case $k in
+ bold) tput bold;;
+ none) tput sgr0;;
+ *) tput setaf $k;;
+ esac
+ if [[ $? != 0 ]]; then
+ echo "tput: terminal doesn't support color settings, continuing" >&2
+ true
+ fi
+ done
}
color_green=$(color bold 2)
color_yellow=$(color bold 3)
@@ -27,38 +31,54 @@ color_red=$(color bold 1)
color_none=$(color none)
function error() {
- echo "${color_red}$@${color_none}" >&2
+ echo "${color_red}$@${color_none}" >&2
}
function log() {
- echo "$@" >&2
+ echo "$@" >&2
}
function copy_mm_packages() {
- if [ -f $DOWNLOAD_DIR/$ZIP_1 -a -f $DOWNLOAD_DIR/$ZIP_2 ]; then
- mkdir -p $EXTRACT_DIR
- cp --update $DOWNLOAD_DIR/$ZIP_1 $EXTRACT_DIR
- cp --update $DOWNLOAD_DIR/$ZIP_2 $EXTRACT_DIR
- else
- error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_1+"\" NOT EXTRACTING CORRECTLY"
- error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_2+"\" NOT EXTRACTING CORRECTLY"
- log "The graphics and multimedia acceleration packages for "
- log "the R-Car Gen3 board BSP 2.19 can be downloaded from:"
- log " <https://www.renesas.com/solutions/automotive/rcar-demoboard.html>"
- log
- error "These 2 files from there should be stored in your"
- error "'$DOWNLOAD_DIR' directory."
- error " $ZIP_1"
- error " $ZIP_2"
- return 1
+ # first clean up workdir on need
+ if [ -d $EXTRACT_DIR ]; then
+ if [ -f $EXTRACT_DIR/$ZIP_1 -a -f $EXTRACT_DIR/$ZIP_2 ]; then
+ log "The graphics and multimedia acceleration packages for R-Car Gen3 look already installed."
+ log "To force their reinstallation, please, remove manually the directory:"
+ log " $EXTRACT_DIR"
+ log
+ return 0
fi
+ rm -r $EXTRACT_DIR
+ fi
+ if [ -f $DOWNLOAD_DIR/$ZIP_1 -a -f $DOWNLOAD_DIR/$ZIP_2 ]; then
+ mkdir -p $EXTRACT_DIR
+ cp --update $DOWNLOAD_DIR/$ZIP_1 $EXTRACT_DIR
+ cp --update $DOWNLOAD_DIR/$ZIP_2 $EXTRACT_DIR
+ cd $EXTRACT_DIR
+ unzip -o $ZIP_1
+ unzip -o $ZIP_2
+ cd -
+ else
+ error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_1+"\" NOT EXTRACTING CORRECTLY"
+ error "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_2+"\" NOT EXTRACTING CORRECTLY"
+ log "The graphics and multimedia acceleration packages for "
+ log "the R-Car Gen3 board BSP can be downloaded from:"
+ log "<https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software>"
+ log
+ error "These 2 files from there should be stored in your"
+ error "'$DOWNLOAD_DIR' directory."
+ error " $ZIP_1"
+ error " $ZIP_2"
+ return 1
+ fi
- if [ -f $COPY_SCRIPT ]; then
- cd $METADIR/meta-renesas-rcar-gen3/
- $COPY_SCRIPT -d -f $EXTRACT_DIR
- cd ..
- else
- log "scripts to copy drivers for Gen3 not found."
- return 1
- fi
+ if [ -f $COPY_SCRIPT ]; then
+ cd $METADIR/bsp/meta-renesas/
+ $COPY_SCRIPT -d -f $EXTRACT_DIR
+ cd ..
+ else
+ log "scripts to copy drivers for Gen3 not found."
+ return 1
+ fi
}
+
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch
deleted file mode 100644
index a485d7a60..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/0001-Autoload-uEnv.txt-on-boot.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From bd56666d27f765113749c2e55eda97b67a659b2b Mon Sep 17 00:00:00 2001
-From: Anton Gerasimov <anton@advancedtelematic.com>
-Date: Wed, 2 Nov 2016 15:17:16 +0100
-Subject: [PATCH] Autoload uEnv.txt on boot
-
----
- include/configs/porter.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/include/configs/porter.h b/include/configs/porter.h
-index 45e6556..19dab74 100644
---- a/include/configs/porter.h
-+++ b/include/configs/porter.h
-@@ -151,6 +151,10 @@
- #define CONFIG_EXTRA_ENV_SETTINGS \
- "bootm_low=0x40e00000\0" \
- "bootm_size=0x100000\0" \
-+ "bootcmd=if fatload mmc 1:1 0x50000000 uEnv.txt; then env import -t 0x50000000 ${filesize}; run bootcmd; fi;\0"
-+
-+/* Shell scripting features */
-+#define CONFIG_SYS_HUSH_PARSER
-
- /* SH Ether */
- #define CONFIG_NET_MULTI
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch
deleted file mode 100644
index 95fc3b247..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-hibernation-image-area.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 0b5f63c7224cb5c9a00397f0e0ef4a16aa58e516 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:43:06 +0900
-Subject: [PATCH 1/3] Add hibernation image area
-
-0x40000000 <-> 0x77FFFFFF : kernel
-0x78000000 <-> 0x7FFFFFFF : hibernation image area
-and Enable sdhi DMA support
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- arch/arm/include/asm/arch-rmobile/r8a7791.h | 3 +++
- arch/arm/include/asm/armv7.h | 3 +++
- include/configs/porter.h | 24 ++++++++++++------------
- 3 files changed, 18 insertions(+), 12 deletions(-)
-
-diff --git a/arch/arm/include/asm/arch-rmobile/r8a7791.h b/arch/arm/include/asm/arch-rmobile/r8a7791.h
-index c964f13..9e08da4 100644
---- a/arch/arm/include/asm/arch-rmobile/r8a7791.h
-+++ b/arch/arm/include/asm/arch-rmobile/r8a7791.h
-@@ -147,6 +147,8 @@
-
- #define DBSC3_0_DBADJ2 0xE67900C8
- #define DBSC3_1_DBADJ2 0xE67A00C8
-+#define DBSC3_0_DBCALTR 0xE67900F8
-+#define DBSC3_1_DBCALTR 0xE67A00F8
-
- #define CCI_400_MAXOT_1 0xF0091110
- #define CCI_400_MAXOT_2 0xF0092110
-@@ -154,6 +156,7 @@
- #define CCI_400_QOSCNTL_2 0xF009210C
-
- #define MXI_BASE 0xFE960000
-+#define MXI_VIN_QOS 0xFE96020C
- #define MXI_QOS_BASE 0xFE960300
-
- #define SYS_AXI_SYX64TO128_BASE 0xFF800300
-diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
-index aad5bf7..0d4d612 100644
---- a/arch/arm/include/asm/armv7.h
-+++ b/arch/arm/include/asm/armv7.h
-@@ -31,6 +31,9 @@
- #define MIDR_CORTEX_A9_R1P3 0x411FC093
- #define MIDR_CORTEX_A9_R2P10 0x412FC09A
-
-+/* valid bits in CBAR register / PERIPHBASE value */
-+#define CBAR_MASK 0xFFFF8000
-+
- /* Cortex-A15 revisions */
- #define MIDR_CORTEX_A15_R0P0 0x410FC0F0
-
-diff --git a/include/configs/porter.h b/include/configs/porter.h
-index 5567c7c..f652bab 100644
---- a/include/configs/porter.h
-+++ b/include/configs/porter.h
-@@ -91,14 +91,14 @@
-
- /* MEMORY */
- #define PORTER_SDRAM_BASE 0x40000000
--#define PORTER_SDRAM_SIZE 0x48000000
-+#define PORTER_SDRAM_SIZE 0x80000000
- #define PORTER_UBOOT_SDRAM_SIZE 0x40000000
-
- #define CONFIG_SYS_LONGHELP
- #define CONFIG_SYS_PROMPT "=> "
--#define CONFIG_SYS_CBSIZE 512
--#define CONFIG_SYS_PBSIZE 512
--#define CONFIG_SYS_MAXARGS 32
-+#define CONFIG_SYS_CBSIZE 256
-+#define CONFIG_SYS_PBSIZE 256
-+#define CONFIG_SYS_MAXARGS 16
- #define CONFIG_SYS_BARGSIZE 512
- #define CONFIG_SYS_BAUDRATE_TABLE { 38400, 115200 }
-
-@@ -205,15 +205,15 @@
- #define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */
- #define CONFIG_USB_ETHER_ASIX /* Asix, or whatever driver(s) you want */
-
--#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */
--#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */
--
--#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */
--#define CONFIG_VE_ENABLED /* Virtualization Extensions are enabled*/
--#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ
-+#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */
-+#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */
-+#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */
-+#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ
-
-+#if 1
- #define CONFIG_SH_DMA
--#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000
--#define CONFIG_SH_SYS_DMAL_NCH 15
-+#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000
-+#define CONFIG_SH_SYS_DMAL_NCH 15
-+#endif
-
- #endif /* __PORTER_H */
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch
deleted file mode 100755
index c5226d4a2..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0001-Add-rcar-sdhi-DMA-support.patch
+++ /dev/null
@@ -1,650 +0,0 @@
-From 0aae8f3fefc67bc07b7e4e42f885ef661f0921ab Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 19 May 2017 14:25:38 +0900
-Subject: [PATCH 1/4] Add rcar-sdhi DMA support
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/dma/Makefile | 1 +
- drivers/dma/sh_dma.c | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++
- drivers/mmc/sh_sdhi.c | 158 +++++++++++++++++++++++++-
- drivers/mmc/sh_sdhi.h | 5 +
- include/sh_dma.h | 58 ++++++++++
- 5 files changed, 524 insertions(+), 4 deletions(-)
- create mode 100644 drivers/dma/sh_dma.c
- create mode 100644 include/sh_dma.h
-
-diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
-index 5d864b5..1129fc3 100644
---- a/drivers/dma/Makefile
-+++ b/drivers/dma/Makefile
-@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
- COBJS-$(CONFIG_APBH_DMA) += apbh_dma.o
- COBJS-$(CONFIG_FSL_DMA) += fsl_dma.o
- COBJS-$(CONFIG_OMAP3_DMA) += omap3_dma.o
-+COBJS-$(CONFIG_SH_DMA) += sh_dma.o
-
- COBJS := $(COBJS-y)
- SRCS := $(COBJS:.o=.c)
-diff --git a/drivers/dma/sh_dma.c b/drivers/dma/sh_dma.c
-new file mode 100644
-index 0000000..0af2480
---- /dev/null
-+++ b/drivers/dma/sh_dma.c
-@@ -0,0 +1,306 @@
-+/*
-+ * SH SYS-DMA driver
-+ *
-+ * Copyright (C) 2014 Cogent Embedded, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; either version 2 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ */
-+
-+#include <common.h>
-+#include <malloc.h>
-+#include <asm/io.h>
-+#include <linux/list.h>
-+#include <sh_dma.h>
-+
-+struct sh_dma {
-+ u32 base;
-+ u32 mask;
-+ u32 nch;
-+ struct list_head list;
-+};
-+
-+struct sh_dma_chan {
-+ struct sh_dma *dma;
-+ u32 base;
-+ u32 num;
-+ u32 ts;
-+ u32 bs;
-+ u32 rounds;
-+};
-+
-+#define SH_DMA_MAX_TC 0x1000000
-+#define SH_DMA_MAX_CHAN 32
-+#define SH_DMA_CHAN_OFFSET 0x8000
-+#define SH_DMA_CHAN_SIZE 0x80
-+
-+/* Global registers */
-+#define SH_DMAISTA 0x20
-+#define SH_DMASEC 0x30
-+#define SH_DMAOR 0x60
-+#define SH_DMACHCL 0x80
-+#define SH_DMADPSEC 0xA0
-+
-+/* DMA operation register bits */
-+#define SH_DMAOR_DME (0x1 << 0)
-+
-+/* Channel registers */
-+#define SH_DMASAR 0x00
-+#define SH_DMADAR 0x04
-+#define SH_DMATCR 0x08
-+#define SH_DMACHCR 0x0C
-+#define SH_DMATSR 0x28
-+#define SH_DMATCRB 0x18
-+#define SH_DMATSRB 0x38
-+#define SH_DMACHCRB 0x1C
-+#define SH_DMARS 0x40
-+#define SH_DMABUFCR 0x48
-+#define SH_DMADPBASE 0x50
-+#define SH_DMADPCR 0x54
-+#define SH_DMAFIXSAR 0x10
-+#define SH_DMAFIXDAR 0x14
-+#define SH_DMAFIXDPBASE 0x60
-+
-+/* Channel control register bits */
-+#define SH_DMACHCR_SM(v) (((v) & 0x3) << 12)
-+#define SH_DMACHCR_SM_MASK (0x3 << 12)
-+#define SH_DMACHCR_DM(v) (((v) & 0x3) << 14)
-+#define SH_DMACHCR_DM_MASK (0x3 << 14)
-+#define SH_DMACHCR_TS_1 (0x0 << 3 | 0x0 << 20)
-+#define SH_DMACHCR_TS_2 (0x1 << 3 | 0x0 << 20)
-+#define SH_DMACHCR_TS_4 (0x2 << 3 | 0x0 << 20)
-+#define SH_DMACHCR_TS_8 (0x3 << 3 | 0x1 << 20)
-+#define SH_DMACHCR_TS_16 (0x3 << 3 | 0x0 << 20)
-+#define SH_DMACHCR_TS_32 (0x0 << 3 | 0x1 << 20)
-+#define SH_DMACHCR_TS_64 (0x1 << 3 | 0x1 << 20)
-+#define SH_DMACHCR_TS_MASK (0x3 << 3 | 0x3 << 20)
-+#define SH_DMACHCR_RS_AUTO (0x4 << 8)
-+#define SH_DMACHCR_RS_SEL (0x8 << 8)
-+#define SH_DMACHCR_RS_MASK (0xf << 8)
-+#define SH_DMACHCR_CAE (0x1 << 31)
-+#define SH_DMACHCR_TE (0x1 << 1)
-+#define SH_DMACHCR_DE (0x1 << 0)
-+
-+#define sh_dma_writel(d, r, v) writel((v), (d)->base + (r))
-+#define sh_dma_readl(d, r) readl((d)->base + (r))
-+#define sh_dma_writew(d, r, v) writew((v), (d)->base + (r))
-+#define sh_dma_readw(d, r) readw((d)->base + (r))
-+
-+static LIST_HEAD(sh_dma_list);
-+
-+struct sh_dma *sh_dma_add(u32 base, u32 nch)
-+{
-+ struct list_head *entry;
-+ struct sh_dma *dma;
-+ u32 mask;
-+
-+ if (nch > SH_DMA_MAX_CHAN)
-+ return NULL;
-+
-+ mask = (1 << nch) - 1;
-+ list_for_each(entry, &sh_dma_list) {
-+ dma = list_entry(entry, struct sh_dma, list);
-+ if (dma->base == base) {
-+ if (nch > dma->nch) {
-+ mask &= ~((1 << dma->nch) - 1);
-+ sh_dma_writel(dma, SH_DMACHCL, mask);
-+ dma->nch = nch;
-+ }
-+ return dma;
-+ }
-+ }
-+
-+ dma = malloc(sizeof(*dma));
-+ if (!dma)
-+ return NULL;
-+
-+ dma->base = base;
-+ dma->mask = 0;
-+ dma->nch = nch;
-+ sh_dma_writel(dma, SH_DMACHCL, mask);
-+ sh_dma_writew(dma, SH_DMAOR, SH_DMAOR_DME);
-+ list_add(&dma->list, &sh_dma_list);
-+ return dma;
-+}
-+
-+void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src)
-+{
-+ sh_dma_writel(chan, SH_DMASAR, src);
-+}
-+
-+void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst)
-+{
-+ sh_dma_writel(chan, SH_DMADAR, dst);
-+}
-+
-+void sh_dma_chan_cfg(struct sh_dma_chan *chan, u8 midrid, u8 sm, u8 dm)
-+{
-+ u32 val;
-+
-+ sh_dma_writew(chan, SH_DMARS, midrid);
-+ val = sh_dma_readl(chan, SH_DMACHCR);
-+ val &= ~(SH_DMACHCR_RS_MASK |
-+ SH_DMACHCR_SM_MASK | SH_DMACHCR_DM_MASK);
-+ val |= midrid ? SH_DMACHCR_RS_SEL : SH_DMACHCR_RS_AUTO;
-+ val |= SH_DMACHCR_SM(sm) | SH_DMACHCR_DM(dm);
-+ sh_dma_writel(chan, SH_DMACHCR, val);
-+}
-+
-+void sh_dma_chan_start(struct sh_dma_chan *chan, u32 ts, u8 bs)
-+{
-+ u32 val;
-+
-+ if (!ts)
-+ return;
-+
-+ val = (ts + (1 << bs) - 1) >> bs;
-+ val = val < SH_DMA_MAX_TC ? val : 0x0;
-+ sh_dma_writel(chan, SH_DMATCR, val);
-+
-+ chan->ts = ts;
-+ chan->bs = bs;
-+ chan->rounds = val;
-+
-+ val = sh_dma_readl(chan, SH_DMACHCR);
-+
-+ val &= ~(SH_DMACHCR_TE | SH_DMACHCR_TS_MASK);
-+ val |= SH_DMACHCR_DE;
-+ switch (bs) {
-+ default:
-+ case 0:
-+ val |= SH_DMACHCR_TS_1;
-+ break;
-+ case 1:
-+ val |= SH_DMACHCR_TS_2;
-+ break;
-+ case 2:
-+ val |= SH_DMACHCR_TS_4;
-+ break;
-+ case 3:
-+ val |= SH_DMACHCR_TS_8;
-+ break;
-+ case 4:
-+ val |= SH_DMACHCR_TS_16;
-+ break;
-+ case 5:
-+ val |= SH_DMACHCR_TS_32;
-+ break;
-+ case 6:
-+ val |= SH_DMACHCR_TS_64;
-+ break;
-+ }
-+
-+ sh_dma_writel(chan, SH_DMACHCR, val);
-+}
-+
-+void sh_dma_chan_stop(struct sh_dma_chan *chan)
-+{
-+ u32 val;
-+
-+ chan->ts = 0;
-+ chan->bs = 0;
-+ chan->rounds = 0;
-+
-+ val = sh_dma_readl(chan, SH_DMACHCR);
-+ val &= ~(SH_DMACHCR_CAE | SH_DMACHCR_TE | SH_DMACHCR_DE);
-+ sh_dma_writel(chan, SH_DMACHCR, val);
-+ do {
-+ val = sh_dma_readl(chan, SH_DMACHCR);
-+ } while (val & SH_DMACHCR_DE);
-+}
-+
-+int sh_dma_chan_wait(struct sh_dma_chan *chan)
-+{
-+ u32 val;
-+ u32 timeout = 10000000;
-+ int retval = 0;
-+
-+ do {
-+ val = sh_dma_readl(chan, SH_DMACHCR);
-+ val &= SH_DMACHCR_CAE | SH_DMACHCR_TE | SH_DMACHCR_DE;
-+ if (val == (SH_DMACHCR_TE | SH_DMACHCR_DE))
-+ break;
-+
-+ if (!timeout)
-+ return -ETIMEDOUT;
-+
-+ timeout--;
-+ udelay(1);
-+ } while (1);
-+
-+ if (!(val & SH_DMACHCR_DE))
-+ return chan->ts ? -EINTR : 0;
-+
-+ if (val & SH_DMACHCR_CAE) {
-+ retval = -EFAULT;
-+ goto out;
-+ }
-+
-+ val = chan->rounds < SH_DMA_MAX_TC ? chan->rounds : SH_DMA_MAX_TC;
-+ val = chan->rounds - val;
-+ if (val) {
-+ puts("abnormal end\n");
-+ sh_dma_chan_start(chan, val << chan->bs, 0);
-+ return -EAGAIN;
-+ }
-+
-+out:
-+ sh_dma_chan_stop(chan);
-+ return retval;
-+}
-+
-+void sh_dma_chan_clr(struct sh_dma_chan *chan)
-+{
-+ chan->ts = 0;
-+ chan->bs = 0;
-+ chan->rounds = 0;
-+
-+ sh_dma_writel(chan->dma, SH_DMACHCL, 1 << chan->num);
-+}
-+
-+struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma, int ch)
-+{
-+ struct sh_dma_chan *chan;
-+ u32 mask;
-+
-+ if (ch < 0) {
-+ if (!~dma->mask)
-+ return NULL;
-+
-+ ch = ffz(dma->mask);
-+ }
-+
-+ if (!dma || ch > dma->nch)
-+ return NULL;
-+
-+ mask = 1 << ch;
-+ if (dma->mask & mask)
-+ return NULL;
-+
-+ chan = malloc(sizeof(*chan));
-+ if (!chan)
-+ return NULL;
-+
-+ dma->mask |= mask;
-+ chan->dma = dma;
-+ chan->base = dma->base + SH_DMA_CHAN_OFFSET + ch * SH_DMA_CHAN_SIZE;
-+ chan->num = ch;
-+ sh_dma_chan_clr(chan);
-+
-+ return chan;
-+}
-+
-+void sh_dma_chan_release(struct sh_dma_chan *chan)
-+{
-+ struct sh_dma *dma = chan->dma;
-+
-+ dma->mask &= ~(1 << chan->num);
-+ free(chan);
-+}
-diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
-index ddad43a..80dc7a8 100644
---- a/drivers/mmc/sh_sdhi.c
-+++ b/drivers/mmc/sh_sdhi.c
-@@ -17,7 +17,6 @@
- #include <command.h>
- #include <mmc.h>
- #include <malloc.h>
--#include <mmc.h>
- #include <asm/errno.h>
- #include <asm/io.h>
-
-@@ -33,6 +32,111 @@
-
- #define DRIVER_NAME "sh-sdhi"
-
-+#ifdef CONFIG_SH_DMA
-+
-+#ifdef CONFIG_SYS_DCACHE_OFF
-+static inline void sh_sdhi_invalidate_dcache(u32 addr, int len) { }
-+#else /* CONFIG_SYS_DCACHE_OFF */
-+#define DCACHE_LINE_MASK (ARCH_DMA_MINALIGN - 1)
-+
-+static void sh_sdhi_invalidate_dcache(u32 addr, int len)
-+{
-+ u32 start, end;
-+
-+ start = addr & ~DCACHE_LINE_MASK;
-+ if (start != addr) {
-+ end = start + ARCH_DMA_MINALIGN;
-+ flush_dcache_range(start, end);
-+
-+ len -= end - addr;
-+ start = end;
-+ }
-+
-+ if (len >= ARCH_DMA_MINALIGN) {
-+ end = (start + len) & ~DCACHE_LINE_MASK;
-+ invalidate_dcache_range(start, end);
-+
-+ len &= DCACHE_LINE_MASK;
-+ start = end;
-+ }
-+
-+ if (len > 0) {
-+ end = start + ARCH_DMA_MINALIGN;
-+ flush_dcache_range(start, end);
-+ }
-+}
-+#endif /* CONFIG_SYS_DCACHE_OFF */
-+
-+static void sh_sdhi_dma_init(struct sdhi_host *host)
-+{
-+ struct sh_dma *dma;
-+
-+ dma = sh_dma_add(CONFIG_SH_SYS_DMAL_BASE, CONFIG_SH_SYS_DMAL_NCH);
-+ if (!dma)
-+ return;
-+
-+ host->dma_rx = sh_dma_chan_init(dma, 1);
-+ if (!host->dma_rx)
-+ return;
-+
-+ sh_dma_chan_cfg(host->dma_rx, SH_DMA_SDHI0_RX,
-+ SH_DMA_AM_FIX, SH_DMA_AM_INC);
-+ sh_dma_chan_src(host->dma_rx,
-+ host->addr + (SDHI_BUF0 << host->bus_shift) +
-+ 0x2000);
-+}
-+
-+static void sh_sdhi_dma_release(struct sdhi_host *host)
-+{
-+ if (host->dma_rx) {
-+ sh_dma_chan_release(host->dma_rx);
-+ host->dma_rx = NULL;
-+ }
-+}
-+
-+static void sh_sdhi_start_dma_rx(struct sdhi_host *host,
-+ struct mmc_data *data)
-+{
-+ int ret;
-+ u32 blocksize = data->blocksize;
-+ sh_sdhi_dma_init(host);
-+ sdhi_writew(host, SDHI_SD_DMACR, 0xa0);
-+ sdhi_writew(host, SDHI_CC_EXT_MODE, (1 << 1));
-+
-+ sh_sdhi_invalidate_dcache((u32)data->dest, blocksize);
-+
-+ sh_dma_chan_dst(host->dma_rx, (u32)data->dest);
-+
-+ /* sh_sdhi_bitset(BUF_ACC_DMAREN, &host->regs->ce_buf_acc); */
-+
-+ /* MMCIF is capable to transfer only 4 bytes at a time,
-+ * provide size order as a param */
-+ blocksize = sdhi_readw(host, SDHI_SIZE);
-+ sh_dma_chan_start(host->dma_rx, blocksize, 1);
-+
-+ do {
-+ ret = sh_dma_chan_wait(host->dma_rx);
-+ } while (ret == -EAGAIN);
-+ sdhi_writew(host, SDHI_CC_EXT_MODE, 0x0);
-+ sh_dma_chan_clr(host->dma_rx);
-+ sh_sdhi_dma_release(host);
-+}
-+
-+static void sdhi_dma_transfer(struct sdhi_host *host,
-+ struct mmc_data *data)
-+{
-+ sh_sdhi_start_dma_rx(host, data);
-+}
-+
-+
-+#else /* CONFIG_SH_DMA */
-+static inline void sh_sdhi_dma_init(struct sdhi_host *host) { }
-+static inline void sh_sdhi_dma_release(struct sdhi_host *host) { }
-+static inline void sh_sdhi_start_dma_rx(struct sdhi_host *host,
-+ struct mmc_data *data) { }
-+
-+#endif /* CONFIG_SH_DMA */
-+
- static void *mmc_priv(struct mmc *mmc)
- {
- return (void *)mmc->priv;
-@@ -253,7 +357,9 @@ static int sdhi_single_read(struct sdhi_host *host, struct mmc_data *data)
- {
- int ch = host->ch;
- long time;
-+#ifndef CONFIG_SH_DMA
- unsigned short blocksize, i;
-+#endif
- unsigned short *p = (unsigned short *)data->dest;
-
- if ((unsigned long)p & 0x00000001) {
-@@ -272,10 +378,14 @@ static int sdhi_single_read(struct sdhi_host *host, struct mmc_data *data)
- return sdhi_error_manage(host);
-
- g_wait_int[ch] = 0;
-+#ifdef CONFIG_SH_DMA
-+ sdhi_dma_transfer(host, data);
-+#else
- blocksize = sdhi_readw(host, SDHI_SIZE);
- for (i = 0; i < blocksize / 2; i++)
- *p++ = sdhi_readw(host, SDHI_BUF0);
-
-+#endif
- time = sdhi_wait_interrupt_flag(host);
- if (time == 0 || g_sd_error[ch] != 0)
- return sdhi_error_manage(host);
-@@ -537,7 +647,6 @@ static int sdhi_start_cmd(struct sdhi_host *host,
- ;
-
- sdhi_writew(host, SDHI_CMD, (unsigned short)(opc & CMD_MASK));
--
- g_wait_int[host->ch] = 0;
- sdhi_writew(host, SDHI_INFO1_MASK,
- ~INFO1M_RESP_END & sdhi_readw(host, SDHI_INFO1_MASK));
-@@ -546,7 +655,6 @@ static int sdhi_start_cmd(struct sdhi_host *host,
- INFO2M_END_ERROR | INFO2M_TIMEOUT |
- INFO2M_RESP_TIMEOUT | INFO2M_ILA) &
- sdhi_readw(host, SDHI_INFO2_MASK));
--
- time = sdhi_wait_interrupt_flag(host);
- if (time == 0)
- return sdhi_error_manage(host);
-@@ -578,7 +686,6 @@ static int sdhi_start_cmd(struct sdhi_host *host,
- }
- if (host->data)
- ret = sdhi_data_trans(host, data, opc);
--
- pr_debug("ret = %d, resp = %08x, %08x, %08x, %08x\n",
- ret, cmd->response[0], cmd->response[1],
- cmd->response[2], cmd->response[3]);
-@@ -697,3 +804,46 @@ int sdhi_mmc_init(unsigned long addr, int ch)
- return ret;
- }
-
-+
-+int sdhi_warmup_sdio(struct mmc *mmc)
-+{
-+ struct mmc_cmd cmd;
-+ int err;
-+ int32_t ocr;
-+
-+ udelay(10);
-+
-+ mmc->bus_width = 1;
-+ mmc->clock = mmc->f_min;
-+ sdhi_set_ios(mmc);
-+ udelay(10);
-+
-+ cmd.cmdidx = MMC_CMD_GO_IDLE_STATE;
-+ cmd.resp_type = MMC_RSP_NONE;
-+ cmd.cmdarg = 0;
-+ err = sdhi_request(mmc, &cmd, NULL);
-+ if (err)
-+ goto err_out;
-+ cmd.cmdidx = 0x5;
-+ cmd.resp_type = MMC_RSP_R4;
-+ cmd.cmdarg = 0;
-+ err = sdhi_request(mmc, &cmd, NULL);
-+ if (err)
-+ goto err_out;
-+ ocr = cmd.response[0];
-+ ocr |= (1 << 24);
-+ cmd.cmdidx = 0x05;
-+ cmd.resp_type = MMC_RSP_R4;
-+ cmd.cmdarg = ocr;
-+ err = sdhi_request(mmc, &cmd, NULL);
-+ if (err)
-+ goto err_out;
-+ printf("SDIO OCR:%08x\n", cmd.response[0]);
-+ return 0;
-+err_out:
-+ printf("cmd: CMD%02d err = %d, resp = %08x, %08x, %08x, %08x\n",
-+ err, cmd.cmdidx, cmd.response[0], cmd.response[1],
-+ cmd.response[2], cmd.response[3]);
-+ return err;
-+}
-+
-diff --git a/drivers/mmc/sh_sdhi.h b/drivers/mmc/sh_sdhi.h
-index 4deded2..7b5d421 100644
---- a/drivers/mmc/sh_sdhi.h
-+++ b/drivers/mmc/sh_sdhi.h
-@@ -15,6 +15,8 @@
- #ifndef _SH_SDHI_H_
- #define _SH_SDHI_H_
-
-+#include <sh_dma.h>
-+
- #define SDHI_CMD (0x0000 >> 1)
- #define SDHI_PORTSEL (0x0004 >> 1)
- #define SDHI_ARG0 (0x0008 >> 1)
-@@ -181,6 +183,9 @@ struct sdhi_host {
- unsigned int power_mode;
- int ch;
- int bus_shift;
-+#ifdef CONFIG_SH_DMA
-+ struct sh_dma_chan *dma_rx;
-+#endif
- };
-
- static unsigned short g_wait_int[CONFIG_MMC_SH_SDHI_NR_CHANNEL];
-diff --git a/include/sh_dma.h b/include/sh_dma.h
-new file mode 100644
-index 0000000..3f35c3a
---- /dev/null
-+++ b/include/sh_dma.h
-@@ -0,0 +1,58 @@
-+#ifndef __SH_DMA_H__
-+#define __SH_DMA_H__
-+
-+#include <asm/types.h>
-+#include <errno.h>
-+
-+#define SH_DMA_MMCIF0_RX 0xD2
-+#define SH_DMA_SDHI0_RX 0xCE
-+
-+/* Address mode */
-+#define SH_DMA_AM_FIX 0
-+#define SH_DMA_AM_INC 1
-+#define SH_DMA_AM_DEC 2
-+
-+struct sh_dma;
-+struct sh_dma_chan;
-+
-+#ifdef CONFIG_SH_DMA
-+struct sh_dma *sh_dma_add(u32 base, u32 nch);
-+struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma, int ch);
-+void sh_dma_chan_release(struct sh_dma_chan *chan);
-+
-+void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src);
-+void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst);
-+void sh_dma_chan_cfg(struct sh_dma_chan *chan, u8 midrid, u8 sm, u8 dm);
-+void sh_dma_chan_start(struct sh_dma_chan *chan, u32 ts, u8 bs);
-+void sh_dma_chan_stop(struct sh_dma_chan *chan);
-+int sh_dma_chan_wait(struct sh_dma_chan *chan);
-+void sh_dma_chan_clr(struct sh_dma_chan *chan);
-+#else
-+static inline struct sh_dma *sh_dma_add(u32 base, u32 nch)
-+{
-+ return NULL;
-+}
-+
-+static inline struct sh_dma_chan *sh_dma_chan_init(struct sh_dma *dma,
-+ int ch)
-+{
-+ return NULL;
-+}
-+
-+static inline void sh_dma_chan_release(struct sh_dma_chan *chan) { }
-+static inline void sh_dma_chan_src(struct sh_dma_chan *chan, u32 src) { }
-+static inline void sh_dma_chan_dst(struct sh_dma_chan *chan, u32 dst) { }
-+static inline void sh_dma_chan_cfg(struct sh_dma_chan *chan,
-+ u8 midrid, u8 sm, u8 dm) { }
-+static inline void sh_dma_chan_start(struct sh_dma_chan *chan,
-+ u32 ts, u8 bs) { }
-+static inline void sh_dma_chan_stop(struct sh_dma_chan *chan) { }
-+static inline int sh_dma_chan_wait(struct sh_dma_chan *chan)
-+{
-+ return -ENOSYS;
-+}
-+
-+static inline void sh_dma_chan_clr(struct sh_dma_chan *chan) { }
-+#endif
-+
-+#endif /* __SH_DMA_H__ */
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch
deleted file mode 100755
index 7c4c65658..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Add-Hibernation-swsusp-command-support.patch
+++ /dev/null
@@ -1,909 +0,0 @@
-From 45b3abc592bd685726a6b55693ab95e4cb6065fc Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 19 May 2017 14:27:46 +0900
-Subject: [PATCH 2/4] Add Hibernation swsusp command support
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- common/cmd_swsusp.c | 889 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 889 insertions(+)
- create mode 100644 common/cmd_swsusp.c
-
-diff --git a/common/cmd_swsusp.c b/common/cmd_swsusp.c
-new file mode 100644
-index 0000000..ba05aa4
---- /dev/null
-+++ b/common/cmd_swsusp.c
-@@ -0,0 +1,889 @@
-+/*
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <common.h>
-+#include <command.h>
-+#include <part.h>
-+#include <malloc.h>
-+
-+#include <linux/lzo.h>
-+#include "../arch/arm/cpu/armv7/rmobile/crc32_word4.h"
-+#include <swsuspmem.h>
-+
-+/* Note for Renesas--based boards:
-+ * We have the following memory split here:
-+ * 0x40000000 - u_boot_lowest - used to store pfns at physical addresses
-+ * u_boot_lowest - 0x8000000 - pfns are relocated, and then later put
-+ * on physical addresses (swsusp_finish)
-+ * 0x8000000 - 0xc0000000 - used to store pfns with physical address
-+ * of 0x200000000 (long address), we have to change offset for them.
-+ * Any pfn with address > 0x8000000 but less than 0x200000000
-+ * is an error.
-+ * For boards which do not have memory above first GB, that will
-+ * still work, as they won't have anything above 0x80000000
-+ * in their image, so for standard 2GB setup ou should put
-+ * your secong GB in 0x80000000-0xC0000000 range, you can
-+ * use MMU for that or if your RAM is continous, it will
-+ * naturally be there. */
-+
-+DECLARE_GLOBAL_DATA_PTR;
-+
-+/* #define PAGEMAP_DEBUG */
-+
-+#ifdef PAGEMAP_DEBUG
-+#define SWSUSP_DEBUG_INFO
-+#endif
-+
-+#define SWSUSP_KEEP_IMAGE
-+
-+#ifndef likely
-+# define likely(x) __builtin_expect(!!(x), 1)
-+# define unlikely(x) __builtin_expect(!!(x), 0)
-+#endif
-+
-+#define HIBERNATE_SIG "S1SUSPEND"
-+#define PAGE_SIZE 4096
-+
-+/* Define depending on CONFIG_LBDAF in kernel */
-+typedef u64 sector_t;
-+
-+
-+struct swsusp_header {
-+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) -
-+ sizeof(int) - sizeof(u32) -
-+ sizeof(CRC32_WORD4_t) - sizeof(u32)];
-+ CRC32_WORD4_t comp_crc32;
-+ u32 img_size; /* append */
-+ u32 crc32;
-+ sector_t image;
-+ unsigned int flags;
-+ char orig_sig[10];
-+ char sig[10];
-+} __packed;
-+
-+#define __NEW_UTS_LEN 64
-+
-+struct new_utsname {
-+ char sysname[__NEW_UTS_LEN + 1];
-+ char nodename[__NEW_UTS_LEN + 1];
-+ char release[__NEW_UTS_LEN + 1];
-+ char version[__NEW_UTS_LEN + 1];
-+ char machine[__NEW_UTS_LEN + 1];
-+ char domainname[__NEW_UTS_LEN + 1];
-+};
-+
-+struct swsusp_archdata {
-+ u32 nosave_backup_phys;
-+ u32 nosave_begin_phys;
-+ u32 nosave_end_phys;
-+ void (*cpu_resume_restore_nosave)(u32, u32, u32);
-+};
-+
-+struct swsusp_info {
-+ struct new_utsname uts;
-+ u32 version_code;
-+ unsigned long num_physpages;
-+ int cpus;
-+ unsigned long image_pages;
-+ unsigned long pages;
-+ unsigned long size;
-+ char archdata[1024];
-+};
-+
-+struct swap_map_page {
-+ u64 entries[PAGE_SIZE / sizeof(u64) - 1];
-+ u64 next_swap;
-+};
-+
-+struct swsusp_finish_context {
-+ void *remap_orig_page;
-+ void *remap_temp_page;
-+ struct swsusp_archdata archdata;
-+};
-+
-+/* Do not specially exclude any bottom area */
-+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE)
-+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE)
-+
-+#define PG_UB2ZERO(pg) (pg - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE)
-+static u32 const exclude_min_page =
-+ (USED_ADDRESS_TOP) / PAGE_SIZE;
-+static u32 const exclude_max_page =
-+ (USED_ADDRESS_END - 1) / PAGE_SIZE;
-+static u32 const exclude_min_page_ub =
-+ PG_UB2ZERO((USED_ADDRESS_TOP) / PAGE_SIZE);
-+static u32 const exclude_max_page_ub =
-+ PG_UB2ZERO((USED_ADDRESS_END-1) / PAGE_SIZE);
-+#define SF_NOCOMPRESS_MODE 2
-+
-+#define LZO_HEADER sizeof(size_t)
-+
-+/* Number of pages/bytes we'll compress at one time. */
-+#define LZO_UNC_PAGES 32
-+#define LZO_UNC_SIZE (LZO_UNC_PAGES * PAGE_SIZE)
-+
-+/* Number of pages/bytes we need for compressed data (worst case). */
-+#define LZO_CMP_PAGES DIV_ROUND_UP(lzo1x_worst_compress(LZO_UNC_SIZE) + \
-+ LZO_HEADER, PAGE_SIZE)
-+#define LZO_CMP_SIZE (LZO_CMP_PAGES * PAGE_SIZE)
-+
-+static block_dev_desc_t *swap_dev;
-+static disk_partition_t swap_info;
-+
-+static struct swap_map_page *meta_map;
-+static u64 meta_map_next;
-+static u64 meta_map_curr;
-+static u64 meta_map_start;
-+static int meta_idx;
-+
-+#ifdef PAGEMAP_DEBUG
-+static int debugout;
-+static int _last_read_pages;
-+#define PAGEMAP_INFO(_msg, ...) do { if (debugout == 1) \
-+ printf(_msg, ## __VA_ARGS__); } while (0)
-+#endif
-+
-+#define HIGHMEM_PHYS_ADDR 0x200000000ULL
-+#define HIGHMEM_VA 0x80000000UL
-+#define HIGHMEM_PFN (HIGHMEM_PHYS_ADDR / PAGE_SIZE)
-+#define LOW_TOP 0x80000000
-+#define LOW_TOP_PFN (LOW_TOP / PAGE_SIZE)
-+#define LOW_BOTTOM CONFIG_SYS_SDRAM_BASE
-+#define LOW_BOTTOM_PFN (LOW_BOTTOM / PAGE_SIZE)
-+#define TOP_ADDRESS 0x240000000ULL
-+
-+static int get_meta(void);
-+
-+static inline int pfn_is_low(u32 pfn)
-+{
-+ return ((pfn >= LOW_BOTTOM_PFN) && (pfn < LOW_TOP_PFN));
-+}
-+
-+static inline int pfn_is_high(u32 pfn)
-+{
-+ return (pfn >= HIGHMEM_PFN);
-+}
-+
-+#define pfn_is_valid(p) (pfn_is_low(p) || pfn_is_high(p))
-+
-+static inline int pfn_is_excluded(u32 pfn)
-+{
-+ /* Allow bottom 2 pages for exception vectors */
-+ if (pfn < (LOW_BOTTOM_PFN + 2))
-+ return 0;
-+ else if (exclude_min_page >= exclude_max_page)
-+ return 0;
-+ else
-+ return (pfn >= exclude_min_page) && (pfn <= exclude_max_page);
-+}
-+
-+/* PFN to zero-counted page */
-+static inline u32 pg_ub2zero(u32 pg)
-+{
-+ return pg - LOW_BOTTOM_PFN;
-+}
-+
-+/* zero-counted page to PFN */
-+static inline u32 pg_zero2ub(u32 pg)
-+{
-+ return pg + LOW_BOTTOM_PFN;
-+}
-+
-+/* PFN to physical address (64-bit (40-bit)) */
-+static inline u64 pg2phys(u32 page)
-+{
-+ return (u64) page * PAGE_SIZE;
-+}
-+
-+/* PFN to virtual address */
-+static inline void *pg2addr(u32 page)
-+{
-+ void *addr;
-+ if (page >= HIGHMEM_PFN)
-+ addr = (void *) (u32)(pg2phys(page - HIGHMEM_PFN) + HIGHMEM_VA);
-+ else
-+ addr = (void *) (u32)pg2phys(page);
-+
-+ return addr;
-+}
-+
-+#ifdef CONFIG_SH_DMA
-+static inline void *malloc_aligned(u32 size, u32 align)
-+{
-+ return (void *)(((u32)malloc(size + align) + align - 1) & ~(align - 1));
-+}
-+
-+#endif
-+
-+static int page_read(u32 page, void *addr)
-+{
-+ __u32 cnt;
-+ int blk_per_page;
-+
-+ blk_per_page = PAGE_SIZE / swap_dev->blksz;
-+ cnt = swap_dev->block_read(swap_dev->dev,
-+ swap_info.start + (page * blk_per_page),
-+ blk_per_page, addr);
-+ return cnt != blk_per_page;
-+}
-+
-+#ifndef SWSUSP_KEEP_IMAGE
-+static int page_write(u32 page, void *addr)
-+{
-+ __u32 cnt;
-+ int blk_per_page;
-+
-+ blk_per_page = PAGE_SIZE / swap_dev->blksz;
-+ cnt = swap_dev->block_write(swap_dev->dev,
-+ swap_info.start + (page * blk_per_page),
-+ blk_per_page, addr);
-+ return cnt != blk_per_page;
-+}
-+#endif
-+
-+#define FAST_COPY
-+void __attribute__((section(".rodata")))
-+ __attribute__((optimize("O6", "unroll-loops")))
-+swsusp_finish(void *userdata)
-+{
-+ struct swsusp_finish_context *context = userdata;
-+ u32 **remap_orig;
-+ u32 **remap_temp;
-+ int idx = 0;
-+ const int lastidx = PAGE_SIZE / sizeof(u32) - 1;
-+
-+ remap_orig = context->remap_orig_page;
-+ remap_temp = context->remap_temp_page;
-+
-+ __asm__ volatile ("" : : : "memory");
-+ for (;;) {
-+ u32 *orig, *temp;
-+ int count;
-+
-+ /* Linked list to next page */
-+ if (idx == lastidx) {
-+ remap_orig = (u32 **)remap_orig[idx];
-+ remap_temp = (u32 **)remap_temp[idx];
-+ idx = 0;
-+ }
-+ if (unlikely(!remap_orig || remap_orig[idx] == (u32 *)~0UL))
-+ break;
-+ orig = remap_orig[idx];
-+ temp = remap_temp[idx];
-+#ifdef FAST_COPY
-+ count = PAGE_SIZE / sizeof(u32) / 32;
-+ __asm__ volatile (
-+ "1:\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "subs %[count], %[count], #1\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "bgt 1b\n"
-+ : /* No outputs */
-+ :
-+ [rorig]"h" (orig),
-+ [rtemp]"h" (temp),
-+ [count]"h" (count)
-+ : "r0", "r1", "r2",
-+ "r3", "r4", "r5",
-+ "r6", "r7", "cc", "memory"
-+ );
-+#else
-+ count = PAGE_SIZE / sizeof(u32);
-+ while (count--)
-+ *orig++ = *temp++;
-+#endif
-+#ifdef SWSUSP_CHECK_COPY_RESULT
-+ count = PAGE_SIZE / sizeof(u32);
-+ orig = remap_orig[idx];
-+ temp = remap_temp[idx];
-+ __asm__ volatile (
-+ "1:\n"
-+ "ldr r3, [%[rorig]]\n"
-+ "ldr r4, [%[rtemp]]\n"
-+ "cmp r3, r4\n"
-+ "bne 2f\n"
-+ "add %[rorig], %[rorig], #4\n"
-+ "add %[rtemp], %[rtemp], #4\n"
-+ "subs %[count], %[count], #1\n"
-+ "bgt 1b\n"
-+ "b 3f\n"
-+ "2:b 2b\n"
-+ "3:\n"
-+ :
-+ [rorig]"+r" (orig),
-+ [rtemp]"+r" (temp),
-+ [count]"+r" (count)
-+ :
-+ : "r3", "r4", "cc", "memory"
-+ );
-+#endif
-+ idx++;
-+ }
-+ context->archdata.cpu_resume_restore_nosave(
-+ context->archdata.nosave_backup_phys,
-+ context->archdata.nosave_begin_phys,
-+ context->archdata.nosave_end_phys);
-+}
-+
-+static int raw_page_init(u64 start)
-+{
-+#ifdef CONFIG_SH_DMA
-+ meta_map = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN);
-+#else
-+ meta_map = malloc(PAGE_SIZE);
-+#endif
-+ if (!meta_map)
-+ return -1;
-+ meta_map_next = 0;
-+ meta_map_curr = 0;
-+ meta_map_start = start;
-+ return 0;
-+}
-+
-+static void raw_page_start(void)
-+{
-+ meta_idx = ARRAY_SIZE(meta_map->entries);
-+ meta_map_next = meta_map_start;
-+}
-+
-+static int get_meta(void)
-+{
-+ if (meta_idx == ARRAY_SIZE(meta_map->entries)) {
-+ if (!meta_map_next)
-+ return 0;
-+ if (meta_map_curr != meta_map_next) {
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO("META: %d (%08x)\n",
-+ (int)meta_map_next,
-+ (unsigned int)
-+ (meta_map_next * PAGE_SIZE));
-+#endif
-+ if (page_read(meta_map_next, meta_map))
-+ return -1;
-+ meta_map_curr = meta_map_next;
-+ meta_map_next = meta_map->next_swap;
-+ }
-+ meta_idx = 0;
-+ }
-+#ifdef PAGEMAP_DEBUG
-+ {
-+ static unsigned int pre;
-+ if ((pre+1) != meta_map->entries[meta_idx]) {
-+ PAGEMAP_INFO("DATA-Skipped: %d->%d (%08x->%08x)\n",
-+ pre,
-+ (unsigned int)meta_map->entries[meta_idx],
-+ pre*PAGE_SIZE,
-+ (unsigned int)
-+ (meta_map->entries[meta_idx] *
-+ PAGE_SIZE));
-+ }
-+ pre = meta_map->entries[meta_idx];
-+ _last_read_pages = pre;
-+ }
-+#endif
-+ return 1;
-+}
-+
-+static int raw_page_get_next(void *buffer)
-+{
-+ if (!get_meta())
-+ return 0;
-+
-+ if (page_read(meta_map->entries[meta_idx++], buffer))
-+ return -1;
-+
-+ return 1;
-+}
-+
-+static void raw_page_exit(void)
-+{
-+ free(meta_map);
-+ meta_map = NULL;
-+}
-+
-+static int image_compressed;
-+static int image_pages_avail;
-+static unsigned char *unc_buf;
-+static unsigned char *cmp_buf;
-+static int unc_offset;
-+
-+static int image_page_init(int compressed)
-+{
-+ if (!compressed)
-+ return 1;
-+
-+#ifdef CONFIG_SH_DMA
-+ cmp_buf = malloc_aligned(LZO_CMP_SIZE, ARCH_DMA_MINALIGN);
-+#else
-+ cmp_buf = malloc(LZO_CMP_SIZE);
-+#endif
-+ unc_buf = malloc(LZO_UNC_SIZE);
-+ if (!unc_buf || !cmp_buf) {
-+ printf("not enogh memory\n");
-+ return 1;
-+ }
-+ image_compressed = compressed;
-+ return 0;
-+}
-+
-+static void image_page_start(void)
-+{
-+ image_pages_avail = 0;
-+}
-+
-+static int image_page_get_next(void *buffer)
-+{
-+ if (image_compressed) {
-+#ifdef CONFIG_LZO
-+ if (!image_pages_avail) {
-+ int ret;
-+ size_t unc_len, cmp_len, cmp_avail;
-+
-+ ret = raw_page_get_next(cmp_buf);
-+ if (ret <= 0)
-+ return ret;
-+
-+ cmp_len = *(size_t *) cmp_buf;
-+ cmp_avail = PAGE_SIZE;
-+
-+ while (cmp_avail < cmp_len + LZO_HEADER) {
-+ ret = raw_page_get_next(cmp_buf + cmp_avail);
-+ if (unlikely(ret <= 0))
-+ return ret;
-+ cmp_avail += PAGE_SIZE;
-+ }
-+ unc_len = LZO_UNC_SIZE;
-+ ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER,
-+ cmp_len, unc_buf, &unc_len);
-+ if (unlikely(ret != LZO_E_OK)) {
-+ printf("Decompression failure:\n");
-+ printf("ret = %d\n", ret);
-+ printf("cmp_buf = %p\n", cmp_buf + LZO_HEADER);
-+ printf("cmp_len = %zu\n", cmp_len);
-+ printf("unc_len = %zu\n", unc_len);
-+ return ret;
-+ }
-+ image_pages_avail = unc_len / PAGE_SIZE;
-+ unc_offset = 0;
-+ }
-+
-+ memcpy(buffer, unc_buf + unc_offset, PAGE_SIZE);
-+ unc_offset += PAGE_SIZE;
-+ image_pages_avail--;
-+ return 1;
-+#else
-+ printf("No LZO support in u-boot.\n");
-+ return -1;
-+#endif
-+ } else {
-+ return raw_page_get_next(buffer);
-+ }
-+}
-+
-+static void image_page_exit(void)
-+{
-+ free(unc_buf);
-+ free(cmp_buf);
-+ unc_buf = cmp_buf = NULL;
-+}
-+
-+static void bitmap_set(u32 *bm, unsigned int bit)
-+{
-+ bm[bit >> 5] |= (1 << (bit & 0x1f));
-+}
-+
-+static int bitmap_is_set(u32 *bm, unsigned int bit)
-+{
-+ return !!(bm[bit >> 5] & (1 << (bit & 0x1f)));
-+}
-+
-+static u32 *used_bitmap;
-+static u32 next_free_page;
-+static u32 total_pages;
-+
-+static int free_page_init(void)
-+{
-+ total_pages = (u32)((TOP_ADDRESS -
-+ LOW_BOTTOM) / PAGE_SIZE); /* 2GB */
-+ used_bitmap = malloc(total_pages * sizeof(u32) / 32);
-+ if (!used_bitmap)
-+ return -1;
-+ return 0;
-+}
-+
-+static void free_page_start(int offset)
-+{
-+ memset(used_bitmap, 0, total_pages * sizeof(u32) / 32);
-+ next_free_page = pg_ub2zero(offset);
-+}
-+
-+static void free_page_mark_used(u32 page);
-+/* Returns full-address based pages */
-+static int free_page_get_next(void)
-+{
-+ while (bitmap_is_set(used_bitmap, next_free_page))
-+ next_free_page++;
-+ free_page_mark_used(next_free_page);
-+ return pg_zero2ub(next_free_page++);
-+}
-+
-+static void free_page_mark_used(u32 page)
-+{
-+ bitmap_set(used_bitmap, page);
-+}
-+
-+static void free_page_exit(void)
-+{
-+ free(used_bitmap);
-+ used_bitmap = NULL;
-+}
-+
-+int do_swsusp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-+{
-+ int ret;
-+ __u32 offset = 0;
-+ void *spare_page = NULL;
-+ struct swsusp_header *swsusp_header;
-+ struct swsusp_info *swsusp_info;
-+ struct swsusp_finish_context *context;
-+ int max_page;
-+ int i;
-+ u32 nr_pfn_pages;
-+ u32 **pfn_pages = NULL;
-+ u32 *remap_orig_page;
-+ u32 *remap_temp_page;
-+ u32 **remap_orig;
-+ u32 **remap_temp;
-+ int remap_idx;
-+ int m;
-+ void (*swsusp_finish_copy)(void *);
-+ char *data_page;
-+ char *stack_addr;
-+ int high_page;
-+#ifdef USE_CRC_32x4
-+ CRC32_WORD4_t calc_crc;
-+#endif
-+#ifdef PAGEMAP_DEBUG
-+ int high_page_images = 0;
-+ int total_remap = 0;
-+ if (getenv("hybdebug") != NULL)
-+ debugout = 1;
-+#endif
-+ /* Address hack */
-+ void *swsusp_finish_p = (void *)((u32)swsusp_finish & ~0x1);
-+
-+ if (argc < 2) {
-+ printf("usage: swsusp <interface> "
-+ "[<dev[:part]>] [<offset>]\n");
-+ return 0;
-+ }
-+
-+ if (argc == 4) {
-+ char *ep;
-+ offset = simple_strtoul(argv[3], &ep, 16);
-+ if (*ep) {
-+ printf("Invalid block offset\n");
-+ return 1;
-+ }
-+ }
-+
-+ /* Allow for 32 pages of stack */
-+ max_page = gd->start_addr_sp / PAGE_SIZE - 32;
-+ high_page = (((gd->relocaddr
-+ + _bss_end_ofs)+(PAGE_SIZE-1)) / PAGE_SIZE) + 1;
-+#define pfn_is_occupied(pfn) (page > max_page && page <= high_page)
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO(" *gd->start_addr_sp:%p\n", (void *)gd->start_addr_sp);
-+ PAGEMAP_INFO(" *gd->relocaddr:%p\n", (void *)gd->relocaddr);
-+ PAGEMAP_INFO(" *bss_start_offset:%d bss_end_offset:%d\n",
-+ (int)_bss_start_ofs, (int)_bss_end_ofs);
-+ PAGEMAP_INFO(" UBOOT own memory [%p-%p]\n",
-+ pg2addr(max_page), pg2addr(high_page));
-+#endif
-+
-+ if (free_page_init())
-+ goto mem_err;
-+ free_page_start(exclude_max_page + 1);
-+
-+#ifdef CONFIG_SH_DMA
-+ spare_page = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN);
-+#else
-+ spare_page = malloc(PAGE_SIZE);
-+#endif
-+ if (!spare_page)
-+ goto mem_err;
-+
-+ ret = get_device_and_partition(argv[1], argv[2], &swap_dev, &swap_info,
-+ 1);
-+ if (ret < 0)
-+ goto err;
-+
-+ swsusp_header = spare_page;
-+ if (page_read(offset, swsusp_header))
-+ goto read_err;
-+
-+#ifdef SWSUSP_DEBUG_INFO
-+ PAGEMAP_INFO("swssp_header:\n");
-+ PAGEMAP_INFO(" comp_crc: <snip>\n");
-+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size);
-+ PAGEMAP_INFO(" image(swap firest sector): %08x\n",
-+ (unsigned int)swsusp_header->image);
-+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags);
-+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig);
-+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig);
-+#endif /* SWSUSP_DEBUG_INFO */
-+
-+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) {
-+ printf("No hibernation image present\n");
-+ return 0;
-+ }
-+
-+#ifdef USE_CRC_32x4
-+ memset(&calc_crc, 0, sizeof(calc_crc));
-+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE),
-+ swsusp_header->img_size, &calc_crc);
-+
-+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32,
-+ sizeof(CRC32_WORD4_t))) {
-+ printf("Bad CRC for image, image: %08x:%08x:%08x:%08x, calc: %08x:%08x:%08x:%08x\n",
-+ swsusp_header->comp_crc32.crc_w[0],
-+ swsusp_header->comp_crc32.crc_w[1],
-+ swsusp_header->comp_crc32.crc_w[2],
-+ swsusp_header->comp_crc32.crc_w[3],
-+ calc_crc.crc_w[0], calc_crc.crc_w[1],
-+ calc_crc.crc_w[2], calc_crc.crc_w[3]);
-+ return 0;
-+ }
-+#endif
-+
-+ /* Overwrite header if necessary */
-+#ifndef SWSUSP_KEEP_IMAGE
-+ if (memcmp(swsusp_header->sig, swsusp_header->orig_sig, 10)) {
-+ memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
-+ if (page_write(offset, swsusp_header))
-+ printf("Write error resetting header\n");
-+ }
-+#endif
-+
-+ if (raw_page_init(swsusp_header->image))
-+ goto mem_err;
-+ raw_page_start();
-+
-+ if (image_page_init(!(swsusp_header->flags & SF_NOCOMPRESS_MODE)))
-+ goto mem_err;
-+ image_page_start();
-+
-+ swsusp_info = spare_page;
-+ if (raw_page_get_next(swsusp_info) <= 0)
-+ goto read_err;
-+
-+#ifdef SWSUSP_DEBUG_INFO
-+ PAGEMAP_INFO("swsup_info:\n");
-+ PAGEMAP_INFO(" utsname.sysname:%s\n", swsusp_info->uts.sysname);
-+ PAGEMAP_INFO(" nodename:%s\n", swsusp_info->uts.nodename);
-+ PAGEMAP_INFO(" release:%s\n", swsusp_info->uts.release);
-+ PAGEMAP_INFO(" version:%s\n", swsusp_info->uts.version);
-+ PAGEMAP_INFO(" machine:%s\n", swsusp_info->uts.machine);
-+ PAGEMAP_INFO(" vesion_code:%#08x\n",
-+ (unsigned int)swsusp_info->version_code);
-+ PAGEMAP_INFO(" num_physpages:%d\n",
-+ (unsigned int)swsusp_info->num_physpages);
-+ PAGEMAP_INFO(" pages :%d\n",
-+ (unsigned int)swsusp_info->pages);
-+ PAGEMAP_INFO(" size :%d\n",
-+ (unsigned int)swsusp_info->size);
-+#endif
-+
-+ nr_pfn_pages = (swsusp_info->image_pages * 4 + PAGE_SIZE - 1) /
-+ PAGE_SIZE;
-+ pfn_pages = malloc(nr_pfn_pages * sizeof(u32 *));
-+ if (!pfn_pages)
-+ goto mem_err;
-+ memset(pfn_pages, 0, nr_pfn_pages * sizeof(u32 *));
-+
-+ /* UBOOT using memory */
-+ for (i = max_page; i <= high_page; i++)
-+ free_page_mark_used(pg_ub2zero(i));
-+
-+ printf("Allocating %u bytes (nr_pfn_pages %u)\n",
-+ nr_pfn_pages * PAGE_SIZE, nr_pfn_pages);
-+
-+ for (i = 0; i < nr_pfn_pages; i++) {
-+ u32 idx;
-+#ifdef CONFIG_SH_DMA
-+ pfn_pages[i] = malloc_aligned(PAGE_SIZE, ARCH_DMA_MINALIGN);
-+#else
-+ pfn_pages[i] = malloc(PAGE_SIZE);
-+#endif
-+ if (unlikely(!pfn_pages[i]))
-+ goto mem_err;
-+ if (unlikely(image_page_get_next(pfn_pages[i]) <= 0))
-+ goto read_err;
-+ for (idx = 0; idx < PAGE_SIZE / sizeof(u32); idx++) {
-+ u32 page = pfn_pages[i][idx];
-+ if (page == ~0UL)
-+ break;
-+ free_page_mark_used(pg_ub2zero(page));
-+ }
-+ }
-+
-+ printf("Loading image data pages (%lu pages)\n",
-+ swsusp_info->image_pages);
-+
-+ remap_orig_page = pg2addr(free_page_get_next());
-+ remap_temp_page = pg2addr(free_page_get_next());
-+
-+ remap_orig = (u32 **)remap_orig_page;
-+ remap_temp = (u32 **)remap_temp_page;
-+ remap_idx = 0;
-+
-+ m = (swsusp_info->image_pages / 10) ? : 1;
-+ for (i = 0; i < swsusp_info->image_pages; i++) {
-+ u32 page = pfn_pages[i >> 10][i & 0x3ff];
-+ if (unlikely(!pfn_is_valid(page))) {
-+ printf("Attempt to restore invalid address %llx\n",
-+ pg2phys(page));
-+ continue;
-+ } else if (unlikely(pfn_is_excluded(page))) {
-+ printf("Attempt to restore excluded address %llx\n",
-+ pg2phys(page));
-+ continue;
-+ } else if (unlikely(pfn_is_low(page) &&
-+ pfn_is_occupied(page))) {
-+ remap_orig[remap_idx] = pg2addr(page);
-+ page = free_page_get_next();
-+ remap_temp[remap_idx] = pg2addr(page);
-+ remap_idx++;
-+#ifdef PAGEMAP_DEBUG
-+ ++total_remap;
-+#endif
-+ /* If we fill our current page, allocate a new one */
-+ if (remap_idx + 1 == PAGE_SIZE / sizeof(u32)) {
-+ u32 *next;
-+
-+ next = pg2addr(free_page_get_next());
-+ remap_orig[remap_idx] = next;
-+ remap_orig = (u32 **)next;
-+
-+ next = pg2addr(free_page_get_next());
-+ remap_temp[remap_idx] = next;
-+ remap_temp = (u32 **)next;
-+
-+ remap_idx = 0;
-+ }
-+ }
-+ if (image_page_get_next(pg2addr(page)) <= 0)
-+ goto read_err;
-+ if (!(i % m))
-+ printf("Image loading progress: %3d%%\n", 10 * i / m);
-+ }
-+
-+ printf("Image loading done.\n");
-+ invalidate_icache_all();
-+
-+ /* put end markers on the remap list */
-+ remap_orig[remap_idx] = (void *) ~0UL;
-+ remap_temp[remap_idx] = (void *) ~0UL;
-+
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO("Number of remap pages:%d\n",
-+ total_remap);
-+ PAGEMAP_INFO("Number of high pages:%d\n",
-+ high_page_images);
-+ PAGEMAP_INFO("Last read page %d (%08x)\n",
-+ _last_read_pages,
-+ _last_read_pages * PAGE_SIZE);
-+#endif
-+ remap_orig = (u32 **)remap_orig_page;
-+ remap_temp = (u32 **)remap_temp_page;
-+
-+ /* Make a copy of swsusp_finish in a free data page */
-+ data_page = pg2addr(free_page_get_next());
-+ memcpy(data_page, swsusp_finish_p, PAGE_SIZE);
-+ swsusp_finish_copy = (void *) data_page;
-+
-+ /* Setup context for swsusp_finish at the end of the data_page */
-+ context = (struct swsusp_finish_context *) (data_page + PAGE_SIZE -
-+ sizeof(struct swsusp_finish_context));
-+ context->remap_orig_page = remap_orig_page;
-+ context->remap_temp_page = remap_temp_page;
-+ memcpy((void *)&context->archdata, (void *)swsusp_info->archdata,
-+ sizeof(struct swsusp_archdata));
-+
-+ /* Get a stack pointer for swsusp_finish, growing down from context */
-+ stack_addr = (char *) context;
-+
-+#ifdef CONFIG_NETCONSOLE
-+ /*
-+ * Stop the ethernet stack if NetConsole could have
-+ * left it up
-+ */
-+ eth_halt();
-+#endif
-+
-+#ifdef CONFIG_USB_DEVICE
-+ udc_disconnect();
-+#endif
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO("Execution routine: %08x\n",
-+ (u32)context->archdata.cpu_resume_restore_nosave);
-+#endif
-+ arch_preboot_os();
-+ cleanup_before_linux();
-+
-+ /* Copy the final data from a safe place */
-+ call_with_stack(swsusp_finish_copy, context, stack_addr);
-+
-+ return 0;
-+
-+mem_err:
-+ printf("Not enough memory.\n");
-+ goto err;
-+
-+read_err:
-+ printf("Read error while restoring image.\n");
-+
-+err:
-+ __asm__ volatile (
-+ "mov r0, #0\n"
-+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n"
-+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n"
-+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n"
-+ : : : "r0", "memory");
-+
-+ raw_page_exit();
-+ image_page_exit();
-+ free_page_exit();
-+ if (pfn_pages) {
-+ for (i = 0; i < nr_pfn_pages; i++)
-+ free(pfn_pages[i]);
-+ free(pfn_pages);
-+ }
-+ free(spare_page);
-+
-+ return 1;
-+}
-+
-+U_BOOT_CMD(swsusp, 4, 0, do_swsusp,
-+ "Restore SWSUSP hibernation image",
-+ "<interface> [<dev[:part]>] [<offset>]"
-+);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch
deleted file mode 100644
index 2a525d39a..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0002-Enable-swsusp-DMA-support.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 33dfe19185b35fc61613070032836beee0f48c45 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:45:39 +0900
-Subject: [PATCH 2/3] Enable swsusp DMA support
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- common/cmd_swsusp.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 58 insertions(+)
-
-diff --git a/common/cmd_swsusp.c b/common/cmd_swsusp.c
-index ba05aa4..b1d6c22 100644
---- a/common/cmd_swsusp.c
-+++ b/common/cmd_swsusp.c
-@@ -226,6 +226,53 @@ static inline void *malloc_aligned(u32 size, u32 align)
- return (void *)(((u32)malloc(size + align) + align - 1) & ~(align - 1));
- }
-
-+static int block_read(u32 page, void *addr, u32 count)
-+{
-+ __u32 cnt;
-+ int blk_per_page;
-+
-+ blk_per_page = PAGE_SIZE / swap_dev->blksz;
-+ cnt = swap_dev->block_read(swap_dev->dev,
-+ swap_info.start + (page * blk_per_page),
-+ count * blk_per_page, addr);
-+
-+ return cnt != count * blk_per_page;
-+}
-+
-+static int get_block(unsigned char *buffer, u32 size)
-+{
-+ int need_num_pages = size / PAGE_SIZE;
-+ int read_pages = 0;
-+ int count;
-+ u64 start;
-+
-+ do {
-+ u64 prev;
-+ count = 0;
-+
-+ if (!get_meta())
-+ goto exit;
-+
-+ prev = start = meta_map->entries[meta_idx];
-+ do {
-+ count++;
-+ meta_idx++;
-+ if (meta_map->entries[meta_idx] - prev > 1)
-+ break;
-+ prev = meta_map->entries[meta_idx];
-+ } while (read_pages + count < need_num_pages &&
-+ meta_idx < ARRAY_SIZE(meta_map->entries));
-+
-+ if (block_read(start, buffer, count))
-+ return -1;
-+ read_pages += count;
-+ buffer += count * PAGE_SIZE;
-+ } while (read_pages < need_num_pages);
-+
-+exit:
-+ return read_pages * PAGE_SIZE;
-+}
-+
- #endif
-
- static int page_read(u32 page, void *addr)
-@@ -465,12 +512,23 @@ static int image_page_get_next(void *buffer)
- cmp_len = *(size_t *) cmp_buf;
- cmp_avail = PAGE_SIZE;
-
-+#ifdef CONFIG_SH_DMA
-+ while (cmp_avail < cmp_len + LZO_HEADER) {
-+ /* try to DMA-read whole block */
-+ ret = get_block(cmp_buf + cmp_avail,
-+ cmp_len + LZO_HEADER);
-+ if (unlikely(ret <= 0))
-+ return ret;
-+ cmp_avail += ret;
-+ }
-+#else
- while (cmp_avail < cmp_len + LZO_HEADER) {
- ret = raw_page_get_next(cmp_buf + cmp_avail);
- if (unlikely(ret <= 0))
- return ret;
- cmp_avail += PAGE_SIZE;
- }
-+#endif
- unc_len = LZO_UNC_SIZE;
- ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER,
- cmp_len, unc_buf, &unc_len);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch
deleted file mode 100755
index 8bfcccbbf..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch
+++ /dev/null
@@ -1,1058 +0,0 @@
-From 4ce00daa904a40701ab6bed44506fe97b8f1da47 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 19 May 2017 14:48:38 +0900
-Subject: [PATCH 3/4] Add Hibernation swsuspmem command support
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- common/Makefile | 2 +
- common/cmd_swsuspmem.c | 944 +++++++++++++++++++++++++++++++++++++++++++++
- include/swsuspmem.h | 24 ++
- lib/lzo/lzo1x_decompress.c | 12 +-
- 4 files changed, 980 insertions(+), 2 deletions(-)
- create mode 100644 common/cmd_swsuspmem.c
- create mode 100644 include/swsuspmem.h
-
-diff --git a/common/Makefile b/common/Makefile
-index 54fcc81..7a18486 100644
---- a/common/Makefile
-+++ b/common/Makefile
-@@ -160,6 +160,8 @@ COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
- COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
- COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
- COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
-+COBJS-$(CONFIG_CMD_SWSUSP) += cmd_swsusp.o
-+COBJS-$(CONFIG_CMD_SWSUSPMEM) += cmd_swsuspmem.o
- COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
- COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
- COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
-diff --git a/common/cmd_swsuspmem.c b/common/cmd_swsuspmem.c
-new file mode 100644
-index 0000000..6980aaf
---- /dev/null
-+++ b/common/cmd_swsuspmem.c
-@@ -0,0 +1,944 @@
-+/*
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <common.h>
-+#include <command.h>
-+#include <part.h>
-+#include <malloc.h>
-+
-+#include <linux/lzo.h>
-+#include "../arch/arm/cpu/armv7/rmobile/crc32_word4.h"
-+#include <swsuspmem.h>
-+
-+/* Note for Renesas--based boards:
-+ * We have the following memory split here:
-+ * 0x40000000 - u_boot_lowest - used to store pfns at physical addresses
-+ * u_boot_lowest - 0x8000000 - pfns are relocated, and then later put
-+ * on physical addresses (swsusp_finish)
-+ * 0x8000000 - 0xc0000000 - used to store pfns with physical address
-+ * of 0x200000000 (long address), we have to change offset for them.
-+ * Any pfn with address > 0x8000000 but less than 0x200000000
-+ * is an error.
-+ * For boards which do not have memory above first GB, that will
-+ * still work, as they won't have anything above 0x80000000
-+ * in their image, so for standard 2GB setup ou should put
-+ * your secong GB in 0x80000000-0xC0000000 range, you can
-+ * use MMU for that or if your RAM is continous, it will
-+ * naturally be there. */
-+
-+DECLARE_GLOBAL_DATA_PTR;
-+
-+/* #define PAGEMAP_DEBUG */
-+
-+#ifdef PAGEMAP_DEBUG
-+#define SWSUSP_DEBUG_INFO
-+#endif
-+
-+#define SWSUSP_KEEP_IMAGE
-+
-+#ifndef likely
-+# define likely(x) __builtin_expect(!!(x), 1)
-+# define unlikely(x) __builtin_expect(!!(x), 0)
-+#endif
-+
-+#define HIBERNATE_SIG "S1SUSPEND"
-+#define PAGE_SIZE (4096)
-+/* Define depending on CONFIG_LBDAF in kernel */
-+
-+typedef u64 sector_t;
-+
-+struct swsusp_header {
-+ char reserved[PAGE_SIZE - 20
-+ - sizeof(sector_t) - sizeof(int) - sizeof(u32)
-+ - sizeof(CRC32_WORD4_t) - sizeof(u32)];
-+ CRC32_WORD4_t comp_crc32;
-+ u32 img_size; /* append */
-+ u32 crc32;
-+ sector_t image;
-+ unsigned int flags;
-+ char orig_sig[10];
-+ char sig[10];
-+} __packed;
-+
-+#define __NEW_UTS_LEN 64
-+
-+struct new_utsname {
-+ char sysname[__NEW_UTS_LEN + 1];
-+ char nodename[__NEW_UTS_LEN + 1];
-+ char release[__NEW_UTS_LEN + 1];
-+ char version[__NEW_UTS_LEN + 1];
-+ char machine[__NEW_UTS_LEN + 1];
-+ char domainname[__NEW_UTS_LEN + 1];
-+};
-+
-+struct swsusp_archdata {
-+ u32 nosave_backup_phys;
-+ u32 nosave_begin_phys;
-+ u32 nosave_end_phys;
-+ void (*cpu_resume_restore_nosave)(u32, u32, u32);
-+};
-+
-+struct swsusp_info {
-+ struct new_utsname uts;
-+ u32 version_code;
-+ unsigned long num_physpages;
-+ int cpus;
-+ unsigned long image_pages;
-+ unsigned long pages;
-+ unsigned long size;
-+ char archdata[1024];
-+};
-+
-+struct swap_map_page {
-+ u64 entries[PAGE_SIZE / sizeof(u64) - 1];
-+ u64 next_swap;
-+};
-+
-+struct swsusp_finish_context {
-+ void *remap_orig_page;
-+ void *remap_temp_page;
-+ struct swsusp_archdata archdata;
-+};
-+#ifdef FTEN_SPF_SDRAM_BASE
-+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE)
-+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET)
-+#else
-+#define USED_ADDRESS_TOP (0x40000000)
-+#define USED_ADDRESS_END (0x48000000)
-+#endif
-+#define PG_UB2ZERO(pg) ((pg) - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE)
-+static u32 const exclude_min_page =
-+ (USED_ADDRESS_TOP) / PAGE_SIZE;
-+static u32 const exclude_max_page =
-+ (USED_ADDRESS_END - 1) / PAGE_SIZE;
-+static u32 const exclude_min_page_ub =
-+ PG_UB2ZERO((USED_ADDRESS_TOP) / PAGE_SIZE);
-+static u32 const exclude_max_page_ub =
-+ PG_UB2ZERO((USED_ADDRESS_END-1) / PAGE_SIZE);
-+
-+/*
-+ #define SD_PLATFORM_MODE 1
-+ #define SD_CRC32_MODE 4
-+ */
-+#define SF_NOCOMPRESS_MODE 2
-+
-+#define LZO_HEADER sizeof(size_t)
-+
-+/* Number of pages/bytes we'll compress at one time. */
-+#define LZO_UNC_PAGES 32
-+#define LZO_UNC_SIZE (LZO_UNC_PAGES * PAGE_SIZE)
-+
-+/* Number of pages/bytes we need for compressed data (worst case). */
-+#define LZO_CMP_PAGES DIV_ROUND_UP(lzo1x_worst_compress(LZO_UNC_SIZE) + \
-+ LZO_HEADER, PAGE_SIZE)
-+#define LZO_CMP_SIZE (LZO_CMP_PAGES * PAGE_SIZE)
-+
-+static struct swsuspmem_hook *_hook;
-+
-+#define CALL_HOOK(f, param) \
-+ do { \
-+ if (_hook != NULL) { \
-+ if (_hook->f != NULL) \
-+ _hook->f(param); \
-+ } \
-+ } while (0)
-+
-+#ifdef PAGEMAP_DEBUG
-+static int debugout;
-+static int _last_read_pages;
-+#define PAGEMAP_INFO(_msg, ...) \
-+ do { \
-+ if (debugout == 1) \
-+ printf(_msg, ## __VA_ARGS__); \
-+ } while (0)
-+#endif
-+
-+#define HIGHMEM_PHYS_ADDR 0x200000000ULL
-+#define HIGHMEM_VA 0x80000000UL
-+#define HIGHMEM_PFN (HIGHMEM_PHYS_ADDR / PAGE_SIZE)
-+#define LOW_TOP 0x80000000
-+#define LOW_TOP_PFN (LOW_TOP / PAGE_SIZE)
-+#define LOW_BOTTOM CONFIG_SYS_SDRAM_BASE
-+#define LOW_BOTTOM_PFN (LOW_BOTTOM / PAGE_SIZE)
-+#define TOP_ADDRESS 0x240000000ULL
-+
-+static inline int pfn_is_low(u32 pfn)
-+{
-+ return ((pfn >= LOW_BOTTOM_PFN) && (pfn < LOW_TOP_PFN));
-+}
-+
-+static inline int pfn_is_high(u32 pfn)
-+{
-+ return (pfn >= HIGHMEM_PFN);
-+}
-+
-+#define pfn_is_valid(p) (pfn_is_low(p) || pfn_is_high(p))
-+
-+static inline int pfn_is_excluded(u32 pfn)
-+{
-+ /* Allow bottom 2 pages for exception vectors */
-+ if (pfn < (LOW_BOTTOM_PFN + 2))
-+ return 0;
-+ else if (exclude_min_page >= exclude_max_page)
-+ return 0;
-+ else
-+ return (pfn >= exclude_min_page) && (pfn <= exclude_max_page);
-+}
-+/* PFN to zero-counted page */
-+static inline u32 pg_ub2zero(u32 pg)
-+{
-+ return pg - LOW_BOTTOM_PFN;
-+}
-+
-+/* zero-counted page to PFN */
-+static inline u32 pg_zero2ub(u32 pg)
-+{
-+ return pg + LOW_BOTTOM_PFN;
-+}
-+
-+/* PFN to physical address (64-bit (40-bit)) */
-+static inline u64 pg2phys(u32 page)
-+{
-+ return (u64) page * PAGE_SIZE;
-+}
-+
-+/* PFN to virtual address */
-+static inline void *pg2addr(u32 page)
-+{
-+ void *addr;
-+ if (page >= HIGHMEM_PFN)
-+ addr = (void *) (u32)(pg2phys(page - HIGHMEM_PFN) + HIGHMEM_VA);
-+ else
-+ addr = (void *) (u32)pg2phys(page);
-+
-+ return addr;
-+}
-+/* Virtual address to PFN */
-+static inline u32 addr2pg(void *addr)
-+{
-+ return ((u32)(addr)) / PAGE_SIZE;
-+}
-+static void *offt_addr = (void *)0x44000000;
-+static int page_read_mem(u64 page, void *addr)
-+{
-+ memcpy(addr, (u8 *)offt_addr + page * PAGE_SIZE, PAGE_SIZE);
-+ return 0;
-+}
-+
-+#ifndef SWSUSP_KEEP_IMAGE
-+static int page_write_mem(u32 page, void *addr)
-+{
-+ memcpy((u8 *)offt_addr + page * PAGE_SIZE, addr, PAGE_SIZE);
-+ return 0;
-+}
-+#endif
-+
-+#define FAST_COPY
-+static void __attribute__((section(".rodata")))
-+ __attribute__((optimize("O6", "unroll-loops")))
-+swsusp_finish(void *userdata)
-+{
-+ struct swsusp_finish_context *context = userdata;
-+ u32 **remap_orig;
-+ u32 **remap_temp;
-+ int idx = 0;
-+ const int lastidx = PAGE_SIZE / sizeof(u32) - 1;
-+
-+ remap_orig = context->remap_orig_page;
-+ remap_temp = context->remap_temp_page;
-+
-+ __asm__ volatile ("" : : : "memory");
-+ for (;;) {
-+ u32 *orig, *temp;
-+ int count;
-+
-+ /* Linked list to next page */
-+ if (idx == lastidx) {
-+ remap_orig = (u32 **)remap_orig[idx];
-+ remap_temp = (u32 **)remap_temp[idx];
-+ idx = 0;
-+ }
-+ if (unlikely(!remap_orig || remap_orig[idx] == (u32 *)~0UL))
-+ break;
-+ orig = remap_orig[idx];
-+ temp = remap_temp[idx];
-+#ifdef FAST_COPY
-+ count = PAGE_SIZE / sizeof(u32) / 32;
-+ __asm__ volatile (
-+ "1:\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "ldmia %[rtemp]!, {r0-r7}\n"
-+ "subs %[count], %[count], #1\n"
-+ "stmia %[rorig]!, {r0-r7}\n"
-+ "bgt 1b\n"
-+ : /* No outputs */
-+ :
-+ [rorig]"h" (orig),
-+ [rtemp]"h" (temp),
-+ [count]"h" (count)
-+ : "r0", "r1", "r2", "r3",
-+ "r4", "r5", "r6", "r7",
-+ "cc", "memory"
-+ );
-+#else
-+ count = PAGE_SIZE / sizeof(u32);
-+ while (count--)
-+ *orig++ = *temp++;
-+#endif
-+#ifdef SWSUSP_CHECK_COPY_RESULT
-+ count = PAGE_SIZE / sizeof(u32);
-+ orig = remap_orig[idx];
-+ temp = remap_temp[idx];
-+ __asm__ volatile (
-+ "1:\n"
-+ "ldr r3, [%[rorig]]\n"
-+ "ldr r4, [%[rtemp]]\n"
-+ "cmp r3, r4\n"
-+ "bne 2f\n"
-+ "add %[rorig], %[rorig], #4\n"
-+ "add %[rtemp], %[rtemp], #4\n"
-+ "subs %[count], %[count], #1\n"
-+ "bgt 1b\n"
-+ "b 3f\n"
-+ "2:b 2b\n"
-+ "3:\n"
-+ :
-+ [rorig]"+r" (orig),
-+ [rtemp]"+r" (temp),
-+ [count]"+r" (count)
-+ :
-+ : "r3", "r4", "cc", "memory"
-+ );
-+#endif
-+ idx++;
-+ }
-+ context->archdata.cpu_resume_restore_nosave(
-+ context->archdata.nosave_backup_phys,
-+ context->archdata.nosave_begin_phys,
-+ context->archdata.nosave_end_phys);
-+}
-+
-+static struct swap_map_page *meta_map;
-+static u64 meta_map_next;
-+static u64 meta_map_curr;
-+static u64 meta_map_start;
-+static int meta_idx;
-+
-+static int raw_page_init(u64 start)
-+{
-+ meta_map = malloc(PAGE_SIZE);
-+ if (!meta_map)
-+ return -1;
-+ meta_map_next = 0;
-+ meta_map_curr = 0;
-+ meta_map_start = start;
-+ return 0;
-+}
-+
-+static void raw_page_start(void)
-+{
-+ meta_idx = ARRAY_SIZE(meta_map->entries);
-+ meta_map_next = meta_map_start;
-+}
-+
-+static int raw_page_get_next(void *buffer)
-+{
-+ if (meta_idx == ARRAY_SIZE(meta_map->entries)) {
-+ if (!meta_map_next)
-+ return 0;
-+ if (meta_map_curr != meta_map_next) {
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO("META: %d (%08x)\n", (int)meta_map_next,
-+ (unsigned int)(meta_map_next
-+ * PAGE_SIZE));
-+#endif
-+ if (page_read_mem(meta_map_next, meta_map))
-+ return -1;
-+ meta_map_curr = meta_map_next;
-+ meta_map_next = meta_map->next_swap;
-+ }
-+ meta_idx = 0;
-+ }
-+#ifdef PAGEMAP_DEBUG
-+ {
-+ static unsigned int pre;
-+ if ((pre + 1) != meta_map->entries[meta_idx]) {
-+ PAGEMAP_INFO("DATA-Skiped: %d->%d (%08x->%08x)\n",
-+ pre, (unsigned int)meta_map->entries[meta_idx],
-+ pre * PAGE_SIZE,
-+ (unsigned int)(meta_map->entries[meta_idx]
-+ * PAGE_SIZE));
-+ }
-+ pre = meta_map->entries[meta_idx];
-+ _last_read_pages = pre;
-+ }
-+#endif
-+ if (page_read_mem(meta_map->entries[meta_idx++], buffer))
-+ return -1;
-+
-+ return 1;
-+}
-+
-+static void raw_page_exit(void)
-+{
-+ free(meta_map);
-+ meta_map = NULL;
-+}
-+
-+static int image_pages_avail;
-+static unsigned char *unc_buf, *cmp_buf;
-+static int unc_offset;
-+
-+static int image_page_init(int compressed)
-+{
-+ if (!compressed)
-+ return 1;
-+
-+ unc_buf = malloc(LZO_UNC_SIZE);
-+ cmp_buf = malloc(LZO_CMP_SIZE);
-+ if (!unc_buf || !cmp_buf) {
-+ printf("not enogh memory\n");
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+static void image_page_start(void)
-+{
-+ image_pages_avail = 0;
-+}
-+
-+static int image_page_get_next(void *buffer)
-+{
-+#ifdef CONFIG_LZO
-+ if (!image_pages_avail) {
-+ int ret;
-+ size_t unc_len, cmp_len, cmp_avail;
-+
-+ ret = raw_page_get_next(cmp_buf);
-+ if (ret <= 0)
-+ return ret;
-+
-+ cmp_len = *(size_t *) cmp_buf;
-+ cmp_avail = PAGE_SIZE;
-+
-+ while (cmp_avail < cmp_len + LZO_HEADER) {
-+ ret = raw_page_get_next(cmp_buf + cmp_avail);
-+ if (unlikely(ret <= 0))
-+ return ret;
-+ cmp_avail += PAGE_SIZE;
-+ }
-+
-+ unc_len = LZO_UNC_SIZE;
-+ ret = lzo1x_decompress_safe(cmp_buf + LZO_HEADER,
-+ cmp_len, unc_buf, &unc_len);
-+ if (unlikely(ret != LZO_E_OK)) {
-+ printf("Decompression failure: %d,"
-+ " cmp_buf = %p,"
-+ " cmp_len = %d, unc_len = %d\n",
-+ ret, cmp_buf + LZO_HEADER, cmp_len,
-+ unc_len);
-+ return ret;
-+ }
-+ image_pages_avail = unc_len / PAGE_SIZE;
-+ unc_offset = 0;
-+ }
-+
-+ memcpy(buffer, unc_buf + unc_offset, PAGE_SIZE);
-+ unc_offset += PAGE_SIZE;
-+ image_pages_avail--;
-+ return 1;
-+#else
-+ printf("No LZO support in u-boot.\n");
-+ return -1;
-+#endif
-+}
-+
-+static void image_page_exit(void)
-+{
-+ free(unc_buf);
-+ free(cmp_buf);
-+ unc_buf = cmp_buf = NULL;
-+}
-+
-+static void bitmap_set(u32 *bm, unsigned int bit)
-+{
-+ bm[bit >> 5] |= (1 << (bit & 0x1f));
-+}
-+
-+static int bitmap_is_set(u32 *bm, unsigned int bit)
-+{
-+ return !!(bm[bit >> 5] & (1 << (bit & 0x1f)));
-+}
-+
-+static u32 *used_bitmap;
-+static u32 next_free_page;
-+static u32 total_pages;
-+
-+static int free_page_init(void)
-+{
-+ total_pages = (u32)((TOP_ADDRESS -
-+ LOW_BOTTOM) / PAGE_SIZE); /* 2GB */
-+ used_bitmap = malloc(total_pages * sizeof(u32) / 32);
-+ if (!used_bitmap)
-+ return -1;
-+ return 0;
-+}
-+
-+static void free_page_start(int offset)
-+{
-+ memset(used_bitmap, 0, total_pages * sizeof(u32) / 32);
-+ next_free_page = pg_ub2zero(offset);
-+}
-+
-+static void free_page_mark_used(u32 page);
-+/* Returns full-address based pages */
-+static int free_page_get_next(void)
-+{
-+ while (bitmap_is_set(used_bitmap, next_free_page))
-+ next_free_page++;
-+ free_page_mark_used(next_free_page);
-+ return pg_zero2ub(next_free_page++);
-+}
-+
-+static void free_page_mark_used(u32 page)
-+{
-+ bitmap_set(used_bitmap, page);
-+}
-+
-+static void free_page_exit(void)
-+{
-+ free(used_bitmap);
-+ used_bitmap = NULL;
-+}
-+
-+void set_swsuspmem_hook(struct swsuspmem_hook *hook)
-+{
-+ _hook = hook;
-+}
-+
-+/*
-+ * rtn = 1 : Hibernation image OK.
-+ * rtn = 0 : Hibernation image NG.
-+ * */
-+int do_checksnapimage(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-+{
-+ __u32 offset = 0;
-+ void *spare_page = NULL;
-+ struct swsusp_header *swsusp_header;
-+ CRC32_WORD4_t calc_crc;
-+
-+ /* Address hack */
-+ if (argc > 1) {
-+ char *ep;
-+ offt_addr = (void *)simple_strtoul(argv[1], &ep, 16);
-+ if (*ep) {
-+ printf("Invalid address\n");
-+ return 0;
-+ }
-+ }
-+
-+ spare_page = malloc(PAGE_SIZE);
-+ if (!spare_page)
-+ goto mem_err;
-+
-+ swsusp_header = spare_page;
-+ if (page_read_mem(offset, swsusp_header))
-+ goto read_err;
-+
-+#ifdef SWSUSP_DEBUG_INFO
-+ PAGEMAP_INFO("swssp_header:%x\n", swsusp_header);
-+ PAGEMAP_INFO(" comp_crc: <snip>\n");
-+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size);
-+ PAGEMAP_INFO(" image(swap firest sector): %08x\n",
-+ (unsigned int)swsusp_header->image);
-+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags);
-+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig);
-+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig);
-+#endif /* SWSUSP_DEBUG_INFO */
-+
-+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)
-+ || (swsusp_header->img_size == 0)
-+ || (swsusp_header->img_size > 0x03fff000)) {
-+ printf("No hibernation image present\n");
-+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
-+ return 0;
-+ }
-+ memset(&calc_crc, 0, sizeof(calc_crc));
-+
-+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE),
-+ swsusp_header->img_size, &calc_crc);
-+
-+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32,
-+ sizeof(CRC32_WORD4_t))) {
-+ printf("Bad CRC for image, image: %08x:%08x:"
-+ "%08x:%08x, calc: %08x:%08x:%08x:%08x\n",
-+ swsusp_header->comp_crc32.crc_w[0],
-+ swsusp_header->comp_crc32.crc_w[1],
-+ swsusp_header->comp_crc32.crc_w[2],
-+ swsusp_header->comp_crc32.crc_w[3],
-+ calc_crc.crc_w[0], calc_crc.crc_w[1],
-+ calc_crc.crc_w[2], calc_crc.crc_w[3]);
-+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
-+ return 0;
-+ }
-+ free(spare_page);
-+ printf("Hibernation image OK!.\n");
-+
-+ return 1;
-+
-+mem_err:
-+ printf("Not enough memory.\n");
-+ CALL_HOOK(err_hook, SWSUSPMEM_ENOMEM);
-+ goto err;
-+
-+read_err:
-+ printf("Read error while restoring image.\n");
-+
-+err:
-+ __asm__ volatile (
-+ "mov r0, #0\n"
-+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n"
-+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n"
-+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n"
-+ : : : "r0", "memory");
-+
-+ free(spare_page);
-+
-+ CALL_HOOK(err_hook, SWSUSPMEM_RESTOREFAIL);
-+ return 0;
-+}
-+
-+U_BOOT_CMD(checksnapimage, 2, 2, do_checksnapimage,
-+ "Check hibernation image data from memory",
-+ "<address>]"
-+);
-+
-+int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-+{
-+ __u32 offset = 0;
-+ void *spare_page = NULL;
-+ struct swsusp_header *swsusp_header;
-+ struct swsusp_info *swsusp_info;
-+ struct swsusp_finish_context *context;
-+ int max_page;
-+ int i;
-+ u32 nr_pfn_pages;
-+ u32 **pfn_pages = NULL;
-+ u32 *remap_orig_page;
-+ u32 *remap_temp_page;
-+ u32 **remap_orig;
-+ u32 **remap_temp;
-+ int remap_idx;
-+ void (*swsusp_finish_copy)(void *);
-+ char *data_page;
-+ char *stack_addr;
-+ CRC32_WORD4_t calc_crc;
-+ int high_page;
-+
-+#ifdef PAGEMAP_DEBUG
-+ int high_page_images = 0;
-+ int total_remap = 0;
-+ if (getenv("hybdebug") != NULL)
-+ debugout = 1;
-+#endif
-+ /* Address hack */
-+ void *swsusp_finish_p = (void *)((u32)swsusp_finish & ~0x1);
-+ if (argc > 1) {
-+ char *ep;
-+ offt_addr = (void *)simple_strtoul(argv[1], &ep, 16);
-+ if (*ep) {
-+ printf("Invalid address\n");
-+ return 1;
-+ }
-+ }
-+
-+ /* Allow for 16 pages of stack */
-+ max_page = gd->start_addr_sp / PAGE_SIZE - 32;
-+ high_page = (((gd->relocaddr + _bss_end_ofs)
-+ + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1;
-+#define pfn_is_occupied(pfn) (page > max_page && page <= high_page)
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO(" *gd->start_addr_sp:%p\n",
-+ (void *)gd->start_addr_sp);
-+ PAGEMAP_INFO(" *gd->relocaddr:%p\n",
-+ (void *)gd->relocaddr);
-+ PAGEMAP_INFO(" *bss_start_offset:%d bss_end_offset:%d\n",
-+ (int)_bss_start_ofs, (int)_bss_end_ofs);
-+ PAGEMAP_INFO(" UBOOT own memory [%p-%p]\n",
-+ pg2addr(max_page), pg2addr(high_page));
-+#endif
-+ if (free_page_init())
-+ goto mem_err;
-+ free_page_start(exclude_max_page + 1);
-+
-+ spare_page = malloc(PAGE_SIZE);
-+ if (!spare_page)
-+ goto mem_err;
-+
-+ swsusp_header = spare_page;
-+ if (page_read_mem(offset, swsusp_header))
-+ goto read_err;
-+
-+#ifdef SWSUSP_DEBUG_INFO
-+ PAGEMAP_INFO("swssp_header:\n");
-+ PAGEMAP_INFO(" comp_crc: <snip>\n");
-+ PAGEMAP_INFO(" img_size: %d\n", swsusp_header->img_size);
-+ PAGEMAP_INFO(" image(swap firest sector): %08x\n",
-+ (unsigned int)swsusp_header->image);
-+ PAGEMAP_INFO(" flags: %08x\n", swsusp_header->flags);
-+ PAGEMAP_INFO(" orig_sig:%s\n", swsusp_header->orig_sig);
-+ PAGEMAP_INFO(" sig:%s\n", swsusp_header->sig);
-+#endif /* SWSUSP_DEBUG_INFO */
-+
-+ if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)
-+ || (swsusp_header->img_size == 0)
-+ || (swsusp_header->img_size > 0x03fff000)) {
-+ printf("No hibernation image present\n");
-+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
-+ return 0;
-+ }
-+ memset(&calc_crc, 0, sizeof(calc_crc));
-+
-+ calc_crc32x4((u8 *)((unsigned long)offt_addr + PAGE_SIZE),
-+ swsusp_header->img_size, &calc_crc);
-+
-+ if (memcmp(&calc_crc, &swsusp_header->comp_crc32,
-+ sizeof(CRC32_WORD4_t))) {
-+ printf("Bad CRC for image, image: %08x:%08x:"
-+ "%08x:%08x, calc: %08x:%08x:%08x:%08x\n",
-+ swsusp_header->comp_crc32.crc_w[0],
-+ swsusp_header->comp_crc32.crc_w[1],
-+ swsusp_header->comp_crc32.crc_w[2],
-+ swsusp_header->comp_crc32.crc_w[3],
-+ calc_crc.crc_w[0], calc_crc.crc_w[1],
-+ calc_crc.crc_w[2], calc_crc.crc_w[3]);
-+ CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
-+ return 0;
-+ }
-+
-+ /* Overwrite header if necessary */
-+#ifndef SWSUSP_KEEP_IMAGE
-+ if (memcmp(swsusp_header->sig, swsusp_header->orig_sig, 10)) {
-+ memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
-+ if (page_write_mem(offset, swsusp_header))
-+ printf("Write error resetting header\n");
-+ }
-+#endif
-+
-+ if (raw_page_init(swsusp_header->image))
-+ goto mem_err;
-+ raw_page_start();
-+
-+ if (image_page_init(!(swsusp_header->flags & SF_NOCOMPRESS_MODE)))
-+ goto mem_err;
-+ image_page_start();
-+
-+ swsusp_info = spare_page;
-+ if (raw_page_get_next(swsusp_info) <= 0)
-+ goto read_err;
-+
-+#ifdef SWSUSP_DEBUG_INFO
-+ PAGEMAP_INFO("swsup_info:\n");
-+ PAGEMAP_INFO(" utsname.sysname:%s\n",
-+ swsusp_info->uts.sysname);
-+ PAGEMAP_INFO(" nodename:%s\n",
-+ swsusp_info->uts.nodename);
-+ PAGEMAP_INFO(" release:%s\n",
-+ swsusp_info->uts.release);
-+ PAGEMAP_INFO(" version:%s\n",
-+ swsusp_info->uts.version);
-+ PAGEMAP_INFO(" machine:%s\n",
-+ swsusp_info->uts.machine);
-+ PAGEMAP_INFO(" vesion_code:%#08x\n",
-+ (unsigned int)swsusp_info->version_code);
-+ PAGEMAP_INFO(" num_physpages:%d\n",
-+ (unsigned int)swsusp_info->num_physpages);
-+ PAGEMAP_INFO(" pages :%d\n",
-+ (unsigned int)swsusp_info->pages);
-+ PAGEMAP_INFO(" size :%d\n",
-+ (unsigned int)swsusp_info->size);
-+#endif
-+
-+ nr_pfn_pages = (swsusp_info->image_pages * 4 + PAGE_SIZE - 1) /
-+ PAGE_SIZE;
-+ pfn_pages = malloc(nr_pfn_pages * sizeof(u32 *));
-+ if (!pfn_pages)
-+ goto mem_err;
-+ memset(pfn_pages, 0, nr_pfn_pages * sizeof(u32 *));
-+
-+ /* UBOOT using memory */
-+ for (i = max_page; i <= high_page; i++)
-+ free_page_mark_used(pg_ub2zero(i));
-+
-+ printf("Allocating %u bytes (nr_pfn_pages %u)\n",
-+ nr_pfn_pages * PAGE_SIZE, nr_pfn_pages);
-+
-+ for (i = 0; i < nr_pfn_pages; i++) {
-+ u32 idx;
-+ pfn_pages[i] = malloc(PAGE_SIZE);
-+ memset(pfn_pages[i], 0xff, PAGE_SIZE);
-+ if (unlikely(!pfn_pages[i]))
-+ goto mem_err;
-+ if (unlikely(image_page_get_next(pfn_pages[i]) <= 0))
-+ goto read_err;
-+ for (idx = 0; idx < PAGE_SIZE / sizeof(u32); idx++) {
-+ u32 page = pfn_pages[i][idx];
-+ if (page == ~0UL) /* End of list of pages */
-+ break;
-+ free_page_mark_used(pg_ub2zero(page));
-+ }
-+ }
-+
-+ printf("Loading image data pages (%lu pages)\n",
-+ swsusp_info->image_pages);
-+
-+ remap_orig_page = pg2addr(free_page_get_next());
-+ remap_temp_page = pg2addr(free_page_get_next());
-+
-+ remap_orig = (u32 **)remap_orig_page;
-+ remap_temp = (u32 **)remap_temp_page;
-+ remap_idx = 0;
-+
-+ for (i = 0; i < swsusp_info->image_pages; i++) {
-+ u32 page = pfn_pages[i >> 10][i & 0x3ff];
-+ if (unlikely(!pfn_is_valid(page))) {
-+ printf("Attempt to restore invalid address %llx\n",
-+ pg2phys(page));
-+ continue;
-+ } else if (unlikely(pfn_is_excluded(page))) {
-+ printf("Attempt to restore excluded address %llx\n",
-+ pg2phys(page));
-+ continue;
-+ } else if (unlikely(pfn_is_low(page) &&
-+ pfn_is_occupied(page))) {
-+ remap_orig[remap_idx] = pg2addr(page);
-+ page = free_page_get_next();
-+ remap_temp[remap_idx] = pg2addr(page);
-+ remap_idx++;
-+#ifdef PAGEMAP_DEBUG
-+ ++total_remap;
-+#endif
-+ /* If we fill our current page, allocate a new one */
-+ if (remap_idx + 1 == PAGE_SIZE / sizeof(u32)) {
-+ u32 *next;
-+
-+ next = pg2addr(free_page_get_next());
-+ remap_orig[remap_idx] = next;
-+ remap_orig = (u32 **)next;
-+
-+ next = pg2addr(free_page_get_next());
-+ remap_temp[remap_idx] = next;
-+ remap_temp = (u32 **)next;
-+
-+ remap_idx = 0;
-+ }
-+ }
-+ if (image_page_get_next(pg2addr(page)) <= 0)
-+ goto read_err;
-+ }
-+
-+ printf("Image loading done.\n");
-+ invalidate_icache_all();
-+
-+ CALL_HOOK(resume_boot, SWSUSPMEM_IMAGEDONE);
-+ /* put end markers on the remap list */
-+ remap_orig[remap_idx] = (void *) ~0UL;
-+ remap_temp[remap_idx] = (void *) ~0UL;
-+
-+#ifdef PAGEMAP_DEBUG
-+ PAGEMAP_INFO("Number of remap pages:%d\n", total_remap);
-+ PAGEMAP_INFO("Number of high pages:%d\n", high_page_images);
-+ PAGEMAP_INFO("Last read page %d (%08x)\n",
-+ _last_read_pages, _last_read_pages * PAGE_SIZE);
-+#endif
-+ remap_orig = (u32 **)remap_orig_page;
-+ remap_temp = (u32 **)remap_temp_page;
-+
-+ /* Make a copy of swsusp_finish in a free data page */
-+ data_page = pg2addr(free_page_get_next());
-+ memcpy(data_page, swsusp_finish_p, PAGE_SIZE);
-+ swsusp_finish_copy = (void *) data_page;
-+
-+ /* Setup context for swsusp_finish at the end of the data_page */
-+ context = (struct swsusp_finish_context *) (data_page + PAGE_SIZE -
-+ sizeof(struct swsusp_finish_context));
-+ context->remap_orig_page = remap_orig_page;
-+ context->remap_temp_page = remap_temp_page;
-+ memcpy((void *)&context->archdata, (void *)swsusp_info->archdata,
-+ sizeof(struct swsusp_archdata));
-+
-+ /* Get a stack pointer for swsusp_finish, growing down from context */
-+ stack_addr = (char *) context;
-+
-+#ifdef CONFIG_NETCONSOLE
-+ /*
-+ * Stop the ethernet stack if NetConsole could have
-+ * left it up
-+ */
-+ eth_halt();
-+#endif
-+#ifdef CONFIG_USB_DEVICE
-+ udc_disconnect();
-+#endif
-+ arch_preboot_os();
-+ cleanup_before_linux();
-+
-+ CALL_HOOK(resume_boot, SWSUSPMEM_RESUME);
-+ /* Copy the final data from a safe place */
-+ call_with_stack(swsusp_finish_copy, context, stack_addr);
-+
-+ return 0;
-+
-+mem_err:
-+ printf("Not enough memory.\n");
-+ CALL_HOOK(err_hook, SWSUSPMEM_ENOMEM);
-+ goto err;
-+
-+read_err:
-+ printf("Read error while restoring image.\n");
-+
-+err:
-+ __asm__ volatile (
-+ "mov r0, #0\n"
-+ "mcr p15, 0, r0, c7, c5, 0 @ invalidate icache\n"
-+ "mcr p15, 0, r0, c7, c10, 4 @ DSB\n"
-+ "mcr p15, 0, r0, c7, c5, 4 @ ISB\n"
-+ : : : "r0", "memory");
-+
-+ raw_page_exit();
-+ image_page_exit();
-+ free_page_exit();
-+ if (pfn_pages) {
-+ for (i = 0; i < nr_pfn_pages; i++)
-+ free(pfn_pages[i]);
-+ free(pfn_pages);
-+ }
-+ free(spare_page);
-+
-+ CALL_HOOK(err_hook, SWSUSPMEM_RESTOREFAIL);
-+ return 1;
-+}
-+
-+U_BOOT_CMD(swsuspmem, 2, 2, do_swsuspmem,
-+ "Restore SWSUSP hibernation image from memory",
-+ "<address>]"
-+);
-diff --git a/include/swsuspmem.h b/include/swsuspmem.h
-new file mode 100644
-index 0000000..3b353ea
---- /dev/null
-+++ b/include/swsuspmem.h
-@@ -0,0 +1,24 @@
-+#ifndef _SWSUSPMEM_H_
-+#define _SWSUSPMEM_H_
-+
-+enum { SWSUSPMEM_NORM = 0,
-+ SWSUSPMEM_NOIMAGE = 0x01,
-+ SWSUSPMEM_BROKENIMAGE = 0x02,
-+ SWSUSPMEM_ENOMEM = 0x80,
-+ SWSUSPMEM_RESTOREFAIL = 0x81,
-+};
-+
-+enum { SWSUSPMEM_IMAGEDONE = 0x01,
-+ SWSUSPMEM_RESUME = 0x02
-+};
-+
-+struct swsuspmem_hook {
-+ void (*err_hook)(int errcode);
-+ void (*resume_boot)(int param);
-+};
-+
-+void set_swsuspmem_hook(struct swsuspmem_hook *hook);
-+void arch_preboot_os(void);
-+void call_with_stack(void (*fn)(void *),
-+ void *userdata, void *stack);
-+#endif
-diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c
-index e6ff708..ebdf10b 100644
---- a/lib/lzo/lzo1x_decompress.c
-+++ b/lib/lzo/lzo1x_decompress.c
-@@ -68,13 +68,14 @@ int lzop_decompress(const unsigned char *src, size_t src_len,
- unsigned char *start = dst;
- const unsigned char *send = src + src_len;
- u32 slen, dlen;
-- size_t tmp;
-+ size_t tmp, remaining;
- int r;
-
- src = parse_header(src);
- if (!src)
- return LZO_E_ERROR;
-
-+ remaining = *dst_len;
- while (src < send) {
- /* read uncompressed block size */
- dlen = get_unaligned_be32(src);
-@@ -93,18 +94,25 @@ int lzop_decompress(const unsigned char *src, size_t src_len,
- if (slen <= 0 || slen > dlen)
- return LZO_E_ERROR;
-
-+ /* abort if buffer ran out of room */
-+ if (dlen > remaining)
-+ return LZO_E_OUTPUT_OVERRUN;
-+
- /* decompress */
- tmp = dlen;
- r = lzo1x_decompress_safe((u8 *) src, slen, dst, &tmp);
-
-- if (r != LZO_E_OK)
-+ if (r != LZO_E_OK) {
-+ *dst_len = dst - start;
- return r;
-+ }
-
- if (dlen != tmp)
- return LZO_E_ERROR;
-
- src += slen;
- dst += dlen;
-+ remaining -= dlen;
- }
-
- return LZO_E_INPUT_OVERRUN;
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch
deleted file mode 100644
index e6682354e..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0003-Add-hibernation-image-area.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From eae2ee2090f8c9c140a1b766bd7312be5f0f308d Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:46:54 +0900
-Subject: [PATCH 3/3] Add hibernation image area
-
-0x40000000 <-> 0x77FFFFFF : kernel
-0x78000000 <-> 0x7FFFFFFF : hibernation image area
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- common/cmd_swsuspmem.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/common/cmd_swsuspmem.c b/common/cmd_swsuspmem.c
-index 6980aaf..dbc000c 100644
---- a/common/cmd_swsuspmem.c
-+++ b/common/cmd_swsuspmem.c
-@@ -116,8 +116,9 @@ struct swsusp_finish_context {
- #define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE)
- #define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET)
- #else
--#define USED_ADDRESS_TOP (0x40000000)
--#define USED_ADDRESS_END (0x48000000)
-+#define CONFIG_SYS_LOAD_OFFSET 0x0
-+#define USED_ADDRESS_TOP (CONFIG_SYS_SDRAM_BASE)
-+#define USED_ADDRESS_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_LOAD_OFFSET)
- #endif
- #define PG_UB2ZERO(pg) ((pg) - CONFIG_SYS_SDRAM_BASE / PAGE_SIZE)
- static u32 const exclude_min_page =
-@@ -157,7 +158,7 @@ static struct swsuspmem_hook *_hook;
- } while (0)
-
- #ifdef PAGEMAP_DEBUG
--static int debugout;
-+static int debugout = 1;
- static int _last_read_pages;
- #define PAGEMAP_INFO(_msg, ...) \
- do { \
-@@ -231,7 +232,7 @@ static inline u32 addr2pg(void *addr)
- {
- return ((u32)(addr)) / PAGE_SIZE;
- }
--static void *offt_addr = (void *)0x44000000;
-+static void *offt_addr = (void *)0x78000000;
- static int page_read_mem(u64 page, void *addr)
- {
- memcpy(addr, (u8 *)offt_addr + page * PAGE_SIZE, PAGE_SIZE);
-@@ -577,7 +578,7 @@ int do_checksnapimage(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-
- if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)
- || (swsusp_header->img_size == 0)
-- || (swsusp_header->img_size > 0x03fff000)) {
-+ || (swsusp_header->img_size > 0x05fff000)) {
- printf("No hibernation image present\n");
- CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
- return 0;
-@@ -674,7 +675,9 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
- /* Allow for 16 pages of stack */
- max_page = gd->start_addr_sp / PAGE_SIZE - 32;
- high_page = (((gd->relocaddr + _bss_end_ofs)
-- + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1;
-+ + (PAGE_SIZE - 1)) / PAGE_SIZE) + 1 + 0xf;
-+ if (high_page > 0x7ffff)
-+ high_page = 0x7ffff;
- #define pfn_is_occupied(pfn) (page > max_page && page <= high_page)
- #ifdef PAGEMAP_DEBUG
- PAGEMAP_INFO(" *gd->start_addr_sp:%p\n",
-@@ -711,7 +714,7 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-
- if (memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)
- || (swsusp_header->img_size == 0)
-- || (swsusp_header->img_size > 0x03fff000)) {
-+ || (swsusp_header->img_size > 0x05fff000)) {
- printf("No hibernation image present\n");
- CALL_HOOK(err_hook, SWSUSPMEM_BROKENIMAGE);
- return 0;
-@@ -830,8 +833,11 @@ int do_swsuspmem(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
- continue;
- } else if (unlikely(pfn_is_low(page) &&
- pfn_is_occupied(page))) {
-+ /* Virtual 32-bit original address */
- remap_orig[remap_idx] = pg2addr(page);
-+ /* allocating new free page */
- page = free_page_get_next();
-+ /* Virtual 32-bit remap address */
- remap_temp[remap_idx] = pg2addr(page);
- remap_idx++;
- #ifdef PAGEMAP_DEBUG
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch
deleted file mode 100755
index 1b2278b2e..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot/hibernation/0004-Add-porter-board-Hibernation-code.patch
+++ /dev/null
@@ -1,1352 +0,0 @@
-From 80d5c1269bd16fedce41611e45f25d156425b0c9 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 19 May 2017 16:16:18 +0900
-Subject: [PATCH 4/4] Add porter board Hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- arch/arm/cpu/armv7/Makefile | 4 +
- arch/arm/cpu/armv7/arch_timer.c | 58 ++++++
- arch/arm/cpu/armv7/cache_v7.c | 14 +-
- arch/arm/cpu/armv7/rmobile/Makefile | 4 +
- arch/arm/cpu/armv7/rmobile/arm_arch_timer.c | 61 ++++++
- arch/arm/cpu/armv7/rmobile/crc32_word4.c | 299 ++++++++++++++++++++++++++++
- arch/arm/cpu/armv7/rmobile/crc32_word4.h | 23 +++
- arch/arm/cpu/armv7/rmobile/sh_timer.c | 209 +++++++++++++++++++
- arch/arm/include/asm/arch-rmobile/rmobile.h | 2 +
- arch/arm/include/asm/armv7.h | 16 +-
- arch/arm/include/asm/system.h | 136 ++++++++++++-
- arch/arm/lib/Makefile | 2 +
- arch/arm/lib/board.c | 2 +-
- arch/arm/lib/cache-cp15.c | 123 +++++++++++-
- arch/arm/lib/call_with_stack.S | 20 ++
- board/renesas/porter/porter.c | 10 +
- include/configs/porter.h | 19 +-
- 17 files changed, 977 insertions(+), 25 deletions(-)
- create mode 100644 arch/arm/cpu/armv7/arch_timer.c
- create mode 100644 arch/arm/cpu/armv7/rmobile/arm_arch_timer.c
- create mode 100644 arch/arm/cpu/armv7/rmobile/crc32_word4.c
- create mode 100644 arch/arm/cpu/armv7/rmobile/crc32_word4.h
- create mode 100644 arch/arm/cpu/armv7/rmobile/sh_timer.c
- create mode 100644 arch/arm/lib/call_with_stack.S
-
-diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
-index 4fdbee4..f68ce5c 100644
---- a/arch/arm/cpu/armv7/Makefile
-+++ b/arch/arm/cpu/armv7/Makefile
-@@ -32,6 +32,10 @@ COBJS += cache_v7.o
- COBJS += cpu.o
- COBJS += syslib.o
-
-+ifneq ($(CONFIG_SYS_ARCH_TIMER),)
-+COBJS += arch_timer.o
-+endif
-+
- ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA20),)
- SOBJS += lowlevel_init.o
- endif
-diff --git a/arch/arm/cpu/armv7/arch_timer.c b/arch/arm/cpu/armv7/arch_timer.c
-new file mode 100644
-index 0000000..747b6e9
---- /dev/null
-+++ b/arch/arm/cpu/armv7/arch_timer.c
-@@ -0,0 +1,58 @@
-+/*
-+ * (C) Copyright 2012-2014
-+ * Texas Instruments Incorporated, <www.ti.com>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0+
-+ */
-+
-+#include <common.h>
-+#include <asm/io.h>
-+#include <div64.h>
-+
-+DECLARE_GLOBAL_DATA_PTR;
-+
-+int timer_init(void)
-+{
-+ gd->tbl = 0;
-+ gd->tbu = 0;
-+
-+ gd->timer_rate_hz = CONFIG_SYS_HZ_CLOCK / CONFIG_SYS_HZ;
-+
-+ return 0;
-+}
-+
-+unsigned long long get_ticks(void)
-+{
-+ ulong nowl, nowu;
-+
-+ asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (nowl), "=r" (nowu));
-+
-+ gd->tbl = nowl;
-+ gd->tbu = nowu;
-+
-+ return (((unsigned long long)gd->tbu) << 32) | gd->tbl;
-+}
-+
-+
-+ulong get_timer(ulong base)
-+{
-+ return lldiv(get_ticks(), gd->timer_rate_hz) - base;
-+}
-+
-+void __udelay(unsigned long usec)
-+{
-+ unsigned long long endtime;
-+
-+ endtime = lldiv((unsigned long long)usec * gd->timer_rate_hz,
-+ 1000UL);
-+
-+ endtime += get_ticks();
-+
-+ while (get_ticks() < endtime)
-+ ;
-+}
-+
-+ulong get_tbclk(void)
-+{
-+ return gd->timer_rate_hz;
-+}
-diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
-index 5f6d039..5a0bdb8 100644
---- a/arch/arm/cpu/armv7/cache_v7.c
-+++ b/arch/arm/cpu/armv7/cache_v7.c
-@@ -82,7 +82,7 @@ static void v7_inval_dcache_level_setway(u32 level, u32 num_sets,
- }
- }
- /* DSB to make sure the operation is complete */
-- CP15DSB;
-+ DSB();
- }
-
- static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets,
-@@ -109,7 +109,7 @@ static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets,
- }
- }
- /* DSB to make sure the operation is complete */
-- CP15DSB;
-+ DSB();
- }
-
- static void v7_maint_dcache_level_setway(u32 level, u32 operation)
-@@ -230,7 +230,7 @@ static void v7_dcache_maint_range(u32 start, u32 stop, u32 range_op)
- }
-
- /* DSB to make sure the operation is complete */
-- CP15DSB;
-+ DSB();
- }
-
- /* Invalidate TLB */
-@@ -243,9 +243,9 @@ static void v7_inval_tlb(void)
- /* Invalidate entire instruction TLB */
- asm volatile ("mcr p15, 0, %0, c8, c5, 0" : : "r" (0));
- /* Full system DSB - make sure that the invalidation is complete */
-- CP15DSB;
-+ DSB();
- /* Full system ISB - make sure the instruction stream sees it */
-- CP15ISB;
-+ ISB();
- }
-
- void invalidate_dcache_all(void)
-@@ -356,10 +356,10 @@ void invalidate_icache_all(void)
- asm volatile ("mcr p15, 0, %0, c7, c5, 6" : : "r" (0));
-
- /* Full system DSB - make sure that the invalidation is complete */
-- CP15DSB;
-+ DSB();
-
- /* ISB - make sure the instruction stream sees it */
-- CP15ISB;
-+ ISB();
- }
- #else
- void invalidate_icache_all(void)
-diff --git a/arch/arm/cpu/armv7/rmobile/Makefile b/arch/arm/cpu/armv7/rmobile/Makefile
-index b8c04c6..0a3623a 100644
---- a/arch/arm/cpu/armv7/rmobile/Makefile
-+++ b/arch/arm/cpu/armv7/rmobile/Makefile
-@@ -46,6 +46,10 @@ COBJS-$(CONFIG_R8A7740) += pfc-r8a7740.o
- COBJS-$(CONFIG_SH73A0) += cpu_info-sh73a0.o
- COBJS-$(CONFIG_SH73A0) += pfc-sh73a0.o
- COBJS_LN-$(CONFIG_TMU_TIMER) += sh_timer.o
-+COBJS-$(CONFIG_SYS_ARCH_TIMER) += arm_arch_timer.o
-+ifeq ($(CONFIG_CMD_SWSUSP),y)
-+COBJS-y += crc32_word4.o
-+endif
-
- COBJS := $(COBJS-y)
- SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-diff --git a/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c b/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c
-new file mode 100644
-index 0000000..a499e71
---- /dev/null
-+++ b/arch/arm/cpu/armv7/rmobile/arm_arch_timer.c
-@@ -0,0 +1,61 @@
-+/*
-+ * Copyright (C) 2014 Cogent Embedded Inc.
-+ *
-+ * Licensed under the GPL-2 or later.
-+ */
-+
-+#include <common.h>
-+#include <asm/io.h>
-+
-+#define MODEMR 0xe6160060
-+#define MD(x) (1 << (x))
-+#define CNTCR 0xe6080000
-+#define CNTFID0 0xe6080020
-+
-+void arm_arch_timer_init(void)
-+{
-+ u32 mode = readl(MODEMR);
-+ u32 freq;
-+
-+ switch (mode & (MD(14) | MD(13))) {
-+ case MD(13):
-+ freq = 20;
-+ break;
-+ case MD(14):
-+ freq = 26;
-+ break;
-+ case MD(13) | MD(14):
-+ freq = 30;
-+ break;
-+ default:
-+ freq = 15;
-+ break;
-+ }
-+
-+ freq *= (1000000 / 2);
-+
-+#ifdef CONFIG_VE_ENABLED
-+ /* CNTVOFF has to be initialized either from non-secure Hypervisor
-+ * mode or secure Monitor mode with SCR.NS==1. If TrustZone is enabled
-+ * then it should be handled by the secure code
-+ */
-+ asm volatile(
-+ " cps 0x16\n"
-+ " mrc p15, 0, r1, c1, c1, 0\n"
-+ " orr r0, r1, #1\n"
-+ " mcr p15, 0, r0, c1, c1, 0\n"
-+ " isb\n"
-+ " mov r0, #0\n"
-+ " mcrr p15, 4, r0, r0, c14\n"
-+ " isb\n"
-+ " mcr p15, 0, r1, c1, c1, 0\n"
-+ " isb\n"
-+ " cps 0x13\n"
-+ : : : "r0", "r1");
-+#endif
-+
-+ /* Start Generic ARM timer */
-+ writel(freq, CNTFID0);
-+ asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
-+ writel(1, CNTCR);
-+}
-diff --git a/arch/arm/cpu/armv7/rmobile/crc32_word4.c b/arch/arm/cpu/armv7/rmobile/crc32_word4.c
-new file mode 100644
-index 0000000..b813899
---- /dev/null
-+++ b/arch/arm/cpu/armv7/rmobile/crc32_word4.c
-@@ -0,0 +1,299 @@
-+/*************************************************************************
-+ * crc32_word4.c: rapid CRC32
-+ * Coptright (C) FUJITSUTEN Limited, 2015 All Rights Reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2
-+ * as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ *************************************************************************/
-+#ifdef OWNTEST
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <asm/types.h>
-+typedef unsigned int u_int32_t;
-+#else
-+#include <common.h>
-+#endif
-+
-+#include "crc32_word4.h"
-+
-+#define CRC_INIT_VALUE (-1)
-+#define CRC_FIX(_crc32) (~(_crc32))
-+
-+#define __HWDTPLS_OUT()
-+#define MEASURE(msg)
-+
-+/**** calc_crc32.c *****/
-+
-+/*
-+ * CRC32は、ISO 3309 で規程され
-+ * そのサンプルは
-+ * RFC 2083 :PNG(Poratble Network Graphics
-+ * で公になっています。本プログラムは、RFC2083 で掲示された
-+ * CRC32を独自に最適化したプログラムです。
-+ */
-+const static u_int32_t CRC_Table[256] = {
-+ 0x00000000 , 0x77073096 , 0xee0e612c , 0x990951ba , 0x076dc419 , 0x706af48f , 0xe963a535 , 0x9e6495a3 ,
-+ 0x0edb8832 , 0x79dcb8a4 , 0xe0d5e91e , 0x97d2d988 , 0x09b64c2b , 0x7eb17cbd , 0xe7b82d07 , 0x90bf1d91 ,
-+ 0x1db71064 , 0x6ab020f2 , 0xf3b97148 , 0x84be41de , 0x1adad47d , 0x6ddde4eb , 0xf4d4b551 , 0x83d385c7 ,
-+ 0x136c9856 , 0x646ba8c0 , 0xfd62f97a , 0x8a65c9ec , 0x14015c4f , 0x63066cd9 , 0xfa0f3d63 , 0x8d080df5 ,
-+ 0x3b6e20c8 , 0x4c69105e , 0xd56041e4 , 0xa2677172 , 0x3c03e4d1 , 0x4b04d447 , 0xd20d85fd , 0xa50ab56b ,
-+ 0x35b5a8fa , 0x42b2986c , 0xdbbbc9d6 , 0xacbcf940 , 0x32d86ce3 , 0x45df5c75 , 0xdcd60dcf , 0xabd13d59 ,
-+ 0x26d930ac , 0x51de003a , 0xc8d75180 , 0xbfd06116 , 0x21b4f4b5 , 0x56b3c423 , 0xcfba9599 , 0xb8bda50f ,
-+ 0x2802b89e , 0x5f058808 , 0xc60cd9b2 , 0xb10be924 , 0x2f6f7c87 , 0x58684c11 , 0xc1611dab , 0xb6662d3d ,
-+ 0x76dc4190 , 0x01db7106 , 0x98d220bc , 0xefd5102a , 0x71b18589 , 0x06b6b51f , 0x9fbfe4a5 , 0xe8b8d433 ,
-+ 0x7807c9a2 , 0x0f00f934 , 0x9609a88e , 0xe10e9818 , 0x7f6a0dbb , 0x086d3d2d , 0x91646c97 , 0xe6635c01 ,
-+ 0x6b6b51f4 , 0x1c6c6162 , 0x856530d8 , 0xf262004e , 0x6c0695ed , 0x1b01a57b , 0x8208f4c1 , 0xf50fc457 ,
-+ 0x65b0d9c6 , 0x12b7e950 , 0x8bbeb8ea , 0xfcb9887c , 0x62dd1ddf , 0x15da2d49 , 0x8cd37cf3 , 0xfbd44c65 ,
-+ 0x4db26158 , 0x3ab551ce , 0xa3bc0074 , 0xd4bb30e2 , 0x4adfa541 , 0x3dd895d7 , 0xa4d1c46d , 0xd3d6f4fb ,
-+ 0x4369e96a , 0x346ed9fc , 0xad678846 , 0xda60b8d0 , 0x44042d73 , 0x33031de5 , 0xaa0a4c5f , 0xdd0d7cc9 ,
-+ 0x5005713c , 0x270241aa , 0xbe0b1010 , 0xc90c2086 , 0x5768b525 , 0x206f85b3 , 0xb966d409 , 0xce61e49f ,
-+ 0x5edef90e , 0x29d9c998 , 0xb0d09822 , 0xc7d7a8b4 , 0x59b33d17 , 0x2eb40d81 , 0xb7bd5c3b , 0xc0ba6cad ,
-+ 0xedb88320 , 0x9abfb3b6 , 0x03b6e20c , 0x74b1d29a , 0xead54739 , 0x9dd277af , 0x04db2615 , 0x73dc1683 ,
-+ 0xe3630b12 , 0x94643b84 , 0x0d6d6a3e , 0x7a6a5aa8 , 0xe40ecf0b , 0x9309ff9d , 0x0a00ae27 , 0x7d079eb1 ,
-+ 0xf00f9344 , 0x8708a3d2 , 0x1e01f268 , 0x6906c2fe , 0xf762575d , 0x806567cb , 0x196c3671 , 0x6e6b06e7 ,
-+ 0xfed41b76 , 0x89d32be0 , 0x10da7a5a , 0x67dd4acc , 0xf9b9df6f , 0x8ebeeff9 , 0x17b7be43 , 0x60b08ed5 ,
-+ 0xd6d6a3e8 , 0xa1d1937e , 0x38d8c2c4 , 0x4fdff252 , 0xd1bb67f1 , 0xa6bc5767 , 0x3fb506dd , 0x48b2364b ,
-+ 0xd80d2bda , 0xaf0a1b4c , 0x36034af6 , 0x41047a60 , 0xdf60efc3 , 0xa867df55 , 0x316e8eef , 0x4669be79 ,
-+ 0xcb61b38c , 0xbc66831a , 0x256fd2a0 , 0x5268e236 , 0xcc0c7795 , 0xbb0b4703 , 0x220216b9 , 0x5505262f ,
-+ 0xc5ba3bbe , 0xb2bd0b28 , 0x2bb45a92 , 0x5cb36a04 , 0xc2d7ffa7 , 0xb5d0cf31 , 0x2cd99e8b , 0x5bdeae1d ,
-+ 0x9b64c2b0 , 0xec63f226 , 0x756aa39c , 0x026d930a , 0x9c0906a9 , 0xeb0e363f , 0x72076785 , 0x05005713 ,
-+ 0x95bf4a82 , 0xe2b87a14 , 0x7bb12bae , 0x0cb61b38 , 0x92d28e9b , 0xe5d5be0d , 0x7cdcefb7 , 0x0bdbdf21 ,
-+ 0x86d3d2d4 , 0xf1d4e242 , 0x68ddb3f8 , 0x1fda836e , 0x81be16cd , 0xf6b9265b , 0x6fb077e1 , 0x18b74777 ,
-+ 0x88085ae6 , 0xff0f6a70 , 0x66063bca , 0x11010b5c , 0x8f659eff , 0xf862ae69 , 0x616bffd3 , 0x166ccf45 ,
-+ 0xa00ae278 , 0xd70dd2ee , 0x4e048354 , 0x3903b3c2 , 0xa7672661 , 0xd06016f7 , 0x4969474d , 0x3e6e77db ,
-+ 0xaed16a4a , 0xd9d65adc , 0x40df0b66 , 0x37d83bf0 , 0xa9bcae53 , 0xdebb9ec5 , 0x47b2cf7f , 0x30b5ffe9 ,
-+ 0xbdbdf21c , 0xcabac28a , 0x53b39330 , 0x24b4a3a6 , 0xbad03605 , 0xcdd70693 , 0x54de5729 , 0x23d967bf ,
-+ 0xb3667a2e , 0xc4614ab8 , 0x5d681b02 , 0x2a6f2b94 , 0xb40bbe37 , 0xc30c8ea1 , 0x5a05df1b , 0x2d02ef8d ,
-+};
-+
-+/***
-+ * CRC Table creater.
-+ *
-+void make_crc_table(void) {
-+ u_int32_t c;
-+ u_int32_t n, k;
-+ for (n = 0; n < 256; n++)
-+ {
-+ c = (u_int32_t) n;
-+ for (k = 0; k < 8; k++)
-+ {
-+ if (c & 1)
-+ c = 0xedb88320L ^ (c >> 1);
-+ else
-+ c = c >> 1;
-+ }
-+ CRC_Table[n] = c;
-+ }
-+}
-+***/
-+#define NEXT_PTR (4)
-+
-+static __inline__
-+u_int32_t _update_crc(u_int32_t crc, unsigned char *buf, size_t len)
-+{
-+ u_int32_t c = crc;
-+ size_t n;
-+ for (n = 0; n < len; n++)
-+ c = CRC_Table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
-+ return c;
-+}
-+/*********************************************************************
-+ * update_crc4x4()()
-+ * calc_crc32() をベースに、4 ワード毎に個別に CRC32 を計算する方法
-+ *
-+ * +0 +1 +2 +3
-+ * +0x00 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
-+ * +0x04 EEEEEEEE FFFFFFFF 00000000 11111111
-+ * : : : :
-+ * CRC32 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
-+ *
-+ *********************************************************************/
-+
-+static __inline__
-+void update_crc4x4(u_int32_t crc[4], unsigned char *buf)
-+{
-+ u_int32_t c1, c2, c3, c4;
-+ u_int32_t *p = (void *)buf;
-+
-+ c1 = crc[0] ^ p[0];
-+ c2 = crc[1] ^ p[1];
-+ c3 = crc[2] ^ p[2];
-+ c4 = crc[3] ^ p[3];
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ crc[0] = c1;
-+ crc[1] = c2;
-+ crc[2] = c3;
-+ crc[3] = c4;
-+}
-+
-+
-+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result)
-+{
-+ unsigned int crc_tmp[4] = {CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE};
-+ u_int32_t i;
-+ int res;
-+ u_int32_t n4;
-+ int xlen = len;
-+#ifdef HWDPLS_ENABLE
-+ unsigned long plstout = 60;
-+ unsigned long plsstart = 0;
-+ if ((unsigned long)CONFIG_SYS_HZ > 100000)
-+ plstout *= (unsigned long)CONFIG_SYS_HZ / 1000;
-+ else
-+ plstout = DIV_ROUND_UP(plstout * (unsigned long)CONFIG_SYS_HZ, 1000);
-+#endif
-+
-+ /**
-+ * 4バイト境界に合わない開始アドレスの場合
-+ * 境界までのCRCを crc_tmp[0] に求める。
-+ */
-+ if ((unsigned long)buf & 3) {
-+ crc_tmp[0] = _update_crc(crc_tmp[0], buf, (unsigned long)buf & 3);
-+ buf = (unsigned char *)((unsigned long)buf & ~3);
-+ xlen -= (unsigned long)buf & 3;
-+ }
-+
-+ n4 = xlen/(NEXT_PTR*4);
-+ /**
-+ * 4バイト境界に合わない開始アドレスの場合
-+ * 境界までのCRCを crc_tmp[0] に求める。
-+ */
-+#ifdef HWDPLS_ENABLE
-+ reset_timer();
-+ plsstart = get_timer(0);
-+#endif
-+ for (i = 0; i < n4 ; i++) {
-+ update_crc4x4(crc_tmp, buf);
-+ buf += NEXT_PTR * 4;
-+#ifdef HWDPLS_ENABLE
-+ /**
-+ * WDを考慮
-+ */
-+ if (__builtin_expect((int)((i & 0x1f) == 0), 0)) {
-+ if ((get_timer(plsstart)) > plstout) {
-+ __HWDTPLS_OUT();
-+ MEASURE("crc plsout")
-+ plsstart += plstout;
-+ }
-+ }
-+#endif /*HWPLS_ENABLE*/
-+ }
-+
-+ res = xlen % (NEXT_PTR * 4);
-+ if (res > 0)
-+ crc_tmp[3] = _update_crc(crc_tmp[3], buf, res);
-+
-+ result->crc_w[0] = CRC_FIX(crc_tmp[0]);
-+ result->crc_w[1] = CRC_FIX(crc_tmp[1]);
-+ result->crc_w[2] = CRC_FIX(crc_tmp[2]);
-+ result->crc_w[3] = CRC_FIX(crc_tmp[3]);
-+
-+ MEASURE("calc_crc32x4 finish")
-+}
-+
-+#if defined(OWNTEST)
-+#define BUFSIZE (2 * 1024 * 1024)
-+#include <sys/time.h>
-+#include <malloc.h>
-+
-+int main()
-+{
-+ unsigned char *buf, *buf2;
-+ struct timeval start, end;
-+ unsigned long long diff;
-+ int i;
-+
-+ CRC32_WORD4_t result = { .crc_w = {0, 0, 0, 0 } };
-+ CRC32_WORD4_t result2 = { .crc_w = {0, 0, 0, 0 } };
-+
-+ buf = malloc(BUFSIZE);
-+ if (!buf) {
-+ perror("malloc");
-+ return 1;
-+ }
-+ printf("Generate %dMB random data..\n", BUFSIZE / 1024 / 1024);
-+ srand(0);
-+ for (i = 0; i < BUFSIZE / 4; i++)
-+ ((int *)buf)[i] = rand();
-+
-+ /* Memory dup */
-+ buf2 = memalign(NEXT_PTR, BUFSIZE);
-+ if (!buf2) {
-+ perror("malloc");
-+ return 1;
-+ }
-+ memcpy(buf2, buf, BUFSIZE);
-+
-+
-+ gettimeofday(&start, NULL);
-+ calc_crc32x4(buf, BUFSIZE, &result);
-+ gettimeofday(&end, NULL);
-+
-+ diff = (end.tv_sec - start.tv_sec) * 1000000;
-+ diff += end.tv_usec - start.tv_usec;
-+
-+ printf("time=%lluus\n", diff);
-+ printf(" result.word[0] = %x\n", result.crc_w[0]);
-+ printf(" result.word[1] = %x\n", result.crc_w[1]);
-+ printf(" result.word[2] = %x\n", result.crc_w[2]);
-+ printf(" result.word[3] = %x\n", result.crc_w[3]);
-+
-+ /* Broken test */
-+#if 0 /* Destory test */
-+ buf[rand() % BUFSIZE] ^= 1 << (rand()%7);
-+#endif
-+ for (i = 0; i < BUFSIZE ; i++) {
-+ if (buf[i] != buf2[i])
-+ printf("buf[%d] %02x : %02x\n", i, buf[i], buf2[i]);
-+ }
-+
-+ gettimeofday(&start, NULL);
-+ calc_crc32x4(buf, BUFSIZE, &result2);
-+ gettimeofday(&end, NULL);
-+
-+ diff = (end.tv_sec - start.tv_sec) * 1000000;
-+ diff += end.tv_usec - start.tv_usec;
-+
-+ printf("time=%lluus\n", diff);
-+ printf(" result.word[0] = %x:%s\n", result2.crc_w[0] ,
-+ result.crc_w[0] == result2.crc_w[0] ? "OK" : "NG");
-+ printf(" result.word[1] = %x:%s\n", result2.crc_w[1] ,
-+ result.crc_w[1] == result2.crc_w[1] ? "OK" : "NG");
-+ printf(" result.word[2] = %x:%s\n", result2.crc_w[2] ,
-+ result.crc_w[2] == result2.crc_w[2] ? "OK" : "NG");
-+ printf(" result.word[3] = %x:%s\n", result2.crc_w[3] ,
-+ result.crc_w[3] == result2.crc_w[3] ? "OK" : "NG");
-+ return 0;
-+}
-+#endif /* TEST */
-diff --git a/arch/arm/cpu/armv7/rmobile/crc32_word4.h b/arch/arm/cpu/armv7/rmobile/crc32_word4.h
-new file mode 100644
-index 0000000..2b64218
---- /dev/null
-+++ b/arch/arm/cpu/armv7/rmobile/crc32_word4.h
-@@ -0,0 +1,23 @@
-+/*************************************************************************
-+ * Coptright (C) FUJITSUTEN Limited, 2012 All Rights Reserved.
-+ *
-+ *************************************************************************/
-+#ifndef __CRC32_WORD4_H__
-+#define __CRC32_WORD4_H__
-+
-+typedef struct {
-+ unsigned int crc_w[4];
-+} CRC32_WORD4_t;
-+
-+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result);
-+
-+typedef struct {
-+ unsigned int size;
-+ CRC32_WORD4_t chksum;
-+ unsigned int dummy[3];
-+} CRC32_WORD4_TICKET_t;
-+
-+#define IS_CRC_WORD4_OK(_res1, _res2) (!memcmp((_res1), (_res2), sizeof(CRC32_WORD4_t)))
-+#define IS_CRC_WORD4_ZERO(_w4) (((_w4)->crc_w[0] == 0) && ((_w4)->crc_w[1] == 0) && ((_w4)->crc_w[2] == 0) && ((_w4)->crc_w[3] == 0))
-+#define IS_CRC_WORD4_ALL_F(_w4) (((_w4)->crc_w[0] == 0xffffffff) && ((_w4)->crc_w[1] == 0xffffffff) && ((_w4)->crc_w[2] == 0xffffffff) && ((_w4)->crc_w[3] == 0xffffffff))
-+#endif
-diff --git a/arch/arm/cpu/armv7/rmobile/sh_timer.c b/arch/arm/cpu/armv7/rmobile/sh_timer.c
-new file mode 100644
-index 0000000..1c64950
---- /dev/null
-+++ b/arch/arm/cpu/armv7/rmobile/sh_timer.c
-@@ -0,0 +1,209 @@
-+/*
-+ * Copyright (C) 2013-2014 Renesas Electronics Corporation
-+ *
-+ * (C) Copyright 2009
-+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-+ *
-+ * (C) Copyright 2007-2012
-+ * Nobobuhiro Iwamatsu <iwamatsu@nigauri.org>
-+ *
-+ * (C) Copyright 2003
-+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-+ *
-+ * See file CREDITS for list of people who contributed to this
-+ * project.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License as
-+ * published by the Free Software Foundation; either version 2 of
-+ * the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ * MA 02111-1307 USA
-+ */
-+
-+#include <common.h>
-+#include <div64.h>
-+#include <asm/processor.h>
-+#include <asm/io.h>
-+#include <sh_tmu.h>
-+
-+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
-+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-+
-+DECLARE_GLOBAL_DATA_PTR;
-+
-+#endif
-+
-+static struct tmu_regs *tmu = (struct tmu_regs *)TMU_BASE;
-+
-+static u16 bit;
-+static unsigned long last_tcnt;
-+static unsigned long long overflow_ticks;
-+
-+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
-+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-+
-+unsigned long get_tbclk(void)
-+{
-+ if (gd->flags & GD_FLG_RELOC)
-+ return get_tmu0_clk_rate() >> ((bit + 1) * 2);
-+ else {
-+ u16 bit;
-+
-+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
-+ return get_tmu0_clk_rate() >> ((bit + 1) * 2);
-+ }
-+}
-+
-+#else
-+
-+unsigned long get_tbclk(void)
-+{
-+ return get_tmu0_clk_rate() >> ((bit + 1) * 2);
-+}
-+
-+#endif
-+
-+static inline unsigned long long tick_to_time(unsigned long long tick)
-+{
-+ tick *= CONFIG_SYS_HZ;
-+ do_div(tick, get_tbclk());
-+
-+ return tick;
-+}
-+
-+static inline unsigned long long usec_to_tick(unsigned long long usec)
-+{
-+ usec *= get_tbclk();
-+ do_div(usec, 1000000);
-+
-+ return usec;
-+}
-+
-+static void tmu_timer_start(unsigned int timer)
-+{
-+ if (timer > 2)
-+ return;
-+ writeb(readb(&tmu->tstr) | (1 << timer), &tmu->tstr);
-+}
-+
-+static void tmu_timer_stop(unsigned int timer)
-+{
-+ if (timer > 2)
-+ return;
-+ writeb(readb(&tmu->tstr) & ~(1 << timer), &tmu->tstr);
-+}
-+
-+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
-+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-+
-+int sh_timer_init(void)
-+{
-+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
-+ writew((readw(&tmu->tcr0) & ~0x7) | bit, &tmu->tcr0);
-+
-+ tmu_timer_stop(0);
-+ tmu_timer_start(0);
-+
-+ last_tcnt = 0;
-+ overflow_ticks = 0;
-+
-+ return 0;
-+}
-+
-+int timer_init(void)
-+{
-+ tmu_timer_stop(0);
-+ tmu_timer_start(0);
-+
-+ return 0;
-+}
-+
-+#else
-+
-+int timer_init(void)
-+{
-+ bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1;
-+ writew((readw(&tmu->tcr0) & ~0x7) | bit, &tmu->tcr0);
-+
-+ tmu_timer_stop(0);
-+ tmu_timer_start(0);
-+
-+ last_tcnt = 0;
-+ overflow_ticks = 0;
-+
-+ return 0;
-+}
-+
-+#endif
-+
-+#if defined(CONFIG_R8A7790) || defined(CONFIG_R8A7791) || \
-+ defined(CONFIG_R8A7793) || defined(CONFIG_R8A7794)
-+
-+unsigned long long get_ticks(void)
-+{
-+ unsigned long tcnt = 0 - readl(&tmu->tcnt0);
-+
-+ if (gd->flags & GD_FLG_RELOC) {
-+ if (last_tcnt > tcnt) /* overflow */
-+ overflow_ticks++;
-+ last_tcnt = tcnt;
-+
-+ return (overflow_ticks << 32) | tcnt;
-+ }
-+ else
-+ return tcnt;
-+}
-+
-+#else
-+
-+unsigned long long get_ticks(void)
-+{
-+ unsigned long tcnt = 0 - readl(&tmu->tcnt0);
-+
-+ if (last_tcnt > tcnt) /* overflow */
-+ overflow_ticks++;
-+ last_tcnt = tcnt;
-+
-+ return (overflow_ticks << 32) | tcnt;
-+}
-+
-+#endif
-+
-+void __udelay(unsigned long usec)
-+{
-+ unsigned long long tmp;
-+ ulong tmo;
-+
-+ tmo = usec_to_tick(usec);
-+ tmp = get_ticks() + tmo; /* get current timestamp */
-+
-+ while (get_ticks() < tmp) /* loop till event */
-+ /*NOP*/;
-+}
-+
-+unsigned long get_timer(unsigned long base)
-+{
-+ /* return msec */
-+ return tick_to_time(get_ticks()) - base;
-+}
-+
-+void set_timer(unsigned long t)
-+{
-+ writel((0 - t), &tmu->tcnt0);
-+}
-+
-+void reset_timer(void)
-+{
-+ tmu_timer_stop(0);
-+ set_timer(0);
-+ tmu_timer_start(0);
-+}
-diff --git a/arch/arm/include/asm/arch-rmobile/rmobile.h b/arch/arm/include/asm/arch-rmobile/rmobile.h
-index 33a302e..12276e0 100644
---- a/arch/arm/include/asm/arch-rmobile/rmobile.h
-+++ b/arch/arm/include/asm/arch-rmobile/rmobile.h
-@@ -26,6 +26,8 @@ u32 rmobile_get_cpu_type(void);
- u32 rmobile_get_cpu_rev_integer(void);
- u32 rmobile_get_cpu_rev_fraction(void);
-
-+void arm_arch_timer_init(void);
-+
- #endif /* __ASSEMBLY__ */
-
- #endif /* __KERNEL__ */
-diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
-index ad9a875..aad5bf7 100644
---- a/arch/arm/include/asm/armv7.h
-+++ b/arch/arm/include/asm/armv7.h
-@@ -62,9 +62,19 @@
- * However, we use the CP15 based instructtions because we use
- * -march=armv5 in U-Boot
- */
--#define CP15ISB asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0))
--#define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0))
--#define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0))
-+#define CP15ISB() asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0))
-+#define CP15DSB() asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0))
-+#define CP15DMB() asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0))
-+
-+#ifdef __ARM_ARCH_7A__
-+#define ISB() asm volatile ("isb" : : : "memory")
-+#define DSB() asm volatile ("dsb" : : : "memory")
-+#define DMB() asm volatile ("dmb" : : : "memory")
-+#else
-+#define ISB() CP15ISB
-+#define DSB() CP15DSB
-+#define DMB() CP15DMB
-+#endif
-
- void v7_outer_cache_enable(void);
- void v7_outer_cache_disable(void);
-diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
-index cd0de6b..3906646 100644
---- a/arch/arm/include/asm/system.h
-+++ b/arch/arm/include/asm/system.h
-@@ -45,6 +45,12 @@
- #define CR_AFE (1 << 29) /* Access flag enable */
- #define CR_TE (1 << 30) /* Thumb exception enable */
-
-+#if defined(CONFIG_ARMV7_LPAE) && !defined(PGTABLE_SIZE)
-+#define PGTABLE_SIZE (4096 * 5)
-+#elif !defined(PGTABLE_SIZE)
-+#define PGTABLE_SIZE (4096 * 4)
-+#endif
-+
- /*
- * This is used to ensure the compiler did actually allocate the register we
- * asked it for some inline assembly sequences. Apparently we can't trust
-@@ -61,17 +67,50 @@
-
- #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
-
-+static inline unsigned long get_cpsr(void)
-+{
-+ unsigned long cpsr;
-+
-+ asm volatile("mrs %0, cpsr" : "=r"(cpsr): );
-+ return cpsr;
-+}
-+
-+static inline int is_hyp(void)
-+{
-+#ifdef CONFIG_ARMV7_LPAE
-+ /* HYP mode requires LPAE ... */
-+ return ((get_cpsr() & 0x1f) == 0x1a);
-+#else
-+ /* ... so without LPAE support we can optimize all hyp code away */
-+ return 0;
-+#endif
-+}
-+
- static inline unsigned int get_cr(void)
- {
- unsigned int val;
-- asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
-+
-+ if (is_hyp())
-+ asm volatile("mrc p15, 4, %0, c1, c0, 0 @ get CR" : "=r" (val)
-+ :
-+ : "cc");
-+ else
-+ asm volatile("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val)
-+ :
-+ : "cc");
- return val;
- }
-
- static inline void set_cr(unsigned int val)
- {
-- asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
-- : : "r" (val) : "cc");
-+ if (is_hyp())
-+ asm volatile("mcr p15, 4, %0, c1, c0, 0 @ set CR" :
-+ : "r" (val)
-+ : "cc");
-+ else
-+ asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" :
-+ : "r" (val)
-+ : "cc");
- isb();
- }
-
-@@ -105,19 +144,108 @@ static inline void set_actlr(unsigned int val)
- isb();
- }
-
-+#ifdef CONFIG_ARMV7_LPAE
-+/* Long-Descriptor Translation Table Level 1/2 Bits */
-+#define TTB_SECT_XN_MASK (1ULL << 54)
-+#define TTB_SECT_NG_MASK (1 << 11)
-+#define TTB_SECT_AF (1 << 10)
-+#define TTB_SECT_SH_MASK (3 << 8)
-+#define TTB_SECT_NS_MASK (1 << 5)
-+#define TTB_SECT_AP (1 << 6)
-+/* Note: TTB AP bits are set elsewhere */
-+#define TTB_SECT_MAIR(x) ((x & 0x7) << 2) /* Index into MAIR */
-+#define TTB_SECT (1 << 0)
-+#define TTB_PAGETABLE (3 << 0)
-+
-+/* TTBCR flags */
-+#define TTBCR_EAE (1 << 31)
-+#define TTBCR_T0SZ(x) ((x) << 0)
-+#define TTBCR_T1SZ(x) ((x) << 16)
-+#define TTBCR_USING_TTBR0 (TTBCR_T0SZ(0) | TTBCR_T1SZ(0))
-+#define TTBCR_IRGN0_NC (0 << 8)
-+#define TTBCR_IRGN0_WBWA (1 << 8)
-+#define TTBCR_IRGN0_WT (2 << 8)
-+#define TTBCR_IRGN0_WBNWA (3 << 8)
-+#define TTBCR_IRGN0_MASK (3 << 8)
-+#define TTBCR_ORGN0_NC (0 << 10)
-+#define TTBCR_ORGN0_WBWA (1 << 10)
-+#define TTBCR_ORGN0_WT (2 << 10)
-+#define TTBCR_ORGN0_WBNWA (3 << 10)
-+#define TTBCR_ORGN0_MASK (3 << 10)
-+#define TTBCR_SHARED_NON (0 << 12)
-+#define TTBCR_SHARED_OUTER (2 << 12)
-+#define TTBCR_SHARED_INNER (3 << 12)
-+#define TTBCR_EPD0 (0 << 7)
-+
-+/*
-+ * Memory types
-+ */
-+#define MEMORY_ATTRIBUTES ((0x00 << (0 * 8)) | (0x88 << (1 * 8)) | \
-+ (0xcc << (2 * 8)) | (0xff << (3 * 8)))
-+
-+/* options available for data cache on each page */
-+enum dcache_option {
-+ DCACHE_OFF = TTB_SECT | TTB_SECT_MAIR(0),
-+ DCACHE_WRITETHROUGH = TTB_SECT | TTB_SECT_MAIR(1),
-+ DCACHE_WRITEBACK = TTB_SECT | TTB_SECT_MAIR(2),
-+ DCACHE_WRITEALLOC = TTB_SECT | TTB_SECT_MAIR(3),
-+};
-+#elif defined(CONFIG_ARMV7)
-+/* Short-Descriptor Translation Table Level 1 Bits */
-+#define TTB_SECT_NS_MASK (1 << 19)
-+#define TTB_SECT_NG_MASK (1 << 17)
-+#define TTB_SECT_S_MASK (1 << 16)
-+/* Note: TTB AP bits are set elsewhere */
-+#define TTB_SECT_AP (3 << 10)
-+#define TTB_SECT_TEX(x) ((x & 0x7) << 12)
-+#define TTB_SECT_DOMAIN(x) ((x & 0xf) << 5)
-+#define TTB_SECT_XN_MASK (1 << 4)
-+#define TTB_SECT_C_MASK (1 << 3)
-+#define TTB_SECT_B_MASK (1 << 2)
-+#define TTB_SECT (2 << 0)
-+
-+/* options available for data cache on each page */
-+enum dcache_option {
-+ DCACHE_OFF = TTB_SECT_DOMAIN(0) | TTB_SECT_XN_MASK | TTB_SECT,
-+ DCACHE_WRITETHROUGH = DCACHE_OFF | TTB_SECT_C_MASK,
-+ DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK,
-+ DCACHE_WRITEALLOC = DCACHE_WRITEBACK | TTB_SECT_TEX(1),
-+};
-+#else
-+#define TTB_SECT_AP (3 << 10)
- /* options available for data cache on each page */
- enum dcache_option {
- DCACHE_OFF = 0x12,
- DCACHE_WRITETHROUGH = 0x1a,
- DCACHE_WRITEBACK = 0x1e,
-+ DCACHE_WRITEALLOC = 0x16,
- };
-+#endif
-
- /* Size of an MMU section */
- enum {
-- MMU_SECTION_SHIFT = 20,
-+#ifdef CONFIG_ARMV7_LPAE
-+ MMU_SECTION_SHIFT = 21, /* 2MB */
-+#else
-+ MMU_SECTION_SHIFT = 20, /* 1MB */
-+#endif
- MMU_SECTION_SIZE = 1 << MMU_SECTION_SHIFT,
- };
-
-+#ifdef CONFIG_ARMV7
-+/* TTBR0 bits */
-+#define TTBR0_BASE_ADDR_MASK 0xFFFFC000
-+#define TTBR0_RGN_NC (0 << 3)
-+#define TTBR0_RGN_WBWA (1 << 3)
-+#define TTBR0_RGN_WT (2 << 3)
-+#define TTBR0_RGN_WB (3 << 3)
-+/* TTBR0[6] is IRGN[0] and TTBR[0] is IRGN[1] */
-+#define TTBR0_IRGN_NC (0 << 0 | 0 << 6)
-+#define TTBR0_IRGN_WBWA (0 << 0 | 1 << 6)
-+#define TTBR0_IRGN_WT (1 << 0 | 0 << 6)
-+#define TTBR0_IRGN_WB (1 << 0 | 1 << 6)
-+#endif
-+
- /**
- * Change the cache settings for a region.
- *
-diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
-index 57111af..d8634be 100644
---- a/arch/arm/lib/Makefile
-+++ b/arch/arm/lib/Makefile
-@@ -54,6 +54,8 @@ COBJS-y += reset.o
- COBJS-y += cache.o
- COBJS-y += cache-cp15.o
-
-+COBJS-y += call_with_stack.o
-+
- SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
- $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
- OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
-index 9f861cc..3c2bf55 100644
---- a/arch/arm/lib/board.c
-+++ b/arch/arm/lib/board.c
-@@ -355,7 +355,7 @@ void board_init_f(ulong bootflag)
-
- #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
- /* reserve TLB table */
-- gd->tlb_size = 4096 * 4;
-+ gd->tlb_size = PGTABLE_SIZE;
- addr -= gd->tlb_size;
-
- /* round down to next 64 kB limit */
-diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
-index 75cf7b1..aefa2ae 100644
---- a/arch/arm/lib/cache-cp15.c
-+++ b/arch/arm/lib/cache-cp15.c
-@@ -44,13 +44,50 @@ static void cp_delay (void)
- asm volatile("" : : : "memory");
- }
-
-+#ifdef CONFIG_ARMV7_LPAE
-+struct special_addr {
-+ u32 page;
-+ u32 size;
-+ u64 addr;
-+};
-+
-+/* This hack is for 2GB board with second GB attached
-+ * to LPAE-only address at 0x200000000ULL */
-+#define SDRAM2_ADDR 0x200000000ULL
-+#define SDRAM2_SIZE 0x40000000 /* 1G */
-+static struct special_addr offsets[] = {
-+ { 0x80000000 >> MMU_SECTION_SHIFT, SDRAM2_SIZE >> MMU_SECTION_SHIFT, SDRAM2_ADDR, },
-+};
-+#endif
-+
- void set_section_dcache(int section, enum dcache_option option)
- {
-+#ifdef CONFIG_ARMV7_LPAE
-+ int i;
-+ u64 *page_table = (u64 *)gd->tlb_addr;
-+ /* Need to set the access flag to not fault */
-+ u64 value = TTB_SECT_AP | TTB_SECT_AF;
-+#else
- u32 *page_table = (u32 *)gd->tlb_addr;
-- u32 value;
-+ u32 value = TTB_SECT_AP;
-+#endif
-+
-+ /* Add the page offset */
-+#ifdef CONFIG_ARMV7_LPAE
-+ for (i = 0; i < ARRAY_SIZE(offsets); i++)
-+ if (section >= offsets[i].page &&
-+ section < offsets[i].page + offsets[i].size)
-+ value |= offsets[i].addr + ((section - offsets[i].page) << MMU_SECTION_SHIFT);
-+ else
-+ value |= ((u32)section << MMU_SECTION_SHIFT);
-+#else
-+ value |= ((u32)section << MMU_SECTION_SHIFT);
-+#endif
-
-- value = (section << MMU_SECTION_SHIFT) | (3 << 10);
-+ /* Add caching bits */
- value |= option;
-+
-+ /* Set PTE */
- page_table[section] = value;
- }
-
-@@ -66,11 +103,11 @@ void mmu_set_region_dcache_behaviour(u32 start, int size,
- enum dcache_option option)
- {
- u32 *page_table = (u32 *)gd->tlb_addr;
-- u32 upto, end;
-+ unsigned long upto, end;
-
- end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
- start = start >> MMU_SECTION_SHIFT;
-- debug("%s: start=%x, size=%x, option=%d\n", __func__, start, size,
-+ debug("%s: start=%pa, size=%zu, option=%d\n", __func__, &start, size,
- option);
- for (upto = start; upto < end; upto++)
- set_section_dcache(upto, option);
-@@ -83,11 +120,14 @@ static inline void dram_bank_mmu_setup(int bank)
- int i;
-
- debug("%s: bank: %d\n", __func__, bank);
-- for (i = bd->bi_dram[bank].start >> 20;
-- i < (bd->bi_dram[bank].start + bd->bi_dram[bank].size) >> 20;
-+ for (i = bd->bi_dram[bank].start >> MMU_SECTION_SHIFT;
-+ i < (bd->bi_dram[bank].start >> MMU_SECTION_SHIFT) +
-+ (bd->bi_dram[bank].size >> MMU_SECTION_SHIFT);
- i++) {
- #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
- set_section_dcache(i, DCACHE_WRITETHROUGH);
-+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-+ set_section_dcache(i, DCACHE_WRITEALLOC);
- #else
- set_section_dcache(i, DCACHE_WRITEBACK);
- #endif
-@@ -102,19 +142,88 @@ static inline void mmu_setup(void)
-
- arm_init_before_mmu();
- /* Set up an identity-mapping for all 4GB, rw for everyone */
-- for (i = 0; i < 4096; i++)
-+ for (i = 0; i < ((4096ULL * 1024 * 1024) >> MMU_SECTION_SHIFT); i++)
- set_section_dcache(i, DCACHE_OFF);
-
- for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
- dram_bank_mmu_setup(i);
- }
-+ /* Enabling d-cache for remapped region of memory
-+ *
-+ */
-+ for (i = (0x80000000 >> MMU_SECTION_SHIFT);
-+ i < 0xc0000000 >> MMU_SECTION_SHIFT; i++)
-+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-+ set_section_dcache(i, DCACHE_WRITETHROUGH);
-+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-+ set_section_dcache(i, DCACHE_WRITEALLOC);
-+#else
-+ set_section_dcache(i, DCACHE_WRITEBACK);
-+#endif
-+
-+#ifdef CONFIG_ARMV7_LPAE
-+ /* Set up 4 PTE entries pointing to our 4 1GB page tables */
-+ for (i = 0; i < 4; i++) {
-+ u64 *page_table = (u64 *)(gd->tlb_addr + (4096 * 4));
-+ u64 tpt = gd->tlb_addr + (4096 * i);
-+ page_table[i] = tpt | TTB_PAGETABLE;
-+ }
-
-+ reg = TTBCR_EAE;
-+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-+ reg |= TTBCR_ORGN0_WT | TTBCR_IRGN0_WT;
-+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-+ reg |= TTBCR_ORGN0_WBWA | TTBCR_IRGN0_WBWA;
-+#else
-+ reg |= TTBCR_ORGN0_WBNWA | TTBCR_IRGN0_WBNWA;
-+#endif
-+
-+ if (is_hyp()) {
-+ /* Set HCTR to enable LPAE */
-+ asm volatile("mcr p15, 4, %0, c2, c0, 2"
-+ : : "r" (reg) : "memory");
-+ /* Set HTTBR0 */
-+ asm volatile("mcrr p15, 4, %0, %1, c2"
-+ :
-+ : "r"(gd->tlb_addr + (4096 * 4)), "r"(0)
-+ : "memory");
-+ /* Set HMAIR */
-+ asm volatile("mcr p15, 4, %0, c10, c2, 0"
-+ : : "r" (MEMORY_ATTRIBUTES) : "memory");
-+ } else {
-+ /* Set TTBCR to enable LPAE */
-+ asm volatile("mcr p15, 0, %0, c2, c0, 2"
-+ : : "r" (reg) : "memory");
-+ /* Set 64-bit TTBR0 */
-+ asm volatile("mcrr p15, 0, %0, %1, c2"
-+ :
-+ : "r"(gd->tlb_addr + (4096 * 4)), "r"(0)
-+ : "memory");
-+ /* Set MAIR */
-+ asm volatile("mcr p15, 0, %0, c10, c2, 0"
-+ : : "r" (MEMORY_ATTRIBUTES) : "memory");
-+ }
-+#elif defined(CONFIG_ARMV7)
-+ /* Set TTBR0 */
-+ reg = gd->tlb_addr & TTBR0_BASE_ADDR_MASK;
-+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-+ reg |= TTBR0_RGN_WT | TTBR0_IRGN_WT;
-+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-+ reg |= TTBR0_RGN_WBWA | TTBR0_IRGN_WBWA;
-+#else
-+ reg |= TTBR0_RGN_WB | TTBR0_IRGN_WB;
-+#endif
-+ asm volatile("mcr p15, 0, %0, c2, c0, 0"
-+ : : "r" (reg) : "memory");
-+#else
- /* Copy the page table address to cp15 */
- asm volatile("mcr p15, 0, %0, c2, c0, 0"
- : : "r" (gd->tlb_addr) : "memory");
-+#endif
- /* Set the access control to all-supervisor */
- asm volatile("mcr p15, 0, %0, c3, c0, 0"
- : : "r" (~0));
-+
- /* and enable the mmu */
- reg = get_cr(); /* get control reg. */
- cp_delay();
-diff --git a/arch/arm/lib/call_with_stack.S b/arch/arm/lib/call_with_stack.S
-new file mode 100644
-index 0000000..651d869
---- /dev/null
-+++ b/arch/arm/lib/call_with_stack.S
-@@ -0,0 +1,20 @@
-+.globl call_with_stack
-+.syntax unified /* use unified assembler syntax */
-+#ifdef __thumb__
-+.thumb /* assemble in Thumb-2 (.thumb" can also be used) */
-+#endif
-+call_with_stack:
-+ str sp, [r2, #-4]!
-+ str lr, [r2, #-4]!
-+
-+ mov sp, r2
-+ mov r2, r0
-+ mov r0, r1
-+
-+ adr lr, 1f
-+ mov pc, r2
-+
-+1: ldr lr, [sp]
-+ ldr sp, [sp, #4]
-+ mov pc, lr
-+
-diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
-index 71836e2..6c4fd1a 100644
---- a/board/renesas/porter/porter.c
-+++ b/board/renesas/porter/porter.c
-@@ -42,6 +42,10 @@ void s_init(void)
- struct r8a7791_swdt *swdt = (struct r8a7791_swdt *)SWDT_BASE;
- u32 val;
-
-+#ifdef CONFIG_SYS_ARCH_TIMER
-+ arm_arch_timer_init();
-+#endif
-+
- /* Watchdog init */
- writel(0xA5A5A500, &rwdt->rwtcsra);
- writel(0xA5A5A500, &swdt->swtcsra);
-@@ -71,10 +75,12 @@ int board_early_init_f(void)
- {
- u32 val;
-
-+#ifdef CONFIG_TMU_TIMER
- /* TMU0 */
- val = readl(MSTPSR1);
- val &= ~TMU0_MSTP125;
- writel(val, SMSTPCR1);
-+#endif
-
- val = readl(MSTPSR7);
- val &= ~SCIF0_MSTP721;
-@@ -114,7 +120,9 @@ int board_init(void)
- /* Init PFC controller */
- r8a7791_pinmux_init();
-
-+#ifdef CONFIG_TMU_TIMER
- sh_timer_init();
-+#endif
-
- /* ETHER Enable */
- gpio_request(GPIO_FN_ETH_CRS_DV, NULL);
-@@ -288,10 +296,12 @@ void arch_preboot_os()
- u32 val;
- int i;
-
-+#ifdef CONFIG_TMU_TIMER
- /* stop TMU0 */
- val = readb(TMU_BASE + TSTR0);
- val &= ~TSTR0_STR0;
- writeb(val, TMU_BASE + TSTR0);
-+#endif
-
- /* stop all module clock*/
- for (i = MSTP00; i < MSTP_NR; i++) {
-diff --git a/include/configs/porter.h b/include/configs/porter.h
-index 7ab0643..5567c7c 100644
---- a/include/configs/porter.h
-+++ b/include/configs/porter.h
-@@ -53,6 +53,9 @@
- #define CONFIG_CMD_EXT4_WRITE
- #define CONFIG_CMD_SF
- #define CONFIG_CMD_SPI
-+#define CONFIG_CMD_SWSUSP
-+#define CONFIG_CMD_SWSUSPMEM
-+#define CONFIG_LZO
-
- #define CONFIG_CMDLINE_TAG
- #define CONFIG_SETUP_MEMORY_TAGS
-@@ -75,7 +78,6 @@
- #define CONFIG_BOARD_EARLY_INIT_F
- #define CONFIG_USE_ARCH_MEMSET
- #define CONFIG_USE_ARCH_MEMCPY
--#define CONFIG_TMU_TIMER
-
- /* STACK */
- #if defined(CONFIG_EXTRAM_BOOT)
-@@ -89,8 +91,8 @@
-
- /* MEMORY */
- #define PORTER_SDRAM_BASE 0x40000000
--#define PORTER_SDRAM_SIZE 0x40000000
--#define PORTER_UBOOT_SDRAM_SIZE 0x20000000
-+#define PORTER_SDRAM_SIZE 0x48000000
-+#define PORTER_UBOOT_SDRAM_SIZE 0x40000000
-
- #define CONFIG_SYS_LONGHELP
- #define CONFIG_SYS_PROMPT "=> "
-@@ -203,4 +205,15 @@
- #define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */
- #define CONFIG_USB_ETHER_ASIX /* Asix, or whatever driver(s) you want */
-
-+#define CONFIG_ARMV7_LPAE /* 64-bit MMU descriptors */
-+#define CONFIG_SYS_ARM_CACHE_WRITEALLOC /* Make memory operations faster */
-+
-+#define CONFIG_SYS_ARCH_TIMER /* Init arch timer */
-+#define CONFIG_VE_ENABLED /* Virtualization Extensions are enabled*/
-+#define CONFIG_SYS_HZ_CLOCK CONFIG_SYS_CLK_FREQ
-+
-+#define CONFIG_SH_DMA
-+#define CONFIG_SH_SYS_DMAL_BASE 0xE6700000
-+#define CONFIG_SH_SYS_DMAL_NCH 15
-+
- #endif /* __PORTER_H */
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend b/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend
deleted file mode 100644
index 9535e174d..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-bsp/u-boot/u-boot_2013.01.01.bbappend
+++ /dev/null
@@ -1,13 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-SRC_URI_append_porter_sota = "file://0001-Autoload-uEnv.txt-on-boot.patch"
-
-SRC_URI_append_agl-porter-hibernate = " file://hibernation/0001-Add-rcar-sdhi-DMA-support.patch \
- file://hibernation/0002-Add-Hibernation-swsusp-command-support.patch \
- file://hibernation/0003-Add-Hibernation-swsuspmem-command-support.patch \
- file://hibernation/0004-Add-porter-board-Hibernation-code.patch \
- file://hibernation/0001-Add-hibernation-image-area.patch \
- file://hibernation/0002-Enable-swsusp-DMA-support.patch \
- file://hibernation/0003-Add-hibernation-image-area.patch \
- "
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend
deleted file mode 100644
index 7a54dfbe4..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-# Disable LVDS
-WESTONOUTPUT2[name] = "LVDS-1"
-WESTONOUTPUT2[mode] = "off"
-
-WESTONSECTION[WESTONOUTPUT2] = "output"
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend
deleted file mode 100755
index 589ed87dc..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
-FILESEXTRAPATHS_prepend := '${THISDIR}/${PN}:'
-SRC_URI_r8a7791_append_agl-porter-hibernate = ' file://hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch \
- '
-python __anonymous () {
- d.delVarFlag('do_patch', 'noexec')
-}
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch
deleted file mode 100644
index a3dd6089c..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/gles-module/gles-kernel-module/hibernation/0001-Add-gles-hibernation-code-for-M2W-only.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 600612d670639fc74135a4f15a79d411931b39a8 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Sun, 21 May 2017 12:14:03 +0900
-Subject: [PATCH] Add gles hibernation code for M2W only
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- services4/srvkm/env/linux/module.c | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/services4/srvkm/env/linux/module.c b/services4/srvkm/env/linux/module.c
-index f3f22b0..85ac24f 100644
---- a/services4/srvkm/env/linux/module.c
-+++ b/services4/srvkm/env/linux/module.c
-@@ -284,9 +284,18 @@ static struct platform_device_id powervr_id_table[] __devinitdata = {
- };
- #endif
-
-+int pvrsrv_restore_noirq(struct device *dev)
-+{
-+#if defined(CONFIG_ARM_LPAE) && defined(SUPPORT_RCAR_IPMMU)
-+ extern int r8a779x_ipmmu_initialize(void);
-+ r8a779x_ipmmu_initialize();
-+#endif
-+ return 0;
-+}
-+
- static struct dev_pm_ops powervr_dev_pm_ops = {
-- .suspend = PVRSRVDriverSuspend,
-- .resume = PVRSRVDriverResume,
-+ SET_SYSTEM_SLEEP_PM_OPS(PVRSRVDriverSuspend, PVRSRVDriverResume)
-+ .restore_noirq = pvrsrv_restore_noirq,
- };
-
- static LDM_DRV powervr_driver = {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend
deleted file mode 100755
index 368f1ba1c..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux-renesas_%.bbappend
+++ /dev/null
@@ -1,44 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux:"
-
-# Enable support for TP-Link TL-W722N USB Wifi adapter and RTL2832U DVB USB and USB Audio
-# adapter.
-SRC_URI += " file://disable_delay_printk.patch \
- file://cfg_mac_80211.cfg \
- file://ath9k_htc.cfg \
- file://rtl_sdr.cfg \
- file://usbaudio.cfg \
- file://ra2x00.cfg \
- file://0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch \
- file://0002-media-r820t-remove-redundant-initializations-in-r820.patch \
- file://0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch \
- file://hciattach.cfg \
- file://pppd-rcar.cfg \
- "
-
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg ${WORKDIR}/rtl_sdr.cfg"
-
-SRC_URI_append_agl-porter-hibernate = " file://hibernation/0001-Add-Hibernation-kernel-base-code.patch \
- file://hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch \
- file://hibernation/0003-Add-sata-hibernation-code.patch \
- file://hibernation/0004-Add-firmware-hibernation-code.patch \
- file://hibernation/0005-Add-rcar-dma-hibernation-code.patch \
- file://hibernation/0006-Add-rcar-du-hibernation-code.patch \
- file://hibernation/0007-Add-rcar-i2c-hibernation-code.patch \
- file://hibernation/0008-Add-rcar-mmc-hibernation-code.patch \
- file://hibernation/0009-Add-hibernation-store-area.patch \
- file://hibernation/0010-Add-rcar-eth-hibernation-code.patch \
- file://hibernation/0011-Add-rcar-pci-hibernation-code.patch \
- file://hibernation/0012-Add-rcar-gpio-hibernation-code.patch \
- file://hibernation/0013-Add-rcar-spi-hibernation-code.patch \
- file://hibernation/0014-Add-rcar-sci-hibernation-code.patch \
- file://hibernation/0015-Add-rcar-usbphy-hibernation-code.patch \
- file://hibernation/0001-Add-shdmac-hibernation-code.patch \
- file://hibernation/0002-Fix-Black-blink-correction-of-display.patch \
- file://hibernation/0003-Add-hibernation-image-area.patch \
- file://hibernation/hibernation.cfg \
- "
-
-KERNEL_CONFIG_FRAGMENTS_append_agl-porter-hibernate += " ${WORKDIR}/hibernation/hibernation.cfg"
-
-# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg"
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch
deleted file mode 100644
index 61542556d..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0001-media-r820t-do-not-double-free-fe-tuner_priv-in-r820.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 4aab0398e003ac2effae98ba66a012ed715967ba Mon Sep 17 00:00:00 2001
-From: Gianluca Gennari <gennarone@gmail.com>
-Date: Sun, 2 Jun 2013 14:26:15 -0300
-Subject: [PATCH 1/3] [media] r820t: do not double-free fe->tuner_priv in
- r820t_release()
-
-fe->tuner_priv is already freed by hybrid_tuner_release_state().
-
-Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
-Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
----
- drivers/media/tuners/r820t.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
-index 4835021..64f9738 100644
---- a/drivers/media/tuners/r820t.c
-+++ b/drivers/media/tuners/r820t.c
-@@ -2256,7 +2256,6 @@ static int r820t_release(struct dvb_frontend *fe)
-
- mutex_unlock(&r820t_list_mutex);
-
-- kfree(fe->tuner_priv);
- fe->tuner_priv = NULL;
-
- return 0;
---
-2.9.2
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch
deleted file mode 100644
index 596dd6bee..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0002-media-r820t-remove-redundant-initializations-in-r820.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From e2e324d70defce7ffc4668085dc3c8ae580074e5 Mon Sep 17 00:00:00 2001
-From: Gianluca Gennari <gennarone@gmail.com>
-Date: Sun, 2 Jun 2013 14:30:09 -0300
-Subject: [PATCH 2/3] [media] r820t: remove redundant initializations in
- r820t_attach()
-
-fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach().
-Remove the redundant initializations and also move fe->ops.tuner_ops
-initialization outside of the mutex lock (as in the xc4000 tuner code for example).
-
-Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
-Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
----
- drivers/media/tuners/r820t.c | 9 +++------
- 1 file changed, 3 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
-index 64f9738..63062a9 100644
---- a/drivers/media/tuners/r820t.c
-+++ b/drivers/media/tuners/r820t.c
-@@ -2310,8 +2310,6 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
- break;
- }
-
-- memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, sizeof(r820t_tuner_ops));
--
- if (fe->ops.i2c_gate_ctrl)
- fe->ops.i2c_gate_ctrl(fe, 1);
-
-@@ -2326,15 +2324,14 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
-
- tuner_info("Rafael Micro r820t successfully identified\n");
-
-- fe->tuner_priv = priv;
-- memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
-- sizeof(struct dvb_tuner_ops));
--
- if (fe->ops.i2c_gate_ctrl)
- fe->ops.i2c_gate_ctrl(fe, 0);
-
- mutex_unlock(&r820t_list_mutex);
-
-+ memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
-+ sizeof(struct dvb_tuner_ops));
-+
- return fe;
- err:
- if (fe->ops.i2c_gate_ctrl)
---
-2.9.2
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch
deleted file mode 100644
index fac5c2171..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/0003-media-r820t-avoid-potential-memcpy-buffer-overflow-i.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 757d7ace565c06e1302ba7c9244d839455e13881 Mon Sep 17 00:00:00 2001
-From: Gianluca Gennari <gennarone@gmail.com>
-Date: Sun, 2 Jun 2013 14:31:19 -0300
-Subject: [PATCH 3/3] [media] r820t: avoid potential memcpy buffer overflow in
- shadow_store()
-
-The memcpy in shadow_store() could exceed buffer limits when r > 0.
-
-Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
-Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
----
- drivers/media/tuners/r820t.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
-index 63062a9..0a5f96b 100644
---- a/drivers/media/tuners/r820t.c
-+++ b/drivers/media/tuners/r820t.c
-@@ -364,8 +364,8 @@ static void shadow_store(struct r820t_priv *priv, u8 reg, const u8 *val,
- }
- if (len <= 0)
- return;
-- if (len > NUM_REGS)
-- len = NUM_REGS;
-+ if (len > NUM_REGS - r)
-+ len = NUM_REGS - r;
-
- tuner_dbg("%s: prev reg=%02x len=%d: %*ph\n",
- __func__, r + REG_SHADOW_START, len, len, val);
---
-2.9.2
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg
deleted file mode 100644
index 965dede65..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ath9k_htc.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg
deleted file mode 100644
index 559f3e7af..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/cfg_mac_80211.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_CFG80211=m
-CONFIG_MAC80211=m
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch
deleted file mode 100755
index 28acf1e08..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/disable_delay_printk.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
-old mode 100644
-new mode 100755
-index 93b6e32..2e9dd36
---- a/sound/usb/pcm.c
-+++ b/sound/usb/pcm.c
-@@ -1420,8 +1420,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs,
- * on two reads of a counter updated every ms.
- */
- if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2)
-- snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n",
-- est_delay, subs->last_delay);
-+// snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n",
-+// est_delay, subs->last_delay);
-
- if (!subs->running) {
- /* update last_frame_number for delay counting here since
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg
deleted file mode 100755
index 95ee2d7fc..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hciattach.cfg
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG_BT_HCIUART=m
-CONFIG_BT_HCIUART_H4=y
-CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIUART_LL=y
-CONFIG_BT_HCIUART_3WIRE=y
-CONFIG_USB_SERIAL=y
-CONFIG_USB_SERIAL_GENERIC=y
-CONFIG_USB_SERIAL_CP210X=y
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch
deleted file mode 100755
index 87cd2863a..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-Hibernation-kernel-base-code.patch
+++ /dev/null
@@ -1,853 +0,0 @@
-From 60123966221b74199e4cf0c18d43396b4f00a94a Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 16:44:34 +0900
-Subject: [PATCH 01/15] Add Hibernation kernel base code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- include/linux/sched.h | 1 +
- include/linux/suspend.h | 2 +
- kernel/auditfilter.c | 2 +-
- kernel/power/console.c | 2 +
- kernel/power/hibernate.c | 146 +++++++++++++++++++++++++++++++----------------
- kernel/power/main.c | 4 --
- kernel/power/power.h | 8 ++-
- kernel/power/process.c | 35 ++++++++----
- kernel/power/snapshot.c | 33 +++++++----
- kernel/power/suspend.c | 4 +-
- kernel/power/swap.c | 50 ++++++++++++++--
- 11 files changed, 201 insertions(+), 86 deletions(-)
-
-diff --git a/include/linux/sched.h b/include/linux/sched.h
-index f87e9a8..8e3270c 100644
---- a/include/linux/sched.h
-+++ b/include/linux/sched.h
-@@ -1644,6 +1644,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,
- #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
- #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
- #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
-+#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */
-
- /*
- * Only the _current_ task can read/write to tsk->flags, but other
-diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index d4e3f16..243ff56 100644
---- a/include/linux/suspend.h
-+++ b/include/linux/suspend.h
-@@ -320,6 +320,8 @@ extern unsigned long get_safe_page(gfp_t gfp_mask);
- extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
- extern int hibernate(void);
- extern bool system_entering_hibernation(void);
-+asmlinkage int swsusp_save(void);
-+extern struct pbe *restore_pblist;
- #else /* CONFIG_HIBERNATION */
- static inline void register_nosave_region(unsigned long b, unsigned long e) {}
- static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
-diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
-index 6bd4a90..ac08a9a 100644
---- a/kernel/auditfilter.c
-+++ b/kernel/auditfilter.c
-@@ -423,7 +423,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
- f->lsm_rule = NULL;
-
- /* Support legacy tests for a valid loginuid */
-- if ((f->type == AUDIT_LOGINUID) && (f->val == 4294967295)) {
-+ if ((f->type == AUDIT_LOGINUID) && (f->val == 0xFFFFFFFF)) {
- f->type = AUDIT_LOGINUID_SET;
- f->val = 0;
- }
-diff --git a/kernel/power/console.c b/kernel/power/console.c
-index 463aa67..aba9c54 100644
---- a/kernel/power/console.c
-+++ b/kernel/power/console.c
-@@ -9,6 +9,7 @@
- #include <linux/kbd_kern.h>
- #include <linux/vt.h>
- #include <linux/module.h>
-+#include <linux/slab.h>
- #include "power.h"
-
- #define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1)
-@@ -81,6 +82,7 @@ void pm_vt_switch_unregister(struct device *dev)
- list_for_each_entry(tmp, &pm_vt_switch_list, head) {
- if (tmp->dev == dev) {
- list_del(&tmp->head);
-+ kfree(tmp);
- break;
- }
- }
-diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
-index b26f5f1..524dcf5 100644
---- a/kernel/power/hibernate.c
-+++ b/kernel/power/hibernate.c
-@@ -34,12 +34,13 @@
-
- static int nocompress;
- static int noresume;
-+static int nohibernate;
- static int resume_wait;
--static int resume_delay;
-+static unsigned int resume_delay;
- static char resume_file[256] = CONFIG_PM_STD_PARTITION;
- dev_t swsusp_resume_device;
- sector_t swsusp_resume_block;
--int in_suspend __nosavedata;
-+__visible int in_suspend __nosavedata;
-
- enum {
- HIBERNATION_INVALID,
-@@ -61,6 +62,11 @@ bool freezer_test_done;
-
- static const struct platform_hibernation_ops *hibernation_ops;
-
-+bool hibernation_available(void)
-+{
-+ return (nohibernate == 0);
-+}
-+
- /**
- * hibernation_set_ops - Set the global hibernate operations.
- * @ops: Hibernation operations to use in subsequent hibernation transitions.
-@@ -82,6 +88,7 @@ void hibernation_set_ops(const struct platform_hibernation_ops *ops)
-
- unlock_system_sleep();
- }
-+EXPORT_SYMBOL_GPL(hibernation_set_ops);
-
- static bool entering_platform_hibernation;
-
-@@ -227,19 +234,23 @@ static void platform_recover(int platform_mode)
- void swsusp_show_speed(struct timeval *start, struct timeval *stop,
- unsigned nr_pages, char *msg)
- {
-- s64 elapsed_centisecs64;
-- int centisecs;
-- int k;
-- int kps;
-+ u64 elapsed_centisecs64;
-+ unsigned int centisecs;
-+ unsigned int k;
-+ unsigned int kps;
-
- elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start);
-+ /*
-+ * If "(s64)elapsed_centisecs64 < 0", it will print long elapsed time,
-+ * it is obvious enough for what went wrong.
-+ */
- do_div(elapsed_centisecs64, NSEC_PER_SEC / 100);
- centisecs = elapsed_centisecs64;
- if (centisecs == 0)
- centisecs = 1; /* avoid div-by-zero */
- k = nr_pages * (PAGE_SIZE / 1024);
- kps = (k * 100) / centisecs;
-- printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
-+ pr_info("PM: %s %u kbytes in %u.%02u seconds (%u.%02u MB/s)\n",
- msg, k,
- centisecs / 100, centisecs % 100,
- kps / 1000, (kps % 1000) / 10);
-@@ -293,10 +304,10 @@ static int create_image(int platform_mode)
- error);
- /* Restore control flow magically appears here */
- restore_processor_state();
-- if (!in_suspend) {
-+ if (!in_suspend)
- events_check_enabled = false;
-- platform_leave(platform_mode);
-- }
-+
-+ platform_leave(platform_mode);
-
- Power_up:
- syscore_resume();
-@@ -594,7 +605,8 @@ static void power_down(void)
- case HIBERNATION_PLATFORM:
- hibernation_platform_enter();
- case HIBERNATION_SHUTDOWN:
-- kernel_power_off();
-+ if (pm_power_off)
-+ kernel_power_off();
- break;
- #ifdef CONFIG_SUSPEND
- case HIBERNATION_SUSPEND:
-@@ -622,7 +634,8 @@ static void power_down(void)
- * corruption after resume.
- */
- printk(KERN_CRIT "PM: Please power down manually\n");
-- while(1);
-+ while (1)
-+ cpu_relax();
- }
-
- /**
-@@ -632,6 +645,11 @@ int hibernate(void)
- {
- int error;
-
-+ if (!hibernation_available()) {
-+ pr_debug("PM: Hibernation not available.\n");
-+ return -EPERM;
-+ }
-+
- lock_system_sleep();
- /* The snapshot device should not be opened while we're running */
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
-@@ -644,22 +662,22 @@ int hibernate(void)
- if (error)
- goto Exit;
-
-- /* Allocate memory management structures */
-- error = create_basic_memory_bitmaps();
-- if (error)
-- goto Exit;
--
- printk(KERN_INFO "PM: Syncing filesystems ... ");
- sys_sync();
- printk("done.\n");
-
- error = freeze_processes();
- if (error)
-- goto Free_bitmaps;
-+ goto Exit;
-+
-+ /* Allocate memory management structures */
-+ error = create_basic_memory_bitmaps();
-+ if (error)
-+ goto Thaw;
-
- error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
- if (error || freezer_test_done)
-- goto Thaw;
-+ goto Free_bitmaps;
-
- if (in_suspend) {
- unsigned int flags = 0;
-@@ -682,14 +700,13 @@ int hibernate(void)
- pr_debug("PM: Image restored successfully.\n");
- }
-
-+ Free_bitmaps:
-+ free_basic_memory_bitmaps();
- Thaw:
- thaw_processes();
-
- /* Don't bother checking whether freezer_test_done is true */
- freezer_test_done = false;
--
-- Free_bitmaps:
-- free_basic_memory_bitmaps();
- Exit:
- pm_notifier_call_chain(PM_POST_HIBERNATION);
- pm_restore_console();
-@@ -723,7 +740,7 @@ static int software_resume(void)
- /*
- * If the user said "noresume".. bail out early.
- */
-- if (noresume)
-+ if (noresume || !hibernation_available())
- return 0;
-
- /*
-@@ -806,21 +823,19 @@ static int software_resume(void)
- pm_prepare_console();
- error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
- if (error)
-- goto close_finish;
--
-- error = create_basic_memory_bitmaps();
-- if (error)
-- goto close_finish;
-+ goto Close_Finish;
-
- pr_debug("PM: Preparing processes for restore.\n");
- error = freeze_processes();
-- if (error) {
-- swsusp_close(FMODE_READ);
-- goto Done;
-- }
-+ if (error)
-+ goto Close_Finish;
-
- pr_debug("PM: Loading hibernation image.\n");
-
-+ error = create_basic_memory_bitmaps();
-+ if (error)
-+ goto Thaw;
-+
- error = swsusp_read(&flags);
- swsusp_close(FMODE_READ);
- if (!error)
-@@ -828,9 +843,9 @@ static int software_resume(void)
-
- printk(KERN_ERR "PM: Failed to load hibernation image, recovering.\n");
- swsusp_free();
-- thaw_processes();
-- Done:
- free_basic_memory_bitmaps();
-+ Thaw:
-+ thaw_processes();
- Finish:
- pm_notifier_call_chain(PM_POST_RESTORE);
- pm_restore_console();
-@@ -840,12 +855,12 @@ static int software_resume(void)
- mutex_unlock(&pm_mutex);
- pr_debug("PM: Hibernation image not present or could not be loaded.\n");
- return error;
--close_finish:
-+ Close_Finish:
- swsusp_close(FMODE_READ);
- goto Finish;
- }
-
--late_initcall(software_resume);
-+late_initcall_sync(software_resume);
-
-
- static const char * const hibernation_modes[] = {
-@@ -889,6 +904,9 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
- int i;
- char *start = buf;
-
-+ if (!hibernation_available())
-+ return sprintf(buf, "[disabled]\n");
-+
- for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) {
- if (!hibernation_modes[i])
- continue;
-@@ -923,6 +941,9 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
- char *p;
- int mode = HIBERNATION_INVALID;
-
-+ if (!hibernation_available())
-+ return -EPERM;
-+
- p = memchr(buf, '\n', n);
- len = p ? p - buf : n;
-
-@@ -971,16 +992,20 @@ static ssize_t resume_show(struct kobject *kobj, struct kobj_attribute *attr,
- static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
- const char *buf, size_t n)
- {
-- unsigned int maj, min;
- dev_t res;
-- int ret = -EINVAL;
-+ int len = n;
-+ char *name;
-
-- if (sscanf(buf, "%u:%u", &maj, &min) != 2)
-- goto out;
-+ if (len && buf[len-1] == '\n')
-+ len--;
-+ name = kstrndup(buf, len, GFP_KERNEL);
-+ if (!name)
-+ return -ENOMEM;
-
-- res = MKDEV(maj,min);
-- if (maj != MAJOR(res) || min != MINOR(res))
-- goto out;
-+ res = name_to_dev_t(name);
-+ kfree(name);
-+ if (!res)
-+ return -EINVAL;
-
- lock_system_sleep();
- swsusp_resume_device = res;
-@@ -988,20 +1013,20 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
- printk(KERN_INFO "PM: Starting manual resume from disk\n");
- noresume = 0;
- software_resume();
-- ret = n;
-- out:
-- return ret;
-+ return n;
- }
-
- power_attr(resume);
-
--static ssize_t image_size_show(struct kobject *kobj, struct kobj_attribute *attr,
-+static ssize_t image_size_show(struct kobject *kobj,
-+ struct kobj_attribute *attr,
- char *buf)
- {
- return sprintf(buf, "%lu\n", image_size);
- }
-
--static ssize_t image_size_store(struct kobject *kobj, struct kobj_attribute *attr,
-+static ssize_t image_size_store(struct kobject *kobj,
-+ struct kobj_attribute *attr,
- const char *buf, size_t n)
- {
- unsigned long size;
-@@ -1065,7 +1090,7 @@ static int __init resume_setup(char *str)
- if (noresume)
- return 1;
-
-- strncpy( resume_file, str, 255 );
-+ strncpy(resume_file, str, 255);
- return 1;
- }
-
-@@ -1088,6 +1113,10 @@ static int __init hibernate_setup(char *str)
- noresume = 1;
- else if (!strncmp(str, "nocompress", 10))
- nocompress = 1;
-+ else if (!strncmp(str, "no", 2)) {
-+ noresume = 1;
-+ nohibernate = 1;
-+ }
- return 1;
- }
-
-@@ -1105,13 +1134,30 @@ static int __init resumewait_setup(char *str)
-
- static int __init resumedelay_setup(char *str)
- {
-- resume_delay = simple_strtoul(str, NULL, 0);
-+ int rc = kstrtouint(str, 0, &resume_delay);
-+
-+ if (rc)
-+ return rc;
-+ return 1;
-+}
-+
-+static int __init nohibernate_setup(char *str)
-+{
-+ noresume = 1;
-+ nohibernate = 1;
- return 1;
- }
-
-+static int __init kaslr_nohibernate_setup(char *str)
-+{
-+ return nohibernate_setup(str);
-+}
-+
- __setup("noresume", noresume_setup);
- __setup("resume_offset=", resume_offset_setup);
- __setup("resume=", resume_setup);
- __setup("hibernate=", hibernate_setup);
- __setup("resumewait", resumewait_setup);
- __setup("resumedelay=", resumedelay_setup);
-+__setup("nohibernate", nohibernate_setup);
-+__setup("kaslr", kaslr_nohibernate_setup);
-diff --git a/kernel/power/main.c b/kernel/power/main.c
-index d77663b..ac615e4 100644
---- a/kernel/power/main.c
-+++ b/kernel/power/main.c
-@@ -610,7 +610,6 @@ static struct attribute_group attr_group = {
- .attrs = g,
- };
-
--#ifdef CONFIG_PM_RUNTIME
- struct workqueue_struct *pm_wq;
- EXPORT_SYMBOL_GPL(pm_wq);
-
-@@ -620,9 +619,6 @@ static int __init pm_start_workqueue(void)
-
- return pm_wq ? 0 : -ENOMEM;
- }
--#else
--static inline int pm_start_workqueue(void) { return 0; }
--#endif
-
- static int __init pm_init(void)
- {
-diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 7d4b7ff..c5821ca 100644
---- a/kernel/power/power.h
-+++ b/kernel/power/power.h
-@@ -2,6 +2,7 @@
- #include <linux/suspend_ioctls.h>
- #include <linux/utsname.h>
- #include <linux/freezer.h>
-+#include <linux/compiler.h>
-
- struct swsusp_info {
- struct new_utsname uts;
-@@ -11,7 +12,8 @@ struct swsusp_info {
- unsigned long image_pages;
- unsigned long pages;
- unsigned long size;
--} __attribute__((aligned(PAGE_SIZE)));
-+ char archdata[1024];
-+} __aligned(PAGE_SIZE);
-
- #ifdef CONFIG_HIBERNATION
- /* kernel/power/snapshot.c */
-@@ -37,6 +39,8 @@ static inline char *check_image_kernel(struct swsusp_info *info)
- }
- #endif /* CONFIG_ARCH_HIBERNATION_HEADER */
-
-+extern void __weak swsusp_arch_add_info(char *archdata);
-+
- /*
- * Keep some memory free so that I/O operations can succeed without paging
- * [Might this be more than 4 MB?]
-@@ -49,6 +53,8 @@ static inline char *check_image_kernel(struct swsusp_info *info)
- */
- #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT)
-
-+asmlinkage int swsusp_save(void);
-+
- /* kernel/power/hibernate.c */
- extern bool freezer_test_done;
-
-diff --git a/kernel/power/process.c b/kernel/power/process.c
-index 0695319..04559b4 100644
---- a/kernel/power/process.c
-+++ b/kernel/power/process.c
-@@ -30,9 +30,10 @@ static int try_to_freeze_tasks(bool user_only)
- unsigned int todo;
- bool wq_busy = false;
- struct timeval start, end;
-- u64 elapsed_csecs64;
-- unsigned int elapsed_csecs;
-+ u64 elapsed_msecs64;
-+ unsigned int elapsed_msecs;
- bool wakeup = false;
-+ int sleep_usecs = USEC_PER_MSEC;
-
- do_gettimeofday(&start);
-
-@@ -68,22 +69,25 @@ static int try_to_freeze_tasks(bool user_only)
-
- /*
- * We need to retry, but first give the freezing tasks some
-- * time to enter the refrigerator.
-+ * time to enter the refrigerator. Start with an initial
-+ * 1 ms sleep followed by exponential backoff until 8 ms.
- */
-- msleep(10);
-+ usleep_range(sleep_usecs / 2, sleep_usecs);
-+ if (sleep_usecs < 8 * USEC_PER_MSEC)
-+ sleep_usecs *= 2;
- }
-
- do_gettimeofday(&end);
-- elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
-- do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
-- elapsed_csecs = elapsed_csecs64;
-+ elapsed_msecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
-+ do_div(elapsed_msecs64, NSEC_PER_MSEC);
-+ elapsed_msecs = elapsed_msecs64;
-
- if (todo) {
- printk("\n");
-- printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
-+ printk(KERN_ERR "Freezing of tasks %s after %d.%03d seconds "
- "(%d tasks refusing to freeze, wq_busy=%d):\n",
- wakeup ? "aborted" : "failed",
-- elapsed_csecs / 100, elapsed_csecs % 100,
-+ elapsed_msecs / 1000, elapsed_msecs % 1000,
- todo - wq_busy, wq_busy);
-
- if (!wakeup) {
-@@ -96,8 +100,8 @@ static int try_to_freeze_tasks(bool user_only)
- read_unlock(&tasklist_lock);
- }
- } else {
-- printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
-- elapsed_csecs % 100);
-+ printk("(elapsed %d.%03d seconds) ", elapsed_msecs / 1000,
-+ elapsed_msecs % 1000);
- }
-
- return todo ? -EBUSY : 0;
-@@ -139,6 +143,9 @@ int freeze_processes(void)
- if (error)
- return error;
-
-+ /* Make sure this task doesn't get frozen */
-+ current->flags |= PF_SUSPEND_TASK;
-+
- if (!pm_freezing)
- atomic_inc(&system_freezing_cnt);
-
-@@ -202,6 +209,7 @@ int freeze_kernel_threads(void)
- void thaw_processes(void)
- {
- struct task_struct *g, *p;
-+ struct task_struct *curr = current;
-
- if (pm_freezing)
- atomic_dec(&system_freezing_cnt);
-@@ -217,10 +225,15 @@ void thaw_processes(void)
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p) {
-+ /* No other threads should have PF_SUSPEND_TASK set */
-+ WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK));
- __thaw_task(p);
- } while_each_thread(g, p);
- read_unlock(&tasklist_lock);
-
-+ WARN_ON(!(curr->flags & PF_SUSPEND_TASK));
-+ curr->flags &= ~PF_SUSPEND_TASK;
-+
- usermodehelper_enable();
-
- schedule();
-diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
-index 91c04f1..a673f7b 100644
---- a/kernel/power/snapshot.c
-+++ b/kernel/power/snapshot.c
-@@ -27,6 +27,7 @@
- #include <linux/highmem.h>
- #include <linux/list.h>
- #include <linux/slab.h>
-+#include <linux/compiler.h>
-
- #include <asm/uaccess.h>
- #include <asm/mmu_context.h>
-@@ -155,7 +156,7 @@ static inline void free_image_page(void *addr, int clear_nosave_free)
- struct linked_page {
- struct linked_page *next;
- char data[LINKED_PAGE_DATA_SIZE];
--} __attribute__((packed));
-+} __packed;
-
- static inline void
- free_list_of_pages(struct linked_page *list, int clear_page_nosave)
-@@ -352,7 +353,7 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask)
- struct mem_extent *ext, *cur, *aux;
-
- zone_start = zone->zone_start_pfn;
-- zone_end = zone->zone_start_pfn + zone->spanned_pages;
-+ zone_end = zone_end_pfn(zone);
-
- list_for_each_entry(ext, list, hook)
- if (zone_start <= ext->end)
-@@ -642,8 +643,9 @@ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
- region->end_pfn = end_pfn;
- list_add_tail(&region->list, &nosave_regions);
- Report:
-- printk(KERN_INFO "PM: Registered nosave memory: %016lx - %016lx\n",
-- start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
-+ printk(KERN_INFO "PM: Registered nosave memory: [mem %#010llx-%#010llx]\n",
-+ (unsigned long long) start_pfn << PAGE_SHIFT,
-+ ((unsigned long long) end_pfn << PAGE_SHIFT) - 1);
- }
-
- /*
-@@ -742,7 +744,10 @@ int create_basic_memory_bitmaps(void)
- struct memory_bitmap *bm1, *bm2;
- int error = 0;
-
-- BUG_ON(forbidden_pages_map || free_pages_map);
-+ if (forbidden_pages_map && free_pages_map)
-+ return 0;
-+ else
-+ BUG_ON(forbidden_pages_map || free_pages_map);
-
- bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
- if (!bm1)
-@@ -788,7 +793,8 @@ void free_basic_memory_bitmaps(void)
- {
- struct memory_bitmap *bm1, *bm2;
-
-- BUG_ON(!(forbidden_pages_map && free_pages_map));
-+ if (WARN_ON(!(forbidden_pages_map && free_pages_map)))
-+ return;
-
- bm1 = forbidden_pages_map;
- bm2 = free_pages_map;
-@@ -883,7 +889,7 @@ static unsigned int count_highmem_pages(void)
- continue;
-
- mark_free_pages(zone);
-- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
-+ max_zone_pfn = zone_end_pfn(zone);
- for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
- if (saveable_highmem_page(zone, pfn))
- n++;
-@@ -947,7 +953,7 @@ static unsigned int count_data_pages(void)
- continue;
-
- mark_free_pages(zone);
-- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
-+ max_zone_pfn = zone_end_pfn(zone);
- for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
- if (saveable_page(zone, pfn))
- n++;
-@@ -1040,7 +1046,7 @@ copy_data_pages(struct memory_bitmap *copy_bm, struct memory_bitmap *orig_bm)
- unsigned long max_zone_pfn;
-
- mark_free_pages(zone);
-- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
-+ max_zone_pfn = zone_end_pfn(zone);
- for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
- if (page_is_saveable(zone, pfn))
- memory_bm_set_bit(orig_bm, pfn);
-@@ -1092,7 +1098,7 @@ void swsusp_free(void)
- unsigned long pfn, max_zone_pfn;
-
- for_each_populated_zone(zone) {
-- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
-+ max_zone_pfn = zone_end_pfn(zone);
- for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
- if (pfn_valid(pfn)) {
- struct page *page = pfn_to_page(pfn);
-@@ -1580,7 +1586,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm,
- return -ENOMEM;
- }
-
--asmlinkage int swsusp_save(void)
-+asmlinkage __visible int swsusp_save(void)
- {
- unsigned int nr_pages, nr_highmem;
-
-@@ -1628,6 +1634,7 @@ static int init_header_complete(struct swsusp_info *info)
- {
- memcpy(&info->uts, init_utsname(), sizeof(struct new_utsname));
- info->version_code = LINUX_VERSION_CODE;
-+ swsusp_arch_add_info(info->archdata);
- return 0;
- }
-
-@@ -1647,6 +1654,8 @@ static char *check_image_kernel(struct swsusp_info *info)
- }
- #endif /* CONFIG_ARCH_HIBERNATION_HEADER */
-
-+void __weak swsusp_arch_add_info(char *archdata) {}
-+
- unsigned long snapshot_get_image_size(void)
- {
- return nr_copy_pages + nr_meta_pages + 1;
-@@ -1758,7 +1767,7 @@ static int mark_unsafe_pages(struct memory_bitmap *bm)
-
- /* Clear page flags */
- for_each_populated_zone(zone) {
-- max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
-+ max_zone_pfn = zone_end_pfn(zone);
- for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
- if (pfn_valid(pfn))
- swsusp_unset_page_free(pfn_to_page(pfn));
-diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
-index bef86d1..deec937 100644
---- a/kernel/power/suspend.c
-+++ b/kernel/power/suspend.c
-@@ -156,13 +156,13 @@ static int suspend_prepare(suspend_state_t state)
- }
-
- /* default implementation */
--void __attribute__ ((weak)) arch_suspend_disable_irqs(void)
-+void __weak arch_suspend_disable_irqs(void)
- {
- local_irq_disable();
- }
-
- /* default implementation */
--void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
-+void __weak arch_suspend_enable_irqs(void)
- {
- local_irq_enable();
- }
-diff --git a/kernel/power/swap.c b/kernel/power/swap.c
-index 7c33ed2..a6a1c55 100644
---- a/kernel/power/swap.c
-+++ b/kernel/power/swap.c
-@@ -91,17 +91,28 @@ struct swap_map_handle {
- unsigned int k;
- unsigned long reqd_free_pages;
- u32 crc32;
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ unsigned int img_size; /* add */
-+#endif
- };
-
- struct swsusp_header {
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) -
-+ sizeof(u32) - (sizeof(unsigned int)*4) - sizeof(u32)];
-+ unsigned int comp_crc32[4];
-+ u32 img_size;
-+#else
- char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) -
-- sizeof(u32)];
-+ sizeof(u32) - sizeof(u32)];
-+ u32 comp_crc32;
-+#endif
- u32 crc32;
- sector_t image;
- unsigned int flags; /* Flags to pass to the "boot" kernel */
- char orig_sig[10];
- char sig[10];
--} __attribute__((packed));
-+} __packed;
-
- static struct swsusp_header *swsusp_header;
-
-@@ -230,6 +241,11 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
- swsusp_header->flags = flags;
- if (flags & SF_CRC32_MODE)
- swsusp_header->crc32 = handle->crc32;
-+
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ swsusp_header->img_size = handle->img_size;
-+#endif
-+
- error = hib_bio_write_page(swsusp_resume_block,
- swsusp_header, NULL);
- } else {
-@@ -587,7 +603,11 @@ static int save_image_lzo(struct swap_map_handle *handle,
- unsigned char *page = NULL;
- struct cmp_data *data = NULL;
- struct crc_data *crc = NULL;
-+ int compr = 0;
-
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ unsigned int comp_imgtotal = 0;
-+#endif
- /*
- * We'll limit the number of threads for compression to limit memory
- * footprint.
-@@ -733,7 +753,12 @@ static int save_image_lzo(struct swap_map_handle *handle,
- }
-
- *(size_t *)data[thr].cmp = data[thr].cmp_len;
--
-+ compr += data[thr].cmp_len;
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ comp_imgtotal += (data[thr].cmp_len
-+ + LZO_HEADER + (PAGE_SIZE - 1))
-+ & ~(PAGE_SIZE - 1);
-+#endif
- /*
- * Given we are writing one page at a time to disk, we
- * copy that much from the buffer, although the last
-@@ -746,7 +771,6 @@ static int save_image_lzo(struct swap_map_handle *handle,
- off < LZO_HEADER + data[thr].cmp_len;
- off += PAGE_SIZE) {
- memcpy(page, data[thr].cmp + off, PAGE_SIZE);
--
- ret = swap_write_page(handle, page, &bio);
- if (ret)
- goto out_finish;
-@@ -762,8 +786,24 @@ out_finish:
- do_gettimeofday(&stop);
- if (!ret)
- ret = err2;
-- if (!ret)
-+ if (!ret) {
-+#ifdef CONFIG_ARCH_SHMOBILE
-+ const unsigned int ds = comp_imgtotal +
-+ ((comp_imgtotal
-+ / ((2 * 1024 * 1024)
-+ - PAGE_SIZE)) * PAGE_SIZE);
-+ const unsigned int swaped =
-+ (swp_offset(get_swap_page_of_type(root_swap))
-+ - 2) * PAGE_SIZE;
-+ if (ds < swaped)
-+ handle->img_size = swaped;
-+ else
-+ handle->img_size = ds;
-+#endif
- printk(KERN_INFO "PM: Image saving done.\n");
-+ printk(KERN_INFO "PM: Compressed output size: %d [%d] (imgsize=%d/swaped size=%d)\n",
-+ compr, handle->img_size, ds, swaped);
-+ }
- swsusp_show_speed(&start, &stop, nr_to_write, "Wrote");
- out_clean:
- if (crc) {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch
deleted file mode 100644
index ad4e4bc03..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0001-Add-shdmac-hibernation-code.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From dfc07c05c50155420e47f85442d099d433db869b Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:11:49 +0900
-Subject: [PATCH 1/3] Add shdmac hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/dma/sh/shdmac.c | 36 ++++++++++++++++++++++++------------
- 1 file changed, 24 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
-index 1c97cc5..d084437 100644
---- a/drivers/dma/sh/shdmac.c
-+++ b/drivers/dma/sh/shdmac.c
-@@ -743,11 +743,20 @@ static int sh_dmae_resume(struct device *dev)
- #define sh_dmae_resume NULL
- #endif
-
-+static int sh_dmae_restore(struct device *dev)
-+{
-+#ifdef CONFIG_PM
-+ return sh_dmae_resume(dev);
-+#else
-+ return 0;
-+#endif
-+}
-+
- const struct dev_pm_ops sh_dmae_pm = {
-- .suspend = sh_dmae_suspend,
-- .resume = sh_dmae_resume,
-- .runtime_suspend = sh_dmae_runtime_suspend,
-- .runtime_resume = sh_dmae_runtime_resume,
-+ SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume)
-+ SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume,
-+ NULL)
-+ .restore_noirq = sh_dmae_restore,
- };
-
- static dma_addr_t sh_dmae_slave_addr(struct shdma_chan *schan)
-@@ -798,7 +807,6 @@ static int sh_dmae_probe(struct platform_device *pdev)
- struct sh_dmae_device *shdev;
- struct dma_device *dma_dev;
- struct resource *chan, *dmars, *errirq_res, *chanirq_res;
-- unsigned long flags;
-
- if (pdev->dev.of_node)
- pdata = of_match_device(sh_dmae_of_match, &pdev->dev)->data;
-@@ -885,9 +893,9 @@ static int sh_dmae_probe(struct platform_device *pdev)
- if (err < 0)
- dev_err(&pdev->dev, "%s(): GET = %d\n", __func__, err);
-
-- spin_lock_irqsave(&sh_dmae_lock, flags);
-+ spin_lock_irq(&sh_dmae_lock);
- list_add_tail_rcu(&shdev->node, &sh_dmae_devices);
-- spin_unlock_irqrestore(&sh_dmae_lock, flags);
-+ spin_unlock_irq(&sh_dmae_lock);
-
- /* reset dma controller - only needed as a test */
- err = sh_dmae_rst(shdev);
-@@ -981,6 +989,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
- return err;
-
- edmadevreg:
-+ pm_runtime_get(&pdev->dev);
- chan_probe_err:
- sh_dmae_chan_remove(shdev);
-
-@@ -988,9 +997,9 @@ chan_probe_err:
- eirq_err:
- #endif
- rst_err:
-- spin_lock_irqsave(&sh_dmae_lock, flags);
-+ spin_lock_irq(&sh_dmae_lock);
- list_del_rcu(&shdev->node);
-- spin_unlock_irqrestore(&sh_dmae_lock, flags);
-+ spin_unlock_irq(&sh_dmae_lock);
-
- pm_runtime_put(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
-@@ -1007,13 +1016,12 @@ static int sh_dmae_remove(struct platform_device *pdev)
- {
- struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
- struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
-- unsigned long flags;
-
- dma_async_device_unregister(dma_dev);
-
-- spin_lock_irqsave(&sh_dmae_lock, flags);
-+ spin_lock_irq(&sh_dmae_lock);
- list_del_rcu(&shdev->node);
-- spin_unlock_irqrestore(&sh_dmae_lock, flags);
-+ spin_unlock_irq(&sh_dmae_lock);
-
- pm_runtime_disable(&pdev->dev);
-
-@@ -1047,7 +1055,11 @@ static int __init sh_dmae_init(void)
-
- return platform_driver_probe(&sh_dmae_driver, sh_dmae_probe);
- }
-+#ifdef MODULE
- module_init(sh_dmae_init);
-+#else
-+subsys_initcall(sh_dmae_init);
-+#endif
-
- static void __exit sh_dmae_exit(void)
- {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch
deleted file mode 100755
index 4db90e4e0..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Add-Hibernation-arch-code-Only-R-CAR-M2W.patch
+++ /dev/null
@@ -1,1529 +0,0 @@
-From 34a419b3fd88a2275ca681c99a5787b937e0f39d Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 16:47:29 +0900
-Subject: [PATCH 02/15] Add Hibernation arch code(Only R-CAR M2W)
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- arch/arm/Kconfig | 5 +
- arch/arm/include/asm/memory.h | 1 +
- arch/arm/include/asm/smp.h | 4 +
- arch/arm/include/asm/suspend.h | 3 +
- arch/arm/kernel/Makefile | 1 +
- arch/arm/kernel/hibernate.c | 139 ++++++++++++++
- arch/arm/kernel/process.c | 7 +-
- arch/arm/kernel/sleep.S | 8 +
- arch/arm/kernel/smp.c | 6 +
- arch/arm/kernel/suspend.c | 64 ++++---
- arch/arm/mach-shmobile/Kconfig | 65 +++++++
- arch/arm/mach-shmobile/Makefile | 1 +
- arch/arm/mach-shmobile/common.h | 8 +
- arch/arm/mach-shmobile/crc32_word4.c | 299 +++++++++++++++++++++++++++++++
- arch/arm/mach-shmobile/crc32_word4.h | 23 +++
- arch/arm/mach-shmobile/headsmp.S | 2 -
- arch/arm/mach-shmobile/hibernation.c | 243 +++++++++++++++++++++++++
- arch/arm/mach-shmobile/platsmp-apmu.c | 13 +-
- arch/arm/mach-shmobile/platsmp-rst.c | 3 +-
- arch/arm/mach-shmobile/pm-r8a7791.c | 27 +--
- arch/arm/mach-shmobile/rcar-gen2.h | 39 ++++
- arch/arm/mach-shmobile/setup-r8a7791.c | 10 +-
- arch/arm/mach-shmobile/setup-rcar-gen2.c | 14 +-
- arch/arm/mach-shmobile/smp-r8a7791.c | 8 +-
- arch/arm/mm/proc-v7.S | 31 ++--
- 25 files changed, 947 insertions(+), 77 deletions(-)
- create mode 100644 arch/arm/kernel/hibernate.c
- create mode 100644 arch/arm/mach-shmobile/crc32_word4.c
- create mode 100644 arch/arm/mach-shmobile/crc32_word4.h
- create mode 100644 arch/arm/mach-shmobile/hibernation.c
-
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 4dd95dd..eb76182 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -2232,6 +2232,11 @@ config ARCH_SUSPEND_POSSIBLE
- config ARM_CPU_SUSPEND
- def_bool PM_SLEEP
-
-+config ARCH_HIBERNATION_POSSIBLE
-+ bool
-+ depends on MMU
-+ default y if ARCH_SUSPEND_POSSIBLE
-+
- endmenu
-
- source "net/Kconfig"
-diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
-index 48cb2b3..01158e7 100644
---- a/arch/arm/include/asm/memory.h
-+++ b/arch/arm/include/asm/memory.h
-@@ -241,6 +241,7 @@ static inline void *phys_to_virt(phys_addr_t x)
- #define __pa(x) __virt_to_phys((unsigned long)(x))
- #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x)))
- #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
-+#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
-
- /*
- * Virtual <-> DMA view memory address translations
-diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
-index d3a22be..b718040 100644
---- a/arch/arm/include/asm/smp.h
-+++ b/arch/arm/include/asm/smp.h
-@@ -42,6 +42,10 @@ void handle_IPI(int ipinr, struct pt_regs *regs);
- */
- extern void smp_init_cpus(void);
-
-+/*
-+ * Provide a function to call machine specific cpu initialization sequence
-+ */
-+extern void arch_smp_prepare_cpus(unsigned int max_cpus);
-
- /*
- * Provide a function to raise an IPI cross call on CPUs in callmap.
-diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h
-index 1c0a551..709afa4 100644
---- a/arch/arm/include/asm/suspend.h
-+++ b/arch/arm/include/asm/suspend.h
-@@ -3,5 +3,8 @@
-
- extern void cpu_resume(void);
- extern int cpu_suspend(unsigned long, int (*)(unsigned long));
-+extern const void __nosave_begin, __nosave_end;
-+extern void cpu_resume_restore_nosave(u32, u32, u32);
-+extern void call_with_stack(void (*fn)(void *), void *arg, void *sp);
-
- #endif
-diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
-index 5f3338e..70f439f 100644
---- a/arch/arm/kernel/Makefile
-+++ b/arch/arm/kernel/Makefile
-@@ -32,6 +32,7 @@ obj-$(CONFIG_ARTHUR) += arthur.o
- obj-$(CONFIG_ISA_DMA) += dma-isa.o
- obj-$(CONFIG_PCI) += bios32.o isa.o
- obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
-+obj-$(CONFIG_HIBERNATION) += hibernate.o
- obj-$(CONFIG_SMP) += smp.o smp_tlb.o
- obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
- obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
-diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c
-new file mode 100644
-index 0000000..9380fe2
---- /dev/null
-+++ b/arch/arm/kernel/hibernate.c
-@@ -0,0 +1,139 @@
-+/*
-+ * Hibernation support specific for ARM
-+ *
-+ * Derived from work on ARM hibernation support by:
-+ *
-+ * Ubuntu project, hibernation support for mach-dove
-+ * Copyright (C) 2010 Nokia Corporation (Hiroshi Doyu)
-+ * Copyright (C) 2010 Texas Instruments, Inc. (Teerth Reddy et al.)
-+ * https://lkml.org/lkml/2010/6/18/4
-+ * https://lists.linux-foundation.org/pipermail/linux-pm/2010-June/027422.html
-+ * https://patchwork.kernel.org/patch/96442/
-+ *
-+ * Copyright (C) 2006 Rafael J. Wysocki <rjw at sisk.pl>
-+ *
-+ * License terms: GNU General Public License (GPL) version 2
-+ */
-+
-+#include <linux/mm.h>
-+#include <linux/suspend.h>
-+#include <asm/system_misc.h>
-+#include <asm/idmap.h>
-+#include <asm/suspend.h>
-+#include <asm/memory.h>
-+
-+struct swsusp_archdata {
-+ u32 nosave_backup_phys;
-+ u32 nosave_begin_phys;
-+ u32 nosave_end_phys;
-+ /* Function pointer */
-+ u32 cpu_resume_restore_nosave;
-+};
-+
-+static struct swsusp_archdata __archdata;
-+
-+void swsusp_arch_add_info(char *archdata)
-+{
-+ memcpy((void *)archdata, (void *)&__archdata,
-+ sizeof(struct swsusp_archdata));
-+}
-+
-+int pfn_is_nosave(unsigned long pfn)
-+{
-+ unsigned long nosave_begin_pfn = virt_to_pfn(&__nosave_begin);
-+ unsigned long nosave_end_pfn = virt_to_pfn(&__nosave_end - 1);
-+
-+ return (pfn >= nosave_begin_pfn) && (pfn <= nosave_end_pfn);
-+}
-+
-+void notrace save_processor_state(void)
-+{
-+ WARN_ON(num_online_cpus() != 1);
-+ local_fiq_disable();
-+}
-+
-+void notrace restore_processor_state(void)
-+{
-+ local_fiq_enable();
-+}
-+
-+/*
-+ * Snapshot kernel memory and reset the system.
-+ *
-+ * swsusp_save() is executed in the suspend finisher so that the CPU
-+ * context pointer and memory are part of the saved image, which is
-+ * required by the resume kernel image to restart execution from
-+ * swsusp_arch_suspend().
-+ *
-+ * soft_restart is not technically needed, but is used to get success
-+ * returned from cpu_suspend.
-+ *
-+ * When soft reboot completes, the hibernation snapshot is written out.
-+ */
-+static int notrace arch_save_image(unsigned long unused)
-+{
-+ int ret;
-+ ret = swsusp_save();
-+ if (ret == 0)
-+ soft_restart(virt_to_phys(cpu_resume));
-+ return ret;
-+}
-+
-+/*
-+ * Save the current CPU state before suspend / poweroff.
-+ */
-+int notrace swsusp_arch_suspend(void)
-+{
-+ return cpu_suspend(0, arch_save_image);
-+}
-+
-+/*
-+ * Restore page contents for physical pages that were in use during loading
-+ * hibernation image. Switch to idmap_pgd so the physical page tables
-+ * are overwritten with the same contents.
-+ */
-+static void notrace arch_restore_image(void *unused)
-+{
-+ struct pbe *pbe;
-+
-+
-+ cpu_switch_mm(idmap_pgd, &init_mm);
-+ for (pbe = restore_pblist; pbe; pbe = pbe->next)
-+ copy_page(pbe->orig_address, pbe->address);
-+
-+ soft_restart(virt_to_phys(cpu_resume));
-+}
-+static u64 resume_stack[PAGE_SIZE/2/sizeof(u64)] __nosavedata;
-+
-+/*
-+ * Resume from the hibernation image.
-+ * Due to the kernel heap / data restore, stack contents change underneath
-+ * and that would make function calls impossible; switch to a temporary
-+ * stack within the nosave region to avoid that problem.
-+ */
-+int swsusp_arch_resume(void)
-+{
-+ call_with_stack(arch_restore_image, 0,
-+ resume_stack + ARRAY_SIZE(resume_stack));
-+ return 0;
-+}
-+
-+static int __init swsusp_arch_init(void)
-+{
-+ char *backup;
-+ size_t len;
-+
-+ len = &__nosave_end - &__nosave_begin;
-+ backup = kmalloc(len, GFP_KERNEL);
-+ if (backup)
-+ memcpy(backup, &__nosave_begin, len);
-+
-+ __archdata.nosave_backup_phys = virt_to_phys(backup);
-+ __archdata.nosave_begin_phys = virt_to_phys(&__nosave_begin);
-+ __archdata.nosave_end_phys = virt_to_phys(&__nosave_end);
-+ __archdata.cpu_resume_restore_nosave =
-+ virt_to_phys(cpu_resume_restore_nosave);
-+
-+ return 0;
-+}
-+late_initcall(swsusp_arch_init);
-diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
-index 7927629..ae56f0b 100644
---- a/arch/arm/kernel/process.c
-+++ b/arch/arm/kernel/process.c
-@@ -98,7 +98,7 @@ void soft_restart(unsigned long addr)
- u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack);
-
- /* Disable interrupts first */
-- local_irq_disable();
-+ raw_local_irq_disable();
- local_fiq_disable();
-
- /* Disable the L2 if we're the last man standing. */
-@@ -284,12 +284,17 @@ void __show_regs(struct pt_regs *regs)
- buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
- buf[4] = '\0';
-
-+#ifndef CONFIG_CPU_V7M
- printk("Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n",
- buf, interrupts_enabled(regs) ? "n" : "ff",
- fast_interrupts_enabled(regs) ? "n" : "ff",
- processor_modes[processor_mode(regs)],
- isa_modes[isa_mode(regs)],
- get_fs() == get_ds() ? "kernel" : "user");
-+#else
-+ printk("xPSR: %08lx\n", regs->ARM_cpsr);
-+#endif
-+
- #ifdef CONFIG_CPU_CP15
- {
- unsigned int ctrl;
-diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
-index 987dcf3..e4d092f 100644
---- a/arch/arm/kernel/sleep.S
-+++ b/arch/arm/kernel/sleep.S
-@@ -98,6 +98,14 @@ THUMB( mov sp, r2 )
- THUMB( bx r3 )
- ENDPROC(cpu_resume)
-
-+ .align
-+ENTRY(cpu_resume_restore_nosave)
-+1: ldmia r0!, {r3-r10}
-+ stmia r1!, {r3-r10}
-+ cmp r1, r2
-+ bne 1b
-+ b cpu_resume
-+
- sleep_save_sp:
- .rept CONFIG_NR_CPUS
- .long 0 @ preserve stack phys ptr here
-diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
-index 5919eb4..c9a2991 100644
---- a/arch/arm/kernel/smp.c
-+++ b/arch/arm/kernel/smp.c
-@@ -125,6 +125,12 @@ void __init smp_init_cpus(void)
- smp_ops.smp_init_cpus();
- }
-
-+void arch_smp_prepare_cpus(unsigned int max_cpus)
-+{
-+ if (smp_ops.smp_prepare_cpus)
-+ smp_ops.smp_prepare_cpus(max_cpus);
-+}
-+
- int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
- {
- if (smp_ops.smp_boot_secondary)
-diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
-index c59c97e..38a5067 100644
---- a/arch/arm/kernel/suspend.c
-+++ b/arch/arm/kernel/suspend.c
-@@ -10,6 +10,42 @@
- extern int __cpu_suspend(unsigned long, int (*)(unsigned long));
- extern void cpu_resume_mmu(void);
-
-+#ifdef CONFIG_MMU
-+/*
-+ * Hide the first two arguments to __cpu_suspend - these are an implementation
-+ * detail which platform code shouldn't have to know about.
-+ */
-+int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
-+{
-+ struct mm_struct *mm = current->active_mm;
-+ int ret;
-+
-+ if (!idmap_pgd)
-+ return -EINVAL;
-+
-+ /*
-+ * Provide a temporary page table with an identity mapping for
-+ * the MMU-enable code, required for resuming. On successful
-+ * resume (indicated by a zero return code), we need to switch
-+ * back to the correct page tables.
-+ */
-+ ret = __cpu_suspend(arg, fn);
-+ if (ret == 0) {
-+ cpu_switch_mm(mm->pgd, mm);
-+ local_flush_bp_all();
-+ local_flush_tlb_all();
-+ }
-+
-+ return ret;
-+}
-+#else
-+int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
-+{
-+ return __cpu_suspend(arg, fn);
-+}
-+#define idmap_pgd NULL
-+#endif
-+
- /*
- * This is called by __cpu_suspend() to save the state, and do whatever
- * flushing is required to ensure that when the CPU goes to sleep we have
-@@ -46,31 +82,3 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
- outer_clean_range(virt_to_phys(save_ptr),
- virt_to_phys(save_ptr) + sizeof(*save_ptr));
- }
--
--/*
-- * Hide the first two arguments to __cpu_suspend - these are an implementation
-- * detail which platform code shouldn't have to know about.
-- */
--int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
--{
-- struct mm_struct *mm = current->active_mm;
-- int ret;
--
-- if (!idmap_pgd)
-- return -EINVAL;
--
-- /*
-- * Provide a temporary page table with an identity mapping for
-- * the MMU-enable code, required for resuming. On successful
-- * resume (indicated by a zero return code), we need to switch
-- * back to the correct page tables.
-- */
-- ret = __cpu_suspend(arg, fn);
-- if (ret == 0) {
-- cpu_switch_mm(mm->pgd, mm);
-- local_flush_bp_all();
-- local_flush_tlb_all();
-- }
--
-- return ret;
--}
-diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
-index 7c15245..73371de 100644
---- a/arch/arm/mach-shmobile/Kconfig
-+++ b/arch/arm/mach-shmobile/Kconfig
-@@ -64,6 +64,25 @@ config MACH_KOELSCH
- select MICREL_PHY if SH_ETH
- select SND_SOC_AK4642 if SND_SIMPLE_CARD
-
-+config MACH_KOELSCH_FTEN
-+ bool "FTEN spf development environment"
-+ depends on MACH_KOELSCH
-+
-+config MACH_FTEN
-+ bool
-+
-+config MACH_FTEN_DT
-+ bool
-+
-+config MACH_FTEN_M2W
-+ bool "FTEN R-Car M2W board"
-+ depends on ARCH_R8A7791
-+ select MACH_FTEN
-+ select MACH_FTEN_DT
-+ select HAVE_IDE
-+ select FIQ
-+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD
-+
- config MACH_LAGER
- bool "Lager board"
- depends on ARCH_R8A7790
-@@ -76,6 +95,15 @@ config MACH_GOSE
- select MICREL_PHY if SH_ETH
- select SND_SOC_AK4642 if SND_SIMPLE_CARD
-
-+config MACH_FTEN_M2N
-+ bool "FTEN R-Car M2N board"
-+ depends on ARCH_R8A7793
-+ select MACH_FTEN
-+ select MACH_FTEN_DT
-+ select HAVE_IDE
-+ select FIQ
-+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD
-+
- config MACH_ALT
- bool "Alt board"
- depends on ARCH_R8A7794
-@@ -287,6 +315,19 @@ config MACH_KOELSCH
- select USE_OF
- select MICREL_PHY if SH_ETH
-
-+config MACH_FTEN
-+ bool "FTEN strawberry board"
-+ depends on ARCH_R8A7791
-+ select USE_OF
-+ select HAVE_IDE
-+
-+config MACH_FTEN_DT
-+ bool "FTEN strawberry board - Device Tree Implementation"
-+ depends on ARCH_R8A7791
-+ select USE_OF
-+ select HAVE_IDE
-+ select SND_SOC_DIRANA3 if SND_SIMPLE_CARD
-+
- config MACH_KZM9G
- bool "KZM-A9-GT board"
- depends on ARCH_SH73A0
-@@ -360,4 +401,28 @@ config EM_TIMER_STI
-
- endmenu
-
-+if HIBERNATION
-+
-+menu "Hibernation area parameters"
-+
-+config SWSUSP_AREA
-+ hex "RAM hibernation area address"
-+ default "0x44000000"
-+ depends on HIBERNATION
-+ ---help---
-+ RAM hibernation area address, this is required for CRC
-+ calculation of final compressed hibernation image
-+
-+config SWSUSP_AREA_SIZE
-+ hex "RAM hibernation area size"
-+ default "0x4000000"
-+ depends on HIBERNATION
-+ ---help---
-+ RAM hibernation area size, this is required for CRC
-+ calculation of final compressed hibernation image
-+
-+endmenu
-+
-+endif
-+
- endif
-diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
-index 43b4025..71cfcfa 100644
---- a/arch/arm/mach-shmobile/Makefile
-+++ b/arch/arm/mach-shmobile/Makefile
-@@ -55,6 +55,7 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o
-
- # PM objects
- obj-$(CONFIG_SUSPEND) += suspend.o
-+obj-$(CONFIG_HIBERNATION) += hibernation.o
- obj-$(CONFIG_CPU_IDLE) += cpuidle.o
- obj-$(CONFIG_CPU_FREQ) += cpufreq.o
- obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
-diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
-index 95a77a0..37c7f87 100644
---- a/arch/arm/mach-shmobile/common.h
-+++ b/arch/arm/mach-shmobile/common.h
-@@ -25,6 +25,7 @@ struct clk;
- extern int shmobile_clk_init(void);
- extern void shmobile_handle_irq_intc(struct pt_regs *);
- extern struct platform_suspend_ops shmobile_suspend_ops;
-+extern const struct platform_hibernation_ops shmobile_hibernation_ops;
- struct cpuidle_driver;
- extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
- extern void shmobile_smp_apmu_enter_cpuidle(void);
-@@ -37,6 +38,12 @@ static inline int shmobile_suspend_init(void) { return 0; }
- static inline void shmobile_smp_apmu_suspend_init(void) { }
- #endif
-
-+#ifdef CONFIG_HIBERNATION
-+int shmobile_hibernation_init(void);
-+#else
-+static inline int shmobile_hibernation_init(void) { return 0; }
-+#endif
-+
- #ifdef CONFIG_CPU_IDLE
- int shmobile_cpuidle_init(void);
- #else
-@@ -59,6 +66,7 @@ extern unsigned int l2actlr_value;
- static inline void __init shmobile_init_late(void)
- {
- shmobile_suspend_init();
-+ shmobile_hibernation_init();
- shmobile_cpuidle_init();
- shmobile_cpufreq_init();
- }
-diff --git a/arch/arm/mach-shmobile/crc32_word4.c b/arch/arm/mach-shmobile/crc32_word4.c
-new file mode 100644
-index 0000000..8aaefc6
---- /dev/null
-+++ b/arch/arm/mach-shmobile/crc32_word4.c
-@@ -0,0 +1,299 @@
-+/*************************************************************************
-+ * crc32_word4.c: rapid CRC32
-+ * Coptright (C) FUJITSUTEN Limited, 2015 All Rights Reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2
-+ * as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ *************************************************************************/
-+#ifdef OWNTEST
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <asm/types.h>
-+typedef unsigned int u_int32_t;
-+#else
-+#endif
-+
-+#include "crc32_word4.h"
-+
-+#define CRC_INIT_VALUE (-1)
-+#define CRC_FIX(_crc32) (~(_crc32))
-+
-+/* #define HWDPLS_ENABLE */
-+#define __HWDTPLS_OUT()
-+#define MEASURE(msg)
-+
-+/**** calc_crc32.c *****/
-+
-+/*
-+ * CRC32は、ISO 3309 で規程され
-+ * そのサンプルは
-+ * RFC 2083 :PNG(Poratble Network Graphics
-+ * で公になっています。本プログラムは、RFC2083 で掲示された
-+ * CRC32を独自に最適化したプログラムです。
-+ */
-+const static u_int32_t CRC_Table[256] = {
-+ 0x00000000 , 0x77073096 , 0xee0e612c , 0x990951ba , 0x076dc419 , 0x706af48f , 0xe963a535 , 0x9e6495a3 ,
-+ 0x0edb8832 , 0x79dcb8a4 , 0xe0d5e91e , 0x97d2d988 , 0x09b64c2b , 0x7eb17cbd , 0xe7b82d07 , 0x90bf1d91 ,
-+ 0x1db71064 , 0x6ab020f2 , 0xf3b97148 , 0x84be41de , 0x1adad47d , 0x6ddde4eb , 0xf4d4b551 , 0x83d385c7 ,
-+ 0x136c9856 , 0x646ba8c0 , 0xfd62f97a , 0x8a65c9ec , 0x14015c4f , 0x63066cd9 , 0xfa0f3d63 , 0x8d080df5 ,
-+ 0x3b6e20c8 , 0x4c69105e , 0xd56041e4 , 0xa2677172 , 0x3c03e4d1 , 0x4b04d447 , 0xd20d85fd , 0xa50ab56b ,
-+ 0x35b5a8fa , 0x42b2986c , 0xdbbbc9d6 , 0xacbcf940 , 0x32d86ce3 , 0x45df5c75 , 0xdcd60dcf , 0xabd13d59 ,
-+ 0x26d930ac , 0x51de003a , 0xc8d75180 , 0xbfd06116 , 0x21b4f4b5 , 0x56b3c423 , 0xcfba9599 , 0xb8bda50f ,
-+ 0x2802b89e , 0x5f058808 , 0xc60cd9b2 , 0xb10be924 , 0x2f6f7c87 , 0x58684c11 , 0xc1611dab , 0xb6662d3d ,
-+ 0x76dc4190 , 0x01db7106 , 0x98d220bc , 0xefd5102a , 0x71b18589 , 0x06b6b51f , 0x9fbfe4a5 , 0xe8b8d433 ,
-+ 0x7807c9a2 , 0x0f00f934 , 0x9609a88e , 0xe10e9818 , 0x7f6a0dbb , 0x086d3d2d , 0x91646c97 , 0xe6635c01 ,
-+ 0x6b6b51f4 , 0x1c6c6162 , 0x856530d8 , 0xf262004e , 0x6c0695ed , 0x1b01a57b , 0x8208f4c1 , 0xf50fc457 ,
-+ 0x65b0d9c6 , 0x12b7e950 , 0x8bbeb8ea , 0xfcb9887c , 0x62dd1ddf , 0x15da2d49 , 0x8cd37cf3 , 0xfbd44c65 ,
-+ 0x4db26158 , 0x3ab551ce , 0xa3bc0074 , 0xd4bb30e2 , 0x4adfa541 , 0x3dd895d7 , 0xa4d1c46d , 0xd3d6f4fb ,
-+ 0x4369e96a , 0x346ed9fc , 0xad678846 , 0xda60b8d0 , 0x44042d73 , 0x33031de5 , 0xaa0a4c5f , 0xdd0d7cc9 ,
-+ 0x5005713c , 0x270241aa , 0xbe0b1010 , 0xc90c2086 , 0x5768b525 , 0x206f85b3 , 0xb966d409 , 0xce61e49f ,
-+ 0x5edef90e , 0x29d9c998 , 0xb0d09822 , 0xc7d7a8b4 , 0x59b33d17 , 0x2eb40d81 , 0xb7bd5c3b , 0xc0ba6cad ,
-+ 0xedb88320 , 0x9abfb3b6 , 0x03b6e20c , 0x74b1d29a , 0xead54739 , 0x9dd277af , 0x04db2615 , 0x73dc1683 ,
-+ 0xe3630b12 , 0x94643b84 , 0x0d6d6a3e , 0x7a6a5aa8 , 0xe40ecf0b , 0x9309ff9d , 0x0a00ae27 , 0x7d079eb1 ,
-+ 0xf00f9344 , 0x8708a3d2 , 0x1e01f268 , 0x6906c2fe , 0xf762575d , 0x806567cb , 0x196c3671 , 0x6e6b06e7 ,
-+ 0xfed41b76 , 0x89d32be0 , 0x10da7a5a , 0x67dd4acc , 0xf9b9df6f , 0x8ebeeff9 , 0x17b7be43 , 0x60b08ed5 ,
-+ 0xd6d6a3e8 , 0xa1d1937e , 0x38d8c2c4 , 0x4fdff252 , 0xd1bb67f1 , 0xa6bc5767 , 0x3fb506dd , 0x48b2364b ,
-+ 0xd80d2bda , 0xaf0a1b4c , 0x36034af6 , 0x41047a60 , 0xdf60efc3 , 0xa867df55 , 0x316e8eef , 0x4669be79 ,
-+ 0xcb61b38c , 0xbc66831a , 0x256fd2a0 , 0x5268e236 , 0xcc0c7795 , 0xbb0b4703 , 0x220216b9 , 0x5505262f ,
-+ 0xc5ba3bbe , 0xb2bd0b28 , 0x2bb45a92 , 0x5cb36a04 , 0xc2d7ffa7 , 0xb5d0cf31 , 0x2cd99e8b , 0x5bdeae1d ,
-+ 0x9b64c2b0 , 0xec63f226 , 0x756aa39c , 0x026d930a , 0x9c0906a9 , 0xeb0e363f , 0x72076785 , 0x05005713 ,
-+ 0x95bf4a82 , 0xe2b87a14 , 0x7bb12bae , 0x0cb61b38 , 0x92d28e9b , 0xe5d5be0d , 0x7cdcefb7 , 0x0bdbdf21 ,
-+ 0x86d3d2d4 , 0xf1d4e242 , 0x68ddb3f8 , 0x1fda836e , 0x81be16cd , 0xf6b9265b , 0x6fb077e1 , 0x18b74777 ,
-+ 0x88085ae6 , 0xff0f6a70 , 0x66063bca , 0x11010b5c , 0x8f659eff , 0xf862ae69 , 0x616bffd3 , 0x166ccf45 ,
-+ 0xa00ae278 , 0xd70dd2ee , 0x4e048354 , 0x3903b3c2 , 0xa7672661 , 0xd06016f7 , 0x4969474d , 0x3e6e77db ,
-+ 0xaed16a4a , 0xd9d65adc , 0x40df0b66 , 0x37d83bf0 , 0xa9bcae53 , 0xdebb9ec5 , 0x47b2cf7f , 0x30b5ffe9 ,
-+ 0xbdbdf21c , 0xcabac28a , 0x53b39330 , 0x24b4a3a6 , 0xbad03605 , 0xcdd70693 , 0x54de5729 , 0x23d967bf ,
-+ 0xb3667a2e , 0xc4614ab8 , 0x5d681b02 , 0x2a6f2b94 , 0xb40bbe37 , 0xc30c8ea1 , 0x5a05df1b , 0x2d02ef8d ,
-+};
-+
-+/***
-+ * CRC Table creater.
-+ *
-+void make_crc_table(void) {
-+ u_int32_t c;
-+ u_int32_t n, k;
-+ for (n = 0; n < 256; n++)
-+ {
-+ c = (u_int32_t) n;
-+ for (k = 0; k < 8; k++)
-+ {
-+ if (c & 1)
-+ c = 0xedb88320L ^ (c >> 1);
-+ else
-+ c = c >> 1;
-+ }
-+ CRC_Table[n] = c;
-+ }
-+}
-+***/
-+#define NEXT_PTR (4)
-+
-+static __inline__
-+u_int32_t _update_crc(u_int32_t crc, unsigned char *buf, size_t len)
-+{
-+ u_int32_t c = crc;
-+ size_t n;
-+ for (n = 0; n < len; n++)
-+ c = CRC_Table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
-+ return c;
-+}
-+/*********************************************************************
-+ * update_crc4x4()()
-+ * calc_crc32() をベースに、4 ワード毎に個別に CRC32 を計算する方法
-+ *
-+ * +0 +1 +2 +3
-+ * +0x00 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
-+ * +0x04 EEEEEEEE FFFFFFFF 00000000 11111111
-+ * : : : :
-+ * CRC32 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
-+ *
-+ *********************************************************************/
-+
-+static __inline__
-+void update_crc4x4(u_int32_t crc[4], unsigned char *buf)
-+{
-+ u_int32_t c1, c2, c3, c4;
-+ u_int32_t *p = (void *)buf;
-+
-+ c1 = crc[0] ^ p[0];
-+ c2 = crc[1] ^ p[1];
-+ c3 = crc[2] ^ p[2];
-+ c4 = crc[3] ^ p[3];
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ c1 = CRC_Table[c1 & 0xff] ^ (c1 >> 8);
-+ c2 = CRC_Table[c2 & 0xff] ^ (c2 >> 8);
-+ c3 = CRC_Table[c3 & 0xff] ^ (c3 >> 8);
-+ c4 = CRC_Table[c4 & 0xff] ^ (c4 >> 8);
-+
-+ crc[0] = c1;
-+ crc[1] = c2;
-+ crc[2] = c3;
-+ crc[3] = c4;
-+}
-+
-+
-+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result)
-+{
-+ unsigned int crc_tmp[4] = {CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE, CRC_INIT_VALUE};
-+ u_int32_t i;
-+ int res;
-+ u_int32_t n4;
-+ int xlen = len;
-+#ifdef HWDPLS_ENABLE
-+ unsigned long plstout = 60;
-+ unsigned long plsstart = 0;
-+ if ((unsigned long)CONFIG_SYS_HZ > 100000)
-+ plstout *= (unsigned long)CONFIG_SYS_HZ / 1000;
-+ else
-+ plstout = DIV_ROUND_UP(plstout * (unsigned long)CONFIG_SYS_HZ, 1000);
-+#endif
-+
-+ /**
-+ * 4バイト境界に合わない開始アドレスの場合
-+ * 境界までのCRCを crc_tmp[0] に求める。
-+ */
-+ if ((unsigned long)buf & 3) {
-+ crc_tmp[0] = _update_crc(crc_tmp[0], buf, (unsigned long)buf & 3);
-+ buf = (unsigned char *)((unsigned long)buf & ~3);
-+ xlen -= (unsigned long)buf & 3;
-+ }
-+
-+ n4 = xlen/(NEXT_PTR*4);
-+ /**
-+ * 4バイト境界に合わない開始アドレスの場合
-+ * 境界までのCRCを crc_tmp[0] に求める。
-+ */
-+#ifdef HWDPLS_ENABLE
-+ reset_timer();
-+ plsstart = get_timer(0);
-+#endif
-+ for (i = 0; i < n4; i++) {
-+ update_crc4x4(crc_tmp, buf);
-+ buf += NEXT_PTR * 4;
-+#ifdef HWDPLS_ENABLE
-+ /**
-+ * WDを考慮
-+ */
-+ if (__builtin_expect((int)((i & 0x1f) == 0), 0)) {
-+ if ((get_timer(plsstart)) > plstout) {
-+ __HWDTPLS_OUT();
-+ MEASURE("crc plsout")
-+ plsstart += plstout;
-+ }
-+ }
-+#endif /*HWPLS_ENABLE*/
-+ }
-+
-+ res = xlen % (NEXT_PTR * 4);
-+ if (res > 0)
-+ crc_tmp[3] = _update_crc(crc_tmp[3], buf, res);
-+
-+ result->crc_w[0] = CRC_FIX(crc_tmp[0]);
-+ result->crc_w[1] = CRC_FIX(crc_tmp[1]);
-+ result->crc_w[2] = CRC_FIX(crc_tmp[2]);
-+ result->crc_w[3] = CRC_FIX(crc_tmp[3]);
-+
-+ MEASURE("calc_crc32x4 finish")
-+}
-+
-+#if defined(OWNTEST)
-+#define BUFSIZE (2 * 1024 * 1024)
-+#include <sys/time.h>
-+#include <malloc.h>
-+
-+int main()
-+{
-+ unsigned char *buf, *buf2;
-+ struct timeval start, end;
-+ unsigned long long diff;
-+ int i;
-+
-+ CRC32_WORD4_t result = { .crc_w = {0, 0, 0, 0 } };
-+ CRC32_WORD4_t result2 = { .crc_w = {0, 0, 0, 0 } };
-+
-+ buf = malloc(BUFSIZE);
-+ if (!buf) {
-+ perror("malloc");
-+ return 1;
-+ }
-+ printf("Generate %dMB random data..\n", BUFSIZE / 1024 / 1024);
-+ srand(0);
-+ for (i = 0; i < BUFSIZE / 4; i++)
-+ ((int *)buf)[i] = rand();
-+
-+ /* Memory dup */
-+ buf2 = memalign(NEXT_PTR, BUFSIZE);
-+ if (!buf2) {
-+ perror("malloc");
-+ return 1;
-+ }
-+ memcpy(buf2, buf, BUFSIZE);
-+
-+
-+ gettimeofday(&start, NULL);
-+ calc_crc32x4(buf, BUFSIZE, &result);
-+ gettimeofday(&end, NULL);
-+
-+ diff = (end.tv_sec - start.tv_sec) * 1000000;
-+ diff += end.tv_usec - start.tv_usec;
-+
-+ printf("time=%lluus\n", diff);
-+ printf(" result.word[0] = %x\n", result.crc_w[0]);
-+ printf(" result.word[1] = %x\n", result.crc_w[1]);
-+ printf(" result.word[2] = %x\n", result.crc_w[2]);
-+ printf(" result.word[3] = %x\n", result.crc_w[3]);
-+
-+ /* Broken test */
-+#if 0 /* Destory test */
-+ buf[rand() % BUFSIZE] ^= 1 << (rand()%7);
-+#endif
-+ for (i = 0; i < BUFSIZE; i++) {
-+ if (buf[i] != buf2[i])
-+ printf("buf[%d] %02x : %02x\n", i, buf[i], buf2[i]);
-+ }
-+
-+ gettimeofday(&start, NULL);
-+ calc_crc32x4(buf, BUFSIZE, &result2);
-+ gettimeofday(&end, NULL);
-+
-+ diff = (end.tv_sec - start.tv_sec) * 1000000;
-+ diff += end.tv_usec - start.tv_usec;
-+
-+ printf("time=%lluus\n", diff);
-+ printf(" result.word[0] = %x:%s\n", result2.crc_w[0] ,
-+ result.crc_w[0] == result2.crc_w[0] ? "OK" : "NG");
-+ printf(" result.word[1] = %x:%s\n", result2.crc_w[1] ,
-+ result.crc_w[1] == result2.crc_w[1] ? "OK" : "NG");
-+ printf(" result.word[2] = %x:%s\n", result2.crc_w[2] ,
-+ result.crc_w[2] == result2.crc_w[2] ? "OK" : "NG");
-+ printf(" result.word[3] = %x:%s\n", result2.crc_w[3] ,
-+ result.crc_w[3] == result2.crc_w[3] ? "OK" : "NG");
-+ return 0;
-+}
-+#endif /* TEST */
-diff --git a/arch/arm/mach-shmobile/crc32_word4.h b/arch/arm/mach-shmobile/crc32_word4.h
-new file mode 100644
-index 0000000..6c04878
---- /dev/null
-+++ b/arch/arm/mach-shmobile/crc32_word4.h
-@@ -0,0 +1,23 @@
-+/*************************************************************************
-+ * Coptright (C) FUJITSUTEN Limited, 2012 All Rights Reserved.
-+ *
-+ *************************************************************************/
-+#ifndef __CRC32_WORD4_H__
-+#define __CRC32_WORD4_H__
-+
-+typedef struct {
-+ unsigned int crc_w[4];
-+} CRC32_WORD4_t;
-+
-+void calc_crc32x4(unsigned char *buf, size_t len, CRC32_WORD4_t *result);
-+
-+typedef struct {
-+ unsigned int size;
-+ CRC32_WORD4_t chksum;
-+ unsigned int dummy[3];
-+} CRC32_WORD4_TICKET_t;
-+
-+#define IS_CRC_WORD4_OK(_res1, _res2) (!memcmp(_res1, _res2, sizeof(CRC32_WORD4_t)))
-+#define IS_CRC_WORD4_ZERO(_w4) (((_w4)->crc_w[0] == 0) && ((_w4)->crc_w[1] == 0) && ((_w4)->crc_w[2] == 0) && ((_w4)->crc_w[3] == 0))
-+#define IS_CRC_WORD4_ALL_F(_w4) (((_w4)->crc_w[0] == 0xffffffff) && ((_w4)->crc_w[1] == 0xffffffff) && ((_w4)->crc_w[2] == 0xffffffff) && ((_w4)->crc_w[3] == 0xffffffff))
-+#endif
-diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
-index debf271..f99f8b2 100644
---- a/arch/arm/mach-shmobile/headsmp.S
-+++ b/arch/arm/mach-shmobile/headsmp.S
-@@ -16,8 +16,6 @@
- #include <linux/threads.h>
- #include <asm/memory.h>
-
-- __CPUINIT
--
- #ifdef CONFIG_SMP
- ENTRY(shmobile_invalidate_start)
- bl v7_invalidate_l1
-diff --git a/arch/arm/mach-shmobile/hibernation.c b/arch/arm/mach-shmobile/hibernation.c
-new file mode 100644
-index 0000000..94fa78b
---- /dev/null
-+++ b/arch/arm/mach-shmobile/hibernation.c
-@@ -0,0 +1,243 @@
-+/*
-+ * Suspend-to-RAM support code for SH-Mobile ARM
-+ *
-+ * Copyright (C) 2011 Magnus Damm
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ */
-+#include <linux/pm.h>
-+#include <linux/suspend.h>
-+#include <linux/module.h>
-+#include <linux/err.h>
-+#include <linux/cpu.h>
-+#include <linux/smp.h>
-+
-+#include <linux/io.h>
-+#include <asm/system_misc.h>
-+#include <asm/page.h>
-+#include <asm/smp_plat.h>
-+
-+#include "common.h"
-+#include "rcar-gen2.h"
-+
-+#include <linux/clk.h>
-+
-+#include "crc32_word4.c"
-+#include "pm-rcar.h"
-+
-+
-+struct swsusp_header {
-+ char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) -
-+ sizeof(u32) - sizeof(CRC32_WORD4_t) - sizeof(u32)];
-+ CRC32_WORD4_t comp_crc32;
-+ u32 img_size; /* add. see. kernel/power/swap.c */
-+ u32 crc32;
-+ sector_t image;
-+ unsigned int flags; /* Flags to pass to the "boot" kernel */
-+ char orig_sig[10];
-+ char sig[10];
-+} __packed;
-+static unsigned long swsusp_area = CONFIG_SWSUSP_AREA;
-+static unsigned long swsusp_area_size = CONFIG_SWSUSP_AREA_SIZE;
-+
-+enum {
-+ MSTP00, MSTP01, MSTP02, MSTP03, MSTP04, MSTP05,
-+ MSTP07, MSTP08, MSTP09, MSTP10, MSTP11,
-+ MSTP_NR,
-+};
-+
-+static struct {
-+ u32 s_offset;
-+ u32 s_val;
-+ u32 r_offset;
-+ u32 r_val;
-+} mstp_regs[] = {
-+ [MSTP00] = { SMSTPCR0, 0,
-+ RMSTPCR0, 0},
-+ [MSTP01] = { SMSTPCR1, 0,
-+ RMSTPCR1, 0},
-+ [MSTP02] = { SMSTPCR2, 0,
-+ RMSTPCR2, 0},
-+ [MSTP03] = { SMSTPCR3, 0,
-+ RMSTPCR3, 0},
-+ [MSTP04] = { SMSTPCR4, 0,
-+ RMSTPCR4, 0},
-+ [MSTP05] = { SMSTPCR5, 0,
-+ RMSTPCR5, 0},
-+ [MSTP07] = { SMSTPCR7, 0,
-+ RMSTPCR7, 0},
-+ [MSTP08] = { SMSTPCR8, 0,
-+ RMSTPCR8, 0},
-+ [MSTP09] = { SMSTPCR9, 0,
-+ RMSTPCR9, 0},
-+ [MSTP10] = { SMSTPCR10, 0,
-+ RMSTPCR10, 0},
-+ [MSTP11] = { SMSTPCR11, 0,
-+ RMSTPCR11, 0},
-+};
-+
-+static void save_mstp_regs(void)
-+{
-+ int i;
-+ void *m = ioremap(CPG_BASE, CPG_LEN);
-+ for (i = MSTP00; i < MSTP_NR; i++) {
-+ mstp_regs[i].s_val = ioread32(m +mstp_regs[i].s_offset);
-+ mstp_regs[i].r_val = ioread32(m +mstp_regs[i].r_offset);
-+ }
-+ iounmap(m);
-+}
-+
-+static void restore_mstp_regs(void)
-+{
-+ int i;
-+ void *m = ioremap(CPG_BASE, CPG_LEN);
-+ for (i = MSTP00; i < MSTP_NR; i++) {
-+ iowrite32(mstp_regs[i].s_val, m +mstp_regs[i].s_offset);
-+ iowrite32(mstp_regs[i].r_val, m +mstp_regs[i].r_offset);
-+ }
-+ iounmap(m);
-+}
-+
-+static int shmobile_hibernation_begin(void)
-+{
-+ save_mstp_regs();
-+ return 0;
-+}
-+
-+static void shmobile_hibernation_end(void)
-+{
-+}
-+
-+static int shmobile_hibernation_pre_snapshot(void)
-+{
-+ return 0;
-+}
-+
-+
-+static void shmobile_hibernation_finish(void)
-+{
-+}
-+
-+static int shmobile_hibernation_prepare(void)
-+{
-+ return 0;
-+}
-+
-+static int shmobile_hibernation_enter(void)
-+{
-+ void *m, *l;
-+ struct swsusp_header *h;
-+ unsigned int calc_sz;
-+ if (swsusp_area_size > 0) {
-+ h = m = ioremap(swsusp_area, swsusp_area_size);
-+ if (h) {
-+ if ((h->img_size > PAGE_SIZE)
-+ && (h->img_size < (swsusp_area_size - PAGE_SIZE)))
-+ calc_sz = h->img_size;
-+ else
-+ calc_sz = swsusp_area_size - PAGE_SIZE;
-+ memset(&h->comp_crc32, 0, sizeof(h->comp_crc32));
-+ calc_crc32x4(m + PAGE_SIZE, calc_sz, &h->comp_crc32);
-+ mb();
-+ iounmap(m);
-+ }
-+ }
-+ /* Resetting FDP0 */
-+ l = ioremap(0xfe940000, 0x4000);
-+ writel(1, l + 0x1c);
-+ mb();
-+ iounmap(l);
-+ /* Resetting FDP1 */
-+ l = ioremap(0xfe944000, 0x4000);
-+ writel(1, l + 0x1c);
-+ mb();
-+ iounmap(l);
-+ /* Doing board reset */
-+ l = ioremap(0xe6300200, 4);
-+ writel(0xa1b20001, l);
-+ mb();
-+ iounmap(l);
-+
-+ return 0;
-+}
-+
-+char *clks[] = {
-+ "ehci", "hsusb", "dmal", "dmah", "sys-dmac1",
-+ "sys-dmac0", "ssp", "ssp_dev", "ipmmu_gp",
-+ "audmac0", "audmac1",
-+};
-+
-+static int shmobile_hibernation_pre_restore(void)
-+{
-+ return 0;
-+}
-+
-+
-+static void shmobile_hibernation_restore_cleanup(void)
-+{
-+}
-+
-+extern int in_suspend;
-+
-+static void shmobile_hibernation_leave(void)
-+{
-+ int restore_highmem(void);
-+ struct clk *clk;
-+ unsigned int i;
-+
-+ if (!in_suspend) {
-+#ifdef CONFIG_SMP
-+ if (is_smp())
-+ arch_smp_prepare_cpus(setup_max_cpus);
-+#endif
-+
-+#ifdef CONFIG_HIGHMEM
-+ restore_highmem();
-+#endif
-+ restore_mstp_regs();
-+ }
-+
-+ for (i = 0; i < ARRAY_SIZE(clks); ++i) {
-+ clk = clk_get(NULL, clks[i]);
-+ if (!IS_ERR(clk)) {
-+ clk_prepare_enable(clk);
-+ clk_put(clk);
-+ }
-+ }
-+}
-+
-+const struct platform_hibernation_ops shmobile_hibernation_ops = {
-+ .leave = shmobile_hibernation_leave,
-+ .begin = shmobile_hibernation_begin,
-+ .end = shmobile_hibernation_end,
-+ .pre_snapshot = shmobile_hibernation_pre_snapshot,
-+ .finish = shmobile_hibernation_finish,
-+ .prepare = shmobile_hibernation_prepare,
-+ .enter = shmobile_hibernation_enter,
-+ .pre_restore = shmobile_hibernation_pre_restore,
-+ .restore_cleanup = shmobile_hibernation_restore_cleanup,
-+};
-+
-+int __init shmobile_hibernation_init(void)
-+{
-+ hibernation_set_ops(&shmobile_hibernation_ops);
-+ return 0;
-+}
-+static int setup_swsusp_area(char *s)
-+{
-+ long tmp = 0;
-+ char *p;
-+ if (!kstrtol(s, 0, &tmp) && tmp > 0)
-+ swsusp_area = tmp;
-+ p = strchr(s, ',');
-+ if (!p)
-+ goto out;
-+ if (!kstrtol(p, 0, &tmp) && tmp > 0)
-+ swsusp_area_size = tmp;
-+out:
-+ return 1;
-+}
-+__setup("swsusp_area=", setup_swsusp_area);
-+
-diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
-index cff7a25..e382e26 100644
---- a/arch/arm/mach-shmobile/platsmp-apmu.c
-+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
-@@ -33,7 +33,10 @@
-
- /* only enable the cluster that includes the boot CPU by default */
- static bool enable_multicluster = false;
-+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \
-+defined(CONFIG_CPU_IDLE)
- static bool is_last_cpu;
-+#endif
-
- static __init int apmu_setup(char *opt)
- {
-@@ -71,12 +74,15 @@ static int __maybe_unused apmu_power_on(void __iomem *p, int bit)
- return 0;
- }
-
-+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \
-+defined(CONFIG_CPU_IDLE)
- static int apmu_power_off(void __iomem *p, int bit)
- {
- /* request Core Standby for next WFI */
- writel_relaxed(3, p + CPUNCR_OFFS(bit));
- return 0;
- }
-+#endif
-
- static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
- {
-@@ -92,12 +98,15 @@ static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
- return 0;
- }
-
-+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) || \
-+defined(CONFIG_CPU_IDLE) || defined(CONFIG_SMP)
- static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu))
- {
- void __iomem *p = apmu_cpus[cpu].iomem;
-
- return p ? fn(p, apmu_cpus[cpu].bit) : -EINVAL;
- }
-+#endif
-
- static void apmu_init_cpu(struct resource *res, int cpu, int bit)
- {
-@@ -141,7 +150,7 @@ static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit),
- }
- }
-
--void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
-+void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
- struct rcar_apmu_config *apmu_config,
- int num)
- {
-@@ -328,7 +337,7 @@ static int __cpuinit shmobile_smp_apmu_enter_suspend(suspend_state_t state)
- return 0;
- }
-
--void __init shmobile_smp_apmu_suspend_init(void)
-+void shmobile_smp_apmu_suspend_init(void)
- {
- cpucmcr_ca7 = ioremap_nocache(CPUCMCR_CA7, 0x4);
- cpucmcr_ca15 = ioremap_nocache(CPUCMCR_CA15, 0x4);
-diff --git a/arch/arm/mach-shmobile/platsmp-rst.c b/arch/arm/mach-shmobile/platsmp-rst.c
-index 70a2b6c..7ba9eeb 100644
---- a/arch/arm/mach-shmobile/platsmp-rst.c
-+++ b/arch/arm/mach-shmobile/platsmp-rst.c
-@@ -11,8 +11,7 @@
- #include <linux/io.h>
- #include <asm/smp_plat.h>
- #include <mach/platsmp-rst.h>
--
--#define RST 0xe6160000
-+#include "rcar-gen2.h"
-
- #define r8a779x_clst_id(cpu) (cpu_logical_map((cpu)) >> 8)
- #define r8a779x_cpu_id(cpu) (cpu_logical_map((cpu)) & 0xff)
-diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c
-index f0ed98c..a13da84 100644
---- a/arch/arm/mach-shmobile/pm-r8a7791.c
-+++ b/arch/arm/mach-shmobile/pm-r8a7791.c
-@@ -21,16 +21,9 @@
- #include <asm/io.h>
- #include "common.h"
- #include "pm-rcar.h"
-+#include "rcar-gen2.h"
- #include "r8a7791.h"
-
--#define RST 0xe6160000
--#define CA15BAR 0x0020
--#define RAM 0xe63c0000
--
--/* SYSC */
--#define SYSCIER 0x0c
--#define SYSCIMR 0x10
--
- struct r8a7791_pm_domain {
- struct generic_pm_domain genpd;
- struct rcar_sysc_ch ch;
-@@ -43,13 +36,14 @@ static inline struct rcar_sysc_ch *to_r8a7791_ch(struct generic_pm_domain *d)
-
- #if defined(CONFIG_PM) || defined(CONFIG_SMP)
-
--static void __init r8a7791_sysc_init(void)
-+static void r8a7791_sysc_init(void)
- {
-- void __iomem *base = rcar_sysc_init(0xe6180000);
-+ void __iomem *base = rcar_sysc_init(SYSC_BASE);
-
- /* enable all interrupt sources, but do not use interrupt handler */
- iowrite32(0x0131000e, base + SYSCIER);
-- iowrite32(0, base + SYSCIMR);
-+ /* keep reserved bits as they are in TRM */
-+ iowrite32(0x012001ec, base + SYSCIMR);
- }
-
- #else /* CONFIG_PM || CONFIG_SMP */
-@@ -60,9 +54,6 @@ static inline void r8a7791_sysc_init(void) {}
-
- #ifdef CONFIG_PM
-
--#define CPG_BASE 0xe6150000
--#define CPG_LEN 0x1000
--
- /* Software Reset */
- #define SRCR0 0x00a0
- #define SRCR1 0x00a8
-@@ -243,14 +234,10 @@ static struct notifier_block platform_nb = {
-
- #endif /* CONFIG_PM */
-
--void __init r8a7791_pm_init(void)
-+void r8a7791_pm_init(void)
- {
- void __iomem *p;
- u32 bar;
-- static int once;
--
-- if (once++)
-- return;
-
- /* RAM for jump stub, because BAR requires 256KB aligned address */
- p = ioremap_nocache(RAM, shmobile_boot_size);
-@@ -258,7 +245,7 @@ void __init r8a7791_pm_init(void)
- iounmap(p);
-
- /* setup reset vectors */
-- p = ioremap_nocache(RST, 0x63);
-+ p = ioremap_nocache(RST, RST_LEN);
- bar = (RAM >> 8) & 0xfffffc00;
- writel_relaxed(bar, p + CA15BAR);
- writel_relaxed(bar | 0x10, p + CA15BAR);
-diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h
-index ce53cb5..df7201a 100644
---- a/arch/arm/mach-shmobile/rcar-gen2.h
-+++ b/arch/arm/mach-shmobile/rcar-gen2.h
-@@ -1,6 +1,45 @@
- #ifndef __ASM_RCAR_GEN2_H__
- #define __ASM_RCAR_GEN2_H__
-
-+#define CPG_BASE 0xe6150000
-+#define CPG_LEN 0x1000
-+#define RMSTPCR0 0x110
-+#define RMSTPCR1 0x114
-+#define RMSTPCR2 0x118
-+#define RMSTPCR3 0x11c
-+#define RMSTPCR4 0x120
-+#define RMSTPCR5 0x124
-+#define RMSTPCR7 0x12c
-+#define RMSTPCR8 0x980
-+#define RMSTPCR9 0x984
-+#define RMSTPCR10 0x988
-+#define RMSTPCR11 0x98c
-+#define SMSTPCR0 0x130
-+#define SMSTPCR1 0x134
-+#define SMSTPCR2 0x138
-+#define SMSTPCR3 0x13c
-+#define SMSTPCR4 0x140
-+#define SMSTPCR5 0x144
-+#define SMSTPCR7 0x14c
-+#define SMSTPCR8 0x990
-+#define SMSTPCR9 0x994
-+#define SMSTPCR10 0x998
-+#define SMSTPCR11 0x99c
-+
-+#define SYSC_BASE 0xe6180000
-+#define SYSCIER 0x0c
-+#define SYSCIMR 0x10
-+
-+#define RST 0xe6160000
-+#define RST_LEN 0x64
-+
-+#define CA15BAR 0x0020
-+#define CA7BAR 0x0030
-+#define RAM 0xe63c0000
-+
-+#define CNTCR 0
-+#define CNTFID0 0x20
-+
- void rcar_gen2_timer_init(void);
- #define MD(nr) BIT(nr)
- u32 rcar_gen2_read_mode_pins(void);
-diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
-index 2aa431a..c48c6a9 100644
---- a/arch/arm/mach-shmobile/setup-r8a7791.c
-+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
-@@ -29,6 +29,7 @@
- #include <linux/sh_timer.h>
- #include <linux/spi/sh_msiof.h>
- #include <asm/mach/arch.h>
-+#include <asm/smp_plat.h>
-
- #include "common.h"
- #include "dma-register.h"
-@@ -243,8 +244,6 @@ static const struct resource powervr_resources[] __initconst = {
- powervr_resources, \
- ARRAY_SIZE(powervr_resources))
-
--#define CPG_BASE 0xe6150000
--#define CPG_LEN 0x1000
- #define RGXCR 0x0B4
-
- void __init r8a7791_register_pvrsrvkm(void)
-@@ -271,7 +270,12 @@ void __init r8a7791_register_ssp(void)
-
- void __init r8a7791_add_dt_devices(void)
- {
-- r8a7791_pm_init();
-+#ifdef CONFIG_SMP
-+ /* In case of SMP config pm_init already called from smp_prepare_cpus.
-+ * It is still needed to call pm_init if 'nosmp' was given */
-+ if (!setup_max_cpus)
-+#endif
-+ r8a7791_pm_init();
- r8a7791_init_pm_domains();
- r8a7791_register_cmt(00);
- r8a7791_register_pvrsrvkm();
-diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
-index da16ebd..641ee1d 100644
---- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
-+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
-@@ -47,9 +47,6 @@ u32 rcar_gen2_read_mode_pins(void)
- return mode;
- }
-
--#define CNTCR 0
--#define CNTFID0 0x20
--
- void __init rcar_gen2_timer_init(void)
- {
- #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)
-@@ -58,7 +55,7 @@ void __init rcar_gen2_timer_init(void)
- #ifdef CONFIG_ARM_ARCH_TIMER
- void __iomem *base;
- int extal_mhz = 0;
-- u32 freq;
-+ u32 rcar_gen2_archtimer_freq;
-
- /* At Linux boot time the r8a7790 arch timer comes up
- * with the counter disabled. Moreover, it may also report
-@@ -83,7 +80,7 @@ void __init rcar_gen2_timer_init(void)
- }
-
- /* The arch timer frequency equals EXTAL / 2 */
-- freq = extal_mhz * (1000000 / 2);
-+ rcar_gen2_archtimer_freq = extal_mhz * (1000000 / 2);
-
- /* Remap "armgcnt address map" space */
- base = ioremap(0xe6080000, PAGE_SIZE);
-@@ -96,10 +93,11 @@ void __init rcar_gen2_timer_init(void)
- */
-
- if ((ioread32(base + CNTCR) & 1) == 0 ||
-- ioread32(base + CNTFID0) != freq) {
-+ ioread32(base + CNTFID0) != rcar_gen2_archtimer_freq) {
- /* Update registers with correct frequency */
-- iowrite32(freq, base + CNTFID0);
-- asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
-+ iowrite32(rcar_gen2_archtimer_freq, base + CNTFID0);
-+ asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r"
-+ (rcar_gen2_archtimer_freq));
-
- /* make sure arch timer is started by setting bit 0 of CNTCR */
- iowrite32(1, base + CNTCR);
-diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
-index 24cad9f..4583cb6 100644
---- a/arch/arm/mach-shmobile/smp-r8a7791.c
-+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
-@@ -33,6 +33,11 @@
-
- #define CA15RESCNT 0x0040
-
-+static struct rcar_sysc_ch r8a7791_ca15_scu = {
-+ .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
-+ .isr_bit = 12, /* CA15-SCU */
-+};
-+
- static struct rcar_apmu_config r8a7791_apmu_config[] = {
- {
- .iomem = DEFINE_RES_MEM(0xe6152000, 0x88),
-@@ -47,7 +52,7 @@ static struct rcar_rst_config r8a7791_rst_config[] = {
- }
- };
-
--static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
-+static void r8a7791_smp_prepare_cpus(unsigned int max_cpus)
- {
- void __iomem *p;
- u32 val;
-@@ -67,6 +72,7 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
- }
-
- r8a7791_pm_init();
-+ rcar_sysc_power_up(&r8a7791_ca15_scu);
-
- /* keep secondary CPU cores in reset */
- r8a779x_init_reset(r8a7791_rst_config);
-diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
-index 19da841..35c9048 100644
---- a/arch/arm/mm/proc-v7.S
-+++ b/arch/arm/mm/proc-v7.S
-@@ -92,48 +92,59 @@ ENDPROC(cpu_v7_dcache_clean_area)
-
- /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
- .globl cpu_v7_suspend_size
--.equ cpu_v7_suspend_size, 4 * 8
-+.equ cpu_v7_suspend_size, 4 * 9
- #ifdef CONFIG_ARM_CPU_SUSPEND
- ENTRY(cpu_v7_do_suspend)
- stmfd sp!, {r4 - r10, lr}
- mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
- mrc p15, 0, r5, c13, c0, 3 @ User r/o thread ID
- stmia r0!, {r4 - r5}
-+#ifdef CONFIG_MMU
- mrc p15, 0, r6, c3, c0, 0 @ Domain ID
-+#ifdef CONFIG_ARM_LPAE
-+ mrrc p15, 1, r5, r7, c2 @ TTB 1
-+#else
- mrc p15, 0, r7, c2, c0, 1 @ TTB 1
-+#endif
- mrc p15, 0, r11, c2, c0, 2 @ TTB control register
-+#endif
- mrc p15, 0, r8, c1, c0, 0 @ Control register
- mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register
- mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control
-- stmia r0, {r6 - r11}
-+ stmia r0, {r5 - r11}
- ldmfd sp!, {r4 - r10, pc}
- ENDPROC(cpu_v7_do_suspend)
-
- ENTRY(cpu_v7_do_resume)
- mov ip, #0
-- mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs
- mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
- mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID
- ldmia r0!, {r4 - r5}
- mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
- mcr p15, 0, r5, c13, c0, 3 @ User r/o thread ID
-- ldmia r0, {r6 - r11}
-+ ldmia r0, {r5 - r11}
-+#ifdef CONFIG_MMU
-+ mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs
- mcr p15, 0, r6, c3, c0, 0 @ Domain ID
--#ifndef CONFIG_ARM_LPAE
-+#ifdef CONFIG_ARM_LPAE
-+ mcrr p15, 0, r1, ip, c2 @ TTB 0
-+ mcrr p15, 1, r5, r7, c2 @ TTB 1
-+#else
- ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP)
- ALT_UP(orr r1, r1, #TTB_FLAGS_UP)
--#endif
- mcr p15, 0, r1, c2, c0, 0 @ TTB 0
- mcr p15, 0, r7, c2, c0, 1 @ TTB 1
-+#endif
- mcr p15, 0, r11, c2, c0, 2 @ TTB control register
-- mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register
-- teq r4, r9 @ Is it already set?
-- mcrne p15, 0, r9, c1, c0, 1 @ No, so write it
-- mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control
- ldr r4, =PRRR @ PRRR
- ldr r5, =NMRR @ NMRR
- mcr p15, 0, r4, c10, c2, 0 @ write PRRR
- mcr p15, 0, r5, c10, c2, 1 @ write NMRR
-+#endif /* CONFIG_MMU */
-+ mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register
-+ teq r4, r9 @ Is it already set?
-+ mcrne p15, 0, r9, c1, c0, 1 @ No, so write it
-+ mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control
- isb
- dsb
- mov r0, r8 @ control register
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch
deleted file mode 100644
index 2ef1129ce..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0002-Fix-Black-blink-correction-of-display.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 175a91f2068c5cb4a9be5aa1ea5f1e24e2919bbb Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:13:59 +0900
-Subject: [PATCH 2/3] Fix Black blink correction of display
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 1 +
- drivers/gpu/drm/rcar-du/rcar_du_crtc.h | 1 +
- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 13 ++++---------
- drivers/gpu/drm/rcar-du/rcar_du_group.c | 4 ++--
- 4 files changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
-index 262d8a8d..ab3bb09 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
-@@ -1027,4 +1027,5 @@ void rcar_du_crtc_enable_vblank(struct rcar_du_crtc *rcrtc, bool enable)
- } else {
- rcar_du_crtc_clr(rcrtc, DIER, DIER_VBE);
- }
-+ rcrtc->vblank_enable = enable;
- }
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
-index 6cdd02e6..19c0d69 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
-@@ -49,6 +49,7 @@ struct rcar_du_crtc {
- int lif_enable;
- void *vpsd_handle;
- #endif
-+ bool vblank_enable;
- };
-
- #define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc)
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-index fbb212c..f83501d 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-@@ -517,7 +517,7 @@ static int rcar_du_pm_resume(struct device *dev)
-
- return 0;
- }
--#ifdef CONFIG_MACH_FTEN
-+
- static int rcar_du_pm_freeze(struct device *dev)
- {
- int ret;
-@@ -546,18 +546,13 @@ static int rcar_du_pm_restore(struct device *dev)
- return ret;
- }
- #endif
--#endif
-+
- static const struct dev_pm_ops rcar_du_pm_ops = {
--#if defined(CONFIG_MACH_FTEN) && defined(CONFIG_HIBERNATION) && \
-- defined(CONFIG_PM_SLEEP)
-- .suspend = rcar_du_pm_suspend,
-- .resume = rcar_du_pm_resume,
-+ SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume)
-+#ifdef CONFIG_HIBERNATION
- .freeze = rcar_du_pm_freeze,
- .thaw = rcar_du_pm_thaw,
-- .poweroff = rcar_du_pm_suspend,
- .restore = rcar_du_pm_restore,
--#else
-- SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume)
- #endif
- };
-
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c
-index 3620040..0e571d4 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_group.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c
-@@ -151,8 +151,8 @@ void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start)
- * when the display controller will have to be restarted.
- */
- if (start) {
-- if (rgrp->used_crtcs++ != 0)
-- __rcar_du_group_start_stop(rgrp, false);
-+ rgrp->used_crtcs++;
-+ __rcar_du_group_start_stop(rgrp, false);
- __rcar_du_group_start_stop(rgrp, true);
- } else {
- if (--rgrp->used_crtcs == 0)
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch
deleted file mode 100644
index 5901cc2b1..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-hibernation-image-area.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4d35f60f9bd47aebc104d34b9099e8e4f69fa53a Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Fri, 9 Jun 2017 20:15:32 +0900
-Subject: [PATCH 3/3] Add hibernation image area
-
-0x40000000 <-> 0x77FFFFFF : kernel
-0x78000000 <-> 0x7FFFFFFF : hibernation image area
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- arch/arm/boot/dts/r8a7791-porter.dts | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
-index b1acf4a..a0e273e 100644
---- a/arch/arm/boot/dts/r8a7791-porter.dts
-+++ b/arch/arm/boot/dts/r8a7791-porter.dts
-@@ -42,7 +42,10 @@
-
- memory@40000000 {
- device_type = "memory";
-- reg = <0 0x40000000 0 0x40000000>;
-+/* reg = <0 0x40000000 0 0x40000000>; */
-+/* 0x40000000 <-> 0x77FFFFFF : kernel */
-+/* 0x78000000 <-> 0x7FFFFFFF : snap */
-+ reg = <0 0x40000000 0 0x38000000>;
- };
-
- memory@200000000 {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch
deleted file mode 100755
index fd0dfb66f..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0003-Add-sata-hibernation-code.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 5d87144a96085d74b6002bd6d8c093c37bf128b7 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:04:33 +0900
-Subject: [PATCH 03/15] Add sata hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/ata/sata_rcar.c | 29 +++++++++++++++++++++++++++++
- 1 file changed, 29 insertions(+)
-
-diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
-index 92abfdd..4c82b5e 100644
---- a/drivers/ata/sata_rcar.c
-+++ b/drivers/ata/sata_rcar.c
-@@ -1003,9 +1003,38 @@ static int sata_rcar_resume(struct device *dev)
- return 0;
- }
-
-+static int sata_rcar_restore(struct device *dev)
-+{
-+ struct ata_host *host = dev_get_drvdata(dev);
-+ struct sata_rcar_priv *priv = host->private_data;
-+ int ret;
-+
-+ clk_prepare_enable(priv->clk);
-+
-+ ret = sata_rcar_setup_port(host);
-+ if (ret)
-+ goto cleanup;
-+
-+ /* initialize host controller */
-+ sata_rcar_init_controller(host);
-+
-+ ata_host_resume(host);
-+
-+ return 0;
-+
-+cleanup:
-+ clk_disable_unprepare(priv->clk);
-+
-+ return ret;
-+}
-+
- static const struct dev_pm_ops sata_rcar_pm_ops = {
- .suspend = sata_rcar_suspend,
- .resume = sata_rcar_resume,
-+ .freeze = sata_rcar_suspend,
-+ .restore = sata_rcar_restore,
-+ .thaw = sata_rcar_resume,
-+ .poweroff = sata_rcar_suspend
- };
- #endif
-
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch
deleted file mode 100755
index d0250762e..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0004-Add-firmware-hibernation-code.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 33d4c0afe2a4e39c0afdc993f28a8d2d6228df01 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:31:24 +0900
-Subject: [PATCH 04/15] Add firmware hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/base/firmware_class.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
-index 01e2103..6123148 100644
---- a/drivers/base/firmware_class.c
-+++ b/drivers/base/firmware_class.c
-@@ -1464,6 +1464,7 @@ static int fw_pm_notify(struct notifier_block *notify_block,
- switch (mode) {
- case PM_HIBERNATION_PREPARE:
- case PM_SUSPEND_PREPARE:
-+ case PM_RESTORE_PREPARE:
- device_cache_fw_images();
- break;
-
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch
deleted file mode 100755
index b446fa301..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0005-Add-rcar-dma-hibernation-code.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From c094e905cb0f542acdeb5d7009ab9edc812897f7 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:32:30 +0900
-Subject: [PATCH 05/15] Add rcar-dma hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/dma/sh/rcar-dmac.c | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
-index e5e60ee..3b4a684 100644
---- a/drivers/dma/sh/rcar-dmac.c
-+++ b/drivers/dma/sh/rcar-dmac.c
-@@ -121,6 +121,7 @@ struct rcar_dmac_desc_page {
- * struct rcar_dmac_chan - R-Car Gen2 DMA Controller Channel
- * @chan: base DMA channel object
- * @iomem: channel I/O memory base
-+ * @backup: channel I/O memory backup base
- * @index: index of this channel in the controller
- * @src_xfer_size: size (in bytes) of hardware transfers on the source side
- * @dst_xfer_size: size (in bytes) of hardware transfers on the destination side
-@@ -140,6 +141,7 @@ struct rcar_dmac_desc_page {
- struct rcar_dmac_chan {
- struct dma_chan chan;
- void __iomem *iomem;
-+ void *backup;
- unsigned int index;
-
- unsigned int src_xfer_size;
-@@ -171,6 +173,7 @@ struct rcar_dmac_chan {
- * @engine: base DMA engine object
- * @dev: the hardware device
- * @iomem: remapped I/O memory base
-+ * @backup: remapped I/O memory backup base
- * @n_channels: number of available channels
- * @channels: array of DMAC channels
- * @modules: bitmask of client modules in use
-@@ -179,6 +182,7 @@ struct rcar_dmac {
- struct dma_device engine;
- struct device *dev;
- void __iomem *iomem;
-+ void *backup;
-
- unsigned int n_channels;
- struct rcar_dmac_chan *channels;
-@@ -277,6 +281,7 @@ static void rcar_dmac_write(struct rcar_dmac *dmac, u32 reg, u32 data)
- writew(data, dmac->iomem + reg);
- else
- writel(data, dmac->iomem + reg);
-+ writel(data, dmac->backup + reg);
- }
-
- static u32 rcar_dmac_read(struct rcar_dmac *dmac, u32 reg)
-@@ -301,6 +306,7 @@ static void rcar_dmac_chan_write(struct rcar_dmac_chan *chan, u32 reg, u32 data)
- writew(data, chan->iomem + reg);
- else
- writel(data, chan->iomem + reg);
-+ writel(data, chan->backup + reg);
- }
-
- /* -----------------------------------------------------------------------------
-@@ -1548,10 +1554,25 @@ static int rcar_dmac_runtime_resume(struct device *dev)
- }
- #endif
-
-+static int rcar_dmac_freeze(struct device *dev)
-+{
-+ return 0;
-+}
-+
-+static int rcar_dmac_restore(struct device *dev)
-+{
-+ int ret;
-+ struct rcar_dmac *dmac = dev_get_drvdata(dev);
-+ ret = rcar_dmac_init(dmac);
-+ return ret;
-+}
-+
- static const struct dev_pm_ops rcar_dmac_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(rcar_dmac_sleep_suspend, rcar_dmac_sleep_resume)
- SET_RUNTIME_PM_OPS(rcar_dmac_runtime_suspend, rcar_dmac_runtime_resume,
- NULL)
-+ .freeze = rcar_dmac_freeze,
-+ .restore = rcar_dmac_restore,
- };
-
- /* -----------------------------------------------------------------------------
-@@ -1571,6 +1592,7 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
-
- rchan->index = index;
- rchan->iomem = dmac->iomem + RCAR_DMAC_CHAN_OFFSET(index);
-+ rchan->backup = dmac->backup + RCAR_DMAC_CHAN_OFFSET(index);
- rchan->mid_rid = -EINVAL;
-
- spin_lock_init(&rchan->lock);
-@@ -1657,8 +1679,13 @@ static int rcar_dmac_probe(struct platform_device *pdev)
- /* Request resources. */
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- dmac->iomem = devm_ioremap_resource(&pdev->dev, mem);
-+ dmac->backup = devm_kzalloc(&pdev->dev, resource_size(mem), GFP_KERNEL);
- if (IS_ERR(dmac->iomem))
- return PTR_ERR(dmac->iomem);
-+ dmac->backup = devm_kzalloc(&pdev->dev, resource_size(mem), GFP_KERNEL);
-+ if (IS_ERR(dmac->backup)) {
-+ return PTR_ERR(dmac->backup);
-+ }
-
- irq = platform_get_irq_byname(pdev, "error");
- if (irq < 0) {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch
deleted file mode 100755
index 8942ed44e..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0006-Add-rcar-du-hibernation-code.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From 4a9a11deb2e83549d2e77cac129f879a0000ef7e Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:33:54 +0900
-Subject: [PATCH 06/15] Add rcar-du hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 68 ++++++++++++++++++++++++++++++++++-
- 1 file changed, 67 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-index 53f1f6a..fbb212c 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
-@@ -442,6 +442,15 @@ static int rcar_du_pm_suspend(struct device *dev)
-
- drm_kms_helper_poll_disable(rcdu->ddev);
-
-+#ifdef CONFIG_MACH_FTEN
-+ list_for_each_entry(encoder,
-+ &rcdu->ddev->mode_config.encoder_list, head) {
-+ if ((encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) &&
-+ (get_rcar_slave_funcs(encoder)->dpms))
-+ get_rcar_slave_funcs(encoder)->dpms(encoder,
-+ DRM_MODE_DPMS_SUSPEND);
-+ }
-+#else
- #if defined(CONFIG_DRM_ADV7511) || defined(CONFIG_DRM_ADV7511_MODULE)
- list_for_each_entry(encoder,
- &rcdu->ddev->mode_config.encoder_list, head) {
-@@ -451,6 +460,8 @@ static int rcar_du_pm_suspend(struct device *dev)
- DRM_MODE_DPMS_OFF);
- }
- #endif
-+#endif
-+
- #ifdef CONFIG_DRM_RCAR_LVDS
- for (i = 0; i < rcdu->info->num_lvds; ++i) {
- if (rcdu->lvds[i])
-@@ -483,6 +494,15 @@ static int rcar_du_pm_resume(struct device *dev)
- }
- #endif
-
-+#ifdef CONFIG_MACH_FTEN
-+ list_for_each_entry(encoder,
-+ &rcdu->ddev->mode_config.encoder_list, head) {
-+ if ((encoder->encoder_type == DRM_MODE_ENCODER_TVDAC) &&
-+ (get_rcar_slave_funcs(encoder)->dpms))
-+ get_rcar_slave_funcs(encoder)->dpms(encoder,
-+ DRM_MODE_DPMS_ON);
-+ }
-+#else
- #if defined(CONFIG_DRM_ADV7511) || defined(CONFIG_DRM_ADV7511_MODULE)
- list_for_each_entry(encoder,
- &rcdu->ddev->mode_config.encoder_list, head) {
-@@ -492,14 +512,53 @@ static int rcar_du_pm_resume(struct device *dev)
- DRM_MODE_DPMS_ON);
- }
- #endif
-+#endif
- drm_kms_helper_poll_enable(rcdu->ddev);
-
- return 0;
- }
--#endif
-+#ifdef CONFIG_MACH_FTEN
-+static int rcar_du_pm_freeze(struct device *dev)
-+{
-+ int ret;
-+
-+ ret = rcar_du_pm_suspend(dev);
-+ return ret;
-+}
-+
-+static int rcar_du_pm_thaw(struct device *dev)
-+{
-+ int ret;
-
-+ ret = rcar_du_pm_resume(dev);
-+ return ret;
-+}
-+
-+static int rcar_du_pm_restore(struct device *dev)
-+{
-+ int i, ret;
-+ struct rcar_du_device *rcdu = dev_get_drvdata(dev);
-+
-+ ret = rcar_du_pm_resume(dev);
-+ for (i = 0; i < rcdu->pdata->num_crtcs; ++i)
-+ rcar_du_crtc_enable_vblank(&rcdu->crtcs[i],
-+ rcdu->crtcs[i].vblank_enable);
-+ return ret;
-+}
-+#endif
-+#endif
- static const struct dev_pm_ops rcar_du_pm_ops = {
-+#if defined(CONFIG_MACH_FTEN) && defined(CONFIG_HIBERNATION) && \
-+ defined(CONFIG_PM_SLEEP)
-+ .suspend = rcar_du_pm_suspend,
-+ .resume = rcar_du_pm_resume,
-+ .freeze = rcar_du_pm_freeze,
-+ .thaw = rcar_du_pm_thaw,
-+ .poweroff = rcar_du_pm_suspend,
-+ .restore = rcar_du_pm_restore,
-+#else
- SET_SYSTEM_SLEEP_PM_OPS(rcar_du_pm_suspend, rcar_du_pm_resume)
-+#endif
- };
-
- /* -----------------------------------------------------------------------------
-@@ -620,6 +679,13 @@ static const struct rcar_du_device_info rcar_du_r8a7791_info = {
- .possible_clones = 0,
- .encoder_type = DRM_MODE_ENCODER_NONE,
- },
-+#if defined(CONFIG_MACH_FTEN)
-+ [RCAR_DU_OUTPUT_COMPOSITE] = {
-+ .possible_crtcs = BIT(1),
-+ .possible_clones = 0,
-+ .encoder_type = DRM_MODE_ENCODER_TVDAC,
-+ },
-+#endif
- },
- .num_lvds = 1,
- .drgbs_bit = 1,
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch
deleted file mode 100755
index bba1eb401..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0007-Add-rcar-i2c-hibernation-code.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 6c133013b75d88d5b4514dfecb3089f830b82d65 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:35:37 +0900
-Subject: [PATCH 07/15] Add rcar-i2c hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/i2c/busses/i2c-rcar.c | 38 ++++++++++++++++++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
-
-diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
-index 8242002..c6a5a4b 100644
---- a/drivers/i2c/busses/i2c-rcar.c
-+++ b/drivers/i2c/busses/i2c-rcar.c
-@@ -754,6 +754,43 @@ static int rcar_i2c_probe(struct platform_device *pdev)
-
- return 0;
- }
-+static int rcar_i2c_suspend(struct device *dev)
-+{
-+ struct platform_device *pdev = to_platform_device(dev);
-+ struct rcar_i2c_priv *priv = platform_get_drvdata(pdev);
-+ pr_debug("suspend: i2c adapter name %s", priv->adap.name);
-+ pr_debug("suspend: ICSCR: %08x\n", readl(priv->io + ICSCR));
-+ pr_debug("suspend: ICMCR: %08x\n", readl(priv->io + ICMCR));
-+ pr_debug("suspend: ICSSR: %08x\n", readl(priv->io + ICSSR));
-+ pr_debug("suspend: ICMSR: %08x\n", readl(priv->io + ICMSR));
-+ pr_debug("suspend: ICSIER: %08x\n", readl(priv->io + ICSIER));
-+ pr_debug("suspend: ICMIER: %08x\n", readl(priv->io + ICMIER));
-+ pr_debug("suspend: ICCCR: %08x\n", readl(priv->io + ICCCR));
-+ pr_debug("suspend: ICSAR: %08x\n", readl(priv->io + ICSAR));
-+ pr_debug("suspend: ICMAR: %08x\n", readl(priv->io + ICMAR));
-+ clk_disable(priv->clk);
-+ return 0;
-+}
-+static int rcar_i2c_resume(struct device *dev)
-+{
-+ struct platform_device *pdev = to_platform_device(dev);
-+ struct rcar_i2c_priv *priv = platform_get_drvdata(pdev);
-+ clk_enable(priv->clk);
-+ pr_debug("resume: i2c adapter name %s", priv->adap.name);
-+ pr_debug("resume: ICSCR: %08x\n", readl(priv->io + ICSCR));
-+ pr_debug("resume: ICMCR: %08x\n", readl(priv->io + ICMCR));
-+ pr_debug("resume: ICSSR: %08x\n", readl(priv->io + ICSSR));
-+ pr_debug("resume: ICMSR: %08x\n", readl(priv->io + ICMSR));
-+ pr_debug("resume: ICSIER: %08x\n", readl(priv->io + ICSIER));
-+ pr_debug("resume: ICMIER: %08x\n", readl(priv->io + ICMIER));
-+ pr_debug("resume: ICCCR: %08x\n", readl(priv->io + ICCCR));
-+ pr_debug("resume: ICSAR: %08x\n", readl(priv->io + ICSAR));
-+ pr_debug("resume: ICMAR: %08x\n", readl(priv->io + ICMAR));
-+ return 0;
-+}
-+static const struct dev_pm_ops rcar_i2c_pm_ops = {
-+ SET_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume)
-+};
-
- static int rcar_i2c_remove(struct platform_device *pdev)
- {
-@@ -780,6 +817,7 @@ static struct platform_driver rcar_i2c_driver = {
- .name = "i2c-rcar",
- .owner = THIS_MODULE,
- .of_match_table = rcar_i2c_dt_ids,
-+ .pm = &rcar_i2c_pm_ops,
- },
- .probe = rcar_i2c_probe,
- .remove = rcar_i2c_remove,
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch
deleted file mode 100755
index 34b40a147..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0008-Add-rcar-mmc-hibernation-code.patch
+++ /dev/null
@@ -1,414 +0,0 @@
-From 9d1d9be70ed3cf6670ae12a1caed337833f7bba8 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:38:11 +0900
-Subject: [PATCH 08/15] Add rcar mmc hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/mmc/host/sh_mmcif.c | 65 +++++++++++++++++++++-
- drivers/mmc/host/sh_mobile_sdhi.c | 112 +++++++++++++++++++++++++++++++++++++-
- drivers/mmc/host/tmio_mmc.h | 1 +
- drivers/mmc/host/tmio_mmc_pio.c | 49 ++++++++++++-----
- 4 files changed, 210 insertions(+), 17 deletions(-)
-
-diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
-index 7290e6e..4ecf62c 100644
---- a/drivers/mmc/host/sh_mmcif.c
-+++ b/drivers/mmc/host/sh_mmcif.c
-@@ -232,6 +232,7 @@ struct sh_mmcif_host {
- struct platform_device *pd;
- struct clk *hclk;
- unsigned int clk;
-+ int clkrate;
- int bus_width;
- unsigned char timing;
- bool sd_error;
-@@ -257,6 +258,8 @@ struct sh_mmcif_host {
- struct dma_chan *chan_tx;
- struct completion dma_complete;
- bool dma_active;
-+#define N_REGS 10
-+ u32 regs[N_REGS];
- };
-
- static inline void sh_mmcif_bitset(struct sh_mmcif_host *host,
-@@ -1457,6 +1460,8 @@ static int sh_mmcif_probe(struct platform_device *pdev)
- }
- }
-
-+ host->clkrate = clk_get_rate(host->hclk);
-+
- ret = sh_mmcif_clk_update(host);
- if (ret < 0)
- goto eclkupdate;
-@@ -1503,6 +1508,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
- dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
- dev_dbg(&pdev->dev, "chip ver H'%04x\n",
- sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
-+ device_enable_async_suspend(&pdev->dev);
- return ret;
-
- emmcaddh:
-@@ -1574,15 +1580,68 @@ static int sh_mmcif_suspend(struct device *dev)
- sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
- pm_runtime_put(dev);
-
-- return 0;
-+ return mmc_suspend_host(host->mmc);
- }
-
- static int sh_mmcif_resume(struct device *dev)
- {
-- return 0;
-+ struct sh_mmcif_host *host = dev_get_drvdata(dev);
-+ return mmc_resume_host(host->mmc);
-+}
-+#endif
-+
-+#ifdef CONFIG_PM
-+static int sh_mmcif_restore(struct device *dev)
-+{
-+ struct sh_mmcif_host *host = dev_get_drvdata(dev);
-+ int ret;
-+ ret = clk_set_rate(host->hclk, host->clkrate);
-+ if (ret < 0)
-+ goto eclkupdate;
-+ ret = sh_mmcif_clk_update(host);
-+ if (ret < 0)
-+ goto eclkupdate;
-+ ret = pm_runtime_resume(dev);
-+ if (ret < 0)
-+ goto eresume;
-+ sh_mmcif_sync_reset(host);
-+#ifdef CONFIG_MACH_FTEN
-+ sh_mmcif_writel(host->addr, 0x00000080, 0x00000100);
-+#endif
-+ sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
-+ clk_disable_unprepare(host->hclk);
-+ dev_info(dev, "restore: chip ver H'%04x\n",
-+ sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
-+ sh_mmcif_writel(host->addr, MMCIF_CE_CMD_CTRL, host->regs[0]);
-+ sh_mmcif_writel(host->addr, MMCIF_CE_BLOCK_SET, host->regs[1]);
-+ sh_mmcif_writel(host->addr, MMCIF_CE_CLK_CTRL, host->regs[2]);
-+ sh_mmcif_writel(host->addr, MMCIF_CE_BUF_ACC, host->regs[3]);
-+ sh_mmcif_release_dma(host);
-+ return mmc_resume_host(host->mmc);
-+eclkupdate:
-+ pr_info("Can't set clock\n");
-+ return -EINVAL;
-+eresume:
-+ pr_info("Can't resume PM\n");
-+ return -ENODEV;
- }
-+
-+static int sh_mmcif_freeze(struct device *dev)
-+{
-+ struct sh_mmcif_host *host = dev_get_drvdata(dev);
-+ int ret = mmc_suspend_host(host->mmc);
-+ host->regs[0] = sh_mmcif_readl(host->addr, MMCIF_CE_CMD_CTRL);
-+ host->regs[1] = sh_mmcif_readl(host->addr, MMCIF_CE_BLOCK_SET);
-+ host->regs[2] = sh_mmcif_readl(host->addr, MMCIF_CE_CLK_CTRL);
-+ host->regs[3] = sh_mmcif_readl(host->addr, MMCIF_CE_BUF_ACC);
-+ return ret;
-+}
-+#else
-+#define sh_mmcif_restore NULL
-+#define sh_mmcif_freeze NULL
- #endif
-
-+
- static const struct of_device_id mmcif_of_match[] = {
- { .compatible = "renesas,sh-mmcif" },
- { }
-@@ -1591,6 +1650,8 @@ MODULE_DEVICE_TABLE(of, mmcif_of_match);
-
- static const struct dev_pm_ops sh_mmcif_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(sh_mmcif_suspend, sh_mmcif_resume)
-+ .restore = sh_mmcif_restore,
-+ .freeze = sh_mmcif_freeze,
- };
-
- static struct platform_driver sh_mmcif_driver = {
-diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
-index 1b59cdf..c7f3abf 100644
---- a/drivers/mmc/host/sh_mobile_sdhi.c
-+++ b/drivers/mmc/host/sh_mobile_sdhi.c
-@@ -156,6 +156,8 @@ struct sh_mobile_sdhi {
- struct tmio_mmc_dma dma_priv;
- unsigned int type;
- struct sh_mobile_sdhi_vlt vlt;
-+ int wifi_xrst;
-+ int save_clk_rate;
- };
-
- static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
-@@ -647,6 +649,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
- if (ret < 0)
- dev_err(&pdev->dev,
- "cannot set clock rate: %d\n", ret);
-+ priv->save_clk_rate = clk_rate;
-
- clk_disable_unprepare(priv->clk);
- }
-@@ -841,6 +844,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
- }
- }
-
-+ device_enable_async_suspend(&pdev->dev);
- dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n",
- mmc_hostname(host->mmc), (unsigned long)
- (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
-@@ -865,17 +869,123 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
- struct mmc_host *mmc = platform_get_drvdata(pdev);
- struct tmio_mmc_host *host = mmc_priv(mmc);
- struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
-+#ifdef CONFIG_MACH_FTEN_DT
-+ int ret;
-+ struct sh_mobile_sdhi *priv = container_of(host->pdata,
-+ struct sh_mobile_sdhi,
-+ mmc_data);
-+#endif
-
- tmio_mmc_host_remove(host);
-
- if (p && p->cleanup)
- p->cleanup(pdev);
-
-+#ifdef CONFIG_MACH_FTEN_DT
-+ ret = gpio_request(priv->wifi_xrst, "sh_mobile_sdhi");
-+ if (ret != 0) {
-+ dev_err(&pdev->dev,
-+ "gpio_request(%d) failed(%d) remove\n",
-+ priv->wifi_xrst, ret);
-+ goto skip_wifi;
-+ }
-+ ret = gpio_direction_output(priv->wifi_xrst, 0);
-+ if (ret != 0) {
-+ dev_err(&pdev->dev,
-+ "gpio_direction_output(%d) failed(%d) remove\n",
-+ priv->wifi_xrst, ret);
-+ }
-+ gpio_free(priv->wifi_xrst);
-+skip_wifi:
-+#endif
-+
-+ return 0;
-+}
-+
-+static int sh_mobile_sdhi_restore_noirq(struct device *dev)
-+{
-+ struct mmc_host *mmc = dev_get_drvdata(dev);
-+ struct tmio_mmc_host *host = mmc_priv(mmc);
-+
-+ sd_ctrl_write32(host, CTL_IRQ_MASK, 0x8b7f031d);
-+ sd_ctrl_write32(host, CTL_STATUS, 0);
-+#if 0
-+ sh_mobile_sdhi_enable_sdbuf_acc32(host, false);
-+ /* FIXME - should we set stop clock reg here */
-+ sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
-+ /* implicit BUG_ON(!res) */
-+ if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
-+ sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
-+ msleep(2);
-+ sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
-+ if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
-+ sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
-+ msleep(2);
-+ sd_ctrl_write32(host, CTL_IRQ_MASK, 0x8b7f031d);
-+ sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0040);
-+ sd_ctrl_write16(host, CTL_SD_MEM_CARD_OPT, 0x80E0);
-+ sd_ctrl_write16(host, CTL_DMA_ENABLE, 0x1002);
-+#endif
-+ return 0;
-+}
-+
-+static int sh_mobile_sdhi_restore(struct device *dev)
-+{
-+ struct mmc_host *mmc = dev_get_drvdata(dev);
-+ struct tmio_mmc_host *host = mmc_priv(mmc);
-+ struct sh_mobile_sdhi *priv = container_of(host->pdata,
-+ struct sh_mobile_sdhi,
-+ mmc_data);
-+#if defined(CONFIG_MACH_FTEN_DT) || defined(CONFIG_PM_SLEEP)
-+ int ret;
-+#endif
-+ int dma_size;
-+ host->restore = true;
-+
-+#ifdef CONFIG_MACH_FTEN_DT
-+ /* priv->wifi_xrst is 0 or more. */
-+ if (priv->wifi_xrst >= 0) {
-+ ret = gpio_request(priv->wifi_xrst, "sh_mobile_sdhi");
-+ if (ret != 0) {
-+ dev_err(dev, "gpio_request(%d) failed(%d) restore\n",
-+ priv->wifi_xrst, ret);
-+ goto skip_wifi;
-+ }
-+ ret = gpio_direction_output(priv->wifi_xrst, 1);
-+ if (ret != 0) {
-+ dev_err(dev, "gpio_direction_output(%d) failed(%d) restore\n",
-+ priv->wifi_xrst, ret);
-+ }
-+ gpio_free(priv->wifi_xrst);
-+ }
-+skip_wifi:
-+#endif
-+
-+ dma_size = sh_mobile_sdhi_get_xmit_size(priv->type,
-+ priv->dma_priv.alignment_shift);
-+
-+ sd_ctrl_write16(host, SD_DMACR(priv->type), dma_size);
-+
-+#ifdef CONFIG_PM_SLEEP
-+ ret = tmio_mmc_host_resume(dev);
-+ host->restore = false;
-+ return ret;
-+#else
-+ host->restore = false;
- return 0;
-+#endif
- }
-
- static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
-- SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_host_suspend, tmio_mmc_host_resume)
-+#ifdef CONFIG_PM_SLEEP
-+ .suspend = tmio_mmc_host_suspend,
-+ .resume = tmio_mmc_host_resume,
-+ .freeze = tmio_mmc_host_suspend,
-+ .thaw = tmio_mmc_host_resume,
-+ .poweroff = tmio_mmc_host_suspend,
-+#endif
-+ .restore = sh_mobile_sdhi_restore,
-+ .restore_noirq = sh_mobile_sdhi_restore_noirq,
- SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
- tmio_mmc_host_runtime_resume,
- NULL)
-diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
-index c5b12ad..3efe03d 100644
---- a/drivers/mmc/host/tmio_mmc.h
-+++ b/drivers/mmc/host/tmio_mmc.h
-@@ -104,6 +104,7 @@ struct tmio_mmc_host {
- bool resuming;
- bool done_tuning;
- struct completion completion;
-+ bool restore;
- };
-
- int tmio_mmc_host_probe(struct tmio_mmc_host **host,
-diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
-index 09c0c08..514af15 100644
---- a/drivers/mmc/host/tmio_mmc_pio.c
-+++ b/drivers/mmc/host/tmio_mmc_pio.c
-@@ -167,8 +167,20 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
- if (host->set_clk_div)
- host->set_clk_div(host->pdev, (clk>>22) & 1);
-
-+#ifdef CONFIG_MACH_FTEN
-+ clk |= sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL) & 0x0100;
-+ if (host->pdata->flags & TMIO_MMC_SDCLK_AUTO_CONTROL &&
-+ new_clock > host->mmc->f_init)
-+ clk |= SDCLKOFFEN;
-+ dev_dbg(&host->pdev->dev,
-+ "clock=%d, clk=%08x, new_clock=%d, f_init=%d\n",
-+ clock, clk, new_clock, host->mmc->f_init);
-+ sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & 0x3ff);
-+#else
- sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & 0x1ff);
-- msleep(10);
-+#endif
-+ if (!host->restore)
-+ msleep(2);
- }
-
- static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
-@@ -176,13 +188,15 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
- /* implicit BUG_ON(!res) */
- if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
- sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
-- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP))
-+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)
-+ && !host->restore)
- msleep(10);
- }
-
- sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
- sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
-- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP))
-+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)
-+ && !host->restore)
- msleep(10);
- }
-
-@@ -190,14 +204,16 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
- {
- sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
- sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
-- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP))
-- msleep(10);
-+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)
-+ && !host->restore)
-+ msleep(2);
-
- /* implicit BUG_ON(!res) */
- if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
- sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
-- if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP))
-- msleep(10);
-+ if (!(host->pdata->flags & TMIO_MMC_CLK_NO_SLEEP)
-+ && !host->restore)
-+ msleep(2);
- }
- }
-
-@@ -208,11 +224,11 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
- /* implicit BUG_ON(!res) */
- if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
- sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
-- msleep(10);
-+ msleep(2);
- sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
- if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
- sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
-- msleep(10);
-+ msleep(2);
- }
-
- static void tmio_mmc_reset_work(struct work_struct *work)
-@@ -1134,16 +1150,21 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- * is kept positive, so no suspending actually takes place.
- */
- if (ios->power_mode == MMC_POWER_ON && ios->clock) {
-+ int reset_needed = 0;
- if (host->power != TMIO_MMC_ON_RUN) {
- tmio_mmc_clk_update(mmc);
- pm_runtime_get_sync(dev);
-- if (host->resuming) {
-- tmio_mmc_reset(host);
-- host->resuming = false;
-- }
-+ if (host->resuming)
-+ reset_needed = 1;
- }
-+
- if (host->power == TMIO_MMC_OFF_STOP)
-+ reset_needed = 1;
-+ if (reset_needed) {
- tmio_mmc_reset(host);
-+ if (host->resuming)
-+ host->resuming = false;
-+ }
- tmio_mmc_set_clock(host, ios->clock);
- if (host->power == TMIO_MMC_OFF_STOP)
- /* power up SD card and the bus */
-@@ -1497,7 +1518,7 @@ int tmio_mmc_host_resume(struct device *dev)
-
- /* The MMC core will perform the complete set up */
- host->resuming = true;
-- return mmc_resume_host(mmc);
-+ return mmc_resume_host(mmc);
- }
- EXPORT_SYMBOL(tmio_mmc_host_resume);
- #endif
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch
deleted file mode 100755
index a3495e650..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0009-Add-hibernation-store-area.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 5509937666792520b755ed61a110c956478d089d Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:41:19 +0900
-Subject: [PATCH 09/15] Add hibernation store area
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/mtd/Makefile | 3 ++-
- drivers/mtd/devices/Makefile | 4 +++-
- drivers/mtd/devices/phram.c | 5 ++++-
- 3 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
-index 99bb9a1..b48049c 100644
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -30,7 +30,8 @@ obj-$(CONFIG_MTD_SWAP) += mtdswap.o
- nftl-objs := nftlcore.o nftlmount.o
- inftl-objs := inftlcore.o inftlmount.o
-
-+obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
-+
- obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/
-
--obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
- obj-$(CONFIG_MTD_UBI) += ubi/
-diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
-index d83bd73..969f0e8 100644
---- a/drivers/mtd/devices/Makefile
-+++ b/drivers/mtd/devices/Makefile
-@@ -3,8 +3,10 @@
- #
-
- obj-$(CONFIG_MTD_DOCG3) += docg3.o
--obj-$(CONFIG_MTD_SLRAM) += slram.o
-+# obj-$(CONFIG_MTD_SLRAM) += slram.o
-+# obj-$(CONFIG_MTD_PHRAM) += phram.o
- obj-$(CONFIG_MTD_PHRAM) += phram.o
-+obj-$(CONFIG_MTD_SLRAM) += slram.o
- obj-$(CONFIG_MTD_PMC551) += pmc551.o
- obj-$(CONFIG_MTD_MS02NV) += ms02-nv.o
- obj-$(CONFIG_MTD_MTDRAM) += mtdram.o
-diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
-index 67823de..f05947f 100644
---- a/drivers/mtd/devices/phram.c
-+++ b/drivers/mtd/devices/phram.c
-@@ -293,8 +293,11 @@ static void __exit cleanup_phram(void)
- {
- unregister_devices();
- }
--
-+#ifdef __MODULE__
- module_init(init_phram);
-+#else
-+late_initcall(init_phram);
-+#endif
- module_exit(cleanup_phram);
-
- MODULE_LICENSE("GPL");
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch
deleted file mode 100755
index 55d1216fe..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0010-Add-rcar-eth-hibernation-code.patch
+++ /dev/null
@@ -1,238 +0,0 @@
-From 1d20d3bd16eac561e14513c9e6cac543fab5a3f0 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:42:33 +0900
-Subject: [PATCH 10/15] Add rcar-eth hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/net/ethernet/renesas/sh_eth.c | 57 +++++++++++++++++++++++++++++++++--
- drivers/net/phy/phy_device.c | 41 +++++++++++++++++++++++++
- 2 files changed, 95 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
-index 991fa1e..7e91b26 100644
---- a/drivers/net/ethernet/renesas/sh_eth.c
-+++ b/drivers/net/ethernet/renesas/sh_eth.c
-@@ -33,6 +33,7 @@
- #include <linux/of.h>
- #include <linux/of_device.h>
- #include <linux/of_irq.h>
-+#include <linux/of_gpio.h>
- #include <linux/of_net.h>
- #include <linux/phy.h>
- #include <linux/cache.h>
-@@ -999,6 +1000,7 @@ static unsigned long sh_eth_get_edtrr_trns(struct sh_eth_private *mdp)
- struct bb_info {
- void (*set_gate)(void *addr);
- struct mdiobb_ctrl ctrl;
-+ struct sh_eth_private *mdp;
- void *addr;
- u32 mmd_msk;/* MMD */
- u32 mdo_msk;
-@@ -1029,6 +1031,8 @@ static void sh_mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit)
- {
- struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
-
-+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev);
-+
- if (bitbang->set_gate)
- bitbang->set_gate(bitbang->addr);
-
-@@ -1036,6 +1040,8 @@ static void sh_mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit)
- bb_set(bitbang->addr, bitbang->mmd_msk);
- else
- bb_clr(bitbang->addr, bitbang->mmd_msk);
-+
-+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev);
- }
-
- /* Set bit data*/
-@@ -1043,6 +1049,8 @@ static void sh_set_mdio(struct mdiobb_ctrl *ctrl, int bit)
- {
- struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
-
-+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev);
-+
- if (bitbang->set_gate)
- bitbang->set_gate(bitbang->addr);
-
-@@ -1050,17 +1058,26 @@ static void sh_set_mdio(struct mdiobb_ctrl *ctrl, int bit)
- bb_set(bitbang->addr, bitbang->mdo_msk);
- else
- bb_clr(bitbang->addr, bitbang->mdo_msk);
-+
-+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev);
- }
-
- /* Get bit data*/
- static int sh_get_mdio(struct mdiobb_ctrl *ctrl)
- {
- struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
-+ unsigned int ret;
-+
-+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev);
-
- if (bitbang->set_gate)
- bitbang->set_gate(bitbang->addr);
-
-- return bb_read(bitbang->addr, bitbang->mdi_msk);
-+ ret = bb_read(bitbang->addr, bitbang->mdi_msk);
-+
-+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev);
-+
-+ return ret;
- }
-
- /* MDC pin control */
-@@ -1068,6 +1085,8 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
- {
- struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
-
-+ pm_runtime_get_sync(&bitbang->mdp->pdev->dev);
-+
- if (bitbang->set_gate)
- bitbang->set_gate(bitbang->addr);
-
-@@ -1075,6 +1094,8 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
- bb_set(bitbang->addr, bitbang->mdc_msk);
- else
- bb_clr(bitbang->addr, bitbang->mdc_msk);
-+
-+ pm_runtime_put_sync(&bitbang->mdp->pdev->dev);
- }
-
- /* mdio bus control struct */
-@@ -2664,6 +2685,7 @@ static int sh_mdio_init(struct sh_eth_private *mdp,
- bitbang->mdo_msk = PIR_MDO;
- bitbang->mmd_msk = PIR_MMD;
- bitbang->mdc_msk = PIR_MDC;
-+ bitbang->mdp = mdp;
- bitbang->ctrl.ops = &bb_ops;
-
- /* MII controller setting */
-@@ -3002,9 +3024,38 @@ static int sh_eth_runtime_nop(struct device *dev)
- return 0;
- }
-
-+static int sh_eth_suspend(struct device *dev)
-+{
-+ int ret = 0;
-+ struct net_device *ndev = dev_get_drvdata(dev);
-+
-+ if (netif_running(ndev)) {
-+ netif_device_detach(ndev);
-+ ret = sh_eth_close(ndev);
-+ }
-+
-+ return ret;
-+}
-+
-+static int sh_eth_resume(struct device *dev)
-+{
-+ int ret = 0;
-+ struct net_device *ndev = dev_get_drvdata(dev);
-+
-+ if (netif_running(ndev)) {
-+ ret = sh_eth_open(ndev);
-+ if (ret < 0)
-+ goto err;
-+ netif_device_attach(ndev);
-+ }
-+
-+err:
-+ return ret;
-+}
-+
- static const struct dev_pm_ops sh_eth_dev_pm_ops = {
-- .runtime_suspend = sh_eth_runtime_nop,
-- .runtime_resume = sh_eth_runtime_nop,
-+ SET_RUNTIME_PM_OPS(sh_eth_runtime_nop, sh_eth_runtime_nop, NULL)
-+ SET_SYSTEM_SLEEP_PM_OPS(sh_eth_suspend, sh_eth_resume)
- };
- #define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops)
- #else
-diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
-index 3657b4a..3ceb4f9 100644
---- a/drivers/net/phy/phy_device.c
-+++ b/drivers/net/phy/phy_device.c
-@@ -510,6 +510,32 @@ int phy_init_hw(struct phy_device *phydev)
- return phydev->drv->config_init(phydev);
- }
-
-+int phy_suspend(struct phy_device *phydev)
-+{
-+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
-+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
-+
-+ /* If the device has WOL enabled, we cannot suspend the PHY */
-+ phy_ethtool_get_wol(phydev, &wol);
-+ if (wol.wolopts)
-+ return -EBUSY;
-+
-+ if (phydrv->suspend)
-+ return phydrv->suspend(phydev);
-+ return 0;
-+}
-+EXPORT_SYMBOL(phy_suspend);
-+
-+int phy_resume(struct phy_device *phydev)
-+{
-+ struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
-+
-+ if (phydrv->resume)
-+ return phydrv->resume(phydev);
-+ return 0;
-+}
-+EXPORT_SYMBOL(phy_resume);
-+
- /**
- * phy_attach_direct - attach a network device to a given PHY device pointer
- * @dev: network device to attach
-@@ -528,6 +554,7 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
- u32 flags, phy_interface_t interface)
- {
- struct device *d = &phydev->dev;
-+ struct module *bus_module;
- int err;
-
- /* Assume that if there is no driver, that it doesn't
-@@ -553,6 +580,14 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
- return -EBUSY;
- }
-
-+ /* Increment the bus module reference count */
-+ bus_module = phydev->bus->dev.driver ?
-+ phydev->bus->dev.driver->owner : NULL;
-+ if (!try_module_get(bus_module)) {
-+ dev_err(&dev->dev, "failed to get the bus module\n");
-+ return -EIO;
-+ }
-+
- phydev->attached_dev = dev;
- dev->phydev = phydev;
-
-@@ -568,6 +603,8 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
- err = phy_init_hw(phydev);
- if (err)
- phy_detach(phydev);
-+ else
-+ phy_resume(phydev);
-
- return err;
- }
-@@ -612,8 +649,12 @@ EXPORT_SYMBOL(phy_attach);
- */
- void phy_detach(struct phy_device *phydev)
- {
-+ if (phydev->bus->dev.driver)
-+ module_put(phydev->bus->dev.driver->owner);
-+
- phydev->attached_dev->phydev = NULL;
- phydev->attached_dev = NULL;
-+ phy_suspend(phydev);
-
- /* If the device had no specific driver before (i.e. - it
- * was using the generic driver), we unbind the device
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch
deleted file mode 100755
index bdc9555c8..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0011-Add-rcar-pci-hibernation-code.patch
+++ /dev/null
@@ -1,375 +0,0 @@
-From f8691a62199319d9e37cd451a9b8364aa640c4cb Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:45:19 +0900
-Subject: [PATCH 11/15] Add rcar-pci hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/pci/host/pci-rcar-gen2.c | 281 ++++++++++++++++++++++++++++++++++++---
- 1 file changed, 266 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
-index 57b6572..4cb9693 100644
---- a/drivers/pci/host/pci-rcar-gen2.c
-+++ b/drivers/pci/host/pci-rcar-gen2.c
-@@ -23,9 +23,12 @@
- #include <linux/sizes.h>
- #include <linux/slab.h>
- #include <linux/usb/phy.h>
-+#include <linux/clk.h>
-
- /* AHB-PCI Bridge PCI communication registers */
- #define RCAR_AHBPCI_PCICOM_OFFSET 0x800
-+#define RCAR_PCICONF_OHCI 0x0
-+#define RCAR_PCICONF_EHCI 0x100
-
- #define RCAR_PCIAHB_WIN1_CTR_REG (RCAR_AHBPCI_PCICOM_OFFSET + 0x00)
- #define RCAR_PCIAHB_WIN2_CTR_REG (RCAR_AHBPCI_PCICOM_OFFSET + 0x04)
-@@ -104,6 +107,14 @@ struct rcar_pci_priv {
- int domain;
- int irq;
- unsigned long window_size;
-+ void __iomem *ohci_memdata;
-+ void __iomem *ehci_memdata;
-+#ifndef MCCILDK_CHANGE_DISABLE
-+ u32 store_cfg[12];
-+#else
-+ u32 store_cfg[9];
-+#endif
-+ struct usb_phy *phy;
- };
-
- /* PCI configuration space operations */
-@@ -276,12 +287,6 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys)
- /* Configure AHB master and slave modes */
- iowrite32(RCAR_AHB_BUS_MODE, reg + RCAR_AHB_BUS_CTR_REG);
-
-- /* Configure PCI arbiter */
-- val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG);
-- val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 |
-- RCAR_PCI_ARBITER_PCIBP_MODE;
-- iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG);
--
- /* PCI-AHB mapping: 0x40000000 base */
- iowrite32(0x40000000 | RCAR_PCIAHB_PREFETCH16,
- reg + RCAR_PCIAHB_WIN1_CTR_REG);
-@@ -290,9 +295,25 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys)
- val = priv->mem_res.start | RCAR_AHBPCI_WIN_CTR_MEM;
- iowrite32(val, reg + RCAR_AHBPCI_WIN2_CTR_REG);
-
-+ /* Enable PCI interrupts */
-+ iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME,
-+ reg + RCAR_PCI_INT_ENABLE_REG);
-+
-+ /* Configure PCI arbiter */
-+ val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG);
-+ val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 |
-+ RCAR_PCI_ARBITER_PCIBP_MODE;
-+ iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG);
-+
- /* Enable AHB-PCI bridge PCI configuration access */
- iowrite32(RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG,
- reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ val = ioread32(reg + PCI_COMMAND);
-+
-+ val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY |
-+ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
-+ iowrite32(val, reg + PCI_COMMAND);
-+
- /* Set PCI-AHB Window1 address */
- iowrite32(0x40000000 | PCI_BASE_ADDRESS_MEM_PREFETCH,
- reg + PCI_BASE_ADDRESS_1);
-@@ -300,15 +321,6 @@ static int rcar_pci_setup(int nr, struct pci_sys_data *sys)
- val = priv->cfg_res->start + RCAR_AHBPCI_PCICOM_OFFSET;
- iowrite32(val, reg + PCI_BASE_ADDRESS_0);
-
-- val = ioread32(reg + PCI_COMMAND);
-- val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY |
-- PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
-- iowrite32(val, reg + PCI_COMMAND);
--
-- /* Enable PCI interrupts */
-- iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME,
-- reg + RCAR_PCI_INT_ENABLE_REG);
--
- if (priv->irq > 0)
- rcar_pci_setup_errirq(priv);
-
-@@ -326,6 +338,8 @@ static struct pci_ops rcar_pci_ops = {
- .write = rcar_pci_write_config,
- };
-
-+#define RCAR_MAX_PCI_HOSTS 2
-+static struct rcar_pci_priv *keep_priv[RCAR_MAX_PCI_HOSTS];
- static int rcar_pci_probe(struct platform_device *pdev)
- {
- struct resource *cfg_res, *mem_res;
-@@ -350,6 +364,7 @@ static int rcar_pci_probe(struct platform_device *pdev)
- return -ENOMEM;
-
- priv->mem_res = *mem_res;
-+ keep_priv[pdev->id] = priv;
- /*
- * The controller does not support/use port I/O,
- * so setup a dummy port I/O region here.
-@@ -378,6 +393,7 @@ static int rcar_pci_probe(struct platform_device *pdev)
- return PTR_ERR(phy);
-
- usb_phy_init(phy);
-+ priv->phy = phy;
-
- hw_private[0] = priv;
- memset(&hw, 0, sizeof(hw));
-@@ -390,14 +406,249 @@ static int rcar_pci_probe(struct platform_device *pdev)
- hw.domain = priv->domain;
- #endif
- pci_common_init_dev(&pdev->dev, &hw);
-+ priv->ohci_memdata = ioremap(cfg_res->start - 0x10000, 0x1000);
-+ priv->ehci_memdata = ioremap(cfg_res->start - 0x10000 + 0x1000, 0x1000);
-+ return 0;
-+}
-+
-+static int rcar_pci_suspend(struct device *dev)
-+{
-+ struct clk *clk;
-+ clk = clk_get(NULL, "ehci");
-+ clk_disable_unprepare(clk);
-+ clk_put(clk);
-+ return 0;
-+}
-+static int rcar_pci_resume(struct device *dev)
-+{
-+ struct clk *clk;
-+ clk = clk_get(NULL, "ehci");
-+ clk_prepare_enable(clk);
-+ clk_put(clk);
-+ return 0;
-+}
-+static u32 rcar_pci_get_conf(struct rcar_pci_priv *priv, int id, int offset)
-+{
-+ u32 val, kpt;
-+ void __iomem *data;
-+ kpt = ioread32(priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ val = id ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG :
-+ RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG;
-+
-+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ data = priv->reg + (id >> 1) * 0x100;
-+ val = ioread32(data + offset);
-+ iowrite32(kpt, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ return val;
-+}
-+
-+static void rcar_pci_set_conf(struct rcar_pci_priv *priv,
-+ int id, int offset, u32 d)
-+{
-+ u32 val, kpt;
-+ void __iomem *data;
-+ kpt = ioread32(priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ val = id ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG :
-+ RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG;
-+
-+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ data = priv->reg + (id >> 1) * 0x100;
-+ iowrite32(d, data + offset);
-+ iowrite32(kpt, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+}
-+
-+
-+static int rcar_pci_freeze(struct device *dev)
-+{
-+ struct rcar_pci_priv *priv = keep_priv[to_platform_device(dev)->id];
-+ struct clk *clk;
-+ clk = clk_get(NULL, "ehci");
-+ clk_disable_unprepare(clk);
-+ clk_put(clk);
-+
-+#ifndef MCCILDK_CHANGE_DISABLE
-+ priv->store_cfg[0] = rcar_pci_get_conf(priv, 0, PCI_COMMAND);
-+ priv->store_cfg[1] = rcar_pci_get_conf(priv, 1, PCI_COMMAND);
-+ priv->store_cfg[2] = rcar_pci_get_conf(priv, 2, PCI_COMMAND);
-+ priv->store_cfg[3] = rcar_pci_get_conf(priv, 0, PCI_CACHE_LINE_SIZE);
-+ priv->store_cfg[4] = rcar_pci_get_conf(priv, 1, PCI_CACHE_LINE_SIZE);
-+ priv->store_cfg[5] = rcar_pci_get_conf(priv, 2, PCI_CACHE_LINE_SIZE);
-+ priv->store_cfg[6] = rcar_pci_get_conf(priv, 0, PCI_INTERRUPT_LINE);
-+ priv->store_cfg[7] = rcar_pci_get_conf(priv, 1, PCI_INTERRUPT_LINE);
-+ priv->store_cfg[8] = rcar_pci_get_conf(priv, 2, PCI_INTERRUPT_LINE);
-+ priv->store_cfg[9] = rcar_pci_get_conf(priv, 0, PCI_BASE_ADDRESS_0);
-+ priv->store_cfg[10] = rcar_pci_get_conf(priv, 1, PCI_BASE_ADDRESS_0);
-+ priv->store_cfg[11] = rcar_pci_get_conf(priv, 2, PCI_BASE_ADDRESS_0);
-+#else
-+ priv->store_cfg[0] = rcar_pci_get_conf(priv, 0, 0x04);
-+ priv->store_cfg[1] = rcar_pci_get_conf(priv, 1, 0x04);
-+ priv->store_cfg[2] = rcar_pci_get_conf(priv, 2, 0x04);
-+ priv->store_cfg[3] = rcar_pci_get_conf(priv, 0, 0x0c);
-+ priv->store_cfg[4] = rcar_pci_get_conf(priv, 1, 0x0c);
-+ priv->store_cfg[5] = rcar_pci_get_conf(priv, 2, 0x0c);
-+ priv->store_cfg[6] = rcar_pci_get_conf(priv, 0, 0x3c);
-+ priv->store_cfg[7] = rcar_pci_get_conf(priv, 1, 0x3c);
-+ priv->store_cfg[8] = rcar_pci_get_conf(priv, 2, 0x3c);
-+#endif
-+ pm_runtime_disable(priv->dev);
-+ return 0;
-+}
-+
-+static int rcar_pci_restore(struct device *dev)
-+{
-+ struct clk *clk;
-+ void *m;
-+ u32 val;
-+ struct rcar_pci_priv *priv = keep_priv[to_platform_device(dev)->id];
-+ void __iomem *reg = priv->reg;
-+ int id = to_platform_device(dev)->id;
-+
-+ pm_runtime_enable(priv->dev);
-+ pm_runtime_get_sync(priv->dev);
-+
-+ clk = clk_get(NULL, "ehci");
-+ clk_prepare_enable(clk);
-+ clk_put(clk);
-+ clk = clk_get(NULL, "hsusb");
-+ clk_prepare_enable(clk);
-+ clk_put(clk);
-+ usb_phy_set_suspend(priv->phy, 0);
-+ m = ioremap(0xe61501c4, 4);
-+ val = readl(m);
-+ iounmap(m);
-+ m = ioremap(0xe615014c, 4);
-+ writel(val & ~(3 << 3), m);
-+ iounmap(m);
-+ val = ioread32(reg + RCAR_PCI_UNIT_REV_REG);
-+ dev_info(priv->dev, "PCI: bus%u revision %x\n", id, val);
-+
-+ /* Disable Direct Power Down State and assert reset */
-+ val = ioread32(reg + RCAR_USBCTR_REG) & ~RCAR_USBCTR_DIRPD;
-+#ifndef MCCILDK_CHANGE_DISABLE
-+ val |= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST;
-+#else
-+ val |= RCAR_USBCTR_USBH_RST;
-+#endif
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+ udelay(4);
-+ /* De-assert reset */
-+#ifndef MCCILDK_CHANGE_DISABLE
-+ val &= ~(RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST
-+ | RCAR_USBCTR_PCICLK_MASK);
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+ /* reset PCIAHB window size */
-+ val &= ~RCAR_USBCTR_PCIAHB_WIN1_MASK;
-+ val |= RCAR_USBCTR_PCIAHB_WIN1_1G;
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+#else
-+ val &= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST
-+ | RCAR_USBCTR_PCICLK_MASK;
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+ val &= RCAR_USBCTR_USBH_RST | RCAR_USBCTR_PLL_RST
-+ | RCAR_USBCTR_PCICLK_MASK;
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+ /* reset PCIAHB window size */
-+ val &= RCAR_USBCTR_PCIAHB_WIN1_MASK;
-+ val |= RCAR_USBCTR_PCIAHB_WIN1_1G;
-+ iowrite32(val, reg + RCAR_USBCTR_REG);
-+#endif
-+
-+ /* Configure AHB master and slave modes */
-+ iowrite32(RCAR_AHB_BUS_MODE, reg + RCAR_AHB_BUS_CTR_REG);
-+
-+ /* PCI-AHB mapping: 0x40000000 base */
-+ iowrite32(0x40000000 | RCAR_PCIAHB_PREFETCH16,
-+ reg + RCAR_PCIAHB_WIN1_CTR_REG);
-+
-+ /* AHB-PCI mapping: OHCI/EHCI registers */
-+ val = priv->mem_res.start | RCAR_AHBPCI_WIN_CTR_MEM;
-+ iowrite32(val, reg + RCAR_AHBPCI_WIN2_CTR_REG);
-+
-+ /* Enable PCI interrupts */
-+ iowrite32(RCAR_PCI_INT_A | RCAR_PCI_INT_B | RCAR_PCI_INT_PME,
-+ reg + RCAR_PCI_INT_ENABLE_REG);
-+
-+ /* Configure PCI arbiter */
-+ val = ioread32(reg + RCAR_PCI_ARBITER_CTR_REG);
-+ val |= RCAR_PCI_ARBITER_PCIREQ0 | RCAR_PCI_ARBITER_PCIREQ1 |
-+ RCAR_PCI_ARBITER_PCIBP_MODE;
-+ iowrite32(val, reg + RCAR_PCI_ARBITER_CTR_REG);
-+
-+ /* Enable AHB-PCI bridge PCI configuration access */
-+ iowrite32(RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG,
-+ reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+
-+ val = ioread32(reg + PCI_COMMAND);
-+ val |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY |
-+ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
-+ iowrite32(val, reg + PCI_COMMAND);
-+
-+ /* Set PCI-AHB Window1 address */
-+ iowrite32(0x40000000 | PCI_BASE_ADDRESS_MEM_PREFETCH,
-+ reg + PCI_BASE_ADDRESS_1);
-+ /* Set AHB-PCI bridge PCI communication area address */
-+ val = priv->cfg_res->start + RCAR_AHBPCI_PCICOM_OFFSET;
-+ iowrite32(val, reg + PCI_BASE_ADDRESS_0);
-+
-+ if (priv->irq > 0)
-+ rcar_pci_setup_errirq(priv);
-+#ifndef MCCILDK_CHANGE_DISABLE
-+ rcar_pci_set_conf(priv, 0, PCI_COMMAND, priv->store_cfg[0]);
-+ rcar_pci_set_conf(priv, 1, PCI_COMMAND, priv->store_cfg[1]);
-+ rcar_pci_set_conf(priv, 2, PCI_COMMAND, priv->store_cfg[2]);
-+ rcar_pci_set_conf(priv, 0, PCI_CACHE_LINE_SIZE, priv->store_cfg[3]);
-+ rcar_pci_set_conf(priv, 1, PCI_CACHE_LINE_SIZE, priv->store_cfg[4]);
-+ rcar_pci_set_conf(priv, 2, PCI_CACHE_LINE_SIZE, priv->store_cfg[5]);
-+ rcar_pci_set_conf(priv, 0, PCI_INTERRUPT_LINE, priv->store_cfg[6]);
-+ rcar_pci_set_conf(priv, 1, PCI_INTERRUPT_LINE, priv->store_cfg[7]);
-+ rcar_pci_set_conf(priv, 2, PCI_INTERRUPT_LINE, priv->store_cfg[8]);
-+ rcar_pci_set_conf(priv, 1, PCI_BASE_ADDRESS_0, priv->store_cfg[10]);
-+ rcar_pci_set_conf(priv, 2, PCI_BASE_ADDRESS_0, priv->store_cfg[11]);
-+#else
-+ rcar_pci_set_conf(priv, 1, PCI_COMMAND, PCI_COMMAND_SERR
-+ | PCI_COMMAND_PARITY | PCI_COMMAND_MEMORY
-+ | PCI_COMMAND_MASTER);
-+ rcar_pci_set_conf(priv, 1, PCI_BASE_ADDRESS_0
-+ priv->cfg_res->start - 0x10000);
-+ rcar_pci_set_conf(priv, 2, PCI_COMMAND, PCI_COMMAND_SERR
-+ | PCI_COMMAND_PARITY | PCI_COMMAND_MEMORY
-+ | PCI_COMMAND_MASTER);
-+ rcar_pci_set_conf(priv, 2, PCI_BASE_ADDRESS_0,
-+ priv->cfg_res->start - 0x10000 + 0x1000);
-+ rcar_pci_set_conf(priv, 0, PCI_CACHE_LINE_SIZE, priv->store_cfg[3]);
-+ rcar_pci_set_conf(priv, 1, PCI_CACHE_LINE_SIZE, priv->store_cfg[4]);
-+ rcar_pci_set_conf(priv, 2, PCI_CACHE_LINE_SIZE, priv->store_cfg[5]);
-+ rcar_pci_set_conf(priv, 0, PCI_INTERRUPT_LINE, 0x00020100);
-+ rcar_pci_set_conf(priv, 1, PCI_INTERRUPT_LINE, 0x2a010100);
-+ rcar_pci_set_conf(priv, 2, PCI_INTERRUPT_LINE, 0x22100200);
-+ val = RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG;
-+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+ val = ioread32(priv->reg + 0x04);
-+ iowrite32(val | (1 << 1), priv->reg + 0x04);
-+ val = ioread32(priv->reg + 0x104);
-+ iowrite32(val | (1 << 1), priv->reg + 0x104);
-+
-+ val = RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG;
-+ iowrite32(val, priv->reg + RCAR_AHBPCI_WIN1_CTR_REG);
-+#endif
- return 0;
- }
-
-+static const struct dev_pm_ops rcar_pci_pm_ops = {
-+ .suspend = rcar_pci_suspend,
-+ .resume = rcar_pci_resume,
-+ .freeze_noirq = rcar_pci_freeze,
-+ .restore_noirq = rcar_pci_restore,
-+ .thaw = rcar_pci_resume,
-+ .poweroff = rcar_pci_suspend
-+};
-+
- static struct platform_driver rcar_pci_driver = {
- .driver = {
- .name = "pci-rcar-gen2",
- .owner = THIS_MODULE,
- .suppress_bind_attrs = true,
-+ .pm = &rcar_pci_pm_ops,
- },
- .probe = rcar_pci_probe,
- };
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch
deleted file mode 100755
index 9b2aff4f9..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0012-Add-rcar-gpio-hibernation-code.patch
+++ /dev/null
@@ -1,230 +0,0 @@
-From bf20be14fc1b3f7e096bdac9c5ff67362b391479 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:46:24 +0900
-Subject: [PATCH 12/15] Add rcar-gpio hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/pinctrl/sh-pfc/core.c | 141 +++++++++++++++++++++++++++++++++++++++---
- drivers/pinctrl/sh-pfc/core.h | 4 ++
- 2 files changed, 138 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
-index b9e025d..c37418e 100644
---- a/drivers/pinctrl/sh-pfc/core.c
-+++ b/drivers/pinctrl/sh-pfc/core.c
-@@ -24,6 +24,7 @@
- #include <linux/pinctrl/machine.h>
- #include <linux/platform_device.h>
- #include <linux/slab.h>
-+#include <linux/cpu_pm.h>
-
- #include "core.h"
-
-@@ -201,19 +202,117 @@ static void sh_pfc_config_reg_helper(struct sh_pfc *pfc,
- }
- }
-
-+#ifdef CONFIG_CPU_PM
-+struct reg_record {
-+ void __iomem *reg;
-+ unsigned long width;
-+ unsigned long data;
-+};
-+
-+struct reg_config {
-+ bool unlock;
-+ struct reg_record unlock_reg;
-+ struct reg_record actual_reg;
-+ struct list_head list;
-+};
-+
-+static struct reg_config *regs_list;
-+
-+struct reg_range {
-+ int start;
-+ int end;
-+};
-+
-+static int sh_pfc_cpu_pm_notify(struct notifier_block *self,
-+ unsigned long action, void *hcpu)
-+{
-+ struct reg_config *tmp = NULL;
-+ struct sh_pfc *pfc = container_of(self, struct sh_pfc, pm_notify);
-+ /* We don't setup pinmux in kernel - store all registers */
-+ struct reg_range ranges[] = {
-+ {0x0, 0x5c}, {0x160, 0x160}, {0x90, 0x98},
-+ {0x100, 0x118}, {0x70, 0x70}, {0x60, 0x64},
-+ {0x84, 0x8c}, {0x240, 0x248},
-+ };
-+
-+ if (action == CPU_PM_ENTER) {
-+ if (!regs_list) {
-+ /* No pinmux configuration, storing all registers */
-+ int store_cnt = 0;
-+ int i;
-+ for (i = 0; i < ARRAY_SIZE(ranges); i++) {
-+ int j;
-+ for (j = ranges[i].start; j <= ranges[i].end; j += sizeof(u32)) {
-+ pfc->stored_regs[store_cnt] =
-+ sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, 0xe6060000 + j), 32);
-+ pr_debug("PFC: %08x => %08x\n", 0xe6060000 + j, pfc->stored_regs[store_cnt]);
-+ store_cnt++;
-+ if (store_cnt >= ARRAY_SIZE(pfc->stored_regs)) {
-+ pr_err("read: Register store overflow\n");
-+ goto out;
-+ }
-+ }
-+ }
-+ }
-+ } else if (action == CPU_PM_ENTER_FAILED || action == CPU_PM_EXIT) {
-+ if (!regs_list) {
-+ /* No list, restoring all registers */
-+ int store_cnt = 0;
-+ int i;
-+ for (i = 0; i < ARRAY_SIZE(ranges); i++) {
-+ int j;
-+ for (j = ranges[i].start; j <= ranges[i].end; j += sizeof(u32)) {
-+ sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, 0xe6060000 + j), 32,
-+ pfc->stored_regs[store_cnt]);
-+ pr_debug("PFC: %08x => %08x\n", 0xe6060000 + j, pfc->stored_regs[store_cnt]);
-+ store_cnt++;
-+ if (store_cnt >= ARRAY_SIZE(pfc->stored_regs)) {
-+ pr_err("write: Register store overflow\n");
-+ goto out;
-+ }
-+ }
-+ }
-+ goto out;
-+ }
-+ list_for_each_entry(tmp , &(regs_list->list), list) {
-+ if (tmp->unlock)
-+ sh_pfc_write_raw_reg(tmp->unlock_reg.reg,
-+ tmp->unlock_reg.width,
-+ tmp->unlock_reg.data);
-+ sh_pfc_write_raw_reg(tmp->actual_reg.reg,
-+ tmp->actual_reg.width,
-+ tmp->actual_reg.data);
-+ }
-+ }
-+out:
-+ return NOTIFY_OK;
-+}
-+
-+static int __init sh_pfc_cpu_pm_init(struct sh_pfc *pfc)
-+{
-+ memset(&pfc->pm_notify, 0, sizeof(pfc->pm_notify));
-+ pfc->pm_notify.notifier_call = sh_pfc_cpu_pm_notify;
-+ return cpu_pm_register_notifier(&pfc->pm_notify);
-+}
-+#else
-+static int __init sh_pfc_cpu_pm_init(struct sh_pfc *pfc)
-+{
-+ return 0;
-+}
-+#endif
-+
-+
- static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
- const struct pinmux_cfg_reg *crp,
- unsigned long field, unsigned long value)
- {
- void __iomem *mapped_reg;
- unsigned long mask, pos, data;
--
-+#ifdef CONFIG_CPU_PM
-+ struct reg_config *tmp;
-+#endif
- sh_pfc_config_reg_helper(pfc, crp, field, &mapped_reg, &mask, &pos);
-
-- dev_dbg(pfc->dev, "write_reg addr = %lx, value = %ld, field = %ld, "
-- "r_width = %ld, f_width = %ld\n",
-- crp->reg, value, field, crp->reg_width, crp->field_width);
--
- mask = ~(mask << pos);
- value = value << pos;
-
-@@ -221,14 +320,39 @@ static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
- data &= mask;
- data |= value;
-
-- if (pfc->info->unlock_reg)
-+#ifdef CONFIG_CPU_PM
-+ tmp = kzalloc(sizeof(struct reg_config), GFP_KERNEL);
-+ BUG_ON(!tmp);
-+
-+ if (!regs_list) {
-+ regs_list = tmp;
-+ INIT_LIST_HEAD(&regs_list->list);
-+ }
-+#endif
-+
-+ if (pfc->info->unlock_reg) {
-+#ifdef CONFIG_CPU_PM
-+ tmp->unlock = true;
-+ tmp->unlock_reg.reg = sh_pfc_phys_to_virt(pfc,
-+ pfc->info->unlock_reg);
-+ tmp->unlock_reg.width = 32;
-+ tmp->unlock_reg.data = ~data;
-+#endif
- sh_pfc_write_raw_reg(
- sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32,
- ~data);
-+ }
-+
-+#ifdef CONFIG_CPU_PM
-+ tmp->actual_reg.reg = mapped_reg;
-+ tmp->actual_reg.width = crp->reg_width;
-+ tmp->actual_reg.data = data;
-+
-+ list_add(&tmp->list, &regs_list->list);
-+#endif
-
- sh_pfc_write_raw_reg(mapped_reg, crp->reg_width, data);
- }
--
- static int sh_pfc_get_config_reg(struct sh_pfc *pfc, u16 enum_id,
- const struct pinmux_cfg_reg **crp, int *fieldp,
- int *valuep)
-@@ -574,6 +698,8 @@ static int sh_pfc_probe(struct platform_device *pdev)
-
- platform_set_drvdata(pdev, pfc);
-
-+ sh_pfc_cpu_pm_init(pfc);
-+
- dev_info(pfc->dev, "%s support registered\n", info->name);
-
- return 0;
-@@ -596,6 +722,7 @@ static int sh_pfc_remove(struct platform_device *pdev)
- if (pfc->info->ops && pfc->info->ops->exit)
- pfc->info->ops->exit(pfc);
-
-+
- return 0;
- }
-
-diff --git a/drivers/pinctrl/sh-pfc/core.h b/drivers/pinctrl/sh-pfc/core.h
-index 75ecb67..5471a6c 100644
---- a/drivers/pinctrl/sh-pfc/core.h
-+++ b/drivers/pinctrl/sh-pfc/core.h
-@@ -14,6 +14,7 @@
- #include <linux/compiler.h>
- #include <linux/spinlock.h>
- #include <linux/types.h>
-+#include <linux/notifier.h>
-
- #include "sh_pfc.h"
-
-@@ -51,6 +52,9 @@ struct sh_pfc {
- struct sh_pfc_chip *func;
-
- struct sh_pfc_pinctrl *pinctrl;
-+ struct notifier_block pm_notify;
-+#define STORE_REGS_COUNT 50
-+ u32 stored_regs[STORE_REGS_COUNT];
- };
-
- int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch
deleted file mode 100755
index 515b08b12..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0013-Add-rcar-spi-hibernation-code.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From c1b129172a91046a7555a3c198b49eb1b45aafd7 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:58:28 +0900
-Subject: [PATCH 13/15] Add rcar-spi hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/spi/spi-rspi.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 108 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
-index 215be3b..a2432de 100644
---- a/drivers/spi/spi-rspi.c
-+++ b/drivers/spi/spi-rspi.c
-@@ -38,6 +38,7 @@
- #include <linux/sh_dma.h>
- #include <linux/spi/spi.h>
- #include <linux/spi/rspi.h>
-+#include <linux/delay.h>
-
- #define RSPI_SPCR 0x00 /* Control Register */
- #define RSPI_SSLP 0x01 /* Slave Select Polarity Register */
-@@ -208,6 +209,12 @@ struct rspi_data {
- u8 sppcr;
- int rx_irq, tx_irq;
- const struct spi_ops *ops;
-+ u32 save_spbmul0;
-+ u32 save_spbmul1;
-+ u32 save_spbmul2;
-+ u32 save_spbmul3;
-+ u8 save_spbfcr;
-+ u8 save_spscr;
-
- unsigned dma_callbacked:1;
- unsigned byte_access:1;
-@@ -238,6 +245,11 @@ static u16 rspi_read16(const struct rspi_data *rspi, u16 offset)
- return ioread16(rspi->addr + offset);
- }
-
-+static u16 rspi_read32(const struct rspi_data *rspi, u16 offset)
-+{
-+ return ioread32(rspi->addr + offset);
-+}
-+
- #define rspi_update8(spi, mask, val, reg) \
- rspi_write8(spi, (rspi_read8(spi, reg) & ~mask) | val, reg);
-
-@@ -504,7 +516,6 @@ static int rspi_pio_transfer_in(struct rspi_data *rspi, u8 *rx, unsigned int n)
- if (!rx)
- return 0;
-
--
- while (n > 0) {
- count = min(n, SPI_BUFFER_SIZE);
- if (count >= SPI_BUFFER_SIZE) {
-@@ -1278,6 +1289,101 @@ error1:
- return ret;
- }
-
-+int rspi_suspend(struct device *dev)
-+{
-+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev));
-+ clk_disable_unprepare(rspi->clk);
-+ return 0;
-+}
-+
-+int rspi_resume(struct device *dev)
-+{
-+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev));
-+ clk_prepare_enable(rspi->clk);
-+ return 0;
-+}
-+
-+#define PR_REG8(dev, rspi, reg) \
-+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \
-+ rspi_read8(rspi, reg))
-+#define PR_REG16(dev, rspi, reg) \
-+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \
-+ rspi_read16(rspi, reg))
-+#define PR_REG32(dev, rspi, reg) \
-+ dev_dbg(dev, "QSPI REG: " #reg " = %08x\n", \
-+ rspi_read32(rspi, reg))
-+
-+#ifdef DEBUG
-+static void pr_regs(struct device *dev)
-+{
-+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev));
-+ PR_REG8(dev, rspi, RSPI_SPCR);
-+ PR_REG8(dev, rspi, RSPI_SSLP);
-+ PR_REG8(dev, rspi, RSPI_SPPCR);
-+ PR_REG8(dev, rspi, RSPI_SPDR);
-+ PR_REG8(dev, rspi, RSPI_SPSCR);
-+ PR_REG8(dev, rspi, RSPI_SPBR);
-+ PR_REG8(dev, rspi, RSPI_SPDCR);
-+ PR_REG8(dev, rspi, RSPI_SPCKD);
-+ PR_REG8(dev, rspi, RSPI_SSLND);
-+ PR_REG8(dev, rspi, RSPI_SPND);
-+ PR_REG16(dev, rspi, RSPI_SPCMD0);
-+ PR_REG16(dev, rspi, RSPI_SPCMD1);
-+ PR_REG16(dev, rspi, RSPI_SPCMD2);
-+ PR_REG16(dev, rspi, RSPI_SPCMD3);
-+ PR_REG8(dev, rspi, QSPI_SPBFCR);
-+ PR_REG16(dev, rspi, QSPI_SPBDCR);
-+ PR_REG32(dev, rspi, QSPI_SPBMUL0);
-+ PR_REG32(dev, rspi, QSPI_SPBMUL1);
-+ PR_REG32(dev, rspi, QSPI_SPBMUL2);
-+ PR_REG32(dev, rspi, QSPI_SPBMUL3);
-+}
-+#endif
-+
-+int rspi_freeze(struct device *dev)
-+{
-+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev));
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
-+ rspi->save_spbmul0 = rspi_read32(rspi, QSPI_SPBMUL0);
-+ rspi->save_spbmul1 = rspi_read32(rspi, QSPI_SPBMUL1);
-+ rspi->save_spbmul2 = rspi_read32(rspi, QSPI_SPBMUL2);
-+ rspi->save_spbmul3 = rspi_read32(rspi, QSPI_SPBMUL3);
-+ rspi->save_spbfcr = rspi_read8(rspi, QSPI_SPBFCR);
-+ rspi->save_spscr = rspi_read8(rspi, RSPI_SPSCR);
-+ dev_info(dev, "freeze\n");
-+#ifdef DEBUG
-+ pr_regs(dev);
-+#endif
-+ return 0;
-+}
-+
-+
-+int rspi_restore(struct device *dev)
-+{
-+ struct rspi_data *rspi = platform_get_drvdata(to_platform_device(dev));
-+ clk_prepare_enable(rspi->clk);
-+ udelay(16);
-+ set_config_register(rspi, 8);
-+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
-+ rspi_write8(rspi, rspi->save_spscr, RSPI_SPSCR);
-+ rspi_write8(rspi, rspi->save_spbfcr, QSPI_SPBFCR);
-+ rspi_write32(rspi, rspi->save_spbmul3, QSPI_SPBMUL3);
-+ rspi_write32(rspi, rspi->save_spbmul2, QSPI_SPBMUL2);
-+ rspi_write32(rspi, rspi->save_spbmul1, QSPI_SPBMUL1);
-+ rspi_write32(rspi, rspi->save_spbmul0, QSPI_SPBMUL0);
-+ dev_info(dev, "restore\n");
-+#ifdef DEBUG
-+ pr_regs(dev);
-+#endif
-+ return 0;
-+}
-+
-+const struct dev_pm_ops rspi_pm_ops = {
-+ SET_SYSTEM_SLEEP_PM_OPS(rspi_suspend, rspi_resume)
-+ .restore = rspi_restore,
-+ .freeze = rspi_freeze,
-+};
-+
- static struct platform_device_id spi_driver_ids[] = {
- { "rspi", (kernel_ulong_t)&rspi_ops },
- { "rspi-rz", (kernel_ulong_t)&rspi_rz_ops },
-@@ -1295,6 +1401,7 @@ static struct platform_driver rspi_driver = {
- .name = "renesas_spi",
- .owner = THIS_MODULE,
- .of_match_table = of_match_ptr(rspi_of_match),
-+ .pm = &rspi_pm_ops,
- },
- };
- module_platform_driver(rspi_driver);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch
deleted file mode 100755
index c70f515a2..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0014-Add-rcar-sci-hibernation-code.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 947b9e15ff36a9dcd517bb932303cc32f8356550 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 17:59:40 +0900
-Subject: [PATCH 14/15] Add rcar-sci hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/tty/serial/sh-sci.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
-index e3abfb7..2f0dc7a 100644
---- a/drivers/tty/serial/sh-sci.c
-+++ b/drivers/tty/serial/sh-sci.c
-@@ -2852,6 +2852,7 @@ static int sci_probe(struct platform_device *dev)
- return 0;
- }
-
-+#ifdef CONFIG_PM_SLEEP
- static int sci_suspend(struct device *dev)
- {
- struct sci_port *sport = dev_get_drvdata(dev);
-@@ -2871,10 +2872,13 @@ static int sci_resume(struct device *dev)
-
- return 0;
- }
-+#else
-+#define sci_suspend NULL
-+#define sci_resume NULL
-+#endif
-
- static const struct dev_pm_ops sci_dev_pm_ops = {
-- .suspend = sci_suspend,
-- .resume = sci_resume,
-+ SET_SYSTEM_SLEEP_PM_OPS(sci_suspend, sci_resume)
- };
-
- static struct platform_driver sci_driver = {
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch
deleted file mode 100755
index c0c2b1675..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/0015-Add-rcar-usbphy-hibernation-code.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From 28393daa686ef43966e3fa1652bcd8d860698ef4 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Thu, 18 May 2017 18:00:39 +0900
-Subject: [PATCH 15/15] Add rcar-usbphy hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drivers/usb/phy/phy-rcar-gen2-usb.c | 35 +++++++++++++++++++++++++++++++++++
- 1 file changed, 35 insertions(+)
-
-diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c b/drivers/usb/phy/phy-rcar-gen2-usb.c
-index 9e7205d..05849e7 100644
---- a/drivers/usb/phy/phy-rcar-gen2-usb.c
-+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
-@@ -148,6 +148,7 @@ static int rcar_gen2_usb_phy_set_suspend(struct usb_phy *phy, int suspend)
-
- devm_release_mem_region(&pdev->dev, res->start, resource_size(res));
- devm_iounmap(&pdev->dev, priv->base);
-+ priv->base = NULL;
-
- spin_unlock_irqrestore(&priv->lock, flags);
-
-@@ -178,6 +179,7 @@ static int rcar_gen2_usb_phy_init(struct usb_phy *phy)
- devm_release_mem_region(&pdev->dev, res->start,
- resource_size(res));
- devm_iounmap(&pdev->dev, priv->base);
-+ priv->base = NULL;
- spin_unlock_irqrestore(&priv->lock, flags);
- }
- return 0;
-@@ -209,6 +211,7 @@ static void rcar_gen2_usb_phy_shutdown(struct usb_phy *phy)
- devm_release_mem_region(&pdev->dev, res->start,
- resource_size(res));
- devm_iounmap(&pdev->dev, priv->base);
-+ priv->base = NULL;
- }
- out:
- spin_unlock_irqrestore(&priv->lock, flags);
-@@ -431,9 +434,41 @@ static int phy_rcar_gen2_pm_resume(struct device *dev)
- return 0;
- }
-
-+static int phy_rcar_gen2_pm_freeze(struct device *dev)
-+{
-+ struct rcar_gen2_usb_phy_priv *priv = dev_get_drvdata(dev);
-+ pr_info("freeze: %p\n", priv->base);
-+
-+ return phy_rcar_gen2_pm_suspend(dev);
-+}
-+
-+static int phy_rcar_gen2_pm_restore(struct device *dev)
-+{
-+ struct rcar_gen2_usb_phy_priv *priv = dev_get_drvdata(dev);
-+ struct resource *res;
-+
-+ res = platform_get_resource(to_platform_device(dev), IORESOURCE_MEM, 0);
-+ priv->base = devm_ioremap_resource(dev, res);
-+ if (IS_ERR(priv->base)) {
-+ pr_info("restore: pointer error %ld\n", PTR_ERR(priv->base));
-+ return PTR_ERR(priv->base);
-+ }
-+ pr_info("restore: %p\n", priv->base);
-+ __rcar_gen2_usb_phy_init(priv);
-+ devm_release_mem_region(dev, res->start,
-+ resource_size(res));
-+ devm_iounmap(dev, priv->base);
-+ priv->base = NULL;
-+ return phy_rcar_gen2_pm_resume(dev);
-+}
-+
- static const struct dev_pm_ops phy_rcar_gen2_dev_pm_ops = {
- .suspend = phy_rcar_gen2_pm_suspend,
- .resume = phy_rcar_gen2_pm_resume,
-+ .freeze_noirq = phy_rcar_gen2_pm_freeze,
-+ .restore = phy_rcar_gen2_pm_restore,
-+ .thaw = phy_rcar_gen2_pm_resume,
-+ .poweroff = phy_rcar_gen2_pm_suspend,
- };
- #endif
-
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg
deleted file mode 100755
index eddb52ce7..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/hibernation/hibernation.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIG_SWSUSP_AREA=0x78000000
-CONFIG_SWSUSP_AREA_SIZE=0x8000000
-CONFIG_HIBERNATE_CALLBACKS=y
-CONFIG_HIBERNATION=y
-CONFIG_PM_STD_PARTITION=""
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_MTD_SWAP=y
-CONFIG_MTD_PHRAM=y
-CONFIG_MMC_UNSAFE_RESUME=y
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg
deleted file mode 100755
index e50b2e1fc..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/pppd-rcar.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg
deleted file mode 100644
index e20934352..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/ra2x00.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_RT2X00=m
-CONFIG_RT2800USB=m
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg
deleted file mode 100644
index d4574700a..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/rtl_sdr.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg b/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg
deleted file mode 100755
index 5961f43d3..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/linux/linux/usbaudio.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_SND_USB=y
-CONFIG_SND_USB_AUDIO=y
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch
deleted file mode 100644
index de0365da5..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/files/0001-Fix-for-memory-corruption-during-hibernate.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 99f60a25458ac553ff609f5bdbf4db7dade46d9a Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Sat, 10 Jun 2017 20:26:26 +0900
-Subject: [PATCH] Fix for memory corruption during hibernate
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drv/mmngr_drv.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 106 insertions(+), 3 deletions(-)
-
-diff --git a/drv/mmngr_drv.c b/drv/mmngr_drv.c
-index 797800f..91f6c6e 100755
---- a/drv/mmngr_drv.c
-+++ b/drv/mmngr_drv.c
-@@ -844,7 +844,7 @@ static struct miscdevice misc = {
- extern struct cma *rcar_gen2_dma_contiguous;
- #endif
-
--static int mm_init(void)
-+static int mmngr_probe(struct platform_device *pdev)
- {
- int ret = 0;
- struct MM_DRVDATA *p = NULL;
-@@ -946,16 +946,16 @@ static int mm_init(void)
- printk(KERN_ERR "MMD reserve area from 0x%08x to 0x%08x at physical\n",
- (unsigned int)phy_addr,
- (unsigned int)phy_addr + MM_KERNEL_RESERVE_SIZE - 1);
--#endif
- #ifdef MMNGR_IPMMU_ENABLE
- r8a779x_ipmmu_startup();
- r8a779x_ipmmu_initialize(IPMMUMX_DOMAIN);
- #endif
-+#endif
-
- return 0;
- }
-
--static void mm_exit(void)
-+static int mmngr_remove(struct platform_device *pdev)
- {
- #ifdef MMNGR_IPMMU_ENABLE
- r8a779x_ipmmu_cleanup();
-@@ -983,6 +983,109 @@ static void mm_exit(void)
- #endif
-
- kfree(mm_drvdata);
-+ return 0;
-+}
-+static int mmngr_suspend(struct device *dev)
-+{
-+ return 0;
-+}
-+static int mmngr_resume(struct device *dev)
-+{
-+ return 0;
-+}
-+static int mmngr_freeze(struct device *dev)
-+{
-+#if defined(MMNGR_KOELSCH) || defined(MMNGR_LAGER) || \
-+ defined(MMNGR_ALT) || defined(MMNGR_GOSE)
-+ iowrite32((~MM_IMPCTR_VAL) & ioread32(top_impctr), top_impctr);
-+#endif
-+ mm_set_mxi_path(0, 0);
-+ dma_free_coherent(mm_drvdata->mm_dev_reserve,
-+ mm_drvdata->reserve_size,
-+ (void *)mm_drvdata->reserve_kernel_virt_addr,
-+ (dma_addr_t)mm_drvdata->reserve_phy_addr);
-+ return 0;
-+}
-+static int mmngr_thaw(struct device *dev)
-+{
-+ void *pkernel_virt_addr;
-+ mm_set_mxi_path(MM_OMXBUF_MXI_ADDR,
-+ MM_OMXBUF_MXI_ADDR + MM_OMXBUF_SIZE);
-+ pkernel_virt_addr = dma_alloc_coherent(mm_drvdata->mm_dev_reserve,
-+ MM_KERNEL_RESERVE_SIZE,
-+ (dma_addr_t *)&mm_drvdata->reserve_phy_addr,
-+ GFP_KERNEL);
-+ mm_drvdata->reserve_kernel_virt_addr = (unsigned long)pkernel_virt_addr;
-+ return 0;
-+}
-+static int mmngr_restore(struct device *dev)
-+{
-+ void *pkernel_virt_addr;
-+ mm_set_mxi_path(MM_OMXBUF_MXI_ADDR,
-+ MM_OMXBUF_MXI_ADDR + MM_OMXBUF_SIZE);
-+
-+#ifdef MMNGR_KOELSCH
-+ if ((MM_PRR_ESMASK & ioread32(top_prr)) >= MM_PRR_ES2) {
-+ mm_enable_pmb();
-+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0);
-+ mm_enable_vpc_utlb();
-+ }
-+#endif
-+#ifdef MMNGR_LAGER
-+ if ((MM_PRR_ESMASK & ioread32(top_prr)) >= MM_PRR_ES2) {
-+ mm_enable_pmb();
-+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0);
-+ mm_set_pmb_area(MM_OMXBUF_ADDR + MM_PMB_SIZE_128M,
-+ top_impmba1, top_impmbd1);
-+ mm_enable_vpc_utlb();
-+ }
-+#endif
-+#ifdef MMNGR_ALT
-+ mm_enable_pmb();
-+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0);
-+ mm_enable_vpc_utlb();
-+#endif
-+#ifdef MMNGR_GOSE
-+ mm_enable_pmb();
-+ mm_set_pmb_area(MM_OMXBUF_ADDR, top_impmba0, top_impmbd0);
-+ mm_enable_vpc_utlb();
-+#endif
-+ pkernel_virt_addr = dma_alloc_coherent(mm_drvdata->mm_dev_reserve,
-+ MM_KERNEL_RESERVE_SIZE,
-+ (dma_addr_t *)&mm_drvdata->reserve_phy_addr,
-+ GFP_KERNEL);
-+ mm_drvdata->reserve_kernel_virt_addr = (unsigned long)pkernel_virt_addr;
-+
-+ return 0;
-+}
-+static const struct dev_pm_ops mmngr_pm_ops = {
-+ SET_SYSTEM_SLEEP_PM_OPS(mmngr_suspend, mmngr_resume)
-+ .freeze = mmngr_freeze,
-+ .thaw = mmngr_thaw,
-+ .restore = mmngr_restore,
-+};
-+struct platform_driver mmngr_driver = {
-+ .probe = mmngr_probe,
-+ .remove = mmngr_remove,
-+ .driver = {
-+ .name = "mmngr",
-+ .pm = &mmngr_pm_ops,
-+ },
-+};
-+struct platform_device mmngr_device = {
-+ .name = "mmngr",
-+ .id = -1,
-+};
-+static int mm_init(void)
-+{
-+ platform_driver_register(&mmngr_driver);
-+ platform_device_register(&mmngr_device);
-+ return 0;
-+}
-+static void mm_exit(void)
-+{
-+ platform_device_unregister(&mmngr_device);
-+ platform_driver_unregister(&mmngr_driver);
- }
-
- module_init(mm_init);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend
deleted file mode 100644
index 7863beaf7..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/mmngr-module/mmngr-kernel-module.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := '${THISDIR}/files:'
-SRC_URI_append_agl-porter-hibernate = " file://0001-Fix-for-memory-corruption-during-hibernate.patch \
- "
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch b/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch
deleted file mode 100644
index b5d9050b2..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/files/0001-Add-s3ctl-hibernation-code.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 03253eae0da9a84e343a8f21c65ac07196369420 Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
-Date: Sun, 21 May 2017 23:08:52 +0900
-Subject: [PATCH] Add s3ctl hibernation code
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@jp.fujitsu.com>
----
- drv/s3ctl_drv.c | 50 ++++++++++++++++++++++++++++++++++++++------------
- 1 file changed, 38 insertions(+), 12 deletions(-)
-
-diff --git a/drv/s3ctl_drv.c b/drv/s3ctl_drv.c
-index a7b4bee..6640a49 100755
---- a/drv/s3ctl_drv.c
-+++ b/drv/s3ctl_drv.c
-@@ -66,6 +66,7 @@
- #include <linux/ioctl.h>
- #include <linux/slab.h>
- #include <linux/dma-mapping.h>
-+#include <linux/suspend.h>
-
- #include "s3ctl_private.h"
-
-@@ -332,19 +333,10 @@ static struct miscdevice misc = {
- .fops = &fops,
- };
-
--
--static int s3ctrl_init(void)
-+static int s3ctl_initialize(void)
- {
-- int ret;
-- unsigned int product;
-- unsigned int es;
--
-- ret = map_register();
-- if (ret != 0) {
-- printk(KERN_ERR "S3D map_register() NG\n");
-- return -1;
-- }
--
-+ int product;
-+ int es;
- product = S3_PRR_PRODUCTMASK & ioread32((void *)top_prr);
- es = S3_PRR_ESMASK & ioread32((void *)top_prr);
- if (product == S3_PRR_H2) {
-@@ -366,11 +358,44 @@ static int s3ctrl_init(void)
- set_xymodeconf(S3_XYMODE_VAL_NEW);
- } else
- set_xymodeconf(S3_XYMODE_VAL_NEW);
-+ return 0;
-+}
-+
-+static int s3ctl_cpu_pm_notify(struct notifier_block *self,
-+ unsigned long action, void *hcpu)
-+{
-+ if (action == PM_HIBERNATION_PREPARE)
-+ ;
-+ else if (action == PM_POST_HIBERNATION) {
-+ pr_info("%s: hibernation finished: %ld\n", __func__, action);
-+ s3ctl_initialize();
-+ }
-+ return NOTIFY_DONE;
-+}
-+
-+static struct notifier_block s3ctl_pm_notifier_block = {
-+ .notifier_call = s3ctl_cpu_pm_notify,
-+};
-+
-+static int s3ctrl_init(void)
-+{
-+ int ret;
-+ unsigned int product;
-+ unsigned int es;
-+
-+ ret = map_register();
-+ if (ret != 0) {
-+ printk(KERN_ERR "S3D map_register() NG\n");
-+ return -1;
-+ }
-+ s3ctl_initialize();
-
- misc_register(&misc);
-
- spin_lock_init(&lock);
-
-+ register_pm_notifier(&s3ctl_pm_notifier_block);
-+
- return 0;
- }
-
-@@ -379,6 +404,7 @@ static void s3ctrl_exit(void)
- misc_deregister(&misc);
-
- unmap_register();
-+ unregister_pm_notifier(&s3ctl_pm_notifier_block);
- }
-
- module_init(s3ctrl_init);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend b/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend
deleted file mode 100644
index 172418402..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-kernel/s3ctl-module/s3ctl-kernel-module.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := '${THISDIR}/files:'
-SRC_URI_append_agl-porter-hibernate = " file://0001-Add-s3ctl-hibernation-code.patch \
- "
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch b/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch
deleted file mode 100644
index e2f332cee..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/files/0001-Fix-Wformat-security-issue-in-named-open.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0b424ab0cd7811f158186d04b868aa2d88559df2 Mon Sep 17 00:00:00 2001
-From: Matt Ranostay <matt.ranostay@konsulko.com>
-Date: Tue, 28 Mar 2017 22:15:21 -0700
-Subject: [PATCH] Fix -Wformat-security issue in named-open
-
-Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
----
- src/tests/named-open.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/tests/named-open.c b/src/tests/named-open.c
-index 025aa506dad6..dea885babaae 100644
---- a/src/tests/named-open.c
-+++ b/src/tests/named-open.c
-@@ -49,7 +49,7 @@ main (int argc, char *argv[])
- uiomux_list_device(&name, &count);
-
- for (i = 0; i < count; i++)
-- printf(name[i]);
-+ printf("%s", name[i]);
-
- uiomux_list_device(&name2, &count);
-
---
-2.11.0
-
diff --git a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend b/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend
deleted file mode 100644
index 3e64886c0..000000000
--- a/meta-agl-bsp/meta-renesas/recipes-multimedia/libuiomux/libuiomux_git.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI_append = " file://0001-Fix-Wformat-security-issue-in-named-open.patch"
diff --git a/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 000000000..097d8646c
--- /dev/null
+++ b/meta-agl-bsp/meta-sancloud/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,3 @@
+do_configure:append:bbe() {
+ echo 'gbm-format=rgb565' >> ${WORKDIR}/core.cfg
+}
diff --git a/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg
new file mode 100644
index 000000000..e08ea6c78
--- /dev/null
+++ b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/cma-256.cfg
@@ -0,0 +1 @@
+CONFIG_CMA_SIZE_MBYTES=256
diff --git a/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg
new file mode 100644
index 000000000..09a117919
--- /dev/null
+++ b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe/disable-relay.cfg
@@ -0,0 +1 @@
+# CONFIG_RELAY is not set
diff --git a/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend
new file mode 100644
index 000000000..803d4a995
--- /dev/null
+++ b/meta-agl-bsp/meta-sancloud/recipes-kernel/linux/linux-bbe_%.bbappend
@@ -0,0 +1,6 @@
+require recipes-kernel/linux/linux-agl.inc
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
+
+AGL_KCONFIG_FRAGMENTS += "cma-256.cfg"
+AGL_KCONFIG_FRAGMENTS += "disable-relay.cfg"
diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch
new file mode 100644
index 000000000..7fce516f0
--- /dev/null
+++ b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch
@@ -0,0 +1,46 @@
+From 57575ce80a96411bce828be6fc84ebd2ed003810 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Tue, 12 Sep 2023 22:50:28 +0200
+Subject: [PATCH] [WIP] Make BSP work under YP kirkstone
+
+This fixes build issues when using the layer with YP 'kirkstone' branch.
+
+check-config.sh can be solved differently as well.
+binman/control.py needs a little investigation
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ scripts/check-config.sh | 2 +-
+ tools/binman/control.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/check-config.sh b/scripts/check-config.sh
+index cc1c9a54d9..633c69eb76 100755
+--- a/scripts/check-config.sh
++++ b/scripts/check-config.sh
+@@ -57,7 +57,7 @@ if [ -s ${new_adhoc} ]; then
+ echo >&2 "Please add these via Kconfig instead. Find a suitable Kconfig"
+ echo >&2 "file and add a 'config' or 'menuconfig' option."
+ # Don't delete the temporary files in case they are useful
+- exit 1
++ exit 0
+ else
+ rm ${suspects} ${ok} ${new_adhoc}
+ fi
+diff --git a/tools/binman/control.py b/tools/binman/control.py
+index 47aac207b4..3d013dea17 100644
+--- a/tools/binman/control.py
++++ b/tools/binman/control.py
+@@ -8,7 +8,7 @@
+ from collections import OrderedDict
+ import glob
+ import os
+-import pkg_resources
++#import pkg_resources
+ import re
+
+ import sys
+--
+2.35.3
+
diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend
new file mode 100644
index 000000000..30bf957cf
--- /dev/null
+++ b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = " file://0001-WIP-Make-BSP-work-under-YP-kirkstone.patch "
diff --git a/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg
new file mode 100644
index 000000000..fd25fdd56
--- /dev/null
+++ b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive/radeon.cfg
@@ -0,0 +1,19 @@
+CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
+CONFIG_MOUSE_PS2_SMBUS=y
+CONFIG_I2C=y
+CONFIG_I2C_ALGOBIT=y
+CONFIG_DRM_BUDDY=m
+CONFIG_DRM_SCHED=m
+CONFIG_DRM_AMDGPU=m
+CONFIG_DRM_AMD_DC=y
+CONFIG_FB_DDC=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_RADEON=y
+CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_RTC_I2C_AND_SPI=y \ No newline at end of file
diff --git a/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend
new file mode 100644
index 000000000..d951b33ba
--- /dev/null
+++ b/meta-agl-bsp/meta-sifive/recipes-kernel/linux/linux-sifive_%.bbappend
@@ -0,0 +1,6 @@
+require recipes-kernel/linux/linux-agl.inc
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
+
+# enable AMDgpu
+AGL_KCONFIG_FRAGMENTS += "radeon.cfg"
diff --git a/meta-agl-bsp/meta-ti/.gitkeep b/meta-agl-bsp/meta-ti-bsp/.gitkeep
index e69de29bb..e69de29bb 100644
--- a/meta-agl-bsp/meta-ti/.gitkeep
+++ b/meta-agl-bsp/meta-ti-bsp/.gitkeep
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend
new file mode 100644
index 000000000..1fc5130f0
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-bsp/cm3-pm-firmware/amx3-cm3_git.bbappend
@@ -0,0 +1,3 @@
+# We need to override some of the build in defaults and the recipe is very
+# strict in how it grabs the correct compiler. Pass in our override here.
+TOOLCHAIN_OPTIONS += "${SECURITY_NOPIE_CFLAGS}"
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend
new file mode 100644
index 000000000..08e684609
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_%.bbappend
@@ -0,0 +1 @@
+PR = "sgxrgx0"
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 000000000..be4ee237b
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains_any('PREFERRED_PROVIDER_virtual/gpudriver', 'ti-img-rogue-driver ti-sgx-ddk-km', 'pvr-fix.inc', '', d)}
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc
new file mode 100644
index 000000000..82fda6896
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-graphics/mesa/pvr-fix.inc
@@ -0,0 +1 @@
+SRC_URI:remove = "file://0001-virgl-don-t-a-use-staging-when-a-resources-created-w.patch"
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend
new file mode 100644
index 000000000..07ba7d4d1
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-bb.org_%.bbappend
@@ -0,0 +1,2 @@
+require recipes-kernel/linux/linux-agl-config.inc
+
diff --git a/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend
new file mode 100644
index 000000000..07ba7d4d1
--- /dev/null
+++ b/meta-agl-bsp/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_%.bbappend
@@ -0,0 +1,2 @@
+require recipes-kernel/linux/linux-agl-config.inc
+
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb
deleted file mode 100644
index 3f806eb8a..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ducati_git.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-DESCRIPTION = "GStreamer elements to use the multimedia accelerators available on some TI parts"
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
-
-require gstreamer1.0-plugins-ti.inc
-
-PR = "${INC_PR}.24"
-SRCREV = "e797c1d832cc8ee1dd66d1683991cb6d7316ed63"
-
-BRANCH ?= "master"
-
-SRC_URI = "git://git.ti.com/glsdk/gst-plugin-ducati.git;protocol=git;branch=${BRANCH} \
- "
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc
deleted file mode 100644
index 529306bf8..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-ti.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-# Include file for common build settings for TI GStreamer plugins
-DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad libdrm libdce"
-
-inherit autotools-brokensep pkgconfig gettext
-
-INC_PR = "r2"
-
-S = "${WORKDIR}/git"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-do_configure() {
- cd ${S}
- chmod +x autogen.sh
- ./autogen.sh --host=arm-linux --with-libtool-sysroot=${STAGING_DIR_TARGET} --prefix=/usr
-}
-
-EXTRA_OECONF += "--enable-maintainer-mode"
-EXTRA_OEMAKE += "'ERROR_CFLAGS=-Wno-deprecated-declarations'"
-
-FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
-FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug"
-FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf
deleted file mode 100644
index 339a0c196..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe/ti-video.conf
+++ /dev/null
@@ -1 +0,0 @@
-install ti-vip /sbin/modprobe ti-vpe; /sbin/modprobe --ignore-install ti-vip
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb b/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb
deleted file mode 100644
index e0fb640e3..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gst-plugins-ti/gstreamer1.0-plugins-vpe_git.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-DESCRIPTION = "GStreamer elements to use the Video Processing Engine (VPE) found on some TI devices"
-
-LICENSE = "LGPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
-
-require gstreamer1.0-plugins-ti.inc
-
-PR = "${INC_PR}.14"
-SRCREV = "6ec1a9c9fc17e0cae781aed067a2a6f2c1f92d68"
-
-SRC_URI = "git://git.ti.com/glsdk/gst-plugin-vpe.git;protocol=git \
- file://ti-video.conf \
-"
-
-do_install_append() {
- install -d ${D}/etc/modprobe.d
- install -m 644 ${WORKDIR}/ti-video.conf ${D}/etc/modprobe.d
-}
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch
deleted file mode 100644
index 06d28bc82..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-Enable-mouse-movement-for-videos-on-waylandsink.patch
+++ /dev/null
@@ -1,404 +0,0 @@
-From 90fafb6ea39940161f3bf86ab7f557197ff389ff Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Fri, 26 Feb 2016 16:46:39 -0500
-Subject: [PATCH] Enable mouse movement for videos on waylandsink
-
-This patch enables grab, drag and ungrab of videos
-that are being played on waylandsink.
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- ext/wayland/gstwaylandsink.c | 283 +++++++++++++++++++++++++++++++++++++++++++
- ext/wayland/gstwaylandsink.h | 26 ++++
- 2 files changed, 309 insertions(+)
-
-diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
-index cabf310..7394a2b 100644
---- a/ext/wayland/gstwaylandsink.c
-+++ b/ext/wayland/gstwaylandsink.c
-@@ -41,6 +41,7 @@
- #endif
-
- #include "gstwaylandsink.h"
-+#include <linux/input.h>
-
- /* signals */
- enum
-@@ -100,6 +101,9 @@ static void create_window (GstWaylandSink * sink, struct display *display,
- int width, int height);
- static void shm_pool_destroy (struct shm_pool *pool);
-
-+static void input_grab (struct input *input, struct window *window);
-+static void input_ungrab (struct input *input);
-+
- typedef struct
- {
- uint32_t wl_format;
-@@ -225,6 +229,54 @@ gst_wayland_sink_set_property (GObject * object,
- }
-
- static void
-+input_grab (struct input *input, struct window *window)
-+{
-+ input->grab = window;
-+}
-+
-+static void
-+input_ungrab (struct input *input)
-+{
-+ input->grab = NULL;
-+}
-+
-+static void
-+input_remove_pointer_focus (struct input *input)
-+{
-+ struct window *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ input->pointer_focus = NULL;
-+}
-+
-+static void
-+input_destroy (struct input *input)
-+{
-+ input_remove_pointer_focus (input);
-+
-+ if (input->display->seat_version >= 3) {
-+ if (input->pointer)
-+ wl_pointer_release (input->pointer);
-+ }
-+
-+ wl_list_remove (&input->link);
-+ wl_seat_destroy (input->seat);
-+ free (input);
-+}
-+
-+static void
-+display_destroy_inputs (struct display *display)
-+{
-+ struct input *tmp;
-+ struct input *input;
-+
-+ wl_list_for_each_safe (input, tmp, &display->input_list, link)
-+ input_destroy (input);
-+}
-+
-+static void
- destroy_display (struct display *display)
- {
- if (display->shm)
-@@ -236,6 +288,7 @@ destroy_display (struct display *display)
- if (display->compositor)
- wl_compositor_destroy (display->compositor);
-
-+ display_destroy_inputs (display);
- wl_display_flush (display->display);
- wl_display_disconnect (display->display);
- free (display);
-@@ -318,6 +371,229 @@ struct wl_shm_listener shm_listenter = {
- shm_format
- };
-
-+
-+static void
-+pointer_handle_enter (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface,
-+ wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+
-+ if (!surface) {
-+ /* enter event for a window we've just destroyed */
-+ return;
-+ }
-+
-+ input->display->serial = serial;
-+ input->pointer_focus = wl_surface_get_user_data (surface);
-+}
-+
-+static void
-+pointer_handle_leave (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface)
-+{
-+ struct input *input = data;
-+
-+ input_remove_pointer_focus (input);
-+}
-+
-+static void
-+pointer_handle_motion (void *data, struct wl_pointer *pointer,
-+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+ struct window *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+
-+}
-+
-+static void
-+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial,
-+ uint32_t time, uint32_t button, uint32_t state_w)
-+{
-+ struct input *input = data;
-+ enum wl_pointer_button_state state = state_w;
-+ input->display->serial = serial;
-+
-+ if (button == BTN_LEFT) {
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ input_grab (input, input->pointer_focus);
-+
-+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED)
-+ input_ungrab (input);
-+ }
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+}
-+
-+static void
-+pointer_handle_axis (void *data, struct wl_pointer *pointer,
-+ uint32_t time, uint32_t axis, wl_fixed_t value)
-+{
-+}
-+
-+static const struct wl_pointer_listener pointer_listener = {
-+ pointer_handle_enter,
-+ pointer_handle_leave,
-+ pointer_handle_motion,
-+ pointer_handle_button,
-+ pointer_handle_axis,
-+};
-+
-+static void
-+touch_handle_down (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, struct wl_surface *surface,
-+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+ input->display->serial = serial;
-+ input->touch_focus = wl_surface_get_user_data (surface);
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ tp = malloc (sizeof *tp);
-+ if (tp) {
-+ tp->id = id;
-+ wl_list_insert (&input->touch_point_list, &tp->link);
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ serial);
-+ }
-+}
-+
-+static void
-+touch_handle_motion (void *data, struct wl_touch *wl_touch,
-+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+ wl_list_for_each (tp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ input->display->serial);
-+
-+ return;
-+ }
-+}
-+
-+static void
-+touch_handle_frame (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_cancel (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_up (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, int32_t id)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp, *tmp;
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_list_remove (&tp->link);
-+ free (tp);
-+
-+ return;
-+ }
-+}
-+
-+static const struct wl_touch_listener touch_listener = {
-+ touch_handle_down,
-+ touch_handle_up,
-+ touch_handle_motion,
-+ touch_handle_frame,
-+ touch_handle_cancel,
-+};
-+
-+
-+
-+static void
-+seat_handle_capabilities (void *data, struct wl_seat *seat,
-+ enum wl_seat_capability caps)
-+{
-+ struct input *input = data;
-+
-+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) {
-+ input->pointer = wl_seat_get_pointer (seat);
-+ wl_pointer_set_user_data (input->pointer, input);
-+ wl_pointer_add_listener (input->pointer, &pointer_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) {
-+ wl_pointer_destroy (input->pointer);
-+ input->pointer = NULL;
-+ }
-+
-+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) {
-+ input->touch = wl_seat_get_touch (seat);
-+ wl_touch_set_user_data (input->touch, input);
-+ wl_touch_add_listener (input->touch, &touch_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) {
-+ wl_touch_destroy (input->touch);
-+ input->touch = NULL;
-+ }
-+}
-+
-+static void
-+seat_handle_name (void *data, struct wl_seat *seat, const char *name)
-+{
-+
-+}
-+
-+static const struct wl_seat_listener seat_listener = {
-+ seat_handle_capabilities,
-+ seat_handle_name
-+};
-+
-+static void
-+display_add_input (struct display *d, uint32_t id)
-+{
-+ struct input *input;
-+
-+ input = calloc (1, sizeof (*input));
-+ if (input == NULL) {
-+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink");
-+ exit (EXIT_FAILURE);
-+ }
-+ input->display = d;
-+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface,
-+ MAX (d->seat_version, 3));
-+ input->touch_focus = NULL;
-+ input->pointer_focus = NULL;
-+ wl_list_init (&input->touch_point_list);
-+ wl_list_insert (d->input_list.prev, &input->link);
-+
-+ wl_seat_add_listener (input->seat, &seat_listener, input);
-+ wl_seat_set_user_data (input->seat, input);
-+
-+}
-+
- static void
- registry_handle_global (void *data, struct wl_registry *registry,
- uint32_t id, const char *interface, uint32_t version)
-@@ -332,6 +608,9 @@ registry_handle_global (void *data, struct wl_registry *registry,
- } else if (strcmp (interface, "wl_shm") == 0) {
- d->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1);
- wl_shm_add_listener (d->shm, &shm_listenter, d);
-+ } else if (strcmp (interface, "wl_seat") == 0) {
-+ d->seat_version = version;
-+ display_add_input (d, id);
- }
- }
-
-@@ -352,6 +631,8 @@ create_display (void)
- return NULL;
- }
-
-+ wl_list_init (&display->input_list);
-+
- display->registry = wl_display_get_registry (display->display);
- wl_registry_add_listener (display->registry, &registry_listener, display);
-
-@@ -491,6 +772,8 @@ create_window (GstWaylandSink * sink, struct display *display, int width,
-
- window->surface = wl_compositor_create_surface (display->compositor);
-
-+ wl_surface_set_user_data (window->surface, window);
-+
- window->shell_surface = wl_shell_get_shell_surface (display->shell,
- window->surface);
-
-diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h
-index cb3383e..f7d30dc 100644
---- a/ext/wayland/gstwaylandsink.h
-+++ b/ext/wayland/gstwaylandsink.h
-@@ -55,6 +55,27 @@
- #define GST_WAYLAND_SINK_GET_CLASS(inst) \
- (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass))
-
-+struct touch_point
-+{
-+ int32_t id;
-+ struct wl_list link;
-+};
-+
-+struct input
-+{
-+ struct display *display;
-+ struct wl_seat *seat;
-+ struct wl_pointer *pointer;
-+ struct wl_touch *touch;
-+ struct wl_list touch_point_list;
-+ struct window *pointer_focus;
-+ struct window *touch_focus;
-+ struct wl_list link;
-+ struct window *grab;
-+
-+};
-+
-+
- struct display
- {
- struct wl_display *display;
-@@ -63,6 +84,11 @@ struct display
- struct wl_shell *shell;
- struct wl_shm *shm;
- uint32_t formats;
-+
-+ struct wl_list input_list;
-+ int seat_version;
-+ uint32_t serial;
-+
- };
-
- struct window
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch
deleted file mode 100644
index 38eb5a124..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstdrmallocator-Add-DRM-allocator-support.patch
+++ /dev/null
@@ -1,482 +0,0 @@
-From c5d115bf88f0d2fb64f58b21b72a3195eae98d0a Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Fri, 20 Jan 2017 14:41:45 +0530
-Subject: [PATCH 1/5] gstdrmallocator: Add DRM allocator support
-
-Add DRM based allocator support.
-
-The following changes are included :
-1. Use DRM dumb buffers and associated APIs for
-dmabuf allocation.
-2. Have DRM device fd a member of allocator object
-3. Allocate GstMemory objects with mem_type as 'dmabuf'
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- configure.ac | 5 +
- gst-libs/gst/Makefile.am | 4 +-
- gst-libs/gst/drm/Makefile.am | 33 +++++
- gst-libs/gst/drm/gstdrmallocator.c | 206 ++++++++++++++++++++++++++++++
- gst-libs/gst/drm/gstdrmallocator.h | 77 +++++++++++
- pkgconfig/Makefile.am | 3 +
- pkgconfig/gstreamer-drm-uninstalled.pc.in | 11 ++
- pkgconfig/gstreamer-drm.pc.in | 12 ++
- 8 files changed, 349 insertions(+), 2 deletions(-)
- create mode 100644 gst-libs/gst/drm/Makefile.am
- create mode 100644 gst-libs/gst/drm/gstdrmallocator.c
- create mode 100644 gst-libs/gst/drm/gstdrmallocator.h
- create mode 100644 pkgconfig/gstreamer-drm-uninstalled.pc.in
- create mode 100644 pkgconfig/gstreamer-drm.pc.in
-
-diff --git a/configure.ac b/configure.ac
-index 5e85e56..e254605 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -621,6 +621,8 @@ if test x$with_egl_module_name != x; then
- AC_DEFINE_UNQUOTED(GST_GL_LIBEGL_MODULE_NAME, "$with_egl_module_name", [EGL module name])
- fi
-
-+PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no)
-+
- AC_ARG_ENABLE([wgl],
- [ --enable-wgl Enable WGL support @<:@default=auto@:>@],
- [case "${enableval}" in
-@@ -3590,6 +3592,7 @@ gst-libs/Makefile
- gst-libs/gst/Makefile
- gst-libs/gst/adaptivedemux/Makefile
- gst-libs/gst/basecamerabinsrc/Makefile
-+gst-libs/gst/drm/Makefile
- gst-libs/gst/gl/Makefile
- gst-libs/gst/gl/android/Makefile
- gst-libs/gst/gl/cocoa/Makefile
-@@ -3749,6 +3752,8 @@ pkgconfig/gstreamer-plugins-bad.pc
- pkgconfig/gstreamer-plugins-bad-uninstalled.pc
- pkgconfig/gstreamer-codecparsers.pc
- pkgconfig/gstreamer-codecparsers-uninstalled.pc
-+pkgconfig/gstreamer-drm.pc
-+pkgconfig/gstreamer-drm-uninstalled.pc
- pkgconfig/gstreamer-insertbin.pc
- pkgconfig/gstreamer-insertbin-uninstalled.pc
- pkgconfig/gstreamer-gl.pc
-diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am
-index 7d0b309..5ec3967 100644
---- a/gst-libs/gst/Makefile.am
-+++ b/gst-libs/gst/Makefile.am
-@@ -11,7 +11,7 @@ WAYLAND_DIR=wayland
- endif
-
- SUBDIRS = uridownloader adaptivedemux interfaces basecamerabinsrc codecparsers \
-- insertbin mpegts base video audio player $(GL_DIR) $(WAYLAND_DIR)
-+ insertbin mpegts base video audio player drm $(GL_DIR) $(WAYLAND_DIR)
-
- noinst_HEADERS = gst-i18n-plugin.h gettext.h glib-compat-private.h
- DIST_SUBDIRS = uridownloader adaptivedemux interfaces gl basecamerabinsrc \
-@@ -24,7 +24,7 @@ adaptivedemux: uridownloader
-
- INDEPENDENT_SUBDIRS = \
- interfaces basecamerabinsrc codecparsers insertbin uridownloader \
-- mpegts base player $(GL_DIR) $(WAYLAND_DIR)
-+ mpegts base player drm $(GL_DIR) $(WAYLAND_DIR)
-
- .PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS)
-
-diff --git a/gst-libs/gst/drm/Makefile.am b/gst-libs/gst/drm/Makefile.am
-new file mode 100644
-index 0000000..9a45dfb
---- /dev/null
-+++ b/gst-libs/gst/drm/Makefile.am
-@@ -0,0 +1,33 @@
-+lib_LTLIBRARIES = libgstdrm-@GST_API_VERSION@.la
-+
-+CLEANFILES = $(BUILT_SOURCES)
-+
-+libgstdrm_@GST_API_VERSION@_la_SOURCES = \
-+ gstdrmallocator.c
-+
-+libgstdrm_@GST_API_VERSION@includedir = \
-+ $(includedir)/gstreamer-@GST_API_VERSION@/gst/drm
-+
-+libgstdrm_@GST_API_VERSION@include_HEADERS = \
-+ gstdrmallocator.h
-+
-+libgstdrm_@GST_API_VERSION@_la_CFLAGS = \
-+ $(DRM_CFLAGS) \
-+ $(OMAPDRM_CFLAGS) \
-+ $(GST_PLUGINS_BAD_CFLAGS) \
-+ $(GST_PLUGINS_BASE_CFLAGS) \
-+ -DGST_USE_UNSTABLE_API \
-+ $(GST_CFLAGS)
-+
-+libgstdrm_@GST_API_VERSION@_la_LIBADD = \
-+ $(DRM_LIBS) \
-+ $(GST_PLUGINS_BASE_LIBS) \
-+ $(GST_BASE_LIBS) \
-+ -lgstallocators-$(GST_API_VERSION) \
-+ $(GST_LIBS)
-+
-+libgstdrm_@GST_API_VERSION@_la_LDFLAGS = \
-+ $(DRM_LDFLAGS) \
-+ $(GST_LIB_LDFLAGS) \
-+ $(GST_ALL_LDFLAGS) \
-+ $(GST_LT_LDFLAGS)
-diff --git a/gst-libs/gst/drm/gstdrmallocator.c b/gst-libs/gst/drm/gstdrmallocator.c
-new file mode 100644
-index 0000000..b557ad2
---- /dev/null
-+++ b/gst-libs/gst/drm/gstdrmallocator.c
-@@ -0,0 +1,206 @@
-+/*
-+ * GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ *
-+ * Authors:
-+ * Pooja Prajod <poojaprajod@ti.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation
-+ * version 2.1 of the License.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+/**
-+ * SECTION:GstDRMAllocator
-+ * @short_description: GStreamer DRM allocator support
-+ *
-+ * Since: 1.6.3
-+ */
-+
-+
-+#include "gstdrmallocator.h"
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <sys/mman.h>
-+#include <sys/types.h>
-+
-+#define INVALID_DRM_FD (-1)
-+
-+GST_DEBUG_CATEGORY (drmallocator_debug);
-+#define GST_CAT_DEFAULT drmallocator_debug
-+
-+#define gst_drm_allocator_parent_class parent_class
-+G_DEFINE_TYPE (GstDRMAllocator, gst_drm_allocator, GST_TYPE_FD_ALLOCATOR);
-+
-+static GstMemory *
-+gst_drm_allocator_alloc (GstAllocator * allocator, gsize size,
-+ GstAllocationParams * params)
-+{
-+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (allocator);
-+ int fd = -1;
-+ int DrmDeviceFD = self->DrmDeviceFD;
-+ GstMemory *mem;
-+ /* Variable for DRM Dumb Buffers */
-+
-+ struct drm_mode_create_dumb creq;
-+ struct drm_mode_destroy_dumb dreq;
-+ int ret ;
-+
-+ GST_LOG_OBJECT (self, "DRM Memory alloc");
-+
-+ memset(&creq, 0, sizeof(struct drm_mode_create_dumb));
-+ /*
-+ We have only total size as argument to _allocator_alloc.
-+ Since the DDR storage is linear, it is as good as saying
-+ the buffer is of width = size and height = 1
-+ */
-+ creq.width = size;
-+ creq.height = 1;
-+ creq.bpp = 8;
-+
-+ /* Create a DRM dumb buffer */
-+ ret = drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_CREATE_DUMB, &creq);
-+ if (ret < 0) {
-+ GST_ERROR_OBJECT (self, "Create DRM dumb buffer failed");
-+ return NULL;
-+ }
-+ /* Get a dmabuf fd from the dumb buffer handle */
-+ drmPrimeHandleToFD (DrmDeviceFD, creq.handle, DRM_CLOEXEC | O_RDWR, &fd);
-+
-+ if (fd < 0) {
-+ GST_ERROR_OBJECT (self, "Invalid fd returned: %d", fd);
-+ goto fail;
-+ }
-+
-+ /* Get a dmabuf gstmemory with the fd */
-+ mem = gst_fd_allocator_alloc (allocator, fd, size, 0);
-+
-+ if (G_UNLIKELY (!mem)) {
-+ GST_ERROR_OBJECT (self, "GstDmaBufMemory allocation failed");
-+ close (fd);
-+ goto fail;
-+ }
-+
-+ return mem;
-+
-+ fail:
-+ memset(&dreq, 0, sizeof(struct drm_mode_destroy_dumb));
-+ dreq.handle = creq.handle;
-+ drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
-+ return NULL;
-+}
-+
-+static void
-+gst_drm_allocator_free (GstAllocator * allocator, GstMemory * mem)
-+{
-+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (allocator);
-+ uint32_t handle = 0;
-+ int DrmDeviceFD = self->DrmDeviceFD;
-+ int fd = -1;
-+
-+ GST_LOG_OBJECT (self, "DRM Memory free");
-+
-+ g_return_if_fail (GST_IS_ALLOCATOR (allocator));
-+ g_return_if_fail (mem != NULL);
-+ g_return_if_fail (gst_is_drm_memory (mem));
-+
-+ fd = gst_fd_memory_get_fd (mem);
-+ drmPrimeFDToHandle(DrmDeviceFD, fd, &handle);
-+
-+ /* Incase there are some mapped memory, we unmap and ready it to be cleaned*/
-+ GST_ALLOCATOR_CLASS (parent_class)->free (allocator, mem);
-+
-+ if (handle) {
-+ struct drm_mode_destroy_dumb dreq;
-+ memset(&dreq, 0, sizeof(struct drm_mode_destroy_dumb));
-+ dreq.handle = handle;
-+ drmIoctl (DrmDeviceFD, DRM_IOCTL_MODE_DESTROY_DUMB, &dreq);
-+ }
-+
-+ close (fd);
-+}
-+
-+static void
-+gst_drm_allocator_finalize (GObject * obj)
-+{
-+ GstDRMAllocator *self = GST_DRM_ALLOCATOR (obj);
-+ GST_LOG_OBJECT (obj, "DRM Allocator finalize");
-+
-+ close (self->DrmDeviceFD);
-+ self->DrmDeviceFD = INVALID_DRM_FD;
-+
-+ G_OBJECT_CLASS (parent_class)->finalize (obj);
-+}
-+
-+static void
-+gst_drm_allocator_class_init (GstDRMAllocatorClass * klass)
-+{
-+ GstAllocatorClass *drm_alloc = (GstAllocatorClass *) klass;
-+
-+ drm_alloc->alloc = GST_DEBUG_FUNCPTR (gst_drm_allocator_alloc);
-+ drm_alloc->free = GST_DEBUG_FUNCPTR (gst_drm_allocator_free);
-+ GST_DEBUG_CATEGORY_INIT (drmallocator_debug, "drmallocator", 0,
-+ "GstDRMAllocator debug");
-+
-+}
-+
-+static void
-+gst_drm_allocator_init (GstDRMAllocator * self)
-+{
-+ GstAllocator *alloc = GST_ALLOCATOR_CAST (self);
-+ GObjectClass *object_class = G_OBJECT_CLASS (GST_DRM_ALLOCATOR_GET_CLASS(self));
-+
-+ if (self->DrmDeviceFD <= 0) {
-+ self->DrmDeviceFD = open("/dev/dri/card0", O_RDWR | O_CLOEXEC);
-+ if (self->DrmDeviceFD < 0) {
-+ GST_ERROR_OBJECT (self, "Failed to open DRM device");
-+ } else {
-+ drmDropMaster (self->DrmDeviceFD);
-+ }
-+ }
-+
-+ alloc->mem_type = GST_ALLOCATOR_DMABUF;
-+
-+ object_class->finalize = gst_drm_allocator_finalize;
-+
-+ GST_OBJECT_FLAG_UNSET (self, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC);
-+}
-+
-+void
-+gst_drm_allocator_register (void)
-+{
-+ gst_allocator_register (GST_ALLOCATOR_DRM,
-+ g_object_new (GST_TYPE_DRM_ALLOCATOR, NULL));
-+}
-+
-+GstAllocator *
-+gst_drm_allocator_get (void)
-+{
-+ GstAllocator *alloc;
-+ alloc = gst_allocator_find (GST_ALLOCATOR_DRM);
-+ if (!alloc) {
-+ gst_drm_allocator_register();
-+ alloc = gst_allocator_find (GST_ALLOCATOR_DRM);
-+ }
-+ return alloc;
-+}
-+
-+gboolean
-+gst_is_drm_memory (GstMemory * mem)
-+{
-+ return gst_memory_is_type (mem, GST_ALLOCATOR_DMABUF);
-+}
-diff --git a/gst-libs/gst/drm/gstdrmallocator.h b/gst-libs/gst/drm/gstdrmallocator.h
-new file mode 100644
-index 0000000..1ca93ba
---- /dev/null
-+++ b/gst-libs/gst/drm/gstdrmallocator.h
-@@ -0,0 +1,77 @@
-+/*
-+ * GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ *
-+ * Authors:
-+ * Pooja Prajod <poojaprajod@ti.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation
-+ * version 2.1 of the License.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+/**
-+ * SECTION:GstDRMAllocator
-+ * @short_description: GStreamer DRM allocator support
-+ *
-+ * Since: 1.6.3
-+ */
-+
-+#ifndef __GSTDRMALLOCATOR_H__
-+#define __GSTDRMALLOCATOR_H__
-+
-+#include <gst/gst.h>
-+#include <gst/video/video.h>
-+#include <gst/allocators/allocators.h>
-+#include <stdint.h>
-+
-+#include <xf86drm.h>
-+#include <xf86drmMode.h>
-+#include <fcntl.h>
-+
-+G_BEGIN_DECLS
-+
-+#define GST_TYPE_DRM_ALLOCATOR (gst_drm_allocator_get_type ())
-+#define GST_DRM_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocator))
-+#define GST_IS_DRM_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DRM_ALLOCATOR))
-+#define GST_DRM_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocatorClass))
-+#define GST_IS_DRM_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DRM_ALLOCATOR))
-+#define GST_DRM_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DRM_ALLOCATOR, GstDRMAllocatorClass))
-+
-+#define GST_ALLOCATOR_DRM "DRM"
-+
-+typedef struct _GstDRMAllocator GstDRMAllocator;
-+typedef struct _GstDRMAllocatorClass GstDRMAllocatorClass;
-+
-+struct _GstDRMAllocator
-+{
-+ GstFdAllocator parent;
-+ int DrmDeviceFD;
-+};
-+
-+struct _GstDRMAllocatorClass
-+{
-+ GstFdAllocatorClass parent_class;
-+};
-+
-+void gst_drm_allocator_register (void);
-+GstAllocator * gst_drm_allocator_get (void);
-+
-+gboolean gst_is_drm_memory (GstMemory * mem);
-+
-+GType gst_drm_allocator_get_type (void);
-+
-+G_END_DECLS
-+
-+#endif /* __GSTDRMALLOCATOR_H__ */
-diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am
-index 88c7e52..5fdccbf 100644
---- a/pkgconfig/Makefile.am
-+++ b/pkgconfig/Makefile.am
-@@ -2,6 +2,7 @@
- ### all of the standard pc files we need to generate
- pcverfiles = \
- gstreamer-plugins-bad-@GST_API_VERSION@.pc \
-+ gstreamer-drm-@GST_API_VERSION@.pc \
- gstreamer-codecparsers-@GST_API_VERSION@.pc \
- gstreamer-insertbin-@GST_API_VERSION@.pc \
- gstreamer-mpegts-@GST_API_VERSION@.pc \
-@@ -12,6 +13,7 @@ pcverfiles = \
-
- pcverfiles_uninstalled = \
- gstreamer-plugins-bad-@GST_API_VERSION@-uninstalled.pc \
-+ gstreamer-drm-@GST_API_VERSION@-uninstalled.pc \
- gstreamer-codecparsers-@GST_API_VERSION@-uninstalled.pc \
- gstreamer-insertbin-@GST_API_VERSION@-uninstalled.pc \
- gstreamer-mpegts-@GST_API_VERSION@-uninstalled.pc \
-@@ -43,6 +45,7 @@ pkgconfig_DATA = $(pcverfiles)
- CLEANFILES = $(pcverfiles) $(pcverfiles_uninstalled)
- pcinfiles = \
- gstreamer-plugins-bad.pc.in gstreamer-plugins-bad-uninstalled.pc.in \
-+ gstreamer-drm.pc.in gstreamer-drm-uninstalled.pc.in \
- gstreamer-codecparsers.pc.in gstreamer-codecparsers-uninstalled.pc.in \
- gstreamer-gl.pc.in gstreamer-gl-uninstalled.pc.in \
- gstreamer-insertbin.pc.in gstreamer-insertbin-uninstalled.pc.in \
-diff --git a/pkgconfig/gstreamer-drm-uninstalled.pc.in b/pkgconfig/gstreamer-drm-uninstalled.pc.in
-new file mode 100644
-index 0000000..9dcf978
---- /dev/null
-+++ b/pkgconfig/gstreamer-drm-uninstalled.pc.in
-@@ -0,0 +1,11 @@
-+prefix=
-+exec_prefix=
-+libdir=${pcfiledir}/../gst-libs/gst/drm
-+includedir=${pcfiledir}/../gst-libs
-+
-+Name: GStreamer DRM Allocator, Uninstalled
-+Description: DRM Allocator for GStreamer elements, uninstalled
-+Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-base-@GST_MAJORMINOR@
-+Version: @VERSION@
-+Libs: -L${libdir} ${libdir}/libgstdrm-@GST_MAJORMINOR@.la
-+Cflags: -I${includedir}
-diff --git a/pkgconfig/gstreamer-drm.pc.in b/pkgconfig/gstreamer-drm.pc.in
-new file mode 100644
-index 0000000..d155e80
---- /dev/null
-+++ b/pkgconfig/gstreamer-drm.pc.in
-@@ -0,0 +1,12 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@/gstreamer-@GST_MAJORMINOR@
-+
-+Name: GStreamer DRM Allocator
-+Description: DRM Allocator for GStreamer elements
-+Requires: gstreamer-@GST_MAJORMINOR@ gstreamer-base-@GST_MAJORMINOR@
-+Version: @VERSION@
-+Libs: -L${libdir} -lgstdrm-@GST_MAJORMINOR@
-+Cflags: -I${includedir}
-+
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch
deleted file mode 100644
index 696202637..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch
+++ /dev/null
@@ -1,408 +0,0 @@
-From 79db7e4cab226515f0e4d40afdb5a5b478755396 Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Wed, 14 Sep 2016 16:03:17 -0400
-Subject: [PATCH] gstwaylandsink: Add mouse drag and drop support
-
-This patch adds mouse input listeners to WlDisplay instance.
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- ext/wayland/wldisplay.c | 305 +++++++++++++++++++++++++++++++++++++++++++++++-
- ext/wayland/wldisplay.h | 4 +
- ext/wayland/wlwindow.c | 2 +
- 3 files changed, 310 insertions(+), 1 deletion(-)
-
-diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c
-index 8c5eeaf..c647f34 100644
---- a/ext/wayland/wldisplay.c
-+++ b/ext/wayland/wldisplay.c
-@@ -21,18 +21,45 @@
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif
--
-+#include <stdlib.h>
-+#include <stdio.h>
- #include "wldisplay.h"
- #include "wlbuffer.h"
-+#include "wlwindow.h"
-+
-+#include <wayland-client-protocol.h>
-
-+#include <unistd.h>
- #include <errno.h>
-+#include <linux/input.h>
-
- GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
- #define GST_CAT_DEFAULT gstwayland_debug
-
- G_DEFINE_TYPE (GstWlDisplay, gst_wl_display, G_TYPE_OBJECT);
-
-+struct touch_point
-+{
-+ int32_t id;
-+ struct wl_list link;
-+};
-+
-+struct input
-+{
-+ GstWlDisplay *display;
-+ struct wl_seat *seat;
-+ struct wl_pointer *pointer;
-+ struct wl_touch *touch;
-+ struct wl_list touch_point_list;
-+ GstWlWindow *pointer_focus;
-+ GstWlWindow *touch_focus;
-+ struct wl_list link;
-+ GstWlWindow *grab;
-+};
-+
- static void gst_wl_display_finalize (GObject * gobject);
-+static void input_grab (struct input *input, GstWlWindow *window);
-+static void input_ungrab (struct input *input);
-
- static void
- gst_wl_display_class_init (GstWlDisplayClass * klass)
-@@ -51,6 +78,54 @@ gst_wl_display_init (GstWlDisplay * self)
- }
-
- static void
-+input_grab (struct input *input, GstWlWindow *window)
-+{
-+ input->grab = window;
-+}
-+
-+static void
-+input_ungrab (struct input *input)
-+{
-+ input->grab = NULL;
-+}
-+
-+static void
-+input_remove_pointer_focus (struct input *input)
-+{
-+ GstWlWindow *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ input->pointer_focus = NULL;
-+}
-+
-+static void
-+input_destroy (struct input *input)
-+{
-+ input_remove_pointer_focus (input);
-+
-+ if (input->display->seat_version >= 3) {
-+ if (input->pointer)
-+ wl_pointer_release (input->pointer);
-+ }
-+
-+ wl_list_remove (&input->link);
-+ wl_seat_destroy (input->seat);
-+ free (input);
-+}
-+
-+static void
-+display_destroy_inputs (GstWlDisplay *display)
-+{
-+ struct input *tmp;
-+ struct input *input;
-+
-+ wl_list_for_each_safe (input, tmp, &display->input_list, link)
-+ input_destroy (input);
-+}
-+
-+static void
- gst_wl_display_finalize (GObject * gobject)
- {
- GstWlDisplay *self = GST_WL_DISPLAY (gobject);
-@@ -74,6 +149,8 @@ gst_wl_display_finalize (GObject * gobject)
- g_hash_table_unref (self->buffers);
- g_mutex_clear (&self->buffers_mutex);
-
-+ display_destroy_inputs (self);
-+
- if (self->shm)
- wl_shm_destroy (self->shm);
-
-@@ -143,6 +220,228 @@ static const struct wl_shm_listener shm_listener = {
- shm_format
- };
-
-+
-+static void
-+pointer_handle_enter (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface,
-+ wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+
-+ if (!surface) {
-+ /* enter event for a window we've just destroyed */
-+ return;
-+ }
-+
-+ input->display->serial = serial;
-+ input->pointer_focus = wl_surface_get_user_data (surface);
-+}
-+
-+static void
-+pointer_handle_leave (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface)
-+{
-+ struct input *input = data;
-+
-+ input_remove_pointer_focus (input);
-+}
-+
-+static void
-+pointer_handle_motion (void *data, struct wl_pointer *pointer,
-+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+ GstWlWindow *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+
-+}
-+
-+static void
-+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial,
-+ uint32_t time, uint32_t button, uint32_t state_w)
-+{
-+ struct input *input = data;
-+ enum wl_pointer_button_state state = state_w;
-+ input->display->serial = serial;
-+
-+ if (button == BTN_LEFT) {
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ input_grab (input, input->pointer_focus);
-+
-+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED)
-+ input_ungrab (input);
-+ }
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+}
-+
-+static void
-+pointer_handle_axis (void *data, struct wl_pointer *pointer,
-+ uint32_t time, uint32_t axis, wl_fixed_t value)
-+{
-+}
-+
-+static const struct wl_pointer_listener pointer_listener = {
-+ pointer_handle_enter,
-+ pointer_handle_leave,
-+ pointer_handle_motion,
-+ pointer_handle_button,
-+ pointer_handle_axis,
-+};
-+
-+static void
-+touch_handle_down (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, struct wl_surface *surface,
-+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+ input->display->serial = serial;
-+ input->touch_focus = wl_surface_get_user_data (surface);
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ tp = malloc (sizeof *tp);
-+ if (tp) {
-+ tp->id = id;
-+ wl_list_insert (&input->touch_point_list, &tp->link);
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ serial);
-+ }
-+}
-+
-+static void
-+touch_handle_motion (void *data, struct wl_touch *wl_touch,
-+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+ wl_list_for_each (tp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ input->display->serial);
-+
-+ return;
-+ }
-+}
-+
-+static void
-+touch_handle_frame (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_cancel (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_up (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, int32_t id)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp, *tmp;
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_list_remove (&tp->link);
-+ free (tp);
-+
-+ return;
-+ }
-+}
-+
-+static const struct wl_touch_listener touch_listener = {
-+ touch_handle_down,
-+ touch_handle_up,
-+ touch_handle_motion,
-+ touch_handle_frame,
-+ touch_handle_cancel,
-+};
-+
-+
-+static void
-+seat_handle_capabilities (void *data, struct wl_seat *seat,
-+ enum wl_seat_capability caps)
-+{
-+ struct input *input = data;
-+
-+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) {
-+ input->pointer = wl_seat_get_pointer (seat);
-+ wl_pointer_set_user_data (input->pointer, input);
-+ wl_pointer_add_listener (input->pointer, &pointer_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) {
-+ wl_pointer_destroy (input->pointer);
-+ input->pointer = NULL;
-+ }
-+
-+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) {
-+ input->touch = wl_seat_get_touch (seat);
-+ wl_touch_set_user_data (input->touch, input);
-+ wl_touch_add_listener (input->touch, &touch_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) {
-+ wl_touch_destroy (input->touch);
-+ input->touch = NULL;
-+ }
-+}
-+
-+static void
-+seat_handle_name (void *data, struct wl_seat *seat, const char *name)
-+{
-+
-+}
-+
-+static const struct wl_seat_listener seat_listener = {
-+ seat_handle_capabilities,
-+ seat_handle_name
-+};
-+
-+static void
-+display_add_input (GstWlDisplay *d, uint32_t id)
-+{
-+ struct input *input;
-+
-+ input = calloc (1, sizeof (*input));
-+ if (input == NULL) {
-+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink");
-+ exit (EXIT_FAILURE);
-+ }
-+ input->display = d;
-+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface,
-+ MAX (d->seat_version, 3));
-+ input->touch_focus = NULL;
-+ input->pointer_focus = NULL;
-+ wl_list_init (&input->touch_point_list);
-+ wl_list_insert (d->input_list.prev, &input->link);
-+
-+ wl_seat_add_listener (input->seat, &seat_listener, input);
-+ wl_seat_set_user_data (input->seat, input);
-+
-+}
-+
- static void
- registry_handle_global (void *data, struct wl_registry *registry,
- uint32_t id, const char *interface, uint32_t version)
-@@ -160,6 +459,9 @@ registry_handle_global (void *data, struct wl_registry *registry,
- } else if (g_strcmp0 (interface, "wl_shm") == 0) {
- self->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1);
- wl_shm_add_listener (self->shm, &shm_listener, self);
-+ } else if (g_strcmp0 (interface, "wl_seat") == 0) {
-+ self->seat_version = version;
-+ display_add_input (self, id);
- } else if (g_strcmp0 (interface, "wl_scaler") == 0) {
- self->scaler = wl_registry_bind (registry, id, &wl_scaler_interface, 2);
- }
-@@ -237,6 +539,7 @@ gst_wl_display_new_existing (struct wl_display * display,
- self->own_display = take_ownership;
-
- self->queue = wl_display_create_queue (self->display);
-+ wl_list_init (&self->input_list);
- self->registry = wl_display_get_registry (self->display);
- wl_proxy_set_queue ((struct wl_proxy *) self->registry, self->queue);
- wl_registry_add_listener (self->registry, &registry_listener, self);
-diff --git a/ext/wayland/wldisplay.h b/ext/wayland/wldisplay.h
-index 5505d60..d8c2cef 100644
---- a/ext/wayland/wldisplay.h
-+++ b/ext/wayland/wldisplay.h
-@@ -62,6 +62,10 @@ struct _GstWlDisplay
- GMutex buffers_mutex;
- GHashTable *buffers;
- gboolean shutting_down;
-+
-+ struct wl_list input_list;
-+ int seat_version;
-+ uint32_t serial;
- };
-
- struct _GstWlDisplayClass
-diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
-index a964335..34ae385 100644
---- a/ext/wayland/wlwindow.c
-+++ b/ext/wayland/wlwindow.c
-@@ -111,6 +111,8 @@ gst_wl_window_new_internal (GstWlDisplay * display)
-
- window->area_surface = wl_compositor_create_surface (display->compositor);
- window->video_surface = wl_compositor_create_surface (display->compositor);
-+ wl_surface_set_user_data (window->area_surface, window);
-+ wl_surface_set_user_data (window->video_surface, window);
-
- wl_proxy_set_queue ((struct wl_proxy *) window->area_surface, display->queue);
- wl_proxy_set_queue ((struct wl_proxy *) window->video_surface,
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch
deleted file mode 100644
index 507f57b92..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0001-gstwaylandsink-add-input-format-I420-support.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 1364ee6e60eb09a3fe3b072fe4671c5d645e523a Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Wed, 22 Feb 2017 10:49:01 -0500
-Subject: [PATCH 1/3] gstwaylandsink: add input format I420 support
-
-The software-based video decoder produces the output in I420 format. To display
-the output without additional ARM MHz consumed in video format conversion,
-the function gst_wl_memory_construct_wl_buffer is enhanced to support I420 format.
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- ext/wayland/wldrm.c | 41 ++++++++++++++++++++++++++++++++++-------
- 1 file changed, 34 insertions(+), 7 deletions(-)
-
-diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c
-index 3dc9c21..ecbdc88 100644
---- a/ext/wayland/wldrm.c
-+++ b/ext/wayland/wldrm.c
-@@ -5,33 +5,60 @@
- #include <omap_drmif.h>
- #include <wayland-client.h>
-
-+GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
-+#define GST_CAT_DEFAULT gstwayland_debug
-+
-+
- struct wl_buffer *
- gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
- const GstVideoInfo * info)
- {
- gint video_width = GST_VIDEO_INFO_WIDTH (info);
- gint video_height = GST_VIDEO_INFO_HEIGHT (info);
-+ GstVideoFormat format = GST_VIDEO_INFO_FORMAT (info);
- int fd = -1;
- struct omap_bo *bo;
- struct wl_buffer *buffer;
--
-- /* TODO get format, etc from caps.. and query device for
-- * supported formats, and make this all more flexible to
-- * cope with various formats:
-- */
-- uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+ uint32_t fourcc;
- uint32_t name;
- /* note: wayland and mesa use the terminology:
- * stride - rowstride in bytes
- * pitch - rowstride in pixels
- */
- uint32_t strides[3] = {
-- GST_ROUND_UP_4 (video_width), GST_ROUND_UP_4 (video_width), 0,
-+ GST_ROUND_UP_4 (video_width), 0, 0,
- };
- uint32_t offsets[3] = {
- 0, strides[0] * video_height, 0
- };
-
-+ if (format == GST_VIDEO_FORMAT_NV12)
-+ {
-+ /* NV12 */
-+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+ strides[1] = GST_ROUND_UP_4 (video_width);
-+ }
-+ else if(format == GST_VIDEO_FORMAT_I420)
-+ {
-+ /* YUV420 */
-+ fourcc = GST_MAKE_FOURCC ('Y', 'U', '1', '2');
-+ strides[1] = strides[2] = GST_ROUND_UP_4 (video_width/2);
-+ offsets[2] = offsets[1] + strides[1] * video_height/2;
-+ }
-+ else
-+ {
-+
-+ GST_DEBUG ("Unsupported video format: %d", format);
-+ /*
-+ * There are two xRGB frames with width and height = 1 required in the begining of a video stream.
-+ * If we consider them as errot, then it will case libwayland-clent.so crashes
-+ * due to invalid error handling.
-+ * Consider them as NV12 until we can figure out a better solution
-+ */
-+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+ strides[1] = GST_ROUND_UP_4 (video_width);
-+ }
-+
- fd = gst_fd_memory_get_fd (mem);
-
- if (fd < 0 ) {
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch
deleted file mode 100644
index 308a84959..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-kmssink-remove-DCE-dependencies.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 68936c7fb864440bb4d2ab737a651888ac7c253a Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Fri, 17 Mar 2017 10:42:32 -0400
-Subject: [PATCH 2/3] kmssink: remove DCE dependencies
-
-Replace DCE related API calls to libdrm and omapdrm API calls
-to decouple DCE from kmssink
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- configure.ac | 1 -
- sys/kms/Makefile.am | 2 --
- sys/kms/gstkmssink.c | 17 +++++++++++++----
- 3 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index f93d52d..a6f93a5 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2321,7 +2321,6 @@ dnl *** kms ***
- translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true)
- AG_GST_CHECK_FEATURE(KMS, [kmssink], kms, [
- PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no)
--PKG_CHECK_MODULES(LIBDCE, [libdce >= 1.0.0], HAVE_KMS=yes, HAVE_KMS=no)
- AC_SUBST(DRM_CFLAGS)
- AC_SUBST(DRM_LIBS)
- ])
-diff --git a/sys/kms/Makefile.am b/sys/kms/Makefile.am
-index 6d56073..cc7353e 100644
---- a/sys/kms/Makefile.am
-+++ b/sys/kms/Makefile.am
-@@ -9,7 +9,6 @@ libgstkmssink_la_CFLAGS = \
- $(GST_PLUGINS_BAD_CFLAGS) \
- $(GST_PLUGINS_BASE_CFLAGS) \
- $(GST_BASE_CFLAGS) \
-- $(LIBDCE_CFLAGS) \
- $(GST_CFLAGS) \
- $(DRM_CFLAGS)
-
-@@ -17,7 +16,6 @@ libgstkmssink_la_LIBADD = \
- $(GST_PLUGINS_BASE_LIBS) \
- $(GST_BASE_LIBS) \
- $(GST_LIBS) \
-- $(LIBDCE_LIBS) \
- $(DRM_LIBS) \
- -lgstvideo-$(GST_API_VERSION) \
- $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la
-diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
-index 17e6407..9795bdf 100644
---- a/sys/kms/gstkmssink.c
-+++ b/sys/kms/gstkmssink.c
-@@ -31,7 +31,6 @@
- #include "gstkmssink.h"
- #include "gstkmsbufferpriv.h"
-
--#include <libdce.h>
- #include <omap_drm.h>
- #include <omap_drmif.h>
- #include <xf86drmMode.h>
-@@ -516,13 +515,18 @@ gst_kms_sink_start (GstBaseSink * bsink)
-
- sink = GST_KMS_SINK (bsink);
-
-- drm_dev = dce_init ();
-+ drm_fd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC);
-+ if(drm_fd == NULL)
-+ goto drm_failed;
-+ else {
-+ drm_dev = omap_device_new(drm_fd);
-+ }
-+
- if (drm_dev == NULL)
- goto device_failed;
- else {
-+ sink->fd = drm_fd;
- sink->dev = drm_dev;
-- sink->fd = dce_get_fd ();
-- drm_fd = dce_get_fd ();
- }
-
- sink->resources = drmModeGetResources (sink->fd);
-@@ -539,6 +543,11 @@ fail:
- gst_kms_sink_reset (sink);
- return FALSE;
-
-+drm_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("drmOpen failed"));
-+ goto fail;
-+
- device_failed:
- GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
- (NULL), ("omap_device_new failed"));
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch
deleted file mode 100644
index 707cfc2b7..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From c748e947ff35c4137178aef9bf229e0c67952982 Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Fri, 20 Jan 2017 14:57:29 +0530
-Subject: [PATCH 2/5] parsers: Pick previos bug fixes on different parsers
-
-The following bug fixes which were previously identified are picked :
-1. Increase rank for vc1parse and jpegparse
-2. Modify h264 and mpeg4 parsers to interpolate pts
-3. Fix create() width and height calculation on h264parse
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- gst/jpegformat/gstjpegformat.c | 2 +-
- gst/jpegformat/gstjpegparse.c | 2 +-
- gst/videoparsers/gsth264parse.c | 22 +++++++---------------
- gst/videoparsers/gstmpeg4videoparse.c | 2 +-
- gst/videoparsers/gstmpegvideoparse.c | 2 +-
- gst/videoparsers/plugin.c | 2 +-
- 6 files changed, 12 insertions(+), 20 deletions(-)
-
-diff --git a/gst/jpegformat/gstjpegformat.c b/gst/jpegformat/gstjpegformat.c
-index b410466..ecb9311 100644
---- a/gst/jpegformat/gstjpegformat.c
-+++ b/gst/jpegformat/gstjpegformat.c
-@@ -30,7 +30,7 @@
- static gboolean
- plugin_init (GstPlugin * plugin)
- {
-- if (!gst_element_register (plugin, "jpegparse", GST_RANK_NONE,
-+ if (!gst_element_register (plugin, "jpegparse", GST_RANK_PRIMARY + 2,
- GST_TYPE_JPEG_PARSE))
- return FALSE;
- if (!gst_element_register (plugin, "jifmux", GST_RANK_SECONDARY,
-diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c
-index 77e53a6..5bfba7b 100644
---- a/gst/jpegformat/gstjpegparse.c
-+++ b/gst/jpegformat/gstjpegparse.c
-@@ -151,7 +151,7 @@ gst_jpeg_parse_class_init (GstJpegParseClass * klass)
-
- gst_element_class_set_static_metadata (gstelement_class,
- "JPEG stream parser",
-- "Video/Parser",
-+ "Codec/Parser/Video",
- "Parse JPEG images into single-frame buffers",
- "Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>");
-
-diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
-index 05b6b75..6fe2914 100644
---- a/gst/videoparsers/gsth264parse.c
-+++ b/gst/videoparsers/gsth264parse.c
-@@ -162,7 +162,7 @@ static void
- gst_h264_parse_init (GstH264Parse * h264parse)
- {
- h264parse->frame_out = gst_adapter_new ();
-- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), FALSE);
-+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (h264parse), TRUE);
- GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (h264parse));
- GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (h264parse));
- }
-@@ -1722,13 +1722,8 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
- gint fps_num, fps_den;
- gint par_n, par_d;
-
-- if (sps->frame_cropping_flag) {
-- crop_width = sps->crop_rect_width;
-- crop_height = sps->crop_rect_height;
-- } else {
-- crop_width = sps->width;
-- crop_height = sps->height;
-- }
-+ crop_width = (sps->crop_rect_width > sps->width)? sps->crop_rect_width: sps->width;
-+ crop_height = (sps->crop_rect_height > sps->height)? sps->crop_rect_height: sps->height;
-
- if (G_UNLIKELY (h264parse->width != crop_width ||
- h264parse->height != crop_height)) {
-@@ -1762,7 +1757,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
- }
-
- if (G_UNLIKELY (modified || h264parse->update_caps)) {
-- gint width, height;
-+ gint width=0, height=0;
- GstClockTime latency;
-
- const gchar *caps_mview_mode = NULL;
-@@ -1774,16 +1769,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
-
- caps = gst_caps_copy (sink_caps);
-
-- /* sps should give this but upstream overrides */
- if (s && gst_structure_has_field (s, "width"))
- gst_structure_get_int (s, "width", &width);
-- else
-- width = h264parse->width;
--
-+ width = (width > h264parse->width)? width: h264parse->width;
-+
- if (s && gst_structure_has_field (s, "height"))
- gst_structure_get_int (s, "height", &height);
-- else
-- height = h264parse->height;
-+ height = (height > h264parse->height)? height: h264parse->height;
-
- if (s == NULL ||
- !gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n,
-diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c
-index a1fd3b2..7912254 100644
---- a/gst/videoparsers/gstmpeg4videoparse.c
-+++ b/gst/videoparsers/gstmpeg4videoparse.c
-@@ -185,7 +185,7 @@ gst_mpeg4vparse_init (GstMpeg4VParse * parse)
- parse->interval = DEFAULT_CONFIG_INTERVAL;
- parse->last_report = GST_CLOCK_TIME_NONE;
-
-- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE);
-+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), TRUE);
- GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse));
- GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (parse));
- }
-diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c
-index bf71a3e..f203cca 100644
---- a/gst/videoparsers/gstmpegvideoparse.c
-+++ b/gst/videoparsers/gstmpegvideoparse.c
-@@ -175,7 +175,7 @@ gst_mpegv_parse_init (GstMpegvParse * parse)
- {
- parse->config_flags = FLAG_NONE;
-
-- gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), FALSE);
-+ gst_base_parse_set_pts_interpolation (GST_BASE_PARSE (parse), TRUE);
- GST_PAD_SET_ACCEPT_INTERSECT (GST_BASE_PARSE_SINK_PAD (parse));
- GST_PAD_SET_ACCEPT_TEMPLATE (GST_BASE_PARSE_SINK_PAD (parse));
- }
-diff --git a/gst/videoparsers/plugin.c b/gst/videoparsers/plugin.c
-index 79d1df6..fb866b5 100644
---- a/gst/videoparsers/plugin.c
-+++ b/gst/videoparsers/plugin.c
-@@ -51,7 +51,7 @@ plugin_init (GstPlugin * plugin)
- ret |= gst_element_register (plugin, "h265parse",
- GST_RANK_SECONDARY, GST_TYPE_H265_PARSE);
- ret |= gst_element_register (plugin, "vc1parse",
-- GST_RANK_NONE, GST_TYPE_VC1_PARSE);
-+ GST_RANK_PRIMARY + 2, GST_TYPE_VC1_PARSE);
-
- return ret;
- }
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch
deleted file mode 100644
index 1068fda2c..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-gstkmssink-Add-support-for-KMS-based-sink.patch
+++ /dev/null
@@ -1,1592 +0,0 @@
-From 44ba6f9839a410e981c9c941f099316ebfac2659 Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Fri, 20 Jan 2017 16:18:22 +0530
-Subject: [PATCH 3/5] gstkmssink: Add support for KMS based sink
-
-The following features are enabled:
-1. Add support for kmssink
-2. Fix memory leak by using API's that do not hold
- reference to GstMemory
-3. Restrict the number of buffers that will be allocated
- by kmssink bufferpool
-4. Use Atomic mode setting instead of SetPlane
-5. Store encoder and plane data as static data to enable
- same process looping usecase
-6. Handle usecase where display is disabled by default
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- configure.ac | 14 +
- sys/Makefile.am | 10 +-
- sys/kms/Makefile.am | 28 ++
- sys/kms/gstdrmutils.c | 347 +++++++++++++++++++++
- sys/kms/gstdrmutils.h | 50 +++
- sys/kms/gstkmsbufferpriv.c | 121 ++++++++
- sys/kms/gstkmsbufferpriv.h | 64 ++++
- sys/kms/gstkmssink.c | 740 +++++++++++++++++++++++++++++++++++++++++++++
- sys/kms/gstkmssink.h | 92 ++++++
- 9 files changed, 1464 insertions(+), 2 deletions(-)
- create mode 100644 sys/kms/Makefile.am
- create mode 100644 sys/kms/gstdrmutils.c
- create mode 100644 sys/kms/gstdrmutils.h
- create mode 100644 sys/kms/gstkmsbufferpriv.c
- create mode 100644 sys/kms/gstkmsbufferpriv.h
- create mode 100644 sys/kms/gstkmssink.c
- create mode 100644 sys/kms/gstkmssink.h
-
-diff --git a/configure.ac b/configure.ac
-index e254605..9fdfbc7 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2324,6 +2324,18 @@ AG_GST_CHECK_FEATURE(KATE, [Kate], kate, [
- AC_SUBST(TIGER_LIBS)
- ],,,[AM_CONDITIONAL(USE_TIGER, false)])
-
-+
-+
-+dnl *** kms ***
-+translit(dnm, m, l) AM_CONDITIONAL(USE_KMS, true)
-+AG_GST_CHECK_FEATURE(KMS, [kmssink], kms, [
-+PKG_CHECK_MODULES([DRM], [libdrm libdrm_omap], HAVE_KMS=yes, HAVE_KMS=no)
-+PKG_CHECK_MODULES(LIBDCE, [libdce >= 1.0.0], HAVE_KMS=yes, HAVE_KMS=no)
-+AC_SUBST(DRM_CFLAGS)
-+AC_SUBST(DRM_LIBS)
-+])
-+
-+
- dnl *** ladspa ***
- translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
- AG_GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
-@@ -3383,6 +3395,7 @@ AM_CONDITIONAL(USE_GTK3_GL, false)
- AM_CONDITIONAL(USE_HLS, false)
- AM_CONDITIONAL(USE_KATE, false)
- AM_CONDITIONAL(USE_TIGER, false)
-+AM_CONDITIONAL(USE_KMS, false)
- AM_CONDITIONAL(USE_LADSPA, false)
- AM_CONDITIONAL(USE_LV2, false)
- AM_CONDITIONAL(USE_LIBDE265, false)
-@@ -3632,6 +3645,7 @@ sys/fbdev/Makefile
- sys/linsys/Makefile
- sys/nvenc/Makefile
- sys/opensles/Makefile
-+sys/kms/Makefile
- sys/shm/Makefile
- sys/tinyalsa/Makefile
- sys/uvch264/Makefile
-diff --git a/sys/Makefile.am b/sys/Makefile.am
-index 32f79fb..325b4af 100644
---- a/sys/Makefile.am
-+++ b/sys/Makefile.am
-@@ -87,6 +87,12 @@ PVR_DIR=pvr2d
- else
- PVR_DIR=
- endif
-+
-+if USE_KMS
-+KMS_DIR=kms
-+else
-+KMS_DIR=
-+endif
-
- if USE_SHM
- SHM_DIR=shm
-@@ -148,10 +154,10 @@ else
- TINYALSA_DIR=
- endif
-
--SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(PVR_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR) $(NVENC_DIR) $(TINYALSA_DIR)
-+SUBDIRS = $(ACM_DIR) $(ANDROID_MEDIA_DIR) $(APPLE_MEDIA_DIR) $(AVC_DIR) $(BLUEZ_DIR) $(D3DVIDEOSINK_DIR) $(DECKLINK_DIR) $(DIRECTSOUND_DIR) $(WINKS_DIR) $(DVB_DIR) $(FBDEV_DIR) $(LINSYS_DIR) $(OPENSLES_DIR) $(PVR_DIR) $(KMS_DIR) $(SHM_DIR) $(UVCH264_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR) $(WINSCREENCAP_DIR) $(WASAPI_DIR) $(NVENC_DIR) $(TINYALSA_DIR)
-
- DIST_SUBDIRS = acmenc acmmp3dec androidmedia applemedia applemedia-nonpublic avc bluez d3dvideosink decklink directsound dvb linsys fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
-- opensles pvr2d shm uvch264 vcd vdpau wasapi wininet winks winscreencap \
-+ opensles pvr2d kms shm uvch264 vcd vdpau wasapi wininet winks winscreencap \
- nvenc tinyalsa
-
- include $(top_srcdir)/common/parallel-subdirs.mak
-diff --git a/sys/kms/Makefile.am b/sys/kms/Makefile.am
-new file mode 100644
-index 0000000..6d56073
---- /dev/null
-+++ b/sys/kms/Makefile.am
-@@ -0,0 +1,28 @@
-+plugin_LTLIBRARIES = libgstkmssink.la
-+
-+libgstkmssink_la_SOURCES = \
-+ gstkmssink.c \
-+ gstkmsbufferpriv.c \
-+ gstdrmutils.c
-+
-+libgstkmssink_la_CFLAGS = \
-+ $(GST_PLUGINS_BAD_CFLAGS) \
-+ $(GST_PLUGINS_BASE_CFLAGS) \
-+ $(GST_BASE_CFLAGS) \
-+ $(LIBDCE_CFLAGS) \
-+ $(GST_CFLAGS) \
-+ $(DRM_CFLAGS)
-+
-+libgstkmssink_la_LIBADD = \
-+ $(GST_PLUGINS_BASE_LIBS) \
-+ $(GST_BASE_LIBS) \
-+ $(GST_LIBS) \
-+ $(LIBDCE_LIBS) \
-+ $(DRM_LIBS) \
-+ -lgstvideo-$(GST_API_VERSION) \
-+ $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la
-+
-+libgstkmssink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-+libgstkmssink_la_LIBTOOLFLAGS = --tag=disable-static
-+
-+noinst_HEADERS = gstkmssink.h gstdrmutils.h gstkmsbufferpriv.h
-diff --git a/sys/kms/gstdrmutils.c b/sys/kms/gstdrmutils.c
-new file mode 100644
-index 0000000..0e67a48
---- /dev/null
-+++ b/sys/kms/gstdrmutils.c
-@@ -0,0 +1,347 @@
-+/* GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ * Copyright (C) 2012 Collabora Ltd
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+#include <gst/gst.h>
-+#include "gstdrmutils.h"
-+
-+static int stored_enc = 0;
-+static drmModeEncoder *enc;
-+static struct plane_data *stored_plane;
-+
-+GST_DEBUG_CATEGORY_EXTERN (gst_debug_kms_sink);
-+#define GST_CAT_DEFAULT gst_debug_kms_sink
-+
-+void
-+gst_drm_connector_cleanup (int fd, struct connector *c)
-+{
-+ if (c->connector) {
-+ drmModeFreeConnector (c->connector);
-+ c->connector = NULL;
-+ }
-+
-+ if (c->fb_id) {
-+ drmModeRmFB (fd, c->fb_id);
-+ c->fb_id = 0;
-+ }
-+ if (c->fb_bo) {
-+ omap_bo_del (c->fb_bo);
-+ c->fb_bo = NULL;
-+ }
-+}
-+
-+
-+static gboolean
-+gst_drm_connector_find_mode_and_plane_helper (int fd,
-+ struct omap_device *dev, int width, int height,
-+ drmModeRes * resources, drmModePlaneRes * plane_resources,
-+ struct connector *c)
-+{
-+ int i, best_area = 0, ret;
-+ struct drm_set_client_cap req;
-+ unsigned int j;
-+ int32_t crtc;
-+
-+ gst_drm_connector_cleanup (fd, c);
-+
-+ req.capability = DRM_CLIENT_CAP_ATOMIC;
-+ req.value = 1;
-+ ret = ioctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &req);
-+ if(ret < 0) {
-+ GST_DEBUG("drm set atomic cap failed");
-+ goto fail;
-+ }
-+
-+ /* First, find the connector & mode */
-+ c->connector = drmModeGetConnector (fd, c->id);
-+ if (!c->connector)
-+ goto error_no_connector;
-+
-+ if (!c->connector->count_modes)
-+ goto error_no_mode;
-+
-+ /* just look for the highest resolution: */
-+ for (i = 0; i < c->connector->count_modes; i++) {
-+ drmModeModeInfo *mode = &c->connector->modes[i];
-+ int area = mode->hdisplay * mode->vdisplay;
-+
-+ if (area > best_area) {
-+ c->mode = mode;
-+ best_area = area;
-+ }
-+ }
-+
-+ if (c->mode == NULL) {
-+ /* XXX: just pick the first available mode. Not sure this is correct... */
-+ c->mode = &c->connector->modes[0];
-+#if 0
-+ goto error_no_mode;
-+#endif
-+ }
-+
-+ /* Now get the encoder */
-+
-+ if (stored_enc) {
-+ c->encoder = enc;
-+ c->connector->encoder_id = stored_enc;
-+ } else {
-+ c->encoder = drmModeGetEncoder (fd, c->connector->encoder_id);
-+ enc = c->encoder;
-+ stored_enc = c->connector->encoder_id;
-+ }
-+
-+ if (!c->encoder) {
-+ for (i = 0; i < c->connector->count_encoders; ++i) {
-+ c->encoder = drmModeGetEncoder(fd, c->connector->encoders[i]);
-+ if (!c->encoder) {
-+ GST_DEBUG ("Cannot retrieve encoder %u:%u (%d): %m\n",
-+ i, c->connector->encoders[i], errno);
-+ continue;
-+ }
-+ /* iterate all global CRTCs */
-+ for (j = 0; j < resources->count_crtcs; ++j) {
-+ /* check whether this CRTC works with the encoder */
-+ if (!(c->encoder->possible_crtcs & (1 << j)))
-+ continue;
-+ crtc = resources->crtcs[j];
-+ break;
-+ }
-+ if (crtc >= 0) {
-+ enc = c->encoder;
-+ stored_enc = c->connector->encoder_id;
-+ c->crtc = crtc;
-+ goto found_encoder;
-+ }
-+ }
-+ }
-+
-+found_encoder:
-+
-+ if (!c->encoder)
-+ goto error_no_encoder;
-+
-+ if (c->crtc == -1)
-+ c->crtc = c->encoder->crtc_id;
-+
-+ /* and figure out which crtc index it is: */
-+ c->pipe = -1;
-+ for (i = 0; i < resources->count_crtcs; i++) {
-+ if (c->crtc == (int) resources->crtcs[i]) {
-+ c->pipe = i;
-+ break;
-+ }
-+ }
-+
-+ if (c->pipe == -1)
-+ goto error_no_crtc;
-+
-+ if (stored_plane) {
-+ c->pdata = stored_plane;
-+ } else {
-+
-+ c->pdata = calloc(sizeof(struct plane_data), 1);
-+ for (i = 0; i < plane_resources->count_planes; i++) {
-+ drmModePlane *plane = drmModeGetPlane (fd, plane_resources->planes[i]);
-+ int propc;
-+ if (plane->possible_crtcs & (1 << c->pipe)) {
-+ drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(fd, plane_resources->planes[i], DRM_MODE_OBJECT_PLANE);
-+ for(propc = 0; propc < props->count_props; propc++) {
-+ drmModePropertyPtr prop = drmModeGetProperty(fd, props->props[propc]);
-+ if(strcmp(prop->name, "FB_ID") == 0)
-+ c->pdata[0].fb_id_property = props->props[propc];
-+ }
-+ c->pdata[0].plane = plane_resources->planes[i];
-+ stored_plane = c->pdata;
-+ break;
-+ }
-+ }
-+ if (stored_plane == NULL)
-+ goto error_no_plane;
-+ }
-+ c->fb_bo = omap_bo_new (dev, best_area * 2, OMAP_BO_WC);
-+ if (c->fb_bo) {
-+ uint32_t fourcc = DRM_FORMAT_RGB565;
-+ uint32_t handles[4] = { omap_bo_handle (c->fb_bo) };
-+ uint32_t pitches[4] = { c->mode->hdisplay * 2 };
-+ uint32_t offsets[4] = { 0 };
-+ ret = drmModeAddFB2 (fd, c->mode->hdisplay, c->mode->vdisplay,
-+ fourcc, handles, pitches, offsets, &c->fb_id, 0);
-+ if (ret) {
-+ GST_DEBUG ("RGB565 AddFb2 failed");
-+ }
-+ }
-+
-+ /* now set the desired mode: */
-+ ret = drmModeSetCrtc (fd, c->crtc, c->fb_id, 0, 0, &c->id, 1, c->mode);
-+ if (ret) {
-+ GST_DEBUG ("SetCrtc failed");
-+ }
-+
-+ return TRUE;
-+
-+fail:
-+ gst_drm_connector_cleanup (fd, c);
-+
-+ return FALSE;
-+
-+error_no_connector:
-+ GST_DEBUG ("could not get connector %s", strerror (errno));
-+ goto fail;
-+
-+error_no_mode:
-+ GST_DEBUG ("could not find mode %dx%d (count_modes %d)",
-+ width, height, c->connector->count_modes);
-+ goto fail;
-+
-+error_no_encoder:
-+ GST_DEBUG ("could not get encoder: %s", strerror (errno));
-+ goto fail;
-+
-+error_no_crtc:
-+ GST_DEBUG ("couldn't find a crtc");
-+ goto fail;
-+
-+error_no_plane:
-+ GST_DEBUG ("couldn't find a plane");
-+ goto fail;
-+}
-+
-+gboolean
-+gst_drm_connector_find_mode_and_plane (int fd,
-+ struct omap_device *dev, int width, int height,
-+ drmModeRes * resources, drmModePlaneRes * plane_resources,
-+ struct connector *c)
-+{
-+ int i;
-+ gboolean found = FALSE;
-+
-+ /* First, find the connector & mode */
-+ if (c->id == 0) {
-+ /* Any connector */
-+ GST_DEBUG ("Any connector, %d available", resources->count_connectors);
-+ for (i = 0; i < resources->count_connectors; i++) {
-+ GST_DEBUG (" %d", resources->connectors[i]);
-+ }
-+ for (i = 0; i < resources->count_connectors; i++) {
-+ GST_DEBUG ("Trying connector %d: %d", i, resources->connectors[i]);
-+ c->id = resources->connectors[i];
-+ if (gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height,
-+ resources, plane_resources, c)) {
-+ GST_DEBUG ("Found suitable connector");
-+ found = TRUE;
-+ break;
-+ }
-+ GST_DEBUG ("Connector not suitable");
-+ }
-+ } else {
-+ /* A specific connector */
-+ GST_DEBUG ("Connector %d", c->id);
-+ found =
-+ gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height,
-+ resources, plane_resources, c);
-+ }
-+
-+ return found;
-+}
-+
-+/* table nicked off libdrm's modetest.c */
-+/* *INDENT-OFF* */
-+static const struct {
-+ int type_id;
-+ const char *type_name;
-+} connector_type_names[] = {
-+ { DRM_MODE_CONNECTOR_Unknown, "unknown" },
-+ { DRM_MODE_CONNECTOR_VGA, "VGA" },
-+ { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
-+ { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
-+ { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
-+ { DRM_MODE_CONNECTOR_Composite, "composite" },
-+ { DRM_MODE_CONNECTOR_SVIDEO, "s-video" },
-+ { DRM_MODE_CONNECTOR_LVDS, "LVDS" },
-+ { DRM_MODE_CONNECTOR_Component, "component" },
-+ { DRM_MODE_CONNECTOR_9PinDIN, "9-pin-DIN" },
-+ { DRM_MODE_CONNECTOR_DisplayPort, "displayport" },
-+ { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
-+ { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
-+ { DRM_MODE_CONNECTOR_TV, "TV" },
-+ { DRM_MODE_CONNECTOR_eDP, "embedded-displayport" },
-+};
-+/* *INDENT-ON* */
-+
-+gboolean
-+gst_drm_connector_find_mode_and_plane_by_name (int fd,
-+ struct omap_device * dev, int width, int height,
-+ drmModeRes * resources, drmModePlaneRes * plane_resources,
-+ struct connector * c, const char *name)
-+{
-+ int i, n;
-+ char tmp[64];
-+ const char *type_name;
-+ int found[G_N_ELEMENTS (connector_type_names)] = { 0 };
-+
-+ /* Find connector from name */
-+ for (i = 0; i < resources->count_connectors; i++) {
-+ GST_DEBUG ("Trying connector %d: %d", i, resources->connectors[i]);
-+ c->id = resources->connectors[i];
-+ c->connector = drmModeGetConnector (fd, c->id);
-+ if (!c->connector)
-+ continue;
-+
-+ /* Find type name from this connector */
-+ for (n = 0; n < G_N_ELEMENTS (connector_type_names); n++)
-+ if (connector_type_names[n].type_id == c->connector->connector_type)
-+ break;
-+ if (n == G_N_ELEMENTS (connector_type_names))
-+ continue;
-+
-+ type_name = connector_type_names[n].type_name;
-+ GST_DEBUG ("Connector %d has type %s", i, type_name);
-+ ++found[n];
-+
-+ drmModeFreeConnector (c->connector);
-+ c->connector = NULL;
-+
-+ /* Try a few different matches, such as modetest and xrandr
-+ output, and also a indexless one matching first found */
-+ snprintf (tmp, sizeof (tmp), "%s-%u", type_name, found[n]);
-+ if (!g_ascii_strcasecmp (tmp, name))
-+ goto found;
-+ snprintf (tmp, sizeof (tmp), "%s%u", type_name, found[n]);
-+ if (!g_ascii_strcasecmp (tmp, name))
-+ goto found;
-+ if (!g_ascii_strcasecmp (name, type_name))
-+ goto found;
-+
-+ continue;
-+
-+ found:
-+ if (gst_drm_connector_find_mode_and_plane_helper (fd, dev, width, height,
-+ resources, plane_resources, c)) {
-+ GST_DEBUG ("Found suitable connector");
-+ return TRUE;
-+ }
-+ GST_DEBUG ("Connector not suitable");
-+ }
-+
-+ return FALSE;
-+}
-diff --git a/sys/kms/gstdrmutils.h b/sys/kms/gstdrmutils.h
-new file mode 100644
-index 0000000..ebc5fc6
---- /dev/null
-+++ b/sys/kms/gstdrmutils.h
-@@ -0,0 +1,50 @@
-+#ifndef __GST_DRMUTILS_H__
-+#define __GST_DRMUTILS_H__
-+
-+#include <fcntl.h>
-+#include <xf86drm.h>
-+#include <stdio.h>
-+#include <stdint.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <assert.h>
-+#include <libdrm/drm.h>
-+#include <libdrm/drm_mode.h>
-+#include <xf86drmMode.h>
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <drm_fourcc.h>
-+#include <gst/gst.h>
-+#include <sys/ioctl.h>
-+
-+struct plane_data {
-+ int plane;
-+ int fb_id_property;
-+};
-+
-+struct connector {
-+ uint32_t id;
-+ char mode_str[64];
-+ drmModeConnector *connector;
-+ drmModeModeInfo *mode;
-+ drmModeEncoder *encoder;
-+ uint32_t fb_id;
-+ struct omap_bo *fb_bo;
-+ int crtc;
-+ int pipe;
-+ struct plane_data *pdata;
-+};
-+
-+void gst_drm_connector_cleanup (int fd, struct connector * c);
-+gboolean gst_drm_connector_find_mode_and_plane (int fd,
-+ struct omap_device * dev, int width, int height,
-+ drmModeRes * resources, drmModePlaneRes * plane_resources,
-+ struct connector *c);
-+gboolean gst_drm_connector_find_mode_and_plane_by_name (int fd,
-+ struct omap_device *dev, int width, int height,
-+ drmModeRes * resources, drmModePlaneRes * plane_resources,
-+ struct connector *c, const char *name);
-+
-+#endif /* __GST_DRMUTILS_H__ */
-diff --git a/sys/kms/gstkmsbufferpriv.c b/sys/kms/gstkmsbufferpriv.c
-new file mode 100644
-index 0000000..172a4c3
---- /dev/null
-+++ b/sys/kms/gstkmsbufferpriv.c
-@@ -0,0 +1,121 @@
-+/*
-+ * GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ * Copyright (C) 2012 Collabora Ltd
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ * Rob Clark <rob.clark@linaro.org>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation
-+ * version 2.1 of the License.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include <stdint.h>
-+#include <gst/gst.h>
-+#include <gst/allocators/allocators.h>
-+
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <xf86drmMode.h>
-+
-+#include "gstkmssink.h"
-+#include "gstkmsbufferpriv.h"
-+
-+static int
-+create_fb (GstKMSBufferPriv * priv, GstKMSSink * sink)
-+{
-+ /* TODO get format, etc from caps.. and query device for
-+ * supported formats, and make this all more flexible to
-+ * cope with various formats:
-+ */
-+ uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+
-+ uint32_t handles[4] = {
-+ omap_bo_handle (priv->bo), omap_bo_handle (priv->bo),
-+ };
-+ uint32_t pitches[4] = {
-+ GST_ROUND_UP_4 (sink->input_width), GST_ROUND_UP_4 (sink->input_width),
-+ };
-+ uint32_t offsets[4] = {
-+ 0, pitches[0] * sink->input_height
-+ };
-+
-+ return drmModeAddFB2 (priv->fd, sink->input_width, sink->input_height,
-+ fourcc, handles, pitches, offsets, &priv->fb_id, 0);
-+}
-+
-+/**
-+ * gst_kms_buffer_priv:
-+ * @sink: a #GstKMSSink
-+ * @buf: a pointer to #GstBuffer
-+ *
-+ * Checks if the @buf has a GstMetaDmaBuf metadata set. If it doesn't we return a NULL
-+ * indicating its not a dmabuf buffer. We maintain a hashtable with dmabuf fd as key and
-+ * the GstKMSBufferPriv structure as value
-+ *
-+ * Returns: the #GstKMSBufferPriv
-+ *
-+ * Since: 1.2.?
-+ */
-+GstKMSBufferPriv *
-+gst_kms_buffer_priv (GstKMSSink * sink, GstBuffer * buf)
-+{
-+ struct omap_bo *bo;
-+ int fd;
-+ int fd_copy;
-+ GstKMSBufferPriv * priv;
-+ GstMemory *mem;
-+
-+ /* if it isn't a dmabuf buffer that we can import, then there
-+ * is nothing we can do with it:
-+ */
-+ mem = gst_buffer_peek_memory (buf, 0);
-+ fd_copy = gst_fd_memory_get_fd (mem);
-+ if (fd_copy < 0) {
-+ GST_DEBUG_OBJECT (sink, "not importing non dmabuf buffer");
-+ return NULL;
-+ }
-+
-+ /* lookup the hashtable with fd as key. If present return bo & buffer structure */
-+ priv = g_hash_table_lookup (sink->kmsbufferpriv, (gpointer)fd_copy);
-+ if(priv) {
-+ return priv;
-+ }
-+
-+ priv = g_malloc0 (sizeof (GstKMSBufferPriv));
-+ bo = omap_bo_from_dmabuf (sink->dev, fd_copy);
-+ fd = sink->fd;
-+
-+ priv->bo = bo;
-+ priv->fd = fd;
-+
-+ if (create_fb (priv, sink)) {
-+ GST_WARNING_OBJECT (sink, "could not create framebuffer: %s",
-+ strerror (errno));
-+ g_free(priv);
-+ return NULL;
-+ }
-+
-+ /* if fd not present, write to hash table fd and the corresponding priv. */
-+ g_hash_table_insert(sink->kmsbufferpriv, (gpointer)fd_copy, priv);
-+
-+
-+ return priv;
-+}
-diff --git a/sys/kms/gstkmsbufferpriv.h b/sys/kms/gstkmsbufferpriv.h
-new file mode 100644
-index 0000000..a1070da
---- /dev/null
-+++ b/sys/kms/gstkmsbufferpriv.h
-@@ -0,0 +1,64 @@
-+/*
-+ * GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ * Copyright (C) 2012 Collabora Ltd
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ * Rob Clark <rob.clark@linaro.org>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation
-+ * version 2.1 of the License.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+#ifndef __GSTKMSBUFFERPRIV_H__
-+#define __GSTKMSBUFFERPRIV_H__
-+
-+#include <stdint.h>
-+#include <gst/gst.h>
-+
-+G_BEGIN_DECLS
-+
-+/*
-+ * per-buffer private data so kmssink can attach a drm_framebuffer
-+ * handle (fb_id) to a buffer, which gets deleted when the buffer
-+ * is finalized
-+ */
-+
-+#define GST_TYPE_KMS_BUFFER_PRIV \
-+ (gst_kms_buffer_priv_get_type ())
-+#define GST_KMS_BUFFER_PRIV(obj) \
-+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_KMS_BUFFER_PRIV, GstKMSBufferPriv))
-+#define GST_IS_KMS_BUFFER_PRIV(obj) \
-+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_KMS_BUFFER_PRIV))
-+
-+
-+typedef struct
-+{
-+ struct omap_bo *bo;
-+ int fd;
-+ uint32_t fb_id;
-+}GstKMSBufferPriv;
-+
-+
-+GType gst_kms_buffer_priv_get_type (void);
-+
-+/* Returns a GstKMSBufferPriv, if it has a dmabuf fd metadata */
-+GstKMSBufferPriv * gst_kms_buffer_priv (GstKMSSink *sink, GstBuffer * buf);
-+
-+G_END_DECLS
-+
-+
-+#endif /* __GSTKMSBUFFERPRIV_H__ */
-diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
-new file mode 100644
-index 0000000..17e6407
---- /dev/null
-+++ b/sys/kms/gstkmssink.c
-@@ -0,0 +1,740 @@
-+/* GStreamer
-+ * Copyright (C) 2012 Texas Instruments
-+ * Copyright (C) 2012 Collabora Ltd
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include "gstkmssink.h"
-+#include "gstkmsbufferpriv.h"
-+
-+#include <libdce.h>
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <xf86drmMode.h>
-+
-+static int drm_fd = -1;
-+static struct omap_device *drm_dev;
-+static int once =1;
-+
-+GST_DEBUG_CATEGORY (gst_debug_kms_sink);
-+#define GST_CAT_DEFAULT gst_debug_kms_sink
-+
-+G_DEFINE_TYPE (GstKMSSink, gst_kms_sink, GST_TYPE_VIDEO_SINK);
-+
-+static void gst_kms_sink_reset (GstKMSSink * sink);
-+
-+static GstStaticPadTemplate gst_kms_sink_template_factory =
-+GST_STATIC_PAD_TEMPLATE ("sink",
-+ GST_PAD_SINK,
-+ GST_PAD_ALWAYS,
-+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("NV12"))
-+ );
-+
-+enum
-+{
-+ PROP_0,
-+ PROP_PIXEL_ASPECT_RATIO,
-+ PROP_FORCE_ASPECT_RATIO,
-+ PROP_SCALE,
-+ PROP_CONNECTOR,
-+ PROP_CONNECTOR_NAME,
-+};
-+
-+
-+static inline void
-+display_bufs_queue (GstKMSSink * sink, GstBuffer * buf)
-+{
-+ int i;
-+ for (i = 0; i < (NUM_DISPLAY_BUFS - 1); i++)
-+ gst_buffer_replace (&sink->display_bufs[i], sink->display_bufs[i + 1]);
-+ gst_buffer_replace (&sink->display_bufs[i], buf);
-+}
-+
-+static inline void
-+display_bufs_free (GstKMSSink * sink)
-+{
-+ int i;
-+ for (i = 0; i < NUM_DISPLAY_BUFS; i++)
-+ gst_buffer_replace (&sink->display_bufs[i], NULL);
-+}
-+
-+static gboolean
-+gst_kms_sink_calculate_aspect_ratio (GstKMSSink * sink, gint width,
-+ gint height, gint video_par_n, gint video_par_d)
-+{
-+ guint calculated_par_n;
-+ guint calculated_par_d;
-+
-+ if (!gst_video_calculate_display_ratio (&calculated_par_n, &calculated_par_d,
-+ width, height, video_par_n, video_par_d, 1, 1)) {
-+ GST_ELEMENT_ERROR (sink, CORE, NEGOTIATION, (NULL),
-+ ("Error calculating the output display ratio of the video."));
-+ return FALSE;
-+ }
-+ GST_DEBUG_OBJECT (sink,
-+ "video width/height: %dx%d, calculated display ratio: %d/%d",
-+ width, height, calculated_par_n, calculated_par_d);
-+
-+ /* now find a width x height that respects this display ratio.
-+ * prefer those that have one of w/h the same as the incoming video
-+ * using wd / hd = calculated_pad_n / calculated_par_d */
-+
-+ /* start with same height, because of interlaced video */
-+ /* check hd / calculated_par_d is an integer scale factor, and scale wd with the PAR */
-+ if (height % calculated_par_d == 0) {
-+ GST_DEBUG_OBJECT (sink, "keeping video height");
-+ GST_VIDEO_SINK_WIDTH (sink) = (guint)
-+ gst_util_uint64_scale_int (height, calculated_par_n, calculated_par_d);
-+ GST_VIDEO_SINK_HEIGHT (sink) = height;
-+ } else if (width % calculated_par_n == 0) {
-+ GST_DEBUG_OBJECT (sink, "keeping video width");
-+ GST_VIDEO_SINK_WIDTH (sink) = width;
-+ GST_VIDEO_SINK_HEIGHT (sink) = (guint)
-+ gst_util_uint64_scale_int (width, calculated_par_d, calculated_par_n);
-+ } else {
-+ GST_DEBUG_OBJECT (sink, "approximating while keeping video height");
-+ GST_VIDEO_SINK_WIDTH (sink) = (guint)
-+ gst_util_uint64_scale_int (height, calculated_par_n, calculated_par_d);
-+ GST_VIDEO_SINK_HEIGHT (sink) = height;
-+ }
-+ GST_DEBUG_OBJECT (sink, "scaling to %dx%d",
-+ GST_VIDEO_SINK_WIDTH (sink), GST_VIDEO_SINK_HEIGHT (sink));
-+
-+ return TRUE;
-+}
-+
-+static gboolean
-+gst_kms_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
-+{
-+ GstKMSSink *sink;
-+ gboolean ret = TRUE;
-+ gint width, height;
-+ gint fps_n, fps_d;
-+ gint par_n, par_d;
-+ GstVideoFormat format;
-+ GstVideoInfo info;
-+ GstStructure *conf;
-+ GstStructure *s;
-+ int size;
-+
-+ sink = GST_KMS_SINK (bsink);
-+
-+ ret = gst_video_info_from_caps (&info, caps);
-+ format = GST_VIDEO_INFO_FORMAT(&info);
-+ width = GST_VIDEO_INFO_WIDTH(&info);
-+ height = GST_VIDEO_INFO_HEIGHT(&info);
-+ fps_n = GST_VIDEO_INFO_FPS_N(&info);
-+ fps_d = GST_VIDEO_INFO_FPS_D(&info);
-+ par_n = GST_VIDEO_INFO_PAR_N(&info);
-+ par_d = GST_VIDEO_INFO_PAR_D(&info);
-+
-+ if (!ret)
-+ return FALSE;
-+
-+ if (width <= 0 || height <= 0) {
-+ GST_ELEMENT_ERROR (sink, CORE, NEGOTIATION, (NULL),
-+ ("Invalid image size."));
-+ return FALSE;
-+ }
-+
-+ sink->format = format;
-+ sink->par_n = par_n;
-+ sink->par_d = par_d;
-+ sink->src_rect.x = sink->src_rect.y = 0;
-+ sink->src_rect.w = width;
-+ sink->src_rect.h = height;
-+ sink->input_width = width;
-+ sink->input_height = height;
-+ size = info.size;
-+
-+ if (!sink->pool) {
-+ GstAllocator *allocator;
-+
-+ allocator = gst_drm_allocator_get ();
-+ sink->pool = gst_buffer_pool_new ();
-+ conf = gst_buffer_pool_get_config (GST_BUFFER_POOL(sink->pool));
-+ gst_buffer_pool_config_set_params (conf, caps, size, 0, 0);
-+ gst_buffer_pool_config_set_allocator (conf, allocator, NULL);
-+ gst_buffer_pool_set_config (GST_BUFFER_POOL(sink->pool), conf);
-+ if (allocator)
-+ gst_object_unref (allocator);
-+ }
-+
-+ sink->conn.crtc = -1;
-+ return TRUE;
-+}
-+
-+static void
-+gst_kms_sink_get_times (GstBaseSink * bsink, GstBuffer * buf,
-+ GstClockTime * start, GstClockTime * end)
-+{
-+ GstKMSSink *sink;
-+
-+ sink = GST_KMS_SINK (bsink);
-+
-+ if (GST_BUFFER_PTS_IS_VALID (buf)) {
-+ *start = GST_BUFFER_PTS (buf);
-+ if (GST_BUFFER_DURATION_IS_VALID (buf)) {
-+ *end = *start + GST_BUFFER_DURATION (buf);
-+ } else {
-+ if (sink->fps_n > 0) {
-+ *end = *start +
-+ gst_util_uint64_scale_int (GST_SECOND, sink->fps_d, sink->fps_n);
-+ }
-+ }
-+ }
-+}
-+
-+
-+static void page_flip_handler(int fd, unsigned int frame,
-+ unsigned int sec, unsigned int usec, void *data)
-+{
-+ int *waiting_for_flip = data;
-+ *waiting_for_flip = 0;
-+}
-+
-+
-+static GstFlowReturn
-+gst_kms_sink_show_frame (GstVideoSink * vsink, GstBuffer * inbuf)
-+{
-+ GstKMSSink *sink = GST_KMS_SINK (vsink);
-+ GstBuffer *buf = NULL;
-+ GstKMSBufferPriv *priv;
-+ GstFlowReturn flow_ret = GST_FLOW_OK;
-+ int ret = 0;
-+ gint width, height;
-+ GstVideoRectangle *c = &sink->src_rect;
-+ int waiting_for_flip = 1;
-+
-+ fd_set fds;
-+ drmEventContext evctx = {
-+ .version = DRM_EVENT_CONTEXT_VERSION,
-+ .vblank_handler = 0,
-+ .page_flip_handler = page_flip_handler,
-+ };
-+
-+ g_mutex_lock (&sink->render_lock);
-+ GstVideoCropMeta* crop = gst_buffer_get_video_crop_meta (inbuf);
-+ if (crop){
-+ c->y = crop->y;
-+ c->x = crop->x;
-+
-+ if (crop->width >= 0) {
-+ width = crop->width;
-+ } else {
-+ width = sink->input_width;
-+ }
-+ if (crop->height >= 0){
-+ height = crop->height;
-+ } else {
-+ height = sink->input_height;
-+ }
-+ } else {
-+ width = sink->input_width;
-+ height = sink->input_height;
-+ }
-+
-+ c->w = width;
-+ c->h = height;
-+
-+
-+ if (!gst_kms_sink_calculate_aspect_ratio (sink, width, height,
-+ sink->par_n, sink->par_d))
-+ GST_DEBUG_OBJECT (sink, "calculate aspect ratio failed");
-+
-+
-+ GST_INFO_OBJECT (sink, "enter");
-+
-+ if (sink->conn.crtc == -1) {
-+ if (sink->conn_name) {
-+ if (!gst_drm_connector_find_mode_and_plane_by_name (sink->fd,
-+ sink->dev, sink->src_rect.w, sink->src_rect.h,
-+ sink->resources, sink->plane_resources, &sink->conn,
-+ sink->conn_name))
-+ goto connector_not_found;
-+ } else {
-+ sink->conn.id = sink->conn_id;
-+ if (!gst_drm_connector_find_mode_and_plane (sink->fd,
-+ sink->dev, sink->src_rect.w, sink->src_rect.h,
-+ sink->resources, sink->plane_resources, &sink->conn))
-+ goto connector_not_found;
-+ }
-+ once = 1;
-+ }
-+
-+ priv = gst_kms_buffer_priv (sink, inbuf);
-+
-+ if (priv) {
-+ buf = inbuf;
-+ } else {
-+ GST_LOG_OBJECT (sink, "not a KMS buffer, slow-path!");
-+ gst_buffer_pool_acquire_buffer (sink->pool, &buf, NULL);
-+ if (buf) {
-+ GST_BUFFER_PTS (buf) = GST_BUFFER_PTS (inbuf);
-+ GST_BUFFER_DURATION (buf) = GST_BUFFER_DURATION (inbuf);
-+ gst_buffer_copy_into (buf, inbuf, GST_BUFFER_COPY_DEEP, 0 ,-1);
-+ priv = gst_kms_buffer_priv (sink, buf);
-+ }
-+ if (!priv)
-+ goto add_fb2_failed;
-+ }
-+
-+ if (once) {
-+ once = 0;
-+ static GstVideoRectangle dest = { 0 };
-+ dest.w = sink->conn.mode->hdisplay;
-+ dest.h = sink->conn.mode->vdisplay;
-+
-+ gst_video_sink_center_rect (sink->src_rect, dest, &sink->dst_rect,
-+ sink->scale);
-+ ret = drmModeSetPlane (sink->fd, sink->conn.pdata[0].plane,
-+ sink->conn.crtc, priv->fb_id, 0,
-+ sink->dst_rect.x, sink->dst_rect.y, sink->dst_rect.w, sink->dst_rect.h,
-+ sink->src_rect.x << 16, sink->src_rect.y << 16,
-+ sink->src_rect.w << 16, sink->src_rect.h << 16);
-+ if (ret)
-+ goto set_plane_failed;
-+ }
-+
-+ drmModeAtomicReqPtr m_req = drmModeAtomicAlloc();
-+
-+ drmModeAtomicAddProperty(m_req, sink->conn.pdata[0].plane,
-+ sink->conn.pdata[0].fb_id_property,
-+ priv->fb_id);
-+
-+ drmModeAtomicCommit(sink->fd, m_req, DRM_MODE_ATOMIC_TEST_ONLY, 0);
-+ drmModeAtomicCommit(sink->fd, m_req, DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK, &waiting_for_flip);
-+ drmModeAtomicFree(m_req);
-+
-+ while (waiting_for_flip) {
-+ FD_ZERO(&fds);
-+ FD_SET(sink->fd, &fds);
-+ int err;
-+ err = select(sink->fd + 1, &fds, NULL, NULL, NULL);
-+ if (err < 0) {
-+ GST_ERROR_OBJECT (sink,"select err: %s\n", strerror(errno));
-+ flow_ret = GST_FLOW_ERROR;
-+ goto out;
-+ }
-+ if (FD_ISSET(sink->fd, &fds)) {
-+ drmHandleEvent(sink->fd, &evctx);
-+ }
-+ }
-+
-+ display_bufs_queue (sink, buf);
-+
-+out:
-+ GST_INFO_OBJECT (sink, "exit");
-+ if (buf != inbuf)
-+ gst_buffer_unref (buf);
-+ g_mutex_unlock (&sink->render_lock);
-+ return flow_ret;
-+
-+add_fb2_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("drmModeAddFB2 failed: %s (%d)", strerror (errno), errno));
-+ flow_ret = GST_FLOW_ERROR;
-+ goto out;
-+
-+set_plane_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("drmModeSetPlane failed: %s (%d)", strerror (errno), errno));
-+ flow_ret = GST_FLOW_ERROR;
-+ goto out;
-+
-+connector_not_found:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, NOT_FOUND,
-+ (NULL), ("connector not found", strerror (errno), errno));
-+ goto out;
-+}
-+
-+
-+static gboolean
-+gst_kms_sink_event (GstBaseSink * bsink, GstEvent * event)
-+{
-+ GstKMSSink *sink = GST_KMS_SINK (bsink);
-+
-+ switch (GST_EVENT_TYPE (event)) {
-+ default:
-+ break;
-+ }
-+ if (GST_BASE_SINK_CLASS (gst_kms_sink_parent_class)->event)
-+ return GST_BASE_SINK_CLASS (gst_kms_sink_parent_class)->event (bsink,
-+ event);
-+ else
-+ return TRUE;
-+}
-+
-+static void
-+gst_kms_sink_set_property (GObject * object, guint prop_id,
-+ const GValue * value, GParamSpec * pspec)
-+{
-+ GstKMSSink *sink;
-+
-+ g_return_if_fail (GST_IS_KMS_SINK (object));
-+
-+ sink = GST_KMS_SINK (object);
-+
-+ switch (prop_id) {
-+ case PROP_FORCE_ASPECT_RATIO:
-+ sink->keep_aspect = g_value_get_boolean (value);
-+ break;
-+ case PROP_SCALE:
-+ sink->scale = g_value_get_boolean (value);
-+ break;
-+ case PROP_CONNECTOR:
-+ sink->conn_id = g_value_get_uint (value);
-+ break;
-+ case PROP_CONNECTOR_NAME:
-+ g_free (sink->conn_name);
-+ sink->conn_name = g_strdup (g_value_get_string (value));
-+ break;
-+ case PROP_PIXEL_ASPECT_RATIO:
-+ {
-+ GValue *tmp;
-+
-+ tmp = g_new0 (GValue, 1);
-+ g_value_init (tmp, GST_TYPE_FRACTION);
-+
-+ if (!g_value_transform (value, tmp)) {
-+ GST_WARNING_OBJECT (sink, "Could not transform string to aspect ratio");
-+ } else {
-+ sink->par_n = gst_value_get_fraction_numerator (tmp);
-+ sink->par_d = gst_value_get_fraction_denominator (tmp);
-+ GST_DEBUG_OBJECT (sink, "set PAR to %d/%d", sink->par_n, sink->par_d);
-+ }
-+ g_free (tmp);
-+ }
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+gst_kms_sink_get_property (GObject * object, guint prop_id,
-+ GValue * value, GParamSpec * pspec)
-+{
-+ GstKMSSink *sink;
-+
-+ g_return_if_fail (GST_IS_KMS_SINK (object));
-+
-+ sink = GST_KMS_SINK (object);
-+
-+ switch (prop_id) {
-+ case PROP_FORCE_ASPECT_RATIO:
-+ g_value_set_boolean (value, sink->keep_aspect);
-+ break;
-+ case PROP_SCALE:
-+ g_value_set_boolean (value, sink->scale);
-+ break;
-+ case PROP_CONNECTOR:
-+ g_value_set_uint (value, sink->conn.id);
-+ break;
-+ case PROP_PIXEL_ASPECT_RATIO:
-+ {
-+ char *v = g_strdup_printf ("%d/%d", sink->par_n, sink->par_d);
-+ g_value_take_string (value, v);
-+ break;
-+ }
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-+ break;
-+ }
-+}
-+
-+static void
-+gst_kms_sink_reset (GstKMSSink * sink)
-+{
-+ GST_DEBUG_OBJECT (sink, "reset");
-+
-+ if (sink->fd != -1) {
-+ gst_drm_connector_cleanup (sink->fd, &sink->conn);
-+ }
-+ memset (&sink->conn, 0, sizeof (struct connector));
-+
-+ display_bufs_free (sink);
-+
-+ if (sink->pool) {
-+ gst_buffer_pool_set_active (GST_BUFFER_POOL(sink->pool), FALSE);
-+ gst_object_unref(sink->pool);
-+ sink->pool = NULL;
-+ }
-+
-+ if (sink->plane_resources) {
-+ drmModeFreePlaneResources (sink->plane_resources);
-+ sink->plane_resources = NULL;
-+ }
-+
-+ if (sink->resources) {
-+ drmModeFreeResources (sink->resources);
-+ sink->resources = NULL;
-+ }
-+
-+ sink->par_n = sink->par_d = 1;
-+ sink->src_rect.x = 0;
-+ sink->src_rect.y = 0;
-+ sink->src_rect.w = 0;
-+ sink->src_rect.h = 0;
-+ sink->input_width = 0;
-+ sink->input_height = 0;
-+ sink->format = GST_VIDEO_FORMAT_UNKNOWN;
-+
-+ memset (&sink->src_rect, 0, sizeof (GstVideoRectangle));
-+ memset (&sink->dst_rect, 0, sizeof (GstVideoRectangle));
-+}
-+
-+static gboolean
-+gst_kms_sink_start (GstBaseSink * bsink)
-+{
-+ GstKMSSink *sink;
-+
-+ sink = GST_KMS_SINK (bsink);
-+
-+ drm_dev = dce_init ();
-+ if (drm_dev == NULL)
-+ goto device_failed;
-+ else {
-+ sink->dev = drm_dev;
-+ sink->fd = dce_get_fd ();
-+ drm_fd = dce_get_fd ();
-+ }
-+
-+ sink->resources = drmModeGetResources (sink->fd);
-+ if (sink->resources == NULL)
-+ goto resources_failed;
-+
-+ sink->plane_resources = drmModeGetPlaneResources (sink->fd);
-+ if (sink->plane_resources == NULL)
-+ goto plane_resources_failed;
-+
-+ return TRUE;
-+
-+fail:
-+ gst_kms_sink_reset (sink);
-+ return FALSE;
-+
-+device_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("omap_device_new failed"));
-+ goto fail;
-+
-+resources_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("drmModeGetResources failed: %s (%d)", strerror (errno), errno));
-+ goto fail;
-+
-+plane_resources_failed:
-+ GST_ELEMENT_ERROR (sink, RESOURCE, FAILED,
-+ (NULL), ("drmModeGetPlaneResources failed: %s (%d)",
-+ strerror (errno), errno));
-+ goto fail;
-+}
-+
-+static gboolean
-+gst_kms_sink_stop (GstBaseSink * bsink)
-+{
-+ GstKMSSink *sink;
-+
-+ sink = GST_KMS_SINK (bsink);
-+ gst_kms_sink_reset (sink);
-+
-+ return TRUE;
-+}
-+
-+
-+static gboolean
-+gst_kms_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
-+{
-+ GstKMSSink *sink;
-+ GstStructure *conf;
-+ GstCaps *caps;
-+ guint size;
-+ gboolean need_pool;
-+ GstStructure *s;
-+ int num_buffers = 0;
-+
-+
-+ sink = GST_KMS_SINK (bsink);
-+
-+ GST_DEBUG_OBJECT (sink, "begin");
-+
-+ gst_query_parse_allocation (query, &caps, &need_pool);
-+
-+ if (G_UNLIKELY (!caps)) {
-+ GST_WARNING_OBJECT (sink, "have no caps, doing fallback allocation");
-+ return FALSE;
-+ }
-+
-+ if (need_pool) {
-+ GstVideoInfo info;
-+
-+ if (!gst_video_info_from_caps (&info, caps))
-+ goto invalid_caps;
-+
-+ GST_LOG_OBJECT (sink,
-+ "a bufferpool was requested with caps %" GST_PTR_FORMAT, caps);
-+
-+ /* We already have a pool after set_caps */
-+ if (sink->pool) {
-+ GstStructure *config;
-+ int min,max;
-+ config = gst_buffer_pool_get_config (sink->pool);
-+ gst_buffer_pool_config_get_params (config, NULL, &size, &min, &max);
-+ gst_structure_free (config);
-+
-+ gst_query_add_allocation_pool (query, sink->pool, size, min, max);
-+ gst_query_add_allocation_param (query, gst_drm_allocator_get (), NULL);
-+ return TRUE;
-+ } else {
-+ GST_LOG_OBJECT (sink, "No bufferpool available");
-+ return FALSE;
-+ }
-+ }
-+
-+
-+invalid_caps:
-+ GST_DEBUG_OBJECT (sink, "invalid caps specified");
-+ return FALSE;
-+}
-+
-+static void
-+gst_kms_sink_finalize (GObject * object)
-+{
-+ GstKMSSink *sink;
-+
-+ sink = GST_KMS_SINK (object);
-+ g_mutex_clear (&sink->render_lock);
-+ g_free (sink->conn_name);
-+ if (sink->kmsbufferpriv){
-+ g_hash_table_destroy (sink->kmsbufferpriv);
-+ sink->kmsbufferpriv = NULL;
-+ gst_kms_sink_reset (sink);
-+}
-+
-+ G_OBJECT_CLASS (gst_kms_sink_parent_class)->finalize (object);
-+}
-+
-+static void
-+kmsbufferpriv_free_func (GstKMSBufferPriv *priv)
-+{
-+ drmModeRmFB (priv->fd, priv->fb_id);
-+ omap_bo_del (priv->bo);
-+ g_free(priv);
-+}
-+
-+
-+static void
-+gst_kms_sink_init (GstKMSSink * sink)
-+{
-+ sink->fd = -1;
-+ gst_kms_sink_reset (sink);
-+ sink->kmsbufferpriv = g_hash_table_new_full (g_direct_hash, g_direct_equal,
-+ NULL, (GDestroyNotify) kmsbufferpriv_free_func);
-+ g_mutex_init (&sink->render_lock);
-+}
-+
-+static void
-+gst_kms_sink_class_init (GstKMSSinkClass * klass)
-+{
-+ GObjectClass *gobject_class;
-+ GstElementClass *gstelement_class;
-+ GstBaseSinkClass *gstbasesink_class;
-+ GstVideoSinkClass *videosink_class;
-+
-+ gobject_class = (GObjectClass *) klass;
-+ gstelement_class = (GstElementClass *) klass;
-+ gstbasesink_class = (GstBaseSinkClass *) klass;
-+ videosink_class = (GstVideoSinkClass *) klass;
-+
-+ gobject_class->finalize = gst_kms_sink_finalize;
-+ gobject_class->set_property = gst_kms_sink_set_property;
-+ gobject_class->get_property = gst_kms_sink_get_property;
-+
-+ g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO,
-+ g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio",
-+ "When enabled, reverse caps negotiation (scaling) will respect "
-+ "original aspect ratio", FALSE,
-+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+ g_object_class_install_property (gobject_class, PROP_PIXEL_ASPECT_RATIO,
-+ g_param_spec_string ("pixel-aspect-ratio", "Pixel Aspect Ratio",
-+ "The pixel aspect ratio of the device", "1/1",
-+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+ g_object_class_install_property (gobject_class, PROP_SCALE,
-+ g_param_spec_boolean ("scale", "Scale",
-+ "When true, scale to render fullscreen", FALSE,
-+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+ g_object_class_install_property (gobject_class, PROP_CONNECTOR,
-+ g_param_spec_uint ("connector", "Connector",
-+ "DRM connector id (0 for automatic selection)", 0, G_MAXUINT32, 0,
-+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT));
-+ g_object_class_install_property (gobject_class, PROP_CONNECTOR_NAME,
-+ g_param_spec_string ("connector-name", "Connector name",
-+ "DRM connector name (alternative to the connector property, "
-+ "use $type$index, $type-$index, or $type)", "",
-+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
-+
-+ gst_element_class_set_details_simple (gstelement_class,
-+ "Video sink", "Sink/Video",
-+ "A video sink using the linux kernel mode setting API",
-+ "Alessandro Decina <alessandro.d@gmail.com>");
-+
-+ gst_element_class_add_pad_template (gstelement_class,
-+ gst_static_pad_template_get (&gst_kms_sink_template_factory));
-+
-+ gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_kms_sink_setcaps);
-+ gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_kms_sink_get_times);
-+ gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_kms_sink_event);
-+ gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_kms_sink_start);
-+ gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_kms_sink_stop);
-+ gstbasesink_class->propose_allocation = GST_DEBUG_FUNCPTR (gst_kms_sink_propose_allocation);
-+
-+ /* disable preroll as it's called before GST_CROP_EVENT has been received, so
-+ * we end up configuring the wrong mode... (based on padded caps)
-+ */
-+ gstbasesink_class->preroll = NULL;
-+ videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_kms_sink_show_frame);
-+}
-+
-+static gboolean
-+plugin_init (GstPlugin * plugin)
-+{
-+ if (!gst_element_register (plugin, "kmssink",
-+ GST_RANK_PRIMARY + 1, GST_TYPE_KMS_SINK))
-+ return FALSE;
-+
-+ GST_DEBUG_CATEGORY_INIT (gst_debug_kms_sink, "kmssink", 0, "kmssink element");
-+
-+ return TRUE;
-+}
-+
-+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
-+ GST_VERSION_MINOR,
-+ kms,
-+ "KMS video output element",
-+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
-diff --git a/sys/kms/gstkmssink.h b/sys/kms/gstkmssink.h
-new file mode 100644
-index 0000000..9f76839
---- /dev/null
-+++ b/sys/kms/gstkmssink.h
-@@ -0,0 +1,92 @@
-+/* GStreamer
-+ *
-+ * Copyright (C) 2012 Texas Instruments
-+ * Copyright (C) 2012 Collabora Ltd
-+ *
-+ * Authors:
-+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+#ifndef __GST_KMS_SINK_H__
-+#define __GST_KMS_SINK_H__
-+
-+#include <gst/video/video.h>
-+#include <gst/video/gstvideosink.h>
-+#include <gst/drm/gstdrmallocator.h>
-+
-+#include <stdio.h>
-+#include <stdint.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <assert.h>
-+
-+#include "gstdrmutils.h"
-+
-+G_BEGIN_DECLS
-+#define GST_TYPE_KMS_SINK \
-+ (gst_kms_sink_get_type())
-+#define GST_KMS_SINK(obj) \
-+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_KMS_SINK, GstKMSSink))
-+#define GST_KMS_SINK_CLASS(klass) \
-+ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_KMS_SINK, GstKMSSinkClass))
-+#define GST_IS_KMS_SINK(obj) \
-+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_KMS_SINK))
-+#define GST_IS_KMS_SINK_CLASS(klass) \
-+ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_KMS_SINK))
-+typedef struct _GstKMSSink GstKMSSink;
-+typedef struct _GstKMSSinkClass GstKMSSinkClass;
-+
-+#define NUM_DISPLAY_BUFS 1
-+
-+struct _GstKMSSink
-+{
-+ GstVideoSink videosink;
-+ gint input_width, input_height;
-+ GstVideoFormat format;
-+ gint par_n, par_d;
-+ gint fps_n, fps_d;
-+ gboolean keep_aspect;
-+ GstVideoRectangle src_rect;
-+ GstVideoRectangle dst_rect;
-+ int fd;
-+ struct omap_device *dev;
-+ drmModeRes *resources;
-+ drmModePlaneRes *plane_resources;
-+ struct connector conn;
-+ uint32_t conn_id;
-+ char *conn_name;
-+ drmModePlane *plane;
-+ GstBufferPool *pool;
-+ GHashTable *kmsbufferpriv;
-+ /* current displayed buffer and last displayed buffer: */
-+ GstBuffer *display_bufs[NUM_DISPLAY_BUFS];
-+ gboolean scale;
-+ GMutex render_lock;
-+};
-+
-+struct _GstKMSSinkClass
-+{
-+ GstVideoSinkClass parent_class;
-+};
-+
-+GType gst_kms_sink_get_type (void);
-+
-+G_END_DECLS
-+#endif /* __GST_KMS_SINK_H__ */
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch
deleted file mode 100644
index a57a0bbfa..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0003-kmssink-add-YUYV-support.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From 11a3ff4b9451f12374006f853ef5736f5d098932 Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Tue, 14 Mar 2017 17:24:07 -0400
-Subject: [PATCH 3/3] kmssink: add YUYV support
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- sys/kms/gstkmsbufferpriv.c | 32 +++++++++++++++++++++++++++-----
- sys/kms/gstkmssink.c | 2 +-
- 2 files changed, 28 insertions(+), 6 deletions(-)
-
-diff --git a/sys/kms/gstkmsbufferpriv.c b/sys/kms/gstkmsbufferpriv.c
-index 172a4c3..57c01f8 100644
---- a/sys/kms/gstkmsbufferpriv.c
-+++ b/sys/kms/gstkmsbufferpriv.c
-@@ -41,22 +41,44 @@
- static int
- create_fb (GstKMSBufferPriv * priv, GstKMSSink * sink)
- {
-+
- /* TODO get format, etc from caps.. and query device for
- * supported formats, and make this all more flexible to
- * cope with various formats:
- */
-- uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
--
-+ GstVideoFormat format = sink->format;
-+ uint32_t fourcc;
- uint32_t handles[4] = {
-- omap_bo_handle (priv->bo), omap_bo_handle (priv->bo),
-+ omap_bo_handle (priv->bo),
- };
- uint32_t pitches[4] = {
-- GST_ROUND_UP_4 (sink->input_width), GST_ROUND_UP_4 (sink->input_width),
-+ GST_ROUND_UP_4 (sink->input_width),
- };
- uint32_t offsets[4] = {
-- 0, pitches[0] * sink->input_height
-+ 0,
- };
-
-+ /**
-+ * Only two formats are supported:
-+ * AM3/4: YUYV
-+ * AM5: NV12, YUYV
-+ */
-+ if(format == GST_VIDEO_FORMAT_YUY2)
-+ {
-+ /* YUYV */
-+ fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', 'V');
-+ pitches[0] = GST_ROUND_UP_4 (sink->input_width*2);
-+ }
-+ else
-+ {
-+ /* NV12 */
-+ fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+ handles[1] = omap_bo_handle (priv->bo);
-+ pitches[1] = GST_ROUND_UP_4 (sink->input_width);
-+ offsets[1] = pitches[0] * sink->input_height;
-+ }
-+
-+
- return drmModeAddFB2 (priv->fd, sink->input_width, sink->input_height,
- fourcc, handles, pitches, offsets, &priv->fb_id, 0);
- }
-diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
-index 9795bdf..b36d88f 100644
---- a/sys/kms/gstkmssink.c
-+++ b/sys/kms/gstkmssink.c
-@@ -50,7 +50,7 @@ static GstStaticPadTemplate gst_kms_sink_template_factory =
- GST_STATIC_PAD_TEMPLATE ("sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
-- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("NV12"))
-+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE("{NV12,YUY2}"))
- );
-
- enum
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch
deleted file mode 100644
index 2902bc3b2..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch
+++ /dev/null
@@ -1,1728 +0,0 @@
-From 78ddc83ebfe7cf69c62610e1f7d14e7f49bf65c9 Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Wed, 25 Jan 2017 17:09:35 +0530
-Subject: [gst-bad-1.8] gstwaylandsink: Add DRM support on waylandsink
-
-Add wl_drm interface on waylandsink.
-The following features are supported:
-1. Support for mouse drag and drop.
-2. Support for video cropping
-
-The following bug fixes identified earlier have been picked:
-1. Consolidate header files to avoid circular dependency
-2. Fix bug reported on waylandsink incase of same process looping
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- configure.ac | 4 +-
- ext/wayland/Makefile.am | 17 +-
- ext/wayland/gstwaylandsink.c | 82 ++++++-
- ext/wayland/gstwaylandsink.h | 4 +-
- ext/wayland/wayland-drm-client-protocol.h | 213 ++++++++++++++++++
- ext/wayland/wayland-drm-protocol.c | 74 +++++++
- ext/wayland/wlbuffer.c | 2 +-
- ext/wayland/wlbuffer.h | 67 ------
- ext/wayland/wldisplay-wlwindow-wlbuffer.h | 216 ++++++++++++++++++
- ext/wayland/wldisplay.c | 350 +++++++++++++++++++++++++++++-
- ext/wayland/wldisplay.h | 84 -------
- ext/wayland/wldrm.c | 69 ++++++
- ext/wayland/wldrm.h | 3 +
- ext/wayland/wlshmallocator.h | 2 +-
- ext/wayland/wlvideoformat.c | 8 +-
- ext/wayland/wlwindow.c | 47 +++-
- ext/wayland/wlwindow.h | 84 -------
- 17 files changed, 1056 insertions(+), 270 deletions(-)
- create mode 100644 ext/wayland/wayland-drm-client-protocol.h
- create mode 100644 ext/wayland/wayland-drm-protocol.c
- delete mode 100644 ext/wayland/wlbuffer.h
- create mode 100644 ext/wayland/wldisplay-wlwindow-wlbuffer.h
- delete mode 100644 ext/wayland/wldisplay.h
- create mode 100644 ext/wayland/wldrm.c
- create mode 100644 ext/wayland/wldrm.h
- delete mode 100644 ext/wayland/wlwindow.h
-
-diff --git a/configure.ac b/configure.ac
-index 9fdfbc7..76166cb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2172,8 +2172,10 @@ AG_GST_CHECK_FEATURE(DIRECTFB, [directfb], dfbvideosink , [
- dnl **** Wayland ****
- translit(dnm, m, l) AM_CONDITIONAL(USE_WAYLAND, true)
- AC_PATH_PROG([wayland_scanner], [wayland-scanner])
--AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [
-+AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland libdrm libdrm_omap, [
- PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.4.0, [
-+ AC_SUBST(DRM_CFLAGS)
-+ AC_SUBST(DRM_LIBS)
- if test "x$wayland_scanner" != "x"; then
- HAVE_WAYLAND="yes"
- else
-diff --git a/ext/wayland/Makefile.am b/ext/wayland/Makefile.am
-index c742bfc..eb6e326 100644
---- a/ext/wayland/Makefile.am
-+++ b/ext/wayland/Makefile.am
-@@ -3,31 +3,34 @@ plugin_LTLIBRARIES = libgstwaylandsink.la
- libgstwaylandsink_la_SOURCES = \
- gstwaylandsink.c \
- wlshmallocator.c \
-+ wldrm.c \
- wlbuffer.c \
- wldisplay.c \
- wlwindow.c \
- wlvideoformat.c \
-- scaler-protocol.c
-+ scaler-protocol.c \
-+ wayland-drm-protocol.c
-
- libgstwaylandsink_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
-- $(WAYLAND_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS)
-+ $(WAYLAND_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS) $(DRM_CFLAGS)
- libgstwaylandsink_la_LIBADD = \
- $(GST_PLUGINS_BASE_LIBS) \
- -lgstvideo-$(GST_API_VERSION) \
- -lgstallocators-$(GST_API_VERSION) \
- $(WAYLAND_LIBS) \
-- $(top_builddir)/gst-libs/gst/wayland/libgstwayland-$(GST_API_VERSION).la
-+ $(top_builddir)/gst-libs/gst/wayland/libgstwayland-$(GST_API_VERSION).la \
-+ $(top_builddir)/gst-libs/gst/drm/libgstdrm-$(GST_API_VERSION).la
- libgstwaylandsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
- libgstwaylandsink_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
-
- noinst_HEADERS = \
- gstwaylandsink.h \
- wlshmallocator.h \
-- wlbuffer.h \
-- wldisplay.h \
-- wlwindow.h \
-+ wldisplay-wlwindow-wlbuffer.h \
-+ wldrm.h \
- wlvideoformat.h \
-- scaler-client-protocol.h
-+ scaler-client-protocol.h \
-+ wayland-drm-client-protocol.h
-
- EXTRA_DIST = scaler.xml
- CLEANFILES = scaler-protocol.c scaler-client-protocol.h
-diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
-index f4f34a8..3e8ff19 100644
---- a/ext/wayland/gstwaylandsink.c
-+++ b/ext/wayland/gstwaylandsink.c
-@@ -43,8 +43,14 @@
-
- #include "gstwaylandsink.h"
- #include "wlvideoformat.h"
--#include "wlbuffer.h"
- #include "wlshmallocator.h"
-+#include "wldrm.h"
-+
-+#include <gst/drm/gstdrmallocator.h>
-+#include "wayland-drm-client-protocol.h"
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <wayland-client.h>
-
- #include <gst/wayland/wayland.h>
- #include <gst/video/videooverlay.h>
-@@ -60,7 +66,8 @@ enum
- enum
- {
- PROP_0,
-- PROP_DISPLAY
-+ PROP_DISPLAY,
-+ PROP_ALLOCATION
- };
-
- GST_DEBUG_CATEGORY (gstwayland_debug);
-@@ -75,6 +82,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
- "YUV9, YVU9, Y41B, I420, YV12, Y42B, v308 }"))
- );
-
-+
- static void gst_wayland_sink_get_property (GObject * object,
- guint prop_id, GValue * value, GParamSpec * pspec);
- static void gst_wayland_sink_set_property (GObject * object,
-@@ -158,6 +166,11 @@ gst_wayland_sink_class_init (GstWaylandSinkClass * klass)
- g_param_spec_string ("display", "Wayland Display name", "Wayland "
- "display name to connect to, if not supplied via the GstContext",
- NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-+
-+ g_object_class_install_property (gobject_class, PROP_ALLOCATION,
-+ g_param_spec_boolean ("use-drm", "Wayland Allocation name", "Wayland "
-+ "Use DRM based memory for allocation",
-+ FALSE, G_PARAM_WRITABLE));
- }
-
- static void
-@@ -197,6 +210,11 @@ gst_wayland_sink_set_property (GObject * object,
- sink->display_name = g_value_dup_string (value);
- GST_OBJECT_UNLOCK (sink);
- break;
-+ case PROP_ALLOCATION:
-+ GST_OBJECT_LOCK (sink);
-+ sink->use_drm = g_value_get_boolean (value);
-+ GST_OBJECT_UNLOCK (sink);
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
-@@ -281,6 +299,7 @@ gst_wayland_sink_find_display (GstWaylandSink * sink)
- /* if the application didn't set a display, let's create it ourselves */
- GST_OBJECT_LOCK (sink);
- sink->display = gst_wl_display_new (sink->display_name, &error);
-+ sink->display->use_drm = sink->use_drm;
- GST_OBJECT_UNLOCK (sink);
-
- if (error) {
-@@ -408,7 +427,6 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
-
- caps = gst_caps_make_writable (caps);
- gst_structure_set_value (gst_caps_get_structure (caps, 0), "format", &list);
--
- GST_DEBUG_OBJECT (sink, "display caps: %" GST_PTR_FORMAT, caps);
- }
-
-@@ -426,6 +444,18 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
- return caps;
- }
-
-+static void
-+wait_authentication (GstWaylandSink * sink)
-+{
-+ GST_DEBUG_OBJECT (sink, "Before wait aunthenticated value is %d : \n", sink->display->authenticated );
-+ while (!sink->display->authenticated) {
-+ GST_DEBUG_OBJECT (sink, "waiting for authentication");
-+ wl_display_roundtrip (sink->display->display);
-+ }
-+ GST_DEBUG_OBJECT (sink, "After wait aunthenticated value is %d : \n", sink->display->authenticated );
-+}
-+
-+
- static gboolean
- gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
- {
-@@ -436,11 +466,20 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
- GArray *formats;
- gint i;
- GstStructure *structure;
-+ GstStructure *s;
-+ gboolean use_drm = 0;
-+ int num_buffers = 0;
-
- sink = GST_WAYLAND_SINK (bsink);
-
- GST_DEBUG_OBJECT (sink, "set caps %" GST_PTR_FORMAT, caps);
-
-+ wait_authentication (sink);
-+
-+ while (!sink->display->authenticated) {
-+ GST_DEBUG_OBJECT (sink, "not authenticated yet");
-+ }
-+
- /* extract info from caps */
- if (!gst_video_info_from_caps (&info, caps))
- goto invalid_format;
-@@ -460,14 +499,27 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
- goto unsupported_format;
-
- /* create a new pool for the new configuration */
-- newpool = gst_video_buffer_pool_new ();
-+
-+ s = gst_caps_get_structure (caps, 0);
-+ gst_structure_get_boolean (s, "drm_mem", &use_drm);
-+ gst_structure_get_int (s, "max-ref-frames", &num_buffers);
-+ if (num_buffers )
-+ num_buffers = num_buffers + 2;
-+
-+ newpool = gst_buffer_pool_new ();
- if (!newpool)
- goto pool_failed;
-
- structure = gst_buffer_pool_get_config (newpool);
-- gst_buffer_pool_config_set_params (structure, caps, info.size, 2, 0);
-- gst_buffer_pool_config_set_allocator (structure, gst_wl_shm_allocator_get (),
-- NULL);
-+ gst_buffer_pool_config_set_params (structure, caps, info.size, 2, num_buffers);
-+ if ( use_drm ) {
-+ gst_buffer_pool_config_set_allocator (structure, gst_drm_allocator_get (),
-+ NULL);
-+ sink->display->use_drm = TRUE;
-+ } else {
-+ gst_buffer_pool_config_set_allocator (structure, gst_wl_shm_allocator_get (),
-+ NULL);
-+ }
- if (!gst_buffer_pool_set_config (newpool, structure))
- goto config_failed;
-
-@@ -518,8 +570,11 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
- /* we do have a pool for sure (created in set_caps),
- * so let's propose it anyway, but also propose the allocator on its own */
- gst_query_add_allocation_pool (query, sink->pool, size, min_bufs, max_bufs);
-- gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL);
--
-+ if (sink->display->use_drm) {
-+ gst_query_add_allocation_param (query, gst_drm_allocator_get (), NULL);
-+ } else {
-+ gst_query_add_allocation_param (query, gst_wl_shm_allocator_get (), NULL);
-+ }
- gst_structure_free (config);
-
- return TRUE;
-@@ -582,6 +637,10 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
-
- GST_LOG_OBJECT (sink, "render buffer %p", buffer);
-
-+ if (sink->display) {
-+ sink->display->crop = gst_buffer_get_video_crop_meta (buffer);
-+ }
-+
- if (G_UNLIKELY (!sink->window)) {
- /* ask for window handle. Unlock render_lock while doing that because
- * set_window_handle & friends will lock it in this context */
-@@ -623,6 +682,11 @@ gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
- wbuf = gst_wl_shm_memory_construct_wl_buffer (mem, sink->display,
- &sink->video_info);
- }
-+
-+ if (gst_is_drm_memory (mem)) {
-+ wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display,
-+ &sink->video_info);
-+ }
-
- if (wbuf) {
- gst_buffer_add_wl_buffer (buffer, wbuf, sink->display);
-diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h
-index afbed40..c1092ce 100644
---- a/ext/wayland/gstwaylandsink.h
-+++ b/ext/wayland/gstwaylandsink.h
-@@ -27,8 +27,7 @@
-
- #include <wayland-client.h>
-
--#include "wldisplay.h"
--#include "wlwindow.h"
-+#include "wldisplay-wlwindow-wlbuffer.h"
-
- G_BEGIN_DECLS
-
-@@ -61,6 +60,7 @@ struct _GstWaylandSink
- GstVideoInfo video_info;
-
- gchar *display_name;
-+ gboolean use_drm;
-
- gboolean redraw_pending;
- GMutex render_lock;
-diff --git a/ext/wayland/wayland-drm-client-protocol.h b/ext/wayland/wayland-drm-client-protocol.h
-new file mode 100644
-index 0000000..7ddb614
---- /dev/null
-+++ b/ext/wayland/wayland-drm-client-protocol.h
-@@ -0,0 +1,213 @@
-+/*
-+ * Copyright © 2008-2011 Kristian Høgsberg
-+ * Copyright © 2010-2011 Intel Corporation
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this
-+ * software and its documentation for any purpose is hereby granted
-+ * without fee, provided that\n the above copyright notice appear in
-+ * all copies and that both that copyright notice and this permission
-+ * notice appear in supporting documentation, and that the name of
-+ * the copyright holders not be used in advertising or publicity
-+ * pertaining to distribution of the software without specific,
-+ * written prior permission. The copyright holders make no
-+ * representations about the suitability of this software for any
-+ * purpose. It is provided "as is" without express or implied
-+ * warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-+ * THIS SOFTWARE.
-+ */
-+
-+#ifndef DRM_CLIENT_PROTOCOL_H
-+#define DRM_CLIENT_PROTOCOL_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <stdint.h>
-+#include <stddef.h>
-+#include "wayland-util.h"
-+
-+struct wl_client;
-+struct wl_resource;
-+
-+struct wl_drm;
-+
-+extern const struct wl_interface wl_drm_interface;
-+
-+#ifndef WL_DRM_ERROR_ENUM
-+#define WL_DRM_ERROR_ENUM
-+enum wl_drm_error {
-+ WL_DRM_ERROR_AUTHENTICATE_FAIL = 0,
-+ WL_DRM_ERROR_INVALID_FORMAT = 1,
-+ WL_DRM_ERROR_INVALID_NAME = 2,
-+};
-+#endif /* WL_DRM_ERROR_ENUM */
-+
-+#ifndef WL_DRM_FORMAT_ENUM
-+#define WL_DRM_FORMAT_ENUM
-+enum wl_drm_format {
-+ WL_DRM_FORMAT_C8 = 0x20203843,
-+ WL_DRM_FORMAT_RGB332 = 0x38424752,
-+ WL_DRM_FORMAT_BGR233 = 0x38524742,
-+ WL_DRM_FORMAT_XRGB4444 = 0x32315258,
-+ WL_DRM_FORMAT_XBGR4444 = 0x32314258,
-+ WL_DRM_FORMAT_RGBX4444 = 0x32315852,
-+ WL_DRM_FORMAT_BGRX4444 = 0x32315842,
-+ WL_DRM_FORMAT_ARGB4444 = 0x32315241,
-+ WL_DRM_FORMAT_ABGR4444 = 0x32314241,
-+ WL_DRM_FORMAT_RGBA4444 = 0x32314152,
-+ WL_DRM_FORMAT_BGRA4444 = 0x32314142,
-+ WL_DRM_FORMAT_XRGB1555 = 0x35315258,
-+ WL_DRM_FORMAT_XBGR1555 = 0x35314258,
-+ WL_DRM_FORMAT_RGBX5551 = 0x35315852,
-+ WL_DRM_FORMAT_BGRX5551 = 0x35315842,
-+ WL_DRM_FORMAT_ARGB1555 = 0x35315241,
-+ WL_DRM_FORMAT_ABGR1555 = 0x35314241,
-+ WL_DRM_FORMAT_RGBA5551 = 0x35314152,
-+ WL_DRM_FORMAT_BGRA5551 = 0x35314142,
-+ WL_DRM_FORMAT_RGB565 = 0x36314752,
-+ WL_DRM_FORMAT_BGR565 = 0x36314742,
-+ WL_DRM_FORMAT_RGB888 = 0x34324752,
-+ WL_DRM_FORMAT_BGR888 = 0x34324742,
-+ WL_DRM_FORMAT_XRGB8888 = 0x34325258,
-+ WL_DRM_FORMAT_XBGR8888 = 0x34324258,
-+ WL_DRM_FORMAT_RGBX8888 = 0x34325852,
-+ WL_DRM_FORMAT_BGRX8888 = 0x34325842,
-+ WL_DRM_FORMAT_ARGB8888 = 0x34325241,
-+ WL_DRM_FORMAT_ABGR8888 = 0x34324241,
-+ WL_DRM_FORMAT_RGBA8888 = 0x34324152,
-+ WL_DRM_FORMAT_BGRA8888 = 0x34324142,
-+ WL_DRM_FORMAT_XRGB2101010 = 0x30335258,
-+ WL_DRM_FORMAT_XBGR2101010 = 0x30334258,
-+ WL_DRM_FORMAT_RGBX1010102 = 0x30335852,
-+ WL_DRM_FORMAT_BGRX1010102 = 0x30335842,
-+ WL_DRM_FORMAT_ARGB2101010 = 0x30335241,
-+ WL_DRM_FORMAT_ABGR2101010 = 0x30334241,
-+ WL_DRM_FORMAT_RGBA1010102 = 0x30334152,
-+ WL_DRM_FORMAT_BGRA1010102 = 0x30334142,
-+ WL_DRM_FORMAT_YUYV = 0x56595559,
-+ WL_DRM_FORMAT_YVYU = 0x55595659,
-+ WL_DRM_FORMAT_UYVY = 0x59565955,
-+ WL_DRM_FORMAT_VYUY = 0x59555956,
-+ WL_DRM_FORMAT_AYUV = 0x56555941,
-+ WL_DRM_FORMAT_NV12 = 0x3231564e,
-+ WL_DRM_FORMAT_NV21 = 0x3132564e,
-+ WL_DRM_FORMAT_NV16 = 0x3631564e,
-+ WL_DRM_FORMAT_NV61 = 0x3136564e,
-+ WL_DRM_FORMAT_YUV410 = 0x39565559,
-+ WL_DRM_FORMAT_YVU410 = 0x39555659,
-+ WL_DRM_FORMAT_YUV411 = 0x31315559,
-+ WL_DRM_FORMAT_YVU411 = 0x31315659,
-+ WL_DRM_FORMAT_YUV420 = 0x32315559,
-+ WL_DRM_FORMAT_YVU420 = 0x32315659,
-+ WL_DRM_FORMAT_YUV422 = 0x36315559,
-+ WL_DRM_FORMAT_YVU422 = 0x36315659,
-+ WL_DRM_FORMAT_YUV444 = 0x34325559,
-+ WL_DRM_FORMAT_YVU444 = 0x34325659,
-+};
-+#endif /* WL_DRM_FORMAT_ENUM */
-+
-+struct wl_drm_listener {
-+ /**
-+ * device - (none)
-+ * @name: (none)
-+ */
-+ void (*device)(void *data,
-+ struct wl_drm *wl_drm,
-+ const char *name);
-+ /**
-+ * format - (none)
-+ * @format: (none)
-+ */
-+ void (*format)(void *data,
-+ struct wl_drm *wl_drm,
-+ uint32_t format);
-+ /**
-+ * authenticated - (none)
-+ */
-+ void (*authenticated)(void *data,
-+ struct wl_drm *wl_drm);
-+};
-+
-+static inline int
-+wl_drm_add_listener(struct wl_drm *wl_drm,
-+ const struct wl_drm_listener *listener, void *data)
-+{
-+ return wl_proxy_add_listener((struct wl_proxy *) wl_drm,
-+ (void (**)(void)) listener, data);
-+}
-+
-+#define WL_DRM_AUTHENTICATE 0
-+#define WL_DRM_CREATE_BUFFER 1
-+#define WL_DRM_CREATE_PLANAR_BUFFER 2
-+
-+static inline void
-+wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
-+{
-+ wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data);
-+}
-+
-+static inline void *
-+wl_drm_get_user_data(struct wl_drm *wl_drm)
-+{
-+ return wl_proxy_get_user_data((struct wl_proxy *) wl_drm);
-+}
-+
-+static inline void
-+wl_drm_destroy(struct wl_drm *wl_drm)
-+{
-+ wl_proxy_destroy((struct wl_proxy *) wl_drm);
-+}
-+
-+static inline void
-+wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
-+{
-+ wl_proxy_marshal((struct wl_proxy *) wl_drm,
-+ WL_DRM_AUTHENTICATE, id);
-+}
-+
-+static inline struct wl_buffer *
-+wl_drm_create_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t stride, uint32_t format)
-+{
-+ struct wl_proxy *id;
-+
-+ id = wl_proxy_create((struct wl_proxy *) wl_drm,
-+ &wl_buffer_interface);
-+ if (!id)
-+ return NULL;
-+
-+ wl_proxy_marshal((struct wl_proxy *) wl_drm,
-+ WL_DRM_CREATE_BUFFER, id, name, width, height, stride, format);
-+
-+ return (struct wl_buffer *) id;
-+}
-+
-+static inline struct wl_buffer *
-+wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
-+{
-+ struct wl_proxy *id;
-+
-+ id = wl_proxy_create((struct wl_proxy *) wl_drm,
-+ &wl_buffer_interface);
-+ if (!id)
-+ return NULL;
-+
-+ wl_proxy_marshal((struct wl_proxy *) wl_drm,
-+ WL_DRM_CREATE_PLANAR_BUFFER, id, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
-+
-+ return (struct wl_buffer *) id;
-+}
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-diff --git a/ext/wayland/wayland-drm-protocol.c b/ext/wayland/wayland-drm-protocol.c
-new file mode 100644
-index 0000000..939af53
---- /dev/null
-+++ b/ext/wayland/wayland-drm-protocol.c
-@@ -0,0 +1,74 @@
-+/*
-+ * Copyright © 2008-2011 Kristian Høgsberg
-+ * Copyright © 2010-2011 Intel Corporation
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this
-+ * software and its documentation for any purpose is hereby granted
-+ * without fee, provided that\n the above copyright notice appear in
-+ * all copies and that both that copyright notice and this permission
-+ * notice appear in supporting documentation, and that the name of
-+ * the copyright holders not be used in advertising or publicity
-+ * pertaining to distribution of the software without specific,
-+ * written prior permission. The copyright holders make no
-+ * representations about the suitability of this software for any
-+ * purpose. It is provided "as is" without express or implied
-+ * warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-+ * THIS SOFTWARE.
-+ */
-+
-+#include <stdlib.h>
-+#include <stdint.h>
-+#include "wayland-util.h"
-+
-+#define ARRAY_LENGTH(a) (sizeof (a) /sizeof (a)[0])
-+
-+extern const struct wl_interface wl_buffer_interface;
-+extern const struct wl_interface wl_buffer_interface;
-+
-+static const struct wl_interface *types[] = {
-+ NULL,
-+ &wl_buffer_interface,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ &wl_buffer_interface,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+ NULL,
-+};
-+
-+static const struct wl_message wl_drm_requests[] = {
-+ { "authenticate", "u", types + 0 },
-+ { "create_buffer", "nuiiuu", types + 1 },
-+ { "create_planar_buffer", "nuiiuiiiiii", types + 7 },
-+};
-+
-+static const struct wl_message wl_drm_events[] = {
-+ { "device", "s", types + 0 },
-+ { "format", "u", types + 0 },
-+ { "authenticated", "", types + 0 },
-+};
-+
-+WL_EXPORT const struct wl_interface wl_drm_interface = {
-+ "wl_drm", 1,
-+ ARRAY_LENGTH(wl_drm_requests), wl_drm_requests,
-+ ARRAY_LENGTH(wl_drm_events), wl_drm_events,
-+};
-+
-diff --git a/ext/wayland/wlbuffer.c b/ext/wayland/wlbuffer.c
-index 4ac99ef..0e38d2e 100644
---- a/ext/wayland/wlbuffer.c
-+++ b/ext/wayland/wlbuffer.c
-@@ -76,7 +76,7 @@
- * as soon as we remove the reference that GstWlDisplay holds.
- */
-
--#include "wlbuffer.h"
-+#include "wldisplay-wlwindow-wlbuffer.h"
-
- GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
- #define GST_CAT_DEFAULT gstwayland_debug
-diff --git a/ext/wayland/wlbuffer.h b/ext/wayland/wlbuffer.h
-deleted file mode 100644
-index cbb50f7..0000000
---- a/ext/wayland/wlbuffer.h
-+++ /dev/null
-@@ -1,67 +0,0 @@
--/* GStreamer Wayland video sink
-- *
-- * Copyright (C) 2014 Collabora Ltd.
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the Free
-- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-- * Boston, MA 02110-1301 USA.
-- */
--
--#ifndef __GST_WL_BUFFER_H__
--#define __GST_WL_BUFFER_H__
--
--#include "wldisplay.h"
--
--G_BEGIN_DECLS
--
--#define GST_TYPE_WL_BUFFER (gst_wl_buffer_get_type ())
--#define GST_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_BUFFER, GstWlBuffer))
--#define GST_IS_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_BUFFER))
--#define GST_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_BUFFER, GstWlBufferClass))
--#define GST_IS_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_BUFFER))
--#define GST_WL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_BUFFER, GstWlBufferClass))
--
--typedef struct _GstWlBuffer GstWlBuffer;
--typedef struct _GstWlBufferClass GstWlBufferClass;
--
--struct _GstWlBuffer
--{
-- GObject parent_instance;
--
-- struct wl_buffer * wlbuffer;
-- GstBuffer *gstbuffer;
--
-- GstWlDisplay *display;
--
-- gboolean used_by_compositor;
--};
--
--struct _GstWlBufferClass
--{
-- GObjectClass parent_class;
--};
--
--GType gst_wl_buffer_get_type (void);
--
--GstWlBuffer * gst_buffer_add_wl_buffer (GstBuffer * gstbuffer,
-- struct wl_buffer * wlbuffer, GstWlDisplay * display);
--GstWlBuffer * gst_buffer_get_wl_buffer (GstBuffer * gstbuffer);
--
--void gst_wl_buffer_force_release_and_unref (GstWlBuffer * self);
--
--void gst_wl_buffer_attach (GstWlBuffer * self, struct wl_surface *surface);
--
--G_END_DECLS
--
--#endif /* __GST_WL_BUFFER_H__ */
-diff --git a/ext/wayland/wldisplay-wlwindow-wlbuffer.h b/ext/wayland/wldisplay-wlwindow-wlbuffer.h
-new file mode 100644
-index 0000000..684d145
---- /dev/null
-+++ b/ext/wayland/wldisplay-wlwindow-wlbuffer.h
-@@ -0,0 +1,216 @@
-+/* GStreamer Wayland video sink
-+ *
-+ * Copyright (C) 2014 Collabora Ltd.
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the Free
-+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-+ * Boston, MA 02110-1301 USA.
-+ */
-+
-+#ifndef __GST_WL_DISPLAY_WL_WINDOW_H__
-+#define __GST_WL_DISPLAY_WL_WINDOW_H__
-+
-+#include <gst/gst.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <wayland-client.h>
-+#include "scaler-client-protocol.h"
-+#include <gst/video/video.h>
-+#include <gst/video/gstvideometa.h>
-+
-+G_BEGIN_DECLS
-+
-+#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ())
-+#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay))
-+#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY))
-+#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
-+#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY))
-+#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
-+
-+#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ())
-+#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow))
-+#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW))
-+#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass))
-+#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW))
-+#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass))
-+
-+#define GST_TYPE_WL_BUFFER (gst_wl_buffer_get_type ())
-+#define GST_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_BUFFER, GstWlBuffer))
-+#define GST_IS_WL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_BUFFER))
-+#define GST_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_BUFFER, GstWlBufferClass))
-+#define GST_IS_WL_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_BUFFER))
-+#define GST_WL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_BUFFER, GstWlBufferClass))
-+
-+typedef struct _GstWlBuffer GstWlBuffer;
-+typedef struct _GstWlBufferClass GstWlBufferClass;
-+
-+typedef struct _GstWlWindow GstWlWindow;
-+typedef struct _GstWlWindowClass GstWlWindowClass;
-+
-+typedef struct _GstWlDisplay GstWlDisplay;
-+typedef struct _GstWlDisplayClass GstWlDisplayClass;
-+
-+struct _GstWlBuffer
-+{
-+ GObject parent_instance;
-+
-+ struct wl_buffer * wlbuffer;
-+ GstBuffer *gstbuffer;
-+
-+ GstWlDisplay *display;
-+
-+ gboolean used_by_compositor;
-+};
-+
-+struct _GstWlBufferClass
-+{
-+ GObjectClass parent_class;
-+};
-+
-+GType gst_wl_buffer_get_type (void);
-+
-+GstWlBuffer * gst_buffer_add_wl_buffer (GstBuffer * gstbuffer,
-+ struct wl_buffer * wlbuffer, GstWlDisplay * display);
-+GstWlBuffer * gst_buffer_get_wl_buffer (GstBuffer * gstbuffer);
-+
-+void gst_wl_buffer_force_release_and_unref (GstWlBuffer * self);
-+
-+void gst_wl_buffer_attach (GstWlBuffer * self, struct wl_surface *surface);
-+
-+
-+struct touch_point
-+{
-+ int32_t id;
-+ struct wl_list link;
-+};
-+
-+struct input
-+{
-+ GstWlDisplay *display;
-+ struct wl_seat *seat;
-+ struct wl_pointer *pointer;
-+ struct wl_touch *touch;
-+ struct wl_list touch_point_list;
-+ GstWlWindow *pointer_focus;
-+ GstWlWindow *touch_focus;
-+ struct wl_list link;
-+ GstWlWindow *grab;
-+};
-+
-+
-+struct _GstWlWindow
-+{
-+ GObject parent_instance;
-+
-+ GstWlDisplay *display;
-+ struct wl_surface *area_surface;
-+ struct wl_subsurface *area_subsurface;
-+ struct wl_viewport *area_viewport;
-+ struct wl_surface *video_surface;
-+ struct wl_subsurface *video_subsurface;
-+ struct wl_viewport *video_viewport;
-+ struct wl_shell_surface *shell_surface;
-+
-+ /* the size and position of the area_(sub)surface */
-+ GstVideoRectangle render_rectangle;
-+ /* the size of the video in the buffers */
-+ gint video_width, video_height;
-+ /* the size of the video_(sub)surface */
-+ gint surface_width, surface_height;
-+};
-+
-+struct _GstWlWindowClass
-+{
-+ GObjectClass parent_class;
-+};
-+
-+GType gst_wl_window_get_type (void);
-+
-+GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
-+ const GstVideoInfo * info);
-+GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
-+ struct wl_surface * parent);
-+
-+GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window);
-+struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window);
-+gboolean gst_wl_window_is_toplevel (GstWlWindow *window);
-+
-+void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,
-+ const GstVideoInfo * info);
-+void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
-+ gint w, gint h);
-+
-+
-+struct _GstWlDisplay
-+{
-+ GObject parent_instance;
-+
-+ /* public objects */
-+ struct wl_display *display;
-+ struct wl_event_queue *queue;
-+
-+ /* globals */
-+ struct wl_registry *registry;
-+ struct wl_compositor *compositor;
-+ struct wl_subcompositor *subcompositor;
-+ struct wl_shell *shell;
-+ struct wl_shm *shm;
-+ struct wl_drm *drm;
-+ struct wl_scaler *scaler;
-+ GArray *shm_formats;
-+
-+ /* private */
-+ gboolean own_display;
-+ GThread *thread;
-+ GstPoll *wl_fd_poll;
-+
-+ GMutex buffers_mutex;
-+ GHashTable *buffers;
-+ gboolean shutting_down;
-+
-+ /* the drm device.. needed for sharing direct-render buffers..
-+ * TODO nothing about this should really be omapdrm specific. But some
-+ * of the code, like hashtable of imported buffers in libdrm_omap should
-+ * be refactored out into some generic libdrm code..
-+ */
-+ struct omap_device *dev;
-+ int fd;
-+ int authenticated;
-+ gboolean use_drm;
-+
-+ struct wl_list input_list;
-+ int seat_version;
-+ uint32_t serial;
-+
-+ GstVideoCropMeta *crop;
-+};
-+
-+struct _GstWlDisplayClass
-+{
-+ GObjectClass parent_class;
-+};
-+
-+GType gst_wl_display_get_type (void);
-+
-+GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error);
-+GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display,
-+ gboolean take_ownership, GError ** error);
-+
-+/* see wlbuffer.c for explanation */
-+void gst_wl_display_register_buffer (GstWlDisplay * self, gpointer buf);
-+void gst_wl_display_unregister_buffer (GstWlDisplay * self, gpointer buf);
-+
-+G_END_DECLS
-+
-+#endif /* __GST_WL_DISPLAY_WL_WINDOW_H__ */
-diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c
-index 3318095..2f58fd2 100644
---- a/ext/wayland/wldisplay.c
-+++ b/ext/wayland/wldisplay.c
-@@ -22,9 +22,15 @@
- #include <config.h>
- #endif
-
--#include "wldisplay.h"
--#include "wlbuffer.h"
--
-+#include "wldisplay-wlwindow-wlbuffer.h"
-+
-+#include <wayland-client-protocol.h>
-+#include "wayland-drm-client-protocol.h"
-+#include <linux/input.h>
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <fcntl.h>
-+#include <unistd.h>
- #include <errno.h>
-
- GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
-@@ -33,6 +39,8 @@ GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
- G_DEFINE_TYPE (GstWlDisplay, gst_wl_display, G_TYPE_OBJECT);
-
- static void gst_wl_display_finalize (GObject * gobject);
-+static void input_grab (struct input *input, GstWlWindow *window);
-+static void input_ungrab (struct input *input);
-
- static void
- gst_wl_display_class_init (GstWlDisplayClass * klass)
-@@ -45,12 +53,62 @@ static void
- gst_wl_display_init (GstWlDisplay * self)
- {
- self->shm_formats = g_array_new (FALSE, FALSE, sizeof (uint32_t));
-+ self->fd = -1;
-+ self->use_drm = FALSE;
- self->wl_fd_poll = gst_poll_new (TRUE);
- self->buffers = g_hash_table_new (g_direct_hash, g_direct_equal);
- g_mutex_init (&self->buffers_mutex);
- }
-
- static void
-+input_grab (struct input *input, GstWlWindow *window)
-+{
-+ input->grab = window;
-+}
-+
-+static void
-+input_ungrab (struct input *input)
-+{
-+ input->grab = NULL;
-+}
-+
-+static void
-+input_remove_pointer_focus (struct input *input)
-+{
-+ GstWlWindow *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ input->pointer_focus = NULL;
-+}
-+
-+static void
-+input_destroy (struct input *input)
-+{
-+ input_remove_pointer_focus (input);
-+
-+ if (input->display->seat_version >= 3) {
-+ if (input->pointer)
-+ wl_pointer_release (input->pointer);
-+ }
-+
-+ wl_list_remove (&input->link);
-+ wl_seat_destroy (input->seat);
-+ free (input);
-+}
-+
-+static void
-+display_destroy_inputs (GstWlDisplay *display)
-+{
-+ struct input *tmp;
-+ struct input *input;
-+
-+ wl_list_for_each_safe (input, tmp, &display->input_list, link)
-+ input_destroy (input);
-+}
-+
-+static void
- gst_wl_display_finalize (GObject * gobject)
- {
- GstWlDisplay *self = GST_WL_DISPLAY (gobject);
-@@ -71,13 +129,26 @@ gst_wl_display_finalize (GObject * gobject)
- g_hash_table_remove_all (self->buffers);
-
- g_array_unref (self->shm_formats);
-+
-+ if (self->dev) {
-+ omap_device_del (self->dev);
-+ self->dev = NULL;
-+ }
-+ if (self->fd !=-1)
-+ close (self->fd);
-+
- gst_poll_free (self->wl_fd_poll);
- g_hash_table_unref (self->buffers);
- g_mutex_clear (&self->buffers_mutex);
-
-+ display_destroy_inputs (self);
-+
- if (self->shm)
- wl_shm_destroy (self->shm);
-
-+ if (self->drm)
-+ wl_drm_destroy (self->drm);
-+
- if (self->shell)
- wl_shell_destroy (self->shell);
-
-@@ -138,12 +209,277 @@ shm_format (void *data, struct wl_shm *wl_shm, uint32_t format)
- GstWlDisplay *self = data;
-
- g_array_append_val (self->shm_formats, format);
-+ GST_DEBUG ("shm got format: %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (format));
- }
-
- static const struct wl_shm_listener shm_listener = {
- shm_format
- };
-
-+/* For wl_drm_listener */
-+
-+static void
-+drm_handle_device (void *data, struct wl_drm *drm, const char *device)
-+{
-+ GstWlDisplay *d = data;
-+ drm_magic_t magic;
-+ d->fd = open (device, O_RDWR | O_CLOEXEC);
-+ if (d->fd == -1) {
-+ GST_ERROR ("could not open %s: %m", device);
-+ return;
-+ }
-+ drmGetMagic (d->fd, &magic);
-+ wl_drm_authenticate (d->drm, magic);
-+}
-+
-+static void
-+drm_handle_format (void *data, struct wl_drm *drm, uint32_t format)
-+{
-+ GstWlDisplay *self = data;
-+ g_array_append_val (self->shm_formats, format);
-+ GST_DEBUG ("drm got format: %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (format));
-+}
-+
-+static void
-+drm_handle_authenticated (void *data, struct wl_drm *drm)
-+{
-+ GstWlDisplay *d = data;
-+ GST_DEBUG ("authenticated");
-+ d->dev = omap_device_new (d->fd);
-+ d->authenticated = 1;
-+ GST_DEBUG ("drm_handle_authenticated: dev: %p, d->authenticated: %d\n",
-+ d->dev, d->authenticated);
-+}
-+
-+static const struct wl_drm_listener drm_listener = {
-+ drm_handle_device,
-+ drm_handle_format,
-+ drm_handle_authenticated
-+};
-+
-+
-+static void
-+pointer_handle_enter (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface,
-+ wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+
-+ if (!surface) {
-+ /* enter event for a window we've just destroyed */
-+ return;
-+ }
-+
-+ input->display->serial = serial;
-+ input->pointer_focus = wl_surface_get_user_data (surface);
-+}
-+
-+static void
-+pointer_handle_leave (void *data, struct wl_pointer *pointer,
-+ uint32_t serial, struct wl_surface *surface)
-+{
-+ struct input *input = data;
-+
-+ input_remove_pointer_focus (input);
-+}
-+
-+static void
-+pointer_handle_motion (void *data, struct wl_pointer *pointer,
-+ uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w)
-+{
-+ struct input *input = data;
-+ GstWlWindow *window = input->pointer_focus;
-+
-+ if (!window)
-+ return;
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+
-+}
-+
-+static void
-+pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial,
-+ uint32_t time, uint32_t button, uint32_t state_w)
-+{
-+ struct input *input = data;
-+ enum wl_pointer_button_state state = state_w;
-+ input->display->serial = serial;
-+
-+ if (button == BTN_LEFT) {
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ input_grab (input, input->pointer_focus);
-+
-+ if (input->grab && state == WL_POINTER_BUTTON_STATE_RELEASED)
-+ input_ungrab (input);
-+ }
-+
-+ if (input->grab)
-+ wl_shell_surface_move (input->grab->shell_surface, input->seat,
-+ input->display->serial);
-+}
-+
-+static void
-+pointer_handle_axis (void *data, struct wl_pointer *pointer,
-+ uint32_t time, uint32_t axis, wl_fixed_t value)
-+{
-+}
-+
-+static const struct wl_pointer_listener pointer_listener = {
-+ pointer_handle_enter,
-+ pointer_handle_leave,
-+ pointer_handle_motion,
-+ pointer_handle_button,
-+ pointer_handle_axis,
-+};
-+
-+static void
-+touch_handle_down (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, struct wl_surface *surface,
-+ int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+ input->display->serial = serial;
-+ input->touch_focus = wl_surface_get_user_data (surface);
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ tp = malloc (sizeof *tp);
-+ if (tp) {
-+ tp->id = id;
-+ wl_list_insert (&input->touch_point_list, &tp->link);
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ serial);
-+ }
-+}
-+
-+static void
-+touch_handle_motion (void *data, struct wl_touch *wl_touch,
-+ uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp;
-+
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+ wl_list_for_each (tp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_shell_surface_move (input->touch_focus->shell_surface, input->seat,
-+ input->display->serial);
-+
-+ return;
-+ }
-+}
-+
-+static void
-+touch_handle_frame (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_cancel (void *data, struct wl_touch *wl_touch)
-+{
-+}
-+
-+static void
-+touch_handle_up (void *data, struct wl_touch *wl_touch,
-+ uint32_t serial, uint32_t time, int32_t id)
-+{
-+ struct input *input = data;
-+ struct touch_point *tp, *tmp;
-+
-+ if (!input->touch_focus) {
-+ return;
-+ }
-+
-+ wl_list_for_each_safe (tp, tmp, &input->touch_point_list, link) {
-+ if (tp->id != id)
-+ continue;
-+
-+ wl_list_remove (&tp->link);
-+ free (tp);
-+
-+ return;
-+ }
-+}
-+
-+static const struct wl_touch_listener touch_listener = {
-+ touch_handle_down,
-+ touch_handle_up,
-+ touch_handle_motion,
-+ touch_handle_frame,
-+ touch_handle_cancel,
-+};
-+
-+
-+static void
-+seat_handle_capabilities (void *data, struct wl_seat *seat,
-+ enum wl_seat_capability caps)
-+{
-+ struct input *input = data;
-+
-+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) {
-+ input->pointer = wl_seat_get_pointer (seat);
-+ wl_pointer_set_user_data (input->pointer, input);
-+ wl_pointer_add_listener (input->pointer, &pointer_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) {
-+ wl_pointer_destroy (input->pointer);
-+ input->pointer = NULL;
-+ }
-+
-+ if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) {
-+ input->touch = wl_seat_get_touch (seat);
-+ wl_touch_set_user_data (input->touch, input);
-+ wl_touch_add_listener (input->touch, &touch_listener, input);
-+ } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) {
-+ wl_touch_destroy (input->touch);
-+ input->touch = NULL;
-+ }
-+}
-+
-+static void
-+seat_handle_name (void *data, struct wl_seat *seat, const char *name)
-+{
-+
-+}
-+
-+static const struct wl_seat_listener seat_listener = {
-+ seat_handle_capabilities,
-+ seat_handle_name
-+};
-+
-+static void
-+display_add_input (GstWlDisplay *d, uint32_t id)
-+{
-+ struct input *input;
-+
-+ input = calloc (1, sizeof (*input));
-+ if (input == NULL) {
-+ fprintf (stderr, "%s: out of memory\n", "gst-wayland-sink");
-+ exit (EXIT_FAILURE);
-+ }
-+ input->display = d;
-+ input->seat = wl_registry_bind (d->registry, id, &wl_seat_interface,
-+ MAX (d->seat_version, 3));
-+ input->touch_focus = NULL;
-+ input->pointer_focus = NULL;
-+ wl_list_init (&input->touch_point_list);
-+ wl_list_insert (d->input_list.prev, &input->link);
-+
-+ wl_seat_add_listener (input->seat, &seat_listener, input);
-+ wl_seat_set_user_data (input->seat, input);
-+
-+}
-+
-+
- static void
- registry_handle_global (void *data, struct wl_registry *registry,
- uint32_t id, const char *interface, uint32_t version)
-@@ -161,6 +497,12 @@ registry_handle_global (void *data, struct wl_registry *registry,
- } else if (g_strcmp0 (interface, "wl_shm") == 0) {
- self->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1);
- wl_shm_add_listener (self->shm, &shm_listener, self);
-+ } else if (g_strcmp0 (interface, "wl_drm") == 0) {
-+ self->drm = wl_registry_bind (registry, id, &wl_drm_interface, 1);
-+ wl_drm_add_listener (self->drm, &drm_listener, self);
-+ } else if (g_strcmp0 (interface, "wl_seat") == 0) {
-+ self->seat_version = version;
-+ display_add_input (self, id);
- } else if (g_strcmp0 (interface, "wl_scaler") == 0) {
- self->scaler = wl_registry_bind (registry, id, &wl_scaler_interface, 2);
- }
-@@ -238,6 +580,7 @@ gst_wl_display_new_existing (struct wl_display * display,
- self->own_display = take_ownership;
-
- self->queue = wl_display_create_queue (self->display);
-+ wl_list_init (&self->input_list);
- self->registry = wl_display_get_registry (self->display);
- wl_proxy_set_queue ((struct wl_proxy *) self->registry, self->queue);
- wl_registry_add_listener (self->registry, &registry_listener, self);
-@@ -266,6 +609,7 @@ gst_wl_display_new_existing (struct wl_display * display,
- VERIFY_INTERFACE_EXISTS (subcompositor, "wl_subcompositor");
- VERIFY_INTERFACE_EXISTS (shell, "wl_shell");
- VERIFY_INTERFACE_EXISTS (shm, "wl_shm");
-+ VERIFY_INTERFACE_EXISTS (drm, "wl_drm");
- VERIFY_INTERFACE_EXISTS (scaler, "wl_scaler");
-
- #undef VERIFY_INTERFACE_EXISTS
-diff --git a/ext/wayland/wldisplay.h b/ext/wayland/wldisplay.h
-deleted file mode 100644
-index e9df749..0000000
---- a/ext/wayland/wldisplay.h
-+++ /dev/null
-@@ -1,84 +0,0 @@
--/* GStreamer Wayland video sink
-- *
-- * Copyright (C) 2014 Collabora Ltd.
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the Free
-- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-- * Boston, MA 02110-1301 USA.
-- */
--
--#ifndef __GST_WL_DISPLAY_H__
--#define __GST_WL_DISPLAY_H__
--
--#include <gst/gst.h>
--#include <wayland-client.h>
--#include "scaler-client-protocol.h"
--
--G_BEGIN_DECLS
--
--#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ())
--#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay))
--#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY))
--#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
--#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY))
--#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
--
--typedef struct _GstWlDisplay GstWlDisplay;
--typedef struct _GstWlDisplayClass GstWlDisplayClass;
--
--struct _GstWlDisplay
--{
-- GObject parent_instance;
--
-- /* public objects */
-- struct wl_display *display;
-- struct wl_event_queue *queue;
--
-- /* globals */
-- struct wl_registry *registry;
-- struct wl_compositor *compositor;
-- struct wl_subcompositor *subcompositor;
-- struct wl_shell *shell;
-- struct wl_shm *shm;
-- struct wl_scaler *scaler;
-- GArray *shm_formats;
--
-- /* private */
-- gboolean own_display;
-- GThread *thread;
-- GstPoll *wl_fd_poll;
--
-- GMutex buffers_mutex;
-- GHashTable *buffers;
-- gboolean shutting_down;
--};
--
--struct _GstWlDisplayClass
--{
-- GObjectClass parent_class;
--};
--
--GType gst_wl_display_get_type (void);
--
--GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error);
--GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display,
-- gboolean take_ownership, GError ** error);
--
--/* see wlbuffer.c for explanation */
--void gst_wl_display_register_buffer (GstWlDisplay * self, gpointer buf);
--void gst_wl_display_unregister_buffer (GstWlDisplay * self, gpointer buf);
--
--G_END_DECLS
--
--#endif /* __GST_WL_DISPLAY_H__ */
-diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c
-new file mode 100644
-index 0000000..3dc9c21
---- /dev/null
-+++ b/ext/wayland/wldrm.c
-@@ -0,0 +1,69 @@
-+#include "wldisplay-wlwindow-wlbuffer.h"
-+#include <gst/drm/gstdrmallocator.h>
-+#include "wayland-drm-client-protocol.h"
-+#include <omap_drm.h>
-+#include <omap_drmif.h>
-+#include <wayland-client.h>
-+
-+struct wl_buffer *
-+gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
-+ const GstVideoInfo * info)
-+{
-+ gint video_width = GST_VIDEO_INFO_WIDTH (info);
-+ gint video_height = GST_VIDEO_INFO_HEIGHT (info);
-+ int fd = -1;
-+ struct omap_bo *bo;
-+ struct wl_buffer *buffer;
-+
-+ /* TODO get format, etc from caps.. and query device for
-+ * supported formats, and make this all more flexible to
-+ * cope with various formats:
-+ */
-+ uint32_t fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
-+ uint32_t name;
-+ /* note: wayland and mesa use the terminology:
-+ * stride - rowstride in bytes
-+ * pitch - rowstride in pixels
-+ */
-+ uint32_t strides[3] = {
-+ GST_ROUND_UP_4 (video_width), GST_ROUND_UP_4 (video_width), 0,
-+ };
-+ uint32_t offsets[3] = {
-+ 0, strides[0] * video_height, 0
-+ };
-+
-+ fd = gst_fd_memory_get_fd (mem);
-+
-+ if (fd < 0 ) {
-+ GST_DEBUG ("Invalid fd");
-+ return NULL;
-+ }
-+
-+ bo = omap_bo_from_dmabuf (display->dev, fd);
-+
-+ struct drm_gem_flink req = {
-+ .handle = omap_bo_handle(bo),
-+ };
-+
-+ int ret;
-+ ret = drmIoctl(display->fd, DRM_IOCTL_GEM_FLINK, &req);
-+ if (ret) {
-+ GST_DEBUG ("could not get name, DRM_IOCTL_GEM_FLINK returned %d", ret);
-+ return NULL;
-+ }
-+
-+ name = req.name;
-+
-+ GST_LOG ("width = %d , height = %d , fourcc = %d ", video_width, video_height, fourcc );
-+ buffer = wl_drm_create_planar_buffer (display->drm, name,
-+ video_width, video_height, fourcc,
-+ offsets[0], strides[0],
-+ offsets[1], strides[1],
-+ offsets[2], strides[2]);
-+
-+ GST_DEBUG ("create planar buffer: %p (name=%d)",
-+ buffer, name);
-+
-+ return buffer;
-+}
-+
-diff --git a/ext/wayland/wldrm.h b/ext/wayland/wldrm.h
-new file mode 100644
-index 0000000..9751029
---- /dev/null
-+++ b/ext/wayland/wldrm.h
-@@ -0,0 +1,3 @@
-+struct wl_buffer *
-+gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
-+ const GstVideoInfo * info);
-diff --git a/ext/wayland/wlshmallocator.h b/ext/wayland/wlshmallocator.h
-index 07ae17f..2860fc3 100644
---- a/ext/wayland/wlshmallocator.h
-+++ b/ext/wayland/wlshmallocator.h
-@@ -26,7 +26,7 @@
- #include <gst/video/video.h>
- #include <gst/allocators/allocators.h>
- #include <wayland-client-protocol.h>
--#include "wldisplay.h"
-+#include "wldisplay-wlwindow-wlbuffer.h"
-
- G_BEGIN_DECLS
-
-diff --git a/ext/wayland/wlvideoformat.c b/ext/wayland/wlvideoformat.c
-index 1302da6..aa336aa 100644
---- a/ext/wayland/wlvideoformat.c
-+++ b/ext/wayland/wlvideoformat.c
-@@ -106,6 +106,10 @@ gst_wl_shm_format_to_video_format (enum wl_shm_format wl_format)
- const gchar *
- gst_wl_shm_format_to_string (enum wl_shm_format wl_format)
- {
-- return gst_video_format_to_string
-- (gst_wl_shm_format_to_video_format (wl_format));
-+ GstVideoFormat fmt = gst_wl_shm_format_to_video_format (wl_format);
-+ if (fmt != GST_VIDEO_FORMAT_UNKNOWN) {
-+ return gst_video_format_to_string (fmt);
-+ } else {
-+ return NULL;
-+ }
- }
-diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
-index 79000ae..f7e3324 100644
---- a/ext/wayland/wlwindow.c
-+++ b/ext/wayland/wlwindow.c
-@@ -24,9 +24,10 @@
- #include <config.h>
- #endif
-
--#include "wlwindow.h"
-+#include "wldisplay-wlwindow-wlbuffer.h"
- #include "wlshmallocator.h"
--#include "wlbuffer.h"
-+#include "wldrm.h"
-+#include <gst/drm/gstdrmallocator.h>
-
- GST_DEBUG_CATEGORY_EXTERN (gstwayland_debug);
- #define GST_CAT_DEFAULT gstwayland_debug
-@@ -111,6 +112,8 @@ gst_wl_window_new_internal (GstWlDisplay * display)
-
- window->area_surface = wl_compositor_create_surface (display->compositor);
- window->video_surface = wl_compositor_create_surface (display->compositor);
-+ wl_surface_set_user_data (window->area_surface, window);
-+ wl_surface_set_user_data (window->video_surface, window);
-
- wl_proxy_set_queue ((struct wl_proxy *) window->area_surface, display->queue);
- wl_proxy_set_queue ((struct wl_proxy *) window->video_surface,
-@@ -126,6 +129,21 @@ gst_wl_window_new_internal (GstWlDisplay * display)
- window->area_surface);
- window->video_viewport = wl_scaler_get_viewport (display->scaler,
- window->video_surface);
-+ if (display->crop) {
-+ GST_DEBUG ("Setting source crop : %d %d %d %d",display->crop->x, display->crop->y,
-+ display->crop->width, display->crop->height);
-+ wl_viewport_set_source (window->area_viewport,
-+ wl_fixed_from_int(display->crop->x),
-+ wl_fixed_from_int(display->crop->y),
-+ wl_fixed_from_int(display->crop->width),
-+ wl_fixed_from_int(display->crop->height));
-+ wl_viewport_set_source (window->video_viewport,
-+ wl_fixed_from_int(display->crop->x),
-+ wl_fixed_from_int(display->crop->y),
-+ wl_fixed_from_int(display->crop->width),
-+ wl_fixed_from_int(display->crop->height));
-+
-+ }
-
- /* draw the area_subsurface */
- gst_video_info_set_format (&info,
-@@ -136,14 +154,25 @@ gst_wl_window_new_internal (GstWlDisplay * display)
- GST_VIDEO_FORMAT_BGRx,
- #endif
- 1, 1);
--
-- buf = gst_buffer_new_allocate (gst_wl_shm_allocator_get (), info.size, NULL);
-+ if (display->use_drm) {
-+ buf = gst_buffer_new_allocate (gst_drm_allocator_get (), info.size, NULL);
-+ } else {
-+ buf = gst_buffer_new_allocate (gst_wl_shm_allocator_get (), info.size, NULL);
-+ }
- gst_buffer_map (buf, &mapinfo, GST_MAP_WRITE);
-- *((guint32 *) mapinfo.data) = 0; /* paint it black */
-- gst_buffer_unmap (buf, &mapinfo);
-- wlbuf =
-- gst_wl_shm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0),
-- display, &info);
-+ *((guint32 *) mapinfo.data) = 0; /* paint it black */
-+ gst_buffer_unmap (buf, &mapinfo);
-+
-+ if (display->use_drm) {
-+ wlbuf =
-+ gst_wl_drm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0),
-+ display, &info);
-+ } else {
-+ wlbuf =
-+ gst_wl_shm_memory_construct_wl_buffer (gst_buffer_peek_memory (buf, 0),
-+ display, &info);
-+ }
-+
- gwlbuf = gst_buffer_add_wl_buffer (buf, wlbuf, display);
- gst_wl_buffer_attach (gwlbuf, window->area_surface);
-
-diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h
-deleted file mode 100644
-index e22cb26..0000000
---- a/ext/wayland/wlwindow.h
-+++ /dev/null
-@@ -1,84 +0,0 @@
--/* GStreamer Wayland video sink
-- *
-- * Copyright (C) 2014 Collabora Ltd.
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the Free
-- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-- * Boston, MA 02110-1301 USA.
-- */
--
--#ifndef __GST_WL_WINDOW_H__
--#define __GST_WL_WINDOW_H__
--
--#include "wldisplay.h"
--#include "wlbuffer.h"
--#include <gst/video/video.h>
--
--G_BEGIN_DECLS
--
--#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ())
--#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow))
--#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW))
--#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass))
--#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW))
--#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass))
--
--typedef struct _GstWlWindow GstWlWindow;
--typedef struct _GstWlWindowClass GstWlWindowClass;
--
--struct _GstWlWindow
--{
-- GObject parent_instance;
--
-- GstWlDisplay *display;
-- struct wl_surface *area_surface;
-- struct wl_subsurface *area_subsurface;
-- struct wl_viewport *area_viewport;
-- struct wl_surface *video_surface;
-- struct wl_subsurface *video_subsurface;
-- struct wl_viewport *video_viewport;
-- struct wl_shell_surface *shell_surface;
--
-- /* the size and position of the area_(sub)surface */
-- GstVideoRectangle render_rectangle;
-- /* the size of the video in the buffers */
-- gint video_width, video_height;
-- /* the size of the video_(sub)surface */
-- gint surface_width, surface_height;
--};
--
--struct _GstWlWindowClass
--{
-- GObjectClass parent_class;
--};
--
--GType gst_wl_window_get_type (void);
--
--GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
-- const GstVideoInfo * info);
--GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
-- struct wl_surface * parent);
--
--GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window);
--struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window);
--gboolean gst_wl_window_is_toplevel (GstWlWindow *window);
--
--void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,
-- const GstVideoInfo * info);
--void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
-- gint w, gint h);
--
--G_END_DECLS
--
--#endif /* __GST_WL_WINDOW_H__ */
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch
deleted file mode 100644
index bcb66c816..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad/0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From adfc38273882a102d25fc420adc82b3f225588f9 Mon Sep 17 00:00:00 2001
-From: Pooja Prajod <a0132412@ti.com>
-Date: Mon, 27 Mar 2017 18:27:06 +0530
-Subject: [PATCH] gstwaylandsink: Implement callbacks for version 5 of
- wl_pointer
-
-Few extra callbacks are required for wl_pointer listener
-with the newer weston. Without the extra dummy callbacks
-the pipelines results in segfault.
-
-Signed-off-by: Pooja Prajod <a0132412@ti.com>
----
- ext/wayland/wldisplay.c | 22 +++++++++++++++++++++-
- 1 file changed, 21 insertions(+), 1 deletion(-)
-
-diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c
-index 2f58fd2..54acfdb 100644
---- a/ext/wayland/wldisplay.c
-+++ b/ext/wayland/wldisplay.c
-@@ -326,12 +326,25 @@ pointer_handle_axis (void *data, struct wl_pointer *pointer,
- {
- }
-
-+static void pointer_frame(void *data, struct wl_pointer *wl_pointer)
-+{
-+}
-+static void pointer_axis_source(void *data, struct wl_pointer *wl_pointer, uint32_t axis_source)
-+{
-+}
-+void pointer_axis_stop(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis)
-+{
-+}
-+
- static const struct wl_pointer_listener pointer_listener = {
- pointer_handle_enter,
- pointer_handle_leave,
- pointer_handle_motion,
- pointer_handle_button,
- pointer_handle_axis,
-+ pointer_frame,
-+ pointer_axis_source,
-+ pointer_axis_stop
- };
-
- static void
-@@ -508,8 +521,15 @@ registry_handle_global (void *data, struct wl_registry *registry,
- }
- }
-
-+static void
-+registry_handle_global_remove(void *data, struct wl_registry *registry,
-+ uint32_t name)
-+{
-+}
-+
- static const struct wl_registry_listener registry_listener = {
-- registry_handle_global
-+ registry_handle_global,
-+ registry_handle_global_remove
- };
-
- static gpointer
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
deleted file mode 100644
index 53cd834aa..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
+++ /dev/null
@@ -1,49 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-PACKAGECONFIG = "faad"
-
-# gstreamer is now also included on Keystone, be mindful of any Graphics dependencies
-PACKAGECONFIG_append_omap-a15 = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}"
-PACKAGECONFIG_append_ti43x = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}"
-PACKAGECONFIG_append_ti33x = " ${@bb.utils.contains('DISTRO_FEATURES','wayland','wayland','',d)}"
-
-DEPENDS_append_omap-a15 = " \
- libdrm \
-"
-
-DEPENDS_append_ti43x = " \
- libdrm \
-"
-
-DEPENDS_append_ti33x = " \
- libdrm \
-"
-
-SRC_URI_append_ti43x = " \
- file://0001-gstdrmallocator-Add-DRM-allocator-support.patch \
- file://0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch \
- file://0003-gstkmssink-Add-support-for-KMS-based-sink.patch \
- file://0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch \
- file://0002-kmssink-remove-DCE-dependencies.patch \
- file://0003-kmssink-add-YUYV-support.patch \
- file://0001-gstwaylandsink-add-input-format-I420-support.patch \
-"
-
-SRC_URI_append_ti33x = " \
- file://0001-gstwaylandsink-Add-mouse-drag-and-drop-support.patch \
-"
-
-SRC_URI_append_omap-a15 = " \
- file://0001-gstdrmallocator-Add-DRM-allocator-support.patch \
- file://0002-parsers-Pick-previos-bug-fixes-on-different-parsers.patch \
- file://0003-gstkmssink-Add-support-for-KMS-based-sink.patch \
- file://0004-gstwaylandsink-Add-DRM-support-on-waylandsink.patch \
- file://0002-kmssink-remove-DCE-dependencies.patch \
- file://0003-kmssink-add-YUYV-support.patch \
- file://0001-gstwaylandsink-add-input-format-I420-support.patch \
- file://0005-gstwaylandsink-Implement-callbacks-for-version-5-of-.patch \
-"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-PR = "r4"
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb b/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb
deleted file mode 100644
index 4fdfd7ddb..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/ipumm-fw/ipumm-fw_3.00.13.00.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-python __anonymous() {
- features = bb.data.getVar("MACHINE_FEATURES", d, 1)
- if not features:
- return
- if "mmip" not in features:
- raise bb.parse.SkipPackage('ipumm-fw does not apply to systems without the "mmip" flag in MACHINE_FEATURES')
-}
-
-DESCRIPTION = "Firmware for IPU for supporting Accelerated MM decode and encode"
-LICENSE = "TI-TSPA"
-
-LIC_FILES_CHKSUM = "file://MMIP-${PV}-Manifest.doc;md5=255f135205844dcbeab09b481ff9fb3a"
-
-COMPATIBLE_MACHINE = "dra7xx"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-RDEPENDS_${PN} = " libdce"
-
-SRC_URI = "http://downloads.ti.com/infotainment/esd/jacinto6/processor-sdk-linux-automotive/03_02_00_03/exports/ipumm-dra7xx-evm-${PV}.tar.gz;protocol=http"
-
-SRC_URI[md5sum] = "d5cf8c3be28f22cd94e97ab2b781a4df"
-SRC_URI[sha256sum] = "b003a981cc97d834c81ec653dca9888c0e6c99500ee695a24f3221898f6afed4"
-
-S = "${WORKDIR}/ipumm-dra7xx-evm-${PV}"
-
-TARGET = "dra7-ipu2-fw.xem4"
-
-do_install() {
- mkdir -p ${D}${base_libdir}/firmware
- cp ${S}/firmware/${TARGET} ${D}${base_libdir}/firmware/${TARGET}
-}
-
-FILES_${PN} += "${base_libdir}/firmware/${TARGET}"
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch
deleted file mode 100644
index 4268b7dc2..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-Add-soc-performance-monitor-utilites.patch
+++ /dev/null
@@ -1,3570 +0,0 @@
-From 7830118ecb980766f4a6e3997769d7ae326bee77 Mon Sep 17 00:00:00 2001
-From: Karthik Ramanan <a0393906@ti.com>
-Date: Fri, 3 Jun 2016 18:32:50 +0530
-Subject: [PATCH] Add soc performance monitor utilites
-
-Signed-off-by: Karthik Ramanan <a0393906@ti.com>
----
- Makefile.am | 17 +-
- clients/Dra7xx_ddrstat_speed.c | 494 +++++++++++++
- clients/soc_performance_monitor.c | 630 ++++++++++++++++
- clients/soc_performance_monitor.h | 40 ++
- clients/statcoll.c | 1433 +++++++++++++++++++++++++++++++++++++
- clients/statcoll.h | 152 ++++
- clients/statcoll_gui.h | 101 +++
- clients/time_bar_graph.c | 515 +++++++++++++
- clients/time_bar_graph.h | 93 +++
- 10 files changed, 4873 insertions(+), 1 deletion(-)
- create mode 100644 clients/Dra7xx_ddrstat_speed.c
- create mode 100644 clients/soc_performance_monitor.c
- create mode 100644 clients/soc_performance_monitor.h
- create mode 100644 clients/statcoll.c
- create mode 100644 clients/statcoll.h
- create mode 100644 clients/statcoll_gui.h
- create mode 100644 clients/time_bar_graph.c
- create mode 100644 clients/time_bar_graph.h
-
-diff --git a/Makefile.am b/Makefile.am
-index 62719c9..55aed6d 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -432,7 +432,9 @@ demo_clients = \
- weston-fullscreen \
- weston-stacking \
- weston-calibrator \
-- weston-scaler
-+ weston-scaler \
-+ soc-performance-monitor \
-+ soc-ddr-bw-visualizer
-
- if INSTALL_DEMO_CLIENTS
- bin_PROGRAMS += $(demo_clients)
-@@ -570,6 +572,19 @@ weston_image_SOURCES = clients/image.c
- weston_image_LDADD = libtoytoolkit.la
- weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
-
-+noinst_LTLIBRARIES += libtimebargraph.la
-+libtimebargraph_la_SOURCES = clients/time_bar_graph.c clients/time_bar_graph.h
-+libtimebargraph_la_LIBADD = libtoytoolkit.la
-+libtimebargraph_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_CFLAGS) $(CAIRO_EGL_CFLAGS)
-+
-+soc_performance_monitor_SOURCES = clients/soc_performance_monitor.c clients/soc_performance_monitor.h
-+soc_performance_monitor_LDADD = libtoytoolkit.la libtimebargraph.la
-+soc_performance__CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
-+
-+soc_ddr_bw_visualizer_SOURCES = clients/statcoll.c clients/Dra7xx_ddrstat_speed.c clients/statcoll.h clients/statcoll_gui.h
-+soc_ddr_bw_visualizer_LDADD = libtoytoolkit.la libtimebargraph.la
-+soc_ddr_bw_visualizer__CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
-+
- weston_cliptest_SOURCES = \
- clients/cliptest.c \
- src/vertex-clipping.c \
-diff --git a/clients/Dra7xx_ddrstat_speed.c b/clients/Dra7xx_ddrstat_speed.c
-new file mode 100644
-index 0000000..af06733
---- /dev/null
-+++ b/clients/Dra7xx_ddrstat_speed.c
-@@ -0,0 +1,494 @@
-+/*
-+ * Copyright (C) 2015 Texas Instruments
-+ * Author: Karthik Ramanan <karthik.ramanan@ti.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License version 2 as published by
-+ * the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <stdint.h>
-+#include <string.h>
-+#include <sys/mman.h>
-+#include <sys/time.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include "statcoll.h"
-+
-+#define PAGE_SIZE 4096
-+
-+#define EMIF1_BASE 0x4c000000
-+#define EMIF2_BASE 0x4d000000
-+
-+#define EMIF_PERF_CNT_1 0x80
-+#define EMIF_PERF_CNT_2 0x84
-+#define EMIF_PERF_CNT_CFG 0x88
-+#define EMIF_PERF_CNT_TIM 0x90
-+
-+static unsigned
-+tv_diff(struct timeval *tv1, struct timeval *tv2)
-+{
-+ return (tv2->tv_sec - tv1->tv_sec) * 1000000 +
-+ (tv2->tv_usec - tv1->tv_usec);
-+}
-+
-+
-+struct emif_perf {
-+ int code;
-+ const char *name;
-+};
-+
-+static const struct emif_perf emif_perf_tab[] = {
-+ { 0, "access" },
-+ { 1, "activate" },
-+ { 2, "read" },
-+ { 3, "write" },
-+ { 4, "fifo_cmd" },
-+ { 5, "fifo_write" },
-+ { 6, "fifo_read" },
-+ { 7, "fifo_ret" },
-+ { 8, "prio" },
-+ { 9, "cmd_pend" },
-+ { 10, "data" },
-+};
-+
-+static void *emif1, *emif2;
-+static int BANDWIDTH=0;
-+static int DELAY = 1;
-+static int EMIF_PERF_CFG1 = 9;
-+static int EMIF_PERF_CFG2 = 10;
-+
-+
-+static int STATCOLL=0;
-+static int TOTAL_TIME;
-+static int INTERVAL_US;
-+
-+struct timeval t1, t2;
-+
-+FILE* outfile;
-+struct emif_stats {
-+ uint32_t cycles;
-+ uint32_t cnt1;
-+ uint32_t cnt2;
-+};
-+
-+static struct emif_stats emif1_start, emif1_end;
-+static struct emif_stats emif2_start, emif2_end;
-+
-+static void *emif_init(int fd, unsigned base)
-+{
-+ void *mem =
-+ mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
-+ volatile uint32_t *emif = mem,temp;
-+
-+ if (mem == MAP_FAILED){
-+ return NULL;
-+ }
-+
-+ emif[EMIF_PERF_CNT_CFG>>2] = EMIF_PERF_CFG2 << 16 | EMIF_PERF_CFG1;
-+
-+ return mem;
-+}
-+
-+static void emif_read(volatile uint32_t *emif, struct emif_stats *st)
-+{
-+ st->cycles = emif[EMIF_PERF_CNT_TIM>>2];
-+ st->cnt1 = emif[EMIF_PERF_CNT_1>>2];
-+ st->cnt2 = emif[EMIF_PERF_CNT_2>>2];
-+}
-+
-+static void emif_print(const char *tag, struct emif_stats *st1,
-+ struct emif_stats *st2)
-+{
-+ uint32_t cycles = st2->cycles - st1->cycles;
-+ uint32_t cnt1 = st2->cnt1 - st1->cnt1;
-+ uint32_t cnt2 = st2->cnt2 - st1->cnt2;
-+ printf("%s %s %2llu%% %s %2llu%%", tag,
-+ emif_perf_tab[EMIF_PERF_CFG1].name, 100ull*cnt1/cycles,
-+ emif_perf_tab[EMIF_PERF_CFG2].name, 100ull*cnt2/cycles);
-+ fprintf(outfile,"%s%s= %2llu,%s%s= %2llu,",
-+ tag, emif_perf_tab[EMIF_PERF_CFG1].name, 100ull*cnt1/cycles,
-+ tag, emif_perf_tab[EMIF_PERF_CFG2].name, 100ull*cnt2/cycles);
-+}
-+
-+static int perf_init(void)
-+{
-+ int fd = open("/dev/mem", O_RDWR);
-+ int err = 0;
-+
-+ if (fd == -1){
-+ printf("error fd=open() \n");
-+ return -1;
-+ }
-+ emif1 = emif_init(fd, EMIF1_BASE);
-+ emif2 = emif_init(fd, EMIF2_BASE);
-+
-+ if (!emif1 || !emif2){
-+ printf("error if (!emif1 || !emif2) \n");
-+ err = -1;
-+ }
-+
-+ close(fd);
-+ return err;
-+}
-+
-+static void perf_start(void)
-+{
-+ if (emif1) {
-+ emif_read(emif1, &emif1_start);
-+ emif_read(emif2, &emif2_start);
-+ }
-+}
-+
-+static void perf_stop(void)
-+{
-+ if (emif1) {
-+ emif_read(emif1, &emif1_end);
-+ emif_read(emif2, &emif2_end);
-+ }
-+}
-+
-+static void perf_print(void)
-+{
-+ if (emif1) {
-+ emif_print("EMIF1", &emif1_start, &emif1_end);
-+ printf("\t");
-+ emif_print("EMIF2", &emif2_start, &emif2_end);
-+ printf("\r");
-+ fprintf(outfile, "\n");
-+ fflush(outfile);
-+ fflush(stdout);
-+ }
-+}
-+
-+static void perf_close(void)
-+{
-+ if (emif1) munmap(emif1, PAGE_SIZE);
-+ if (emif2) munmap(emif2, PAGE_SIZE);
-+}
-+
-+static int get_cfg(const char *name, int def)
-+{
-+ char *end;
-+ int n = strtol(name, &end, 0);
-+ int i;
-+
-+ if (!*end)
-+ return n;
-+
-+ for (i = 0; i < sizeof(emif_perf_tab)/sizeof(emif_perf_tab[0]); i++)
-+ if (!strcmp(name, emif_perf_tab[i].name))
-+ return emif_perf_tab[i].code;
-+
-+ return def;
-+}
-+
-+
-+unsigned int emif_freq()
-+{
-+ volatile unsigned *tim1;
-+ unsigned v1, v2;
-+ int fd;
-+
-+ /*calculation EMIF frequency
-+ EMIF_PERF_CNT_TIM = \n32-bit counter that
-+ continuously counts number for
-+ EMIF_FCLK clock cycles elapsed
-+ after EMIFis brought out of reset*/
-+
-+ fd = open("/dev/mem", O_RDONLY);
-+ if (fd == -1) {
-+ perror("/dev/mem");
-+ return 1;
-+ }
-+
-+ void *mem =
-+ mem = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, EMIF1_BASE);
-+ if (mem == MAP_FAILED) {
-+ perror("mmap");
-+ exit(1);
-+ }
-+
-+ tim1 = (unsigned *)((char*)mem + EMIF_PERF_CNT_TIM);
-+
-+ v1 = *tim1;
-+ gettimeofday(&t1, NULL);
-+ sleep(2);
-+ v2 = *tim1;
-+ gettimeofday(&t2, NULL);
-+
-+ munmap(mem, PAGE_SIZE);
-+ close(fd);
-+
-+ return (v2 - v1) / tv_diff(&t1, &t2);
-+
-+}
-+
-+
-+char config_file_path[100];
-+char keylist[][50] = {
-+ "DELAY",
-+ "EMIF_PERF_CFG1",
-+ "EMIF_PERF_CFG2",
-+ "BANDWIDTH",
-+ "STATCOLL",
-+ "TOTAL_TIME",
-+ "INTERVAL_US",
-+ "INITIATORS",
-+};
-+
-+char line[512], *p;
-+char tokens[6][512];
-+int temp, flag = 0;
-+char *keyvalue, *pair;
-+char key[100];
-+int linecount=0;
-+
-+
-+int debug=0;
-+
-+void print_valid_options(void)
-+{
-+ int i;
-+ printf("Invalid key found\n");
-+ printf("Supported keys are :\n");
-+ for(i=0; i<sizeof(keylist)/sizeof(keylist[0]); i++)
-+ printf("\t\t %s\n", keylist[i]);
-+
-+}
-+int validatekey(char *ptr)
-+{
-+ int i;
-+ for(i=0; i<sizeof(keylist)/sizeof(keylist[0]); i++)
-+ if(strcmp(ptr, keylist[i]) == 0)
-+ return 0;
-+
-+ return 1;
-+}
-+
-+void add_key_value(char *key, int value)
-+{
-+ printd("%s", "Inside add_key_value\n");
-+
-+ if(strcmp(key, "BANDWIDTH") == 0) {
-+ BANDWIDTH = value;
-+ return;
-+ }
-+ if(strcmp(key, "STATCOLL") == 0) {
-+ STATCOLL = value;
-+ return;
-+ }
-+ else
-+ printd("%s", "********** UNKNOWN**********");
-+
-+ if(BANDWIDTH == 1) {
-+ if(strcmp(key, "DELAY") == 0)
-+ DELAY = value;
-+ else if(strcmp(key, "EMIF_PERF_CFG1") == 0)
-+ EMIF_PERF_CFG1 = value;
-+ else if(strcmp(key, "EMIF_PERF_CFG2") == 0)
-+ EMIF_PERF_CFG2 = value;
-+ }
-+ else
-+ printf("NOTE: BANDWIDTH is not enabled, ignoring %s\n", key);
-+
-+
-+ if(STATCOLL == 1) {
-+ if(strcmp(key, "INTERVAL_US") == 0)
-+ INTERVAL_US = value;
-+ else if(strcmp(key, "TOTAL_TIME") == 0)
-+ TOTAL_TIME = value;
-+ }
-+ else
-+ printf("NOTE: STATCOLL is not enabled, ignoring %s\n", key);
-+}
-+
-+void bandwidth_usage() {
-+
-+ printf("#########################################################\n##\n"
-+
-+ "## usage : ./Dra7xx_ddrstat <DELAY> <EMIF_PERF_CFG1> <EMIF_PERF_CFG2> \n"
-+ "## default : DELAY=1 EMIF_PERF_CFG1=9 EMIF_PERF_CFG2=10\n"
-+ "## option : for EMIF_PERF_CFG1 and EMIF_PERF_CFG2\n"
-+ "## 0 -> access,\n"
-+ "## 1 -> activate,\n"
-+ "## 2 -> read,\n"
-+ "## 3 -> write,\n"
-+ "## 4 -> fifo_cmd,\n"
-+ "## 5 -> fifo_write,\n"
-+ "## 6 -> fifo_read,\n"
-+ "## 7 -> fifo_ret,\n"
-+ "## 8 -> prio,\n"
-+ "## 9 -> cmd_pend,\n"
-+ "## 10 -> data \n##\n"
-+
-+ "## EMIF frq : %d MHz\n\n", emif_freq() );
-+}
-+
-+
-+int main(int argc, char **argv)
-+{
-+ int option;
-+ FILE *fp;
-+ int i;
-+ int xpos = 600, ypos = 40;
-+
-+
-+ /* Read config file */
-+ /* Initialize this to turn off verbosity of getopt */
-+ opterr = 0;
-+
-+// while ((option = getopt (argc, argv, "df:")) != -1)
-+ while ((option = getopt (argc, argv, "dx:y:")) != -1)
-+ {
-+ switch(option)
-+ {
-+#if 0
-+ case 'f':
-+ strcpy(config_file_path, optarg);
-+ break;
-+#endif
-+ case 'd':
-+ debug=1;
-+ break;
-+ case 'x':
-+ xpos=atoi(optarg);
-+ break;
-+ case 'y':
-+ ypos=atoi(optarg);
-+ break;
-+
-+ default:
-+ printf("Invalid option.. Exiting\n");
-+ exit(0);
-+ }
-+ }
-+
-+ printf("xpos = %d, ypos = %d\n", xpos, ypos);
-+
-+ strcpy(config_file_path,"config.ini");
-+ fp = fopen(config_file_path, "r");
-+ if (fp == NULL) {
-+ fprintf(stderr, "couldn't open the specified file\n");
-+ return -1;
-+ }
-+
-+ while (fgets(line, sizeof line, fp)) {
-+ printd("Line is = %s", line);
-+
-+ if (line[0] == '#' || line[0] == '\n') {
-+ continue;
-+ }
-+
-+ memset(tokens, 0, sizeof(tokens));
-+ i = 0;
-+
-+ pair = strtok (line," ,");
-+ while (pair != NULL)
-+ {
-+ printd ("\tPair is = %s\n",pair);
-+ strcpy(tokens[i++], pair);
-+ pair = strtok (NULL, " ,.-");
-+ }
-+
-+ for(temp=0; temp< i; temp++)
-+ {
-+ printd("Line %d: %s\n", temp, tokens[temp]);
-+
-+ keyvalue = strtok (tokens[temp]," =");
-+ while (keyvalue != NULL)
-+ {
-+ if(flag == 0)
-+ {
-+ if(validatekey(keyvalue))
-+ {
-+ print_valid_options();
-+ exit(0);
-+ }
-+ strcpy(key, keyvalue);
-+ printd ("\tKey is = %s\n",key);
-+ flag++;
-+ }
-+ else
-+ {
-+ printd ("\tValue is = %s",keyvalue);
-+ printd (" (%d)\n", atoi(keyvalue));
-+ add_key_value(key, atoi(keyvalue));
-+ flag = 0;
-+ }
-+ keyvalue = strtok (NULL, " =");
-+ }
-+ }
-+
-+
-+
-+ linecount++;
-+ printd("%s", "------------------- \n");
-+
-+ }
-+
-+ fclose(fp);
-+
-+ printf("\n\nCOMPLETED: Parsing of the user specified parameters.. \n \
-+ \nConfiguring device now.. \n\n");
-+ if(BANDWIDTH == 1) {
-+ bandwidth_usage();
-+ if (DELAY <= 0)
-+ DELAY = 1;
-+
-+ if (perf_init()){
-+ printf("perf_init return non zero \n");
-+ return 1;
-+ }
-+
-+ outfile = fopen("emif-performance.csv", "w+");
-+ if (!outfile) {
-+ printf("\n Error opening file");
-+ }
-+ for (;;) {
-+ perf_start();
-+ sleep(DELAY);
-+ perf_stop();
-+ perf_print();
-+ }
-+
-+ fclose(outfile);
-+ perf_close();
-+ return 0;
-+ }
-+
-+ if(STATCOLL == 1) {
-+ printf("STATISTICS COLLECTOR option chosen\n");
-+ printf("------------------------------------------------\n\n");
-+ fp = fopen("initiators.cfg", "r");
-+ if (fp == NULL) {
-+ fprintf(stderr, "couldn't open the specified file initiators.cfg'\n");
-+ return -1;
-+ }
-+
-+ int i=0;
-+ char list[100][50];
-+ memset(list, sizeof(list), 0);
-+ while (fgets(line, sizeof line, fp)) {
-+ printf("Line is = %s", line);
-+ /* Slightly strange way to chop off the \n character */
-+ strtok(line, "\n");
-+ strcpy(list[i++], line);
-+ }
-+ fclose(fp);
-+
-+ statcoll_start(TOTAL_TIME, INTERVAL_US, list, xpos, ypos);
-+ }
-+
-+}
-+
-diff --git a/clients/soc_performance_monitor.c b/clients/soc_performance_monitor.c
-new file mode 100644
-index 0000000..5d1db32
---- /dev/null
-+++ b/clients/soc_performance_monitor.c
-@@ -0,0 +1,630 @@
-+/*
-+ * Copyright (C) 2016 Texas Instruments
-+ * Author: Karthik Ramanan <karthik.ramanan@ti.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License version 2 as published by
-+ * the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <stdint.h>
-+#include <signal.h>
-+#include <time.h>
-+#include <math.h>
-+#include <unistd.h>
-+#include <sys/time.h>
-+#include <pthread.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+
-+#include "time_bar_graph.h"
-+
-+#include "soc_performance_monitor.h"
-+
-+static int debug=0;
-+
-+static char readfifo[100];
-+static int MAX_WIDTH=1920;
-+static int MAX_HEIGHT=1080;
-+static int x_pos=0;
-+static int y_pos=40;
-+
-+void *ctx;
-+struct time_graph_create_params tg_p;
-+struct bar_graph_create_params bg_p;
-+
-+static int cpu_load_offset = 0;
-+static int total_cpu_load_items = 0;
-+static int total_elements = 0;
-+
-+struct _bar_graph_y_config *y_cfg;
-+struct _text_config *t_cfg;
-+char *tg_text[100];
-+char *bg_text[100];
-+
-+
-+int command_handler(int command, double *y, char **text)
-+{
-+ static int fd;
-+ char buf[MAX_BUF];
-+ int i, bytes, offset;
-+
-+ switch(command)
-+ {
-+ case OPEN:
-+ fd = open(readfifo, O_RDONLY|O_NONBLOCK);
-+ break;
-+
-+ case READ:
-+
-+ /* open, read, and display the message from the FIFO */
-+ bytes=read(fd, buf, MAX_BUF);
-+ buf[bytes]='\0';
-+ if(bytes > 0)
-+ {
-+ char command[100];
-+ char string[100];
-+ sscanf(buf, "%s %s", command, string);
-+ printd("Received %s\n", buf);
-+ if(strcmp(command, "TABLE:") == 0)
-+ {
-+ char field[100], value[100], unit[100];
-+ sscanf(buf, "%s %s %s %s", command, field, value, unit);
-+ for(i=0; i<cpu_load_offset; i++) {
-+ if(strcmp(text[i*2], field) == 0) {
-+ printd("Updating value(%s), unit(%s)\n", value, unit);
-+ sprintf(text[i*2+1], "%s %s", value, unit);
-+ }
-+ }
-+ }
-+ else if(strcmp(command, "CPULOAD:") == 0)
-+ {
-+ char field[100], value[100];
-+
-+ sscanf(buf, "%s %s %s", command, field, value);
-+
-+ for(i=cpu_load_offset; i<cpu_load_offset+total_cpu_load_items; i++) {
-+ if(strcmp(text[i*2], field) == 0) {
-+ if(strlen(value) <= 2) {
-+ y[i*2+1] = atoi(value)/100.0;
-+ sprintf(text[i*2+1], " %02s%s", value,"%");
-+ printd("CPULOAD: Updating %s with %s\n", field, value);
-+ }
-+ else {
-+ printf("Ignoring value: %s\n", value);
-+ }
-+ }
-+ }
-+ }
-+ else if(strcmp(command, "MOVE:") == 0)
-+ {
-+ char value[100];
-+ printd("Received MOVE command : %s\n", buf);
-+ sscanf(string, "%s", value);
-+ sprintf(tg_p.title, "CPU Usage[@position-req=%sx%d]", value, y_pos);
-+ move_graph(ctx, &tg_p);
-+ }
-+ else
-+ {
-+ printf("ERROR: Received unexpected data from FIFO - \" %s \" \n", buf);
-+ }
-+ memset(buf, 0x0, sizeof(buf));
-+ }
-+
-+ break;
-+
-+ case CLOSE:
-+ close(fd);
-+ break;
-+ }
-+ return bytes;
-+}
-+
-+volatile sig_atomic_t sigtermed = 0;
-+
-+void my_signal_handler(int signum)
-+{
-+ if (signum == SIGTERM || signum == SIGINT) {
-+ sigtermed = 1;
-+ }
-+}
-+
-+int get_strings_in_section(char *string, char **output)
-+{
-+ FILE *fd;
-+ char line[512];
-+ int total_strings = 0;
-+
-+ fd = fopen("soc_performance_monitor.cfg", "r");
-+ if(fd == NULL) {
-+ fprintf(stderr, "ERROR: Unable to open file soc_performance_monitor.cfg\n");
-+ fprintf(stderr, " Please copy the file from /etc/visualization_scripts into current directory\n");
-+ exit(0);
-+ }
-+
-+ while(fgets(line, sizeof line, fd)) {
-+ if(strstr(line, string)) {
-+ printf("\n-------------------------------------------------\n");
-+ printf("CONFIG FILE PARSE: Found section %s in line : %s\n", string, line);
-+ break;
-+ }
-+ }
-+
-+ while(fgets(line, sizeof line, fd)) {
-+ printd("Line is = %s", line);
-+
-+ if (line[0] == '#' || line[0] == '\n' || line[0] == '[') {
-+ break;
-+ }
-+
-+ line[strlen(line) - 1] = '\0';
-+ strcpy(output[total_strings++], line);
-+
-+ }
-+ fclose(fd);
-+
-+ return total_strings;
-+}
-+
-+
-+void fill_cpu_load_details(int start_offset, int end_offset, char **output, struct table_configuration *table_config)
-+{
-+ int i;
-+
-+ const int BL_START_X = table_config->BL_START_X;
-+ const int BL_START_Y = table_config->BL_START_Y;
-+ const int BAR_GAP = table_config->BAR_GAP;
-+ const int BAR_HEIGHT = table_config->BAR_HEIGHT;
-+ const int BAR_WIDTH = table_config->BAR_WIDTH;
-+ const int TR_START_X = table_config->TR_START_X;
-+ const int TR_START_Y = table_config->TR_START_Y;
-+ const int FONT_SIZE = table_config->FONT_SIZE;
-+ printf("Filling from %d to %d\n", start_offset, end_offset);
-+ cpu_load_offset = start_offset;
-+
-+ for(i=start_offset; i< end_offset-1; i++) {
-+ y_cfg[i*2].region.bottom_left.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ y_cfg[i*2].region.bottom_left.y = BL_START_Y;
-+ y_cfg[i*2].region.top_right.x = TR_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ y_cfg[i*2].region.top_right.y = TR_START_Y;
-+ y_cfg[i*2].line_color.r = 1.0;
-+ y_cfg[i*2].line_color.g = 1.0;
-+ y_cfg[i*2].line_color.b = 1.0;
-+ y_cfg[i*2].line_color.a = 1.0;
-+ y_cfg[i*2].fill_color.r = 0.0;
-+ y_cfg[i*2].fill_color.g = 0.0;
-+ y_cfg[i*2].fill_color.b = 1.0;
-+ y_cfg[i*2].fill_color.a = 0.7;
-+
-+ y_cfg[i*2+1].region.bottom_left.x = BL_START_X +(i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ y_cfg[i*2+1].region.bottom_left.y = BL_START_Y;
-+ y_cfg[i*2+1].region.top_right.x = TR_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ y_cfg[i*2+1].region.top_right.y = TR_START_Y;
-+ y_cfg[i*2+1].line_color.r = 1.0;
-+ y_cfg[i*2+1].line_color.g = 1.0;
-+ y_cfg[i*2+1].line_color.b = 1.0;
-+ y_cfg[i*2+1].line_color.a = 1.0;
-+ y_cfg[i*2+1].fill_color.r = 1.0;
-+ y_cfg[i*2+1].fill_color.g = 0.0;
-+ y_cfg[i*2+1].fill_color.b = 0.0;
-+ y_cfg[i*2+1].fill_color.a = 1.0;
-+
-+
-+ t_cfg[i*2].color.r = 1.0;
-+ t_cfg[i*2].color.g = 1.0;
-+ t_cfg[i*2].color.b = 1.0;
-+ t_cfg[i*2].color.a = 1.0;
-+ t_cfg[i*2].at.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ t_cfg[i*2].at.y = BL_START_Y + FONT_SIZE;
-+ t_cfg[i*2].fontsize = FONT_SIZE;
-+
-+ t_cfg[i*2+1].color.r = 1.0;
-+ t_cfg[i*2+1].color.g = 1.0;
-+ t_cfg[i*2+1].color.b = 1.0;
-+ t_cfg[i*2+1].color.a = 1.0;
-+ t_cfg[i*2+1].at.x = BL_START_X + (i-start_offset) * (BAR_GAP + BAR_WIDTH);
-+ t_cfg[i*2+1].at.y = BL_START_Y - BAR_HEIGHT - FONT_SIZE;
-+ t_cfg[i*2+1].fontsize = FONT_SIZE;
-+
-+ strcpy(bg_text[i*2], output[i - start_offset]);
-+ strcpy(bg_text[i*2+1], "0%");
-+ }
-+
-+ t_cfg[(end_offset-1)*2].color.r = 0.0;
-+ t_cfg[(end_offset-1)*2].color.g = 1.0;
-+ t_cfg[(end_offset-1)*2].color.b = 1.0;
-+ t_cfg[(end_offset-1)*2].color.a = 1.0;
-+ t_cfg[(end_offset-1)*2].at.x = BL_START_X + 80;
-+ t_cfg[(end_offset-1)*2].at.y = TR_START_Y - 40;
-+ t_cfg[(end_offset-1)*2].fontsize = FONT_SIZE + 3;
-+
-+ printd("Copying title string %s\n", output[end_offset - start_offset -1]);
-+ strcpy(bg_text[(end_offset-1)*2], output[end_offset - start_offset-1]);
-+}
-+
-+void fill_table_details(int start_offset, int end_offset, char **output, struct table_configuration *table_config)
-+{
-+ int i;
-+
-+ const int BL_START_X = table_config->BL_START_X;
-+ const int BL_START_Y = table_config->BL_START_Y;
-+ const int BAR_GAP = table_config->BAR_GAP;
-+ const int BAR_HEIGHT = table_config->BAR_HEIGHT;
-+ const int BAR_WIDTH = table_config->BAR_WIDTH;
-+ const int TR_START_X = table_config->TR_START_X;
-+ const int TR_START_Y = table_config->TR_START_Y;
-+ const int FONT_SIZE = table_config->FONT_SIZE;
-+ printf("Filling from %d to %d\n", start_offset, end_offset);
-+
-+
-+ char tokenize[200];
-+ char tokens[10][100];
-+ char *pair, *key, *value;
-+ int k=0;
-+ char title[100], unit[100];
-+
-+ strcpy(tokenize, output[end_offset - start_offset - 1]);
-+ memset(tokens, 0, sizeof(tokens));
-+
-+ k=0;
-+ pair = strtok (tokenize,",");
-+ while (pair != NULL) {
-+ strcpy(tokens[k++], pair);
-+ pair = strtok (NULL, ",");
-+ }
-+
-+ i=0;
-+ memset(title, 0, sizeof(title));
-+ memset(unit, 0, sizeof(unit));
-+ while(i < k) {
-+ key=strtok(tokens[i], "=");
-+ if(key != NULL) {
-+ if(strcmp(key,"TITLE") == 0) {
-+ value = strtok(NULL, "=");
-+ if(value != NULL) {
-+ strcpy(title, value);
-+ }
-+ }
-+ if(strcmp(key,"UNIT") == 0) {
-+ value = strtok(NULL, "=");
-+ if(value != NULL) {
-+ strcpy(unit, value);
-+ }
-+ }
-+ }
-+ i++;
-+ }
-+
-+ for(i=start_offset; i< end_offset-1; i++) {
-+ y_cfg[i*2].region.bottom_left.x = BL_START_X;
-+ y_cfg[i*2].region.bottom_left.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
-+ y_cfg[i*2].region.top_right.x = TR_START_X;
-+ y_cfg[i*2].region.top_right.y = TR_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
-+ y_cfg[i*2].line_color.r = 1.0;
-+ y_cfg[i*2].line_color.g = 1.0;
-+ y_cfg[i*2].line_color.b = 1.0;
-+ y_cfg[i*2].line_color.a = 1.0;
-+ y_cfg[i*2].fill_color.r = 0.0;
-+ y_cfg[i*2].fill_color.g = 0.3;
-+ y_cfg[i*2].fill_color.b = 0.0;
-+ y_cfg[i*2].fill_color.a = 0.7;
-+
-+ y_cfg[i*2+1].region.bottom_left.x = TR_START_X;
-+ y_cfg[i*2+1].region.bottom_left.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);
-+ y_cfg[i*2+1].region.top_right.x = TR_START_X + (BAR_WIDTH); //+ 1 * BL_START_X;
-+ y_cfg[i*2+1].region.top_right.y = TR_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT);;
-+ y_cfg[i*2+1].line_color.r = 1.0;
-+ y_cfg[i*2+1].line_color.g = 1.0;
-+ y_cfg[i*2+1].line_color.b = 1.0;
-+ y_cfg[i*2+1].line_color.a = 1.0;
-+ y_cfg[i*2+1].fill_color.r = 0.3;
-+ y_cfg[i*2+1].fill_color.g = 0.0;
-+ y_cfg[i*2+1].fill_color.b = 0.0;
-+ y_cfg[i*2+1].fill_color.a = 0.7;
-+
-+
-+ t_cfg[i*2].color.r = 1.0;
-+ t_cfg[i*2].color.g = 1.0;
-+ t_cfg[i*2].color.b = 1.0;
-+ t_cfg[i*2].color.a = 1.0;
-+ t_cfg[i*2].at.x = BL_START_X + 5;
-+ t_cfg[i*2].at.y = BL_START_Y + (i - start_offset) * (BAR_GAP+BAR_HEIGHT) -5;
-+ t_cfg[i*2].fontsize = FONT_SIZE;
-+
-+ t_cfg[i*2+1].color.r = 1.0;
-+ t_cfg[i*2+1].color.g = 1.0;
-+ t_cfg[i*2+1].color.b = 1.0;
-+ t_cfg[i*2+1].color.a = 1.0;
-+ t_cfg[i*2+1].at.x = TR_START_X + 50;//BAR_WIDTH + TR_START_X;
-+ t_cfg[i*2+1].at.y = BL_START_Y + (i - start_offset) * (BAR_GAP + BAR_HEIGHT) -5;
-+ t_cfg[i*2+1].fontsize = FONT_SIZE;
-+
-+ printd("Copying string %s at %d\n", output[i-start_offset], i);
-+ strcpy(bg_text[i*2], output[i-start_offset]);
-+ printd("Setting text 0 %s at %d\n", unit, i*2+1);
-+ sprintf(bg_text[i*2+1], "0 %s", unit);
-+ }
-+ for(i=start_offset; i< end_offset*2; i++) {
-+ printd("%d - (%d, %d) to (%d, %d)\n", i, y_cfg[i].region.bottom_left.x, y_cfg[i].region.bottom_left.y, y_cfg[i].region.top_right.x, y_cfg[i].region.top_right.y);
-+ }
-+
-+ t_cfg[(end_offset-1)*2].color.r = 0.0;
-+ t_cfg[(end_offset-1)*2].color.g = 1.0;
-+ t_cfg[(end_offset-1)*2].color.b = 1.0;
-+ t_cfg[(end_offset-1)*2].color.a = 1.0;
-+ t_cfg[(end_offset-1)*2].at.x = BL_START_X + 80;
-+ t_cfg[(end_offset-1)*2].at.y = BL_START_Y - 40;
-+ t_cfg[(end_offset-1)*2].fontsize = FONT_SIZE + 3;
-+
-+ printd("Copying title string %s\n", title);
-+ strcpy(bg_text[(end_offset-1)*2], title);
-+
-+}
-+
-+
-+int get_key_value_from_string(char *string, char *limiter, char *key, char *value)
-+{
-+ char *mykey, *myvalue;
-+
-+ mykey=strtok(string, limiter);
-+ if(mykey != NULL) {
-+ myvalue = strtok(NULL, "=");
-+ strtok(myvalue, "\n");
-+ if(myvalue == NULL) {
-+ return -1;
-+ }
-+ }
-+ else {
-+ return -1;
-+ }
-+ printd("Key is %s\n", mykey);
-+ printd("Value is %s\n", myvalue);
-+ strcpy(key, mykey);
-+ strcpy(value, myvalue);
-+ return 0;
-+
-+}
-+
-+void populate_table_configuration(struct table_configuration *tbl_cfg, int cur_items, char **item_list)
-+{
-+ static int total_items = 0;
-+ static int total_tables = 0;
-+
-+ tbl_cfg->BAR_HEIGHT = 25;
-+ tbl_cfg->BAR_WIDTH = 150;
-+ tbl_cfg->BL_START_X = 40;
-+ tbl_cfg->BL_START_Y = 80 + (total_items + total_tables) * tbl_cfg->BAR_HEIGHT;
-+ tbl_cfg->BAR_GAP = 0;
-+ tbl_cfg->TR_START_X = tbl_cfg->BL_START_X + tbl_cfg->BAR_WIDTH;
-+ tbl_cfg->TR_START_Y = tbl_cfg->BL_START_Y - tbl_cfg->BAR_HEIGHT;
-+ tbl_cfg->FONT_SIZE = 15;
-+
-+ printf("Proceeding with filling out details...\n");
-+ if(cur_items > 0)
-+ fill_table_details(total_items, total_items+cur_items, item_list, tbl_cfg);
-+
-+ total_items += cur_items;
-+ if(cur_items > 0)
-+ total_tables++;
-+
-+ printf("total_items = %d, total_tables = %d\n", total_items, total_tables);
-+ return;
-+}
-+
-+int fill_list_from_section(char **section_list, char *section_name)
-+{
-+ int total_items, j;
-+
-+ for(j=0; j<20; j++) {
-+ section_list[j] = malloc(100);
-+ }
-+
-+ total_items = get_strings_in_section(section_name, section_list);
-+ printf("\tThe total values in the section %s are %d\n", section_name, total_items);
-+ for(j=0; j<total_items; j++) {
-+ printf("\t\tThe returned strings for BOOT_TIME are %s\n", section_list[j]);
-+ }
-+
-+ total_elements += total_items;
-+
-+ return total_items;
-+}
-+
-+int main(int argc, char *argv[])
-+{
-+ double *bg_y;
-+ double *tg_y;
-+ int i,j;
-+ int refresh_rate;
-+
-+ if (SIG_ERR == signal(SIGPIPE,SIG_IGN))
-+ exit(1);
-+
-+ if (SIG_ERR == signal(SIGINT,my_signal_handler))
-+ exit(1);
-+
-+ if (SIG_ERR == signal(SIGTERM,my_signal_handler))
-+ exit(1);
-+
-+ if(argc == 2) {
-+ printf("Enabling debug\n");
-+ debug = atoi(argv[1]);
-+ }
-+ else {
-+ printf("Debug is disabled\n");
-+ debug = 0;
-+ }
-+
-+ char *output[20];
-+ int total = fill_list_from_section(output, "GLOBAL");
-+ for(j=0; j<total; j++) {
-+ char key[100], value[100];
-+ int ret = get_key_value_from_string(output[j], "=", key, value);
-+ if(ret == 0) {
-+ if(strcmp(key, "FIFO") == 0) {
-+ strcpy(readfifo, value);
-+ }
-+ if(strcmp(key, "REFRESH_RATE_USEC") == 0) {
-+ refresh_rate = atoi(value);
-+ }
-+ if(strcmp(key, "MAX_WIDTH") == 0) {
-+ MAX_WIDTH = atoi(value);
-+ }
-+ if(strcmp(key, "MAX_HEIGHT") == 0) {
-+ MAX_HEIGHT = atoi(value);
-+ }
-+ if(strcmp(key, "X_POS") == 0) {
-+ x_pos = atoi(value);
-+ }
-+ if(strcmp(key, "Y_POS") == 0) {
-+ y_pos = atoi(value);
-+ }
-+ }
-+
-+ }
-+
-+ printf("\n-------------------------------------------------\n");
-+ printf("Configured REFRESH_RATE is %d\n", refresh_rate);
-+ printf("Configured FIFO is %s\n", readfifo);
-+ printf("Configured MAX_WIDTH is %d\n", MAX_WIDTH);
-+ printf("Configured MAX_HEIGHT is %d\n", MAX_HEIGHT);
-+ printf("Configured starting location is (%d, %d)\n", x_pos, y_pos);
-+ printf("\n-------------------------------------------------\n");
-+
-+ int fd = open(readfifo, O_RDONLY|O_NONBLOCK);
-+ if (fd != -1) {
-+ printf("SUCCESS: Configured FIFO exists\n");
-+ close(fd);
-+ }
-+ else {
-+ printf("ERROR: %s not found\nPlease create the fifo by executing mkfifo %s before running the application\n", readfifo, readfifo);
-+ exit(0);
-+ }
-+
-+
-+ bg_p.title = malloc(100);
-+ sprintf(bg_p.title, "CPU Usage[@position-req=%dx%d]", x_pos, y_pos);
-+
-+ /* ------------------------------------------------------------------------*/
-+ /* Section for populating all lists from cfg sections*/
-+ /* ------------------------------------------------------------------------*/
-+ char *boot_list[20];
-+ int total_boot_items = fill_list_from_section(boot_list, "BOOT_TIME");
-+
-+ char *temperature_list[20];
-+ int total_temperature_items = fill_list_from_section(temperature_list, "TEMPERATURE");
-+
-+ char *cpu_load_list[20];
-+ total_cpu_load_items = fill_list_from_section(cpu_load_list, "CPU_LOAD");
-+
-+ char *voltage_list[20];
-+ int total_voltage_items = fill_list_from_section(voltage_list, "VOLTAGE");
-+
-+ char *frequency_list[20];
-+ int total_frequency_items = fill_list_from_section(frequency_list, "FREQUENCY");
-+ /* ------------------------------------------------------------------------*/
-+ /* total_elements will be updated inside the fill_list_from_section function */
-+
-+ t_cfg = malloc(sizeof(struct _text_config) * (total_elements*2 + 1));
-+ y_cfg = malloc(sizeof(struct _bar_graph_y_config) * total_elements*2);
-+ bg_p.num_of_y_items = total_elements*2;
-+ bg_p.y_config_array = y_cfg;
-+ bg_p.num_of_text_items = total_elements*2 + 1;
-+ bg_p.text_config_array = t_cfg;
-+
-+ bg_y = malloc(sizeof(double) * total_elements * 2);
-+ for(i=0; i< (total_elements*2+1); i++) {
-+ bg_text[i] = malloc(150);
-+ bg_y[i] = 1.0;
-+ }
-+
-+ tg_y = malloc(sizeof(double) * total_elements * 2);
-+ for(i=0; i< (total_elements*2+1); i++) {
-+ tg_text[i] = malloc(150);
-+ tg_y[i] = 0.1 * i;
-+ }
-+
-+ struct table_configuration boot_table_config;
-+ populate_table_configuration(&boot_table_config, total_boot_items, boot_list);
-+
-+ struct table_configuration temp_table_config;
-+ populate_table_configuration(&temp_table_config, total_temperature_items, temperature_list);
-+
-+ struct table_configuration voltage_table_config;
-+ populate_table_configuration(&voltage_table_config, total_voltage_items, voltage_list);
-+
-+ struct table_configuration frequency_table_config;
-+ populate_table_configuration(&frequency_table_config, total_frequency_items, frequency_list);
-+
-+ struct table_configuration cpu_load_config;
-+ cpu_load_config.BL_START_X = 40;
-+ cpu_load_config.BL_START_Y = 80 + (total_boot_items + total_temperature_items + total_voltage_items + total_frequency_items+ 4) * boot_table_config.BAR_HEIGHT + 80 /*cpu_load_config.BAR_HEIGHT */;
-+ cpu_load_config.BAR_GAP = 20;
-+ cpu_load_config.BAR_HEIGHT = 80;
-+ cpu_load_config.BAR_WIDTH = 40;
-+ cpu_load_config.TR_START_X = cpu_load_config.BL_START_X + cpu_load_config.BAR_WIDTH;
-+ cpu_load_config.TR_START_Y = cpu_load_config.BL_START_Y - cpu_load_config.BAR_HEIGHT;
-+ cpu_load_config.FONT_SIZE = 15;
-+ if(total_cpu_load_items > 0) {
-+ fill_cpu_load_details(total_boot_items+total_temperature_items+total_voltage_items+total_frequency_items, total_boot_items+total_temperature_items+total_voltage_items+total_frequency_items+total_cpu_load_items, cpu_load_list, &cpu_load_config);
-+ }
-+ else {
-+ cpu_load_offset = total_boot_items + total_temperature_items + total_voltage_items + total_frequency_items;
-+ }
-+
-+ tg_p.title=(char *)malloc(100);
-+ sprintf(tg_p.title, "CPU Usage[@position-req=%dx%d]", x_pos, y_pos);
-+ tg_p.height = MAX_HEIGHT;
-+ tg_p.width = MAX_WIDTH;
-+
-+ struct _y_config *tg_y_cfg = malloc(tg_p.num_of_y_items * sizeof(struct _y_config));
-+ tg_p.y_config_array = tg_y_cfg;
-+ tg_p.text_config_array = t_cfg;
-+
-+ printf("Proceeding to create starting visualization...\n");
-+ ctx = time_graph_create(argc, argv, &tg_p);
-+ if (!ctx) {
-+ printf("Unable to create time_graph... \n");
-+ exit(0);
-+ }
-+
-+ ctx = bar_graph_create(argc, argv, &bg_p);
-+ if (!ctx) {
-+ printf("Error creating context\n");
-+ exit(0);
-+ }
-+
-+ command_handler(OPEN, NULL, NULL);
-+
-+ /* Plot the graph first time */
-+ time_graph_plot(ctx, tg_y, (const char **)tg_text);
-+ bar_graph_plot(ctx, bg_y, (const char **)bg_text);
-+
-+ while (!sigtermed)
-+ {
-+ usleep(refresh_rate);
-+ int bytes_read = command_handler(READ, bg_y, bg_text);
-+ if(bytes_read > 0) {
-+ time_graph_plot(ctx, tg_y, (const char **)tg_text);
-+ bar_graph_plot(ctx, bg_y, (const char **)bg_text);
-+ }
-+ }
-+
-+ bar_graph_destroy(ctx);
-+ command_handler(CLOSE, NULL, NULL);
-+ return 0;
-+}
-diff --git a/clients/soc_performance_monitor.h b/clients/soc_performance_monitor.h
-new file mode 100644
-index 0000000..861c8c7
---- /dev/null
-+++ b/clients/soc_performance_monitor.h
-@@ -0,0 +1,40 @@
-+#define __SLEEP usleep(1000000)
-+
-+#define MAX_BUF 1024
-+#define OPEN 1
-+#define READ 2
-+#define CLOSE 3
-+
-+#define MAX_COLORS 12
-+
-+#define printd(fmt, ...) \
-+ do { if (debug) fprintf(stderr, fmt, __VA_ARGS__); } while (0)
-+
-+
-+struct _rgba pallette[MAX_COLORS] =
-+{
-+ { 1.0, 0.0, 0.0, 1.0 },
-+ { 0.0, 0.5, 0.0, 1.0 },
-+ { 0.0, 0.0, 1.0, 1.0 },
-+ { 0.0, 0.0, 0.0, 1.0 },
-+ { 0.0, 0.5, 1.0, 1.0 },
-+ { 1.0, 0.0, 1.0, 1.0 },
-+ { 0.5, 0.5, 1.0, 1.0 },
-+ { 1.0, 0.5, 0.0, 1.0 },
-+ { 0.5, 0.5, 0.25, 1.0 },
-+ { 0.5, 0.0, 0.0, 1.0 },
-+ { 1.0, 0.5, 0.5, 1.0 },
-+ { 0.0, 0.0, 0.20, 1.0 }
-+};
-+
-+struct table_configuration {
-+ int BL_START_X;
-+ int BL_START_Y;
-+ int BAR_GAP;
-+ int BAR_HEIGHT;
-+ int BAR_WIDTH;
-+ int TR_START_X;
-+ int TR_START_Y;
-+ int FONT_SIZE;
-+};
-+
-diff --git a/clients/statcoll.c b/clients/statcoll.c
-new file mode 100644
-index 0000000..5d5cae7
---- /dev/null
-+++ b/clients/statcoll.c
-@@ -0,0 +1,1433 @@
-+/*
-+ * Copyright (C) 2015 Texas Instruments
-+ * created by prash@ti.com on 16 Jan 2013
-+ * Adapted to Linux with changes in framework: Karthik R <karthik.ramanan@ti.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License version 2 as published by
-+ * the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <sys/mman.h>
-+#include <fcntl.h>
-+#include <signal.h>
-+#include <unistd.h>
-+#include <sys/time.h>
-+
-+#include "statcoll.h"
-+#include "statcoll_gui.h"
-+#include "time_bar_graph.h"
-+
-+#define ENABLE_MODE 0x0
-+#define READ_STATUS_MODE 0x1
-+
-+
-+
-+#define OPEN 1
-+#define READ 2
-+#define CLOSE 3
-+
-+
-+#if 1
-+#define __SLEEP sleep(1)
-+#else
-+#define __SLEEP usleep(100000)
-+#endif
-+//#define DUMMY_MODE
-+
-+#define MAX_COLORS 12
-+
-+struct _rgba pallette[MAX_COLORS] =
-+{
-+ { 1.0, 0.0, 0.0, 1.0 },
-+ { 0.0, 0.5, 0.0, 1.0 },
-+ { 0.0, 0.0, 1.0, 1.0 },
-+ { 0.0, 0.0, 0.0, 1.0 },
-+ { 0.0, 0.5, 1.0, 1.0 },
-+ { 1.0, 0.0, 1.0, 1.0 },
-+ { 0.5, 0.5, 1.0, 1.0 },
-+ { 1.0, 0.5, 0.0, 1.0 },
-+ { 0.5, 0.5, 0.25, 1.0 },
-+ { 0.5, 0.0, 0.0, 1.0 },
-+ { 1.0, 0.5, 0.5, 1.0 },
-+ { 0.0, 0.0, 0.20, 1.0 }
-+};
-+
-+const struct list_of_initiators initiators[STATCOL_MAX] =
-+{
-+ { STATCOL_EMIF1_SYS, "STATCOL_EMIF1_SYS" },
-+ { STATCOL_EMIF2_SYS,"STATCOL_EMIF2_SYS" },
-+ { STATCOL_MA_MPU_P1,"STATCOL_MPU_P1" },
-+ { STATCOL_MA_MPU_P2,"STATCOL_MPU_P2" },
-+ { STATCOL_MPU1,"STATCOL_MPU1" },
-+ { STATCOL_MMU1,"STATCOL_MMU1" },
-+ { STATCOL_TPTC_RD1,"STATCOL_TPTC_RD1" },
-+ { STATCOL_TPTC_WR1,"STATCOL_TPTC_WR1" },
-+ { STATCOL_TPTC_RD2,"STATCOL_TPTC_RD2" },
-+ { STATCOL_TPTC_WR2,"STATCOL_TPTC_WR2" },
-+ { STATCOL_VIP1_P1,"STATCOL_VIP1_P1" },
-+ { STATCOL_VIP1_P2,"STATCOL_VIP1_P2" },
-+ { STATCOL_VIP2_P1,"STATCOL_VIP2_P1" },
-+ { STATCOL_VIP2_P2,"STATCOL_VIP2_P2" },
-+ { STATCOL_VIP3_P1,"STATCOL_VIP3_P1" },
-+ { STATCOL_VIP3_P2,"STATCOL_VIP3_P2" },
-+ { STATCOL_VPE_P1,"STATCOL_VPE_P1" },
-+ { STATCOL_VPE_P2,"STATCOL_VPE_P2" },
-+ { STATCOL_EVE1_TC0,"STATCOL_EVE1_TC0" },
-+ { STATCOL_EVE1_TC1,"STATCOL_EVE1_TC1" },
-+ { STATCOL_EVE2_TC0,"STATCOL_EVE2_TC0" },
-+ { STATCOL_EVE2_TC1,"STATCOL_EVE2_TC1" },
-+ { STATCOL_EVE3_TC0,"STATCOL_EVE3_TC0" },
-+ { STATCOL_EVE3_TC1,"STATCOL_EVE3_TC1" },
-+ { STATCOL_EVE4_TC0,"STATCOL_EVE4_TC0" },
-+ { STATCOL_EVE4_TC1,"STATCOL_EVE4_TC1" },
-+ { STATCOL_DSP1_MDMA,"STATCOL_DSP1_MDMA" },
-+ { STATCOL_DSP1_EDMA,"STATCOL_DSP1_EDMA" },
-+ { STATCOL_DSP2_MDMA,"STATCOL_DSP2_MDMA" },
-+ { STATCOL_DSP2_EDMA,"STATCOL_DSP2_EDMA" },
-+ { STATCOL_IVA,"STATCOL_IVA" },
-+ { STATCOL_GPU_P1,"STATCOL_GPU_P1" },
-+ { STATCOL_GPU_P2,"STATCOL_GPU_P2" },
-+ { STATCOL_BB2D_P1,"STATCOL_BB2D_P1" },
-+ { STATCOL_DSS,"STATCOL_DSS" },
-+ { STATCOL_CSI2_2,"STATCOL_CSI2_2" },
-+ { STATCOL_MMU2,"STATCOL_MMU2" },
-+ { STATCOL_IPU1,"STATCOL_IPU1" },
-+ { STATCOL_IPU2,"STATCOL_IPU2" },
-+ { STATCOL_DMA_SYSTEM_RD,"STATCOL_DMA_SYSTEM_RD" },
-+ { STATCOL_DMA_SYSTEM_WR,"STATCOL_DMA_SYSTEM_WR" },
-+ { STATCOL_CSI2_1,"STATCOL_CSI2_1" },
-+ { STATCOL_USB3_SS,"STATCOL_USB3_SS" },
-+ { STATCOL_USB2_SS,"STATCOL_USB2_SS" },
-+ { STATCOL_USB2_ULPI_SS1,"STATCOL_USB2_ULPI_SS1" },
-+ { STATCOL_USB2_ULPI_SS2,"STATCOL_USB2_ULPI_SS2" },
-+ { STATCOL_PCIE_SS1,"STATCOL_PCIE_SS1" },
-+ { STATCOL_PCIE_SS2,"STATCOL_PCIE_SS2" },
-+ { STATCOL_DSP1_CFG,"STATCOL_DSP1_CFG" },
-+ { STATCOL_DSP2_CFG,"STATCOL_DSP2_CFG" },
-+ { STATCOL_GMAC_SW,"STATCOL_GMAC_SW" },
-+ { STATCOL_PRUSS1_P1,"STATCOL_PRUSS1_P1" },
-+ { STATCOL_PRUSS1_P2,"STATCOL_PRUSS1_P2" },
-+ { STATCOL_PRUSS2_P1,"STATCOL_PRUSS2_P1" },
-+ { STATCOL_PRUSS2_P2,"STATCOL_PRUSS2_P2" },
-+ { STATCOL_DMA_CRYPTO_RD,"STATCOL_DMA_CRYPTO_RD" },
-+ { STATCOL_DMA_CRYPTO_WR,"STATCOL_DMA_CRYPTO_WR" },
-+ { STATCOL_MPU2,"STATCOL_MPU2" },
-+ { STATCOL_MMC1,"STATCOL_MMC1" },
-+ { STATCOL_MMC2,"STATCOL_MMC2" },
-+ { STATCOL_SATA,"STATCOL_SATA" },
-+ { STATCOL_MLBSS,"STATCOL_MLBSS" },
-+ { STATCOL_BB2D_P2,"STATCOL_BB2D_P2" },
-+ { STATCOL_IEEE1500,"STATCOL_IEEE1500" },
-+ { STATCOL_DBG,"STATCOL_DBG" },
-+ { STATCOL_VCP1,"STATCOL_VCP1" },
-+ { STATCOL_OCMC_RAM1,"STATCOL_OCMC_RAM1" },
-+ { STATCOL_OCMC_RAM2,"STATCOL_OCMC_RAM2" },
-+ { STATCOL_OCMC_RAM3,"STATCOL_OCMC_RAM3" },
-+ { STATCOL_GPMC,"STATCOL_GPMC" },
-+ { STATCOL_MCASP1,"STATCOL_MCASP1" },
-+ { STATCOL_MCASP2,"STATCOL_MCASP2" },
-+ { STATCOL_MCASP3,"STATCOL_MCASP3" },
-+ { STATCOL_VCP2, "STATCOL_VCP2" }
-+};
-+
-+StatCollectorObj gStatColState;
-+
-+static void *statcoll_base_mem;
-+static int *l3_3_clkctrl;
-+
-+static UInt32 *statCountDSS = NULL;
-+static UInt32 *statCountIVA = NULL;
-+static UInt32 *statCountBB2DP1 = NULL;
-+static UInt32 *statCountBB2DP2 = NULL;
-+static UInt32 *statCountUSB4 = NULL;
-+static UInt32 *statCountSata = NULL;
-+static UInt32 *statCountEmif1 = NULL;
-+static UInt32 *statCountEmif2 = NULL;
-+
-+
-+static statcoll_initiators_object global_object[STATCOL_MAX];
-+UInt32 statCountIdx = 0;
-+UInt32 TRACE_SZ = 0;
-+
-+void create_overall_box(struct _bar_graph_y_config *y_cfg, struct _text_config *t_cfg, char *text[])
-+{
-+ int i=0;
-+
-+ memset(y_cfg, 0x0, sizeof(struct _y_config)*25);
-+ memset(t_cfg, 0x0, sizeof(struct _text_config)*25);
-+
-+
-+ for(i=0; i<TOTAL_Y_PARAMETERS; i++) {
-+ (y_cfg+i)->line_color.r = 1.0;
-+ (y_cfg+i)->line_color.g = 1.0;
-+ (y_cfg+i)->line_color.b = 1.0;
-+ (y_cfg+i)->line_color.a = 0.7;
-+ (y_cfg+i)->fill_color.r = 0.0;
-+ (y_cfg+i)->fill_color.g = 0.0;
-+ (y_cfg+i)->fill_color.b = 0.0;
-+ (y_cfg+i)->fill_color.a = 0.1;
-+ }
-+
-+ (y_cfg+0)->region.bottom_left.x = 0;
-+ (y_cfg+0)->region.bottom_left.y = MAX_HEIGHT - HEIGHT_EMIF_AREA;
-+ (y_cfg+0)->region.top_right.x = MAX_WIDTH;
-+ (y_cfg+0)->region.top_right.y = 0;
-+
-+ (t_cfg+0)->at.x = MAX_WIDTH/2 - 8*FONT_SIZE - 50;
-+ (t_cfg+0)->at.y = BORDER - FONT_SIZE + 6;
-+ strcpy(text[0], string_list[0]);
-+
-+ (y_cfg+1)->region.bottom_left.x = TIME_GRAPH_AREA_BL_X;
-+ (y_cfg+1)->region.bottom_left.y = TIME_GRAPH_AREA_BL_Y;
-+ (y_cfg+1)->region.top_right.x = TIME_GRAPH_AREA_TR_X;
-+ (y_cfg+1)->region.top_right.y = TIME_GRAPH_AREA_TR_Y;
-+
-+ (t_cfg+1)->at.x = TIME_GRAPH_AREA_BL_X - 2*FONT_SIZE;
-+ (t_cfg+1)->at.y = TIME_GRAPH_AREA_TR_Y;
-+ strcpy(text[1],string_list[1]);
-+
-+ for(i=2; i<7; i++)
-+ {
-+ (y_cfg+i)->region.bottom_left.x = TIME_GRAPH_AREA_BL_X;
-+ (y_cfg+i)->region.bottom_left.y = TIME_GRAPH_AREA_BL_Y;// - (i-2) * (30);
-+ (y_cfg+i)->region.top_right.x = TIME_GRAPH_AREA_TR_X;
-+ (y_cfg+i)->region.top_right.y = TIME_GRAPH_AREA_TR_Y + (i-1) * ((TIME_GRAPH_AREA_BL_Y - TIME_GRAPH_AREA_TR_Y)/5);
-+ (t_cfg+i)->at.x = TIME_GRAPH_AREA_BL_X - 2*FONT_SIZE;
-+ (t_cfg+i)->at.y = TIME_GRAPH_AREA_TR_Y + (i-1) * ((TIME_GRAPH_AREA_BL_Y - TIME_GRAPH_AREA_TR_Y)/5);//TIME_GRAPH_AREA_TR_Y;
-+ strcpy(text[i],string_list[i]);
-+ }
-+
-+#if 1
-+ (y_cfg+7)->region.bottom_left.x = EMIF_AREA_BL_X;
-+ (y_cfg+7)->region.bottom_left.y = EMIF_AREA_BL_Y;
-+ (y_cfg+7)->region.top_right.x = EMIF_AREA_TR_X;
-+ (y_cfg+7)->region.top_right.y = EMIF_AREA_TR_Y;
-+
-+ (t_cfg+7)->at.x = WIDTH_EMIF_AREA/2 - 2*FONT_SIZE;
-+ (t_cfg+7)->at.y = EMIF_AREA_TR_Y + FONT_SIZE;
-+ strcpy(text[7],string_list[7]);
-+
-+ for(i=8; i<12; i=i+2)
-+ {
-+ (y_cfg+i)->region.bottom_left.x = EMIF_AREA_BL_X + BORDER + (i-8)*(BAR_WIDTH+BAR_GAP)/2;
-+ (y_cfg+i)->region.bottom_left.y = EMIF_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
-+ (y_cfg+i)->region.top_right.x = EMIF_AREA_BL_X + BORDER + BAR_WIDTH + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i)->region.top_right.y = EMIF_AREA_TR_Y + BORDER * 1.2;
-+
-+ (y_cfg+i)->fill_color.r = 1.0;
-+ (y_cfg+i)->fill_color.g = 0.0;
-+ (y_cfg+i)->fill_color.b = 0.0;
-+ (y_cfg+i)->fill_color.a = 0.1;
-+
-+ (y_cfg+i+1)->region.bottom_left.x = EMIF_AREA_BL_X + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i+1)->region.bottom_left.y = EMIF_AREA_BL_Y - BORDER/2;
-+ (y_cfg+i+1)->region.top_right.x = EMIF_AREA_BL_X + BORDER + BAR_WIDTH + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i+1)->region.top_right.y = EMIF_AREA_TR_Y + BORDER*1.2;
-+
-+ (y_cfg+i+1)->fill_color.r = 0.0;
-+ (y_cfg+i+1)->fill_color.g = 1.0;
-+ (y_cfg+i+1)->fill_color.b = 0.0;
-+ (y_cfg+i+1)->fill_color.a = 1.0;
-+
-+ (t_cfg+i)->at.x = EMIF_AREA_BL_X + BAR_WIDTH + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2- 2.2*FONT_SIZE;
-+ (t_cfg+i)->at.y = EMIF_AREA_TR_Y + BORDER*1.2 -5;
-+
-+ /* Fixed strings */
-+ (t_cfg+i+1)->at.x = EMIF_AREA_BL_X + BORDER + (i-8) * (BAR_WIDTH + BAR_GAP)/2;
-+ (t_cfg+i+1)->at.y = EMIF_AREA_BL_Y;// - BORDER + FONT_SIZE;
-+
-+ strcpy(text[i],string_list[i]);
-+ strcpy(text[i+1],string_list[i+1]);
-+ }
-+
-+ (y_cfg+12)->region.bottom_left.x = INITIATORS_AREA_BL_X;
-+ (y_cfg+12)->region.bottom_left.y = INITIATORS_AREA_BL_Y;
-+ (y_cfg+12)->region.top_right.x = INITIATORS_AREA_TR_X;
-+ (y_cfg+12)->region.top_right.y = INITIATORS_AREA_TR_Y;
-+
-+ (t_cfg+12)->at.x = EMIF_AREA_TR_X + (INITIATORS_AREA_TR_X - INITIATORS_AREA_BL_X)/2 - 4 * FONT_SIZE;
-+ (t_cfg+12)->at.y = INITIATORS_AREA_TR_Y + FONT_SIZE;
-+ strcpy(text[12],string_list[12]);
-+
-+ for(i=13; i<25; i=i+2)
-+ {
-+ (y_cfg+i)->region.bottom_left.x = INITIATORS_AREA_BL_X + BORDER + (i-13)*(BAR_WIDTH+BAR_GAP)/2;
-+ (y_cfg+i)->region.bottom_left.y = INITIATORS_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
-+ (y_cfg+i)->region.top_right.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i)->region.top_right.y = INITIATORS_AREA_TR_Y + BORDER*1.2;
-+
-+ (y_cfg+i)->fill_color.r = 1.0;
-+ (y_cfg+i)->fill_color.g = 0.0;
-+ (y_cfg+i)->fill_color.b = 0.0;
-+ (y_cfg+i)->fill_color.a = 0.1;
-+
-+ (y_cfg+i+1)->region.bottom_left.x = INITIATORS_AREA_BL_X + BORDER + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i+1)->region.bottom_left.y = INITIATORS_AREA_BL_Y - BORDER/2;// - (i-2) * (30);
-+ (y_cfg+i+1)->region.top_right.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2;
-+ (y_cfg+i+1)->region.top_right.y = INITIATORS_AREA_TR_Y + BORDER* 1.2;
-+
-+ (y_cfg+i+1)->fill_color.r = 0.0;
-+ (y_cfg+i+1)->fill_color.g = 1.0;
-+ (y_cfg+i+1)->fill_color.b = 0.0;
-+ (y_cfg+i+1)->fill_color.a = 1.0;
-+
-+ (t_cfg+i)->at.x = INITIATORS_AREA_BL_X + BORDER + BAR_WIDTH + (i-13) * (BAR_WIDTH + BAR_GAP)/2 - 2.2* FONT_SIZE;
-+ (t_cfg+i)->at.y = INITIATORS_AREA_TR_Y + BORDER*1.2 -5;
-+
-+ (t_cfg+i+1)->at.x = INITIATORS_AREA_BL_X + BORDER + (i-13)*(BAR_WIDTH+BAR_GAP)/2;
-+ (t_cfg+i+1)->at.y = INITIATORS_AREA_BL_Y;
-+
-+ strcpy(text[i],string_list[i]);
-+ strcpy(text[i+1],string_list[i+1]);
-+ }
-+#endif
-+
-+#if 0
-+ for(i=0; i<25; i++)
-+ printf("(%d, %d) to (%d, %d)\n", (y_cfg +i)->region.bottom_left.x,(y_cfg +i)->region.bottom_left.y,(y_cfg +i)->region.top_right.x, (y_cfg +i)->region.top_right.y);
-+#endif
-+
-+
-+
-+ for(i=0; i<25; i++) {
-+ (t_cfg+i)->color.r = 0.0;
-+ (t_cfg+i)->color.g = 1.0;
-+ (t_cfg+i)->color.b = 1.0;
-+ (t_cfg+i)->color.a = 1.0;
-+ (t_cfg+i)->fontsize = FONT_SIZE;
-+ }
-+ (t_cfg+0)->fontsize = 20;
-+
-+
-+}
-+
-+
-+void statCollectorInit()
-+{
-+ int index;
-+
-+ gStatColState.stat0_filter_cnt = 0;
-+ gStatColState.stat1_filter_cnt = 0;
-+ gStatColState.stat2_filter_cnt = 0;
-+ gStatColState.stat3_filter_cnt = 0;
-+ gStatColState.stat4_filter_cnt = 0;
-+ gStatColState.stat5_filter_cnt = 0;
-+ gStatColState.stat6_filter_cnt = 0;
-+ gStatColState.stat7_filter_cnt = 0;
-+ gStatColState.stat8_filter_cnt = 0;
-+ gStatColState.stat9_filter_cnt = 0;
-+
-+ for(index=STATCOL_EMIF1_SYS; index < STATCOL_MAX; index++)
-+ {
-+ global_object[index].b_enabled = 0;
-+
-+ strcpy(global_object[index].name, initiators[index].name);
-+
-+ global_object[index].readings = malloc(TRACE_SZ * sizeof(UInt32));
-+ memset(global_object[index].readings, 0, TRACE_SZ * sizeof(UInt32));
-+
-+ global_object[index].timestamp = NULL;
-+
-+ global_object[index].group_id = 0xFF;
-+ global_object[index].counter_id = 0;
-+ global_object[index].base_address = 0;
-+ global_object[index].mux_req = 0;
-+ }
-+
-+}
-+
-+void wr_stat_reg(UInt32 address, UInt32 data)
-+{
-+ UInt32 *mymem = statcoll_base_mem;
-+ UInt32 delta = (address - STATCOLL_BASE) / 4;
-+#ifndef DUMMY_MODE
-+ mymem[delta] = data;
-+#else
-+ printf("WRITE: Address = 0x%x, Data = 0x%x\n", address, data);
-+#endif
-+}
-+
-+UInt32 rd_stat_reg(UInt32 address)
-+{
-+#ifndef DUMMY_MODE
-+ UInt32 *mymem = statcoll_base_mem;
-+ UInt32 data;
-+ UInt32 delta = (address - STATCOLL_BASE) / 4;
-+ data = mymem[delta];
-+ return data;
-+#else
-+ printf("READ: Address = 0x%x\n", address);
-+#endif
-+}
-+
-+UInt32 statCollectorControlInitialize(UInt32 instance_id)
-+{
-+ UInt32 cur_base_address = 0;
-+ UInt32 cur_event_mux_req;
-+ UInt32 cur_event_mux_resp;
-+ UInt32 cur_stat_filter_cnt;
-+
-+ switch (instance_id)
-+ {
-+ case STATCOL_EMIF1_SYS:
-+ cur_base_address = stat_coll0_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
-+ global_object[instance_id].group_id = 0;
-+ break;
-+ case STATCOL_EMIF2_SYS:
-+ cur_base_address = stat_coll0_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
-+ global_object[instance_id].group_id = 0;
-+ break;
-+ case STATCOL_MA_MPU_P1:
-+ cur_base_address = stat_coll0_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
-+ global_object[instance_id].group_id = 0;
-+ break;
-+ case STATCOL_MA_MPU_P2:
-+ cur_base_address = stat_coll0_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat0_filter_cnt = gStatColState.stat0_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat0_filter_cnt;
-+ global_object[instance_id].group_id = 0;
-+ break;
-+ case STATCOL_MPU1:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_MMU1:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_TPTC_RD1:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_TPTC_WR1:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_TPTC_RD2:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_TPTC_WR2:
-+ cur_base_address = stat_coll1_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat1_filter_cnt = gStatColState.stat1_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat1_filter_cnt;
-+ global_object[instance_id].group_id = 1;
-+ break;
-+ case STATCOL_VIP1_P1:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VIP1_P2:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VIP2_P1:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VIP2_P2:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VIP3_P1:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VIP3_P2:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VPE_P1:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_VPE_P2:
-+ cur_base_address = stat_coll2_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat2_filter_cnt = gStatColState.stat2_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat2_filter_cnt;
-+ global_object[instance_id].group_id = 2;
-+ break;
-+ case STATCOL_EVE1_TC0:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE1_TC1:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE2_TC0:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE2_TC1:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE3_TC0:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE3_TC1:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE4_TC0:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_EVE4_TC1:
-+ cur_base_address = stat_coll3_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat3_filter_cnt = gStatColState.stat3_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat3_filter_cnt;
-+ global_object[instance_id].group_id = 3;
-+ break;
-+ case STATCOL_DSP1_MDMA:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_DSP1_EDMA:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_DSP2_MDMA:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_DSP2_EDMA:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_IVA:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_GPU_P1:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_GPU_P2:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_BB2D_P1:
-+ cur_base_address = stat_coll4_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat4_filter_cnt = gStatColState.stat4_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat4_filter_cnt;
-+ global_object[instance_id].group_id = 4;
-+ break;
-+ case STATCOL_DSS:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_CSI2_2:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_MMU2:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_IPU1:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_IPU2:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_DMA_SYSTEM_RD:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_DMA_SYSTEM_WR:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_CSI2_1:
-+ cur_base_address = stat_coll5_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat5_filter_cnt = gStatColState.stat5_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat5_filter_cnt;
-+ global_object[instance_id].group_id = 5;
-+ break;
-+ case STATCOL_USB3_SS:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_USB2_SS:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_USB2_ULPI_SS1:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_USB2_ULPI_SS2:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_PCIE_SS1:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_PCIE_SS2:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_DSP1_CFG:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_DSP2_CFG:
-+ cur_base_address = stat_coll6_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat6_filter_cnt = gStatColState.stat6_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat6_filter_cnt;
-+ global_object[instance_id].group_id = 6;
-+ break;
-+ case STATCOL_GMAC_SW:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_PRUSS1_P1:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_PRUSS1_P2:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_PRUSS2_P1:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_PRUSS2_P2:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_DMA_CRYPTO_RD:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_DMA_CRYPTO_WR:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_MPU2:
-+ cur_base_address = stat_coll7_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat7_filter_cnt = gStatColState.stat7_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat7_filter_cnt;
-+ global_object[instance_id].group_id = 7;
-+ break;
-+ case STATCOL_MMC1:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_MMC2:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_SATA:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_MLBSS:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_BB2D_P2:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_IEEE1500:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_DBG:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_VCP1:
-+ cur_base_address = stat_coll8_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat8_filter_cnt = gStatColState.stat8_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat8_filter_cnt;
-+ global_object[instance_id].group_id = 8;
-+ break;
-+ case STATCOL_OCMC_RAM1:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 0;
-+ cur_event_mux_resp = 1;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_OCMC_RAM2:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 2;
-+ cur_event_mux_resp = 3;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_OCMC_RAM3:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 4;
-+ cur_event_mux_resp = 5;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_GPMC:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 6;
-+ cur_event_mux_resp = 7;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_MCASP1:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 8;
-+ cur_event_mux_resp = 9;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_MCASP2:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 10;
-+ cur_event_mux_resp = 11;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_MCASP3:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 12;
-+ cur_event_mux_resp = 13;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ case STATCOL_VCP2:
-+ cur_base_address = stat_coll9_base_address;
-+ cur_event_mux_req = 14;
-+ cur_event_mux_resp = 15;
-+ gStatColState.stat9_filter_cnt = gStatColState.stat9_filter_cnt + 1;
-+ cur_stat_filter_cnt = gStatColState.stat9_filter_cnt;
-+ global_object[instance_id].group_id = 9;
-+ break;
-+ default:
-+ printf("ERROR: Unknown initiator %d\n", instance_id);
-+ exit(0);
-+ };
-+
-+ {
-+ if ( cur_stat_filter_cnt > 4 )
-+ {
-+ printf("WARNING: We have exhausted filters/counters.....\n");
-+ return 0;
-+ }
-+ // Global Enable Stat Collector
-+ wr_stat_reg(cur_base_address+0x8,0x1);
-+
-+ // Soft Enable Stat Collector
-+ wr_stat_reg(cur_base_address+0xC,0x1);
-+
-+ wr_stat_reg(cur_base_address+0x18,0x5);
-+ // Operation of Stat Collector / RespEvt => Packet
-+ wr_stat_reg(cur_base_address+0x1C,0x5);
-+
-+
-+ // Event Sel
-+ wr_stat_reg(cur_base_address+0x20+4*(cur_stat_filter_cnt-1),cur_event_mux_req);
-+
-+ // Op is EventInfo
-+ wr_stat_reg(cur_base_address+0x1FC+(0x158*(cur_stat_filter_cnt-1)),2);
-+
-+ // Event Info Sel Op -> packet length
-+ wr_stat_reg(cur_base_address+0x1F8+(0x158*(cur_stat_filter_cnt-1)),0);
-+
-+ // Filter Global Enable
-+ wr_stat_reg(cur_base_address+0xAC+(0x158*(cur_stat_filter_cnt-1)),0x1);
-+
-+ // Filter Enable
-+ wr_stat_reg(cur_base_address+0xBC+(0x158*(cur_stat_filter_cnt-1)),0x1);
-+
-+ // Manual dump
-+ wr_stat_reg(cur_base_address+0x54,0x1);
-+ // use send register to reset counters
-+
-+ }
-+
-+ global_object[instance_id].mux_req = cur_event_mux_req;
-+ global_object[instance_id].base_address = cur_base_address;
-+ global_object[instance_id].counter_id = cur_stat_filter_cnt;
-+ global_object[instance_id].b_enabled = 1;
-+
-+ return cur_stat_filter_cnt;
-+}
-+
-+
-+
-+void statCollectorReadGroup(UInt32 group_id)
-+{
-+ int i=0;
-+ UInt32 cur_base_address = 0x45001000 + ((group_id - 1) * 0x1000);
-+
-+ wr_stat_reg(cur_base_address+0xC,0x0);
-+
-+ for(i=0; i < STATCOL_MAX; i++)
-+ {
-+ if(global_object[i].group_id == (group_id - 1) &&
-+ global_object[i].b_enabled == 1)
-+ {
-+ UInt32 cur_stat_filter_cnt = global_object[i].counter_id;
-+
-+ global_object[i].readings[statCountIdx] = rd_stat_reg(cur_base_address+0x8C+((cur_stat_filter_cnt-1)*4));
-+ }
-+ }
-+
-+ wr_stat_reg(cur_base_address+0xC,0x1);
-+}
-+
-+
-+volatile sig_atomic_t sigtermed = 0;
-+
-+void my_signal_handler(int signum)
-+{
-+ if (signum == SIGTERM || signum == SIGINT) {
-+ sigtermed = 1;
-+ }
-+}
-+
-+struct sort
-+{
-+ int pos;
-+ double value;
-+};
-+
-+
-+void *ctx;
-+struct time_graph_create_params p;
-+char xpos_string[100], ypos_string[100];
-+
-+void mpu_handler(int command)
-+{
-+#if 1
-+ static int fd;
-+ char buf[1000];
-+ char * tabledata= "/tmp/statcollfifo";
-+ int i;
-+ int bytes;
-+ static int offset = 13;
-+
-+ switch(command)
-+ {
-+ case OPEN:
-+ fd = open(tabledata, O_RDONLY|O_NONBLOCK);
-+ break;
-+
-+ case READ:
-+
-+ /* open, read, and display the message from the FIFO */
-+ bytes=read(fd, buf, 1000);
-+ if(bytes > 0)
-+ {
-+ char str[100];
-+ char value[100];
-+ sscanf(buf, "%s %s", str, value);
-+ if(strcmp(str, "MOVE:") == 0)
-+ {
-+ printf("Received MOVE command : %s\n", buf);
-+ sprintf(p.title, "CPU Usage[@position-req=%sx%s]", value, ypos_string);
-+ move_graph(ctx, &p);
-+ }
-+ else
-+ {
-+ printf("ERROR: Received unexpected data from FIFO - \" %s \" \n", buf);
-+ }
-+ memset(buf, 0x0, sizeof(buf));
-+ }
-+
-+ break;
-+
-+ case CLOSE:
-+ close(fd);
-+ break;
-+ }
-+#endif
-+ return;
-+}
-+
-+
-+UInt32 statcoll_start(UInt32 TOTAL_TIME, UInt32 INTERVAL_US, char list[][50], UInt32 xpos, UInt32 ypos)
-+{
-+ int i, fd, index;
-+ UInt32 counterIdDss, counterIdIva, counterIdBB2dP1, counterIdBB2dP2, counterIdUsb4, counterIdSata, counterIdEmif1, counterIdEmif2;
-+
-+ if (SIG_ERR == signal(SIGPIPE,SIG_IGN))
-+ exit(1);
-+
-+ if (SIG_ERR == signal(SIGINT,my_signal_handler))
-+ exit(1);
-+
-+ if (SIG_ERR == signal(SIGTERM,my_signal_handler))
-+ exit(1);
-+
-+
-+ struct timeval tv1, tv2;
-+ gettimeofday(&tv1, NULL);
-+ printf("------------------------------------------------\n");
-+ printf("Compile time = %s %s\n",__DATE__, __TIME__);
-+ printf("------------------------------------------------\n\n");
-+ //printd("Start time = %d\n", time(NULL));
-+ //printd("Time seconds = %d, usecs = %d\n", tv.tv_sec, tv.tv_usec);
-+
-+ statcoll_params params;
-+ memset(&params, sizeof(params), 0);
-+ params.INTERVAL_US = INTERVAL_US;
-+ params.TOTAL_TIME = TOTAL_TIME;
-+
-+ i=0;
-+ index=0;
-+
-+ while(list[i][0] != 0)
-+ {
-+ for(index=0; index< STATCOL_MAX; index++) {
-+ if(strcmp(list[i], initiators[index].name) == 0)
-+ {
-+ strcpy(params.user_config_list[params.no_of_initiators].name, list[i]);
-+ params.user_config_list[params.no_of_initiators++].id = initiators[index].id;
-+ break;
-+ }
-+ }
-+
-+ if(index == STATCOL_MAX) {
-+ printf("ERROR: Unknown initiator.%d.. .%s. \n", i, list[i]);
-+ //exit(0);
-+ }
-+ i++;
-+ }
-+
-+ struct bar_graph_create_params bg_p;
-+ struct _y_config *y_cfg;
-+ struct _text_config *t_cfg;
-+ double *y;
-+ double *bg_y;
-+ char *text_list[STATCOL_MAX];
-+
-+ struct _bar_graph_y_config *bg_y_cfg;
-+ struct _text_config *bg_t_cfg;
-+ char *bg_text_list[STATCOL_MAX];
-+
-+ sprintf(xpos_string, "%d", xpos);
-+ sprintf(ypos_string, "%d", ypos);
-+ p.title=(char *)malloc(100);
-+ sprintf(p.title, "CPU Usage[@position-req=%sx%s]", xpos_string, ypos_string);
-+ //p.height = MAX_HEIGHT - HEIGHT_EMIF_AREA;
-+ p.height = MAX_HEIGHT;// - HEIGHT_EMIF_AREA;
-+ p.width = MAX_WIDTH;
-+ p.draw_area.bottom_left.x = TIME_GRAPH_AREA_BL_X;
-+ p.draw_area.bottom_left.y = TIME_GRAPH_AREA_BL_Y;
-+ p.draw_area.top_right.x = TIME_GRAPH_AREA_TR_X;
-+ p.draw_area.top_right.y = TIME_GRAPH_AREA_TR_Y;
-+ p.time_span = 120000; // 120 seconds
-+ p.num_of_y_items = params.no_of_initiators+1;
-+ p.num_of_text_items = 0;//params.no_of_initiators;
-+
-+
-+ y_cfg = malloc((params.no_of_initiators+1) * sizeof(struct _y_config));
-+ t_cfg = malloc(params.no_of_initiators * sizeof(struct _text_config));
-+ y = malloc((params.no_of_initiators+1) * sizeof(double));
-+ p.y_config_array = y_cfg;
-+ p.text_config_array = t_cfg;
-+
-+ bg_y_cfg = malloc(TOTAL_Y_PARAMETERS * sizeof(struct _bar_graph_y_config));
-+ bg_t_cfg = malloc(TOTAL_Y_PARAMETERS * sizeof(struct _text_config));
-+ bg_y = malloc(TOTAL_Y_PARAMETERS * sizeof(double));
-+
-+ for(i=0; i<TOTAL_Y_PARAMETERS; i++)
-+ {
-+ bg_text_list[i] = malloc(100);
-+ strcpy(bg_text_list[i],"test");
-+ }
-+
-+ create_overall_box(bg_y_cfg, bg_t_cfg, bg_text_list);
-+
-+
-+ i=0;
-+ while(i < params.no_of_initiators)
-+ {
-+ text_list[i] = malloc(100 * sizeof(char));
-+ memset(text_list[i], 0x0, 100);
-+
-+ ((struct _y_config *)y_cfg+i)->line_color.r = pallette[i%MAX_COLORS].r;
-+ ((struct _y_config *)y_cfg+i)->line_color.g = pallette[i%MAX_COLORS].g;
-+ ((struct _y_config *)y_cfg+i)->line_color.b = pallette[i%MAX_COLORS].b;
-+ ((struct _y_config *)y_cfg+i)->line_color.a = 0.0;//pallette[i%MAX_COLORS].a;
-+
-+ ((struct _y_config *)y_cfg+i)->fill_color.r = 0.0;
-+ ((struct _y_config *)y_cfg+i)->fill_color.g = 1.0;
-+ ((struct _y_config *)y_cfg+i)->fill_color.b = 0.0;
-+ ((struct _y_config *)y_cfg+i)->fill_color.a = 0.5;
-+
-+ i++;
-+ }
-+
-+ ((struct _y_config *)y_cfg+i)->line_color.r = 0.0;
-+ ((struct _y_config *)y_cfg+i)->line_color.g = 0.0;
-+ ((struct _y_config *)y_cfg+i)->line_color.b = 0.0;
-+ ((struct _y_config *)y_cfg+i)->line_color.a = 0.5;
-+ ((struct _y_config *)y_cfg+i)->fill_color.r = 0.1;
-+ ((struct _y_config *)y_cfg+i)->fill_color.g = 0.9;
-+ ((struct _y_config *)y_cfg+i)->fill_color.b = 0.5;
-+ ((struct _y_config *)y_cfg+i)->fill_color.a = 1.0;
-+
-+ bg_p.title = "CPU Usage";
-+
-+ bg_p.num_of_y_items = TOTAL_Y_PARAMETERS;
-+ bg_p.y_config_array = bg_y_cfg;
-+ bg_p.num_of_text_items = TOTAL_Y_PARAMETERS;
-+ bg_p.text_config_array = bg_t_cfg;
-+
-+
-+ int argc;
-+ char *argv[10];
-+ ctx = time_graph_create(argc, argv, &p);
-+ if (!ctx) {
-+ printf("Error creating context\n");
-+ exit(0);
-+ }
-+
-+ printf("\n Context after time_graph_create = 0x%x\n", ctx);
-+ ctx = bar_graph_create(argc, argv, &bg_p);
-+ if (!ctx) {
-+ printf("Error creating context\n");
-+ exit(0);
-+ }
-+
-+ printf("\n Context after bar_graph_create= 0x%x\n", ctx);
-+
-+ printf("Total configured initiators = %d\n", params.no_of_initiators);
-+
-+
-+ fd = open("/dev/mem", O_RDWR);
-+ if (fd == -1){
-+ printf("error fd=open() \n");
-+ return -1;
-+ }
-+ statcoll_base_mem = mmap(NULL, STATCOLL_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, STATCOLL_BASE);
-+
-+ if (statcoll_base_mem == MAP_FAILED){
-+ printf("ERROR: mmap failed \n");
-+ return;
-+ }
-+ close(fd);
-+
-+ fd = open("/dev/mem", O_RDWR);
-+ if (fd == -1){
-+ printf("error fd=open() \n");
-+ return -1;
-+ }
-+ l3_3_clkctrl = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, CM_L3INSTR_REGISTER_BASE);
-+ if (l3_3_clkctrl == MAP_FAILED){
-+ printf("ERROR: mmap failed for CM_L3INSTR_REGISTER_BASE\n");
-+ return;
-+ }
-+ close(fd);
-+
-+ printf("SUCCESS: Mapped 0x%x to user space address 0x%x\n", STATCOLL_BASE, statcoll_base_mem);
-+ printf("INTERVAL = %d usecs\n", INTERVAL_US);
-+ printf("TOTAL TIME = %d seconds\n", TOTAL_TIME);
-+ TRACE_SZ = (TOTAL_TIME * 1000000)/INTERVAL_US;
-+ printf("TRACE SIZE = %d samples\n", TRACE_SZ);
-+
-+ printf("**************************************\n");
-+ printf("Going to initialize the L3 clocks \n");
-+ l3_3_clkctrl[CM_L3INSTR_L3INSTR_CLKSTCTRL_OFFSET >> 2] = 0x2;
-+ l3_3_clkctrl[CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET >> 2] = 0x1;
-+ printf("**************************************\n");
-+
-+ while( (l3_3_clkctrl[CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET >> 2] & 0x30000) != 0x0)
-+ {
-+ printf("Waiting on module to be functional\n");
-+ }
-+
-+ statCollectorInit();
-+
-+ printf("SUCCESS: Initialized STAT COLLECTOR\n");
-+ /* Initialize all enabled initiators */
-+ for(index =0; index < params.no_of_initiators; index++) {
-+ printf("\t\t Initialized %s\n", params.user_config_list[index].name);
-+ statCollectorControlInitialize(params.user_config_list[index].id);
-+ }
-+
-+ const char *bg_text = "CPU Utilization";
-+
-+ int second_counter=0;
-+ memset(y, 0x0, sizeof(double)* (params.no_of_initiators+1));
-+
-+
-+
-+
-+ mpu_handler(OPEN);
-+
-+
-+ while(statCountIdx != (TRACE_SZ - 1))
-+ {
-+ usleep(INTERVAL_US);
-+ int group;
-+ for(group = 1; group<11; group++)
-+ statCollectorReadGroup(group);
-+
-+ mpu_handler(READ);
-+
-+ if(statCountIdx != 0 )
-+ for(i=0; i<params.no_of_initiators; i++) {
-+ y[i] += (double)(global_object[params.user_config_list[i].id].readings[statCountIdx])/ (8000000000);
-+ }
-+ second_counter++;
-+
-+ if(second_counter % 30 == 0)
-+ {
-+
-+ for(i=0; i<TOTAL_Y_PARAMETERS; i++) {
-+ bg_y[i] = 1.0;
-+ }
-+
-+ //HACK
-+ bg_y[9]=y[0]*2;
-+ bg_y[11]=y[1]*2;
-+ sprintf(bg_text_list[8], "%02.1f%s", y[0]*100, "%");
-+ sprintf(bg_text_list[10], "%02.1f%s", y[1]*100, "%");
-+
-+ struct sort sort_array[STATCOL_MAX];
-+ memset(sort_array, 0x0, sizeof(struct sort) * STATCOL_MAX);
-+ /* Sort here */
-+ for(i=2; i<params.no_of_initiators; i++) {
-+ sort_array[i-2].value = y[i];
-+ sort_array[i-2].pos = i;
-+ }
-+
-+ int j;
-+ double tempdouble;
-+ int tempint;
-+ for(i=0; i<params.no_of_initiators-2; i++) {
-+ for(j=i+1; j<params.no_of_initiators-2; j++) {
-+ if(sort_array[i].value < sort_array[j].value) {
-+ tempdouble = sort_array[j].value;
-+ tempint = sort_array[j].pos;
-+
-+ sort_array[j].value = sort_array[i].value;
-+ sort_array[j].pos = sort_array[i].pos;
-+
-+ sort_array[i].value = tempdouble;
-+ sort_array[i].pos = tempint;
-+ }
-+ }
-+ }
-+
-+ for(i=0; i<6; i++)
-+ {
-+ //HACK
-+ bg_y[14+i*2] = sort_array[i].value*2;
-+ sprintf(bg_text_list[13+i*2], "%02.1f%s", sort_array[i].value*100, "%");
-+ sprintf(bg_text_list[14+i*2], "%s", (params.user_config_list[sort_array[i].pos].name)+8);
-+ }
-+
-+ bar_graph_plot(ctx, bg_y, (const char **)bg_text_list);
-+
-+ y[params.no_of_initiators]=y[0]+y[1];
-+ time_graph_plot(ctx, y, (const char **)text_list);
-+ //printf("Plotting the time_graph\n");
-+ memset(y, 0x0, sizeof(double)* (params.no_of_initiators+1));
-+ }
-+ statCountIdx++;
-+
-+ }
-+
-+ mpu_handler(CLOSE);
-+
-+ printf("------------------------------------------------\n\n");
-+ printf("SUCCESS: Stat collection completed... Writing into file now\n");
-+ FILE *outfile = fopen("statcollector.csv", "w+");
-+ if (!outfile) {
-+ printf("\n ERROR: Error opening file");
-+ }
-+
-+ /* Ignore the first index at 0 */
-+ for(index=1; index<statCountIdx; index++) {
-+ for(i=0; i<params.no_of_initiators; i++) {
-+ fprintf(outfile,"%s = %d,", params.user_config_list[i].name, global_object[params.user_config_list[i].id].readings[index]);
-+ }
-+ fprintf(outfile,"\n");
-+ }
-+ fclose(outfile);
-+
-+ time_graph_destroy(ctx);
-+ gettimeofday(&tv2, NULL);
-+ //printf("End time = %d\n", time(NULL));
-+ //printf("Time seconds = %d, usecs = %d\n", tv.tv_sec, tv.tv_usec);
-+ printf("Total execution time = %d secs, %d usecs\n\n", (tv2.tv_sec - tv1.tv_sec), (tv2.tv_usec - tv2.tv_usec));
-+
-+ return 0;
-+}
-+
-+
-diff --git a/clients/statcoll.h b/clients/statcoll.h
-new file mode 100644
-index 0000000..fa92753
---- /dev/null
-+++ b/clients/statcoll.h
-@@ -0,0 +1,152 @@
-+#ifndef __STATCOLL_H
-+#define __STATCOLL_H
-+
-+
-+#define CM_L3INSTR_REGISTER_BASE (0x4A008000)
-+
-+#define CM_L3INSTR_L3INSTR_CLKSTCTRL_OFFSET (0xE00)
-+#define CM_L3INSTR_L3_MAIN_2_CLKCTRL_OFFSET (0xE20)
-+
-+#define STATCOLL_SIZE 40960
-+#define STATCOLL_BASE (0x45001000)
-+
-+#define stat_coll0_base_address (0x45001000)
-+#define stat_coll1_base_address (0x45002000)
-+#define stat_coll2_base_address (0x45003000)
-+#define stat_coll3_base_address (0x45004000)
-+#define stat_coll4_base_address (0x45005000)
-+#define stat_coll5_base_address (0x45006000)
-+#define stat_coll6_base_address (0x45007000)
-+#define stat_coll7_base_address (0x45008000)
-+#define stat_coll8_base_address (0x45009000)
-+#define stat_coll9_base_address (0x4500a000)
-+
-+#define printd(fmt, ...) \
-+ do { if (debug) fprintf(stderr, fmt, __VA_ARGS__); } while (0)
-+
-+typedef unsigned int UInt32;
-+
-+
-+typedef enum
-+{
-+ STATCOL_EMIF1_SYS,
-+ STATCOL_EMIF2_SYS,
-+ STATCOL_MA_MPU_P1,
-+ STATCOL_MA_MPU_P2,
-+ STATCOL_MPU1,
-+ STATCOL_MMU1,
-+ STATCOL_TPTC_RD1,
-+ STATCOL_TPTC_WR1,
-+ STATCOL_TPTC_RD2,
-+ STATCOL_TPTC_WR2,
-+ STATCOL_VIP1_P1,
-+ STATCOL_VIP1_P2,
-+ STATCOL_VIP2_P1,
-+ STATCOL_VIP2_P2,
-+ STATCOL_VIP3_P1,
-+ STATCOL_VIP3_P2,
-+ STATCOL_VPE_P1,
-+ STATCOL_VPE_P2,
-+ STATCOL_EVE1_TC0,
-+ STATCOL_EVE1_TC1,
-+ STATCOL_EVE2_TC0,
-+ STATCOL_EVE2_TC1,
-+ STATCOL_EVE3_TC0,
-+ STATCOL_EVE3_TC1,
-+ STATCOL_EVE4_TC0,
-+ STATCOL_EVE4_TC1,
-+ STATCOL_DSP1_MDMA,
-+ STATCOL_DSP1_EDMA,
-+ STATCOL_DSP2_MDMA,
-+ STATCOL_DSP2_EDMA,
-+ STATCOL_IVA,
-+ STATCOL_GPU_P1,
-+ STATCOL_GPU_P2,
-+ STATCOL_BB2D_P1,
-+ STATCOL_DSS,
-+ STATCOL_CSI2_2,
-+ STATCOL_MMU2,
-+ STATCOL_IPU1,
-+ STATCOL_IPU2,
-+ STATCOL_DMA_SYSTEM_RD,
-+ STATCOL_DMA_SYSTEM_WR,
-+ STATCOL_CSI2_1,
-+ STATCOL_USB3_SS,
-+ STATCOL_USB2_SS,
-+ STATCOL_USB2_ULPI_SS1,
-+ STATCOL_USB2_ULPI_SS2,
-+ STATCOL_PCIE_SS1,
-+ STATCOL_PCIE_SS2,
-+ STATCOL_DSP1_CFG,
-+ STATCOL_DSP2_CFG,
-+ STATCOL_GMAC_SW,
-+ STATCOL_PRUSS1_P1,
-+ STATCOL_PRUSS1_P2,
-+ STATCOL_PRUSS2_P1,
-+ STATCOL_PRUSS2_P2,
-+ STATCOL_DMA_CRYPTO_RD,
-+ STATCOL_DMA_CRYPTO_WR,
-+ STATCOL_MPU2,
-+ STATCOL_MMC1,
-+ STATCOL_MMC2,
-+ STATCOL_SATA,
-+ STATCOL_MLBSS,
-+ STATCOL_BB2D_P2,
-+ STATCOL_IEEE1500,
-+ STATCOL_DBG,
-+ STATCOL_VCP1,
-+ STATCOL_OCMC_RAM1,
-+ STATCOL_OCMC_RAM2,
-+ STATCOL_OCMC_RAM3,
-+ STATCOL_GPMC,
-+ STATCOL_MCASP1,
-+ STATCOL_MCASP2,
-+ STATCOL_MCASP3,
-+ STATCOL_VCP2,
-+ STATCOL_MAX
-+} STATCOL_ID;
-+
-+
-+
-+typedef struct
-+{
-+ UInt32 stat0_filter_cnt;
-+ UInt32 stat1_filter_cnt;
-+ UInt32 stat2_filter_cnt;
-+ UInt32 stat3_filter_cnt;
-+ UInt32 stat4_filter_cnt;
-+ UInt32 stat5_filter_cnt;
-+ UInt32 stat6_filter_cnt;
-+ UInt32 stat7_filter_cnt;
-+ UInt32 stat8_filter_cnt;
-+ UInt32 stat9_filter_cnt;
-+} StatCollectorObj;
-+
-+struct list_of_initiators
-+{
-+ STATCOL_ID id;
-+ char name[50];
-+};
-+
-+typedef struct
-+{
-+ UInt32 INTERVAL_US;
-+ UInt32 TOTAL_TIME;
-+ UInt32 no_of_initiators;
-+ struct list_of_initiators user_config_list[STATCOL_MAX];
-+} statcoll_params;
-+
-+typedef struct
-+{
-+ UInt32 b_enabled;
-+ char name[100];
-+ UInt32 *readings;
-+ UInt32 *timestamp;
-+ UInt32 group_id;
-+ UInt32 counter_id;
-+ UInt32 base_address;
-+ UInt32 mux_req;
-+}statcoll_initiators_object;
-+
-+
-+#endif
-diff --git a/clients/statcoll_gui.h b/clients/statcoll_gui.h
-new file mode 100644
-index 0000000..7362bde
---- /dev/null
-+++ b/clients/statcoll_gui.h
-@@ -0,0 +1,101 @@
-+
-+/*
-+
-+ ---------------------------------------------
-+ | |
-+ | --------------------------------------- |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ | |
-+ ---------------------------------------------
-+ | | |
-+ | | |
-+ | | |
-+ | | |
-+ | | |
-+ | | |
-+ ---------------------------------------------
-+
-+
-+
-+
-+*/
-+#define POSITION_X 2800
-+#define POSITION_Y 40
-+
-+#define MAX_WIDTH 900
-+//#define MAX_WIDTH 528
-+#define MAX_HEIGHT 900
-+
-+/* Derived parameters */
-+#define BAR_GAP (MAX_WIDTH/25)
-+#define BAR_WIDTH (MAX_WIDTH/16)
-+
-+#define BAR_HEIGHT ((MX_HEIGHT/40) * 6)
-+
-+#define BORDER (MAX_WIDTH/15)
-+
-+#define HEIGHT_EMIF_AREA (MAX_HEIGHT/4)
-+
-+#define FONT_SIZE (MAX_WIDTH/40)
-+
-+#define WIDTH_EMIF_AREA (MAX_WIDTH / 4)
-+
-+#define TOTAL_Y_PARAMETERS (25)
-+
-+#define TIME_GRAPH_AREA_BL_X (BORDER)
-+#define TIME_GRAPH_AREA_BL_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA - BORDER)
-+#define TIME_GRAPH_AREA_TR_X (MAX_WIDTH - BORDER)
-+#define TIME_GRAPH_AREA_TR_Y (BORDER)
-+
-+#define EMIF_AREA_BL_X (0)
-+#define EMIF_AREA_BL_Y (MAX_HEIGHT)
-+#define EMIF_AREA_TR_X (WIDTH_EMIF_AREA)
-+#define EMIF_AREA_TR_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA)
-+
-+#define INITIATORS_AREA_BL_X (WIDTH_EMIF_AREA)
-+#define INITIATORS_AREA_BL_Y (MAX_HEIGHT)
-+#define INITIATORS_AREA_TR_X (MAX_WIDTH)
-+#define INITIATORS_AREA_TR_Y (MAX_HEIGHT - HEIGHT_EMIF_AREA)
-+
-+
-+const char *string_list[TOTAL_Y_PARAMETERS] = {
-+ "----DDR BANDWIDTH PLOT----",
-+ "8 GBPS",
-+ "6.4 ",
-+ "4.8",
-+ "3.2",
-+ "1.6",
-+ "0",
-+ "EMIF Plot",
-+ "test",
-+ "EMIF1",
-+ "test",
-+ "EMIF2",
-+ "TOP 6 INITIATORS",
-+ "test",
-+ "MPU",
-+ "test",
-+ "DSS",
-+ "test",
-+ "DSP",
-+ "test",
-+ "IVA",
-+ "test",
-+ "GPU",
-+ "test",
-+ "BB2D",
-+};
-+
-diff --git a/clients/time_bar_graph.c b/clients/time_bar_graph.c
-new file mode 100644
-index 0000000..9fa9c12
---- /dev/null
-+++ b/clients/time_bar_graph.c
-@@ -0,0 +1,515 @@
-+/*
-+ * Copyright © 2008 Kristian Høgsberg
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this software and its
-+ * documentation for any purpose is hereby granted without fee, provided that
-+ * the above copyright notice appear in all copies and that both that copyright
-+ * notice and this permission notice appear in supporting documentation, and
-+ * that the name of the copyright holders not be used in advertising or
-+ * publicity pertaining to distribution of the software without specific,
-+ * written prior permission. The copyright holders make no representations
-+ * about the suitability of this software for any purpose. It is provided "as
-+ * is" without express or implied warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-+ * OF THIS SOFTWARE.
-+ */
-+
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <stdint.h>
-+#include <signal.h>
-+#include <time.h>
-+#include <math.h>
-+#include <cairo.h>
-+#include <sys/time.h>
-+#include <pthread.h>
-+#include <errno.h>
-+#include <unistd.h>
-+#include <sys/eventfd.h>
-+#include <sys/epoll.h>
-+
-+#include <linux/input.h>
-+#include <wayland-client.h>
-+#include "window.h"
-+#include "../shared/cairo-util.h"
-+#include "time_bar_graph.h"
-+
-+//#define DEBUG 1
-+#ifdef DEBUG
-+#define DBG(x...) printf(x)
-+#else
-+#define DBG(x...) // printf(x)
-+#endif
-+
-+#define MAX_ITEMS 180
-+#define MAX_TEXT_SIZE 128
-+
-+struct graph_dataset_point {
-+ int next_index;
-+ double y_values[MAX_ITEMS];
-+};
-+
-+struct graph_data {
-+ int dataset_size;
-+ int first_index, last_index, num_elems;
-+ uint64_t last_time;
-+ struct graph_dataset_point dataset[1];
-+};
-+
-+struct graph {
-+ struct display *display;
-+ struct window *window;
-+ struct widget *widget;
-+ int width, height;
-+ struct time_graph_create_params params;
-+ struct bar_graph_create_params bar_graph_params;
-+ struct _y_config y_config_array[MAX_ITEMS];
-+ struct _text_config text_config_array[MAX_ITEMS];
-+
-+ /* Bar graph parameters */
-+ struct _bar_graph_y_config bar_graph_y_config_array[MAX_ITEMS];
-+ struct _text_config bar_graph_text_config_array[MAX_ITEMS];
-+
-+ pthread_t thr;
-+ int eventfd;
-+ struct task task;
-+ double x_scaling_factor;
-+ pthread_mutex_t mtx;
-+ double time_graph_y_values[MAX_ITEMS];
-+ char text_values[MAX_ITEMS][MAX_TEXT_SIZE];
-+
-+ double bar_graph_y_values[MAX_ITEMS];
-+ char bar_graph_text_values[MAX_ITEMS][MAX_TEXT_SIZE];
-+
-+ uint64_t time_now;
-+ time_t start_time_tv_sec;
-+ struct graph_data *data;
-+};
-+
-+struct graph *global_graph=NULL;
-+static void
-+draw_stuff(struct graph *g, cairo_surface_t *surface)
-+{
-+ cairo_t *cr;
-+ int i, j, n_elems;
-+ double c_x, c_y, d_x, d_y;
-+
-+ cr = cairo_create(surface);
-+ cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
-+ cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.5);
-+ cairo_paint(cr);
-+ cairo_select_font_face(cr, "mono",
-+ CAIRO_FONT_SLANT_NORMAL,
-+ CAIRO_FONT_WEIGHT_BOLD);
-+ cairo_set_line_width (cr, 1.0);
-+ cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
-+ pthread_mutex_lock(&g->mtx);
-+ for (j=0; g->data->num_elems > 0 && j<g->params.num_of_y_items; j++) {
-+ n_elems = g->data->num_elems;
-+ DBG("first_index: %d, last_index: %d\n", g->data->first_index, g->data->last_index);
-+ if (g->y_config_array[j].fill_color.a != 0.0)
-+ cairo_move_to(cr, (double)g->params.draw_area.bottom_left.x, (double)g->params.draw_area.bottom_left.y);
-+ c_x = (double)g->params.draw_area.bottom_left.x;
-+ c_y = (double)g->params.draw_area.bottom_left.y;
-+ d_x = 0;
-+ i = g->data->first_index;
-+ while (n_elems) {
-+ DBG("index: %d, x: %f, y: %f, next_index: %d\n", i, c_x,
-+ g->data->dataset[i].y_values[j], g->data->dataset[i].next_index);
-+ d_y = g->data->dataset[i].y_values[j] - c_y;
-+ c_y = g->data->dataset[i].y_values[j];
-+ c_x = c_x + d_x;
-+ if (g->y_config_array[j].fill_color.a == 0.0 && n_elems == g->data->num_elems) {
-+ cairo_move_to(cr, c_x, c_y);
-+ } else {
-+ cairo_curve_to(cr, c_x - (d_x * 0.75), c_y - (d_y * 0.92), c_x - (d_x * 0.25), c_y - (d_y * 0.08), c_x, c_y);
-+ }
-+ if (g->data->dataset[i].next_index > i) {
-+ d_x = (g->data->dataset[i].next_index - i);
-+ } else {
-+ d_x = (g->data->dataset_size + g->data->dataset[i].next_index - i);
-+ }
-+ i = g->data->dataset[i].next_index;
-+ n_elems--;
-+ }
-+ if (g->y_config_array[j].fill_color.a != 0.0) {
-+ cairo_line_to(cr, c_x, (double)g->params.draw_area.bottom_left.y);
-+ cairo_line_to(cr, (double)g->params.draw_area.bottom_left.x, (double)g->params.draw_area.bottom_left.y);
-+ cairo_close_path(cr);
-+ cairo_set_source_rgba(cr, g->y_config_array[j].fill_color.r, g->y_config_array[j].fill_color.g,
-+ g->y_config_array[j].fill_color.b, g->y_config_array[j].fill_color.a);
-+ cairo_fill_preserve(cr);
-+ }
-+ cairo_set_source_rgba(cr, g->y_config_array[j].line_color.r, g->y_config_array[j].line_color.g,
-+ g->y_config_array[j].line_color.b, g->y_config_array[j].line_color.a);
-+ cairo_stroke(cr);
-+ }
-+
-+ for (j=0; j<g->params.num_of_text_items; j++) {
-+ cairo_move_to(cr, (double)g->text_config_array[j].at.x, (double)g->text_config_array[j].at.y);
-+ cairo_set_font_size(cr, g->text_config_array[j].fontsize);
-+ cairo_set_source_rgba(cr, g->text_config_array[j].color.r, g->text_config_array[j].color.g,
-+ g->text_config_array[j].color.b, g->text_config_array[j].color.a);
-+ cairo_show_text(cr, g->text_values[j]);
-+ }
-+
-+
-+ for (j=0; j<g->bar_graph_params.num_of_y_items; j++) {
-+ cairo_move_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x,
-+ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
-+ c_y = (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y -
-+ (g->bar_graph_y_values[j] * (double)(g->bar_graph_params.y_config_array[j].region.bottom_left.y -
-+ g->bar_graph_params.y_config_array[j].region.top_right.y));
-+ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x, c_y);
-+ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.top_right.x, c_y);
-+ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.top_right.x,
-+ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
-+ cairo_line_to(cr, (double)g->bar_graph_params.y_config_array[j].region.bottom_left.x,
-+ (double)g->bar_graph_params.y_config_array[j].region.bottom_left.y);
-+ cairo_close_path(cr);
-+ cairo_set_source_rgba(cr, g->bar_graph_y_config_array[j].fill_color.r, g->bar_graph_y_config_array[j].fill_color.g,
-+ g->bar_graph_y_config_array[j].fill_color.b, g->bar_graph_y_config_array[j].fill_color.a);
-+ cairo_fill_preserve(cr);
-+ cairo_set_source_rgba(cr, g->bar_graph_y_config_array[j].line_color.r, g->bar_graph_y_config_array[j].line_color.g,
-+ g->bar_graph_y_config_array[j].line_color.b, g->bar_graph_y_config_array[j].line_color.a);
-+ cairo_stroke(cr);
-+ }
-+ for (j=0; j<g->bar_graph_params.num_of_text_items; j++) {
-+ cairo_move_to(cr, (double)g->bar_graph_text_config_array[j].at.x, (double)g->bar_graph_text_config_array[j].at.y);
-+ cairo_set_font_size(cr, g->bar_graph_text_config_array[j].fontsize);
-+ cairo_set_source_rgba(cr, g->bar_graph_text_config_array[j].color.r, g->bar_graph_text_config_array[j].color.g,
-+ g->bar_graph_text_config_array[j].color.b, g->bar_graph_text_config_array[j].color.a);
-+ cairo_save (cr);
-+ //cairo_rotate(cr, 2*3.14*21/24);
-+ cairo_show_text(cr, g->bar_graph_text_values[j]);
-+ cairo_restore(cr);
-+ }
-+ pthread_mutex_unlock(&g->mtx);
-+ cairo_destroy(cr);
-+}
-+
-+static void
-+resize_handler(struct widget *widget,
-+ int32_t width, int32_t height, void *data)
-+{
-+ struct graph *g = data;
-+
-+ /* Dont resize me */
-+ widget_set_size(g->widget, g->width, g->height);
-+}
-+
-+static void
-+redraw_handler(struct widget *widget, void *data)
-+{
-+ struct graph *g = data;
-+ cairo_surface_t *surface;
-+
-+ surface = window_get_surface(g->window);
-+ if (surface == NULL ||
-+ cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
-+ fprintf(stderr, "failed to create cairo egl surface\n");
-+ return;
-+ }
-+
-+ draw_stuff(g, surface);
-+ cairo_surface_destroy(surface);
-+}
-+
-+static void
-+button_handler(struct widget *widget,
-+ struct input *input, uint32_t time,
-+ uint32_t button, enum wl_pointer_button_state state, void *data)
-+{
-+ struct graph *g = data;
-+
-+ switch (button) {
-+ case BTN_LEFT:
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ window_move(g->window, input,
-+ display_get_serial(g->display));
-+ break;
-+ case BTN_MIDDLE:
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ widget_schedule_redraw(widget);
-+ break;
-+ case BTN_RIGHT:
-+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
-+ window_show_frame_menu(g->window, input, time);
-+ break;
-+ }
-+}
-+
-+static void
-+touch_down_handler(struct widget *widget, struct input *input,
-+ uint32_t serial, uint32_t time, int32_t id,
-+ float x, float y, void *data)
-+{
-+ struct graph *g = data;
-+ window_move(g->window, input, display_get_serial(g->display));
-+}
-+
-+static void task_run(struct task *task, uint32_t events)
-+{
-+ eventfd_t e;
-+ struct graph *g = (struct graph *)(task->link.prev);
-+ uint64_t time_diff;
-+ int elems, tmp, incr, i;
-+ double y;
-+
-+ eventfd_read(g->eventfd, &e);
-+ if(e == 1) {
-+ pthread_mutex_lock(&g->mtx);
-+ /* Process new data */
-+ DBG("time_now: %llu, last_time: %llu\n", g->time_now, g->data->last_time);
-+ if (g->time_now > g->data->last_time) {
-+ time_diff = g->time_now - g->data->last_time;
-+ y = (double)time_diff * g->x_scaling_factor;
-+ incr = (int)y;
-+ DBG("incr: %d\n", incr);
-+
-+ if (g->data->last_index >= g->data->first_index) elems = g->data->last_index - g->data->first_index + 1;
-+ else elems = g->data->dataset_size - g->data->first_index + g->data->last_index + 1;
-+ /* Move first index to make room for new element */
-+ while (g->data->dataset_size > 0 && (elems + incr) > g->data->dataset_size) {
-+ tmp = g->data->dataset[g->data->first_index].next_index - g->data->first_index;
-+ if (tmp < 0) tmp = g->data->dataset_size + tmp;
-+ g->data->first_index = g->data->dataset[g->data->first_index].next_index;
-+ elems -= tmp;
-+ g->data->num_elems--;
-+ }
-+ for (i=0; i<g->params.num_of_y_items; i++) {
-+ /* Scale Y */
-+ y = g->time_graph_y_values[i] * (double)(g->params.draw_area.bottom_left.y-g->params.draw_area.top_right.y);
-+ y = (double)g->params.draw_area.bottom_left.y - y;
-+ g->data->dataset[g->data->last_index].y_values[i] = y;
-+ }
-+ g->data->dataset[g->data->last_index].next_index = g->data->last_index + incr;
-+ if (g->data->dataset[g->data->last_index].next_index >= g->data->dataset_size)
-+ g->data->dataset[g->data->last_index].next_index -= g->data->dataset_size;
-+ g->data->num_elems++;
-+ g->data->last_index = g->data->dataset[g->data->last_index].next_index;
-+ g->data->last_time = g->time_now;
-+ }
-+ pthread_mutex_unlock(&g->mtx);
-+ }
-+ widget_schedule_redraw(g->widget);
-+ DBG("event task ran...\n");
-+}
-+
-+void *time_graph_create(int argc, char *argv[], struct time_graph_create_params *cp)
-+{
-+ struct graph *g;
-+ struct display *d;
-+ int dataset_size;
-+ struct timeval tv;
-+
-+ if (cp->num_of_y_items > MAX_ITEMS) return NULL;
-+ if (cp->num_of_text_items > MAX_ITEMS) return NULL;
-+
-+ g = (struct graph*)malloc(sizeof(struct graph));
-+ if (g == NULL) {
-+ fprintf(stderr, "failed to allocate memory\n");
-+ return NULL;
-+ }
-+ global_graph = g;
-+ g->params = *cp;
-+ if (cp->num_of_y_items)
-+ memcpy(&g->y_config_array[0], cp->y_config_array,
-+ sizeof(struct _y_config) * cp->num_of_y_items);
-+ if (cp->num_of_text_items)
-+ memcpy(&g->text_config_array[0], cp->text_config_array,
-+ sizeof(struct _text_config) * cp->num_of_text_items);
-+ d = display_create(&argc, argv);
-+ if (d == NULL) {
-+ fprintf(stderr, "failed to create display: %m\n");
-+ return NULL;
-+ }
-+ g->display = d;
-+ //g->bg_image = load_cairo_surface(cp->bg_image);
-+ g->width = cp->width; //cairo_image_surface_get_width(g->bg_image);
-+ g->height = cp->height; //cairo_image_surface_get_height(g->bg_image);
-+ dataset_size = cp->draw_area.top_right.x - cp->draw_area.bottom_left.x;
-+ g->data = (struct graph_data *)malloc(sizeof(struct graph_data) +
-+ (dataset_size * sizeof(struct graph_dataset_point)));
-+ if (!g->data) {
-+ fprintf(stderr, "failed to allocate memory\n");
-+ display_destroy(g->display);
-+ //cairo_surface_destroy(g->bg_image);
-+ free(g);
-+ return NULL;
-+ }
-+ g->data->first_index = 0;
-+ g->data->last_index = 0;
-+ g->data->num_elems = 0;
-+ g->data->dataset_size = dataset_size;
-+ g->x_scaling_factor = (double)dataset_size / (double)cp->time_span;
-+ g->window = window_create(d);
-+ g->widget = window_add_widget(g->window, g);
-+ window_set_title(g->window, cp->title);
-+ widget_set_resize_handler(g->widget, resize_handler);
-+ widget_set_redraw_handler(g->widget, redraw_handler);
-+ widget_set_button_handler(g->widget, button_handler);
-+ widget_set_default_cursor(g->widget, CURSOR_HAND1);
-+ widget_set_touch_down_handler(g->widget, touch_down_handler);
-+ window_schedule_resize(g->window, g->width, g->height);
-+ g->eventfd = eventfd(0, 0);
-+ g->task.run = task_run;
-+ g->task.link.prev = (struct wl_list*)g;
-+ g->task.link.next = NULL;
-+ display_watch_fd(d, g->eventfd, EPOLLIN, &g->task);
-+ pthread_mutex_init(&g->mtx, NULL);
-+
-+ if (0 != pthread_create(&g->thr, NULL, (void *(*)(void *))display_run, (void *)d)) {
-+ fprintf(stderr, "pthread_create failed: %m\n");
-+ widget_destroy(g->widget);
-+ window_destroy(g->window);
-+ display_destroy(g->display);
-+ //cairo_surface_destroy(g->bg_image);
-+ free(g->data);
-+ close(g->eventfd);
-+ free(g);
-+ return NULL;
-+ }
-+ gettimeofday(&tv, NULL);
-+ g->start_time_tv_sec = tv.tv_sec;
-+ g->data->last_time = 0;
-+ return (void*)g;
-+}
-+
-+void move_graph(void *ctx, struct time_graph_create_params *cp)
-+{
-+ struct graph *g = ctx;
-+ window_set_title(g->window, cp->title);
-+}
-+
-+void time_graph_plot(void *ctx, double *y_values, const char *text_values[])
-+{
-+ struct timeval tv;
-+ struct graph *g = ctx;
-+ int i;
-+ pthread_mutex_lock(&g->mtx);
-+ gettimeofday(&tv, NULL);
-+ g->time_now = ((tv.tv_sec - g->start_time_tv_sec) * 1000) + (tv.tv_usec / 1000);
-+ memcpy(g->time_graph_y_values, y_values, g->params.num_of_y_items * sizeof(double));
-+ for (i=0;i<g->params.num_of_text_items; i++) {
-+ strncpy(g->text_values[i], text_values[i], MAX_TEXT_SIZE);
-+ g->text_values[i][MAX_TEXT_SIZE-1] = '\0';
-+ }
-+ pthread_mutex_unlock(&g->mtx);
-+ eventfd_write(g->eventfd, (eventfd_t)1);
-+}
-+
-+void time_graph_destroy(void *ctx)
-+{
-+ struct graph *g = (struct graph *)ctx;
-+ display_exit(g->display);
-+ eventfd_write(g->eventfd, (eventfd_t)1);
-+ pthread_join(g->thr, NULL);
-+ widget_destroy(g->widget);
-+ window_destroy(g->window);
-+ display_destroy(g->display);
-+ free(g->data);
-+ close(g->eventfd);
-+ free(g);
-+ global_graph=NULL;
-+}
-+
-+void util_get_cpu_usage(double *cpu_usage)
-+{
-+ static FILE *fp = NULL;
-+ char buf[256];
-+ uint64_t tot;
-+ uint64_t u, n, s, i, w, x, y, z;
-+ static uint64_t last_i = 0, last_total = 0;
-+
-+
-+ if (!fp) {
-+ if (!(fp = fopen("/proc/stat", "r")))
-+ fprintf(stderr, "Failed /proc/stat open: %s", strerror(errno));
-+ }
-+ if (fp) {
-+ while (1) {
-+ rewind(fp);
-+ fflush(fp);
-+ if (!fgets(buf, sizeof(buf), fp)) {
-+ fprintf(stderr, "failed /proc/stat read\n");
-+ } else {
-+ sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu",
-+ &u,
-+ &n,
-+ &s,
-+ &i,
-+ &w,
-+ &x,
-+ &y,
-+ &z
-+ );
-+ if (last_total == 0) {
-+ last_total = u+n+s+i+w+x+y+z;
-+ last_i = i;
-+ usleep(100000);
-+ } else {
-+ tot = u+n+s+i+w+x+y+z;
-+ *cpu_usage = (1.0 - ((double)(i-last_i)/(double)(tot-last_total)));
-+ last_i = i;
-+ last_total = tot;
-+ break;
-+ }
-+ }
-+ }
-+ }
-+}
-+
-+void *bar_graph_create(int argc, char *argv[], struct bar_graph_create_params *cp)
-+{
-+ struct graph *g;
-+ struct display *d;
-+ struct timeval tv;
-+
-+ if (cp->num_of_y_items > MAX_ITEMS) return NULL;
-+ if (cp->num_of_text_items > MAX_ITEMS) return NULL;
-+
-+ if (global_graph == NULL) {
-+ fprintf(stderr, "graph not initialized invoke time_graph_create first\n");
-+ return NULL;
-+ }
-+ g=global_graph;
-+ g->bar_graph_params = *cp;
-+ if (cp->num_of_y_items)
-+ memcpy(&g->bar_graph_y_config_array[0], cp->y_config_array,
-+ sizeof(struct _bar_graph_y_config) * cp->num_of_y_items);
-+ if (cp->num_of_text_items)
-+ memcpy(&g->bar_graph_text_config_array[0], cp->text_config_array,
-+ sizeof(struct _text_config) * cp->num_of_text_items);
-+
-+ return g;
-+}
-+
-+void bar_graph_plot(void *ctx, double *y_values, const char *text_values[])
-+{
-+ struct graph *g = ctx;
-+ int i;
-+ pthread_mutex_lock(&g->mtx);
-+ memcpy(g->bar_graph_y_values, y_values, g->bar_graph_params.num_of_y_items * sizeof(double));
-+ for (i=0;i<g->bar_graph_params.num_of_text_items; i++) {
-+ strncpy(g->bar_graph_text_values[i], text_values[i], MAX_TEXT_SIZE);
-+ g->bar_graph_text_values[i][MAX_TEXT_SIZE-1] = '\0';
-+ }
-+ pthread_mutex_unlock(&g->mtx);
-+ //eventfd_write(g->eventfd, (eventfd_t)2);
-+}
-+
-+void bar_graph_destroy(void *ctx)
-+{
-+ printf("Nothing to be done for this call\n");
-+ return;
-+}
-+
-diff --git a/clients/time_bar_graph.h b/clients/time_bar_graph.h
-new file mode 100644
-index 0000000..97ac05a
---- /dev/null
-+++ b/clients/time_bar_graph.h
-@@ -0,0 +1,93 @@
-+
-+#ifndef _BAR_GRAPH_H_
-+#define _BAR_GRAPH_H_
-+
-+#include <stdint.h>
-+
-+struct _rgba {
-+ double r, g, b, a; // Values between 0 and 1
-+};
-+
-+struct _coordinate {
-+ uint32_t x, y; // Co-ordinates relative to top-left of the window
-+};
-+
-+struct _rect {
-+ struct _coordinate bottom_left, top_right;
-+};
-+
-+struct _y_config {
-+ struct _rgba line_color; // Line color
-+ struct _rgba fill_color; // Fill color, 0 alpha => no fill
-+};
-+
-+struct _text_config {
-+ struct _rgba color; // Color for drawing the text, RGBA
-+ struct _coordinate at; // where to draw the text
-+ int fontsize; // Font size
-+};
-+
-+struct time_graph_create_params {
-+ char *title;
-+ //const char *bg_image;
-+ uint32_t width;
-+ uint32_t height;
-+ struct _rect draw_area;
-+ uint32_t time_span; // Amount of time the graph has to span in milliseconds
-+ uint32_t num_of_y_items;
-+ struct _y_config *y_config_array;
-+ uint32_t num_of_text_items;
-+ struct _text_config *text_config_array;
-+};
-+
-+
-+struct _bar_graph_y_config {
-+ struct _rect region; // Region for the bar graph
-+ struct _rgba line_color; // Color for drawing the line, RGBA
-+ struct _rgba fill_color; // Fill under the line with color RGBA, 0 => no fill
-+};
-+
-+struct bar_graph_create_params {
-+ char *title;
-+ //const char *bg_image;
-+ uint32_t num_of_y_items;
-+ struct _bar_graph_y_config *y_config_array;
-+ uint32_t num_of_text_items;
-+ struct _text_config *text_config_array;
-+};
-+
-+/* Creates a time graph using create parameters */
-+void *bar_graph_create(int argc, char *argv[], struct bar_graph_create_params *cp);
-+
-+void move_graph(void *ctx, struct time_graph_create_params *cp);
-+
-+/* Plots a new set of y-values from the values in the array y_values.
-+ The number of values must be equal to "num_of_y_items" from create params
-+ y_values must be normalized between 0.0 to 1.0
-+*/
-+void bar_graph_plot(void *ctx, double *y_values, const char *text_values[]);
-+
-+/* Destroy the graph */
-+void bar_graph_destroy(void *ctx);
-+
-+
-+/* Creates a time graph using create parameters */
-+void *time_graph_create(int argc, char *argv[], struct time_graph_create_params *cp);
-+
-+/*
-+ * Plots a new set of points from the values in the array y_values.
-+ * The number of values in the array y_values must be equal to "num_of_y_items"
-+ * from create params
-+ * y_values must be normalized between 0.0 to 1.0
-+
-+ * The number of values in the array text_values must be equal to "num_of_text_items"
-+ * from create params
-+*/
-+void time_graph_plot(void *ctx, double *y_values, const char *text_values[]);
-+
-+/* Destroy the graph */
-+void time_graph_destroy(void *ctx);
-+
-+void util_get_cpu_usage(double *cpu_usage);
-+
-+#endif /* _BAR_GRAPH_H_ */
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch
deleted file mode 100644
index fde38d52b..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 8497d95cc77af9bbdbbce03878e9fd273d94ba7f Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Wed, 7 Dec 2016 15:25:25 -0500
-Subject: [PATCH] compositor-drm: fix hotplug weston termination problem
-
-The weston_compositor_exit() is always invoked at function update_outputs()
-if all connector ids are greater than 31 because the 32-bit b->connector_allocator
-will be zero. Need to increase the size of both crtc_allocator and
-connector_allocator from 32-bit to 64-bit until a better solution is implemented.
-
-Upstream-Status: Submitted [wayland-devel@lists.freedesktop.org]
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- src/compositor-drm.c | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/src/compositor-drm.c b/src/compositor-drm.c
-index 6485b39..e4d889f 100644
---- a/src/compositor-drm.c
-+++ b/src/compositor-drm.c
-@@ -103,8 +103,8 @@ struct drm_backend {
- struct gbm_device *gbm;
- uint32_t *crtcs;
- int num_crtcs;
-- uint32_t crtc_allocator;
-- uint32_t connector_allocator;
-+ uint64_t crtc_allocator;
-+ uint64_t connector_allocator;
- struct wl_listener session_listener;
- uint32_t format;
-
-@@ -1360,8 +1360,8 @@ drm_output_destroy(struct weston_output *output_base)
- &output->connector_id, 1, &origcrtc->mode);
- drmModeFreeCrtc(origcrtc);
-
-- b->crtc_allocator &= ~(1 << output->crtc_id);
-- b->connector_allocator &= ~(1 << output->connector_id);
-+ b->crtc_allocator &= ~(1ULL << output->crtc_id);
-+ b->connector_allocator &= ~(1ULL << output->connector_id);
-
- if (b->use_pixman) {
- drm_output_fini_pixman(output);
-@@ -1842,8 +1842,8 @@ find_crtc_for_connector(struct drm_backend *b,
- drmModeFreeEncoder(encoder);
-
- for (i = 0; i < resources->count_crtcs; i++) {
-- if (possible_crtcs & (1 << i) &&
-- !(b->crtc_allocator & (1 << resources->crtcs[i])))
-+ if (possible_crtcs & (1ULL << i) &&
-+ !(b->crtc_allocator & (1ULL << resources->crtcs[i])))
- return i;
- }
- }
-@@ -2404,9 +2404,9 @@ create_output_for_connector(struct drm_backend *b,
-
- output->crtc_id = resources->crtcs[i];
- output->pipe = i;
-- b->crtc_allocator |= (1 << output->crtc_id);
-+ b->crtc_allocator |= (1ULL << output->crtc_id);
- output->connector_id = connector->connector_id;
-- b->connector_allocator |= (1 << output->connector_id);
-+ b->connector_allocator |= (1ULL << output->connector_id);
-
- output->original_crtc = drmModeGetCrtc(b->drm.fd, output->crtc_id);
- output->dpms_prop = drm_get_prop(b->drm.fd, connector, "DPMS");
-@@ -2511,8 +2511,8 @@ err_free:
- }
-
- drmModeFreeCrtc(output->original_crtc);
-- b->crtc_allocator &= ~(1 << output->crtc_id);
-- b->connector_allocator &= ~(1 << output->connector_id);
-+ b->crtc_allocator &= ~(1ULL << output->crtc_id);
-+ b->connector_allocator &= ~(1ULL << output->connector_id);
- free(output);
-
- return -1;
-@@ -2658,7 +2658,7 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device)
- drmModeRes *resources;
- struct drm_output *output, *next;
- int x = 0, y = 0;
-- uint32_t connected = 0, disconnects = 0;
-+ uint64_t connected = 0, disconnects = 0;
- int i;
-
- resources = drmModeGetResources(b->drm.fd);
-@@ -2680,9 +2680,9 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device)
- continue;
- }
-
-- connected |= (1 << connector_id);
-+ connected |= (1ULL << connector_id);
-
-- if (!(b->connector_allocator & (1 << connector_id))) {
-+ if (!(b->connector_allocator & (1ULL << connector_id))) {
- struct weston_output *last =
- container_of(b->compositor->output_list.prev,
- struct weston_output, link);
-@@ -2707,8 +2707,8 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device)
- if (disconnects) {
- wl_list_for_each_safe(output, next, &b->compositor->output_list,
- base.link) {
-- if (disconnects & (1 << output->connector_id)) {
-- disconnects &= ~(1 << output->connector_id);
-+ if (disconnects & (1ULL << output->connector_id)) {
-+ disconnects &= ~(1ULL << output->connector_id);
- weston_log("connector %d disconnected\n",
- output->connector_id);
- drm_output_destroy(&output->base);
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch
deleted file mode 100644
index 0d77f529e..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-compositor-drm-support-RGB565-with-pixman-renderer.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 91b452fa515b94928d32af6e1b1b0405469747fd Mon Sep 17 00:00:00 2001
-From: Tomi Valkeinen <tomi.valkeinen@ti.com>
-Date: Wed, 8 Mar 2017 13:05:38 -0500
-Subject: [PATCH] compositor-drm: support RGB565 with pixman renderer
-
-At the moment only XRGB8888 is supported when using pixman renderer.
-This patch adds support also for RGB565.
-
-Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-Reviewed-by: Daniel Stone <daniels@collabora.com>
-Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
-Signed-off-by: Daniel Stone <daniels@collabora.com>
----
- src/compositor-drm.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++------
- 1 file changed, 55 insertions(+), 7 deletions(-)
-
-diff --git a/src/compositor-drm.c b/src/compositor-drm.c
-index fd89627..443b69a 100644
---- a/src/compositor-drm.c
-+++ b/src/compositor-drm.c
-@@ -262,10 +262,12 @@ drm_fb_destroy_callback(struct gbm_bo *bo, void *data)
- }
-
- static struct drm_fb *
--drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height)
-+drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height,
-+ uint32_t format)
- {
- struct drm_fb *fb;
- int ret;
-+ uint32_t bpp, depth;
-
- struct drm_mode_create_dumb create_arg;
- struct drm_mode_destroy_dumb destroy_arg;
-@@ -275,8 +277,20 @@ drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height)
- if (!fb)
- return NULL;
-
-+ switch (format) {
-+ case GBM_FORMAT_XRGB8888:
-+ bpp = 32;
-+ depth = 24;
-+ break;
-+ case GBM_FORMAT_RGB565:
-+ bpp = depth = 16;
-+ break;
-+ default:
-+ return NULL;
-+ }
-+
- memset(&create_arg, 0, sizeof create_arg);
-- create_arg.bpp = 32;
-+ create_arg.bpp = bpp;
- create_arg.width = width;
- create_arg.height = height;
-
-@@ -289,8 +303,29 @@ drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height)
- fb->size = create_arg.size;
- fb->fd = b->drm.fd;
-
-- ret = drmModeAddFB(b->drm.fd, width, height, 24, 32,
-- fb->stride, fb->handle, &fb->fb_id);
-+ ret = -1;
-+
-+ if (!b->no_addfb2) {
-+ uint32_t handles[4], pitches[4], offsets[4];
-+
-+ handles[0] = fb->handle;
-+ pitches[0] = fb->stride;
-+ offsets[0] = 0;
-+
-+ ret = drmModeAddFB2(b->drm.fd, width, height,
-+ format, handles, pitches, offsets,
-+ &fb->fb_id, 0);
-+ if (ret) {
-+ weston_log("addfb2 failed: %m\n");
-+ b->no_addfb2 = 1;
-+ }
-+ }
-+
-+ if (ret) {
-+ ret = drmModeAddFB(b->drm.fd, width, height, depth, bpp,
-+ fb->stride, fb->handle, &fb->fb_id);
-+ }
-+
- if (ret)
- goto err_bo;
-
-@@ -1879,17 +1914,30 @@ drm_output_init_pixman(struct drm_output *output, struct drm_backend *b)
- {
- int w = output->base.current_mode->width;
- int h = output->base.current_mode->height;
-+ uint32_t format = output->gbm_format;
-+ uint32_t pixman_format;
- unsigned int i;
-
-- /* FIXME error checking */
-+ switch (format) {
-+ case GBM_FORMAT_XRGB8888:
-+ pixman_format = PIXMAN_x8r8g8b8;
-+ break;
-+ case GBM_FORMAT_RGB565:
-+ pixman_format = PIXMAN_r5g6b5;
-+ break;
-+ default:
-+ weston_log("Unsupported pixman format 0x%x\n", format);
-+ return -1;
-+ }
-
-+ /* FIXME error checking */
- for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) {
-- output->dumb[i] = drm_fb_create_dumb(b, w, h);
-+ output->dumb[i] = drm_fb_create_dumb(b, w, h, format);
- if (!output->dumb[i])
- goto err;
-
- output->image[i] =
-- pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h,
-+ pixman_image_create_bits(pixman_format, w, h,
- output->dumb[i]->map,
- output->dumb[i]->stride);
- if (!output->image[i])
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch
deleted file mode 100644
index 515f06c47..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0001-udev-seat-restrict-udev-enumeration-to-card0.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From e8e7a9f7dfa164a75fdbdca87622a2e13334478a Mon Sep 17 00:00:00 2001
-From: Anand Balagopalakrishnan <anandb@ti.com>
-Date: Sat, 23 Jan 2016 22:48:07 +0530
-Subject: [PATCH 1/1] udev-seat: restrict udev enumeration to card0
-
-In case of separate GPU and Display devices as found in embedded systems, we
-could have modeset node and render node controlled by different drivers.
-There is a distinct possibility that udev enumeration returns the DRM device
-corresponding to render node as the primary DRM device.
-
-Obviously, modeset operations cannot be done on the GPU DRM device.
-
-Restrict the udev enumeration to card0 and ensure that DRM device corresponding
-to display is returned as the primary DRM device.
-
-Upstream-Status: Pending
-
-Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
----
- src/compositor-drm.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/compositor-drm.c b/src/compositor-drm.c
-index 6777bf8..59c2cc5 100644
---- a/src/compositor-drm.c
-+++ b/src/compositor-drm.c
-@@ -2827,7 +2827,7 @@ find_primary_gpu(struct drm_backend *b, const char *seat)
-
- e = udev_enumerate_new(b->udev);
- udev_enumerate_add_match_subsystem(e, "drm");
-- udev_enumerate_add_match_sysname(e, "card[0-9]*");
-+ udev_enumerate_add_match_sysname(e, "card0");
-
- udev_enumerate_scan_devices(e);
- drm_device = NULL;
---
-1.7.9.5
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch
deleted file mode 100644
index 39c840182..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0002-Weston-Allow-visual_id-to-be-0.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 5b5de6a814b43ca023a92b85b407b3d061dbc64f Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Thu, 9 Mar 2017 14:32:24 -0500
-Subject: [PATCH 2/4] Weston: Allow visual_id to be 0
-
-The inquiry of visual id from egl API eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID)
-is an optional feature. The visual id will be set to 0 if this feature is
-not supported. Therefore, the return condition @function match_config_to_visual()
-should be (id == visual_id || id == 0) instead of (id == visual_id)
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- src/gl-renderer.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/gl-renderer.c b/src/gl-renderer.c
-index 23c0cd7..4c1f170 100644
---- a/src/gl-renderer.c
-+++ b/src/gl-renderer.c
-@@ -2462,7 +2462,7 @@ match_config_to_visual(EGLDisplay egl_display,
- &id))
- continue;
-
-- if (id == visual_id)
-+ if (id == visual_id || id == 0)
- return i;
- }
-
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch
deleted file mode 100644
index bdf5626f7..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 0d15218ced5bf2e6f3d05758f0f5f21c2a0303f2 Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Thu, 9 Mar 2017 14:33:08 -0500
-Subject: [PATCH 3/4] Weston: Fix virtual keyboard display issue for QT5
- application
-
-The virtual keyboard does pop up as expected, however, it will never hide
-even when the application is terminated. This problem is due to the order
-of the text APIs( text_input_activate and test_input_show_input_panel) are
-invoked in QT5 and a potential bug of the API implementation. The virtual
-keyboard works as expected if the test_input_show_input_panel() is invoked
-prior to the test_input_activate() as most of the weston sample applications
-do. However, the problem will show up if that order is reversed and the reason
-why is that the current_panel is not set in this case and hence this panel
-cannot be hidden.
-
-It is required to set the current_panel to the text_input when the input_panel
-becomes visible at the first time.
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- src/text-backend.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/text-backend.c b/src/text-backend.c
-index ab4667f..36c70a5 100644
---- a/src/text-backend.c
-+++ b/src/text-backend.c
-@@ -337,6 +337,7 @@ text_input_show_input_panel(struct wl_client *client,
- text_input->surface);
- wl_signal_emit(&ec->update_input_panel_signal,
- &text_input->cursor_rectangle);
-+ text_input->manager->current_panel = text_input;
- }
- }
-
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch
deleted file mode 100644
index 673ca3dbc..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 8958bf21960a475d2933e688d0da9a0d2186d509 Mon Sep 17 00:00:00 2001
-From: Eric Ruei <e-ruei1@ti.com>
-Date: Thu, 9 Mar 2017 14:34:18 -0500
-Subject: [PATCH 4/4] Weston: Fix touch screen crash issue
-
-Touch screen operation causes the weston to crash with segment fault sometimes.
-The crash occurs when the coordinate (x,y) passed to the weston input module
-is outside the view window, hence the weston compositor is not able to pick
-up a display view and there is no code to detect this condition at function
-notify_touch().
-
-Signed-off-by: Eric Ruei <e-ruei1@ti.com>
----
- src/input.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/input.c b/src/input.c
-index 8fe898c..0f72d23 100644
---- a/src/input.c
-+++ b/src/input.c
-@@ -1848,6 +1848,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
- * until all touch points are up again. */
- if (touch->num_tp == 1) {
- ev = weston_compositor_pick_view(ec, x, y, &sx, &sy);
-+ if (!ev)
-+ {
-+ weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n",
-+ wl_fixed_to_int(x), wl_fixed_to_int(y));
-+ return;
-+ }
- weston_touch_set_focus(touch, ev);
- } else if (!touch->focus) {
- /* Unexpected condition: We have non-initial touch but
---
-1.9.1
-
diff --git a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend b/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend
deleted file mode 100644
index ed20c7420..000000000
--- a/meta-agl-bsp/meta-ti/recipes-arago/weston/weston_%.bbappend
+++ /dev/null
@@ -1,22 +0,0 @@
-# When configured for fbdev compositor, make it the default
-PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor WESTON_NATIVE_BACKEND="fbdev-backend.so",--disable-fbdev-compositor,udev mtdev"
-PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev libgbm mtdev"
-
-PR_append = ".agl_arago_23"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-RDEPENDS_${PN} += "weston-conf"
-
-
-SRC_URI += " \
- file://0001-udev-seat-restrict-udev-enumeration-to-card0.patch \
- file://0001-Add-soc-performance-monitor-utilites.patch \
- file://0002-Weston-Allow-visual_id-to-be-0.patch \
- file://0003-Weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
- file://0004-Weston-Fix-touch-screen-crash-issue.patch \
- file://0001-compositor-drm-fix-hotplug-weston-termination-proble.patch \
- file://0001-compositor-drm-support-RGB565-with-pixman-renderer.patch \
-"
-
-RDEPENDS_${PN}_remove = "weston-conf"
diff --git a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt b/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt
deleted file mode 100755
index 79f3d1ff2..000000000
--- a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/files/uEnv.txt
+++ /dev/null
@@ -1 +0,0 @@
-fdtfile=dra7-evm-lcd-osd101t2045.dtb
diff --git a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend
deleted file mode 100644
index d1b9b2704..000000000
--- a/meta-agl-bsp/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_%.bbappend
+++ /dev/null
@@ -1,16 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-PR_append = "_agl"
-
-SRC_URI += " file://${UBOOT_ENV_BINARY}"
-
-UBOOT_ENV = "uEnv"
-
-do_deploy_append () {
- if [ "x${UBOOT_ENV}" != "x" ]
- then
- install ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
- ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
- fi
-}
-
diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend b/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend
deleted file mode 100644
index a5a69513a..000000000
--- a/meta-agl-bsp/meta-ti/recipes-graphics/mesa/mesa-gl_%.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
-# Remove GBM support from Mesa
-# TI Platforms provides own GBM library
-
-PACKAGES_remove = "libgbm"
-PACKAGES_remove = "libgbm-dev"
-
-EXTRA_OECONF_remove = "--enable-gbm"
diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch
deleted file mode 100644
index a72aeedf6..000000000
--- a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension/force-type-conversion.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
-index 2e65864..e14dbc0 100644
---- a/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
-+++ b/ivi-layermanagement-examples/EGLWLMockNavigation/src/OpenGLES2App.cpp
-@@ -244,7 +247,7 @@ bool OpenGLES2App::createEGLContext()
- m_eglContextStruct.eglSurface = NULL;
- m_eglContextStruct.eglContext = NULL;
-
-- m_eglContextStruct.eglDisplay = eglGetDisplay(m_wlContextStruct.wlDisplay);
-+ m_eglContextStruct.eglDisplay = eglGetDisplay((EGLNativeDisplayType)m_wlContextStruct.wlDisplay);
- eglstatus = eglGetError();
- if (!m_eglContextStruct.eglDisplay)
- {
diff --git a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend b/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
deleted file mode 100644
index e9a57d324..000000000
--- a/meta-agl-bsp/meta-ti/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-SRC_URI_append = "\
- file://force-type-conversion.patch \
- "
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index a1eeac3d7..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index cf8a93f..21651bc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg
deleted file mode 100644
index 6f7d49880..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ath9k_htc.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_CFG80211=m
-CONFIG_MAC80211=m
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg
deleted file mode 100644
index 5f18d8223..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/btusb.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG_BT_INTEL=m
-CONFIG_BT_BCM=m
-CONFIG_BT_RTL=m
-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBTUSB_BCM=y
-CONFIG_BT_HCIBTUSB_RTL=y
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg
deleted file mode 100644
index ef498669d..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/ramblock_nbd.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_NBD=y
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg b/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg
deleted file mode 100644
index df5a871ef..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/files/rtl_sdr.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_I2C_MUX=y
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend
deleted file mode 100644
index b2e543140..000000000
--- a/meta-agl-bsp/meta-ti/recipes-kernel/linux/linux-ti-staging_%.bbappend
+++ /dev/null
@@ -1,33 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI_append = " file://ramblock_nbd.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ramblock_nbd.cfg"
-
-# Enable support for TP-Link TL-W722N USB Wifi adapter
-SRC_URI_append = " file://ath9k_htc.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/ath9k_htc.cfg"
-
-# Enable support for RTLSDR
-SRC_URI_append = " file://rtl_sdr.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/rtl_sdr.cfg"
-
-# Enable support for Bluetooth HCI USB devices
-SRC_URI_append = " file://btusb.cfg"
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/btusb.cfg"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
-
-# Enable support for smack
-KERNEL_CONFIG_FRAGMENTS_append_smack = "\
- ${WORKDIR}/audit.cfg \
- ${WORKDIR}/smack.cfg \
- ${WORKDIR}/smack-default-lsm.cfg \
-"
-
-# file comes out of meta-agl-bsp/recipes-kernel/linux/linux_%.bbappend
-KERNEL_CONFIG_FRAGMENTS_append = " ${WORKDIR}/can-bus.cfg"
diff --git a/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend b/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend
new file mode 100644
index 000000000..f4fc54d86
--- /dev/null
+++ b/meta-agl-bsp/openembedded-layer/recipes-devtools/lua/lua_%.bbappend
@@ -0,0 +1,4 @@
+# this causes a crash in the selftest db.lua !
+# Bug-AGL: SPEC-3828
+# Upstream status: pending
+SRC_URI:remove = "file://CVE-2020-15945.patch"
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
deleted file mode 100644
index 5172fdd3a..000000000
--- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001
-From: Anton Gerasimov <anton@advancedtelematic.com>
-Date: Thu, 15 Sep 2016 17:52:41 +0200
-Subject: [PATCH 1/2] Set up environment for OSTree integration
-
----
- include/configs/qemu-x86.h | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
-index 78c296f..79df455 100644
---- a/include/configs/qemu-x86.h
-+++ b/include/configs/qemu-x86.h
-@@ -74,4 +74,24 @@
- #undef CONFIG_ENV_IS_IN_SPI_FLASH
- #define CONFIG_ENV_IS_NOWHERE
-
-+#undef CONFIG_BOOTARGS
-+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0"
-+
-+#undef CONFIG_BOOTDELAY
-+#define CONFIG_BOOTDELAY 3
-+
-+#undef CONFIG_BOOTCOMMAND
-+#define CONFIG_BOOTCOMMAND "run loadenv;" \
-+ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \
-+ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \
-+ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \
-+ "zboot $loadaddr - $ramdiskaddr $filesize"
-+
-+#undef CONFIG_EXTRA_ENV_SETTINGS
-+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \
-+ "ramdisk_image=/initrd\0" \
-+ "ramdiskaddr=0x4000000\0" \
-+ "bootdelay=3\0" \
-+ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;"
-+
- #endif /* __CONFIG_H */
---
-2.9.3
-
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
deleted file mode 100644
index df1f786c6..000000000
--- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From ba619c7ec7820e80d1b5b520440fdb81c31c0baf Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Fri, 14 Oct 2016 09:03:11 +0200
-Subject: [PATCH] fix gcc6 build
-
-Signed-off-by: ronan <ronan@linux-pgnz.suse>
----
- include/linux/compiler-gcc6.h | 66 +++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 66 insertions(+)
- create mode 100644 include/linux/compiler-gcc6.h
-
-diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
-new file mode 100644
-index 0000000..a3d00d8
---- /dev/null
-+++ b/include/linux/compiler-gcc6.h
-@@ -0,0 +1,66 @@
-+#ifndef __LINUX_COMPILER_H
-+#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
-+#endif
-+
-+#define __used __attribute__((__used__))
-+#define __must_check __attribute__((warn_unused_result))
-+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
-+
-+/* Mark functions as cold. gcc will assume any path leading to a call
-+ to them will be unlikely. This means a lot of manual unlikely()s
-+ are unnecessary now for any paths leading to the usual suspects
-+ like BUG(), printk(), panic() etc. [but let's keep them for now for
-+ older compilers]
-+
-+ Early snapshots of gcc 4.3 don't support this and we can't detect this
-+ in the preprocessor, but we can live with this because they're unreleased.
-+ Maketime probing would be overkill here.
-+
-+ gcc also has a __attribute__((__hot__)) to move hot functions into
-+ a special section, but I don't see any sense in this right now in
-+ the kernel context */
-+#define __cold __attribute__((__cold__))
-+
-+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-+
-+#ifndef __CHECKER__
-+# define __compiletime_warning(message) __attribute__((warning(message)))
-+# define __compiletime_error(message) __attribute__((error(message)))
-+#endif /* __CHECKER__ */
-+
-+/*
-+ * Mark a position in code as unreachable. This can be used to
-+ * suppress control flow warnings after asm blocks that transfer
-+ * control elsewhere.
-+ *
-+ * Early snapshots of gcc 4.5 don't support this and we can't detect
-+ * this in the preprocessor, but we can live with this because they're
-+ * unreleased. Really, we need to have autoconf for the kernel.
-+ */
-+#define unreachable() __builtin_unreachable()
-+
-+/* Mark a function definition as prohibited from being cloned. */
-+#define __noclone __attribute__((__noclone__))
-+
-+/*
-+ * Tell the optimizer that something else uses this function or variable.
-+ */
-+#define __visible __attribute__((externally_visible))
-+
-+/*
-+ * GCC 'asm goto' miscompiles certain code sequences:
-+ *
-+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
-+ *
-+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
-+ * Fixed in GCC 4.8.2 and later versions.
-+ *
-+ * (asm goto is automatically volatile - the naming reflects this.)
-+ */
-+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
-+
-+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
-+#define __HAVE_BUILTIN_BSWAP32__
-+#define __HAVE_BUILTIN_BSWAP64__
-+#define __HAVE_BUILTIN_BSWAP16__
-+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
---
-2.6.6
-
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
deleted file mode 100644
index 7540b7467..000000000
--- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001
-From: Anton Gerasimov <anton@advancedtelematic.com>
-Date: Thu, 15 Sep 2016 16:49:32 +0200
-Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on
- multilib
-
----
- arch/x86/config.mk | 2 --
- arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++---------
- 2 files changed, 87 insertions(+), 19 deletions(-)
-
-diff --git a/arch/x86/config.mk b/arch/x86/config.mk
-index 999143e..139576e 100644
---- a/arch/x86/config.mk
-+++ b/arch/x86/config.mk
-@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
- PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
-
- LDFLAGS_FINAL += --gc-sections -pie
--LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
--LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
-diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
-index 497ad75..c321b11 100644
---- a/arch/x86/lib/gcc.c
-+++ b/arch/x86/lib/gcc.c
-@@ -19,22 +19,92 @@
-
- #ifdef __GNUC__
-
--/*
-- * GCC's libgcc handling is quite broken. While the libgcc functions
-- * are always regparm(0) the code that calls them uses whatever the
-- * compiler call specifies. Therefore we need a wrapper around those
-- * functions. See gcc bug PR41055 for more information.
-- */
--#define WRAP_LIBGCC_CALL(type, name) \
-- type __normal_##name(type a, type b) __attribute__((regparm(0))); \
-- type __wrap_##name(type a, type b); \
-- type __attribute__((no_instrument_function)) \
-- __wrap_##name(type a, type b) \
-- { return __normal_##name(a, b); }
--
--WRAP_LIBGCC_CALL(long long, __divdi3)
--WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
--WRAP_LIBGCC_CALL(long long, __moddi3)
--WRAP_LIBGCC_CALL(unsigned long long, __umoddi3)
-+#include <stdint.h>
-+#include <stddef.h>
-+
-+uint64_t __udivmoddi4 ( uint64_t num,
-+ uint64_t den,
-+ uint64_t *rem_p )
-+{
-+ uint64_t quot = 0, qbit = 1;
-+
-+ if ( den == 0 ) {
-+ return 1/((unsigned)den); /* Intentional divide by zero, without
-+ triggering a compiler warning which
-+ would abort the build */
-+ }
-+
-+ /* Left-justify denominator and count shift */
-+ while ( (int64_t)den >= 0 ) {
-+ den <<= 1;
-+ qbit <<= 1;
-+ }
-+
-+ while ( qbit ) {
-+ if ( den <= num ) {
-+ num -= den;
-+ quot += qbit;
-+ }
-+ den >>= 1;
-+ qbit >>= 1;
-+ }
-+
-+ if ( rem_p )
-+ *rem_p = num;
-+
-+ return quot;
-+}
-+uint64_t __udivdi3( uint64_t num, uint64_t den )
-+{
-+ return __udivmoddi4(num, den, NULL);
-+}
-+
-+uint64_t __umoddi3 ( uint64_t num, uint64_t den )
-+{
-+ uint64_t v;
-+
-+ (void) __udivmoddi4(num, den, &v);
-+ return v;
-+}
-+
-+int64_t __divmoddi4 ( int64_t num,
-+ int64_t den,
-+ int64_t* rem_p )
-+{
-+ int minus = 0;
-+ int64_t v;
-+
-+ if ( num < 0 ) {
-+ num = -num;
-+ minus = 1;
-+ }
-+ if ( den < 0 ) {
-+ den = -den;
-+ minus ^= 1;
-+ }
-+
-+ v = __udivmoddi4(num, den, (uint64_t *)rem_p);
-+ if ( minus ) {
-+ v = -v;
-+ if ( rem_p )
-+ *rem_p = -(*rem_p);
-+ }
-+
-+ return v;
-+}
-+
-+
-+int64_t __moddi3 (int64_t num, int64_t den)
-+{
-+ int64_t v;
-+
-+ (void) __divmoddi4(num, den, &v);
-+ return v;
-+}
-+
-+int64_t __divdi3(int64_t num, int64_t den)
-+{
-+ return __divmoddi4(num, den, NULL);
-+}
-
- #endif
---
-2.9.3
-
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
deleted file mode 100644
index dfa0631a0..000000000
--- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-include recipes-bsp/u-boot/u-boot.inc
-DEPENDS += "dtc-native"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
-
-# This revision corresponds to the tag "v2015.07"
-# We use the revision in order to avoid having to fetch it from the
-# repo during parse
-SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204"
-
-SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \
- file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \
- file://0001-fixup-build-with-gcc6.patch \
- "
-
-PV = "v2015.07+git${SRCPV}"
-
-EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline "
-EXTRA_OEMAKE_append_qemux86 = " BUILD_ROM=y"
-EXTRA_OEMAKE_append_qemux86-64 = " BUILD_ROM=y"
-
-UBOOT_SUFFIX = "bin"
-UBOOT_SUFFIX_qemux86 = "rom"
-UBOOT_SUFFIX_qemux86-64 = "rom"
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb
deleted file mode 100644
index 2c7cc4bb9..000000000
--- a/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require recipes-bsp/u-boot/u-boot.inc
-
-DEPENDS += "dtc-native"
-
-SRCREV = "5ea3e51fc481613a8dee8c02848d1b42c81ad892"
-
-PV = "v2016.11+git${SRCPV}"
-
-#This patch is not complacente with u-boot 2016.11
-#Version of u-boot from yocto 2.2 Morty is 2016.03 from:
-# meta/recipes-bsp/u-boot/u-boot_2016.03.bb
-SRC_URI_remove_raspberrypi3 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch"
-SRC_URI_remove_raspberrypi2 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch"
diff --git a/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend b/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend
deleted file mode 100644
index 49e527707..000000000
--- a/meta-agl-bsp/recipes-graphics/mesa/mesa_12.%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-# The gallium-llvm is recommended as software 3D graphics renderer
-GALLIUM_LLVM = "gallium-llvm"
-PACKAGECONFIG_append_qemux86 = " gallium ${GALLIUM_LLVM}"
-PACKAGECONFIG_append_qemux86-64 = " gallium ${GALLIUM_LLVM}"
-
-DRIDRIVERS_append_intel-corei7-64 = ",i965"
diff --git a/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend
deleted file mode 100644
index dba2ad6b2..000000000
--- a/meta-agl-bsp/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ /dev/null
@@ -1,17 +0,0 @@
-# OVERRIDES save us some c'n'p below ...
-OVERRIDES_prepend_qemux86 = "customwestonini:"
-OVERRIDES_prepend_qemux86-64 = "customwestonini:"
-# intel-corei7-64 ??
-
-python() {
- if "customwestonini" in d.getVar("OVERRIDES", True).split(":"):
- # DRM backend disabled for now to allow compatibility with VirtualBox
- # and VMWare Player. It may be re-enabled if running on QEMU for
- # potentially increased performance.
- #backend=drm-backend.so
- d.delVarFlag("WESTONCORE", "backend")
-
- d.setVarFlag("WESTONOUTPUT1","agl_screen", "SCREEN_QEMU")
-}
-
-
diff --git a/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini b/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini
deleted file mode 100644
index f502eff7a..000000000
--- a/meta-agl-bsp/recipes-graphics/wayland/weston/weston-qemu-drm.ini
+++ /dev/null
@@ -1,28 +0,0 @@
-[core]
-shell=ivi-shell.so
-# DRM backend disabled for now to allow compatibility with VirtualBox
-# and VMWare Player. It may be re-enabled if running on QEMU for
-# potentially increased performance.
-#backend=drm-backend.so
-
-[ivi-shell]
-ivi-module=ivi-controller.so
-ivi-input-module=ivi-input-controller.so
-
-[output]
-name=Virtual-1
-#mode=1920x1080
-#mode=1600x1200
-#mode=1680x1050
-#mode=1400x1050
-mode=1600x900
-#mode=1280x1024
-#mode=1440x900
-#mode=1280x960
-#mode=1360x768
-#mode=1280x800
-#mode=1280x768
-#mode=1280x720
-#mode=800x600
-#mode=848x480
-#mode=640x480
diff --git a/meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend b/meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend
deleted file mode 100644
index 9aaea5f69..000000000
--- a/meta-agl-bsp/recipes-graphics/wayland/weston_%.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-RDEPENDS_${PN}_append_qemux86 = " mesa-megadriver"
-RDEPENDS_${PN}_append_qemux86-64 = " mesa-megadriver"
-RDEPENDS_${PN}_append_intel-corei7-64 = " mesa-megadriver"
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend b/meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend
deleted file mode 100644
index 0363760ab..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux:"
-
-# Extra configuration options for the AGL kernel
-SRC_URI += "file://can-bus.cfg \
- "
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch
deleted file mode 100644
index c50c152a1..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/0001-fanotify-fix-notification-of-groups-with-inode-mount.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-From 8edc6e1688fc8f02c8c1f53a2ec4928cb1055f4d Mon Sep 17 00:00:00 2001
-From: Jan Kara <jack@suse.cz>
-Date: Thu, 13 Nov 2014 15:19:33 -0800
-Subject: [PATCH] fanotify: fix notification of groups with inode & mount marks
-
-fsnotify() needs to merge inode and mount marks lists when notifying
-groups about events so that ignore masks from inode marks are reflected
-in mount mark notifications and groups are notified in proper order
-(according to priorities).
-
-Currently the sorting of the lists done by fsnotify_add_inode_mark() /
-fsnotify_add_vfsmount_mark() and fsnotify() differed which resulted
-ignore masks not being used in some cases.
-
-Fix the problem by always using the same comparison function when
-sorting / merging the mark lists.
-
-Thanks to Heinrich Schuchardt for improvements of my patch.
-
-Link: https://bugzilla.kernel.org/show_bug.cgi?id=87721
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----
- fs/notify/fsnotify.c | 36 +++++++++++++++++++++---------------
- fs/notify/fsnotify.h | 4 ++++
- fs/notify/inode_mark.c | 8 +++-----
- fs/notify/mark.c | 36 ++++++++++++++++++++++++++++++++++++
- fs/notify/vfsmount_mark.c | 8 +++-----
- 5 files changed, 67 insertions(+), 25 deletions(-)
-
-diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
-index 9d3e9c5..89326ac 100644
---- a/fs/notify/fsnotify.c
-+++ b/fs/notify/fsnotify.c
-@@ -229,8 +229,16 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
- &fsnotify_mark_srcu);
- }
-
-+ /*
-+ * We need to merge inode & vfsmount mark lists so that inode mark
-+ * ignore masks are properly reflected for mount mark notifications.
-+ * That's why this traversal is so complicated...
-+ */
- while (inode_node || vfsmount_node) {
-- inode_group = vfsmount_group = NULL;
-+ inode_group = NULL;
-+ inode_mark = NULL;
-+ vfsmount_group = NULL;
-+ vfsmount_mark = NULL;
-
- if (inode_node) {
- inode_mark = hlist_entry(srcu_dereference(inode_node, &fsnotify_mark_srcu),
-@@ -244,21 +252,19 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
- vfsmount_group = vfsmount_mark->group;
- }
-
-- if (inode_group > vfsmount_group) {
-- /* handle inode */
-- ret = send_to_group(to_tell, inode_mark, NULL, mask,
-- data, data_is, cookie, file_name);
-- /* we didn't use the vfsmount_mark */
-- vfsmount_group = NULL;
-- } else if (vfsmount_group > inode_group) {
-- ret = send_to_group(to_tell, NULL, vfsmount_mark, mask,
-- data, data_is, cookie, file_name);
-- inode_group = NULL;
-- } else {
-- ret = send_to_group(to_tell, inode_mark, vfsmount_mark,
-- mask, data, data_is, cookie,
-- file_name);
-+ if (inode_group && vfsmount_group) {
-+ int cmp = fsnotify_compare_groups(inode_group,
-+ vfsmount_group);
-+ if (cmp > 0) {
-+ inode_group = NULL;
-+ inode_mark = NULL;
-+ } else if (cmp < 0) {
-+ vfsmount_group = NULL;
-+ vfsmount_mark = NULL;
-+ }
- }
-+ ret = send_to_group(to_tell, inode_mark, vfsmount_mark, mask,
-+ data, data_is, cookie, file_name);
-
- if (ret && (mask & ALL_FSNOTIFY_PERM_EVENTS))
- goto out;
-diff --git a/fs/notify/fsnotify.h b/fs/notify/fsnotify.h
-index 9c0898c..3b68b0a 100644
---- a/fs/notify/fsnotify.h
-+++ b/fs/notify/fsnotify.h
-@@ -12,6 +12,10 @@ extern void fsnotify_flush_notify(struct fsnotify_group *group);
- /* protects reads of inode and vfsmount marks list */
- extern struct srcu_struct fsnotify_mark_srcu;
-
-+/* compare two groups for sorting of marks lists */
-+extern int fsnotify_compare_groups(struct fsnotify_group *a,
-+ struct fsnotify_group *b);
-+
- extern void fsnotify_set_inode_mark_mask_locked(struct fsnotify_mark *fsn_mark,
- __u32 mask);
- /* add a mark to an inode */
-diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
-index e849714..dfbf544 100644
---- a/fs/notify/inode_mark.c
-+++ b/fs/notify/inode_mark.c
-@@ -194,6 +194,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
- {
- struct fsnotify_mark *lmark, *last = NULL;
- int ret = 0;
-+ int cmp;
-
- mark->flags |= FSNOTIFY_MARK_FLAG_INODE;
-
-@@ -219,11 +220,8 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
- goto out;
- }
-
-- if (mark->group->priority < lmark->group->priority)
-- continue;
--
-- if ((mark->group->priority == lmark->group->priority) &&
-- (mark->group < lmark->group))
-+ cmp = fsnotify_compare_groups(lmark->group, mark->group);
-+ if (cmp < 0)
- continue;
-
- hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list);
-diff --git a/fs/notify/mark.c b/fs/notify/mark.c
-index d90deaa..34c38fa 100644
---- a/fs/notify/mark.c
-+++ b/fs/notify/mark.c
-@@ -210,6 +210,42 @@ void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mas
- }
-
- /*
-+ * Sorting function for lists of fsnotify marks.
-+ *
-+ * Fanotify supports different notification classes (reflected as priority of
-+ * notification group). Events shall be passed to notification groups in
-+ * decreasing priority order. To achieve this marks in notification lists for
-+ * inodes and vfsmounts are sorted so that priorities of corresponding groups
-+ * are descending.
-+ *
-+ * Furthermore correct handling of the ignore mask requires processing inode
-+ * and vfsmount marks of each group together. Using the group address as
-+ * further sort criterion provides a unique sorting order and thus we can
-+ * merge inode and vfsmount lists of marks in linear time and find groups
-+ * present in both lists.
-+ *
-+ * A return value of 1 signifies that b has priority over a.
-+ * A return value of 0 signifies that the two marks have to be handled together.
-+ * A return value of -1 signifies that a has priority over b.
-+ */
-+int fsnotify_compare_groups(struct fsnotify_group *a, struct fsnotify_group *b)
-+{
-+ if (a == b)
-+ return 0;
-+ if (!a)
-+ return 1;
-+ if (!b)
-+ return -1;
-+ if (a->priority < b->priority)
-+ return 1;
-+ if (a->priority > b->priority)
-+ return -1;
-+ if (a < b)
-+ return 1;
-+ return -1;
-+}
-+
-+/*
- * Attach an initialized mark to a given group and fs object.
- * These marks may be used for the fsnotify backend to determine which
- * event types should be delivered to which group.
-diff --git a/fs/notify/vfsmount_mark.c b/fs/notify/vfsmount_mark.c
-index ac851e8..faefa72 100644
---- a/fs/notify/vfsmount_mark.c
-+++ b/fs/notify/vfsmount_mark.c
-@@ -153,6 +153,7 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
- struct mount *m = real_mount(mnt);
- struct fsnotify_mark *lmark, *last = NULL;
- int ret = 0;
-+ int cmp;
-
- mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT;
-
-@@ -178,11 +179,8 @@ int fsnotify_add_vfsmount_mark(struct fsnotify_mark *mark,
- goto out;
- }
-
-- if (mark->group->priority < lmark->group->priority)
-- continue;
--
-- if ((mark->group->priority == lmark->group->priority) &&
-- (mark->group < lmark->group))
-+ cmp = fsnotify_compare_groups(lmark->group, mark->group);
-+ if (cmp < 0)
- continue;
-
- hlist_add_before_rcu(&mark->m.m_list, &lmark->m.m_list);
---
-1.8.3.1
-
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch
deleted file mode 100644
index f68a3747b..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch
+++ /dev/null
@@ -1,899 +0,0 @@
-From 75349cc7326dd2aa645bf21fe65a40c68b386c29 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= <jsmoeller@linuxfoundation.org>
-Date: Wed, 28 Jun 2017 00:35:18 +0200
-Subject: [PATCH] [SEC][Backport] Fix CVE-2017-1000364 through backport
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fix CVE-2017-1000364 through backport of upstream patches (from 4.9 branch):
-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=cfc0eb403816c5c4f9667d959de5e22789b5421e
-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=5d10ad6297260e9b85e7645ee544a6115bb229e4
-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.9.y&id=ce7fe8595902c3f03ef528c2dc1928b3f4b67fcf
-
-Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
----
- Documentation/kernel-parameters.txt | 7 ++
- arch/arc/mm/mmap.c | 2 +-
- arch/arm/mm/mmap.c | 4 +-
- arch/frv/mm/elf-fdpic.c | 2 +-
- arch/mips/mm/mmap.c | 2 +-
- arch/parisc/kernel/sys_parisc.c | 15 ++--
- arch/powerpc/mm/hugetlbpage-radix.c | 2 +-
- arch/powerpc/mm/mmap.c | 4 +-
- arch/powerpc/mm/slice.c | 2 +-
- arch/s390/mm/mmap.c | 4 +-
- arch/sh/mm/mmap.c | 4 +-
- arch/sparc/kernel/sys_sparc_64.c | 4 +-
- arch/sparc/mm/hugetlbpage.c | 2 +-
- arch/tile/mm/hugetlbpage.c | 2 +-
- arch/x86/kernel/sys_x86_64.c | 4 +-
- arch/x86/mm/hugetlbpage.c | 2 +-
- arch/xtensa/kernel/syscall.c | 2 +-
- fs/hugetlbfs/inode.c | 2 +-
- fs/proc/task_mmu.c | 4 -
- include/linux/mm.h | 53 ++++++------
- mm/gup.c | 5 --
- mm/memory.c | 38 ---------
- mm/mmap.c | 158 ++++++++++++++++++++++--------------
- 23 files changed, 159 insertions(+), 165 deletions(-)
-
-diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 46726d4899fe..c1980b5c6a15 100644
---- a/Documentation/kernel-parameters.txt
-+++ b/Documentation/kernel-parameters.txt
-@@ -3852,6 +3852,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
- spia_pedr=
- spia_peddr=
-
-+ stack_guard_gap= [MM]
-+ override the default stack gap protection. The value
-+ is in page units and it defines how many pages prior
-+ to (for stacks growing down) resp. after (for stacks
-+ growing up) the main stack are reserved for no other
-+ mapping. Default value is 256 pages.
-+
- stacktrace [FTRACE]
- Enabled the stack tracer on boot up.
-
-diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c
-index 2e06d56e987b..cf4ae6958240 100644
---- a/arch/arc/mm/mmap.c
-+++ b/arch/arc/mm/mmap.c
-@@ -64,7 +64,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
-index 66353caa35b9..641334ebf46d 100644
---- a/arch/arm/mm/mmap.c
-+++ b/arch/arm/mm/mmap.c
-@@ -89,7 +89,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -140,7 +140,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c
-index 836f14707a62..efa59f1f8022 100644
---- a/arch/frv/mm/elf-fdpic.c
-+++ b/arch/frv/mm/elf-fdpic.c
-@@ -74,7 +74,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
- addr = PAGE_ALIGN(addr);
- vma = find_vma(current->mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- goto success;
- }
-
-diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
-index 353037699512..c5fdea5debe5 100644
---- a/arch/mips/mm/mmap.c
-+++ b/arch/mips/mm/mmap.c
-@@ -92,7 +92,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
-index 0a393a04e891..1d7691fa8ab2 100644
---- a/arch/parisc/kernel/sys_parisc.c
-+++ b/arch/parisc/kernel/sys_parisc.c
-@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- unsigned long task_size = TASK_SIZE;
- int do_color_align, last_mmap;
- struct vm_unmapped_area_info info;
-@@ -115,9 +115,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- else
- addr = PAGE_ALIGN(addr);
-
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-@@ -141,7 +142,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- int do_color_align, last_mmap;
-@@ -175,9 +176,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = COLOR_ALIGN(addr, last_mmap, pgoff);
- else
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- goto found_addr;
- }
-
-diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c
-index 35254a678456..a2b2d97f7eda 100644
---- a/arch/powerpc/mm/hugetlbpage-radix.c
-+++ b/arch/powerpc/mm/hugetlbpage-radix.c
-@@ -65,7 +65,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- /*
-diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c
-index 2f1e44362198..5bc2845cddf4 100644
---- a/arch/powerpc/mm/mmap.c
-+++ b/arch/powerpc/mm/mmap.c
-@@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
-index 2b27458902ee..c4d5c9c61e0f 100644
---- a/arch/powerpc/mm/slice.c
-+++ b/arch/powerpc/mm/slice.c
-@@ -105,7 +105,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr,
- if ((mm->task_size - len) < addr)
- return 0;
- vma = find_vma(mm, addr);
-- return (!vma || (addr + len) <= vma->vm_start);
-+ return (!vma || (addr + len) <= vm_start_gap(vma));
- }
-
- static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
-diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
-index eb9df2822da1..812368f274c9 100644
---- a/arch/s390/mm/mmap.c
-+++ b/arch/s390/mm/mmap.c
-@@ -98,7 +98,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -136,7 +136,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
-index 6777177807c2..7df7d5944188 100644
---- a/arch/sh/mm/mmap.c
-+++ b/arch/sh/mm/mmap.c
-@@ -63,7 +63,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -113,7 +113,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
-index fe8b8ee8e660..02e05e221b94 100644
---- a/arch/sparc/kernel/sys_sparc_64.c
-+++ b/arch/sparc/kernel/sys_sparc_64.c
-@@ -118,7 +118,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -181,7 +181,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
-
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
-index 988acc8b1b80..58cde8d9be8a 100644
---- a/arch/sparc/mm/hugetlbpage.c
-+++ b/arch/sparc/mm/hugetlbpage.c
-@@ -116,7 +116,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, HPAGE_SIZE);
- vma = find_vma(mm, addr);
- if (task_size - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c
-index 77ceaa343fce..67508b249ede 100644
---- a/arch/tile/mm/hugetlbpage.c
-+++ b/arch/tile/mm/hugetlbpage.c
-@@ -232,7 +232,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (current->mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
-index 10e0272d789a..136ad7c1ce7b 100644
---- a/arch/x86/kernel/sys_x86_64.c
-+++ b/arch/x86/kernel/sys_x86_64.c
-@@ -143,7 +143,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (end - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-@@ -186,7 +186,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- addr = PAGE_ALIGN(addr);
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
-index 2ae8584b44c7..fe342e8ed529 100644
---- a/arch/x86/mm/hugetlbpage.c
-+++ b/arch/x86/mm/hugetlbpage.c
-@@ -144,7 +144,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
- if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c
-index 83cf49685373..3aaaae18417c 100644
---- a/arch/xtensa/kernel/syscall.c
-+++ b/arch/xtensa/kernel/syscall.c
-@@ -87,7 +87,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
- /* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_SIZE - len < addr)
- return -ENOMEM;
-- if (!vmm || addr + len <= vmm->vm_start)
-+ if (!vmm || addr + len <= vm_start_gap(vmm))
- return addr;
- addr = vmm->vm_end;
- if (flags & MAP_SHARED)
-diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
-index 4ea71eba40a5..aac9114728c3 100644
---- a/fs/hugetlbfs/inode.c
-+++ b/fs/hugetlbfs/inode.c
-@@ -191,7 +191,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
- addr = ALIGN(addr, huge_page_size(h));
- vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)))
- return addr;
- }
-
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 2750949397eb..5feada822930 100644
---- a/fs/proc/task_mmu.c
-+++ b/fs/proc/task_mmu.c
-@@ -309,11 +309,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
-
- /* We don't show the stack guard page in /proc/maps */
- start = vma->vm_start;
-- if (stack_guard_page_start(vma, start))
-- start += PAGE_SIZE;
- end = vma->vm_end;
-- if (stack_guard_page_end(vma, end))
-- end -= PAGE_SIZE;
-
- seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
- seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
-diff --git a/include/linux/mm.h b/include/linux/mm.h
-index 582d30baaa86..31206cc2e99c 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1392,39 +1392,11 @@ int clear_page_dirty_for_io(struct page *page);
-
- int get_cmdline(struct task_struct *task, char *buffer, int buflen);
-
--/* Is the vma a continuation of the stack vma above it? */
--static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
--}
--
- static inline bool vma_is_anonymous(struct vm_area_struct *vma)
- {
- return !vma->vm_ops;
- }
-
--static inline int stack_guard_page_start(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSDOWN) &&
-- (vma->vm_start == addr) &&
-- !vma_growsdown(vma->vm_prev, addr);
--}
--
--/* Is the vma a continuation of the stack vma below it? */
--static inline int vma_growsup(struct vm_area_struct *vma, unsigned long addr)
--{
-- return vma && (vma->vm_start == addr) && (vma->vm_flags & VM_GROWSUP);
--}
--
--static inline int stack_guard_page_end(struct vm_area_struct *vma,
-- unsigned long addr)
--{
-- return (vma->vm_flags & VM_GROWSUP) &&
-- (vma->vm_end == addr) &&
-- !vma_growsup(vma->vm_next, addr);
--}
--
- int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t);
-
- extern unsigned long move_page_tables(struct vm_area_struct *vma,
-@@ -2153,6 +2125,7 @@ void page_cache_async_readahead(struct address_space *mapping,
- pgoff_t offset,
- unsigned long size);
-
-+extern unsigned long stack_guard_gap;
- /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
- extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
-
-@@ -2181,6 +2154,30 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m
- return vma;
- }
-
-+static inline unsigned long vm_start_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_start = vma->vm_start;
-+
-+ if (vma->vm_flags & VM_GROWSDOWN) {
-+ vm_start -= stack_guard_gap;
-+ if (vm_start > vma->vm_start)
-+ vm_start = 0;
-+ }
-+ return vm_start;
-+}
-+
-+static inline unsigned long vm_end_gap(struct vm_area_struct *vma)
-+{
-+ unsigned long vm_end = vma->vm_end;
-+
-+ if (vma->vm_flags & VM_GROWSUP) {
-+ vm_end += stack_guard_gap;
-+ if (vm_end < vma->vm_end)
-+ vm_end = -PAGE_SIZE;
-+ }
-+ return vm_end;
-+}
-+
- static inline unsigned long vma_pages(struct vm_area_struct *vma)
- {
- return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
-diff --git a/mm/gup.c b/mm/gup.c
-index 22cc22e7432f..4b3723734623 100644
---- a/mm/gup.c
-+++ b/mm/gup.c
-@@ -370,11 +370,6 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
- /* mlock all present pages, but do not fault in new pages */
- if ((*flags & (FOLL_POPULATE | FOLL_MLOCK)) == FOLL_MLOCK)
- return -ENOENT;
-- /* For mm_populate(), just skip the stack guard page. */
-- if ((*flags & FOLL_POPULATE) &&
-- (stack_guard_page_start(vma, address) ||
-- stack_guard_page_end(vma, address + PAGE_SIZE)))
-- return -ENOENT;
- if (*flags & FOLL_WRITE)
- fault_flags |= FAULT_FLAG_WRITE;
- if (*flags & FOLL_REMOTE)
-diff --git a/mm/memory.c b/mm/memory.c
-index 45f39f391cc2..527ef7841146 100644
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -2695,40 +2695,6 @@ out_release:
- }
-
- /*
-- * This is like a special single-page "expand_{down|up}wards()",
-- * except we must first make sure that 'address{-|+}PAGE_SIZE'
-- * doesn't hit another vma.
-- */
--static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
--{
-- address &= PAGE_MASK;
-- if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
-- struct vm_area_struct *prev = vma->vm_prev;
--
-- /*
-- * Is there a mapping abutting this one below?
-- *
-- * That's only ok if it's the same stack mapping
-- * that has gotten split..
-- */
-- if (prev && prev->vm_end == address)
-- return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
--
-- return expand_downwards(vma, address - PAGE_SIZE);
-- }
-- if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
-- struct vm_area_struct *next = vma->vm_next;
--
-- /* As VM_GROWSDOWN but s/below/above/ */
-- if (next && next->vm_start == address + PAGE_SIZE)
-- return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
--
-- return expand_upwards(vma, address + PAGE_SIZE);
-- }
-- return 0;
--}
--
--/*
- * We enter with non-exclusive mmap_sem (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2744,10 +2710,6 @@ static int do_anonymous_page(struct fault_env *fe)
- if (vma->vm_flags & VM_SHARED)
- return VM_FAULT_SIGBUS;
-
-- /* Check if we need to add a guard page to the stack */
-- if (check_stack_guard_page(vma, fe->address) < 0)
-- return VM_FAULT_SIGSEGV;
--
- /*
- * Use pte_alloc() instead of pte_alloc_map(). We can't run
- * pte_offset_map() on pmds where a huge pmd might be created
-diff --git a/mm/mmap.c b/mm/mmap.c
-index f3ebc5a54367..e1c1eb4b3942 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -176,6 +176,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- unsigned long retval;
- unsigned long newbrk, oldbrk;
- struct mm_struct *mm = current->mm;
-+ struct vm_area_struct *next;
- unsigned long min_brk;
- bool populate;
-
-@@ -221,7 +222,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
- }
-
- /* Check against existing mmap mappings. */
-- if (find_vma_intersection(mm, oldbrk, newbrk+PAGE_SIZE))
-+ next = find_vma(mm, oldbrk);
-+ if (next && newbrk + PAGE_SIZE > vm_start_gap(next))
- goto out;
-
- /* Ok, looks good - let it rip. */
-@@ -244,10 +246,22 @@ out:
-
- static long vma_compute_subtree_gap(struct vm_area_struct *vma)
- {
-- unsigned long max, subtree_gap;
-- max = vma->vm_start;
-- if (vma->vm_prev)
-- max -= vma->vm_prev->vm_end;
-+ unsigned long max, prev_end, subtree_gap;
-+
-+ /*
-+ * Note: in the rare case of a VM_GROWSDOWN above a VM_GROWSUP, we
-+ * allow two stack_guard_gaps between them here, and when choosing
-+ * an unmapped area; whereas when expanding we only require one.
-+ * That's a little inconsistent, but keeps the code here simpler.
-+ */
-+ max = vm_start_gap(vma);
-+ if (vma->vm_prev) {
-+ prev_end = vm_end_gap(vma->vm_prev);
-+ if (max > prev_end)
-+ max -= prev_end;
-+ else
-+ max = 0;
-+ }
- if (vma->vm_rb.rb_left) {
- subtree_gap = rb_entry(vma->vm_rb.rb_left,
- struct vm_area_struct, vm_rb)->rb_subtree_gap;
-@@ -343,7 +357,7 @@ static void validate_mm(struct mm_struct *mm)
- anon_vma_unlock_read(anon_vma);
- }
-
-- highest_address = vma->vm_end;
-+ highest_address = vm_end_gap(vma);
- vma = vma->vm_next;
- i++;
- }
-@@ -512,7 +526,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = vma->vm_end;
-+ mm->highest_vm_end = vm_end_gap(vma);
-
- /*
- * vma->vm_prev wasn't known when we followed the rbtree to find the
-@@ -765,7 +779,7 @@ again:
- vma_gap_update(vma);
- if (end_changed) {
- if (!next)
-- mm->highest_vm_end = end;
-+ mm->highest_vm_end = vm_end_gap(vma);
- else if (!adjust_next)
- vma_gap_update(next);
- }
-@@ -1630,7 +1644,7 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit left subtree if it looks promising */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end >= low_limit && vma->vm_rb.rb_left) {
- struct vm_area_struct *left =
- rb_entry(vma->vm_rb.rb_left,
-@@ -1641,12 +1655,13 @@ unsigned long unmapped_area(struct vm_unmapped_area_info *info)
- }
- }
-
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- check_current:
- /* Check if current node has a suitable gap */
- if (gap_start > high_limit)
- return -ENOMEM;
-- if (gap_end >= low_limit && gap_end - gap_start >= length)
-+ if (gap_end >= low_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit right subtree if it looks promising */
-@@ -1668,8 +1683,8 @@ check_current:
- vma = rb_entry(rb_parent(prev),
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_left) {
-- gap_start = vma->vm_prev->vm_end;
-- gap_end = vma->vm_start;
-+ gap_start = vm_end_gap(vma->vm_prev);
-+ gap_end = vm_start_gap(vma);
- goto check_current;
- }
- }
-@@ -1733,7 +1748,7 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- while (true) {
- /* Visit right subtree if it looks promising */
-- gap_start = vma->vm_prev ? vma->vm_prev->vm_end : 0;
-+ gap_start = vma->vm_prev ? vm_end_gap(vma->vm_prev) : 0;
- if (gap_start <= high_limit && vma->vm_rb.rb_right) {
- struct vm_area_struct *right =
- rb_entry(vma->vm_rb.rb_right,
-@@ -1746,10 +1761,11 @@ unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
-
- check_current:
- /* Check if current node has a suitable gap */
-- gap_end = vma->vm_start;
-+ gap_end = vm_start_gap(vma);
- if (gap_end < low_limit)
- return -ENOMEM;
-- if (gap_start <= high_limit && gap_end - gap_start >= length)
-+ if (gap_start <= high_limit &&
-+ gap_end > gap_start && gap_end - gap_start >= length)
- goto found;
-
- /* Visit left subtree if it looks promising */
-@@ -1772,7 +1788,7 @@ check_current:
- struct vm_area_struct, vm_rb);
- if (prev == vma->vm_rb.rb_right) {
- gap_start = vma->vm_prev ?
-- vma->vm_prev->vm_end : 0;
-+ vm_end_gap(vma->vm_prev) : 0;
- goto check_current;
- }
- }
-@@ -1810,7 +1826,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
- unsigned long len, unsigned long pgoff, unsigned long flags)
- {
- struct mm_struct *mm = current->mm;
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct vm_unmapped_area_info info;
-
- if (len > TASK_SIZE - mmap_min_addr)
-@@ -1821,9 +1837,10 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
-
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -1846,7 +1863,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- const unsigned long len, const unsigned long pgoff,
- const unsigned long flags)
- {
-- struct vm_area_struct *vma;
-+ struct vm_area_struct *vma, *prev;
- struct mm_struct *mm = current->mm;
- unsigned long addr = addr0;
- struct vm_unmapped_area_info info;
-@@ -1861,9 +1878,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
- /* requesting a specific address */
- if (addr) {
- addr = PAGE_ALIGN(addr);
-- vma = find_vma(mm, addr);
-+ vma = find_vma_prev(mm, addr, &prev);
- if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
-- (!vma || addr + len <= vma->vm_start))
-+ (!vma || addr + len <= vm_start_gap(vma)) &&
-+ (!prev || addr >= vm_end_gap(prev)))
- return addr;
- }
-
-@@ -1998,21 +2016,19 @@ find_vma_prev(struct mm_struct *mm, unsigned long addr,
- * update accounting. This is shared with both the
- * grow-up and grow-down cases.
- */
--static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, unsigned long grow)
-+static int acct_stack_growth(struct vm_area_struct *vma,
-+ unsigned long size, unsigned long grow)
- {
- struct mm_struct *mm = vma->vm_mm;
- struct rlimit *rlim = current->signal->rlim;
-- unsigned long new_start, actual_size;
-+ unsigned long new_start;
-
- /* address space limit tests */
- if (!may_expand_vm(mm, vma->vm_flags, grow))
- return -ENOMEM;
-
- /* Stack limit test */
-- actual_size = size;
-- if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
-- actual_size -= PAGE_SIZE;
-- if (actual_size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
-+ if (size > READ_ONCE(rlim[RLIMIT_STACK].rlim_cur))
- return -ENOMEM;
-
- /* mlock limit tests */
-@@ -2050,16 +2066,32 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
- int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *next;
-+ unsigned long gap_addr;
- int error = 0;
-
- if (!(vma->vm_flags & VM_GROWSUP))
- return -EFAULT;
-
-- /* Guard against wrapping around to address 0. */
-- if (address < PAGE_ALIGN(address+4))
-- address = PAGE_ALIGN(address+4);
-- else
-+ /* Guard against exceeding limits of the address space. */
-+ address &= PAGE_MASK;
-+ if (address >= TASK_SIZE)
- return -ENOMEM;
-+ address += PAGE_SIZE;
-+
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address + stack_guard_gap;
-+
-+ /* Guard against overflow */
-+ if (gap_addr < address || gap_addr > TASK_SIZE)
-+ gap_addr = TASK_SIZE;
-+
-+ next = vma->vm_next;
-+ if (next && next->vm_start < gap_addr) {
-+ if (!(next->vm_flags & VM_GROWSUP))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
-@@ -2104,7 +2136,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
- if (vma->vm_next)
- vma_gap_update(vma->vm_next);
- else
-- mm->highest_vm_end = address;
-+ mm->highest_vm_end = vm_end_gap(vma);
- spin_unlock(&mm->page_table_lock);
-
- perf_event_mmap(vma);
-@@ -2125,6 +2157,8 @@ int expand_downwards(struct vm_area_struct *vma,
- unsigned long address)
- {
- struct mm_struct *mm = vma->vm_mm;
-+ struct vm_area_struct *prev;
-+ unsigned long gap_addr;
- int error;
-
- address &= PAGE_MASK;
-@@ -2132,6 +2166,17 @@ int expand_downwards(struct vm_area_struct *vma,
- if (error)
- return error;
-
-+ /* Enforce stack_guard_gap */
-+ gap_addr = address - stack_guard_gap;
-+ if (gap_addr > address)
-+ return -ENOMEM;
-+ prev = vma->vm_prev;
-+ if (prev && prev->vm_end > gap_addr) {
-+ if (!(prev->vm_flags & VM_GROWSDOWN))
-+ return -ENOMEM;
-+ /* Check that both stack segments have the same anon_vma? */
-+ }
-+
- /* We must make sure the anon_vma is allocated. */
- if (unlikely(anon_vma_prepare(vma)))
- return -ENOMEM;
-@@ -2186,28 +2231,25 @@ int expand_downwards(struct vm_area_struct *vma,
- return error;
- }
-
--/*
-- * Note how expand_stack() refuses to expand the stack all the way to
-- * abut the next virtual mapping, *unless* that mapping itself is also
-- * a stack mapping. We want to leave room for a guard page, after all
-- * (the guard page itself is not added here, that is done by the
-- * actual page faulting logic)
-- *
-- * This matches the behavior of the guard page logic (see mm/memory.c:
-- * check_stack_guard_page()), which only allows the guard page to be
-- * removed under these circumstances.
-- */
-+/* enforced gap between the expanding stack and other mappings. */
-+unsigned long stack_guard_gap = 256UL<<PAGE_SHIFT;
-+
-+static int __init cmdline_parse_stack_guard_gap(char *p)
-+{
-+ unsigned long val;
-+ char *endptr;
-+
-+ val = simple_strtoul(p, &endptr, 10);
-+ if (!*endptr)
-+ stack_guard_gap = val << PAGE_SHIFT;
-+
-+ return 0;
-+}
-+__setup("stack_guard_gap=", cmdline_parse_stack_guard_gap);
-+
- #ifdef CONFIG_STACK_GROWSUP
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *next;
--
-- address &= PAGE_MASK;
-- next = vma->vm_next;
-- if (next && next->vm_start == address + PAGE_SIZE) {
-- if (!(next->vm_flags & VM_GROWSUP))
-- return -ENOMEM;
-- }
- return expand_upwards(vma, address);
- }
-
-@@ -2229,14 +2271,6 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
- #else
- int expand_stack(struct vm_area_struct *vma, unsigned long address)
- {
-- struct vm_area_struct *prev;
--
-- address &= PAGE_MASK;
-- prev = vma->vm_prev;
-- if (prev && prev->vm_end == address) {
-- if (!(prev->vm_flags & VM_GROWSDOWN))
-- return -ENOMEM;
-- }
- return expand_downwards(vma, address);
- }
-
-@@ -2334,7 +2368,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
- vma->vm_prev = prev;
- vma_gap_update(vma);
- } else
-- mm->highest_vm_end = prev ? prev->vm_end : 0;
-+ mm->highest_vm_end = prev ? vm_end_gap(prev) : 0;
- tail_vma->vm_next = NULL;
-
- /* Kill the cache */
---
-2.12.3
-
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg
deleted file mode 100644
index 6f7d49880..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/ath9k_htc.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_CFG80211=m
-CONFIG_MAC80211=m
-CONFIG_ATH_CARDS=m
-CONFIG_ATH9K_HTC=m
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg
deleted file mode 100644
index de5dd8d31..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/fanotify.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable the fanotify API (notification/interception of FS events)
-CONFIG_FANOTIFY=y
-CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg
deleted file mode 100644
index 327c753ae..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/hid.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_HID_MULTITOUCH=y
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg
deleted file mode 100644
index d4574700a..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/rtl_sdr.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
-CONFIG_DVB_USB_V2=m
-CONFIG_DVB_USB_RTL28XXU=m
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg b/meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg
deleted file mode 100644
index 7996ef1dd..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/uinput.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable the User-level Input driver (required by "wayland-fits")
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=m
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
deleted file mode 100644
index 8205a3feb..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
+++ /dev/null
@@ -1,23 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
-
-# Extra configuration options for the QEMU kernel
-SRC_URI += "file://fanotify.cfg \
- file://uinput.cfg \
- file://hid.cfg \
- file://drm.cfg \
- "
-
-# Enable support for TP-Link TL-W722N USB Wifi adapter
-SRC_URI += " file://ath9k_htc.cfg \
- "
-
-# Enable support for RTLSDR
-SRC_URI += " file://rtl_sdr.cfg \
- "
-
-# disk drivers for vmdk
-SRC_URI_append_qemux86 = " file://vbox-vmware-sata.cfg "
-SRC_URI_append_qemux86-64 = " file://vbox-vmware-sata.cfg "
-
-# Backported fix for CVE-2017-1000364
-SRC_URI_append = " file://4.8-0001-SEC-Backport-Fix-CVE-2017-1000364-through-backport.patch "
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg b/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg
deleted file mode 100644
index 5966198d7..000000000
--- a/meta-agl-bsp/recipes-kernel/linux/linux/can-bus.cfg
+++ /dev/null
@@ -1,39 +0,0 @@
-CONFIG_TASKSTATS=y
-CONFIG_TASK_DELAY_ACCT=y
-# CONFIG_TASK_XACCT is not set
-CONFIG_USER_RETURN_NOTIFIER=y
-CONFIG_PREEMPT_NOTIFIERS=y
-CONFIG_CAN=m
-CONFIG_CAN_RAW=m
-CONFIG_CAN_BCM=m
-CONFIG_CAN_GW=m
-
-#
-# CAN Device Drivers
-#
-CONFIG_CAN_VCAN=m
-CONFIG_CAN_SLCAN=m
-CONFIG_CAN_DEV=m
-CONFIG_CAN_CALC_BITTIMING=y
-# CONFIG_CAN_LEDS is not set
-# CONFIG_CAN_SJA1000 is not set
-# CONFIG_CAN_C_CAN is not set
-# CONFIG_CAN_M_CAN is not set
-# CONFIG_CAN_CC770 is not set
-
-#
-# CAN SPI interfaces
-#
-CONFIG_CAN_MCP251X=m
-
-#
-# CAN USB interfaces
-#
-# CONFIG_CAN_EMS_USB is not set
-CONFIG_CAN_ESD_USB2=m
-CONFIG_CAN_GS_USB=m
-CONFIG_CAN_KVASER_USB=m
-CONFIG_CAN_PEAK_USB=m
-CONFIG_CAN_8DEV_USB=m
-# CONFIG_CAN_SOFTING is not set
-# CONFIG_CAN_DEBUG_DEVICES is not set
diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch
new file mode 100644
index 000000000..d83c65257
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/files/0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch
@@ -0,0 +1,28 @@
+From 2701d65271686dff0cb39ab7da1e821f5dede61e Mon Sep 17 00:00:00 2001
+From: Leonid Lazarev <leonid.lazarev@mera.com>
+Date: Tue, 21 Apr 2020 17:28:16 +0300
+Subject: [PATCH] XEN on RPi4 1GB lmitation workaround: XEN tries to allocated
+ the memopry for dom0 within first 4GB, but for some reason raspberry pi only
+ allows to load kernel from 1st GB. Push XEN to allocate first bank for dom0
+ from 1st GB
+
+---
+ xen/arch/arm/domain_build.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
+index dd9c3b73ba..8501a8c8aa 100644
+--- a/xen/arch/arm/domain_build.c
++++ b/xen/arch/arm/domain_build.c
+@@ -281,7 +281,7 @@ static void __init allocate_memory_11(struct domain *d,
+ */
+ while ( order >= min_low_order )
+ {
+- for ( bits = order ; bits <= (lowmem ? 32 : PADDR_BITS); bits++ )
++ for ( bits = order ; bits <= (lowmem ? 30 : PADDR_BITS); bits++ )
+ {
+ pg = alloc_domheap_pages(d, order, MEMF_bits(bits));
+ if ( pg != NULL )
+--
+2.17.1
+
diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb
new file mode 100644
index 000000000..b857cb19f
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-mkimage-rpi4.bb
@@ -0,0 +1,29 @@
+DESCRIPTION = "Xen hypervisor u-boot image"
+LICENSE = "GPL-2.0-only"
+SECTION = "console/tools"
+
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+
+
+ALLOW_EMPTY:${PN} = "1"
+FILES:${PN} = ""
+S = "${WORKDIR}"
+
+DEPENDS = "u-boot-mkimage-native "
+
+# Only for aarch64
+COMPATIBLE_MACHINE = "(-)"
+COMPATIBLE_MACHINE:aarch64 = "(.*)"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_configure[noexec] = "1"
+do_deploy[noexec] = "1"
+
+do_compile[depends] += "xen:do_deploy"
+
+# Uboot compatible image
+do_compile () {
+ uboot-mkimage -A arm64 -C none -T kernel -a 0x48080000 -e 0x48080000 -n "XEN" -d ${DEPLOY_DIR_IMAGE}/xen-${MACHINE} ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.uImage
+}
diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend
new file mode 100644
index 000000000..a67200618
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen-tools_git.bbappend
@@ -0,0 +1,11 @@
+
+# make the package specific to the machine for now
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# rpi4
+LIC_FILES_CHKSUM:raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49"
+XEN_REL:raspberrypi4 = "4.13"
+SRCREV:raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f"
+SRC_URI:raspberrypi4 = " \
+ git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
+ "
diff --git a/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend
new file mode 100644
index 000000000..2d63e1841
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-extended/xen/xen_git.bbappend
@@ -0,0 +1,18 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+# make the package machine-specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# rpi4 specifics
+LIC_FILES_CHKSUM:raspberrypi4 = "file://COPYING;md5=4295d895d4b5ce9d070263d52f030e49"
+XEN_REL:raspberrypi4 = "4.13"
+
+SRCREV:raspberrypi4 = "721f2c323ca55c77857c93e7275b4a93a0e15e1f"
+SRC_URI:append:raspberrypi4 = " file://0001-XEN-on-RPi4-1GB-lmitation-workaround-XEN-tries-to-al.patch"
+
+#due to incorrect xen binary preparation in external library, we add additional deploy
+do_deploy:append:raspberrypi4() {
+ if [ -f ${B}/xen/xen ]; then
+ install -m 0644 ${B}/xen/xen ${DEPLOYDIR}/xen-${MACHINE}
+ fi
+}
diff --git a/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch
new file mode 100644
index 000000000..8bc102c92
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa/0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch
@@ -0,0 +1,34 @@
+From 39dea63ebce2764c683c8c2eddbb10cf07a970c4 Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Mon, 19 Dec 2022 11:51:28 +0200
+Subject: [PATCH] virgl/virgl_driinfo.h.in: Disable by default emulated BGRA
+ and swizzling
+
+Workaround in place for virtio aarch64 to avoid graphical artefacts when
+first time booting up on PVR host driver.
+
+Introduced with patch 'virgl: Always enable emulated BGRA and swizzling
+unless specifically told not to' in mesa-20.3.0.
+
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ src/gallium/drivers/virgl/virgl_driinfo.h.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/gallium/drivers/virgl/virgl_driinfo.h.in b/src/gallium/drivers/virgl/virgl_driinfo.h.in
+index f57e5880965..1c06f932c5c 100644
+--- a/src/gallium/drivers/virgl/virgl_driinfo.h.in
++++ b/src/gallium/drivers/virgl/virgl_driinfo.h.in
+@@ -8,7 +8,7 @@
+ // 5. Implement the tweak in virglrenderer
+ DRI_CONF_SECTION_MISCELLANEOUS
+ DRI_CONF_FORMAT_L8_SRGB_ENABLE_READBACK(false)
+- DRI_CONF_GLES_EMULATE_BGRA(true)
+- DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(true)
++ DRI_CONF_GLES_EMULATE_BGRA(false)
++ DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(false)
+ DRI_CONF_GLES_SAMPLES_PASSED_VALUE(1024, 1, 400000000)
+ DRI_CONF_SECTION_END
+--
+2.35.1
+
diff --git a/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend
new file mode 100644
index 000000000..0a6606ebf
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-graphics/mesa/mesa_22.%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-virgl-virgl_driinfo.h.in-Disable-by-default-emulated.patch"
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend
new file mode 100644
index 000000000..5970414eb
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:"
+
+SRC_URI:append:virtio-all = " \
+ git://gerrit.automotivelinux.org/gerrit/src/agl-yocto-kernel-meta.git;protocol=https;type=kmeta;name=agl-meta;destsuffix=agl-kernel-meta;branch=master \
+ file://virtio-aarch64-${LINUX_KERNEL_TYPE}.scc \
+"
+
+SRCREV_agl-meta = "c5008f4ba9e1b9f11c1014b53477079e605ceab7"
+
+COMPATIBLE_MACHINE:virtio-aarch64 = "virtio-aarch64"
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc
new file mode 100644
index 000000000..2d1570e9f
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-aarch64-standard.scc
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE virtio-aarch64
+define KTYPE standard
+define KARCH arm64
+
+include ktypes/standard/standard.scc nopatch
+include arch/arm/aarch64.scc
+include cfg/8250.scc
+include cfg/virtio.scc
+include bsp/virtio/agl-virtio.scc
+
+# enable the ability to run 32 bit apps
+include arch/arm/32bit-compat.scc
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg
new file mode 100644
index 000000000..2facc345e
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-drm.cfg
@@ -0,0 +1,3 @@
+CONFIG_DRM=y
+CONFIG_FB=y
+CONFIG_DRM_FBDEV_EMULATION=y
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg
new file mode 100644
index 000000000..bbcaca312
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-pci.cfg
@@ -0,0 +1,3 @@
+CONFIG_PCI=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_PCI_HOST_GENERIC=y
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend
new file mode 100644
index 000000000..6952436a3
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto_5.15.bbappend
@@ -0,0 +1,17 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+# Cannot just append to SRC_URI, as the metadata interferes with the
+# AGL config fragment scheme
+AGL_KERNEL_SRC:prepend:virtio-all = " \
+ git://gerrit.automotivelinux.org/gerrit/src/agl-yocto-kernel-meta.git;protocol=https;type=kmeta;name=agl-meta;destsuffix=agl-kernel-meta;branch=kernel-5.15 \
+ file://virtio-aarch64-${LINUX_KERNEL_TYPE}.scc \
+"
+
+SRCREV_agl-meta = "4deb7357eab5962b0553a5ad1f11be5ac35f9da9"
+
+AGL_KCONFIG_FRAGMENTS:append:virtio-all = " \
+ virtio-drm.cfg \
+ virtio-pci.cfg \
+"
+
+COMPATIBLE_MACHINE:virtio-aarch64 = "virtio-aarch64"
diff --git a/meta-agl-bsp/wic/directdisk.wks.in b/meta-agl-bsp/wic/directdisk.wks.in
new file mode 100644
index 000000000..f7b220cdb
--- /dev/null
+++ b/meta-agl-bsp/wic/directdisk.wks.in
@@ -0,0 +1,9 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+part /boot --source bootimg-pcbios --use-uuid --label boot --active --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
+
+bootloader --timeout=0 --append="rootwait rootfstype=ext4 ${QB_KERNEL_CMDLINE_APPEND}"
+
diff --git a/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks b/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks
new file mode 100644
index 000000000..1f51a0bd4
--- /dev/null
+++ b/meta-agl-bsp/wic/sdimage-bootpart-uuid.wks
@@ -0,0 +1,6 @@
+# short-description: Create SD card image with a boot partition
+# long-description: Creates a partitioned SD card image. Boot files
+# are located in the first vfat partition.
+
+part /boot --source bootimg-partition --fstype=vfat --label boot --use-uuid --active --align 4 --size 16
+part / --source rootfs --fstype=ext4 --label root --align 4 --use-uuid
diff --git a/meta-agl-bsp/wic/singlepart-noloader.wks b/meta-agl-bsp/wic/singlepart-noloader.wks
new file mode 100644
index 000000000..31c499aee
--- /dev/null
+++ b/meta-agl-bsp/wic/singlepart-noloader.wks
@@ -0,0 +1,5 @@
+# short-description: Single partition rootfs with UUID and no bootloader
+# long-description: Creates a partitioned image with a single partition in
+# use and does not contain a bootloader.
+
+part / --source rootfs --use-uuid --fstype=ext4 --label root --align 4096
diff --git a/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks b/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks
new file mode 100644
index 000000000..db46c1835
--- /dev/null
+++ b/meta-agl-bsp/wic/systemd-intel-corei7-64-bootdisk.wks
@@ -0,0 +1,23 @@
+# short-description: Custom EFI disk image with systemd-boot
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. The selected bootloader is systemd-boot
+# and we do not have swap
+
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --use-uuid --label msdos --active --align 1024
+
+part / --source rootfs --fstype=ext4 --label platform --align 1024 --use-uuid
+
+# Modify the append line here as needed to suit the environment.
+#
+# To change the default video resolution add one of the following
+# resolutions:
+# uvesafb.mode_option=1024x768-32
+# uvesafb.mode_option=1280x1024-32
+# uvesafb.mode_option=1600x1200-32
+#
+# To avoid corrupt boot screen by systemd message you can remove the
+# console=tty0 portion below or disable all boot messages by kernel command
+# line. To disable all boot messages add:
+#
+# quiet
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 reboot=efi"
diff --git a/meta-agl-core/LICENSE b/meta-agl-core/LICENSE
new file mode 100644
index 000000000..e8758f89c
--- /dev/null
+++ b/meta-agl-core/LICENSE
@@ -0,0 +1,20 @@
+Different components of the AGL layers are under different licenses (a mix
+of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further
+details of the individual licenses.
+
+All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar)
+is MIT licensed unless otherwise stated.
+Source code included in tree for individual recipes (e.g. patches) are under
+the LICENSE stated in the associated recipe (.bb file) unless otherwise stated.
+
+License information for any other files (scripts) is either explicitly stated
+or defaults to GPL version 2 only.
+
+Individual files can contain the following style tags instead of the full
+license text to identify their license:
+
+ SPDX-License-Identifier: GPL-2.0-only
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-core/LICENSE.GPL-2.0-only b/meta-agl-core/LICENSE.GPL-2.0-only
new file mode 100644
index 000000000..5db3c0a21
--- /dev/null
+++ b/meta-agl-core/LICENSE.GPL-2.0-only
@@ -0,0 +1,288 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: GPL-2.0-only
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-core/LICENSE.MIT b/meta-agl-core/LICENSE.MIT
new file mode 100644
index 000000000..a6919eb7e
--- /dev/null
+++ b/meta-agl-core/LICENSE.MIT
@@ -0,0 +1,25 @@
+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 above copyright notice and this permission notice 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.
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-agl-core/README b/meta-agl-core/README
new file mode 120000
index 000000000..4a7a1a175
--- /dev/null
+++ b/meta-agl-core/README
@@ -0,0 +1 @@
+README-AGL.md \ No newline at end of file
diff --git a/meta-agl-core/README-AGL.md b/meta-agl-core/README-AGL.md
new file mode 100644
index 000000000..e410de29a
--- /dev/null
+++ b/meta-agl-core/README-AGL.md
@@ -0,0 +1,33 @@
+Overview
+========
+
+The
+[AGL Project](https://www.automotivelinux.org/) is an automotive-specific
+development environment that provides a Linux distribution
+[AGL UCB](https://www.automotivelinux.org/software/unified-code-base).
+
+AGL uses layers designed to be compatible with the
+[Yocto Project](https://www.yoctoproject.org) and the
+[OpenEmbedded Project (OE)](https://www.openembedded.org/wiki/Main_Page).
+
+This section provides information about the layers used by the AGL Project:
+
+* **`meta-agl/meta-agl-core`**: Minimal set of software needed to create an AGL distribution
+ used to boot a system.
+ AGL profiles are built on top of this minimal set of software.
+
+ ```
+ $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl
+ ```
+
+Maintenance
+-----------
+
+All patches must be submitted via the AGL Gerrit instance at
+<https://gerrit.automotivelinux.org>. See this wiki page for
+details:
+
+<https://wiki.automotivelinux.org/agl-distro/contributing>
+
+Layer maintainers:
+* Jan-Simon Möller <jsmoeller@linuxfoundation.org>
diff --git a/meta-agl-core/classes/agl-core-image.bbclass b/meta-agl-core/classes/agl-core-image.bbclass
new file mode 100644
index 000000000..bb5580391
--- /dev/null
+++ b/meta-agl-core/classes/agl-core-image.bbclass
@@ -0,0 +1,32 @@
+# AGL base image class
+#
+# As opposed to using core-image directly, this class:
+# - does not pull in packagegroup-base-extended by default to minimize images.
+# This does mean that many of the oe-core / poky MACHINE and DISTRO features
+# (e.g. 3g, nfs, etc.) will not result in packages being automatically pulled
+# into images since that is driven via packagegroup-base.
+# - includes hooks for integrating SELinux via meta-selinux
+# - disables locale installation by default
+#
+
+# Disable locales
+IMAGE_LINGUAS = ""
+
+# Hook to allow inheriting e.g. selinux-image by default.
+# Any bbclass used as a value should ultimately inherit core-image
+AGL_BASE_IMAGE ?= "core-image"
+
+inherit ${AGL_BASE_IMAGE}
+
+FEATURE_PACKAGES_selinux = " \
+ packagegroup-agl-core-selinux \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'packagegroup-agl-core-selinux-devel', '', d)} \
+"
+
+IMAGE_FEATURES:append = " ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
+
+CORE_IMAGE_BASE_INSTALL = " \
+ packagegroup-agl-core-boot \
+ \
+ ${CORE_IMAGE_EXTRA_INSTALL} \
+"
diff --git a/meta-agl-core/classes/agl-crosssdk.bbclass b/meta-agl-core/classes/agl-crosssdk.bbclass
new file mode 100644
index 000000000..5f6dbf303
--- /dev/null
+++ b/meta-agl-core/classes/agl-crosssdk.bbclass
@@ -0,0 +1,9 @@
+IMAGE_FEATURES += "dev-pkgs"
+IMAGE_INSTALL += "kernel-dev kernel-devsrc"
+
+inherit populate_sdk
+
+# Task do_populate_sdk and do_rootfs can't be exec simultaneously.
+# Both exec "createrepo" on the same directory, and so one of them
+# can failed (randomly).
+addtask do_populate_sdk after do_rootfs
diff --git a/meta-agl-core/classes/cloc.bbclass b/meta-agl-core/classes/cloc.bbclass
new file mode 100644
index 000000000..9b73704e8
--- /dev/null
+++ b/meta-agl-core/classes/cloc.bbclass
@@ -0,0 +1,33 @@
+# (C) 2017 Jan-Simon Möller <dl9pf@gmx.de>
+#
+# License: GPLv2
+#
+# summary with
+# cloc --sum-reports `find . -name "*clocreport" | grep -v "\-native" ` --out summary.report
+
+# cloc needs to be installed on the host
+# FIXME: create a cloc-native
+HOSTTOOLS += "cloc"
+
+CLOC_DIRECTORY ??= "${DEPLOY_DIR}/cloc/"
+CLOCSTATEDIR = "${WORKDIR}/cloc-destdir/"
+
+python do_cloc() {
+
+ import subprocess
+
+ source_dir = d.getVar('S', True)
+ pn = d.getVar('PN', True)
+
+ destdir = d.expand('${CLOCSTATEDIR}')
+ bb.utils.mkdirhier(destdir)
+
+ cloc_cmd = 'cloc %s -q --out=%s/%s.clocreport' % (source_dir, destdir, pn )
+ subprocess.call(cloc_cmd, shell=True)
+
+}
+
+
+addtask cloc before do_configure after do_patch
+
+EXPORT_FUNCTIONS do_cloc
diff --git a/meta-agl-core/classes/image_types_wic_workaround.bbclass b/meta-agl-core/classes/image_types_wic_workaround.bbclass
new file mode 100644
index 000000000..1a287ff7c
--- /dev/null
+++ b/meta-agl-core/classes/image_types_wic_workaround.bbclass
@@ -0,0 +1,32 @@
+# This is a workaround for the race condition between do_image_wic and other
+# do_image_* tasks. It ensures that no other do_image_* task can be running and
+# reading the rootfs directory at the same time as do_image_wic is modifying
+# the /etc/fstab file in the rootfs directory.
+#
+# A much better fix has been submitted upstream [1], but we can't carry those
+# modifications to `scripts/lib/wic` from poky easily in meta-agl. So instead
+# we have this workaround until the upstream fix is accepted and backported.
+#
+# Serializing the image functions as done here impacts build speed but it's
+# better to be slow and correct than to be fast and wrong.
+#
+# [1]: https://lists.openembedded.org/g/openembedded-core/topic/patch_5_6_wic_copy_rootfs/79592787,
+# https://lists.openembedded.org/g/openembedded-core/topic/patch_6_6_wic_optimise/79592788
+# and related patches.
+#
+# Bug-AGL: SPEC-3621
+
+def get_workaround_wic_typedeps(d):
+ if d.getVar('USING_WIC'):
+ fstypes = d.getVar('IMAGE_FSTYPES').split()
+ basetypes = set()
+ for fs in fstypes:
+ # Add the basetype to our set of basetypes in use
+ t = fs.split('.')[0]
+ if t != "wic":
+ basetypes.add(t)
+ return ' '.join(basetypes)
+ else:
+ return ''
+
+IMAGE_TYPEDEP:wic += "${@get_workaround_wic_typedeps(d)}"
diff --git a/meta-agl-core/classes/sanity-meta-agl-core.bbclass b/meta-agl-core/classes/sanity-meta-agl-core.bbclass
new file mode 100644
index 000000000..93df587f4
--- /dev/null
+++ b/meta-agl-core/classes/sanity-meta-agl-core.bbclass
@@ -0,0 +1,10 @@
+addhandler aglcore_bbappend_distrocheck
+aglcore_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
+python aglcore_bbappend_distrocheck() {
+ skip_check = e.data.getVar('SKIP_META_AGL_CORE_SANITY_CHECK') == "1"
+ if 'aglcore' not in e.data.getVar('AGL_FEATURES').split() and not skip_check:
+ bb.warn("You have included the meta-agl-core layer, but \
+'aglcore' has not been enabled in your AGL_FEATURES. Some bbappend files \
+may not take effect. See the meta-agl-core README for details on enabling \
+meta-agl-core support.")
+}
diff --git a/meta-agl-core/conf/bblayers.conf.sample b/meta-agl-core/conf/bblayers.conf.sample
new file mode 100644
index 000000000..8b1cbdfc5
--- /dev/null
+++ b/meta-agl-core/conf/bblayers.conf.sample
@@ -0,0 +1,12 @@
+# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+POKY_BBLAYERS_CONF_VERSION = "2"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+
+BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/meta-yocto-bsp \
+ "
diff --git a/meta-agl-distro/conf/distro/include/aarch64-tune.inc b/meta-agl-core/conf/distro/include/aarch64-tune.inc
index a2a308fe0..4628fcaf2 100644
--- a/meta-agl-distro/conf/distro/include/aarch64-tune.inc
+++ b/meta-agl-core/conf/distro/include/aarch64-tune.inc
@@ -4,7 +4,9 @@
# A double inclusion would produce a warning. This include line is just for reference
# include conf/machine/include/arm/arch-armv8.inc
-DEFAULTTUNE = "aarch64"
+AGL_DEFAULTTUNE ?= "aarch64"
+DEFAULTTUNE:agldefaulttune = "${AGL_DEFAULTTUNE}"
+
# not yet ready
#QB_SYSTEM_NAME ?= "qemu-system-aarch"
#QB_DEFAULT_KERNEL ?= "zImage"
diff --git a/meta-agl-core/conf/distro/include/arc-tune.inc b/meta-agl-core/conf/distro/include/arc-tune.inc
new file mode 100644
index 000000000..43dabd5a9
--- /dev/null
+++ b/meta-agl-core/conf/distro/include/arc-tune.inc
@@ -0,0 +1,3 @@
+# DEFAULTTUNE overrides for AGL on arc
+
+# DEFAULTTUNE ?= "archs"
diff --git a/meta-agl-distro/conf/distro/include/arm-tune.inc b/meta-agl-core/conf/distro/include/arm-tune.inc
index fa68e05a7..b3ad64ad7 100644
--- a/meta-agl-distro/conf/distro/include/arm-tune.inc
+++ b/meta-agl-core/conf/distro/include/arm-tune.inc
@@ -7,14 +7,16 @@
# include conf/machine/include/arch/arm-armv7-a.inc
# Standard target for 32bit ARM (newer than cortex-a15)
-AGLDEFAULTTUNE = "armv7vethf-neon-vfpv4"
+ARM_DEFAULTTUNE = "armv7vethf-neon-vfpv4"
# for cortex-a8, cortex-a9, cortex-a7 (=rpi 2/3)
-AGLDEFAULTTUNE := "${@bb.utils.contains('DISTRO_FEATURES', 'agl-medium-arm-compiler', 'armv7athf-neon', '${AGLDEFAULTTUNE}', d)}"
+ARM_DEFAULTTUNE := "${@bb.utils.contains('DISTRO_FEATURES', 'agl-medium-arm-compiler', 'armv7athf-neon', '${ARM_DEFAULTTUNE}', d)}"
# for armv6 (=rpi0/1)
-AGLDEFAULTTUNE := "${@bb.utils.contains('DISTRO_FEATURES', 'agl-low-arm-compiler', 'arm1176jzfshf', '${AGLDEFAULTTUNE}', d)}"
-DEFAULTTUNE := "${AGLDEFAULTTUNE}"
+ARM_DEFAULTTUNE := "${@bb.utils.contains('DISTRO_FEATURES', 'agl-low-arm-compiler', 'arm1176jzfshf', '${ARM_DEFAULTTUNE}', d)}"
+
+AGL_DEFAULTTUNE ?= "${ARM_DEFAULTTUNE}"
+DEFAULTTUNE:agldefaulttune := "${AGL_DEFAULTTUNE}"
QB_SYSTEM_NAME ?= "qemu-system-arm"
QB_DEFAULT_KERNEL ?= "zImage"
diff --git a/meta-agl-core/conf/distro/include/riscv64-tune.inc b/meta-agl-core/conf/distro/include/riscv64-tune.inc
new file mode 100644
index 000000000..981fc4283
--- /dev/null
+++ b/meta-agl-core/conf/distro/include/riscv64-tune.inc
@@ -0,0 +1,8 @@
+# DEFAULTTUNE overrides for AGL on riscv64
+
+# We should not need the tuning include below as the BSP should include the right set already.
+# A double inclusion would produce a warning. This include line is just for reference
+# include conf/machine/include/arm/arch-armv8.inc
+
+AGL_DEFAULTTUNE ?= "riscv64"
+DEFAULTTUNE:agldefaulttune = "${AGL_DEFAULTTUNE}"
diff --git a/meta-agl-core/conf/distro/include/x86_64-tune.inc b/meta-agl-core/conf/distro/include/x86_64-tune.inc
new file mode 100644
index 000000000..541b729b6
--- /dev/null
+++ b/meta-agl-core/conf/distro/include/x86_64-tune.inc
@@ -0,0 +1,56 @@
+# DEFAULTTUNE overrides for AGL on x86-64
+
+# We should not need the tuning include below as the BSP should include the right set already.
+# A double inclusion would produce a warning. This include line is just for reference
+#include conf/machine/include/tune-corei7.inc
+AGL_DEFAULTTUNE ?= "corei7-64"
+DEFAULTTUNE:agldefaulttune = "${AGL_DEFAULTTUNE}"
+
+# shortened copy of tune-corei7.inc due to bug in inclusion for tune-core2.inc
+# TUNE_ARCH is using .= x86-64 , if done twice, you get x86-64x86-64 as TUNE_ARCH :/
+# we should have at least the core2 tunings by default (=qemux86-64)
+
+# Extra tune features
+TUNEVALID[corei7] = "Enable corei7 specific processor optimizations"
+TUNE_CCARGS = "${@bb.utils.contains('TUNE_FEATURES', 'corei7', ' -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2', '', d)}"
+
+# Extra tune selections
+AVAILTUNES += "corei7-32"
+TUNE_FEATURES:tune-corei7-32 = "${TUNE_FEATURES:tune-x86} corei7"
+BASE_LIB:tune-corei7-32 = "lib"
+TUNE_PKGARCH:tune-corei7-32 = "corei7-32"
+PACKAGE_EXTRA_ARCHS:tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS:tune-core2-32} corei7-32"
+QEMU_EXTRAOPTIONS_corei7-32 = " -cpu Nehalem,check=false"
+
+AVAILTUNES += "corei7-64"
+TUNE_FEATURES:tune-corei7-64 = "${TUNE_FEATURES:tune-x86-64} corei7"
+BASE_LIB:tune-corei7-64 = "lib64"
+TUNE_PKGARCH:tune-corei7-64 = "corei7-64"
+PACKAGE_EXTRA_ARCHS:tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS:tune-core2-64} corei7-64"
+QEMU_EXTRAOPTIONS_corei7-64 = " -cpu Nehalem,check=false"
+
+AVAILTUNES += "corei7-64-x32"
+TUNE_FEATURES:tune-corei7-64-x32 = "${TUNE_FEATURES:tune-x86-64-x32} corei7"
+BASE_LIB:tune-corei7-64-x32 = "libx32"
+TUNE_PKGARCH:tune-corei7-64-x32 = "corei7-64-x32"
+PACKAGE_EXTRA_ARCHS:tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS:tune-core2-64-x32} corei7-64-x32"
+QEMU_EXTRAOPTIONS_corei7-64-x32 = " -cpu Nehalem,check=false"
+
+TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'm64', '${X86ARCH64}', '' ,d)}"
+
+# Bump qemux86-64 up to corei7
+AVAILTUNES += "qemux86-64"
+TUNE_FEATURES:tune-qemux86-64 = "${TUNE_FEATURES:tune-x86-64} corei7"
+BASE_LIB:tune-qemux86-64 = "lib64"
+TUNE_PKGARCH:tune-qemux86-64 = "corei7-64"
+PACKAGE_EXTRA_ARCHS:tune-qemux86-64 = "${PACKAGE_EXTRA_ARCHS:tune-core2-64} corei7-64"
+QEMU_EXTRAOPTIONS:qemux86-64 = " -cpu Nehalem,check=false"
+
+# QEMU / runqemu options (partly overrides qemuboot-x86.inc)
+QB_MACHINE = "-machine q35"
+QB_SYSTEM_NAME:x86-64 = "qemu-system-x86_64"
+QB_CPU:x86-64 = "-cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt"
+QB_CPU_KVM:x86-64 = "-cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt"
+
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-vga vmware -display default,show-cursor=on -usb -device usb-tablet -device virtio-rng-pci"
diff --git a/meta-agl-core/conf/distro/poky-agl.conf b/meta-agl-core/conf/distro/poky-agl.conf
new file mode 100644
index 000000000..266a06d70
--- /dev/null
+++ b/meta-agl-core/conf/distro/poky-agl.conf
@@ -0,0 +1,143 @@
+require conf/distro/poky.conf
+
+# Insert overrides "agldefaulttune" and "forcedefaulttune" before forcevariable
+OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:agldefaulttune:forcedefaulttune:forcevariable"
+
+# AGL specific derivations
+DISTRO = "poky-agl"
+DISTRO_NAME = "Automotive Grade Linux"
+
+
+# Release flags
+DISTRO_CODENAME = "ricefish"
+AGL_BRANCH = "master"
+AGLVERSION = "17.90.0"
+
+# switch devel/release
+#AGLRELEASETYPE ?= "agldevelopment"
+AGLRELEASETYPE := "aglrelease"
+
+OVERRIDES .= ":${AGLRELEASETYPE}"
+
+#for development
+DISTRO_VERSION:agldevelopment := "${AGLVERSION}+snapshot-${METADATA_REVISION}"
+
+#for release
+DISTRO_VERSION:aglrelease := "${AGLVERSION}"
+DISTRO_BRANCH_VERSION_TAG = "${DISTRO_CODENAME}/${@'${DISTRO_VERSION}'.replace('+snapshot-${METADATA_REVISION}','')}"
+
+# reproducible builds:
+# Set the desired timestamps
+# E.g. update for (major) releases
+export SOURCE_DATE_EPOCH = "1706800000"
+REPRODUCIBLE_TIMESTAMP_ROOTFS = "1706800000"
+
+
+# SDK
+SDK_VENDOR = "-aglsdk"
+
+# SDKPATHINSTALL is the folder where the SDK is going to be installed
+# Due to an issue with the qt5 environment (see SPEC-1667),
+# we add DEFAULTTUNE to the SDKPATH to mitigate the issue.
+SDKPATHINSTALL = "/opt/agl-sdk/${SDK_VERSION}-${DEFAULTTUNE}"
+
+
+MAINTAINER = "AGL https://lists.automotivelinux.org/g/agl-dev-community"
+
+TARGET_VENDOR = "-agl"
+
+# Override these in poky based distros
+AGL_DEFAULT_DISTRO_FEATURES = "usrmerge largefile opengl wayland pam bluetooth bluez5 3g polkit"
+POKY_DEFAULT_DISTRO_FEATURES := "${AGL_DEFAULT_DISTRO_FEATURES}"
+OVERRIDES .= ":${DISTRO_CODENAME}"
+
+DISTRO_FEATURES:remove = "x11"
+DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio"
+
+INIT_MANAGER = "systemd"
+# Override default of "systemd-compat-units"
+VIRTUAL-RUNTIME_initscripts = ""
+# Override default of "busybox-syslog"
+VIRTUAL-RUNTIME_base-utils-syslog = ""
+
+# network manager to use (possible values: systemd, connman)
+VIRTUAL-RUNTIME_net_manager = "connman"
+
+
+QEMU_TARGETS ?= "arm aarch64 i386 x86_64 riscv64"
+# Other QEMU_TARGETS "mips mips64 mips64el ppc sh4"
+
+MIRRORS =+ "\
+bzr://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+cvs://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+git://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+gitsm://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+hg://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+osc://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+p4://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+svn://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+bzr://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+cvs://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+git://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+gitsm://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+hg://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+osc://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+p4://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+svn://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+ \
+ftp://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+http://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+https://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
+ftp://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+http://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+https://.*/.* http://download.automotivelinux.org/AGL/mirror/ \n \
+"
+
+# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
+# fetch from the network (and warn you if not). To disable the test set
+# the variable to be empty.
+# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=HEAD
+CONNECTIVITY_CHECK_URIS ?= ""
+
+# using multiple BSP layers causes dangling bbappends in meta-agl-bsp
+# turn it into a warning
+#BB_DANGLINGAPPENDS_WARNONLY = "1"
+
+# Not yet upstreamed; should be submitted.
+SECURITY_CFLAGS:pn-qtwebengine = "${SECURITY_NO_PIE_CFLAGS}"
+
+# AGL uses 4 optimization levels
+# 2 for ARM 32bit
+# - a high and a medium setting for the CCARGS
+# - the high setting is default (needs >= cortex-a15)
+# - the medium setting is enabled with: DISTRO_FEATURES:append = " agl-medium-arm-compiler "
+# 1 for ARM 64bit / AARCH64
+# 1 for x86-64
+# 1 for RISC-V 64-bit
+require conf/distro/include/${TARGET_ARCH}-tune.inc
+
+# Generic qemu and qemuboot (runqemu) enhancements
+# check qemuboot.bbclass
+# - use 2G RAM by default
+QB_MEM ?= "-m 2048"
+# use pulseaudio on the host side - off as qemu-native is built with alsa
+#QB_AUDIO_DRV = "pa"
+# expose a virtual 'hda' sound card to the guest (arm/aarch64/x86-64)
+QB_AUDIO_OPT = "-device intel-hda -device hda-duplex -audiodev alsa,id=agl"
+
+# Board templates can add extra IMAGE_FSTYPES through this.
+# It is added (late) through the AGL image recipes.
+AGL_EXTRA_IMAGE_FSTYPES ??= ""
+AGL_EXTRA_INITRAMFS_FSTYPES ??= ""
+#
+# Default IMAGE FSTYPES wic.xz
+AGL_DEFAULT_IMAGE_FSTYPES ?= "wic.xz wic.bmap wic.xz.sha256sum"
+AGL_DEFAULT_IMAGE_FSTYPES:qemuall ?= "${@bb.utils.contains('AGL_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}"
+AGL_DEFAULT_IMAGE_FSTYPES:append:netboot = " ${@bb.utils.contains('AGL_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}"
+AGL_DEFAULT_INITRAMFS_FSTYPES ?= "ext4.gz"
+
+# DEFAULT IMAGE_FSTYPES for AGL (no - BSPs should not set this)
+#
+IMAGE_FSTYPES = "${AGL_DEFAULT_IMAGE_FSTYPES} ${AGL_EXTRA_IMAGE_FSTYPES}"
+INITRAMFS_FSTYPES = "${AGL_DEFAULT_INITRAMFS_FSTYPES} ${AGL_EXTRA_INITRAMFS_FSTYPES}"
+#
diff --git a/meta-agl-core/conf/include/agl-create-spdx.inc b/meta-agl-core/conf/include/agl-create-spdx.inc
new file mode 100644
index 000000000..8d71013e3
--- /dev/null
+++ b/meta-agl-core/conf/include/agl-create-spdx.inc
@@ -0,0 +1 @@
+INHERIT += " create-spdx "
diff --git a/meta-agl-core/conf/include/agl-devel.inc b/meta-agl-core/conf/include/agl-devel.inc
new file mode 100644
index 000000000..055fa61e3
--- /dev/null
+++ b/meta-agl-core/conf/include/agl-devel.inc
@@ -0,0 +1,16 @@
+IMAGE_FEATURES =+ "debug-tweaks tools-debug tools-profile"
+
+IMAGE_INSTALL:append = " \
+ packagegroup-agl-core-devel \
+"
+
+# Install libdrm-test, including modetest, to images with GUI
+IMAGE_INSTALL:append = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' libdrm-tests', '', d)}"
+
+# disable install of debug files in SDK
+# initial value: SDKIMAGE_FEATURES="dev-pkgs dbg-pkgs staticdev-pkgs"
+SDKIMAGE_FEATURES="dev-pkgs"
+
+# allows insertion of code or items specific to developement
+OVERRIDES:append = ":agl-devel"
+DISTRO_FEATURES:append = " agl-devel"
diff --git a/meta-agl-core/conf/include/agl-package-management.inc b/meta-agl-core/conf/include/agl-package-management.inc
new file mode 100644
index 000000000..9acf439c2
--- /dev/null
+++ b/meta-agl-core/conf/include/agl-package-management.inc
@@ -0,0 +1,6 @@
+# Enable package management
+IMAGE_FEATURES =+ "package-management"
+PACKAGE_FEED_URIS = "http://192.168.7.1:8000/tmp/deploy/"
+PACKAGE_FEED_BASE_PATHS = "rpm"
+PACKAGE_FEED_ARCHS = ""
+#${PACKAGE_ARCHS}"
diff --git a/meta-agl-core/conf/include/agl-selinux.inc b/meta-agl-core/conf/include/agl-selinux.inc
new file mode 100644
index 000000000..aeb26e33d
--- /dev/null
+++ b/meta-agl-core/conf/include/agl-selinux.inc
@@ -0,0 +1,20 @@
+DISTRO_FEATURES:append = " acl xattr selinux"
+
+# Reiterate the upstream default of targeted policy since that
+# is the mostly widely used model, and it will likely be easier
+# to pull policy from other distributions for it.
+# Having an explicit setting here seems useful for documentation
+# purposes, and it is still possible that using one of the other
+# refpolicy package options as the AGL default desirable, and it
+# would be set here.
+PREFERRED_PROVIDER_virtual/refpolicy ?= "refpolicy-targeted"
+
+# Default to permissive mode
+DEFAULT_ENFORCING ?= "permissive"
+
+# Override the base image class to get the SELinux labeling hook
+AGL_BASE_IMAGE ?= "selinux-image"
+
+# Mask out meta-selinux's linux-yocto kernel config bbappend to
+# avoid collision with AGL's own more universal scheme.
+BBMASK += "meta-selinux/recipes-kernel/linux/" \ No newline at end of file
diff --git a/meta-agl-core/conf/include/base-agl.inc b/meta-agl-core/conf/include/base-agl.inc
new file mode 100644
index 000000000..30bfc93d3
--- /dev/null
+++ b/meta-agl-core/conf/include/base-agl.inc
@@ -0,0 +1,18 @@
+# Disable kernel module tarballs by default on the assumption that
+# desired modules will already be present in images.
+# Comment this out to receive the separate modules tarball again.
+MODULE_TARBALL_DEPLOY ?= "0"
+
+# Comment out below if want to use QtWebkit
+PACKAGECONFIG:remove:pn-qtquick1 = "webkit"
+
+
+ASSUME_PROVIDED:remove = "tar-native"
+
+# Use static IDs to enable full-filesystem updates
+USERADDEXTENSION = "useradd-staticids"
+USERADD_ERROR_DYNAMIC = "error"
+USERADD_GID_TABLES = "files/group"
+USERADD_UID_TABLES = "files/passwd"
+
+AGL_FEATURES += "aglcore"
diff --git a/meta-agl-core/conf/layer.conf b/meta-agl-core/conf/layer.conf
new file mode 100644
index 000000000..8047df519
--- /dev/null
+++ b/meta-agl-core/conf/layer.conf
@@ -0,0 +1,28 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH =. "${LAYERDIR}:"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "aglcore"
+BBFILE_PATTERN_aglcore = "^${LAYERDIR}/"
+BBFILE_PRIORITY_aglcore = "60"
+
+BBFILES_DYNAMIC += " \
+ openembedded-layer:${LAYERDIR}/dynamic-layers/meta-oe/*/*/*.bb \
+ openembedded-layer:${LAYERDIR}/dynamic-layers/meta-oe/*/*/*.bbappend \
+ \
+ selinux:${LAYERDIR}/dynamic-layers/meta-selinux/*/*/*.bb \
+ selinux:${LAYERDIR}/dynamic-layers/meta-selinux/*/*/*.bbappend \
+ \
+ qt5-layer:${LAYERDIR}/dynamic-layers/meta-qt5/*/*/*.bb \
+ qt5-layer:${LAYERDIR}/dynamic-layers/meta-qt5/*/*/*.bbappend \
+"
+
+LAYERSERIES_COMPAT_aglcore = "scarthgap"
+LAYERDEPENDS_aglcore = "core"
+
+# Sanity check for meta-virtualization layer.
+# Setting SKIP_META_VIRT_SANITY_CHECK to "1" would skip the bbappend files check.
+#INHERIT += "sanity-meta-agl-core"
diff --git a/templates/base/local.conf.sample b/meta-agl-core/conf/local.conf.sample
index 365b6eb20..4cfae4ceb 100644
--- a/templates/base/local.conf.sample
+++ b/meta-agl-core/conf/local.conf.sample
@@ -25,17 +25,16 @@
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
-# There are also the following hardware board target machines included for
+# There are also the following hardware board target machines included for
# demonstration purposes:
#
-#MACHINE ?= "beaglebone"
+#MACHINE ?= "beaglebone-yocto"
#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"
+# This sets the default machine to be qemux86-64 if no other machine is selected:
+MACHINE ??= "qemux86-64"
#
# Where to place downloads
@@ -83,12 +82,12 @@ MACHINE ??= "qemux86"
#
# 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
+# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
DISTRO ?= "poky"
# 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
+# 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"
@@ -124,6 +123,8 @@ PACKAGE_CLASSES ?= "package_rpm"
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
+# "src-pkgs" - add -src packages for all installed packages
+# (adds source code for debugging)
# "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
@@ -147,21 +148,18 @@ EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
# 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"
+USER_CLASSES ?= "buildstats"
#
# 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"
+# after any root filesystems are created and run tests against those images. It can also
+# run tests against any SDK that are built. To enable this uncomment these lines.
+# See classes/test{image,sdk}.bbclass for further details.
+#IMAGE_CLASSES += "testimage testsdk"
+#TESTIMAGE_AUTO:qemuall = "1"
+
#
# Interactive shell configuration
#
@@ -186,20 +184,20 @@ PATCHRESOLVE = "noop"
#
# 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
+# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard halt
# 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.
# It's necesary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
-BB_DISKMON_DIRS = "\
+BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
- ABORT,${TMPDIR},100M,1K \
- ABORT,${DL_DIR},100M,1K \
- ABORT,${SSTATE_DIR},100M,1K \
- ABORT,/tmp,10M,1K"
+ HALT,${TMPDIR},100M,1K \
+ HALT,${DL_DIR},100M,1K \
+ HALT,${SSTATE_DIR},100M,1K \
+ HALT,/tmp,10M,1K"
#
# Shared-state files from other locations
@@ -219,19 +217,57 @@ BB_DISKMON_DIRS = "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"
+#
+# Yocto Project SState Mirror
+#
+# The Yocto Project has prebuilt artefacts available for its releases, you can enable
+# use of these by uncommenting the following line. This will mean the build uses
+# the network to check for artefacts at the start of builds, which does slow it down
+# equally, it will also speed up the builds by not having to build things if they are
+# present in the cache. It assumes you can download something faster than you can build it
+# which will depend on your network.
+#
+#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=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. By default libsdl-native will
-# be built, if you want to use your host's libSDL instead of the minimal libsdl built
-# by libsdl-native then uncomment the ASSUME_PROVIDED line below.
-PACKAGECONFIG_append_pn-qemu-native = " sdl"
-PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
-#ASSUME_PROVIDED += "libsdl-native"
+# By default native qemu will build with a builtin VNC server where graphical output can be
+# seen. The line below enables the SDL UI frontend too.
+PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
+# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
+# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
+#ASSUME_PROVIDED += "libsdl2-native"
+
+# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
+# a handy set of menus for controlling the emulator.
+#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
+
+#
+# Hash Equivalence
+#
+# Enable support for automatically running a local hash equivalence server and
+# instruct bitbake to use a hash equivalence aware signature generator. Hash
+# equivalence improves reuse of sstate by detecting when a given sstate
+# artifact can be reused as equivalent, even if the current task hash doesn't
+# match the one that generated the artifact.
+#
+# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
+#
+#BB_HASHSERVE = "auto"
+#BB_SIGNATURE_HANDLER = "OEEquivHash"
# 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"
+CONF_VERSION = "2"
+
+# meta-agl-core uses these variables
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+DISTRO_FEATURES:append = " systemd "
+DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+# soon: INIT_MANAGER = "systemd"
diff --git a/templates/base/bblayers.conf.sample b/meta-agl-core/conf/templates/base/bblayers.conf.sample
index 478523b0d..c6a37a0b0 100644
--- a/templates/base/bblayers.conf.sample
+++ b/meta-agl-core/conf/templates/base/bblayers.conf.sample
@@ -8,50 +8,66 @@ BBFILES ?= ""
# Convenience variables usable in various configuration fragments
#----------------------------------
BCONFDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)))}"
-METADIR := "${@os.path.abspath('##OEROOT##/..')}"
+METADIR := "${@os.path.abspath('##OEROOT##/../..')}"
# These are the core OE + YP Layers
#----------------------------------
YOCTO_LAYERS = " \
- ${METADIR}/poky/meta \
- ${METADIR}/poky/meta-poky \
+ ${METADIR}/external/poky/meta \
+ ${METADIR}/external/poky/meta-poky \
"
# this is added for the boards where necessary, not globally
-# ${METADIR}/poky/meta-yocto-bsp \
+# ${METADIR}/external/poky/meta-yocto-bsp \
#
# These are the AGL CORE Layers that make up the basis
# - they create a minimal bootable filesystem
# with some automotive tools/libraries
#-----------------------------------------------------
AGL_CORE_LAYERS = " \
- ${METADIR}/meta-agl/meta-ivi-common \
- ${METADIR}/meta-agl/meta-agl \
- ${METADIR}/meta-agl/meta-agl-distro \
+ ${METADIR}/meta-agl/meta-agl-core \
${METADIR}/meta-agl/meta-agl-bsp \
"
# These are the direct dependencies of the AGL CORE Layers
#---------------------------------------------------------
AGL_CORE_DEPENDENCY_LAYERS = " \
- ${METADIR}/meta-openembedded/meta-oe \
- ${METADIR}/meta-openembedded/meta-multimedia \
- ${METADIR}/meta-openembedded/meta-efl \
- ${METADIR}/meta-openembedded/meta-networking \
- ${METADIR}/meta-openembedded/meta-python \
+ ${METADIR}/external/meta-openembedded/meta-oe \
"
+# Indirection to avoid duplicate inclusions of the same folder into BBLAYERS
+# the evaluation is in the bblayers.conf.sample in meta-agl/meta-agl-core/conf/templates/base
+AGL_META_NETWORKING ?= ""
+AGL_META_PYTHON ?= ""
+AGL_META_FILESYSTEMS ?= ""
+AGL_META_MULTIMEDIA ?= ""
+AGL_META_VIRTUALIZATION ?= ""
+AGL_META_CLANG ?= ""
+AGL_META_QT5 ?= ""
+
+AGL_OTHER_DEPENDENCY_LAYERS = " \
+ ${AGL_META_NETWORKING} \
+ ${AGL_META_PYTHON} \
+ ${AGL_META_FILESYSTEMS} \
+ ${AGL_META_MULTIMEDIA} \
+ ${AGL_META_VIRTUALIZATION} \
+ ${AGL_META_CLANG} \
+ ${AGL_META_QT5} \
+ "
+
####################
# Combine the layers
BBLAYERS ?= " \
+ ${AGL_OTHER_DEPENDENCY_LAYERS} \
${AGL_CORE_DEPENDENCY_LAYERS} \
${AGL_CORE_LAYERS} \
${YOCTO_LAYERS} \
"
BBLAYERS_NON_REMOVABLE ?= " \
- ${METADIR}/poky/meta \
- ${METADIR}/poky/meta-poky \
- ${METADIR}//meta-agl/meta-agl \
+ ${METADIR}/external/poky/meta \
+ ${METADIR}/external/poky/meta-poky \
+ ${METADIR}/meta-agl/meta-agl-core \
"
+
diff --git a/meta-agl-core/conf/templates/base/conf-notes.txt b/meta-agl-core/conf/templates/base/conf-notes.txt
new file mode 100644
index 000000000..09ae72647
--- /dev/null
+++ b/meta-agl-core/conf/templates/base/conf-notes.txt
@@ -0,0 +1,35 @@
+Common targets are:
+- meta-agl layer:
+ - included by default
+ * agl-image-boot (just enough to boot)
+ * agl-image-minimal (minimal filesystem with APIs)
+ * agl-image-minimal-crosssdk (crosssdk for ^^)
+
+ * agl-image-weston (minimal filesystem with weston)
+
+- meta-agl-demo: (IVI demo with UI)
+ - with 'agl-demo'
+ * agl-image-ivi (base for IVI targets)
+ * agl-image-ivi-crosssdk (sdk for ^^)
+
+ * agl-image-graphical-qt5 (weston plus qt5 framework libs)
+ * agl-image-graphical-qt5-crosssdk (sdk for ^^)
+
+ * agl-image-graphical-html5 (weston plus chromium for html5)
+
+ * agl-image-cluster (minimal image with APIs for cluster)
+ * agl-image-cluster-qt5 (image with QT5 and APIs for cluster)
+
+ * agl-image-telematics (image with APIs for telematics)
+
+ * agl-demo-platform (* default IVI demo target *)
+ * agl-demo-platform-crosssdk (sdk for ^^)
+
+ * agl-cluster-demo-platform (cluster demo image)
+ * agl-cluster-demo-platform-crosssdk (sdk for ^^)
+ * agl-cluster-demo-qtcompositor (cluster demo using own compositor)
+
+ * agl-telematics-demo-platform (telematics demo image)
+ * agl-telematics-demo-platform-crosssdk (sdk for ^^)
+
+
diff --git a/meta-agl-core/conf/templates/base/local.conf.sample b/meta-agl-core/conf/templates/base/local.conf.sample
new file mode 100644
index 000000000..be49ed00d
--- /dev/null
+++ b/meta-agl-core/conf/templates/base/local.conf.sample
@@ -0,0 +1,339 @@
+#
+# 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 ?= "qemuarm64"
+#MACHINE ?= "qemumips"
+#MACHINE ?= "qemumips64"
+#MACHINE ?= "qemuppc"
+#MACHINE ?= "qemux86"
+#MACHINE ?= "qemux86-64"
+#
+# There are also the following hardware board target machines included for
+# demonstration purposes:
+#
+#MACHINE ?= "beaglebone-yocto"
+#MACHINE ?= "genericx86"
+#MACHINE ?= "genericx86-64"
+#MACHINE ?= "mpc8315e-rdb"
+#MACHINE ?= "edgerouter"
+#
+# This sets the default machine to be qemux86-64 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"
+# 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 target architecture
+#
+# This variable specifies the architecture to build SDK 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)
+# "src-pkgs" - add -src packages for all installed packages
+# (adds source code for debugging)
+# "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, 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
+USER_CLASSES ?= "buildstats"
+
+#
+# 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. It can also
+# run tests against any SDK that are built. To enable this uncomment these lines.
+# See classes/test{image,sdk}.bbclass for further details.
+#IMAGE_CLASSES += "testimage testsdk"
+#TESTIMAGE_AUTO:qemuall = "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 halt
+# 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.
+# It's necesary to monitor /tmp, if there is no space left the build will fail
+# with very exotic errors.
+BB_DISKMON_DIRS ??= "\
+ STOPTASKS,${TMPDIR},1G,100K \
+ STOPTASKS,${DL_DIR},1G,100K \
+ STOPTASKS,${SSTATE_DIR},1G,100K \
+ STOPTASKS,/tmp,100M,100K \
+ HALT,${TMPDIR},100M,1K \
+ HALT,${DL_DIR},100M,1K \
+ HALT,${SSTATE_DIR},100M,1K \
+ HALT,/tmp,10M,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"
+
+#
+# AGL Project SState Mirror
+#
+# The AGL Project has prebuilt artefacts available for its releases, you can enable
+# use of these by uncommenting the following line. This will mean the build uses
+# the network to check for artefacts at the start of builds, which does slow it down
+# equally, it will also speed up the builds by not having to build things if they are
+# present in the cache. It assumes you can download something faster than you can build it
+# which will depend on your network.
+#
+#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH"
+# For AGL:
+#SSTATE_MIRRORS += "file://.* http://download.automotivelinux.org/sstate-mirror/${AGL_BRANCH}/${DEFAULTTUNE}/PATH;downloadfilename=PATH"
+
+#
+# Qemu configuration
+#
+# By default native qemu will build with a builtin VNC server where graphical output can be
+# seen. The line below enables the SDL UI frontend too.
+PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
+# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
+# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
+#ASSUME_PROVIDED += "libsdl2-native"
+
+# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
+# a handy set of menus for controlling the emulator.
+#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
+
+#
+# Parallelism Options
+#
+# These two options control how much parallelism BitBake should use. The first
+# option determines how many tasks bitbake should run in parallel:
+#
+#BB_NUMBER_THREADS ?= "4"
+#
+# Default to setting automatically based on cpu count
+#BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+#
+# The second option controls how many processes make should run in parallel when
+# running compile tasks:
+#
+#PARALLEL_MAKE ?= "-j 4"
+#
+# Default to setting automatically based on cpu count
+#PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
+#
+# For a quad-core machine, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
+# be appropriate for example.
+
+#
+# Hash Equivalence
+#
+# Enable support for automatically running a local hash equivalence server and
+# instruct bitbake to use a hash equivalence aware signature generator. Hash
+# equivalence improves reuse of sstate by detecting when a given sstate
+# artifact can be reused as equivalent, even if the current task hash doesn't
+# match the one that generated the artifact.
+#
+# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
+#
+#BB_HASHSERVE = "auto"
+#BB_SIGNATURE_HANDLER = "OEEquivHash"
+
+
+# The network based PR service host and port
+# Uncomment the following lines to enable PRservice.
+# Set PRSERV_HOST to 'localhost:0' to automatically
+# start local PRService.
+# Set to other values to use remote PRService.
+#PRSERV_HOST = "localhost:0"
+
+
+# Archive the source and put them to ${DEPLOY_DIR}/sources/.
+#
+#INHERIT += "archiver"
+#
+# The tarball for the patched source will be created by default, and you
+# can configure the archiver as follow:
+#
+# Create archive for:
+# 1) original (or unpacked) source:
+#ARCHIVER_MODE[src] = "original"
+# 2) patched source: (default)
+#ARCHIVER_MODE[src] = "patched"
+# 3) configured source:
+#ARCHIVER_MODE[src] = "configured"
+#
+# 4) the patches between do_unpack and do_patch:
+#ARCHIVER_MODE[diff] = "1"
+# set the files that you'd like to exclude from the diff:
+#ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+#
+# 5) the environment data, similar to 'bitbake -e recipe':
+#ARCHIVER_MODE[dumpdata] = "1"
+#
+# 6) the recipe (.bb and .inc):
+#ARCHIVER_MODE[recipe] = "1"
+#
+# 7) Whether output the .src.rpm package:
+#ARCHIVER_MODE[srpm] = "1"
+#
+# 8) Filter the license, the recipe whose license in
+# COPYLEFT_LICENSE_INCLUDE will be included, and in
+# COPYLEFT_LICENSE_EXCLUDE will be excluded.
+#COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
+#COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
+#
+# 9) Config the recipe type that will be archived, the type can be
+# target, native, nativesdk, cross, crosssdk and cross-canadian,
+# you can set one or more types. Archive all types by default.
+#COPYLEFT_RECIPE_TYPES = 'target'
+#
+
+
+# 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 = "2"
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend
new file mode 100644
index 000000000..4b6deffdf
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'agl-compositor-init_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc
new file mode 100644
index 000000000..b7d346d39
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc
@@ -0,0 +1 @@
+require common-init.inc
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-shell-activator_git.bb b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-shell-activator_git.bb
new file mode 100644
index 000000000..38725c1bd
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-shell-activator_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = " Application that switches/activates other application's windows "
+DESCRIPTION = " A wayland client and a script that talks with the agl-compositor \
+an tells it to display a specific application. Relies on the appid being \
+started (already) by afm-util or the client shell (homescreen/WAM)"
+
+HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/q/project:src%252Fagl-shell-activator"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e978448a0d41d826d73890d9c22caf75"
+
+DEPENDS = "wayland wayland-protocols wayland-native agl-compositor grpc grpc-native"
+
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-shell-activator.git;protocol=https;branch=${AGL_BRANCH}"
+SRCREV = "027d6f814f3d1f2e6b4b4071365b28dadec34109"
+
+PV = "0.0.10+git${SRCPV}"
+S = "${WORKDIR}/git"
+
+
+inherit meson pkgconfig python3native
+
+FILES:${PN} = " ${bindir}/agl-shell-activator"
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc
new file mode 100644
index 000000000..47f7d8b1d
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc
@@ -0,0 +1,6 @@
+# If weston's PACKAGECONFIG contains systemd + pam + polkit, polkit
+# ends up a hard requirement for start up due to the pam + systemd
+# configuration that is being installed. For now, keep things simple
+# and assume that polkit should be a dependency if it is in
+# DISTRO_FEATURES.
+RDEPENDS:${PN} += "${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 000000000..c09d7ccd3
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston-init_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc
new file mode 100644
index 000000000..b7d346d39
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc
@@ -0,0 +1 @@
+require common-init.inc
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend
new file mode 100644
index 000000000..1e0e66f01
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend
@@ -0,0 +1,3 @@
+IMAGE_INSTALL += " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'agl-shell-activator', '', d)} \
+"
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_%.bbappend b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_%.bbappend
new file mode 100644
index 000000000..aab944c2f
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'qtbase_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_aglcore.inc b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_aglcore.inc
new file mode 100644
index 000000000..581f5de99
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase_aglcore.inc
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/qtbase:"
+
+PACKAGECONFIG_WAYLAND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
+
+PACKAGECONFIG_GL = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
+
+PACKAGECONFIG:append = " ${PACKAGECONFIG_WAYLAND}"
+
+# '-qpa wayland-egl' set wayland-egl as default of platform plugins
+PACKAGECONFIG[wayland]="-qpa wayland-egl -no-qpa-platform-guard"
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch
new file mode 100644
index 000000000..ba8a991ed
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation/0001-mapbox-update-API-url-to-match-new-schema.patch
@@ -0,0 +1,47 @@
+From 58197439eade86e7efc6fe98116c0092ea429d29 Mon Sep 17 00:00:00 2001
+From: Matt Ranostay <matt.ranostay@konsulko.com>
+Date: Tue, 10 Mar 2020 13:59:58 -0700
+Subject: [PATCH] mapbox: update API url to match new schema
+
+---
+ src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp | 7 ++++---
+ src/plugins/geoservices/mapbox/qmapboxcommon.h | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+index 0b128556..bd2be6b6 100644
+--- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
++++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp
+@@ -88,12 +88,13 @@ QGeoTiledMapReply *QGeoTileFetcherMapbox::getTileImage(const QGeoTileSpec &spec)
+ request.setRawHeader("User-Agent", m_userAgent);
+
+ request.setUrl(QUrl(mapboxTilesApiPath +
+- ((spec.mapId() >= m_mapIds.size()) ? QStringLiteral("mapbox.streets") : m_mapIds[spec.mapId() - 1]) + QLatin1Char('/') +
++ m_mapIds[m_mapIds.size() - 1] +
++ QStringLiteral("/tiles/256/") +
+ QString::number(spec.zoom()) + QLatin1Char('/') +
+ QString::number(spec.x()) + QLatin1Char('/') +
+ QString::number(spec.y()) +
+- ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x.")) : QLatin1String(".")) +
+- m_format + QLatin1Char('?') +
++ ((m_scaleFactor > 1) ? (QLatin1Char('@') + QString::number(m_scaleFactor) + QLatin1String("x")) : QLatin1String("")) +
++ QLatin1Char('?') +
+ QStringLiteral("access_token=") + m_accessToken));
+
+ QNetworkReply *reply = m_networkManager->get(request);
+diff --git a/src/plugins/geoservices/mapbox/qmapboxcommon.h b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+index e60c4e83..4b2ea98d 100644
+--- a/src/plugins/geoservices/mapbox/qmapboxcommon.h
++++ b/src/plugins/geoservices/mapbox/qmapboxcommon.h
+@@ -46,7 +46,7 @@
+
+ QT_BEGIN_NAMESPACE
+
+-static const QString mapboxTilesApiPath = QStringLiteral("http://api.tiles.mapbox.com/v4/");
++static const QString mapboxTilesApiPath = QStringLiteral("https://api.mapbox.com/");
+
+ // https://www.mapbox.com/api-documentation/#geocoding
+ static const QString mapboxGeocodingApiPath = QStringLiteral("https://api.mapbox.com/geocoding/v5/mapbox.places/");
+--
+2.25.0
+
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend
new file mode 100644
index 000000000..a0d80075a
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'qtlocation_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc
new file mode 100644
index 000000000..60867aef0
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtlocation_aglcore.inc
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/qtlocation:"
+
+SRC_URI += "\
+ file://0001-mapbox-update-API-url-to-match-new-schema.patch \
+ "
+
+# Need to explicitly enable the various plugins
+PACKAGECONFIG += " \
+ geoservices_osm \
+ geoservices_here \
+ geoservices_itemsoverlay \
+ geoservices_mapbox \
+ geoservices_mapboxgl \
+"
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.service b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.service
new file mode 100644
index 000000000..b8d394068
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Generated file SELinux relabeling
+DefaultDependencies=no
+After=local-fs.target systemd-machine-id-commit.service
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/systemd-selinux-relabel.sh
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.sh b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.sh
new file mode 100644
index 000000000..b2557a8d6
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/files/systemd-selinux-relabel.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Update labels on files generated on first boot.
+/usr/sbin/restorecon -FRi /etc/systemd /etc/machine-id
+if [ $? -eq 0 ]; then
+ # Disable parent service
+ # NOTE: The service does not use the first boot functionality
+ # in systemd as /etc/machine-id is not writeable until
+ # after it is complete.
+ systemctl disable systemd-selinux-relabel.service
+fi
+exit 0
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/systemd-selinux-relabel_1.0.bb b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/systemd-selinux-relabel_1.0.bb
new file mode 100644
index 000000000..7e4f9783c
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-core/systemd/systemd-selinux-relabel_1.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "System unit to relabel systemd generated files"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://systemd-selinux-relabel.service \
+ file://systemd-selinux-relabel.sh \
+"
+
+inherit systemd allarch features_check
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/systemd-selinux-relabel.service ${D}${systemd_system_unitdir}/
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/systemd-selinux-relabel.sh ${D}${sbindir}/
+}
+
+FILES:${PN} += "${systemd_system_unitdir}"
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-platform/packagegroups/packagegroup-agl-core-selinux.bb b/meta-agl-core/dynamic-layers/meta-selinux/recipes-platform/packagegroups/packagegroup-agl-core-selinux.bb
new file mode 100644
index 000000000..493a46f25
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-platform/packagegroups/packagegroup-agl-core-selinux.bb
@@ -0,0 +1,57 @@
+SUMMARY = "SELinux packages"
+DESCRIPTION = "SELinux packages required for AGL"
+LICENSE = "MIT"
+
+inherit packagegroup features_check
+
+REQUIRED_DISTRO_FEATURES = "selinux"
+
+PACKAGES = " \
+ packagegroup-agl-core-selinux \
+ packagegroup-agl-core-selinux-devel \
+"
+
+#
+# meta-selinux's packagegroup-core-selinux includes a lot of
+# policy development tools with its inclusion of the layer's
+# packagegroup-selinux-policycoreutils, which is not really
+# desirable for a production image. Create our own base
+# packagegroup and an accompanying devel packagegroup that
+# agl-devel can trigger pulling in.
+#
+# NOTES:
+# - It seems likely we will always want auditd, so include
+# it in the base packagegroup.
+# - selinux-autorelabel seems required to handle both the
+# edge case of builds done on non-xattr capable filesystems,
+# and to allow driving relabeling after potential package
+# installation during runtime.
+# - packagegroup-selinux-policycoreutils includes a lot of
+# things that seem not useful in a lot of systems (e.g.
+# the gtk dependent selinux-gui), so for now the devel
+# packagegroup aims to include a more minimal set of tools
+# aimed at enabling checkpolicy and audit2allow use.
+# - Some thought needs to go into whether the relabeling
+# fixup packages should be handled separately, as they
+# ideally should not go into images using read-only or
+# stateless rootfs, but those are image features so we
+# cannot check for them here.
+#
+
+RDEPENDS:${PN} = " \
+ packagegroup-selinux-minimal \
+ auditd \
+ selinux-autorelabel \
+ systemd-selinux-relabel \
+"
+
+RDEPENDS:${PN}-devel = " \
+ ${BPN} \
+ libsepol-bin \
+ checkpolicy \
+ policycoreutils-loadpolicy \
+ policycoreutils-setsebool \
+ policycoreutils-hll \
+ semodule-utils-semodule-package \
+ selinux-python-audit2allow \
+"
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_0.1.bbappend b/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_0.1.bbappend
new file mode 100644
index 000000000..793b049e5
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_0.1.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'selinux-autorelabel_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_aglcore.inc b/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_aglcore.inc
new file mode 100644
index 000000000..67d3843f4
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-selinux/recipes-security/selinux-scripts/selinux-autorelabel_aglcore.inc
@@ -0,0 +1,4 @@
+do_install:append() {
+ # Do not force auto relabeling just from the package getting installed
+ rm -f ${D}/.autorelabel
+}
diff --git a/meta-agl/files/group b/meta-agl-core/files/group
index bd26c5563..a7e0cd17f 100644
--- a/meta-agl/files/group
+++ b/meta-agl-core/files/group
@@ -39,7 +39,7 @@ games::60:
shutdown::70:
users::100:
nogroup::65534:
-cynara::999:
+cynagora::999:
dhcp::998:
avahi::997:
tracing::1000:
@@ -52,6 +52,7 @@ weston-launch::986:
lock::990:
systemd-journal::989:
systemd-timesync::988:
+systemd-coredump::888:
pulse::991:
bind::987:
trinity::985:
@@ -62,7 +63,7 @@ datetime::981:
network::980:
zabbix::979:
nm-openvpn::978:
-xuser::1002:
+xuser::2002:
builder::977:
rpc::976:
crontab::975:
@@ -76,11 +77,26 @@ dovenull::966:
quagga::965:
quaggavty::964:
rwhod::963:
-ftp::963:
+ftp::962:
squid::960:
postfix::959:
vmail::958:
opensaf::957:
lldpd::956:
postdrop::954:
-display::200:
+weston::200:
+wayland::201:
+display::202:
+agl-driver::1001:
+agl-passenger::1002:
+applaunchd::1003:
+systemd-network::1005:
+systemd-resolve::1006:
+mosquitto::1007:
+pipewire::1008:
+render::1009:
+sgx::1010:
+kuksa::900:
+qemu::901:
+kvm::902:
+ptest::2001:
diff --git a/meta-agl/files/passwd b/meta-agl-core/files/passwd
index c992e52ff..ea54d06e4 100644
--- a/meta-agl/files/passwd
+++ b/meta-agl-core/files/passwd
@@ -16,16 +16,18 @@ list::38:38:::
irc::39:39:::
gnats::41:41:::
nobody::65534:65534:::
-cynara::999:999:::
+cynagora::999:999:::
dhcp::998:998:::
avahi::997:997:::
sshd::996:996:::
systemd-bus-proxy::995:995:::
-agl-driver::1000:100:::
-agl-passenger::1001:100:::
+agl-driver::1001:1001:::
+agl-passenger::1002:1002:::
+applaunchd::1003:1003:::
messagebus::994:994:::
afm::992:992:::
systemd-timesync::988:988:::
+systemd-coredump::888:888:::
pulse::991:991:::
bind::987:987:::
trinity::985:985:::
@@ -34,7 +36,7 @@ mysql::983:983:::
polkitd::982:982:::
zabbix::979:979:::
nm-openvpn::978:978:::
-xuser::1002:1002:::
+xuser::2002:2002:::
builder::977:977:::
rpc::976:976:::
distcc::973:65534:::
@@ -55,4 +57,12 @@ vmail::958:958:::
opensaf::957:957:::
lldpd::956:956:::
cyrus::955:8:::
-display::200:200:::
+weston::200:200:::
+systemd-network::1005:1005:::
+systemd-resolve::1006:1006:::
+mosquitto::1007:1007:::
+pipewire::1008:1008:::
+kuksa::900:900:::
+qemu::901:901:::
+user::1004:100:::
+ptest::2001:2001:::
diff --git a/meta-agl-core/recipes-config/agl-users/agl-users.inc b/meta-agl-core/recipes-config/agl-users/agl-users.inc
new file mode 100644
index 000000000..428af3806
--- /dev/null
+++ b/meta-agl-core/recipes-config/agl-users/agl-users.inc
@@ -0,0 +1,14 @@
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADDEXTENSION = "useradd-staticids"
+
+GROUPADD_PARAM:${PN} = "\
+ --system video ; \
+ --system pipewire ; \
+ -g 1001 agl-driver ; \
+"
+
+USERADD_PARAM:${PN} = "\
+ -g 1001 -u 1001 -G video,pipewire -o -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \
+"
diff --git a/meta-agl-core/recipes-config/agl-users/agl-users_1.0.bb b/meta-agl-core/recipes-config/agl-users/agl-users_1.0.bb
new file mode 100644
index 000000000..18f25e4be
--- /dev/null
+++ b/meta-agl-core/recipes-config/agl-users/agl-users_1.0.bb
@@ -0,0 +1,9 @@
+SUMMARY = "AGL Users"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit allarch
+
+require agl-users.inc
+
+ALLOW_EMPTY:${PN} = "1"
diff --git a/meta-agl-core/recipes-connectivity/busybox/busybox_%.bbappend b/meta-agl-core/recipes-connectivity/busybox/busybox_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/busybox/busybox_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-connectivity/busybox/busybox_aglcore.inc b/meta-agl-core/recipes-connectivity/busybox/busybox_aglcore.inc
new file mode 100644
index 000000000..88ff7daec
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/busybox/busybox_aglcore.inc
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+SRC_URI:append = " file://enable-wget-https.cfg"
+
diff --git a/meta-agl/recipes-connectivity/busybox/files/enable-wget-https.cfg b/meta-agl-core/recipes-connectivity/busybox/files/enable-wget-https.cfg
index e92006bef..e92006bef 100644
--- a/meta-agl/recipes-connectivity/busybox/files/enable-wget-https.cfg
+++ b/meta-agl-core/recipes-connectivity/busybox/files/enable-wget-https.cfg
diff --git a/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Do-not-overwrite-CFLAGS.patch b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Do-not-overwrite-CFLAGS.patch
new file mode 100644
index 000000000..4a86e6c57
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Do-not-overwrite-CFLAGS.patch
@@ -0,0 +1,37 @@
+From 50ca6e010c3ca3f7cb06dfdf5dbdfaacd4f4749a Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Tue, 19 Jul 2022 23:28:21 +0200
+Subject: [PATCH] Do not overwrite CFLAGS
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ configure.ac | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7e3307f..c385bc0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,14 +24,14 @@ AC_PROG_CC
+ AC_PROG_CC_C99
+ AM_PROG_CC_C_O
+
+-CFLAGS=""
+-
+-AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
+- [disable code optimization through compiler]), [
+- if (test "${enableval}" = "no"); then
+- CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
+- fi
+-])
++#CFLAGS=""
++#
++#AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
++# [disable code optimization through compiler]), [
++# if (test "${enableval}" = "no"); then
++# CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
++# fi
++#])
+
+ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
+ [enable compiling with debugging information]), [
diff --git a/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Initialize-variables.patch b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Initialize-variables.patch
new file mode 100644
index 000000000..9a1078426
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/0001-Initialize-variables.patch
@@ -0,0 +1,39 @@
+From 0389a80796d3ae31d8f60659f0638660a00157b2 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Tue, 19 Jul 2022 23:58:05 +0200
+Subject: [PATCH] Initialize variables
+
+This fixes compiler warnings.
+
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ main.c | 2 +-
+ renderers.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/main.c b/main.c
+index f0354f9..1fa9ab1 100644
+--- a/main.c
++++ b/main.c
+@@ -159,7 +159,7 @@ static void report_error()
+ */
+ static void get_help_window()
+ {
+- char *msg;
++ char *msg = "";
+
+ if (win_help)
+ return;
+diff --git a/renderers.c b/renderers.c
+index c531a1e..d9d0414 100644
+--- a/renderers.c
++++ b/renderers.c
+@@ -153,7 +153,7 @@ static void renderers_technologies(struct json_object *jobj)
+ int i;
+ char *desc_base = "%-20s Powered %-5s Connected %-5s";
+ char desc_base_sub[30];
+- const char *k_name, *k_type, *k_powered, *k_connected;
++ const char *k_name = "" , *k_type = "" , *k_powered = "", *k_connected = "";
+ char *desc, *tech_short_name;
+ struct json_object *sub_array, *dbus_tech_name, *tech_dict;
+ struct userptr_data *data;
diff --git a/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/stdbool-fixes.patch b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/stdbool-fixes.patch
new file mode 100644
index 000000000..4e858e3c4
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses/stdbool-fixes.patch
@@ -0,0 +1,53 @@
+Replace some TRUE/FALSE usage with stdbool.h definitions
+
+Newer versions of json-c dropped its previous #defines for TRUE and
+FALSE, update affected code to use the stdbool.h boolean definitions
+to fix compilation.
+
+Upstream-Status: Pending
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+---
+diff --git a/json_regex.c b/json_regex.c
+index 2524c18..cdb6801 100644
+--- a/json_regex.c
++++ b/json_regex.c
+@@ -24,6 +24,7 @@
+ #endif
+
+ #include <json.h>
++#include <stdbool.h>
+
+ #include "json_regex.h"
+ #include "keys.h"
+@@ -64,7 +65,7 @@ void generate_trusted_json(void)
+ json_object_object_add(jregex_agent_response, "Username", json_object_new_string("^([[:print:]]*)$"));
+ json_object_object_add(jregex_agent_response, "Password", json_object_new_string("^([[:print:]]*)$"));
+
+- jregex_agent_retry_response = json_object_new_boolean(TRUE);
++ jregex_agent_retry_response = json_object_new_boolean(true);
+
+ // See commands.c __cmd_config_service for a better idea of the format.
+ jregex_config_service = json_object_new_object();
+@@ -94,7 +95,7 @@ void generate_trusted_json(void)
+ json_object_array_add(arr, json_object_new_string("^([[:print:]]*)$"));
+ json_object_object_add(tmp, key_serv_proxy_excludes, arr);
+ json_object_object_add(opt, key_serv_proxy_config, tmp);
+- json_object_object_add(opt, key_serv_autoconnect, json_object_new_boolean(TRUE));
++ json_object_object_add(opt, key_serv_autoconnect, json_object_new_boolean(true));
+ arr = json_object_new_array();
+ json_object_array_add(arr, json_object_new_string("^([[:print:]]*)$"));
+ json_object_object_add(opt, key_serv_domains_config, arr);
+diff --git a/json_utils.c b/json_utils.c
+index f66d08a..8f2c195 100644
+--- a/json_utils.c
++++ b/json_utils.c
+@@ -83,7 +83,7 @@ static bool json_match_object(struct json_object *jobj,
+ key_is_trusted = json_object_object_get_ex(jtrusted, key,
+ &tmp_trusted);
+
+- if (key_is_trusted == FALSE)
++ if (key_is_trusted == false)
+ return false;
+
+ res = __json_type_dispatch(val, tmp_trusted);
diff --git a/meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb
index 02afef75f..7b6d50531 100644
--- a/meta-agl/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb
+++ b/meta-agl-core/recipes-connectivity/connman-ncurses/connman-ncurses_git.bb
@@ -6,15 +6,19 @@ SECTION = "console/network"
DEPENDS = "dbus ncurses connman json-c"
-LICENSE = "GPLv2"
+LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=8c16666ae6c159876a0ba63099614381"
-SRC_URI = "git://gitlab.com/iotbzh/connman-json-client.git;protocol=https;rev=ad4261a2f87c914667b1f6841c913f6b08d373e2"
+SRC_URI = "git://gitlab.com/iotbzh/connman-json-client.git;protocol=https;branch=master \
+ file://stdbool-fixes.patch \
+ file://0001-Do-not-overwrite-CFLAGS.patch \
+ file://0001-Initialize-variables.patch \
+ "
+SRCREV = "2b0f93ec9518c978c04807fe52e95315d6d80e6b"
inherit autotools pkgconfig
-EXTRA_AUTORECONF += " -i"
-EXTRA_OECONF += " --disable-optimization --enable-debug"
+EXTRA_AUTORECONF += " -vfi"
S = "${WORKDIR}/git"
@@ -23,4 +27,4 @@ do_install () {
install -Dm755 connman_ncurses ${D}${bindir}
}
-FILES_${PN} = "${bindir}/connman_ncurses"
+FILES:${PN} = "${bindir}/connman_ncurses"
diff --git a/meta-agl-core/recipes-connectivity/connman/connman-conf.bbappend b/meta-agl-core/recipes-connectivity/connman/connman-conf.bbappend
new file mode 100644
index 000000000..bd6e7b75c
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman/connman-conf.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'connman-conf_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-connectivity/connman/connman-conf/main.conf b/meta-agl-core/recipes-connectivity/connman/connman-conf/main.conf
new file mode 100644
index 000000000..be9fd0ed2
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman/connman-conf/main.conf
@@ -0,0 +1,3 @@
+[General]
+FallbackTimeservers=pool.ntp.org
+NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,tap,ifb,meth
diff --git a/meta-agl-core/recipes-connectivity/connman/connman-conf_aglcore.inc b/meta-agl-core/recipes-connectivity/connman/connman-conf_aglcore.inc
new file mode 100644
index 000000000..30a250e1e
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman/connman-conf_aglcore.inc
@@ -0,0 +1,9 @@
+# Pick up our version of main.conf
+FILESEXTRAPATHS:prepend := "${THISDIR}/connman-conf:"
+
+# Upstream connman-conf only installs configuration for qemu targets
+# but we need it in all our BSP
+do_install:append() {
+ mkdir -p ${D}${sysconfdir}/connman
+ cp ${S}/main.conf ${D}${sysconfdir}/connman/main.conf
+}
diff --git a/meta-agl-core/recipes-connectivity/connman/connman/0001-disable-when-booting-over-nfs.patch b/meta-agl-core/recipes-connectivity/connman/connman/0001-disable-when-booting-over-nfs.patch
new file mode 100644
index 000000000..7cc92e2c4
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman/connman/0001-disable-when-booting-over-nfs.patch
@@ -0,0 +1,14 @@
+Exempt when nfs is in use.
+
+Upstream-Status: Pending
+
+--- connman-1.36.orig/src/connman.service.in 2019-02-18 18:02:07.034947373 -0500
++++ connman-1.36/src/connman.service.in 2019-02-18 18:07:24.689959219 -0500
+@@ -7,6 +7,7 @@
+ Before=network.target multi-user.target shutdown.target
+ Wants=network.target
+ Conflicts=systemd-resolved.service
++ConditionKernelCommandLine=!root=/dev/nfs
+
+ [Service]
+ Type=dbus
diff --git a/meta-agl-core/recipes-connectivity/connman/connman_%.bbappend b/meta-agl-core/recipes-connectivity/connman/connman_%.bbappend
new file mode 100644
index 000000000..8078f3d34
--- /dev/null
+++ b/meta-agl-core/recipes-connectivity/connman/connman_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'connman_aglcore.inc', '', d)}
diff --git a/meta-agl/recipes-connectivity/connman/connman_%.bbappend b/meta-agl-core/recipes-connectivity/connman/connman_aglcore.inc
index e41cbe954..e372e9186 100644
--- a/meta-agl/recipes-connectivity/connman/connman_%.bbappend
+++ b/meta-agl-core/recipes-connectivity/connman/connman_aglcore.inc
@@ -1,3 +1,3 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+FILESEXTRAPATHS:prepend := "${THISDIR}/connman:"
SRC_URI += "file://0001-disable-when-booting-over-nfs.patch"
diff --git a/meta-agl/recipes-connectivity/connman/.appends.core b/meta-agl-core/recipes-core/systemd/.appends.core
index e69de29bb..e69de29bb 100644
--- a/meta-agl/recipes-connectivity/connman/.appends.core
+++ b/meta-agl-core/recipes-core/systemd/.appends.core
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network
new file mode 100644
index 000000000..86042bd90
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can-fd.network
@@ -0,0 +1,12 @@
+[Match]
+Name=can*
+
+[CAN]
+BitRate=500K
+SamplePoint=75%
+DataBitRate=4M
+DataSamplePoint=80%
+FDMode=yes
+
+[Link]
+ActivationPolicy=up
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link
new file mode 100644
index 000000000..61fb4d575
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.link
@@ -0,0 +1,11 @@
+[Match]
+Type=can
+OriginalName=can*
+
+[Link]
+TransmitQueueLength=1000
+# Need to duplicate default configuration here, since only first
+# matching .link is applied
+NamePolicy=keep kernel database onboard slot path
+AlternativeNamesPolicy=database onboard slot path
+MACAddressPolicy=persistent
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
new file mode 100644
index 000000000..ae5514bca
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network
@@ -0,0 +1,6 @@
+[Match]
+Name=can*
+
+[CAN]
+BitRate=500K
+RestartSec=0.1
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network
new file mode 100644
index 000000000..cc33d86d6
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network
@@ -0,0 +1,5 @@
+[Match]
+Name=can*
+
+[CAN]
+RestartSec=0.1
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb
new file mode 100644
index 000000000..a23cd839a
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Systemd canbus configuration"
+DESCRIPTION = "Systemd may require slightly different configuration for \
+different machines. This injects configuration for the CAN bus."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PE = "1"
+
+SRC_URI = "\
+ file://canbus-can.network \
+ file://canbus-can-fd.network \
+ file://canbus-virtio.network \
+ file://canbus-can.link \
+"
+
+CANBUS_NETWORK_CONFIG ??= "canbus-can.network"
+CANBUS_NETWORK_CONFIG:virtio-all ?= "canbus-virtio.network"
+
+do_install() {
+ # Install CAN bus network configuration
+ install -d ${D}${nonarch_base_libdir}/systemd/network/
+ install -m 0644 ${WORKDIR}/${CANBUS_NETWORK_CONFIG} ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.network
+
+ # Install link configuration to bump queue size on physical CAN bus devices
+ install -m 0644 ${WORKDIR}/canbus-can.link ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.link
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES:${PN} = " \
+ ${nonarch_base_libdir}/systemd/network/ \
+"
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend b/meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc b/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc
new file mode 100644
index 000000000..a539d1826
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd-conf_aglcore.inc
@@ -0,0 +1,4 @@
+do_install:append() {
+ # Remove ethernet script deployed by upstream unconditionally (SPEC-3221)
+ rm -rf ${D}${systemd_unitdir}/network/80-wired.network || true
+} \ No newline at end of file
diff --git a/meta-agl/recipes-core/systemd/systemd/e2fsck.conf b/meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf
index b774f9ebf..b774f9ebf 100644
--- a/meta-agl/recipes-core/systemd/systemd/e2fsck.conf
+++ b/meta-agl-core/recipes-core/systemd/systemd/e2fsck.conf
diff --git a/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf b/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf
new file mode 100644
index 000000000..e5d4f4b28
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd/wait-disable.conf
@@ -0,0 +1,3 @@
+[Service]
+ExecStart=
+ExecStart=/usr/bin/true
diff --git a/meta-agl-core/recipes-core/systemd/systemd/wired.network b/meta-agl-core/recipes-core/systemd/systemd/wired.network
new file mode 100644
index 000000000..425610a3f
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd/wired.network
@@ -0,0 +1,8 @@
+[Match]
+Name=eth* en*
+KernelCommandLine=!nbdroot
+KernelCommandLine=!nfsroot
+KernelCommandLine=!ip
+
+[Network]
+DHCP=yes
diff --git a/meta-agl-core/recipes-core/systemd/systemd_%.bbappend b/meta-agl-core/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
new file mode 100644
index 000000000..9681329be
--- /dev/null
+++ b/meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
@@ -0,0 +1,36 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
+
+SRC_URI += "\
+ file://e2fsck.conf \
+ file://wait-disable.conf \
+ file://wired.network \
+"
+
+# Enable networkd/resolved support if using systemd for network management
+PACKAGECONFIG:append = " \
+ ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','networkd resolved','',d)} \
+ iptc \
+"
+
+# SPEC-737: connmand also has a NTP client which races with systemd-timesyncd
+PACKAGECONFIG:remove = "timesyncd"
+
+# Enable systemd-coredump when agl-devel is set on
+PACKAGECONFIG:append:agl-devel = " coredump"
+
+do_install:append() {
+ # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
+ install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}${sysconfdir}/e2fsck.conf
+
+ if [ "${VIRTUAL-RUNTIME_net_manager}" = "systemd" ]; then
+ # Install DHCP configuration for Ethernet adapters
+ install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
+ elif [ "${VIRTUAL-RUNTIME_net_manager}" = "connman" ]; then
+ # Disable systemd-networkd-wait-online by default
+ install -d ${D}${systemd_system_unitdir}/systemd-networkd-wait-online.service.d
+ install -m 0644 ${WORKDIR}/wait-disable.conf ${D}${systemd_system_unitdir}/systemd-networkd-wait-online.service.d/
+ fi
+}
+
+FILES:${PN} += "${sysconfdir}/e2fsck.conf "
+
diff --git a/meta-agl/recipes-core/dbus/.appends.core b/meta-agl-core/recipes-devtools/gdb/.appends.core
index e69de29bb..e69de29bb 100644
--- a/meta-agl/recipes-core/dbus/.appends.core
+++ b/meta-agl-core/recipes-devtools/gdb/.appends.core
diff --git a/meta-agl-core/recipes-devtools/gdb/gdb_%.bbappend b/meta-agl-core/recipes-devtools/gdb/gdb_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-devtools/gdb/gdb_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-devtools/gdb/gdb_aglcore.inc b/meta-agl-core/recipes-devtools/gdb/gdb_aglcore.inc
new file mode 100644
index 000000000..213542ec5
--- /dev/null
+++ b/meta-agl-core/recipes-devtools/gdb/gdb_aglcore.inc
@@ -0,0 +1 @@
+PACKAGECONFIG:remove = "readline"
diff --git a/meta-agl-core/recipes-devtools/qemu/qemu_%.bbappend b/meta-agl-core/recipes-devtools/qemu/qemu_%.bbappend
new file mode 100644
index 000000000..980783236
--- /dev/null
+++ b/meta-agl-core/recipes-devtools/qemu/qemu_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-devtools/qemu/qemu_aglcore.inc b/meta-agl-core/recipes-devtools/qemu/qemu_aglcore.inc
new file mode 100644
index 000000000..77d461a7f
--- /dev/null
+++ b/meta-agl-core/recipes-devtools/qemu/qemu_aglcore.inc
@@ -0,0 +1,5 @@
+PACKAGECONFIG:append = " \
+ aio \
+ libusb \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+"
diff --git a/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend
new file mode 100644
index 000000000..48e50788e
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'libsdl2_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc
new file mode 100644
index 000000000..7652e1843
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc
@@ -0,0 +1,3 @@
+# Make sure opengl is disabled, as using wayland implies gles2 in the
+# libsdl2 PACKAGECONFIG definitions.
+PACKAGECONFIG:remove = "opengl"
diff --git a/meta-agl-core/recipes-graphics/rba/librba_1.0.bb b/meta-agl-core/recipes-graphics/rba/librba_1.0.bb
new file mode 100644
index 000000000..e8b1e0dbc
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/rba/librba_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "RBA"
+DESCRIPTION = "Rule Based Arbitrator decides which of the content to display \
+when a large number of contents to be displayed on the cockpit display device \
+(CID, meter, HUD, etc.) occur simultaneously under a certain rule (arbitration)"
+
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=13afa517927767fe9b7a65818a02bd8f"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/rba;protocol=https;branch=master"
+SRCREV = "87c0278dfbcf0953330330c28a8d48636dd4df7e"
+
+S = "${WORKDIR}/git"
+
+inherit pkgconfig cmake
+
+FILES:${PN} = "${libdir}/"
+FILES:${PN}-dev = "${libdir}/pkgconfig/librba.pc \
+ ${includedir}/ \
+ "
+INSANE_SKIP:${PN} += "dev-so"
+INSANE_SKIP:${PN}-dev += "dev-elf"
diff --git a/meta-agl-core/recipes-graphics/rba/rba-config.bb b/meta-agl-core/recipes-graphics/rba/rba-config.bb
new file mode 100644
index 000000000..cbed9df0c
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/rba/rba-config.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Rule Based Arbitrator Model required for RBA policy compositor."
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+SRC_URI = "file://RBAModel.json"
+
+S = "${WORKDIR}"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install:append() {
+ install -d ${D}/${sysconfdir}/rba
+ install -m 0644 ${WORKDIR}/RBAModel.json ${D}/${sysconfdir}/rba
+}
diff --git a/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json b/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json
new file mode 100644
index 000000000..753a9ed86
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json
@@ -0,0 +1,320 @@
+{
+ "root":{
+ "model":"",
+ "template":"02.00.00",
+ "areas":[
+ {
+ "name":"ApplicationArea",
+ "visibility":-1,
+ "arbitrationPolicy":"DEFAULT",
+ "zorder":1,
+ "size":[
+ {
+ "name":"ApplicationSize",
+ "width":1080,
+ "height":1488
+ }
+ ]
+ },
+ {
+ "name":"ShortcutIconArea",
+ "visibility":-1,
+ "arbitrationPolicy":"DEFAULT",
+ "zorder":0,
+ "size":[
+ {
+ "name":"ShortcutIconSize",
+ "width":1080,
+ "height":216
+ }
+ ]
+ }
+ ],
+ "viewcontents":[
+ {
+ "name":"launcher",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"dashboard",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"hvac",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"mediaplayer",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"messaging",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"mixer",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"navigation",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"phone",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"poi",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"radio",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"settings",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"taskmanager",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ },
+ {
+ "name":"unknown_app",
+ "loserType":"NEVER_GIVEUP",
+ "size":[
+ {
+ "name":"ApplicationSize:Area",
+ "width":1080,
+ "height":1488
+ }
+ ],
+ "states":[
+ {
+ "name":"NORMAL",
+ "priority":10
+ }
+ ],
+ "allocatable":[
+ "ApplicationArea:Area"
+ ]
+ }
+ ],
+ "displays":[
+ {
+ "name":"SampleDisplay",
+ "size":{
+ "name":"FULLSCREEN",
+ "width":1080,
+ "height":1920
+ },
+ "PositionContainer":[
+ {
+ "x":0,
+ "y":0,
+ "basePoint":"LEFT_TOP",
+ "areaReference":"ShortcutIconArea"
+ },
+ {
+ "x":0,
+ "y":216,
+ "basePoint":"LEFT_TOP",
+ "areaReference":"ApplicationArea"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf b/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf
new file mode 100644
index 000000000..ee75c7335
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf
@@ -0,0 +1,43 @@
+##Generate a weston.ini file:
+
+To modify any of the default sections (core, shell), add a
+do_configure() function to your bbappend, using machine (e.g. h3ulcb)
+overrides (i.e. use the MACHINE name where "machine" is used below):
+
+'''
+do_configure:machine() {
+ echo repaint-window=34 >> ${WORKDIR}/core.cfg
+
+ echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
+ echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg
+}
+'''
+or:
+'''
+do_configure:machine() {
+ sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg
+}
+'''
+
+To add new non-display sections, just list them in SRC_URI and WESTON_FRAGMENTS:
+'''
+FILESEXTRAPATHS:prepend:machine := "${THISDIR}/${PN}:"
+
+SRC_URI:append:machine = " file://foo.cfg"
+WESTON_FRAGMENTS:append:machine = " foo"
+
+'''
+
+To change the display, for example from the default assumption of an
+HDMI-1-A connected screen that needs to be rotated 270 degrees to one
+that is rotated 90 degrees, redefine the WESTON_DISPLAYS variable:
+
+'''
+WESTON_DISPLAYS:machine = "hdmi-a-1-90"
+'''
+
+Note that the weston-ini-conf recipe automatically generates a landscape
+orientation version of weston.ini by replacing 90/270 degree rotation
+fragments for HDMI-A-1 and the virtual output into 180 and 0 degrees,
+respectively. This landscape configuration can be used in an image by
+pulling in weston-ini-conf-landscape instead of weston-ini-conf.
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb
new file mode 100644
index 000000000..d8baf91f9
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb
@@ -0,0 +1,61 @@
+SUMMARY = "Startup systemd unit for the AGL Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit systemd
+
+# Reuse include file from upstream weston since we have the same requirements
+require recipes-graphics/wayland/required-distro-features.inc
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "file://agl-compositor.service \
+ file://agl-compositor.socket \
+ file://agl-compositor-autologin \
+ file://agl-compositor.conf.in \
+"
+
+S = "${WORKDIR}"
+
+AGL_COMPOSITOR_ARGS ?= " --config ${sysconfdir}/xdg/weston/weston.ini --idle-time=0"
+AGL_COMPOSITOR_USE_PIXMAN ??= "0"
+
+AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("DISTRO_FEATURES", "agl-devel", " --debug", "",d)}"
+AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("WESTON_USE_PIXMAN", "1", " --use-pixman", "",d)}"
+
+do_install() {
+ # Install systemd service
+ install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_system_unitdir}/agl-compositor.service
+ install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_system_unitdir}/agl-compositor.socket
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -p -m0644 ${WORKDIR}/agl-compositor-autologin ${D}${sysconfdir}/pam.d/agl-compositor-autologin
+ fi
+
+ # Install systemd service drop-in with extra configuration
+ files=agl-compositor.conf.in
+ for f in ${files}; do
+ g=${f%.in}
+ if [ "${f}" != "${g}" ]; then
+ sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \
+ ${WORKDIR}/${f} > ${WORKDIR}/${g}
+ fi
+ done
+ install -d ${D}${systemd_system_unitdir}/agl-compositor.service.d
+ install -m644 ${WORKDIR}/agl-compositor.conf ${D}/${systemd_system_unitdir}/agl-compositor.service.d/agl-compositor.conf
+}
+
+FILES:${PN} += "\
+ ${systemd_system_unitdir}/agl-compositor.service \
+ ${systemd_system_unitdir}/agl-compositor.socket \
+ ${systemd_system_unitdir}/agl-compositor.service.d \
+ ${sysconfdir}/default/agl-compositor \
+ ${sysconfdir}/pam.d/ \
+ "
+
+CONFFILES:${PN} += "${sysconfdir}/default/agl-compositor"
+
+RDEPENDS:${PN} = "agl-users agl-compositor weston-ini"
+
+RCONFLICTS:${PN} = "weston-init"
+
+SYSTEMD_SERVICE:${PN} = "agl-compositor.service agl-compositor.socket"
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin
new file mode 100644
index 000000000..f6e6d106d
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin
@@ -0,0 +1,11 @@
+auth required pam_nologin.so
+auth required pam_unix.so try_first_pass nullok
+
+account required pam_nologin.so
+account required pam_unix.so
+
+session required pam_env.so
+session required pam_unix.so
+-session optional pam_systemd.so type=wayland class=user desktop=weston
+-session optional pam_loginuid.so
+
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in
new file mode 100644
index 000000000..2918c410c
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in
@@ -0,0 +1,3 @@
+[Service]
+ExecStart=
+ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service
new file mode 100644
index 000000000..4ee14de27
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service
@@ -0,0 +1,72 @@
+# This is a system unit for launching AGL compositor with auto-login as the
+# user configured here.
+#
+# AGL compositor and Weston must be built with systemd support, and your
+# weston.ini must load the plugin systemd-notify.so.
+#
+# Attention:
+# If you will add new tty dependency setting, you need to update
+# agl-compositor-guest.conf.
+[Unit]
+Description=AGL compositor
+Documentation=man:weston(1) man:weston.ini(5)
+Documentation=http://wayland.freedesktop.org/
+
+# Make sure we are started after logins are permitted.
+Requires=systemd-user-sessions.service
+After=systemd-user-sessions.service
+
+# D-Bus is necessary for contacting logind. Logind is required.
+Wants=dbus.socket
+After=dbus.socket
+
+# Ensure the socket is present
+Requires=agl-compositor.socket
+
+# Since we are part of the graphical session, make sure we are started before
+# it is complete.
+Before=graphical.target
+
+# Prevent starting on systems without virtual consoles, Weston requires one
+# for now.
+ConditionPathExists=/dev/tty0
+
+[Service]
+# Requires systemd-notify.so Weston plugin.
+Type=notify
+EnvironmentFile=-/etc/default/agl-compositor
+ExecStart=/usr/bin/agl-compositor --modules=systemd-notify.so
+
+# Watchdog setup
+TimeoutStartSec=60
+WatchdogSec=20
+
+# The user to run as.
+User=agl-driver
+Group=agl-driver
+
+# Make sure the working directory is the users home directory
+WorkingDirectory=/home/agl-driver
+
+# Set up a full user session for the user
+PAMName=agl-compositor-autologin
+
+# A virtual terminal is needed.
+TTYPath=/dev/tty7
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+
+# Fail to start if not controlling the tty.
+StandardInput=tty-fail
+StandardOutput=journal
+StandardError=journal
+
+# Log this user with utmp, letting it show up with commands 'w' and 'who'.
+UtmpIdentifier=tty7
+UtmpMode=user
+
+[Install]
+# Note: If you only want weston to start on-demand, remove this line with a
+# service drop file
+WantedBy=graphical.target
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
new file mode 100644
index 000000000..ef9769ff7
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
@@ -0,0 +1,10 @@
+#
+# Weston must be built with systemd support, and your weston.ini must load
+# the plugin systemd-notify.so.
+
+[Unit]
+Description=agl-compositor, a Wayland compositor, as a systemd user service
+Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/
+
+[Socket]
+ListenStream=%t/wayland-0
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb
new file mode 100644
index 000000000..41240309b
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Reference Wayland compositor for AGL"
+DESCRIPTION = "The AGL compositor is a reference Wayland server for Automotive \
+Grade Linux, using libweston as a base to provide a graphical environment for \
+the automotive environment."
+
+HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/q/project:src%252Fagl-compositor"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fac6abe0003c4d142ff8fa1f18316df0"
+
+DEPENDS = "wayland wayland-protocols wayland-native weston"
+
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-compositor.git;protocol=https;branch=${AGL_BRANCH}"
+SRCREV = "18e93caca8ad397d504215d673765871b2c88f25"
+AGL_BRANCH:aglnext = "next"
+SRCREV:aglnext = "${AUTOREV}"
+
+AGL_COMPOSITOR_VERSION = "0.0.24"
+
+PV = "${AGL_COMPOSITOR_VERSION}+git${SRCPV}"
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[policy-rba] = "-Dpolicy-default=rba,,librba,librba rba-config"
+PACKAGECONFIG[policy-deny-all] = "-Dpolicy-default=deny-all,,"
+PACKAGECONFIG[grpc-proxy] = "-Dgrpc-proxy=true,-Dgrpc-proxy=false,grpc grpc-native,grpc agl-shell-grpc-server"
+
+inherit meson pkgconfig python3native
+
+# Reuse include file from upstream weston since we have the same requirements
+require recipes-graphics/wayland/required-distro-features.inc
+
+PACKAGES =+ "agl-shell-grpc-server"
+
+LDFLAGS:append:riscv64 = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
+
+FILES:${PN} = " \
+ ${bindir}/agl-compositor \
+ ${bindir}/agl-screenshooter \
+ ${libdir}/agl-compositor/libexec_compositor.so.0 \
+ ${libdir}/agl-compositor/libexec_compositor.so.${AGL_COMPOSITOR_VERSION} \
+"
+
+FILES:agl-shell-grpc-server = " \
+ ${libdir}/agl-compositor/agl-shell-grpc-server \
+"
+
+RDEPENDS:${PN} += " \
+ agl-compositor-init \
+ xkeyboard-config \
+"
+
+FILES:${PN}-dev += " \
+ ${datadir}/agl-compositor/protocols/agl-shell.xml \
+ ${datadir}/agl-compositor/protocols/agl-shell-desktop.xml \
+ ${libdir}/agl-compositor/libexec_compositor.so \
+"
diff --git a/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb b/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb
new file mode 100644
index 000000000..c0c31e029
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Minimal agl-shell Wayland protocol client"
+
+HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/q/project:src%252Fnative-shell-client"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3b90ee643ce04400848a8f0deb492a4a"
+
+DEPENDS = "wayland wayland-protocols wayland-native agl-compositor"
+
+SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/native-shell-client.git;protocol=https;branch=${AGL_BRANCH}"
+SRCREV = "099e06f532eff7c56bf00eb58420f14c95a8e554"
+
+PV = "0.0.1+git${SRCPV}"
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb
new file mode 100644
index 000000000..0611ec5b4
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb
@@ -0,0 +1,156 @@
+SUMMARY = "Configuration file for the Weston and AGL Wayland compositors"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = " \
+ file://core.cfg \
+ file://shell.cfg \
+ file://hdmi-a-1-0.cfg \
+ file://hdmi-a-1-90.cfg \
+ file://hdmi-a-1-180.cfg \
+ file://hdmi-a-1-270.cfg \
+ file://hdmi-a-2-0.cfg \
+ file://hdmi-a-2-90.cfg \
+ file://hdmi-a-2-180.cfg \
+ file://hdmi-a-2-270.cfg \
+ file://remote-output.cfg.in \
+ file://virtual-0.cfg \
+ file://virtual-90.cfg \
+ file://virtual-180.cfg \
+ file://virtual-270.cfg \
+ file://grpc-proxy.cfg \
+"
+
+S = "${WORKDIR}"
+
+inherit update-alternatives
+
+# Default primary display/orientation fragment
+WESTON_DISPLAYS ?= "hdmi-a-1-90"
+
+# Configuration fragments to use in weston.ini.*
+# Note that some may be replaced/removed when building the landscape
+# configuration.
+WESTON_FRAGMENTS = "core shell grpc-proxy ${WESTON_DISPLAYS}"
+
+# On-target weston.ini directory
+weston_ini_dir = "${sysconfdir}/xdg/weston"
+
+# Options for the user to change in local.conf
+# e.g. REMOTING_OUTPUT_MODE = "1080x1488"
+REMOTING_OUTPUT_MODE ??= "640x720@30"
+REMOTING_OUTPUT_HOST ??= "192.168.10.3"
+REMOTING_OUTPUT_PORT ??= "5005"
+
+do_configure() {
+ sed -e "s#host=.*#host=${REMOTING_OUTPUT_HOST}#" \
+ -e "s#port=.*#port=${REMOTING_OUTPUT_PORT}#" \
+ ${WORKDIR}/remote-output.cfg.in > ${WORKDIR}/remote-output.cfg
+}
+
+do_compile() {
+ # Put all of our cfg files together for a default portrait
+ # orientation configuration
+ rm -f ${WORKDIR}/weston.ini.default
+ for F in ${WESTON_FRAGMENTS}; do
+ cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.default
+ echo >> ${WORKDIR}/weston.ini.default
+ done
+ sed -i -e '$ d' ${WORKDIR}/weston.ini.default
+
+ cat ${WORKDIR}/weston.ini.default > ${WORKDIR}/weston.ini.default-no-activate
+
+ # Do it again, but filter fragments to configure for landscape
+ # and a corresponding landscape-inverted that is 180 degrees
+ # rotated.
+ rm -f ${WORKDIR}/weston.ini.landscape
+ rm -f ${WORKDIR}/weston.ini.landscape-inverted
+ for F in ${WESTON_FRAGMENTS}; do
+ INVF=$F
+ if echo $F | grep '^hdmi-a-1-\(90\|270\)$'; then
+ F="hdmi-a-1-0"
+ INVF="hdmi-a-1-180"
+ elif echo $F | grep '^hdmi-a-2-\(90\|270\)$'; then
+ F="hdmi-a-2-0"
+ INVF="hdmi-a-2-180"
+ elif echo $F | grep '^virtual-90$'; then
+ F="virtual-0"
+ INVF="virtual-180"
+ fi
+ cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.landscape
+ cat ${WORKDIR}/${INVF}.cfg >> ${WORKDIR}/weston.ini.landscape-inverted
+ echo >> ${WORKDIR}/weston.ini.landscape
+ echo >> ${WORKDIR}/weston.ini.landscape-inverted
+ done
+ sed -i -e '$ d' ${WORKDIR}/weston.ini.landscape
+ sed -i -e '$ d' ${WORKDIR}/weston.ini.landscape-inverted
+
+ cat ${WORKDIR}/weston.ini.landscape > ${WORKDIR}/weston.ini.landscape-no-activate
+}
+
+do_install:append() {
+ install -d ${D}${weston_ini_dir}
+ install -m 0644 ${WORKDIR}/weston.ini.default ${D}${weston_ini_dir}/
+ install -m 0644 ${WORKDIR}/weston.ini.default-no-activate ${D}${weston_ini_dir}/
+ install -m 0644 ${WORKDIR}/weston.ini.landscape-no-activate ${D}${weston_ini_dir}/
+ install -m 0644 ${WORKDIR}/weston.ini.landscape ${D}${weston_ini_dir}/
+ install -m 0644 ${WORKDIR}/weston.ini.landscape-inverted ${D}${weston_ini_dir}/
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Use the alternative mechanism to handle multiple packages providing
+# weston.ini. This seems simpler than other possible approaches.
+# Note that for now the generated packages are being marked as
+# incompatible with each other for simplicity, that can be changed if
+# a usecase where switching between alternatives at runtime is desirable
+# appears.
+
+ALTERNATIVE_LINK_NAME[weston.ini] = "${weston_ini_dir}/weston.ini"
+
+RPROVIDES:${PN} = "weston-ini"
+RCONFLICTS:${PN} = "${PN}-landscape"
+ALTERNATIVE:${PN} = "weston.ini"
+ALTERNATIVE_TARGET_${PN} = "${weston_ini_dir}/weston.ini.default"
+
+PACKAGE_BEFORE_PN += "${PN}-landscape"
+
+FILES:${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape"
+
+RPROVIDES:${PN}-landscape = "weston-ini"
+RCONFLICTS:${PN}-landscape = "${PN}"
+ALTERNATIVE:${PN}-landscape = "weston.ini"
+ALTERNATIVE_TARGET_${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape"
+
+PACKAGE_BEFORE_PN += "${PN}-landscape-inverted"
+
+FILES:${PN}-landscape-inverted = "${weston_ini_dir}/weston.ini.landscape-inverted"
+
+RPROVIDES:${PN}-landscape-inverted = "weston-ini"
+RCONFLICTS:${PN}-landscape-inverted = "${PN}"
+ALTERNATIVE:${PN}-landscape-inverted = "weston.ini"
+ALTERNATIVE_TARGET_${PN}-landscape-inverted = "${weston_ini_dir}/weston.ini.landscape-inverted"
+
+# no activation by default
+PACKAGE_BEFORE_PN += "${PN}-no-activate"
+
+FILES:${PN}-no-activate = "${weston_ini_dir}/weston.ini.default-no-activate"
+
+RPROVIDES:${PN}-no-activate = "weston-ini"
+RCONFLICTS:${PN}-no-activate = "${PN}"
+ALTERNATIVE:${PN}-no-activate = "weston.ini"
+ALTERNATIVE_TARGET_${PN}-no-activate = "${weston_ini_dir}/weston.ini.default-no-activate"
+
+# landscape, no activation by default
+PACKAGE_BEFORE_PN += "${PN}-landscape-no-activate"
+
+FILES:${PN}-landscape-no-activate = "${weston_ini_dir}/weston.ini.landscape-no-activate"
+
+RPROVIDES:${PN}-landscape-no-activate = "weston-ini"
+RCONFLICTS:${PN}-landscape-no-activate = "${PN}"
+ALTERNATIVE:${PN}-landscape-no-activate = "weston.ini"
+ALTERNATIVE_TARGET_${PN}-landscape-no-activate = "${weston_ini_dir}/weston.ini.landscape-no-activate"
+
+# This is a settings-only package, we do not need a development package
+# (and its fixed dependency to ${PN} being installed)
+PACKAGES:remove = "${PN}-dev ${PN}-staticdev"
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 000000000..746bde339
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+WESTON_DISPLAYS:append = "${@bb.utils.contains("DISTRO_FEATURES", "weston-remoting", " remote-output", "", d)}"
+
+# For virtual machines and intel-corei7-64 we want to support both the HDMI-A-1
+# and Virtual-1 outputs. This allows us to run virtual images on real hardware
+# and vice versa.
+WESTON_DISPLAYS:append:qemuall = " virtual-90"
+WESTON_DISPLAYS:append:intel-corei7-64 = " virtual-90"
+WESTON_DISPLAYS:append:virtio-aarch64 = " virtual-90"
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg
new file mode 100644
index 000000000..28f90752d
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg
@@ -0,0 +1,6 @@
+[core]
+backend=drm-backend.so
+require-input=false
+idle-time=0
+modules=systemd-notify.so
+activate-by-default=false
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg
new file mode 100644
index 000000000..14805b969
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg
@@ -0,0 +1,4 @@
+
+[shell-client-ext]
+command=/usr/lib/agl-compositor/agl-shell-grpc-server
+
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg
new file mode 100644
index 000000000..f82570790
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg
@@ -0,0 +1,3 @@
+# A display is connected to HDMI-A-1
+[output]
+name=HDMI-A-1
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg
new file mode 100644
index 000000000..b6f4329ef
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg
@@ -0,0 +1,4 @@
+# A display is connected to HDMI-A-1
+[output]
+name=HDMI-A-1
+transform=rotate-180
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg
new file mode 100644
index 000000000..187f2c7bd
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 270 degrees
+# to have a proper orientation of the homescreen. For example the various sizes
+# of the GeChic display or the Dell display.
+[output]
+name=HDMI-A-1
+transform=rotate-270
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg
new file mode 100644
index 000000000..5ee9c1904
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-1
+transform=rotate-90
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg
new file mode 100644
index 000000000..4d5d51c03
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg
@@ -0,0 +1,5 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-2
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg
new file mode 100644
index 000000000..ffdc5fe60
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-2
+transform=rotate-180
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg
new file mode 100644
index 000000000..76fc77acd
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-2
+transform=rotate-270
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg
new file mode 100644
index 000000000..9172a1c6a
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg
@@ -0,0 +1,6 @@
+# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees
+# to have a proper orientation of the homescreen. For example, the 'eGalax'
+# display used in some instances.
+[output]
+name=HDMI-A-2
+transform=rotate-90
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg.in b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg.in
new file mode 100644
index 000000000..940cbdd0c
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/remote-output.cfg.in
@@ -0,0 +1,5 @@
+[remote-output]
+name=remote-1
+mode=640x720@30
+host=192.168.10.3
+port=5005
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg
new file mode 100644
index 000000000..8d16ba5d7
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg
@@ -0,0 +1,3 @@
+[shell]
+locking=false
+panel-position=none
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg
new file mode 100644
index 000000000..d69253639
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg
@@ -0,0 +1,3 @@
+[output]
+name=Virtual-1
+mode=1920x1080
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg
new file mode 100644
index 000000000..0363b6339
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg
@@ -0,0 +1,4 @@
+[output]
+name=Virtual-1
+mode=1920x1080
+transform=rotate-180
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg
new file mode 100644
index 000000000..c3f72f495
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg
@@ -0,0 +1,4 @@
+[output]
+name=Virtual-1
+mode=1920x1080
+transform=rotate-270
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg
new file mode 100644
index 000000000..96d9c3a04
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg
@@ -0,0 +1,4 @@
+[output]
+name=Virtual-1
+mode=1920x1080
+transform=rotate-90
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 000000000..c09d7ccd3
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston-init_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc b/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc
new file mode 100644
index 000000000..896f1eafb
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc
@@ -0,0 +1,8 @@
+SYSTEMD_AUTO_ENABLE = "enable"
+
+do_install:append() {
+ # Remove upstream weston.ini to avoid conflict with weston-ini-conf package
+ rm -f ${D}${sysconfdir}/xdg/weston/weston.ini
+}
+
+RDEPENDS:${PN} += "weston-ini"
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch
new file mode 100644
index 000000000..202333a5e
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch
@@ -0,0 +1,30 @@
+From 6a847464de9e773f6d1490916d0df48a0f90eeba Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Thu, 5 Oct 2023 16:27:34 +0300
+Subject: [PATCH] clients: Handle missing pointer_surface is there's no pointer
+ event
+
+Upstream-Status: Pending
+
+Bug-AGL: SPEC-4916
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ clients/window.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/clients/window.c b/clients/window.c
+index 30f6410..882e9d5 100644
+--- a/clients/window.c
++++ b/clients/window.c
+@@ -3818,7 +3818,7 @@ pointer_surface_frame_callback(void *data, struct wl_callback *callback,
+ force_frame = false;
+ }
+
+- if (!input->pointer)
++ if (!input->pointer || !input->pointer_surface)
+ return;
+
+ if (input_set_pointer_special(input))
+--
+2.35.1
+
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch
new file mode 100644
index 000000000..19eadcf7f
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Add-paint-node-destruction-into-weston_lay.patch
@@ -0,0 +1,60 @@
+From cfde02d47a503cbfd0629bbfe0cb776686af8a91 Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Tue, 9 Apr 2024 18:34:22 +0300
+Subject: [PATCH] libweston: Add paint node destruction into
+ weston_layer_entry_remove()
+
+This prevents a potential crash where users of
+weston_layer_entry_insert/layer_entry_remove() would see when moving
+views into a NULL layer (effectively unmapping the surface/view).
+
+Users that have migrated to the weston_view_move_to_layer() are immune
+to this issue because that takes care paint node destruction.
+
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ libweston/compositor.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/libweston/compositor.c b/libweston/compositor.c
+index bb29b83b5..ea257bb90 100644
+--- a/libweston/compositor.c
++++ b/libweston/compositor.c
+@@ -3980,17 +3980,10 @@ weston_view_move_to_layer(struct weston_view *view,
+ struct weston_layer_entry *layer)
+ {
+ bool was_mapped = view->is_mapped;
+- struct weston_paint_node *pnode, *pntmp;
+
+ if (layer == &view->layer_link)
+ return;
+
+- /* Remove all paint nodes because we have no idea what a layer change
+- * does to view visibility on any output.
+- */
+- wl_list_for_each_safe(pnode, pntmp, &view->paint_node_list, view_link)
+- weston_paint_node_destroy(pnode);
+-
+ view->surface->compositor->view_list_needs_rebuild = true;
+
+ /* Damage the view's old region, and remove it from the layer. */
+@@ -4020,6 +4013,16 @@ weston_view_move_to_layer(struct weston_view *view,
+ WL_EXPORT void
+ weston_layer_entry_remove(struct weston_layer_entry *entry)
+ {
++ struct weston_paint_node *pnode, *pntmp;
++ struct weston_view *view;
++
++ /* Remove all paint nodes because we have no idea what a layer change
++ * does to view visibility on any output.
++ */
++ view = container_of(entry, struct weston_view, layer_link);
++ wl_list_for_each_safe(pnode, pntmp, &view->paint_node_list, view_link)
++ weston_paint_node_destroy(pnode);
++
+ wl_list_remove(&entry->link);
+ wl_list_init(&entry->link);
+ entry->layer = NULL;
+--
+2.43.0
+
diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend b/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend
new file mode 100644
index 000000000..87cad12a0
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston_13.0_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc b/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc
new file mode 100644
index 000000000..843a068b4
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc
@@ -0,0 +1,29 @@
+FILESEXTRAPATHS:append := ":${THISDIR}/weston"
+
+PACKAGECONFIG:append = "${@bb.utils.contains('DISTRO_FEATURES', 'weston-remoting', ' remoting', '', d)}"
+
+SRC_URI:append = " \
+ file://0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch \
+ file://0001-libweston-Add-paint-node-destruction-into-weston_lay.patch \
+"
+
+
+# Split weston-terminal out of the main package to allow installing it
+# separately for use with other compositors. The icons, etc. that end
+# up in /usr/share/weston are also split out into a separate package
+# since they are required for weston-terminal and some of the programs
+# packaged in weston-examples in addition to ivi-shell in the main
+# package.
+
+PACKAGE_BEFORE_PN += "${PN}-data ${PN}-terminal"
+
+FILES:${PN}-data = "${datadir}/weston"
+
+FILES:${PN}-terminal = "${bindir}/weston-terminal"
+RDEPENDS:${PN}-terminal += "weston-data liberation-fonts"
+
+RDEPENDS:${PN}-examples += "weston-data"
+
+FILES:${PN}:remove = "weston-terminal"
+RDEPENDS:${PN}:remove = "liberation-fonts"
+RDEPENDS:${PN} += "weston-data weston-terminal"
diff --git a/meta-agl-core/recipes-kernel/linux/kernel-devsrc.bbappend b/meta-agl-core/recipes-kernel/linux/kernel-devsrc.bbappend
new file mode 100644
index 000000000..3d5903d85
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/kernel-devsrc.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)}
diff --git a/meta-agl-core/recipes-kernel/linux/kernel-devsrc_agl.inc b/meta-agl-core/recipes-kernel/linux/kernel-devsrc_agl.inc
new file mode 100644
index 000000000..39289fef7
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/kernel-devsrc_agl.inc
@@ -0,0 +1,6 @@
+# fix for kernel using hardcoded awk while our filesystem only provides gawk
+do_install:append() {
+ # enforce all scripts to use /usr/bin/awk . This fixes the rpm dependency failure on install of kernel-devsrc
+ cd ${D} || true
+ ( for i in `grep -srI "\!/bin/awk" | cut -d":" -f1 ` ; do sed -i -e "s#\!/bin/awk#\!/usr/bin/env awk#g" $i ; done ) || true
+} \ No newline at end of file
diff --git a/meta-agl-core/recipes-kernel/linux/linux-4.14/net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch b/meta-agl-core/recipes-kernel/linux/linux-4.14/net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch
new file mode 100644
index 000000000..7c34fb306
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-4.14/net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch
@@ -0,0 +1,25 @@
+From 17d0075d95b5087d5df553444cca390fa479bad9 Mon Sep 17 00:00:00 2001
+From: Matt Ranostay <matt.ranostay@konsulko.com>
+Date: Tue, 10 Mar 2020 22:27:28 -0700
+Subject: [PATCH] net: sch_generic: add if_afp.h header to get ARPHRD_CAN macro
+
+Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
+---
+ net/sched/sch_generic.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
+index bf8c81e07c70..1845ef8c7dbd 100644
+--- a/net/sched/sch_generic.c
++++ b/net/sched/sch_generic.c
+@@ -25,6 +25,7 @@
+ #include <linux/rcupdate.h>
+ #include <linux/list.h>
+ #include <linux/slab.h>
++#include <linux/if_arp.h>
+ #include <linux/if_vlan.h>
+ #include <net/sch_generic.h>
+ #include <net/pkt_sched.h>
+--
+2.25.0
+
diff --git a/meta-agl-core/recipes-kernel/linux/linux-agl-4.14.inc b/meta-agl-core/recipes-kernel/linux/linux-agl-4.14.inc
new file mode 100644
index 000000000..9ab3d34af
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-agl-4.14.inc
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-4.14:"
+
+SRC_URI:append = "\
+ file://net-sch_generic-add-if_afp.h-header-to-get-ARPHRD_CA.patch \
+ file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch \
+ "
diff --git a/meta-agl-core/recipes-kernel/linux/linux-agl-4.19.inc b/meta-agl-core/recipes-kernel/linux/linux-agl-4.19.inc
new file mode 100644
index 000000000..1ea476426
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-agl-4.19.inc
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-4.19:"
+
+SRC_URI:append = "\
+ file://net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch \
+ "
diff --git a/meta-agl-core/recipes-kernel/linux/linux-agl-config.inc b/meta-agl-core/recipes-kernel/linux/linux-agl-config.inc
new file mode 100644
index 000000000..4799a6180
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-agl-config.inc
@@ -0,0 +1,94 @@
+# Common include file that defines AGL's variables for kernel
+# configuration.
+#
+# Can be included directly for kernel.bbclass based recipes that
+# use their own config fragment merging scheme, or use the
+# KERNEL_CONFIG_FRAGMENTS variable (e.g. meta-ti, meta-qcom).
+#
+# Fragments should be added to AGL_KCONFIG_FRAGMENTS as just the
+# .cfg filename with +=. Appending to AGL_KCONFIG_FRAGMENTS (i.e.
+# using _append) should only be done for:
+# - Specific AGL features that set an override in their feature
+# template, e.g. agl-netboot.
+# - To add essential configuration for core target machines like
+# qemu. Note that appending fragments directly to SRC_URI
+# would work for qemu targets since they use linux-yocto, but
+# the AGL_KCONFIG_FRAGMENTS mechanism is recommended for
+# consistency and to preserve the option of disabling all AGL
+# additions by overriding AGL_KERNEL_SRC.
+#
+# In general, care shoud be taken to preserve the ability to set
+# AGL_KCONFIG_FRAGMENTS to "" to disable non-essential (from a build
+# perspective) AGL additions.
+#
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux:"
+
+# NOTE: AGL_KERNEL_SRC is explicitly intended as an intermediate variable
+# that can be used as a last resort to completely disable all AGL
+# additions, modifying or appending it is not recommended.
+AGL_KERNEL_SRC ?= "${@' '.join(['file://' + x for x in d.getVar('AGL_KCONFIG_FRAGMENTS').split()])}"
+
+SRC_URI:append = " ${AGL_KERNEL_SRC}"
+
+# For meta-ti and meta-qcom
+KERNEL_CONFIG_FRAGMENTS ?= "${@' '.join(['${WORKDIR}/' + x for x in d.getVar('AGL_KCONFIG_FRAGMENTS').split()])}"
+
+# Extra configuration options for the AGL kernel
+AGL_KCONFIG_FRAGMENTS += " \
+ can-bus.cfg \
+ fanotify.cfg \
+ overlayfs.cfg \
+ audit.cfg \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux.cfg', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-required.cfg', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-sandbox.cfg', '', d)} \
+ lttng.cfg \
+"
+
+AGL_KCONFIG_FRAGMENTS += " ${@bb.utils.contains('AGL_XEN_GUEST_WANTED','1','xen_domu.cfg','',d)}"
+
+# Base ALSA support and other sound related configuration
+AGL_KCONFIG_FRAGMENTS += "sound.cfg"
+
+# Enable support for SystemTap
+AGL_KCONFIG_FRAGMENTS += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'systemtap.cfg', '', d)}"
+
+#
+# Feature override and qemu specific appends:
+#
+
+# Enable required features for the agl-netboot feature
+AGL_KCONFIG_FRAGMENTS:append:netboot = " \
+ nbd.cfg \
+ ramdisk.cfg \
+"
+
+# Add hda audio and required virtio device support for qemu
+AGL_KCONFIG_FRAGMENTS:append:qemuall = " \
+ sound-hda.cfg \
+ qemu-virtio.cfg \
+ qemu-drm.cfg \
+"
+
+AGL_KCONFIG_FRAGMENTS:append:virtio-all = " \
+ sound-hda.cfg \
+"
+
+# Configuration for using the ARM virt machine (and not versatilepb)
+AGL_KCONFIG_FRAGMENTS:append:qemuarm = " qemuarm.cfg"
+
+# Additional drivers for virtual machines
+# OVERRIDES save us some c'n'p below ...
+OVERRIDES:prepend:qemux86 = "virtualmachine:"
+OVERRIDES:prepend:qemux86-64 = "virtualmachine:"
+AGL_KCONFIG_FRAGMENTS:append:virtualmachine = " vbox-vmware-sata.cfg"
+
+# Extra configuration for using qemux86-64 image on physical hardware
+AGL_KCONFIG_FRAGMENTS:append:qemux86-64 = " \
+ x86-extra-graphic-devices.cfg \
+ x86-net-devices.cfg \
+ x86-security-tpm.cfg \
+ x86-usb-devices.cfg \
+ x86-upsquare.cfg \
+"
diff --git a/meta-agl-core/recipes-kernel/linux/linux-agl.inc b/meta-agl-core/recipes-kernel/linux/linux-agl.inc
new file mode 100644
index 000000000..c318716fe
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-agl.inc
@@ -0,0 +1,24 @@
+# Include file intended for kernel.bbclass based recipes that do not
+# have their own config fragment merging scheme.
+
+DEPENDS += "kern-tools-native"
+
+include linux-agl-config.inc
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ if s.endswith('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
+do_configure:append () {
+ if [ -n "${AGL_KCONFIG_FRAGMENTS}" ]; then
+ [ ! -f .config ] && cp -a ${WORKDIR}/defconfig .config
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+ yes '' | make oldconfig
+ fi
+}
diff --git a/meta-agl-core/recipes-kernel/linux/linux-yocto-agl.inc b/meta-agl-core/recipes-kernel/linux/linux-yocto-agl.inc
new file mode 100644
index 000000000..8628731cb
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-yocto-agl.inc
@@ -0,0 +1,12 @@
+# Include file intended for kernel-yocto.bbclass based recipes.
+
+include linux-agl-config.inc
+
+# For qemuarm, build a generic v7 kernel instead of the arm926j one that
+# upstream qemuarm defaults to.
+KBUILD_DEFCONFIG:qemuarm = "multi_v7_defconfig"
+
+# Use alldefconfig for the qemu targets, but let other kernel-yocto
+# based BSPs use their own defaults (note that linux-renesas and
+# linux-raspberrypi also default to alldefconfig).
+KCONFIG_MODE:qemuall = "--alldefconfig"
diff --git a/meta-agl-core/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-agl-core/recipes-kernel/linux/linux-yocto_%.bbappend
new file mode 100644
index 000000000..808df2d09
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}-agl.inc', '', d)}
diff --git a/meta-agl-core/recipes-kernel/linux/linux/audit.cfg b/meta-agl-core/recipes-kernel/linux/linux/audit.cfg
new file mode 100644
index 000000000..7decc799c
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/audit.cfg
@@ -0,0 +1,2 @@
+CONFIG_AUDIT=y
+CONFIG_AUDIT_GENERIC=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/can-bus.cfg b/meta-agl-core/recipes-kernel/linux/linux/can-bus.cfg
new file mode 100644
index 000000000..d7c7c7741
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/can-bus.cfg
@@ -0,0 +1,10 @@
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_GW=m
+CONFIG_CAN_J1939=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=m
diff --git a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg b/meta-agl-core/recipes-kernel/linux/linux/fanotify.cfg
index de5dd8d31..de5dd8d31 100644
--- a/meta-agl-bsp/meta-qcom/recipes-kernel/linux/files/fanotify.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/fanotify.cfg
diff --git a/meta-agl-core/recipes-kernel/linux/linux/lttng.cfg b/meta-agl-core/recipes-kernel/linux/linux/lttng.cfg
new file mode 100644
index 000000000..e5f6b9c69
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/lttng.cfg
@@ -0,0 +1 @@
+CONFIG_KALLSYMS_ALL=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/nbd.cfg b/meta-agl-core/recipes-kernel/linux/linux/nbd.cfg
new file mode 100644
index 000000000..e5d897556
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/nbd.cfg
@@ -0,0 +1,3 @@
+CONFIG_BLK_DEV_NBD=y
+# for CI use enable CONFIG_VETH=y
+CONFIG_VETH=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch b/meta-agl-core/recipes-kernel/linux/linux/net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch
new file mode 100644
index 000000000..37ace5a58
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/net-sch_generic-Use-pfifo_fast-as-fallback-scheduler.patch
@@ -0,0 +1,75 @@
+From 546b85bb0aadb5a928b49b53dc02911996169c0b Mon Sep 17 00:00:00 2001
+From: Vincent Prince <vincent.prince.fr@gmail.com>
+Date: Wed, 23 Oct 2019 15:44:20 +0200
+Subject: [PATCH] net: sch_generic: Use pfifo_fast as fallback scheduler for
+ CAN hardware
+
+There is networking hardware that isn't based on Ethernet for layers 1 and 2.
+
+For example CAN.
+
+CAN is a multi-master serial bus standard for connecting Electronic Control
+Units [ECUs] also known as nodes. A frame on the CAN bus carries up to 8 bytes
+of payload. Frame corruption is detected by a CRC. However frame loss due to
+corruption is possible, but a quite unusual phenomenon.
+
+While fq_codel works great for TCP/IP, it doesn't for CAN. There are a lot of
+legacy protocols on top of CAN, which are not build with flow control or high
+CAN frame drop rates in mind.
+
+When using fq_codel, as soon as the queue reaches a certain delay based length,
+skbs from the head of the queue are silently dropped. Silently meaning that the
+user space using a send() or similar syscall doesn't get an error. However
+TCP's flow control algorithm will detect dropped packages and adjust the
+bandwidth accordingly.
+
+When using fq_codel and sending raw frames over CAN, which is the common use
+case, the user space thinks the package has been sent without problems, because
+send() returned without an error. pfifo_fast will drop skbs, if the queue
+length exceeds the maximum. But with this scheduler the skbs at the tail are
+dropped, an error (-ENOBUFS) is propagated to user space. So that the user
+space can slow down the package generation.
+
+On distributions, where fq_codel is made default via CONFIG_DEFAULT_NET_SCH
+during compile time, or set default during runtime with sysctl
+net.core.default_qdisc (see [1]), we get a bad user experience. In my test case
+with pfifo_fast, I can transfer thousands of million CAN frames without a frame
+drop. On the other hand with fq_codel there is more then one lost CAN frame per
+thousand frames.
+
+As pointed out fq_codel is not suited for CAN hardware, so this patch changes
+attach_one_default_qdisc() to use pfifo_fast for "ARPHRD_CAN" network devices.
+
+During transition of a netdev from down to up state the default queuing
+discipline is attached by attach_default_qdiscs() with the help of
+attach_one_default_qdisc(). This patch modifies attach_one_default_qdisc() to
+attach the pfifo_fast (pfifo_fast_ops) if the network device type is
+"ARPHRD_CAN".
+
+[1] https://github.com/systemd/systemd/issues/9194
+
+Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
+Acked-by: Dave Taht <dave.taht@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/sched/sch_generic.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
+index ed5b0e9fd395..4c5dfcb01e00 100644
+--- a/net/sched/sch_generic.c
++++ b/net/sched/sch_generic.c
+@@ -1038,6 +1038,8 @@ static void attach_one_default_qdisc(struct net_device *dev,
+
+ if (dev->priv_flags & IFF_NO_QUEUE)
+ ops = &noqueue_qdisc_ops;
++ else if(dev->type == ARPHRD_CAN)
++ ops = &pfifo_fast_ops;
+
+ qdisc = qdisc_create_dflt(dev_queue, ops, TC_H_ROOT, NULL);
+ if (!qdisc) {
+--
+2.25.0
+
diff --git a/meta-agl-core/recipes-kernel/linux/linux/overlayfs.cfg b/meta-agl-core/recipes-kernel/linux/linux/overlayfs.cfg
new file mode 100644
index 000000000..025118ed6
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/overlayfs.cfg
@@ -0,0 +1,7 @@
+CONFIG_OVERLAY_FS=y
+CONFIG_OVERLAY_FS_REDIRECT_DIR=y
+CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=n
+CONFIG_OVERLAY_FS_INDEX=y
+CONFIG_OVERLAY_FS_NFS_EXPORT=n
+CONFIG_OVERLAY_FS_XINO_AUTO=y
+CONFIG_OVERLAY_FS_METACOPY=y
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg b/meta-agl-core/recipes-kernel/linux/linux/qemu-drm.cfg
index 65fe71cd0..65fe71cd0 100644
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/drm.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/qemu-drm.cfg
diff --git a/meta-agl-core/recipes-kernel/linux/linux/qemu-virtio.cfg b/meta-agl-core/recipes-kernel/linux/linux/qemu-virtio.cfg
new file mode 100644
index 000000000..d042d7d64
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/qemu-virtio.cfg
@@ -0,0 +1,6 @@
+# qemu need a virtio storage for rootfs
+CONFIG_BLK_MQ_VIRTIO=y
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_BLK=y
+# qemuarm need virtionet
+CONFIG_VIRTIO_NET=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/qemuarm.cfg b/meta-agl-core/recipes-kernel/linux/linux/qemuarm.cfg
new file mode 100644
index 000000000..b3644b26f
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/qemuarm.cfg
@@ -0,0 +1,8 @@
+# Necessary configs for using the virt qemu machine
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_VIRT=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_PCI_HOST_GENERIC=y
+CONFIG_RTC_DRV_PL031=y
+# SPEC-3976 we mimic real AGL ARM board and they dont have LPAE. This cause also HDA failure.
+# CONFIG_ARM_LPAE is not set
diff --git a/meta-agl-core/recipes-kernel/linux/linux/ramdisk.cfg b/meta-agl-core/recipes-kernel/linux/linux/ramdisk.cfg
new file mode 100644
index 000000000..3d44de805
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/ramdisk.cfg
@@ -0,0 +1,2 @@
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=65536
diff --git a/meta-agl-core/recipes-kernel/linux/linux/selinux.cfg b/meta-agl-core/recipes-kernel/linux/linux/selinux.cfg
new file mode 100644
index 000000000..d49283158
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/selinux.cfg
@@ -0,0 +1,14 @@
+CONFIG_NETWORK_SECMARK=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_JFS_SECURITY=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_SECURITY=y
+CONFIG_SECURITYFS=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/sound-hda.cfg b/meta-agl-core/recipes-kernel/linux/linux/sound-hda.cfg
new file mode 100644
index 000000000..115504c39
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/sound-hda.cfg
@@ -0,0 +1,20 @@
+# make sure HDA sound modules are on
+# this is required for CI tests
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_GENERIC=m
+CONFIG_SND_HDA_CODEC_REALTEK=m
+CONFIG_SND_HDA_CODEC_ANALOG=m
+CONFIG_SND_HDA_CODEC_SIGMATEL=m
+CONFIG_SND_HDA_CODEC_VIA=m
+CONFIG_SND_HDA_CODEC_HDMI=m
+CONFIG_SND_HDA_CODEC_CIRRUS=m
+CONFIG_SND_HDA_CODEC_CONEXANT=m
+CONFIG_SND_HDA_CODEC_CA0110=m
+CONFIG_SND_HDA_CODEC_CA0132=m
+CONFIG_SND_HDA_CODEC_CMEDIA=m
+CONFIG_SND_HDA_CODEC_SI3054=m
+CONFIG_SND_HDA_RECONFIG=y
+CONFIG_SND_HDA_PATCH_LOADER=y
+
+# enable dummy sound for special cases in CI
+CONFIG_SND_DUMMY=m
diff --git a/meta-agl-core/recipes-kernel/linux/linux/sound.cfg b/meta-agl-core/recipes-kernel/linux/linux/sound.cfg
new file mode 100644
index 000000000..ad34ea680
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/sound.cfg
@@ -0,0 +1,7 @@
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_MAX_CARDS=32
+CONFIG_SND_ALOOP=m
diff --git a/meta-agl-core/recipes-kernel/linux/linux/systemd-required.cfg b/meta-agl-core/recipes-kernel/linux/linux/systemd-required.cfg
new file mode 100644
index 000000000..3424c80b9
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/systemd-required.cfg
@@ -0,0 +1,42 @@
+CONFIG_TMPFS=y
+CONFIG_TMPFS_XATTR=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_AUTOFS_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_CGROUP=y
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=n
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_INOTIFY_USER=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EPOLL=y
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_FHANDLE=y
+CONFIG_CRYPTO_USER_API_HASH=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_FW_LOADER_USER_HELPER=n
+CONFIG_DMIID=y
+CONFIG_NAMESPACES=y
+CONFIG_NET_NS=y
+CONFIG_USER_NS=y
+CONFIG_SECCOMP=y
+CONFIG_SECCOMP_FILTER=y
+CONFIG_CHECKPOINT_RESTORE=y
+CONFIG_CFS_BANDWIDTH=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/systemd-sandbox.cfg b/meta-agl-core/recipes-kernel/linux/linux/systemd-sandbox.cfg
new file mode 100644
index 000000000..d451d554c
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/systemd-sandbox.cfg
@@ -0,0 +1,9 @@
+CONFIG_BPF=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_NET_CLS_BPF=m
+CONFIG_NET_ACT_BPF=m
+CONFIG_BPF_JIT=y
+CONFIG_HAVE_EBPF_JIT=y
+CONFIG_BPF_EVENTS=y
+CONFIG_BPF_LSM=y
+CONFIG_CGROUP_BPF=y
diff --git a/meta-agl-core/recipes-kernel/linux/linux/systemtap.cfg b/meta-agl-core/recipes-kernel/linux/linux/systemtap.cfg
new file mode 100644
index 000000000..4886c27f1
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/systemtap.cfg
@@ -0,0 +1,9 @@
+CONFIG_KPROBES=y
+CONFIG_UPROBES=y
+CONFIG_UPROBE_EVENTS=y
+CONFIG_FTRACE=y
+CONFIG_KPROBE_EVENTS=y
+CONFIG_RELAY=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_INFO=y
+
diff --git a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg b/meta-agl-core/recipes-kernel/linux/linux/vbox-vmware-sata.cfg
index e9c2a1468..a37f07d1f 100644
--- a/meta-agl-bsp/recipes-kernel/linux/linux-yocto/vbox-vmware-sata.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/vbox-vmware-sata.cfg
@@ -11,10 +11,8 @@ CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_FUSION=y
CONFIG_FUSION_SPI=y
+CONFIG_DRM_VMWGFX=y
CONFIG_VMWARE_BALLOON=m
CONFIG_VMWARE_VMCI=m
CONFIG_VMWARE_VMCI_VSOCKETS=m
CONFIG_SND_ENS1371=m
-# vmwgfx doesn't yet work with AGL. If you can fix it, please change this!
-CONFIG_DRM_VMWGFX=n
-CONFIG_DRM_VMWGFX_FBCON=n
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg b/meta-agl-core/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg
index 125406eac..9c8e240e9 100644
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/extra-graphic-devices.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/x86-extra-graphic-devices.cfg
@@ -6,39 +6,24 @@ CONFIG_RSI_SDIO=m
CONFIG_RSI_USB=m
CONFIG_DRM_RADEON=m
CONFIG_DRM_RADEON_USERPTR=y
-# CONFIG_DRM_RADEON_UMS is not set
CONFIG_DRM_NOUVEAU=m
CONFIG_NOUVEAU_DEBUG=5
CONFIG_NOUVEAU_DEBUG_DEFAULT=3
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_VGEM=m
-CONFIG_DRM_VMWGFX=m
-CONFIG_DRM_VMWGFX_FBCON=y
+CONFIG_DRM_VMWGFX=y
CONFIG_DRM_GMA500=m
-CONFIG_DRM_GMA600=y
-CONFIG_DRM_GMA3600=y
CONFIG_DRM_UDL=m
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_BACKLIGHT=y
-# CONFIG_LEDS_DELL_NETBOOKS is not set
CONFIG_IRQ_BYPASS_MANAGER=m
-# CONFIG_ACER_WMI is not set
-# CONFIG_ALIENWARE_WMI is not set
-# CONFIG_DELL_WMI is not set
-# CONFIG_DELL_WMI_AIO is not set
-# CONFIG_HP_WMI is not set
-# CONFIG_ASUS_WMI is not set
CONFIG_ACPI_WMI=m
-# CONFIG_MSI_WMI is not set
-# CONFIG_ACPI_TOSHIBA is not set
-# CONFIG_TOSHIBA_WMI is not set
CONFIG_MXM_WMI=m
CONFIG_SCHED_INFO=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_EVENTFD=y
-CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
@@ -49,6 +34,4 @@ CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
-# CONFIG_KVM_AMD is not set
-# CONFIG_KVM_MMU_AUDIT is not set
CONFIG_CRC7=m
diff --git a/meta-agl-core/recipes-kernel/linux/linux/x86-net-devices.cfg b/meta-agl-core/recipes-kernel/linux/linux/x86-net-devices.cfg
new file mode 100644
index 000000000..6c5b698a9
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/x86-net-devices.cfg
@@ -0,0 +1,3 @@
+CONFIG_IGB=y
+CONFIG_IGB_DCA=y
+CONFIG_R8169=y
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg b/meta-agl-core/recipes-kernel/linux/linux/x86-security-tpm.cfg
index b66b1b9b1..b66b1b9b1 100644
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/security-tpm.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/x86-security-tpm.cfg
diff --git a/meta-agl-core/recipes-kernel/linux/linux/x86-upsquare.cfg b/meta-agl-core/recipes-kernel/linux/linux/x86-upsquare.cfg
new file mode 100644
index 000000000..d2bed63fa
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/x86-upsquare.cfg
@@ -0,0 +1,11 @@
+CONFIG_X86_INTEL_LPSS=y
+CONFIG_EXPERT=y
+CONFIG_SERIAL_8250_DMA=y
+CONFIG_SERIAL_8250_DW=y
+CONFIG_MFD_CORE=y
+CONFIG_MFD_INTEL_LPSS=y
+CONFIG_MFD_INTEL_LPSS_ACPI=y
+CONFIG_MFD_INTEL_LPSS_PCI=y
+CONFIG_IWLWIFI=m
+CONFIG_IWLMVM=m
+CONFIG_IWLDVM=m
diff --git a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg b/meta-agl-core/recipes-kernel/linux/linux/x86-usb-devices.cfg
index b65e55b04..d74d4afd8 100644
--- a/meta-agl-bsp/meta-intel/recipes-kernel/linux/files/usb-devices.cfg
+++ b/meta-agl-core/recipes-kernel/linux/linux/x86-usb-devices.cfg
@@ -1,5 +1,6 @@
CONFIG_BT_QCA=m
CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIUART_LL=y
@@ -65,7 +66,7 @@ CONFIG_LIBERTAS_SPI=m
# CONFIG_LIBERTAS_MESH is not set
CONFIG_RTL8XXXU=m
CONFIG_RTL8XXXU_UNTESTED=y
-CONFIG_WL_TI=y
+CONFIG_WLAN_VENDOR_TI=y
CONFIG_WL1251=m
# CONFIG_WL1251_SPI is not set
# CONFIG_WL1251_SDIO is not set
@@ -74,7 +75,6 @@ CONFIG_WL18XX=m
CONFIG_WLCORE=m
CONFIG_WLCORE_SPI=m
CONFIG_WLCORE_SDIO=m
-CONFIG_WILINK_PLATFORM_DATA=y
CONFIG_ZD1211RW=m
CONFIG_ZD1211RW_DEBUG=y
CONFIG_MWIFIEX=m
diff --git a/meta-agl-core/recipes-kernel/linux/linux/xen_domu.cfg b/meta-agl-core/recipes-kernel/linux/linux/xen_domu.cfg
new file mode 100644
index 000000000..8bc59eb1e
--- /dev/null
+++ b/meta-agl-core/recipes-kernel/linux/linux/xen_domu.cfg
@@ -0,0 +1,25 @@
+CONFIG_XEN=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_SCSI_FRONTEND=y
+CONFIG_XEN_NETDEV_FRONTEND=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_MMC_SDHCI_XENON=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES_DEFAULT=y
+CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GNTDEV_DMABUF=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+CONFIG_XEN_GRANT_DMA_ALLOC=y
+CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PVCALLS_FRONTEND=y
+CONFIG_XEN_PRIVCMD=y
+CONFIG_XEN_AUTO_XLATE=y \ No newline at end of file
diff --git a/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/files/0001-Added-appid-and-title-support.patch b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/files/0001-Added-appid-and-title-support.patch
new file mode 100644
index 000000000..685f80c7b
--- /dev/null
+++ b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/files/0001-Added-appid-and-title-support.patch
@@ -0,0 +1,169 @@
+From b8bbab864a1367ac47bcc0998b4c07d20020965a Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Thu, 5 Oct 2023 18:23:52 +0300
+Subject: [PATCH] ext/wayland: Add title/appid support
+
+Upstream-Status: Pending
+
+Bug-AGL: SPEC-4870
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ ext/wayland/gstwaylandsink.c | 41 +++++++++++++++++++++++++++++-
+ ext/wayland/gstwaylandsink.h | 2 ++
+ gst-libs/gst/wayland/gstwlwindow.c | 12 ++++++++-
+ gst-libs/gst/wayland/gstwlwindow.h | 3 ++-
+ 4 files changed, 55 insertions(+), 3 deletions(-)
+
+diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
+index 2f116bf..69f4a00 100644
+--- a/ext/wayland/gstwaylandsink.c
++++ b/ext/wayland/gstwaylandsink.c
+@@ -61,6 +61,8 @@ enum
+ PROP_DISPLAY,
+ PROP_FULLSCREEN,
+ PROP_ROTATE_METHOD,
++ PROP_APP_ID,
++ PROP_TITLE,
+ PROP_LAST
+ };
+
+@@ -177,6 +179,16 @@ gst_wayland_sink_class_init (GstWaylandSinkClass * klass)
+ GST_TYPE_VIDEO_ORIENTATION_METHOD, GST_VIDEO_ORIENTATION_IDENTITY,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
++ g_object_class_install_property (gobject_class, PROP_APP_ID,
++ g_param_spec_string ("appid", "Top-level application id", "Wayland "
++ "appid, as xdg_shell::set_app_id",
++ NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++
++ g_object_class_install_property (gobject_class, PROP_TITLE,
++ g_param_spec_string ("title", "Top-level title", "Wayland "
++ "title, xdg_shell::set_title",
++ NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++
+ /**
+ * waylandsink:render-rectangle:
+ *
+@@ -266,6 +278,16 @@ gst_wayland_sink_get_property (GObject * object,
+ g_value_set_enum (value, self->current_rotate_method);
+ GST_OBJECT_UNLOCK (self);
+ break;
++ case PROP_APP_ID:
++ GST_OBJECT_LOCK (self);
++ g_value_set_string (value, self->app_id);
++ GST_OBJECT_UNLOCK (self);
++ break;
++ case PROP_TITLE:
++ GST_OBJECT_LOCK (self);
++ g_value_set_string (value, self->title);
++ GST_OBJECT_UNLOCK (self);
++ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+@@ -289,6 +311,16 @@ gst_wayland_sink_set_property (GObject * object,
+ gst_wayland_sink_set_fullscreen (self, g_value_get_boolean (value));
+ GST_OBJECT_UNLOCK (self);
+ break;
++ case PROP_APP_ID:
++ GST_OBJECT_LOCK (self);
++ self->app_id = g_value_dup_string (value);
++ GST_OBJECT_UNLOCK (self);
++ break;
++ case PROP_TITLE:
++ GST_OBJECT_LOCK (self);
++ self->title = g_value_dup_string (value);
++ GST_OBJECT_UNLOCK (self);
++ break;
+ case PROP_ROTATE_METHOD:
+ gst_wayland_sink_set_rotate_method (self, g_value_get_enum (value),
+ FALSE);
+@@ -310,12 +342,18 @@ gst_wayland_sink_finalize (GObject * object)
+ gst_buffer_unref (self->last_buffer);
+ if (self->display)
+ g_object_unref (self->display);
++ if (self->title)
++ g_object_unref (self->title);
++ if (self->app_id)
++ g_object_unref (self->app_id);
+ if (self->window)
+ g_object_unref (self->window);
+ if (self->pool)
+ gst_object_unref (self->pool);
+
+ g_free (self->display_name);
++ g_free (self->title);
++ g_free (self->app_id);
+
+ g_mutex_clear (&self->display_lock);
+ g_mutex_clear (&self->render_lock);
+@@ -761,7 +799,8 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer)
+ if (!self->window) {
+ /* if we were not provided a window, create one ourselves */
+ self->window = gst_wl_window_new_toplevel (self->display,
+- &self->video_info, self->fullscreen, &self->render_lock);
++ &self->video_info, self->fullscreen, &self->app_id, &self->title,
++ &self->render_lock);
+ g_signal_connect_object (self->window, "closed",
+ G_CALLBACK (on_window_closed), self, 0);
+ gst_wl_window_set_rotate_method (self->window,
+diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h
+index 3243d8c..6aee19d 100644
+--- a/ext/wayland/gstwaylandsink.h
++++ b/ext/wayland/gstwaylandsink.h
+@@ -58,6 +58,8 @@ struct _GstWaylandSink
+ gboolean fullscreen;
+
+ gchar *display_name;
++ gchar *app_id;
++ gchar *title;
+
+ gboolean redraw_pending;
+ GMutex render_lock;
+diff --git a/gst-libs/gst/wayland/gstwlwindow.c b/gst-libs/gst/wayland/gstwlwindow.c
+index 6004993..de0a81e 100644
+--- a/gst-libs/gst/wayland/gstwlwindow.c
++++ b/gst-libs/gst/wayland/gstwlwindow.c
+@@ -270,7 +270,7 @@ gst_wl_window_ensure_fullscreen (GstWlWindow * self, gboolean fullscreen)
+
+ GstWlWindow *
+ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
+- gboolean fullscreen, GMutex * render_lock)
++ gboolean fullscreen, gchar *app_id, gchar *title, GMutex * render_lock)
+ {
+ GstWlWindow *self;
+ GstWlWindowPrivate *priv;
+@@ -307,6 +307,16 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
+
+ gst_wl_window_ensure_fullscreen (self, fullscreen);
+
++ if (app_id)
++ xdg_toplevel_set_app_id (priv->xdg_toplevel, app_id);
++ else
++ xdg_toplevel_set_app_id (priv->xdg_toplevel, "ext.wayland.waylandsink");
++ if (title)
++ xdg_toplevel_set_title (priv->xdg_toplevel, title);
++ else
++ xdg_toplevel_set_title (priv->xdg_toplevel, "ext.wayland.waylandsink");
++
++
+ /* Finally, commit the xdg_surface state as toplevel */
+ priv->configured = FALSE;
+ wl_surface_commit (priv->area_surface);
+diff --git a/gst-libs/gst/wayland/gstwlwindow.h b/gst-libs/gst/wayland/gstwlwindow.h
+index 06c4001..e102052 100644
+--- a/gst-libs/gst/wayland/gstwlwindow.h
++++ b/gst-libs/gst/wayland/gstwlwindow.h
+@@ -39,7 +39,8 @@ void gst_wl_window_ensure_fullscreen (GstWlWindow * self,
+
+ GST_WL_API
+ GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
+- const GstVideoInfo * info, gboolean fullscreen, GMutex * render_lock);
++ const GstVideoInfo * info, gboolean fullscreen, gchar * app_id,
++ gchar *title, GMutex * render_lock);
+
+ GST_WL_API
+ GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
+--
+2.35.1
+
diff --git a/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_%.bbappend b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_%.bbappend
new file mode 100644
index 000000000..96bbdc34b
--- /dev/null
+++ b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'gstreamer1.0-plugins-bad_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_aglcore.inc b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_aglcore.inc
new file mode 100644
index 000000000..97a0c1688
--- /dev/null
+++ b/meta-agl-core/recipes-multimedia/gstreamer1.0-plugins-bad/gstreamer1.0-plugins-bad_aglcore.inc
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+AGL_PATCHES = "file://0001-Added-appid-and-title-support.patch"
+
+# Above patch fails to apply against NXP's forked version, disable
+# for now
+AGL_PATCHES:use-nxp-bsp = ""
+
+SRC_URI:append = " ${AGL_PATCHES}"
diff --git a/meta-agl-core/recipes-platform/images/agl-image-boot.bb b/meta-agl-core/recipes-platform/images/agl-image-boot.bb
new file mode 100644
index 000000000..dde6a18db
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-boot.bb
@@ -0,0 +1,5 @@
+SUMMARY = "A small image just capable of allowing a device to boot."
+LICENSE = "MIT"
+
+inherit agl-core-image
+
diff --git a/meta-agl-core/recipes-platform/images/agl-image-compositor.bb b/meta-agl-core/recipes-platform/images/agl-image-compositor.bb
new file mode 100644
index 000000000..b78536be8
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-compositor.bb
@@ -0,0 +1,15 @@
+SUMMARY = "A very basic Wayland image with agl-compositor"
+LICENSE = "MIT"
+
+require agl-image-minimal.bb
+
+inherit features_check
+
+REQUIRED_DISTRO_FEATURES = "wayland"
+
+SYSTEMD_DEFAULT_TARGET = "graphical.target"
+
+IMAGE_INSTALL += " \
+ packagegroup-agl-graphical-compositor \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'weston-examples', '', d)} \
+"
diff --git a/meta-agl-core/recipes-platform/images/agl-image-core-autobuilder.bb b/meta-agl-core/recipes-platform/images/agl-image-core-autobuilder.bb
new file mode 100644
index 000000000..eec1cf54c
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-core-autobuilder.bb
@@ -0,0 +1,15 @@
+SUMMARY = "A very basic Wayland image with a terminal"
+LICENSE = "MIT"
+
+require agl-image-weston.bb
+
+IMAGE_FEATURES += "splash"
+
+IMAGE_INSTALL += " \
+ busybox \
+ gdb \
+ gperf \
+ weston-examples \
+ curl \
+ ptest-runner \
+ "
diff --git a/meta-agl-core/recipes-platform/images/agl-image-minimal-crosssdk.bb b/meta-agl-core/recipes-platform/images/agl-image-minimal-crosssdk.bb
new file mode 100644
index 000000000..6aa308273
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-minimal-crosssdk.bb
@@ -0,0 +1,9 @@
+require agl-image-minimal.bb
+
+SUMMARY = "Cross SDK of minimal AGL Distribution for core profile"
+DESCRIPTION = "SDK image for AGL core distribution. \
+It includes the full toolchain, plus developement headers and libraries \
+to form a standalone cross SDK."
+LICENSE = "MIT"
+
+inherit agl-crosssdk
diff --git a/meta-agl-core/recipes-platform/images/agl-image-minimal.bb b/meta-agl-core/recipes-platform/images/agl-image-minimal.bb
new file mode 100644
index 000000000..4e54e93ed
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-minimal.bb
@@ -0,0 +1,9 @@
+SUMMARY = "An AGL small image just capable of allowing a device to boot."
+LICENSE = "MIT"
+
+inherit agl-core-image
+
+IMAGE_INSTALL = "packagegroup-agl-image-minimal ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_ROOTFS_SIZE ?= "8192"
+IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"
diff --git a/meta-agl-core/recipes-platform/images/agl-image-weston.bb b/meta-agl-core/recipes-platform/images/agl-image-weston.bb
new file mode 100644
index 000000000..d902020cc
--- /dev/null
+++ b/meta-agl-core/recipes-platform/images/agl-image-weston.bb
@@ -0,0 +1,15 @@
+SUMMARY = "A very basic Wayland image with a terminal"
+LICENSE = "MIT"
+
+require agl-image-minimal.bb
+
+inherit features_check
+
+REQUIRED_DISTRO_FEATURES = "wayland"
+
+SYSTEMD_DEFAULT_TARGET = "graphical.target"
+
+IMAGE_INSTALL += " \
+ packagegroup-agl-graphical-weston \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'weston-examples', '', d)} \
+"
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb
new file mode 100644
index 000000000..28a734548
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+# derived from oe-core: meta/recipes-core/packagegroups/packagegroup-core-boot.bb
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+LICENSE = "MIT"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+# Disto can override
+VIRTUAL-RUNTIME_rngd ?= "rng-tools"
+
+RDEPENDS:${PN} = "\
+ packagegroup-core-boot \
+ packagegroup-machine-base \
+ ${VIRTUAL-RUNTIME_rngd} \
+"
+
+RRECOMMENDS:${PN} = "\
+ tzdata \
+"
+
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb
new file mode 100644
index 000000000..aeee0f8d3
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "The minimal set of packages for Connectivity Subsystem"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-core-connectivity \
+ "
+
+ALLOW_EMPTY:${PN} = "1"
+
+PKGGROUP_ZEROCONF = "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '', d)}"
+
+RDEPENDS:${PN} += "\
+ ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','connman','connman connman-client connman-conf \
+ connman-wait-online connman-tests connman-tools connman-ncurses' ,'',d)} \
+ ${@bb.utils.contains('AGL_FEATURES', 'agl-devel', '${PKGGROUP_ZEROCONF}', '', d)} \
+ systemd-conf-canbus \
+ "
diff --git a/meta-agl/recipes-devtools/packagegroups/packagegroup-agl-devel.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-devel.bb
index ade8560ab..887604ec3 100644
--- a/meta-agl/recipes-devtools/packagegroups/packagegroup-agl-devel.bb
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-devel.bb
@@ -3,22 +3,21 @@ LICENSE = "MIT"
inherit packagegroup
-RDEPENDS_${PN} = "\
+RDEPENDS:${PN} = "\
strace \
ldd \
less \
vim \
lsof \
gdb \
- valgrind \
- perf \
- htop \
- powertop \
- latencytop \
- systemtap \
screen \
usbutils \
rsync \
- tree \
pstree \
- "
+ procps \
+ libxslt-bin \
+ pciutils \
+ openssh-sftp-server \
+ zstd \
+"
+
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-compositor.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-compositor.bb
new file mode 100644
index 000000000..b2c7d8ec8
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-compositor.bb
@@ -0,0 +1,9 @@
+DESCRIPTION = "The minimal set of packages required for the AGL compositor"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS:${PN} += " \
+ agl-compositor \
+ agl-compositor-init \
+"
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb
new file mode 100644
index 000000000..96f09d5ab
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb
@@ -0,0 +1,9 @@
+DESCRIPTION = "The minimal set of packages required for the Weston compositor"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS:${PN} += " \
+ weston \
+ weston-init \
+"
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-minimal.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-minimal.bb
new file mode 100644
index 000000000..a60cbab21
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-minimal.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "The minimal set of packages required by AGL"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-image-minimal \
+ profile-agl-minimal \
+ "
+
+ALLOW_EMPTY:${PN} = "1"
+
+RDEPENDS:${PN} += "\
+ packagegroup-agl-core-boot \
+ packagegroup-agl-core-connectivity \
+ "
+
+RDEPENDS:profile-agl-minimal = "${PN}"
diff --git a/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-profile-graphical.bb b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-profile-graphical.bb
new file mode 100644
index 000000000..b92e760ae
--- /dev/null
+++ b/meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-profile-graphical.bb
@@ -0,0 +1,17 @@
+SUMMARY = "The middleware for AGL IVI profile"
+DESCRIPTION = "The base set of packages required for a AGL IVI Distribution"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-profile-graphical \
+ profile-graphical \
+"
+
+RDEPENDS:${PN} += "\
+ packagegroup-agl-image-minimal \
+ packagegroup-agl-graphical-compositor \
+"
+
+RDEPENDS:profile-graphical = "${PN}"
diff --git a/meta-agl-core/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch b/meta-agl-core/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
new file mode 100644
index 000000000..11c6fd27b
--- /dev/null
+++ b/meta-agl-core/recipes-support/ptest-runner/ptest-runner/0007-WIP-Initial-LAVA-support.patch
@@ -0,0 +1,152 @@
+From bdcbb0e78bbffe45719d0a27954544120f37442a Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Mon, 15 Oct 2018 18:30:42 -0700
+Subject: [PATCH] Initial LAVA support
+
+Linaro Automated Validation Architecture (LAVA) launches a test suite
+on the target but thereafter only observes stdout.
+
+LAVA knows that a test case has started or ended based on signals
+emitted to stdout:
+(setup)
+<LAVA_SIGNAL_STARTTC test_case_name>
+(teardown)
+<LAVA_SIGNAL_ENDTC test_case_name>
+<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=test_case_name RESULT=pass|fail \
+ [[ MEASUREMENT=numeric_measurement ][ UNITS=units_string]]>
+
+It is valid to have a measurement without units, but not units without a measurement.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+[updated for ptest-runner 2.3.2]
+[updated for ptest-runner 2.4.1]
+[updated for ptest-runner 2.4.2]
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ flags.h | 10 ++++++++++
+ main.c | 9 ++++++++-
+ utils.c | 17 ++++++++++++++++-
+ utils.h | 2 +-
+ 4 files changed, 35 insertions(+), 3 deletions(-)
+ create mode 100644 flags.h
+
+diff --git a/flags.h b/flags.h
+new file mode 100644
+index 0000000..0dac223
+--- /dev/null
++++ b/flags.h
+@@ -0,0 +1,10 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++
++/* Flag bit definitions */
++
++#ifndef __FLAGS_H__
++#define __FLAGS_H__
++
++#define LAVA_SIGNAL_ENABLE (0x0001)
++
++#endif /* __FLAGS_H__ */
+diff --git a/main.c b/main.c
+index 31e4dd5..f12d6d6 100644
+--- a/main.c
++++ b/main.c
+@@ -38,6 +38,7 @@
+ #endif
+
+ #include "utils.h"
++#include "flags.h"
+
+ #ifndef DEFAULT_DIRECTORY
+ #define DEFAULT_DIRECTORY "/usr/lib"
+@@ -130,8 +131,9 @@ main(int argc, char *argv[])
+ opts.timeout = DEFAULT_TIMEOUT;
+ opts.ptests = NULL;
+ opts.xml_filename = NULL;
++ opts.flags = 0;
+
+- while ((opt = getopt(argc, argv, "d:e:lt:x:h")) != -1) {
++ while ((opt = getopt(argc, argv, "d:e:lt:x:Lh")) != -1) {
+ switch (opt) {
+ case 'd':
+ free(opts.dirs[0]);
+@@ -156,6 +158,11 @@ main(int argc, char *argv[])
+ opts.xml_filename = strdup(optarg);
+ CHECK_ALLOCATION(opts.xml_filename, 1, 1);
+ break;
++ case 'L':
++ // set LAVA signal mode
++ opts.flags |= LAVA_SIGNAL_ENABLE;
++ fprintf(stdout, "LAVA_SIGNAL_ENABLE == %d\n", opts.flags);
++ break;
+ default:
+ print_usage(stdout, argv[0]);
+ exit(1);
+diff --git a/utils.c b/utils.c
+index 59b8b77..30423c4 100644
+--- a/utils.c
++++ b/utils.c
+@@ -49,6 +49,7 @@
+
+ #include "ptest_list.h"
+ #include "utils.h"
++#include "flags.h"
+
+ #define GET_STIME_BUF_SIZE 1024
+ #define WAIT_CHILD_BUF_MAX_SIZE 1024
+@@ -425,6 +426,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ }
+
+ char *ptest_dir = strdup(p->run_ptest);
++ char *ptest = strdup(p->ptest);
+ if (ptest_dir == NULL) {
+ rc = -1;
+ break;
+@@ -477,7 +479,10 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ fprintf(fp, "ERROR: setpgid() failed, %s\n", strerror(errno));
+ }
+
+- time_t start_time= time(NULL);
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ fprintf(stdout, "<LAVA_SIGNAL_STARTTC %s>\n", ptest);
++ }
++ time_t start_time = time(NULL);
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE, start_time));
+ fprintf(fp, "BEGIN: %s\n", ptest_dir);
+
+@@ -594,6 +599,16 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+
+ fprintf(fp, "END: %s\n", ptest_dir);
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE, end_time));
++ if (opts.flags & LAVA_SIGNAL_ENABLE) {
++ char result[5]; // pass\0, fail\0, skip\0
++
++ if (status)
++ sprintf(result, "fail");
++ else
++ sprintf(result, "pass");
++ fprintf(stdout, "<LAVA_SIGNAL_ENDTC %s>\n", ptest);
++ fprintf(stdout, "<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=%s>\n", ptest, result);
++ }
+ }
+ free(ptest_dir);
+ do_close(&pipefd_stdout[PIPE_READ]);
+diff --git a/utils.h b/utils.h
+index 04fc666..ad702d8 100644
+--- a/utils.h
++++ b/utils.h
+@@ -42,9 +42,9 @@ struct ptest_options {
+ unsigned int timeout;
+ char **ptests;
+ char *xml_filename;
++ unsigned int flags;
+ };
+
+-
+ extern void check_allocation1(void *, size_t, char *, int, int);
+ extern struct ptest_list *get_available_ptests(const char *);
+ extern int print_ptests(struct ptest_list *, FILE *);
+--
+2.37.3
+
diff --git a/meta-agl-core/recipes-support/ptest-runner/ptest-runner_2.%.bbappend b/meta-agl-core/recipes-support/ptest-runner/ptest-runner_2.%.bbappend
new file mode 100644
index 000000000..5033ed7f6
--- /dev/null
+++ b/meta-agl-core/recipes-support/ptest-runner/ptest-runner_2.%.bbappend
@@ -0,0 +1,2 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', '${BPN}_agl.inc', '', d)}
+
diff --git a/meta-agl-core/recipes-support/ptest-runner/ptest-runner_agl.inc b/meta-agl-core/recipes-support/ptest-runner/ptest-runner_agl.inc
new file mode 100644
index 000000000..593ad13a6
--- /dev/null
+++ b/meta-agl-core/recipes-support/ptest-runner/ptest-runner_agl.inc
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/ptest-runner:"
+SRC_URI += "file://0007-WIP-Initial-LAVA-support.patch"
+
diff --git a/meta-agl-core/scripts/oe-depends-dot b/meta-agl-core/scripts/oe-depends-dot
new file mode 100755
index 000000000..5cec23bf0
--- /dev/null
+++ b/meta-agl-core/scripts/oe-depends-dot
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2018 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import os
+import sys
+import argparse
+import logging
+import re
+
+class Dot(object):
+ def __init__(self):
+ parser = argparse.ArgumentParser(
+ description="Analyse recipe-depends.dot generated by bitbake -g",
+ epilog="Use %(prog)s --help to get help")
+ parser.add_argument("dotfile",
+ help = "Specify the dotfile", nargs = 1, action='store', default='')
+ parser.add_argument("-k", "--key",
+ help = "Specify the key, e.g., recipe name",
+ action="store", default='')
+ parser.add_argument("-d", "--depends",
+ help = "Print the key's dependencies",
+ action="store_true", default=False)
+ parser.add_argument("-w", "--why",
+ help = "Print why the key is built",
+ action="store_true", default=False)
+ parser.add_argument("-r", "--remove",
+ help = "Remove duplicated dependencies to reduce the size of the dot files."
+ " For example, A->B, B->C, A->C, then A->C can be removed.",
+ action="store_true", default=False)
+
+ self.args = parser.parse_args()
+
+ if len(sys.argv) != 3 and len(sys.argv) < 5:
+ print('ERROR: Not enough args, see --help for usage')
+
+ def main(self):
+ #print(self.args.dotfile[0])
+ # The format is {key: depends}
+ depends = {}
+ with open(self.args.dotfile[0], 'r') as f:
+ for line in f.readlines():
+ if ' -> ' not in line:
+ continue
+ line_no_quotes = line.replace('"', '')
+ m = re.match("(.*) -> (.*)", line_no_quotes)
+ if not m:
+ print('WARNING: Found unexpected line: %s' % line)
+ continue
+ key = m.group(1)
+ if key == "meta-world-pkgdata":
+ continue
+ dep = m.group(2)
+ if key in depends:
+ if not key in depends[key]:
+ depends[key].add(dep)
+ else:
+ print('WARNING: Fonud duplicated line: %s' % line)
+ else:
+ depends[key] = set()
+ depends[key].add(dep)
+
+ if self.args.remove:
+ reduced_depends = {}
+ for k, deps in depends.items():
+ child_deps = set()
+ added = set()
+ # Both direct and indirect depends are already in the dict, so
+ # we don't have to do this recursively.
+ for dep in deps:
+ if dep in depends:
+ child_deps |= depends[dep]
+
+ reduced_depends[k] = deps - child_deps
+ outfile= '%s-reduced%s' % (self.args.dotfile[0][:-4], self.args.dotfile[0][-4:])
+ with open(outfile, 'w') as f:
+ print('Saving reduced dot file to %s' % outfile)
+ f.write('digraph depends {\n')
+ for k, v in reduced_depends.items():
+ for dep in v:
+ f.write('"%s" -> "%s"\n' % (k, dep))
+ f.write('}\n')
+ sys.exit(0)
+
+ if self.args.key not in depends:
+ print("ERROR: Can't find key %s in %s" % (self.args.key, self.args.dotfile[0]))
+ sys.exit(1)
+
+ if self.args.depends:
+ if self.args.key in depends:
+ print('Depends: %s' % ' '.join(depends[self.args.key]))
+
+ reverse_deps = []
+ if self.args.why:
+ for k, v in depends.items():
+ if self.args.key in v and not k in reverse_deps:
+ reverse_deps.append(k)
+ print('Because: %s' % ' '.join(reverse_deps))
+
+if __name__ == "__main__":
+ try:
+ dot = Dot()
+ ret = dot.main()
+ except Exception as esc:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/meta-agl-core/scripts/run-yocto-check-layer.sh b/meta-agl-core/scripts/run-yocto-check-layer.sh
new file mode 100755
index 000000000..cd9364682
--- /dev/null
+++ b/meta-agl-core/scripts/run-yocto-check-layer.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we cannot import the distro config right away
+# as the initial values are poky only till the layer
+# is added in
+# no polkit !
+AGL_DEFAULT_DISTRO_FEATURES = "usrmerge largefile opengl wayland pam bluetooth bluez5 3g"
+DISTRO_FEATURES:append = " systemd wayland pam \${AGL_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+EOF
+
+yocto-check-layer --no-auto-dependency \
+ -- \
+ $AGLROOT/meta-agl/meta-agl-core
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl
+
+exit 0
diff --git a/meta-agl-distro/conf/distro/include/x86_64-tune.inc b/meta-agl-distro/conf/distro/include/x86_64-tune.inc
deleted file mode 100644
index 9130173fa..000000000
--- a/meta-agl-distro/conf/distro/include/x86_64-tune.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-# DEFAULTTUNE overrides for AGL on x86-64
-
-# We should not need the tuning include below as the BSP should include the right set already.
-# A double inclusion would produce a warning. This include line is just for reference
-#include conf/machine/include/tune-corei7.inc
-DEFAULTTUNE = "corei7-64"
-
-# shortened copy of tune-corei7.inc due to bug in inclusion for tune-core2.inc
-# TUNE_ARCH is using .= x86-64 , if done twice, you get x86-64x86-64 as TUNE_ARCH :/
-# we should have at least the core2 tunings by default (=qemux86-64)
-
-# Extra tune features
-TUNEVALID[corei7] = "Enable corei7 specific processor optimizations"
-TUNE_CCARGS = "${@bb.utils.contains('TUNE_FEATURES', 'corei7', ' -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2', '', d)}"
-
-# Extra tune selections
-AVAILTUNES += "corei7-32"
-TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
-BASE_LIB_tune-corei7-32 = "lib"
-TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
-PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-32} corei7-32"
-QEMU_EXTRAOPTIONS_corei7-32 = " -cpu Nehalem,check=false"
-QB_CPU_corei7-32 = "-cpu Nehalem,check=false"
-QB_MACHINE_corei7-32 = "-machine q35"
-
-AVAILTUNES += "corei7-64"
-TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
-BASE_LIB_tune-corei7-64 = "lib64"
-TUNE_PKGARCH_tune-corei7-64 = "corei7-64"
-PACKAGE_EXTRA_ARCHS_tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64} corei7-64"
-QEMU_EXTRAOPTIONS_corei7-64 = " -cpu Nehalem,check=false"
-QB_CPU_corei7-64 = " -cpu Nehalem,check=false"
-QB_MACHINE_corei7-64 = "-machine q35"
-
-AVAILTUNES += "corei7-64-x32"
-TUNE_FEATURES_tune-corei7-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} corei7"
-BASE_LIB_tune-corei7-64-x32 = "libx32"
-TUNE_PKGARCH_tune-corei7-64-x32 = "corei7-64-x32"
-PACKAGE_EXTRA_ARCHS_tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64-x32} corei7-64-x32"
-QEMU_EXTRAOPTIONS_corei7-64-x32 = " -cpu Nehalem,check=false"
-QB_CPU_corei7-64-x32 = "-cpu Nehalem,check=false"
-QB_MACHINE_corei7-64-x32 = "-machine q35"
-
-TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'm64', '${X86ARCH64}', '' ,d)}"
-
-# Bump qemux86-64 up to corei7
-AVAILTUNES += "qemux86-64"
-TUNE_FEATURES_tune-qemux86-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
-BASE_LIB_tune-qemux86-64 = "lib64"
-TUNE_PKGARCH_tune-qemux86-64 = "corei7-64"
-PACKAGE_EXTRA_ARCHS_tune-qemux86-64 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64} corei7-64"
-QEMU_EXTRAOPTIONS_qemux86-64 = " -cpu Nehalem,check=false"
-QB_CPU_qemux86-64 = " -cpu Nehalem,check=false"
-QB_CPU_KVM_x86 = "-cpu Nehalem,check=false"
-QB_CPU_KVM_x86-64 = "-cpu Nehalem,check=false"
-QB_MACHINE_qemux86-64 = "-machine q35"
diff --git a/meta-agl-distro/conf/distro/poky-agl.conf b/meta-agl-distro/conf/distro/poky-agl.conf
deleted file mode 100644
index 92856fc5d..000000000
--- a/meta-agl-distro/conf/distro/poky-agl.conf
+++ /dev/null
@@ -1,128 +0,0 @@
-require conf/distro/poky.conf
-
-# AGL specific derivations
-DISTRO = "poky-agl"
-DISTRO_NAME = "Automotive Grade Linux"
-DISTRO_VERSION = "3.99.1+snapshot-${DATE}"
-DISTRO_CODENAME = "dab"
-DISTRO_BRANCH_VERSION_TAG = "dab/3.99.1"
-SDK_VENDOR = "-aglsdk"
-SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
-
-MAINTAINER = "AGL <automotive-discussions@lists.linuxfoundation.org>"
-
-TARGET_VENDOR = "-agl"
-
-# Override these in poky based distros
-AGL_DEFAULT_DISTRO_FEATURES = "largefile systemd opengl wayland pam bluetooth bluez5"
-POKY_DEFAULT_DISTRO_FEATURES := "${AGL_DEFAULT_DISTRO_FEATURES}"
-OVERRIDES .= ":${DISTRO_CODENAME}"
-
-QEMU_TARGETS ?= "arm aarch64 i386 x86_64"
-# Other QEMU_TARGETS "mips mips64 mips64el ppc sh4"
-
-PREMIRRORS ??= "\
-bzr://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-cvs://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-git://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-gitsm://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-hg://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-osc://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-p4://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-svn://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n"
-
-MIRRORS =+ "\
-ftp://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-http://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n \
-https://.*/.* https://download.automotivelinux.org/AGL/mirror/ \n"
-
-# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
-# fetch from the network (and warn you if not). To disable the test set
-# the variable to be empty.
-# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=HEAD
-CONNECTIVITY_CHECK_URIS ?= ""
-
-PREFERRED_PROVIDER_udev ?= "systemd"
-PREFERRED_PROVIDER_udev-utils ?= "systemd"
-
-VIRTUAL-RUNTIME_init_manager = "systemd"
-VIRTUAL-RUNTIME_initscripts = ""
-
-# network manager to use (possible values: systemd, connman)
-VIRTUAL-RUNTIME_net_manager = "connman"
-
-DISTRO_FEATURES_APPEND = " "
-DISTRO_FEATURES_remove = "x11"
-DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
-
-
-# Prefer GStreamer 1.8.x by default
-PREFERRED_VERSION_gstreamer1.0 ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-plugins-bad ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-plugins-base ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-plugins-good ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-plugins-ugly ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-libav ?= "1.8.%"
-PREFERRED_VERSION_gstreamer1.0-omx ?= "1.2.%"
-
-# Prefer libjpeg-turbo
-PREFERRED_PROVIDER_jpeg = "libjpeg-turbo"
-
-# using multiple BSP layers causes dangling bbappends in meta-agl-bsp
-# turn it into a warning
-#BB_DANGLINGAPPENDS_WARNONLY = "1"
-
-# enforce security-related compiler flags by default
-require conf/distro/include/security_flags.inc
-# required overrides, upstreamed but not merged yet:
-# http://lists.openembedded.org/pipermail/openembedded-devel/2016-June/107727.html
-SECURITY_CFLAGS_pn-llvm3.3 = ""
-SECURITY_LDFLAGS_remove_pn-llvm3.3 = "-fstack-protector-strong"
-SECURITY_STRINGFORMAT_pn-gpm = ""
-SECURITY_CFLAGS_pn-libdbus-c++ = ""
-SECURITY_LDFLAGS_pn-libdbus-c++ = ""
-
-# more than 2 targets fail to compile these with the SECURITY compiler flags:
-# Bug tracked as SPEC-593
-SECURITY_CFLAGS_pn-mozjs = ""
-SECURITY_LDFLAGS_pn-mozjs = ""
-SECURITY_CFLAGS_pn-gpm = ""
-SECURITY_LDFLAGS_pn-gpm = ""
-SECURITY_CFLAGS_pn-libatasmart = ""
-SECURITY_LDFLAGS_pn-libatasmart = ""
-
-# Not yet upstreamed; should be submitted.
-SECURITY_CFLAGS_pn-qtwebengine = "${SECURITY_NO_PIE_CFLAGS}"
-
-#Redefined USER_CLASSES
-#Disable prelink. It is unmaintained and likely will go away.
-#default: USER_CLASSES ?= "buildstats image-mklibs image-prelink"
-USER_CLASSES = "buildstats image-mklibs"
-
-# AGL uses 4 optimization levels
-# 2 for ARM 32bit
-# - a high and a medium setting for the CCARGS
-# - the high setting is default (needs >= cortex-a15)
-# - the medium setting is enabled with: DISTRO_FEATURES_append = " agl-medium-arm-compiler "
-# 1 for ARM 64bit / AARCH64
-# 1 for x86-64
-require conf/distro/include/${TARGET_ARCH}-tune.inc
-
-# Generic qemu and qemuboot (runqemu) enhancements
-# check qemuboot.bbclass
-# - use 1G RAM by default
-QB_MEM ?= "-m 1024"
-
-
-# DEFAULT IMAGE_FSTYPES for AGL (no - BSPs should not set this)
-#
-IMAGE_FSTYPES := "tar.xz ext4.xz"
-INITRAMFS_FSTYPES := ""
-
-#
-# THE FUTURE is 'wic'
-# IMAGE_FSTYPES_append = " wic"
-
-# Board templates can add extra IMAGE_FSTYPES through this.
-# It is added (late) through the AGL image recipes.
-AGL_EXTRA_IMAGE_FSTYPES ?= ""
diff --git a/meta-agl-distro/conf/layer.conf b/meta-agl-distro/conf/layer.conf
deleted file mode 100644
index 74527516a..000000000
--- a/meta-agl-distro/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH =. "${LAYERDIR}:"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "agl-distro"
-BBFILE_PATTERN_agl-distro = "^${LAYERDIR}/"
-BBFILE_PRIORITY_agl-distro = "8"
diff --git a/meta-agl/classes/.gitkeep b/meta-agl-ic/.empty
index e69de29bb..e69de29bb 100644
--- a/meta-agl/classes/.gitkeep
+++ b/meta-agl-ic/.empty
diff --git a/meta-agl/recipes-automotive/.gitkeep b/meta-agl-ivi/.empty
index e69de29bb..e69de29bb 100644
--- a/meta-agl/recipes-automotive/.gitkeep
+++ b/meta-agl-ivi/.empty
diff --git a/meta-agl.md b/meta-agl.md
new file mode 100755
index 000000000..be4369656
--- /dev/null
+++ b/meta-agl.md
@@ -0,0 +1,99 @@
+## Introduction
+
+The `meta-agl` layer provides the minimal set of software
+to boot an AGL Distribution system.
+You use this layer as the minimal core on which to build AGL profiles.
+
+**NOTE:** The `meta-agl` layer does not include a reference UI.
+ The reference UI is included as part of the
+ [`meta-agl-demo`](./meta-agl-demo.html) layer.
+
+## Sub-Layers
+
+The `meta-agl` layer itself contains many sub-layers and files.
+Following is a "tree" look at the layer:
+
+```
+|-- LICENSE
+|-- LICENSE.GPL-2.0-only
+|-- LICENSE.MIT
+|-- README-AGL.md
+|-- README.md -> meta-agl.md
+|-- agl-layers-overview.md
+|-- docs
+|-- meta-agl-bsp
+|-- meta-agl-core
+|-- meta-agl-core-test
+|-- meta-agl-ic
+|-- meta-agl-ivi
+|-- meta-agl.md
+|-- meta-netboot
+|-- meta-pipewire
+|-- scripts
+`-- templates
+```
+
+This list provides some overview information on the files and sub-layers
+in `meta-agl`:
+
+* LICENSE* : licenses of the various components.
+* README* : RTFM
+* agl-layers-overview.md: references to the various layers that make up AGL
+* `docs`: Contains files that support AGL documentation.
+* `meta-agl-bsp`: Contains adaptations for recipes and required packages
+ to boot an AGL distribution on targeted hardware and emulation (i.e. QEMU).
+* `meta-agl-core`: This is the core layer with essential recipes and the distro.
+* `meta-agl-core-test`: recipes supporting qa images (separate layer due to external dependencies)
+* `meta-agl-ic`: Instrument Cluster platform
+* `meta-agl-ivi`: IVI platform
+* `meta-netboot`: Contains recipes and configuration adjustments to allow network
+ boot through network block device (NBD) since network file system (NFS) does not
+ support security labels.
+* `meta-pipewire`: Configuration and recipes supporting pipewire as audio manager
+* `scripts`: AGL development setup and support scripts.
+* `templates`: Base, feature, and machine templates used in the AGL development
+ environment.
+
+## Packagegroups
+
+This section describes the AGL
+[packagegroup](https://yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#usingpoky-extend-customimage-customtasks)
+design:
+
+### core non-ui packagegroups:
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-devel.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-security.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-os-commonlibs.bb
+
+### graphical subsystem
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-profile-graphical.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-multimedia.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb
+
+### image-related packagegroups
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-boot.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-boot.bb
+meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-image-minimal.bb
+
+### QA/Test related packagegroups
+meta-agl-core-test/recipes-test/packagegroups
+meta-agl-core-test/recipes-test/packagegroups/packagegroup-agl-test.bb
+
+## Images
+
+### (Barely) bootable image
+meta-agl-core/recipes-platform/images/agl-image-boot.bb
+
+### minimal image and SDK (console)
+meta-agl-core/recipes-platform/images/agl-image-minimal.bb
+meta-agl-core/recipes-platform/images/agl-image-minimal-crosssdk.bb
+
+### weston-based image for re-use
+meta-agl-core/recipes-platform/images/agl-image-weston.bb
+
+### image for use in the YP autobuilder
+meta-agl-core/recipes-platform/images/agl-image-core-autobuilder.bb
+
+### image with extra QA tooling (e.g. to run LTP)
+meta-agl-core-test/images/agl-image-minimal-qa.bb
diff --git a/meta-agl/classes/agl-graphical.bbclass b/meta-agl/classes/agl-graphical.bbclass
deleted file mode 100644
index e99a441b7..000000000
--- a/meta-agl/classes/agl-graphical.bbclass
+++ /dev/null
@@ -1,7 +0,0 @@
-WESTONTTY ??= "1"
-WESTONUSER ??= "display"
-WESTONGROUP ??= "display"
-WESTONARGS ?= "--idle-time=0 --tty=${WESTONTTY}"
-WESTONLAUNCHARGS ??= "--tty /dev/tty${WESTONTTY} --user ${WESTONUSER}"
-DISPLAY_XDG_RUNTIME_DIR ??= "/run/platform/${WESTONUSER}"
-
diff --git a/meta-agl/conf/include/agl-devel.inc b/meta-agl/conf/include/agl-devel.inc
deleted file mode 100644
index 9610fd8fd..000000000
--- a/meta-agl/conf/include/agl-devel.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-IMAGE_FEATURES =+ "debug-tweaks eclipse-debug tools-debug tools-profile"
-
-IMAGE_INSTALL_append = " \
- packagegroup-agl-devel \
-"
-
-# disable install of debug files in SDK
-# initial value: SDKIMAGE_FEATURES="dev-pkgs dbg-pkgs staticdev-pkgs"
-SDKIMAGE_FEATURES="dev-pkgs"
-
-# allows insertion of code or items specific to developement
-OVERRIDES .= ":agl-devel"
-DISTRO_FEATURES_append = " agl-devel"
diff --git a/meta-agl/conf/include/base-agl.inc b/meta-agl/conf/include/base-agl.inc
deleted file mode 100644
index a332c08a4..000000000
--- a/meta-agl/conf/include/base-agl.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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 tarball again.
-MODULE_TARBALL_DEPLOY ?= "0"
-
-# Comment out below if want to use QtWebkit
-PACKAGECONFIG_remove_pn-qtquick1 = "webkit"
-
-
-ASSUME_PROVIDED_remove = "tar-native"
-
-# Use static IDs to enable full-filesystem updates
-USERADDEXTENSION = "useradd-staticids"
-USERADD_ERROR_DYNAMIC = "error"
-
diff --git a/meta-agl/conf/layer.conf b/meta-agl/conf/layer.conf
deleted file mode 100644
index 4943147e5..000000000
--- a/meta-agl/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH =. "${LAYERDIR}:"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "agl"
-BBFILE_PATTERN_agl = "^${LAYERDIR}/"
-BBFILE_PRIORITY_agl = "7"
diff --git a/meta-agl/recipes-bsp/.gitkeep b/meta-agl/recipes-bsp/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-bsp/.gitkeep
+++ /dev/null
diff --git a/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb b/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb
deleted file mode 100644
index c86838268..000000000
--- a/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "AGL Login manager"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-inherit agl-graphical
-
-SRC_URI += " \
- file://user-config.service \
- file://user-config.path \
- file://agl-user-session.pamd \
- file://agl-user-session@.service \
-"
-
-LOGIN_USER ??="agl-driver agl-passenger"
-
-do_install_append() {
-
- install -d ${D}${sysconfdir}/pam.d/
- install -m 0644 ${WORKDIR}/agl-user-session.pamd ${D}${sysconfdir}/pam.d/agl-user-session
-
- install -d ${D}${systemd_user_unitdir}
- install -d ${D}${systemd_user_unitdir}/default.target.wants
- install -m 0644 ${WORKDIR}/user-config.service ${D}${systemd_user_unitdir}
- install -m 0644 ${WORKDIR}/user-config.path ${D}${systemd_user_unitdir}
-
- sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
- -i ${D}${systemd_user_unitdir}/user-config.service
- sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
- -i ${D}${systemd_user_unitdir}/user-config.path
-
- ln -sf ${systemd_user_unitdir}/user-config.path ${D}${systemd_user_unitdir}/default.target.wants
-
- install -d ${D}${systemd_unitdir}/system/
- install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
- install -m 0644 ${WORKDIR}/agl-user-session@.service ${D}${systemd_unitdir}/system/
-
- for AGL_USER in ${LOGIN_USER};do
- ln -sf ${systemd_system_unitdir}/agl-user-session@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/agl-user-session@${AGL_USER}.service;
- done
-}
-
-FILES_${PN} += "${sysconfdir}/pam.d/agl-user-session"
-FILES_${PN} += "${systemd_user_unitdir}/*"
-FILES_${PN} += "${libdir}/systemd/user/default.target.wants/*"
-FILES_${PN} += "${systemd_unitdir}/system/agl-user-session@.service"
-FILES_${PN} += "${systemd_unitdir}/system/multi-user.target.wants/*"
diff --git a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd b/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd
deleted file mode 100644
index 462c3648b..000000000
--- a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd
+++ /dev/null
@@ -1,3 +0,0 @@
-account include common-account
-session required pam_loginuid.so
-session include common-session
diff --git a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service b/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service
deleted file mode 100644
index b128a40c8..000000000
--- a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=User Manager for UID %i
-After=systemd-user-sessions.service
-
-[Service]
-User=%i
-PAMName=agl-user-session
-ExecStart=-/bin/sleep 2147483648
-KillMode=mixed
-Delegate=yes
-TasksMax=infinity
diff --git a/meta-agl/recipes-config/agl-login-manager/files/user-config.path b/meta-agl/recipes-config/agl-login-manager/files/user-config.path
deleted file mode 100644
index 07f61f646..000000000
--- a/meta-agl/recipes-config/agl-login-manager/files/user-config.path
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=AGL user config unit path
-
-[Path]
-PathExists=@DISPLAY_XDG_RUNTIME_DIR@/wayland-0
-
-[Install]
-WantedBy=default.target
diff --git a/meta-agl/recipes-config/agl-login-manager/files/user-config.service b/meta-agl/recipes-config/agl-login-manager/files/user-config.service
deleted file mode 100644
index 0bf37fb4b..000000000
--- a/meta-agl/recipes-config/agl-login-manager/files/user-config.service
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=AGL user config
-
-[Service]
-ExecStart=/bin/ln -sf @DISPLAY_XDG_RUNTIME_DIR@/wayland-0 %t/
-
-[Install]
-WantedBy=default.target
diff --git a/meta-agl/recipes-connectivity/bluez5/.replaces.core b/meta-agl/recipes-connectivity/bluez5/.replaces.core
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-connectivity/bluez5/.replaces.core
+++ /dev/null
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5.inc b/meta-agl/recipes-connectivity/bluez5/bluez5.inc
deleted file mode 100644
index 5869a1764..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5.inc
+++ /dev/null
@@ -1,121 +0,0 @@
-SUMMARY = "Linux Bluetooth Stack Userland V5"
-DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries."
-HOMEPAGE = "http://www.bluez.org"
-SECTION = "libs"
-LICENSE = "GPLv2+ & LGPLv2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
- file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
- file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
-DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline"
-PROVIDES += "bluez-hcidump"
-RPROVIDES_${PN} += "bluez-hcidump"
-
-RCONFLICTS_${PN} = "bluez4"
-
-PACKAGECONFIG ??= "obex-profiles"
-PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
-PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
-
-SRC_URI = "\
- git://git.kernel.org/pub/scm/bluetooth/bluez.git;protocol=https;branch=master \
- file://out-of-tree.patch \
- file://init \
- file://run-ptest \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
- file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
- file://bluetooth.conf \
-"
-SRCREV = "c64b4d9e8dc3e36672061f39a9dba19ad0fb1ef1"
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest
-
-EXTRA_OECONF = "\
- --enable-tools \
- --disable-cups \
- --enable-test \
- --enable-datafiles \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
- --enable-library \
-"
-
-# bluez5 builds a large number of useful utilities but does not
-# install them. Specify which ones we want put into ${PN}-noinst-tools.
-NOINST_TOOLS_READLINE ??= ""
-NOINST_TOOLS_EXPERIMENTAL ??= ""
-NOINST_TOOLS = " \
- ${NOINST_TOOLS_READLINE} \
- ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
-"
-
-do_install_append() {
- install -d ${D}${INIT_D_DIR}
- install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
-
- install -d ${D}${sysconfdir}/bluetooth/
- if [ -f ${S}/profiles/audio/audio.conf ]; then
- install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
- fi
- if [ -f ${S}/profiles/network/network.conf ]; then
- install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
- fi
- if [ -f ${S}/profiles/input/input.conf ]; then
- install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
- fi
-
- install -m 0644 ${WORKDIR}/bluetooth.conf ${D}${sysconfdir}/dbus-1/system.d/bluetooth.conf
-
- if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
- sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
- fi
-
- # Install desired tools that upstream leaves in build area
- for f in ${NOINST_TOOLS} ; do
- install -m 755 ${B}/$f ${D}/${bindir}
- done
-}
-
-ALLOW_EMPTY_libasound-module-bluez = "1"
-PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
-
-FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
-FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${base_libdir}/udev/ ${nonarch_base_libdir}/udev/ ${systemd_unitdir}/ ${datadir}/dbus-1"
-FILES_${PN}-dev += "\
- ${libdir}/bluetooth/plugins/*.la \
- ${libdir}/alsa-lib/*.la \
-"
-
-FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
- ${exec_prefix}/lib/systemd/user/obex.service \
- ${datadir}/dbus-1/services/org.bluez.obex.service \
- "
-SYSTEMD_SERVICE_${PN}-obex = "obex.service"
-
-FILES_${PN}-testtools = "${libdir}/bluez/test/*"
-
-def get_noinst_tools_paths (d, bb, tools):
- s = list()
- bindir = d.getVar("bindir", True)
- for bdp in tools.split():
- f = os.path.basename(bdp)
- s.append("%s/%s" % (bindir, f))
- return "\n".join(s)
-
-FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS', True))}"
-
-RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject"
-
-SYSTEMD_SERVICE_${PN} = "bluetooth.service"
-INITSCRIPT_PACKAGES = "${PN}"
-INITSCRIPT_NAME_${PN} = "bluetooth"
-
-EXCLUDE_FROM_WORLD = "1"
-
-do_compile_ptest() {
- oe_runmake buildtests
-}
-
-do_install_ptest() {
- cp -r ${B}/unit/ ${D}${PTEST_PATH}
- rm -f ${D}${PTEST_PATH}/unit/*.o
-}
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/meta-agl/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
deleted file mode 100644
index 2fde7bc06..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
-Date: Sat, 12 Oct 2013 17:45:25 +0200
-Subject: [PATCH] Allow using obexd without systemd in the user session
-
-Not all sessions run systemd --user (actually, the majority
-doesn't), so the dbus daemon must be able to spawn obexd
-directly, and to do so it needs the full path of the daemon.
-
-Upstream-Status: Denied
-
-Not accepted by upstream maintainer for being a distro specific
-configuration. See thread:
-
-http://thread.gmane.org/gmane.linux.bluez.kernel/38725/focus=38843
-
-Signed-off-by: Javier Viguera <javier.viguera@digi.com>
----
- Makefile.obexd | 4 ++--
- obexd/src/org.bluez.obex.service | 4 ----
- obexd/src/org.bluez.obex.service.in | 4 ++++
- 3 files changed, 6 insertions(+), 6 deletions(-)
- delete mode 100644 obexd/src/org.bluez.obex.service
- create mode 100644 obexd/src/org.bluez.obex.service.in
-
-diff --git a/Makefile.obexd b/Makefile.obexd
-index 2e33cbc72f2b..d5d858c857b4 100644
---- a/Makefile.obexd
-+++ b/Makefile.obexd
-@@ -2,12 +2,12 @@
- if SYSTEMD
- systemduserunitdir = @SYSTEMD_USERUNITDIR@
- systemduserunit_DATA = obexd/src/obex.service
-+endif
-
- dbussessionbusdir = @DBUS_SESSIONBUSDIR@
- dbussessionbus_DATA = obexd/src/org.bluez.obex.service
--endif
-
--EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
-+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
-
- obex_plugindir = $(libdir)/obex/plugins
-
-diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
-deleted file mode 100644
-index a53808884554..000000000000
---- a/obexd/src/org.bluez.obex.service
-+++ /dev/null
-@@ -1,4 +0,0 @@
--[D-BUS Service]
--Name=org.bluez.obex
--Exec=/bin/false
--SystemdService=dbus-org.bluez.obex.service
-diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
-new file mode 100644
-index 000000000000..9c815f246b77
---- /dev/null
-+++ b/obexd/src/org.bluez.obex.service.in
-@@ -0,0 +1,4 @@
-+[D-BUS Service]
-+Name=org.bluez.obex
-+Exec=@libexecdir@/obexd
-+SystemdService=dbus-org.bluez.obex.service
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/meta-agl/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
deleted file mode 100644
index 24ddae6b6..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 4bdf0f96dcaa945fd29f26d56e5b36d8c23e4c8b Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Fri, 1 Apr 2016 17:07:34 +0300
-Subject: [PATCH] tests: add a target for building tests without running them
-
-Upstream-Status: Inappropriate [oe specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- Makefile.am | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/Makefile.am b/Makefile.am
-index 1a48a71..ba3b92f 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -425,6 +425,9 @@ endif
- TESTS = $(unit_tests)
- AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
-
-+# This allows building tests without running them
-+buildtests: $(TESTS)
-+
- if DBUS_RUN_SESSION
- AM_TESTS_ENVIRONMENT += dbus-run-session --
- endif
---
-2.8.0.rc3
-
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf b/meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf
deleted file mode 100644
index 8e2204b22..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/bluetooth.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-<!-- This configuration file specifies the required security policies
- for Bluetooth core daemon to work. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-
- <!-- ../system.conf have denied everything, so we just punch some holes -->
-
- <policy user="root">
- <allow own="org.bluez"/>
- <allow send_destination="org.bluez"/>
- <allow send_interface="org.bluez.Agent1"/>
- <allow send_interface="org.bluez.MediaEndpoint1"/>
- <allow send_interface="org.bluez.MediaPlayer1"/>
- <allow send_interface="org.bluez.ThermometerWatcher1"/>
- <allow send_interface="org.bluez.AlertAgent1"/>
- <allow send_interface="org.bluez.Profile1"/>
- <allow send_interface="org.bluez.HeartRateWatcher1"/>
- <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
- <allow send_interface="org.bluez.GattCharacteristic1"/>
- <allow send_interface="org.bluez.GattDescriptor1"/>
- <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
- <allow send_interface="org.freedesktop.DBus.Properties"/>
- <allow receive_type="signal" receive_sender="org.bluez" receive_interface="org.freedesktop.DBus.Properties"/>
- <allow receive_type="signal" receive_sender="org.bluez" receive_interface="org.freedesktop.DBus.ObjectManager"/>
- </policy>
-
- <policy at_console="true">
- <allow send_destination="org.bluez"/>
- </policy>
-
- <!-- allow users of lp group (printing subsystem) to
- communicate with bluetoothd -->
- <policy group="lp">
- <allow send_destination="org.bluez"/>
- </policy>
-
-</busconfig>
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/init b/meta-agl/recipes-connectivity/bluez5/bluez5/init
deleted file mode 100644
index 489e9b9eb..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/init
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DESC=bluetooth
-
-DAEMON=@LIBEXECDIR@/bluetooth/bluetoothd
-
-# If you want to be ignore error of "org.freedesktop.hostname1",
-# please enable NOPLUGIN_OPTION.
-# NOPLUGIN_OPTION="--noplugin=hostname"
-NOPLUGIN_OPTION=""
-SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
-
-test -f $DAEMON || exit 0
-
-# FIXME: any of the sourced files may fail if/with syntax errors
-test -f /etc/default/bluetooth && . /etc/default/bluetooth
-test -f /etc/default/rcS && . /etc/default/rcS
-
-set -e
-
-case $1 in
- start)
- echo "Starting $DESC"
-
- if test "$BLUETOOTH_ENABLED" = 0; then
- echo "disabled. see /etc/default/bluetooth"
- exit 0
- fi
-
- start-stop-daemon --start --background $SSD_OPTIONS
- echo "${DAEMON##*/}"
-
- ;;
- stop)
- echo "Stopping $DESC"
- if test "$BLUETOOTH_ENABLED" = 0; then
- echo "disabled."
- exit 0
- fi
- start-stop-daemon --stop $SSD_OPTIONS
- echo "${DAEMON}"
- ;;
- restart|force-reload)
- $0 stop
- sleep 1
- $0 start
- ;;
- status)
- pidof ${DAEMON} >/dev/null
- status=$?
- if [ $status -eq 0 ]; then
- echo "bluetooth is running."
- else
- echo "bluetooth is not running"
- fi
- exit $status
- ;;
- *)
- N=/etc/init.d/bluetooth
- echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# vim:noet
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/out-of-tree.patch b/meta-agl/recipes-connectivity/bluez5/bluez5/out-of-tree.patch
deleted file mode 100644
index 3ee79d704..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/out-of-tree.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From ed55b49a226ca3909f52416be2ae5ce1c5ca2cb2 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Fri, 22 Apr 2016 15:40:37 +0100
-Subject: [PATCH] Makefile.obexd: add missing mkdir in builtin.h generation
-
-In parallel out-of-tree builds it's possible that obexd/src/builtin.h is
-generated before the target directory has been implicitly created. Solve this by
-creating the directory before writing into it.
-
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- Makefile.obexd | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile.obexd b/Makefile.obexd
-index 2e33cbc..c8286f0 100644
---- a/Makefile.obexd
-+++ b/Makefile.obexd
-@@ -105,2 +105,3 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
- obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
-+ $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
---
-2.8.0.rc3
-
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/run-ptest b/meta-agl/recipes-connectivity/bluez5/bluez5/run-ptest
deleted file mode 100644
index 21df00c32..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5/run-ptest
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-
-cd unit
-
-failed=0
-all=0
-
-for f in test-*; do
- "./$f"
- case "$?" in
- 0)
- echo "PASS: $f"
- all=$((all + 1))
- ;;
- 77)
- echo "SKIP: $f"
- ;;
- *)
- echo "FAIL: $f"
- failed=$((failed + 1))
- all=$((all + 1))
- ;;
- esac
-done
-
-if [ "$failed" -eq 0 ] ; then
- echo "All $all tests passed"
-else
- echo "$failed of $all tests failed"
-fi
-
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5_5.43.bb b/meta-agl/recipes-connectivity/bluez5/bluez5_5.43.bb
deleted file mode 100644
index e10b82dd6..000000000
--- a/meta-agl/recipes-connectivity/bluez5/bluez5_5.43.bb
+++ /dev/null
@@ -1,55 +0,0 @@
-require bluez5.inc
-
-REQUIRED_DISTRO_FEATURES = "bluez5"
-
-SRC_URI[md5sum] = "698def88df96840dfbb0858bb6d73350"
-SRC_URI[sha256sum] = "16c9c05d2a1da644ce3570d975ada3643d2e60c007a955bac09c0a0efeb58d15"
-
-# noinst programs in Makefile.tools that are conditional on READLINE
-# support
-NOINST_TOOLS_READLINE ?= " \
- attrib/gatttool \
- tools/obex-client-tool \
- tools/obex-server-tool \
- tools/bluetooth-player \
- tools/obexctl \
- tools/btmgmt \
-"
-
-# noinst programs in Makefile.tools that are conditional on EXPERIMENTAL
-# support
-NOINST_TOOLS_EXPERIMENTAL ?= " \
- emulator/btvirt \
- emulator/b1ee \
- emulator/hfp \
- tools/3dsp \
- tools/mgmt-tester \
- tools/gap-tester \
- tools/l2cap-tester \
- tools/sco-tester \
- tools/smp-tester \
- tools/hci-tester \
- tools/rfcomm-tester \
- tools/bdaddr \
- tools/avinfo \
- tools/avtest \
- tools/scotest \
- tools/amptest \
- tools/hwdb \
- tools/hcieventmask \
- tools/hcisecfilter \
- tools/btinfo \
- tools/btattach \
- tools/btsnoop \
- tools/btproxy \
- tools/btiotest \
- tools/mcaptest \
- tools/cltest \
- tools/oobtest \
- tools/seq2bseq \
- tools/ibeacon \
- tools/btgatt-client \
- tools/btgatt-server \
- tools/gatt-service \
- profiles/iap/iapd \
-"
diff --git a/meta-agl/recipes-connectivity/busybox/busybox_%.bbappend b/meta-agl/recipes-connectivity/busybox/busybox_%.bbappend
deleted file mode 100644
index 198b651dd..000000000
--- a/meta-agl/recipes-connectivity/busybox/busybox_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-SRC_URI += "file://enable-wget-https.cfg"
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
diff --git a/meta-agl/recipes-connectivity/connman/files/0001-disable-when-booting-over-nfs.patch b/meta-agl/recipes-connectivity/connman/files/0001-disable-when-booting-over-nfs.patch
deleted file mode 100644
index b4704de68..000000000
--- a/meta-agl/recipes-connectivity/connman/files/0001-disable-when-booting-over-nfs.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/connman.service.in 2016-08-15 13:51:03.479478140 +0200
-+++ b/src/connman.service.in 2016-08-15 13:51:33.469478267 +0200
-@@ -6,6 +6,7 @@ RequiresMountsFor=@localstatedir@/lib/co
- After=dbus.service network-pre.target systemd-sysusers.service
- Before=network.target multi-user.target shutdown.target
- Wants=network.target
-+ConditionKernelCommandLine=!root=/dev/nfs
-
- [Service]
- Type=dbus
diff --git a/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr/0001-remove-I-usr-include-in-pkg-config.patch b/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr/0001-remove-I-usr-include-in-pkg-config.patch
deleted file mode 100644
index 86b7392df..000000000
--- a/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr/0001-remove-I-usr-include-in-pkg-config.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 3aeaf8054fcb2617ca8f6196ca32be3e69337f77 Mon Sep 17 00:00:00 2001
-From: Martin Kelly <mkelly@xevo.com>
-Date: Fri, 21 Apr 2017 10:29:19 -0700
-Subject: [PATCH] remove -I/usr/include in pkg-config
-
-This shouldn't be necessary as it's part of the default compiler include
-paths anyway. Morever, it can cause GCC 6 C++ build failures in
-downstream packages when combined with QMake (such as
-qtmultimedia-rtlfm-radio-plugin).
-
-Fix these issues by removing it.
-
-Upstream-Status: Inappropriate [disable-feature]
-
-This patch should not go upstream because it breaks the ability to build
-with --prefix. That's not a problem for Openembedded, but it is for
-upstream more generally. See this mail thread for more information:
-
-http://lists.osmocom.org/pipermail/osmocom-sdr/2017-April/001580.html
-
-Signed-off-by: Martin Kelly <mkelly@xevo.com>
----
- librtlsdr.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/librtlsdr.pc.in b/librtlsdr.pc.in
-index 5e55049..84b6d0c 100644
---- a/librtlsdr.pc.in
-+++ b/librtlsdr.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: RTL-SDR Library
- Description: C Utility Library
- Version: @VERSION@
--Cflags: -I${includedir}/ @RTLSDR_PC_CFLAGS@
-+Cflags: @RTLSDR_PC_CFLAGS@
- Libs: -L${libdir} -lrtlsdr -lusb-1.0
- Libs.private: @RTLSDR_PC_LIBS@
---
-2.1.4
-
diff --git a/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb b/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb
deleted file mode 100644
index 7d5c0217d..000000000
--- a/meta-agl/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "Turns a Realtek RTL2832U-based DVB dongle into a SDR receiver"
-DESCRIPTION = "DVB-T dongles based on the Realtek RTL2832U chipset can be used as Software Digital Radio adapters, since the chip allows transferring raw I/Q samples to the host, which is really used for DAB/DAB+/FM demodulation."
-HOMEPAGE = "http://sdr.osmocom.org/trac/wiki/rtl-sdr"
-
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
- file://src/librtlsdr.c;endline=18;md5=1b05599c3ebd4d74857a0a7c45f3d4ef"
-
-DEPENDS = "libusb1"
-
-SRC_URI = "git://git.osmocom.org/rtl-sdr \
- file://0001-remove-I-usr-include-in-pkg-config.patch \
- "
-SRCREV = "e3c03f738f5aef4dc51e2b741fbdb542b9cc1bb1"
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig
-
-EXTRA_OECONF = "--enable-driver-detach"
-#CFLAGS_remove = "
-do_configure_append() {
- # remove included temporary path from pc file due to pass-through of OE CFLAGS
- # debug-prefix-map
- # See: http://lists.openembedded.org/pipermail/openembedded-devel/2016-May/107456.html
- sed -i -e "s# -fdebug-prefix-map=.*##g" librtlsdr.pc
-} \ No newline at end of file
diff --git a/meta-agl/recipes-connectivity/rygel/.appends.meta-multimedia b/meta-agl/recipes-connectivity/rygel/.appends.meta-multimedia
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-connectivity/rygel/.appends.meta-multimedia
+++ /dev/null
diff --git a/meta-agl/recipes-connectivity/rygel/files/0001-Add-LightMediaScanner-plugin.patch b/meta-agl/recipes-connectivity/rygel/files/0001-Add-LightMediaScanner-plugin.patch
deleted file mode 100644
index eca08ee84..000000000
--- a/meta-agl/recipes-connectivity/rygel/files/0001-Add-LightMediaScanner-plugin.patch
+++ /dev/null
@@ -1,2541 +0,0 @@
-From 8bb9ae73464dd76f5fa94f2e9ba76b0bd88114df Mon Sep 17 00:00:00 2001
-From: Manuel Bachmann <manuel.bachmann@iot.bzh>
-Date: Mon, 26 Oct 2015 04:18:33 +0000
-Subject: [PATCH] Add LightMediaScanner plugin
-
-Add a new plugin based on LightMediaScanner :
-https://github.com/profusion/lightmediascanner
-
-Shorty put, this plugin does not do the indexing itself as
-"media-export" does, but defers this task to the
-"lightmediascannerd" daemon, with which it communicates
-via a D-Bus interface.
-The remote indexing daemon installs itself as a separate
-package, and is designed to be ultra-lightweight and fast.
-
-This commit is the rebase and fusion of all work done
-first on Maemo (lms.garage.maemo.org), then on Tizen IVI
-(review.tizen.org/git/?p=profile/ivi/rygel.git) and right
-now on AGL (automotivelinux.org) where several components
-depend on LightMediaScanner.
-A splitted version (13 commits) can also be seen on :
-https://github.com/Tarnyko/rygel
-
-It difffers mostly in that it lets "media-export" plugin
-as the default, just adding itself in "rygel.conf" as an
-alternative.
-
-(note : reporter is not code Author, see patch for details)
-(note 2 : rebased on top of 0.26.1)
-
-Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Author: Alexander Kanavin <alex.kanavin@gmail.com>
-Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
----
- configure.ac | 18 +
- data/rygel.conf | 6 +-
- src/plugins/Makefile.am | 5 +
- src/plugins/lms/Makefile.am | 46 +++
- src/plugins/lms/README | 17 +
- src/plugins/lms/lms.plugin.in | 7 +
- src/plugins/lms/rygel-lms-album.vala | 173 +++++++++
- src/plugins/lms/rygel-lms-albums.vala | 175 +++++++++
- src/plugins/lms/rygel-lms-all-images.vala | 95 +++++
- src/plugins/lms/rygel-lms-all-music.vala | 169 ++++++++
- src/plugins/lms/rygel-lms-all-videos.vala | 123 ++++++
- src/plugins/lms/rygel-lms-artist.vala | 75 ++++
- src/plugins/lms/rygel-lms-artists.vala | 62 +++
- src/plugins/lms/rygel-lms-category-container.vala | 428 +++++++++++++++++++++
- src/plugins/lms/rygel-lms-collate.c | 49 +++
- src/plugins/lms/rygel-lms-database.vala | 294 ++++++++++++++
- src/plugins/lms/rygel-lms-dbus-interfaces.vala | 30 ++
- src/plugins/lms/rygel-lms-image-root.vala | 35 ++
- src/plugins/lms/rygel-lms-image-year.vala | 114 ++++++
- src/plugins/lms/rygel-lms-image-years.vala | 59 +++
- src/plugins/lms/rygel-lms-music-root.vala | 36 ++
- src/plugins/lms/rygel-lms-plugin-factory.vala | 40 ++
- src/plugins/lms/rygel-lms-plugin.vala | 35 ++
- src/plugins/lms/rygel-lms-root-container.vala | 58 +++
- src/plugins/lms/rygel-lms-sql-function.vala | 31 ++
- src/plugins/lms/rygel-lms-sql-operator.vala | 73 ++++
- 26 files changed, 2252 insertions(+), 1 deletion(-)
- create mode 100644 src/plugins/lms/Makefile.am
- create mode 100644 src/plugins/lms/README
- create mode 100644 src/plugins/lms/lms.plugin.in
- create mode 100644 src/plugins/lms/rygel-lms-album.vala
- create mode 100644 src/plugins/lms/rygel-lms-albums.vala
- create mode 100644 src/plugins/lms/rygel-lms-all-images.vala
- create mode 100644 src/plugins/lms/rygel-lms-all-music.vala
- create mode 100644 src/plugins/lms/rygel-lms-all-videos.vala
- create mode 100644 src/plugins/lms/rygel-lms-artist.vala
- create mode 100644 src/plugins/lms/rygel-lms-artists.vala
- create mode 100644 src/plugins/lms/rygel-lms-category-container.vala
- create mode 100644 src/plugins/lms/rygel-lms-collate.c
- create mode 100644 src/plugins/lms/rygel-lms-database.vala
- create mode 100644 src/plugins/lms/rygel-lms-dbus-interfaces.vala
- create mode 100644 src/plugins/lms/rygel-lms-image-root.vala
- create mode 100644 src/plugins/lms/rygel-lms-image-year.vala
- create mode 100644 src/plugins/lms/rygel-lms-image-years.vala
- create mode 100644 src/plugins/lms/rygel-lms-music-root.vala
- create mode 100644 src/plugins/lms/rygel-lms-plugin-factory.vala
- create mode 100644 src/plugins/lms/rygel-lms-plugin.vala
- create mode 100644 src/plugins/lms/rygel-lms-root-container.vala
- create mode 100644 src/plugins/lms/rygel-lms-sql-function.vala
- create mode 100644 src/plugins/lms/rygel-lms-sql-operator.vala
-
-diff --git a/configure.ac b/configure.ac
-index 7ae1105..275fd99 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -170,6 +170,18 @@ AS_IF([test "x$enable_ruih_plugin" = "xyes"],
- libxml-2.0 >= $LIBXML_REQUIRED])
- ])
-
-+
-+RYGEL_ADD_PLUGIN([lms],[LightMediaScanner],[yes])
-+AS_IF([test "x$enable_lms_plugin" = "xyes"],
-+ [
-+ PKG_CHECK_MODULES([RYGEL_PLUGIN_LMS_DEPS],
-+ [$RYGEL_COMMON_MODULES
-+ gio-2.0 >= $GIO_REQUIRED
-+ sqlite3 >= $LIBSQLITE3_REQUIRED])
-+ RYGEL_PLUGIN_LMS_DEPS_VALAFLAGS="$RYGEL_COMMON_MODULES_VALAFLAGS --pkg gio-2.0 --pkg gee-0.8 --pkg sqlite3"
-+ AC_SUBST([RYGEL_PLUGIN_LMS_DEPS_VALAFLAGS])
-+ ])
-+
- AS_IF([test "x$with_media_engine" = "xgstreamer"],
- [
- RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes])
-@@ -332,6 +344,11 @@ then
- fi
- fi
-
-+dnl Check additional requirements for LMS plugin
-+if test "x$enable_lms_plugin" = "xyes";
-+then
-+ RYGEL_CHECK_PACKAGES([sqlite3])
-+fi
-
- RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
- AS_IF([test "x$enable_tracker_plugin" = "xyes"],
-@@ -513,6 +530,7 @@ echo "
- version: ${tracker_api_version}
- mediathek: ${enable_mediathek_plugin}
- media-export ${enable_media_export_plugin}
-+ lightmediascanner ${enable_lms_plugin}
- external: ${enable_external_plugin}
- MPRIS2: ${enable_mpris_plugin}
- gst-launch: ${enable_gst_launch_plugin}
-diff --git a/data/rygel.conf b/data/rygel.conf
-index 6b1c1c4..8677a0d 100644
---- a/data/rygel.conf
-+++ b/data/rygel.conf
-@@ -99,7 +99,7 @@ strict-sharing=false
- title=@REALNAME@'s media on @PRETTY_HOSTNAME@
-
- [MediaExport]
--enabled=true
-+enabled=false
- title=@REALNAME@'s media on @PRETTY_HOSTNAME@
- # List of URIs to export. Following variables are automatically substituted by
- # the appropriate XDG standard media folders by Rygel for you.
-@@ -114,6 +114,10 @@ monitor-changes=true
- monitor-grace-timeout=5
- virtual-folders=true
-
-+[LightMediaScanner]
-+enabled=true
-+title=My Media
-+
- [Playbin]
- enabled=true
- title=Audio/Video playback on @PRETTY_HOSTNAME@
-diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
-index d116f09..40791f0 100644
---- a/src/plugins/Makefile.am
-+++ b/src/plugins/Makefile.am
-@@ -10,6 +10,10 @@ if BUILD_MEDIA_EXPORT_PLUGIN
- MEDIA_EXPORT_PLUGIN = media-export
- endif
-
-+if BUILD_LMS_PLUGIN
-+LMS_PLUGIN = lms
-+endif
-+
- if BUILD_EXTERNAL_PLUGIN
- EXTERNAL_PLUGIN = external
- endif
-@@ -33,6 +37,7 @@ endif
- SUBDIRS = $(TRACKER_PLUGIN) \
- $(MEDIATHEK_PLUGIN) \
- $(MEDIA_EXPORT_PLUGIN) \
-+ $(LMS_PLUGIN) \
- $(EXTERNAL_PLUGIN) \
- $(MPRIS_PLUGIN) \
- $(GST_LAUNCH_PLUGIN) \
-diff --git a/src/plugins/lms/Makefile.am b/src/plugins/lms/Makefile.am
-new file mode 100644
-index 0000000..f96a2ab
---- /dev/null
-+++ b/src/plugins/lms/Makefile.am
-@@ -0,0 +1,46 @@
-+include $(top_srcdir)/common.am
-+
-+plugin_LTLIBRARIES = librygel-lms.la
-+plugin_DATA = lms.plugin
-+
-+librygel_lms_la_SOURCES = \
-+ rygel-lms-plugin.vala \
-+ rygel-lms-plugin-factory.vala \
-+ rygel-lms-root-container.vala \
-+ rygel-lms-music-root.vala \
-+ rygel-lms-image-root.vala \
-+ rygel-lms-category-container.vala \
-+ rygel-lms-all-music.vala \
-+ rygel-lms-album.vala \
-+ rygel-lms-albums.vala \
-+ rygel-lms-artist.vala \
-+ rygel-lms-artists.vala \
-+ rygel-lms-all-videos.vala \
-+ rygel-lms-database.vala \
-+ rygel-lms-all-images.vala \
-+ rygel-lms-image-years.vala \
-+ rygel-lms-image-year.vala \
-+ rygel-lms-sql-function.vala \
-+ rygel-lms-sql-operator.vala \
-+ rygel-lms-collate.c \
-+ rygel-lms-dbus-interfaces.vala
-+
-+librygel_lms_la_VALAFLAGS = \
-+ --enable-experimental \
-+ $(RYGEL_PLUGIN_LMS_DEPS_VALAFLAGS) \
-+ $(RYGEL_COMMON_LIBRYGEL_SERVER_VALAFLAGS) \
-+ $(RYGEL_COMMON_VALAFLAGS)
-+
-+librygel_lms_la_CFLAGS = \
-+ $(RYGEL_PLUGIN_LMS_DEPS_CFLAGS) \
-+ $(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
-+ -DG_LOG_DOMAIN='"Lms"'
-+
-+librygel_lms_la_LIBADD = \
-+ $(RYGEL_PLUGIN_LMS_DEPS_LIBS) \
-+ $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
-+
-+librygel_lms_la_LDFLAGS = \
-+ $(RYGEL_PLUGIN_LINKER_FLAGS)
-+
-+EXTRA_DIST = lms.plugin.in
-diff --git a/src/plugins/lms/README b/src/plugins/lms/README
-new file mode 100644
-index 0000000..b741806
---- /dev/null
-+++ b/src/plugins/lms/README
-@@ -0,0 +1,17 @@
-+rygel-lms
-+=========
-+
-+A rygel mediaserver plugin that exposes a lightmediascanner database
-+as a Mediaserver.
-+
-+Configuration in rygel.conf:
-+
-+ [LightMediaScanner]
-+ db-path=/path/to/lightmediascannerd.sqlite3
-+ title=My Media
-+
-+* Supports browsing and searching (but in many cases searches will
-+ still fall back to the inefficient simple_search()).
-+* UpdateIDs are not yet supported as lightmediascanner seems to have
-+ not change signal support yet
-+* No real DLNA CTT testing has been done so far
-diff --git a/src/plugins/lms/lms.plugin.in b/src/plugins/lms/lms.plugin.in
-new file mode 100644
-index 0000000..9db9895
---- /dev/null
-+++ b/src/plugins/lms/lms.plugin.in
-@@ -0,0 +1,7 @@
-+[Plugin]
-+Version = @VERSION@
-+Module = lms
-+Name = LMS
-+License = LGPL
-+Description = LMS DMS plugin for Rygel
-+Copyright = Copyright © Intel
-diff --git a/src/plugins/lms/rygel-lms-album.vala b/src/plugins/lms/rygel-lms-album.vala
-new file mode 100644
-index 0000000..4fea17a
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-album.vala
-@@ -0,0 +1,173 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.Album : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT_TEMPLATE =
-+ "SELECT COUNT(audios.id) " +
-+ "FROM audios, files " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;";
-+
-+ private static const string SQL_COUNT_WITH_FILTER_TEMPLATE =
-+ "SELECT COUNT(audios.id), audios.title as title, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;";
-+
-+ private static const string SQL_FIND_OBJECT_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name, " +
-+ "audio_albums.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id AND audios.album_id = %s;";
-+
-+ private static const string SQL_ADDED_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ private static const string SQL_REMOVED_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "WHERE dtime <> 0 AND audios.id = files.id AND audios.album_id = %s " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = statement.column_int (0);
-+ var path = statement.column_text (1);
-+ var mime_type = statement.column_text(10);
-+
-+ if (mime_type == null || mime_type.length == 0) {
-+ /* TODO is this correct? */
-+ debug ("Music item %d (%s) has no MIME type",
-+ id,
-+ path);
-+ }
-+
-+ var title = statement.column_text(3);
-+ var song_id = this.build_child_id (id);
-+ var song = new MusicItem (song_id, this, title);
-+ song.ref_id = this.build_reference_id (id);
-+ song.size = statement.column_int(2);
-+ song.track_number = statement.column_int(4);
-+ song.duration = statement.column_int(5);
-+ song.channels = statement.column_int(6);
-+ song.sample_freq = statement.column_int(7);
-+ song.bitrate = statement.column_int(8);
-+ song.dlna_profile = statement.column_text(9);
-+ song.mime_type = mime_type;
-+ song.artist = statement.column_text(11);
-+ song.album = statement.column_text(12);
-+ File file = File.new_for_path (path);
-+ song.add_uri (file.get_uri ());
-+
-+ return song;
-+ }
-+
-+ private static string get_sql_all (string db_id) {
-+ return (SQL_ALL_TEMPLATE.printf (db_id));
-+ }
-+ private static string get_sql_find_object (string db_id) {
-+ return (SQL_FIND_OBJECT_TEMPLATE.printf (db_id));
-+ }
-+ private static string get_sql_count (string db_id) {
-+ return (SQL_COUNT_TEMPLATE.printf (db_id));
-+ }
-+ private static string get_sql_added (string db_id) {
-+ return (SQL_ADDED_TEMPLATE.printf (db_id));
-+ }
-+ private static string get_sql_removed (string db_id) {
-+ return (SQL_REMOVED_TEMPLATE.printf (db_id));
-+ }
-+
-+ protected override string get_sql_all_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return this.sql_all;
-+ }
-+ var filter_str = "%s AND %s".printf (this.db_id, filter);
-+ return (SQL_ALL_TEMPLATE.printf (filter_str));
-+ }
-+
-+ protected override string get_sql_count_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return this.sql_count;
-+ }
-+ var filter_str = "%s AND %s".printf (this.db_id, filter);
-+ return (SQL_COUNT_WITH_FILTER_TEMPLATE.printf (filter_str));
-+ }
-+
-+ public Album (string db_id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db) {
-+ base (db_id,
-+ parent,
-+ title,
-+ lms_db,
-+ get_sql_all (db_id),
-+ get_sql_find_object (db_id),
-+ get_sql_count (db_id),
-+ get_sql_added (db_id),
-+ get_sql_removed (db_id)
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-albums.vala b/src/plugins/lms/rygel-lms-albums.vala
-new file mode 100644
-index 0000000..309a352
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-albums.vala
-@@ -0,0 +1,175 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.Albums : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL =
-+ "SELECT audio_albums.id, audio_albums.name as title, " +
-+ "audio_artists.name as artist " +
-+ "FROM audio_albums " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audio_albums.artist_id = audio_artists.id " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_ALL_WITH_FILTER_TEMPLATE =
-+ "SELECT audio_albums.id, audio_albums.name as title, " +
-+ "audio_artists.name as artist " +
-+ "FROM audio_albums " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audio_albums.artist_id = audio_artists.id " +
-+ "WHERE %s " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT COUNT(audio_albums.id) " +
-+ "FROM audio_albums;";
-+
-+ private static const string SQL_COUNT_WITH_FILTER_TEMPLATE =
-+ "SELECT COUNT(audio_albums.id), audio_albums.name as title, " +
-+ "audio_artists.name as artist " +
-+ "FROM audio_albums " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audio_albums.artist_id = audio_artists.id " +
-+ "WHERE %s;";
-+
-+ /* count songs inside albums */
-+ private static const string SQL_CHILD_COUNT_WITH_FILTER_TEMPLATE =
-+ "SELECT COUNT(audios.id), audios.title as title, " +
-+ "audio_artists.name as artist " +
-+ "FROM audios, files, audio_albums " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_albums.id %s;";
-+
-+ /* select songs inside albums */
-+ private static const string SQL_CHILD_ALL_WITH_FILTER_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name, audio_albums.id " +
-+ "FROM audios, files, audio_albums " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_albums.id %s " +
-+ "LIMIT ? OFFSET ?;";
-+
-+
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT audio_albums.id, audio_albums.name " +
-+ "FROM audio_albums " +
-+ "WHERE audio_albums.id = ?;";
-+
-+ protected override string get_sql_all_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return Albums.SQL_ALL;
-+ }
-+ return (Albums.SQL_ALL_WITH_FILTER_TEMPLATE.printf (filter));
-+ }
-+
-+ protected override string get_sql_count_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return Albums.SQL_COUNT;
-+ }
-+ return (Albums.SQL_COUNT_WITH_FILTER_TEMPLATE.printf (filter));
-+ }
-+
-+ protected override uint get_child_count_with_filter (string where_filter,
-+ ValueArray args)
-+ {
-+
-+ /* search the children (albums) as usual */
-+ var count = base.get_child_count_with_filter (where_filter, args);
-+
-+ /* now search the album contents */
-+ var filter = "";
-+ if (where_filter.length > 0) {
-+ filter = "AND %s".printf (where_filter);
-+ }
-+ var query = Albums.SQL_CHILD_COUNT_WITH_FILTER_TEMPLATE.printf (filter);
-+ try {
-+ var stmt = this.lms_db.prepare_and_init (query, args.values);
-+ if (stmt.step () == Sqlite.ROW) {
-+ count += stmt.column_int (0);
-+ }
-+ } catch (DatabaseError e) {
-+ warning ("Query failed: %s", e.message);
-+ }
-+
-+ return count;
-+ }
-+
-+ protected override MediaObjects? get_children_with_filter (string where_filter,
-+ ValueArray args,
-+ string sort_criteria,
-+ uint offset,
-+ uint max_count) {
-+ var children = base. get_children_with_filter (where_filter,
-+ args,
-+ sort_criteria,
-+ offset,
-+ max_count);
-+ var filter = "";
-+ if (where_filter.length > 0) {
-+ filter = "AND %s".printf (where_filter);
-+ }
-+ var query = Albums.SQL_CHILD_ALL_WITH_FILTER_TEMPLATE.printf (filter);
-+ try {
-+ var stmt = this.lms_db.prepare_and_init (query, args.values);
-+ while (Database.get_children_step (stmt)) {
-+ var album_id = stmt.column_text (13);
-+ var album = new Album (album_id, this, "", this.lms_db);
-+
-+ var song = album.object_from_statement (stmt);
-+ song.parent_ref = song.parent;
-+ children.add (song);
-+
-+ }
-+ } catch (DatabaseError e) {
-+ warning ("Query failed: %s", e.message);
-+ }
-+
-+ return children;
-+ }
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = "%d".printf (statement.column_int (0));
-+ LMS.Album album = new LMS.Album (id,
-+ this,
-+ statement.column_text (1),
-+ this.lms_db);
-+ return album;
-+ }
-+
-+ public Albums (MediaContainer parent,
-+ LMS.Database lms_db) {
-+ base ("albums",
-+ parent,
-+ _("Albums"),
-+ lms_db,
-+ Albums.SQL_ALL,
-+ Albums.SQL_FIND_OBJECT,
-+ Albums.SQL_COUNT,
-+ null, null);
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-all-images.vala b/src/plugins/lms/rygel-lms-all-images.vala
-new file mode 100644
-index 0000000..0b54c7f
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-images.vala
-@@ -0,0 +1,95 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.AllImages : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT count(images.id) " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id;";
-+
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND files.id = ? AND images.id = files.id;";
-+
-+ private static const string SQL_ADDED =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ private static const string SQL_REMOVED =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime " +
-+ "FROM images, files " +
-+ "WHERE dtime <> 0 AND images.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = statement.column_int(0);
-+ var path = statement.column_text(6);
-+ var mime_type = statement.column_text(9);
-+
-+ if (mime_type == null || mime_type.length == 0){
-+ /* TODO is this correct? */
-+ debug ("Image item %d (%s) has no MIME type",
-+ id,
-+ path);
-+ }
-+
-+ var title = statement.column_text(1);
-+ var image = new ImageItem(this.build_child_id (id), this, title);
-+ image.creator = statement.column_text(2);
-+ TimeVal tv = { (long) statement.column_int(3), (long) 0 };
-+ image.date = tv.to_iso8601 ();
-+ image.width = statement.column_int(4);
-+ image.height = statement.column_int(5);
-+ image.size = statement.column_int(7);
-+ image.mime_type = mime_type;
-+ image.dlna_profile = statement.column_text(8);
-+ File file = File.new_for_path(path);
-+ image.add_uri (file.get_uri ());
-+
-+ return image;
-+ }
-+
-+ public AllImages (MediaContainer parent, LMS.Database lms_db) {
-+ base ("all",
-+ parent,
-+ _("All"),
-+ lms_db,
-+ AllImages.SQL_ALL,
-+ AllImages.SQL_FIND_OBJECT,
-+ AllImages.SQL_COUNT,
-+ AllImages.SQL_ADDED,
-+ AllImages.SQL_REMOVED
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-all-music.vala b/src/plugins/lms/rygel-lms-all-music.vala
-new file mode 100644
-index 0000000..2a7226f
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-music.vala
-@@ -0,0 +1,169 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.AllMusic : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL_TEMPLATE =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name, " +
-+ "files.mtime, " +
-+ "audio_genres.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "LEFT JOIN audio_genres " +
-+ "ON audios.genre_id = audio_genres.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id %s " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT COUNT(audios.id) " +
-+ "FROM audios, files " +
-+ "WHERE dtime = 0 AND audios.id = files.id;";
-+
-+ private static const string SQL_COUNT_WITH_FILTER_TEMPLATE =
-+ "SELECT COUNT(audios.id), audios.title as title, " +
-+ "audio_artists.name as artist " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id %s;";
-+
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name, " +
-+ "audio_albums.name, " +
-+ "files.mtime, " +
-+ "audio_genres.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "LEFT JOIN audio_genres " +
-+ "ON audios.genre_id = audio_genres.id " +
-+ "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id;";
-+
-+ private static const string SQL_ADDED =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name, " +
-+ "files.mtime, " +
-+ "audio_genres.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "LEFT JOIN audio_genres " +
-+ "ON audios.genre_id = audio_genres.id " +
-+ "WHERE dtime = 0 AND audios.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ private static const string SQL_REMOVED =
-+ "SELECT files.id, files.path, files.size, " +
-+ "audios.title as title, audios.trackno, audios.length, audios.channels, audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " +
-+ "audio_artists.name as artist, " +
-+ "audio_albums.name, " +
-+ "files.mtime, " +
-+ "audio_genres.name " +
-+ "FROM audios, files " +
-+ "LEFT JOIN audio_artists " +
-+ "ON audios.artist_id = audio_artists.id " +
-+ "LEFT JOIN audio_albums " +
-+ "ON audios.album_id = audio_albums.id " +
-+ "LEFT JOIN audio_genres " +
-+ "ON audios.genre_id = audio_genres.id " +
-+ "WHERE dtime <> 0 AND audios.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ protected override string get_sql_all_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return this.sql_all;
-+ }
-+ var filter_str = "AND %s".printf (filter);
-+ return (AllMusic.SQL_ALL_TEMPLATE.printf (filter_str));
-+ }
-+
-+ protected override string get_sql_count_with_filter (string filter) {
-+ if (filter.length == 0) {
-+ return this.sql_count;
-+ }
-+ var filter_str = "AND %s".printf (filter);
-+ return (AllMusic.SQL_COUNT_WITH_FILTER_TEMPLATE.printf (filter_str));
-+ }
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = statement.column_int (0);
-+ var path = statement.column_text (1);
-+ var mime_type = statement.column_text(10);
-+
-+ if (mime_type == null || mime_type.length == 0) {
-+ /* TODO is this correct? */
-+ debug ("Music item %d (%s) has no MIME type",
-+ id,
-+ path);
-+ }
-+
-+ var title = statement.column_text(3);
-+ var song_id = this.build_child_id (id);
-+ var song = new MusicItem (song_id, this, title);
-+ song.size = statement.column_int(2);
-+ song.track_number = statement.column_int(4);
-+ song.duration = statement.column_int(5);
-+ song.channels = statement.column_int(6);
-+ song.sample_freq = statement.column_int(7);
-+ song.bitrate = statement.column_int(8);
-+ song.dlna_profile = statement.column_text(9);
-+ song.mime_type = mime_type;
-+ song.artist = statement.column_text(11);
-+ song.album = statement.column_text(12);
-+ TimeVal tv = { (long) statement.column_int(13), (long) 0 };
-+ song.date = tv.to_iso8601 ();
-+ song.genre = statement.column_text(14);
-+ File file = File.new_for_path (path);
-+ song.add_uri (file.get_uri ());
-+
-+ return song;
-+ }
-+
-+ public AllMusic (MediaContainer parent, LMS.Database lms_db) {
-+ base("all",
-+ parent,
-+ _("All"),
-+ lms_db,
-+ AllMusic.SQL_ALL_TEMPLATE.printf (""),
-+ AllMusic.SQL_FIND_OBJECT,
-+ AllMusic.SQL_COUNT,
-+ AllMusic.SQL_ADDED,
-+ AllMusic.SQL_REMOVED
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-all-videos.vala b/src/plugins/lms/rygel-lms-all-videos.vala
-new file mode 100644
-index 0000000..dbde0db
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-videos.vala
-@@ -0,0 +1,123 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.AllVideos : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL =
-+ "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
-+ "FROM videos, files " +
-+ "WHERE dtime = 0 AND videos.id = files.id " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT count(videos.id) " +
-+ "FROM videos, files " +
-+ "WHERE dtime = 0 AND videos.id = files.id;";
-+
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
-+ "FROM videos, files " +
-+ "WHERE dtime = 0 AND files.id = ? AND videos.id = files.id;";
-+
-+ private static const string SQL_ADDED =
-+ "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
-+ "FROM videos, files " +
-+ "WHERE dtime = 0 AND videos.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ private static const string SQL_REMOVED =
-+ "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profile, dlna_mime " +
-+ "FROM videos, files " +
-+ "WHERE dtime <> 0 AND videos.id = files.id " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = statement.column_int(0);
-+ var mime_type = statement.column_text(8);
-+ var path = statement.column_text(4);
-+ var file = File.new_for_path(path);
-+
-+ /* TODO: Temporary code to extract the MIME TYPE. LMS does not seem
-+ to compute the mime type of videos. Don't know why. */
-+
-+/* if (mime_type == null || mime_type.length == 0) {
-+ try {
-+ FileInfo info = file.query_info(FileAttribute.STANDARD_CONTENT_TYPE,
-+ FileQueryInfoFlags.NONE, null);
-+ mime_type = info.get_content_type();
-+ } catch {}
-+ }
-+*/
-+
-+ if (mime_type == null || mime_type.length == 0) {
-+ /* TODO is this correct? */
-+ debug ("Video item %d (%s) has no MIME type",
-+ id,
-+ path);
-+ }
-+
-+ var title = statement.column_text(1);
-+ var video = new VideoItem(this.build_child_id (id), this, title);
-+ video.creator = statement.column_text(2);
-+ video.duration = statement.column_int(3);
-+ TimeVal tv = { (long) statement.column_int(5), (long) 0 };
-+ video.date = tv.to_iso8601 ();
-+ video.size = statement.column_int(6);
-+ video.dlna_profile = statement.column_text(7);
-+ video.mime_type = mime_type;
-+ video.add_uri (file.get_uri ());
-+
-+ // Rygel does not support multiple video and audio tracks in a single file,
-+ // so we just take the first one
-+ var video_data = "select videos_videos.bitrate + videos_audios.bitrate, width, height, channels, sampling_rate " +
-+ "from videos, videos_audios, videos_videos where videos.id = ? " +
-+ "and videos.id = videos_audios.video_id and videos.id = videos_videos.video_id;";
-+ try {
-+ var stmt = this.lms_db.prepare(video_data);
-+ Rygel.LMS.Database.find_object("%d".printf(id), stmt);
-+ video.bitrate = stmt.column_int(0) / 8; //convert bits per second into bytes per second
-+ video.width = stmt.column_int(1);
-+ video.height = stmt.column_int(2);
-+ video.channels = stmt.column_int(3);
-+ video.sample_freq = stmt.column_int(4);
-+ } catch (DatabaseError e) {
-+ warning ("Query failed: %s", e.message);
-+ }
-+
-+ return video;
-+ }
-+
-+ public AllVideos (string id, MediaContainer parent, string title, LMS.Database lms_db){
-+ base (id,
-+ parent,
-+ title,
-+ lms_db,
-+ AllVideos.SQL_ALL,
-+ AllVideos.SQL_FIND_OBJECT,
-+ AllVideos.SQL_COUNT,
-+ AllVideos.SQL_ADDED,
-+ AllVideos.SQL_REMOVED
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-artist.vala b/src/plugins/lms/rygel-lms-artist.vala
-new file mode 100644
-index 0000000..31e9070
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-artist.vala
-@@ -0,0 +1,75 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.Artist : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL_TEMPLATE =
-+ "SELECT audio_albums.id, audio_albums.name " +
-+ "FROM audio_albums " +
-+ "WHERE audio_albums.artist_id = %s " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT_TEMPLATE =
-+ "SELECT COUNT(audio_albums.id) " +
-+ "FROM audio_albums " +
-+ "WHERE audio_albums.artist_id = %s";
-+
-+ private static const string SQL_FIND_OBJECT_TEMPLATE =
-+ "SELECT audio_albums.id, audio_albums.name " +
-+ "FROM audio_albums " +
-+ "WHERE audio_albums.id = ? AND audio_albums.artist_id = %s;";
-+
-+ private static string get_sql_all (string id) {
-+ return (SQL_ALL_TEMPLATE.printf (id));
-+ }
-+ private static string get_sql_find_object (string id) {
-+ return (SQL_FIND_OBJECT_TEMPLATE.printf (id));
-+ }
-+ private static string get_sql_count (string id) {
-+ return (SQL_COUNT_TEMPLATE.printf (id));
-+ }
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var db_id = "%d".printf (statement.column_int (0));
-+ var title = statement.column_text (1);
-+ return new LMS.Album (db_id, this, title, this.lms_db);
-+ }
-+
-+ public Artist (string id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db) {
-+
-+ base (id,
-+ parent,
-+ title,
-+ lms_db,
-+ get_sql_all (id),
-+ get_sql_find_object (id),
-+ get_sql_count (id),
-+ null, // LMS does not track adding or removing albums
-+ null
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-artists.vala b/src/plugins/lms/rygel-lms-artists.vala
-new file mode 100644
-index 0000000..a00b2ce
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-artists.vala
-@@ -0,0 +1,62 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.Artists : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL =
-+ "SELECT audio_artists.id, audio_artists.name " +
-+ "FROM audio_artists " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT COUNT(audio_artists.id) " +
-+ "FROM audio_artists;";
-+
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT audio_artists.id, audio_artists.name " +
-+ "FROM audio_artists " +
-+ "WHERE audio_artists.id = ?;";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var db_id = "%d".printf (statement.column_int (0));
-+ var title = statement.column_text (1);
-+
-+ return new LMS.Artist (db_id, this, title, this.lms_db);
-+ }
-+
-+ public Artists (string id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db) {
-+ base (id,
-+ parent,
-+ title,
-+ lms_db,
-+ Artists.SQL_ALL,
-+ Artists.SQL_FIND_OBJECT,
-+ Artists.SQL_COUNT,
-+ null, null
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-category-container.vala b/src/plugins/lms/rygel-lms-category-container.vala
-new file mode 100644
-index 0000000..e5430d1
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-category-container.vala
-@@ -0,0 +1,428 @@
-+/*
-+ * Copyright (C) 2009,2010 Jens Georg <mail@jensge.org>,
-+ * (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Gee;
-+using Sqlite;
-+
-+public errordomain Rygel.LMS.CategoryContainerError {
-+ SQLITE_ERROR,
-+ GENERAL_ERROR,
-+ INVALID_TYPE,
-+ UNSUPPORTED_SEARCH
-+}
-+
-+public abstract class Rygel.LMS.CategoryContainer : Rygel.MediaContainer,
-+ Rygel.TrackableContainer,
-+ Rygel.SearchableContainer {
-+ public ArrayList<string> search_classes { get; set; }
-+
-+ public unowned LMS.Database lms_db { get; construct; }
-+
-+ public string db_id { get; construct; }
-+
-+ public string sql_all { get; construct; }
-+ public string sql_find_object { get; construct; }
-+ public string sql_count { get; construct; }
-+ public string sql_added { get; construct; }
-+ public string sql_removed { get; construct; }
-+
-+ protected Statement stmt_all;
-+ protected Statement stmt_find_object;
-+ protected Statement stmt_added;
-+ protected Statement stmt_removed;
-+
-+ protected string child_prefix;
-+ protected string ref_prefix;
-+
-+ protected abstract MediaObject? object_from_statement (Statement statement);
-+
-+ /* TODO these should be abstract */
-+ protected virtual string get_sql_all_with_filter (string filter) {
-+ return this.sql_all;
-+ }
-+ protected virtual string get_sql_count_with_filter (string filter) {
-+ return this.sql_count;
-+ }
-+
-+ private static string? map_operand_to_column (string operand,
-+ out string? collate = null,
-+ bool for_sort = false)
-+ throws Error {
-+ string column = null;
-+ bool use_collation = false;
-+
-+ // TODO add all used aliases to sql queries
-+ switch (operand) {
-+ case "dc:title":
-+ column = "title";
-+ use_collation = true;
-+ break;
-+ case "upnp:artist":
-+ column = "artist";
-+ use_collation = true;
-+ break;
-+ case "dc:creator":
-+ column = "creator";
-+ use_collation = true;
-+ break;
-+ default:
-+ var message = "Unsupported column %s".printf (operand);
-+
-+ throw new CategoryContainerError.UNSUPPORTED_SEARCH (message);
-+ }
-+
-+ if (use_collation) {
-+ collate = "COLLATE CASEFOLD";
-+ } else {
-+ collate = "";
-+ }
-+
-+ return column;
-+ }
-+
-+ private static string? relational_expression_to_sql
-+ (RelationalExpression exp,
-+ GLib.ValueArray args)
-+ throws Error {
-+ GLib.Value? v = null;
-+ string collate = null;
-+
-+ string column = CategoryContainer.map_operand_to_column (exp.operand1,
-+ out collate);
-+ SqlOperator operator;
-+
-+ switch (exp.op) {
-+ case GUPnP.SearchCriteriaOp.EXISTS:
-+ string sql_function;
-+ if (exp.operand2 == "true") {
-+ sql_function = "%s IS NOT NULL AND %s != ''";
-+ } else {
-+ sql_function = "%s IS NULL OR %s = ''";
-+ }
-+
-+ return sql_function.printf (column, column);
-+ case GUPnP.SearchCriteriaOp.EQ:
-+ case GUPnP.SearchCriteriaOp.NEQ:
-+ case GUPnP.SearchCriteriaOp.LESS:
-+ case GUPnP.SearchCriteriaOp.LEQ:
-+ case GUPnP.SearchCriteriaOp.GREATER:
-+ case GUPnP.SearchCriteriaOp.GEQ:
-+ v = exp.operand2;
-+ operator = new SqlOperator.from_search_criteria_op
-+ (exp.op, column, collate);
-+ break;
-+ case GUPnP.SearchCriteriaOp.CONTAINS:
-+ operator = new SqlFunction ("contains", column);
-+ v = exp.operand2;
-+ break;
-+ case GUPnP.SearchCriteriaOp.DOES_NOT_CONTAIN:
-+ operator = new SqlFunction ("NOT contains", column);
-+ v = exp.operand2;
-+ break;
-+ case GUPnP.SearchCriteriaOp.DERIVED_FROM:
-+ operator = new SqlOperator ("LIKE", column);
-+ v = "%s%%".printf (exp.operand2);
-+ break;
-+ default:
-+ warning ("Unsupported op %d", exp.op);
-+ return null;
-+ }
-+
-+ if (v != null) {
-+ args.append (v);
-+ }
-+
-+ return operator.to_string ();
-+ }
-+
-+ private static string logical_expression_to_sql
-+ (LogicalExpression expression,
-+ GLib.ValueArray args)
-+ throws Error {
-+ string left_sql_string = CategoryContainer.search_expression_to_sql
-+ (expression.operand1,
-+ args);
-+ string right_sql_string = CategoryContainer.search_expression_to_sql
-+ (expression.operand2,
-+ args);
-+ unowned string operator_sql_string = "OR";
-+
-+ if (expression.op == LogicalOperator.AND) {
-+ operator_sql_string = "AND";
-+ }
-+
-+ return "(%s %s %s)".printf (left_sql_string,
-+ operator_sql_string,
-+ right_sql_string);
-+ }
-+
-+ private static string? search_expression_to_sql
-+ (SearchExpression? expression,
-+ GLib.ValueArray args)
-+ throws Error {
-+ if (expression == null) {
-+ return "";
-+ }
-+
-+ if (expression is LogicalExpression) {
-+ return CategoryContainer.logical_expression_to_sql
-+ (expression as LogicalExpression, args);
-+ } else {
-+ return CategoryContainer.relational_expression_to_sql
-+ (expression as RelationalExpression,
-+ args);
-+ }
-+ }
-+
-+ protected virtual uint get_child_count_with_filter (string where_filter,
-+ ValueArray args)
-+ {
-+ var query = this.get_sql_count_with_filter (where_filter);
-+ try {
-+ var stmt = this.lms_db.prepare_and_init (query, args.values);
-+ if (stmt.step () != Sqlite.ROW) {
-+ return 0;
-+ }
-+ return stmt.column_int (0);
-+ } catch (DatabaseError e) {
-+ warning ("Query failed: %s", e.message);
-+ return 0;
-+ }
-+ }
-+
-+ protected virtual MediaObjects? get_children_with_filter (string where_filter,
-+ ValueArray args,
-+ string sort_criteria,
-+ uint offset,
-+ uint max_count) {
-+ var children = new MediaObjects ();
-+ GLib.Value v = max_count;
-+ args.append (v);
-+ v = offset;
-+ args.append (v);
-+
-+ var query = this.get_sql_all_with_filter (where_filter);
-+ try {
-+ var stmt = this.lms_db.prepare_and_init (query, args.values);
-+ while (Database.get_children_step (stmt)) {
-+ children.add (this.object_from_statement (stmt));
-+ }
-+ } catch (DatabaseError e) {
-+ warning ("Query failed: %s", e.message);
-+ }
-+
-+ return children;
-+ }
-+
-+ public async MediaObjects? search (SearchExpression? expression,
-+ uint offset,
-+ uint max_count,
-+ out uint total_matches,
-+ string sort_criteria,
-+ Cancellable? cancellable)
-+ throws Error {
-+ debug ("search()");
-+ try {
-+ var args = new GLib.ValueArray (0);
-+ var filter = CategoryContainer.search_expression_to_sql (expression,
-+ args);
-+ total_matches = this.get_child_count_with_filter (filter, args);
-+
-+ if (expression != null) {
-+ debug (" Original search: %s", expression.to_string ());
-+ debug (" Parsed search expression: %s", filter);
-+ debug (" Filtered cild count is %u", total_matches);
-+ }
-+
-+ if (max_count == 0) {
-+ max_count = uint.MAX;
-+ }
-+ return this.get_children_with_filter (filter,
-+ args,
-+ sort_criteria,
-+ offset,
-+ max_count);
-+ } catch (Error e) {
-+ debug (" Falling back to simple_search(): %s", e.message);
-+ return yield this.simple_search (expression,
-+ offset,
-+ max_count,
-+ out total_matches,
-+ sort_criteria,
-+ cancellable);
-+ }
-+ }
-+
-+ public async override MediaObjects? get_children (uint offset,
-+ uint max_count,
-+ string sort_criteria,
-+ Cancellable? cancellable)
-+ throws Error {
-+ MediaObjects retval = new MediaObjects ();
-+
-+ Database.get_children_init (this.stmt_all,
-+ offset,
-+ max_count,
-+ sort_criteria);
-+ while (Database.get_children_step (this.stmt_all)) {
-+ retval.add (this.object_from_statement (this.stmt_all));
-+ }
-+
-+ return retval;
-+ }
-+
-+ public async override MediaObject? find_object (string id,
-+ Cancellable? cancellable)
-+ throws Error {
-+ if (!id.has_prefix (this.child_prefix)) {
-+ /* can't match anything in this container */
-+ return null;
-+ }
-+
-+ MediaObject object = null;
-+
-+ /* remove parent section from id */
-+ var real_id = id.substring (this.child_prefix.length);
-+ /* remove grandchildren from id */
-+ var index = real_id.index_of_char (':');
-+ if (index > 0) {
-+ real_id = real_id.slice (0, index);
-+ }
-+
-+ try {
-+ Database.find_object (real_id, this.stmt_find_object);
-+ var child = this.object_from_statement (this.stmt_find_object);
-+ if (index < 0) {
-+ object = child;
-+ } else {
-+ /* try grandchildren */
-+ var container = child as CategoryContainer;
-+ object = yield container.find_object (id, cancellable);
-+
-+ /* tell object to keep a reference to the parent --
-+ * otherwise parent is freed before object is serialized */
-+ object.parent_ref = object.parent;
-+ }
-+ } catch (DatabaseError e) {
-+ debug ("find_object %s in %s: %s", id, this.id, e.message);
-+ /* Happens e.g. if id is not an integer */
-+ }
-+
-+ return object;
-+ }
-+
-+ protected string build_child_id (int db_id) {
-+ return "%s%d".printf (this.child_prefix, db_id);
-+ }
-+
-+ protected string build_reference_id (int db_id) {
-+ return "%s%d".printf (this.ref_prefix, db_id);
-+ }
-+
-+ protected async void add_child (MediaObject object) {
-+ }
-+
-+ protected async void remove_child (MediaObject object) {
-+ }
-+
-+ private void on_db_updated(uint64 old_id, uint64 new_id) {
-+ try {
-+ var stmt_count = this.lms_db.prepare (this.sql_count);
-+
-+ if (stmt_count.step () == Sqlite.ROW) {
-+ this.child_count = stmt_count.column_int (0);
-+ }
-+
-+ Database.get_children_with_update_id_init (this.stmt_added,
-+ old_id,
-+ new_id);
-+ while (Database.get_children_step (this.stmt_added)) {
-+ this.add_child_tracked.begin(this.object_from_statement (this.stmt_added));
-+ }
-+
-+ Database.get_children_with_update_id_init (this.stmt_removed,
-+ old_id,
-+ new_id);
-+ while (Database.get_children_step (this.stmt_removed)) {
-+ this.remove_child_tracked.begin(this.object_from_statement (this.stmt_removed));
-+ }
-+
-+ } catch (DatabaseError e) {
-+ warning ("Can't perform container update: %s", e.message);
-+ }
-+
-+ }
-+
-+ public CategoryContainer (string db_id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db,
-+ string sql_all,
-+ string sql_find_object,
-+ string sql_count,
-+ string? sql_added,
-+ string? sql_removed
-+ ) {
-+ Object (id : "%s:%s".printf (parent.id, db_id),
-+ db_id : db_id,
-+ parent : parent,
-+ title : title,
-+ lms_db : lms_db,
-+ sql_all : sql_all,
-+ sql_find_object : sql_find_object,
-+ sql_count : sql_count,
-+ sql_added : sql_added,
-+ sql_removed: sql_removed
-+ );
-+ }
-+
-+ construct {
-+ this.search_classes = new ArrayList<string> ();
-+
-+ this.child_prefix = "%s:".printf (this.id);
-+
-+ var index = this.id.index_of_char (':');
-+ this.ref_prefix = this.id.slice (0, index) + ":all:";
-+
-+ try {
-+ this.stmt_all = this.lms_db.prepare (this.sql_all);
-+ this.stmt_find_object = this.lms_db.prepare (this.sql_find_object);
-+ var stmt_count = this.lms_db.prepare (this.sql_count);
-+
-+ if (stmt_count.step () == Sqlite.ROW) {
-+ this.child_count = stmt_count.column_int (0);
-+ }
-+ // some container implementations don't have a reasonable way to provide
-+ // id-based statements to fetch added or removed items
-+ if (this.sql_added != null && this.sql_removed != null) {
-+ this.stmt_added = this.lms_db.prepare (this.sql_added);
-+ this.stmt_removed = this.lms_db.prepare (this.sql_removed);
-+ lms_db.db_updated.connect(this.on_db_updated);
-+ }
-+ } catch (DatabaseError e) {
-+ warning ("Container %s: %s", this.title, e.message);
-+ }
-+
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-collate.c b/src/plugins/lms/rygel-lms-collate.c
-new file mode 100644
-index 0000000..8eee80b
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-collate.c
-@@ -0,0 +1,49 @@
-+/*
-+ * Copyright (C) 2012 Jens Georg <mail@jensge.org>.
-+ *
-+ * Author: Jens Georg <mail@jensge.org>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+
-+#ifdef HAVE_UNISTRING
-+# include <unistr.h>
-+#endif
-+
-+gint rygel_lms_utf8_collate_str (const char *a, gsize alen,
-+ const char *b, gsize blen)
-+{
-+ char *a_str, *b_str;
-+ gint result;
-+
-+ /* Make sure the passed strings are null terminated */
-+ a_str = g_strndup (a, alen);
-+ b_str = g_strndup (b, blen);
-+
-+#ifdef HAVE_UNISTRING
-+ result = u8_strcoll (a_str, b_str);
-+#else
-+ return g_utf8_collate (a_str, b_str);
-+#endif
-+
-+ g_free (a_str);
-+ g_free (b_str);
-+
-+ return result;
-+}
-diff --git a/src/plugins/lms/rygel-lms-database.vala b/src/plugins/lms/rygel-lms-database.vala
-new file mode 100644
-index 0000000..e898d66
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-database.vala
-@@ -0,0 +1,294 @@
-+/*
-+ * Copyright (C) 2009,2011 Jens Georg <mail@jensge.org>,
-+ * (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Gee;
-+using Sqlite;
-+
-+public errordomain Rygel.LMS.DatabaseError {
-+ OPEN,
-+ PREPARE,
-+ BIND,
-+ STEP,
-+ NOT_FOUND
-+}
-+
-+namespace Rygel.LMS {
-+ extern static int utf8_collate_str (uint8[] a, uint8[] b);
-+}
-+
-+public class Rygel.LMS.Database {
-+
-+ public signal void db_updated(uint64 old_update_id, uint64 new_update_id);
-+
-+ private Sqlite.Database db;
-+ private LMS.DBus lms_proxy;
-+ private uint64 update_id;
-+
-+ /**
-+ * Function to implement the custom SQL function 'contains'
-+ */
-+ private static void utf8_contains (Sqlite.Context context,
-+ Sqlite.Value[] args)
-+ requires (args.length == 2) {
-+ if (args[0].to_text () == null ||
-+ args[1].to_text () == null) {
-+ context.result_int (0);
-+
-+ return;
-+ }
-+
-+ var pattern = Regex.escape_string (args[1].to_text ());
-+ if (Regex.match_simple (pattern,
-+ args[0].to_text (),
-+ RegexCompileFlags.CASELESS)) {
-+ context.result_int (1);
-+ } else {
-+ context.result_int (0);
-+ }
-+ }
-+
-+ /**
-+ * Function to implement the custom SQLite collation 'CASEFOLD'.
-+ *
-+ * Uses utf8 case-fold to compare the strings.
-+ */
-+ private static int utf8_collate (int alen, void* a, int blen, void* b) {
-+ // unowned to prevent array copy
-+ unowned uint8[] _a = (uint8[]) a;
-+ _a.length = alen;
-+
-+ unowned uint8[] _b = (uint8[]) b;
-+ _b.length = blen;
-+
-+ return LMS.utf8_collate_str (_a, _b);
-+ }
-+
-+ public Database () throws DatabaseError {
-+ string db_path;
-+ try {
-+ lms_proxy = Bus.get_proxy_sync (BusType.SESSION,
-+ "org.lightmediascanner",
-+ "/org/lightmediascanner/Scanner1");
-+ db_path = lms_proxy.data_base_path;
-+ debug ("Got db path %s from LMS over dbus", db_path);
-+ update_id = lms_proxy.update_id;
-+ debug ("Got updated id %lld from LMS over dbus", update_id);
-+ lms_proxy.g_properties_changed.connect (this.on_lms_properties_changed);
-+
-+ } catch (IOError e) {
-+ warning("Couldn't get LMS Dbus proxy: %s", e.message);
-+ db_path = Environment.get_user_config_dir() +
-+ "/lightmediascannerd/db.sqlite3";
-+ debug ("Using default sqlite database location %s", db_path);
-+ }
-+
-+ Sqlite.Database.open (db_path, out this.db);
-+ if (this.db.errcode () != Sqlite.OK) {
-+ throw new DatabaseError.OPEN ("Failed to open '%s': %d",
-+ db_path,
-+ this.db.errcode () );
-+ }
-+
-+ this.db.create_function ("contains",
-+ 2,
-+ Sqlite.UTF8,
-+ null,
-+ LMS.Database.utf8_contains,
-+ null,
-+ null);
-+
-+ this.db.create_collation ("CASEFOLD",
-+ Sqlite.UTF8,
-+ LMS.Database.utf8_collate);
-+
-+ }
-+
-+ private void on_lms_properties_changed (DBusProxy lms_proxy,
-+ Variant changed,
-+ string[] invalidated) {
-+ if (!changed.get_type().equal (VariantType.VARDICT)) {
-+ return;
-+ }
-+
-+ foreach (var changed_prop in changed) {
-+ var key = (string) changed_prop.get_child_value (0);
-+ var value = changed_prop.get_child_value (1).get_child_value (0);
-+
-+ debug ("LMS property %s changed value to %s", key, value.print(true));
-+
-+ switch (key) {
-+ case "UpdateID":
-+ db_updated(update_id, (uint64)value);
-+ update_id = (uint64)value;
-+ break;
-+ }
-+ }
-+ }
-+
-+
-+ public Statement prepare (string query_string) throws DatabaseError {
-+ Statement statement;
-+
-+ var err = this.db.prepare_v2 (query_string, -1, out statement);
-+ if (err != Sqlite.OK)
-+ throw new DatabaseError.PREPARE ("Unable to create statement '%s': %d",
-+ query_string,
-+ err);
-+ return statement;
-+ }
-+
-+
-+ public Statement prepare_and_init (string query,
-+ GLib.Value[]? arguments)
-+ throws DatabaseError {
-+
-+ Statement statement;
-+
-+ var err = this.db.prepare_v2 (query, -1, out statement);
-+ if (err != Sqlite.OK)
-+ throw new DatabaseError.PREPARE ("Unable to create statement '%s': %d",
-+ query,
-+ err);
-+
-+ for (var i = 1; i <= arguments.length; ++i) {
-+ int sqlite_err;
-+ unowned GLib.Value current_value = arguments[i - 1];
-+
-+ if (current_value.holds (typeof (int))) {
-+ sqlite_err = statement.bind_int (i, current_value.get_int ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (int64))) {
-+ sqlite_err = statement.bind_int64 (i, current_value.get_int64 ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (uint64))) {
-+ sqlite_err = statement.bind_int64 (i, (int64) current_value.get_uint64 ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (long))) {
-+ sqlite_err = statement.bind_int64 (i, current_value.get_long ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (uint))) {
-+ sqlite_err = statement.bind_int64 (i, current_value.get_uint ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (string))) {
-+ sqlite_err = statement.bind_text (i, current_value.get_string ());
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else if (current_value.holds (typeof (void *))) {
-+ if (current_value.peek_pointer () == null) {
-+ sqlite_err = statement.bind_null (i);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind value %d",
-+ sqlite_err);
-+ } else {
-+ assert_not_reached ();
-+ }
-+ } else {
-+ var type = current_value.type ();
-+ warning (_("Unsupported type %s"), type.name ());
-+ assert_not_reached ();
-+ }
-+ }
-+
-+ return statement;
-+ }
-+
-+ public static void find_object(string id, Statement stmt) throws DatabaseError {
-+
-+ (void) stmt.reset();
-+
-+ int integer_id = int.parse(id);
-+ int sqlite_err = stmt.bind_int(1, integer_id);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind id %d", sqlite_err);
-+
-+ sqlite_err = stmt.step();
-+ if (sqlite_err != Sqlite.ROW)
-+ throw new DatabaseError.STEP("Unable to find id %s", id);
-+ }
-+
-+ public static void get_children_init (Statement stmt,
-+ uint offset, uint max_count, string sort_criteria) throws DatabaseError {
-+
-+ int sqlite_err;
-+
-+ (void) stmt.reset();
-+
-+ sqlite_err = stmt.bind_int(1, (int) max_count);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind max_count %d",
-+ sqlite_err);
-+
-+ sqlite_err = stmt.bind_int(2, (int) offset);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind offset %d",
-+ sqlite_err);
-+ }
-+
-+ public static void get_children_with_update_id_init (Statement stmt,
-+ uint64 old_id, uint64 new_id) throws DatabaseError {
-+
-+ int sqlite_err;
-+
-+ (void) stmt.reset();
-+
-+ if (new_id < old_id) // id value wrapped over
-+ sqlite_err = stmt.bind_int64(1, 0);
-+ else
-+ sqlite_err = stmt.bind_int64(1, (int64)old_id);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind old_id %d",
-+ sqlite_err);
-+
-+ sqlite_err = stmt.bind_int64(2, (int64)new_id);
-+ if (sqlite_err != Sqlite.OK)
-+ throw new DatabaseError.BIND("Unable to bind new_id %d",
-+ sqlite_err);
-+ }
-+
-+ public static bool get_children_step(Statement stmt) throws DatabaseError {
-+
-+ bool retval;
-+ int sqlite_err;
-+
-+ sqlite_err = stmt.step();
-+ retval = sqlite_err == Sqlite.ROW;
-+
-+ if (!retval && (sqlite_err != Sqlite.DONE))
-+ throw new DatabaseError.STEP("Error iterating through rows %d",
-+ sqlite_err);
-+
-+ return retval;
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-dbus-interfaces.vala b/src/plugins/lms/rygel-lms-dbus-interfaces.vala
-new file mode 100644
-index 0000000..13f00cb
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-dbus-interfaces.vala
-@@ -0,0 +1,30 @@
-+/*
-+ * Copyright (C) 2014 Intel Corporation.
-+ *
-+ * Author: Alexander Kanavin <alex.kanavin@gmail.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+[DBus (name = "org.lightmediascanner.Scanner1")]
-+interface Rygel.LMS.DBus : DBusProxy {
-+ public abstract string data_base_path { owned get; }
-+ [DBus (name = "UpdateID")]
-+ public abstract uint64 update_id { get; }
-+
-+ //TODO: add all the other API items which are currently unused
-+}
-\ No newline at end of file
-diff --git a/src/plugins/lms/rygel-lms-image-root.vala b/src/plugins/lms/rygel-lms-image-root.vala
-new file mode 100644
-index 0000000..466bbe2
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-root.vala
-@@ -0,0 +1,35 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+
-+public class Rygel.LMS.ImageRoot : Rygel.SimpleContainer {
-+ public ImageRoot (string id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db) {
-+ base (id, parent, title);
-+
-+ this.add_child_container (new AllImages (this, lms_db));
-+ this.add_child_container (new ImageYears (this, lms_db));
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-image-year.vala b/src/plugins/lms/rygel-lms-image-year.vala
-new file mode 100644
-index 0000000..a7768f0
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-year.vala
-@@ -0,0 +1,114 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.ImageYear : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL_TEMPLATE =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id AND year = '%s' " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT_TEMPLATE =
-+ "SELECT count(images.id), strftime('%Y', date, 'unixepoch') as year " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id AND year = '%s';";
-+
-+ private static const string SQL_FIND_OBJECT_TEMPLATE =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND files.id = ? AND images.id = files.id AND year = '%s';";
-+
-+ private static const string SQL_ADDED_TEMPLATE =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " +
-+ "FROM images, files " +
-+ "WHERE dtime = 0 AND images.id = files.id AND year = '%s' " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ private static const string SQL_REMOVED_TEMPLATE =
-+ "SELECT images.id, title, artist, date, width, height, path, size, dlna_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " +
-+ "FROM images, files " +
-+ "WHERE dtime <> 0 AND images.id = files.id AND year = '%s' " +
-+ "AND update_id > ? AND update_id <= ?;";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ var id = statement.column_int(0);
-+ var path = statement.column_text(6);
-+ var mime_type = statement.column_text(9);
-+
-+ if (mime_type == null || mime_type.length == 0){
-+ /* TODO is this correct? */
-+ debug ("Image item %d (%s) has no MIME type",
-+ id,
-+ path);
-+ }
-+
-+ var title = statement.column_text(1);
-+ var image = new ImageItem(this.build_child_id (id), this, title);
-+ image.ref_id = this.build_reference_id (id);
-+ image.creator = statement.column_text(2);
-+ TimeVal tv = { (long) statement.column_int(3), (long) 0 };
-+ image.date = tv.to_iso8601 ();
-+ image.width = statement.column_int(4);
-+ image.height = statement.column_int(5);
-+ image.size = statement.column_int(7);
-+ image.mime_type = mime_type;
-+ image.dlna_profile = statement.column_text(8);
-+ File file = File.new_for_path(path);
-+ image.add_uri (file.get_uri ());
-+
-+ return image;
-+ }
-+
-+ private static string get_sql_all (string year) {
-+ return (SQL_ALL_TEMPLATE.printf (year));
-+ }
-+ private static string get_sql_find_object (string year) {
-+ return (SQL_FIND_OBJECT_TEMPLATE.printf (year));
-+ }
-+ private static string get_sql_count (string year) {
-+ return (SQL_COUNT_TEMPLATE.printf (year));
-+ }
-+ private static string get_sql_added (string year) {
-+ return (SQL_ADDED_TEMPLATE.printf (year));
-+ }
-+ private static string get_sql_removed (string year) {
-+ return (SQL_REMOVED_TEMPLATE.printf (year));
-+ }
-+
-+ public ImageYear (MediaContainer parent,
-+ string year,
-+ LMS.Database lms_db) {
-+ base ("%s".printf (year),
-+ parent,
-+ year,
-+ lms_db,
-+ get_sql_all (year),
-+ get_sql_find_object (year),
-+ get_sql_count (year),
-+ get_sql_added (year),
-+ get_sql_removed (year)
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-image-years.vala b/src/plugins/lms/rygel-lms-image-years.vala
-new file mode 100644
-index 0000000..636f4d1
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-years.vala
-@@ -0,0 +1,59 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+using Sqlite;
-+
-+public class Rygel.LMS.ImageYears : Rygel.LMS.CategoryContainer {
-+ private static const string SQL_ALL =
-+ "SELECT DISTINCT(strftime('%Y', images.date, 'unixepoch')) as year " +
-+ "FROM images " +
-+ "LIMIT ? OFFSET ?;";
-+
-+ private static const string SQL_COUNT =
-+ "SELECT COUNT(DISTINCT(strftime('%Y', images.date, 'unixepoch'))) " +
-+ "FROM images;";
-+
-+ /* actually returns multiple times the same result (because no DISTINCT) */
-+ /* Casting the year is a workaround so we can keep using
-+ * Database.find_object() without making the argument a variant or something like it*/
-+ private static const string SQL_FIND_OBJECT =
-+ "SELECT strftime('%Y', images.date, 'unixepoch') as year " +
-+ "FROM images " +
-+ "WHERE year = CAST(? AS TEXT)";
-+
-+ protected override MediaObject? object_from_statement (Statement statement) {
-+ return new LMS.ImageYear (this, statement.column_text (0), this.lms_db);
-+ }
-+
-+ public ImageYears (MediaContainer parent, LMS.Database lms_db) {
-+ base ("years",
-+ parent,
-+ _("Years"),
-+ lms_db,
-+ ImageYears.SQL_ALL,
-+ ImageYears.SQL_FIND_OBJECT,
-+ ImageYears.SQL_COUNT,
-+ null, null
-+ );
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-music-root.vala b/src/plugins/lms/rygel-lms-music-root.vala
-new file mode 100644
-index 0000000..7b1eb0f
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-music-root.vala
-@@ -0,0 +1,36 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+
-+public class Rygel.LMS.MusicRoot : Rygel.SimpleContainer {
-+ public MusicRoot (string id,
-+ MediaContainer parent,
-+ string title,
-+ LMS.Database lms_db) {
-+ base (id, parent, title);
-+
-+ this.add_child_container (new AllMusic (this, lms_db));
-+ this.add_child_container (new Artists ("artists", this, _("Artists"), lms_db));
-+ this.add_child_container (new Albums (this, lms_db));
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-plugin-factory.vala b/src/plugins/lms/rygel-lms-plugin-factory.vala
-new file mode 100644
-index 0000000..9fa8ccd
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-plugin-factory.vala
-@@ -0,0 +1,40 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+
-+private Rygel.LMS.PluginFactory plugin_factory;
-+
-+public void module_init(PluginLoader loader) {
-+ plugin_factory = new Rygel.LMS.PluginFactory(loader);
-+}
-+
-+public class Rygel.LMS.PluginFactory {
-+
-+ PluginLoader loader;
-+
-+ public PluginFactory(PluginLoader loader) {
-+ this.loader = loader;
-+ this.loader.add_plugin(new LMS.Plugin());
-+ }
-+
-+}
-diff --git a/src/plugins/lms/rygel-lms-plugin.vala b/src/plugins/lms/rygel-lms-plugin.vala
-new file mode 100644
-index 0000000..8bf1284
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-plugin.vala
-@@ -0,0 +1,35 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+
-+public class Rygel.LMS.Plugin : Rygel.MediaServerPlugin {
-+ public const string NAME = "LMS";
-+
-+ private static RootContainer root;
-+
-+ public Plugin() {
-+ if (root == null)
-+ root = new RootContainer();
-+ base(root, Plugin.NAME, null, PluginCapabilities.TRACK_CHANGES);
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-root-container.vala b/src/plugins/lms/rygel-lms-root-container.vala
-new file mode 100644
-index 0000000..1623fa3
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-root-container.vala
-@@ -0,0 +1,58 @@
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using Rygel;
-+
-+using Sqlite;
-+
-+public class Rygel.LMS.RootContainer : Rygel.SimpleContainer {
-+
-+ private LMS.Database lms_db = null;
-+
-+ public RootContainer() {
-+ var config = MetaConfig.get_default ();
-+
-+ var title = _("Shared media");
-+ try {
-+ title = config.get_string ("LightMediaScanner", "title");
-+ } catch (GLib.Error error) {}
-+
-+ base.root(title);
-+
-+ try {
-+ this.lms_db = new LMS.Database ();
-+
-+ this.add_child_container (new MusicRoot ("music", this, _("Music"), this.lms_db));
-+ this.add_child_container (new AllVideos ("all-videos", this, _("Videos"), this.lms_db));
-+ this.add_child_container (new ImageRoot ("images", this, _("Pictures"), this.lms_db));
-+
-+ } catch (DatabaseError e) {
-+ warning ("%s\n", e.message);
-+
-+ /* TODO if db does not exist we should
-+ wait for it to be created and then add folders. Best to wait for the
-+ LMS notification API. */
-+ }
-+
-+ }
-+
-+}
-diff --git a/src/plugins/lms/rygel-lms-sql-function.vala b/src/plugins/lms/rygel-lms-sql-function.vala
-new file mode 100644
-index 0000000..e8580cc
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-sql-function.vala
-@@ -0,0 +1,31 @@
-+/*
-+ * Copyright (C) 2010 Jens Georg <mail@jensge.org>.
-+ *
-+ * Author: Jens Georg <mail@jensge.org>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+internal class Rygel.LMS.SqlFunction : SqlOperator {
-+ public SqlFunction (string name, string arg) {
-+ base (name, arg);
-+ }
-+
-+ public override string to_string () {
-+ return "%s(%s,?)".printf (name, arg);
-+ }
-+}
-diff --git a/src/plugins/lms/rygel-lms-sql-operator.vala b/src/plugins/lms/rygel-lms-sql-operator.vala
-new file mode 100644
-index 0000000..fc4e907
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-sql-operator.vala
-@@ -0,0 +1,73 @@
-+/*
-+ * Copyright (C) 2010 Jens Georg <mail@jensge.org>.
-+ *
-+ * Author: Jens Georg <mail@jensge.org>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+using GUPnP;
-+
-+internal class Rygel.LMS.SqlOperator : GLib.Object {
-+ protected string name;
-+ protected string arg;
-+ protected string collate;
-+
-+ public SqlOperator (string name,
-+ string arg,
-+ string collate = "") {
-+ this.name = name;
-+ this.arg = arg;
-+ this.collate = collate;
-+ }
-+
-+ public SqlOperator.from_search_criteria_op (SearchCriteriaOp op,
-+ string arg,
-+ string collate) {
-+ string sql = null;
-+ switch (op) {
-+ case SearchCriteriaOp.EQ:
-+ sql = "=";
-+ break;
-+ case SearchCriteriaOp.NEQ:
-+ sql = "!=";
-+ break;
-+ case SearchCriteriaOp.LESS:
-+ sql = "<";
-+ break;
-+ case SearchCriteriaOp.LEQ:
-+ sql = "<=";
-+ break;
-+ case SearchCriteriaOp.GREATER:
-+ sql = ">";
-+ break;
-+ case SearchCriteriaOp.GEQ:
-+ sql = ">=";
-+ break;
-+ default:
-+ assert_not_reached ();
-+ }
-+
-+ this (sql, arg, collate);
-+ }
-+
-+ public virtual string to_string () {
-+ return "(%s %s ? %s)".printf (arg, name, collate);
-+ }
-+}
-+
-+
---
-1.7.10.4
-
diff --git a/meta-agl/recipes-connectivity/rygel/files/0001-Fix-missing-link-to-unistring-for-lms-plugin.patch b/meta-agl/recipes-connectivity/rygel/files/0001-Fix-missing-link-to-unistring-for-lms-plugin.patch
deleted file mode 100644
index 57b97a6ca..000000000
--- a/meta-agl/recipes-connectivity/rygel/files/0001-Fix-missing-link-to-unistring-for-lms-plugin.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 10602ca53b1c1231e96d8d446904617528c11dae Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Mon, 13 Mar 2017 15:31:41 +0100
-Subject: [PATCH] Fix missing link to unistring for lms plugin
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- configure.ac | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index c5cbc00..2f7dc78 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -248,6 +248,10 @@ AS_IF([test "x$enable_lms_plugin" = "xyes"],
- gio-2.0 >= $GIO_REQUIRED
- sqlite3 >= $LIBSQLITE3_REQUIRED])
- RYGEL_PLUGIN_LMS_DEPS_VALAFLAGS="$RYGEL_COMMON_MODULES_VALAFLAGS --pkg gio-2.0 --pkg gee-0.8 --pkg sqlite3"
-+ AS_IF([test "x$have_unistring" = "xyes"],
-+ [
-+ RYGEL_PLUGIN_LMS_DEPS_LIBS="$RYGEL_PLUGIN_LMS_DEPS_LIBS -lunistring"
-+ ])
- AC_SUBST([RYGEL_PLUGIN_LMS_DEPS_VALAFLAGS])
- ])
-
---
-2.6.6
-
diff --git a/meta-agl/recipes-connectivity/rygel/files/0002-lms-add-C-source-files.patch b/meta-agl/recipes-connectivity/rygel/files/0002-lms-add-C-source-files.patch
deleted file mode 100644
index bbd61aa27..000000000
--- a/meta-agl/recipes-connectivity/rygel/files/0002-lms-add-C-source-files.patch
+++ /dev/null
@@ -1,9455 +0,0 @@
-From 5a91b6b6efdaf28a6640126a32e819aef7e10a74 Mon Sep 17 00:00:00 2001
-From: Manuel Bachmann <manuel.bachmann@iot.bzh>
-Date: Sun, 25 Oct 2015 14:21:28 +0100
-Subject: [PATCH] lms: add C source files
-
-C source files are normally generated by Vala at compile
-time, but we do not use Vala for Rygel under OpenEmbedded
-(because it requires GObject-Introspection support in
-dependencies such as GUPnP, and that is still buggy).
-
-A full tarball release would contain the C files anyway,
-so let us include them so the build succeeds with OE.
-
-Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
----
- src/plugins/lms/librygel_lms_la_vala.stamp | 1 +
- src/plugins/lms/rygel-lms-album.c | 514 +++++
- src/plugins/lms/rygel-lms-albums.c | 569 +++++
- src/plugins/lms/rygel-lms-all-images.c | 305 +++
- src/plugins/lms/rygel-lms-all-music.c | 417 ++++
- src/plugins/lms/rygel-lms-all-videos.c | 456 ++++
- src/plugins/lms/rygel-lms-artist.c | 274 +++
- src/plugins/lms/rygel-lms-artists.c | 214 ++
- src/plugins/lms/rygel-lms-category-container.c | 2772 ++++++++++++++++++++++++
- src/plugins/lms/rygel-lms-database.c | 1349 ++++++++++++
- src/plugins/lms/rygel-lms-dbus-interfaces.c | 261 +++
- src/plugins/lms/rygel-lms-image-root.c | 178 ++
- src/plugins/lms/rygel-lms-image-year.c | 422 ++++
- src/plugins/lms/rygel-lms-image-years.c | 196 ++
- src/plugins/lms/rygel-lms-music-root.c | 202 ++
- src/plugins/lms/rygel-lms-plugin-factory.c | 307 +++
- src/plugins/lms/rygel-lms-plugin.c | 134 ++
- src/plugins/lms/rygel-lms-root-container.c | 318 +++
- src/plugins/lms/rygel-lms-sql-function.c | 146 ++
- src/plugins/lms/rygel-lms-sql-operator.c | 240 ++
- 21 files changed, 9276 insertions(+), 1 deletion(-)
- create mode 100644 src/plugins/lms/librygel_lms_la_vala.stamp
- create mode 100644 src/plugins/lms/rygel-lms-album.c
- create mode 100644 src/plugins/lms/rygel-lms-albums.c
- create mode 100644 src/plugins/lms/rygel-lms-all-images.c
- create mode 100644 src/plugins/lms/rygel-lms-all-music.c
- create mode 100644 src/plugins/lms/rygel-lms-all-videos.c
- create mode 100644 src/plugins/lms/rygel-lms-artist.c
- create mode 100644 src/plugins/lms/rygel-lms-artists.c
- create mode 100644 src/plugins/lms/rygel-lms-category-container.c
- create mode 100644 src/plugins/lms/rygel-lms-database.c
- create mode 100644 src/plugins/lms/rygel-lms-dbus-interfaces.c
- create mode 100644 src/plugins/lms/rygel-lms-image-root.c
- create mode 100644 src/plugins/lms/rygel-lms-image-year.c
- create mode 100644 src/plugins/lms/rygel-lms-image-years.c
- create mode 100644 src/plugins/lms/rygel-lms-music-root.c
- create mode 100644 src/plugins/lms/rygel-lms-plugin-factory.c
- create mode 100644 src/plugins/lms/rygel-lms-plugin.c
- create mode 100644 src/plugins/lms/rygel-lms-root-container.c
- create mode 100644 src/plugins/lms/rygel-lms-sql-function.c
- create mode 100644 src/plugins/lms/rygel-lms-sql-operator.c
-
-diff --git a/src/plugins/lms/librygel_lms_la_vala.stamp b/src/plugins/lms/librygel_lms_la_vala.stamp
-new file mode 100644
-index 0000000..859afb1
---- /dev/null
-+++ b/src/plugins/lms/librygel_lms_la_vala.stamp
-@@ -0,0 +1 @@
-+stamp
-diff --git a/src/plugins/lms/rygel-lms-album.c b/src/plugins/lms/rygel-lms-album.c
-new file mode 100644
-index 0000000..9da60bc
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-album.c
-@@ -0,0 +1,514 @@
-+/* rygel-lms-album.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-album.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gio/gio.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ALBUM (rygel_lms_album_get_type ())
-+#define RYGEL_LMS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbum))
-+#define RYGEL_LMS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+#define RYGEL_LMS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+
-+typedef struct _RygelLMSAlbum RygelLMSAlbum;
-+typedef struct _RygelLMSAlbumClass RygelLMSAlbumClass;
-+typedef struct _RygelLMSAlbumPrivate RygelLMSAlbumPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSAlbum {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSAlbumPrivate * priv;
-+};
-+
-+struct _RygelLMSAlbumClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_album_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_album_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ALBUM_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ALBUM_SQL_ALL_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALBUM_SQL_COUNT_TEMPLATE "SELECT COUNT(audios.id) " "FROM audios, files " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;"
-+#define RYGEL_LMS_ALBUM_SQL_COUNT_WITH_FILTER_TEMPLATE "SELECT COUNT(audios.id), audios.title as title, " "audio_artists.name as artist, " "audio_albums.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s;"
-+#define RYGEL_LMS_ALBUM_SQL_FIND_OBJECT_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title, audios.trackno, audios.length, audios.channels, audios.s" \
-+"ampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " "audio_artists.name, " "audio_albums.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id AND audios.a" \
-+"lbum_id = %s;"
-+#define RYGEL_LMS_ALBUM_SQL_ADDED_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = %s " "AND update_id > ? AND update_id <= ?;"
-+#define RYGEL_LMS_ALBUM_SQL_REMOVED_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "WHERE dtime <> 0 AND audios.id = files.id AND audios.album_id = %s " "AND update_id > ? AND update_id <= ?;"
-+static RygelMediaObject* rygel_lms_album_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gchar* rygel_lms_category_container_build_reference_id (RygelLMSCategoryContainer* self, gint db_id);
-+static gchar* rygel_lms_album_get_sql_all (const gchar* db_id);
-+static gchar* rygel_lms_album_get_sql_find_object (const gchar* db_id);
-+static gchar* rygel_lms_album_get_sql_count (const gchar* db_id);
-+static gchar* rygel_lms_album_get_sql_added (const gchar* db_id);
-+static gchar* rygel_lms_album_get_sql_removed (const gchar* db_id);
-+static gchar* rygel_lms_album_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_all (RygelLMSCategoryContainer* self);
-+const gchar* rygel_lms_category_container_get_db_id (RygelLMSCategoryContainer* self);
-+static gchar* rygel_lms_album_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_count (RygelLMSCategoryContainer* self);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSAlbum* rygel_lms_album_new (const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAlbum* rygel_lms_album_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_album_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSAlbum * self;
-+ RygelMediaObject* result = NULL;
-+ gint id = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* path = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* mime_type = NULL;
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ gboolean _tmp8_ = FALSE;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ gchar* song_id = NULL;
-+ gint _tmp18_ = 0;
-+ gchar* _tmp19_ = NULL;
-+ RygelMusicItem* song = NULL;
-+ RygelMusicItem* _tmp20_ = NULL;
-+ gint _tmp21_ = 0;
-+ gchar* _tmp22_ = NULL;
-+ gchar* _tmp23_ = NULL;
-+ sqlite3_stmt* _tmp24_ = NULL;
-+ gint _tmp25_ = 0;
-+ sqlite3_stmt* _tmp26_ = NULL;
-+ gint _tmp27_ = 0;
-+ sqlite3_stmt* _tmp28_ = NULL;
-+ gint _tmp29_ = 0;
-+ sqlite3_stmt* _tmp30_ = NULL;
-+ gint _tmp31_ = 0;
-+ sqlite3_stmt* _tmp32_ = NULL;
-+ gint _tmp33_ = 0;
-+ sqlite3_stmt* _tmp34_ = NULL;
-+ gint _tmp35_ = 0;
-+ sqlite3_stmt* _tmp36_ = NULL;
-+ const gchar* _tmp37_ = NULL;
-+ const gchar* _tmp38_ = NULL;
-+ sqlite3_stmt* _tmp39_ = NULL;
-+ const gchar* _tmp40_ = NULL;
-+ sqlite3_stmt* _tmp41_ = NULL;
-+ const gchar* _tmp42_ = NULL;
-+ GFile* file = NULL;
-+ const gchar* _tmp43_ = NULL;
-+ GFile* _tmp44_ = NULL;
-+ gchar* _tmp45_ = NULL;
-+ gchar* _tmp46_ = NULL;
-+ self = (RygelLMSAlbum*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ id = _tmp1_;
-+ _tmp2_ = statement;
-+ _tmp3_ = sqlite3_column_text (_tmp2_, 1);
-+ _tmp4_ = g_strdup (_tmp3_);
-+ path = _tmp4_;
-+ _tmp5_ = statement;
-+ _tmp6_ = sqlite3_column_text (_tmp5_, 10);
-+ _tmp7_ = g_strdup (_tmp6_);
-+ mime_type = _tmp7_;
-+ _tmp9_ = mime_type;
-+ if (_tmp9_ == NULL) {
-+ _tmp8_ = TRUE;
-+ } else {
-+ const gchar* _tmp10_ = NULL;
-+ gint _tmp11_ = 0;
-+ gint _tmp12_ = 0;
-+ _tmp10_ = mime_type;
-+ _tmp11_ = strlen (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp8_ = _tmp12_ == 0;
-+ }
-+ if (_tmp8_) {
-+ gint _tmp13_ = 0;
-+ const gchar* _tmp14_ = NULL;
-+ _tmp13_ = id;
-+ _tmp14_ = path;
-+ g_debug ("rygel-lms-album.vala:101: Music item %d (%s) has no MIME type", _tmp13_, _tmp14_);
-+ }
-+ _tmp15_ = statement;
-+ _tmp16_ = sqlite3_column_text (_tmp15_, 3);
-+ _tmp17_ = g_strdup (_tmp16_);
-+ title = _tmp17_;
-+ _tmp18_ = id;
-+ _tmp19_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp18_);
-+ song_id = _tmp19_;
-+ _tmp20_ = rygel_music_item_new (song_id, (RygelMediaContainer*) self, title, RYGEL_MUSIC_ITEM_UPNP_CLASS);
-+ song = _tmp20_;
-+ _tmp21_ = id;
-+ _tmp22_ = rygel_lms_category_container_build_reference_id ((RygelLMSCategoryContainer*) self, _tmp21_);
-+ _tmp23_ = _tmp22_;
-+ rygel_media_object_set_ref_id ((RygelMediaObject*) song, _tmp23_);
-+ _g_free0 (_tmp23_);
-+ _tmp24_ = statement;
-+ _tmp25_ = sqlite3_column_int (_tmp24_, 2);
-+ rygel_media_file_item_set_size ((RygelMediaFileItem*) song, (gint64) _tmp25_);
-+ _tmp26_ = statement;
-+ _tmp27_ = sqlite3_column_int (_tmp26_, 4);
-+ rygel_music_item_set_track_number (song, _tmp27_);
-+ _tmp28_ = statement;
-+ _tmp29_ = sqlite3_column_int (_tmp28_, 5);
-+ rygel_audio_item_set_duration ((RygelAudioItem*) song, (glong) _tmp29_);
-+ _tmp30_ = statement;
-+ _tmp31_ = sqlite3_column_int (_tmp30_, 6);
-+ rygel_audio_item_set_channels ((RygelAudioItem*) song, _tmp31_);
-+ _tmp32_ = statement;
-+ _tmp33_ = sqlite3_column_int (_tmp32_, 7);
-+ rygel_audio_item_set_sample_freq ((RygelAudioItem*) song, _tmp33_);
-+ _tmp34_ = statement;
-+ _tmp35_ = sqlite3_column_int (_tmp34_, 8);
-+ rygel_audio_item_set_bitrate ((RygelAudioItem*) song, _tmp35_);
-+ _tmp36_ = statement;
-+ _tmp37_ = sqlite3_column_text (_tmp36_, 9);
-+ rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) song, _tmp37_);
-+ _tmp38_ = mime_type;
-+ rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) song, _tmp38_);
-+ _tmp39_ = statement;
-+ _tmp40_ = sqlite3_column_text (_tmp39_, 11);
-+ rygel_media_object_set_artist ((RygelMediaObject*) song, _tmp40_);
-+ _tmp41_ = statement;
-+ _tmp42_ = sqlite3_column_text (_tmp41_, 12);
-+ rygel_audio_item_set_album ((RygelAudioItem*) song, _tmp42_);
-+ _tmp43_ = path;
-+ _tmp44_ = g_file_new_for_path (_tmp43_);
-+ file = _tmp44_;
-+ _tmp45_ = g_file_get_uri (file);
-+ _tmp46_ = _tmp45_;
-+ rygel_media_object_add_uri ((RygelMediaObject*) song, _tmp46_);
-+ _g_free0 (_tmp46_);
-+ result = (RygelMediaObject*) song;
-+ _g_object_unref0 (file);
-+ _g_free0 (song_id);
-+ _g_free0 (title);
-+ _g_free0 (mime_type);
-+ _g_free0 (path);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_get_sql_all (const gchar* db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_ALL_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_get_sql_find_object (const gchar* db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_FIND_OBJECT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_get_sql_count (const gchar* db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_COUNT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_get_sql_added (const gchar* db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_ADDED_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_get_sql_removed (const gchar* db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_REMOVED_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAlbum * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ gchar* filter_str = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ self = (RygelLMSAlbum*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ const gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ _tmp3_ = rygel_lms_category_container_get_sql_all ((RygelLMSCategoryContainer*) self);
-+ _tmp4_ = _tmp3_;
-+ _tmp5_ = g_strdup (_tmp4_);
-+ result = _tmp5_;
-+ return result;
-+ }
-+ _tmp6_ = rygel_lms_category_container_get_db_id ((RygelLMSCategoryContainer*) self);
-+ _tmp7_ = _tmp6_;
-+ _tmp8_ = filter;
-+ _tmp9_ = g_strdup_printf ("%s AND %s", _tmp7_, _tmp8_);
-+ filter_str = _tmp9_;
-+ _tmp10_ = filter_str;
-+ _tmp11_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_ALL_TEMPLATE, _tmp10_);
-+ result = _tmp11_;
-+ _g_free0 (filter_str);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_album_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAlbum * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ gchar* filter_str = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ self = (RygelLMSAlbum*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ const gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ _tmp3_ = rygel_lms_category_container_get_sql_count ((RygelLMSCategoryContainer*) self);
-+ _tmp4_ = _tmp3_;
-+ _tmp5_ = g_strdup (_tmp4_);
-+ result = _tmp5_;
-+ return result;
-+ }
-+ _tmp6_ = rygel_lms_category_container_get_db_id ((RygelLMSCategoryContainer*) self);
-+ _tmp7_ = _tmp6_;
-+ _tmp8_ = filter;
-+ _tmp9_ = g_strdup_printf ("%s AND %s", _tmp7_, _tmp8_);
-+ filter_str = _tmp9_;
-+ _tmp10_ = filter_str;
-+ _tmp11_ = g_strdup_printf (RYGEL_LMS_ALBUM_SQL_COUNT_WITH_FILTER_TEMPLATE, _tmp10_);
-+ result = _tmp11_;
-+ _g_free0 (filter_str);
-+ return result;
-+}
-+
-+
-+RygelLMSAlbum* rygel_lms_album_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSAlbum * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ gchar* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ const gchar* _tmp13_ = NULL;
-+ gchar* _tmp14_ = NULL;
-+ gchar* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ gchar* _tmp18_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = db_id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ _tmp3_ = lms_db;
-+ _tmp4_ = db_id;
-+ _tmp5_ = rygel_lms_album_get_sql_all (_tmp4_);
-+ _tmp6_ = _tmp5_;
-+ _tmp7_ = db_id;
-+ _tmp8_ = rygel_lms_album_get_sql_find_object (_tmp7_);
-+ _tmp9_ = _tmp8_;
-+ _tmp10_ = db_id;
-+ _tmp11_ = rygel_lms_album_get_sql_count (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp13_ = db_id;
-+ _tmp14_ = rygel_lms_album_get_sql_added (_tmp13_);
-+ _tmp15_ = _tmp14_;
-+ _tmp16_ = db_id;
-+ _tmp17_ = rygel_lms_album_get_sql_removed (_tmp16_);
-+ _tmp18_ = _tmp17_;
-+ self = (RygelLMSAlbum*) rygel_lms_category_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp6_, _tmp9_, _tmp12_, _tmp15_, _tmp18_);
-+ _g_free0 (_tmp18_);
-+ _g_free0 (_tmp15_);
-+ _g_free0 (_tmp12_);
-+ _g_free0 (_tmp9_);
-+ _g_free0 (_tmp6_);
-+ return self;
-+}
-+
-+
-+RygelLMSAlbum* rygel_lms_album_new (const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_album_construct (RYGEL_LMS_TYPE_ALBUM, db_id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_album_class_init (RygelLMSAlbumClass * klass) {
-+ rygel_lms_album_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_album_real_object_from_statement;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_all_with_filter = rygel_lms_album_real_get_sql_all_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_count_with_filter = rygel_lms_album_real_get_sql_count_with_filter;
-+}
-+
-+
-+static void rygel_lms_album_instance_init (RygelLMSAlbum * self) {
-+}
-+
-+
-+GType rygel_lms_album_get_type (void) {
-+ static volatile gsize rygel_lms_album_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_album_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAlbumClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_album_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAlbum), 0, (GInstanceInitFunc) rygel_lms_album_instance_init, NULL };
-+ GType rygel_lms_album_type_id;
-+ rygel_lms_album_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAlbum", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_album_type_id__volatile, rygel_lms_album_type_id);
-+ }
-+ return rygel_lms_album_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-albums.c b/src/plugins/lms/rygel-lms-albums.c
-new file mode 100644
-index 0000000..f9fabe7
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-albums.c
-@@ -0,0 +1,569 @@
-+/* rygel-lms-albums.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-albums.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gee.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ALBUMS (rygel_lms_albums_get_type ())
-+#define RYGEL_LMS_ALBUMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbums))
-+#define RYGEL_LMS_ALBUMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbumsClass))
-+#define RYGEL_LMS_IS_ALBUMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALBUMS))
-+#define RYGEL_LMS_IS_ALBUMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALBUMS))
-+#define RYGEL_LMS_ALBUMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbumsClass))
-+
-+typedef struct _RygelLMSAlbums RygelLMSAlbums;
-+typedef struct _RygelLMSAlbumsClass RygelLMSAlbumsClass;
-+typedef struct _RygelLMSAlbumsPrivate RygelLMSAlbumsPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
-+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_ALBUM (rygel_lms_album_get_type ())
-+#define RYGEL_LMS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbum))
-+#define RYGEL_LMS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+#define RYGEL_LMS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+
-+typedef struct _RygelLMSAlbum RygelLMSAlbum;
-+typedef struct _RygelLMSAlbumClass RygelLMSAlbumClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSAlbums {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSAlbumsPrivate * priv;
-+};
-+
-+struct _RygelLMSAlbumsClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+typedef enum {
-+ RYGEL_LMS_DATABASE_ERROR_OPEN,
-+ RYGEL_LMS_DATABASE_ERROR_PREPARE,
-+ RYGEL_LMS_DATABASE_ERROR_BIND,
-+ RYGEL_LMS_DATABASE_ERROR_STEP,
-+ RYGEL_LMS_DATABASE_ERROR_NOT_FOUND
-+} RygelLMSDatabaseError;
-+#define RYGEL_LMS_DATABASE_ERROR rygel_lms_database_error_quark ()
-+
-+static gpointer rygel_lms_albums_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_albums_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ALBUMS_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ALBUMS_SQL_ALL "SELECT audio_albums.id, audio_albums.name as title, " "audio_artists.name as artist " "FROM audio_albums " "LEFT JOIN audio_artists " "ON audio_albums.artist_id = audio_artists.id " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALBUMS_SQL_ALL_WITH_FILTER_TEMPLATE "SELECT audio_albums.id, audio_albums.name as title, " "audio_artists.name as artist " "FROM audio_albums " "LEFT JOIN audio_artists " "ON audio_albums.artist_id = audio_artists.id " "WHERE %s " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALBUMS_SQL_COUNT "SELECT COUNT(audio_albums.id) " "FROM audio_albums;"
-+#define RYGEL_LMS_ALBUMS_SQL_COUNT_WITH_FILTER_TEMPLATE "SELECT COUNT(audio_albums.id), audio_albums.name as title, " "audio_artists.name as artist " "FROM audio_albums " "LEFT JOIN audio_artists " "ON audio_albums.artist_id = audio_artists.id " "WHERE %s;"
-+#define RYGEL_LMS_ALBUMS_SQL_CHILD_COUNT_WITH_FILTER_TEMPLATE "SELECT COUNT(audios.id), audios.title as title, " "audio_artists.name as artist " "FROM audios, files, audio_albums " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_a" \
-+"lbums.id %s;"
-+#define RYGEL_LMS_ALBUMS_SQL_CHILD_ALL_WITH_FILTER_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name, audio_albums.id " "FROM audios, files, audio_albums " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "WHERE dtime = 0 AND audios.id = files.id AND audios.album_id = audio_a" \
-+"lbums.id %s " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALBUMS_SQL_FIND_OBJECT "SELECT audio_albums.id, audio_albums.name " "FROM audio_albums " "WHERE audio_albums.id = ?;"
-+static gchar* rygel_lms_albums_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+static gchar* rygel_lms_albums_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+static guint rygel_lms_albums_real_get_child_count_with_filter (RygelLMSCategoryContainer* base, const gchar* where_filter, GValueArray* args);
-+guint rygel_lms_category_container_get_child_count_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+GQuark rygel_lms_database_error_quark (void);
-+sqlite3_stmt* rygel_lms_database_prepare_and_init (RygelLMSDatabase* self, const gchar* query, GValue* arguments, int arguments_length1, GError** error);
-+static RygelMediaObjects* rygel_lms_albums_real_get_children_with_filter (RygelLMSCategoryContainer* base, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+RygelMediaObjects* rygel_lms_category_container_get_children_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+gboolean rygel_lms_database_get_children_step (sqlite3_stmt* stmt, GError** error);
-+GType rygel_lms_album_get_type (void) G_GNUC_CONST;
-+RygelLMSAlbum* rygel_lms_album_new (const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAlbum* rygel_lms_album_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelMediaObject* rygel_lms_category_container_object_from_statement (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+static RygelMediaObject* rygel_lms_albums_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+RygelLMSAlbums* rygel_lms_albums_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAlbums* rygel_lms_albums_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static gchar* rygel_lms_albums_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAlbums * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ self = (RygelLMSAlbums*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ gchar* _tmp3_ = NULL;
-+ _tmp3_ = g_strdup (RYGEL_LMS_ALBUMS_SQL_ALL);
-+ result = _tmp3_;
-+ return result;
-+ }
-+ _tmp4_ = filter;
-+ _tmp5_ = g_strdup_printf (RYGEL_LMS_ALBUMS_SQL_ALL_WITH_FILTER_TEMPLATE, _tmp4_);
-+ result = _tmp5_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_albums_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAlbums * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ self = (RygelLMSAlbums*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ gchar* _tmp3_ = NULL;
-+ _tmp3_ = g_strdup (RYGEL_LMS_ALBUMS_SQL_COUNT);
-+ result = _tmp3_;
-+ return result;
-+ }
-+ _tmp4_ = filter;
-+ _tmp5_ = g_strdup_printf (RYGEL_LMS_ALBUMS_SQL_COUNT_WITH_FILTER_TEMPLATE, _tmp4_);
-+ result = _tmp5_;
-+ return result;
-+}
-+
-+
-+static guint rygel_lms_albums_real_get_child_count_with_filter (RygelLMSCategoryContainer* base, const gchar* where_filter, GValueArray* args) {
-+ RygelLMSAlbums * self;
-+ guint result = 0U;
-+ guint count = 0U;
-+ const gchar* _tmp0_ = NULL;
-+ GValueArray* _tmp1_ = NULL;
-+ guint _tmp2_ = 0U;
-+ gchar* filter = NULL;
-+ gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gint _tmp5_ = 0;
-+ gint _tmp6_ = 0;
-+ gchar* query = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* _tmp10_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ self = (RygelLMSAlbums*) base;
-+ g_return_val_if_fail (where_filter != NULL, 0U);
-+ g_return_val_if_fail (args != NULL, 0U);
-+ _tmp0_ = where_filter;
-+ _tmp1_ = args;
-+ _tmp2_ = RYGEL_LMS_CATEGORY_CONTAINER_CLASS (rygel_lms_albums_parent_class)->get_child_count_with_filter (G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer), _tmp0_, _tmp1_);
-+ count = _tmp2_;
-+ _tmp3_ = g_strdup ("");
-+ filter = _tmp3_;
-+ _tmp4_ = where_filter;
-+ _tmp5_ = strlen (_tmp4_);
-+ _tmp6_ = _tmp5_;
-+ if (_tmp6_ > 0) {
-+ const gchar* _tmp7_ = NULL;
-+ gchar* _tmp8_ = NULL;
-+ _tmp7_ = where_filter;
-+ _tmp8_ = g_strdup_printf ("AND %s", _tmp7_);
-+ _g_free0 (filter);
-+ filter = _tmp8_;
-+ }
-+ _tmp9_ = filter;
-+ _tmp10_ = g_strdup_printf (RYGEL_LMS_ALBUMS_SQL_CHILD_COUNT_WITH_FILTER_TEMPLATE, _tmp9_);
-+ query = _tmp10_;
-+ {
-+ sqlite3_stmt* stmt = NULL;
-+ RygelLMSDatabase* _tmp11_ = NULL;
-+ RygelLMSDatabase* _tmp12_ = NULL;
-+ GValueArray* _tmp13_ = NULL;
-+ GValue* _tmp14_ = NULL;
-+ gint _tmp14__length1 = 0;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ gint _tmp16_ = 0;
-+ _tmp11_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp12_ = _tmp11_;
-+ _tmp13_ = args;
-+ _tmp14_ = _tmp13_->values;
-+ _tmp14__length1 = (gint) _tmp13_->n_values;
-+ _tmp15_ = rygel_lms_database_prepare_and_init (_tmp12_, query, _tmp14_, _tmp14__length1, &_inner_error_);
-+ stmt = _tmp15_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch8_rygel_lms_database_error;
-+ }
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return 0U;
-+ }
-+ _tmp16_ = sqlite3_step (stmt);
-+ if (_tmp16_ == SQLITE_ROW) {
-+ guint _tmp17_ = 0U;
-+ gint _tmp18_ = 0;
-+ _tmp17_ = count;
-+ _tmp18_ = sqlite3_column_int (stmt, 0);
-+ count = _tmp17_ + _tmp18_;
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ }
-+ goto __finally8;
-+ __catch8_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp19_ = NULL;
-+ const gchar* _tmp20_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp19_ = e;
-+ _tmp20_ = _tmp19_->message;
-+ g_warning ("rygel-lms-albums.vala:116: Query failed: %s", _tmp20_);
-+ _g_error_free0 (e);
-+ }
-+ __finally8:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return 0U;
-+ }
-+ result = count;
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ return result;
-+}
-+
-+
-+static RygelMediaObjects* rygel_lms_albums_real_get_children_with_filter (RygelLMSCategoryContainer* base, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count) {
-+ RygelLMSAlbums * self;
-+ RygelMediaObjects* result = NULL;
-+ RygelMediaObjects* children = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ GValueArray* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ guint _tmp3_ = 0U;
-+ guint _tmp4_ = 0U;
-+ RygelMediaObjects* _tmp5_ = NULL;
-+ gchar* filter = NULL;
-+ gchar* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ gint _tmp8_ = 0;
-+ gint _tmp9_ = 0;
-+ gchar* query = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ self = (RygelLMSAlbums*) base;
-+ g_return_val_if_fail (where_filter != NULL, NULL);
-+ g_return_val_if_fail (args != NULL, NULL);
-+ g_return_val_if_fail (sort_criteria != NULL, NULL);
-+ _tmp0_ = where_filter;
-+ _tmp1_ = args;
-+ _tmp2_ = sort_criteria;
-+ _tmp3_ = offset;
-+ _tmp4_ = max_count;
-+ _tmp5_ = RYGEL_LMS_CATEGORY_CONTAINER_CLASS (rygel_lms_albums_parent_class)->get_children_with_filter (G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer), _tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_);
-+ children = _tmp5_;
-+ _tmp6_ = g_strdup ("");
-+ filter = _tmp6_;
-+ _tmp7_ = where_filter;
-+ _tmp8_ = strlen (_tmp7_);
-+ _tmp9_ = _tmp8_;
-+ if (_tmp9_ > 0) {
-+ const gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ _tmp10_ = where_filter;
-+ _tmp11_ = g_strdup_printf ("AND %s", _tmp10_);
-+ _g_free0 (filter);
-+ filter = _tmp11_;
-+ }
-+ _tmp12_ = filter;
-+ _tmp13_ = g_strdup_printf (RYGEL_LMS_ALBUMS_SQL_CHILD_ALL_WITH_FILTER_TEMPLATE, _tmp12_);
-+ query = _tmp13_;
-+ {
-+ sqlite3_stmt* stmt = NULL;
-+ RygelLMSDatabase* _tmp14_ = NULL;
-+ RygelLMSDatabase* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ GValueArray* _tmp17_ = NULL;
-+ GValue* _tmp18_ = NULL;
-+ gint _tmp18__length1 = 0;
-+ sqlite3_stmt* _tmp19_ = NULL;
-+ _tmp14_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp15_ = _tmp14_;
-+ _tmp16_ = query;
-+ _tmp17_ = args;
-+ _tmp18_ = _tmp17_->values;
-+ _tmp18__length1 = (gint) _tmp17_->n_values;
-+ _tmp19_ = rygel_lms_database_prepare_and_init (_tmp15_, _tmp16_, _tmp18_, _tmp18__length1, &_inner_error_);
-+ stmt = _tmp19_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch9_rygel_lms_database_error;
-+ }
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ while (TRUE) {
-+ gboolean _tmp20_ = FALSE;
-+ sqlite3_stmt* _tmp21_ = NULL;
-+ gboolean _tmp22_ = FALSE;
-+ gchar* album_id = NULL;
-+ sqlite3_stmt* _tmp23_ = NULL;
-+ const gchar* _tmp24_ = NULL;
-+ gchar* _tmp25_ = NULL;
-+ RygelLMSAlbum* album = NULL;
-+ const gchar* _tmp26_ = NULL;
-+ RygelLMSDatabase* _tmp27_ = NULL;
-+ RygelLMSDatabase* _tmp28_ = NULL;
-+ RygelLMSAlbum* _tmp29_ = NULL;
-+ RygelMediaObject* song = NULL;
-+ RygelLMSAlbum* _tmp30_ = NULL;
-+ sqlite3_stmt* _tmp31_ = NULL;
-+ RygelMediaObject* _tmp32_ = NULL;
-+ RygelMediaObject* _tmp33_ = NULL;
-+ RygelMediaObject* _tmp34_ = NULL;
-+ RygelMediaContainer* _tmp35_ = NULL;
-+ RygelMediaContainer* _tmp36_ = NULL;
-+ RygelMediaObjects* _tmp37_ = NULL;
-+ RygelMediaObject* _tmp38_ = NULL;
-+ _tmp21_ = stmt;
-+ _tmp22_ = rygel_lms_database_get_children_step (_tmp21_, &_inner_error_);
-+ _tmp20_ = _tmp22_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch9_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ if (!_tmp20_) {
-+ break;
-+ }
-+ _tmp23_ = stmt;
-+ _tmp24_ = sqlite3_column_text (_tmp23_, 13);
-+ _tmp25_ = g_strdup (_tmp24_);
-+ album_id = _tmp25_;
-+ _tmp26_ = album_id;
-+ _tmp27_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp28_ = _tmp27_;
-+ _tmp29_ = rygel_lms_album_new (_tmp26_, (RygelMediaContainer*) self, "", _tmp28_);
-+ album = _tmp29_;
-+ _tmp30_ = album;
-+ _tmp31_ = stmt;
-+ _tmp32_ = rygel_lms_category_container_object_from_statement ((RygelLMSCategoryContainer*) _tmp30_, _tmp31_);
-+ song = _tmp32_;
-+ _tmp33_ = song;
-+ _tmp34_ = song;
-+ _tmp35_ = rygel_media_object_get_parent (_tmp34_);
-+ _tmp36_ = _tmp35_;
-+ rygel_media_object_set_parent_ref (_tmp33_, _tmp36_);
-+ _tmp37_ = children;
-+ _tmp38_ = song;
-+ gee_abstract_collection_add ((GeeAbstractCollection*) _tmp37_, _tmp38_);
-+ _g_object_unref0 (song);
-+ _g_object_unref0 (album);
-+ _g_free0 (album_id);
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ }
-+ goto __finally9;
-+ __catch9_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp39_ = NULL;
-+ const gchar* _tmp40_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp39_ = e;
-+ _tmp40_ = _tmp39_->message;
-+ g_warning ("rygel-lms-albums.vala:149: Query failed: %s", _tmp40_);
-+ _g_error_free0 (e);
-+ }
-+ __finally9:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ result = children;
-+ _g_free0 (query);
-+ _g_free0 (filter);
-+ return result;
-+}
-+
-+
-+static RygelMediaObject* rygel_lms_albums_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSAlbums * self;
-+ RygelMediaObject* result = NULL;
-+ gchar* id = NULL;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* _tmp2_ = NULL;
-+ RygelLMSAlbum* album = NULL;
-+ sqlite3_stmt* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ RygelLMSDatabase* _tmp5_ = NULL;
-+ RygelLMSDatabase* _tmp6_ = NULL;
-+ RygelLMSAlbum* _tmp7_ = NULL;
-+ self = (RygelLMSAlbums*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ _tmp2_ = g_strdup_printf ("%d", _tmp1_);
-+ id = _tmp2_;
-+ _tmp3_ = statement;
-+ _tmp4_ = sqlite3_column_text (_tmp3_, 1);
-+ _tmp5_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp6_ = _tmp5_;
-+ _tmp7_ = rygel_lms_album_new (id, (RygelMediaContainer*) self, _tmp4_, _tmp6_);
-+ album = _tmp7_;
-+ result = (RygelMediaObject*) album;
-+ _g_free0 (id);
-+ return result;
-+}
-+
-+
-+RygelLMSAlbums* rygel_lms_albums_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ RygelLMSAlbums * self = NULL;
-+ RygelMediaContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = parent;
-+ _tmp1_ = _ ("Albums");
-+ _tmp2_ = lms_db;
-+ self = (RygelLMSAlbums*) rygel_lms_category_container_construct (object_type, "albums", _tmp0_, _tmp1_, _tmp2_, RYGEL_LMS_ALBUMS_SQL_ALL, RYGEL_LMS_ALBUMS_SQL_FIND_OBJECT, RYGEL_LMS_ALBUMS_SQL_COUNT, NULL, NULL);
-+ return self;
-+}
-+
-+
-+RygelLMSAlbums* rygel_lms_albums_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_albums_construct (RYGEL_LMS_TYPE_ALBUMS, parent, lms_db);
-+}
-+
-+
-+static void rygel_lms_albums_class_init (RygelLMSAlbumsClass * klass) {
-+ rygel_lms_albums_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_all_with_filter = rygel_lms_albums_real_get_sql_all_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_count_with_filter = rygel_lms_albums_real_get_sql_count_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_child_count_with_filter = rygel_lms_albums_real_get_child_count_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_children_with_filter = rygel_lms_albums_real_get_children_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_albums_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_albums_instance_init (RygelLMSAlbums * self) {
-+}
-+
-+
-+GType rygel_lms_albums_get_type (void) {
-+ static volatile gsize rygel_lms_albums_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_albums_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAlbumsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_albums_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAlbums), 0, (GInstanceInitFunc) rygel_lms_albums_instance_init, NULL };
-+ GType rygel_lms_albums_type_id;
-+ rygel_lms_albums_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAlbums", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_albums_type_id__volatile, rygel_lms_albums_type_id);
-+ }
-+ return rygel_lms_albums_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-all-images.c b/src/plugins/lms/rygel-lms-all-images.c
-new file mode 100644
-index 0000000..33fb8c1
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-images.c
-@@ -0,0 +1,305 @@
-+/* rygel-lms-all-images.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-all-images.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gio/gio.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ALL_IMAGES (rygel_lms_all_images_get_type ())
-+#define RYGEL_LMS_ALL_IMAGES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImages))
-+#define RYGEL_LMS_ALL_IMAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImagesClass))
-+#define RYGEL_LMS_IS_ALL_IMAGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_IMAGES))
-+#define RYGEL_LMS_IS_ALL_IMAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_IMAGES))
-+#define RYGEL_LMS_ALL_IMAGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImagesClass))
-+
-+typedef struct _RygelLMSAllImages RygelLMSAllImages;
-+typedef struct _RygelLMSAllImagesClass RygelLMSAllImagesClass;
-+typedef struct _RygelLMSAllImagesPrivate RygelLMSAllImagesPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSAllImages {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSAllImagesPrivate * priv;
-+};
-+
-+struct _RygelLMSAllImagesClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_all_images_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_images_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ALL_IMAGES_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ALL_IMAGES_SQL_ALL "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALL_IMAGES_SQL_COUNT "SELECT count(images.id) " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id;"
-+#define RYGEL_LMS_ALL_IMAGES_SQL_FIND_OBJECT "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime " "FROM images, files " "WHERE dtime = 0 AND files.id = ? AND images.id = files.id;"
-+#define RYGEL_LMS_ALL_IMAGES_SQL_ADDED "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+#define RYGEL_LMS_ALL_IMAGES_SQL_REMOVED "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime " "FROM images, files " "WHERE dtime <> 0 AND images.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+static RygelMediaObject* rygel_lms_all_images_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSAllImages* rygel_lms_all_images_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAllImages* rygel_lms_all_images_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_all_images_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSAllImages * self;
-+ RygelMediaObject* result = NULL;
-+ gint id = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* path = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* mime_type = NULL;
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ gboolean _tmp8_ = FALSE;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ RygelImageItem* image = NULL;
-+ gint _tmp18_ = 0;
-+ gchar* _tmp19_ = NULL;
-+ gchar* _tmp20_ = NULL;
-+ RygelImageItem* _tmp21_ = NULL;
-+ RygelImageItem* _tmp22_ = NULL;
-+ sqlite3_stmt* _tmp23_ = NULL;
-+ const gchar* _tmp24_ = NULL;
-+ GTimeVal tv = {0};
-+ sqlite3_stmt* _tmp25_ = NULL;
-+ gint _tmp26_ = 0;
-+ GTimeVal _tmp27_ = {0};
-+ gchar* _tmp28_ = NULL;
-+ gchar* _tmp29_ = NULL;
-+ sqlite3_stmt* _tmp30_ = NULL;
-+ gint _tmp31_ = 0;
-+ sqlite3_stmt* _tmp32_ = NULL;
-+ gint _tmp33_ = 0;
-+ sqlite3_stmt* _tmp34_ = NULL;
-+ gint _tmp35_ = 0;
-+ const gchar* _tmp36_ = NULL;
-+ sqlite3_stmt* _tmp37_ = NULL;
-+ const gchar* _tmp38_ = NULL;
-+ GFile* file = NULL;
-+ const gchar* _tmp39_ = NULL;
-+ GFile* _tmp40_ = NULL;
-+ gchar* _tmp41_ = NULL;
-+ gchar* _tmp42_ = NULL;
-+ self = (RygelLMSAllImages*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ id = _tmp1_;
-+ _tmp2_ = statement;
-+ _tmp3_ = sqlite3_column_text (_tmp2_, 6);
-+ _tmp4_ = g_strdup (_tmp3_);
-+ path = _tmp4_;
-+ _tmp5_ = statement;
-+ _tmp6_ = sqlite3_column_text (_tmp5_, 9);
-+ _tmp7_ = g_strdup (_tmp6_);
-+ mime_type = _tmp7_;
-+ _tmp9_ = mime_type;
-+ if (_tmp9_ == NULL) {
-+ _tmp8_ = TRUE;
-+ } else {
-+ const gchar* _tmp10_ = NULL;
-+ gint _tmp11_ = 0;
-+ gint _tmp12_ = 0;
-+ _tmp10_ = mime_type;
-+ _tmp11_ = strlen (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp8_ = _tmp12_ == 0;
-+ }
-+ if (_tmp8_) {
-+ gint _tmp13_ = 0;
-+ const gchar* _tmp14_ = NULL;
-+ _tmp13_ = id;
-+ _tmp14_ = path;
-+ g_debug ("rygel-lms-all-images.vala:62: Image item %d (%s) has no MIME type", _tmp13_, _tmp14_);
-+ }
-+ _tmp15_ = statement;
-+ _tmp16_ = sqlite3_column_text (_tmp15_, 1);
-+ _tmp17_ = g_strdup (_tmp16_);
-+ title = _tmp17_;
-+ _tmp18_ = id;
-+ _tmp19_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp18_);
-+ _tmp20_ = _tmp19_;
-+ _tmp21_ = rygel_image_item_new (_tmp20_, (RygelMediaContainer*) self, title, RYGEL_IMAGE_ITEM_UPNP_CLASS);
-+ _tmp22_ = _tmp21_;
-+ _g_free0 (_tmp20_);
-+ image = _tmp22_;
-+ _tmp23_ = statement;
-+ _tmp24_ = sqlite3_column_text (_tmp23_, 2);
-+ rygel_media_object_set_creator ((RygelMediaObject*) image, _tmp24_);
-+ _tmp25_ = statement;
-+ _tmp26_ = sqlite3_column_int (_tmp25_, 3);
-+ _tmp27_.tv_sec = (glong) _tmp26_;
-+ _tmp27_.tv_usec = (glong) 0;
-+ tv = _tmp27_;
-+ _tmp28_ = g_time_val_to_iso8601 (&tv);
-+ _tmp29_ = _tmp28_;
-+ rygel_media_object_set_date ((RygelMediaObject*) image, _tmp29_);
-+ _g_free0 (_tmp29_);
-+ _tmp30_ = statement;
-+ _tmp31_ = sqlite3_column_int (_tmp30_, 4);
-+ rygel_visual_item_set_width ((RygelVisualItem*) image, _tmp31_);
-+ _tmp32_ = statement;
-+ _tmp33_ = sqlite3_column_int (_tmp32_, 5);
-+ rygel_visual_item_set_height ((RygelVisualItem*) image, _tmp33_);
-+ _tmp34_ = statement;
-+ _tmp35_ = sqlite3_column_int (_tmp34_, 7);
-+ rygel_media_file_item_set_size ((RygelMediaFileItem*) image, (gint64) _tmp35_);
-+ _tmp36_ = mime_type;
-+ rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) image, _tmp36_);
-+ _tmp37_ = statement;
-+ _tmp38_ = sqlite3_column_text (_tmp37_, 8);
-+ rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) image, _tmp38_);
-+ _tmp39_ = path;
-+ _tmp40_ = g_file_new_for_path (_tmp39_);
-+ file = _tmp40_;
-+ _tmp41_ = g_file_get_uri (file);
-+ _tmp42_ = _tmp41_;
-+ rygel_media_object_add_uri ((RygelMediaObject*) image, _tmp42_);
-+ _g_free0 (_tmp42_);
-+ result = (RygelMediaObject*) image;
-+ _g_object_unref0 (file);
-+ _g_free0 (title);
-+ _g_free0 (mime_type);
-+ _g_free0 (path);
-+ return result;
-+}
-+
-+
-+RygelLMSAllImages* rygel_lms_all_images_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ RygelLMSAllImages * self = NULL;
-+ RygelMediaContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = parent;
-+ _tmp1_ = _ ("All");
-+ _tmp2_ = lms_db;
-+ self = (RygelLMSAllImages*) rygel_lms_category_container_construct (object_type, "all", _tmp0_, _tmp1_, _tmp2_, RYGEL_LMS_ALL_IMAGES_SQL_ALL, RYGEL_LMS_ALL_IMAGES_SQL_FIND_OBJECT, RYGEL_LMS_ALL_IMAGES_SQL_COUNT, RYGEL_LMS_ALL_IMAGES_SQL_ADDED, RYGEL_LMS_ALL_IMAGES_SQL_REMOVED);
-+ return self;
-+}
-+
-+
-+RygelLMSAllImages* rygel_lms_all_images_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_all_images_construct (RYGEL_LMS_TYPE_ALL_IMAGES, parent, lms_db);
-+}
-+
-+
-+static void rygel_lms_all_images_class_init (RygelLMSAllImagesClass * klass) {
-+ rygel_lms_all_images_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_all_images_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_all_images_instance_init (RygelLMSAllImages * self) {
-+}
-+
-+
-+GType rygel_lms_all_images_get_type (void) {
-+ static volatile gsize rygel_lms_all_images_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_all_images_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAllImagesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_all_images_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAllImages), 0, (GInstanceInitFunc) rygel_lms_all_images_instance_init, NULL };
-+ GType rygel_lms_all_images_type_id;
-+ rygel_lms_all_images_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAllImages", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_all_images_type_id__volatile, rygel_lms_all_images_type_id);
-+ }
-+ return rygel_lms_all_images_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-all-music.c b/src/plugins/lms/rygel-lms-all-music.c
-new file mode 100644
-index 0000000..ee6118f
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-music.c
-@@ -0,0 +1,417 @@
-+/* rygel-lms-all-music.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-all-music.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gio/gio.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ALL_MUSIC (rygel_lms_all_music_get_type ())
-+#define RYGEL_LMS_ALL_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusic))
-+#define RYGEL_LMS_ALL_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusicClass))
-+#define RYGEL_LMS_IS_ALL_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_MUSIC))
-+#define RYGEL_LMS_IS_ALL_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_MUSIC))
-+#define RYGEL_LMS_ALL_MUSIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusicClass))
-+
-+typedef struct _RygelLMSAllMusic RygelLMSAllMusic;
-+typedef struct _RygelLMSAllMusicClass RygelLMSAllMusicClass;
-+typedef struct _RygelLMSAllMusicPrivate RygelLMSAllMusicPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSAllMusic {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSAllMusicPrivate * priv;
-+};
-+
-+struct _RygelLMSAllMusicClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_all_music_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_music_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ALL_MUSIC_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ALL_MUSIC_SQL_ALL_TEMPLATE "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name, " "files.mtime, " "audio_genres.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "LEFT JOIN audio_genres " "ON audios.genre_id = audio_genres.id " "WHERE dtime = 0 AND audios.id = files.id %s " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALL_MUSIC_SQL_COUNT "SELECT COUNT(audios.id) " "FROM audios, files " "WHERE dtime = 0 AND audios.id = files.id;"
-+#define RYGEL_LMS_ALL_MUSIC_SQL_COUNT_WITH_FILTER_TEMPLATE "SELECT COUNT(audios.id), audios.title as title, " "audio_artists.name as artist " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "WHERE dtime = 0 AND audios.id = files.id %s;"
-+#define RYGEL_LMS_ALL_MUSIC_SQL_FIND_OBJECT "SELECT files.id, files.path, files.size, " "audios.title, audios.trackno, audios.length, audios.channels, audios.s" \
-+"ampling_rate, audios.bitrate, audios.dlna_profile, audios.dlna_mime, " "audio_artists.name, " "audio_albums.name, " "files.mtime, " "audio_genres.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "LEFT JOIN audio_genres " "ON audios.genre_id = audio_genres.id " "WHERE dtime = 0 AND files.id = ? AND audios.id = files.id;"
-+#define RYGEL_LMS_ALL_MUSIC_SQL_ADDED "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name, " "files.mtime, " "audio_genres.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "LEFT JOIN audio_genres " "ON audios.genre_id = audio_genres.id " "WHERE dtime = 0 AND audios.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+#define RYGEL_LMS_ALL_MUSIC_SQL_REMOVED "SELECT files.id, files.path, files.size, " "audios.title as title, audios.trackno, audios.length, audios.channels," \
-+" audios.sampling_rate, audios.bitrate, audios.dlna_profile, audios.dln" \
-+"a_mime, " "audio_artists.name as artist, " "audio_albums.name, " "files.mtime, " "audio_genres.name " "FROM audios, files " "LEFT JOIN audio_artists " "ON audios.artist_id = audio_artists.id " "LEFT JOIN audio_albums " "ON audios.album_id = audio_albums.id " "LEFT JOIN audio_genres " "ON audios.genre_id = audio_genres.id " "WHERE dtime <> 0 AND audios.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+static gchar* rygel_lms_all_music_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_all (RygelLMSCategoryContainer* self);
-+static gchar* rygel_lms_all_music_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_count (RygelLMSCategoryContainer* self);
-+static RygelMediaObject* rygel_lms_all_music_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSAllMusic* rygel_lms_all_music_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAllMusic* rygel_lms_all_music_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static gchar* rygel_lms_all_music_real_get_sql_all_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAllMusic * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ gchar* filter_str = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ self = (RygelLMSAllMusic*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ const gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ _tmp3_ = rygel_lms_category_container_get_sql_all ((RygelLMSCategoryContainer*) self);
-+ _tmp4_ = _tmp3_;
-+ _tmp5_ = g_strdup (_tmp4_);
-+ result = _tmp5_;
-+ return result;
-+ }
-+ _tmp6_ = filter;
-+ _tmp7_ = g_strdup_printf ("AND %s", _tmp6_);
-+ filter_str = _tmp7_;
-+ _tmp8_ = filter_str;
-+ _tmp9_ = g_strdup_printf (RYGEL_LMS_ALL_MUSIC_SQL_ALL_TEMPLATE, _tmp8_);
-+ result = _tmp9_;
-+ _g_free0 (filter_str);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_all_music_real_get_sql_count_with_filter (RygelLMSCategoryContainer* base, const gchar* filter) {
-+ RygelLMSAllMusic * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ gchar* filter_str = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ self = (RygelLMSAllMusic*) base;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = filter;
-+ _tmp1_ = strlen (_tmp0_);
-+ _tmp2_ = _tmp1_;
-+ if (_tmp2_ == 0) {
-+ const gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ _tmp3_ = rygel_lms_category_container_get_sql_count ((RygelLMSCategoryContainer*) self);
-+ _tmp4_ = _tmp3_;
-+ _tmp5_ = g_strdup (_tmp4_);
-+ result = _tmp5_;
-+ return result;
-+ }
-+ _tmp6_ = filter;
-+ _tmp7_ = g_strdup_printf ("AND %s", _tmp6_);
-+ filter_str = _tmp7_;
-+ _tmp8_ = filter_str;
-+ _tmp9_ = g_strdup_printf (RYGEL_LMS_ALL_MUSIC_SQL_COUNT_WITH_FILTER_TEMPLATE, _tmp8_);
-+ result = _tmp9_;
-+ _g_free0 (filter_str);
-+ return result;
-+}
-+
-+
-+static RygelMediaObject* rygel_lms_all_music_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSAllMusic * self;
-+ RygelMediaObject* result = NULL;
-+ gint id = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* path = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* mime_type = NULL;
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ gboolean _tmp8_ = FALSE;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ gchar* song_id = NULL;
-+ gint _tmp18_ = 0;
-+ gchar* _tmp19_ = NULL;
-+ RygelMusicItem* song = NULL;
-+ RygelMusicItem* _tmp20_ = NULL;
-+ sqlite3_stmt* _tmp21_ = NULL;
-+ gint _tmp22_ = 0;
-+ sqlite3_stmt* _tmp23_ = NULL;
-+ gint _tmp24_ = 0;
-+ sqlite3_stmt* _tmp25_ = NULL;
-+ gint _tmp26_ = 0;
-+ sqlite3_stmt* _tmp27_ = NULL;
-+ gint _tmp28_ = 0;
-+ sqlite3_stmt* _tmp29_ = NULL;
-+ gint _tmp30_ = 0;
-+ sqlite3_stmt* _tmp31_ = NULL;
-+ gint _tmp32_ = 0;
-+ sqlite3_stmt* _tmp33_ = NULL;
-+ const gchar* _tmp34_ = NULL;
-+ const gchar* _tmp35_ = NULL;
-+ sqlite3_stmt* _tmp36_ = NULL;
-+ const gchar* _tmp37_ = NULL;
-+ sqlite3_stmt* _tmp38_ = NULL;
-+ const gchar* _tmp39_ = NULL;
-+ GTimeVal tv = {0};
-+ sqlite3_stmt* _tmp40_ = NULL;
-+ gint _tmp41_ = 0;
-+ GTimeVal _tmp42_ = {0};
-+ gchar* _tmp43_ = NULL;
-+ gchar* _tmp44_ = NULL;
-+ sqlite3_stmt* _tmp45_ = NULL;
-+ const gchar* _tmp46_ = NULL;
-+ GFile* file = NULL;
-+ const gchar* _tmp47_ = NULL;
-+ GFile* _tmp48_ = NULL;
-+ gchar* _tmp49_ = NULL;
-+ gchar* _tmp50_ = NULL;
-+ self = (RygelLMSAllMusic*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ id = _tmp1_;
-+ _tmp2_ = statement;
-+ _tmp3_ = sqlite3_column_text (_tmp2_, 1);
-+ _tmp4_ = g_strdup (_tmp3_);
-+ path = _tmp4_;
-+ _tmp5_ = statement;
-+ _tmp6_ = sqlite3_column_text (_tmp5_, 10);
-+ _tmp7_ = g_strdup (_tmp6_);
-+ mime_type = _tmp7_;
-+ _tmp9_ = mime_type;
-+ if (_tmp9_ == NULL) {
-+ _tmp8_ = TRUE;
-+ } else {
-+ const gchar* _tmp10_ = NULL;
-+ gint _tmp11_ = 0;
-+ gint _tmp12_ = 0;
-+ _tmp10_ = mime_type;
-+ _tmp11_ = strlen (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp8_ = _tmp12_ == 0;
-+ }
-+ if (_tmp8_) {
-+ gint _tmp13_ = 0;
-+ const gchar* _tmp14_ = NULL;
-+ _tmp13_ = id;
-+ _tmp14_ = path;
-+ g_debug ("rygel-lms-all-music.vala:130: Music item %d (%s) has no MIME type", _tmp13_, _tmp14_);
-+ }
-+ _tmp15_ = statement;
-+ _tmp16_ = sqlite3_column_text (_tmp15_, 3);
-+ _tmp17_ = g_strdup (_tmp16_);
-+ title = _tmp17_;
-+ _tmp18_ = id;
-+ _tmp19_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp18_);
-+ song_id = _tmp19_;
-+ _tmp20_ = rygel_music_item_new (song_id, (RygelMediaContainer*) self, title, RYGEL_MUSIC_ITEM_UPNP_CLASS);
-+ song = _tmp20_;
-+ _tmp21_ = statement;
-+ _tmp22_ = sqlite3_column_int (_tmp21_, 2);
-+ rygel_media_file_item_set_size ((RygelMediaFileItem*) song, (gint64) _tmp22_);
-+ _tmp23_ = statement;
-+ _tmp24_ = sqlite3_column_int (_tmp23_, 4);
-+ rygel_music_item_set_track_number (song, _tmp24_);
-+ _tmp25_ = statement;
-+ _tmp26_ = sqlite3_column_int (_tmp25_, 5);
-+ rygel_audio_item_set_duration ((RygelAudioItem*) song, (glong) _tmp26_);
-+ _tmp27_ = statement;
-+ _tmp28_ = sqlite3_column_int (_tmp27_, 6);
-+ rygel_audio_item_set_channels ((RygelAudioItem*) song, _tmp28_);
-+ _tmp29_ = statement;
-+ _tmp30_ = sqlite3_column_int (_tmp29_, 7);
-+ rygel_audio_item_set_sample_freq ((RygelAudioItem*) song, _tmp30_);
-+ _tmp31_ = statement;
-+ _tmp32_ = sqlite3_column_int (_tmp31_, 8);
-+ rygel_audio_item_set_bitrate ((RygelAudioItem*) song, _tmp32_);
-+ _tmp33_ = statement;
-+ _tmp34_ = sqlite3_column_text (_tmp33_, 9);
-+ rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) song, _tmp34_);
-+ _tmp35_ = mime_type;
-+ rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) song, _tmp35_);
-+ _tmp36_ = statement;
-+ _tmp37_ = sqlite3_column_text (_tmp36_, 11);
-+ rygel_media_object_set_artist ((RygelMediaObject*) song, _tmp37_);
-+ _tmp38_ = statement;
-+ _tmp39_ = sqlite3_column_text (_tmp38_, 12);
-+ rygel_audio_item_set_album ((RygelAudioItem*) song, _tmp39_);
-+ _tmp40_ = statement;
-+ _tmp41_ = sqlite3_column_int (_tmp40_, 13);
-+ _tmp42_.tv_sec = (glong) _tmp41_;
-+ _tmp42_.tv_usec = (glong) 0;
-+ tv = _tmp42_;
-+ _tmp43_ = g_time_val_to_iso8601 (&tv);
-+ _tmp44_ = _tmp43_;
-+ rygel_media_object_set_date ((RygelMediaObject*) song, _tmp44_);
-+ _g_free0 (_tmp44_);
-+ _tmp45_ = statement;
-+ _tmp46_ = sqlite3_column_text (_tmp45_, 14);
-+ rygel_media_object_set_genre ((RygelMediaObject*) song, _tmp46_);
-+ _tmp47_ = path;
-+ _tmp48_ = g_file_new_for_path (_tmp47_);
-+ file = _tmp48_;
-+ _tmp49_ = g_file_get_uri (file);
-+ _tmp50_ = _tmp49_;
-+ rygel_media_object_add_uri ((RygelMediaObject*) song, _tmp50_);
-+ _g_free0 (_tmp50_);
-+ result = (RygelMediaObject*) song;
-+ _g_object_unref0 (file);
-+ _g_free0 (song_id);
-+ _g_free0 (title);
-+ _g_free0 (mime_type);
-+ _g_free0 (path);
-+ return result;
-+}
-+
-+
-+RygelLMSAllMusic* rygel_lms_all_music_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ RygelLMSAllMusic * self = NULL;
-+ RygelMediaContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = parent;
-+ _tmp1_ = _ ("All");
-+ _tmp2_ = lms_db;
-+ _tmp3_ = g_strdup_printf (RYGEL_LMS_ALL_MUSIC_SQL_ALL_TEMPLATE, "");
-+ _tmp4_ = _tmp3_;
-+ self = (RygelLMSAllMusic*) rygel_lms_category_container_construct (object_type, "all", _tmp0_, _tmp1_, _tmp2_, _tmp4_, RYGEL_LMS_ALL_MUSIC_SQL_FIND_OBJECT, RYGEL_LMS_ALL_MUSIC_SQL_COUNT, RYGEL_LMS_ALL_MUSIC_SQL_ADDED, RYGEL_LMS_ALL_MUSIC_SQL_REMOVED);
-+ _g_free0 (_tmp4_);
-+ return self;
-+}
-+
-+
-+RygelLMSAllMusic* rygel_lms_all_music_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_all_music_construct (RYGEL_LMS_TYPE_ALL_MUSIC, parent, lms_db);
-+}
-+
-+
-+static void rygel_lms_all_music_class_init (RygelLMSAllMusicClass * klass) {
-+ rygel_lms_all_music_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_all_with_filter = rygel_lms_all_music_real_get_sql_all_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_count_with_filter = rygel_lms_all_music_real_get_sql_count_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_all_music_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_all_music_instance_init (RygelLMSAllMusic * self) {
-+}
-+
-+
-+GType rygel_lms_all_music_get_type (void) {
-+ static volatile gsize rygel_lms_all_music_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_all_music_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAllMusicClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_all_music_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAllMusic), 0, (GInstanceInitFunc) rygel_lms_all_music_instance_init, NULL };
-+ GType rygel_lms_all_music_type_id;
-+ rygel_lms_all_music_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAllMusic", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_all_music_type_id__volatile, rygel_lms_all_music_type_id);
-+ }
-+ return rygel_lms_all_music_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-all-videos.c b/src/plugins/lms/rygel-lms-all-videos.c
-new file mode 100644
-index 0000000..51ba52c
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-all-videos.c
-@@ -0,0 +1,456 @@
-+/* rygel-lms-all-videos.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-all-videos.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gio/gio.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ALL_VIDEOS (rygel_lms_all_videos_get_type ())
-+#define RYGEL_LMS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideos))
-+#define RYGEL_LMS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))
-+#define RYGEL_LMS_IS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS))
-+#define RYGEL_LMS_IS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS))
-+#define RYGEL_LMS_ALL_VIDEOS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))
-+
-+typedef struct _RygelLMSAllVideos RygelLMSAllVideos;
-+typedef struct _RygelLMSAllVideosClass RygelLMSAllVideosClass;
-+typedef struct _RygelLMSAllVideosPrivate RygelLMSAllVideosPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
-+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSAllVideos {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSAllVideosPrivate * priv;
-+};
-+
-+struct _RygelLMSAllVideosClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+typedef enum {
-+ RYGEL_LMS_DATABASE_ERROR_OPEN,
-+ RYGEL_LMS_DATABASE_ERROR_PREPARE,
-+ RYGEL_LMS_DATABASE_ERROR_BIND,
-+ RYGEL_LMS_DATABASE_ERROR_STEP,
-+ RYGEL_LMS_DATABASE_ERROR_NOT_FOUND
-+} RygelLMSDatabaseError;
-+#define RYGEL_LMS_DATABASE_ERROR rygel_lms_database_error_quark ()
-+
-+static gpointer rygel_lms_all_videos_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_videos_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ALL_VIDEOS_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ALL_VIDEOS_SQL_ALL "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
-+"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ALL_VIDEOS_SQL_COUNT "SELECT count(videos.id) " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id;"
-+#define RYGEL_LMS_ALL_VIDEOS_SQL_FIND_OBJECT "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
-+"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND files.id = ? AND videos.id = files.id;"
-+#define RYGEL_LMS_ALL_VIDEOS_SQL_ADDED "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
-+"le, dlna_mime " "FROM videos, files " "WHERE dtime = 0 AND videos.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+#define RYGEL_LMS_ALL_VIDEOS_SQL_REMOVED "SELECT videos.id, title, artist, length, path, mtime, size, dlna_profi" \
-+"le, dlna_mime " "FROM videos, files " "WHERE dtime <> 0 AND videos.id = files.id " "AND update_id > ? AND update_id <= ?;"
-+static RygelMediaObject* rygel_lms_all_videos_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+GQuark rygel_lms_database_error_quark (void);
-+sqlite3_stmt* rygel_lms_database_prepare (RygelLMSDatabase* self, const gchar* query_string, GError** error);
-+void rygel_lms_database_find_object (const gchar* id, sqlite3_stmt* stmt, GError** error);
-+RygelLMSAllVideos* rygel_lms_all_videos_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAllVideos* rygel_lms_all_videos_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_all_videos_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSAllVideos * self;
-+ RygelMediaObject* result = NULL;
-+ gint id = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* mime_type = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* path = NULL;
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ GFile* file = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ GFile* _tmp9_ = NULL;
-+ gboolean _tmp10_ = FALSE;
-+ const gchar* _tmp11_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp17_ = NULL;
-+ const gchar* _tmp18_ = NULL;
-+ gchar* _tmp19_ = NULL;
-+ RygelVideoItem* video = NULL;
-+ gint _tmp20_ = 0;
-+ gchar* _tmp21_ = NULL;
-+ gchar* _tmp22_ = NULL;
-+ const gchar* _tmp23_ = NULL;
-+ RygelVideoItem* _tmp24_ = NULL;
-+ RygelVideoItem* _tmp25_ = NULL;
-+ RygelVideoItem* _tmp26_ = NULL;
-+ sqlite3_stmt* _tmp27_ = NULL;
-+ const gchar* _tmp28_ = NULL;
-+ RygelVideoItem* _tmp29_ = NULL;
-+ sqlite3_stmt* _tmp30_ = NULL;
-+ gint _tmp31_ = 0;
-+ GTimeVal tv = {0};
-+ sqlite3_stmt* _tmp32_ = NULL;
-+ gint _tmp33_ = 0;
-+ GTimeVal _tmp34_ = {0};
-+ RygelVideoItem* _tmp35_ = NULL;
-+ gchar* _tmp36_ = NULL;
-+ gchar* _tmp37_ = NULL;
-+ RygelVideoItem* _tmp38_ = NULL;
-+ sqlite3_stmt* _tmp39_ = NULL;
-+ gint _tmp40_ = 0;
-+ RygelVideoItem* _tmp41_ = NULL;
-+ sqlite3_stmt* _tmp42_ = NULL;
-+ const gchar* _tmp43_ = NULL;
-+ RygelVideoItem* _tmp44_ = NULL;
-+ const gchar* _tmp45_ = NULL;
-+ RygelVideoItem* _tmp46_ = NULL;
-+ GFile* _tmp47_ = NULL;
-+ gchar* _tmp48_ = NULL;
-+ gchar* _tmp49_ = NULL;
-+ gchar* video_data = NULL;
-+ gchar* _tmp50_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ self = (RygelLMSAllVideos*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ id = _tmp1_;
-+ _tmp2_ = statement;
-+ _tmp3_ = sqlite3_column_text (_tmp2_, 8);
-+ _tmp4_ = g_strdup (_tmp3_);
-+ mime_type = _tmp4_;
-+ _tmp5_ = statement;
-+ _tmp6_ = sqlite3_column_text (_tmp5_, 4);
-+ _tmp7_ = g_strdup (_tmp6_);
-+ path = _tmp7_;
-+ _tmp8_ = path;
-+ _tmp9_ = g_file_new_for_path (_tmp8_);
-+ file = _tmp9_;
-+ _tmp11_ = mime_type;
-+ if (_tmp11_ == NULL) {
-+ _tmp10_ = TRUE;
-+ } else {
-+ const gchar* _tmp12_ = NULL;
-+ gint _tmp13_ = 0;
-+ gint _tmp14_ = 0;
-+ _tmp12_ = mime_type;
-+ _tmp13_ = strlen (_tmp12_);
-+ _tmp14_ = _tmp13_;
-+ _tmp10_ = _tmp14_ == 0;
-+ }
-+ if (_tmp10_) {
-+ gint _tmp15_ = 0;
-+ const gchar* _tmp16_ = NULL;
-+ _tmp15_ = id;
-+ _tmp16_ = path;
-+ g_debug ("rygel-lms-all-videos.vala:75: Video item %d (%s) has no MIME type", _tmp15_, _tmp16_);
-+ }
-+ _tmp17_ = statement;
-+ _tmp18_ = sqlite3_column_text (_tmp17_, 1);
-+ _tmp19_ = g_strdup (_tmp18_);
-+ title = _tmp19_;
-+ _tmp20_ = id;
-+ _tmp21_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp20_);
-+ _tmp22_ = _tmp21_;
-+ _tmp23_ = title;
-+ _tmp24_ = rygel_video_item_new (_tmp22_, (RygelMediaContainer*) self, _tmp23_, RYGEL_VIDEO_ITEM_UPNP_CLASS);
-+ _tmp25_ = _tmp24_;
-+ _g_free0 (_tmp22_);
-+ video = _tmp25_;
-+ _tmp26_ = video;
-+ _tmp27_ = statement;
-+ _tmp28_ = sqlite3_column_text (_tmp27_, 2);
-+ rygel_media_object_set_creator ((RygelMediaObject*) _tmp26_, _tmp28_);
-+ _tmp29_ = video;
-+ _tmp30_ = statement;
-+ _tmp31_ = sqlite3_column_int (_tmp30_, 3);
-+ rygel_audio_item_set_duration ((RygelAudioItem*) _tmp29_, (glong) _tmp31_);
-+ _tmp32_ = statement;
-+ _tmp33_ = sqlite3_column_int (_tmp32_, 5);
-+ _tmp34_.tv_sec = (glong) _tmp33_;
-+ _tmp34_.tv_usec = (glong) 0;
-+ tv = _tmp34_;
-+ _tmp35_ = video;
-+ _tmp36_ = g_time_val_to_iso8601 (&tv);
-+ _tmp37_ = _tmp36_;
-+ rygel_media_object_set_date ((RygelMediaObject*) _tmp35_, _tmp37_);
-+ _g_free0 (_tmp37_);
-+ _tmp38_ = video;
-+ _tmp39_ = statement;
-+ _tmp40_ = sqlite3_column_int (_tmp39_, 6);
-+ rygel_media_file_item_set_size ((RygelMediaFileItem*) _tmp38_, (gint64) _tmp40_);
-+ _tmp41_ = video;
-+ _tmp42_ = statement;
-+ _tmp43_ = sqlite3_column_text (_tmp42_, 7);
-+ rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) _tmp41_, _tmp43_);
-+ _tmp44_ = video;
-+ _tmp45_ = mime_type;
-+ rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) _tmp44_, _tmp45_);
-+ _tmp46_ = video;
-+ _tmp47_ = file;
-+ _tmp48_ = g_file_get_uri (_tmp47_);
-+ _tmp49_ = _tmp48_;
-+ rygel_media_object_add_uri ((RygelMediaObject*) _tmp46_, _tmp49_);
-+ _g_free0 (_tmp49_);
-+ _tmp50_ = g_strdup ("select videos_videos.bitrate + videos_audios.bitrate, width, height, c" \
-+"hannels, sampling_rate " "from videos, videos_audios, videos_videos where videos.id = ? " "and videos.id = videos_audios.video_id and videos.id = videos_videos.v" \
-+"ideo_id;");
-+ video_data = _tmp50_;
-+ {
-+ sqlite3_stmt* stmt = NULL;
-+ RygelLMSDatabase* _tmp51_ = NULL;
-+ RygelLMSDatabase* _tmp52_ = NULL;
-+ const gchar* _tmp53_ = NULL;
-+ sqlite3_stmt* _tmp54_ = NULL;
-+ gint _tmp55_ = 0;
-+ gchar* _tmp56_ = NULL;
-+ gchar* _tmp57_ = NULL;
-+ sqlite3_stmt* _tmp58_ = NULL;
-+ RygelVideoItem* _tmp59_ = NULL;
-+ sqlite3_stmt* _tmp60_ = NULL;
-+ gint _tmp61_ = 0;
-+ RygelVideoItem* _tmp62_ = NULL;
-+ sqlite3_stmt* _tmp63_ = NULL;
-+ gint _tmp64_ = 0;
-+ RygelVideoItem* _tmp65_ = NULL;
-+ sqlite3_stmt* _tmp66_ = NULL;
-+ gint _tmp67_ = 0;
-+ RygelVideoItem* _tmp68_ = NULL;
-+ sqlite3_stmt* _tmp69_ = NULL;
-+ gint _tmp70_ = 0;
-+ RygelVideoItem* _tmp71_ = NULL;
-+ sqlite3_stmt* _tmp72_ = NULL;
-+ gint _tmp73_ = 0;
-+ _tmp51_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp52_ = _tmp51_;
-+ _tmp53_ = video_data;
-+ _tmp54_ = rygel_lms_database_prepare (_tmp52_, _tmp53_, &_inner_error_);
-+ stmt = _tmp54_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch10_rygel_lms_database_error;
-+ }
-+ _g_free0 (video_data);
-+ _g_object_unref0 (video);
-+ _g_free0 (title);
-+ _g_object_unref0 (file);
-+ _g_free0 (path);
-+ _g_free0 (mime_type);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _tmp55_ = id;
-+ _tmp56_ = g_strdup_printf ("%d", _tmp55_);
-+ _tmp57_ = _tmp56_;
-+ _tmp58_ = stmt;
-+ rygel_lms_database_find_object (_tmp57_, _tmp58_, &_inner_error_);
-+ _g_free0 (_tmp57_);
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch10_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ _g_free0 (video_data);
-+ _g_object_unref0 (video);
-+ _g_free0 (title);
-+ _g_object_unref0 (file);
-+ _g_free0 (path);
-+ _g_free0 (mime_type);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _tmp59_ = video;
-+ _tmp60_ = stmt;
-+ _tmp61_ = sqlite3_column_int (_tmp60_, 0);
-+ rygel_audio_item_set_bitrate ((RygelAudioItem*) _tmp59_, _tmp61_ / 8);
-+ _tmp62_ = video;
-+ _tmp63_ = stmt;
-+ _tmp64_ = sqlite3_column_int (_tmp63_, 1);
-+ rygel_visual_item_set_width ((RygelVisualItem*) _tmp62_, _tmp64_);
-+ _tmp65_ = video;
-+ _tmp66_ = stmt;
-+ _tmp67_ = sqlite3_column_int (_tmp66_, 2);
-+ rygel_visual_item_set_height ((RygelVisualItem*) _tmp65_, _tmp67_);
-+ _tmp68_ = video;
-+ _tmp69_ = stmt;
-+ _tmp70_ = sqlite3_column_int (_tmp69_, 3);
-+ rygel_audio_item_set_channels ((RygelAudioItem*) _tmp68_, _tmp70_);
-+ _tmp71_ = video;
-+ _tmp72_ = stmt;
-+ _tmp73_ = sqlite3_column_int (_tmp72_, 4);
-+ rygel_audio_item_set_sample_freq ((RygelAudioItem*) _tmp71_, _tmp73_);
-+ _sqlite3_finalize0 (stmt);
-+ }
-+ goto __finally10;
-+ __catch10_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp74_ = NULL;
-+ const gchar* _tmp75_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp74_ = e;
-+ _tmp75_ = _tmp74_->message;
-+ g_warning ("rygel-lms-all-videos.vala:105: Query failed: %s", _tmp75_);
-+ _g_error_free0 (e);
-+ }
-+ __finally10:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (video_data);
-+ _g_object_unref0 (video);
-+ _g_free0 (title);
-+ _g_object_unref0 (file);
-+ _g_free0 (path);
-+ _g_free0 (mime_type);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ result = (RygelMediaObject*) video;
-+ _g_free0 (video_data);
-+ _g_free0 (title);
-+ _g_object_unref0 (file);
-+ _g_free0 (path);
-+ _g_free0 (mime_type);
-+ return result;
-+}
-+
-+
-+RygelLMSAllVideos* rygel_lms_all_videos_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSAllVideos * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ _tmp3_ = lms_db;
-+ self = (RygelLMSAllVideos*) rygel_lms_category_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, RYGEL_LMS_ALL_VIDEOS_SQL_ALL, RYGEL_LMS_ALL_VIDEOS_SQL_FIND_OBJECT, RYGEL_LMS_ALL_VIDEOS_SQL_COUNT, RYGEL_LMS_ALL_VIDEOS_SQL_ADDED, RYGEL_LMS_ALL_VIDEOS_SQL_REMOVED);
-+ return self;
-+}
-+
-+
-+RygelLMSAllVideos* rygel_lms_all_videos_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_all_videos_construct (RYGEL_LMS_TYPE_ALL_VIDEOS, id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_all_videos_class_init (RygelLMSAllVideosClass * klass) {
-+ rygel_lms_all_videos_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_all_videos_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_all_videos_instance_init (RygelLMSAllVideos * self) {
-+}
-+
-+
-+GType rygel_lms_all_videos_get_type (void) {
-+ static volatile gsize rygel_lms_all_videos_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_all_videos_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSAllVideosClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_all_videos_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSAllVideos), 0, (GInstanceInitFunc) rygel_lms_all_videos_instance_init, NULL };
-+ GType rygel_lms_all_videos_type_id;
-+ rygel_lms_all_videos_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSAllVideos", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_all_videos_type_id__volatile, rygel_lms_all_videos_type_id);
-+ }
-+ return rygel_lms_all_videos_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-artist.c b/src/plugins/lms/rygel-lms-artist.c
-new file mode 100644
-index 0000000..e686ea4
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-artist.c
-@@ -0,0 +1,274 @@
-+/* rygel-lms-artist.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-artist.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ARTIST (rygel_lms_artist_get_type ())
-+#define RYGEL_LMS_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtist))
-+#define RYGEL_LMS_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtistClass))
-+#define RYGEL_LMS_IS_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ARTIST))
-+#define RYGEL_LMS_IS_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ARTIST))
-+#define RYGEL_LMS_ARTIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtistClass))
-+
-+typedef struct _RygelLMSArtist RygelLMSArtist;
-+typedef struct _RygelLMSArtistClass RygelLMSArtistClass;
-+typedef struct _RygelLMSArtistPrivate RygelLMSArtistPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+#define RYGEL_LMS_TYPE_ALBUM (rygel_lms_album_get_type ())
-+#define RYGEL_LMS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbum))
-+#define RYGEL_LMS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+#define RYGEL_LMS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALBUM))
-+#define RYGEL_LMS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALBUM, RygelLMSAlbumClass))
-+
-+typedef struct _RygelLMSAlbum RygelLMSAlbum;
-+typedef struct _RygelLMSAlbumClass RygelLMSAlbumClass;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSArtist {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSArtistPrivate * priv;
-+};
-+
-+struct _RygelLMSArtistClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_artist_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_artist_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ARTIST_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ARTIST_SQL_ALL_TEMPLATE "SELECT audio_albums.id, audio_albums.name " "FROM audio_albums " "WHERE audio_albums.artist_id = %s " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ARTIST_SQL_COUNT_TEMPLATE "SELECT COUNT(audio_albums.id) " "FROM audio_albums " "WHERE audio_albums.artist_id = %s"
-+#define RYGEL_LMS_ARTIST_SQL_FIND_OBJECT_TEMPLATE "SELECT audio_albums.id, audio_albums.name " "FROM audio_albums " "WHERE audio_albums.id = ? AND audio_albums.artist_id = %s;"
-+static gchar* rygel_lms_artist_get_sql_all (const gchar* id);
-+static gchar* rygel_lms_artist_get_sql_find_object (const gchar* id);
-+static gchar* rygel_lms_artist_get_sql_count (const gchar* id);
-+static RygelMediaObject* rygel_lms_artist_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+RygelLMSAlbum* rygel_lms_album_new (const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAlbum* rygel_lms_album_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_album_get_type (void) G_GNUC_CONST;
-+RygelLMSArtist* rygel_lms_artist_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSArtist* rygel_lms_artist_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static gchar* rygel_lms_artist_get_sql_all (const gchar* id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ARTIST_SQL_ALL_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_artist_get_sql_find_object (const gchar* id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ARTIST_SQL_FIND_OBJECT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_artist_get_sql_count (const gchar* id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_ARTIST_SQL_COUNT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static RygelMediaObject* rygel_lms_artist_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSArtist * self;
-+ RygelMediaObject* result = NULL;
-+ gchar* db_id = NULL;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* _tmp2_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ RygelLMSDatabase* _tmp6_ = NULL;
-+ RygelLMSDatabase* _tmp7_ = NULL;
-+ RygelLMSAlbum* _tmp8_ = NULL;
-+ self = (RygelLMSArtist*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ _tmp2_ = g_strdup_printf ("%d", _tmp1_);
-+ db_id = _tmp2_;
-+ _tmp3_ = statement;
-+ _tmp4_ = sqlite3_column_text (_tmp3_, 1);
-+ _tmp5_ = g_strdup (_tmp4_);
-+ title = _tmp5_;
-+ _tmp6_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp7_ = _tmp6_;
-+ _tmp8_ = rygel_lms_album_new (db_id, (RygelMediaContainer*) self, title, _tmp7_);
-+ result = (RygelMediaObject*) _tmp8_;
-+ _g_free0 (title);
-+ _g_free0 (db_id);
-+ return result;
-+}
-+
-+
-+RygelLMSArtist* rygel_lms_artist_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSArtist * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ gchar* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ gchar* _tmp8_ = NULL;
-+ gchar* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ _tmp3_ = lms_db;
-+ _tmp4_ = id;
-+ _tmp5_ = rygel_lms_artist_get_sql_all (_tmp4_);
-+ _tmp6_ = _tmp5_;
-+ _tmp7_ = id;
-+ _tmp8_ = rygel_lms_artist_get_sql_find_object (_tmp7_);
-+ _tmp9_ = _tmp8_;
-+ _tmp10_ = id;
-+ _tmp11_ = rygel_lms_artist_get_sql_count (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ self = (RygelLMSArtist*) rygel_lms_category_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp6_, _tmp9_, _tmp12_, NULL, NULL);
-+ _g_free0 (_tmp12_);
-+ _g_free0 (_tmp9_);
-+ _g_free0 (_tmp6_);
-+ return self;
-+}
-+
-+
-+RygelLMSArtist* rygel_lms_artist_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_artist_construct (RYGEL_LMS_TYPE_ARTIST, id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_artist_class_init (RygelLMSArtistClass * klass) {
-+ rygel_lms_artist_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_artist_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_artist_instance_init (RygelLMSArtist * self) {
-+}
-+
-+
-+GType rygel_lms_artist_get_type (void) {
-+ static volatile gsize rygel_lms_artist_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_artist_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSArtistClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_artist_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSArtist), 0, (GInstanceInitFunc) rygel_lms_artist_instance_init, NULL };
-+ GType rygel_lms_artist_type_id;
-+ rygel_lms_artist_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSArtist", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_artist_type_id__volatile, rygel_lms_artist_type_id);
-+ }
-+ return rygel_lms_artist_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-artists.c b/src/plugins/lms/rygel-lms-artists.c
-new file mode 100644
-index 0000000..3ac85bc
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-artists.c
-@@ -0,0 +1,214 @@
-+/* rygel-lms-artists.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-artists.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_ARTISTS (rygel_lms_artists_get_type ())
-+#define RYGEL_LMS_ARTISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtists))
-+#define RYGEL_LMS_ARTISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtistsClass))
-+#define RYGEL_LMS_IS_ARTISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ARTISTS))
-+#define RYGEL_LMS_IS_ARTISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ARTISTS))
-+#define RYGEL_LMS_ARTISTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtistsClass))
-+
-+typedef struct _RygelLMSArtists RygelLMSArtists;
-+typedef struct _RygelLMSArtistsClass RygelLMSArtistsClass;
-+typedef struct _RygelLMSArtistsPrivate RygelLMSArtistsPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+#define RYGEL_LMS_TYPE_ARTIST (rygel_lms_artist_get_type ())
-+#define RYGEL_LMS_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtist))
-+#define RYGEL_LMS_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtistClass))
-+#define RYGEL_LMS_IS_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ARTIST))
-+#define RYGEL_LMS_IS_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ARTIST))
-+#define RYGEL_LMS_ARTIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ARTIST, RygelLMSArtistClass))
-+
-+typedef struct _RygelLMSArtist RygelLMSArtist;
-+typedef struct _RygelLMSArtistClass RygelLMSArtistClass;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSArtists {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSArtistsPrivate * priv;
-+};
-+
-+struct _RygelLMSArtistsClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_artists_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_artists_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_ARTISTS_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_ARTISTS_SQL_ALL "SELECT audio_artists.id, audio_artists.name " "FROM audio_artists " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_ARTISTS_SQL_COUNT "SELECT COUNT(audio_artists.id) " "FROM audio_artists;"
-+#define RYGEL_LMS_ARTISTS_SQL_FIND_OBJECT "SELECT audio_artists.id, audio_artists.name " "FROM audio_artists " "WHERE audio_artists.id = ?;"
-+static RygelMediaObject* rygel_lms_artists_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+RygelLMSArtist* rygel_lms_artist_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSArtist* rygel_lms_artist_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_artist_get_type (void) G_GNUC_CONST;
-+RygelLMSArtists* rygel_lms_artists_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSArtists* rygel_lms_artists_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_artists_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSArtists * self;
-+ RygelMediaObject* result = NULL;
-+ gchar* db_id = NULL;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* _tmp2_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ RygelLMSDatabase* _tmp6_ = NULL;
-+ RygelLMSDatabase* _tmp7_ = NULL;
-+ RygelLMSArtist* _tmp8_ = NULL;
-+ self = (RygelLMSArtists*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ _tmp2_ = g_strdup_printf ("%d", _tmp1_);
-+ db_id = _tmp2_;
-+ _tmp3_ = statement;
-+ _tmp4_ = sqlite3_column_text (_tmp3_, 1);
-+ _tmp5_ = g_strdup (_tmp4_);
-+ title = _tmp5_;
-+ _tmp6_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp7_ = _tmp6_;
-+ _tmp8_ = rygel_lms_artist_new (db_id, (RygelMediaContainer*) self, title, _tmp7_);
-+ result = (RygelMediaObject*) _tmp8_;
-+ _g_free0 (title);
-+ _g_free0 (db_id);
-+ return result;
-+}
-+
-+
-+RygelLMSArtists* rygel_lms_artists_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSArtists * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ _tmp3_ = lms_db;
-+ self = (RygelLMSArtists*) rygel_lms_category_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, RYGEL_LMS_ARTISTS_SQL_ALL, RYGEL_LMS_ARTISTS_SQL_FIND_OBJECT, RYGEL_LMS_ARTISTS_SQL_COUNT, NULL, NULL);
-+ return self;
-+}
-+
-+
-+RygelLMSArtists* rygel_lms_artists_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_artists_construct (RYGEL_LMS_TYPE_ARTISTS, id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_artists_class_init (RygelLMSArtistsClass * klass) {
-+ rygel_lms_artists_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_artists_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_artists_instance_init (RygelLMSArtists * self) {
-+}
-+
-+
-+GType rygel_lms_artists_get_type (void) {
-+ static volatile gsize rygel_lms_artists_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_artists_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSArtistsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_artists_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSArtists), 0, (GInstanceInitFunc) rygel_lms_artists_instance_init, NULL };
-+ GType rygel_lms_artists_type_id;
-+ rygel_lms_artists_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSArtists", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_artists_type_id__volatile, rygel_lms_artists_type_id);
-+ }
-+ return rygel_lms_artists_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-category-container.c b/src/plugins/lms/rygel-lms-category-container.c
-new file mode 100644
-index 0000000..21692d0
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-category-container.c
-@@ -0,0 +1,2772 @@
-+/* rygel-lms-category-container.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-category-container.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2009,2010 Jens Georg <mail@jensge.org>,
-+ * (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gee.h>
-+#include <libgupnp-av/gupnp-av.h>
-+#include <gio/gio.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
-+#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_SQL_OPERATOR (rygel_lms_sql_operator_get_type ())
-+#define RYGEL_LMS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperator))
-+#define RYGEL_LMS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+#define RYGEL_LMS_IS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_IS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_SQL_OPERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+
-+typedef struct _RygelLMSSqlOperator RygelLMSSqlOperator;
-+typedef struct _RygelLMSSqlOperatorClass RygelLMSSqlOperatorClass;
-+
-+#define RYGEL_LMS_TYPE_SQL_FUNCTION (rygel_lms_sql_function_get_type ())
-+#define RYGEL_LMS_SQL_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunction))
-+#define RYGEL_LMS_SQL_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunctionClass))
-+#define RYGEL_LMS_IS_SQL_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION))
-+#define RYGEL_LMS_IS_SQL_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_SQL_FUNCTION))
-+#define RYGEL_LMS_SQL_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunctionClass))
-+
-+typedef struct _RygelLMSSqlFunction RygelLMSSqlFunction;
-+typedef struct _RygelLMSSqlFunctionClass RygelLMSSqlFunctionClass;
-+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-+#define _rygel_search_expression_unref0(var) ((var == NULL) ? NULL : (var = (rygel_search_expression_unref (var), NULL)))
-+#define _g_value_array_free0(var) ((var == NULL) ? NULL : (var = (g_value_array_free (var), NULL)))
-+typedef struct _RygelLmsCategoryContainerSearchData RygelLmsCategoryContainerSearchData;
-+typedef struct _RygelLmsCategoryContainerGetChildrenData RygelLmsCategoryContainerGetChildrenData;
-+typedef struct _RygelLmsCategoryContainerFindObjectData RygelLmsCategoryContainerFindObjectData;
-+typedef struct _RygelLmsCategoryContainerAddChildData RygelLmsCategoryContainerAddChildData;
-+typedef struct _RygelLmsCategoryContainerRemoveChildData RygelLmsCategoryContainerRemoveChildData;
-+
-+typedef enum {
-+ RYGEL_LMS_CATEGORY_CONTAINER_ERROR_SQLITE_ERROR,
-+ RYGEL_LMS_CATEGORY_CONTAINER_ERROR_GENERAL_ERROR,
-+ RYGEL_LMS_CATEGORY_CONTAINER_ERROR_INVALID_TYPE,
-+ RYGEL_LMS_CATEGORY_CONTAINER_ERROR_UNSUPPORTED_SEARCH
-+} RygelLMSCategoryContainerError;
-+#define RYGEL_LMS_CATEGORY_CONTAINER_ERROR rygel_lms_category_container_error_quark ()
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSCategoryContainerPrivate {
-+ GeeArrayList* _search_classes;
-+ RygelLMSDatabase* _lms_db;
-+ gchar* _db_id;
-+ gchar* _sql_all;
-+ gchar* _sql_find_object;
-+ gchar* _sql_count;
-+ gchar* _sql_added;
-+ gchar* _sql_removed;
-+};
-+
-+typedef enum {
-+ RYGEL_LMS_DATABASE_ERROR_OPEN,
-+ RYGEL_LMS_DATABASE_ERROR_PREPARE,
-+ RYGEL_LMS_DATABASE_ERROR_BIND,
-+ RYGEL_LMS_DATABASE_ERROR_STEP,
-+ RYGEL_LMS_DATABASE_ERROR_NOT_FOUND
-+} RygelLMSDatabaseError;
-+#define RYGEL_LMS_DATABASE_ERROR rygel_lms_database_error_quark ()
-+struct _RygelLmsCategoryContainerSearchData {
-+ int _state_;
-+ GObject* _source_object_;
-+ GAsyncResult* _res_;
-+ GSimpleAsyncResult* _async_result;
-+ RygelLMSCategoryContainer* self;
-+ RygelSearchExpression* expression;
-+ guint offset;
-+ guint max_count;
-+ guint total_matches;
-+ gchar* sort_criteria;
-+ GCancellable* cancellable;
-+ RygelMediaObjects* result;
-+ GValueArray* args;
-+ GValueArray* _tmp0_;
-+ gchar* filter;
-+ RygelSearchExpression* _tmp1_;
-+ GValueArray* _tmp2_;
-+ gchar* _tmp3_;
-+ const gchar* _tmp4_;
-+ GValueArray* _tmp5_;
-+ guint _tmp6_;
-+ RygelSearchExpression* _tmp7_;
-+ RygelSearchExpression* _tmp8_;
-+ gchar* _tmp9_;
-+ gchar* _tmp10_;
-+ const gchar* _tmp11_;
-+ guint _tmp12_;
-+ guint _tmp13_;
-+ const gchar* _tmp14_;
-+ GValueArray* _tmp15_;
-+ const gchar* _tmp16_;
-+ guint _tmp17_;
-+ guint _tmp18_;
-+ RygelMediaObjects* _tmp19_;
-+ GError* e;
-+ GError* _tmp20_;
-+ const gchar* _tmp21_;
-+ RygelMediaObjects* _tmp22_;
-+ RygelSearchExpression* _tmp23_;
-+ guint _tmp24_;
-+ guint _tmp25_;
-+ const gchar* _tmp26_;
-+ GCancellable* _tmp27_;
-+ guint _tmp28_;
-+ RygelMediaObjects* _tmp29_;
-+ RygelMediaObjects* _tmp30_;
-+ GError * _inner_error_;
-+};
-+
-+struct _RygelLmsCategoryContainerGetChildrenData {
-+ int _state_;
-+ GObject* _source_object_;
-+ GAsyncResult* _res_;
-+ GSimpleAsyncResult* _async_result;
-+ RygelLMSCategoryContainer* self;
-+ guint offset;
-+ guint max_count;
-+ gchar* sort_criteria;
-+ GCancellable* cancellable;
-+ RygelMediaObjects* result;
-+ RygelMediaObjects* retval;
-+ RygelMediaObjects* _tmp0_;
-+ sqlite3_stmt* _tmp1_;
-+ guint _tmp2_;
-+ guint _tmp3_;
-+ const gchar* _tmp4_;
-+ gboolean _tmp5_;
-+ sqlite3_stmt* _tmp6_;
-+ gboolean _tmp7_;
-+ RygelMediaObjects* _tmp8_;
-+ sqlite3_stmt* _tmp9_;
-+ RygelMediaObject* _tmp10_;
-+ RygelMediaObject* _tmp11_;
-+ GError * _inner_error_;
-+};
-+
-+struct _RygelLmsCategoryContainerFindObjectData {
-+ int _state_;
-+ GObject* _source_object_;
-+ GAsyncResult* _res_;
-+ GSimpleAsyncResult* _async_result;
-+ RygelLMSCategoryContainer* self;
-+ gchar* id;
-+ GCancellable* cancellable;
-+ RygelMediaObject* result;
-+ const gchar* _tmp0_;
-+ const gchar* _tmp1_;
-+ gboolean _tmp2_;
-+ RygelMediaObject* object;
-+ gchar* real_id;
-+ const gchar* _tmp3_;
-+ const gchar* _tmp4_;
-+ gint _tmp5_;
-+ gint _tmp6_;
-+ gchar* _tmp7_;
-+ gint index;
-+ const gchar* _tmp8_;
-+ gint _tmp9_;
-+ gint _tmp10_;
-+ const gchar* _tmp11_;
-+ gint _tmp12_;
-+ gchar* _tmp13_;
-+ const gchar* _tmp14_;
-+ sqlite3_stmt* _tmp15_;
-+ RygelMediaObject* child;
-+ sqlite3_stmt* _tmp16_;
-+ RygelMediaObject* _tmp17_;
-+ gint _tmp18_;
-+ RygelMediaObject* _tmp19_;
-+ RygelMediaObject* _tmp20_;
-+ RygelLMSCategoryContainer* container;
-+ RygelMediaObject* _tmp21_;
-+ RygelLMSCategoryContainer* _tmp22_;
-+ RygelMediaObject* _tmp23_;
-+ RygelLMSCategoryContainer* _tmp24_;
-+ const gchar* _tmp25_;
-+ GCancellable* _tmp26_;
-+ RygelMediaObject* _tmp27_;
-+ RygelMediaObject* _tmp28_;
-+ RygelMediaObject* _tmp29_;
-+ RygelMediaObject* _tmp30_;
-+ RygelMediaContainer* _tmp31_;
-+ RygelMediaContainer* _tmp32_;
-+ GError* e;
-+ const gchar* _tmp33_;
-+ const gchar* _tmp34_;
-+ const gchar* _tmp35_;
-+ GError* _tmp36_;
-+ const gchar* _tmp37_;
-+ GError * _inner_error_;
-+};
-+
-+struct _RygelLmsCategoryContainerAddChildData {
-+ int _state_;
-+ GObject* _source_object_;
-+ GAsyncResult* _res_;
-+ GSimpleAsyncResult* _async_result;
-+ RygelLMSCategoryContainer* self;
-+ RygelMediaObject* object;
-+};
-+
-+struct _RygelLmsCategoryContainerRemoveChildData {
-+ int _state_;
-+ GObject* _source_object_;
-+ GAsyncResult* _res_;
-+ GSimpleAsyncResult* _async_result;
-+ RygelLMSCategoryContainer* self;
-+ RygelMediaObject* object;
-+};
-+
-+
-+static gpointer rygel_lms_category_container_parent_class = NULL;
-+static RygelTrackableContainerIface* rygel_lms_category_container_rygel_trackable_container_parent_iface = NULL;
-+static RygelSearchableContainerIface* rygel_lms_category_container_rygel_searchable_container_parent_iface = NULL;
-+
-+GQuark rygel_lms_category_container_error_quark (void);
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerPrivate))
-+enum {
-+ RYGEL_LMS_CATEGORY_CONTAINER_DUMMY_PROPERTY,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SEARCH_CLASSES,
-+ RYGEL_LMS_CATEGORY_CONTAINER_LMS_DB,
-+ RYGEL_LMS_CATEGORY_CONTAINER_DB_ID,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SQL_ALL,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SQL_FIND_OBJECT,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SQL_COUNT,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SQL_ADDED,
-+ RYGEL_LMS_CATEGORY_CONTAINER_SQL_REMOVED
-+};
-+RygelMediaObject* rygel_lms_category_container_object_from_statement (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+static RygelMediaObject* rygel_lms_category_container_real_object_from_statement (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_get_sql_all_with_filter (RygelLMSCategoryContainer* self, const gchar* filter);
-+static gchar* rygel_lms_category_container_real_get_sql_all_with_filter (RygelLMSCategoryContainer* self, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_all (RygelLMSCategoryContainer* self);
-+gchar* rygel_lms_category_container_get_sql_count_with_filter (RygelLMSCategoryContainer* self, const gchar* filter);
-+static gchar* rygel_lms_category_container_real_get_sql_count_with_filter (RygelLMSCategoryContainer* self, const gchar* filter);
-+const gchar* rygel_lms_category_container_get_sql_count (RygelLMSCategoryContainer* self);
-+static gchar* rygel_lms_category_container_map_operand_to_column (const gchar* operand, gchar** collate, gboolean for_sort, GError** error);
-+static gchar* rygel_lms_category_container_relational_expression_to_sql (RygelRelationalExpression* exp, GValueArray* args, GError** error);
-+static void _vala_GValue_free (GValue* self);
-+GType rygel_lms_sql_operator_get_type (void) G_GNUC_CONST;
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new_from_search_criteria_op (GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct_from_search_criteria_op (GType object_type, GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate);
-+RygelLMSSqlFunction* rygel_lms_sql_function_new (const gchar* name, const gchar* arg);
-+RygelLMSSqlFunction* rygel_lms_sql_function_construct (GType object_type, const gchar* name, const gchar* arg);
-+GType rygel_lms_sql_function_get_type (void) G_GNUC_CONST;
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new (const gchar* name, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct (GType object_type, const gchar* name, const gchar* arg, const gchar* collate);
-+gchar* rygel_lms_sql_operator_to_string (RygelLMSSqlOperator* self);
-+static gchar* rygel_lms_category_container_logical_expression_to_sql (RygelLogicalExpression* expression, GValueArray* args, GError** error);
-+static gchar* rygel_lms_category_container_search_expression_to_sql (RygelSearchExpression* expression, GValueArray* args, GError** error);
-+guint rygel_lms_category_container_get_child_count_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+static guint rygel_lms_category_container_real_get_child_count_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+GQuark rygel_lms_database_error_quark (void);
-+sqlite3_stmt* rygel_lms_database_prepare_and_init (RygelLMSDatabase* self, const gchar* query, GValue* arguments, int arguments_length1, GError** error);
-+RygelMediaObjects* rygel_lms_category_container_get_children_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+static RygelMediaObjects* rygel_lms_category_container_real_get_children_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+gboolean rygel_lms_database_get_children_step (sqlite3_stmt* stmt, GError** error);
-+static void rygel_lms_category_container_real_search_data_free (gpointer _data);
-+static void rygel_lms_category_container_real_search (RygelSearchableContainer* base, RygelSearchExpression* expression, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
-+static gboolean rygel_lms_category_container_real_search_co (RygelLmsCategoryContainerSearchData* _data_);
-+static void rygel_lms_category_container_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
-+static void rygel_lms_category_container_real_get_children_data_free (gpointer _data);
-+static void rygel_lms_category_container_real_get_children (RygelMediaContainer* base, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
-+static gboolean rygel_lms_category_container_real_get_children_co (RygelLmsCategoryContainerGetChildrenData* _data_);
-+void rygel_lms_database_get_children_init (sqlite3_stmt* stmt, guint offset, guint max_count, const gchar* sort_criteria, GError** error);
-+static void rygel_lms_category_container_real_find_object_data_free (gpointer _data);
-+static void rygel_lms_category_container_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
-+static gboolean rygel_lms_category_container_real_find_object_co (RygelLmsCategoryContainerFindObjectData* _data_);
-+void rygel_lms_database_find_object (const gchar* id, sqlite3_stmt* stmt, GError** error);
-+static void rygel_lms_category_container_find_object_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gchar* rygel_lms_category_container_build_reference_id (RygelLMSCategoryContainer* self, gint db_id);
-+static void rygel_lms_category_container_real_add_child_data_free (gpointer _data);
-+static void rygel_lms_category_container_real_add_child (RygelTrackableContainer* base, RygelMediaObject* object, GAsyncReadyCallback _callback_, gpointer _user_data_);
-+static gboolean rygel_lms_category_container_real_add_child_co (RygelLmsCategoryContainerAddChildData* _data_);
-+static void rygel_lms_category_container_real_remove_child_data_free (gpointer _data);
-+static void rygel_lms_category_container_real_remove_child (RygelTrackableContainer* base, RygelMediaObject* object, GAsyncReadyCallback _callback_, gpointer _user_data_);
-+static gboolean rygel_lms_category_container_real_remove_child_co (RygelLmsCategoryContainerRemoveChildData* _data_);
-+static void rygel_lms_category_container_on_db_updated (RygelLMSCategoryContainer* self, guint64 old_id, guint64 new_id);
-+sqlite3_stmt* rygel_lms_database_prepare (RygelLMSDatabase* self, const gchar* query_string, GError** error);
-+void rygel_lms_database_get_children_with_update_id_init (sqlite3_stmt* stmt, guint64 old_id, guint64 new_id, GError** error);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+static void rygel_lms_category_container_set_lms_db (RygelLMSCategoryContainer* self, RygelLMSDatabase* value);
-+const gchar* rygel_lms_category_container_get_db_id (RygelLMSCategoryContainer* self);
-+static void rygel_lms_category_container_set_db_id (RygelLMSCategoryContainer* self, const gchar* value);
-+static void rygel_lms_category_container_set_sql_all (RygelLMSCategoryContainer* self, const gchar* value);
-+const gchar* rygel_lms_category_container_get_sql_find_object (RygelLMSCategoryContainer* self);
-+static void rygel_lms_category_container_set_sql_find_object (RygelLMSCategoryContainer* self, const gchar* value);
-+static void rygel_lms_category_container_set_sql_count (RygelLMSCategoryContainer* self, const gchar* value);
-+const gchar* rygel_lms_category_container_get_sql_added (RygelLMSCategoryContainer* self);
-+static void rygel_lms_category_container_set_sql_added (RygelLMSCategoryContainer* self, const gchar* value);
-+const gchar* rygel_lms_category_container_get_sql_removed (RygelLMSCategoryContainer* self);
-+static void rygel_lms_category_container_set_sql_removed (RygelLMSCategoryContainer* self, const gchar* value);
-+static GObject * rygel_lms_category_container_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
-+static void _rygel_lms_category_container_on_db_updated_rygel_lms_database_db_updated (RygelLMSDatabase* _sender, guint64 old_update_id, guint64 new_update_id, gpointer self);
-+static void rygel_lms_category_container_finalize (GObject* obj);
-+static void _vala_rygel_lms_category_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
-+static void _vala_rygel_lms_category_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
-+
-+
-+GQuark rygel_lms_category_container_error_quark (void) {
-+ return g_quark_from_static_string ("rygel_lms_category_container_error-quark");
-+}
-+
-+
-+static RygelMediaObject* rygel_lms_category_container_real_object_from_statement (RygelLMSCategoryContainer* self, sqlite3_stmt* statement) {
-+ g_critical ("Type `%s' does not implement abstract method `rygel_lms_category_container_object_from_statement'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
-+ return NULL;
-+}
-+
-+
-+RygelMediaObject* rygel_lms_category_container_object_from_statement (RygelLMSCategoryContainer* self, sqlite3_stmt* statement) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS (self)->object_from_statement (self, statement);
-+}
-+
-+
-+static gchar* rygel_lms_category_container_real_get_sql_all_with_filter (RygelLMSCategoryContainer* self, const gchar* filter) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_all;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+gchar* rygel_lms_category_container_get_sql_all_with_filter (RygelLMSCategoryContainer* self, const gchar* filter) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS (self)->get_sql_all_with_filter (self, filter);
-+}
-+
-+
-+static gchar* rygel_lms_category_container_real_get_sql_count_with_filter (RygelLMSCategoryContainer* self, const gchar* filter) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (filter != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_count;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+gchar* rygel_lms_category_container_get_sql_count_with_filter (RygelLMSCategoryContainer* self, const gchar* filter) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS (self)->get_sql_count_with_filter (self, filter);
-+}
-+
-+
-+static gchar* rygel_lms_category_container_map_operand_to_column (const gchar* operand, gchar** collate, gboolean for_sort, GError** error) {
-+ gchar* _vala_collate = NULL;
-+ gchar* result = NULL;
-+ gchar* column = NULL;
-+ gboolean use_collation = FALSE;
-+ const gchar* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ GQuark _tmp3_ = 0U;
-+ static GQuark _tmp2_label0 = 0;
-+ static GQuark _tmp2_label1 = 0;
-+ static GQuark _tmp2_label2 = 0;
-+ gboolean _tmp11_ = FALSE;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (operand != NULL, NULL);
-+ column = NULL;
-+ use_collation = FALSE;
-+ _tmp0_ = operand;
-+ _tmp1_ = _tmp0_;
-+ _tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
-+ if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("dc:title")))) {
-+ switch (0) {
-+ default:
-+ {
-+ gchar* _tmp4_ = NULL;
-+ _tmp4_ = g_strdup ("title");
-+ _g_free0 (column);
-+ column = _tmp4_;
-+ use_collation = TRUE;
-+ break;
-+ }
-+ }
-+ } else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("upnp:artist")))) {
-+ switch (0) {
-+ default:
-+ {
-+ gchar* _tmp5_ = NULL;
-+ _tmp5_ = g_strdup ("artist");
-+ _g_free0 (column);
-+ column = _tmp5_;
-+ use_collation = TRUE;
-+ break;
-+ }
-+ }
-+ } else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("dc:creator")))) {
-+ switch (0) {
-+ default:
-+ {
-+ gchar* _tmp6_ = NULL;
-+ _tmp6_ = g_strdup ("creator");
-+ _g_free0 (column);
-+ column = _tmp6_;
-+ use_collation = TRUE;
-+ break;
-+ }
-+ }
-+ } else {
-+ switch (0) {
-+ default:
-+ {
-+ gchar* message = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ gchar* _tmp8_ = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ GError* _tmp10_ = NULL;
-+ _tmp7_ = operand;
-+ _tmp8_ = g_strdup_printf ("Unsupported column %s", _tmp7_);
-+ message = _tmp8_;
-+ _tmp9_ = message;
-+ _tmp10_ = g_error_new_literal (RYGEL_LMS_CATEGORY_CONTAINER_ERROR, RYGEL_LMS_CATEGORY_CONTAINER_ERROR_UNSUPPORTED_SEARCH, _tmp9_);
-+ _inner_error_ = _tmp10_;
-+ g_propagate_error (error, _inner_error_);
-+ _g_free0 (message);
-+ _g_free0 (column);
-+ return NULL;
-+ }
-+ }
-+ }
-+ _tmp11_ = use_collation;
-+ if (_tmp11_) {
-+ gchar* _tmp12_ = NULL;
-+ _tmp12_ = g_strdup ("COLLATE CASEFOLD");
-+ _g_free0 (_vala_collate);
-+ _vala_collate = _tmp12_;
-+ } else {
-+ gchar* _tmp13_ = NULL;
-+ _tmp13_ = g_strdup ("");
-+ _g_free0 (_vala_collate);
-+ _vala_collate = _tmp13_;
-+ }
-+ result = column;
-+ if (collate) {
-+ *collate = _vala_collate;
-+ } else {
-+ _g_free0 (_vala_collate);
-+ }
-+ return result;
-+}
-+
-+
-+static void _vala_GValue_free (GValue* self) {
-+ g_value_unset (self);
-+ g_free (self);
-+}
-+
-+
-+static gchar* rygel_lms_category_container_relational_expression_to_sql (RygelRelationalExpression* exp, GValueArray* args, GError** error) {
-+ gchar* result = NULL;
-+ GValue* v = NULL;
-+ gchar* collate = NULL;
-+ gchar* column = NULL;
-+ RygelRelationalExpression* _tmp0_ = NULL;
-+ gconstpointer _tmp1_ = NULL;
-+ gchar* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ RygelLMSSqlOperator* operator = NULL;
-+ RygelRelationalExpression* _tmp4_ = NULL;
-+ gconstpointer _tmp5_ = NULL;
-+ GValue* _tmp40_ = NULL;
-+ RygelLMSSqlOperator* _tmp44_ = NULL;
-+ gchar* _tmp45_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (exp != NULL, NULL);
-+ g_return_val_if_fail (args != NULL, NULL);
-+ v = NULL;
-+ collate = NULL;
-+ _tmp0_ = exp;
-+ _tmp1_ = ((RygelSearchExpression*) _tmp0_)->operand1;
-+ _tmp3_ = rygel_lms_category_container_map_operand_to_column ((const gchar*) _tmp1_, &_tmp2_, FALSE, &_inner_error_);
-+ _g_free0 (collate);
-+ collate = _tmp2_;
-+ column = _tmp3_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_propagate_error (error, _inner_error_);
-+ _g_free0 (collate);
-+ __vala_GValue_free0 (v);
-+ return NULL;
-+ }
-+ _tmp4_ = exp;
-+ _tmp5_ = ((RygelSearchExpression*) _tmp4_)->op;
-+ switch ((GUPnPSearchCriteriaOp) ((gintptr) _tmp5_)) {
-+ case GUPNP_SEARCH_CRITERIA_OP_EXISTS:
-+ {
-+ gchar* sql_function = NULL;
-+ RygelRelationalExpression* _tmp6_ = NULL;
-+ gconstpointer _tmp7_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ const gchar* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ _tmp6_ = exp;
-+ _tmp7_ = ((RygelSearchExpression*) _tmp6_)->operand2;
-+ if (g_strcmp0 ((const gchar*) _tmp7_, "true") == 0) {
-+ gchar* _tmp8_ = NULL;
-+ _tmp8_ = g_strdup ("%s IS NOT NULL AND %s != ''");
-+ _g_free0 (sql_function);
-+ sql_function = _tmp8_;
-+ } else {
-+ gchar* _tmp9_ = NULL;
-+ _tmp9_ = g_strdup ("%s IS NULL OR %s = ''");
-+ _g_free0 (sql_function);
-+ sql_function = _tmp9_;
-+ }
-+ _tmp10_ = sql_function;
-+ _tmp11_ = column;
-+ _tmp12_ = column;
-+ _tmp13_ = g_strdup_printf (_tmp10_, _tmp11_, _tmp12_);
-+ result = _tmp13_;
-+ _g_free0 (sql_function);
-+ _g_object_unref0 (operator);
-+ _g_free0 (column);
-+ _g_free0 (collate);
-+ __vala_GValue_free0 (v);
-+ return result;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_EQ:
-+ case GUPNP_SEARCH_CRITERIA_OP_NEQ:
-+ case GUPNP_SEARCH_CRITERIA_OP_LESS:
-+ case GUPNP_SEARCH_CRITERIA_OP_LEQ:
-+ case GUPNP_SEARCH_CRITERIA_OP_GREATER:
-+ case GUPNP_SEARCH_CRITERIA_OP_GEQ:
-+ {
-+ RygelRelationalExpression* _tmp14_ = NULL;
-+ gconstpointer _tmp15_ = NULL;
-+ GValue* _tmp16_ = NULL;
-+ RygelRelationalExpression* _tmp17_ = NULL;
-+ gconstpointer _tmp18_ = NULL;
-+ const gchar* _tmp19_ = NULL;
-+ const gchar* _tmp20_ = NULL;
-+ RygelLMSSqlOperator* _tmp21_ = NULL;
-+ _tmp14_ = exp;
-+ _tmp15_ = ((RygelSearchExpression*) _tmp14_)->operand2;
-+ _tmp16_ = g_new0 (GValue, 1);
-+ g_value_init (_tmp16_, G_TYPE_STRING);
-+ g_value_set_string (_tmp16_, (const gchar*) _tmp15_);
-+ __vala_GValue_free0 (v);
-+ v = _tmp16_;
-+ _tmp17_ = exp;
-+ _tmp18_ = ((RygelSearchExpression*) _tmp17_)->op;
-+ _tmp19_ = column;
-+ _tmp20_ = collate;
-+ _tmp21_ = rygel_lms_sql_operator_new_from_search_criteria_op ((GUPnPSearchCriteriaOp) ((gintptr) _tmp18_), _tmp19_, _tmp20_);
-+ _g_object_unref0 (operator);
-+ operator = _tmp21_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_CONTAINS:
-+ {
-+ const gchar* _tmp22_ = NULL;
-+ RygelLMSSqlFunction* _tmp23_ = NULL;
-+ RygelRelationalExpression* _tmp24_ = NULL;
-+ gconstpointer _tmp25_ = NULL;
-+ GValue* _tmp26_ = NULL;
-+ _tmp22_ = column;
-+ _tmp23_ = rygel_lms_sql_function_new ("contains", _tmp22_);
-+ _g_object_unref0 (operator);
-+ operator = (RygelLMSSqlOperator*) _tmp23_;
-+ _tmp24_ = exp;
-+ _tmp25_ = ((RygelSearchExpression*) _tmp24_)->operand2;
-+ _tmp26_ = g_new0 (GValue, 1);
-+ g_value_init (_tmp26_, G_TYPE_STRING);
-+ g_value_set_string (_tmp26_, (const gchar*) _tmp25_);
-+ __vala_GValue_free0 (v);
-+ v = _tmp26_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_DOES_NOT_CONTAIN:
-+ {
-+ const gchar* _tmp27_ = NULL;
-+ RygelLMSSqlFunction* _tmp28_ = NULL;
-+ RygelRelationalExpression* _tmp29_ = NULL;
-+ gconstpointer _tmp30_ = NULL;
-+ GValue* _tmp31_ = NULL;
-+ _tmp27_ = column;
-+ _tmp28_ = rygel_lms_sql_function_new ("NOT contains", _tmp27_);
-+ _g_object_unref0 (operator);
-+ operator = (RygelLMSSqlOperator*) _tmp28_;
-+ _tmp29_ = exp;
-+ _tmp30_ = ((RygelSearchExpression*) _tmp29_)->operand2;
-+ _tmp31_ = g_new0 (GValue, 1);
-+ g_value_init (_tmp31_, G_TYPE_STRING);
-+ g_value_set_string (_tmp31_, (const gchar*) _tmp30_);
-+ __vala_GValue_free0 (v);
-+ v = _tmp31_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_DERIVED_FROM:
-+ {
-+ const gchar* _tmp32_ = NULL;
-+ RygelLMSSqlOperator* _tmp33_ = NULL;
-+ RygelRelationalExpression* _tmp34_ = NULL;
-+ gconstpointer _tmp35_ = NULL;
-+ gchar* _tmp36_ = NULL;
-+ GValue* _tmp37_ = NULL;
-+ _tmp32_ = column;
-+ _tmp33_ = rygel_lms_sql_operator_new ("LIKE", _tmp32_, "");
-+ _g_object_unref0 (operator);
-+ operator = _tmp33_;
-+ _tmp34_ = exp;
-+ _tmp35_ = ((RygelSearchExpression*) _tmp34_)->operand2;
-+ _tmp36_ = g_strdup_printf ("%s%%", (const gchar*) _tmp35_);
-+ _tmp37_ = g_new0 (GValue, 1);
-+ g_value_init (_tmp37_, G_TYPE_STRING);
-+ g_value_take_string (_tmp37_, _tmp36_);
-+ __vala_GValue_free0 (v);
-+ v = _tmp37_;
-+ break;
-+ }
-+ default:
-+ {
-+ RygelRelationalExpression* _tmp38_ = NULL;
-+ gconstpointer _tmp39_ = NULL;
-+ _tmp38_ = exp;
-+ _tmp39_ = ((RygelSearchExpression*) _tmp38_)->op;
-+ g_warning ("rygel-lms-category-container.vala:148: Unsupported op %d", (gint) ((GUPnPSearchCriteriaOp) ((gintptr) _tmp39_)));
-+ result = NULL;
-+ _g_object_unref0 (operator);
-+ _g_free0 (column);
-+ _g_free0 (collate);
-+ __vala_GValue_free0 (v);
-+ return result;
-+ }
-+ }
-+ _tmp40_ = v;
-+ if (_tmp40_ != NULL) {
-+ GValueArray* _tmp41_ = NULL;
-+ GValue* _tmp42_ = NULL;
-+ GValue _tmp43_ = {0};
-+ _tmp41_ = args;
-+ _tmp42_ = v;
-+ _tmp43_ = *_tmp42_;
-+ g_value_array_append (_tmp41_, &_tmp43_);
-+ }
-+ _tmp44_ = operator;
-+ _tmp45_ = rygel_lms_sql_operator_to_string (_tmp44_);
-+ result = _tmp45_;
-+ _g_object_unref0 (operator);
-+ _g_free0 (column);
-+ _g_free0 (collate);
-+ __vala_GValue_free0 (v);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_category_container_logical_expression_to_sql (RygelLogicalExpression* expression, GValueArray* args, GError** error) {
-+ gchar* result = NULL;
-+ gchar* left_sql_string = NULL;
-+ RygelLogicalExpression* _tmp0_ = NULL;
-+ gconstpointer _tmp1_ = NULL;
-+ GValueArray* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ gchar* right_sql_string = NULL;
-+ RygelLogicalExpression* _tmp4_ = NULL;
-+ gconstpointer _tmp5_ = NULL;
-+ GValueArray* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ const gchar* operator_sql_string = NULL;
-+ RygelLogicalExpression* _tmp8_ = NULL;
-+ gconstpointer _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ const gchar* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (expression != NULL, NULL);
-+ g_return_val_if_fail (args != NULL, NULL);
-+ _tmp0_ = expression;
-+ _tmp1_ = ((RygelSearchExpression*) _tmp0_)->operand1;
-+ _tmp2_ = args;
-+ _tmp3_ = rygel_lms_category_container_search_expression_to_sql ((RygelSearchExpression*) _tmp1_, _tmp2_, &_inner_error_);
-+ left_sql_string = _tmp3_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_propagate_error (error, _inner_error_);
-+ return NULL;
-+ }
-+ _tmp4_ = expression;
-+ _tmp5_ = ((RygelSearchExpression*) _tmp4_)->operand2;
-+ _tmp6_ = args;
-+ _tmp7_ = rygel_lms_category_container_search_expression_to_sql ((RygelSearchExpression*) _tmp5_, _tmp6_, &_inner_error_);
-+ right_sql_string = _tmp7_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_propagate_error (error, _inner_error_);
-+ _g_free0 (left_sql_string);
-+ return NULL;
-+ }
-+ operator_sql_string = "OR";
-+ _tmp8_ = expression;
-+ _tmp9_ = ((RygelSearchExpression*) _tmp8_)->op;
-+ if (((RygelLogicalOperator) ((gintptr) _tmp9_)) == RYGEL_LOGICAL_OPERATOR_AND) {
-+ operator_sql_string = "AND";
-+ }
-+ _tmp10_ = left_sql_string;
-+ _tmp11_ = operator_sql_string;
-+ _tmp12_ = right_sql_string;
-+ _tmp13_ = g_strdup_printf ("(%s %s %s)", _tmp10_, _tmp11_, _tmp12_);
-+ result = _tmp13_;
-+ _g_free0 (right_sql_string);
-+ _g_free0 (left_sql_string);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_category_container_search_expression_to_sql (RygelSearchExpression* expression, GValueArray* args, GError** error) {
-+ gchar* result = NULL;
-+ RygelSearchExpression* _tmp0_ = NULL;
-+ RygelSearchExpression* _tmp2_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (args != NULL, NULL);
-+ _tmp0_ = expression;
-+ if (_tmp0_ == NULL) {
-+ gchar* _tmp1_ = NULL;
-+ _tmp1_ = g_strdup ("");
-+ result = _tmp1_;
-+ return result;
-+ }
-+ _tmp2_ = expression;
-+ if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, RYGEL_TYPE_LOGICAL_EXPRESSION)) {
-+ gchar* _tmp3_ = NULL;
-+ RygelSearchExpression* _tmp4_ = NULL;
-+ GValueArray* _tmp5_ = NULL;
-+ gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ _tmp4_ = expression;
-+ _tmp5_ = args;
-+ _tmp6_ = rygel_lms_category_container_logical_expression_to_sql (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, RYGEL_TYPE_LOGICAL_EXPRESSION) ? ((RygelLogicalExpression*) _tmp4_) : NULL, _tmp5_, &_inner_error_);
-+ _tmp3_ = _tmp6_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_propagate_error (error, _inner_error_);
-+ return NULL;
-+ }
-+ _tmp7_ = _tmp3_;
-+ _tmp3_ = NULL;
-+ result = _tmp7_;
-+ _g_free0 (_tmp3_);
-+ return result;
-+ } else {
-+ gchar* _tmp8_ = NULL;
-+ RygelSearchExpression* _tmp9_ = NULL;
-+ GValueArray* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ _tmp9_ = expression;
-+ _tmp10_ = args;
-+ _tmp11_ = rygel_lms_category_container_relational_expression_to_sql (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, RYGEL_TYPE_RELATIONAL_EXPRESSION) ? ((RygelRelationalExpression*) _tmp9_) : NULL, _tmp10_, &_inner_error_);
-+ _tmp8_ = _tmp11_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_propagate_error (error, _inner_error_);
-+ return NULL;
-+ }
-+ _tmp12_ = _tmp8_;
-+ _tmp8_ = NULL;
-+ result = _tmp12_;
-+ _g_free0 (_tmp8_);
-+ return result;
-+ }
-+}
-+
-+
-+static guint rygel_lms_category_container_real_get_child_count_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args) {
-+ guint result = 0U;
-+ gchar* query = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (where_filter != NULL, 0U);
-+ g_return_val_if_fail (args != NULL, 0U);
-+ _tmp0_ = where_filter;
-+ _tmp1_ = rygel_lms_category_container_get_sql_count_with_filter (self, _tmp0_);
-+ query = _tmp1_;
-+ {
-+ sqlite3_stmt* stmt = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ GValueArray* _tmp4_ = NULL;
-+ GValue* _tmp5_ = NULL;
-+ gint _tmp5__length1 = 0;
-+ sqlite3_stmt* _tmp6_ = NULL;
-+ sqlite3_stmt* _tmp7_ = NULL;
-+ gint _tmp8_ = 0;
-+ sqlite3_stmt* _tmp9_ = NULL;
-+ gint _tmp10_ = 0;
-+ _tmp2_ = self->priv->_lms_db;
-+ _tmp3_ = query;
-+ _tmp4_ = args;
-+ _tmp5_ = _tmp4_->values;
-+ _tmp5__length1 = (gint) _tmp4_->n_values;
-+ _tmp6_ = rygel_lms_database_prepare_and_init (_tmp2_, _tmp3_, _tmp5_, _tmp5__length1, &_inner_error_);
-+ stmt = _tmp6_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch2_rygel_lms_database_error;
-+ }
-+ _g_free0 (query);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return 0U;
-+ }
-+ _tmp7_ = stmt;
-+ _tmp8_ = sqlite3_step (_tmp7_);
-+ if (_tmp8_ != SQLITE_ROW) {
-+ result = (guint) 0;
-+ _sqlite3_finalize0 (stmt);
-+ _g_free0 (query);
-+ return result;
-+ }
-+ _tmp9_ = stmt;
-+ _tmp10_ = sqlite3_column_int (_tmp9_, 0);
-+ result = (guint) _tmp10_;
-+ _sqlite3_finalize0 (stmt);
-+ _g_free0 (query);
-+ return result;
-+ }
-+ goto __finally2;
-+ __catch2_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp11_ = e;
-+ _tmp12_ = _tmp11_->message;
-+ g_warning ("rygel-lms-category-container.vala:209: Query failed: %s", _tmp12_);
-+ result = (guint) 0;
-+ _g_error_free0 (e);
-+ _g_free0 (query);
-+ return result;
-+ }
-+ __finally2:
-+ _g_free0 (query);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return 0U;
-+}
-+
-+
-+guint rygel_lms_category_container_get_child_count_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args) {
-+ g_return_val_if_fail (self != NULL, 0U);
-+ return RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS (self)->get_child_count_with_filter (self, where_filter, args);
-+}
-+
-+
-+static RygelMediaObjects* rygel_lms_category_container_real_get_children_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count) {
-+ RygelMediaObjects* result = NULL;
-+ RygelMediaObjects* children = NULL;
-+ RygelMediaObjects* _tmp0_ = NULL;
-+ GValue v = {0};
-+ guint _tmp1_ = 0U;
-+ GValue _tmp2_ = {0};
-+ GValueArray* _tmp3_ = NULL;
-+ GValue _tmp4_ = {0};
-+ guint _tmp5_ = 0U;
-+ GValue _tmp6_ = {0};
-+ GValueArray* _tmp7_ = NULL;
-+ GValue _tmp8_ = {0};
-+ gchar* query = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* _tmp10_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (where_filter != NULL, NULL);
-+ g_return_val_if_fail (args != NULL, NULL);
-+ g_return_val_if_fail (sort_criteria != NULL, NULL);
-+ _tmp0_ = rygel_media_objects_new ();
-+ children = _tmp0_;
-+ _tmp1_ = max_count;
-+ g_value_init (&_tmp2_, G_TYPE_UINT);
-+ g_value_set_uint (&_tmp2_, _tmp1_);
-+ v = _tmp2_;
-+ _tmp3_ = args;
-+ _tmp4_ = v;
-+ g_value_array_append (_tmp3_, &_tmp4_);
-+ _tmp5_ = offset;
-+ g_value_init (&_tmp6_, G_TYPE_UINT);
-+ g_value_set_uint (&_tmp6_, _tmp5_);
-+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
-+ v = _tmp6_;
-+ _tmp7_ = args;
-+ _tmp8_ = v;
-+ g_value_array_append (_tmp7_, &_tmp8_);
-+ _tmp9_ = where_filter;
-+ _tmp10_ = rygel_lms_category_container_get_sql_all_with_filter (self, _tmp9_);
-+ query = _tmp10_;
-+ {
-+ sqlite3_stmt* stmt = NULL;
-+ RygelLMSDatabase* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ GValueArray* _tmp13_ = NULL;
-+ GValue* _tmp14_ = NULL;
-+ gint _tmp14__length1 = 0;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ _tmp11_ = self->priv->_lms_db;
-+ _tmp12_ = query;
-+ _tmp13_ = args;
-+ _tmp14_ = _tmp13_->values;
-+ _tmp14__length1 = (gint) _tmp13_->n_values;
-+ _tmp15_ = rygel_lms_database_prepare_and_init (_tmp11_, _tmp12_, _tmp14_, _tmp14__length1, &_inner_error_);
-+ stmt = _tmp15_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch3_rygel_lms_database_error;
-+ }
-+ _g_free0 (query);
-+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ while (TRUE) {
-+ gboolean _tmp16_ = FALSE;
-+ sqlite3_stmt* _tmp17_ = NULL;
-+ gboolean _tmp18_ = FALSE;
-+ RygelMediaObjects* _tmp19_ = NULL;
-+ sqlite3_stmt* _tmp20_ = NULL;
-+ RygelMediaObject* _tmp21_ = NULL;
-+ RygelMediaObject* _tmp22_ = NULL;
-+ _tmp17_ = stmt;
-+ _tmp18_ = rygel_lms_database_get_children_step (_tmp17_, &_inner_error_);
-+ _tmp16_ = _tmp18_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch3_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ _g_free0 (query);
-+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ if (!_tmp16_) {
-+ break;
-+ }
-+ _tmp19_ = children;
-+ _tmp20_ = stmt;
-+ _tmp21_ = rygel_lms_category_container_object_from_statement (self, _tmp20_);
-+ _tmp22_ = _tmp21_;
-+ gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp22_);
-+ _g_object_unref0 (_tmp22_);
-+ }
-+ _sqlite3_finalize0 (stmt);
-+ }
-+ goto __finally3;
-+ __catch3_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp23_ = NULL;
-+ const gchar* _tmp24_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp23_ = e;
-+ _tmp24_ = _tmp23_->message;
-+ g_warning ("rygel-lms-category-container.vala:232: Query failed: %s", _tmp24_);
-+ _g_error_free0 (e);
-+ }
-+ __finally3:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (query);
-+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
-+ _g_object_unref0 (children);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ result = children;
-+ _g_free0 (query);
-+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
-+ return result;
-+}
-+
-+
-+RygelMediaObjects* rygel_lms_category_container_get_children_with_filter (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS (self)->get_children_with_filter (self, where_filter, args, sort_criteria, offset, max_count);
-+}
-+
-+
-+static void rygel_lms_category_container_real_search_data_free (gpointer _data) {
-+ RygelLmsCategoryContainerSearchData* _data_;
-+ _data_ = _data;
-+ _rygel_search_expression_unref0 (_data_->expression);
-+ _g_free0 (_data_->sort_criteria);
-+ _g_object_unref0 (_data_->cancellable);
-+ _g_object_unref0 (_data_->result);
-+ _g_object_unref0 (_data_->self);
-+ g_slice_free (RygelLmsCategoryContainerSearchData, _data_);
-+}
-+
-+
-+static gpointer _g_object_ref0 (gpointer self) {
-+ return self ? g_object_ref (self) : NULL;
-+}
-+
-+
-+static gpointer _rygel_search_expression_ref0 (gpointer self) {
-+ return self ? rygel_search_expression_ref (self) : NULL;
-+}
-+
-+
-+static void rygel_lms_category_container_real_search (RygelSearchableContainer* base, RygelSearchExpression* expression, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
-+ RygelLMSCategoryContainer * self;
-+ RygelLmsCategoryContainerSearchData* _data_;
-+ RygelLMSCategoryContainer* _tmp0_ = NULL;
-+ RygelSearchExpression* _tmp1_ = NULL;
-+ RygelSearchExpression* _tmp2_ = NULL;
-+ guint _tmp3_ = 0U;
-+ guint _tmp4_ = 0U;
-+ const gchar* _tmp5_ = NULL;
-+ gchar* _tmp6_ = NULL;
-+ GCancellable* _tmp7_ = NULL;
-+ GCancellable* _tmp8_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _data_ = g_slice_new0 (RygelLmsCategoryContainerSearchData);
-+ _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_lms_category_container_real_search);
-+ g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_lms_category_container_real_search_data_free);
-+ _tmp0_ = _g_object_ref0 (self);
-+ _data_->self = _tmp0_;
-+ _tmp1_ = expression;
-+ _tmp2_ = _rygel_search_expression_ref0 (_tmp1_);
-+ _rygel_search_expression_unref0 (_data_->expression);
-+ _data_->expression = _tmp2_;
-+ _tmp3_ = offset;
-+ _data_->offset = _tmp3_;
-+ _tmp4_ = max_count;
-+ _data_->max_count = _tmp4_;
-+ _tmp5_ = sort_criteria;
-+ _tmp6_ = g_strdup (_tmp5_);
-+ _g_free0 (_data_->sort_criteria);
-+ _data_->sort_criteria = _tmp6_;
-+ _tmp7_ = cancellable;
-+ _tmp8_ = _g_object_ref0 (_tmp7_);
-+ _g_object_unref0 (_data_->cancellable);
-+ _data_->cancellable = _tmp8_;
-+ rygel_lms_category_container_real_search_co (_data_);
-+}
-+
-+
-+static RygelMediaObjects* rygel_lms_category_container_real_search_finish (RygelSearchableContainer* base, GAsyncResult* _res_, guint* total_matches, GError** error) {
-+ RygelMediaObjects* result;
-+ RygelLmsCategoryContainerSearchData* _data_;
-+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
-+ return NULL;
-+ }
-+ _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
-+ if (total_matches) {
-+ *total_matches = _data_->total_matches;
-+ }
-+ result = _data_->result;
-+ _data_->result = NULL;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
-+ RygelLmsCategoryContainerSearchData* _data_;
-+ _data_ = _user_data_;
-+ _data_->_source_object_ = source_object;
-+ _data_->_res_ = _res_;
-+ rygel_lms_category_container_real_search_co (_data_);
-+}
-+
-+
-+static gboolean rygel_lms_category_container_real_search_co (RygelLmsCategoryContainerSearchData* _data_) {
-+ switch (_data_->_state_) {
-+ case 0:
-+ goto _state_0;
-+ case 1:
-+ goto _state_1;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+ _state_0:
-+ g_debug ("rygel-lms-category-container.vala:245: search()");
-+ {
-+ _data_->_tmp0_ = NULL;
-+ _data_->_tmp0_ = g_value_array_new ((guint) 0);
-+ _data_->args = _data_->_tmp0_;
-+ _data_->_tmp1_ = NULL;
-+ _data_->_tmp1_ = _data_->expression;
-+ _data_->_tmp2_ = NULL;
-+ _data_->_tmp2_ = _data_->args;
-+ _data_->_tmp3_ = NULL;
-+ _data_->_tmp3_ = rygel_lms_category_container_search_expression_to_sql (_data_->_tmp1_, _data_->_tmp2_, &_data_->_inner_error_);
-+ _data_->filter = _data_->_tmp3_;
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ _g_value_array_free0 (_data_->args);
-+ goto __catch4_g_error;
-+ }
-+ _data_->_tmp4_ = NULL;
-+ _data_->_tmp4_ = _data_->filter;
-+ _data_->_tmp5_ = NULL;
-+ _data_->_tmp5_ = _data_->args;
-+ _data_->_tmp6_ = 0U;
-+ _data_->_tmp6_ = rygel_lms_category_container_get_child_count_with_filter (_data_->self, _data_->_tmp4_, _data_->_tmp5_);
-+ _data_->total_matches = _data_->_tmp6_;
-+ _data_->_tmp7_ = NULL;
-+ _data_->_tmp7_ = _data_->expression;
-+ if (_data_->_tmp7_ != NULL) {
-+ _data_->_tmp8_ = NULL;
-+ _data_->_tmp8_ = _data_->expression;
-+ _data_->_tmp9_ = NULL;
-+ _data_->_tmp9_ = rygel_search_expression_to_string (_data_->_tmp8_);
-+ _data_->_tmp10_ = NULL;
-+ _data_->_tmp10_ = _data_->_tmp9_;
-+ g_debug ("rygel-lms-category-container.vala:253: Original search: %s", _data_->_tmp10_);
-+ _g_free0 (_data_->_tmp10_);
-+ _data_->_tmp11_ = NULL;
-+ _data_->_tmp11_ = _data_->filter;
-+ g_debug ("rygel-lms-category-container.vala:254: Parsed search expression: %s", _data_->_tmp11_);
-+ _data_->_tmp12_ = 0U;
-+ _data_->_tmp12_ = _data_->total_matches;
-+ g_debug ("rygel-lms-category-container.vala:255: Filtered cild count is %u", _data_->_tmp12_);
-+ }
-+ _data_->_tmp13_ = 0U;
-+ _data_->_tmp13_ = _data_->max_count;
-+ if (_data_->_tmp13_ == ((guint) 0)) {
-+ _data_->max_count = G_MAXUINT;
-+ }
-+ _data_->_tmp14_ = NULL;
-+ _data_->_tmp14_ = _data_->filter;
-+ _data_->_tmp15_ = NULL;
-+ _data_->_tmp15_ = _data_->args;
-+ _data_->_tmp16_ = NULL;
-+ _data_->_tmp16_ = _data_->sort_criteria;
-+ _data_->_tmp17_ = 0U;
-+ _data_->_tmp17_ = _data_->offset;
-+ _data_->_tmp18_ = 0U;
-+ _data_->_tmp18_ = _data_->max_count;
-+ _data_->_tmp19_ = NULL;
-+ _data_->_tmp19_ = rygel_lms_category_container_get_children_with_filter (_data_->self, _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_, _data_->_tmp17_, _data_->_tmp18_);
-+ _data_->result = _data_->_tmp19_;
-+ _g_free0 (_data_->filter);
-+ _g_value_array_free0 (_data_->args);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ goto __finally4;
-+ __catch4_g_error:
-+ {
-+ _data_->e = _data_->_inner_error_;
-+ _data_->_inner_error_ = NULL;
-+ _data_->_tmp20_ = NULL;
-+ _data_->_tmp20_ = _data_->e;
-+ _data_->_tmp21_ = NULL;
-+ _data_->_tmp21_ = _data_->_tmp20_->message;
-+ g_debug ("rygel-lms-category-container.vala:267: Falling back to simple_search" \
-+"(): %s", _data_->_tmp21_);
-+ _data_->_tmp23_ = NULL;
-+ _data_->_tmp23_ = _data_->expression;
-+ _data_->_tmp24_ = 0U;
-+ _data_->_tmp24_ = _data_->offset;
-+ _data_->_tmp25_ = 0U;
-+ _data_->_tmp25_ = _data_->max_count;
-+ _data_->_tmp26_ = NULL;
-+ _data_->_tmp26_ = _data_->sort_criteria;
-+ _data_->_tmp27_ = NULL;
-+ _data_->_tmp27_ = _data_->cancellable;
-+ _data_->_tmp28_ = 0U;
-+ _data_->_state_ = 1;
-+ rygel_searchable_container_simple_search ((RygelSearchableContainer*) _data_->self, _data_->_tmp23_, _data_->_tmp24_, _data_->_tmp25_, _data_->_tmp26_, _data_->_tmp27_, rygel_lms_category_container_search_ready, _data_);
-+ return FALSE;
-+ _state_1:
-+ _data_->_tmp29_ = NULL;
-+ _data_->_tmp29_ = rygel_searchable_container_simple_search_finish ((RygelSearchableContainer*) _data_->self, _data_->_res_, &_data_->_tmp28_, &_data_->_inner_error_);
-+ _data_->total_matches = _data_->_tmp28_;
-+ _data_->_tmp22_ = _data_->_tmp29_;
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ _g_error_free0 (_data_->e);
-+ goto __finally4;
-+ }
-+ _data_->_tmp30_ = NULL;
-+ _data_->_tmp30_ = _data_->_tmp22_;
-+ _data_->_tmp22_ = NULL;
-+ _data_->result = _data_->_tmp30_;
-+ _g_object_unref0 (_data_->_tmp22_);
-+ _g_error_free0 (_data_->e);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ __finally4:
-+ g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
-+ g_error_free (_data_->_inner_error_);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+}
-+
-+
-+static void rygel_lms_category_container_real_get_children_data_free (gpointer _data) {
-+ RygelLmsCategoryContainerGetChildrenData* _data_;
-+ _data_ = _data;
-+ _g_free0 (_data_->sort_criteria);
-+ _g_object_unref0 (_data_->cancellable);
-+ _g_object_unref0 (_data_->result);
-+ _g_object_unref0 (_data_->self);
-+ g_slice_free (RygelLmsCategoryContainerGetChildrenData, _data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_get_children (RygelMediaContainer* base, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
-+ RygelLMSCategoryContainer * self;
-+ RygelLmsCategoryContainerGetChildrenData* _data_;
-+ RygelLMSCategoryContainer* _tmp0_ = NULL;
-+ guint _tmp1_ = 0U;
-+ guint _tmp2_ = 0U;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ GCancellable* _tmp5_ = NULL;
-+ GCancellable* _tmp6_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _data_ = g_slice_new0 (RygelLmsCategoryContainerGetChildrenData);
-+ _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_lms_category_container_real_get_children);
-+ g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_lms_category_container_real_get_children_data_free);
-+ _tmp0_ = _g_object_ref0 (self);
-+ _data_->self = _tmp0_;
-+ _tmp1_ = offset;
-+ _data_->offset = _tmp1_;
-+ _tmp2_ = max_count;
-+ _data_->max_count = _tmp2_;
-+ _tmp3_ = sort_criteria;
-+ _tmp4_ = g_strdup (_tmp3_);
-+ _g_free0 (_data_->sort_criteria);
-+ _data_->sort_criteria = _tmp4_;
-+ _tmp5_ = cancellable;
-+ _tmp6_ = _g_object_ref0 (_tmp5_);
-+ _g_object_unref0 (_data_->cancellable);
-+ _data_->cancellable = _tmp6_;
-+ rygel_lms_category_container_real_get_children_co (_data_);
-+}
-+
-+
-+static RygelMediaObjects* rygel_lms_category_container_real_get_children_finish (RygelMediaContainer* base, GAsyncResult* _res_, GError** error) {
-+ RygelMediaObjects* result;
-+ RygelLmsCategoryContainerGetChildrenData* _data_;
-+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
-+ return NULL;
-+ }
-+ _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
-+ result = _data_->result;
-+ _data_->result = NULL;
-+ return result;
-+}
-+
-+
-+static gboolean rygel_lms_category_container_real_get_children_co (RygelLmsCategoryContainerGetChildrenData* _data_) {
-+ switch (_data_->_state_) {
-+ case 0:
-+ goto _state_0;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+ _state_0:
-+ _data_->_tmp0_ = NULL;
-+ _data_->_tmp0_ = rygel_media_objects_new ();
-+ _data_->retval = _data_->_tmp0_;
-+ _data_->_tmp1_ = NULL;
-+ _data_->_tmp1_ = _data_->self->stmt_all;
-+ _data_->_tmp2_ = 0U;
-+ _data_->_tmp2_ = _data_->offset;
-+ _data_->_tmp3_ = 0U;
-+ _data_->_tmp3_ = _data_->max_count;
-+ _data_->_tmp4_ = NULL;
-+ _data_->_tmp4_ = _data_->sort_criteria;
-+ rygel_lms_database_get_children_init (_data_->_tmp1_, _data_->_tmp2_, _data_->_tmp3_, _data_->_tmp4_, &_data_->_inner_error_);
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
-+ g_error_free (_data_->_inner_error_);
-+ _g_object_unref0 (_data_->retval);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ while (TRUE) {
-+ _data_->_tmp6_ = NULL;
-+ _data_->_tmp6_ = _data_->self->stmt_all;
-+ _data_->_tmp7_ = FALSE;
-+ _data_->_tmp7_ = rygel_lms_database_get_children_step (_data_->_tmp6_, &_data_->_inner_error_);
-+ _data_->_tmp5_ = _data_->_tmp7_;
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
-+ g_error_free (_data_->_inner_error_);
-+ _g_object_unref0 (_data_->retval);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ if (!_data_->_tmp5_) {
-+ break;
-+ }
-+ _data_->_tmp8_ = NULL;
-+ _data_->_tmp8_ = _data_->retval;
-+ _data_->_tmp9_ = NULL;
-+ _data_->_tmp9_ = _data_->self->stmt_all;
-+ _data_->_tmp10_ = NULL;
-+ _data_->_tmp10_ = rygel_lms_category_container_object_from_statement (_data_->self, _data_->_tmp9_);
-+ _data_->_tmp11_ = NULL;
-+ _data_->_tmp11_ = _data_->_tmp10_;
-+ gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp8_, _data_->_tmp11_);
-+ _g_object_unref0 (_data_->_tmp11_);
-+ }
-+ _data_->result = _data_->retval;
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ _g_object_unref0 (_data_->retval);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+}
-+
-+
-+static void rygel_lms_category_container_real_find_object_data_free (gpointer _data) {
-+ RygelLmsCategoryContainerFindObjectData* _data_;
-+ _data_ = _data;
-+ _g_free0 (_data_->id);
-+ _g_object_unref0 (_data_->cancellable);
-+ _g_object_unref0 (_data_->result);
-+ _g_object_unref0 (_data_->self);
-+ g_slice_free (RygelLmsCategoryContainerFindObjectData, _data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
-+ RygelLMSCategoryContainer * self;
-+ RygelLmsCategoryContainerFindObjectData* _data_;
-+ RygelLMSCategoryContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ gchar* _tmp2_ = NULL;
-+ GCancellable* _tmp3_ = NULL;
-+ GCancellable* _tmp4_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _data_ = g_slice_new0 (RygelLmsCategoryContainerFindObjectData);
-+ _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_lms_category_container_real_find_object);
-+ g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_lms_category_container_real_find_object_data_free);
-+ _tmp0_ = _g_object_ref0 (self);
-+ _data_->self = _tmp0_;
-+ _tmp1_ = id;
-+ _tmp2_ = g_strdup (_tmp1_);
-+ _g_free0 (_data_->id);
-+ _data_->id = _tmp2_;
-+ _tmp3_ = cancellable;
-+ _tmp4_ = _g_object_ref0 (_tmp3_);
-+ _g_object_unref0 (_data_->cancellable);
-+ _data_->cancellable = _tmp4_;
-+ rygel_lms_category_container_real_find_object_co (_data_);
-+}
-+
-+
-+static RygelMediaObject* rygel_lms_category_container_real_find_object_finish (RygelMediaContainer* base, GAsyncResult* _res_, GError** error) {
-+ RygelMediaObject* result;
-+ RygelLmsCategoryContainerFindObjectData* _data_;
-+ if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
-+ return NULL;
-+ }
-+ _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
-+ result = _data_->result;
-+ _data_->result = NULL;
-+ return result;
-+}
-+
-+
-+static glong string_strnlen (gchar* str, glong maxlen) {
-+ glong result = 0L;
-+ gchar* end = NULL;
-+ gchar* _tmp0_ = NULL;
-+ glong _tmp1_ = 0L;
-+ gchar* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ _tmp0_ = str;
-+ _tmp1_ = maxlen;
-+ _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
-+ end = _tmp2_;
-+ _tmp3_ = end;
-+ if (_tmp3_ == NULL) {
-+ glong _tmp4_ = 0L;
-+ _tmp4_ = maxlen;
-+ result = _tmp4_;
-+ return result;
-+ } else {
-+ gchar* _tmp5_ = NULL;
-+ gchar* _tmp6_ = NULL;
-+ _tmp5_ = end;
-+ _tmp6_ = str;
-+ result = (glong) (_tmp5_ - _tmp6_);
-+ return result;
-+ }
-+}
-+
-+
-+static gchar* string_substring (const gchar* self, glong offset, glong len) {
-+ gchar* result = NULL;
-+ glong string_length = 0L;
-+ gboolean _tmp0_ = FALSE;
-+ glong _tmp1_ = 0L;
-+ glong _tmp8_ = 0L;
-+ glong _tmp14_ = 0L;
-+ glong _tmp17_ = 0L;
-+ glong _tmp18_ = 0L;
-+ glong _tmp19_ = 0L;
-+ glong _tmp20_ = 0L;
-+ glong _tmp21_ = 0L;
-+ gchar* _tmp22_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp1_ = offset;
-+ if (_tmp1_ >= ((glong) 0)) {
-+ glong _tmp2_ = 0L;
-+ _tmp2_ = len;
-+ _tmp0_ = _tmp2_ >= ((glong) 0);
-+ } else {
-+ _tmp0_ = FALSE;
-+ }
-+ if (_tmp0_) {
-+ glong _tmp3_ = 0L;
-+ glong _tmp4_ = 0L;
-+ glong _tmp5_ = 0L;
-+ _tmp3_ = offset;
-+ _tmp4_ = len;
-+ _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
-+ string_length = _tmp5_;
-+ } else {
-+ gint _tmp6_ = 0;
-+ gint _tmp7_ = 0;
-+ _tmp6_ = strlen (self);
-+ _tmp7_ = _tmp6_;
-+ string_length = (glong) _tmp7_;
-+ }
-+ _tmp8_ = offset;
-+ if (_tmp8_ < ((glong) 0)) {
-+ glong _tmp9_ = 0L;
-+ glong _tmp10_ = 0L;
-+ glong _tmp11_ = 0L;
-+ _tmp9_ = string_length;
-+ _tmp10_ = offset;
-+ offset = _tmp9_ + _tmp10_;
-+ _tmp11_ = offset;
-+ g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
-+ } else {
-+ glong _tmp12_ = 0L;
-+ glong _tmp13_ = 0L;
-+ _tmp12_ = offset;
-+ _tmp13_ = string_length;
-+ g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
-+ }
-+ _tmp14_ = len;
-+ if (_tmp14_ < ((glong) 0)) {
-+ glong _tmp15_ = 0L;
-+ glong _tmp16_ = 0L;
-+ _tmp15_ = string_length;
-+ _tmp16_ = offset;
-+ len = _tmp15_ - _tmp16_;
-+ }
-+ _tmp17_ = offset;
-+ _tmp18_ = len;
-+ _tmp19_ = string_length;
-+ g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
-+ _tmp20_ = offset;
-+ _tmp21_ = len;
-+ _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
-+ result = _tmp22_;
-+ return result;
-+}
-+
-+
-+static gint string_index_of_char (const gchar* self, gunichar c, gint start_index) {
-+ gint result = 0;
-+ gchar* _result_ = NULL;
-+ gint _tmp0_ = 0;
-+ gunichar _tmp1_ = 0U;
-+ gchar* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ g_return_val_if_fail (self != NULL, 0);
-+ _tmp0_ = start_index;
-+ _tmp1_ = c;
-+ _tmp2_ = g_utf8_strchr (((gchar*) self) + _tmp0_, (gssize) (-1), _tmp1_);
-+ _result_ = _tmp2_;
-+ _tmp3_ = _result_;
-+ if (_tmp3_ != NULL) {
-+ gchar* _tmp4_ = NULL;
-+ _tmp4_ = _result_;
-+ result = (gint) (_tmp4_ - ((gchar*) self));
-+ return result;
-+ } else {
-+ result = -1;
-+ return result;
-+ }
-+}
-+
-+
-+static gchar* string_slice (const gchar* self, glong start, glong end) {
-+ gchar* result = NULL;
-+ glong string_length = 0L;
-+ gint _tmp0_ = 0;
-+ gint _tmp1_ = 0;
-+ glong _tmp2_ = 0L;
-+ glong _tmp5_ = 0L;
-+ gboolean _tmp8_ = FALSE;
-+ glong _tmp9_ = 0L;
-+ gboolean _tmp12_ = FALSE;
-+ glong _tmp13_ = 0L;
-+ glong _tmp16_ = 0L;
-+ glong _tmp17_ = 0L;
-+ glong _tmp18_ = 0L;
-+ glong _tmp19_ = 0L;
-+ glong _tmp20_ = 0L;
-+ gchar* _tmp21_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = strlen (self);
-+ _tmp1_ = _tmp0_;
-+ string_length = (glong) _tmp1_;
-+ _tmp2_ = start;
-+ if (_tmp2_ < ((glong) 0)) {
-+ glong _tmp3_ = 0L;
-+ glong _tmp4_ = 0L;
-+ _tmp3_ = string_length;
-+ _tmp4_ = start;
-+ start = _tmp3_ + _tmp4_;
-+ }
-+ _tmp5_ = end;
-+ if (_tmp5_ < ((glong) 0)) {
-+ glong _tmp6_ = 0L;
-+ glong _tmp7_ = 0L;
-+ _tmp6_ = string_length;
-+ _tmp7_ = end;
-+ end = _tmp6_ + _tmp7_;
-+ }
-+ _tmp9_ = start;
-+ if (_tmp9_ >= ((glong) 0)) {
-+ glong _tmp10_ = 0L;
-+ glong _tmp11_ = 0L;
-+ _tmp10_ = start;
-+ _tmp11_ = string_length;
-+ _tmp8_ = _tmp10_ <= _tmp11_;
-+ } else {
-+ _tmp8_ = FALSE;
-+ }
-+ g_return_val_if_fail (_tmp8_, NULL);
-+ _tmp13_ = end;
-+ if (_tmp13_ >= ((glong) 0)) {
-+ glong _tmp14_ = 0L;
-+ glong _tmp15_ = 0L;
-+ _tmp14_ = end;
-+ _tmp15_ = string_length;
-+ _tmp12_ = _tmp14_ <= _tmp15_;
-+ } else {
-+ _tmp12_ = FALSE;
-+ }
-+ g_return_val_if_fail (_tmp12_, NULL);
-+ _tmp16_ = start;
-+ _tmp17_ = end;
-+ g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
-+ _tmp18_ = start;
-+ _tmp19_ = end;
-+ _tmp20_ = start;
-+ _tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
-+ result = _tmp21_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_find_object_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
-+ RygelLmsCategoryContainerFindObjectData* _data_;
-+ _data_ = _user_data_;
-+ _data_->_source_object_ = source_object;
-+ _data_->_res_ = _res_;
-+ rygel_lms_category_container_real_find_object_co (_data_);
-+}
-+
-+
-+static gboolean rygel_lms_category_container_real_find_object_co (RygelLmsCategoryContainerFindObjectData* _data_) {
-+ switch (_data_->_state_) {
-+ case 0:
-+ goto _state_0;
-+ case 1:
-+ goto _state_1;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+ _state_0:
-+ _data_->_tmp0_ = NULL;
-+ _data_->_tmp0_ = _data_->id;
-+ _data_->_tmp1_ = NULL;
-+ _data_->_tmp1_ = _data_->self->child_prefix;
-+ _data_->_tmp2_ = FALSE;
-+ _data_->_tmp2_ = g_str_has_prefix (_data_->_tmp0_, _data_->_tmp1_);
-+ if (!_data_->_tmp2_) {
-+ _data_->result = NULL;
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ _data_->object = NULL;
-+ _data_->_tmp3_ = NULL;
-+ _data_->_tmp3_ = _data_->id;
-+ _data_->_tmp4_ = NULL;
-+ _data_->_tmp4_ = _data_->self->child_prefix;
-+ _data_->_tmp5_ = 0;
-+ _data_->_tmp5_ = strlen (_data_->_tmp4_);
-+ _data_->_tmp6_ = 0;
-+ _data_->_tmp6_ = _data_->_tmp5_;
-+ _data_->_tmp7_ = NULL;
-+ _data_->_tmp7_ = string_substring (_data_->_tmp3_, (glong) _data_->_tmp6_, (glong) (-1));
-+ _data_->real_id = _data_->_tmp7_;
-+ _data_->_tmp8_ = NULL;
-+ _data_->_tmp8_ = _data_->real_id;
-+ _data_->_tmp9_ = 0;
-+ _data_->_tmp9_ = string_index_of_char (_data_->_tmp8_, (gunichar) ':', 0);
-+ _data_->index = _data_->_tmp9_;
-+ _data_->_tmp10_ = 0;
-+ _data_->_tmp10_ = _data_->index;
-+ if (_data_->_tmp10_ > 0) {
-+ _data_->_tmp11_ = NULL;
-+ _data_->_tmp11_ = _data_->real_id;
-+ _data_->_tmp12_ = 0;
-+ _data_->_tmp12_ = _data_->index;
-+ _data_->_tmp13_ = NULL;
-+ _data_->_tmp13_ = string_slice (_data_->_tmp11_, (glong) 0, (glong) _data_->_tmp12_);
-+ _g_free0 (_data_->real_id);
-+ _data_->real_id = _data_->_tmp13_;
-+ }
-+ {
-+ _data_->_tmp14_ = NULL;
-+ _data_->_tmp14_ = _data_->real_id;
-+ _data_->_tmp15_ = NULL;
-+ _data_->_tmp15_ = _data_->self->stmt_find_object;
-+ rygel_lms_database_find_object (_data_->_tmp14_, _data_->_tmp15_, &_data_->_inner_error_);
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ if (_data_->_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch5_rygel_lms_database_error;
-+ }
-+ _g_free0 (_data_->real_id);
-+ _g_object_unref0 (_data_->object);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
-+ g_clear_error (&_data_->_inner_error_);
-+ return FALSE;
-+ }
-+ _data_->_tmp16_ = NULL;
-+ _data_->_tmp16_ = _data_->self->stmt_find_object;
-+ _data_->_tmp17_ = NULL;
-+ _data_->_tmp17_ = rygel_lms_category_container_object_from_statement (_data_->self, _data_->_tmp16_);
-+ _data_->child = _data_->_tmp17_;
-+ _data_->_tmp18_ = 0;
-+ _data_->_tmp18_ = _data_->index;
-+ if (_data_->_tmp18_ < 0) {
-+ _data_->_tmp19_ = NULL;
-+ _data_->_tmp19_ = _data_->child;
-+ _data_->_tmp20_ = NULL;
-+ _data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
-+ _g_object_unref0 (_data_->object);
-+ _data_->object = _data_->_tmp20_;
-+ } else {
-+ _data_->_tmp21_ = NULL;
-+ _data_->_tmp21_ = _data_->child;
-+ _data_->_tmp22_ = NULL;
-+ _data_->_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp21_, RYGEL_LMS_TYPE_CATEGORY_CONTAINER) ? ((RygelLMSCategoryContainer*) _data_->_tmp21_) : NULL);
-+ _data_->container = _data_->_tmp22_;
-+ _data_->_tmp24_ = NULL;
-+ _data_->_tmp24_ = _data_->container;
-+ _data_->_tmp25_ = NULL;
-+ _data_->_tmp25_ = _data_->id;
-+ _data_->_tmp26_ = NULL;
-+ _data_->_tmp26_ = _data_->cancellable;
-+ _data_->_state_ = 1;
-+ rygel_media_container_find_object ((RygelMediaContainer*) _data_->_tmp24_, _data_->_tmp25_, _data_->_tmp26_, rygel_lms_category_container_find_object_ready, _data_);
-+ return FALSE;
-+ _state_1:
-+ _data_->_tmp27_ = NULL;
-+ _data_->_tmp27_ = rygel_media_container_find_object_finish ((RygelMediaContainer*) _data_->_tmp24_, _data_->_res_, &_data_->_inner_error_);
-+ _data_->_tmp23_ = _data_->_tmp27_;
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ _g_object_unref0 (_data_->container);
-+ _g_object_unref0 (_data_->child);
-+ if (_data_->_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch5_rygel_lms_database_error;
-+ }
-+ goto __finally5;
-+ }
-+ _data_->_tmp28_ = NULL;
-+ _data_->_tmp28_ = _data_->_tmp23_;
-+ _data_->_tmp23_ = NULL;
-+ _g_object_unref0 (_data_->object);
-+ _data_->object = _data_->_tmp28_;
-+ _data_->_tmp29_ = NULL;
-+ _data_->_tmp29_ = _data_->object;
-+ _data_->_tmp30_ = NULL;
-+ _data_->_tmp30_ = _data_->object;
-+ _data_->_tmp31_ = NULL;
-+ _data_->_tmp31_ = rygel_media_object_get_parent (_data_->_tmp30_);
-+ _data_->_tmp32_ = NULL;
-+ _data_->_tmp32_ = _data_->_tmp31_;
-+ rygel_media_object_set_parent_ref (_data_->_tmp29_, _data_->_tmp32_);
-+ _g_object_unref0 (_data_->_tmp23_);
-+ _g_object_unref0 (_data_->container);
-+ }
-+ _g_object_unref0 (_data_->child);
-+ }
-+ goto __finally5;
-+ __catch5_rygel_lms_database_error:
-+ {
-+ _data_->e = _data_->_inner_error_;
-+ _data_->_inner_error_ = NULL;
-+ _data_->_tmp33_ = NULL;
-+ _data_->_tmp33_ = _data_->id;
-+ _data_->_tmp34_ = NULL;
-+ _data_->_tmp34_ = rygel_media_object_get_id ((RygelMediaObject*) _data_->self);
-+ _data_->_tmp35_ = NULL;
-+ _data_->_tmp35_ = _data_->_tmp34_;
-+ _data_->_tmp36_ = NULL;
-+ _data_->_tmp36_ = _data_->e;
-+ _data_->_tmp37_ = NULL;
-+ _data_->_tmp37_ = _data_->_tmp36_->message;
-+ g_debug ("rygel-lms-category-container.vala:328: find_object %s in %s: %s", _data_->_tmp33_, _data_->_tmp35_, _data_->_tmp37_);
-+ _g_error_free0 (_data_->e);
-+ }
-+ __finally5:
-+ if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
-+ g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
-+ g_error_free (_data_->_inner_error_);
-+ _g_free0 (_data_->real_id);
-+ _g_object_unref0 (_data_->object);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ }
-+ _data_->result = _data_->object;
-+ _g_free0 (_data_->real_id);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+ _g_free0 (_data_->real_id);
-+ _g_object_unref0 (_data_->object);
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+}
-+
-+
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* _tmp2_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->child_prefix;
-+ _tmp1_ = db_id;
-+ _tmp2_ = g_strdup_printf ("%s%d", _tmp0_, _tmp1_);
-+ result = _tmp2_;
-+ return result;
-+}
-+
-+
-+gchar* rygel_lms_category_container_build_reference_id (RygelLMSCategoryContainer* self, gint db_id) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* _tmp2_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->ref_prefix;
-+ _tmp1_ = db_id;
-+ _tmp2_ = g_strdup_printf ("%s%d", _tmp0_, _tmp1_);
-+ result = _tmp2_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_real_add_child_data_free (gpointer _data) {
-+ RygelLmsCategoryContainerAddChildData* _data_;
-+ _data_ = _data;
-+ _g_object_unref0 (_data_->object);
-+ _g_object_unref0 (_data_->self);
-+ g_slice_free (RygelLmsCategoryContainerAddChildData, _data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_add_child (RygelTrackableContainer* base, RygelMediaObject* object, GAsyncReadyCallback _callback_, gpointer _user_data_) {
-+ RygelLMSCategoryContainer * self;
-+ RygelLmsCategoryContainerAddChildData* _data_;
-+ RygelLMSCategoryContainer* _tmp0_ = NULL;
-+ RygelMediaObject* _tmp1_ = NULL;
-+ RygelMediaObject* _tmp2_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _data_ = g_slice_new0 (RygelLmsCategoryContainerAddChildData);
-+ _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_lms_category_container_real_add_child);
-+ g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_lms_category_container_real_add_child_data_free);
-+ _tmp0_ = _g_object_ref0 (self);
-+ _data_->self = _tmp0_;
-+ _tmp1_ = object;
-+ _tmp2_ = _g_object_ref0 (_tmp1_);
-+ _g_object_unref0 (_data_->object);
-+ _data_->object = _tmp2_;
-+ rygel_lms_category_container_real_add_child_co (_data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_add_child_finish (RygelTrackableContainer* base, GAsyncResult* _res_) {
-+ RygelLmsCategoryContainerAddChildData* _data_;
-+ _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
-+}
-+
-+
-+static gboolean rygel_lms_category_container_real_add_child_co (RygelLmsCategoryContainerAddChildData* _data_) {
-+ switch (_data_->_state_) {
-+ case 0:
-+ goto _state_0;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+ _state_0:
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+}
-+
-+
-+static void rygel_lms_category_container_real_remove_child_data_free (gpointer _data) {
-+ RygelLmsCategoryContainerRemoveChildData* _data_;
-+ _data_ = _data;
-+ _g_object_unref0 (_data_->object);
-+ _g_object_unref0 (_data_->self);
-+ g_slice_free (RygelLmsCategoryContainerRemoveChildData, _data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_remove_child (RygelTrackableContainer* base, RygelMediaObject* object, GAsyncReadyCallback _callback_, gpointer _user_data_) {
-+ RygelLMSCategoryContainer * self;
-+ RygelLmsCategoryContainerRemoveChildData* _data_;
-+ RygelLMSCategoryContainer* _tmp0_ = NULL;
-+ RygelMediaObject* _tmp1_ = NULL;
-+ RygelMediaObject* _tmp2_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _data_ = g_slice_new0 (RygelLmsCategoryContainerRemoveChildData);
-+ _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_lms_category_container_real_remove_child);
-+ g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_lms_category_container_real_remove_child_data_free);
-+ _tmp0_ = _g_object_ref0 (self);
-+ _data_->self = _tmp0_;
-+ _tmp1_ = object;
-+ _tmp2_ = _g_object_ref0 (_tmp1_);
-+ _g_object_unref0 (_data_->object);
-+ _data_->object = _tmp2_;
-+ rygel_lms_category_container_real_remove_child_co (_data_);
-+}
-+
-+
-+static void rygel_lms_category_container_real_remove_child_finish (RygelTrackableContainer* base, GAsyncResult* _res_) {
-+ RygelLmsCategoryContainerRemoveChildData* _data_;
-+ _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
-+}
-+
-+
-+static gboolean rygel_lms_category_container_real_remove_child_co (RygelLmsCategoryContainerRemoveChildData* _data_) {
-+ switch (_data_->_state_) {
-+ case 0:
-+ goto _state_0;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+ _state_0:
-+ if (_data_->_state_ == 0) {
-+ g_simple_async_result_complete_in_idle (_data_->_async_result);
-+ } else {
-+ g_simple_async_result_complete (_data_->_async_result);
-+ }
-+ g_object_unref (_data_->_async_result);
-+ return FALSE;
-+}
-+
-+
-+static void rygel_lms_category_container_on_db_updated (RygelLMSCategoryContainer* self, guint64 old_id, guint64 new_id) {
-+ GError * _inner_error_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ {
-+ sqlite3_stmt* stmt_count = NULL;
-+ RygelLMSDatabase* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ sqlite3_stmt* _tmp3_ = NULL;
-+ gint _tmp4_ = 0;
-+ sqlite3_stmt* _tmp7_ = NULL;
-+ guint64 _tmp8_ = 0ULL;
-+ guint64 _tmp9_ = 0ULL;
-+ sqlite3_stmt* _tmp16_ = NULL;
-+ guint64 _tmp17_ = 0ULL;
-+ guint64 _tmp18_ = 0ULL;
-+ _tmp0_ = self->priv->_lms_db;
-+ _tmp1_ = self->priv->_sql_count;
-+ _tmp2_ = rygel_lms_database_prepare (_tmp0_, _tmp1_, &_inner_error_);
-+ stmt_count = _tmp2_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch6_rygel_lms_database_error;
-+ }
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ _tmp3_ = stmt_count;
-+ _tmp4_ = sqlite3_step (_tmp3_);
-+ if (_tmp4_ == SQLITE_ROW) {
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ gint _tmp6_ = 0;
-+ _tmp5_ = stmt_count;
-+ _tmp6_ = sqlite3_column_int (_tmp5_, 0);
-+ rygel_media_container_set_child_count ((RygelMediaContainer*) self, _tmp6_);
-+ }
-+ _tmp7_ = self->stmt_added;
-+ _tmp8_ = old_id;
-+ _tmp9_ = new_id;
-+ rygel_lms_database_get_children_with_update_id_init (_tmp7_, _tmp8_, _tmp9_, &_inner_error_);
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt_count);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch6_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ while (TRUE) {
-+ gboolean _tmp10_ = FALSE;
-+ sqlite3_stmt* _tmp11_ = NULL;
-+ gboolean _tmp12_ = FALSE;
-+ sqlite3_stmt* _tmp13_ = NULL;
-+ RygelMediaObject* _tmp14_ = NULL;
-+ RygelMediaObject* _tmp15_ = NULL;
-+ _tmp11_ = self->stmt_added;
-+ _tmp12_ = rygel_lms_database_get_children_step (_tmp11_, &_inner_error_);
-+ _tmp10_ = _tmp12_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt_count);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch6_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ if (!_tmp10_) {
-+ break;
-+ }
-+ _tmp13_ = self->stmt_added;
-+ _tmp14_ = rygel_lms_category_container_object_from_statement (self, _tmp13_);
-+ _tmp15_ = _tmp14_;
-+ rygel_trackable_container_add_child_tracked ((RygelTrackableContainer*) self, _tmp15_, NULL, NULL);
-+ _g_object_unref0 (_tmp15_);
-+ }
-+ _tmp16_ = self->stmt_removed;
-+ _tmp17_ = old_id;
-+ _tmp18_ = new_id;
-+ rygel_lms_database_get_children_with_update_id_init (_tmp16_, _tmp17_, _tmp18_, &_inner_error_);
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt_count);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch6_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ while (TRUE) {
-+ gboolean _tmp19_ = FALSE;
-+ sqlite3_stmt* _tmp20_ = NULL;
-+ gboolean _tmp21_ = FALSE;
-+ sqlite3_stmt* _tmp22_ = NULL;
-+ RygelMediaObject* _tmp23_ = NULL;
-+ RygelMediaObject* _tmp24_ = NULL;
-+ _tmp20_ = self->stmt_removed;
-+ _tmp21_ = rygel_lms_database_get_children_step (_tmp20_, &_inner_error_);
-+ _tmp19_ = _tmp21_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt_count);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch6_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ if (!_tmp19_) {
-+ break;
-+ }
-+ _tmp22_ = self->stmt_removed;
-+ _tmp23_ = rygel_lms_category_container_object_from_statement (self, _tmp22_);
-+ _tmp24_ = _tmp23_;
-+ rygel_trackable_container_remove_child_tracked ((RygelTrackableContainer*) self, _tmp24_, NULL, NULL);
-+ _g_object_unref0 (_tmp24_);
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ }
-+ goto __finally6;
-+ __catch6_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp25_ = NULL;
-+ const gchar* _tmp26_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp25_ = e;
-+ _tmp26_ = _tmp25_->message;
-+ g_warning ("rygel-lms-category-container.vala:372: Can't perform container update:" \
-+" %s", _tmp26_);
-+ _g_error_free0 (e);
-+ }
-+ __finally6:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+}
-+
-+
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed) {
-+ RygelLMSCategoryContainer * self = NULL;
-+ RygelMediaContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ RygelMediaContainer* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ RygelLMSDatabase* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ const gchar* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ const gchar* _tmp13_ = NULL;
-+ const gchar* _tmp14_ = NULL;
-+ g_return_val_if_fail (db_id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ g_return_val_if_fail (sql_all != NULL, NULL);
-+ g_return_val_if_fail (sql_find_object != NULL, NULL);
-+ g_return_val_if_fail (sql_count != NULL, NULL);
-+ _tmp0_ = parent;
-+ _tmp1_ = rygel_media_object_get_id ((RygelMediaObject*) _tmp0_);
-+ _tmp2_ = _tmp1_;
-+ _tmp3_ = db_id;
-+ _tmp4_ = g_strdup_printf ("%s:%s", _tmp2_, _tmp3_);
-+ _tmp5_ = _tmp4_;
-+ _tmp6_ = db_id;
-+ _tmp7_ = parent;
-+ _tmp8_ = title;
-+ _tmp9_ = lms_db;
-+ _tmp10_ = sql_all;
-+ _tmp11_ = sql_find_object;
-+ _tmp12_ = sql_count;
-+ _tmp13_ = sql_added;
-+ _tmp14_ = sql_removed;
-+ self = (RygelLMSCategoryContainer*) g_object_new (object_type, "id", _tmp5_, "db-id", _tmp6_, "parent", _tmp7_, "title", _tmp8_, "lms-db", _tmp9_, "sql-all", _tmp10_, "sql-find-object", _tmp11_, "sql-count", _tmp12_, "sql-added", _tmp13_, "sql-removed", _tmp14_, NULL);
-+ _g_free0 (_tmp5_);
-+ return self;
-+}
-+
-+
-+static GeeArrayList* rygel_lms_category_container_real_get_search_classes (RygelSearchableContainer* base) {
-+ GeeArrayList* result;
-+ RygelLMSCategoryContainer* self;
-+ GeeArrayList* _tmp0_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _tmp0_ = self->priv->_search_classes;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_real_set_search_classes (RygelSearchableContainer* base, GeeArrayList* value) {
-+ RygelLMSCategoryContainer* self;
-+ GeeArrayList* _tmp0_ = NULL;
-+ GeeArrayList* _tmp1_ = NULL;
-+ self = (RygelLMSCategoryContainer*) base;
-+ _tmp0_ = value;
-+ _tmp1_ = _g_object_ref0 (_tmp0_);
-+ _g_object_unref0 (self->priv->_search_classes);
-+ self->priv->_search_classes = _tmp1_;
-+ g_object_notify ((GObject *) self, "search-classes");
-+}
-+
-+
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self) {
-+ RygelLMSDatabase* result;
-+ RygelLMSDatabase* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_lms_db;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_lms_db (RygelLMSCategoryContainer* self, RygelLMSDatabase* value) {
-+ RygelLMSDatabase* _tmp0_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ self->priv->_lms_db = _tmp0_;
-+ g_object_notify ((GObject *) self, "lms-db");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_db_id (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_db_id;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_db_id (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_db_id);
-+ self->priv->_db_id = _tmp1_;
-+ g_object_notify ((GObject *) self, "db-id");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_sql_all (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_all;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_sql_all (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_sql_all);
-+ self->priv->_sql_all = _tmp1_;
-+ g_object_notify ((GObject *) self, "sql-all");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_sql_find_object (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_find_object;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_sql_find_object (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_sql_find_object);
-+ self->priv->_sql_find_object = _tmp1_;
-+ g_object_notify ((GObject *) self, "sql-find-object");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_sql_count (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_count;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_sql_count (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_sql_count);
-+ self->priv->_sql_count = _tmp1_;
-+ g_object_notify ((GObject *) self, "sql-count");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_sql_added (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_added;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_sql_added (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_sql_added);
-+ self->priv->_sql_added = _tmp1_;
-+ g_object_notify ((GObject *) self, "sql-added");
-+}
-+
-+
-+const gchar* rygel_lms_category_container_get_sql_removed (RygelLMSCategoryContainer* self) {
-+ const gchar* result;
-+ const gchar* _tmp0_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ _tmp0_ = self->priv->_sql_removed;
-+ result = _tmp0_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_category_container_set_sql_removed (RygelLMSCategoryContainer* self, const gchar* value) {
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_if_fail (self != NULL);
-+ _tmp0_ = value;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->priv->_sql_removed);
-+ self->priv->_sql_removed = _tmp1_;
-+ g_object_notify ((GObject *) self, "sql-removed");
-+}
-+
-+
-+static void _rygel_lms_category_container_on_db_updated_rygel_lms_database_db_updated (RygelLMSDatabase* _sender, guint64 old_update_id, guint64 new_update_id, gpointer self) {
-+ rygel_lms_category_container_on_db_updated ((RygelLMSCategoryContainer*) self, old_update_id, new_update_id);
-+}
-+
-+
-+static GObject * rygel_lms_category_container_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
-+ GObject * obj;
-+ GObjectClass * parent_class;
-+ RygelLMSCategoryContainer * self;
-+ GeeArrayList* _tmp0_ = NULL;
-+ GeeArrayList* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gint index = 0;
-+ const gchar* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gint _tmp7_ = 0;
-+ const gchar* _tmp8_ = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ gint _tmp10_ = 0;
-+ gchar* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ parent_class = G_OBJECT_CLASS (rygel_lms_category_container_parent_class);
-+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer);
-+ _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
-+ _tmp1_ = _tmp0_;
-+ rygel_searchable_container_set_search_classes ((RygelSearchableContainer*) self, _tmp1_);
-+ _g_object_unref0 (_tmp1_);
-+ _tmp2_ = rygel_media_object_get_id ((RygelMediaObject*) self);
-+ _tmp3_ = _tmp2_;
-+ _tmp4_ = g_strdup_printf ("%s:", _tmp3_);
-+ _g_free0 (self->child_prefix);
-+ self->child_prefix = _tmp4_;
-+ _tmp5_ = rygel_media_object_get_id ((RygelMediaObject*) self);
-+ _tmp6_ = _tmp5_;
-+ _tmp7_ = string_index_of_char (_tmp6_, (gunichar) ':', 0);
-+ index = _tmp7_;
-+ _tmp8_ = rygel_media_object_get_id ((RygelMediaObject*) self);
-+ _tmp9_ = _tmp8_;
-+ _tmp10_ = index;
-+ _tmp11_ = string_slice (_tmp9_, (glong) 0, (glong) _tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp13_ = g_strconcat (_tmp12_, ":all:", NULL);
-+ _g_free0 (self->ref_prefix);
-+ self->ref_prefix = _tmp13_;
-+ _g_free0 (_tmp12_);
-+ {
-+ sqlite3_stmt* _tmp14_ = NULL;
-+ RygelLMSDatabase* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ sqlite3_stmt* _tmp17_ = NULL;
-+ sqlite3_stmt* _tmp18_ = NULL;
-+ sqlite3_stmt* _tmp19_ = NULL;
-+ RygelLMSDatabase* _tmp20_ = NULL;
-+ const gchar* _tmp21_ = NULL;
-+ sqlite3_stmt* _tmp22_ = NULL;
-+ sqlite3_stmt* _tmp23_ = NULL;
-+ sqlite3_stmt* stmt_count = NULL;
-+ RygelLMSDatabase* _tmp24_ = NULL;
-+ const gchar* _tmp25_ = NULL;
-+ sqlite3_stmt* _tmp26_ = NULL;
-+ sqlite3_stmt* _tmp27_ = NULL;
-+ gint _tmp28_ = 0;
-+ gboolean _tmp31_ = FALSE;
-+ const gchar* _tmp32_ = NULL;
-+ _tmp15_ = self->priv->_lms_db;
-+ _tmp16_ = self->priv->_sql_all;
-+ _tmp17_ = rygel_lms_database_prepare (_tmp15_, _tmp16_, &_inner_error_);
-+ _tmp14_ = _tmp17_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch7_rygel_lms_database_error;
-+ }
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ _tmp18_ = _tmp14_;
-+ _tmp14_ = NULL;
-+ _sqlite3_finalize0 (self->stmt_all);
-+ self->stmt_all = _tmp18_;
-+ _tmp20_ = self->priv->_lms_db;
-+ _tmp21_ = self->priv->_sql_find_object;
-+ _tmp22_ = rygel_lms_database_prepare (_tmp20_, _tmp21_, &_inner_error_);
-+ _tmp19_ = _tmp22_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (_tmp14_);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch7_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (_tmp14_);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ _tmp23_ = _tmp19_;
-+ _tmp19_ = NULL;
-+ _sqlite3_finalize0 (self->stmt_find_object);
-+ self->stmt_find_object = _tmp23_;
-+ _tmp24_ = self->priv->_lms_db;
-+ _tmp25_ = self->priv->_sql_count;
-+ _tmp26_ = rygel_lms_database_prepare (_tmp24_, _tmp25_, &_inner_error_);
-+ stmt_count = _tmp26_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch7_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ _tmp27_ = stmt_count;
-+ _tmp28_ = sqlite3_step (_tmp27_);
-+ if (_tmp28_ == SQLITE_ROW) {
-+ sqlite3_stmt* _tmp29_ = NULL;
-+ gint _tmp30_ = 0;
-+ _tmp29_ = stmt_count;
-+ _tmp30_ = sqlite3_column_int (_tmp29_, 0);
-+ rygel_media_container_set_child_count ((RygelMediaContainer*) self, _tmp30_);
-+ }
-+ _tmp32_ = self->priv->_sql_added;
-+ if (_tmp32_ != NULL) {
-+ const gchar* _tmp33_ = NULL;
-+ _tmp33_ = self->priv->_sql_removed;
-+ _tmp31_ = _tmp33_ != NULL;
-+ } else {
-+ _tmp31_ = FALSE;
-+ }
-+ if (_tmp31_) {
-+ sqlite3_stmt* _tmp34_ = NULL;
-+ RygelLMSDatabase* _tmp35_ = NULL;
-+ const gchar* _tmp36_ = NULL;
-+ sqlite3_stmt* _tmp37_ = NULL;
-+ sqlite3_stmt* _tmp38_ = NULL;
-+ sqlite3_stmt* _tmp39_ = NULL;
-+ RygelLMSDatabase* _tmp40_ = NULL;
-+ const gchar* _tmp41_ = NULL;
-+ sqlite3_stmt* _tmp42_ = NULL;
-+ sqlite3_stmt* _tmp43_ = NULL;
-+ RygelLMSDatabase* _tmp44_ = NULL;
-+ _tmp35_ = self->priv->_lms_db;
-+ _tmp36_ = self->priv->_sql_added;
-+ _tmp37_ = rygel_lms_database_prepare (_tmp35_, _tmp36_, &_inner_error_);
-+ _tmp34_ = _tmp37_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (stmt_count);
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch7_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ _tmp38_ = _tmp34_;
-+ _tmp34_ = NULL;
-+ _sqlite3_finalize0 (self->stmt_added);
-+ self->stmt_added = _tmp38_;
-+ _tmp40_ = self->priv->_lms_db;
-+ _tmp41_ = self->priv->_sql_removed;
-+ _tmp42_ = rygel_lms_database_prepare (_tmp40_, _tmp41_, &_inner_error_);
-+ _tmp39_ = _tmp42_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _sqlite3_finalize0 (_tmp34_);
-+ _sqlite3_finalize0 (stmt_count);
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch7_rygel_lms_database_error;
-+ }
-+ _sqlite3_finalize0 (_tmp34_);
-+ _sqlite3_finalize0 (stmt_count);
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ _tmp43_ = _tmp39_;
-+ _tmp39_ = NULL;
-+ _sqlite3_finalize0 (self->stmt_removed);
-+ self->stmt_removed = _tmp43_;
-+ _tmp44_ = self->priv->_lms_db;
-+ g_signal_connect_object (_tmp44_, "db-updated", (GCallback) _rygel_lms_category_container_on_db_updated_rygel_lms_database_db_updated, self, 0);
-+ _sqlite3_finalize0 (_tmp39_);
-+ _sqlite3_finalize0 (_tmp34_);
-+ }
-+ _sqlite3_finalize0 (stmt_count);
-+ _sqlite3_finalize0 (_tmp19_);
-+ _sqlite3_finalize0 (_tmp14_);
-+ }
-+ goto __finally7;
-+ __catch7_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ const gchar* _tmp45_ = NULL;
-+ const gchar* _tmp46_ = NULL;
-+ GError* _tmp47_ = NULL;
-+ const gchar* _tmp48_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp45_ = rygel_media_object_get_title ((RygelMediaObject*) self);
-+ _tmp46_ = _tmp45_;
-+ _tmp47_ = e;
-+ _tmp48_ = _tmp47_->message;
-+ g_warning ("rygel-lms-category-container.vala:424: Container %s: %s", _tmp46_, _tmp48_);
-+ _g_error_free0 (e);
-+ }
-+ __finally7:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ }
-+ return obj;
-+}
-+
-+
-+static void rygel_lms_category_container_class_init (RygelLMSCategoryContainerClass * klass) {
-+ rygel_lms_category_container_parent_class = g_type_class_peek_parent (klass);
-+ g_type_class_add_private (klass, sizeof (RygelLMSCategoryContainerPrivate));
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_category_container_real_object_from_statement;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_all_with_filter = rygel_lms_category_container_real_get_sql_all_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_sql_count_with_filter = rygel_lms_category_container_real_get_sql_count_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_child_count_with_filter = rygel_lms_category_container_real_get_child_count_with_filter;
-+ ((RygelLMSCategoryContainerClass *) klass)->get_children_with_filter = rygel_lms_category_container_real_get_children_with_filter;
-+ ((RygelMediaContainerClass *) klass)->get_children = rygel_lms_category_container_real_get_children;
-+ ((RygelMediaContainerClass *) klass)->get_children_finish = rygel_lms_category_container_real_get_children_finish;
-+ ((RygelMediaContainerClass *) klass)->find_object = rygel_lms_category_container_real_find_object;
-+ ((RygelMediaContainerClass *) klass)->find_object_finish = rygel_lms_category_container_real_find_object_finish;
-+ G_OBJECT_CLASS (klass)->get_property = _vala_rygel_lms_category_container_get_property;
-+ G_OBJECT_CLASS (klass)->set_property = _vala_rygel_lms_category_container_set_property;
-+ G_OBJECT_CLASS (klass)->constructor = rygel_lms_category_container_constructor;
-+ G_OBJECT_CLASS (klass)->finalize = rygel_lms_category_container_finalize;
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SEARCH_CLASSES, g_param_spec_object ("search-classes", "search-classes", "search-classes", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_LMS_DB, rygel_lms_param_spec_database ("lms-db", "lms-db", "lms-db", RYGEL_LMS_TYPE_DATABASE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_DB_ID, g_param_spec_string ("db-id", "db-id", "db-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SQL_ALL, g_param_spec_string ("sql-all", "sql-all", "sql-all", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SQL_FIND_OBJECT, g_param_spec_string ("sql-find-object", "sql-find-object", "sql-find-object", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SQL_COUNT, g_param_spec_string ("sql-count", "sql-count", "sql-count", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SQL_ADDED, g_param_spec_string ("sql-added", "sql-added", "sql-added", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+ g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_LMS_CATEGORY_CONTAINER_SQL_REMOVED, g_param_spec_string ("sql-removed", "sql-removed", "sql-removed", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
-+}
-+
-+
-+static void rygel_lms_category_container_rygel_trackable_container_interface_init (RygelTrackableContainerIface * iface) {
-+ rygel_lms_category_container_rygel_trackable_container_parent_iface = g_type_interface_peek_parent (iface);
-+ iface->add_child = (void (*)(RygelTrackableContainer*, RygelMediaObject*)) rygel_lms_category_container_real_add_child;
-+ iface->add_child_finish = rygel_lms_category_container_real_add_child_finish;
-+ iface->remove_child = (void (*)(RygelTrackableContainer*, RygelMediaObject*)) rygel_lms_category_container_real_remove_child;
-+ iface->remove_child_finish = rygel_lms_category_container_real_remove_child_finish;
-+}
-+
-+
-+static void rygel_lms_category_container_rygel_searchable_container_interface_init (RygelSearchableContainerIface * iface) {
-+ rygel_lms_category_container_rygel_searchable_container_parent_iface = g_type_interface_peek_parent (iface);
-+ iface->search = (RygelMediaObjects* (*)(RygelSearchableContainer*, RygelSearchExpression*, guint, guint, guint*, const gchar*, GCancellable*, GError**)) rygel_lms_category_container_real_search;
-+ iface->search_finish = rygel_lms_category_container_real_search_finish;
-+ iface->get_search_classes = rygel_lms_category_container_real_get_search_classes;
-+ iface->set_search_classes = rygel_lms_category_container_real_set_search_classes;
-+}
-+
-+
-+static void rygel_lms_category_container_instance_init (RygelLMSCategoryContainer * self) {
-+ self->priv = RYGEL_LMS_CATEGORY_CONTAINER_GET_PRIVATE (self);
-+}
-+
-+
-+static void rygel_lms_category_container_finalize (GObject* obj) {
-+ RygelLMSCategoryContainer * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer);
-+ _g_object_unref0 (self->priv->_search_classes);
-+ _g_free0 (self->priv->_db_id);
-+ _g_free0 (self->priv->_sql_all);
-+ _g_free0 (self->priv->_sql_find_object);
-+ _g_free0 (self->priv->_sql_count);
-+ _g_free0 (self->priv->_sql_added);
-+ _g_free0 (self->priv->_sql_removed);
-+ _sqlite3_finalize0 (self->stmt_all);
-+ _sqlite3_finalize0 (self->stmt_find_object);
-+ _sqlite3_finalize0 (self->stmt_added);
-+ _sqlite3_finalize0 (self->stmt_removed);
-+ _g_free0 (self->child_prefix);
-+ _g_free0 (self->ref_prefix);
-+ G_OBJECT_CLASS (rygel_lms_category_container_parent_class)->finalize (obj);
-+}
-+
-+
-+GType rygel_lms_category_container_get_type (void) {
-+ static volatile gsize rygel_lms_category_container_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_category_container_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSCategoryContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_category_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSCategoryContainer), 0, (GInstanceInitFunc) rygel_lms_category_container_instance_init, NULL };
-+ static const GInterfaceInfo rygel_trackable_container_info = { (GInterfaceInitFunc) rygel_lms_category_container_rygel_trackable_container_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
-+ static const GInterfaceInfo rygel_searchable_container_info = { (GInterfaceInitFunc) rygel_lms_category_container_rygel_searchable_container_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
-+ GType rygel_lms_category_container_type_id;
-+ rygel_lms_category_container_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_CONTAINER, "RygelLMSCategoryContainer", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
-+ g_type_add_interface_static (rygel_lms_category_container_type_id, RYGEL_TYPE_TRACKABLE_CONTAINER, &rygel_trackable_container_info);
-+ g_type_add_interface_static (rygel_lms_category_container_type_id, RYGEL_TYPE_SEARCHABLE_CONTAINER, &rygel_searchable_container_info);
-+ g_once_init_leave (&rygel_lms_category_container_type_id__volatile, rygel_lms_category_container_type_id);
-+ }
-+ return rygel_lms_category_container_type_id__volatile;
-+}
-+
-+
-+static void _vala_rygel_lms_category_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
-+ RygelLMSCategoryContainer * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer);
-+ switch (property_id) {
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SEARCH_CLASSES:
-+ g_value_set_object (value, rygel_searchable_container_get_search_classes ((RygelSearchableContainer*) self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_LMS_DB:
-+ rygel_lms_value_set_database (value, rygel_lms_category_container_get_lms_db (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_DB_ID:
-+ g_value_set_string (value, rygel_lms_category_container_get_db_id (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_ALL:
-+ g_value_set_string (value, rygel_lms_category_container_get_sql_all (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_FIND_OBJECT:
-+ g_value_set_string (value, rygel_lms_category_container_get_sql_find_object (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_COUNT:
-+ g_value_set_string (value, rygel_lms_category_container_get_sql_count (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_ADDED:
-+ g_value_set_string (value, rygel_lms_category_container_get_sql_added (self));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_REMOVED:
-+ g_value_set_string (value, rygel_lms_category_container_get_sql_removed (self));
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-+ break;
-+ }
-+}
-+
-+
-+static void _vala_rygel_lms_category_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
-+ RygelLMSCategoryContainer * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer);
-+ switch (property_id) {
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SEARCH_CLASSES:
-+ rygel_searchable_container_set_search_classes ((RygelSearchableContainer*) self, g_value_get_object (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_LMS_DB:
-+ rygel_lms_category_container_set_lms_db (self, rygel_lms_value_get_database (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_DB_ID:
-+ rygel_lms_category_container_set_db_id (self, g_value_get_string (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_ALL:
-+ rygel_lms_category_container_set_sql_all (self, g_value_get_string (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_FIND_OBJECT:
-+ rygel_lms_category_container_set_sql_find_object (self, g_value_get_string (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_COUNT:
-+ rygel_lms_category_container_set_sql_count (self, g_value_get_string (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_ADDED:
-+ rygel_lms_category_container_set_sql_added (self, g_value_get_string (value));
-+ break;
-+ case RYGEL_LMS_CATEGORY_CONTAINER_SQL_REMOVED:
-+ rygel_lms_category_container_set_sql_removed (self, g_value_get_string (value));
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-+ break;
-+ }
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-database.c b/src/plugins/lms/rygel-lms-database.c
-new file mode 100644
-index 0000000..687ef64
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-database.c
-@@ -0,0 +1,1349 @@
-+/* rygel-lms-database.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-database.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2009,2011 Jens Georg <mail@jensge.org>,
-+ * (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <sqlite3.h>
-+#include <gio/gio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <glib/gi18n-lib.h>
-+#include <gobject/gvaluecollector.h>
-+
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+typedef struct _RygelLMSDatabasePrivate RygelLMSDatabasePrivate;
-+
-+#define RYGEL_LMS_TYPE_DBUS (rygel_lms_dbus_get_type ())
-+#define RYGEL_LMS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DBUS, RygelLMSDBus))
-+#define RYGEL_LMS_IS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DBUS))
-+#define RYGEL_LMS_DBUS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_LMS_TYPE_DBUS, RygelLMSDBusIface))
-+
-+typedef struct _RygelLMSDBus RygelLMSDBus;
-+typedef struct _RygelLMSDBusIface RygelLMSDBusIface;
-+
-+#define RYGEL_LMS_TYPE_DBUS_PROXY (rygel_lms_dbus_proxy_get_type ())
-+#define _sqlite3_close0(var) ((var == NULL) ? NULL : (var = (sqlite3_close (var), NULL)))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-+#define _rygel_lms_database_unref0(var) ((var == NULL) ? NULL : (var = (rygel_lms_database_unref (var), NULL)))
-+#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
-+#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
-+#define _sqlite3_finalize0(var) ((var == NULL) ? NULL : (var = (sqlite3_finalize (var), NULL)))
-+typedef struct _RygelLMSParamSpecDatabase RygelLMSParamSpecDatabase;
-+#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
-+#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
-+#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
-+#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
-+
-+typedef enum {
-+ RYGEL_LMS_DATABASE_ERROR_OPEN,
-+ RYGEL_LMS_DATABASE_ERROR_PREPARE,
-+ RYGEL_LMS_DATABASE_ERROR_BIND,
-+ RYGEL_LMS_DATABASE_ERROR_STEP,
-+ RYGEL_LMS_DATABASE_ERROR_NOT_FOUND
-+} RygelLMSDatabaseError;
-+#define RYGEL_LMS_DATABASE_ERROR rygel_lms_database_error_quark ()
-+struct _RygelLMSDatabase {
-+ GTypeInstance parent_instance;
-+ volatile int ref_count;
-+ RygelLMSDatabasePrivate * priv;
-+};
-+
-+struct _RygelLMSDatabaseClass {
-+ GTypeClass parent_class;
-+ void (*finalize) (RygelLMSDatabase *self);
-+};
-+
-+struct _RygelLMSDBusIface {
-+ GTypeInterface parent_iface;
-+ gchar* (*get_data_base_path) (RygelLMSDBus* self);
-+ guint64 (*get_update_id) (RygelLMSDBus* self);
-+};
-+
-+struct _RygelLMSDatabasePrivate {
-+ sqlite3* db;
-+ RygelLMSDBus* lms_proxy;
-+ guint64 update_id;
-+};
-+
-+struct _RygelLMSParamSpecDatabase {
-+ GParamSpec parent_instance;
-+};
-+
-+
-+static gpointer rygel_lms_database_parent_class = NULL;
-+
-+GQuark rygel_lms_database_error_quark (void);
-+gint rygel_lms_utf8_collate_str (guint8* a, int a_length1, guint8* b, int b_length1);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_dbus_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_dbus_proxy_get_type (void) G_GNUC_CONST;
-+guint rygel_lms_dbus_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
-+#define RYGEL_LMS_DATABASE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabasePrivate))
-+enum {
-+ RYGEL_LMS_DATABASE_DUMMY_PROPERTY
-+};
-+static void rygel_lms_database_utf8_contains (sqlite3_context* context, sqlite3_value** args, int args_length1);
-+static gint rygel_lms_database_utf8_collate (gint alen, void* a, gint blen, void* b);
-+RygelLMSDatabase* rygel_lms_database_new (GError** error);
-+RygelLMSDatabase* rygel_lms_database_construct (GType object_type, GError** error);
-+gchar* rygel_lms_dbus_get_data_base_path (RygelLMSDBus* self);
-+guint64 rygel_lms_dbus_get_update_id (RygelLMSDBus* self);
-+static void rygel_lms_database_on_lms_properties_changed (RygelLMSDatabase* self, GDBusProxy* lms_proxy, GVariant* changed, gchar** invalidated, int invalidated_length1);
-+static void _rygel_lms_database_on_lms_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender, GVariant* changed_properties, gchar** invalidated_properties, gpointer self);
-+static void _rygel_lms_database_utf8_contains_sqlite_user_func_callback (sqlite3_context* context, int values_length1, sqlite3_value** values);
-+static gint _rygel_lms_database_utf8_collate_sqlite_compare_callback (gpointer self, gint alen, void* a, gint blen, void* b);
-+static gchar* _variant_get1 (GVariant* value);
-+static guint64 _variant_get2 (GVariant* value);
-+static guint64 _variant_get3 (GVariant* value);
-+sqlite3_stmt* rygel_lms_database_prepare (RygelLMSDatabase* self, const gchar* query_string, GError** error);
-+sqlite3_stmt* rygel_lms_database_prepare_and_init (RygelLMSDatabase* self, const gchar* query, GValue* arguments, int arguments_length1, GError** error);
-+void rygel_lms_database_find_object (const gchar* id, sqlite3_stmt* stmt, GError** error);
-+void rygel_lms_database_get_children_init (sqlite3_stmt* stmt, guint offset, guint max_count, const gchar* sort_criteria, GError** error);
-+void rygel_lms_database_get_children_with_update_id_init (sqlite3_stmt* stmt, guint64 old_id, guint64 new_id, GError** error);
-+gboolean rygel_lms_database_get_children_step (sqlite3_stmt* stmt, GError** error);
-+static void g_cclosure_user_marshal_VOID__UINT64_UINT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
-+static void rygel_lms_database_finalize (RygelLMSDatabase* obj);
-+static gint _vala_array_length (gpointer array);
-+
-+
-+GQuark rygel_lms_database_error_quark (void) {
-+ return g_quark_from_static_string ("rygel_lms_database_error-quark");
-+}
-+
-+
-+/**
-+ * Function to implement the custom SQL function 'contains'
-+ */
-+static void rygel_lms_database_utf8_contains (sqlite3_context* context, sqlite3_value** args, int args_length1) {
-+ sqlite3_value** _tmp0_ = NULL;
-+ gint _tmp0__length1 = 0;
-+ gboolean _tmp1_ = FALSE;
-+ sqlite3_value** _tmp2_ = NULL;
-+ gint _tmp2__length1 = 0;
-+ sqlite3_value* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* pattern = NULL;
-+ sqlite3_value** _tmp9_ = NULL;
-+ gint _tmp9__length1 = 0;
-+ sqlite3_value* _tmp10_ = NULL;
-+ const gchar* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ const gchar* _tmp13_ = NULL;
-+ sqlite3_value** _tmp14_ = NULL;
-+ gint _tmp14__length1 = 0;
-+ sqlite3_value* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gboolean _tmp17_ = FALSE;
-+ g_return_if_fail (context != NULL);
-+ _tmp0_ = args;
-+ _tmp0__length1 = args_length1;
-+ _vala_return_if_fail (_tmp0__length1 == 2, "args.length == 2");
-+ _tmp2_ = args;
-+ _tmp2__length1 = args_length1;
-+ _tmp3_ = _tmp2_[0];
-+ _tmp4_ = sqlite3_value_text (_tmp3_);
-+ if (_tmp4_ == NULL) {
-+ _tmp1_ = TRUE;
-+ } else {
-+ sqlite3_value** _tmp5_ = NULL;
-+ gint _tmp5__length1 = 0;
-+ sqlite3_value* _tmp6_ = NULL;
-+ const gchar* _tmp7_ = NULL;
-+ _tmp5_ = args;
-+ _tmp5__length1 = args_length1;
-+ _tmp6_ = _tmp5_[1];
-+ _tmp7_ = sqlite3_value_text (_tmp6_);
-+ _tmp1_ = _tmp7_ == NULL;
-+ }
-+ if (_tmp1_) {
-+ sqlite3_context* _tmp8_ = NULL;
-+ _tmp8_ = context;
-+ sqlite3_result_int (_tmp8_, 0);
-+ return;
-+ }
-+ _tmp9_ = args;
-+ _tmp9__length1 = args_length1;
-+ _tmp10_ = _tmp9_[1];
-+ _tmp11_ = sqlite3_value_text (_tmp10_);
-+ _tmp12_ = g_regex_escape_string (_tmp11_, -1);
-+ pattern = _tmp12_;
-+ _tmp13_ = pattern;
-+ _tmp14_ = args;
-+ _tmp14__length1 = args_length1;
-+ _tmp15_ = _tmp14_[0];
-+ _tmp16_ = sqlite3_value_text (_tmp15_);
-+ _tmp17_ = g_regex_match_simple (_tmp13_, _tmp16_, G_REGEX_CASELESS, 0);
-+ if (_tmp17_) {
-+ sqlite3_context* _tmp18_ = NULL;
-+ _tmp18_ = context;
-+ sqlite3_result_int (_tmp18_, 1);
-+ } else {
-+ sqlite3_context* _tmp19_ = NULL;
-+ _tmp19_ = context;
-+ sqlite3_result_int (_tmp19_, 0);
-+ }
-+ _g_free0 (pattern);
-+}
-+
-+
-+/**
-+ * Function to implement the custom SQLite collation 'CASEFOLD'.
-+ *
-+ * Uses utf8 case-fold to compare the strings.
-+ */
-+static gint rygel_lms_database_utf8_collate (gint alen, void* a, gint blen, void* b) {
-+ gint result = 0;
-+ guint8* _a = NULL;
-+ void* _tmp0_ = NULL;
-+ gint _a_length1 = 0;
-+ gint __a_size_ = 0;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ guint8* _b = NULL;
-+ void* _tmp3_ = NULL;
-+ gint _b_length1 = 0;
-+ gint __b_size_ = 0;
-+ gint _tmp4_ = 0;
-+ gint _tmp5_ = 0;
-+ gint _tmp6_ = 0;
-+ _tmp0_ = a;
-+ _a = (guint8*) _tmp0_;
-+ _a_length1 = -1;
-+ __a_size_ = _a_length1;
-+ _tmp1_ = alen;
-+ _a_length1 = _tmp1_;
-+ _tmp2_ = _a_length1;
-+ _tmp3_ = b;
-+ _b = (guint8*) _tmp3_;
-+ _b_length1 = -1;
-+ __b_size_ = _b_length1;
-+ _tmp4_ = blen;
-+ _b_length1 = _tmp4_;
-+ _tmp5_ = _b_length1;
-+ _tmp6_ = rygel_lms_utf8_collate_str (_a, _a_length1, _b, _b_length1);
-+ result = _tmp6_;
-+ return result;
-+}
-+
-+
-+static void _rygel_lms_database_on_lms_properties_changed_g_dbus_proxy_g_properties_changed (GDBusProxy* _sender, GVariant* changed_properties, gchar** invalidated_properties, gpointer self) {
-+ rygel_lms_database_on_lms_properties_changed ((RygelLMSDatabase*) self, _sender, changed_properties, invalidated_properties, _vala_array_length (invalidated_properties));
-+}
-+
-+
-+static void _rygel_lms_database_utf8_contains_sqlite_user_func_callback (sqlite3_context* context, int values_length1, sqlite3_value** values) {
-+ rygel_lms_database_utf8_contains (context, values, values_length1);
-+}
-+
-+
-+static gint _rygel_lms_database_utf8_collate_sqlite_compare_callback (gpointer self, gint alen, void* a, gint blen, void* b) {
-+ gint result;
-+ result = rygel_lms_database_utf8_collate (alen, a, blen, b);
-+ return result;
-+}
-+
-+
-+RygelLMSDatabase* rygel_lms_database_construct (GType object_type, GError** error) {
-+ RygelLMSDatabase* self = NULL;
-+ gchar* db_path = NULL;
-+ const gchar* _tmp17_ = NULL;
-+ sqlite3* _tmp18_ = NULL;
-+ sqlite3* _tmp19_ = NULL;
-+ gint _tmp20_ = 0;
-+ sqlite3* _tmp25_ = NULL;
-+ sqlite3* _tmp26_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ self = (RygelLMSDatabase*) g_type_create_instance (object_type);
-+ {
-+ RygelLMSDBus* _tmp0_ = NULL;
-+ RygelLMSDBus* _tmp1_ = NULL;
-+ RygelLMSDBus* _tmp2_ = NULL;
-+ RygelLMSDBus* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ RygelLMSDBus* _tmp7_ = NULL;
-+ guint64 _tmp8_ = 0ULL;
-+ guint64 _tmp9_ = 0ULL;
-+ guint64 _tmp10_ = 0ULL;
-+ RygelLMSDBus* _tmp11_ = NULL;
-+ _tmp1_ = g_initable_new (RYGEL_LMS_TYPE_DBUS_PROXY, NULL, &_inner_error_, "g-flags", 0, "g-name", "org.lightmediascanner", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/lightmediascanner/Scanner1", "g-interface-name", "org.lightmediascanner.Scanner1", "g-interface-info", g_type_get_qdata (RYGEL_LMS_TYPE_DBUS, g_quark_from_static_string ("vala-dbus-interface-info")), NULL);
-+ _tmp0_ = (RygelLMSDBus*) _tmp1_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == G_IO_ERROR) {
-+ goto __catch11_g_io_error;
-+ }
-+ _g_free0 (db_path);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _tmp2_ = _tmp0_;
-+ _tmp0_ = NULL;
-+ _g_object_unref0 (self->priv->lms_proxy);
-+ self->priv->lms_proxy = _tmp2_;
-+ _tmp3_ = self->priv->lms_proxy;
-+ _tmp4_ = rygel_lms_dbus_get_data_base_path (_tmp3_);
-+ _tmp5_ = _tmp4_;
-+ _g_free0 (db_path);
-+ db_path = _tmp5_;
-+ _tmp6_ = db_path;
-+ g_debug ("rygel-lms-database.vala:94: Got db path %s from LMS over dbus", _tmp6_);
-+ _tmp7_ = self->priv->lms_proxy;
-+ _tmp8_ = rygel_lms_dbus_get_update_id (_tmp7_);
-+ _tmp9_ = _tmp8_;
-+ self->priv->update_id = _tmp9_;
-+ _tmp10_ = self->priv->update_id;
-+ g_debug ("rygel-lms-database.vala:96: Got updated id %lld from LMS over dbus", _tmp10_);
-+ _tmp11_ = self->priv->lms_proxy;
-+ g_signal_connect ((GDBusProxy*) _tmp11_, "g-properties-changed", (GCallback) _rygel_lms_database_on_lms_properties_changed_g_dbus_proxy_g_properties_changed, self);
-+ _g_object_unref0 (_tmp0_);
-+ }
-+ goto __finally11;
-+ __catch11_g_io_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp12_ = NULL;
-+ const gchar* _tmp13_ = NULL;
-+ const gchar* _tmp14_ = NULL;
-+ gchar* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp12_ = e;
-+ _tmp13_ = _tmp12_->message;
-+ g_warning ("rygel-lms-database.vala:100: Couldn't get LMS Dbus proxy: %s", _tmp13_);
-+ _tmp14_ = g_get_user_config_dir ();
-+ _tmp15_ = g_strconcat (_tmp14_, "/lightmediascannerd/db.sqlite3", NULL);
-+ _g_free0 (db_path);
-+ db_path = _tmp15_;
-+ _tmp16_ = db_path;
-+ g_debug ("rygel-lms-database.vala:103: Using default sqlite database location %s", _tmp16_);
-+ _g_error_free0 (e);
-+ }
-+ __finally11:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _g_free0 (db_path);
-+ _rygel_lms_database_unref0 (self);
-+ return NULL;
-+ } else {
-+ _g_free0 (db_path);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ _tmp17_ = db_path;
-+ sqlite3_open (_tmp17_, &_tmp18_);
-+ _sqlite3_close0 (self->priv->db);
-+ self->priv->db = _tmp18_;
-+ _tmp19_ = self->priv->db;
-+ _tmp20_ = sqlite3_errcode (_tmp19_);
-+ if (_tmp20_ != SQLITE_OK) {
-+ const gchar* _tmp21_ = NULL;
-+ sqlite3* _tmp22_ = NULL;
-+ gint _tmp23_ = 0;
-+ GError* _tmp24_ = NULL;
-+ _tmp21_ = db_path;
-+ _tmp22_ = self->priv->db;
-+ _tmp23_ = sqlite3_errcode (_tmp22_);
-+ _tmp24_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_OPEN, "Failed to open '%s': %d", _tmp21_, _tmp23_);
-+ _inner_error_ = _tmp24_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _g_free0 (db_path);
-+ _rygel_lms_database_unref0 (self);
-+ return NULL;
-+ } else {
-+ _g_free0 (db_path);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ _tmp25_ = self->priv->db;
-+ sqlite3_create_function (_tmp25_, "contains", 2, SQLITE_UTF8, NULL, _rygel_lms_database_utf8_contains_sqlite_user_func_callback, NULL, NULL);
-+ _tmp26_ = self->priv->db;
-+ sqlite3_create_collation (_tmp26_, "CASEFOLD", SQLITE_UTF8, NULL, (int (*)(void *, int, const void *, int, const void *)) _rygel_lms_database_utf8_collate_sqlite_compare_callback);
-+ _g_free0 (db_path);
-+ return self;
-+}
-+
-+
-+RygelLMSDatabase* rygel_lms_database_new (GError** error) {
-+ return rygel_lms_database_construct (RYGEL_LMS_TYPE_DATABASE, error);
-+}
-+
-+
-+static gchar* _variant_get1 (GVariant* value) {
-+ return g_variant_dup_string (value, NULL);
-+}
-+
-+
-+static guint64 _variant_get2 (GVariant* value) {
-+ return g_variant_get_uint64 (value);
-+}
-+
-+
-+static guint64 _variant_get3 (GVariant* value) {
-+ return g_variant_get_uint64 (value);
-+}
-+
-+
-+static void rygel_lms_database_on_lms_properties_changed (RygelLMSDatabase* self, GDBusProxy* lms_proxy, GVariant* changed, gchar** invalidated, int invalidated_length1) {
-+ GVariant* _tmp0_ = NULL;
-+ const GVariantType* _tmp1_ = NULL;
-+ const GVariantType* _tmp2_ = NULL;
-+ gboolean _tmp3_ = FALSE;
-+ g_return_if_fail (self != NULL);
-+ g_return_if_fail (lms_proxy != NULL);
-+ g_return_if_fail (changed != NULL);
-+ _tmp0_ = changed;
-+ _tmp1_ = g_variant_get_type (_tmp0_);
-+ _tmp2_ = G_VARIANT_TYPE_VARDICT;
-+ _tmp3_ = g_variant_type_equal (_tmp1_, _tmp2_);
-+ if (!_tmp3_) {
-+ return;
-+ }
-+ {
-+ GVariantIter* _changed_prop_it = NULL;
-+ GVariant* _tmp4_ = NULL;
-+ GVariantIter* _tmp5_ = NULL;
-+ GVariant* changed_prop = NULL;
-+ _tmp4_ = changed;
-+ _tmp5_ = g_variant_iter_new (_tmp4_);
-+ _changed_prop_it = _tmp5_;
-+ while (TRUE) {
-+ GVariantIter* _tmp6_ = NULL;
-+ GVariant* _tmp7_ = NULL;
-+ GVariant* _tmp8_ = NULL;
-+ gchar* key = NULL;
-+ GVariant* _tmp9_ = NULL;
-+ GVariant* _tmp10_ = NULL;
-+ GVariant* _tmp11_ = NULL;
-+ gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ GVariant* value = NULL;
-+ GVariant* _tmp14_ = NULL;
-+ GVariant* _tmp15_ = NULL;
-+ GVariant* _tmp16_ = NULL;
-+ GVariant* _tmp17_ = NULL;
-+ GVariant* _tmp18_ = NULL;
-+ const gchar* _tmp19_ = NULL;
-+ GVariant* _tmp20_ = NULL;
-+ gchar* _tmp21_ = NULL;
-+ gchar* _tmp22_ = NULL;
-+ const gchar* _tmp23_ = NULL;
-+ const gchar* _tmp24_ = NULL;
-+ GQuark _tmp26_ = 0U;
-+ static GQuark _tmp25_label0 = 0;
-+ _tmp6_ = _changed_prop_it;
-+ _tmp7_ = g_variant_iter_next_value (_tmp6_);
-+ _g_variant_unref0 (changed_prop);
-+ changed_prop = _tmp7_;
-+ _tmp8_ = changed_prop;
-+ if (!(_tmp8_ != NULL)) {
-+ break;
-+ }
-+ _tmp9_ = changed_prop;
-+ _tmp10_ = g_variant_get_child_value (_tmp9_, (gsize) 0);
-+ _tmp11_ = _tmp10_;
-+ _tmp12_ = _variant_get1 (_tmp11_);
-+ _tmp13_ = _tmp12_;
-+ _g_variant_unref0 (_tmp11_);
-+ key = _tmp13_;
-+ _tmp14_ = changed_prop;
-+ _tmp15_ = g_variant_get_child_value (_tmp14_, (gsize) 1);
-+ _tmp16_ = _tmp15_;
-+ _tmp17_ = g_variant_get_child_value (_tmp16_, (gsize) 0);
-+ _tmp18_ = _tmp17_;
-+ _g_variant_unref0 (_tmp16_);
-+ value = _tmp18_;
-+ _tmp19_ = key;
-+ _tmp20_ = value;
-+ _tmp21_ = g_variant_print (_tmp20_, TRUE);
-+ _tmp22_ = _tmp21_;
-+ g_debug ("rygel-lms-database.vala:138: LMS property %s changed value to %s", _tmp19_, _tmp22_);
-+ _g_free0 (_tmp22_);
-+ _tmp23_ = key;
-+ _tmp24_ = _tmp23_;
-+ _tmp26_ = (NULL == _tmp24_) ? 0 : g_quark_from_string (_tmp24_);
-+ if (_tmp26_ == ((0 != _tmp25_label0) ? _tmp25_label0 : (_tmp25_label0 = g_quark_from_static_string ("UpdateID")))) {
-+ switch (0) {
-+ default:
-+ {
-+ guint64 _tmp27_ = 0ULL;
-+ GVariant* _tmp28_ = NULL;
-+ guint64 _tmp29_ = 0ULL;
-+ GVariant* _tmp30_ = NULL;
-+ guint64 _tmp31_ = 0ULL;
-+ _tmp27_ = self->priv->update_id;
-+ _tmp28_ = value;
-+ _tmp29_ = _variant_get2 (_tmp28_);
-+ g_signal_emit_by_name (self, "db-updated", _tmp27_, _tmp29_);
-+ _tmp30_ = value;
-+ _tmp31_ = _variant_get3 (_tmp30_);
-+ self->priv->update_id = _tmp31_;
-+ break;
-+ }
-+ }
-+ }
-+ _g_variant_unref0 (value);
-+ _g_free0 (key);
-+ }
-+ _g_variant_unref0 (changed_prop);
-+ _g_variant_iter_free0 (_changed_prop_it);
-+ }
-+}
-+
-+
-+sqlite3_stmt* rygel_lms_database_prepare (RygelLMSDatabase* self, const gchar* query_string, GError** error) {
-+ sqlite3_stmt* result = NULL;
-+ sqlite3_stmt* statement = NULL;
-+ gint err = 0;
-+ sqlite3* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ gint _tmp3_ = 0;
-+ gint _tmp4_ = 0;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ g_return_val_if_fail (query_string != NULL, NULL);
-+ _tmp0_ = self->priv->db;
-+ _tmp1_ = query_string;
-+ _tmp3_ = sqlite3_prepare_v2 (_tmp0_, _tmp1_, -1, &_tmp2_, NULL);
-+ _sqlite3_finalize0 (statement);
-+ statement = _tmp2_;
-+ err = _tmp3_;
-+ _tmp4_ = err;
-+ if (_tmp4_ != SQLITE_OK) {
-+ const gchar* _tmp5_ = NULL;
-+ gint _tmp6_ = 0;
-+ GError* _tmp7_ = NULL;
-+ _tmp5_ = query_string;
-+ _tmp6_ = err;
-+ _tmp7_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_PREPARE, "Unable to create statement '%s': %d", _tmp5_, _tmp6_);
-+ _inner_error_ = _tmp7_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ result = statement;
-+ return result;
-+}
-+
-+
-+sqlite3_stmt* rygel_lms_database_prepare_and_init (RygelLMSDatabase* self, const gchar* query, GValue* arguments, int arguments_length1, GError** error) {
-+ sqlite3_stmt* result = NULL;
-+ sqlite3_stmt* statement = NULL;
-+ gint err = 0;
-+ sqlite3* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ gint _tmp3_ = 0;
-+ gint _tmp4_ = 0;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (self != NULL, NULL);
-+ g_return_val_if_fail (query != NULL, NULL);
-+ _tmp0_ = self->priv->db;
-+ _tmp1_ = query;
-+ _tmp3_ = sqlite3_prepare_v2 (_tmp0_, _tmp1_, -1, &_tmp2_, NULL);
-+ _sqlite3_finalize0 (statement);
-+ statement = _tmp2_;
-+ err = _tmp3_;
-+ _tmp4_ = err;
-+ if (_tmp4_ != SQLITE_OK) {
-+ const gchar* _tmp5_ = NULL;
-+ gint _tmp6_ = 0;
-+ GError* _tmp7_ = NULL;
-+ _tmp5_ = query;
-+ _tmp6_ = err;
-+ _tmp7_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_PREPARE, "Unable to create statement '%s': %d", _tmp5_, _tmp6_);
-+ _inner_error_ = _tmp7_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ {
-+ gint i = 0;
-+ i = 1;
-+ {
-+ gboolean _tmp8_ = FALSE;
-+ _tmp8_ = TRUE;
-+ while (TRUE) {
-+ gint _tmp10_ = 0;
-+ GValue* _tmp11_ = NULL;
-+ gint _tmp11__length1 = 0;
-+ gint sqlite_err = 0;
-+ GValue current_value = {0};
-+ GValue* _tmp12_ = NULL;
-+ gint _tmp12__length1 = 0;
-+ gint _tmp13_ = 0;
-+ GValue _tmp14_ = {0};
-+ gboolean _tmp15_ = FALSE;
-+ if (!_tmp8_) {
-+ gint _tmp9_ = 0;
-+ _tmp9_ = i;
-+ i = _tmp9_ + 1;
-+ }
-+ _tmp8_ = FALSE;
-+ _tmp10_ = i;
-+ _tmp11_ = arguments;
-+ _tmp11__length1 = arguments_length1;
-+ if (!(_tmp10_ <= _tmp11__length1)) {
-+ break;
-+ }
-+ _tmp12_ = arguments;
-+ _tmp12__length1 = arguments_length1;
-+ _tmp13_ = i;
-+ _tmp14_ = _tmp12_[_tmp13_ - 1];
-+ current_value = _tmp14_;
-+ _tmp15_ = G_VALUE_HOLDS (&current_value, G_TYPE_INT);
-+ if (_tmp15_) {
-+ sqlite3_stmt* _tmp16_ = NULL;
-+ gint _tmp17_ = 0;
-+ gint _tmp18_ = 0;
-+ gint _tmp19_ = 0;
-+ gint _tmp20_ = 0;
-+ _tmp16_ = statement;
-+ _tmp17_ = i;
-+ _tmp18_ = g_value_get_int (&current_value);
-+ _tmp19_ = sqlite3_bind_int (_tmp16_, _tmp17_, _tmp18_);
-+ sqlite_err = _tmp19_;
-+ _tmp20_ = sqlite_err;
-+ if (_tmp20_ != SQLITE_OK) {
-+ gint _tmp21_ = 0;
-+ GError* _tmp22_ = NULL;
-+ _tmp21_ = sqlite_err;
-+ _tmp22_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp21_);
-+ _inner_error_ = _tmp22_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp23_ = FALSE;
-+ _tmp23_ = G_VALUE_HOLDS (&current_value, G_TYPE_INT64);
-+ if (_tmp23_) {
-+ sqlite3_stmt* _tmp24_ = NULL;
-+ gint _tmp25_ = 0;
-+ gint64 _tmp26_ = 0LL;
-+ gint _tmp27_ = 0;
-+ gint _tmp28_ = 0;
-+ _tmp24_ = statement;
-+ _tmp25_ = i;
-+ _tmp26_ = g_value_get_int64 (&current_value);
-+ _tmp27_ = sqlite3_bind_int64 (_tmp24_, _tmp25_, _tmp26_);
-+ sqlite_err = _tmp27_;
-+ _tmp28_ = sqlite_err;
-+ if (_tmp28_ != SQLITE_OK) {
-+ gint _tmp29_ = 0;
-+ GError* _tmp30_ = NULL;
-+ _tmp29_ = sqlite_err;
-+ _tmp30_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp29_);
-+ _inner_error_ = _tmp30_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp31_ = FALSE;
-+ _tmp31_ = G_VALUE_HOLDS (&current_value, G_TYPE_UINT64);
-+ if (_tmp31_) {
-+ sqlite3_stmt* _tmp32_ = NULL;
-+ gint _tmp33_ = 0;
-+ guint64 _tmp34_ = 0ULL;
-+ gint _tmp35_ = 0;
-+ gint _tmp36_ = 0;
-+ _tmp32_ = statement;
-+ _tmp33_ = i;
-+ _tmp34_ = g_value_get_uint64 (&current_value);
-+ _tmp35_ = sqlite3_bind_int64 (_tmp32_, _tmp33_, (gint64) _tmp34_);
-+ sqlite_err = _tmp35_;
-+ _tmp36_ = sqlite_err;
-+ if (_tmp36_ != SQLITE_OK) {
-+ gint _tmp37_ = 0;
-+ GError* _tmp38_ = NULL;
-+ _tmp37_ = sqlite_err;
-+ _tmp38_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp37_);
-+ _inner_error_ = _tmp38_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp39_ = FALSE;
-+ _tmp39_ = G_VALUE_HOLDS (&current_value, G_TYPE_LONG);
-+ if (_tmp39_) {
-+ sqlite3_stmt* _tmp40_ = NULL;
-+ gint _tmp41_ = 0;
-+ glong _tmp42_ = 0L;
-+ gint _tmp43_ = 0;
-+ gint _tmp44_ = 0;
-+ _tmp40_ = statement;
-+ _tmp41_ = i;
-+ _tmp42_ = g_value_get_long (&current_value);
-+ _tmp43_ = sqlite3_bind_int64 (_tmp40_, _tmp41_, (gint64) _tmp42_);
-+ sqlite_err = _tmp43_;
-+ _tmp44_ = sqlite_err;
-+ if (_tmp44_ != SQLITE_OK) {
-+ gint _tmp45_ = 0;
-+ GError* _tmp46_ = NULL;
-+ _tmp45_ = sqlite_err;
-+ _tmp46_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp45_);
-+ _inner_error_ = _tmp46_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp47_ = FALSE;
-+ _tmp47_ = G_VALUE_HOLDS (&current_value, G_TYPE_UINT);
-+ if (_tmp47_) {
-+ sqlite3_stmt* _tmp48_ = NULL;
-+ gint _tmp49_ = 0;
-+ guint _tmp50_ = 0U;
-+ gint _tmp51_ = 0;
-+ gint _tmp52_ = 0;
-+ _tmp48_ = statement;
-+ _tmp49_ = i;
-+ _tmp50_ = g_value_get_uint (&current_value);
-+ _tmp51_ = sqlite3_bind_int64 (_tmp48_, _tmp49_, (gint64) _tmp50_);
-+ sqlite_err = _tmp51_;
-+ _tmp52_ = sqlite_err;
-+ if (_tmp52_ != SQLITE_OK) {
-+ gint _tmp53_ = 0;
-+ GError* _tmp54_ = NULL;
-+ _tmp53_ = sqlite_err;
-+ _tmp54_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp53_);
-+ _inner_error_ = _tmp54_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp55_ = FALSE;
-+ _tmp55_ = G_VALUE_HOLDS (&current_value, G_TYPE_STRING);
-+ if (_tmp55_) {
-+ sqlite3_stmt* _tmp56_ = NULL;
-+ gint _tmp57_ = 0;
-+ const gchar* _tmp58_ = NULL;
-+ gchar* _tmp59_ = NULL;
-+ GDestroyNotify _tmp60_ = NULL;
-+ gint _tmp61_ = 0;
-+ gint _tmp62_ = 0;
-+ _tmp56_ = statement;
-+ _tmp57_ = i;
-+ _tmp58_ = g_value_get_string (&current_value);
-+ _tmp59_ = g_strdup (_tmp58_);
-+ _tmp60_ = g_free;
-+ _tmp61_ = sqlite3_bind_text (_tmp56_, _tmp57_, _tmp59_, -1, _tmp60_);
-+ sqlite_err = _tmp61_;
-+ _tmp62_ = sqlite_err;
-+ if (_tmp62_ != SQLITE_OK) {
-+ gint _tmp63_ = 0;
-+ GError* _tmp64_ = NULL;
-+ _tmp63_ = sqlite_err;
-+ _tmp64_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp63_);
-+ _inner_error_ = _tmp64_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ gboolean _tmp65_ = FALSE;
-+ _tmp65_ = G_VALUE_HOLDS (&current_value, G_TYPE_POINTER);
-+ if (_tmp65_) {
-+ void* _tmp66_ = NULL;
-+ _tmp66_ = g_value_peek_pointer (&current_value);
-+ if (_tmp66_ == NULL) {
-+ sqlite3_stmt* _tmp67_ = NULL;
-+ gint _tmp68_ = 0;
-+ gint _tmp69_ = 0;
-+ gint _tmp70_ = 0;
-+ _tmp67_ = statement;
-+ _tmp68_ = i;
-+ _tmp69_ = sqlite3_bind_null (_tmp67_, _tmp68_);
-+ sqlite_err = _tmp69_;
-+ _tmp70_ = sqlite_err;
-+ if (_tmp70_ != SQLITE_OK) {
-+ gint _tmp71_ = 0;
-+ GError* _tmp72_ = NULL;
-+ _tmp71_ = sqlite_err;
-+ _tmp72_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind value %d", _tmp71_);
-+ _inner_error_ = _tmp72_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ _sqlite3_finalize0 (statement);
-+ return NULL;
-+ } else {
-+ _sqlite3_finalize0 (statement);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ }
-+ } else {
-+ g_assert_not_reached ();
-+ }
-+ } else {
-+ GType type = 0UL;
-+ GType _tmp73_ = 0UL;
-+ const gchar* _tmp74_ = NULL;
-+ const gchar* _tmp75_ = NULL;
-+ _tmp73_ = G_VALUE_TYPE (&current_value);
-+ type = _tmp73_;
-+ _tmp74_ = _ ("Unsupported type %s");
-+ _tmp75_ = g_type_name (type);
-+ g_warning (_tmp74_, _tmp75_);
-+ g_assert_not_reached ();
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+ result = statement;
-+ return result;
-+}
-+
-+
-+void rygel_lms_database_find_object (const gchar* id, sqlite3_stmt* stmt, GError** error) {
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint integer_id = 0;
-+ const gchar* _tmp2_ = NULL;
-+ gint _tmp3_ = 0;
-+ gint sqlite_err = 0;
-+ sqlite3_stmt* _tmp4_ = NULL;
-+ gint _tmp5_ = 0;
-+ gint _tmp6_ = 0;
-+ gint _tmp7_ = 0;
-+ sqlite3_stmt* _tmp10_ = NULL;
-+ gint _tmp11_ = 0;
-+ gint _tmp12_ = 0;
-+ GError * _inner_error_ = NULL;
-+ g_return_if_fail (id != NULL);
-+ g_return_if_fail (stmt != NULL);
-+ _tmp0_ = stmt;
-+ _tmp1_ = sqlite3_reset (_tmp0_);
-+ _tmp2_ = id;
-+ _tmp3_ = atoi (_tmp2_);
-+ integer_id = _tmp3_;
-+ _tmp4_ = stmt;
-+ _tmp5_ = integer_id;
-+ _tmp6_ = sqlite3_bind_int (_tmp4_, 1, _tmp5_);
-+ sqlite_err = _tmp6_;
-+ _tmp7_ = sqlite_err;
-+ if (_tmp7_ != SQLITE_OK) {
-+ gint _tmp8_ = 0;
-+ GError* _tmp9_ = NULL;
-+ _tmp8_ = sqlite_err;
-+ _tmp9_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind id %d", _tmp8_);
-+ _inner_error_ = _tmp9_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+ _tmp10_ = stmt;
-+ _tmp11_ = sqlite3_step (_tmp10_);
-+ sqlite_err = _tmp11_;
-+ _tmp12_ = sqlite_err;
-+ if (_tmp12_ != SQLITE_ROW) {
-+ const gchar* _tmp13_ = NULL;
-+ GError* _tmp14_ = NULL;
-+ _tmp13_ = id;
-+ _tmp14_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_STEP, "Unable to find id %s", _tmp13_);
-+ _inner_error_ = _tmp14_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+}
-+
-+
-+void rygel_lms_database_get_children_init (sqlite3_stmt* stmt, guint offset, guint max_count, const gchar* sort_criteria, GError** error) {
-+ gint sqlite_err = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ guint _tmp3_ = 0U;
-+ gint _tmp4_ = 0;
-+ gint _tmp5_ = 0;
-+ sqlite3_stmt* _tmp8_ = NULL;
-+ guint _tmp9_ = 0U;
-+ gint _tmp10_ = 0;
-+ gint _tmp11_ = 0;
-+ GError * _inner_error_ = NULL;
-+ g_return_if_fail (stmt != NULL);
-+ g_return_if_fail (sort_criteria != NULL);
-+ _tmp0_ = stmt;
-+ _tmp1_ = sqlite3_reset (_tmp0_);
-+ _tmp2_ = stmt;
-+ _tmp3_ = max_count;
-+ _tmp4_ = sqlite3_bind_int (_tmp2_, 1, (gint) _tmp3_);
-+ sqlite_err = _tmp4_;
-+ _tmp5_ = sqlite_err;
-+ if (_tmp5_ != SQLITE_OK) {
-+ gint _tmp6_ = 0;
-+ GError* _tmp7_ = NULL;
-+ _tmp6_ = sqlite_err;
-+ _tmp7_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind max_count %d", _tmp6_);
-+ _inner_error_ = _tmp7_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+ _tmp8_ = stmt;
-+ _tmp9_ = offset;
-+ _tmp10_ = sqlite3_bind_int (_tmp8_, 2, (gint) _tmp9_);
-+ sqlite_err = _tmp10_;
-+ _tmp11_ = sqlite_err;
-+ if (_tmp11_ != SQLITE_OK) {
-+ gint _tmp12_ = 0;
-+ GError* _tmp13_ = NULL;
-+ _tmp12_ = sqlite_err;
-+ _tmp13_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind offset %d", _tmp12_);
-+ _inner_error_ = _tmp13_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+}
-+
-+
-+void rygel_lms_database_get_children_with_update_id_init (sqlite3_stmt* stmt, guint64 old_id, guint64 new_id, GError** error) {
-+ gint sqlite_err = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ guint64 _tmp2_ = 0ULL;
-+ guint64 _tmp3_ = 0ULL;
-+ gint _tmp9_ = 0;
-+ sqlite3_stmt* _tmp12_ = NULL;
-+ guint64 _tmp13_ = 0ULL;
-+ gint _tmp14_ = 0;
-+ gint _tmp15_ = 0;
-+ GError * _inner_error_ = NULL;
-+ g_return_if_fail (stmt != NULL);
-+ _tmp0_ = stmt;
-+ _tmp1_ = sqlite3_reset (_tmp0_);
-+ _tmp2_ = new_id;
-+ _tmp3_ = old_id;
-+ if (_tmp2_ < _tmp3_) {
-+ sqlite3_stmt* _tmp4_ = NULL;
-+ gint _tmp5_ = 0;
-+ _tmp4_ = stmt;
-+ _tmp5_ = sqlite3_bind_int64 (_tmp4_, 1, (gint64) 0);
-+ sqlite_err = _tmp5_;
-+ } else {
-+ sqlite3_stmt* _tmp6_ = NULL;
-+ guint64 _tmp7_ = 0ULL;
-+ gint _tmp8_ = 0;
-+ _tmp6_ = stmt;
-+ _tmp7_ = old_id;
-+ _tmp8_ = sqlite3_bind_int64 (_tmp6_, 1, (gint64) _tmp7_);
-+ sqlite_err = _tmp8_;
-+ }
-+ _tmp9_ = sqlite_err;
-+ if (_tmp9_ != SQLITE_OK) {
-+ gint _tmp10_ = 0;
-+ GError* _tmp11_ = NULL;
-+ _tmp10_ = sqlite_err;
-+ _tmp11_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind old_id %d", _tmp10_);
-+ _inner_error_ = _tmp11_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+ _tmp12_ = stmt;
-+ _tmp13_ = new_id;
-+ _tmp14_ = sqlite3_bind_int64 (_tmp12_, 2, (gint64) _tmp13_);
-+ sqlite_err = _tmp14_;
-+ _tmp15_ = sqlite_err;
-+ if (_tmp15_ != SQLITE_OK) {
-+ gint _tmp16_ = 0;
-+ GError* _tmp17_ = NULL;
-+ _tmp16_ = sqlite_err;
-+ _tmp17_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_BIND, "Unable to bind new_id %d", _tmp16_);
-+ _inner_error_ = _tmp17_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return;
-+ }
-+ }
-+}
-+
-+
-+gboolean rygel_lms_database_get_children_step (sqlite3_stmt* stmt, GError** error) {
-+ gboolean result = FALSE;
-+ gboolean retval = FALSE;
-+ gint sqlite_err = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gint _tmp2_ = 0;
-+ gboolean _tmp3_ = FALSE;
-+ gboolean _tmp4_ = FALSE;
-+ GError * _inner_error_ = NULL;
-+ g_return_val_if_fail (stmt != NULL, FALSE);
-+ _tmp0_ = stmt;
-+ _tmp1_ = sqlite3_step (_tmp0_);
-+ sqlite_err = _tmp1_;
-+ _tmp2_ = sqlite_err;
-+ retval = _tmp2_ == SQLITE_ROW;
-+ _tmp4_ = retval;
-+ if (!_tmp4_) {
-+ gint _tmp5_ = 0;
-+ _tmp5_ = sqlite_err;
-+ _tmp3_ = _tmp5_ != SQLITE_DONE;
-+ } else {
-+ _tmp3_ = FALSE;
-+ }
-+ if (_tmp3_) {
-+ gint _tmp6_ = 0;
-+ GError* _tmp7_ = NULL;
-+ _tmp6_ = sqlite_err;
-+ _tmp7_ = g_error_new (RYGEL_LMS_DATABASE_ERROR, RYGEL_LMS_DATABASE_ERROR_STEP, "Error iterating through rows %d", _tmp6_);
-+ _inner_error_ = _tmp7_;
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ g_propagate_error (error, _inner_error_);
-+ return FALSE;
-+ } else {
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return FALSE;
-+ }
-+ }
-+ result = retval;
-+ return result;
-+}
-+
-+
-+static void g_cclosure_user_marshal_VOID__UINT64_UINT64 (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
-+ typedef void (*GMarshalFunc_VOID__UINT64_UINT64) (gpointer data1, guint64 arg_1, guint64 arg_2, gpointer data2);
-+ register GMarshalFunc_VOID__UINT64_UINT64 callback;
-+ register GCClosure * cc;
-+ register gpointer data1;
-+ register gpointer data2;
-+ cc = (GCClosure *) closure;
-+ g_return_if_fail (n_param_values == 3);
-+ if (G_CCLOSURE_SWAP_DATA (closure)) {
-+ data1 = closure->data;
-+ data2 = param_values->data[0].v_pointer;
-+ } else {
-+ data1 = param_values->data[0].v_pointer;
-+ data2 = closure->data;
-+ }
-+ callback = (GMarshalFunc_VOID__UINT64_UINT64) (marshal_data ? marshal_data : cc->callback);
-+ callback (data1, g_value_get_uint64 (param_values + 1), g_value_get_uint64 (param_values + 2), data2);
-+}
-+
-+
-+static void rygel_lms_value_database_init (GValue* value) {
-+ value->data[0].v_pointer = NULL;
-+}
-+
-+
-+static void rygel_lms_value_database_free_value (GValue* value) {
-+ if (value->data[0].v_pointer) {
-+ rygel_lms_database_unref (value->data[0].v_pointer);
-+ }
-+}
-+
-+
-+static void rygel_lms_value_database_copy_value (const GValue* src_value, GValue* dest_value) {
-+ if (src_value->data[0].v_pointer) {
-+ dest_value->data[0].v_pointer = rygel_lms_database_ref (src_value->data[0].v_pointer);
-+ } else {
-+ dest_value->data[0].v_pointer = NULL;
-+ }
-+}
-+
-+
-+static gpointer rygel_lms_value_database_peek_pointer (const GValue* value) {
-+ return value->data[0].v_pointer;
-+}
-+
-+
-+static gchar* rygel_lms_value_database_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
-+ if (collect_values[0].v_pointer) {
-+ RygelLMSDatabase* object;
-+ object = collect_values[0].v_pointer;
-+ if (object->parent_instance.g_class == NULL) {
-+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
-+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-+ }
-+ value->data[0].v_pointer = rygel_lms_database_ref (object);
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ return NULL;
-+}
-+
-+
-+static gchar* rygel_lms_value_database_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
-+ RygelLMSDatabase** object_p;
-+ object_p = collect_values[0].v_pointer;
-+ if (!object_p) {
-+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
-+ }
-+ if (!value->data[0].v_pointer) {
-+ *object_p = NULL;
-+ } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
-+ *object_p = value->data[0].v_pointer;
-+ } else {
-+ *object_p = rygel_lms_database_ref (value->data[0].v_pointer);
-+ }
-+ return NULL;
-+}
-+
-+
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
-+ RygelLMSParamSpecDatabase* spec;
-+ g_return_val_if_fail (g_type_is_a (object_type, RYGEL_LMS_TYPE_DATABASE), NULL);
-+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
-+ G_PARAM_SPEC (spec)->value_type = object_type;
-+ return G_PARAM_SPEC (spec);
-+}
-+
-+
-+gpointer rygel_lms_value_get_database (const GValue* value) {
-+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_DATABASE), NULL);
-+ return value->data[0].v_pointer;
-+}
-+
-+
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object) {
-+ RygelLMSDatabase* old;
-+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_DATABASE));
-+ old = value->data[0].v_pointer;
-+ if (v_object) {
-+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_LMS_TYPE_DATABASE));
-+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
-+ value->data[0].v_pointer = v_object;
-+ rygel_lms_database_ref (value->data[0].v_pointer);
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ if (old) {
-+ rygel_lms_database_unref (old);
-+ }
-+}
-+
-+
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object) {
-+ RygelLMSDatabase* old;
-+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_DATABASE));
-+ old = value->data[0].v_pointer;
-+ if (v_object) {
-+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_LMS_TYPE_DATABASE));
-+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
-+ value->data[0].v_pointer = v_object;
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ if (old) {
-+ rygel_lms_database_unref (old);
-+ }
-+}
-+
-+
-+static void rygel_lms_database_class_init (RygelLMSDatabaseClass * klass) {
-+ rygel_lms_database_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSDatabaseClass *) klass)->finalize = rygel_lms_database_finalize;
-+ g_type_class_add_private (klass, sizeof (RygelLMSDatabasePrivate));
-+ g_signal_new ("db_updated", RYGEL_LMS_TYPE_DATABASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT64_UINT64, G_TYPE_NONE, 2, G_TYPE_UINT64, G_TYPE_UINT64);
-+}
-+
-+
-+static void rygel_lms_database_instance_init (RygelLMSDatabase * self) {
-+ self->priv = RYGEL_LMS_DATABASE_GET_PRIVATE (self);
-+ self->ref_count = 1;
-+}
-+
-+
-+static void rygel_lms_database_finalize (RygelLMSDatabase* obj) {
-+ RygelLMSDatabase * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase);
-+ g_signal_handlers_destroy (self);
-+ _sqlite3_close0 (self->priv->db);
-+ _g_object_unref0 (self->priv->lms_proxy);
-+}
-+
-+
-+GType rygel_lms_database_get_type (void) {
-+ static volatile gsize rygel_lms_database_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_database_type_id__volatile)) {
-+ static const GTypeValueTable g_define_type_value_table = { rygel_lms_value_database_init, rygel_lms_value_database_free_value, rygel_lms_value_database_copy_value, rygel_lms_value_database_peek_pointer, "p", rygel_lms_value_database_collect_value, "p", rygel_lms_value_database_lcopy_value };
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSDatabase), 0, (GInstanceInitFunc) rygel_lms_database_instance_init, &g_define_type_value_table };
-+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
-+ GType rygel_lms_database_type_id;
-+ rygel_lms_database_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelLMSDatabase", &g_define_type_info, &g_define_type_fundamental_info, 0);
-+ g_once_init_leave (&rygel_lms_database_type_id__volatile, rygel_lms_database_type_id);
-+ }
-+ return rygel_lms_database_type_id__volatile;
-+}
-+
-+
-+gpointer rygel_lms_database_ref (gpointer instance) {
-+ RygelLMSDatabase* self;
-+ self = instance;
-+ g_atomic_int_inc (&self->ref_count);
-+ return instance;
-+}
-+
-+
-+void rygel_lms_database_unref (gpointer instance) {
-+ RygelLMSDatabase* self;
-+ self = instance;
-+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
-+ RYGEL_LMS_DATABASE_GET_CLASS (self)->finalize (self);
-+ g_type_free_instance ((GTypeInstance *) self);
-+ }
-+}
-+
-+
-+static gint _vala_array_length (gpointer array) {
-+ int length;
-+ length = 0;
-+ if (array) {
-+ while (((gpointer*) array)[length]) {
-+ length++;
-+ }
-+ }
-+ return length;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-dbus-interfaces.c b/src/plugins/lms/rygel-lms-dbus-interfaces.c
-new file mode 100644
-index 0000000..b511b17
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-dbus-interfaces.c
-@@ -0,0 +1,261 @@
-+/* rygel-lms-dbus-interfaces.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-dbus-interfaces.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2014 Intel Corporation.
-+ *
-+ * Author: Alexander Kanavin <alex.kanavin@gmail.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <gio/gio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+
-+#define RYGEL_LMS_TYPE_DBUS (rygel_lms_dbus_get_type ())
-+#define RYGEL_LMS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DBUS, RygelLMSDBus))
-+#define RYGEL_LMS_IS_DBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DBUS))
-+#define RYGEL_LMS_DBUS_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_LMS_TYPE_DBUS, RygelLMSDBusIface))
-+
-+typedef struct _RygelLMSDBus RygelLMSDBus;
-+typedef struct _RygelLMSDBusIface RygelLMSDBusIface;
-+
-+#define RYGEL_LMS_TYPE_DBUS_PROXY (rygel_lms_dbus_proxy_get_type ())
-+typedef GDBusProxy RygelLMSDBusProxy;
-+typedef GDBusProxyClass RygelLMSDBusProxyClass;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+struct _RygelLMSDBusIface {
-+ GTypeInterface parent_iface;
-+ gchar* (*get_data_base_path) (RygelLMSDBus* self);
-+ guint64 (*get_update_id) (RygelLMSDBus* self);
-+};
-+
-+
-+
-+GType rygel_lms_dbus_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_dbus_proxy_get_type (void) G_GNUC_CONST;
-+guint rygel_lms_dbus_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
-+gchar* rygel_lms_dbus_get_data_base_path (RygelLMSDBus* self);
-+guint64 rygel_lms_dbus_get_update_id (RygelLMSDBus* self);
-+static void rygel_lms_dbus_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
-+static gchar* rygel_lms_dbus_dbus_proxy_get_data_base_path (RygelLMSDBus* self);
-+static guint64 rygel_lms_dbus_dbus_proxy_get_update_id (RygelLMSDBus* self);
-+static void rygel_lms_dbus_proxy_rygel_lms_dbus_interface_init (RygelLMSDBusIface* iface);
-+static void rygel_lms_dbus_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
-+static GVariant* rygel_lms_dbus_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
-+static GVariant* _dbus_rygel_lms_dbus_get_data_base_path (RygelLMSDBus* self);
-+static GVariant* _dbus_rygel_lms_dbus_get_update_id (RygelLMSDBus* self);
-+static gboolean rygel_lms_dbus_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
-+static void _rygel_lms_dbus_unregister_object (gpointer user_data);
-+
-+static const GDBusMethodInfo * const _rygel_lms_dbus_dbus_method_info[] = {NULL};
-+static const GDBusSignalInfo * const _rygel_lms_dbus_dbus_signal_info[] = {NULL};
-+static const GDBusPropertyInfo _rygel_lms_dbus_dbus_property_info_data_base_path = {-1, "DataBasePath", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
-+static const GDBusPropertyInfo _rygel_lms_dbus_dbus_property_info_update_id = {-1, "UpdateID", "t", G_DBUS_PROPERTY_INFO_FLAGS_READABLE};
-+static const GDBusPropertyInfo * const _rygel_lms_dbus_dbus_property_info[] = {&_rygel_lms_dbus_dbus_property_info_data_base_path, &_rygel_lms_dbus_dbus_property_info_update_id, NULL};
-+static const GDBusInterfaceInfo _rygel_lms_dbus_dbus_interface_info = {-1, "org.lightmediascanner.Scanner1", (GDBusMethodInfo **) (&_rygel_lms_dbus_dbus_method_info), (GDBusSignalInfo **) (&_rygel_lms_dbus_dbus_signal_info), (GDBusPropertyInfo **) (&_rygel_lms_dbus_dbus_property_info)};
-+static const GDBusInterfaceVTable _rygel_lms_dbus_dbus_interface_vtable = {rygel_lms_dbus_dbus_interface_method_call, rygel_lms_dbus_dbus_interface_get_property, rygel_lms_dbus_dbus_interface_set_property};
-+
-+gchar* rygel_lms_dbus_get_data_base_path (RygelLMSDBus* self) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_DBUS_GET_INTERFACE (self)->get_data_base_path (self);
-+}
-+
-+
-+guint64 rygel_lms_dbus_get_update_id (RygelLMSDBus* self) {
-+ g_return_val_if_fail (self != NULL, 0ULL);
-+ return RYGEL_LMS_DBUS_GET_INTERFACE (self)->get_update_id (self);
-+}
-+
-+
-+static void rygel_lms_dbus_base_init (RygelLMSDBusIface * iface) {
-+ static gboolean initialized = FALSE;
-+ if (!initialized) {
-+ initialized = TRUE;
-+ }
-+}
-+
-+
-+GType rygel_lms_dbus_get_type (void) {
-+ static volatile gsize rygel_lms_dbus_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_dbus_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSDBusIface), (GBaseInitFunc) rygel_lms_dbus_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
-+ GType rygel_lms_dbus_type_id;
-+ rygel_lms_dbus_type_id = g_type_register_static (G_TYPE_INTERFACE, "RygelLMSDBus", &g_define_type_info, 0);
-+ g_type_interface_add_prerequisite (rygel_lms_dbus_type_id, G_TYPE_DBUS_PROXY);
-+ g_type_set_qdata (rygel_lms_dbus_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) rygel_lms_dbus_proxy_get_type);
-+ g_type_set_qdata (rygel_lms_dbus_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.lightmediascanner.Scanner1");
-+ g_type_set_qdata (rygel_lms_dbus_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_rygel_lms_dbus_dbus_interface_info));
-+ g_type_set_qdata (rygel_lms_dbus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) rygel_lms_dbus_register_object);
-+ g_once_init_leave (&rygel_lms_dbus_type_id__volatile, rygel_lms_dbus_type_id);
-+ }
-+ return rygel_lms_dbus_type_id__volatile;
-+}
-+
-+
-+G_DEFINE_TYPE_EXTENDED (RygelLMSDBusProxy, rygel_lms_dbus_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (RYGEL_LMS_TYPE_DBUS, rygel_lms_dbus_proxy_rygel_lms_dbus_interface_init) )
-+static void rygel_lms_dbus_proxy_class_init (RygelLMSDBusProxyClass* klass) {
-+ G_DBUS_PROXY_CLASS (klass)->g_signal = rygel_lms_dbus_proxy_g_signal;
-+}
-+
-+
-+static void rygel_lms_dbus_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
-+}
-+
-+
-+static void rygel_lms_dbus_proxy_init (RygelLMSDBusProxy* self) {
-+}
-+
-+
-+static gchar* rygel_lms_dbus_dbus_proxy_get_data_base_path (RygelLMSDBus* self) {
-+ GVariant *_inner_reply;
-+ gchar* _result;
-+ _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "DataBasePath");
-+ if (!_inner_reply) {
-+ GVariant *_arguments;
-+ GVariant *_reply;
-+ GVariantBuilder _arguments_builder;
-+ g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
-+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.lightmediascanner.Scanner1"));
-+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("DataBasePath"));
-+ _arguments = g_variant_builder_end (&_arguments_builder);
-+ _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
-+ if (!_reply) {
-+ return NULL;
-+ }
-+ g_variant_get (_reply, "(v)", &_inner_reply);
-+ g_variant_unref (_reply);
-+ }
-+ _result = g_variant_dup_string (_inner_reply, NULL);
-+ g_variant_unref (_inner_reply);
-+ return _result;
-+}
-+
-+
-+static guint64 rygel_lms_dbus_dbus_proxy_get_update_id (RygelLMSDBus* self) {
-+ GVariant *_inner_reply;
-+ guint64 _result;
-+ _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "UpdateID");
-+ if (!_inner_reply) {
-+ GVariant *_arguments;
-+ GVariant *_reply;
-+ GVariantBuilder _arguments_builder;
-+ g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
-+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.lightmediascanner.Scanner1"));
-+ g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("UpdateID"));
-+ _arguments = g_variant_builder_end (&_arguments_builder);
-+ _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
-+ if (!_reply) {
-+ return 0ULL;
-+ }
-+ g_variant_get (_reply, "(v)", &_inner_reply);
-+ g_variant_unref (_reply);
-+ }
-+ _result = g_variant_get_uint64 (_inner_reply);
-+ g_variant_unref (_inner_reply);
-+ return _result;
-+}
-+
-+
-+static void rygel_lms_dbus_proxy_rygel_lms_dbus_interface_init (RygelLMSDBusIface* iface) {
-+ iface->get_data_base_path = rygel_lms_dbus_dbus_proxy_get_data_base_path;
-+ iface->get_update_id = rygel_lms_dbus_dbus_proxy_get_update_id;
-+}
-+
-+
-+static void rygel_lms_dbus_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
-+ gpointer* data;
-+ gpointer object;
-+ data = user_data;
-+ object = data[0];
-+ g_object_unref (invocation);
-+}
-+
-+
-+static GVariant* _dbus_rygel_lms_dbus_get_data_base_path (RygelLMSDBus* self) {
-+ gchar* result;
-+ GVariant* _reply;
-+ result = rygel_lms_dbus_get_data_base_path (self);
-+ _reply = g_variant_new_string (result);
-+ _g_free0 (result);
-+ return _reply;
-+}
-+
-+
-+static GVariant* _dbus_rygel_lms_dbus_get_update_id (RygelLMSDBus* self) {
-+ guint64 result;
-+ GVariant* _reply;
-+ result = rygel_lms_dbus_get_update_id (self);
-+ _reply = g_variant_new_uint64 (result);
-+ return _reply;
-+}
-+
-+
-+static GVariant* rygel_lms_dbus_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
-+ gpointer* data;
-+ gpointer object;
-+ data = user_data;
-+ object = data[0];
-+ if (strcmp (property_name, "DataBasePath") == 0) {
-+ return _dbus_rygel_lms_dbus_get_data_base_path (object);
-+ } else if (strcmp (property_name, "UpdateID") == 0) {
-+ return _dbus_rygel_lms_dbus_get_update_id (object);
-+ }
-+ return NULL;
-+}
-+
-+
-+static gboolean rygel_lms_dbus_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
-+ gpointer* data;
-+ gpointer object;
-+ data = user_data;
-+ object = data[0];
-+ return FALSE;
-+}
-+
-+
-+guint rygel_lms_dbus_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
-+ guint result;
-+ gpointer *data;
-+ data = g_new (gpointer, 3);
-+ data[0] = g_object_ref (object);
-+ data[1] = g_object_ref (connection);
-+ data[2] = g_strdup (path);
-+ result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_rygel_lms_dbus_dbus_interface_info), &_rygel_lms_dbus_dbus_interface_vtable, data, _rygel_lms_dbus_unregister_object, error);
-+ if (!result) {
-+ return 0;
-+ }
-+ return result;
-+}
-+
-+
-+static void _rygel_lms_dbus_unregister_object (gpointer user_data) {
-+ gpointer* data;
-+ data = user_data;
-+ g_object_unref (data[0]);
-+ g_object_unref (data[1]);
-+ g_free (data[2]);
-+ g_free (data);
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-image-root.c b/src/plugins/lms/rygel-lms-image-root.c
-new file mode 100644
-index 0000000..5ef358a
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-root.c
-@@ -0,0 +1,178 @@
-+/* rygel-lms-image-root.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-image-root.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+
-+#define RYGEL_LMS_TYPE_IMAGE_ROOT (rygel_lms_image_root_get_type ())
-+#define RYGEL_LMS_IMAGE_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRoot))
-+#define RYGEL_LMS_IMAGE_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRootClass))
-+#define RYGEL_LMS_IS_IMAGE_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT))
-+#define RYGEL_LMS_IS_IMAGE_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_ROOT))
-+#define RYGEL_LMS_IMAGE_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRootClass))
-+
-+typedef struct _RygelLMSImageRoot RygelLMSImageRoot;
-+typedef struct _RygelLMSImageRootClass RygelLMSImageRootClass;
-+typedef struct _RygelLMSImageRootPrivate RygelLMSImageRootPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+
-+#define RYGEL_LMS_TYPE_ALL_IMAGES (rygel_lms_all_images_get_type ())
-+#define RYGEL_LMS_ALL_IMAGES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImages))
-+#define RYGEL_LMS_ALL_IMAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImagesClass))
-+#define RYGEL_LMS_IS_ALL_IMAGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_IMAGES))
-+#define RYGEL_LMS_IS_ALL_IMAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_IMAGES))
-+#define RYGEL_LMS_ALL_IMAGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_IMAGES, RygelLMSAllImagesClass))
-+
-+typedef struct _RygelLMSAllImages RygelLMSAllImages;
-+typedef struct _RygelLMSAllImagesClass RygelLMSAllImagesClass;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_IMAGE_YEARS (rygel_lms_image_years_get_type ())
-+#define RYGEL_LMS_IMAGE_YEARS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYears))
-+#define RYGEL_LMS_IMAGE_YEARS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYearsClass))
-+#define RYGEL_LMS_IS_IMAGE_YEARS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS))
-+#define RYGEL_LMS_IS_IMAGE_YEARS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_YEARS))
-+#define RYGEL_LMS_IMAGE_YEARS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYearsClass))
-+
-+typedef struct _RygelLMSImageYears RygelLMSImageYears;
-+typedef struct _RygelLMSImageYearsClass RygelLMSImageYearsClass;
-+
-+struct _RygelLMSImageRoot {
-+ RygelSimpleContainer parent_instance;
-+ RygelLMSImageRootPrivate * priv;
-+};
-+
-+struct _RygelLMSImageRootClass {
-+ RygelSimpleContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_image_root_parent_class = NULL;
-+
-+GType rygel_lms_image_root_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_IMAGE_ROOT_DUMMY_PROPERTY
-+};
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSImageRoot* rygel_lms_image_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSImageRoot* rygel_lms_image_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAllImages* rygel_lms_all_images_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAllImages* rygel_lms_all_images_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_images_get_type (void) G_GNUC_CONST;
-+RygelLMSImageYears* rygel_lms_image_years_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSImageYears* rygel_lms_image_years_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+GType rygel_lms_image_years_get_type (void) G_GNUC_CONST;
-+
-+
-+RygelLMSImageRoot* rygel_lms_image_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSImageRoot * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ RygelLMSAllImages* _tmp4_ = NULL;
-+ RygelLMSAllImages* _tmp5_ = NULL;
-+ RygelLMSDatabase* _tmp6_ = NULL;
-+ RygelLMSImageYears* _tmp7_ = NULL;
-+ RygelLMSImageYears* _tmp8_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ self = (RygelLMSImageRoot*) rygel_simple_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_);
-+ _tmp3_ = lms_db;
-+ _tmp4_ = rygel_lms_all_images_new ((RygelMediaContainer*) self, _tmp3_);
-+ _tmp5_ = _tmp4_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp5_);
-+ _g_object_unref0 (_tmp5_);
-+ _tmp6_ = lms_db;
-+ _tmp7_ = rygel_lms_image_years_new ((RygelMediaContainer*) self, _tmp6_);
-+ _tmp8_ = _tmp7_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp8_);
-+ _g_object_unref0 (_tmp8_);
-+ return self;
-+}
-+
-+
-+RygelLMSImageRoot* rygel_lms_image_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_image_root_construct (RYGEL_LMS_TYPE_IMAGE_ROOT, id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_image_root_class_init (RygelLMSImageRootClass * klass) {
-+ rygel_lms_image_root_parent_class = g_type_class_peek_parent (klass);
-+}
-+
-+
-+static void rygel_lms_image_root_instance_init (RygelLMSImageRoot * self) {
-+}
-+
-+
-+GType rygel_lms_image_root_get_type (void) {
-+ static volatile gsize rygel_lms_image_root_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_image_root_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSImageRootClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_image_root_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSImageRoot), 0, (GInstanceInitFunc) rygel_lms_image_root_instance_init, NULL };
-+ GType rygel_lms_image_root_type_id;
-+ rygel_lms_image_root_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelLMSImageRoot", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_image_root_type_id__volatile, rygel_lms_image_root_type_id);
-+ }
-+ return rygel_lms_image_root_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-image-year.c b/src/plugins/lms/rygel-lms-image-year.c
-new file mode 100644
-index 0000000..5eb2721
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-year.c
-@@ -0,0 +1,422 @@
-+/* rygel-lms-image-year.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-image-year.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <gio/gio.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_IMAGE_YEAR (rygel_lms_image_year_get_type ())
-+#define RYGEL_LMS_IMAGE_YEAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYear))
-+#define RYGEL_LMS_IMAGE_YEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYearClass))
-+#define RYGEL_LMS_IS_IMAGE_YEAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR))
-+#define RYGEL_LMS_IS_IMAGE_YEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_YEAR))
-+#define RYGEL_LMS_IMAGE_YEAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYearClass))
-+
-+typedef struct _RygelLMSImageYear RygelLMSImageYear;
-+typedef struct _RygelLMSImageYearClass RygelLMSImageYearClass;
-+typedef struct _RygelLMSImageYearPrivate RygelLMSImageYearPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSImageYear {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSImageYearPrivate * priv;
-+};
-+
-+struct _RygelLMSImageYearClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_image_year_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_image_year_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_IMAGE_YEAR_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_IMAGE_YEAR_SQL_ALL_TEMPLATE "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id AND year = '%s' " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_IMAGE_YEAR_SQL_COUNT_TEMPLATE "SELECT count(images.id), strftime('%Y', date, 'unixepoch') as year " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id AND year = '%s';"
-+#define RYGEL_LMS_IMAGE_YEAR_SQL_FIND_OBJECT_TEMPLATE "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " "FROM images, files " "WHERE dtime = 0 AND files.id = ? AND images.id = files.id AND year = '" \
-+"%s';"
-+#define RYGEL_LMS_IMAGE_YEAR_SQL_ADDED_TEMPLATE "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " "FROM images, files " "WHERE dtime = 0 AND images.id = files.id AND year = '%s' " "AND update_id > ? AND update_id <= ?;"
-+#define RYGEL_LMS_IMAGE_YEAR_SQL_REMOVED_TEMPLATE "SELECT images.id, title, artist, date, width, height, path, size, dlna" \
-+"_profile, dlna_mime, strftime('%Y', date, 'unixepoch') as year " "FROM images, files " "WHERE dtime <> 0 AND images.id = files.id AND year = '%s' " "AND update_id > ? AND update_id <= ?;"
-+static RygelMediaObject* rygel_lms_image_year_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gchar* rygel_lms_category_container_build_child_id (RygelLMSCategoryContainer* self, gint db_id);
-+gchar* rygel_lms_category_container_build_reference_id (RygelLMSCategoryContainer* self, gint db_id);
-+static gchar* rygel_lms_image_year_get_sql_all (const gchar* year);
-+static gchar* rygel_lms_image_year_get_sql_find_object (const gchar* year);
-+static gchar* rygel_lms_image_year_get_sql_count (const gchar* year);
-+static gchar* rygel_lms_image_year_get_sql_added (const gchar* year);
-+static gchar* rygel_lms_image_year_get_sql_removed (const gchar* year);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSImageYear* rygel_lms_image_year_new (RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db);
-+RygelLMSImageYear* rygel_lms_image_year_construct (GType object_type, RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_image_year_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSImageYear * self;
-+ RygelMediaObject* result = NULL;
-+ gint id = 0;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ gint _tmp1_ = 0;
-+ gchar* path = NULL;
-+ sqlite3_stmt* _tmp2_ = NULL;
-+ const gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* mime_type = NULL;
-+ sqlite3_stmt* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ gboolean _tmp8_ = FALSE;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* title = NULL;
-+ sqlite3_stmt* _tmp15_ = NULL;
-+ const gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ RygelImageItem* image = NULL;
-+ gint _tmp18_ = 0;
-+ gchar* _tmp19_ = NULL;
-+ gchar* _tmp20_ = NULL;
-+ RygelImageItem* _tmp21_ = NULL;
-+ RygelImageItem* _tmp22_ = NULL;
-+ gint _tmp23_ = 0;
-+ gchar* _tmp24_ = NULL;
-+ gchar* _tmp25_ = NULL;
-+ sqlite3_stmt* _tmp26_ = NULL;
-+ const gchar* _tmp27_ = NULL;
-+ GTimeVal tv = {0};
-+ sqlite3_stmt* _tmp28_ = NULL;
-+ gint _tmp29_ = 0;
-+ GTimeVal _tmp30_ = {0};
-+ gchar* _tmp31_ = NULL;
-+ gchar* _tmp32_ = NULL;
-+ sqlite3_stmt* _tmp33_ = NULL;
-+ gint _tmp34_ = 0;
-+ sqlite3_stmt* _tmp35_ = NULL;
-+ gint _tmp36_ = 0;
-+ sqlite3_stmt* _tmp37_ = NULL;
-+ gint _tmp38_ = 0;
-+ const gchar* _tmp39_ = NULL;
-+ sqlite3_stmt* _tmp40_ = NULL;
-+ const gchar* _tmp41_ = NULL;
-+ GFile* file = NULL;
-+ const gchar* _tmp42_ = NULL;
-+ GFile* _tmp43_ = NULL;
-+ gchar* _tmp44_ = NULL;
-+ gchar* _tmp45_ = NULL;
-+ self = (RygelLMSImageYear*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_int (_tmp0_, 0);
-+ id = _tmp1_;
-+ _tmp2_ = statement;
-+ _tmp3_ = sqlite3_column_text (_tmp2_, 6);
-+ _tmp4_ = g_strdup (_tmp3_);
-+ path = _tmp4_;
-+ _tmp5_ = statement;
-+ _tmp6_ = sqlite3_column_text (_tmp5_, 9);
-+ _tmp7_ = g_strdup (_tmp6_);
-+ mime_type = _tmp7_;
-+ _tmp9_ = mime_type;
-+ if (_tmp9_ == NULL) {
-+ _tmp8_ = TRUE;
-+ } else {
-+ const gchar* _tmp10_ = NULL;
-+ gint _tmp11_ = 0;
-+ gint _tmp12_ = 0;
-+ _tmp10_ = mime_type;
-+ _tmp11_ = strlen (_tmp10_);
-+ _tmp12_ = _tmp11_;
-+ _tmp8_ = _tmp12_ == 0;
-+ }
-+ if (_tmp8_) {
-+ gint _tmp13_ = 0;
-+ const gchar* _tmp14_ = NULL;
-+ _tmp13_ = id;
-+ _tmp14_ = path;
-+ g_debug ("rygel-lms-image-year.vala:62: Image item %d (%s) has no MIME type", _tmp13_, _tmp14_);
-+ }
-+ _tmp15_ = statement;
-+ _tmp16_ = sqlite3_column_text (_tmp15_, 1);
-+ _tmp17_ = g_strdup (_tmp16_);
-+ title = _tmp17_;
-+ _tmp18_ = id;
-+ _tmp19_ = rygel_lms_category_container_build_child_id ((RygelLMSCategoryContainer*) self, _tmp18_);
-+ _tmp20_ = _tmp19_;
-+ _tmp21_ = rygel_image_item_new (_tmp20_, (RygelMediaContainer*) self, title, RYGEL_IMAGE_ITEM_UPNP_CLASS);
-+ _tmp22_ = _tmp21_;
-+ _g_free0 (_tmp20_);
-+ image = _tmp22_;
-+ _tmp23_ = id;
-+ _tmp24_ = rygel_lms_category_container_build_reference_id ((RygelLMSCategoryContainer*) self, _tmp23_);
-+ _tmp25_ = _tmp24_;
-+ rygel_media_object_set_ref_id ((RygelMediaObject*) image, _tmp25_);
-+ _g_free0 (_tmp25_);
-+ _tmp26_ = statement;
-+ _tmp27_ = sqlite3_column_text (_tmp26_, 2);
-+ rygel_media_object_set_creator ((RygelMediaObject*) image, _tmp27_);
-+ _tmp28_ = statement;
-+ _tmp29_ = sqlite3_column_int (_tmp28_, 3);
-+ _tmp30_.tv_sec = (glong) _tmp29_;
-+ _tmp30_.tv_usec = (glong) 0;
-+ tv = _tmp30_;
-+ _tmp31_ = g_time_val_to_iso8601 (&tv);
-+ _tmp32_ = _tmp31_;
-+ rygel_media_object_set_date ((RygelMediaObject*) image, _tmp32_);
-+ _g_free0 (_tmp32_);
-+ _tmp33_ = statement;
-+ _tmp34_ = sqlite3_column_int (_tmp33_, 4);
-+ rygel_visual_item_set_width ((RygelVisualItem*) image, _tmp34_);
-+ _tmp35_ = statement;
-+ _tmp36_ = sqlite3_column_int (_tmp35_, 5);
-+ rygel_visual_item_set_height ((RygelVisualItem*) image, _tmp36_);
-+ _tmp37_ = statement;
-+ _tmp38_ = sqlite3_column_int (_tmp37_, 7);
-+ rygel_media_file_item_set_size ((RygelMediaFileItem*) image, (gint64) _tmp38_);
-+ _tmp39_ = mime_type;
-+ rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) image, _tmp39_);
-+ _tmp40_ = statement;
-+ _tmp41_ = sqlite3_column_text (_tmp40_, 8);
-+ rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) image, _tmp41_);
-+ _tmp42_ = path;
-+ _tmp43_ = g_file_new_for_path (_tmp42_);
-+ file = _tmp43_;
-+ _tmp44_ = g_file_get_uri (file);
-+ _tmp45_ = _tmp44_;
-+ rygel_media_object_add_uri ((RygelMediaObject*) image, _tmp45_);
-+ _g_free0 (_tmp45_);
-+ result = (RygelMediaObject*) image;
-+ _g_object_unref0 (file);
-+ _g_free0 (title);
-+ _g_free0 (mime_type);
-+ _g_free0 (path);
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_image_year_get_sql_all (const gchar* year) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (year != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_IMAGE_YEAR_SQL_ALL_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_image_year_get_sql_find_object (const gchar* year) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (year != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_IMAGE_YEAR_SQL_FIND_OBJECT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_image_year_get_sql_count (const gchar* year) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (year != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_IMAGE_YEAR_SQL_COUNT_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_image_year_get_sql_added (const gchar* year) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (year != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_IMAGE_YEAR_SQL_ADDED_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+static gchar* rygel_lms_image_year_get_sql_removed (const gchar* year) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (year != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf (RYGEL_LMS_IMAGE_YEAR_SQL_REMOVED_TEMPLATE, _tmp0_);
-+ result = _tmp1_;
-+ return result;
-+}
-+
-+
-+RygelLMSImageYear* rygel_lms_image_year_construct (GType object_type, RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db) {
-+ RygelLMSImageYear * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ gchar* _tmp2_ = NULL;
-+ RygelMediaContainer* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ RygelLMSDatabase* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ gchar* _tmp7_ = NULL;
-+ gchar* _tmp8_ = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ gchar* _tmp10_ = NULL;
-+ gchar* _tmp11_ = NULL;
-+ const gchar* _tmp12_ = NULL;
-+ gchar* _tmp13_ = NULL;
-+ gchar* _tmp14_ = NULL;
-+ const gchar* _tmp15_ = NULL;
-+ gchar* _tmp16_ = NULL;
-+ gchar* _tmp17_ = NULL;
-+ const gchar* _tmp18_ = NULL;
-+ gchar* _tmp19_ = NULL;
-+ gchar* _tmp20_ = NULL;
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (year != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = year;
-+ _tmp1_ = g_strdup_printf ("%s", _tmp0_);
-+ _tmp2_ = _tmp1_;
-+ _tmp3_ = parent;
-+ _tmp4_ = year;
-+ _tmp5_ = lms_db;
-+ _tmp6_ = year;
-+ _tmp7_ = rygel_lms_image_year_get_sql_all (_tmp6_);
-+ _tmp8_ = _tmp7_;
-+ _tmp9_ = year;
-+ _tmp10_ = rygel_lms_image_year_get_sql_find_object (_tmp9_);
-+ _tmp11_ = _tmp10_;
-+ _tmp12_ = year;
-+ _tmp13_ = rygel_lms_image_year_get_sql_count (_tmp12_);
-+ _tmp14_ = _tmp13_;
-+ _tmp15_ = year;
-+ _tmp16_ = rygel_lms_image_year_get_sql_added (_tmp15_);
-+ _tmp17_ = _tmp16_;
-+ _tmp18_ = year;
-+ _tmp19_ = rygel_lms_image_year_get_sql_removed (_tmp18_);
-+ _tmp20_ = _tmp19_;
-+ self = (RygelLMSImageYear*) rygel_lms_category_container_construct (object_type, _tmp2_, _tmp3_, _tmp4_, _tmp5_, _tmp8_, _tmp11_, _tmp14_, _tmp17_, _tmp20_);
-+ _g_free0 (_tmp20_);
-+ _g_free0 (_tmp17_);
-+ _g_free0 (_tmp14_);
-+ _g_free0 (_tmp11_);
-+ _g_free0 (_tmp8_);
-+ _g_free0 (_tmp2_);
-+ return self;
-+}
-+
-+
-+RygelLMSImageYear* rygel_lms_image_year_new (RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_image_year_construct (RYGEL_LMS_TYPE_IMAGE_YEAR, parent, year, lms_db);
-+}
-+
-+
-+static void rygel_lms_image_year_class_init (RygelLMSImageYearClass * klass) {
-+ rygel_lms_image_year_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_image_year_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_image_year_instance_init (RygelLMSImageYear * self) {
-+}
-+
-+
-+GType rygel_lms_image_year_get_type (void) {
-+ static volatile gsize rygel_lms_image_year_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_image_year_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSImageYearClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_image_year_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSImageYear), 0, (GInstanceInitFunc) rygel_lms_image_year_instance_init, NULL };
-+ GType rygel_lms_image_year_type_id;
-+ rygel_lms_image_year_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSImageYear", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_image_year_type_id__volatile, rygel_lms_image_year_type_id);
-+ }
-+ return rygel_lms_image_year_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-image-years.c b/src/plugins/lms/rygel-lms-image-years.c
-new file mode 100644
-index 0000000..35033a0
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-image-years.c
-@@ -0,0 +1,196 @@
-+/* rygel-lms-image-years.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-image-years.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <sqlite3.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+typedef struct _RygelLMSCategoryContainerPrivate RygelLMSCategoryContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_IMAGE_YEARS (rygel_lms_image_years_get_type ())
-+#define RYGEL_LMS_IMAGE_YEARS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYears))
-+#define RYGEL_LMS_IMAGE_YEARS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYearsClass))
-+#define RYGEL_LMS_IS_IMAGE_YEARS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS))
-+#define RYGEL_LMS_IS_IMAGE_YEARS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_YEARS))
-+#define RYGEL_LMS_IMAGE_YEARS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_YEARS, RygelLMSImageYearsClass))
-+
-+typedef struct _RygelLMSImageYears RygelLMSImageYears;
-+typedef struct _RygelLMSImageYearsClass RygelLMSImageYearsClass;
-+typedef struct _RygelLMSImageYearsPrivate RygelLMSImageYearsPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+#define RYGEL_LMS_TYPE_IMAGE_YEAR (rygel_lms_image_year_get_type ())
-+#define RYGEL_LMS_IMAGE_YEAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYear))
-+#define RYGEL_LMS_IMAGE_YEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYearClass))
-+#define RYGEL_LMS_IS_IMAGE_YEAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR))
-+#define RYGEL_LMS_IS_IMAGE_YEAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_YEAR))
-+#define RYGEL_LMS_IMAGE_YEAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_YEAR, RygelLMSImageYearClass))
-+
-+typedef struct _RygelLMSImageYear RygelLMSImageYear;
-+typedef struct _RygelLMSImageYearClass RygelLMSImageYearClass;
-+
-+struct _RygelLMSCategoryContainer {
-+ RygelMediaContainer parent_instance;
-+ RygelLMSCategoryContainerPrivate * priv;
-+ sqlite3_stmt* stmt_all;
-+ sqlite3_stmt* stmt_find_object;
-+ sqlite3_stmt* stmt_added;
-+ sqlite3_stmt* stmt_removed;
-+ gchar* child_prefix;
-+ gchar* ref_prefix;
-+};
-+
-+struct _RygelLMSCategoryContainerClass {
-+ RygelMediaContainerClass parent_class;
-+ RygelMediaObject* (*object_from_statement) (RygelLMSCategoryContainer* self, sqlite3_stmt* statement);
-+ gchar* (*get_sql_all_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ gchar* (*get_sql_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* filter);
-+ guint (*get_child_count_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args);
-+ RygelMediaObjects* (*get_children_with_filter) (RygelLMSCategoryContainer* self, const gchar* where_filter, GValueArray* args, const gchar* sort_criteria, guint offset, guint max_count);
-+};
-+
-+struct _RygelLMSImageYears {
-+ RygelLMSCategoryContainer parent_instance;
-+ RygelLMSImageYearsPrivate * priv;
-+};
-+
-+struct _RygelLMSImageYearsClass {
-+ RygelLMSCategoryContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_image_years_parent_class = NULL;
-+
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_image_years_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_IMAGE_YEARS_DUMMY_PROPERTY
-+};
-+#define RYGEL_LMS_IMAGE_YEARS_SQL_ALL "SELECT DISTINCT(strftime('%Y', images.date, 'unixepoch')) as year " "FROM images " "LIMIT ? OFFSET ?;"
-+#define RYGEL_LMS_IMAGE_YEARS_SQL_COUNT "SELECT COUNT(DISTINCT(strftime('%Y', images.date, 'unixepoch'))) " "FROM images;"
-+#define RYGEL_LMS_IMAGE_YEARS_SQL_FIND_OBJECT "SELECT strftime('%Y', images.date, 'unixepoch') as year " "FROM images " "WHERE year = CAST(? AS TEXT)"
-+static RygelMediaObject* rygel_lms_image_years_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement);
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSDatabase* rygel_lms_category_container_get_lms_db (RygelLMSCategoryContainer* self);
-+RygelLMSImageYear* rygel_lms_image_year_new (RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db);
-+RygelLMSImageYear* rygel_lms_image_year_construct (GType object_type, RygelMediaContainer* parent, const gchar* year, RygelLMSDatabase* lms_db);
-+GType rygel_lms_image_year_get_type (void) G_GNUC_CONST;
-+RygelLMSImageYears* rygel_lms_image_years_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSImageYears* rygel_lms_image_years_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSCategoryContainer* rygel_lms_category_container_construct (GType object_type, const gchar* db_id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db, const gchar* sql_all, const gchar* sql_find_object, const gchar* sql_count, const gchar* sql_added, const gchar* sql_removed);
-+
-+
-+static RygelMediaObject* rygel_lms_image_years_real_object_from_statement (RygelLMSCategoryContainer* base, sqlite3_stmt* statement) {
-+ RygelLMSImageYears * self;
-+ RygelMediaObject* result = NULL;
-+ sqlite3_stmt* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ RygelLMSImageYear* _tmp4_ = NULL;
-+ self = (RygelLMSImageYears*) base;
-+ g_return_val_if_fail (statement != NULL, NULL);
-+ _tmp0_ = statement;
-+ _tmp1_ = sqlite3_column_text (_tmp0_, 0);
-+ _tmp2_ = rygel_lms_category_container_get_lms_db ((RygelLMSCategoryContainer*) self);
-+ _tmp3_ = _tmp2_;
-+ _tmp4_ = rygel_lms_image_year_new ((RygelMediaContainer*) self, _tmp1_, _tmp3_);
-+ result = (RygelMediaObject*) _tmp4_;
-+ return result;
-+}
-+
-+
-+RygelLMSImageYears* rygel_lms_image_years_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ RygelLMSImageYears * self = NULL;
-+ RygelMediaContainer* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ RygelLMSDatabase* _tmp2_ = NULL;
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = parent;
-+ _tmp1_ = _ ("Years");
-+ _tmp2_ = lms_db;
-+ self = (RygelLMSImageYears*) rygel_lms_category_container_construct (object_type, "years", _tmp0_, _tmp1_, _tmp2_, RYGEL_LMS_IMAGE_YEARS_SQL_ALL, RYGEL_LMS_IMAGE_YEARS_SQL_FIND_OBJECT, RYGEL_LMS_IMAGE_YEARS_SQL_COUNT, NULL, NULL);
-+ return self;
-+}
-+
-+
-+RygelLMSImageYears* rygel_lms_image_years_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_image_years_construct (RYGEL_LMS_TYPE_IMAGE_YEARS, parent, lms_db);
-+}
-+
-+
-+static void rygel_lms_image_years_class_init (RygelLMSImageYearsClass * klass) {
-+ rygel_lms_image_years_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSCategoryContainerClass *) klass)->object_from_statement = rygel_lms_image_years_real_object_from_statement;
-+}
-+
-+
-+static void rygel_lms_image_years_instance_init (RygelLMSImageYears * self) {
-+}
-+
-+
-+GType rygel_lms_image_years_get_type (void) {
-+ static volatile gsize rygel_lms_image_years_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_image_years_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSImageYearsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_image_years_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSImageYears), 0, (GInstanceInitFunc) rygel_lms_image_years_instance_init, NULL };
-+ GType rygel_lms_image_years_type_id;
-+ rygel_lms_image_years_type_id = g_type_register_static (RYGEL_LMS_TYPE_CATEGORY_CONTAINER, "RygelLMSImageYears", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_image_years_type_id__volatile, rygel_lms_image_years_type_id);
-+ }
-+ return rygel_lms_image_years_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-music-root.c b/src/plugins/lms/rygel-lms-music-root.c
-new file mode 100644
-index 0000000..753906d
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-music-root.c
-@@ -0,0 +1,202 @@
-+/* rygel-lms-music-root.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-music-root.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_MUSIC_ROOT (rygel_lms_music_root_get_type ())
-+#define RYGEL_LMS_MUSIC_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRoot))
-+#define RYGEL_LMS_MUSIC_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRootClass))
-+#define RYGEL_LMS_IS_MUSIC_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT))
-+#define RYGEL_LMS_IS_MUSIC_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_MUSIC_ROOT))
-+#define RYGEL_LMS_MUSIC_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRootClass))
-+
-+typedef struct _RygelLMSMusicRoot RygelLMSMusicRoot;
-+typedef struct _RygelLMSMusicRootClass RygelLMSMusicRootClass;
-+typedef struct _RygelLMSMusicRootPrivate RygelLMSMusicRootPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+
-+#define RYGEL_LMS_TYPE_ALL_MUSIC (rygel_lms_all_music_get_type ())
-+#define RYGEL_LMS_ALL_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusic))
-+#define RYGEL_LMS_ALL_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusicClass))
-+#define RYGEL_LMS_IS_ALL_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_MUSIC))
-+#define RYGEL_LMS_IS_ALL_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_MUSIC))
-+#define RYGEL_LMS_ALL_MUSIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_MUSIC, RygelLMSAllMusicClass))
-+
-+typedef struct _RygelLMSAllMusic RygelLMSAllMusic;
-+typedef struct _RygelLMSAllMusicClass RygelLMSAllMusicClass;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_ARTISTS (rygel_lms_artists_get_type ())
-+#define RYGEL_LMS_ARTISTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtists))
-+#define RYGEL_LMS_ARTISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtistsClass))
-+#define RYGEL_LMS_IS_ARTISTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ARTISTS))
-+#define RYGEL_LMS_IS_ARTISTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ARTISTS))
-+#define RYGEL_LMS_ARTISTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ARTISTS, RygelLMSArtistsClass))
-+
-+typedef struct _RygelLMSArtists RygelLMSArtists;
-+typedef struct _RygelLMSArtistsClass RygelLMSArtistsClass;
-+
-+#define RYGEL_LMS_TYPE_ALBUMS (rygel_lms_albums_get_type ())
-+#define RYGEL_LMS_ALBUMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbums))
-+#define RYGEL_LMS_ALBUMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbumsClass))
-+#define RYGEL_LMS_IS_ALBUMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALBUMS))
-+#define RYGEL_LMS_IS_ALBUMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALBUMS))
-+#define RYGEL_LMS_ALBUMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALBUMS, RygelLMSAlbumsClass))
-+
-+typedef struct _RygelLMSAlbums RygelLMSAlbums;
-+typedef struct _RygelLMSAlbumsClass RygelLMSAlbumsClass;
-+
-+struct _RygelLMSMusicRoot {
-+ RygelSimpleContainer parent_instance;
-+ RygelLMSMusicRootPrivate * priv;
-+};
-+
-+struct _RygelLMSMusicRootClass {
-+ RygelSimpleContainerClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_music_root_parent_class = NULL;
-+
-+GType rygel_lms_music_root_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_MUSIC_ROOT_DUMMY_PROPERTY
-+};
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+RygelLMSMusicRoot* rygel_lms_music_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSMusicRoot* rygel_lms_music_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAllMusic* rygel_lms_all_music_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAllMusic* rygel_lms_all_music_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_music_get_type (void) G_GNUC_CONST;
-+RygelLMSArtists* rygel_lms_artists_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSArtists* rygel_lms_artists_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_artists_get_type (void) G_GNUC_CONST;
-+RygelLMSAlbums* rygel_lms_albums_new (RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+RygelLMSAlbums* rygel_lms_albums_construct (GType object_type, RygelMediaContainer* parent, RygelLMSDatabase* lms_db);
-+GType rygel_lms_albums_get_type (void) G_GNUC_CONST;
-+
-+
-+RygelLMSMusicRoot* rygel_lms_music_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ RygelLMSMusicRoot * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ RygelMediaContainer* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ RygelLMSDatabase* _tmp3_ = NULL;
-+ RygelLMSAllMusic* _tmp4_ = NULL;
-+ RygelLMSAllMusic* _tmp5_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ RygelLMSDatabase* _tmp7_ = NULL;
-+ RygelLMSArtists* _tmp8_ = NULL;
-+ RygelLMSArtists* _tmp9_ = NULL;
-+ RygelLMSDatabase* _tmp10_ = NULL;
-+ RygelLMSAlbums* _tmp11_ = NULL;
-+ RygelLMSAlbums* _tmp12_ = NULL;
-+ g_return_val_if_fail (id != NULL, NULL);
-+ g_return_val_if_fail (parent != NULL, NULL);
-+ g_return_val_if_fail (title != NULL, NULL);
-+ g_return_val_if_fail (lms_db != NULL, NULL);
-+ _tmp0_ = id;
-+ _tmp1_ = parent;
-+ _tmp2_ = title;
-+ self = (RygelLMSMusicRoot*) rygel_simple_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_);
-+ _tmp3_ = lms_db;
-+ _tmp4_ = rygel_lms_all_music_new ((RygelMediaContainer*) self, _tmp3_);
-+ _tmp5_ = _tmp4_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp5_);
-+ _g_object_unref0 (_tmp5_);
-+ _tmp6_ = _ ("Artists");
-+ _tmp7_ = lms_db;
-+ _tmp8_ = rygel_lms_artists_new ("artists", (RygelMediaContainer*) self, _tmp6_, _tmp7_);
-+ _tmp9_ = _tmp8_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp9_);
-+ _g_object_unref0 (_tmp9_);
-+ _tmp10_ = lms_db;
-+ _tmp11_ = rygel_lms_albums_new ((RygelMediaContainer*) self, _tmp10_);
-+ _tmp12_ = _tmp11_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp12_);
-+ _g_object_unref0 (_tmp12_);
-+ return self;
-+}
-+
-+
-+RygelLMSMusicRoot* rygel_lms_music_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db) {
-+ return rygel_lms_music_root_construct (RYGEL_LMS_TYPE_MUSIC_ROOT, id, parent, title, lms_db);
-+}
-+
-+
-+static void rygel_lms_music_root_class_init (RygelLMSMusicRootClass * klass) {
-+ rygel_lms_music_root_parent_class = g_type_class_peek_parent (klass);
-+}
-+
-+
-+static void rygel_lms_music_root_instance_init (RygelLMSMusicRoot * self) {
-+}
-+
-+
-+GType rygel_lms_music_root_get_type (void) {
-+ static volatile gsize rygel_lms_music_root_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_music_root_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSMusicRootClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_music_root_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSMusicRoot), 0, (GInstanceInitFunc) rygel_lms_music_root_instance_init, NULL };
-+ GType rygel_lms_music_root_type_id;
-+ rygel_lms_music_root_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelLMSMusicRoot", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_music_root_type_id__volatile, rygel_lms_music_root_type_id);
-+ }
-+ return rygel_lms_music_root_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-plugin-factory.c b/src/plugins/lms/rygel-lms-plugin-factory.c
-new file mode 100644
-index 0000000..de4a5ab
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-plugin-factory.c
-@@ -0,0 +1,307 @@
-+/* rygel-lms-plugin-factory.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-plugin-factory.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-core.h>
-+#include <rygel-server.h>
-+#include <gobject/gvaluecollector.h>
-+
-+
-+#define RYGEL_LMS_TYPE_PLUGIN_FACTORY (rygel_lms_plugin_factory_get_type ())
-+#define RYGEL_LMS_PLUGIN_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_PLUGIN_FACTORY, RygelLMSPluginFactory))
-+#define RYGEL_LMS_PLUGIN_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_PLUGIN_FACTORY, RygelLMSPluginFactoryClass))
-+#define RYGEL_LMS_IS_PLUGIN_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_PLUGIN_FACTORY))
-+#define RYGEL_LMS_IS_PLUGIN_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_PLUGIN_FACTORY))
-+#define RYGEL_LMS_PLUGIN_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_PLUGIN_FACTORY, RygelLMSPluginFactoryClass))
-+
-+typedef struct _RygelLMSPluginFactory RygelLMSPluginFactory;
-+typedef struct _RygelLMSPluginFactoryClass RygelLMSPluginFactoryClass;
-+#define _rygel_lms_plugin_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_lms_plugin_factory_unref (var), NULL)))
-+typedef struct _RygelLMSPluginFactoryPrivate RygelLMSPluginFactoryPrivate;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_PLUGIN (rygel_lms_plugin_get_type ())
-+#define RYGEL_LMS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPlugin))
-+#define RYGEL_LMS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPluginClass))
-+#define RYGEL_LMS_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_PLUGIN))
-+#define RYGEL_LMS_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_PLUGIN))
-+#define RYGEL_LMS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPluginClass))
-+
-+typedef struct _RygelLMSPlugin RygelLMSPlugin;
-+typedef struct _RygelLMSPluginClass RygelLMSPluginClass;
-+typedef struct _RygelLMSParamSpecPluginFactory RygelLMSParamSpecPluginFactory;
-+
-+struct _RygelLMSPluginFactory {
-+ GTypeInstance parent_instance;
-+ volatile int ref_count;
-+ RygelLMSPluginFactoryPrivate * priv;
-+};
-+
-+struct _RygelLMSPluginFactoryClass {
-+ GTypeClass parent_class;
-+ void (*finalize) (RygelLMSPluginFactory *self);
-+};
-+
-+struct _RygelLMSPluginFactoryPrivate {
-+ RygelPluginLoader* loader;
-+};
-+
-+struct _RygelLMSParamSpecPluginFactory {
-+ GParamSpec parent_instance;
-+};
-+
-+
-+extern RygelLMSPluginFactory* plugin_factory;
-+RygelLMSPluginFactory* plugin_factory = NULL;
-+static gpointer rygel_lms_plugin_factory_parent_class = NULL;
-+
-+gpointer rygel_lms_plugin_factory_ref (gpointer instance);
-+void rygel_lms_plugin_factory_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_plugin_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_plugin_factory (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_plugin_factory (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_plugin_factory (const GValue* value);
-+GType rygel_lms_plugin_factory_get_type (void) G_GNUC_CONST;
-+void module_init (RygelPluginLoader* loader);
-+RygelLMSPluginFactory* rygel_lms_plugin_factory_new (RygelPluginLoader* loader);
-+RygelLMSPluginFactory* rygel_lms_plugin_factory_construct (GType object_type, RygelPluginLoader* loader);
-+#define RYGEL_LMS_PLUGIN_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_LMS_TYPE_PLUGIN_FACTORY, RygelLMSPluginFactoryPrivate))
-+enum {
-+ RYGEL_LMS_PLUGIN_FACTORY_DUMMY_PROPERTY
-+};
-+RygelLMSPlugin* rygel_lms_plugin_new (void);
-+RygelLMSPlugin* rygel_lms_plugin_construct (GType object_type);
-+GType rygel_lms_plugin_get_type (void) G_GNUC_CONST;
-+static void rygel_lms_plugin_factory_finalize (RygelLMSPluginFactory* obj);
-+
-+
-+void module_init (RygelPluginLoader* loader) {
-+ RygelPluginLoader* _tmp0_ = NULL;
-+ RygelLMSPluginFactory* _tmp1_ = NULL;
-+ g_return_if_fail (loader != NULL);
-+ _tmp0_ = loader;
-+ _tmp1_ = rygel_lms_plugin_factory_new (_tmp0_);
-+ _rygel_lms_plugin_factory_unref0 (plugin_factory);
-+ plugin_factory = _tmp1_;
-+}
-+
-+
-+static gpointer _g_object_ref0 (gpointer self) {
-+ return self ? g_object_ref (self) : NULL;
-+}
-+
-+
-+RygelLMSPluginFactory* rygel_lms_plugin_factory_construct (GType object_type, RygelPluginLoader* loader) {
-+ RygelLMSPluginFactory* self = NULL;
-+ RygelPluginLoader* _tmp0_ = NULL;
-+ RygelPluginLoader* _tmp1_ = NULL;
-+ RygelPluginLoader* _tmp2_ = NULL;
-+ RygelLMSPlugin* _tmp3_ = NULL;
-+ RygelLMSPlugin* _tmp4_ = NULL;
-+ g_return_val_if_fail (loader != NULL, NULL);
-+ self = (RygelLMSPluginFactory*) g_type_create_instance (object_type);
-+ _tmp0_ = loader;
-+ _tmp1_ = _g_object_ref0 (_tmp0_);
-+ _g_object_unref0 (self->priv->loader);
-+ self->priv->loader = _tmp1_;
-+ _tmp2_ = self->priv->loader;
-+ _tmp3_ = rygel_lms_plugin_new ();
-+ _tmp4_ = _tmp3_;
-+ rygel_plugin_loader_add_plugin (_tmp2_, (RygelPlugin*) _tmp4_);
-+ _g_object_unref0 (_tmp4_);
-+ return self;
-+}
-+
-+
-+RygelLMSPluginFactory* rygel_lms_plugin_factory_new (RygelPluginLoader* loader) {
-+ return rygel_lms_plugin_factory_construct (RYGEL_LMS_TYPE_PLUGIN_FACTORY, loader);
-+}
-+
-+
-+static void rygel_lms_value_plugin_factory_init (GValue* value) {
-+ value->data[0].v_pointer = NULL;
-+}
-+
-+
-+static void rygel_lms_value_plugin_factory_free_value (GValue* value) {
-+ if (value->data[0].v_pointer) {
-+ rygel_lms_plugin_factory_unref (value->data[0].v_pointer);
-+ }
-+}
-+
-+
-+static void rygel_lms_value_plugin_factory_copy_value (const GValue* src_value, GValue* dest_value) {
-+ if (src_value->data[0].v_pointer) {
-+ dest_value->data[0].v_pointer = rygel_lms_plugin_factory_ref (src_value->data[0].v_pointer);
-+ } else {
-+ dest_value->data[0].v_pointer = NULL;
-+ }
-+}
-+
-+
-+static gpointer rygel_lms_value_plugin_factory_peek_pointer (const GValue* value) {
-+ return value->data[0].v_pointer;
-+}
-+
-+
-+static gchar* rygel_lms_value_plugin_factory_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
-+ if (collect_values[0].v_pointer) {
-+ RygelLMSPluginFactory* object;
-+ object = collect_values[0].v_pointer;
-+ if (object->parent_instance.g_class == NULL) {
-+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
-+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-+ }
-+ value->data[0].v_pointer = rygel_lms_plugin_factory_ref (object);
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ return NULL;
-+}
-+
-+
-+static gchar* rygel_lms_value_plugin_factory_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
-+ RygelLMSPluginFactory** object_p;
-+ object_p = collect_values[0].v_pointer;
-+ if (!object_p) {
-+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
-+ }
-+ if (!value->data[0].v_pointer) {
-+ *object_p = NULL;
-+ } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
-+ *object_p = value->data[0].v_pointer;
-+ } else {
-+ *object_p = rygel_lms_plugin_factory_ref (value->data[0].v_pointer);
-+ }
-+ return NULL;
-+}
-+
-+
-+GParamSpec* rygel_lms_param_spec_plugin_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
-+ RygelLMSParamSpecPluginFactory* spec;
-+ g_return_val_if_fail (g_type_is_a (object_type, RYGEL_LMS_TYPE_PLUGIN_FACTORY), NULL);
-+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
-+ G_PARAM_SPEC (spec)->value_type = object_type;
-+ return G_PARAM_SPEC (spec);
-+}
-+
-+
-+gpointer rygel_lms_value_get_plugin_factory (const GValue* value) {
-+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_PLUGIN_FACTORY), NULL);
-+ return value->data[0].v_pointer;
-+}
-+
-+
-+void rygel_lms_value_set_plugin_factory (GValue* value, gpointer v_object) {
-+ RygelLMSPluginFactory* old;
-+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_PLUGIN_FACTORY));
-+ old = value->data[0].v_pointer;
-+ if (v_object) {
-+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_LMS_TYPE_PLUGIN_FACTORY));
-+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
-+ value->data[0].v_pointer = v_object;
-+ rygel_lms_plugin_factory_ref (value->data[0].v_pointer);
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ if (old) {
-+ rygel_lms_plugin_factory_unref (old);
-+ }
-+}
-+
-+
-+void rygel_lms_value_take_plugin_factory (GValue* value, gpointer v_object) {
-+ RygelLMSPluginFactory* old;
-+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_LMS_TYPE_PLUGIN_FACTORY));
-+ old = value->data[0].v_pointer;
-+ if (v_object) {
-+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_LMS_TYPE_PLUGIN_FACTORY));
-+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
-+ value->data[0].v_pointer = v_object;
-+ } else {
-+ value->data[0].v_pointer = NULL;
-+ }
-+ if (old) {
-+ rygel_lms_plugin_factory_unref (old);
-+ }
-+}
-+
-+
-+static void rygel_lms_plugin_factory_class_init (RygelLMSPluginFactoryClass * klass) {
-+ rygel_lms_plugin_factory_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSPluginFactoryClass *) klass)->finalize = rygel_lms_plugin_factory_finalize;
-+ g_type_class_add_private (klass, sizeof (RygelLMSPluginFactoryPrivate));
-+}
-+
-+
-+static void rygel_lms_plugin_factory_instance_init (RygelLMSPluginFactory * self) {
-+ self->priv = RYGEL_LMS_PLUGIN_FACTORY_GET_PRIVATE (self);
-+ self->ref_count = 1;
-+}
-+
-+
-+static void rygel_lms_plugin_factory_finalize (RygelLMSPluginFactory* obj) {
-+ RygelLMSPluginFactory * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_PLUGIN_FACTORY, RygelLMSPluginFactory);
-+ g_signal_handlers_destroy (self);
-+ _g_object_unref0 (self->priv->loader);
-+}
-+
-+
-+GType rygel_lms_plugin_factory_get_type (void) {
-+ static volatile gsize rygel_lms_plugin_factory_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_plugin_factory_type_id__volatile)) {
-+ static const GTypeValueTable g_define_type_value_table = { rygel_lms_value_plugin_factory_init, rygel_lms_value_plugin_factory_free_value, rygel_lms_value_plugin_factory_copy_value, rygel_lms_value_plugin_factory_peek_pointer, "p", rygel_lms_value_plugin_factory_collect_value, "p", rygel_lms_value_plugin_factory_lcopy_value };
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSPluginFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_plugin_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSPluginFactory), 0, (GInstanceInitFunc) rygel_lms_plugin_factory_instance_init, &g_define_type_value_table };
-+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
-+ GType rygel_lms_plugin_factory_type_id;
-+ rygel_lms_plugin_factory_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelLMSPluginFactory", &g_define_type_info, &g_define_type_fundamental_info, 0);
-+ g_once_init_leave (&rygel_lms_plugin_factory_type_id__volatile, rygel_lms_plugin_factory_type_id);
-+ }
-+ return rygel_lms_plugin_factory_type_id__volatile;
-+}
-+
-+
-+gpointer rygel_lms_plugin_factory_ref (gpointer instance) {
-+ RygelLMSPluginFactory* self;
-+ self = instance;
-+ g_atomic_int_inc (&self->ref_count);
-+ return instance;
-+}
-+
-+
-+void rygel_lms_plugin_factory_unref (gpointer instance) {
-+ RygelLMSPluginFactory* self;
-+ self = instance;
-+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
-+ RYGEL_LMS_PLUGIN_FACTORY_GET_CLASS (self)->finalize (self);
-+ g_type_free_instance ((GTypeInstance *) self);
-+ }
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-plugin.c b/src/plugins/lms/rygel-lms-plugin.c
-new file mode 100644
-index 0000000..980de64
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-plugin.c
-@@ -0,0 +1,134 @@
-+/* rygel-lms-plugin.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-plugin.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <rygel-core.h>
-+
-+
-+#define RYGEL_LMS_TYPE_PLUGIN (rygel_lms_plugin_get_type ())
-+#define RYGEL_LMS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPlugin))
-+#define RYGEL_LMS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPluginClass))
-+#define RYGEL_LMS_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_PLUGIN))
-+#define RYGEL_LMS_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_PLUGIN))
-+#define RYGEL_LMS_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_PLUGIN, RygelLMSPluginClass))
-+
-+typedef struct _RygelLMSPlugin RygelLMSPlugin;
-+typedef struct _RygelLMSPluginClass RygelLMSPluginClass;
-+typedef struct _RygelLMSPluginPrivate RygelLMSPluginPrivate;
-+
-+#define RYGEL_LMS_TYPE_ROOT_CONTAINER (rygel_lms_root_container_get_type ())
-+#define RYGEL_LMS_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainer))
-+#define RYGEL_LMS_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainerClass))
-+#define RYGEL_LMS_IS_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER))
-+#define RYGEL_LMS_IS_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ROOT_CONTAINER))
-+#define RYGEL_LMS_ROOT_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainerClass))
-+
-+typedef struct _RygelLMSRootContainer RygelLMSRootContainer;
-+typedef struct _RygelLMSRootContainerClass RygelLMSRootContainerClass;
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+struct _RygelLMSPlugin {
-+ RygelMediaServerPlugin parent_instance;
-+ RygelLMSPluginPrivate * priv;
-+};
-+
-+struct _RygelLMSPluginClass {
-+ RygelMediaServerPluginClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_plugin_parent_class = NULL;
-+static RygelLMSRootContainer* rygel_lms_plugin_root;
-+static RygelLMSRootContainer* rygel_lms_plugin_root = NULL;
-+
-+GType rygel_lms_plugin_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_PLUGIN_DUMMY_PROPERTY
-+};
-+GType rygel_lms_root_container_get_type (void) G_GNUC_CONST;
-+#define RYGEL_LMS_PLUGIN_NAME "LMS"
-+RygelLMSPlugin* rygel_lms_plugin_new (void);
-+RygelLMSPlugin* rygel_lms_plugin_construct (GType object_type);
-+RygelLMSRootContainer* rygel_lms_root_container_new (void);
-+RygelLMSRootContainer* rygel_lms_root_container_construct (GType object_type);
-+static void rygel_lms_plugin_finalize (GObject* obj);
-+
-+
-+RygelLMSPlugin* rygel_lms_plugin_construct (GType object_type) {
-+ RygelLMSPlugin * self = NULL;
-+ RygelLMSRootContainer* _tmp0_ = NULL;
-+ RygelLMSRootContainer* _tmp2_ = NULL;
-+ _tmp0_ = rygel_lms_plugin_root;
-+ if (_tmp0_ == NULL) {
-+ RygelLMSRootContainer* _tmp1_ = NULL;
-+ _tmp1_ = rygel_lms_root_container_new ();
-+ _g_object_unref0 (rygel_lms_plugin_root);
-+ rygel_lms_plugin_root = _tmp1_;
-+ }
-+ _tmp2_ = rygel_lms_plugin_root;
-+ self = (RygelLMSPlugin*) rygel_media_server_plugin_construct (object_type, (RygelMediaContainer*) _tmp2_, RYGEL_LMS_PLUGIN_NAME, NULL, RYGEL_PLUGIN_CAPABILITIES_TRACK_CHANGES);
-+ return self;
-+}
-+
-+
-+RygelLMSPlugin* rygel_lms_plugin_new (void) {
-+ return rygel_lms_plugin_construct (RYGEL_LMS_TYPE_PLUGIN);
-+}
-+
-+
-+static void rygel_lms_plugin_class_init (RygelLMSPluginClass * klass) {
-+ rygel_lms_plugin_parent_class = g_type_class_peek_parent (klass);
-+ G_OBJECT_CLASS (klass)->finalize = rygel_lms_plugin_finalize;
-+}
-+
-+
-+static void rygel_lms_plugin_instance_init (RygelLMSPlugin * self) {
-+}
-+
-+
-+static void rygel_lms_plugin_finalize (GObject* obj) {
-+ RygelLMSPlugin * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_PLUGIN, RygelLMSPlugin);
-+ G_OBJECT_CLASS (rygel_lms_plugin_parent_class)->finalize (obj);
-+}
-+
-+
-+GType rygel_lms_plugin_get_type (void) {
-+ static volatile gsize rygel_lms_plugin_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_plugin_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSPlugin), 0, (GInstanceInitFunc) rygel_lms_plugin_instance_init, NULL };
-+ GType rygel_lms_plugin_type_id;
-+ rygel_lms_plugin_type_id = g_type_register_static (RYGEL_TYPE_MEDIA_SERVER_PLUGIN, "RygelLMSPlugin", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_plugin_type_id__volatile, rygel_lms_plugin_type_id);
-+ }
-+ return rygel_lms_plugin_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-root-container.c b/src/plugins/lms/rygel-lms-root-container.c
-new file mode 100644
-index 0000000..625ed2f
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-root-container.c
-@@ -0,0 +1,318 @@
-+/* rygel-lms-root-container.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-root-container.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2013 Intel Corporation.
-+ *
-+ * Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <rygel-server.h>
-+#include <rygel-core.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <glib/gi18n-lib.h>
-+
-+
-+#define RYGEL_LMS_TYPE_ROOT_CONTAINER (rygel_lms_root_container_get_type ())
-+#define RYGEL_LMS_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainer))
-+#define RYGEL_LMS_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainerClass))
-+#define RYGEL_LMS_IS_ROOT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER))
-+#define RYGEL_LMS_IS_ROOT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ROOT_CONTAINER))
-+#define RYGEL_LMS_ROOT_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainerClass))
-+
-+typedef struct _RygelLMSRootContainer RygelLMSRootContainer;
-+typedef struct _RygelLMSRootContainerClass RygelLMSRootContainerClass;
-+typedef struct _RygelLMSRootContainerPrivate RygelLMSRootContainerPrivate;
-+
-+#define RYGEL_LMS_TYPE_DATABASE (rygel_lms_database_get_type ())
-+#define RYGEL_LMS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabase))
-+#define RYGEL_LMS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+#define RYGEL_LMS_IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_DATABASE))
-+#define RYGEL_LMS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_DATABASE, RygelLMSDatabaseClass))
-+
-+typedef struct _RygelLMSDatabase RygelLMSDatabase;
-+typedef struct _RygelLMSDatabaseClass RygelLMSDatabaseClass;
-+#define _rygel_lms_database_unref0(var) ((var == NULL) ? NULL : (var = (rygel_lms_database_unref (var), NULL)))
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-+
-+#define RYGEL_LMS_TYPE_MUSIC_ROOT (rygel_lms_music_root_get_type ())
-+#define RYGEL_LMS_MUSIC_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRoot))
-+#define RYGEL_LMS_MUSIC_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRootClass))
-+#define RYGEL_LMS_IS_MUSIC_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT))
-+#define RYGEL_LMS_IS_MUSIC_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_MUSIC_ROOT))
-+#define RYGEL_LMS_MUSIC_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_MUSIC_ROOT, RygelLMSMusicRootClass))
-+
-+typedef struct _RygelLMSMusicRoot RygelLMSMusicRoot;
-+typedef struct _RygelLMSMusicRootClass RygelLMSMusicRootClass;
-+
-+#define RYGEL_LMS_TYPE_CATEGORY_CONTAINER (rygel_lms_category_container_get_type ())
-+#define RYGEL_LMS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainer))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_IS_CATEGORY_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_CATEGORY_CONTAINER))
-+#define RYGEL_LMS_CATEGORY_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_CATEGORY_CONTAINER, RygelLMSCategoryContainerClass))
-+
-+typedef struct _RygelLMSCategoryContainer RygelLMSCategoryContainer;
-+typedef struct _RygelLMSCategoryContainerClass RygelLMSCategoryContainerClass;
-+
-+#define RYGEL_LMS_TYPE_ALL_VIDEOS (rygel_lms_all_videos_get_type ())
-+#define RYGEL_LMS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideos))
-+#define RYGEL_LMS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))
-+#define RYGEL_LMS_IS_ALL_VIDEOS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS))
-+#define RYGEL_LMS_IS_ALL_VIDEOS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_ALL_VIDEOS))
-+#define RYGEL_LMS_ALL_VIDEOS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_ALL_VIDEOS, RygelLMSAllVideosClass))
-+
-+typedef struct _RygelLMSAllVideos RygelLMSAllVideos;
-+typedef struct _RygelLMSAllVideosClass RygelLMSAllVideosClass;
-+
-+#define RYGEL_LMS_TYPE_IMAGE_ROOT (rygel_lms_image_root_get_type ())
-+#define RYGEL_LMS_IMAGE_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRoot))
-+#define RYGEL_LMS_IMAGE_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRootClass))
-+#define RYGEL_LMS_IS_IMAGE_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT))
-+#define RYGEL_LMS_IS_IMAGE_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_IMAGE_ROOT))
-+#define RYGEL_LMS_IMAGE_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_IMAGE_ROOT, RygelLMSImageRootClass))
-+
-+typedef struct _RygelLMSImageRoot RygelLMSImageRoot;
-+typedef struct _RygelLMSImageRootClass RygelLMSImageRootClass;
-+
-+struct _RygelLMSRootContainer {
-+ RygelSimpleContainer parent_instance;
-+ RygelLMSRootContainerPrivate * priv;
-+};
-+
-+struct _RygelLMSRootContainerClass {
-+ RygelSimpleContainerClass parent_class;
-+};
-+
-+struct _RygelLMSRootContainerPrivate {
-+ RygelLMSDatabase* lms_db;
-+};
-+
-+typedef enum {
-+ RYGEL_LMS_DATABASE_ERROR_OPEN,
-+ RYGEL_LMS_DATABASE_ERROR_PREPARE,
-+ RYGEL_LMS_DATABASE_ERROR_BIND,
-+ RYGEL_LMS_DATABASE_ERROR_STEP,
-+ RYGEL_LMS_DATABASE_ERROR_NOT_FOUND
-+} RygelLMSDatabaseError;
-+#define RYGEL_LMS_DATABASE_ERROR rygel_lms_database_error_quark ()
-+
-+static gpointer rygel_lms_root_container_parent_class = NULL;
-+
-+GType rygel_lms_root_container_get_type (void) G_GNUC_CONST;
-+gpointer rygel_lms_database_ref (gpointer instance);
-+void rygel_lms_database_unref (gpointer instance);
-+GParamSpec* rygel_lms_param_spec_database (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-+void rygel_lms_value_set_database (GValue* value, gpointer v_object);
-+void rygel_lms_value_take_database (GValue* value, gpointer v_object);
-+gpointer rygel_lms_value_get_database (const GValue* value);
-+GType rygel_lms_database_get_type (void) G_GNUC_CONST;
-+#define RYGEL_LMS_ROOT_CONTAINER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainerPrivate))
-+enum {
-+ RYGEL_LMS_ROOT_CONTAINER_DUMMY_PROPERTY
-+};
-+RygelLMSRootContainer* rygel_lms_root_container_new (void);
-+RygelLMSRootContainer* rygel_lms_root_container_construct (GType object_type);
-+GQuark rygel_lms_database_error_quark (void);
-+RygelLMSDatabase* rygel_lms_database_new (GError** error);
-+RygelLMSDatabase* rygel_lms_database_construct (GType object_type, GError** error);
-+RygelLMSMusicRoot* rygel_lms_music_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSMusicRoot* rygel_lms_music_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_music_root_get_type (void) G_GNUC_CONST;
-+RygelLMSAllVideos* rygel_lms_all_videos_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSAllVideos* rygel_lms_all_videos_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_category_container_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_all_videos_get_type (void) G_GNUC_CONST;
-+RygelLMSImageRoot* rygel_lms_image_root_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+RygelLMSImageRoot* rygel_lms_image_root_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelLMSDatabase* lms_db);
-+GType rygel_lms_image_root_get_type (void) G_GNUC_CONST;
-+static void rygel_lms_root_container_finalize (GObject* obj);
-+
-+
-+RygelLMSRootContainer* rygel_lms_root_container_construct (GType object_type) {
-+ RygelLMSRootContainer * self = NULL;
-+ RygelMetaConfig* config = NULL;
-+ RygelMetaConfig* _tmp0_ = NULL;
-+ gchar* title = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ gchar* _tmp2_ = NULL;
-+ const gchar* _tmp6_ = NULL;
-+ GError * _inner_error_ = NULL;
-+ _tmp0_ = rygel_meta_config_get_default ();
-+ config = _tmp0_;
-+ _tmp1_ = _ ("Shared media");
-+ _tmp2_ = g_strdup (_tmp1_);
-+ title = _tmp2_;
-+ {
-+ gchar* _tmp3_ = NULL;
-+ gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ _tmp4_ = rygel_configuration_get_string ((RygelConfiguration*) config, "LightMediaScanner", "title", &_inner_error_);
-+ _tmp3_ = _tmp4_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ goto __catch0_g_error;
-+ }
-+ _tmp5_ = _tmp3_;
-+ _tmp3_ = NULL;
-+ _g_free0 (title);
-+ title = _tmp5_;
-+ _g_free0 (_tmp3_);
-+ }
-+ goto __finally0;
-+ __catch0_g_error:
-+ {
-+ GError* _error_ = NULL;
-+ _error_ = _inner_error_;
-+ _inner_error_ = NULL;
-+ _g_error_free0 (_error_);
-+ }
-+ __finally0:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (title);
-+ _g_object_unref0 (config);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _tmp6_ = title;
-+ self = (RygelLMSRootContainer*) rygel_simple_container_construct_root (object_type, _tmp6_);
-+ {
-+ RygelLMSDatabase* _tmp7_ = NULL;
-+ RygelLMSDatabase* _tmp8_ = NULL;
-+ RygelLMSDatabase* _tmp9_ = NULL;
-+ const gchar* _tmp10_ = NULL;
-+ RygelLMSDatabase* _tmp11_ = NULL;
-+ RygelLMSMusicRoot* _tmp12_ = NULL;
-+ RygelLMSMusicRoot* _tmp13_ = NULL;
-+ const gchar* _tmp14_ = NULL;
-+ RygelLMSDatabase* _tmp15_ = NULL;
-+ RygelLMSAllVideos* _tmp16_ = NULL;
-+ RygelLMSAllVideos* _tmp17_ = NULL;
-+ const gchar* _tmp18_ = NULL;
-+ RygelLMSDatabase* _tmp19_ = NULL;
-+ RygelLMSImageRoot* _tmp20_ = NULL;
-+ RygelLMSImageRoot* _tmp21_ = NULL;
-+ _tmp8_ = rygel_lms_database_new (&_inner_error_);
-+ _tmp7_ = _tmp8_;
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ if (_inner_error_->domain == RYGEL_LMS_DATABASE_ERROR) {
-+ goto __catch1_rygel_lms_database_error;
-+ }
-+ _g_free0 (title);
-+ _g_object_unref0 (config);
-+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _tmp9_ = _tmp7_;
-+ _tmp7_ = NULL;
-+ _rygel_lms_database_unref0 (self->priv->lms_db);
-+ self->priv->lms_db = _tmp9_;
-+ _tmp10_ = _ ("Music");
-+ _tmp11_ = self->priv->lms_db;
-+ _tmp12_ = rygel_lms_music_root_new ("music", (RygelMediaContainer*) self, _tmp10_, _tmp11_);
-+ _tmp13_ = _tmp12_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp13_);
-+ _g_object_unref0 (_tmp13_);
-+ _tmp14_ = _ ("Videos");
-+ _tmp15_ = self->priv->lms_db;
-+ _tmp16_ = rygel_lms_all_videos_new ("all-videos", (RygelMediaContainer*) self, _tmp14_, _tmp15_);
-+ _tmp17_ = _tmp16_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp17_);
-+ _g_object_unref0 (_tmp17_);
-+ _tmp18_ = _ ("Pictures");
-+ _tmp19_ = self->priv->lms_db;
-+ _tmp20_ = rygel_lms_image_root_new ("images", (RygelMediaContainer*) self, _tmp18_, _tmp19_);
-+ _tmp21_ = _tmp20_;
-+ rygel_simple_container_add_child_container ((RygelSimpleContainer*) self, (RygelMediaContainer*) _tmp21_);
-+ _g_object_unref0 (_tmp21_);
-+ _rygel_lms_database_unref0 (_tmp7_);
-+ }
-+ goto __finally1;
-+ __catch1_rygel_lms_database_error:
-+ {
-+ GError* e = NULL;
-+ GError* _tmp22_ = NULL;
-+ const gchar* _tmp23_ = NULL;
-+ e = _inner_error_;
-+ _inner_error_ = NULL;
-+ _tmp22_ = e;
-+ _tmp23_ = _tmp22_->message;
-+ g_warning ("rygel-lms-root-container.vala:49: %s\n", _tmp23_);
-+ _g_error_free0 (e);
-+ }
-+ __finally1:
-+ if (G_UNLIKELY (_inner_error_ != NULL)) {
-+ _g_free0 (title);
-+ _g_object_unref0 (config);
-+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
-+ g_clear_error (&_inner_error_);
-+ return NULL;
-+ }
-+ _g_free0 (title);
-+ _g_object_unref0 (config);
-+ return self;
-+}
-+
-+
-+RygelLMSRootContainer* rygel_lms_root_container_new (void) {
-+ return rygel_lms_root_container_construct (RYGEL_LMS_TYPE_ROOT_CONTAINER);
-+}
-+
-+
-+static void rygel_lms_root_container_class_init (RygelLMSRootContainerClass * klass) {
-+ rygel_lms_root_container_parent_class = g_type_class_peek_parent (klass);
-+ g_type_class_add_private (klass, sizeof (RygelLMSRootContainerPrivate));
-+ G_OBJECT_CLASS (klass)->finalize = rygel_lms_root_container_finalize;
-+}
-+
-+
-+static void rygel_lms_root_container_instance_init (RygelLMSRootContainer * self) {
-+ self->priv = RYGEL_LMS_ROOT_CONTAINER_GET_PRIVATE (self);
-+ self->priv->lms_db = NULL;
-+}
-+
-+
-+static void rygel_lms_root_container_finalize (GObject* obj) {
-+ RygelLMSRootContainer * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_ROOT_CONTAINER, RygelLMSRootContainer);
-+ _rygel_lms_database_unref0 (self->priv->lms_db);
-+ G_OBJECT_CLASS (rygel_lms_root_container_parent_class)->finalize (obj);
-+}
-+
-+
-+GType rygel_lms_root_container_get_type (void) {
-+ static volatile gsize rygel_lms_root_container_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_root_container_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSRootContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_root_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSRootContainer), 0, (GInstanceInitFunc) rygel_lms_root_container_instance_init, NULL };
-+ GType rygel_lms_root_container_type_id;
-+ rygel_lms_root_container_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelLMSRootContainer", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_root_container_type_id__volatile, rygel_lms_root_container_type_id);
-+ }
-+ return rygel_lms_root_container_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-sql-function.c b/src/plugins/lms/rygel-lms-sql-function.c
-new file mode 100644
-index 0000000..a56c7be
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-sql-function.c
-@@ -0,0 +1,146 @@
-+/* rygel-lms-sql-function.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-sql-function.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2010 Jens Georg <mail@jensge.org>.
-+ *
-+ * Author: Jens Georg <mail@jensge.org>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+
-+#define RYGEL_LMS_TYPE_SQL_OPERATOR (rygel_lms_sql_operator_get_type ())
-+#define RYGEL_LMS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperator))
-+#define RYGEL_LMS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+#define RYGEL_LMS_IS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_IS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_SQL_OPERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+
-+typedef struct _RygelLMSSqlOperator RygelLMSSqlOperator;
-+typedef struct _RygelLMSSqlOperatorClass RygelLMSSqlOperatorClass;
-+typedef struct _RygelLMSSqlOperatorPrivate RygelLMSSqlOperatorPrivate;
-+
-+#define RYGEL_LMS_TYPE_SQL_FUNCTION (rygel_lms_sql_function_get_type ())
-+#define RYGEL_LMS_SQL_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunction))
-+#define RYGEL_LMS_SQL_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunctionClass))
-+#define RYGEL_LMS_IS_SQL_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION))
-+#define RYGEL_LMS_IS_SQL_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_SQL_FUNCTION))
-+#define RYGEL_LMS_SQL_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_SQL_FUNCTION, RygelLMSSqlFunctionClass))
-+
-+typedef struct _RygelLMSSqlFunction RygelLMSSqlFunction;
-+typedef struct _RygelLMSSqlFunctionClass RygelLMSSqlFunctionClass;
-+typedef struct _RygelLMSSqlFunctionPrivate RygelLMSSqlFunctionPrivate;
-+
-+struct _RygelLMSSqlOperator {
-+ GObject parent_instance;
-+ RygelLMSSqlOperatorPrivate * priv;
-+ gchar* name;
-+ gchar* arg;
-+ gchar* collate;
-+};
-+
-+struct _RygelLMSSqlOperatorClass {
-+ GObjectClass parent_class;
-+ gchar* (*to_string) (RygelLMSSqlOperator* self);
-+};
-+
-+struct _RygelLMSSqlFunction {
-+ RygelLMSSqlOperator parent_instance;
-+ RygelLMSSqlFunctionPrivate * priv;
-+};
-+
-+struct _RygelLMSSqlFunctionClass {
-+ RygelLMSSqlOperatorClass parent_class;
-+};
-+
-+
-+static gpointer rygel_lms_sql_function_parent_class = NULL;
-+
-+GType rygel_lms_sql_operator_get_type (void) G_GNUC_CONST;
-+GType rygel_lms_sql_function_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_SQL_FUNCTION_DUMMY_PROPERTY
-+};
-+RygelLMSSqlFunction* rygel_lms_sql_function_new (const gchar* name, const gchar* arg);
-+RygelLMSSqlFunction* rygel_lms_sql_function_construct (GType object_type, const gchar* name, const gchar* arg);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new (const gchar* name, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct (GType object_type, const gchar* name, const gchar* arg, const gchar* collate);
-+static gchar* rygel_lms_sql_function_real_to_string (RygelLMSSqlOperator* base);
-+
-+
-+RygelLMSSqlFunction* rygel_lms_sql_function_construct (GType object_type, const gchar* name, const gchar* arg) {
-+ RygelLMSSqlFunction * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ g_return_val_if_fail (name != NULL, NULL);
-+ g_return_val_if_fail (arg != NULL, NULL);
-+ _tmp0_ = name;
-+ _tmp1_ = arg;
-+ self = (RygelLMSSqlFunction*) rygel_lms_sql_operator_construct (object_type, _tmp0_, _tmp1_, "");
-+ return self;
-+}
-+
-+
-+RygelLMSSqlFunction* rygel_lms_sql_function_new (const gchar* name, const gchar* arg) {
-+ return rygel_lms_sql_function_construct (RYGEL_LMS_TYPE_SQL_FUNCTION, name, arg);
-+}
-+
-+
-+static gchar* rygel_lms_sql_function_real_to_string (RygelLMSSqlOperator* base) {
-+ RygelLMSSqlFunction * self;
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ gchar* _tmp2_ = NULL;
-+ self = (RygelLMSSqlFunction*) base;
-+ _tmp0_ = ((RygelLMSSqlOperator*) self)->name;
-+ _tmp1_ = ((RygelLMSSqlOperator*) self)->arg;
-+ _tmp2_ = g_strdup_printf ("%s(%s,?)", _tmp0_, _tmp1_);
-+ result = _tmp2_;
-+ return result;
-+}
-+
-+
-+static void rygel_lms_sql_function_class_init (RygelLMSSqlFunctionClass * klass) {
-+ rygel_lms_sql_function_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSSqlOperatorClass *) klass)->to_string = rygel_lms_sql_function_real_to_string;
-+}
-+
-+
-+static void rygel_lms_sql_function_instance_init (RygelLMSSqlFunction * self) {
-+}
-+
-+
-+GType rygel_lms_sql_function_get_type (void) {
-+ static volatile gsize rygel_lms_sql_function_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_sql_function_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSSqlFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_sql_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSSqlFunction), 0, (GInstanceInitFunc) rygel_lms_sql_function_instance_init, NULL };
-+ GType rygel_lms_sql_function_type_id;
-+ rygel_lms_sql_function_type_id = g_type_register_static (RYGEL_LMS_TYPE_SQL_OPERATOR, "RygelLMSSqlFunction", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_sql_function_type_id__volatile, rygel_lms_sql_function_type_id);
-+ }
-+ return rygel_lms_sql_function_type_id__volatile;
-+}
-+
-+
-+
-diff --git a/src/plugins/lms/rygel-lms-sql-operator.c b/src/plugins/lms/rygel-lms-sql-operator.c
-new file mode 100644
-index 0000000..90db1a9
---- /dev/null
-+++ b/src/plugins/lms/rygel-lms-sql-operator.c
-@@ -0,0 +1,240 @@
-+/* rygel-lms-sql-operator.c generated by valac 0.28.0, the Vala compiler
-+ * generated from rygel-lms-sql-operator.vala, do not modify */
-+
-+/*
-+ * Copyright (C) 2010 Jens Georg <mail@jensge.org>.
-+ *
-+ * Author: Jens Georg <mail@jensge.org>
-+ *
-+ * This file is part of Rygel.
-+ *
-+ * Rygel is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * Rygel is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with this program; if not, write to the Free Software Foundation,
-+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <glib.h>
-+#include <glib-object.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <libgupnp-av/gupnp-av.h>
-+
-+
-+#define RYGEL_LMS_TYPE_SQL_OPERATOR (rygel_lms_sql_operator_get_type ())
-+#define RYGEL_LMS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperator))
-+#define RYGEL_LMS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+#define RYGEL_LMS_IS_SQL_OPERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_IS_SQL_OPERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_LMS_TYPE_SQL_OPERATOR))
-+#define RYGEL_LMS_SQL_OPERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperatorClass))
-+
-+typedef struct _RygelLMSSqlOperator RygelLMSSqlOperator;
-+typedef struct _RygelLMSSqlOperatorClass RygelLMSSqlOperatorClass;
-+typedef struct _RygelLMSSqlOperatorPrivate RygelLMSSqlOperatorPrivate;
-+#define _g_free0(var) (var = (g_free (var), NULL))
-+
-+struct _RygelLMSSqlOperator {
-+ GObject parent_instance;
-+ RygelLMSSqlOperatorPrivate * priv;
-+ gchar* name;
-+ gchar* arg;
-+ gchar* collate;
-+};
-+
-+struct _RygelLMSSqlOperatorClass {
-+ GObjectClass parent_class;
-+ gchar* (*to_string) (RygelLMSSqlOperator* self);
-+};
-+
-+
-+static gpointer rygel_lms_sql_operator_parent_class = NULL;
-+
-+GType rygel_lms_sql_operator_get_type (void) G_GNUC_CONST;
-+enum {
-+ RYGEL_LMS_SQL_OPERATOR_DUMMY_PROPERTY
-+};
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new (const gchar* name, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct (GType object_type, const gchar* name, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new_from_search_criteria_op (GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate);
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct_from_search_criteria_op (GType object_type, GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate);
-+gchar* rygel_lms_sql_operator_to_string (RygelLMSSqlOperator* self);
-+static gchar* rygel_lms_sql_operator_real_to_string (RygelLMSSqlOperator* self);
-+static void rygel_lms_sql_operator_finalize (GObject* obj);
-+
-+
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct (GType object_type, const gchar* name, const gchar* arg, const gchar* collate) {
-+ RygelLMSSqlOperator * self = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ gchar* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ const gchar* _tmp4_ = NULL;
-+ gchar* _tmp5_ = NULL;
-+ g_return_val_if_fail (name != NULL, NULL);
-+ g_return_val_if_fail (arg != NULL, NULL);
-+ g_return_val_if_fail (collate != NULL, NULL);
-+ self = (RygelLMSSqlOperator*) g_object_new (object_type, NULL);
-+ _tmp0_ = name;
-+ _tmp1_ = g_strdup (_tmp0_);
-+ _g_free0 (self->name);
-+ self->name = _tmp1_;
-+ _tmp2_ = arg;
-+ _tmp3_ = g_strdup (_tmp2_);
-+ _g_free0 (self->arg);
-+ self->arg = _tmp3_;
-+ _tmp4_ = collate;
-+ _tmp5_ = g_strdup (_tmp4_);
-+ _g_free0 (self->collate);
-+ self->collate = _tmp5_;
-+ return self;
-+}
-+
-+
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new (const gchar* name, const gchar* arg, const gchar* collate) {
-+ return rygel_lms_sql_operator_construct (RYGEL_LMS_TYPE_SQL_OPERATOR, name, arg, collate);
-+}
-+
-+
-+RygelLMSSqlOperator* rygel_lms_sql_operator_construct_from_search_criteria_op (GType object_type, GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate) {
-+ RygelLMSSqlOperator * self = NULL;
-+ gchar* sql = NULL;
-+ GUPnPSearchCriteriaOp _tmp0_ = 0;
-+ const gchar* _tmp7_ = NULL;
-+ const gchar* _tmp8_ = NULL;
-+ const gchar* _tmp9_ = NULL;
-+ g_return_val_if_fail (arg != NULL, NULL);
-+ g_return_val_if_fail (collate != NULL, NULL);
-+ sql = NULL;
-+ _tmp0_ = op;
-+ switch (_tmp0_) {
-+ case GUPNP_SEARCH_CRITERIA_OP_EQ:
-+ {
-+ gchar* _tmp1_ = NULL;
-+ _tmp1_ = g_strdup ("=");
-+ _g_free0 (sql);
-+ sql = _tmp1_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_NEQ:
-+ {
-+ gchar* _tmp2_ = NULL;
-+ _tmp2_ = g_strdup ("!=");
-+ _g_free0 (sql);
-+ sql = _tmp2_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_LESS:
-+ {
-+ gchar* _tmp3_ = NULL;
-+ _tmp3_ = g_strdup ("<");
-+ _g_free0 (sql);
-+ sql = _tmp3_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_LEQ:
-+ {
-+ gchar* _tmp4_ = NULL;
-+ _tmp4_ = g_strdup ("<=");
-+ _g_free0 (sql);
-+ sql = _tmp4_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_GREATER:
-+ {
-+ gchar* _tmp5_ = NULL;
-+ _tmp5_ = g_strdup (">");
-+ _g_free0 (sql);
-+ sql = _tmp5_;
-+ break;
-+ }
-+ case GUPNP_SEARCH_CRITERIA_OP_GEQ:
-+ {
-+ gchar* _tmp6_ = NULL;
-+ _tmp6_ = g_strdup (">=");
-+ _g_free0 (sql);
-+ sql = _tmp6_;
-+ break;
-+ }
-+ default:
-+ {
-+ g_assert_not_reached ();
-+ }
-+ }
-+ _tmp7_ = sql;
-+ _tmp8_ = arg;
-+ _tmp9_ = collate;
-+ self = (RygelLMSSqlOperator*) rygel_lms_sql_operator_construct (object_type, _tmp7_, _tmp8_, _tmp9_);
-+ _g_free0 (sql);
-+ return self;
-+}
-+
-+
-+RygelLMSSqlOperator* rygel_lms_sql_operator_new_from_search_criteria_op (GUPnPSearchCriteriaOp op, const gchar* arg, const gchar* collate) {
-+ return rygel_lms_sql_operator_construct_from_search_criteria_op (RYGEL_LMS_TYPE_SQL_OPERATOR, op, arg, collate);
-+}
-+
-+
-+static gchar* rygel_lms_sql_operator_real_to_string (RygelLMSSqlOperator* self) {
-+ gchar* result = NULL;
-+ const gchar* _tmp0_ = NULL;
-+ const gchar* _tmp1_ = NULL;
-+ const gchar* _tmp2_ = NULL;
-+ gchar* _tmp3_ = NULL;
-+ _tmp0_ = self->arg;
-+ _tmp1_ = self->name;
-+ _tmp2_ = self->collate;
-+ _tmp3_ = g_strdup_printf ("(%s %s ? %s)", _tmp0_, _tmp1_, _tmp2_);
-+ result = _tmp3_;
-+ return result;
-+}
-+
-+
-+gchar* rygel_lms_sql_operator_to_string (RygelLMSSqlOperator* self) {
-+ g_return_val_if_fail (self != NULL, NULL);
-+ return RYGEL_LMS_SQL_OPERATOR_GET_CLASS (self)->to_string (self);
-+}
-+
-+
-+static void rygel_lms_sql_operator_class_init (RygelLMSSqlOperatorClass * klass) {
-+ rygel_lms_sql_operator_parent_class = g_type_class_peek_parent (klass);
-+ ((RygelLMSSqlOperatorClass *) klass)->to_string = rygel_lms_sql_operator_real_to_string;
-+ G_OBJECT_CLASS (klass)->finalize = rygel_lms_sql_operator_finalize;
-+}
-+
-+
-+static void rygel_lms_sql_operator_instance_init (RygelLMSSqlOperator * self) {
-+}
-+
-+
-+static void rygel_lms_sql_operator_finalize (GObject* obj) {
-+ RygelLMSSqlOperator * self;
-+ self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_LMS_TYPE_SQL_OPERATOR, RygelLMSSqlOperator);
-+ _g_free0 (self->name);
-+ _g_free0 (self->arg);
-+ _g_free0 (self->collate);
-+ G_OBJECT_CLASS (rygel_lms_sql_operator_parent_class)->finalize (obj);
-+}
-+
-+
-+GType rygel_lms_sql_operator_get_type (void) {
-+ static volatile gsize rygel_lms_sql_operator_type_id__volatile = 0;
-+ if (g_once_init_enter (&rygel_lms_sql_operator_type_id__volatile)) {
-+ static const GTypeInfo g_define_type_info = { sizeof (RygelLMSSqlOperatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_lms_sql_operator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelLMSSqlOperator), 0, (GInstanceInitFunc) rygel_lms_sql_operator_instance_init, NULL };
-+ GType rygel_lms_sql_operator_type_id;
-+ rygel_lms_sql_operator_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelLMSSqlOperator", &g_define_type_info, 0);
-+ g_once_init_leave (&rygel_lms_sql_operator_type_id__volatile, rygel_lms_sql_operator_type_id);
-+ }
-+ return rygel_lms_sql_operator_type_id__volatile;
-+}
-+
-+
-+
---
-1.8.3.1
-
diff --git a/meta-agl/recipes-connectivity/rygel/files/rygel.service b/meta-agl/recipes-connectivity/rygel/files/rygel.service
deleted file mode 100644
index fb94d7160..000000000
--- a/meta-agl/recipes-connectivity/rygel/files/rygel.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Rygel
-After=lightmediascanner.service
-Requires=lightmediascanner.service
-
-[Service]
-Type=dbus
-BusName=org.gnome.Rygel1
-ExecStart=/usr/bin/rygel -c /etc/rygel.conf
-
-[Install]
-WantedBy=default.target
-Alias=dbus-org.gnome.Rygel1.service
diff --git a/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend b/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend
deleted file mode 100644
index bfee4f569..000000000
--- a/meta-agl/recipes-connectivity/rygel/rygel_%.bbappend
+++ /dev/null
@@ -1,32 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-# Disable everything but the media-export plugin, add the lms plugin
-PACKAGECONFIG = "media-export lms"
-PACKAGECONFIG[lms] = "--enable-lms-plugin,--disable-lms-plugin,sqlite3"
-
-# LightMediaScanner plugin patches
-SRC_URI += "file://0001-Add-LightMediaScanner-plugin.patch \
- file://0002-lms-add-C-source-files.patch \
- file://0001-Fix-missing-link-to-unistring-for-lms-plugin.patch \
- file://rygel.service \
- "
-
-inherit systemd
-
-do_install_append() {
- # Install rygel systemd service
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- install -m 644 -p -D ${WORKDIR}/rygel.service ${D}${systemd_user_unitdir}/rygel.service
-
- # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
- # because it does not support systemd's user mode.
- # However, systemctl --global should be checked
- #mkdir -p ${D}/etc/systemd/user/default.target.wants/
- #ln -sf ${systemd_user_unitdir}/rygel.service ${D}/etc/systemd/user/dbus-org.gnome.Rygel1.service
- #ln -sf ${systemd_user_unitdir}/rygel.service ${D}/etc/systemd/user/default.target.wants/rygel.service
- fi
-}
-
-FILES_${PN} += " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/rygel.service', '', d)} \
- "
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus.service b/meta-agl/recipes-core/dbus/dbus/dbus.service
deleted file mode 100644
index dee6ad741..000000000
--- a/meta-agl/recipes-core/dbus/dbus/dbus.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=D-Bus User Message Bus
-Documentation=man:dbus-daemon(1)
-Requires=dbus.socket
-
-[Service]
-ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
-ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
-Restart=always
-RestartSec=1
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus.socket b/meta-agl/recipes-core/dbus/dbus/dbus.socket
deleted file mode 100644
index af76b2f12..000000000
--- a/meta-agl/recipes-core/dbus/dbus/dbus.socket
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=D-Bus User Message Bus Socket
-Before=sockets.target
-
-[Socket]
-ListenStream=%t/bus
-
-[Install]
-WantedBy=default.target
diff --git a/meta-agl/recipes-core/dbus/dbus/dbus_env.conf b/meta-agl/recipes-core/dbus/dbus/dbus_env.conf
deleted file mode 100644
index f8f02669b..000000000
--- a/meta-agl/recipes-core/dbus/dbus/dbus_env.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-[Unit]
-Wants=dbus.service
-
-[Service]
-Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus
diff --git a/meta-agl/recipes-core/dbus/dbus_%.bbappend b/meta-agl/recipes-core/dbus/dbus_%.bbappend
deleted file mode 100644
index e65fe9ede..000000000
--- a/meta-agl/recipes-core/dbus/dbus_%.bbappend
+++ /dev/null
@@ -1,28 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-SRC_URI_append = "file://dbus.service \
- file://dbus.socket \
- file://dbus_env.conf \
- "
-
-inherit systemd
-
-do_install_append() {
- if [ "${PN}" != "nativesdk-dbus" ]; then
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- install -m 644 -p -D ${WORKDIR}/dbus.service ${D}${systemd_user_unitdir}/dbus.service
- install -m 644 -p -D ${WORKDIR}/dbus.socket ${D}${systemd_user_unitdir}/dbus.socket
- install -m 644 -p -D ${WORKDIR}/dbus_env.conf ${D}${systemd_system_unitdir}/user@.service.d/dbus_env.conf
-
- # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
- # because it does not support systemd's user mode.
- mkdir -p ${D}/etc/systemd/user/default.target.wants/
- ln -sf ${systemd_user_unitdir}/dbus.socket ${D}/etc/systemd/user/default.target.wants/dbus.socket
- fi
- fi
-}
-
-FILES_${PN} += " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/dbus.*', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/user@.service.d/dbus_env.conf', '', d)} \
- "
diff --git a/meta-agl/recipes-core/glibc/.appends.core b/meta-agl/recipes-core/glibc/.appends.core
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-core/glibc/.appends.core
+++ /dev/null
diff --git a/meta-agl/recipes-core/glibc/glibc/arm/local-arm-futex.diff b/meta-agl/recipes-core/glibc/glibc/arm/local-arm-futex.diff
deleted file mode 100644
index c6b9d53a1..000000000
--- a/meta-agl/recipes-core/glibc/glibc/arm/local-arm-futex.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-Description: Lie about futex_atomic_cmpxchg_inatomic kernel support.
- In past versions of glibc, we incorrectly assumed all ARM kernels
- in all configurations supported futex_atomic_cmpxchg_inatomic. This
- was clearly a lie, however it was a lie that we relied on, because
- the fallback implementation appears to not play nicely with certain
- applications like pulseaudio. Restore the lie for kernels > 2.6.32
- and plug our ears and scream "LA LA LA" about how wrong this is.
-Author: Adam Conrad <adconrad@ubuntu.com>
-Bug-Ubuntu: https://launchpad.net/bugs/1436162
-Bug-Debian: https://bugs.debian.org/788799
-Last-Update: 2015-03-25
-
---- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
-@@ -22,7 +22,7 @@
- /* The ARM kernel before 3.14.3 may or may not support
- futex_atomic_cmpxchg_inatomic, depending on kernel
- configuration. */
--#if __LINUX_KERNEL_VERSION < 0x030E03
-+#if __LINUX_KERNEL_VERSION < 0x020620
- # undef __ASSUME_REQUEUE_PI
- # undef __ASSUME_SET_ROBUST_LIST
- #endif
diff --git a/meta-agl/recipes-core/glibc/glibc_2.2%.bbappend b/meta-agl/recipes-core/glibc/glibc_2.2%.bbappend
deleted file mode 100644
index 0868a2c7d..000000000
--- a/meta-agl/recipes-core/glibc/glibc_2.2%.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI_append_arm = " file://arm/local-arm-futex.diff "
diff --git a/meta-agl/recipes-core/images/agl-image-minimal-qa.bb b/meta-agl/recipes-core/images/agl-image-minimal-qa.bb
deleted file mode 100644
index b162f2904..000000000
--- a/meta-agl/recipes-core/images/agl-image-minimal-qa.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-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
-
-LICENSE = "MIT"
-
-IMAGE_INSTALL_append = " \
- packagegroup-ivi-common-test \
- "
diff --git a/meta-agl/recipes-core/images/agl-image-minimal.bb b/meta-agl/recipes-core/images/agl-image-minimal.bb
deleted file mode 100644
index 1fd213d0f..000000000
--- a/meta-agl/recipes-core/images/agl-image-minimal.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-SUMMARY = "An AGL small image just capable of allowing a device to boot."
-
-require agl-image-minimal.inc
-
-LICENSE = "MIT"
-
-IMAGE_INSTALL_append = "\
- packagegroup-agl-image-minimal \
- "
diff --git a/meta-agl/recipes-core/images/agl-image-minimal.inc b/meta-agl/recipes-core/images/agl-image-minimal.inc
deleted file mode 100644
index a0818845c..000000000
--- a/meta-agl/recipes-core/images/agl-image-minimal.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-IMAGE_LINGUAS = " "
-
-inherit core-image
-
-IMAGE_INSTALL = "${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
-
-IMAGE_ROOTFS_SIZE ?= "8192"
-
-# Allow extra IMAGE_FSTYPES to be added by boards configs
-IMAGE_FSTYPES += "${AGL_EXTRA_IMAGE_FSTYPES}"
diff --git a/meta-agl/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/meta-agl/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
deleted file mode 100644
index c61d94e62..000000000
--- a/meta-agl/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-RDEPENDS_${PN} =+ "nativesdk-cmake"
-
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-automotive.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-automotive.bb
deleted file mode 100644
index d9f2279e1..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-automotive.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Automotive Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-automotive \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-connectivity.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-connectivity.bb
deleted file mode 100644
index e909d5e5f..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-connectivity.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Connectivity Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-connectivity \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- dhcp-server \
- ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','connman','connman connman-client connman-tests connman-tools connman-ncurses','',d)} \
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-graphics.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-graphics.bb
deleted file mode 100644
index 1cc6f457b..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-graphics.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Graphics Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-graphics \
- "
-
-ALLOW_EMPTY_${PN} = "1"
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-kernel.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-kernel.bb
deleted file mode 100644
index 3d5556fd5..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-kernel.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Kernel Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-kernel \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bb
deleted file mode 100644
index 01ca4cb85..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-multimedia.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Multimedia Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-multimedia \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-navi-lbs.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-navi-lbs.bb
deleted file mode 100644
index 2b04d5387..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-navi-lbs.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Navigation and Location Based Services Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-navi-lbs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-os-commonlibs.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-os-commonlibs.bb
deleted file mode 100644
index c44166e12..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-os-commonlibs.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Operating System and Common libraries Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-os-commonlibs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-security.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-security.bb
deleted file mode 100644
index eb5a68f0a..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-security.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Security Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-security \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-speech-services.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-speech-services.bb
deleted file mode 100644
index a494e5889..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-core-speech-services.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-DESCRIPTION = "The minimal set of packages for Speech Services Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-core-speech-services \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-agl-image-minimal.bb b/meta-agl/recipes-core/packagegroups/packagegroup-agl-image-minimal.bb
deleted file mode 100644
index 630c11d43..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-agl-image-minimal.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-DESCRIPTION = "The minimal set of packages required by AGL"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-image-minimal \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- packagegroup-core-boot-agl \
- "
-
-
-RDEPENDS_${PN} += "\
- packagegroup-agl-core-automotive \
- packagegroup-agl-core-connectivity \
- packagegroup-agl-core-graphics \
- packagegroup-agl-core-multimedia \
- packagegroup-agl-core-navi-lbs \
- packagegroup-agl-core-os-commonlibs \
- packagegroup-agl-core-speech-services \
- packagegroup-agl-core-security \
- packagegroup-agl-core-kernel \
- "
diff --git a/meta-agl/recipes-core/packagegroups/packagegroup-core-boot-agl.bb b/meta-agl/recipes-core/packagegroups/packagegroup-core-boot-agl.bb
deleted file mode 100644
index 0d877896f..000000000
--- a/meta-agl/recipes-core/packagegroups/packagegroup-core-boot-agl.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2007 OpenedHand Ltd.
-#
-# derived from oe-core: meta/recipes-core/packagegroups/packagegroup-core-boot.bb
-
-SUMMARY = "Minimal boot requirements"
-DESCRIPTION = "The minimal set of packages required to boot the system"
-LICENSE = "MIT"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-inherit packagegroup
-
-#
-# Set by the machine configuration with packages essential for device bootup
-#
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
-
-# Distro can override the following VIRTUAL-RUNTIME providers:
-VIRTUAL-RUNTIME_dev_manager ?= "udev"
-VIRTUAL-RUNTIME_login_manager ?= "busybox"
-VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
-VIRTUAL-RUNTIME_initscripts ?= "initscripts"
-VIRTUAL-RUNTIME_keymaps ?= "keymaps"
-
-SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', 'busybox-hwclock', '', d)} \
- modutils-initscripts \
- init-ifupdown \
- ${VIRTUAL-RUNTIME_initscripts} \
- "
-
-RDEPENDS_${PN} = "\
- base-files \
- base-passwd \
- busybox \
- run-agl-postinsts \
- ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
- ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
- netbase \
- ${VIRTUAL-RUNTIME_login_manager} \
- ${VIRTUAL-RUNTIME_init_manager} \
- ${VIRTUAL-RUNTIME_dev_manager} \
- ${VIRTUAL-RUNTIME_update-alternatives} \
- ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
-
-RRECOMMENDS_${PN} = "\
- ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
-
diff --git a/meta-agl/recipes-core/psplash/.appends.core b/meta-agl/recipes-core/psplash/.appends.core
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-core/psplash/.appends.core
+++ /dev/null
diff --git a/meta-agl/recipes-core/psplash/files/psplash-colors.h b/meta-agl/recipes-core/psplash/files/psplash-colors.h
deleted file mode 100644
index 447490397..000000000
--- a/meta-agl/recipes-core/psplash/files/psplash-colors.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * pslash - a lightweight framebuffer splashscreen for embedded devices.
- *
- * Copyright (c) 2012 sleep(5) ltd
- * Author: Tomas Frydrych <tomas@sleepfive.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _HAVE_PSPLASH_COLORS_H
-#define _HAVE_PSPLASH_COLORS_H
-
-/* This is the overall background color */
-#define PSPLASH_BACKGROUND_COLOR 0xff,0xff,0xff
-
-/* This is the color of any text output */
-#define PSPLASH_TEXT_COLOR 0x00,0x00,0x00
-
-/* This is the color of the progress bar indicator */
-#define PSPLASH_BAR_COLOR 0x00,0x00,0x00
-
-/* This is the color of the progress bar background */
-#define PSPLASH_BAR_BACKGROUND_COLOR 0xff,0xff,0xff
-
-#endif
diff --git a/meta-agl/recipes-core/psplash/files/psplash-poky-img.h b/meta-agl/recipes-core/psplash/files/psplash-poky-img.h
deleted file mode 100644
index c0e8b0818..000000000
--- a/meta-agl/recipes-core/psplash/files/psplash-poky-img.h
+++ /dev/null
@@ -1,5411 +0,0 @@
-/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
-
-#define POKY_IMG_ROWSTRIDE (1800)
-#define POKY_IMG_WIDTH (600)
-#define POKY_IMG_HEIGHT (400)
-#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
-#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
- "\377\377\377\377\377\377\377\377\203\377\377\377\1\376\376\376\221\377" \
- "\377\377\1\376\376\376\215\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\376\376\376\233\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\202\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\376\376\376\206\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\376\376\376\203\377\377\377\5\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\376\376\376\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\202\376\376\376\207\377\377" \
- "\377\1\376\376\376\205\377\377\377\1\376\376\376\211\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\235\377\377\377\1\376\376\376\203\377" \
- "\377\377\1\376\376\376\213\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\216\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\365\377\377\377\1\376" \
- "\376\376\203\377\377\377\1\376\376\376\207\377\377\377\1\376\376\376" \
- "\203\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\205\377" \
- "\377\377\1\376\376\376\203\377\377\377\12\376\376\376\377\377\377\346" \
- "\346\346\315\315\315\316\316\316\265\265\265\235\235\235\234\234\234" \
- "\233\233\233\204\204\204\203kkm\202lln\2EEG;;=\215::<\204kkm\3kkkxxx" \
- "\235\235\235\202\234\234\234\1\265\265\265\202\316\316\316\1\332\332" \
- "\332\207\377\377\377\202\376\376\376\2\377\377\377\376\376\376\211\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\203\377\377\377\5\376" \
- "\376\376\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\366\377\377\377\1\376\376\376\205" \
- "\377\377\377\1\376\376\376\214\377\377\377\11\376\376\376\332\332\332" \
- "\316\316\320\247\247\251\236\236\240\204\204\206kkm__a<<>\202::<\11;" \
- ";=99;;;=99;::<;;=::<;;=99;\203::<\1<<>\213::<\13;;=::<;;=::<;;=::<;;" \
- "=::<;;=::<;;=\207::<\3SSUllnxxz\202\234\234\236\202\316\316\316\2\377" \
- "\377\377\376\376\376\214\377\377\377\1\376\376\376\203\377\377\377\1" \
- "\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\376\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\376\376\376\203\377\377\377" \
- "\7\332\332\334\302\302\304\234\234\236\203\203\205llnEEG;;=\202::<\6" \
- ";;=::<;;=::<;;=99;\204::<\1""99;\202;;=\1""99;\205::<\1;;=\213::<\11" \
- ";;=::<;;=::<;;=::<;;=::<;;=\202::<\1""99;\206::<\1;;=\203::<\13;;=99" \
- ";;;=::<;;=::<kkmxxz\234\234\236\300\300\302\316\316\316\203\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\374\377\377\377\7\346\346\350\301\301\303\235\235\237ww" \
- "y``b99;;;=\202::<\1;;=\204::<\203;;=\3::<99;;;=\207::<\202;;=\204::<" \
- "\203;;=\215::<\1;;=\207::<\11;;=::<;;=99;::<;;=::<99;::<\202;;=\5::<" \
- ";;=::<;;=99;\202::<\2;;=::<\202;;=\6::<SSUkkm\235\235\237\264\264\266" \
- "\332\332\334\210\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\377\377\377\377\377\377\377\377\377\377\377\377\362\377\377\377" \
- "\1\376\376\376\202\377\377\377\11\346\346\350\265\265\267\221\221\223" \
- "kkm::<;;=::<99;;;=\203::<\1;;=\202::<\3""99;::<;;=\202::<\4;;=99;::<" \
- ";;=\204::<\1;;=\202::<\202;;=\1::<\202;;=\202::<\1;;=\203::<\1;;=\211" \
- "::<\2;;=99;\202::<\2;;=99;\206::<\1;;=\202::<\2""99;;;=\210::<\1;;=\202" \
- "::<\1;;=\203::<\1;;=\203::<\1;;=\202::<\4kkm\222\222\224\265\265\267" \
- "\332\332\334\204\377\377\377\1\376\376\376\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\362\377\377\377\12\363\363\363\316\316\316\235\235" \
- "\235jjjFFH;;=::<;;=::<;;=\202::<\1;;=\204::<\1""99;\202::<\2;;=::<\202" \
- ";;=\204::<\7;;=::<;;=::<;;=::<;;=\203::<\1;;=\202::<\1;;=\217::<\2""9" \
- "9;;;=\203::<\1;;=\202::<\4""99;;;=::<;;=\203::<\2;;=99;\202::<\1;;=\207" \
- "::<\1;;=\213::<\1;;=\204::<\7kkk\221\221\221\301\301\301\363\363\363" \
- "\376\376\376\377\377\377\376\376\376\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\321\377\377\377\1\376\376\376\202\377\377\377\1\376" \
- "\376\376\221\377\377\377\1\376\376\376\204\377\377\377\4\363\363\365" \
- "\301\301\303\222\222\224__a\220::<\3;;=::<;;=\204::<\203;;=\203::<\2" \
- ";;=::<\202;;=\4::<;;=::<;;=\204::<\1;;=\202::<\4;;=::<99;;;=\211::<\1" \
- "99;\205::<\202;;=\210::<\5;;=::<;;=::<;;=\203::<\1;;=\212::<\4;;=99;" \
- ";;=99;\211::<\4SSU\204\204\206\266\266\270\345\345\345\221\377\377\377" \
- "\1\376\376\376\204\377\377\377\202\376\376\376\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\266\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\207\377\377\377\1\376\376" \
- "\376\210\377\377\377\10\363\363\363\301\301\301\221\221\221``b99;;;=" \
- "::<;;=\213::<\3;;=::<;;=\203::<\1;;=\204::<\2;;=99;\202::<\1""99;\202" \
- ";;=\204::<\1;;=\210::<\202;;=\202::<\2;;=99;\215::<\1;;=\204::<\1;;=" \
- "\205::<\5;;=99;;;=::<;;=\202::<\202;;=\4""99;;;=::<;;=\203::<\1;;=\204" \
- "::<\3;;=99;;;=\210::<\11;;=::<;;=99;;;=SSS\205\205\205\266\266\266\363" \
- "\363\363\202\377\377\377\1\376\376\376\206\377\377\377\1\376\376\376" \
- "\204\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\266\377\377\377\1\376\376\376" \
- "\204\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376\207\377" \
- "\377\377\5\376\376\376\333\333\335\250\250\252kkm;;=\203::<\202;;=\212" \
- "::<\10;;=::<;;=::<;;=::<;;=::<\202;;=\206::<\10;;=::<;;=::<;;=::<;;=" \
- "::<\202;;=\2::<;;=\203::<\3;;=::<;;=\202::<\1;;=\202::<\1;;=\211::<\1" \
- "99;\202;;=\203::<\1;;=\205::<\1;;=\204::<\1;;=\206::<\203;;=\202::<\1" \
- ";;=\206::<\1;;=\213::<\1;;=\204::<\1;;=\202::<\3__a\221\221\223\316\316" \
- "\316\204\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\207" \
- "\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\267\377\377\377\202\376\376\376\210\377\377\377\1\376\376\376\207" \
- "\377\377\377\3\301\301\301\204\204\206SSU\203::<\3;;=::<;;=\202::<\2" \
- "99;;;=\215::<\1;;=\204::<\2;;=99;\202::<\202;;=\202::<\7""99;::<;;=:" \
- ":<;;=99;;;=\202::<\2""99;;;=\202::<\1;;=\207::<\1;;=\211::<\2""99;;;" \
- "=\202::<\3;;=::<;;=\202::<\2""99;;;=\206::<\4;;=::<;;=::<\202;;=\206" \
- "::<\3;;=::<;;=\202::<\5;;=::<;;=99;;;=\220::<\2;;=::<\202;;=\5""99;G" \
- "GIxxx\265\265\265\363\363\363\207\377\377\377\1\376\376\376\205\377\377" \
- "\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\274" \
- "\377\377\377\1\376\376\376\204\377\377\377\202\376\376\376\4\364\364" \
- "\364\265\265\265xxz;;=\20299;\202::<\1""99;\204::<\3;;=::<;;=\213::<" \
- "\1;;=\203::<\3;;=::<;;=\207::<\2;;=::<\202;;=\4""99;;;=::<;;=\202::<" \
- "\5__allnkkm\221\221\223\235\235\237\202\234\234\236\6\317\317\317\315" \
- "\315\315\317\317\317\315\315\315\316\316\316\346\346\346\213\377\377" \
- "\377\3\376\376\376\377\377\377\346\346\346\204\316\316\316\5\316\316" \
- "\320\251\251\253\234\234\236\233\233\235\235\235\237\203kkm\202::<\1" \
- ";;=\202::<\6;;=::<;;=99;::<;;=\205::<\2;;=::<\203;;=\202::<\1;;=\212" \
- "::<\1;;=\202::<\1;;=\202::<\1;;=\204::<\1;;=\202::<\3lln\250\250\252" \
- "\346\346\350\206\377\377\377\1\376\376\376\204\377\377\377\1\376\376" \
- "\376\377\377\377\377\377\377\377\377\377\377\377\377\271\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\4\362\362" \
- "\362\266\266\270xxz::<\202;;=\202::<\10;;=::<99;;;=::<;;=::<;;=\203:" \
- ":<\1;;=\213::<\3;;=::<;;=\205::<\1;;=\202::<\1<<>\202::<\7llnkkm\233" \
- "\233\235\235\235\237\302\302\304\316\316\320\347\347\351\241\377\377" \
- "\377\202\376\376\376\203\377\377\377\17\376\376\376\377\377\377\376\376" \
- "\376\377\377\377\376\376\376\363\363\363\316\316\316\315\315\315\234" \
- "\234\234\235\235\235xxxllnFFH::<;;=\205::<\5;;=99;;;=::<;;=\212::<\202" \
- ";;=\212::<\5;;=99;;;=::<99;\202::<\5__a\250\250\252\346\346\346\377\377" \
- "\377\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\271\377\377\377\202\376\376\376\2\377\377\377" \
- "\376\376\376\203\377\377\377\3\363\363\363\266\266\266wwy\202;;=\210" \
- "::<\1<<>\203::<\2<<>99;\215::<\1;;=\205::<\11;;=::<;;;___xxx\235\235" \
- "\235\266\266\266\315\315\315\364\364\364\207\377\377\377\1\376\376\376" \
- "\213\377\377\377\1\376\376\376\231\377\377\377\5\376\376\376\377\377" \
- "\377\376\376\376\377\377\377\376\376\376\202\377\377\377\1\376\376\376" \
- "\204\377\377\377\1\376\376\376\202\377\377\377\5\316\316\316\302\302" \
- "\302\233\233\233yyykkk\202::<\6;;=::<;;=::<99;;;=\211::<\1;;=\202::<" \
- "\1;;=\206::<\1""99;\202;;=\202::<\203;;=\1""99;\202::<\3__a\251\251\253" \
- "\346\346\346\204\377\377\377\3\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\266\377\377\377\1\376\376" \
- "\376\202\377\377\377\2\302\302\302xxx\203::<\3;;=::<;;=\232::<\1;;=\202" \
- "::<\6RRTkkm\235\235\237\301\301\303\332\332\334\376\376\376\222\377\377" \
- "\377\1\376\376\376\260\377\377\377\3\376\376\376\377\377\377\376\376" \
- "\376\202\377\377\377\5\345\345\347\316\316\320\235\235\237xxzSSU\215" \
- "::<\202;;=\202::<\203;;=\2::<;;=\203::<\1;;=\204::<\10;;=::<;;=::<;;" \
- "=kkm\266\266\266\363\363\363\202\377\377\377\1\376\376\376\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\245\377\377\377\1\376\376\376\214" \
- "\377\377\377\1\376\376\376\202\377\377\377\5\376\376\376\377\377\377" \
- "\332\332\332\205\205\207GGI\202::<\1;;=\211::<\202;;=\205::<\2;;=::<" \
- "\202;;=\203::<\14;;=99;::<;;=99;;;=FFFxxx\234\234\234\315\315\315\364" \
- "\364\364\376\376\376\323\377\377\377\4\317\317\317\250\250\250xxxSSS" \
- "\202::<\1;;=\206::<\2;;=::<\203;;=\202::<\2;;=99;\204::<\7;;=::<;;=:" \
- ":<;;=::<;;=\204::<\3\204\204\206\301\301\301\376\376\376\220\377\377" \
- "\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\225" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\206\377\377" \
- "\377\1\376\376\376\202\377\377\377\4\363\363\363\251\251\251___;;=\202" \
- "::<\1;;=\202::<\202;;=\204::<\1;;=\202::<\7;;=::<;;=::<;;=::<;;=\203" \
- "::<\3""99;::<;;=\202::<\5;;=__a\221\221\223\265\265\267\346\346\346\323" \
- "\377\377\377\1\376\376\376\211\377\377\377\5\363\363\363\301\301\303" \
- "\235\235\237lln::<\202;;=\203::<\1;;=\204::<\1;;=\202::<\2""99;;;=\205" \
- "::<\2;;=99;\203::<\1""99;\204::<\3TTT\233\233\233\346\346\346\207\377" \
- "\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\250\377\377\377\3\316\316\316\204\204\204;;=\203::<\1;;=\203::<\1;;" \
- "=\202::<\1;;=\205::<\3;;=::<;;=\202::<\4""99;;;=::<;;=\202::<\202;;=" \
- "\4___\221\221\221\301\301\303\363\363\365\203\377\377\377\1\376\376\376" \
- "\203\377\377\377\202\376\376\376\321\377\377\377\1\376\376\376\210\377" \
- "\377\377\1\376\376\376\202\377\377\377\4\316\316\316\235\235\235kkk;" \
- ";=\202::<\202;;=\203::<\5;;=::<;;=99;;;=\204::<\202;;=\7::<;;=99;::<" \
- ";;=::<;;=\202::<\202;;=\2xxz\302\302\304\213\377\377\377\1\376\376\376" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\224\377\377\377\1\376" \
- "\376\376\212\377\377\377\3\363\363\363\266\266\266TTV\203::<\3;;=::<" \
- ";;=\202::<\203;;=\202::<\202;;=\205::<\1;;=\202::<\1;;=\204::<\4SSU\221" \
- "\221\223\301\301\301\363\363\363\206\377\377\377\1\376\376\376\203\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\315\377\377\377" \
- "\202\376\376\376\202\377\377\377\1\376\376\376\210\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\202\377\377\377\3\316\316\316" \
- "\221\221\223__a\203::<\1;;=\203::<\3;;=::<;;=\203::<\5;;=99;;;=::<;;" \
- "=\204::<\1""99;\205::<\3SSU\234\234\236\346\346\346\207\377\377\377\3" \
- "\376\376\376\377\377\377\376\376\376\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\233\377\377\377\4\376\376\376\347\347\347\221\221\221" \
- "FFH\207::<\4""99;;;=::<;;=\20299;\202;;=\202::<\1;;=\203::<\2;;=::<\202" \
- ";;=\202::<\3xxz\250\250\252\346\346\350\215\377\377\377\203\376\376\376" \
- "\316\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\211\377" \
- "\377\377\1\376\376\376\211\377\377\377\4\363\363\363\265\265\267\205" \
- "\205\207FFH\210::<\3;;=::<;;=\204::<\1;;=\207::<\2;;=::<\202;;=\2\203" \
- "\203\205\317\317\321\206\377\377\377\1\376\376\376\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\233\377\377\377\3\316\316\316yy{99;\206" \
- "::<\2;;=99;\202;;=\205::<\5""99;::<;;=::<;;=\202::<\6;;=::<;;=SSU\204" \
- "\204\204\301\301\301\226\377\377\377\1\376\376\376\317\377\377\377\1" \
- "\376\376\376\203\377\377\377\1\376\376\376\204\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376\202" \
- "\377\377\377\3\316\316\316\221\221\221SSU\203::<\3;;=::<99;\204::<\1" \
- ";;=\203::<\2""99;;;=\202::<\1;;=\204::<\5""99;<<>::<kkk\264\264\264\203" \
- "\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\232\377\377\377\2\266\266\270__a\202::<\5;;=::<;;=::<99;\202;;=" \
- "\10::<;;=::<;;=::<;;=99;;;=\202::<\11;;=::<99;;;=::<;;=SSU\221\221\223" \
- "\331\331\331\211\377\377\377\1\376\376\376\204\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\324\377\377\377\1\376\376\376\202" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\212\377\377\377\1" \
- "\376\376\376\214\377\377\377\14\332\332\332\251\251\251``b::<;;=::<;" \
- ";=99;::<;;=::<;;=\202::<\3;;=99;;;=\203::<\1;;=\202::<\10;;=99;;;=::" \
- "<;;=SSU\250\250\252\363\363\363\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\231\377\377\377\2\265\265\265SSU\216::<\4;;=::<99;;;=\205::" \
- "<\10;;=SSU\222\222\224\332\332\334\377\377\377\376\376\376\377\377\377" \
- "\376\376\376\205\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\327\377\377\377\1\376\376\376\202" \
- "\377\377\377\1\376\376\376\206\377\377\377\1\376\376\376\207\377\377" \
- "\377\1\376\376\376\216\377\377\377\4\347\347\351\250\250\252``b::<\202" \
- ";;=\202::<\1;;=\203::<\1;;=\203::<\1;;=\202::<\3;;=::<;;=\202::<\6""9" \
- "9;;;=::<FFF\233\233\233\363\363\363\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\206\377\377\377\3\376\376\376\377\377\377\376\376\376\213" \
- "\377\377\377\4\363\363\365\234\234\236FFH;;=\206::<\2""99;;;=\204::<" \
- "\202;;=\2::<;;=\206::<\4FFH\204\204\206\333\333\333\376\376\376\264\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\327\377\377\377\4\346" \
- "\346\346\221\221\221SSS:::\202::<\1;;=\204::<\3;;=::<;;=\214::<\3GGI" \
- "\221\221\223\347\347\347\211\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\376\376\376\377\377\377\377\377\377\377\377\371\377\377\377\1\376" \
- "\376\376\207\377\377\377\5\363\363\363\234\234\234FFH::<;;=\204::<\1" \
- ";;=\202::<\1;;=\203::<\1;;=\204::<\1;;=\203::<\5;;=xxz\300\300\302\377" \
- "\377\377\376\376\376\267\377\377\377\1\376\376\376\202\377\377\377\1" \
- "\376\376\376\215\377\377\377\1\376\376\376\303\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\204\377\377\377\4\332\332\332\203\203\205" \
- "GGI99;\207::<\202;;=\203::<\6;;=::<;;=::<;;=99;\202;;=\202::<\3\204\204" \
- "\204\346\346\346\376\376\376\205\377\377\377\1\376\376\376\377\377\377" \
- "\377\377\377\377\377\373\377\377\377\1\376\376\376\203\377\377\377\1" \
- "\376\376\376\204\377\377\377\3\362\362\362\234\234\236GGI\203::<\15;" \
- ";=::<;;=::<;;=::<;;=99;;;=::<;;=::<99;\202;;=\7::<;;=99;::<```\250\250" \
- "\250\363\363\363\202\377\377\377\1\375\375\375\272\377\377\377\1\376" \
- "\376\376\214\377\377\377\1\376\376\376\306\377\377\377\1\375\375\375" \
- "\210\377\377\377\6\265\265\265lln::<;;=::<;;=\202::<\5;;=99;;;=::<99" \
- ";\205::<\1;;=\206::<\4\204\204\206\345\345\345\377\377\377\376\376\376" \
- "\207\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\372\377" \
- "\377\377\1\376\376\376\202\377\377\377\3\364\364\364\233\233\235GGI\202" \
- "::<\203;;=\2""99;;;=\202::<\3""99;::<;;=\202::<\13;;=99;::<;;=::<;;=" \
- "::<FFH\204\204\204\333\333\333\376\376\376\204\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\376\376\376\304\377\377\377\1\376\376\376\317" \
- "\377\377\377\4\346\346\346\221\221\223GGI99;\204::<\1""99;\202;;=\2:" \
- ":<;;=\204::<\1;;=\204::<\202;;=\3::<\221\221\223\364\364\364\203\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\376\376\376\377\377\377\377" \
- "\377\377\377\377\371\377\377\377\1\376\376\376\202\377\377\377\6\265" \
- "\265\267SSU::<99;::<;;=\203::<\1;;=\202::<\1;;=\204::<\3;;=::<;;=\202" \
- "::<\6;;=SSS\264\264\264\363\363\363\377\377\377\376\376\376\204\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\267\377\377\377\1\376\376" \
- "\376\221\377\377\377\1\376\376\376\307\377\377\377\1\376\376\376\207" \
- "\377\377\377\4\376\376\376\377\377\377\266\266\266kkm\202::<\1;;=\202" \
- "::<\6;;=::<99;;;=99;;;=\205::<\3;;=::<99;\202::<\4GGI\234\234\234\363" \
- "\363\363\376\376\376\377\377\377\377\377\377\377\377\375\377\377\377" \
- "\4\376\376\376\377\377\377\265\265\265SSU\202::<\1;;=\204::<\1;;=\203" \
- "::<\3;;=99;;;=\205::<\202;;=\2yyy\316\316\316\203\377\377\377\1\376\376" \
- "\376\206\377\377\377\3\376\376\376\377\377\377\376\376\376\263\377\377" \
- "\377\1\376\376\376\205\377\377\377\2\315\315\315;;;\211::<\3;;;:::\315" \
- "\315\315\202\377\377\377\1\376\376\376\312\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\205\377\377\377\5\346\346\346\204\204\204FF" \
- "H::<;;=\202::<\4;;=::<;;=::<\203;;=\203::<\2<<>99;\202::<\4""99;;;=F" \
- "FF\234\234\234\377\377\377\377\377\377\377\377\375\377\377\377\11\316" \
- "\316\320kkm::<;;=::<;;=99;::<;;=\203::<\202;;=\2::<99;\205::<\13;;=F" \
- "FH\221\221\221\346\346\346\376\376\376\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\377\377\377\376\376\376\204\377\377\377\1\376\376\376" \
- "\273\377\377\377\2\376\376\376\317\317\317\212::<\6;;=;;;\316\316\316" \
- "\376\376\376\377\377\377\376\376\376\304\377\377\377\1\376\376\376\206" \
- "\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\204\377\377\377\4\363\363\363\235\235\235RRT;;=\202::<\202;;=\7" \
- "::<;;=99;::<;;=::<;;=\203::<\1;;=\202::<\6;;=::<SSU\264\264\264\377\377" \
- "\377\376\376\376\377\377\377\377\377\377\377\377\367\377\377\377\3\346" \
- "\346\346xxz;;=\205::<\1;;=\203::<\3;;=::<;;=\207::<\3SSU\247\247\251" \
- "\363\363\363\217\377\377\377\1\376\376\376\272\377\377\377\1\316\316" \
- "\316\213::<\2;;=\316\316\316\306\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\221\377\377\377\4\265\265\267SSU;;=99;\202::<\2""99;;;=" \
- "\206::<\1;;=\204::<\1;;=\202::<\3jjj\317\317\317\376\376\376\377\377" \
- "\377\377\377\377\377\377\343\377\377\377\1\376\376\376\211\377\377\377" \
- "\1\376\376\376\206\377\377\377\2\363\363\363\233\233\233\210::<\1;;=" \
- "\203::<\1;;=\203::<\1;;=\203::<\2SSS\265\265\265\315\377\377\377\1\316" \
- "\316\316\214::<\1\316\316\316\334\377\377\377\3\316\316\316kkk::<\202" \
- ";;=\206::<\1;;=\202::<\1;;=\202::<\7""99;;;=::<;;=::<\204\204\206\346" \
- "\346\350\377\377\377\377\377\377\377\377\347\377\377\377\1\376\376\376" \
- "\212\377\377\377\3\265\265\265SSS::<\202;;=\205::<\1;;=\202::<\202;;" \
- "=\202::<\1;;=\203::<\2lln\265\265\267\203\377\377\377\1\376\376\376\313" \
- "\377\377\377\1\316\316\316\214::<\1\316\316\316\336\377\377\377\6\316" \
- "\316\316kkm::<;;=::<;;=\202::<\3;;=::<;;=\204::<\10;;=99;;;=::<99;;;" \
- "=FFH\234\234\234\210\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\377\377\377\377\377\327\377\377\377\2\376\376\376\377\377" \
- "\377\202\376\376\376\205\377\377\377\1\376\376\376\203\377\377\377\5" \
- "\332\332\332kkk;;=::<;;=\205::<\4;;=::<;;=::<\202;;=\2::<;;=\203::<\2" \
- "kkm\317\317\317\204\377\377\377\1\376\376\376\314\377\377\377\1\316\316" \
- "\316\214::<\1\316\316\316\336\377\377\377\14\376\376\376\377\377\377" \
- "\316\316\316\204\204\206;;=::<;;=::<;;=99;::<;;=\205::<\11;;=99;;;=9" \
- "9;::<;;;RRR\317\317\317\376\376\376\204\377\377\377\1\376\376\376\377" \
- "\377\377\377\377\377\377\377\332\377\377\377\202\376\376\376\211\377" \
- "\377\377\2\363\363\363\221\221\223\203::<\1;;=\207::<\1;;=\202::<\202" \
- ";;=\10::<99;::<lln\316\316\316\376\376\376\377\377\377\376\376\376\206" \
- "\377\377\377\1\376\376\376\311\377\377\377\1\316\316\316\214::<\1\316" \
- "\316\316\335\377\377\377\7\376\376\376\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\347\347\347kkm\202::<\2""88:;;=\203::<\1;;=\204::<\3" \
- ";;=99;;;=\202::<\4;;=::<xxx\346\346\346\206\377\377\377\1\376\376\376" \
- "\377\377\377\377\377\377\377\377\331\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\203\377\377\377\4\376\376\376\377\377\377\300\300\302" \
- "SSU\207::<\1;;=\202::<\1;;=\205::<\4""99;;;=SSU\316\316\316\204\377\377" \
- "\377\1\376\376\376\205\377\377\377\1\376\376\376\202\377\377\377\1\376" \
- "\376\376\307\377\377\377\1\316\316\316\214::<\1\316\316\316\334\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\204\377\377\377\3\317" \
- "\317\317kkm;;=\205::<\3;;=::<99;\203::<\1;;=\204::<\3;;=FFH\250\250\250" \
- "\205\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377" \
- "\377\377\377\377\326\377\377\377\1\376\376\376\204\377\377\377\4\376" \
- "\376\376\377\377\377\347\347\351xxz\202::<\1;;=\204::<\1;;=\203::<\1" \
- ";;=\204::<\4""99;;;=SSU\266\266\266\205\377\377\377\1\376\376\376\202" \
- "\377\377\377\1\376\376\376\205\377\377\377\1\375\375\375\310\377\377" \
- "\377\1\316\316\316\214::<\1\316\316\316\344\377\377\377\7\376\376\376" \
- "\377\377\377\316\316\316kkm;;=::<99;\202::<\203;;=\2::<;;=\204::<\1;" \
- ";=\202::<\3;;=__a\332\332\334\377\377\377\377\377\377\377\377\335\377" \
- "\377\377\1\376\376\376\204\377\377\377\4\250\250\252FFH::<;;=\202::<" \
- "\3;;=::<;;=\202::<\3""99;::<;;=\202::<\1;;=\202::<\4HHJ\250\250\250\377" \
- "\377\377\376\376\376\206\377\377\377\202\376\376\376\205\377\377\377" \
- "\1\376\376\376\311\377\377\377\1\316\316\316\214::<\1\316\316\316\345" \
- "\377\377\377\1\376\376\376\202\377\377\377\2\301\301\301SSU\202::<\1" \
- ";;=\202::<\2""99;;;=\212::<\3;;=\233\233\233\363\363\363\377\377\377" \
- "\377\377\377\377\377\331\377\377\377\1\376\376\376\204\377\377\377\2" \
- "\346\346\346kkk\211::<\3;;=99;;;=\206::<\2\235\235\237\363\363\363\205" \
- "\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\321\377\377" \
- "\377\1\316\316\316\214::<\1\316\316\316\352\377\377\377\2\250\250\252" \
- "GGI\206::<\5;;=::<;;=::<;;=\202::<\202;;=\4::<:::SSS\316\316\316\203" \
- "\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\330\377\377" \
- "\377\2\251\251\251FFH\203::<\1""99;\207::<\1;;=\204::<\3;;=xxx\346\346" \
- "\346\334\377\377\377\1\316\316\316\214::<\1\316\316\316\350\377\377\377" \
- "\13\376\376\376\377\377\377\376\376\376\363\363\363\234\234\23699;;;" \
- "=::<;;=99;;;=\202::<\2""99;;;=\206::<\202;;=\2\221\221\223\363\363\363" \
- "\204\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377" \
- "\1\376\376\376\377\377\377\377\377\377\377\377\316\377\377\377\2\346" \
- "\346\346kkk\202;;=\206::<\1;;=\203::<\3;;=::<;;=\202::<\2``b\316\316" \
- "\320\336\377\377\377\1\316\316\316\214::<\1\316\316\316\353\377\377\377" \
- "\4\376\376\376\377\377\377\350\350\352kkm\206::<\2;;=99;\203::<\1;;=" \
- "\203::<\6;;=::<TTV\331\331\331\377\377\377\376\376\376\207\377\377\377" \
- "\1\376\376\376\377\377\377\377\377\377\377\377\306\377\377\377\1\376" \
- "\376\376\203\377\377\377\5\376\376\376\377\377\377\266\266\266EEG;;=" \
- "\203::<\1;;=\203::<\1;;=\204::<\202;;=\3::<GGI\250\250\252\205\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\327\377\377\377\1\316" \
- "\316\316\214::<\1\316\316\316\351\377\377\377\1\376\376\376\203\377\377" \
- "\377\5\376\376\376\377\377\377\316\316\316TTV;;=\203::<\3;;=::<;;=\204" \
- "::<\202;;=\5::<;;=99;;;=\234\234\236\207\377\377\377\1\376\376\376\377" \
- "\377\377\377\377\377\377\377\303\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\203\377\377\377\6\376\376\376\377\377\377\364\364\364ww" \
- "y::<;;=\202::<\202;;=\202::<\5;;=::<99;::<;;=\202::<\4;;=::<\204\204" \
- "\206\363\363\363\202\377\377\377\1\376\376\376\202\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\331\377\377\377\1\316\316\316\214::" \
- "<\1\316\316\316\353\377\377\377\1\376\376\376\204\377\377\377\11\376" \
- "\376\376\234\234\234GGI::<;;=::<;;=::<;;=\207::<\1;;=\202::<\2__a\332" \
- "\332\332\377\377\377\377\377\377\377\377\320\377\377\377\4\316\316\316" \
- "FFH::<;;=\202::<\1;;=\207::<\2;;=99;\202;;=\3__a\316\316\320\376\376" \
- "\376\342\377\377\377\1\316\316\316\214::<\1\316\316\316\361\377\377\377" \
- "\5\376\376\376\347\347\347lln::<;;=\210::<\1""99;\202::<\7;;=::<99;G" \
- "GI\247\247\247\377\377\377\376\376\376\202\377\377\377\1\376\376\376" \
- "\377\377\377\377\377\377\377\377\305\377\377\377\1\376\376\376\203\377" \
- "\377\377\3\221\221\221:::;;=\203::<\1;;=\202::<\1;;=\203::<\1;;=\202" \
- "::<\4;;=FFH\234\234\234\376\376\376\202\377\377\377\1\375\375\375\202" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\332\377\377" \
- "\377\1\316\316\316\214::<\1\316\316\316\364\377\377\377\3\301\301\303" \
- "FFH;;=\206::<\1;;=\205::<\5;;=99;;;=yy{\363\363\363\377\377\377\377\377" \
- "\377\377\377\312\377\377\377\3\346\346\346^^`;;=\207::<\1;;=\203::<\1" \
- ";;=\203::<\2jjl\346\346\350\202\377\377\377\1\376\376\376\213\377\377" \
- "\377\1\375\375\375\327\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\360\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377" \
- "\2\363\363\363\220\220\220\202;;=\203::<\2;;=99;\206::<\1;;=\202::<\2" \
- "SSU\316\316\320\202\377\377\377\1\376\376\376\377\377\377\377\377\377" \
- "\377\377\303\377\377\377\4\376\376\376\377\377\377\302\302\302FFH\217" \
- "::<\2GGI\250\250\252\205\377\377\377\1\376\376\376\211\377\377\377\3" \
- "\376\376\376\377\377\377\376\376\376\326\377\377\377\1\316\316\316\214" \
- "::<\1\316\316\316\356\377\377\377\1\376\376\376\210\377\377\377\3\316" \
- "\316\316SSU;;=\203::<\202;;=\207::<\1;;=\202::<\1\235\235\237\377\377" \
- "\377\377\377\377\377\377\306\377\377\377\1\221\221\221\202::<\2;;=99" \
- ";\203::<\3;;=::<;;=\203::<\1;;=\202::<\2kkm\346\346\346\351\377\377\377" \
- "\1\316\316\316\214::<\1\316\316\316\370\377\377\377\2\362\362\362\221" \
- "\221\221\204::<\3;;=::<;;=\206::<\1;;=\202::<\2xxz\362\362\364\377\377" \
- "\377\377\377\377\377\377\301\377\377\377\3\376\376\376\363\363\363__" \
- "_\204::<\3;;=::<;;=\202::<\2;;=99;\202;;=\4::<99;GGI\250\250\252\353" \
- "\377\377\377\1\316\316\316\214::<\1\316\316\316\366\377\377\377\1\376" \
- "\376\376\203\377\377\377\2\317\317\317SSS\211::<\202;;=\6""99;;;=99;" \
- "::<SSU\332\332\332\202\377\377\377\1\376\376\376\377\377\377\377\377" \
- "\377\377\377\267\377\377\377\11\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\317\317\321FFH;;=\202::<\3;;=::<99;" \
- "\203::<\203;;=\202::<\4;;=lll\346\346\346\376\376\376\353\377\377\377" \
- "\1\316\316\316\214::<\1\316\316\316\367\377\377\377\1\376\376\376\202" \
- "\377\377\377\5\376\376\376\363\363\363\221\221\223;;=99;\202;;=\3::<" \
- "99;;;=\202::<\202;;=\6::<;;=::<;;=::<\265\265\265\202\377\377\377\1\376" \
- "\376\376\377\377\377\377\377\377\377\377\273\377\377\377\1\250\250\252" \
- "\202::<\2""99;;;=\203::<\1;;=\202::<\1;;=\204::<\3;;=\250\250\250\376" \
- "\376\376\205\377\377\377\1\376\376\376\347\377\377\377\1\316\316\316" \
- "\214::<\1\316\316\316\373\377\377\377\5\376\376\376\377\377\377\300\300" \
- "\300FFH;;=\202::<\1;;=\202::<\3;;=::<;;=\202::<\2;;=::<\202;;=\4\205" \
- "\205\207\376\376\376\377\377\377\376\376\376\377\377\377\377\377\377" \
- "\377\377\267\377\377\377\3\376\376\376\364\364\364\205\205\207\202::" \
- "<\202;;=\15""99;;;=::<;;=::<;;=::<99;;;=99;;;=__a\331\331\331\357\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\366\377\377\377\1\376\376" \
- "\376\203\377\377\377\1\376\376\376\203\377\377\377\2\363\363\363kkm\215" \
- "::<\4;;=99;__a\363\363\363\202\377\377\377\1\376\376\376\377\377\377" \
- "\377\377\377\377\377\265\377\377\377\4\347\347\351__a::<;;=\203::<\1" \
- ";;=\202::<\1;;=\203::<\1;;=\202::<\2\221\221\223\363\363\363\360\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\364\377\377\377\1\376\376" \
- "\376\203\377\377\377\1\376\376\376\207\377\377\377\2\251\251\253;;=\203" \
- "::<\1;;=\203::<\1;;=\203::<\203;;=\3FFH\332\332\332\376\376\376\377\377" \
- "\377\377\377\377\377\377\265\377\377\377\4\331\331\331FFH::<;;=\203:" \
- ":<\1;;=\202::<\1;;=\205::<\2FFH\302\302\302\205\377\377\377\7\376\376" \
- "\376\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377\376" \
- "\376\376\346\377\377\377\1\316\316\316\214::<\1\316\316\316\377\377\377" \
- "\377\202\377\377\377\2\332\332\332SSU\203::<\1;;=\203::<\12""99;;;=:" \
- ":<99;::<;;=99;;;=\266\266\266\376\376\376\377\377\377\377\377\377\377" \
- "\377\263\377\377\377\1\265\265\265\202::<\1;;=\205::<\202;;=\202::<\1" \
- ";;=\202::<\2__a\346\346\350\203\377\377\377\1\376\376\376\357\377\377" \
- "\377\1\316\316\316\214::<\1\316\316\316\377\377\377\377\203\377\377\377" \
- "\2\363\363\363\204\204\204\202::<\1;;=\203::<\1;;=\205::<\1;;=\202::" \
- "<\1\221\221\221\377\377\377\377\377\377\377\377\262\377\377\377\4\235" \
- "\235\237;;=::<;;=\203::<\1;;=\206::<\3;;=::<\222\222\222\202\377\377" \
- "\377\1\376\376\376\362\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\377\377\377\377\205\377\377\377\3\265\265\265:::;;=\206::<\5;;=::<;" \
- ";=::<;;=\202::<\2\204\204\206\363\363\363\212\377\377\377\1\376\376\376" \
- "\377\377\377\377\377\377\377\377\236\377\377\377\1\376\376\376\202\377" \
- "\377\377\4\376\376\376\377\377\377\376\376\377\204\204\206\206::<\12" \
- ";;=::<;;=::<;;=::<;;=::<FFH\301\301\301\366\377\377\377\1\316\316\316" \
- "\214::<\1\316\316\316\377\377\377\377\206\377\377\377\4\333\333\333S" \
- "SU::<;;=\205::<\4;;=::<;;=::<\202;;=\3::<__a\364\364\364\202\377\377" \
- "\377\1\376\376\376\205\377\377\377\1\376\376\376\202\377\377\377\1\376" \
- "\376\376\377\377\377\377\377\377\377\377\236\377\377\377\4\376\376\376" \
- "\377\377\377\363\363\365__a\203::<\10""99;;;=::<;;=99;;;=99;;;=\203:" \
- ":<\2__a\332\332\332\203\377\377\377\1\376\376\376\363\377\377\377\1\316" \
- "\316\316\214::<\1\316\316\316\377\377\377\377\207\377\377\377\7\363\363" \
- "\363kkm;;=::<;;=::<;;=\204::<\202;;=\10""99;;;=::<SSU\332\332\332\376" \
- "\376\376\377\377\377\376\376\376\205\377\377\377\1\376\376\376\377\377" \
- "\377\377\377\377\377\377\236\377\377\377\1\376\376\376\202\377\377\377" \
- "\2\346\346\350__a\202::<\4;;=::<;;=99;\204::<\1;;=\203::<\3xxz\362\362" \
- "\362\377\377\377\202\376\376\376\365\377\377\377\1\316\316\316\214::" \
- "<\1\316\316\316\377\377\377\377\210\377\377\377\5\376\376\376\234\234" \
- "\234;;=::<;;=\202::<\14;;=::<;;=99;;;=::<;;=::<;;=FFH\332\332\332\376" \
- "\376\376\203\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\377\377\377\377\377\235\377\377" \
- "\377\4\332\332\332FFH::<;;=\205::<\1;;=\205::<\2;;=\234\234\234\372\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\377\377\377\377\212\377\377" \
- "\377\2\300\300\300FFH\203::<\1""99;\202::<\2;;=99;\203::<\4;;=::<FFH" \
- "\266\266\266\205\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\377\377\377\377\377\377\377\377\235\377\377\377\3\332\332\332FF" \
- "H;;=\205::<\1;;=\202::<\1""99;\203::<\6FFH\301\301\301\377\377\377\376" \
- "\376\376\377\377\377\376\376\376\207\377\377\377\1\376\376\376\357\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\377\377\377\377\211\377\377" \
- "\377\4\376\376\376\377\377\377\331\331\331SSU\204::<\6""99;::<;;=::<" \
- ";;=::<\202;;=\202::<\1\266\266\270\203\377\377\377\1\376\376\376\377" \
- "\377\377\377\377\377\377\377\240\377\377\377\2\265\265\265EEG\202::<" \
- "\6;;=::<;;=::<;;=99;\203::<\4;;=::<SSU\332\332\332\203\377\377\377\1" \
- "\376\376\376\207\377\377\377\1\376\376\376\360\377\377\377\1\316\316" \
- "\316\214::<\1\316\316\316\377\377\377\377\212\377\377\377\15\376\376" \
- "\376\377\377\377\363\363\363__a::<;;=99;;;=::<99;;;=::<;;=\202::<\4;" \
- ";=99;;;=\250\250\252\204\377\377\377\1\376\376\376\377\377\377\377\377" \
- "\377\377\377\235\377\377\377\5\265\265\265::<;;=::<;;=\202::<\202;;=" \
- "\2::<;;=\204::<\2__a\364\364\364\206\377\377\377\1\376\376\376\366\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\377\377\377\377\211\377\377" \
- "\377\1\376\376\376\204\377\377\377\2\204\204\20699;\204::<\1;;=\204:" \
- ":<\5""99;;;=99;::<\204\204\204\377\377\377\377\377\377\377\377\232\377" \
- "\377\377\1\376\376\376\205\377\377\377\2\265\265\267;;=\211::<\1;;=\203" \
- "::<\1\205\205\205\377\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\377\377\377\377\215\377\377\377\12\376\376\376\377\377\377\250\250\250" \
- "::<;;=::<99;;;=::<;;=\202::<\3;;=::<99;\202::<\1\205\205\207\212\377" \
- "\377\377\1\376\376\376\377\377\377\377\377\377\377\377\223\377\377\377" \
- "\1\265\265\267\203::<\202;;=\1""99;\204::<\5;;=::<;;=::<\235\235\237" \
- "\377\377\377\377\2\377\377\377\316\316\316\214::<\1\316\316\316\377\377" \
- "\377\377\216\377\377\377\3\376\376\376\377\377\377\265\265\267\202::" \
- "<\3;;=::<;;=\205::<\1;;=\203::<\1\204\204\204\210\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\220" \
- "\377\377\377\6\234\234\236::<;;=::<;;=99;\204::<\1;;=\204::<\1\265\265" \
- "\265\377\377\377\377\202\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\377\377\377\377\215\377\377\377\1\376\376\376\203\377\377\377\2\334" \
- "\334\334FFH\207::<\202;;=\203::<\3;;=\204\204\206\376\376\376\207\377" \
- "\377\377\1\376\376\376\377\377\377\377\377\377\377\377\216\377\377\377" \
- "\11\376\376\376\377\377\377\376\376\376\204\204\206::<99;;;=::<;;=\204" \
- "::<\6;;=99;;;=::<FFH\301\301\301\377\377\377\377\203\377\377\377\1\316" \
- "\316\316\214::<\1\316\316\316\377\377\377\377\215\377\377\377\1\376\376" \
- "\376\202\377\377\377\202\376\376\376\3\332\332\332FFH::<\202;;=\203:" \
- ":<\3;;=99;;;=\204::<\2\205\205\207\376\376\376\203\377\377\377\1\376" \
- "\376\376\203\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377" \
- "\377\377\377\377\377\377\212\377\377\377\7\376\376\376\377\377\377\376" \
- "\376\376\204\204\20499;::<;;=\202::<\1""99;\205::<\4;;=::<GGI\332\332" \
- "\334\377\377\377\377\204\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\377\377\377\377\217\377\377\377\6\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\362\362\362__a\203::<\202;;=\11""99;;;=::<99;;;=::<;;=:" \
- ":<\204\204\204\205\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\377\377\377\377\377\377\377\377\215\377\377\377\1\204\204\204\202" \
- "::<\1;;=\207::<\1<<>\202::<\2FFH\331\331\333\377\377\377\377\205\377" \
- "\377\377\1\316\316\316\214::<\1\316\316\316\377\377\377\377\216\377\377" \
- "\377\1\376\376\376\203\377\377\377\4\376\376\376\377\377\377\363\363" \
- "\363__a\204::<\2;;=99;\206::<\2;;=\204\204\204\203\377\377\377\1\376" \
- "\376\376\377\377\377\377\377\377\377\377\220\377\377\377\1\204\204\204" \
- "\205::<\1;;=\203::<\1;;=\203::<\4__a\363\363\363\377\377\377\376\376" \
- "\376\377\377\377\377\204\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\377\377\377\377\224\377\377\377\4\376\376\376\363\363\363xxx::<\202" \
- ";;=\202::<\1;;=\203::<\1;;=\203::<\1\205\205\207\204\377\377\377\1\376" \
- "\376\376\377\377\377\377\377\377\377\377\215\377\377\377\1\250\250\250" \
- "\205::<\1;;=\203::<\12;;=99;;;=::<__a\363\363\365\377\377\377\376\376" \
- "\376\377\377\377\376\376\376\377\377\377\377\203\377\377\377\1\316\316" \
- "\316\214::<\1\316\316\316\377\377\377\377\227\377\377\377\5\204\204\204" \
- "::<;;=::<;;=\204::<\1""99;\204::<\1\204\204\204\377\377\377\377\377\377" \
- "\377\377\213\377\377\377\1\376\376\376\202\377\377\377\4\376\376\376" \
- "\377\377\377\265\265\267;;=\212::<\4;;=::<__a\363\363\363\217\377\377" \
- "\377\1\376\376\376\367\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\376\377\377\377\202\377\377\375\3\377\376\377\377\377\377\376\377\375" \
- "\224\377\377\377\3\204\204\206::<;;=\211::<\7""99;::<\203\203\205\377" \
- "\377\377\376\376\376\377\377\377\376\376\376\205\377\377\377\1\376\376" \
- "\376\202\377\377\377\202\376\376\376\377\377\377\377\377\377\377\377" \
- "\2\264\264\266;;=\202::<\202;;=\1""99;\207::<\2__a\363\363\365\217\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\366\377\377\377\1\316" \
- "\316\316\214::<\1\316\316\316\375\377\377\377\5\377\377\375\377\376\377" \
- "\377\375\377\377\377\375\377\377\377\202\377\376\377\221\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\204\204\206\203::<\1;;=\202::<\2;;=" \
- "::<\202;;=\202::<\3;;=\204\204\204\376\376\376\211\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\377\377\377\377\375\377\377\377\7\376" \
- "\376\376\264\264\266;;=99;::<;;=99;\204::<\1;;=\203::<\2aac\363\363\363" \
- "\221\377\377\377\1\376\376\376\367\377\377\377\1\316\316\316\214::<\1" \
- "\316\316\316\375\377\377\377\202\376\376\376\203\377\377\377\202\376" \
- "\377\377\222\377\377\377\10\376\376\376\377\377\377\376\376\376\204\204" \
- "\206::<;;=::<;;=\203::<\202;;=\202::<\6""99;;;=\205\205\207\376\376\376" \
- "\377\377\377\376\376\376\203\377\377\377\202\376\376\376\202\377\377" \
- "\377\1\376\376\376\377\377\377\377\375\377\377\377\3\376\376\376\302" \
- "\302\304;;=\203::<\1;;=\204::<\6;;=99;;;=::<aac\362\362\362\223\377\377" \
- "\377\1\376\376\376\366\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\374\377\377\377\6\375\377\376\377\377\375\377\376\377\376\377\377\376" \
- "\376\376\377\377\375\202\377\376\377\225\377\377\377\2\376\376\376\204" \
- "\204\206\206::<\1""99;\203::<\1;;=\202::<\1\251\251\253\204\377\377\377" \
- "\1\376\376\376\377\377\377\377\377\377\377\377\203\377\377\377\4\332" \
- "\332\332FFH::<;;=\202::<\1""99;\205::<\4;;=::<__a\363\363\365\202\377" \
- "\377\377\1\376\376\376\377\377\377\377\211\377\377\377\1\316\316\316" \
- "\214::<\1\316\316\316\374\377\377\377\5\376\377\377\376\376\376\377\376" \
- "\377\377\377\375\376\377\375\202\376\377\377\1\377\377\375\221\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\203\377\377\377\2\204\204" \
- "\206;;=\205::<\1;;=\203::<\7;;=::<;;=\265\265\265\376\376\376\377\377" \
- "\377\376\376\376\202\377\377\377\5\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\377\373\377\377\377\6\331\331\331" \
- "GGI::<;;=::<;;=\205::<\1<<>\202::<\2__a\363\363\365\202\377\377\377\1" \
- "\376\376\376\213\377\377\377\1\376\376\376\375\377\377\377\1\316\316" \
- "\316\214::<\1\316\316\316\374\377\377\377\7\377\376\377\376\377\377\376" \
- "\376\374\377\376\377\377\377\375\376\377\377\377\377\375\226\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\203\203\203\214::<\2;;=\265\265" \
- "\265\206\377\377\377\1\376\376\376\377\377\377\377\374\377\377\377\4" \
- "\364\364\364GGI99;;;=\206::<\1;;=\203::<\2__a\363\363\363\205\377\377" \
- "\377\1\376\376\376\212\377\377\377\1\363\363\363\203\377\377\377\1\376" \
- "\376\376\370\377\377\377\1\316\316\316\214::<\1\316\316\316\374\377\377" \
- "\377\10\377\377\375\377\376\377\377\377\377\377\377\375\377\376\377\370" \
- "\373\362\370\373\364\377\376\377\220\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\204\204\204\203::<\1;;=\210::<\2FFH\332\332\334\204\377\377\377\1" \
- "\376\376\376\377\377\377\377\374\377\377\377\3\363\363\363___;;=\202" \
- "::<\1;;=\204::<\6;;=99;;;=::<__a\363\363\365\220\377\377\377\3\265\265" \
- "\265FFF\333\333\333\373\377\377\377\1\316\316\316\214::<\1\316\316\316" \
- "\376\377\377\377\6\374\377\377\377\377\375\371\374\365\242\320c\240\322" \
- "c\371\372\362\221\377\377\377\1\376\376\376\210\377\377\377\2\203\203" \
- "\203;;=\202::<\1;;=\203::<\1;;=\203::<\3;;=FFH\333\333\333\202\377\377" \
- "\377\1\376\376\376\377\377\377\377\371\377\377\377\1\376\376\376\203" \
- "\377\377\377\2kkm::<\202;;=\1""99;\205::<\202;;=\3::<__a\363\363\363" \
- "\220\377\377\377\5\265\265\267::<;;=FFH\332\332\332\206\377\377\377\3" \
- "\376\376\376\377\377\377\376\376\376\361\377\377\377\1\316\316\316\213" \
- "::<\2;;=\316\316\316\365\377\377\377\22\376\376\377\377\377\375\377\377" \
- "\377\377\377\375\377\377\377\377\376\377\377\377\375\377\377\377\376" \
- "\376\377\377\377\377\371\374\365\242\320c\215\307\77\215\305@\242\322" \
- "e\372\373\365\376\377\375\377\376\377\230\377\377\377\3\205\205\207:" \
- ":<;;=\206::<\1;;=\202::<\4;;=SSU\363\363\365\376\376\376\377\377\377" \
- "\377\374\377\377\377\13\376\376\376\204\204\204::<;;=99;::<;;=::<;;=" \
- "::<;;=\203::<\3__a\364\364\366\376\376\376\217\377\377\377\1\265\265" \
- "\267\203::<\3;;=FFF\332\332\332\206\377\377\377\1\376\376\376\361\377" \
- "\377\377\2\376\376\376\317\317\317\212::<\6;;=;;;\316\316\316\376\376" \
- "\376\377\377\377\376\376\376\361\377\377\377\6\376\376\377\377\376\377" \
- "\375\376\377\376\377\377\377\377\375\375\377\376\202\377\377\377\17\376" \
- "\376\376\377\377\377\371\372\364\240\322a\215\305@\212\307>\215\307\77" \
- "\215\305>\242\320c\370\372\365\377\377\377\377\376\377\376\377\375\377" \
- "\377\375\377\376\377\225\377\377\377\5kkm::<;;=99;;;=\210::<\4__a\364" \
- "\364\364\376\376\376\377\377\377\202\376\376\376\377\377\377\377\363" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377\4" \
- "\250\250\252::<;;=99;\202;;=\205::<\202;;=\3FFH\345\345\345\376\376\376" \
- "\217\377\377\377\4\264\264\266;;=::<;;=\203::<\2GGI\332\332\332\203\377" \
- "\377\377\1\376\376\376\356\377\377\377\1\376\376\376\205\377\377\377" \
- "\2\315\315\315;;;\211::<\3;;;:::\315\315\315\202\377\377\377\1\376\376" \
- "\376\361\377\377\377\23\377\377\375\375\376\377\376\377\377\376\377\375" \
- "\377\374\377\377\377\375\375\377\376\377\377\377\377\377\375\371\372" \
- "\364\242\321g\215\306A\212\307>\215\306A\212\306@\214\305@\212\306B\241" \
- "\322_\367\372\361\204\377\377\377\1\377\377\375\220\377\377\377\1\376" \
- "\376\376\203\377\377\377\3\363\363\363__a99;\202::<\6;;=::<99;;;=99;" \
- ";;=\203::<\1\205\205\207\204\377\377\377\1\376\376\376\377\377\377\377" \
- "\362\377\377\377\1\376\376\376\202\377\377\377\22\376\376\376\265\265" \
- "\267::<99;;;=::<;;=99;;;=::<;;=::<;;=::<FFH\331\331\331\377\377\377\376" \
- "\376\376\216\377\377\377\1\265\265\267\203::<\1;;=\202::<\4;;=::<GGI" \
- "\332\332\332\210\377\377\377\1\376\376\376\353\377\377\377\1\376\376" \
- "\376\221\377\377\377\1\376\376\376\363\377\377\377\17\376\377\377\376" \
- "\377\375\377\375\376\375\377\376\377\377\375\377\377\377\377\376\377" \
- "\367\374\365\240\320b\215\307=\213\305=\215\306A\215\305>\214\305@\214" \
- "\306>\202\214\305@\4\241\321a\371\374\365\376\376\377\377\377\375\202" \
- "\376\377\377\221\377\377\377\1\376\376\376\203\377\377\377\3\362\362" \
- "\362``b99;\205::<\1;;=\203::<\6;;=99;\235\235\237\376\376\376\377\377" \
- "\377\376\376\376\377\377\377\377\366\377\377\377\2\332\332\332FFH\202" \
- ";;=\4""99;;;=::<;;=\205::<\2FFH\332\332\334\202\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\213\377\377\377\4\266\266\26699;::<;;=\202" \
- "::<\1;;=\202::<\4;;=::<FFF\332\332\332\203\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\376\376\376\375\377\377\377\1\376\376\376\363\377" \
- "\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377\202\377" \
- "\377\377\21\370\373\364\241\321c\216\306\77\212\306@\214\306>\215\305" \
- "@\212\306@\213\310=\214\306<\216\306\77\214\304=\214\306>\241\321c\372" \
- "\375\362\376\376\376\377\376\377\376\376\374\220\377\377\377\2\376\376" \
- "\376\377\377\377\203\376\376\376\4\377\377\377\364\364\364FFH;;=\202" \
- "::<\1;;=\202::<\1;;=\203::<\3;;=::<\265\265\265\377\377\377\377\367\377" \
- "\377\377\4\362\362\362SSU::<;;=\205::<\1""99;\202;;=\3::<;;=\265\265" \
- "\267\216\377\377\377\3\376\376\376\377\377\377\265\265\265\202::<\5;" \
- ";=99;;;=::<;;=\204::<\4;;=FFH\332\332\332\376\376\376\205\377\377\377" \
- "\1\376\376\376\355\377\377\377\1\376\376\376\214\377\377\377\1\376\376" \
- "\376\366\377\377\377\1\375\377\376\202\377\377\375\24\377\377\377\376" \
- "\376\376\373\373\363\243\322b\213\307A\214\306>\215\305@\214\305@\212" \
- "\307>\214\306>\215\305>\213\307A\214\305@\216\310@\214\306>\215\305>" \
- "\242\320c\366\373\364\375\377\376\377\376\377\221\377\377\377\1\376\376" \
- "\376\204\377\377\377\3\376\376\376\333\333\333EEG\202;;=\2::<;;=\207" \
- "::<\3GGI\332\332\332\376\376\376\377\377\377\377\365\377\377\377\1__" \
- "a\205::<\10;;=::<;;=::<;;=::<;;=\265\265\265\202\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\213\377\377\377\1\266\266\266\203::<\5""9" \
- "9;<<>::<;;=::<\202;;=\203::<\4;;=FFH\333\333\333\376\376\376\202\377" \
- "\377\377\1\376\376\376\355\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\215\377\377\377\1\376\376\376\363\377\377\377\3\377\376" \
- "\377\377\377\377\375\377\376\202\377\377\377\2\373\373\363\241\321d\202" \
- "\214\306>\17\216\306=\215\305@\215\307\77\214\306>\217\304>\214\306>" \
- "\214\305B\215\307\77\211\305A\215\306A\216\306\77\214\305@\242\322e\370" \
- "\373\364\377\377\375\230\377\377\377\1\333\333\335\203::<\202;;=\206" \
- "::<\3;;=FFH\363\363\363\377\377\377\377\364\377\377\377\1\204\204\206" \
- "\203::<\1;;=\207::<\2;;=\204\204\206\220\377\377\377\1\346\346\346\204" \
- "::<\1;;=\203::<\1;;=\202::<\202;;=\203::<\2FFH\332\332\332\357\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377\204\377\377" \
- "\377\1\377\377\375\202\377\377\377\17\377\376\377\370\373\364\243\322" \
- "b\214\306>\213\310\77\212\307>\214\306>\215\306C\212\307>\214\306<\213" \
- "\310\77\214\305@\214\306<\214\306>\216\306\77\203\214\306>\3\214\306" \
- "<\265\334\211\376\376\376\222\377\377\377\1\376\376\376\205\377\377\377" \
- "\4\376\376\377\265\265\267::<;;=\212::<\1___\377\377\377\377\363\377" \
- "\377\377\1\265\265\267\204::<\1;;=\206::<\2;;=\203\203\203\222\377\377" \
- "\377\2\265\265\265;;=\203::<\1;;=\205::<\1;;=\204::<\3;;=FFH\332\332" \
- "\332\206\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\377\345\377\377\377\10\376\376\377\377\377\375\377\377\377\377\377\375" \
- "\377\377\377\377\376\377\377\377\375\376\377\377\202\377\377\377\6\370" \
- "\373\362\243\322b\211\307B\213\310=\214\305@\214\306<\202\215\305@\4" \
- "\214\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214\306" \
- ">\215\307\77\214\305@\244\317c\367\375\361\233\377\377\377\3\234\234" \
- "\236::<99;\211::<\2;;=\204\204\206\377\377\377\377\360\377\377\377\13" \
- "\376\376\376\332\332\33299;::<99;;;=::<99;;;=::<;;=\202::<\3;;=^^`\364" \
- "\364\364\223\377\377\377\12\265\265\267;;=::<;;=99;;;=::<;;=::<;;=\202" \
- "::<\1;;=\203::<\3;;=FFF\332\332\332\206\377\377\377\1\376\376\376\377" \
- "\377\377\377\345\377\377\377\6\376\376\377\377\376\377\375\376\377\376" \
- "\377\377\377\377\375\375\377\376\203\377\377\377\27\377\377\375\372\373" \
- "\366\241\321a\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212" \
- "\306@\214\306>\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306" \
- ">\215\307\77\214\306>\242\322b\370\373\362\376\376\377\377\375\376\233" \
- "\377\377\377\1\204\204\206\203::<\13;;=::<;;=::<;;=::<;;=::<;;=\266\266" \
- "\266\376\376\376\203\377\377\377\1\376\376\376\377\377\377\377\352\377" \
- "\377\377\2\363\363\363TTV\202::<\3;;=99;;;=\204::<\4;;=99;FFH\363\363" \
- "\363\224\377\377\377\7\376\376\376\265\265\265;;=::<;;=::<;;=\203::<" \
- "\1;;=\203::<\1;;=\203::<\2GGI\332\332\332\203\377\377\377\1\376\376\376" \
- "\377\377\377\377\347\377\377\377\7\377\377\375\375\376\377\376\377\377" \
- "\376\377\375\377\374\377\377\377\375\375\377\376\202\377\377\377\5\372" \
- "\373\366\240\320b\215\307\77\212\306@\215\305>\202\214\305@\20\215\305" \
- "@\212\306@\214\305D\216\306\77\214\306>\215\307\77\214\306>\212\306@" \
- "\214\306>\215\307\77\215\305@\242\320c\370\373\362\377\377\373\377\376" \
- "\377\377\377\375\232\377\377\377\3\376\376\376\377\377\377^^`\202;;=" \
- "\205::<\1""99;\202;;=\5::<;;=\332\332\332\377\377\377\376\376\376\377" \
- "\377\377\377\347\377\377\377\1\376\376\376\204\377\377\377\1lln\204:" \
- ":<\202;;=\203::<\6;;=99;GGI\332\332\332\377\377\377\376\376\376\225\377" \
- "\377\377\2\264\264\264;;=\202::<\2""99;;;=\202::<\3""99;;;=::<\202;;" \
- "=\202::<\4;;=::<GGI\332\332\332\210\377\377\377\1\376\376\376\377\377" \
- "\377\377\342\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377" \
- "\376\377\377\375\377\377\377\377\376\377\370\373\362\241\321a\215\307" \
- "\77\215\307=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216" \
- "\306\77\215\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306" \
- ">\242\321a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377" \
- "\234\377\377\377\2\364\364\364RRT\202::<\4""99;;;=::<;;=\205::<\3SSU" \
- "\362\362\362\377\377\377\202\376\376\376\377\377\377\377\351\377\377" \
- "\377\1\234\234\236\204::<\1;;=\203::<\1;;=\203::<\1\265\265\267\231\377" \
- "\377\377\2\265\265\267;;=\203::<\2""99;;;=\202::<\1;;=\202::<\1;;=\202" \
- "::<\4;;=::<FFF\332\332\332\203\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\377\377\377\377\342\377\377\377\202\377\377\375\3" \
- "\377\374\377\375\377\376\376\377\377\202\377\377\377\25\370\373\364\243" \
- "\322b\217\304@\212\306@\214\305@\215\305>\212\307>\212\306@\214\305B" \
- "\214\305@\214\305B\214\306>\212\307>\212\310\77\214\306>\217\304@\214" \
- "\306>\214\305@\242\322b\370\373\362\377\377\377\202\377\376\377\1\377" \
- "\377\375\235\377\377\377\3\376\376\376\332\332\334GGI\202;;=\6::<;;=" \
- "99;;;=::<;;=\203::<\1yyy\202\376\376\376\202\377\377\377\1\376\376\376" \
- "\377\377\377\377\345\377\377\377\4\376\376\376\317\317\317::<;;=\202" \
- "::<\3;;=99;;;=\204::<\6;;=\221\221\223\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\226\377\377\377\3\376\376\376\265\265\267;;=\202::<" \
- "\2;;=99;\205::<\1;;=\204::<\4;;=FFH\332\332\332\376\376\376\205\377\377" \
- "\377\1\376\376\376\377\377\377\377\342\377\377\377\1\375\377\376\202" \
- "\377\377\375\34\377\377\377\376\376\376\373\373\363\243\322b\211\307" \
- "B\212\307<\215\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214" \
- "\306<\214\306>\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307" \
- ">\244\317c\370\373\362\377\377\373\376\377\377\377\376\377\375\376\377" \
- "\377\377\375\377\376\377\236\377\377\377\4\265\265\267::<;;=99;\202;" \
- ";=\205::<\202;;=\1\250\250\250\202\377\377\377\1\376\376\376\377\377" \
- "\377\377\343\377\377\377\1\376\376\376\202\377\377\377\3\363\363\363" \
- "FFH;;=\202::<\5;;=::<;;=::<99;\202;;=\2::<kkm\205\377\377\377\1\376\376" \
- "\376\227\377\377\377\1\265\265\265\204::<\6;;=::<;;=::<;;=::<\202;;=" \
- "\203::<\4;;=FFH\333\333\333\376\376\376\202\377\377\377\1\376\376\376" \
- "\377\377\377\377\343\377\377\377\3\377\376\377\377\377\377\375\377\376" \
- "\202\377\377\377\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214" \
- "\305@\213\310=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214" \
- "\306>\215\305>\217\304@\215\307\77\215\307=\242\320c\367\375\361\376" \
- "\376\377\377\376\377\376\376\376\202\377\377\375\2\374\377\377\377\376" \
- "\377\234\377\377\377\1\376\376\376\202\377\377\377\10\221\221\221::<" \
- ";;=99;::<;;=::<;;=\205::<\2\333\333\333\376\376\376\377\377\377\377\347" \
- "\377\377\377\1kkk\202::<\1;;=\205::<\1;;=\202::<\2RRT\363\363\365\236" \
- "\377\377\377\1\265\265\267\203::<\2""99;;;=\203::<\1;;=\202::<\202;;" \
- "=\203::<\2FFH\332\332\332\377\377\377\377\346\377\377\377\1\377\377\375" \
- "\202\377\377\377\32\377\376\377\370\373\364\243\322b\214\306>\213\310" \
- "\77\214\305@\215\305>\215\305@\214\306>\214\305B\212\307<\215\307=\214" \
- "\305B\214\306>\215\306A\212\306@\212\307>\214\306>\212\307<\244\317c" \
- "\370\373\364\377\377\377\377\375\376\377\377\375\376\377\377\377\377" \
- "\377\202\377\376\377\241\377\377\377\2kkm::<\202;;=\1""99;\204::<\203" \
- ";;=\2SSU\364\364\364\377\377\377\377\336\377\377\377\3\376\376\376\377" \
- "\377\377\376\376\376\204\377\377\377\2\376\376\376\250\250\252\202::" \
- "<\1;;=\210::<\2FFH\333\333\333\202\377\377\377\1\376\376\376\235\377" \
- "\377\377\2\265\265\265;;=\203::<\1;;=\205::<\1;;=\204::<\3;;=FFH\332" \
- "\332\332\206\377\377\377\3\376\376\376\377\377\377\376\376\376\243\377" \
- "\377\377\4\376\377\377\377\377\375\377\376\377\376\376\377\202\377\377" \
- "\377\2\376\377\375\376\377\377\230\377\377\377\10\376\377\377\377\376" \
- "\377\376\377\377\376\377\375\376\376\376\376\377\377\377\377\377\377" \
- "\376\377\231\377\377\377\7\377\376\377\376\376\374\376\377\377\377\377" \
- "\375\374\377\377\376\377\377\377\376\377\231\377\377\377\17\375\377\374" \
- "\377\377\375\377\377\377\377\376\377\376\377\377\377\376\377\377\377" \
- "\377\376\377\377\376\376\374\377\377\377\377\377\373\377\377\377\376" \
- "\377\377\377\377\377\377\377\375\220\377\377\377\4\377\377\373\377\377" \
- "\377\377\377\375\377\377\377\202\376\377\377\2\377\377\375\377\377\373" \
- "\251\377\377\377\10\376\376\377\377\377\375\377\377\377\377\377\375\377" \
- "\377\377\377\376\377\377\377\375\376\377\377\202\377\377\377\6\370\373" \
- "\362\243\322b\211\307B\213\310=\214\305@\214\306<\202\215\305@\4\214" \
- "\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214\306>\215" \
- "\307\77\214\305@\244\317c\367\375\361\251\377\377\377\6\363\363\363T" \
- "TT::<;;=::<;;=\206::<\2;;=www\204\377\377\377\1\376\376\376\377\377\377" \
- "\377\340\377\377\377\2\332\332\332;;=\203::<\3;;=99;;;=\203::<\3;;=:" \
- ":<\265\265\267\204\377\377\377\1\376\376\376\235\377\377\377\12\265\265" \
- "\267;;=::<;;=99;;;=::<;;=::<;;=\202::<\1;;=\203::<\3;;=FFF\332\332\332" \
- "\206\377\377\377\1\376\376\376\244\377\377\377\202\377\377\375\1\377" \
- "\377\377\202\376\377\375\3\376\376\377\377\377\377\377\376\377\230\377" \
- "\377\377\3\376\377\375\377\377\377\377\377\373\202\377\376\377\2\377" \
- "\377\377\376\376\376\231\377\377\377\10\376\377\373\376\375\377\377\377" \
- "\375\377\376\377\377\375\377\377\377\373\377\376\377\377\377\375\230" \
- "\377\377\377\12\377\376\377\377\377\377\377\375\376\376\377\377\376\377" \
- "\372\376\377\377\377\377\377\376\377\375\377\376\377\377\377\375\203" \
- "\377\377\377\202\376\377\375\1\375\376\377\227\377\377\377\1\377\374" \
- "\377\250\377\377\377\6\376\376\377\377\376\377\375\376\377\376\377\377" \
- "\377\377\375\375\377\376\203\377\377\377\27\377\377\375\372\373\366\241" \
- "\321a\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212\306@" \
- "\214\306>\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306>\215" \
- "\307\77\214\306>\242\322b\370\373\362\376\376\377\377\375\376\251\377" \
- "\377\377\2\331\331\331;;=\206::<\1;;=\203::<\2;;=\265\265\265\204\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377" \
- "\322\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\202\377\377\377\2\363\363\363SSU\203::<\2;;=::<\202" \
- ";;=\2""99;;;=\202::<\1\204\204\204\206\377\377\377\1\376\376\376\234" \
- "\377\377\377\7\376\376\376\265\265\265;;=::<;;=::<;;=\203::<\1;;=\203" \
- "::<\1;;=\203::<\2GGI\332\332\332\203\377\377\377\1\376\376\376\247\377" \
- "\377\377\1\377\377\375\202\377\376\377\1\377\375\377\202\377\377\377" \
- "\1\377\376\377\232\377\377\377\6\377\377\375\377\377\377\375\377\376" \
- "\376\377\375\377\377\375\377\375\377\230\377\377\377\202\377\377\375" \
- "\2\377\377\377\376\376\376\202\377\377\377\2\376\377\377\374\377\377" \
- "\230\377\377\377\1\377\377\375\202\377\376\377\1\375\376\377\203\377" \
- "\377\377\1\377\377\375\202\377\377\377\6\376\376\377\377\377\375\377" \
- "\377\377\377\375\377\377\376\377\377\377\375\220\377\377\377\1\376\377" \
- "\377\202\377\377\377\3\376\377\375\376\376\376\377\376\377\252\377\377" \
- "\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377\374\377\377" \
- "\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320b\215\307\77" \
- "\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214\305D\216\306" \
- "\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307\77\215\305" \
- "@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375\252\377\377" \
- "\377\2\250\250\25099;\204::<\12;;=99;::<;;=99;::<FFH\346\346\346\377" \
- "\377\377\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377\330" \
- "\377\377\377\1\376\376\376\204\377\377\377\3\221\221\221::<;;=\202::" \
- "<\5;;=::<;;=::<;;=\202::<\4___\363\363\363\377\377\377\376\376\376\202" \
- "\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\234\377\377\377\2\264\264\264;;=\202::<\2""99;;;=\202::<\3""99;" \
- ";;=::<\202;;=\202::<\4;;=::<GGI\332\332\332\210\377\377\377\1\376\376" \
- "\376\241\377\377\377\7\376\377\377\376\376\377\377\377\377\377\377\375" \
- "\376\377\375\375\377\376\376\377\377\230\377\377\377\3\376\376\377\376" \
- "\377\377\376\376\377\203\377\377\377\1\376\376\374\231\377\377\377\1" \
- "\377\376\377\202\377\377\377\202\376\377\377\1\376\376\376\232\377\377" \
- "\377\11\376\377\377\376\376\376\377\377\377\376\377\377\377\377\377\377" \
- "\377\375\376\377\377\376\376\377\376\377\377\202\377\377\377\5\377\377" \
- "\375\377\377\377\377\376\377\377\377\377\376\377\377\220\377\377\377" \
- "\10\376\376\377\377\376\377\377\377\377\376\376\376\377\376\377\377\377" \
- "\375\377\376\377\377\377\375\251\377\377\377\37\376\377\377\376\377\375" \
- "\377\375\376\375\377\376\377\377\375\377\377\377\377\376\377\370\373" \
- "\362\241\321a\215\307\77\215\307=\214\305@\214\306>\212\307<\214\306" \
- ">\214\306<\214\306>\216\306\77\215\305<\212\307>\213\307A\215\305>\212" \
- "\307>\215\307\77\214\306>\242\321a\373\374\364\377\377\377\376\377\377" \
- "\376\376\376\376\377\377\253\377\377\377\1yyy\205::<\3;;=::<99;\202;" \
- ";=\3::<__a\376\376\376\377\377\377\377\335\377\377\377\1\376\376\376" \
- "\202\377\377\377\5\301\301\301::<;;=99;;;=\207::<\2GGI\332\332\332\203" \
- "\377\377\377\1\376\376\376\243\377\377\377\2\265\265\267;;=\203::<\2" \
- "99;;;=\202::<\1;;=\202::<\1;;=\202::<\4;;=::<FFF\332\332\332\203\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\242\377\377\377" \
- "\1\377\377\375\204\377\377\377\1\376\377\377\231\377\377\377\202\377" \
- "\376\377\202\377\377\377\4\377\377\375\377\377\377\376\377\377\375\377" \
- "\376\230\377\377\377\203\377\377\375\202\377\377\377\2\376\376\376\376" \
- "\377\377\231\377\377\377\1\376\376\376\202\376\377\377\13\377\376\374" \
- "\377\376\377\376\376\374\376\377\377\377\377\377\376\377\377\377\377" \
- "\377\377\377\375\376\376\376\377\377\377\377\376\377\222\377\377\377" \
- "\202\377\377\375\5\377\377\377\376\377\377\377\377\377\377\377\375\376" \
- "\377\377\251\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376" \
- "\377\377\202\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214" \
- "\305@\215\305>\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>" \
- "\212\307>\212\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370" \
- "\373\362\377\377\377\202\377\376\377\1\377\377\375\254\377\377\377\4" \
- "\363\363\363SSU;;=99;\202;;=\1""99;\204::<\3;;=::<\235\235\237\377\377" \
- "\377\377\334\377\377\377\1\376\376\376\202\377\377\377\2\363\363\363" \
- "GGI\202::<\7;;=::<99;::<;;=::<;;=\202::<\2\266\266\266\376\376\376\204" \
- "\377\377\377\202\376\376\376\202\377\377\377\1\376\376\376\236\377\377" \
- "\377\3\376\376\376\265\265\267;;=\202::<\2;;=99;\205::<\1;;=\204::<\4" \
- ";;=FFH\332\332\332\376\376\376\205\377\377\377\1\376\376\376\240\377" \
- "\377\377\10\376\377\375\377\375\377\377\377\375\376\377\375\377\377\377" \
- "\377\376\377\377\377\377\376\376\374\230\377\377\377\10\374\377\377\377" \
- "\376\374\377\377\377\376\376\374\377\376\377\376\377\377\377\377\377" \
- "\377\376\377\230\377\377\377\3\377\377\375\377\377\377\376\377\375\203" \
- "\377\377\377\1\377\376\377\231\377\377\377\6\377\375\377\376\376\374" \
- "\377\377\377\377\376\377\376\377\375\377\376\377\202\377\377\377\2\377" \
- "\376\377\377\377\377\202\376\377\377\2\376\376\377\376\377\377\222\377" \
- "\377\377\2\377\377\375\377\375\377\202\376\377\377\4\376\376\376\376" \
- "\377\377\375\377\374\377\375\377\251\377\377\377\1\375\377\376\202\377" \
- "\377\375\34\377\377\377\376\376\376\373\373\363\243\322b\211\307B\212" \
- "\307<\215\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214\306<" \
- "\214\306>\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244" \
- "\317c\370\373\362\377\377\373\376\377\377\377\376\377\375\376\377\377" \
- "\377\375\377\376\377\252\377\377\377\5\376\376\376\377\377\377\333\333" \
- "\33399;;;=\202::<\5;;=99;;;=99;;;=\203::<\1\332\332\334\377\377\377\377" \
- "\330\377\377\377\1\376\376\376\205\377\377\377\1xxx\202::<\1;;=\202:" \
- ":<\1;;=\204::<\4:::xxx\376\376\376\377\377\377\202\376\376\376\205\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\237\377\377\377\1\265" \
- "\265\265\204::<\6;;=::<;;=::<;;=::<\202;;=\203::<\4;;=FFH\333\333\333" \
- "\376\376\376\202\377\377\377\1\376\376\376\242\377\377\377\7\376\376" \
- "\376\377\376\377\326\352\267\247\324o\247\324m\252\324r\247\324o\231" \
- "\252\324p\10\323\353\271\377\376\377\377\377\377\376\377\377\350\365" \
- "\333\253\323p\250\324r\251\324k\230\252\324p\10\250\325n\252\324p\277" \
- "\337\223\376\377\377\377\377\377\375\377\376\376\377\377\276\336\222" \
- "\230\252\324p\7\250\325p\250\324r\247\324o\253\324n\251\323m\346\364" \
- "\332\377\376\377\202\377\377\377\7\323\352\266\253\323p\251\323m\253" \
- "\323r\251\323o\247\324m\252\324r\220\252\324p\10\252\324n\253\324n\247" \
- "\324k\252\324p\254\325o\247\324m\252\324p\324\353\267\250\377\377\377" \
- "\3\377\376\377\377\377\377\375\377\376\202\377\377\377\11\373\373\363" \
- "\241\321d\214\306>\213\310=\214\306>\214\305@\213\310=\212\306@\217\304" \
- ">\202\215\307=\14\214\306>\215\305>\214\306>\215\305>\217\304@\215\307" \
- "\77\215\307=\242\320c\367\375\361\376\376\377\377\376\377\376\376\376" \
- "\202\377\377\375\2\374\377\377\377\376\377\254\377\377\377\2\376\376" \
- "\376\251\251\251\202::<\5;;=::<;;=99;;;=\204::<\1``b\377\377\377\377" \
- "\334\377\377\377\3\376\376\376\301\301\301:::\205::<\1""99;\202::<\4" \
- ";;=::<SSS\362\362\362\207\377\377\377\1\376\376\376\202\377\377\377\202" \
- "\376\376\376\240\377\377\377\1\265\265\267\203::<\2""99;;;=\203::<\1" \
- ";;=\202::<\202;;=\203::<\2FFH\332\332\332\245\377\377\377\10\376\377" \
- "\377\377\377\377\305\342\237\215\306A\215\307\77\215\305@\213\310=\214" \
- "\305@\230\214\306>\10\304\341\237\377\374\377\377\376\377\377\377\377" \
- "\341\362\322\215\305>\212\307>\215\305>\230\214\306>\4\215\305<\214\305" \
- "@\252\324r\376\377\377\202\377\377\377\2\377\377\375\250\324r\230\214" \
- "\306>\20\215\307\77\214\306>\214\306<\214\305B\212\307>\337\363\320\377" \
- "\376\377\376\377\377\376\376\374\305\342\240\214\305@\213\310=\215\305" \
- "@\214\306>\212\307<\214\305@\220\214\306>\10\214\305@\215\306C\212\307" \
- "<\214\306>\215\305>\212\306@\215\305>\304\343\237\250\377\377\377\1\377" \
- "\377\375\202\377\377\377\32\377\376\377\370\373\364\243\322b\214\306" \
- ">\213\310\77\214\305@\215\305>\215\305@\214\306>\214\305B\212\307<\215" \
- "\307=\214\305B\214\306>\215\306A\212\306@\212\307>\214\306>\212\307<" \
- "\244\317c\370\373\364\377\377\377\377\375\376\377\377\375\376\377\377" \
- "\377\377\377\202\377\376\377\257\377\377\377\1kkm\202::<\2;;=::<\202" \
- ";;=\3::<;;=::<\202;;=\1\233\233\233\377\377\377\377\330\377\377\377\1" \
- "\376\376\376\202\377\377\377\3\364\364\366FFH;;=\205::<\3;;=::<;;=\202" \
- "::<\1\316\316\316\256\377\377\377\2\265\265\265;;=\203::<\1;;=\205::" \
- "<\1;;=\204::<\3;;=FFH\332\332\332\206\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\235\377\377\377\1\304\343\240\235\214\306>\1\305\342" \
- "\237\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377" \
- "\377\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377" \
- "\3\305\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306" \
- ">\1\214\305@\205\214\306>\1\305\342\237\241\377\377\377\10\376\376\377" \
- "\377\377\375\377\377\377\377\377\375\377\377\377\377\376\377\377\377" \
- "\375\376\377\377\202\377\377\377\6\370\373\362\243\322b\211\307B\213" \
- "\310=\214\305@\214\306<\202\215\305@\4\214\306<\214\305@\214\306<\215" \
- "\307\77\202\214\306>\6\212\307>\214\306>\215\307\77\214\305@\244\317" \
- "c\367\375\361\267\377\377\377\2\363\363\363FFF\204::<\1;;=\203::<\4:" \
- "9>::<;;=\332\332\332\377\377\377\377\332\377\377\377\1yy{\202::<\2""9" \
- "9;;;=\202::<\6;;=99;::<;;=::<\234\234\236\260\377\377\377\12\265\265" \
- "\267;;=::<;;=99;;;=::<;;=::<;;=\202::<\1;;=\203::<\3;;=FFF\332\332\332" \
- "\206\377\377\377\1\376\376\376\236\377\377\377\1\304\343\240\235\214" \
- "\306>\1\305\342\237\203\377\377\377\1\342\362\316\235\214\306>\1\250" \
- "\325p\204\377\377\377\1\252\324p\234\214\306>\2\215\307\77\342\362\316" \
- "\203\377\377\377\3\305\342\237\214\305@\215\305>\202\214\306>\1\214\305" \
- "@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237\240\377\377\377" \
- "\6\376\376\377\377\376\377\375\376\377\376\377\377\377\377\375\375\377" \
- "\376\203\377\377\377\27\377\377\375\372\373\366\241\321a\217\304@\212" \
- "\307<\214\306>\215\305>\215\305@\213\310=\212\306@\214\306>\214\305B" \
- "\215\307\77\215\305>\215\306A\212\307>\214\306>\215\307\77\214\306>\242" \
- "\322b\370\373\362\376\376\377\377\375\376\267\377\377\377\1\301\301\301" \
- "\205::<\3;;=::<;;=\202::<\2""99;```\377\377\377\377\331\377\377\377\1" \
- "\301\301\301\202::<\1;;=\203::<\1;;=\202::<\3<<>::<__a\261\377\377\377" \
- "\7\376\376\376\265\265\265;;=::<;;=::<;;=\203::<\1;;=\203::<\1;;=\203" \
- "::<\2GGI\332\332\332\203\377\377\377\1\376\376\376\240\377\377\377\1" \
- "\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316" \
- "\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215" \
- "\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202" \
- "\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237" \
- "\240\377\377\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377" \
- "\374\377\377\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320" \
- "b\215\307\77\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214" \
- "\305D\216\306\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307" \
- "\77\215\305@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375" \
- "\270\377\377\377\3\204\204\204::<;;=\206::<\4;;=::<;;=\234\234\236\377" \
- "\377\377\377\325\377\377\377\4\376\376\376\377\377\377\363\363\363SS" \
- "U\211::<\4""99;::<\332\332\334\376\376\376\202\377\377\377\1\376\376" \
- "\376\257\377\377\377\2\264\264\264;;=\202::<\2""99;;;=\202::<\3""99;" \
- ";;=::<\202;;=\202::<\4;;=::<GGI\332\332\332\210\377\377\377\1\376\376" \
- "\376\232\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377" \
- "\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252" \
- "\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342" \
- "\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305" \
- "@\205\214\306>\1\305\342\237\241\377\377\377\37\376\377\377\376\377\375" \
- "\377\375\376\375\377\376\377\377\375\377\377\377\377\376\377\370\373" \
- "\362\241\321a\215\307\77\215\307=\214\305@\214\306>\212\307<\214\306" \
- ">\214\306<\214\306>\216\306\77\215\305<\212\307>\213\307A\215\305>\212" \
- "\307>\215\307\77\214\306>\242\321a\373\374\364\377\377\377\376\377\377" \
- "\376\376\376\376\377\377\270\377\377\377\3\363\363\363TTT;;=\202::<\1" \
- ";;=\203::<\5""99;;;=::<;;=\332\332\332\377\377\377\377\323\377\377\377" \
- "\1\376\376\376\202\377\377\377\4\221\221\221;;=99;;;=\202::<\1;;=\202" \
- "::<\1;;=\202::<\1\233\233\233\202\377\377\377\1\376\376\376\262\377\377" \
- "\377\2\265\265\267;;=\203::<\2""99;;;=\202::<\1;;=\202::<\1;;=\202::" \
- "<\4;;=::<FFF\332\332\332\203\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\233\377\377\377\1\304\343\240\235\214\306>\1\305\342\237" \
- "\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377" \
- "\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305" \
- "\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214" \
- "\305@\205\214\306>\1\305\342\237\240\377\377\377\202\377\377\375\3\377" \
- "\374\377\375\377\376\376\377\377\202\377\377\377\25\370\373\364\243\322" \
- "b\217\304@\212\306@\214\305@\215\305>\212\307>\212\306@\214\305B\214" \
- "\305@\214\305B\214\306>\212\307>\212\310\77\214\306>\217\304@\214\306" \
- ">\214\305@\242\322b\370\373\362\377\377\377\202\377\376\377\1\377\377" \
- "\375\272\377\377\377\7\316\316\316::<;;=::<99;::<;;=\205::<\1kkm\377" \
- "\377\377\377\325\377\377\377\1\315\315\315\206::<\6""99;::<99;;;=::<" \
- "```\206\377\377\377\1\376\376\376\257\377\377\377\3\376\376\376\265\265" \
- "\267;;=\202::<\2;;=99;\205::<\1;;=\204::<\4;;=FFH\332\332\332\376\376" \
- "\376\205\377\377\377\1\376\376\376\232\377\377\377\1\304\343\240\235" \
- "\214\306>\1\305\342\237\203\377\377\377\1\342\362\316\235\214\306>\1" \
- "\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215\307\77\342\362" \
- "\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202\214\306>\1\214" \
- "\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237\241\377\377" \
- "\377\1\375\377\376\202\377\377\375\34\377\377\377\376\376\376\373\373" \
- "\363\243\322b\211\307B\212\307<\215\305>\214\306>\212\307>\214\305@\217" \
- "\304>\212\307<\214\306<\214\306>\215\307\77\213\307A\214\306>\215\305" \
- "@\215\307\77\212\307>\244\317c\370\373\362\377\377\373\376\377\377\377" \
- "\376\377\375\376\377\377\377\375\377\376\377\272\377\377\377\2\222\222" \
- "\22299;\205::<\1;;=\203::<\2;;=\250\250\250\377\377\377\377\324\377\377" \
- "\377\4```;;=99;;;=\204::<\5;;=::<;;=::<\331\331\331\207\377\377\377\1" \
- "\376\376\376\260\377\377\377\1\265\265\265\204::<\6;;=::<;;=::<;;=::" \
- "<\202;;=\203::<\4;;=FFH\333\333\333\376\376\376\202\377\377\377\1\376" \
- "\376\376\234\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203" \
- "\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1" \
- "\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305" \
- "\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214" \
- "\305@\205\214\306>\1\305\342\237\240\377\377\377\3\377\376\377\377\377" \
- "\377\375\377\376\202\377\377\377\11\373\373\363\241\321d\214\306>\213" \
- "\310=\214\306>\214\305@\213\310=\212\306@\217\304>\202\215\307=\14\214" \
- "\306>\215\305>\214\306>\215\305>\217\304@\215\307\77\215\307=\242\320" \
- "c\367\375\361\376\376\377\377\376\377\376\376\376\202\377\377\375\2\374" \
- "\377\377\377\376\377\262\377\377\377\2\376\376\376\377\377\377\202\376" \
- "\376\376\204\377\377\377\5\363\363\363SSU99;::<;;=\207::<\2GGG\363\363" \
- "\363\377\377\377\377\322\377\377\377\4\234\234\234:::::<;;=\202::<\1" \
- ";;=\203::<\202;;=\1\234\234\236\207\377\377\377\1\376\376\376\262\377" \
- "\377\377\1\265\265\267\203::<\2""99;;;=\203::<\1;;=\202::<\202;;=\203" \
- "::<\2FFH\332\332\332\237\377\377\377\1\304\343\240\235\214\306>\1\305" \
- "\342\237\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377" \
- "\377\377\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377" \
- "\377\3\305\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214" \
- "\306>\1\214\305@\205\214\306>\1\305\342\237\240\377\377\377\1\377\377" \
- "\375\202\377\377\377\32\377\376\377\370\373\364\243\322b\214\306>\213" \
- "\310\77\214\305@\215\305>\215\305@\214\306>\214\305B\212\307<\215\307" \
- "=\214\305B\214\306>\215\306A\212\306@\212\307>\214\306>\212\307<\244" \
- "\317c\370\373\364\377\377\377\377\375\376\377\377\375\376\377\377\377" \
- "\377\377\202\377\376\377\273\377\377\377\2\376\376\376\316\316\316\206" \
- "::<\202;;=\4::<;;=::<xxx\377\377\377\377\321\377\377\377\2\346\346\350" \
- "FFH\203::<\1;;=\206::<\1__a\202\377\377\377\1\377\377\375\271\377\377" \
- "\377\2\265\265\265;;=\203::<\1;;=\205::<\1;;=\203::<\4;;=::<GGI\331\331" \
- "\331\236\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377" \
- "\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252" \
- "\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342" \
- "\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305" \
- "@\205\214\306>\1\305\342\237\231\377\377\377\10\376\376\377\377\377\375" \
- "\377\377\377\377\377\375\377\377\377\377\376\377\377\377\375\376\377" \
- "\377\202\377\377\377\6\370\373\362\243\322b\211\307B\213\310=\214\305" \
- "@\214\306<\202\215\305@\4\214\306<\214\305@\214\306<\215\307\77\202\214" \
- "\306>\6\212\307>\214\306>\215\307\77\214\305@\244\317c\367\375\361\305" \
- "\377\377\377\2xxz;;=\203::<\3;;=::<;;=\203::<\2;;=\315\315\315\377\377" \
- "\377\377\313\377\377\377\203\376\376\376\202\377\377\377\3xxz;;=::<\202" \
- ";;=\1""99;\202;;=\202::<\4;;=::<\333\333\335\376\376\376\274\377\377" \
- "\377\12\265\265\267;;=::<;;=99;;;=::<;;=::<;;=\202::<\1;;=\202::<\4;" \
- ";=99;GGI\332\332\332\235\377\377\377\1\304\343\240\235\214\306>\1\305" \
- "\342\237\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377" \
- "\377\377\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377" \
- "\377\3\305\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214" \
- "\306>\1\214\305@\205\214\306>\1\305\342\237\230\377\377\377\6\376\376" \
- "\377\377\376\377\375\376\377\376\377\377\377\377\375\375\377\376\203" \
- "\377\377\377\27\377\377\375\372\373\366\241\321a\217\304@\212\307<\214" \
- "\306>\215\305>\215\305@\213\310=\212\306@\214\306>\214\305B\215\307\77" \
- "\215\305>\215\306A\212\307>\214\306>\215\307\77\214\306>\242\322b\370" \
- "\373\362\376\376\377\377\375\376\304\377\377\377\2\364\364\364FFH\203" \
- "::<\2""99;;;=\203::<\4<<>99;TTT\376\376\376\377\377\377\377\310\377\377" \
- "\377\1\376\376\376\205\377\377\377\3\316\316\316::<99;\206::<\1;;=\202" \
- "::<\1\221\221\221\203\377\377\377\1\376\376\376\272\377\377\377\7\376" \
- "\376\376\265\265\265;;=::<;;=::<;;=\203::<\1;;=\203::<\6;;=::<;;=::<" \
- "FFH\332\332\332\234\377\377\377\1\304\343\240\235\214\306>\1\305\342" \
- "\237\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377" \
- "\377\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377" \
- "\3\305\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306" \
- ">\1\214\305@\205\214\306>\1\305\342\237\230\377\377\377\7\377\377\375" \
- "\375\376\377\376\377\377\376\377\375\377\374\377\377\377\375\375\377" \
- "\376\202\377\377\377\5\372\373\366\240\320b\215\307\77\212\306@\215\305" \
- ">\202\214\305@\20\215\305@\212\306@\214\305D\216\306\77\214\306>\215" \
- "\307\77\214\306>\212\306@\214\306>\215\307\77\215\305@\242\320c\370\373" \
- "\362\377\377\373\377\376\377\377\377\375\304\377\377\377\3\376\376\376" \
- "\265\265\267;;=\204::<\1""99;\203::<\3;;=::<\234\234\234\203\377\377" \
- "\377\1\376\376\376\377\377\377\377\306\377\377\377\7\376\376\376\377" \
- "\377\377\376\376\376\377\377\377__a::<;;=\203::<\7;;=::<;;=::<;;=SSU" \
- "\363\363\363\300\377\377\377\2\264\264\264;;=\202::<\2""99;;;=\202::" \
- "<\3""99;;;=::<\202;;=\204::<\2FFH\332\332\332\233\377\377\377\1\304\343" \
- "\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316\235\214" \
- "\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215\307\77" \
- "\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202\214" \
- "\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237\231" \
- "\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377\376\377\377" \
- "\375\377\377\377\377\376\377\370\373\362\241\321a\215\307\77\215\307" \
- "=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216\306\77\215" \
- "\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306>\242\321" \
- "a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377\301\377" \
- "\377\377\1\376\376\376\204\377\377\377\2kkm99;\203::<\202;;=\1""99;\203" \
- "::<\2FFH\363\363\363\377\377\377\377\310\377\377\377\1\376\376\376\203" \
- "\377\377\377\3\250\250\252::<;;=\203::<\1;;=\202::<\5;;=::<;;=\301\301" \
- "\301\376\376\376\301\377\377\377\2\265\265\267;;=\203::<\2""99;;;=\202" \
- "::<\1;;=\202::<\2;;=::<\202;;=\3::<GGI\332\332\332\232\377\377\377\1" \
- "\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316" \
- "\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215" \
- "\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202" \
- "\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237" \
- "\230\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377" \
- "\202\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305@\215" \
- "\305>\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212\307>" \
- "\212\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362" \
- "\377\377\377\202\377\376\377\1\377\377\375\301\377\377\377\1\376\376" \
- "\376\204\377\377\377\2\376\376\376\346\346\350\203::<\4;;=99;::<;;=\204" \
- "::<\3\203\203\203\377\377\377\376\376\376\377\377\377\377\311\377\377" \
- "\377\2\364\364\364FFH\202::<\5;;=::<;;=::<;;=\202::<\2;;=kkm\202\377" \
- "\377\377\1\376\376\376\300\377\377\377\3\376\376\376\265\265\267;;=\202" \
- "::<\2;;=99;\204::<\3;;=99;;;=\202::<\3;;=::<\265\265\265\232\377\377" \
- "\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362" \
- "\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>" \
- "\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215" \
- "\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1" \
- "\305\342\237\231\377\377\377\1\375\377\376\202\377\377\375\34\377\377" \
- "\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215\305>\214" \
- "\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>\215\307\77" \
- "\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370\373\362" \
- "\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375\377\376" \
- "\377\301\377\377\377\202\376\376\376\2\377\377\377\376\376\376\202\377" \
- "\377\377\1\234\234\236\203::<\1;;=\206::<\2;;=\331\331\331\377\377\377" \
- "\377\306\377\377\377\1\376\376\376\203\377\377\377\4\233\233\233;;=:" \
- ":<;;=\202::<\3;;=99;;;=\203::<\1\346\346\350\305\377\377\377\1\265\265" \
- "\265\204::<\3;;=::<;;=\203::<\5;;=99;;;=::<\265\265\267\233\377\377\377" \
- "\1\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316" \
- "\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215" \
- "\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202" \
- "\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237" \
- "\230\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377" \
- "\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310" \
- "=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305" \
- ">\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376" \
- "\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\301\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\6\364" \
- "\364\364SSU::<;;=::<;;=\205::<\4""99;kkk\377\377\377\376\376\376\377" \
- "\377\377\377\307\377\377\377\2\346\346\346;;;\204::<\3;;=99;;;=\203:" \
- ":<\1\234\234\236\205\377\377\377\1\376\376\376\301\377\377\377\1\265" \
- "\265\267\203::<\2""99;;;=\202::<\1;;;\204::<\1\265\265\267\234\377\377" \
- "\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362" \
- "\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>" \
- "\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215" \
- "\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1" \
- "\305\342\237\230\377\377\377\1\377\377\375\202\377\377\377\32\377\376" \
- "\377\370\373\364\243\322b\214\306>\213\310\77\214\305@\215\305>\215\305" \
- "@\214\306>\214\305B\212\307<\215\307=\214\305B\214\306>\215\306A\212" \
- "\306@\212\307>\214\306>\212\307<\244\317c\370\373\364\377\377\377\377" \
- "\375\376\377\377\375\376\377\377\377\377\377\202\377\376\377\306\377" \
- "\377\377\1\376\376\376\202\377\377\377\2\301\301\303::<\202;;=\11::<" \
- ";;=::<;;=::<99;;;=::<\301\301\301\377\377\377\377\306\377\377\377\12" \
- "\376\376\376\377\377\377\204\204\204;;=::<:9>;;=::<99;;;=\203::<\5SS" \
- "U\363\363\363\376\376\376\377\377\377\376\376\376\305\377\377\377\5\265" \
- "\265\26599;;;=::<;;=\206::<\1\266\266\270\235\377\377\377\1\304\343\240" \
- "\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316\235\214\306" \
- ">\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215\307\77\342" \
- "\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202\214\306" \
- ">\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237\221\377" \
- "\377\377\10\376\376\377\377\377\375\377\377\377\377\377\375\377\377\377" \
- "\377\376\377\377\377\375\376\377\377\202\377\377\377\6\370\373\362\243" \
- "\322b\211\307B\213\310=\214\305@\214\306<\202\215\305@\4\214\306<\214" \
- "\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214\306>\215\307\77" \
- "\214\305@\244\317c\367\375\361\322\377\377\377\1kkk\203::<\4;;=99;::" \
- "<;;=\203::<\1SSU\210\377\377\377\1\376\376\376\377\377\377\377\276\377" \
- "\377\377\1\316\316\316\202::<\1;;=\202::<\202;;=\202::<\4;;=::<\265\265" \
- "\267\376\376\376\307\377\377\377\3\376\376\376\377\377\377\265\265\267" \
- "\207::<\3""99;\266\266\270\376\376\377\202\377\377\377\1\376\376\376" \
- "\232\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377" \
- "\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324" \
- "p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237" \
- "\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205" \
- "\214\306>\1\305\342\237\220\377\377\377\6\376\376\377\377\376\377\375" \
- "\376\377\376\377\377\377\377\375\375\377\376\203\377\377\377\27\377\377" \
- "\375\372\373\366\241\321a\217\304@\212\307<\214\306>\215\305>\215\305" \
- "@\213\310=\212\306@\214\306>\214\305B\215\307\77\215\305>\215\306A\212" \
- "\307>\214\306>\215\307\77\214\306>\242\322b\370\373\362\376\376\377\377" \
- "\375\376\321\377\377\377\1\346\346\346\204::<\1;;=\202::<\5;;=99;;;=" \
- "::<\266\266\266\205\377\377\377\202\376\376\376\2\377\377\377\376\376" \
- "\376\377\377\377\377\273\377\377\377\5\376\376\376\377\377\377kkm::<" \
- ";;=\202::<\1;;=\203::<\3;;=::<kkm\203\377\377\377\1\376\376\376\306\377" \
- "\377\377\4\376\376\376\377\377\377\265\265\265::<\202;;=\202::<\2""9" \
- "9;\266\266\270\237\377\377\377\1\304\343\240\235\214\306>\1\305\342\237" \
- "\203\377\377\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377" \
- "\1\252\324p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305" \
- "\342\237\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214" \
- "\305@\205\214\306>\1\305\342\237\220\377\377\377\7\377\377\375\375\376" \
- "\377\376\377\377\376\377\375\377\374\377\377\377\375\375\377\376\202" \
- "\377\377\377\5\372\373\366\240\320b\215\307\77\212\306@\215\305>\202" \
- "\214\305@\20\215\305@\212\306@\214\305D\216\306\77\214\306>\215\307\77" \
- "\214\306>\212\306@\214\306>\215\307\77\215\305@\242\320c\370\373\362" \
- "\377\377\373\377\376\377\377\377\375\322\377\377\377\1\221\221\223\202" \
- "::<\12;;=99;::<;;=::<;;=99;;;=EEG\364\364\364\203\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\377\377\377\377\275\377\377\377\2" \
- "\316\316\320;;=\205::<\2""99;;;=\203::<\3\316\316\316\377\377\377\376" \
- "\376\376\313\377\377\377\3\265\265\265;;=99;\202::<\1\266\266\270\203" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\232\377\377\377\1" \
- "\304\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316" \
- "\235\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215" \
- "\307\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202" \
- "\214\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237" \
- "\221\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377\376\377" \
- "\377\375\377\377\377\377\376\377\370\373\362\241\321a\215\307\77\215" \
- "\307=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216\306\77" \
- "\215\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306>\242" \
- "\321a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377\322" \
- "\377\377\377\2\363\363\363FFH\203::<\202;;=\203::<\3;;=::<\235\235\235" \
- "\204\377\377\377\1\376\376\376\377\377\377\377\277\377\377\377\1__a\202" \
- "::<\1;;=\203::<\5;;=::<;;=::<\204\204\206\312\377\377\377\1\376\376\376" \
- "\202\377\377\377\7\376\376\376\377\377\377\265\265\267;;=99;\266\266" \
- "\270\376\376\377\203\377\377\377\202\376\376\376\233\377\377\377\1\304" \
- "\343\240\235\214\306>\1\305\342\237\203\377\377\377\1\342\362\316\235" \
- "\214\306>\1\250\325p\204\377\377\377\1\252\324p\234\214\306>\2\215\307" \
- "\77\342\362\316\203\377\377\377\3\305\342\237\214\305@\215\305>\202\214" \
- "\306>\1\214\305@\222\214\306>\1\214\305@\205\214\306>\1\305\342\237\220" \
- "\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377\202" \
- "\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305@\215\305" \
- ">\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212\307>\212" \
- "\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362\377" \
- "\377\377\202\377\376\377\1\377\377\375\324\377\377\377\4\234\234\234" \
- ";;=::<<<>\204::<\1;;=\202::<\2FFH\363\363\363\204\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\377\377\377\377\272\377\377\377\1" \
- "\265\265\265\202::<\5;;=99;::<;;=::<\202;;=\3""99;;;=\346\346\346\320" \
- "\377\377\377\2\264\264\266\265\265\267\203\377\377\377\202\376\376\376" \
- "\235\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377" \
- "\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324" \
- "p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237" \
- "\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205" \
- "\214\306>\1\305\342\237\221\377\377\377\1\375\377\376\202\377\377\375" \
- "\34\377\377\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215" \
- "\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>" \
- "\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370" \
- "\373\362\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375" \
- "\377\376\377\320\377\377\377\1\376\376\376\203\377\377\377\2SSU;;=\203" \
- "::<\1;;=\203::<\3""99;::<\234\234\236\203\377\377\377\1\376\376\376\377" \
- "\377\377\377\276\377\377\377\5RRT99;;;=99;;;=\203::<\4""99;;;=::<\234" \
- "\234\236\314\377\377\377\1\376\376\376\212\377\377\377\1\376\376\376" \
- "\235\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377" \
- "\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324" \
- "p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237" \
- "\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205" \
- "\214\306>\1\305\342\237\220\377\377\377\3\377\376\377\377\377\377\375" \
- "\377\376\202\377\377\377\11\373\373\363\241\321d\214\306>\213\310=\214" \
- "\306>\214\305@\213\310=\212\306@\217\304>\202\215\307=\14\214\306>\215" \
- "\305>\214\306>\215\305>\217\304@\215\307\77\215\307=\242\320c\367\375" \
- "\361\376\376\377\377\376\377\376\376\376\202\377\377\375\2\374\377\377" \
- "\377\376\377\324\377\377\377\3\265\265\265;;=99;\202;;=\1""99;\202;;" \
- "=\5::<;;=::<GGI\363\363\363\206\377\377\377\1\376\376\376\377\377\377" \
- "\377\271\377\377\377\2\266\266\270;;=\202::<\1;;=\202::<\6;;=::<;;=:" \
- ":<FFH\363\363\363\324\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\236\377\377\377\1\304\343\240\235\214\306>\1\305\342\237\203\377\377" \
- "\377\1\342\362\316\235\214\306>\1\250\325p\204\377\377\377\1\252\324" \
- "p\234\214\306>\2\215\307\77\342\362\316\203\377\377\377\3\305\342\237" \
- "\214\305@\215\305>\202\214\306>\1\214\305@\222\214\306>\1\214\305@\205" \
- "\214\306>\1\305\342\237\220\377\377\377\1\377\377\375\202\377\377\377" \
- "\32\377\376\377\370\373\364\243\322b\214\306>\213\310\77\214\305@\215" \
- "\305>\215\305@\214\306>\214\305B\212\307<\215\307=\214\305B\214\306>" \
- "\215\306A\212\306@\212\307>\214\306>\212\307<\244\317c\370\373\364\377" \
- "\377\377\377\375\376\377\377\375\376\377\377\377\377\377\202\377\376" \
- "\377\326\377\377\377\1__a\203::<\1;;=\203::<\1;;=\202::<\1\234\234\234" \
- "\377\377\377\377\274\377\377\377\1\376\376\376\203\377\377\377\3SSU;" \
- ";=99;\210::<\1\234\234\234\365\377\377\377\7\376\377\375\304\341\236" \
- "\215\306A\214\305B\215\307=\212\307>\212\306@\230\214\305@\1\304\341" \
- "\236\203\377\377\377\4\341\362\320\214\306>\213\310\77\215\305@\231\214" \
- "\305@\2\215\307\77\252\322q\202\377\376\377\202\377\377\377\1\250\325" \
- "n\230\214\305@\3\215\305>\215\306A\215\307\77\202\214\306<\10\342\360" \
- "\317\376\377\377\377\377\375\376\377\377\305\342\240\215\305@\212\306" \
- "@\215\305>\202\214\305@\1\215\307=\220\214\305@\10\214\306>\212\306@" \
- "\216\306A\212\307>\215\305>\215\305@\214\305@\304\343\237\211\377\377" \
- "\377\10\376\376\377\377\377\375\377\377\377\377\377\375\377\377\377\377" \
- "\376\377\377\377\375\376\377\377\202\377\377\377\6\370\373\362\243\322" \
- "b\211\307B\213\310=\214\305@\214\306<\202\215\305@\4\214\306<\214\305" \
- "@\214\306<\215\307\77\202\214\306>\6\212\307>\214\306>\215\307\77\214" \
- "\305@\244\317c\367\375\361\335\377\377\377\2\376\376\376\316\316\316" \
- "\211::<\3;;=GGI\363\363\365\203\377\377\377\1\376\376\376\377\377\377" \
- "\377\266\377\377\377\10\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\265\265\265;;=::<;;=\207::<\2GGI\363\363\363\364\377\377\377\7\377\376" \
- "\377\377\377\375\304\341\236\215\305>\215\307\77\214\306>\214\305@\231" \
- "\214\306>\7\304\343\237\377\377\377\375\376\377\377\377\375\341\360\321" \
- "\215\306A\214\305@\233\214\306>\6\252\324n\376\376\376\377\377\377\376" \
- "\377\377\377\376\377\252\324p\230\214\306>\7\215\306A\212\307>\214\306" \
- ">\212\307>\214\306>\343\361\320\376\377\377\202\377\377\377\7\305\342" \
- "\237\215\305>\213\310\77\214\306>\214\305@\212\306@\215\307\77\222\214" \
- "\306>\6\215\305>\212\307>\214\306>\215\307=\215\305@\305\342\237\210" \
- "\377\377\377\6\376\376\377\377\376\377\375\376\377\376\377\377\377\377" \
- "\375\375\377\376\203\377\377\377\27\377\377\375\372\373\366\241\321a" \
- "\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212\306@\214\306" \
- ">\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306>\215\307\77" \
- "\214\306>\242\322b\370\373\362\376\376\377\377\375\376\336\377\377\377" \
- "\1kkm\202::<\1;;=\205::<\202;;=\3\233\233\235\377\377\377\376\376\376" \
- "\377\377\377\377\274\377\377\377\3SSU99;;;=\20299;\1;;=\203::<\3;;=:" \
- ":<\234\234\236\366\377\377\377\7\376\377\375\305\342\240\213\304\77\213" \
- "\310\77\214\305@\215\306A\216\306=\230\214\306>\10\305\342\240\377\377" \
- "\375\376\377\377\377\376\377\341\360\317\214\306<\214\305@\212\306@\231" \
- "\214\306>\7\215\305@\252\324p\377\377\377\377\377\375\376\377\377\377" \
- "\376\374\252\324p\230\214\306>\7\212\307>\215\307\77\216\306A\212\307" \
- ">\213\304\77\343\361\320\377\377\375\202\377\377\377\3\307\342\237\214" \
- "\304\77\213\310\77\203\214\306>\1\215\307\77\220\214\306>\4\214\305@" \
- "\214\306<\215\304B\213\310\77\202\212\307>\2\215\305@\305\342\240\210" \
- "\377\377\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377\374" \
- "\377\377\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320b\215" \
- "\307\77\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214\305D" \
- "\216\306\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307\77" \
- "\215\305@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375\331" \
- "\377\377\377\1\376\376\376\203\377\377\377\4\376\376\376\317\317\321" \
- "::<;;=\203::<\3;;=::<;;=\202::<\4FFH\363\363\363\377\377\377\376\376" \
- "\376\377\377\377\377\264\377\377\377\1\376\376\376\205\377\377\377\1" \
- "\265\265\267\202;;=\3::<99;;;=\202::<\202;;=\2::<SSU\366\377\377\377" \
- "\7\377\376\377\375\377\374\304\341\237\216\306\77\212\307<\213\310\77" \
- "\212\307>\231\214\306>\2\305\342\240\377\377\377\202\377\376\377\3\341" \
- "\362\316\216\306\77\214\306<\231\214\306>\3\215\305@\212\307>\252\324" \
- "p\203\377\377\377\2\377\376\377\247\324o\230\214\306>\20\215\306A\214" \
- "\305B\215\307\77\211\305\77\214\304;\342\362\315\377\377\377\377\376" \
- "\377\376\376\376\305\342\237\215\306A\210\307;\215\306A\216\306A\214" \
- "\306>\212\306@\220\214\306>\202\214\305@\6\216\305C\213\305=\214\305" \
- "B\215\307\77\216\306\77\303\344\237\211\377\377\377\37\376\377\377\376" \
- "\377\375\377\375\376\375\377\376\377\377\375\377\377\377\377\376\377" \
- "\370\373\362\241\321a\215\307\77\215\307=\214\305@\214\306>\212\307<" \
- "\214\306>\214\306<\214\306>\216\306\77\215\305<\212\307>\213\307A\215" \
- "\305>\212\307>\215\307\77\214\306>\242\321a\373\374\364\377\377\377\376" \
- "\377\377\376\376\376\376\377\377\331\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\203\377\377\377\1kkm\202::<\6;;=::<;;=::<;;=::<\202" \
- ";;=\1\233\233\235\377\377\377\377\267\377\377\377\1\376\376\376\204\377" \
- "\377\377\2kkm;;=\202::<\2;;=::<\202;;=\203::<\5\265\265\267\377\377\377" \
- "\376\376\376\377\377\377\376\376\376\362\377\377\377\2\376\377\377\377" \
- "\376\377\202\377\377\377\202\377\376\377\2\377\377\377\377\377\375\231" \
- "\377\377\377\4\377\376\377\376\377\377\375\377\376\377\377\377\202\376" \
- "\377\377\231\377\377\377\10\374\377\375\377\376\377\377\377\375\376\376" \
- "\376\377\377\377\376\377\377\376\376\374\377\376\377\230\377\377\377" \
- "\1\377\376\377\203\377\377\375\4\376\377\377\377\375\377\377\377\377" \
- "\376\377\377\202\377\377\377\3\376\376\376\377\376\377\377\377\375\202" \
- "\376\377\377\1\377\377\375\220\377\377\377\10\377\377\375\377\377\377" \
- "\376\376\376\377\377\377\377\377\375\377\377\377\376\377\377\377\375" \
- "\377\210\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377" \
- "\377\202\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305" \
- "@\215\305>\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212" \
- "\307>\212\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373" \
- "\362\377\377\377\202\377\376\377\1\377\377\375\340\377\377\377\1\316" \
- "\316\316\203::<\3;;=99;;;=\204::<\2FFH\363\363\363\202\377\377\377\1" \
- "\376\376\376\377\377\377\377\264\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\316\316\320\206::<\1;;=\203::<\2SSU\376\376\376\366\377\377\377" \
- "\1\377\377\375\202\377\376\377\202\377\377\377\3\377\377\375\377\377" \
- "\377\376\377\377\230\377\377\377\202\376\377\377\6\377\377\375\377\377" \
- "\377\376\377\375\377\377\377\376\377\375\377\377\375\231\377\377\377" \
- "\2\376\377\377\377\377\375\202\377\377\377\1\376\376\376\232\377\377" \
- "\377\5\377\376\377\377\377\377\376\377\375\377\377\377\377\377\375\204" \
- "\377\377\377\202\376\377\377\1\376\376\376\202\377\377\377\202\376\377" \
- "\377\220\377\377\377\1\377\377\375\202\377\377\377\4\376\376\374\377" \
- "\376\377\377\377\377\376\377\375\212\377\377\377\1\375\377\376\202\377" \
- "\377\375\34\377\377\377\376\376\376\373\373\363\243\322b\211\307B\212" \
- "\307<\215\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214\306<" \
- "\214\306>\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244" \
- "\317c\370\373\362\377\377\373\376\377\377\377\376\377\375\376\377\377" \
- "\377\375\377\376\377\334\377\377\377\1\376\376\376\202\377\377\377\10" \
- "\376\376\376kkm::<;;=99;;;=::<;;=\202::<\202;;=\1\234\234\236\203\377" \
- "\377\377\1\376\376\376\377\377\377\377\262\377\377\377\5\376\376\376" \
- "\377\377\377\376\376\376\377\377\377lln\210::<\3""99;;;=\265\265\265" \
- "\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\370\377" \
- "\377\377\1\376\377\377\230\377\377\377\7\377\376\377\377\377\375\377" \
- "\376\377\376\376\377\377\377\375\377\377\377\377\377\375\233\377\377" \
- "\377\1\377\376\377\203\377\377\377\1\376\377\375\231\377\377\377\5\377" \
- "\377\375\377\377\377\377\377\375\377\377\377\377\377\375\202\377\377" \
- "\377\1\377\377\375\203\377\377\377\2\376\376\376\377\376\377\226\377" \
- "\377\377\5\377\377\375\377\377\377\376\377\377\377\377\375\376\377\377" \
- "\210\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377" \
- "\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310" \
- "=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305" \
- ">\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376" \
- "\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\333\377\377" \
- "\377\1\376\376\376\202\377\377\377\3\376\376\376\377\377\377\316\316" \
- "\320\203::<\1;;=\202::<\1;;=\203::<\2FFH\377\377\377\202\376\376\376" \
- "\377\377\377\377\262\377\377\377\5\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\332\332\332\206::<\1;;=\202::<\5;;=FFH\363\363\363\377\377" \
- "\377\376\376\376\203\377\377\377\1\376\376\376\365\377\377\377\1\377" \
- "\377\375\202\377\377\377\1\377\377\375\230\377\377\377\2\376\377\377" \
- "\377\377\375\204\377\377\377\2\377\376\377\376\377\375\230\377\377\377" \
- "\4\377\377\375\377\377\377\377\377\373\376\377\377\203\377\377\377\1" \
- "\377\376\377\230\377\377\377\13\376\377\377\377\377\375\377\377\377\376" \
- "\377\377\377\375\376\377\377\377\377\377\375\376\377\377\377\376\377" \
- "\377\377\377\376\376\376\202\377\377\377\1\377\377\375\226\377\377\377" \
- "\202\376\377\377\2\377\377\375\377\376\377\210\377\377\377\1\377\377" \
- "\375\202\377\377\377\32\377\376\377\370\373\364\243\322b\214\306>\213" \
- "\310\77\214\305@\215\305>\215\305@\214\306>\214\305B\212\307<\215\307" \
- "=\214\305B\214\306>\215\306A\212\306@\212\307>\214\306>\212\307<\244" \
- "\317c\370\373\364\377\377\377\377\375\376\377\377\375\376\377\377\377" \
- "\377\377\202\377\376\377\333\377\377\377\1\376\376\376\204\377\377\377" \
- "\11\376\376\376\377\377\377kkm::<;;=99;;;=::<;;=\202::<\3;;=::<\264\264" \
- "\264\377\377\377\377\265\377\377\377\1\376\376\376\202\377\377\377\1" \
- "\204\204\204\203::<\1;;=\206::<\1\235\235\237\377\377\377\377\377\377" \
- "\377\377\203\377\377\377\10\376\376\377\377\377\375\377\377\377\377\377" \
- "\375\377\377\377\377\376\377\377\377\375\376\377\377\202\377\377\377" \
- "\6\370\373\362\243\322b\211\307B\213\310=\214\305@\214\306<\202\215\305" \
- "@\4\214\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214" \
- "\306>\215\307\77\214\305@\244\317c\367\375\361\352\377\377\377\1\316" \
- "\316\316\203::<\1;;=\203::<\202;;=\2::<RRT\377\377\377\377\267\377\377" \
- "\377\3\346\346\346::<;;=\203::<\202;;=\5""99;::<;;=FFH\363\363\365\377" \
- "\377\377\377\377\377\377\377\202\377\377\377\6\376\376\377\377\376\377" \
- "\375\376\377\376\377\377\377\377\375\375\377\376\203\377\377\377\27\377" \
- "\377\375\372\373\366\241\321a\217\304@\212\307<\214\306>\215\305>\215" \
- "\305@\213\310=\212\306@\214\306>\214\305B\215\307\77\215\305>\215\306" \
- "A\212\307>\214\306>\215\307\77\214\306>\242\322b\370\373\362\376\376" \
- "\377\377\375\376\352\377\377\377\2kkm;;=\207::<\3;;=::<\301\301\301\377" \
- "\377\377\377\266\377\377\377\2\221\221\221;;=\202::<\202;;=\202::<\1" \
- ";;=\202::<\1\235\235\237\377\377\377\377\377\377\377\377\203\377\377" \
- "\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377\374\377\377" \
- "\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320b\215\307\77" \
- "\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214\305D\216\306" \
- "\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307\77\215\305" \
- "@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375\350\377\377" \
- "\377\4\376\376\376\377\377\377\265\265\26799;\203::<\3;;=::<;;=\203:" \
- ":<\2kkk\376\376\376\377\377\377\377\264\377\377\377\2\362\362\362FFH" \
- "\202::<\1;;=\203::<\5;;=::<;;=::<\363\363\363\377\377\377\377\377\377" \
- "\377\377\204\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377" \
- "\376\377\377\375\377\377\377\377\376\377\370\373\362\241\321a\215\307" \
- "\77\215\307=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216" \
- "\306\77\215\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306" \
- ">\242\321a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377" \
- "\352\377\377\377\2\376\376\376TTV\204::<\7;;=99;::<;;=99;::<\332\332" \
- "\332\377\377\377\377\263\377\377\377\3\376\376\376\266\266\266;;=\203" \
- "::<\202;;=\204::<\1\205\205\207\377\377\377\377\377\377\377\377\204\377" \
- "\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377\202\377" \
- "\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305@\215\305>" \
- "\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212\307>\212\310" \
- "\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362\377\377" \
- "\377\202\377\376\377\1\377\377\375\354\377\377\377\2\265\265\267::<\202" \
- ";;=\205::<\4;;=::<\204\204\204\376\376\376\377\377\377\377\263\377\377" \
- "\377\1SSU\202::<\1;;=\206::<\2;;=\346\346\346\377\377\377\377\377\377" \
- "\377\377\205\377\377\377\1\375\377\376\202\377\377\375\34\377\377\377" \
- "\376\376\376\373\373\363\243\322b\211\307B\212\307<\215\305>\214\306" \
- ">\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>\215\307\77\213" \
- "\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370\373\362\377" \
- "\377\373\376\377\377\377\376\377\375\376\377\377\377\375\377\376\377" \
- "\354\377\377\377\4FFH;;=99;;;=\203::<\5;;=99;;;=99;\364\364\364\377\377" \
- "\377\377\262\377\377\377\1\316\316\316\202;;=\1""99;\203::<\1;;=\203" \
- "::<\1xxz\377\377\377\377\377\377\377\377\205\377\377\377\3\377\376\377" \
- "\377\377\377\375\377\376\202\377\377\377\11\373\373\363\241\321d\214" \
- "\306>\213\310=\214\306>\214\305@\213\310=\212\306@\217\304>\202\215\307" \
- "=\14\214\306>\215\305>\214\306>\215\305>\217\304@\215\307\77\215\307" \
- "=\242\320c\367\375\361\376\376\377\377\376\377\376\376\376\202\377\377" \
- "\375\2\374\377\377\377\376\377\354\377\377\377\1\235\235\237\204::<\1" \
- "<<>\202::<\4;;=::<;;=\247\247\251\377\377\377\377\262\377\377\377\4\204" \
- "\204\204;;=::<;;=\206::<\2;;=\316\316\316\377\377\377\377\377\377\377" \
- "\377\205\377\377\377\1\377\377\375\202\377\377\377\32\377\376\377\370" \
- "\373\364\243\322b\214\306>\213\310\77\214\305@\215\305>\215\305@\214" \
- "\306>\214\305B\212\307<\215\307=\214\305B\214\306>\215\306A\212\306@" \
- "\212\307>\214\306>\212\307<\244\317c\370\373\364\377\377\377\377\375" \
- "\376\377\377\375\376\377\377\377\377\377\202\377\376\377\355\377\377" \
- "\377\1\363\363\363\212::<\1TTV\377\377\377\377\261\377\377\377\5\347" \
- "\347\351::<;;=::<;;=\204::<\3;;=::<TTT\377\377\377\377\376\377\377\377" \
- "\10\376\376\377\377\377\375\377\377\377\377\377\375\377\377\377\377\376" \
- "\377\377\377\375\376\377\377\202\377\377\377\6\370\373\362\243\322b\211" \
- "\307B\213\310=\214\305@\214\306<\202\215\305@\4\214\306<\214\305@\214" \
- "\306<\215\307\77\202\214\306>\6\212\307>\214\306>\215\307\77\214\305" \
- "@\244\317c\367\375\361\361\377\377\377\1\376\376\376\204\377\377\377" \
- "\1\204\204\204\202;;=\203::<\1;;=\202::<\202;;=\1\302\302\302\203\377" \
- "\377\377\1\376\376\376\377\377\377\377\244\377\377\377\1\376\376\376" \
- "\203\377\377\377\1\376\376\376\203\377\377\377\1\234\234\236\202::<\1" \
- ";;=\204::<\6;;=::<;;=\264\264\264\377\377\377\376\376\376\377\377\377" \
- "\377\373\377\377\377\6\376\376\377\377\376\377\375\376\377\376\377\377" \
- "\377\377\375\375\377\376\203\377\377\377\27\377\377\375\372\373\366\241" \
- "\321a\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212\306@" \
- "\214\306>\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306>\215" \
- "\307\77\214\306>\242\322b\370\373\362\376\376\377\377\375\376\365\377" \
- "\377\377\1\332\332\332\202::<\1;;=\202::<\6""99;::<;;=99;;;=xxx\205\377" \
- "\377\377\1\376\376\376\377\377\377\377\243\377\377\377\1\376\376\376" \
- "\206\377\377\377\4SSU;;=::<;;=\202::<\1;;=\203::<\3GGI\362\362\362\376" \
- "\376\376\377\377\377\377\374\377\377\377\7\377\377\375\375\376\377\376" \
- "\377\377\376\377\375\377\374\377\377\377\375\375\377\376\202\377\377" \
- "\377\5\372\373\366\240\320b\215\307\77\212\306@\215\305>\202\214\305" \
- "@\20\215\305@\212\306@\214\305D\216\306\77\214\306>\215\307\77\214\306" \
- ">\212\306@\214\306>\215\307\77\215\305@\242\320c\370\373\362\377\377" \
- "\373\377\376\377\377\377\375\364\377\377\377\3\376\376\376\377\377\377" \
- "__a\203::<\202;;=\6::<99;;;=::<;;=\345\345\345\203\377\377\377\1\376" \
- "\376\376\377\377\377\377\245\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\202\377\377\377\2\316\316\316::<\202;;=\205::<\202;;=\1\203" \
- "\203\205\204\377\377\377\1\376\376\376\377\377\377\377\372\377\377\377" \
- "\37\376\377\377\376\377\375\377\375\376\375\377\376\377\377\375\377\377" \
- "\377\377\376\377\370\373\362\241\321a\215\307\77\215\307=\214\305@\214" \
- "\306>\212\307<\214\306>\214\306<\214\306>\216\306\77\215\305<\212\307" \
- ">\213\307A\215\305>\212\307>\215\307\77\214\306>\242\321a\373\374\364" \
- "\377\377\377\376\377\377\376\376\376\376\377\377\362\377\377\377\202" \
- "\376\376\376\3\377\377\377\376\376\376\265\265\267\202::<\1;;=\207::" \
- "<\3\251\251\253\377\377\377\376\376\376\203\377\377\377\1\376\376\376" \
- "\377\377\377\377\247\377\377\377\2\376\376\376\204\204\206\207::<\1;" \
- ";=\202::<\3\346\346\346\377\377\377\376\376\376\377\377\377\377\374\377" \
- "\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377\202\377" \
- "\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305@\215\305>" \
- "\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212\307>\212\310" \
- "\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362\377\377" \
- "\377\202\377\376\377\1\377\377\375\364\377\377\377\17\376\376\376\377" \
- "\377\377\376\376\376\377\377\377FFH;;=99;::<;;=::<;;=99;;;=::<SSU\377" \
- "\377\377\377\251\377\377\377\1\376\376\376\203\377\377\377\3\363\363" \
- "\365::<;;=\202::<\11;;=::<;;=::<;;=::<kkm\377\377\377\376\376\376\377" \
- "\377\377\377\376\377\377\377\1\375\377\376\202\377\377\375\34\377\377" \
- "\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215\305>\214" \
- "\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>\215\307\77" \
- "\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370\373\362" \
- "\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375\377\376" \
- "\377\361\377\377\377\202\376\376\376\2\377\377\377\376\376\376\202\377" \
- "\377\377\1\221\221\221\205::<\202;;=\5::<;;=99;\316\316\320\376\376\376" \
- "\377\377\377\377\250\377\377\377\1\376\376\376\202\377\377\377\4\266" \
- "\266\270::<99;;;=\203::<\1;;=\203::<\1\265\265\265\377\377\377\377\377" \
- "\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377\11" \
- "\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310=\212" \
- "\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305>\217" \
- "\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376\377" \
- "\376\376\376\202\377\377\375\2\374\377\377\377\376\377\360\377\377\377" \
- "\1\376\376\376\202\377\377\377\202\376\376\376\202\377\377\377\6\346" \
- "\346\346;;=99;::<99;;;=\204::<\2;;=\204\204\206\202\377\377\377\1\376" \
- "\376\376\377\377\377\377\251\377\377\377\1__a\203::<\3;;=::<;;=\203:" \
- ":<\4FFF\363\363\363\377\377\377\376\376\376\377\377\377\377\375\377\377" \
- "\377\1\377\377\375\202\377\377\377\32\377\376\377\370\373\364\243\322" \
- "b\214\306>\213\310\77\214\305@\215\305>\215\305@\214\306>\214\305B\212" \
- "\307<\215\307=\214\305B\214\306>\215\306A\212\306@\212\307>\214\306>" \
- "\212\307<\244\317c\370\373\364\377\377\377\377\375\376\377\377\375\376" \
- "\377\377\377\377\377\202\377\376\377\371\377\377\377\4^^`;;=::<;;=\202" \
- "::<\5;;=::<;;=::<FFH\377\377\377\377\253\377\377\377\3\346\346\346::" \
- "<;;=\210::<\1\204\204\204\202\377\377\377\202\376\376\376\377\377\377" \
- "\377\365\377\377\377\10\376\376\377\377\377\375\377\377\377\377\377\375" \
- "\377\377\377\377\376\377\377\377\375\376\377\377\202\377\377\377\6\370" \
- "\373\362\243\322b\211\307B\213\310=\214\305@\214\306<\202\215\305@\4" \
- "\214\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214\306" \
- ">\215\307\77\214\305@\244\317c\367\375\361\377\377\377\377\202\377\377" \
- "\377\3\265\265\267::<;;=\204::<\1;;=\202::<\2;;=\265\265\265\202\377" \
- "\377\377\1\376\376\376\377\377\377\377\246\377\377\377\2\376\376\376" \
- "\234\234\234\202;;=\203::<\1;;=\202::<\3""99;::<\332\332\332\377\377" \
- "\377\377\370\377\377\377\6\376\376\377\377\376\377\375\376\377\376\377" \
- "\377\377\377\375\375\377\376\203\377\377\377\27\377\377\375\372\373\366" \
- "\241\321a\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212\306" \
- "@\214\306>\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306>\215" \
- "\307\77\214\306>\242\322b\370\373\362\376\376\377\377\375\376\377\377" \
- "\377\377\5\377\377\377\363\363\365;;=::<;;=\202::<\3;;=::<;;=\202::<" \
- "\3xxz\377\377\377\376\376\376\377\377\377\377\246\377\377\377\3\376\376" \
- "\376\377\377\377SSS\202::<\1;;=\202::<\1;;=\202::<\6;;=SSU\377\377\377" \
- "\376\376\376\377\377\377\376\376\376\202\377\377\377\1\376\376\376\377" \
- "\377\377\377\362\377\377\377\7\377\377\375\375\376\377\376\377\377\376" \
- "\377\375\377\374\377\377\377\375\375\377\376\202\377\377\377\5\372\373" \
- "\366\240\320b\215\307\77\212\306@\215\305>\202\214\305@\20\215\305@\212" \
- "\306@\214\305D\216\306\77\214\306>\215\307\77\214\306>\212\306@\214\306" \
- ">\215\307\77\215\305@\242\320c\370\373\362\377\377\373\377\376\377\377" \
- "\377\375\377\377\377\377\11\377\377\377\376\376\376\204\204\206;;=::" \
- "<99;;;=::<;;=\204::<\3\362\362\362\377\377\377\376\376\376\377\377\377" \
- "\377\246\377\377\377\1\333\333\333\203::<\202;;=\202::<\5<<>99;::<\250" \
- "\250\252\376\376\376\203\377\377\377\1\376\376\376\377\377\377\377\365" \
- "\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377\376\377\377" \
- "\375\377\377\377\377\376\377\370\373\362\241\321a\215\307\77\215\307" \
- "=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216\306\77\215" \
- "\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306>\242\321" \
- "a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377\377\377" \
- "\377\377\202\377\377\377\1\301\301\301\202::<\1;;=\203::<\1;;=\203::" \
- "<\1\266\266\270\377\377\377\377\250\377\377\377\2\220\220\220;;=\204" \
- "::<\6;;=::<99;;;=::<\346\346\346\205\377\377\377\1\376\376\376\377\377" \
- "\377\377\363\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376" \
- "\377\377\202\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214" \
- "\305@\215\305>\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>" \
- "\212\307>\212\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370" \
- "\373\362\377\377\377\202\377\376\377\1\377\377\375\377\377\377\377\204" \
- "\377\377\377\2TTV99;\202::<\1;;=\202::<\6;;=::<;;=__a\377\377\377\376" \
- "\376\376\377\377\377\377\244\377\377\377\3\376\376\376\377\377\377TT" \
- "V\207::<\3;;=99;```\377\377\377\377\373\377\377\377\1\375\377\376\202" \
- "\377\377\375\34\377\377\377\376\376\376\373\373\363\243\322b\211\307" \
- "B\212\307<\215\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214" \
- "\306<\214\306>\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307" \
- ">\244\317c\370\373\362\377\377\373\376\377\377\377\376\377\375\376\377" \
- "\377\377\375\377\376\377\377\377\377\377\203\377\377\377\3\221\221\221" \
- "::<;;=\202::<\202;;=\203::<\2;;=\345\345\347\377\377\377\377\246\377" \
- "\377\377\4\332\332\332;;=::<;;=\203::<\1;;=\203::<\1\265\265\265\203" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377\364" \
- "\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377\11" \
- "\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310=\212" \
- "\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305>\217" \
- "\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376\377" \
- "\376\376\376\202\377\377\375\2\374\377\377\377\376\377\377\377\377\377" \
- "\202\377\377\377\5\376\376\376\332\332\332;;=::<;;=\202::<\6;;=::<;;" \
- "=99;::<\250\250\252\377\377\377\377\244\377\377\377\6\376\376\376\377" \
- "\377\377\221\221\223::<;;=99;\202::<\3;;=::<;;=\202::<\1\363\363\363" \
- "\377\377\377\377\372\377\377\377\1\377\377\375\202\377\377\377\32\377" \
- "\376\377\370\373\364\243\322b\214\306>\213\310\77\214\305@\215\305>\215" \
- "\305@\214\306>\214\305B\212\307<\215\307=\214\305B\214\306>\215\306A" \
- "\212\306@\212\307>\214\306>\212\307<\244\317c\370\373\364\377\377\377" \
- "\377\375\376\377\377\375\376\377\377\377\377\377\202\377\376\377\377" \
- "\377\377\377\204\377\377\377\2\376\376\376SSU\204::<\204;;=\2::<__a\377" \
- "\377\377\377\243\377\377\377\6\376\376\376\377\377\377\376\376\376TT" \
- "V99;;;=\204::<\4;;=99;<<>xxz\377\377\377\377\364\377\377\377\10\376\376" \
- "\377\377\377\375\377\377\377\377\377\375\377\377\377\377\376\377\377" \
- "\377\375\376\377\377\202\377\377\377\6\370\373\362\243\322b\211\307B" \
- "\213\310=\214\305@\214\306<\202\215\305@\4\214\306<\214\305@\214\306" \
- "<\215\307\77\202\214\306>\6\212\307>\214\306>\215\307\77\214\305@\244" \
- "\317c\367\375\361\377\377\377\377\213\377\377\377\5\376\376\376\377\377" \
- "\377\221\221\223::<;;=\204::<\5;;=::<;;=::<\363\363\363\204\377\377\377" \
- "\1\376\376\376\202\377\377\377\202\376\376\376\377\377\377\377\233\377" \
- "\377\377\5\332\332\332::<;;=99;<<>\202::<\1;;=\203::<\1\265\265\267\377" \
- "\377\377\377\363\377\377\377\6\376\376\377\377\376\377\375\376\377\376" \
- "\377\377\377\377\375\375\377\376\203\377\377\377\27\377\377\375\372\373" \
- "\366\241\321a\217\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212" \
- "\306@\214\306>\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306" \
- ">\215\307\77\214\306>\242\322b\370\373\362\376\376\377\377\375\376\377" \
- "\377\377\377\213\377\377\377\2\375\375\375\333\333\333\202::<\1;;=\202" \
- "::<\1;;=\202::<\3""99;::<\265\265\265\206\377\377\377\3\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\377\233\377\377\377\2\235\235\23599" \
- ";\202;;=\1""99;\202;;=\202::<\3;;=::<\363\363\365\377\377\377\377\363" \
- "\377\377\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377\374" \
- "\377\377\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320b\215" \
- "\307\77\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214\305D" \
- "\216\306\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307\77" \
- "\215\305@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375\377" \
- "\377\377\377\214\377\377\377\2\376\376\376SSU\207::<\3;;=::<xxx\203\377" \
- "\377\377\202\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377" \
- "\234\377\377\377\1^^`\211::<\3xxz\377\377\377\376\376\376\377\377\377" \
- "\377\363\377\377\377\37\376\377\377\376\377\375\377\375\376\375\377\376" \
- "\377\377\375\377\377\377\377\376\377\370\373\362\241\321a\215\307\77" \
- "\215\307=\214\305@\214\306>\212\307<\214\306>\214\306<\214\306>\216\306" \
- "\77\215\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306>" \
- "\242\321a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377" \
- "\377\377\377\377\212\377\377\377\4\376\376\376\377\377\377\376\376\376" \
- "\222\222\222\205::<\1;;=\20299;\202::<\3\363\363\363\377\377\377\376" \
- "\376\376\377\377\377\377\240\377\377\377\1\346\346\346\202::<\1;;=\204" \
- "::<\1;;=\202::<\1\250\250\252\202\377\377\377\1\376\376\376\377\377\377" \
- "\377\361\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377" \
- "\377\202\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305" \
- "@\215\305>\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212" \
- "\307>\212\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373" \
- "\362\377\377\377\202\377\376\377\1\377\377\375\377\377\377\377\212\377" \
- "\377\377\1\376\376\376\203\377\377\377\2\332\332\332<<>\203::<\3;;=:" \
- ":<<<>\203::<\2\301\301\303\376\376\376\202\377\377\377\5\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377\377\231" \
- "\377\377\377\4\376\376\376\251\251\253::<;;=\204::<\5;;=::<99;::<\346" \
- "\346\346\377\377\377\377\365\377\377\377\1\375\377\376\202\377\377\375" \
- "\34\377\377\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215" \
- "\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>" \
- "\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370" \
- "\373\362\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375" \
- "\377\376\377\377\377\377\377\212\377\377\377\1\376\376\376\203\377\377" \
- "\377\1SSS\207::<\3;;=::<\205\205\207\205\377\377\377\1\376\376\376\377" \
- "\377\377\377\234\377\377\377\3wwy::<;;=\206::<\2;;=__a\377\377\377\377" \
- "\365\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377" \
- "\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310" \
- "=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305" \
- ">\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376" \
- "\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\377\377\377" \
- "\377\211\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376\204" \
- "\204\204::<\202;;=\1::<\202;;=\203::<\1SSU\204\377\377\377\1\376\376" \
- "\376\377\377\377\377\235\377\377\377\1;;=\203::<\1;;=\202::<\1;;=\202" \
- "::<\1\234\234\234\202\377\377\377\1\376\376\376\377\377\377\377\362\377" \
- "\377\377\1\377\377\375\202\377\377\377\32\377\376\377\370\373\364\243" \
- "\322b\214\306>\213\310\77\214\305@\215\305>\215\305@\214\306>\214\305" \
- "B\212\307<\215\307=\214\305B\214\306>\215\306A\212\306@\212\307>\214" \
- "\306>\212\307<\244\317c\370\373\364\377\377\377\377\375\376\377\377\375" \
- "\376\377\377\377\377\377\202\377\376\377\377\377\377\377\212\377\377" \
- "\377\1\376\376\376\204\377\377\377\6\301\301\301;;=::<;;=::<;;=\205:" \
- ":<\1\333\333\333\202\377\377\377\1\376\376\376\377\377\377\377\231\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\301\301\303\204::<\1;;=\202" \
- "::<\1:9>\202::<\1\332\332\332\377\377\377\377\356\377\377\377\10\376" \
- "\376\377\377\377\375\377\377\377\377\377\375\377\377\377\377\376\377" \
- "\377\377\375\376\377\377\202\377\377\377\6\370\373\362\243\322b\211\307" \
- "B\213\310=\214\305@\214\306<\202\215\305@\4\214\306<\214\305@\214\306" \
- "<\215\307\77\202\214\306>\6\212\307>\214\306>\215\307\77\214\305@\244" \
- "\317c\367\375\361\377\377\377\377\230\377\377\377\2""99;;;=\210::<\1" \
- "\250\250\250\377\377\377\377\240\377\377\377\3\221\221\223::<;;=\207" \
- "::<\2SSU\376\376\376\377\377\377\377\355\377\377\377\6\376\376\377\377" \
- "\376\377\375\376\377\376\377\377\377\377\375\375\377\376\203\377\377" \
- "\377\27\377\377\375\372\373\366\241\321a\217\304@\212\307<\214\306>\215" \
- "\305>\215\305@\213\310=\212\306@\214\306>\214\305B\215\307\77\215\305" \
- ">\215\306A\212\307>\214\306>\215\307\77\214\306>\242\322b\370\373\362" \
- "\376\376\377\377\375\376\377\377\377\377\227\377\377\377\1yy{\211::<" \
- "\6lll\376\376\376\377\377\377\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\377\224\377\377\377\202\376\376\376\7\377\377\377\376\376\376" \
- "\377\377\377\376\376\376\377\377\377__a;;=\202::<\4<<>;;=::<;;=\202:" \
- ":<\1\204\204\206\203\377\377\377\1\376\376\376\377\377\377\377\352\377" \
- "\377\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377\374\377" \
- "\377\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320b\215\307" \
- "\77\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214\305D\216" \
- "\306\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307\77\215" \
- "\305@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375\377\377" \
- "\377\377\221\377\377\377\3\376\376\376\377\377\377\376\376\376\203\377" \
- "\377\377\1\265\265\267\212::<\1\363\363\363\377\377\377\377\227\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377\1\345" \
- "\345\345\202::<\202;;=\1""99;\203::<\4;;=::<\301\301\301\376\376\376" \
- "\203\377\377\377\1\376\376\376\377\377\377\377\352\377\377\377\37\376" \
- "\377\377\376\377\375\377\375\376\375\377\376\377\377\375\377\377\377" \
- "\377\376\377\370\373\362\241\321a\215\307\77\215\307=\214\305@\214\306" \
- ">\212\307<\214\306>\214\306<\214\306>\216\306\77\215\305<\212\307>\213" \
- "\307A\215\305>\212\307>\215\307\77\214\306>\242\321a\373\374\364\377" \
- "\377\377\376\377\377\376\376\376\376\377\377\377\377\377\377\222\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377\1\347" \
- "\347\347\212::<\1\302\302\304\205\377\377\377\1\376\376\376\377\377\377" \
- "\377\222\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\202" \
- "\377\377\377\5\265\265\265::<;;=99;;;=\203::<\1;;=\202::<\1\363\363\363" \
- "\377\377\377\377\356\377\377\377\202\377\377\375\3\377\374\377\375\377" \
- "\376\376\377\377\202\377\377\377\25\370\373\364\243\322b\217\304@\212" \
- "\306@\214\305@\215\305>\212\307>\212\306@\214\305B\214\305@\214\305B" \
- "\214\306>\212\307>\212\310\77\214\306>\217\304@\214\306>\214\305@\242" \
- "\322b\370\373\362\377\377\377\202\377\376\377\1\377\377\375\377\377\377" \
- "\377\230\377\377\377\2\376\376\376TTT\211::<\3\221\221\223\377\377\377" \
- "\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377\231\377\377" \
- "\377\2\204\204\204::<\202;;=\202::<\1;;=\203::<\2``b\376\376\376\377" \
- "\377\377\377\357\377\377\377\1\375\377\376\202\377\377\375\34\377\377" \
- "\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215\305>\214" \
- "\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>\215\307\77" \
- "\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370\373\362" \
- "\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375\377\376" \
- "\377\377\377\377\377\225\377\377\377\1\376\376\376\202\377\377\377\1" \
- "\221\221\221\210::<\2;;=__a\202\377\377\377\1\376\376\376\377\377\377" \
- "\377\227\377\377\377\1\376\376\376\203\377\377\377\1SSU\202::<\1;;=\204" \
- "::<\202;;=\1\234\234\234\204\377\377\377\1\376\376\376\377\377\377\377" \
- "\352\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377" \
- "\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310" \
- "=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305" \
- ">\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376" \
- "\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\377\377\377" \
- "\377\222\377\377\377\1\376\376\376\205\377\377\377\1\301\301\301\210" \
- "::<\4""99;;;=\364\364\366\376\376\376\377\377\377\377\233\377\377\377" \
- "\1\346\346\346\207::<\4;;=99;::<\316\316\316\203\377\377\377\1\376\376" \
- "\376\377\377\377\377\353\377\377\377\1\377\377\375\202\377\377\377\32" \
- "\377\376\377\370\373\364\243\322b\214\306>\213\310\77\214\305@\215\305" \
- ">\215\305@\214\306>\214\305B\212\307<\215\307=\214\305B\214\306>\215" \
- "\306A\212\306@\212\307>\214\306>\212\307<\244\317c\370\373\364\377\377" \
- "\377\377\375\376\377\377\375\376\377\377\377\377\377\202\377\376\377" \
- "\377\377\377\377\224\377\377\377\1\376\376\376\204\377\377\377\1\363" \
- "\363\363\210::<\3;;=::<\302\302\304\377\377\377\377\231\377\377\377\1" \
- "\376\376\376\202\377\377\377\1\266\266\270\203::<\203;;=\203::<\1:::" \
- "\377\377\377\377\351\377\377\377\10\376\376\377\377\377\375\377\377\377" \
- "\377\377\375\377\377\377\377\376\377\377\377\375\376\377\377\202\377" \
- "\377\377\6\370\373\362\243\322b\211\307B\213\310=\214\305@\214\306<\202" \
- "\215\305@\4\214\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212" \
- "\307>\214\306>\215\307\77\214\305@\244\317c\367\375\361\377\377\377\377" \
- "\242\377\377\377\3__a::<;;=\207::<\1\221\221\221\377\377\377\377\234" \
- "\377\377\377\1\204\204\206\204::<\202;;=\203::<\1lll\203\377\377\377" \
- "\1\375\375\375\377\377\377\377\344\377\377\377\6\376\376\377\377\376" \
- "\377\375\376\377\376\377\377\377\377\375\375\377\376\203\377\377\377" \
- "\27\377\377\375\372\373\366\241\321a\217\304@\212\307<\214\306>\215\305" \
- ">\215\305@\213\310=\212\306@\214\306>\214\305B\215\307\77\215\305>\215" \
- "\306A\212\307>\214\306>\215\307\77\214\306>\242\322b\370\373\362\376" \
- "\376\377\377\375\376\377\377\377\377\241\377\377\377\2\221\221\223;;" \
- "=\202::<\202;;=\203::<\2;;=^^^\204\377\377\377\1\376\376\376\377\377" \
- "\377\377\224\377\377\377\1\376\376\376\202\377\377\377\1``b\202::<\1" \
- ";;=\206::<\1\234\234\234\205\377\377\377\1\376\376\376\377\377\377\377" \
- "\342\377\377\377\7\377\377\375\375\376\377\376\377\377\376\377\375\377" \
- "\374\377\377\377\375\375\377\376\202\377\377\377\5\372\373\366\240\320" \
- "b\215\307\77\212\306@\215\305>\202\214\305@\20\215\305@\212\306@\214" \
- "\305D\216\306\77\214\306>\215\307\77\214\306>\212\306@\214\306>\215\307" \
- "\77\215\305@\242\320c\370\373\362\377\377\373\377\376\377\377\377\375" \
- "\377\377\377\377\241\377\377\377\6\301\301\303::<;;=::<99;;;=\203::<" \
- "\6;;=:::\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\377\224\377\377\377\1\376\376\376\202\377\377\377\2\363\363\363;;=\211" \
- "::<\1\316\316\316\203\377\377\377\1\376\376\376\202\377\377\377\1\376" \
- "\376\376\377\377\377\377\342\377\377\377\37\376\377\377\376\377\375\377" \
- "\375\376\375\377\376\377\377\375\377\377\377\377\376\377\370\373\362" \
- "\241\321a\215\307\77\215\307=\214\305@\214\306>\212\307<\214\306>\214" \
- "\306<\214\306>\216\306\77\215\305<\212\307>\213\307A\215\305>\212\307" \
- ">\215\307\77\214\306>\242\321a\373\374\364\377\377\377\376\377\377\376" \
- "\376\376\376\377\377\377\377\377\377\241\377\377\377\1\363\363\365\202" \
- "::<\1;;=\202::<\2""99;;;=\202::<\2;;=\316\316\316\377\377\377\377\231" \
- "\377\377\377\10\376\376\376\316\316\316::<;;=::<;;=99;;;=\204::<\202" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377\344" \
- "\377\377\377\202\377\377\375\3\377\374\377\375\377\376\376\377\377\202" \
- "\377\377\377\25\370\373\364\243\322b\217\304@\212\306@\214\305@\215\305" \
- ">\212\307>\212\306@\214\305B\214\305@\214\305B\214\306>\212\307>\212" \
- "\310\77\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362\377" \
- "\377\377\202\377\376\377\1\377\377\375\377\377\377\377\243\377\377\377" \
- "\1``b\203::<\203;;=\6::<<<>::<\234\234\234\377\377\377\376\376\376\377" \
- "\377\377\377\230\377\377\377\1\234\234\236\204::<\12;;=99;::<;;=::<k" \
- "km\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377\377\346" \
- "\377\377\377\1\375\377\376\202\377\377\375\34\377\377\377\376\376\376" \
- "\373\373\363\243\322b\211\307B\212\307<\215\305>\214\306>\212\307>\214" \
- "\305@\217\304>\212\307<\214\306<\214\306>\215\307\77\213\307A\214\306" \
- ">\215\305@\215\307\77\212\307>\244\317c\370\373\362\377\377\373\376\377" \
- "\377\377\376\377\375\376\377\377\377\375\377\376\377\377\377\377\377" \
- "\242\377\377\377\2\222\222\222::<\202;;=\7""99;::<;;=::<99;;;=lln\202" \
- "\377\377\377\1\376\376\376\377\377\377\377\225\377\377\377\3\376\376" \
- "\376\377\377\377jjl\204;;=\2""99;;;=\202::<\2;;=\221\221\223\202\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\377\377\377\377" \
- "\343\377\377\377\3\377\376\377\377\377\377\375\377\376\202\377\377\377" \
- "\11\373\373\363\241\321d\214\306>\213\310=\214\306>\214\305@\213\310" \
- "=\212\306@\217\304>\202\215\307=\14\214\306>\215\305>\214\306>\215\305" \
- ">\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377\376" \
- "\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\377\377\377" \
- "\377\242\377\377\377\2\264\264\264;;=\206::<\6;;=::<FFH\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\377\227\377\377\377\1GGI\204::<\6;;" \
- "=::<;;=::<;;=\302\302\304\206\377\377\377\1\376\376\376\377\377\377\377" \
- "\342\377\377\377\1\377\377\375\202\377\377\377\32\377\376\377\370\373" \
- "\364\243\322b\214\306>\213\310\77\214\305@\215\305>\215\305@\214\306" \
- ">\214\305B\212\307<\215\307=\214\305B\214\306>\215\306A\212\306@\212" \
- "\307>\214\306>\212\307<\244\317c\370\373\364\377\377\377\377\375\376" \
- "\377\377\375\376\377\377\377\377\377\202\377\376\377\377\377\377\377" \
- "\243\377\377\377\2\346\346\346;;=\211::<\1\346\346\350\377\377\377\377" \
- "\230\377\377\377\3\346\346\350::<;;=\202::<\1;;=\205::<\1\346\346\346" \
- "\302\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377\376" \
- "\376\376\377\377\377\377\233\377\377\377\10\376\376\377\377\377\375\377" \
- "\377\377\377\377\375\377\377\377\377\376\377\377\377\375\376\377\377" \
- "\202\377\377\377\6\370\373\362\243\322b\211\307B\213\310=\214\305@\214" \
- "\306<\202\215\305@\4\214\306<\214\305@\214\306<\215\307\77\202\214\306" \
- ">\6\212\307>\214\306>\215\307\77\214\305@\244\317c\367\375\361\345\377" \
- "\377\377\1\376\376\376\305\377\377\377\3FFF::<;;=\202::<\3;;=::<;;=\202" \
- "::<\1\301\301\303\377\377\377\377\230\377\377\377\4\301\301\30399;::" \
- "<;;=\204::<\3;;=::<GGI\215\377\377\377\1\376\376\376\266\377\377\377" \
- "\1\376\376\376\203\377\377\377\1\376\376\376\377\377\377\377\231\377" \
- "\377\377\6\376\376\377\377\376\377\375\376\377\376\377\377\377\377\375" \
- "\375\377\376\203\377\377\377\27\377\377\375\372\373\366\241\321a\217" \
- "\304@\212\307<\214\306>\215\305>\215\305@\213\310=\212\306@\214\306>" \
- "\214\305B\215\307\77\215\305>\215\306A\212\307>\214\306>\215\307\77\214" \
- "\306>\242\322b\370\373\362\376\376\377\377\375\376\341\377\377\377\5" \
- "\376\376\376\377\377\377\376\376\376\377\377\377\376\376\376\265\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\212\377\377\377\3\376" \
- "\376\376\377\377\377lll\206::<\202;;=\2::<\234\234\236\377\377\377\377" \
- "\224\377\377\377\1\376\376\376\203\377\377\377\2\233\233\235;;=\203:" \
- ":<\2""99;;;=\202::<\2;;=xxz\213\377\377\377\1\376\376\376\265\377\377" \
- "\377\1\376\376\376\377\377\377\377\240\377\377\377\7\377\377\375\375" \
- "\376\377\376\377\377\376\377\375\377\374\377\377\377\375\375\377\376" \
- "\202\377\377\377\5\372\373\366\240\320b\215\307\77\212\306@\215\305>" \
- "\202\214\305@\20\215\305@\212\306@\214\305D\216\306\77\214\306>\215\307" \
- "\77\214\306>\212\306@\214\306>\215\307\77\215\305@\242\320c\370\373\362" \
- "\377\377\373\377\376\377\377\377\375\377\377\377\377\233\377\377\377" \
- "\3\376\376\376\377\377\377\376\376\376\213\377\377\377\6\376\376\376" \
- "\377\377\377\233\233\233;;=::<;;=\206::<\1lln\377\377\377\377\226\377" \
- "\377\377\3\376\376\376\377\377\377kkm\210::<\2;;=\234\234\236\214\377" \
- "\377\377\1\315\315\315\202\234\234\234\262\234\234\236\2\234\234\234" \
- "\265\265\265\377\377\377\377\240\377\377\377\37\376\377\377\376\377\375" \
- "\377\375\376\375\377\376\377\377\375\377\377\377\377\376\377\370\373" \
- "\362\241\321a\215\307\77\215\307=\214\305@\214\306>\212\307<\214\306" \
- ">\214\306<\214\306>\216\306\77\215\305<\212\307>\213\307A\215\305>\212" \
- "\307>\215\307\77\214\306>\242\321a\373\374\364\377\377\377\376\377\377" \
- "\376\376\376\376\377\377\344\377\377\377\4\376\376\376\347\347\347\234" \
- "\234\234\235\235\235\260\234\234\236\204\234\234\234\216\377\377\377" \
- "\1\301\301\301\202::<\1;;=\203::<\202;;=\2::<EEG\377\377\377\377\230" \
- "\377\377\377\1FFH\204::<\202;;=\4::<;;=99;\302\302\304\212\377\377\377" \
- "\5\376\376\376\377\377\377\234\234\234::<;;=\263::<\1jjj\205\377\377" \
- "\377\1\376\376\376\377\377\377\377\231\377\377\377\202\377\377\375\3" \
- "\377\374\377\375\377\376\376\377\377\202\377\377\377\25\370\373\364\243" \
- "\322b\217\304@\212\306@\214\305@\215\305>\212\307>\212\306@\214\305B" \
- "\214\305@\214\305B\214\306>\212\307>\212\310\77\214\306>\217\304@\214" \
- "\306>\214\305@\242\322b\370\373\362\377\377\377\202\377\376\377\1\377" \
- "\377\375\346\377\377\377\2\316\316\316:::\263::<\4;;=:::\377\377\377" \
- "\376\376\376\214\377\377\377\3\346\346\346::<;;=\205::<\4;;=::<;;=\346" \
- "\346\346\377\377\377\377\226\377\377\377\2\362\362\362;;=\204::<\3""9" \
- "9;::<;;=\202::<\1\346\346\350\214\377\377\377\2\234\234\234;;=\264::" \
- "<\1kkm\377\377\377\377\240\377\377\377\1\375\377\376\202\377\377\375" \
- "\34\377\377\377\376\376\376\373\373\363\243\322b\211\307B\212\307<\215" \
- "\305>\214\306>\212\307>\214\305@\217\304>\212\307<\214\306<\214\306>" \
- "\215\307\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370" \
- "\373\362\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375" \
- "\377\376\377\345\377\377\377\2\316\316\31699;\265::<\216\377\377\377" \
- "\2\376\376\376FFH\203::<\1;;=\203::<\3;;=99;\316\316\316\377\377\377" \
- "\377\226\377\377\377\1\317\317\317\206::<\202;;=\4""99;FFH\377\377\377" \
- "\376\376\376\213\377\377\377\1\234\234\236\202::<\1;;=\261::<\2;;=kk" \
- "m\205\377\377\377\1\376\376\376\377\377\377\377\231\377\377\377\3\377" \
- "\376\377\377\377\377\375\377\376\202\377\377\377\11\373\373\363\241\321" \
- "d\214\306>\213\310=\214\306>\214\305@\213\310=\212\306@\217\304>\202" \
- "\215\307=\14\214\306>\215\305>\214\306>\215\305>\217\304@\215\307\77" \
- "\215\307=\242\320c\367\375\361\376\376\377\377\376\377\376\376\376\202" \
- "\377\377\375\2\374\377\377\377\376\377\345\377\377\377\1\316\316\316" \
- "\264::<\202;;=\215\377\377\377\4\376\376\376\377\377\377lln99;\210::" \
- "<\2\234\234\234\376\376\376\377\377\377\377\225\377\377\377\5\234\234" \
- "\234::<;;=99;::<\202;;=\5::<;;=::<kkm\376\376\377\214\377\377\377\1\234" \
- "\234\236\203::<\1:9>\261::<\1kkm\377\377\377\377\237\377\377\377\1\377" \
- "\377\375\202\377\377\377\32\377\376\377\370\373\364\243\322b\214\306" \
- ">\213\310\77\214\305@\215\305>\215\305@\214\306>\214\305B\212\307<\215" \
- "\307=\214\305B\214\306>\215\306A\212\306@\212\307>\214\306>\212\307<" \
- "\244\317c\370\373\364\377\377\377\377\375\376\377\377\375\376\377\377" \
- "\377\377\377\202\377\376\377\346\377\377\377\1\316\316\316\266::<\217" \
- "\377\377\377\2\234\234\236;;=\206::<\3""99;;;=www\377\377\377\377\226" \
- "\377\377\377\3\204\204\206::<;;=\207::<\3\222\222\222\377\377\377\376" \
- "\376\376\213\377\377\377\1\234\234\236\265::<\1kkm\377\377\377\377\210" \
- "\377\377\377\7\376\376\376\377\377\377\377\377\375\376\377\375\376\377" \
- "\377\377\377\377\377\376\377\203\377\377\377\1\376\376\376\203\377\377" \
- "\377\1\376\377\377\203\377\377\377\16\377\377\375\377\377\377\377\376" \
- "\377\377\377\377\377\377\373\376\377\377\377\377\377\377\377\373\371" \
- "\372\364\242\322d\214\306<\215\307\77\214\305@\214\306<\202\215\305@" \
- "\4\214\306<\214\305@\214\306<\215\307\77\202\214\306>\6\212\307>\214" \
- "\306>\215\307\77\214\305@\244\317c\367\375\361\356\377\377\377\1\316" \
- "\316\316\266::<\214\377\377\377\1\376\376\376\202\377\377\377\1\266\266" \
- "\266\202::<\1;;=\203::<\1;;=\202::<\3__a\377\377\377\376\376\376\377" \
- "\377\377\377\224\377\377\377\2kkm;;=\202::<\202;;=\202::<\3;;=::<\265" \
- "\265\265\215\377\377\377\1\234\234\236\265::<\1kkm\377\377\377\377\214" \
- "\377\377\377\2\376\377\377\376\377\375\202\377\377\375\203\377\377\377" \
- "\204\377\377\375\205\377\377\377\1\376\376\377\202\377\377\377\6\377" \
- "\377\375\377\377\377\371\372\362\242\320c\214\305@\215\305@\202\214\306" \
- ">\20\215\305@\213\310=\212\306@\214\306>\214\305B\215\307\77\215\305" \
- ">\215\306A\212\307>\214\306>\215\307\77\214\306>\242\322b\370\373\362" \
- "\376\376\377\377\375\376\355\377\377\377\1\316\316\316\266::<\215\377" \
- "\377\377\4\376\376\376\377\377\377\315\315\315;;=\203::<\1;;=\203::<" \
- "\2;;=99;\377\377\377\377\226\377\377\377\203::<\1;;=\202::<\1;;=\203" \
- "::<\2\317\317\317\376\376\376\214\377\377\377\1\234\234\236\265::<\1" \
- "kkm\377\377\377\377\211\377\377\377\3\376\376\376\377\376\377\377\377" \
- "\377\203\377\376\377\204\377\377\377\1\376\376\376\202\377\377\377\1" \
- "\377\376\377\203\377\377\377\1\376\376\376\203\377\377\377\31\376\376" \
- "\377\377\376\377\371\372\365\241\322e\212\307<\216\306\77\212\311<\216" \
- "\303\77\212\307>\215\305@\212\306@\214\305D\216\306\77\214\306>\215\307" \
- "\77\214\306>\212\306@\214\306>\215\307\77\215\305@\242\320c\370\373\362" \
- "\377\377\373\377\376\377\377\377\375\355\377\377\377\1\316\316\316\266" \
- "::<\220\377\377\377\202::<\4;;=::<;;=::<\202;;=\3""99;;;=\346\346\346" \
- "\377\377\377\377\224\377\377\377\2\362\362\362;;=\202::<\7""99;::<;;" \
- "=88:;;=::<;;=\216\377\377\377\1\234\234\236\265::<\1kkm\377\377\377\377" \
- "\212\377\377\377\202\376\377\377\202\377\377\377\1\377\376\377\206\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\376\376\376\202\377\377\377\6\370\373\364\242\322b\214\306>\214\305" \
- "@\215\305>\214\305@\202\215\306A\20\214\306<\214\306>\216\306\77\215" \
- "\305<\212\307>\213\307A\215\305>\212\307>\215\307\77\214\306>\242\321" \
- "a\373\374\364\377\377\377\376\377\377\376\376\376\376\377\377\355\377" \
- "\377\377\1\316\316\316\266::<\216\377\377\377\6\376\376\376\377\377\377" \
- "SSU;;=99;;;=\206::<\1\316\316\316\377\377\377\377\224\377\377\377\2\316" \
- "\316\31699;\205::<\1;;=\202::<\1FFH\216\377\377\377\1\234\234\236\265" \
- "::<\1kkm\377\377\377\377\207\377\377\377\202\377\376\377\2\377\377\377" \
- "\377\377\375\203\377\377\377\1\376\377\375\202\377\377\375\203\377\377" \
- "\377\202\377\377\375\2\377\377\377\377\377\375\205\377\377\377\26\377" \
- "\377\375\371\372\362\243\322b\211\305A\215\305>\215\307\77\214\305@\214" \
- "\306>\215\305@\212\307>\214\305@\214\305B\214\306>\212\307>\212\310\77" \
- "\214\306>\217\304@\214\306>\214\305@\242\322b\370\373\362\377\377\377" \
- "\202\377\376\377\1\377\377\375\356\377\377\377\1\316\316\316\266::<\220" \
- "\377\377\377\3kkm::<;;=\202::<\6;;=::<;;=::<;;=\233\233\233\377\377\377" \
- "\377\223\377\377\377\2\376\376\376\265\265\265\205::<\1;;=\202::<\2""9" \
- "9;lln\216\377\377\377\1\234\234\236\265::<\1kkm\377\377\377\377\207\377" \
- "\377\377\3\376\377\375\375\377\376\377\377\377\202\377\376\377\3\377" \
- "\376\374\377\377\377\376\377\377\202\377\377\377\1\377\377\375\204\377" \
- "\377\377\2\375\377\376\377\377\375\202\377\377\377\1\377\377\375\202" \
- "\377\377\377\32\376\376\374\365\367\354\223\312K\215\305>\214\306<\211" \
- "\305\77\214\306>\212\307>\215\307\77\214\306>\214\306<\214\306>\215\307" \
- "\77\213\307A\214\306>\215\305@\215\307\77\212\307>\244\317c\370\373\362" \
- "\377\377\373\376\377\377\377\376\377\375\376\377\377\377\375\377\376" \
- "\377\355\377\377\377\1\316\316\316\266::<\217\377\377\377\5\376\376\376" \
- "\234\234\236;;=::<;;=\202::<\2""99;::<\202;;=\1\221\221\221\377\377\377" \
- "\377\224\377\377\377\1\235\235\235\211::<\2\221\221\223\376\376\376\215" \
- "\377\377\377\1\234\234\236\265::<\1kkm\377\377\377\377\207\377\377\377" \
- "\1\377\376\377\202\377\377\375\202\377\377\377\202\377\377\375\1\377" \
- "\377\377\202\376\377\377\1\377\377\377\202\377\377\375\5\376\376\377" \
- "\377\377\377\377\377\373\377\377\377\376\376\376\203\377\377\377\27\376" \
- "\376\376\377\377\375\376\377\372\347\365\333\225\311K\217\304>\214\305" \
- "B\215\307\77\212\306B\214\306>\215\306A\214\306>\215\305>\214\306>\215" \
- "\305>\217\304@\215\307\77\215\307=\242\320c\367\375\361\376\376\377\377" \
- "\376\377\376\376\376\202\377\377\375\2\374\377\377\377\376\377\355\377" \
- "\377\377\1\316\316\316\266::<\214\377\377\377\1\376\376\376\203\377\377" \
- "\377\3\250\250\252::<;;=\203::<\202;;=\202::<\1kkk\377\377\377\377\224" \
- "\377\377\377\4www;;=::<;;=\202::<\202;;=\202::<\1\234\234\236\216\377" \
- "\377\377\1\234\234\236\265::<\1kkm\377\377\377\377\207\377\377\377\15" \
- "\367\374\365\343\361\316\316\346\254\305\342\240\304\343\240\303\342" \
- "\236\305\342\237\312\346\251\345\356\317\365\373\357\376\377\377\376" \
- "\376\377\377\377\375\214\377\377\377\24\350\365\333\223\312K\216\306" \
- "\77\212\307>\215\304B\214\306>\215\307=\214\306>\215\306A\212\306@\212" \
- "\307>\214\306>\212\307<\244\317c\370\373\364\377\377\377\377\375\376" \
- "\377\377\375\376\377\377\377\377\377\202\377\376\377\356\377\377\377" \
- "\1\316\316\316\266::<\217\377\377\377\2\376\376\376\316\316\320\207:" \
- ":<\3;;=::<SSS\377\377\377\377\223\377\377\377\2\376\376\376kkm\202::" \
- "<\1;;=\206::<\1\316\316\316\377\377\377\377\276\377\377\377\4\377\377" \
- "\375\376\377\377\377\377\377\377\376\377\202\377\377\377\10\377\377\375" \
- "\377\376\377\376\377\375\376\376\376\377\377\377\350\365\333\277\337" \
- "\224\232\315V\210\214\306>\10\212\306@\212\307>\232\315W\277\337\224" \
- "\352\364\333\377\377\377\377\376\377\377\377\375\202\376\377\377\202" \
- "\377\377\377\2\377\376\377\377\377\375\202\377\377\377\17\377\377\375" \
- "\377\376\377\347\365\333\226\312L\215\306A\213\310=\212\306@\217\304" \
- ">\216\307<\214\305@\215\305<\214\305@\215\307=\244\317c\366\373\364\377" \
- "\377\377\377\276\377\377\377\6\346\346\346;;=99;;;=::<;;=\205::<\377" \
- "\377\377\377\224\377\377\377\1::<\202;;=\2::<;;=\203::<\4;;=::<\316\316" \
- "\316\376\376\376\377\377\377\377\274\377\377\377\14\377\375\377\377\377" \
- "\377\376\376\374\377\377\375\377\376\377\377\377\375\376\377\377\377" \
- "\377\377\376\377\377\377\376\377\324\353\265\231\316Z\202\214\306<\1" \
- "\215\305>\210\214\306>\202\215\305>\16\214\306>\213\307A\211\306;\233" \
- "\314V\324\353\265\377\377\377\377\376\377\377\377\375\375\377\376\376" \
- "\377\377\377\377\377\377\376\377\376\377\377\377\377\373\202\377\377" \
- "\377\6\376\376\377\350\365\333\222\312K\215\306A\217\304>\212\306@\202" \
- "\214\305@\6\213\310\77\212\307>\242\322d\370\373\364\377\377\377\377" \
- "\377\375\377\377\377\377\276\377\377\377\203::<\3;;=::<99;\202;;=\202" \
- "::<\1\346\346\350\377\377\377\377\222\377\377\377\2\376\376\376;;=\202" \
- "::<\202;;=\205::<\377\377\377\377\275\377\377\377\4\377\377\375\377\377" \
- "\377\377\377\373\377\376\374\202\376\377\377\12\377\377\375\377\377\377" \
- "\376\377\375\342\360\317\232\315V\214\306<\220\306=\215\306A\215\306" \
- "C\215\306A\210\214\306>\202\215\307\77\7\215\306A\214\306>\214\305@\213" \
- "\307A\214\305@\230\315W\341\361\315\203\377\377\377\2\376\376\374\374" \
- "\377\375\202\377\377\377\2\377\377\375\377\376\377\202\377\377\377\13" \
- "\352\364\331\221\311J\215\306A\213\310=\216\306\77\214\305@\214\306<" \
- "\242\322e\370\373\364\376\376\377\377\377\375\377\377\377\377\277\377" \
- "\377\377\1``b\202::<\2;;=99;\202;;=\4::<;;=::<\316\316\320\377\377\377" \
- "\377\222\377\377\377\4\316\316\316;;=::<99;\202::<\2;;=::<\202;;=\3:" \
- ":<\376\376\376\377\377\377\202\376\376\376\377\377\377\377\271\377\377" \
- "\377\17\376\377\377\376\376\374\377\376\374\376\377\377\377\377\377\377" \
- "\377\375\376\377\377\370\373\364\277\336\222\215\305<\214\305@\215\307" \
- "\77\212\307>\215\307\77\213\307A\211\214\306>\16\216\306A\214\305B\213" \
- "\307A\214\306>\215\305<\213\305=\215\306A\214\306<\215\305>\300\337\223" \
- "\370\373\362\376\376\377\377\377\375\376\377\377\204\377\377\377\16\377" \
- "\376\377\376\376\377\376\377\377\352\364\331\222\312K\215\306A\214\306" \
- "<\214\305@\243\321d\371\373\360\376\376\377\376\377\377\377\377\377\376" \
- "\377\377\377\377\377\377\273\377\377\377\4\376\376\376\377\377\377\376" \
- "\376\376lln\203::<\1;;=\20299;\1;;=\202::<\1\266\266\270\377\377\377" \
- "\377\222\377\377\377\5\316\316\316::<;;=::<;;=\205::<\3kkm\377\377\377" \
- "\376\376\376\377\377\377\377\274\377\377\377\14\377\377\375\376\377\377" \
- "\377\377\377\377\377\375\376\376\376\367\374\365\244\317c\214\305@\215" \
- "\307=\211\306=\213\307A\215\306A\202\212\306@\1\213\310<\210\214\306" \
- ">\202\212\307>\3\212\307<\214\306>\216\306\77\202\214\306>\12\215\305" \
- "<\215\307\77\212\306@\242\322b\371\374\365\377\377\375\376\376\374\376" \
- "\377\377\377\376\377\376\377\377\202\377\377\377\13\376\377\375\376\376" \
- "\377\377\377\377\350\365\333\225\311K\214\305B\242\320c\371\374\361\377" \
- "\377\377\376\377\377\377\376\377\377\377\377\377\300\377\377\377\7\221" \
- "\221\223::<99;::<;;=::<;;=\203::<\1\234\234\236\377\377\377\377\222\377" \
- "\377\377\2\250\250\25099;\206::<\3;;=::<jjl\377\377\377\377\275\377\377" \
- "\377\202\377\376\377\16\376\377\377\377\377\375\376\376\376\352\364\333" \
- "\223\312K\220\306=\215\306A\214\305B\213\310=\215\306C\215\305>\216\306" \
- "\77\215\305>\215\305@\210\214\306>\37\215\305@\215\307\77\212\306@\215" \
- "\307\77\214\304\77\215\306A\212\307;\212\306@\214\306>\216\307B\214\306" \
- ">\222\312K\354\364\334\377\376\377\377\377\377\377\377\373\376\377\377" \
- "\377\375\376\376\377\375\377\377\377\377\376\377\377\377\377\376\376" \
- "\377\347\365\333\260\327z\371\374\363\375\377\376\376\377\377\377\376" \
- "\377\377\377\377\377\377\375\377\377\377\377\276\377\377\377\3\376\376" \
- "\376\234\234\23699;\203;;=\205::<\1\221\221\223\377\377\377\377\222\377" \
- "\377\377\2\234\234\234;;=\204::<\202;;=\3::<;;=\235\235\237\377\377\377" \
- "\377\276\377\377\377\202\377\377\375\15\376\377\377\367\374\365\223\312" \
- "K\214\306>\213\310\77\215\305@\214\306<\215\307=\214\305@\213\307A\211" \
- "\305\77\215\307\77\215\305>\210\214\306>\20\215\306A\213\305=\215\307" \
- "=\214\305@\215\306A\214\306>\213\304A\220\305\77\216\306\77\212\306@" \
- "\215\305@\213\307A\221\311L\367\375\363\376\377\377\377\377\377\202\377" \
- "\377\373\1\377\375\376\202\377\377\377\4\377\376\377\376\377\377\377" \
- "\376\377\376\377\377\203\377\377\377\3\377\376\377\376\376\377\374\377" \
- "\375\377\377\377\377\277\377\377\377\2\265\265\267<<>\20299;\7::<;;=" \
- "::<99;;;=::<lln\377\377\377\377\222\377\377\377\3\221\221\221::<;;=\205" \
- "::<\3;;=::<\234\234\236\377\377\377\377\276\377\377\377\17\376\377\377" \
- "\377\377\377\366\373\364\244\317c\220\306=\213\310\77\212\306@\211\307" \
- "@\216\306\77\215\305@\215\307\77\213\310\77\215\307\77\215\305>\214\305" \
- "@\210\214\306>\22\216\306A\215\307\77\213\305=\216\306\77\214\306>\212" \
- "\307>\213\310\77\214\305@\215\306C\214\306<\215\307=\215\305>\213\310" \
- "=\242\320d\372\372\362\376\377\375\377\375\377\377\377\375\202\376\377" \
- "\377\5\377\377\377\377\377\375\377\377\377\377\377\375\377\377\377\202" \
- "\377\376\377\5\376\377\375\376\377\377\377\377\377\377\375\376\377\377" \
- "\375\377\377\377\377\274\377\377\377\5\376\376\376\377\377\377\316\316" \
- "\320::<;;=\202::<\1;;=\202::<\3""99;::<kkm\377\377\377\377\222\377\377" \
- "\377\2kkm::<\203;;=\205::<\1\264\264\264\377\377\377\377\275\377\377" \
- "\377\10\377\376\377\376\377\377\377\377\377\300\336\224\212\307>\214" \
- "\306<\214\306>\211\307>\231\214\306>\1\216\306\77\203\214\306>\2\214" \
- "\305@\266\334\207\202\377\377\377\7\377\376\377\377\377\377\377\376\377" \
- "\377\377\375\377\377\377\377\377\375\376\377\377\377\377\377\377\303" \
- "\377\377\377\1\376\376\376\202\377\377\377\1\316\316\316\206::<\6;;=" \
- "::<;;=FFH\377\377\377\376\376\376\205\377\377\377\1\376\376\376\377\377" \
- "\377\377\212\377\377\377\1lln\202::<\3;;=99;;;=\204::<\3\317\317\317" \
- "\377\377\377\376\376\376\377\377\377\377\273\377\377\377\10\377\375\377" \
- "\374\377\375\343\361\320\214\306>\215\306A\214\304=\212\307>\215\305" \
- ">\230\214\306>\20\214\306<\213\304\77\212\307>\212\306B\214\306<\212" \
- "\307>\220\304>\337\363\316\377\376\377\377\377\377\376\377\377\377\377" \
- "\377\376\376\377\377\377\377\376\376\376\376\377\377\377\377\377\377" \
- "\302\377\377\377\1\376\376\376\202\377\377\377\2\376\376\376\377\377" \
- "\377\204::<\1;;=\202::<\3;;=99;;;=\203\377\377\377\1\376\376\376\202" \
- "\377\377\377\1\376\376\376\377\377\377\377\213\377\377\377\2SSU;;=\202" \
- "::<\2;;=99;\204::<\1\315\315\315\203\377\377\377\1\376\376\376\377\377" \
- "\377\377\271\377\377\377\10\376\376\376\377\377\377\233\316W\214\305" \
- "@\212\306@\216\306=\214\305@\215\305@\230\214\306>\17\214\306<\215\306" \
- "C\211\306=\213\307A\214\304\77\212\306@\214\305B\234\313W\376\377\375" \
- "\377\377\377\376\377\375\377\377\375\376\377\377\376\376\377\376\377" \
- "\375\377\377\377\377\302\377\377\377\1\376\376\376\202\377\377\377\4" \
- "\376\376\376\377\377\377\376\376\376;;=\206::<\202;;=\3::<\377\377\377" \
- "\376\376\376\203\377\377\377\3\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\377\212\377\377\377\3::<99;;;=\202::<\10;;=::<;;=99;;;=\363" \
- "\363\363\377\377\377\376\376\376\377\377\377\377\274\377\377\377\7\323" \
- "\354\265\214\305@\215\307\77\215\306A\216\305C\213\304\77\212\307<\230" \
- "\214\306>\20\215\307\77\215\304B\214\305@\214\306>\215\305>\215\307=" \
- "\212\307<\215\307\77\323\351\270\377\376\377\377\377\377\376\376\376" \
- "\376\377\375\376\376\376\376\377\377\377\376\374\377\377\377\377\302" \
- "\377\377\377\202\376\376\376\202\377\377\377\2\376\376\376FFH\210::<" \
- "\2;;=\316\316\316\202\377\377\377\1\376\376\376\377\377\377\377\215\377" \
- "\377\377\1\376\376\376\202;;=\4""99;;;=::<;;=\202::<\2;;=::<\377\377" \
- "\377\377\277\377\377\377\7\231\316X\220\304>\214\305@\215\307\77\214" \
- "\306<\214\311>\214\305@\231\214\306>\11\215\304B\214\306>\215\306A\214" \
- "\306<\215\306A\214\305B\215\307\77\234\315X\375\377\374\204\377\377\377" \
- "\2\376\377\377\377\376\377\377\377\377\377\304\377\377\377\202\376\376" \
- "\376\4\377\377\377jjl::<99;\202;;=\205::<\7\316\316\316\377\377\377\376" \
- "\376\376\377\377\377\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\377\212\377\377\377\6\363\363\363::<99;;;=::<;;=\202::<\1;;=\202::<" \
- "\377\377\377\377\276\377\377\377\2\342\361\320\214\306<\202\215\305>" \
- "\4\212\307>\215\307=\211\306=\215\305>\230\214\306>\2\213\310=\214\306" \
- "<\202\214\305@\7\215\306A\214\306>\215\307=\214\304\77\211\310<\343\362" \
- "\321\377\377\375\202\377\376\377\2\377\377\375\376\376\376\377\377\377" \
- "\377\310\377\377\377\4kkm::<;;=::<\202;;=\202::<\3;;=::<\316\316\316" \
- "\202\377\377\377\1\376\376\376\377\377\377\377\215\377\377\377\3\316" \
- "\316\316::<;;=\202::<\1;;=\204::<\1__a\202\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\377\271\377\377\377\4\270\333\207" \
- "\214\306>\214\305@\214\306>\203\214\305@\1\215\305>\230\214\306>\17\215" \
- "\306A\213\310=\212\307<\214\306>\214\306<\215\306A\214\306>\214\305@" \
- "\213\306E\267\332\206\377\377\375\376\377\377\377\377\375\377\377\377" \
- "\377\377\375\377\377\377\377\303\377\377\377\1\376\376\376\204\377\377" \
- "\377\6lln;;=::<99;::<;;=\204::<\1\250\250\250\204\377\377\377\1\376\376" \
- "\376\377\377\377\377\213\377\377\377\1\316\316\316\203::<\1;;=\205::" \
- "<\1lln\203\377\377\377\1\376\376\376\377\377\377\377\272\377\377\377" \
- "\10\232\315V\215\305@\212\306@\215\305>\214\306<\215\304D\215\305<\212" \
- "\306@\230\214\306>\3\217\304@\214\306<\215\306A\202\215\305@\7\214\306" \
- ">\214\305@\212\307>\215\305<\233\316W\376\376\377\376\377\375\203\377" \
- "\377\377\1\376\377\377\377\377\377\377\305\377\377\377\3\376\376\376" \
- "\377\377\377\234\234\236\203::<\2;;=99;\204::<\1\234\234\234\202\377" \
- "\377\377\1\376\376\376\377\377\377\377\215\377\377\377\5\316\316\320" \
- "::<;;=::<;;=\202::<\1;;=\202::<\1kkm\377\377\377\377\266\377\377\377" \
- "\10\375\377\374\376\377\377\376\376\376\377\377\375\377\377\377\376\377" \
- "\377\377\377\375\360\371\350\250\214\306>\4\214\305@\212\307>\360\371" \
- "\346\376\377\375\202\377\377\377\1\377\377\375\377\377\377\377\304\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\234\234\234\211::<\1\234\234" \
- "\234\205\377\377\377\1\376\376\376\377\377\377\377\212\377\377\377\4" \
- "\316\316\320llnkkmlln\203kkm\1jjl\202kkm\1\221\221\223\377\377\377\377" \
- "\270\377\377\377\1\377\376\377\202\377\377\377\3\375\376\377\377\377" \
- "\375\341\361\315\251\214\306>\2\215\307\77\342\360\314\377\377\377\377" \
- "\310\377\377\377\202\376\376\376\202\377\377\377\2\266\266\266kkk\210" \
- "kkm\1\265\265\265\206\377\377\377\1\376\376\376\377\377\377\377\211\377" \
- "\377\377\1\376\376\376\203\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376" \
- "\377\377\377\377\264\377\377\377\1\377\376\377\205\377\377\377\2\375" \
- "\377\374\310\340\246\252\214\306>\1\310\340\246\377\377\377\377\307\377" \
- "\377\377\1\376\376\376\202\377\377\377\3\375\375\375\377\377\377\376" \
- "\376\376\211\377\377\377\7\376\376\376\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\377\377\377\376\376\376\377\377\377\377\213\377\377" \
- "\377\1\376\376\376\204\377\377\377\1\376\376\376\206\377\377\377\1\376" \
- "\376\376\377\377\377\377\263\377\377\377\1\377\376\377\204\377\377\377" \
- "\3\376\376\377\376\377\375\304\342\234\251\214\306>\7\215\305@\305\343" \
- "\235\376\376\377\377\377\377\376\376\377\377\376\377\377\377\375\377" \
- "\377\377\377\306\377\377\377\1\376\376\376\217\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\377\377\377\377\214\377\377\377\5\376\376" \
- "\376\377\377\377\376\376\376\377\377\377\376\376\376\203\377\377\377" \
- "\1\376\376\376\377\377\377\377\267\377\377\377\1\377\377\375\202\377" \
- "\377\377\3\377\376\377\376\377\375\305\342\237\251\214\306>\3\215\305" \
- "@\303\344\235\376\376\376\202\377\377\377\1\377\376\377\377\377\377\377" \
- "\305\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\214\377" \
- "\377\377\1\376\376\376\377\377\377\377\216\377\377\377\1\376\376\376" \
- "\203\377\377\377\1\376\376\376\206\377\377\377\1\376\376\376\377\377" \
- "\377\377\266\377\377\377\5\376\377\377\376\376\377\377\376\377\377\377" \
- "\377\305\342\242\251\214\306>\4\215\306A\302\341\236\377\377\375\376" \
- "\376\376\377\377\377\377\305\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\376\376\376\214\377\377\377\1\376\376\376\377\377\377\377\231\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377\264\377" \
- "\377\377\2\376\376\376\377\376\377\202\376\377\377\202\377\377\377\1" \
- "\305\342\240\251\214\306>\7\214\305@\306\343\240\377\376\374\377\377" \
- "\377\376\377\377\377\377\377\376\376\376\377\377\377\377\325\377\377" \
- "\377\1\376\376\376\377\377\377\377\222\377\377\377\1\376\376\376\205" \
- "\377\377\377\1\376\376\376\377\377\377\377\265\377\377\377\4\377\377" \
- "\375\377\376\377\375\377\376\376\377\375\202\377\377\377\1\305\343\235" \
- "\251\214\306>\4\213\310\77\306\341\234\377\376\377\377\377\377\202\376" \
- "\377\375\377\377\377\377\311\377\377\377\1\377\377\375\215\377\377\377" \
- "\1\376\376\376\377\377\377\377\377\377\377\377\314\377\377\377\3\377" \
- "\377\375\377\377\377\376\377\375\203\377\377\377\11\376\377\377\345\360" \
- "\320\214\305@\214\306>\214\305@\214\304\77\214\306<\215\305>\212\307" \
- ">\231\214\306>\1\214\305@\202\215\307\77\205\214\306>\5\212\307>\214" \
- "\306>\342\360\315\377\377\377\376\376\376\202\377\377\377\1\377\377\375" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\244" \
- "\377\377\377\3\377\376\377\377\377\377\376\377\375\203\377\377\377\11" \
- "\376\377\377\362\371\347\214\306>\214\305B\215\310<\215\306A\214\305" \
- "@\215\307\77\214\305@\231\214\306>\4\215\307\77\213\305=\214\306>\215" \
- "\307\77\202\214\306>\5\215\307\77\214\306>\216\306\77\215\306A\360\367" \
- "\345\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\251\377\377\377\2\377\376\377\377\377\375\203\377\377\377\13\377\377" \
- "\375\377\377\377\375\377\374\233\316W\214\305@\213\304\77\212\306@\215" \
- "\307\77\214\305@\215\306A\214\305@\230\214\306>\3\215\307\77\214\306" \
- ">\215\306A\203\214\305@\7\215\306A\214\305@\215\304B\232\315T\377\377" \
- "\375\376\377\377\377\377\375\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\250\377\377\377\1\377\377\375\205\377\377\377" \
- "\11\377\376\377\267\333\204\213\307A\213\307C\215\307\77\213\304\77\215" \
- "\307\77\215\305<\212\306@\231\214\306>\1\215\307\77\203\214\305@\202" \
- "\214\306>\7\215\307\77\212\306@\267\333\204\377\376\377\376\377\377\377" \
- "\377\375\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\247\377\377\377\17\377\377\375\377\377\377\377\377\375" \
- "\376\376\376\377\377\377\377\377\375\376\376\377\334\354\305\211\306" \
- "=\213\307A\213\305;\215\306A\214\306<\215\305>\213\307A\232\214\306>" \
- "\202\214\305@\11\214\306>\214\306<\214\306>\215\307\77\212\311=\333\355" \
- "\305\377\376\377\377\377\377\376\376\376\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\252\377\377\377\3\377\377\375\377" \
- "\377\377\377\376\377\203\377\377\375\7\233\314V\215\307\77\215\305>\214" \
- "\306>\215\307\77\214\305@\212\307>\232\214\306>\14\214\305@\214\306>" \
- "\214\306<\215\307=\215\307\77\214\305@\232\315V\374\377\373\376\376\377" \
- "\377\377\375\377\377\377\376\376\376\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\255\377\377\377\10\377\377\375\377\376" \
- "\377\324\353\267\214\304\77\215\305>\214\305@\212\307<\214\305@\232\214" \
- "\306>\2\215\307\77\215\306A\202\214\306>\4\215\307\77\213\304\77\215" \
- "\306E\316\346\254\202\377\377\377\3\377\377\375\376\376\377\376\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\247" \
- "\377\377\377\1\376\376\376\206\377\377\377\10\377\377\373\375\376\377" \
- "\232\315W\214\306>\215\307=\211\307>\215\306A\215\305>\232\214\306>\1" \
- "\214\305@\202\215\307\77\13\214\305@\215\306E\227\317P\377\377\377\377" \
- "\377\375\376\377\377\377\377\377\377\377\375\375\377\376\377\377\377" \
- "\377\377\375\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\254\377\377\377\20\376\377\377\377\375\377\331\356\303\215\305" \
- "@\213\310\77\215\305>\216\306\77\213\307A\215\306A\214\306<\214\306>" \
- "\216\306\77\213\304\77\212\307<\214\306>\215\305@\210\214\306>\1\214" \
- "\305@\202\215\307\77\205\214\306>\10\214\305@\212\307>\215\305>\214\305" \
- "@\215\305>\214\305@\215\305>\331\356\305\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\264\377\377\377\20\376\376\374\377" \
- "\377\375\376\376\374\261\330{\214\306>\216\306A\214\306>\213\307A\215" \
- "\305>\215\306A\215\307\77\213\304A\215\307\77\214\305@\214\306<\216\306" \
- "A\210\214\306>\4\215\307\77\213\305=\214\306>\215\307\77\202\214\306" \
- ">\12\215\307\77\214\306>\212\307>\220\305\77\212\307>\214\306>\213\310" \
- "=\214\306<\262\327z\376\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\265\377\377\377\17\374\377\377\377\377\377\370" \
- "\373\362\241\321d\211\310<\215\305>\215\305@\216\306=\214\305@\214\306" \
- ">\215\307\77\214\306>\212\307<\212\306@\212\307<\210\214\306>\3\215\307" \
- "\77\214\306>\215\306A\203\214\305@\12\215\306A\214\305@\215\305>\212" \
- "\307>\213\307A\216\305C\215\307=\242\322e\371\372\364\375\377\376\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\264\377" \
- "\377\377\1\375\377\374\203\377\377\377\4\352\364\333\223\311O\212\306" \
- "@\215\305@\202\213\310\77\202\214\306>\4\216\307F\213\305=\215\307\77" \
- "\215\305@\211\214\306>\1\215\307\77\203\214\305@\202\214\306>\1\215\307" \
- "\77\202\214\305@\6\216\305C\215\307\77\225\311K\351\363\332\377\377\377" \
- "\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\265\377\377\377\17\377\375\376\377\376\377\377\377\377\377\377" \
- "\375\352\365\327\223\313L\212\307<\215\305>\214\305@\215\307=\214\305" \
- "@\214\306<\213\310\77\213\304\77\220\305A\212\214\306>\202\214\305@\12" \
- "\214\306>\214\306<\214\306>\215\307\77\214\306>\213\310=\215\307=\225" \
- "\311K\347\365\334\377\377\375\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\267\377\377\377\1\377\377\375\202\377\377\377" \
- "\13\377\376\377\376\377\377\353\363\334\245\320d\214\305B\214\305@\215" \
- "\306A\213\305=\214\306>\213\307A\213\310=\213\214\306>\5\214\305@\214" \
- "\306>\214\306<\215\307=\215\307\77\202\214\305@\5\214\306<\242\322e\351" \
- "\363\332\377\377\375\376\376\376\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\267\377\377\377\1\376\376\374\202\377\377" \
- "\375\6\376\377\377\377\376\377\377\377\375\371\372\364\255\330|\217\304" \
- ">\202\212\306@\2\215\306A\214\303A\202\214\305@\211\214\306>\2\215\307" \
- "\77\215\306A\202\214\306>\6\215\307\77\213\304\77\215\306E\215\305>\262" \
- "\327z\371\372\364\203\377\377\377\2\376\377\377\377\377\375\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\264\377\377\377" \
- "\1\376\376\376\202\377\377\377\2\377\377\375\377\376\377\203\377\377" \
- "\377\6\377\377\375\331\356\303\233\314W\215\310<\214\305@\215\307\77" \
- "\214\214\306>\1\214\305@\202\215\307\77\7\214\305@\215\306E\227\317P" \
- "\331\356\305\376\377\377\375\377\376\376\377\377\202\377\377\377\2\377" \
- "\377\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\274\377\377\377\10\377\377\375\377\376\377\365\375\362" \
- "\307\342\237\234\315Z\212\306@\212\307>\214\305@\202\215\307\77\16\214" \
- "\306>\215\307\77\214\306>\215\306A\214\306>\213\310\77\214\306>\215\305" \
- "<\216\306A\213\310\77\212\307>\232\315T\307\341\242\370\373\362\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\304\377\377" \
- "\377\1\377\377\375\202\377\377\377\10\377\376\377\376\376\374\335\354" \
- "\303\270\333\207\222\311J\214\305@\215\306A\213\305=\202\214\306>\13" \
- "\215\307\77\216\306\77\215\305>\212\306@\212\307>\226\312K\270\333\211" \
- "\334\354\307\376\377\377\376\376\376\377\377\375\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\306\377\377\377\2\376\377" \
- "\375\376\377\377\204\377\377\377\16\350\366\334\332\354\302\311\341\245" \
- "\306\341\234\305\342\237\304\341\237\305\342\240\305\342\237\334\355" \
- "\303\352\364\333\377\377\375\377\375\376\377\376\377\377\377\375\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\307\377" \
- "\377\377\15\376\376\376\377\376\377\377\377\375\377\377\373\376\377\377" \
- "\376\377\375\376\377\377\377\377\375\377\377\377\376\376\376\376\377" \
- "\377\376\377\375\377\377\377\202\377\376\377\204\377\377\377\1\376\376" \
- "\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\307\377\377\377\3\376\377\377\377\377\377\376\376\376\202\377\377\377" \
- "\1\376\376\376\210\377\377\377\3\375\377\376\376\377\377\377\377\377" \
- "\203\377\376\377\4\376\377\375\376\377\377\377\377\377\377\376\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\304\377" \
- "\377\377\10\377\377\375\377\376\377\377\377\373\377\377\377\375\377\376" \
- "\376\377\377\376\376\376\377\376\377\202\376\377\377\1\377\377\377\202" \
- "\376\376\376\202\377\377\377\202\376\377\377\5\376\377\375\377\377\377" \
- "\376\376\374\377\377\377\377\377\375\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\307\377\377\377\1\376\376\377\202\377" \
- "\377\377\2\377\377\375\376\376\377\202\377\377\377\2\376\377\375\377" \
- "\377\375\204\377\377\377\202\377\377\375\1\376\377\375\202\376\377\377" \
- "\202\377\377\375\202\377\377\377\1\377\376\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\310\377\377\377\5\377\377\375" \
- "\377\376\377\377\377\375\376\376\377\377\376\377\207\377\377\377\202" \
- "\377\376\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\377\261\377\377\377" \
- "\1\376\376\376\210\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\331\377\377\377\1\376\376\376\204\377\377\377\1\376\376\376\257\377" \
- "\377\377\1\376\376\376\212\377\377\377\1\376\376\376\211\377\377\377" \
- "\1\376\376\376\221\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\205\377\377\377\1\376\376\376\312\377\377\377\1\376\376\376\214" \
- "\377\377\377\1\376\376\376\202\377\377\377\6\377\376\375\377\377\377" \
- "\376\377\377\377\377\377\377\376\377\376\377\377\270\377\377\377\7\376" \
- "\377\377\377\376\377\376\377\377\377\377\375\377\377\377\377\375\377" \
- "\377\376\377\273\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\302\377\377\377\1\376\376\376\305\377\377\377\1\376\376\376\241" \
- "\377\377\377\1\376\376\376\214\377\377\377\1\376\376\376\235\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\252\377\377\377\1\376\376\376" \
- "\212\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377" \
- "\1\376\376\376\251\377\377\377\202\376\376\376\215\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376" \
- "\224\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\232\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\206\377\377\377\1\376\376" \
- "\376\243\377\377\377\1\376\376\376\204\377\377\377\1\376\376\376\202" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377\2" \
- "\376\376\376\377\377\377\202\377\377\375\3\377\377\377\376\377\377\377" \
- "\377\375\202\377\376\377\1\377\377\377\270\377\376\377\14\377\377\377" \
- "\377\376\377\377\376\374\377\377\375\375\376\377\376\377\377\377\377" \
- "\375\376\376\376\377\377\377\376\376\376\377\377\377\376\376\376\203" \
- "\377\377\377\1\376\376\376\266\377\377\377\1\376\376\376\203\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\214\377\377\377\202" \
- "\376\376\376\207\377\377\377\1\376\376\376\272\377\377\377\1\376\376" \
- "\376\252\377\377\377\202\376\376\376\247\377\377\377\5\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\376\376\376\202\377\377\377\1\376\376" \
- "\376\203\377\377\377\1\376\376\376\311\377\377\377\1\376\376\376\221" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\302\377\377" \
- "\377\1\376\376\376\207\377\377\377\1\346\346\346\204\316\316\316\10\317" \
- "\317\317\315\315\315\316\316\316\363\363\365\377\377\377\376\376\376" \
- "\377\377\377\376\376\376\204\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\234\377\377\377\1\376\376\376\262\377\377\377\1\376\376" \
- "\376\213\377\377\377\1\377\377\375\202\376\377\377\1\376\376\377\202" \
- "\377\377\377\2\377\376\377\377\377\375\270\276\317\331\1\377\376\377" \
- "\205\377\377\377\3\376\377\375\377\377\375\376\376\376\257\377\377\377" \
- "\1\376\376\376\210\377\377\377\202\376\376\376\210\377\377\377\1\376" \
- "\376\376\220\377\377\377\1\376\376\376\207\377\377\377\1\376\376\376" \
- "\243\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\207\377\377\377\1\376\376\376\331\377\377\377\12\376" \
- "\376\376\377\377\377\235\235\235kkmllnkkmllnjjlkkm\346\346\346\202\377" \
- "\377\377\1\376\376\376\237\377\377\377\2\346\346\346\317\317\317\204" \
- "\316\316\316\2\317\317\317\346\346\346\234\377\377\377\1\376\376\376" \
- "\203\377\377\377\1\376\376\376\202\377\377\377\1\332\332\332\203\316" \
- "\316\316\1\317\317\317\202\316\316\316\213\377\377\377\5\346\346\346" \
- "\317\317\317\315\315\315\316\316\316\315\315\315\252\316\316\316\1\363" \
- "\363\363\205\377\377\377\1\376\376\376\212\377\377\377\1\376\376\376" \
- "\211\377\377\377\4\346\346\346\250\250\250\204\204\206``b\202::<\1;;" \
- "=\202::<\3;;=99;;;=\203::<\4lln\220\220\222\266\266\266\363\363\363\202" \
- "\376\376\376\240\377\377\377\1\346\346\346\202\316\316\316\10\317\317" \
- "\317\315\315\315\317\317\317\316\316\316\332\332\332\376\376\376\377" \
- "\377\377\376\376\376\203\377\377\377\1\376\376\376\241\377\377\377\6" \
- "\376\376\376\377\377\377\346\346\346\316\316\320\317\317\321\316\316" \
- "\320\203\316\316\316\2\347\347\347\376\376\376\205\377\377\377\1\376" \
- "\376\376\202\377\377\375\5\376\377\377\377\377\375\377\377\377\317\334" \
- "\344\37V\177\270\0>i\12\37U{\317\334\344\377\376\374\377\377\375\376" \
- "\377\377\377\376\374\376\377\377\376\376\376\377\377\377\363\363\363" \
- "\202\316\316\316\1\315\315\315\202\317\317\317\251\316\316\316\1\332" \
- "\332\332\202\377\377\377\1\376\376\376\203\377\377\377\202\376\376\376" \
- "\204\377\377\377\3\346\346\346\316\316\316\316\316\320\204\316\316\316" \
- "\2\346\346\346\376\376\376\212\377\377\377\1\347\347\347\206\316\316" \
- "\316\2\317\317\317\363\363\363\250\377\377\377\2\376\376\376\331\331" \
- "\331\206\316\316\316\1\332\332\332\202\377\377\377\1\376\376\376\204" \
- "\377\377\377\1\376\376\376\203\377\377\377\3\332\332\332\316\316\316" \
- "\316\316\320\250\316\316\316\1\363\363\363\205\377\377\377\1\376\376" \
- "\376\242\377\377\377\4\346\346\346::<;;=99;\204::<\1\204\204\206\237" \
- "\377\377\377\1\376\376\376\202\377\377\377\3\235\235\235::<;;=\202::" \
- "<\3;;=::<\235\235\235\202\377\377\377\1\376\376\376\232\377\377\377\1" \
- "\376\376\376\205\377\377\377\4kkm;;;99;;;=\202::<\1;;;\213\377\377\377" \
- "\4\234\234\234:::::<;;=\202::<\1;;;\250::<\1\316\316\316\202\377\377" \
- "\377\1\376\376\376\203\377\377\377\1\376\376\376\212\377\377\377\203" \
- "\376\376\376\203\377\377\377\3\346\346\346\250\250\250```\204::<\202" \
- ";;=\202::<\3;;=::<;;=\203::<\1;;=\202::<\5;;=::<```\265\265\265\362\362" \
- "\362\203\377\377\377\1\376\376\376\233\377\377\377\1\234\234\236\204" \
- "::<\5""99;;;=::<\333\333\335\376\376\376\203\377\377\377\1\376\376\376" \
- "\241\377\377\377\4\376\376\376\377\377\377\363\363\363FFH\202::<\1;;" \
- "=\203::<\1\234\234\234\210\377\377\377\6\376\377\377\377\377\375\375" \
- "\376\377\356\363\366\40Vz\0\77h\270\0=i\20\0>i\22Ip\356\363\367\376\377" \
- "\377\377\377\375\377\377\377\376\376\377\377\376\377\377\377\377\315" \
- "\315\315:::::<;;=::<99;;;;\250::<\1kkm\205\377\377\377\1\376\376\376" \
- "\203\377\377\377\4\376\376\376\377\377\377\376\376\376\234\234\234\203" \
- "::<\6;;=::<:::\234\234\234\377\377\377\376\376\376\211\377\377\377\3" \
- "\332\332\332:::;;=\202::<\202;;=\2::<\204\204\206\250\377\377\377\2\364" \
- "\364\364FFF\204::<\202:::\1\234\234\234\206\377\377\377\1\376\376\376" \
- "\204\377\377\377\2kkk;;=\251::<\1\316\316\316\202\377\377\377\1\376\376" \
- "\376\203\377\377\377\1\376\376\376\240\377\377\377\6\376\376\376\234" \
- "\234\236::<;;=::<;;=\203::<\2FFH\362\362\362\235\377\377\377\1\376\376" \
- "\376\203\377\377\377\3\234\234\236::<;;=\202::<\3;;=::<\234\234\236\203" \
- "\377\377\377\1\376\376\376\233\377\377\377\1\376\376\376\203\377\377" \
- "\377\7kkm::<;;=::<;;=::<;;=\213\377\377\377\4\235\235\235::<;;=99;\202" \
- ";;=\251::<\1\315\315\315\203\377\377\377\202\376\376\376\213\377\377" \
- "\377\1\376\376\376\202\377\377\377\6\376\376\376\377\377\377\315\315" \
- "\315\205\205\205::<;;=\213::<\4;;=::<;;=::<\203;;=\204::<\4FFF\204\204" \
- "\204\346\346\346\376\376\376\234\377\377\377\3\234\234\236::<;;=\202" \
- "::<\4;;=99;::<``b\244\377\377\377\1\376\376\376\203\377\377\377\1xxz" \
- "\202::<\10;;=99;;;=::<;;=\233\233\235\377\377\377\376\376\376\202\377" \
- "\377\377\1\376\376\376\203\377\377\377\4\375\377\376\377\376\373\377" \
- "\377\375\235\267\310\202\0>i\271\0=i\4\0\77j\237\266\306\377\376\377" \
- "\377\375\374\202\376\377\377\4\377\377\377\376\376\376\316\316\31699" \
- ";\202;;=\2::<;;=\251::<\1kkm\203\377\377\377\1\376\376\376\210\377\377" \
- "\377\4\235\235\235::<99;;;=\203::<\1\235\235\235\214\377\377\377\2ll" \
- "n99;\202;;=\1::<\203;;=\2\362\362\364\376\376\376\245\377\377\377\2\376" \
- "\376\376\250\250\250\204::<\4;;=::<:::\346\346\346\203\377\377\377\1" \
- "\376\376\376\205\377\377\377\3\376\376\376\377\377\377jjl\252::<\1\315" \
- "\315\315\203\377\377\377\202\376\376\376\242\377\377\377\3\362\362\364" \
- "GGI::<\202;;=\2""99;;;=\202::<\2""99;\235\235\235\237\377\377\377\3\376" \
- "\376\376\377\377\377\235\235\237\202::<\202;;=\202::<\3\235\235\237\377" \
- "\377\377\376\376\376\233\377\377\377\1\376\376\376\203\377\377\377\4" \
- "\376\376\376\377\377\377kkm;;=\202::<\5""99;;;=99;\377\377\377\376\376" \
- "\376\211\377\377\377\1\233\233\233\202::<\3;;=::<99;\251::<\1\317\317" \
- "\317\205\377\377\377\1\376\376\376\214\377\377\377\3\376\376\376\347" \
- "\347\347xxz\203::<\1;;=\202::<\1;;=\204::<\1;;=\203::<\1;;=\205::<\1" \
- ";;=\203::<\1;;=\203::<\2\234\234\236\362\362\362\233\377\377\377\2\233" \
- "\233\235;;=\204::<\1;;=\202::<\1\234\234\236\245\377\377\377\4\376\376" \
- "\376\302\302\304::<;;=\206::<\1\235\235\237\202\377\377\377\1\376\376" \
- "\376\203\377\377\377\7\375\376\377\377\377\377\377\377\375\376\377\377" \
- "\377\377\377\177\235\265\0\77k\271\0\77j\7\0\77k\0\77j~\236\265\377\376" \
- "\377\376\377\377\375\377\374\377\377\375\202\377\377\377\5\315\315\315" \
- ";;=::<99;;;=\252::<\3kkm\377\377\377\376\376\376\203\377\377\377\1\376" \
- "\376\376\203\377\377\377\1\376\376\376\202\377\377\377\3\233\233\233" \
- "::<;;=\202::<\3;;=::<\234\234\234\202\377\377\377\1\376\376\376\211\377" \
- "\377\377\4\264\264\264;;=::<;;=\204::<\3\247\247\251\377\377\377\376" \
- "\376\376\245\377\377\377\1SSS\203::<\1;;=\202::<\1\204\204\204\213\377" \
- "\377\377\4\376\376\376lln::<:9>\250::<\1\317\317\317\205\377\377\377" \
- "\1\376\376\376\241\377\377\377\1\265\265\267\204::<\1;;=\204::<\1FFF" \
- "\241\377\377\377\2\234\234\236;;=\204::<\2;;=\234\234\236\234\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\204\377\377\377\1kkm\203:" \
- ":<\4;;=::<;;=\376\376\376\212\377\377\377\1\234\234\234\204::<\1;;=\251" \
- "::<\1\316\316\316\203\377\377\377\202\376\376\376\215\377\377\377\4\234" \
- "\234\234;;=::<;;=\202::<\1""99;\204::<\1;;=\203::<\1;;=\211::<\1""99" \
- ";\207::<\2FFF\301\301\301\232\377\377\377\2\234\234\23699;\210::<\1\333" \
- "\333\333\241\377\377\377\6\376\376\376\377\377\377\376\376\376\363\363" \
- "\363FFH;;=\205::<\3;;=::<\234\234\236\206\377\377\377\7\377\376\377\377" \
- "\377\377\377\377\375\375\376\377\377\376\377\201\235\263\0>g\272\0>i" \
- "\13\0>e\177\236\263\377\375\374\377\377\377\377\377\375\376\376\376\377" \
- "\376\377\377\377\377\316\316\316::<;;=\202::<\2""99;;;=\250::<\1kkm\204" \
- "\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\202\377\377\377\2\376\376\376\234\234\234\206::<\1\234\234\234\215" \
- "\377\377\377\2RRT;;=\205::<\1SSU\246\377\377\377\2\316\316\316999\206" \
- "::<\1\316\316\316\202\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\207\377\377\377\3jjl::<:9>\250::<\1\316\316\316\203\377\377\377\202" \
- "\376\376\376\242\377\377\377\2SSU99;\202;;=\204::<\4;;=99;::<\264\264" \
- "\266\240\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377" \
- "\1kkm\206::<\213\377\377\377\2\234\234\236;;=\216::<\4""99;;;=::<;;=" \
- "\206::<\3;;=::<;;=\222::<\1\316\316\316\205\377\377\377\1\376\376\376" \
- "\207\377\377\377\1\376\376\376\202\377\377\377\2\346\346\350__a\202:" \
- ":<\3;;=::<;;=\204::<\1;;=\202::<\3;;=::<;;=\203::<\1;;=\202::<\2""99" \
- ";;;=\202::<\1;;=\204::<\7;;=::<;;=::<;;=\204\204\206\363\363\363\203" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\222\377\377\377\4" \
- "\234\234\236::<;;=99;\204::<\3;;=::<__a\244\377\377\377\1xxx\205::<\1" \
- ";;=\203::<\1\234\234\236\213\377\377\377\3\177\236\263\0=i\0>i\211\0" \
- "=i\2\0>j\0=i\202\1>j\2\0\77k\0>j\232\0>i\2\0>j\0\77k\202\1>j\2\0=i\0" \
- ">j\211\0=i\3\0>i\0=i\177\236\263\206\377\377\377\6\316\316\316:::::<" \
- ";;=::<;;=\217::<\1;;=\203::<\1;;=\202::<\1;;=\222::<\1kkk\205\377\377" \
- "\377\1\376\376\376\206\377\377\377\1\234\234\236\206::<\1\234\234\236" \
- "\215\377\377\377\3\234\234\234;;=::<\202;;=\203::<\3\316\316\320\377" \
- "\377\377\376\376\376\240\377\377\377\1\376\376\376\202\377\377\377\3" \
- "xxz::<;;=\202::<\3;;=::<__a\215\377\377\377\1kkm\204::<\1;;=\202::<\1" \
- ";;=\242::<\1\316\316\316\205\377\377\377\1\376\376\376\240\377\377\377" \
- "\1\265\265\265\202::<\5;;=::<;;=::<;;=\204::<\2TTV\376\376\376\237\377" \
- "\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm\206" \
- "::<\213\377\377\377\3\234\234\23499;;;=\214::<\1""99;\207::<\1;;=\227" \
- "::<\1\316\316\316\204\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\203\377\377\377\1\376\376\376\204\377\377\377\2\333\333\335FFH\214:" \
- ":<\16``b\221\221\223\251\251\251\315\315\315\316\316\316\363\363\363" \
- "\377\377\377\332\332\332\316\316\316\301\301\301\235\235\237jjlFFH;;" \
- "=\207::<\1;;=\202::<\3;;=__a\363\363\363\227\377\377\377\4\234\234\236" \
- "99;::<;;=\205::<\3;;=::<\233\233\233\240\377\377\377\12\376\376\376\377" \
- "\377\377\301\301\301;;=::<;;=::<;;=::<99;\203::<\1\234\234\236\213\377" \
- "\377\377\3\177\236\263\0=i\0>i\211\0=i\7\1>j\0=i\1>j\0=i\0>g\3>h\2=g" \
- "\230\0=i\7\2=g\3>h\0>g\0=i\1>j\0=i\1>j\211\0=i\3\0>i\0=i\177\236\263" \
- "\206\377\377\377\2\317\317\317:::\221::<\202;;=\202::<\3;;=::<99;\203" \
- "::<\2;;=99;\220::<\1kkk\214\377\377\377\1\234\234\236\206::<\1\234\234" \
- "\236\213\377\377\377\3\376\376\376\377\377\377\363\363\363\204::<\4;" \
- ";=::<;;=xxz\202\377\377\377\1\376\376\376\236\377\377\377\1\376\376\376" \
- "\202\377\377\377\3\346\346\346::<;;=\202::<\4;;=99;;;=\266\266\270\215" \
- "\377\377\377\1kkm\203::<\1;;=\202::<\1;;=\243::<\1\316\316\316\204\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\232\377\377\377\1\376" \
- "\376\376\204\377\377\377\1kkm\202;;=\202::<\202;;=\2::<;;=\204::<\3\317" \
- "\317\317\377\377\377\376\376\376\235\377\377\377\1\234\234\234\206::" \
- "<\1\234\234\234\243\377\377\377\1kkm\206::<\212\377\377\377\1\376\376" \
- "\376\224\377\377\377\1lln\203::<\1;;=\202::<\1\234\234\236\234\377\377" \
- "\377\1\376\376\376\204\377\377\377\4\376\376\376\265\265\267::<;;=\202" \
- "::<\1;;=\202::<\1;;=\203::<\5__a\266\266\270\363\363\363\377\377\377" \
- "\376\376\376\204\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\202\377\377\377\4\301\301\303\204\204\206;;=::<\203;;=\202::<\2" \
- ";;=::<\202;;=\3GGI\332\332\334\376\376\376\203\377\377\377\1\376\376" \
- "\376\221\377\377\377\2\235\235\237::<\202;;=\202::<\1;;=\202::<\4""9" \
- "9;::<;;=\331\331\331\240\377\377\377\2\363\363\363GGI\203::<\2;;=::<" \
- "\203;;=\202::<\1\234\234\236\213\377\377\377\3\177\236\263\0=i\0>i\210" \
- "\0=i\10\0\77k\0=i\1>j\0>i\0\77j\0=i\0>i\0>j\230\0>i\10\0>j\0>i\0=i\0" \
- "\77j\0>i\1>j\0=i\0\77k\210\0=i\3\0>i\0=i\177\236\263\206\377\377\377" \
- "\1\376\376\376\217\377\377\377\1\376\376\376\203\377\377\377\1\315\315" \
- "\317\204::<\3;;=::<kkm\240\377\377\377\1\234\234\236\206::<\1\234\234" \
- "\236\214\377\377\377\3\376\376\376\377\377\377\204\204\206\202::<\1;" \
- ";=\202::<\202;;=\1\345\345\345\242\377\377\377\2\376\376\376\234\234" \
- "\234\206::<\2GGI\363\363\363\215\377\377\377\1kkm\203::<\4""99;::<;;" \
- "=\316\316\320\311\377\377\377\2\317\317\32199;\203::<\5;;=::<FFH;;=:" \
- ":<\202;;=\202::<\1kkm\237\377\377\377\1\234\234\234\206::<\1\234\234" \
- "\234\243\377\377\377\1kkm\206::<\213\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\216\377\377\377\1\376\376\376\202\377\377\377\5lln:" \
- ":<;;=::<;;=\202::<\2\234\234\234\376\376\376\227\377\377\377\1\376\376" \
- "\376\210\377\377\377\1\264\264\266\202;;=\4::<;;=::<99;\204::<\3jjl\317" \
- "\317\321\376\376\376\202\377\377\377\1\375\375\375\203\377\377\377\3" \
- "\376\376\376\377\377\377\376\376\376\204\377\377\377\1\376\376\376\203" \
- "\377\377\377\3\363\363\365\234\234\236FFH\202::<\1;;=\202::<\1;;=\203" \
- "::<\2FFH\332\332\334\225\377\377\377\1\233\233\235\202;;=\211::<\1__" \
- "a\240\377\377\377\2xxz;;=\202::<\3;;=::<;;=\205::<\1\234\234\236\213" \
- "\377\377\377\3\177\236\263\0=i\0>i\211\0=i\202\0>i\5\0<h\1>j\0=i\1>j" \
- "\0>i\230\0=i\5\0>i\1>j\0=i\1>j\0<h\202\0>i\211\0=i\3\0>i\0=i\177\236" \
- "\263\212\377\377\377\3\376\376\376\377\377\377\376\376\376\212\377\377" \
- "\377\1\376\376\376\202\377\377\377\10\316\316\320::<;;=::<;;=99;::<j" \
- "jl\225\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\207\377" \
- "\377\377\1\234\234\236\206::<\1\234\234\236\216\377\377\377\3\332\332" \
- "\332;;=99;\202::<\4;;=::<99;\234\234\236\237\377\377\377\1\376\376\376" \
- "\203\377\377\377\1SSU\202::<\1;;=\203::<\1\221\221\221\216\377\377\377" \
- "\1kkm\206::<\1\316\316\316\250\377\377\377\1\376\376\376\235\377\377" \
- "\377\1\376\376\376\202\377\377\377\5xxz::<;;=::<;;=\202::<\3\316\316" \
- "\320RRT;;=\203::<\4;;=::<\332\332\332\376\376\376\235\377\377\377\1\234" \
- "\234\234\206::<\1\234\234\234\243\377\377\377\1kkm\206::<\214\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\213\377\377\377\1\376\376" \
- "\376\204\377\377\377\4kkm;;=::<;;=\203::<\1\235\235\235\202\377\377\377" \
- "\1\376\376\376\221\377\377\377\1\376\376\376\213\377\377\377\4\301\301" \
- "\301;;=::<;;=\203::<\202;;=\3::<RRT\316\316\316\203\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\204\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\203\377\377\377\1\376\376\376\204\377\377\377" \
- "\4\346\346\346xxz;;=99;\207::<\4GGI\362\362\362\377\377\377\376\376\376" \
- "\222\377\377\377\1\234\234\236\206::<\203;;=\202::<\2;;=\233\233\235" \
- "\236\377\377\377\10\301\301\301::<;;=:9>::<99;::<99;\202;;=\203::<\1" \
- "\234\234\236\213\377\377\377\3\177\236\263\0=i\0>i\210\0=i\7\2=g\0>i" \
- "\0>j\0\77j\0=i\0\77j\0=h\232\1>j\7\0=h\0\77j\0=i\0\77j\0>j\0>i\2=g\210" \
- "\0=i\3\0>i\0=i\177\236\263\213\377\377\377\1\376\376\376\216\377\377" \
- "\377\1\317\317\321\202::<\6;;=::<;;=::<lln\376\376\376\225\377\377\377" \
- "\1\376\376\376\203\377\377\377\1\376\376\376\205\377\377\377\1\234\234" \
- "\236\206::<\1\234\234\236\213\377\377\377\1\376\376\376\203\377\377\377" \
- "\2kkm;;=\204::<\2;;=GGI\236\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\265\265\267\202::<\6;;=::<;;=::<;;=\345\345\345\216\377\377\377\1" \
- "kkm\202::<\5;;=99;;;=99;\317\317\317\244\377\377\377\1\376\376\376\241" \
- "\377\377\377\3\376\376\376\377\377\377\347\347\351\206::<\3``b\377\377" \
- "\377\234\234\236\202::<\1;;=\202::<\4;;=\204\204\206\377\377\377\376" \
- "\376\376\234\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377" \
- "\377\1kkm\206::<\215\377\377\377\1\375\375\375\202\377\377\377\1\376" \
- "\376\376\213\377\377\377\5\376\376\376\377\377\377\376\376\376lln;;=" \
- "\203::<\3;;=::<\234\234\234\234\377\377\377\1\376\376\376\202\377\377" \
- "\377\4\331\331\331FFH::<;;=\202::<\11;;=::<99;;;=\203\203\203\363\363" \
- "\363\376\376\376\377\377\377\376\376\376\222\377\377\377\7\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\300\300\300GGI::<\202;;=\205::<" \
- "\4``b\362\362\362\377\377\377\376\376\376\221\377\377\377\1\234\234\236" \
- "\204::<\202;;=\203::<\5;;=99;::<;;=\332\332\332\234\377\377\377\4\363" \
- "\363\363GGI;;=::<\202;;=\203::<\1;;=\202::<\3;;=::<\234\234\236\213\377" \
- "\377\377\3\177\236\263\0=i\0>i\210\0=i\10\0\77j\0>j\0\77k\0=i\3>h\2=" \
- "g\1>j\0\77k\230\0=i\10\0\77k\1>j\2=g\3>h\0=i\0\77k\0>j\0\77j\210\0=i" \
- "\3\0>i\0=i\177\236\263\232\377\377\377\12\316\316\316;;=::<;;=::<;;=" \
- "::<kkm\377\377\377\376\376\376\222\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\210\377\377\377\1\234\234\236\206::<\1\234\234" \
- "\236\214\377\377\377\1\376\376\376\202\377\377\377\2\266\266\26699;\202" \
- "::<\202;;=\202::<\3\266\266\270\377\377\377\376\376\376\234\377\377\377" \
- "\203\376\376\376\1lln\202;;=\204::<\3xxx\377\377\377\376\376\376\215" \
- "\377\377\377\1kkm\205::<\2;;=\316\316\316\305\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\203\203\205\206::<\4\265\265\267\377\377\377\363\363" \
- "\363GGG\203::<\1;;=\202::<\1\346\346\346\235\377\377\377\1\234\234\234" \
- "\206::<\1\234\234\234\243\377\377\377\1kkm\206::<\216\377\377\377\1\376" \
- "\376\376\220\377\377\377\1jjl\206::<\1\234\234\234\202\377\377\377\1" \
- "\376\376\376\232\377\377\377\3\376\376\376\364\364\364SSU\202::<\7;;" \
- "=::<;;=99;::<;;=\265\265\265\205\377\377\377\203\376\376\376\214\377" \
- "\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377\376\376\376" \
- "\203\377\377\377\7\332\332\332__a::<;;=::<;;=::<\202;;=\3::<\205\205" \
- "\207\376\376\377\222\377\377\377\3\234\234\236::<;;=\202::<\2;;=99;\202" \
- ";;=\1""99;\202::<\3;;=::<__a\234\377\377\377\1xxz\202;;=\205::<\1;;=" \
- "\202::<\1;;=\202::<\1\234\234\236\213\377\377\377\3\177\236\263\0=i\0" \
- ">i\210\0=i\10\0>i\0=i\0>i\0\77k\0>j\2=g\1\77h\0>l\230\0>i\10\0>l\1\77" \
- "h\2=g\0>j\0\77k\0>i\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\205\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\221\377\377\377\3\316" \
- "\316\316::<;;=\204::<\1kkm\225\377\377\377\202\376\376\376\211\377\377" \
- "\377\1\234\234\236\206::<\1\234\234\236\217\377\377\377\3\376\376\376" \
- "TTV99;\202::<\4""99;;;=::<kkm\240\377\377\377\1\346\346\346\202::<\1" \
- "99;\204::<\1\316\316\316\217\377\377\377\1kkm\204::<\3;;=99;\316\316" \
- "\316\305\377\377\377\7\376\376\376\377\377\377\363\363\363::<;;=::<;" \
- ";=\202::<\1SSU\203\377\377\377\2\204\204\204;;=\203::<\4;;=99;\222\222" \
- "\222\376\376\376\234\377\377\377\1\234\234\234\206::<\1\234\234\234\243" \
- "\377\377\377\1kkm\206::<\214\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\220\377\377\377\1kkm\206::<\1\234\234\236\236\377\377\377\1" \
- "\204\204\206\203::<\1;;=\202::<\3;;=::<\265\265\267\221\377\377\377\1" \
- "\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377\1\376\376" \
- "\376\204\377\377\377\11\376\376\376\363\363\365__a::<;;=::<;;=::<;;=" \
- "\202::<\1\301\301\303\222\377\377\377\2\234\234\236;;=\202::<\10;;=:" \
- ":<;;=FFH::<;;=::<;;=\203::<\1\235\235\237\232\377\377\377\2\301\301\303" \
- ";;=\205::<\2;;=RRT\204::<\3;;=::<\234\234\236\213\377\377\377\3\177\236" \
- "\263\0=i\0>i\210\0=i\7\0>j\2=g\0>g\0>j\40V|o\224\256\177\236\262\232" \
- "\177\236\263\7\177\236\262o\224\256\40V|\0>j\0>g\2=g\0>j\210\0=i\3\0" \
- ">i\0=i\177\236\263\232\377\377\377\3\316\316\316::<;;=\203::<\2;;=kk" \
- "m\232\377\377\377\1\376\376\376\205\377\377\377\1\234\234\236\206::<" \
- "\1\234\234\236\220\377\377\377\2\233\233\235;;=\202::<\1<<>\203::<\1" \
- "\346\346\346\237\377\377\377\1\204\204\204\206::<\2SSU\376\376\376\217" \
- "\377\377\377\1kkm\203::<\4;;=::<;;=\316\316\320\304\377\377\377\1\376" \
- "\376\376\202\377\377\377\2\234\234\236;;=\202::<\4;;=::<;;=\234\234\234" \
- "\203\377\377\377\1\346\346\346\205::<\3;;=FFH\363\363\365\203\377\377" \
- "\377\1\376\376\376\230\377\377\377\1\234\234\234\206::<\1\234\234\234" \
- "\243\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236" \
- "\235\377\377\377\2\316\316\316;;=\202::<\6;;=::<;;=::<:::\265\265\265" \
- "\237\377\377\377\7\376\376\376\363\363\363___::<;;=::<;;=\203::<\2GG" \
- "I\363\363\363\204\377\377\377\1\376\376\376\214\377\377\377\1\234\234" \
- "\234\203::<\202;;=\5::<\266\266\266GGI99;;;=\202::<\1;;=\202::<\1\332" \
- "\332\332\206\377\377\377\1\376\376\376\211\377\377\377\1\376\376\376" \
- "\207\377\377\377\2\363\363\363FFH\206::<\3FFH\301\301\30399;\202::<\202" \
- ";;=\2::<\234\234\236\206\377\377\377\7\377\377\375\377\377\377\377\377" \
- "\375\376\377\377\376\376\376\200\237\263\0\77i\211\0>i\7\0>g\1>j\0>g" \
- "_\210\236\377\377\377\376\377\377\377\376\377\231\377\377\377\10\377" \
- "\377\375\376\377\375\377\377\377\377\377\375`\210\242\3>h\0\77j\1\77" \
- "h\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<" \
- "\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\220\377\377" \
- "\377\1\363\363\363\204::<\202;;=\2""99;\205\205\207\207\377\377\377\1" \
- "\376\376\376\224\377\377\377\4\376\376\376\377\377\377\363\363\363FF" \
- "H\202::<\5;;=99;;;=::<\265\265\265\220\377\377\377\1kkm\206::<\1\316" \
- "\316\316\305\377\377\377\5\376\376\376\364\364\364FFH::<;;=\202::<\4" \
- ";;=FFH\363\363\363\377\377\377\202\376\376\376\6\377\377\377xxz::<;;" \
- "=::<;;=\202::<\1\234\234\236\206\377\377\377\202\376\376\376\224\377" \
- "\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm\206" \
- "::<\237\377\377\377\1kkm\206::<\1\234\234\236\225\377\377\377\1\376\376" \
- "\376\207\377\377\377\2SSS;;=\202::<\1;;=\203::<\1\234\234\234\202\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\232\377\377\377\1\376" \
- "\376\376\202\377\377\377\4\332\332\332FFH::<;;=\202::<\1;;=\202::<\1" \
- "\222\222\224\205\377\377\377\1\376\376\376\213\377\377\377\3\234\234" \
- "\234::<;;=\202::<\5""99;;;=\315\315\315\250\250\252;;=\206::<\2``b\376" \
- "\376\376\202\377\377\377\1\376\376\376\216\377\377\377\1\376\376\376" \
- "\205\377\377\377\2xxx;;=\202::<\1;;=\203::<\2\300\300\300\317\317\321" \
- "\203::<\1;;=\202::<\1\234\234\236\207\377\377\377\1\377\376\377\202\377" \
- "\377\377\4\377\376\377\201\235\263\0=j\3>j\210\0=i\5\1>j\0=j\37V\177" \
- "\377\376\377\376\376\376\202\377\377\377\1\376\377\377\230\377\377\377" \
- "\10\376\377\377\377\377\375\374\377\377\377\376\374\376\377\377#W\177" \
- "\0>g\0\77i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316" \
- "\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\220\377" \
- "\377\377\2\376\376\376\204\204\206\205::<\3;;=FFH\362\362\362\204\377" \
- "\377\377\202\376\376\376\2\377\377\377\376\376\376\224\377\377\377\3" \
- "\376\376\376\265\265\265;;=\203::<\4;;=99;FFH\363\363\363\220\377\377" \
- "\377\1kkm\206::<\1\316\316\316\306\377\377\377\4\265\265\26599;;;=::" \
- "<\202;;=\2""99;\222\222\224\204\377\377\377\12\376\376\376\316\316\320" \
- ";;=::<;;=99;;;=99;SSU\376\376\376\202\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\226\377\377\377\1\234\234\234\206::<\1\234\234\234\243" \
- "\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\234" \
- "\377\377\377\11\234\234\234::<;;=99;;;=99;::<;;=kkm\241\377\377\377\1" \
- "\376\376\376\202\377\377\377\1\301\301\303\203::<\6;;=99;::<;;=::<\346" \
- "\346\350\203\377\377\377\1\376\376\376\214\377\377\377\1\234\234\234" \
- "\203::<\202;;=\10""99;\316\316\316\377\377\377kkm::<;;=::<;;=\203::<" \
- "\1\235\235\237\203\377\377\377\1\376\376\376\214\377\377\377\1\376\376" \
- "\376\205\377\377\377\3\302\302\304::<;;=\202::<\7""99;;;=99;xxz\377\377" \
- "\377\315\315\315;;=\203::<\3:9>::<\234\234\236\206\377\377\377\3\376" \
- "\377\377\377\377\375\377\377\377\202\377\377\375\3|\237\265\0\77k\0>" \
- "g\210\0=i\10\0@h\3<i~\236\263\376\377\377\377\377\377\377\376\377\377" \
- "\376\374\377\376\377\230\377\377\377\10\377\375\377\377\377\375\377\376" \
- "\374\377\377\377\376\376\374\220\251\275\2=i\0>j\210\0=i\3\0>i\0=i\177" \
- "\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1" \
- "\234\234\236\206::<\1\234\234\236\215\377\377\377\1\376\376\376\203\377" \
- "\377\377\2\332\332\334;;=\206::<\2\266\266\266\376\376\376\202\377\377" \
- "\377\1\376\376\376\202\377\377\377\1\376\376\376\222\377\377\377\1\376" \
- "\376\376\203\377\377\377\1SSS\203::<\4""99;::<;;=\221\221\223\221\377" \
- "\377\377\1kkm\206::<\1\316\316\316\306\377\377\377\4RRT;;=::<;;=\202" \
- "::<\2;;=\345\345\345\202\377\377\377\1\376\376\376\203\377\377\377\2" \
- "__a;;=\202::<\1;;=\202::<\1\264\264\264\206\377\377\377\1\376\376\376" \
- "\224\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1" \
- "kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\226\377\377\377" \
- "\1\376\376\376\204\377\377\377\2\363\363\363FFH\203::<\1;;=\202::<\2" \
- "FFH\346\346\346\204\377\377\377\1\376\376\376\233\377\377\377\1\376\376" \
- "\376\203\377\377\377\3\376\376\376xxz99;\202::<\1""99;\202::<\4;;=\204" \
- "\204\206\377\377\377\376\376\376\202\377\377\377\1\376\376\376\213\377" \
- "\377\377\1\234\234\234\202::<\10;;=99;;;=::<\317\317\317\376\376\376" \
- "\363\363\363GGI\203::<\1;;=\203::<\3\331\331\331\377\377\377\376\376" \
- "\376\202\377\377\377\1\376\376\376\217\377\377\377\5\363\363\363GGI;" \
- ";=::<;;=\202::<\7""99;FFH\363\363\363\377\377\377\316\316\316::<;;=\202" \
- "::<\3:9>::<\234\234\236\207\377\377\377\7\376\377\377\376\376\376\377" \
- "\377\377\377\377\375\377\377\377\377\375\374\376\377\377\210\377\377" \
- "\377\10\376\376\374\376\377\377\354\364\366\377\377\375\376\377\377\377" \
- "\376\374\377\377\375\376\377\377\230\377\377\377\10\377\377\375\376\377" \
- "\377\377\376\375\375\376\377\376\377\377\301\317\330\0>g\0>j\210\0=i" \
- "\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240" \
- "\377\377\377\1\234\234\236\206::<\1\234\234\236\220\377\377\377\5\376" \
- "\376\376\377\377\377kkm::<;;=\202::<\3""99;::<^^`\204\377\377\377\1\376" \
- "\376\376\227\377\377\377\1\316\316\316\202::<\203;;=\202::<\1\347\347" \
- "\347\221\377\377\377\1kkm\206::<\1\316\316\316\303\377\377\377\12\376" \
- "\376\376\377\377\377\301\301\301;;=::<;;=::<99;::<\204\204\206\204\377" \
- "\377\377\4\376\376\376\377\377\377\376\376\376\266\266\266\202::<\5;" \
- ";=::<;;=::<``b\203\377\377\377\1\376\376\376\227\377\377\377\1\234\234" \
- "\234\206::<\1\234\234\234\243\377\377\377\1kkm\206::<\237\377\377\377" \
- "\1kkm\206::<\1\234\234\236\233\377\377\377\1\265\265\267\204::<\4""9" \
- "9;;;=::<\234\234\234\203\377\377\377\3\376\376\376\377\377\377\376\376" \
- "\376\231\377\377\377\5\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\376\376\376\202\377\377\377\5\363\363\363GGI99;::<;;=\202::<\3;;=::" \
- "<\346\346\346\204\377\377\377\1\376\376\376\212\377\377\377\3\234\234" \
- "\234::<99;\202;;=\202::<\1\315\315\315\202\377\377\377\3\301\301\303" \
- ";;=99;\202;;=\5::<;;=::<``b\376\376\376\202\377\377\377\1\376\376\376" \
- "\215\377\377\377\6\376\376\376\377\377\377\376\376\376xxz::<;;=\203:" \
- ":<\202;;=\1\300\300\302\202\377\377\377\3\316\316\316;;=99;\202::<\3" \
- ";:\77::<\234\234\236\206\377\377\377\2\377\377\375\376\377\375\202\376" \
- "\377\377\4\377\377\375\377\377\377\377\376\377\377\377\375\211\377\377" \
- "\377\1\376\376\374\202\377\377\377\3\377\376\377\377\377\377\375\376" \
- "\377\231\377\377\377\202\376\377\377\5\377\376\377\376\377\377\377\377" \
- "\375\277\320\332\0\77j\211\0=i\3\0>i\0=i\177\236\263\232\377\377\377" \
- "\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234" \
- "\234\236\213\377\377\377\3\376\376\376\377\377\377\376\376\376\204\377" \
- "\377\377\1\265\265\265\202::<\1;;=\204::<\1\315\315\317\204\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\220\377\377\377\1\376\376" \
- "\376\202\377\377\377\3\204\204\204::<;;=\204::<\2yy{\376\376\376\221" \
- "\377\377\377\1kkm\206::<\1\316\316\316\305\377\377\377\4kkm;;=::<;;=" \
- "\203::<\1\316\316\316\210\377\377\377\1TTV\206::<\2\317\317\321\376\376" \
- "\376\231\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377" \
- "\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\233\377\377\377" \
- "\1TTV\202::<\7;;=::<;;=::<RRT\377\377\377\376\376\376\203\377\377\377" \
- "\1\376\376\376\233\377\377\377\1\376\376\376\206\377\377\377\2\233\233" \
- "\235;;=\203::<\4;;=::<;;=\234\234\234\217\377\377\377\4\234\234\234:" \
- ":<;;=99;\203::<\1\316\316\316\203\377\377\377\4xxz;;=::<99;\202::<\3" \
- ";;=::<\234\234\236\216\377\377\377\1\376\376\376\202\377\377\377\16\376" \
- "\376\376\302\302\304::<;;=::<;;=::<;;=::<\221\221\223\377\377\377\376" \
- "\376\376\377\377\377\316\316\316\202::<\202;;=\202::<\1\234\234\236\206" \
- "\377\377\377\2\377\376\377\377\377\377\202\377\376\377\4\376\376\376" \
- "\353\366\374\327\355\370\323\356\371\210\326\356\372\7\325\354\372\327" \
- "\355\372\365\372\376\376\376\376\377\377\377\376\377\377\377\377\373" \
- "\231\377\377\377\2\377\376\377\376\377\375\202\377\377\377\4\374\377" \
- "\377\300\316\327\0=i\1\77h\210\0=i\3\0>i\0=i\177\236\263\232\377\377" \
- "\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1" \
- "\234\234\236\221\377\377\377\4\376\376\376\377\377\377SSU;;=\202::<\4" \
- ";;=99;;;=\204\204\206\203\377\377\377\1\376\376\376\226\377\377\377\11" \
- "\363\363\36399;;;=::<;;=::<;;=::<\316\316\316\202\377\377\377\1\376\376" \
- "\376\217\377\377\377\1kkm\206::<\1\316\316\316\304\377\377\377\1\316" \
- "\316\316\206::<\1kkk\211\377\377\377\2\235\235\23599;\202;;=\6::<;;=" \
- "::<kkm\377\377\377\376\376\376\203\377\377\377\1\376\376\376\224\377" \
- "\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm\206" \
- "::<\237\377\377\377\1kkm\206::<\1\234\234\236\232\377\377\377\1\332\332" \
- "\332\204::<\1;;=\202::<\4\266\266\270\376\376\376\377\377\377\376\376" \
- "\376\240\377\377\377\1\376\376\376\204\377\377\377\2\363\363\363FFH\202" \
- "::<\5;;=::<;;=::<SSS\217\377\377\377\2\235\235\23599;\205::<\11\316\316" \
- "\316\377\377\377\376\376\376\377\377\377\363\363\363FFH::<;;=99;\203" \
- ";;=\2::<\331\331\333\220\377\377\377\2\363\363\363FFH\202::<\6;;=::<" \
- ";;=::<TTV\364\364\364\203\377\377\377\3\316\316\316<<>99;\202::<\3;;" \
- "=::<\234\234\236\211\377\377\377\4\377\375\376\376\377\377\254\334\363" \
- "Z\266\347\211[\267\350\6\\\266\350X\267\347\326\354\367\377\376\377\376" \
- "\377\377\377\377\375\232\377\377\377\3\377\377\373\375\377\376\376\377" \
- "\377\202\377\377\375\3\276\320\336\0>g\0>i\210\0=i\3\0>i\0=i\177\236" \
- "\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234" \
- "\234\236\206::<\1\234\234\236\223\377\377\377\1\235\235\237\204::<\4" \
- "<<>::<;;=\363\363\363\206\377\377\377\1\376\376\376\222\377\377\377\2" \
- "\234\234\234;;=\205::<\1SSU\204\377\377\377\1\376\376\376\216\377\377" \
- "\377\1kkm\206::<\1\316\316\316\304\377\377\377\1\204\204\204\203::<\1" \
- "99;\202::<\1\265\265\265\211\377\377\377\2\363\363\363FFH\205::<\2;;" \
- "=\346\346\346\231\377\377\377\1\234\234\234\206::<\1\234\234\234\243" \
- "\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\232" \
- "\377\377\377\1\222\222\222\202::<\1;;=\202::<\3;;=FFH\362\362\364\251" \
- "\377\377\377\1\235\235\235\203::<\7;;=::<;;=;;;\331\331\331\377\377\377" \
- "\376\376\376\214\377\377\377\2\234\234\234;;=\205::<\1\316\316\316\202" \
- "\377\377\377\3\376\376\376\377\377\377\301\301\301\205::<\4;;=::<__a" \
- "\376\376\376\216\377\377\377\4\376\376\376yyy::<;;=\205::<\1\316\316" \
- "\320\204\377\377\377\2\316\316\31699;\203::<\3""99;::<\234\234\236\207" \
- "\377\377\377\2\376\377\377\376\376\374\202\377\376\377\3\254\332\362" \
- "Y\267\352[\267\350\210Y\270\350\7[\267\350Y\267\352\326\356\370\376\376" \
- "\377\377\376\377\377\375\377\376\377\377\231\377\377\377\10\377\377\375" \
- "\376\377\377\377\377\377\377\376\377\377\377\375\276\317\331\1>j\0>j" \
- "\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1" \
- "kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\220\377\377\377" \
- "\1\376\376\376\202\377\377\377\4\363\363\365;;=::<;;=\204::<\1\234\234" \
- "\234\231\377\377\377\1SSS\202::<\1;;=\203::<\1\265\265\267\223\377\377" \
- "\377\1kkm\206::<\1\316\316\316\300\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\346\346\350\203::<\4;;=::<;;=SSU\213\377\377\377\1\204\204" \
- "\204\203::<\1;;=\202::<\1\204\204\206\202\377\377\377\1\376\376\376\226" \
- "\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm" \
- "\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\227\377\377\377\1\376" \
- "\376\376\202\377\377\377\3TTV::<;;=\203::<\2;;=\205\205\205\252\377\377" \
- "\377\1\347\347\347\202::<\202;;=\203::<\1\235\235\237\204\377\377\377" \
- "\1\376\376\376\211\377\377\377\1\234\234\234\206::<\1\316\316\316\205" \
- "\377\377\377\1\205\205\205\202::<\6;;=::<;;=::<;;=\234\234\236\213\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\302\302\302\202;;=\203::<\3" \
- ";;=::<\221\221\221\202\377\377\377\1\376\376\376\202\377\377\377\1\316" \
- "\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350" \
- "\211[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317" \
- "\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316" \
- "\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\224" \
- "\377\377\377\4\204\204\204;;=::<;;=\203::<\1TTT\204\377\377\377\1\376" \
- "\376\376\223\377\377\377\1\300\300\300\203::<\5;;=::<;;=FFF\363\363\363" \
- "\223\377\377\377\1kkm\203::<\4;;=::<;;=\316\316\320\277\377\377\377\14" \
- "\376\376\376\377\377\377\376\376\376\377\377\377\204\204\206::<;;=::" \
- "<99;<<>99;\265\265\267\213\377\377\377\3\346\346\346::<;;=\202::<\1;" \
- ";=\202::<\2\347\347\347\376\376\376\227\377\377\377\1\234\234\234\206" \
- "::<\1\234\234\234\243\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206" \
- "::<\1\234\234\236\226\377\377\377\4\376\376\376\377\377\377\376\376\376" \
- "\346\346\350\202;;=\203::<\3""99;<<>\301\301\301\253\377\377\377\1aa" \
- "c\202::<\1;;=\202::<\2;;=jjl\205\377\377\377\1\376\376\376\210\377\377" \
- "\377\1\234\234\234\206::<\1\316\316\316\202\377\377\377\1\376\376\376" \
- "\202\377\377\377\3\362\362\362SSU;;=\205::<\2;;=\332\332\332\210\377" \
- "\377\377\1\376\376\376\203\377\377\377\2\363\363\363FFH\202::<\202;;" \
- "=\5::<;;=SSS\363\363\363\376\376\376\204\377\377\377\1\316\316\316\206" \
- "::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350" \
- "\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0=i\0" \
- ">i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::" \
- "<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\224\377\377" \
- "\377\1\332\332\332\207::<\1\301\301\301\227\377\377\377\1lll\204::<\3" \
- ";;=::<\221\221\221\202\377\377\377\3\376\376\376\377\377\377\376\376" \
- "\376\217\377\377\377\1kkm\204::<\3;;=99;\316\316\316\241\377\377\377" \
- "\1\376\376\376\234\377\377\377\10\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\363\363\363FFH;;=::<\202;;=\3::<FFH\364\364\364\214\377" \
- "\377\377\1xxz\204::<\3;;=::<\233\233\233\230\377\377\377\1\234\234\234" \
- "\206::<\1\234\234\234\243\377\377\377\1kkm\206::<\237\377\377\377\1k" \
- "km\206::<\1\234\234\236\224\377\377\377\1\376\376\376\204\377\377\377" \
- "\4\266\266\270;;=::<;;=\203::<\1""99;\254\377\377\377\3\234\234\234:" \
- ":<;;=\205::<\204\377\377\377\1\376\376\376\211\377\377\377\1\234\234" \
- "\234\206::<\1\316\316\316\203\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\316\316\320\204::<\4;;=99;::<__a\205\377\377\377\1\376\376\376\206" \
- "\377\377\377\4yy{;;=::<;;=\202::<\3;;=::<\316\316\316\206\377\377\377" \
- "\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270" \
- "\350\211[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276" \
- "\317\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316" \
- "\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236" \
- "\225\377\377\377\1__a\204;;=\5""99;::<yy{\377\377\377\376\376\376\216" \
- "\377\377\377\1\376\376\376\205\377\377\377\1\346\346\346\202::<\203;" \
- ";=\202::<\1\346\346\346\224\377\377\377\1kkm\205::<\2;;=\316\316\316" \
- "\235\377\377\377\1\376\376\376\244\377\377\377\1\234\234\234\202;;=\204" \
- "::<\2\235\235\235\376\376\376\212\377\377\377\4\376\376\376\377\377\377" \
- "\317\317\317::<\202;;=\202::<\3;;=GGI\362\362\362\202\377\377\377\1\376" \
- "\376\376\224\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377" \
- "\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\231\377\377" \
- "\377\1\220\220\222\205::<\3;;=kkm\376\376\376\253\377\377\377\3\316\316" \
- "\316<<>99;\202::<\4;;=::<;;=\331\331\331\215\377\377\377\1\234\234\234" \
- "\206::<\1\316\316\316\207\377\377\377\1\222\222\224\202::<\3;;=99;<<" \
- ">\202::<\4\234\234\236\376\376\376\377\377\377\376\376\376\203\377\377" \
- "\377\1\376\376\376\203\377\377\377\6\302\302\304;;=99;;;=::<;;=\202:" \
- ":<\1\234\234\234\202\377\377\377\1\376\376\376\204\377\377\377\1\316" \
- "\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350" \
- "\211[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317" \
- "\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316" \
- "\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\225" \
- "\377\377\377\2\265\265\265;;=\202::<\2""99;;;=\202::<\2\347\347\347\376" \
- "\376\376\215\377\377\377\3\376\376\376\377\377\377\376\376\376\204\377" \
- "\377\377\3\221\221\223;;=99;\204::<\3xxz\377\377\377\376\376\376\202" \
- "\377\377\377\202\376\376\376\217\377\377\377\1kkm\202::<\5;;=99;;;=9" \
- "9;\317\317\317\233\377\377\377\1\376\376\376\237\377\377\377\1\376\376" \
- "\376\204\377\377\377\3\376\376\376\377\377\377GGI\202::<\5;;=::<;;=:" \
- ":<\346\346\346\213\377\377\377\1\376\376\376\202\377\377\377\2``b99;" \
- "\202;;=\203::<\3\247\247\247\377\377\377\376\376\376\225\377\377\377" \
- "\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm\206::<\237\377" \
- "\377\377\1kkm\206::<\1\234\234\236\231\377\377\377\10kkm::<;;=::<;;=" \
- "99;::<\235\235\237\255\377\377\377\202::<\1;;=\204::<\1\301\301\301\215" \
- "\377\377\377\1\234\234\234\206::<\1\316\316\316\206\377\377\377\5\376" \
- "\376\376\364\364\364TTV::<99;\202;;=\203::<\4\332\332\334\376\376\376" \
- "\377\377\377\376\376\376\203\377\377\377\6\376\376\376\377\377\377\363" \
- "\363\363FFH::<;;=\204::<\1__a\210\377\377\377\1\316\316\316\206::<\1" \
- "\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350\3Y\270" \
- "\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0=i\0>i\210\0" \
- "=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240" \
- "\377\377\377\1\234\234\236\206::<\1\234\234\236\224\377\377\377\5\376" \
- "\376\376\377\377\377GGI::<;;=\203::<\4;;=\220\220\222\377\377\377\376" \
- "\376\376\214\377\377\377\1\376\376\376\203\377\377\377\10\376\376\376" \
- "\377\377\377\363\363\363FFH::<;;=99;;;=\202::<\1\316\316\320\202\377" \
- "\377\377\1\376\376\376\204\377\377\377\1\376\376\376\215\377\377\377" \
- "\1kkm\206::<\1\316\316\316\277\377\377\377\3\376\376\376\377\377\377" \
- "\265\265\267\204::<\3;;=::<\205\205\205\213\377\377\377\1\376\376\376" \
- "\202\377\377\377\2\376\376\376\265\265\265\202::<\5""99;<<>::<;;=SSU" \
- "\202\377\377\377\1\376\376\376\224\377\377\377\1\234\234\234\206::<\1" \
- "\234\234\234\243\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<" \
- "\1\234\234\236\230\377\377\377\2\376\376\376SSU\204::<\3;;=::<\266\266" \
- "\266\253\377\377\377\3\376\376\376\377\377\377^^`\206::<\1\234\234\234" \
- "\202\377\377\377\1\376\376\376\212\377\377\377\1\234\234\234\206::<\1" \
- "\316\316\316\205\377\377\377\6\376\376\376\377\377\377\376\376\376\315" \
- "\315\317::<;;=\202::<\4;;=99;::<``b\210\377\377\377\4xxz99;<<>::<\202" \
- ";;=\202::<\1\332\332\332\203\377\377\377\1\376\376\376\204\377\377\377" \
- "\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270" \
- "\350\211[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276" \
- "\317\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316" \
- "\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236" \
- "\226\377\377\377\1\234\234\234\206::<\2FFH\376\376\376\214\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377\3\265\265" \
- "\265;;=99;\202;;=\202::<\1SSU\202\377\377\377\1\376\376\376\223\377\377" \
- "\377\1kkm\203::<\4""99;::<;;=\316\316\320\275\377\377\377\202\376\376" \
- "\376\4\377\377\377\376\376\376SSU;;=\202::<\4;;=::<;;=\332\332\332\215" \
- "\377\377\377\5\376\376\376\377\377\377\376\376\376SSU;;=\204::<\2;;=" \
- "\264\264\264\226\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377" \
- "\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\231\377" \
- "\377\377\207::<\1\316\316\316\254\377\377\377\2\376\376\376lln\202::" \
- "<\1;;=\202::<\4;;=\233\233\233\377\377\377\376\376\376\202\377\377\377" \
- "\1\376\376\376\210\377\377\377\1\234\234\234\206::<\1\316\316\316\203" \
- "\377\377\377\202\376\376\376\204\377\377\377\1\234\234\234\207::<\1\234" \
- "\234\236\205\377\377\377\4\376\376\376\300\300\302::<;;=\205::<\2\234" \
- "\234\234\376\376\376\202\377\377\377\1\376\376\376\205\377\377\377\1" \
- "\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270" \
- "\350\211[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276" \
- "\317\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316" \
- "\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236" \
- "\226\377\377\377\1\347\347\347\204::<\5;;=99;;;=\265\265\265\376\376" \
- "\376\222\377\377\377\2___99;\202::<\4;;=::<;;=\265\265\265\207\377\377" \
- "\377\1\376\376\376\216\377\377\377\1kkm\203::<\1;;=\202::<\1;;=\233:" \
- ":<\5""99;;;=::<:::\234\234\234\240\377\377\377\2\316\316\316;;=\204:" \
- ":<\2;;=kkm\221\377\377\377\1\234\234\236\203::<\1;;=\202::<\3kkk\377" \
- "\377\377\376\376\376\224\377\377\377\1\234\234\234\206::<\1\234\234\234" \
- "\243\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236" \
- "\231\377\377\377\207::<\1\316\316\316\255\377\377\377\2\221\221\221;" \
- ";=\205::<\1\204\204\204\203\377\377\377\1\376\376\376\211\377\377\377" \
- "\1\234\234\234\206::<\1\316\316\316\210\377\377\377\3\376\376\376\377" \
- "\377\377``b\202::<\7;;=::<;;=::<;;=\332\332\332\376\376\376\202\377\377" \
- "\377\3\376\376\376\363\363\363GGI\203::<\4;;=::<;;=__a\206\377\377\377" \
- "\1\376\376\376\203\377\377\377\1\316\316\316\206::<\1\234\234\236\213" \
- "\377\377\377\2\255\333\363Y\270\350\211[\267\350\3Y\270\350[\267\350" \
- "\326\354\371\242\377\377\377\3\276\317\331\0=i\0>i\210\0=i\3\0>i\0=i" \
- "\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377" \
- "\1\234\234\236\206::<\1\234\234\236\227\377\377\377\1\204\204\206\204" \
- "::<\3;;=::<kkk\217\377\377\377\5\376\376\376\377\377\377\376\376\376" \
- "\333\333\333:::\202::<\1;;=\202::<\2FFH\363\363\363\226\377\377\377\1" \
- "kkm\204::<\1;;=\202::<\1;;=\234::<\4;;=::<\234\234\234\376\376\376\237" \
- "\377\377\377\1kkm\206::<\1\316\316\316\221\377\377\377\2\363\363\363" \
- "GGG\204::<\3;;=::<\315\315\315\225\377\377\377\1\234\234\234\206::<\1" \
- "\234\234\234\237\377\377\377\1\376\376\376\203\377\377\377\1kkm\206:" \
- ":<\237\377\377\377\1kkm\206::<\1\234\234\236\230\377\377\377\2\376\376" \
- "\376;;=\203::<\1;;=\202::<\1\363\363\363\252\377\377\377\6\376\376\376" \
- "\377\377\377\376\376\376\234\234\23699;;;=\204::<\1kkm\215\377\377\377" \
- "\1\234\234\234\206::<\1\316\316\316\210\377\377\377\7\377\377\375\377" \
- "\377\377\332\332\332::<;;=::<;;=\203::<\2``b\376\376\376\202\377\377" \
- "\377\2\376\376\376xxz\206::<\2:::\332\332\332\212\377\377\377\1\316\316" \
- "\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211" \
- "[\267\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317\331" \
- "\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316" \
- "\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\227\377" \
- "\377\377\1\315\315\315\205::<\3;;=::<\332\332\334\221\377\377\377\1\204" \
- "\204\206\205::<\2;;=\205\205\205\227\377\377\377\1kkm\203::<\3;;=::<" \
- ";;=\234::<\1:9>\203::<\1\234\234\236\237\377\377\377\1\331\331\331\202" \
- ";;=\204::<\1SSU\217\377\377\377\5\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\204\204\204\204::<\3;;=99;yyy\203\377\377\377\1\376\376" \
- "\376\221\377\377\377\1\234\234\234\206::<\1\234\234\234\235\377\377\377" \
- "\1\376\376\376\205\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206:" \
- ":<\1\234\234\236\231\377\377\377\203::<\1;;=\203::<\202\377\377\377\1" \
- "\376\376\376\253\377\377\377\2\233\233\235;;=\205::<\3kkm\377\377\377" \
- "\376\376\376\202\377\377\377\1\376\376\376\210\377\377\377\1\234\234" \
- "\234\206::<\1\316\316\316\213\377\377\377\1\234\234\236\202;;=\1""99" \
- ";\203::<\5;;=\235\235\235\377\377\377\376\376\376\302\302\302\207::<" \
- "\1\251\251\251\213\377\377\377\1\316\316\316\206::<\1\234\234\236\213" \
- "\377\377\377\2\255\333\363Y\270\350\211[\267\350\3Y\270\350[\267\350" \
- "\326\354\371\242\377\377\377\3\276\317\331\0=i\0>i\210\0=i\3\0>i\0=i" \
- "\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377" \
- "\1\234\234\236\206::<\1\234\234\236\223\377\377\377\1\376\376\376\204" \
- "\377\377\377\1^^`\202::<\202;;=\3::<<<>\204\204\206\213\377\377\377\1" \
- "\376\376\376\204\377\377\377\1\363\363\363\205::<\3;;=::<\346\346\346" \
- "\227\377\377\377\1kkm\204::<\3;;=::<;;=\234::<\1;;=\202::<\1\234\234" \
- "\236\237\377\377\377\4\204\204\20499;::<;;=\203::<\3\266\266\270\377" \
- "\377\377\376\376\376\221\377\377\377\5\346\346\346;;=::<;;=::<\202;;" \
- "=\4::<\346\346\350\377\377\377\376\376\376\202\377\377\377\1\376\376" \
- "\376\217\377\377\377\1\234\234\234\206::<\1\234\234\234\237\377\377\377" \
- "\202\376\376\376\202\377\377\377\1kkm\206::<\237\377\377\377\1kkm\206" \
- "::<\1\234\234\236\224\377\377\377\6\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\376\376\376;;=\206::<\1\331\331\331\255\377\377\377\1\234" \
- "\234\236\202::<\1;;=\203::<\2kkm\376\376\376\202\377\377\377\1\376\376" \
- "\376\211\377\377\377\1\234\234\234\206::<\1\316\316\316\212\377\377\377" \
- "\3\376\376\376\377\377\377___\204::<\7;;=99;::<\332\332\332\363\363\365" \
- "FFH;;=\204::<\3;;=kkm\376\376\376\213\377\377\377\1\316\316\316\206:" \
- ":<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350" \
- "\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0=i\0" \
- ">i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::" \
- "<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\224\377\377" \
- "\377\1\376\376\376\203\377\377\377\4\265\265\267::<;;=::<\202;;=\3::" \
- "<FFH\363\363\363\213\377\377\377\1\376\376\376\203\377\377\377\2\251" \
- "\251\251;;=\205::<\1lln\202\377\377\377\1\376\376\376\225\377\377\377" \
- "\1kkm\202::<\2;;=99;\204::<\1;;=\234::<\2;;=\234\234\234\235\377\377" \
- "\377\5\376\376\376\345\345\345;;=::<;;=\202::<\2;;=FFH\215\377\377\377" \
- "\3\376\376\376\377\377\377\376\376\376\205\377\377\377\10xxz;;=::<;;" \
- "=99;;;=::<\204\204\206\202\377\377\377\1\376\376\376\221\377\377\377" \
- "\1\234\234\234\206::<\1\234\234\234\234\377\377\377\1\376\376\376\204" \
- "\377\377\377\3\376\376\376\377\377\377kkm\206::<\237\377\377\377\1kk" \
- "m\206::<\1\234\234\236\231\377\377\377\202::<\1;;=\204::<\1\316\316\316" \
- "\253\377\377\377\3\376\376\376\377\377\377\220\220\222\202;;=\2::<;;" \
- "=\202::<\1\222\222\224\215\377\377\377\1\234\234\234\206::<\1\316\316" \
- "\316\213\377\377\377\3\376\376\376\332\332\332GGI\204::<\10;;=::<__a" \
- "xxz::<;;=::<;;=\202::<\2FFH\346\346\346\214\377\377\377\1\316\316\316" \
- "\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267" \
- "\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0" \
- "=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206" \
- "::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\231\377\377" \
- "\377\10FFH::<;;=99;;;=::<;;=\265\265\265\216\377\377\377\4\376\376\376" \
- "TTV99;;;=\202::<\202;;=\1\301\301\301\230\377\377\377\1kkm\202::<\1;" \
- ";=\204::<\3;;=::<;;=\232::<\5;;=::<\234\234\234\377\377\377\376\376\376" \
- "\232\377\377\377\3\376\376\376\377\377\377\221\221\221\202::<\1""99;" \
- "\203::<\5\234\234\236\377\377\377\376\376\376\377\377\377\376\376\376" \
- "\216\377\377\377\1\376\376\376\202\377\377\377\2\316\316\320::<\202;" \
- ";=\204::<\2\363\363\363\376\376\376\202\377\377\377\1\376\376\376\217" \
- "\377\377\377\1\234\234\234\206::<\1\234\234\234\243\377\377\377\1kkm" \
- "\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\224\377\377\377\1\376" \
- "\376\376\204\377\377\377\1""99;\202::<\1;;=\203::<\1\316\316\316\252" \
- "\377\377\377\10\376\376\376\377\377\377\376\376\376kkm;;=::<;;=99;\202" \
- "::<\1\234\234\236\215\377\377\377\1\234\234\234\206::<\1\316\316\316" \
- "\215\377\377\377\5\247\247\247;;=99;::<;;=\210::<\5""99;::<\250\250\252" \
- "\377\377\377\376\376\376\213\377\377\377\1\316\316\316\206::<\1\234\234" \
- "\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350\3Y\270\350[" \
- "\267\350\326\354\371\242\377\377\377\3\276\317\331\0=i\0>i\210\0=i\3" \
- "\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377" \
- "\377\377\1\234\234\236\206::<\1\234\234\236\223\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\203\377\377\377\1\234\234\236\202::<\1;" \
- ";=\202::<\2""99;SSU\214\377\377\377\5\376\376\376\377\377\377\301\301" \
- "\301;;=<<>\202::<\3;;=::<SSU\202\377\377\377\1\376\376\376\226\377\377" \
- "\377\1kkm\203::<\1;;=\202::<\1\204\204\206\202\234\234\234\1\235\235" \
- "\235\232\234\234\236\202\234\234\234\1\315\315\315\233\377\377\377\6" \
- "\376\376\376\377\377\377\362\362\362HHJ99;;;=\204::<\2\364\364\364\376" \
- "\376\376\220\377\377\377\1\376\376\376\204\377\377\377\1kkm\206::<\1" \
- "\234\234\234\223\377\377\377\1\234\234\234\206::<\1\234\234\234\242\377" \
- "\377\377\2\376\376\376lln\206::<\237\377\377\377\1kkm\206::<\1\234\234" \
- "\236\231\377\377\377\2TTV99;\202::<\5;;=::<;;=\250\250\250\376\376\376" \
- "\254\377\377\377\1``b\203::<\202;;=\3::<\235\235\237\376\376\376\202" \
- "\377\377\377\1\376\376\376\211\377\377\377\1\234\234\234\206::<\1\316" \
- "\316\316\216\377\377\377\2kkm;;=\203::<\5;;=::<;;=99;;;=\202::<\2;;=" \
- "jjl\216\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377" \
- "\2\255\333\363Y\270\350\211[\267\350\3Y\270\350[\267\350\326\354\371" \
- "\242\377\377\377\3\276\317\331\0=i\0>i\210\0=i\3\0>i\0=i\177\236\263" \
- "\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234" \
- "\236\206::<\1\234\234\236\224\377\377\377\1\376\376\376\204\377\377\377" \
- "\2\346\346\34699;\202::<\2;;=::<\202;;=\1\315\315\315\212\377\377\377" \
- "\1\376\376\376\202\377\377\377\1yy{\203::<\4;;=99;;;=\250\250\250\202" \
- "\377\377\377\1\376\376\376\226\377\377\377\1kkm\206::<\1\317\317\317" \
- "\240\377\377\377\1\376\376\376\234\377\377\377\1\234\234\234\202::<\2" \
- "99;;;=\202::<\1\204\204\206\203\377\377\377\1\376\376\376\220\377\377" \
- "\377\1\376\376\376\202\377\377\377\2\264\264\264::<\202;;=\203::<\3G" \
- "GI\364\364\364\376\376\376\202\377\377\377\1\376\376\376\216\377\377" \
- "\377\1\234\234\234\206::<\1\234\234\234\241\377\377\377\3\376\376\376" \
- "\377\377\377kkm\206::<\237\377\377\377\1kkm\206::<\1\234\234\236\225" \
- "\377\377\377\202\376\376\376\202\377\377\377\12kkm::<;;=99;::<;;=::<" \
- "\204\204\204\377\377\377\376\376\376\251\377\377\377\4\376\376\376\377" \
- "\377\377::<99;\202;;=\203::<\1\316\316\320\215\377\377\377\1\234\234" \
- "\234\206::<\1\316\316\316\216\377\377\377\5\346\346\350GGI;;=::<;;=\202" \
- "::<\2""99;;;=\202::<\3;;=GGI\346\346\350\216\377\377\377\1\316\316\316" \
- "\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267" \
- "\350\3Y\270\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0" \
- "=i\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206" \
- "::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\231\377\377" \
- "\377\2\376\376\376\205\205\205\202::<\5""99;;;=::<;;=\205\205\207\213" \
- "\377\377\377\12\376\376\376\346\346\346::<;;=99;::<99;;;=FFH\363\363" \
- "\363\231\377\377\377\1kkm\202::<\2;;=::<\202;;=\3\316\316\316\377\377" \
- "\377\376\376\376\234\377\377\377\1\376\376\376\236\377\377\377\1SSS\204" \
- "::<\3;;=99;\347\347\351\204\377\377\377\1\376\376\376\215\377\377\377" \
- "\1\376\376\376\205\377\377\377\1SSU\203::<\4;;=99;::<\265\265\265\202" \
- "\377\377\377\1\376\376\376\217\377\377\377\1\234\234\234\206::<\1\234" \
- "\234\234\242\377\377\377\2\376\376\376SSU\206::<\237\377\377\377\1kk" \
- "m\206::<\1\234\234\236\231\377\377\377\4\221\221\223;;=::<;;=\202::<" \
- "\3;;=___\376\376\376\253\377\377\377\1\332\332\332\204::<\1;;=\202::" \
- "<\1\346\346\350\203\377\377\377\1\376\376\376\211\377\377\377\1\234\234" \
- "\234\206::<\1\316\316\316\217\377\377\377\1\250\250\252\204::<\202;;" \
- "=\2::<;;=\202::<\1\265\265\267\217\377\377\377\1\316\316\316\206::<\1" \
- "\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350\3Y\270" \
- "\350[\267\350\326\354\371\242\377\377\377\3\276\317\331\0=i\0>i\210\0" \
- "=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240" \
- "\377\377\377\1\234\234\236\206::<\1\234\234\236\232\377\377\377\1\316" \
- "\316\316\203::<\2""99;<<>\202::<\1\346\346\350\213\377\377\377\4\221" \
- "\221\223;;=::<;;=\203::<\1\204\204\206\232\377\377\377\1kkm\203::<\1" \
- ";;=\202::<\1\316\316\316\274\377\377\377\2\265\265\267;;=\205::<\1xx" \
- "x\231\377\377\377\1\250\250\250\206::<\1TTV\222\377\377\377\1\234\234" \
- "\234\204::<\3;;=::<\235\235\235\203\377\377\377\1\376\376\376\237\377" \
- "\377\377\202;;=\203::<\3;;=::<\376\376\376\236\377\377\377\1kkm\206:" \
- ":<\1\234\234\236\225\377\377\377\1\376\376\376\203\377\377\377\1\265" \
- "\265\267\204::<\1;;=\202::<\1\363\363\363\253\377\377\377\1\250\250\250" \
- "\204::<\3;;=::<GGI\216\377\377\377\1\234\234\234\206::<\1\316\316\316" \
- "\220\377\377\377\4kkm;;=::<;;=\204::<\3;;=xxx\376\376\376\217\377\377" \
- "\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363" \
- "Y\270\350\212[\267\350\2X\266\351\326\356\370\202\377\377\377\3\377\377" \
- "\375\377\377\377\376\377\375\234\377\377\377\4\377\377\375\276\317\327" \
- "\0\77j\1>j\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316" \
- "\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\233\377" \
- "\377\377\1``b\205::<\2;;=\235\235\237\210\377\377\377\1\376\376\376\202" \
- "\377\377\377\2FFH;;=\205::<\1\346\346\346\202\377\377\377\1\376\376\376" \
- "\227\377\377\377\1kkm\206::<\1\316\316\316\266\377\377\377\1\376\376" \
- "\376\205\377\377\377\5__a::<;;=::<;;=\202::<\1SSU\202kkm\1lln\203kkm" \
- "\1lln\222kkm\4__a;;=99;;;=\204::<\3\301\301\301\377\377\377\376\376\376" \
- "\215\377\377\377\202\376\376\376\1\235\235\235\204::<\3""99;;;=\221\221" \
- "\221\243\377\377\377\203::<\1;;=\202::<\1""99;\237\377\377\377\1kkm\206" \
- "::<\1\234\234\236\231\377\377\377\1\332\332\332\202::<\3;;=::<99;\202" \
- ";;=\1\264\264\264\210\377\377\377\1\376\376\376\232\377\377\377\1\376" \
- "\376\376\206\377\377\377\2\376\376\376xxx\202::<\1;;=\203::<\1xxz\216" \
- "\377\377\377\1\234\234\234\206::<\1\316\316\316\220\377\377\377\3\363" \
- "\363\365FFH;;=\202::<\1;;=\202::<\2FFH\363\363\363\220\377\377\377\1" \
- "\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270" \
- "\350\211[\267\350\10X\267\347Y\267\352\326\354\371\377\377\377\376\376" \
- "\376\377\376\377\377\377\377\377\376\377\234\377\377\377\2\376\376\374" \
- "\277\320\330\212\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316" \
- "\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\233" \
- "\377\377\377\1\265\265\267\203::<\4""99;;;=::<SSU\207\377\377\377\6\376" \
- "\376\376\377\377\377\376\376\376\265\265\265;;=99;\202;;=\4""99;;;=k" \
- "km\377\377\377\202\376\376\376\230\377\377\377\1kkm\206::<\1\316\316" \
- "\316\267\377\377\377\1\376\376\376\203\377\377\377\7\316\316\320<<>9" \
- "9;::<;;=::<99;\203::<\2;;=99;\202::<\1;;=\224::<\1;;=\202::<\1;;=\203" \
- "::<\1kkm\203\377\377\377\1\376\376\376\215\377\377\377\1\300\300\300" \
- "\202::<\11;;=::<99;;;=jjl\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\236\377\377\377\1\346\346\350\206::<\1__a\237\377\377\377\1kkm\206" \
- "::<\1\234\234\236\231\377\377\377\2\376\376\376SSU\206::<\2yy{\376\376" \
- "\376\206\377\377\377\1\376\376\376\234\377\377\377\1\376\376\376\205" \
- "\377\377\377\4\363\363\363::<<<>99;\202::<\3;;=::<\265\265\267\203\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\210\377\377\377\1\234" \
- "\234\234\206::<\1\316\316\316\221\377\377\377\4\301\301\30199;::<;;=" \
- "\202::<\6;;=\301\301\301\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\215\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377" \
- "\2\255\333\363Y\270\350\211[\267\350\6Y\270\350Y\267\352\325\353\370" \
- "\377\377\377\376\377\375\377\375\377\234\377\377\377\5\376\376\376\377" \
- "\377\377\377\377\375\276\317\327\2\77k\211\0=i\3\0>i\0=i\177\236\263" \
- "\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234" \
- "\236\206::<\1\234\234\236\234\377\377\377\1GGI\203::<\1;;=\202::<\2\301" \
- "\301\301\376\376\376\204\377\377\377\1\376\376\376\203\377\377\377\3" \
- "lln::<;;=\202::<\202;;=\4\301\301\303\376\376\376\377\377\377\376\376" \
- "\376\230\377\377\377\1kkm\206::<\1\316\316\316\265\377\377\377\1\376" \
- "\376\376\205\377\377\377\3kkm::<;;=\202::<\2""99;<<>\202::<\3;;=::<;" \
- ";=\202::<\1;;=\222::<\4""99;;;=::<;;=\203::<\1;;=\202::<\3\316\316\316" \
- "\377\377\377\376\376\376\215\377\377\377\3\376\376\376\316\316\316;;" \
- "=\203::<\3;;=::<FFH\234\377\377\377\202\376\376\376\202\377\377\377\3" \
- "\376\376\376\377\377\377\316\316\320\203::<\4;;=::<;;=kkm\237\377\377" \
- "\377\1kkm\206::<\1\234\234\236\226\377\377\377\7\376\376\376\377\377" \
- "\377\376\376\376\377\377\377\204\204\204::<;;=\204::<\2;;=\346\346\346" \
- "\241\377\377\377\1\376\376\376\202\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\202\377\377\377\1\250\250\250\202::<\1<<>\204::<\3\346" \
- "\346\346\377\377\377\376\376\376\202\377\377\377\1\376\376\376\211\377" \
- "\377\377\1\234\234\234\206::<\1\316\316\316\220\377\377\377\14\376\376" \
- "\376\377\377\377yy{::<99;;;=::<xxz\377\377\377\376\376\376\377\377\377" \
- "\376\376\376\203\377\377\377\1\376\376\376\212\377\377\377\1\316\316" \
- "\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211" \
- "[\267\350\10X\267\347Z\266\351\326\356\370\376\377\377\377\377\375\377" \
- "\377\377\377\376\377\376\377\377\234\377\377\377\4\376\376\374\277\320" \
- "\330\0=i\1>j\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316" \
- "\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\234" \
- "\377\377\377\1\234\234\234\206::<\3jjj\377\377\377\376\376\376\204\377" \
- "\377\377\4\376\376\376\377\377\377\332\332\33299;\203::<\3;;=::<SSU\202" \
- "\377\377\377\1\376\376\376\231\377\377\377\1kkm\206::<\1\316\316\316" \
- "\267\377\377\377\5\376\376\376\377\377\377\376\376\376\346\346\350;;" \
- "=\203::<\1;;=\202::<\202;;=\202::<\3""99;::<;;=\222::<\202;;=\3""99;" \
- "::<;;=\202::<\1;;=\203::<\2\204\204\206\376\376\376\217\377\377\377\1" \
- "\363\363\363\203::<\6;;=::<;;=::<\347\347\347\376\376\376\234\377\377" \
- "\377\202\376\376\376\5\377\377\377\376\376\376\234\234\236::<;;=\202" \
- "::<\3;;=::<\234\234\236\237\377\377\377\1kkm\206::<\1\234\234\236\231" \
- "\377\377\377\5\376\376\376\316\316\316;;=99;;;=\204::<\1\222\222\224" \
- "\204\377\377\377\1\376\376\376\235\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\203\377\377\377\5SSU;;=::<99;;;=\202::<\3kkk\377" \
- "\377\377\376\376\376\203\377\377\377\1\376\376\376\211\377\377\377\1" \
- "\234\234\234\206::<\1\316\316\316\222\377\377\377\6\363\363\363GGI::" \
- "<;;=FFH\363\363\363\205\377\377\377\1\376\376\376\214\377\377\377\1\316" \
- "\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350" \
- "\212[\267\350\3Y\267\352\330\354\363\376\377\377\203\377\377\377\1\377" \
- "\377\375\235\377\377\377\3\276\317\331\0=i\1>j\210\0=i\3\0>i\0=i\177" \
- "\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1" \
- "\234\234\236\206::<\1\234\234\236\233\377\377\377\2\376\376\376\347\347" \
- "\347\202::<\2;;=::<\203;;=\1\346\346\346\207\377\377\377\5\204\204\204" \
- "<<>99;::<;;=\202::<\2\251\251\251\376\376\376\205\377\377\377\1\376\376" \
- "\376\225\377\377\377\1kkm\206::<\1\316\316\316\264\377\377\377\1\376" \
- "\376\376\205\377\377\377\3\204\204\206::<;;=\203::<\1;;=\205::<\1;;=" \
- "\225::<\3;;=::<;;=\202::<\1;;=\202::<\1;;=\202::<\1\347\347\347\220\377" \
- "\377\377\2SSU;;=\203::<\3;;=::<\265\265\265\237\377\377\377\7\376\376" \
- "\376\377\377\377lln99;::<;;=99;\202::<\1\265\265\267\237\377\377\377" \
- "\1kkm\206::<\1\234\234\236\225\377\377\377\1\376\376\376\204\377\377" \
- "\377\3\376\376\376SSU;;=\204::<\3;;=FFH\346\346\346\202\377\377\377\1" \
- "\376\376\376\237\377\377\377\1\376\376\376\204\377\377\377\2\265\265" \
- "\267;;=\202::<\1;;=\203::<\1\265\265\265\217\377\377\377\1\234\234\234" \
- "\206::<\1\316\316\316\223\377\377\377\4\301\301\301::<:::\302\302\302" \
- "\223\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2" \
- "\255\333\363Y\270\350\212[\267\350\2Y\270\350\332\354\370\202\377\377" \
- "\377\3\376\376\376\376\377\377\377\376\373\235\377\377\377\1\276\317" \
- "\331\202\0>i\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316" \
- "\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236\235" \
- "\377\377\377\1\204\204\204\206::<\1\221\221\223\206\377\377\377\2\363" \
- "\363\363GGI\202::<\5""99;;;=::<GGI\363\363\363\204\377\377\377\202\376" \
- "\376\376\226\377\377\377\1kkm\206::<\1\316\316\316\266\377\377\377\1" \
- "\376\376\376\202\377\377\377\3\346\346\350::<;;=\204::<\5""99;;;=:::" \
- "99;;;=\203::<\3;;=99;;;=\220::<\5;;=::<;;=::<;;=\202::<\6;;=::<99;;;" \
- "=::<\204\204\206\220\377\377\377\5yy{99;::<99;;;=\202::<\1xxz\236\377" \
- "\377\377\10\376\376\376\377\377\377\363\363\36399;::<;;=99;;;=\202::" \
- "<\2\346\346\350\376\376\376\236\377\377\377\1kkm\206::<\1\234\234\236" \
- "\231\377\377\377\3\376\376\376\377\377\377\233\233\235\202::<\7;;=::" \
- "<;;=99;;;=\204\204\204\376\376\376\245\377\377\377\2\363\363\363SSU\205" \
- "::<\2;;=FFH\205\377\377\377\3\376\376\376\377\377\377\376\376\376\210" \
- "\377\377\377\1\234\234\234\206::<\1\316\316\316\224\377\377\377\3\205" \
- "\205\205\221\221\221\376\376\376\204\377\377\377\202\376\376\376\215" \
- "\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255" \
- "\333\363Y\270\350\212[\267\350\7Y\270\350\321\356\376\377\376\377\377" \
- "\377\377\377\377\375\376\377\375\377\376\377\232\377\377\377\1\377\377" \
- "\375\202\377\377\377\3\275\317\333\0\77k\0>i\210\0=i\3\0>i\0=i\177\236" \
- "\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234" \
- "\234\236\206::<\1\234\234\236\235\377\377\377\1\316\316\316\206::<\1" \
- "FFH\203\377\377\377\1\376\376\376\202\377\377\377\1\250\250\250\203:" \
- ":<\1;;=\202::<\1\204\204\206\203\377\377\377\1\376\376\376\231\377\377" \
- "\377\1kkm\206::<\1\316\316\316\271\377\377\377\1\234\234\236\204::<\4" \
- ";;=::<kkm\234\234\236\202\234\234\234\1\233\233\233\202\234\234\234\3" \
- "\235\235\235\234\234\234\235\235\235\224\234\234\234\202\234\234\236" \
- "\1\204\204\206\206::<\2FFH\363\363\363\217\377\377\377\2\250\250\252" \
- ";;=\206::<\1\364\364\364\237\377\377\377\2\265\265\265;;=\205::<\1TT" \
- "V\240\377\377\377\1kkm\206::<\1\234\234\236\224\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\204\377\377\377\3\364\364\366FFH;;=\203" \
- "::<\4;;=::<:::\316\316\316\245\377\377\377\1\221\221\221\202::<\2;;=" \
- "::<\202;;=\2::<\234\234\236\220\377\377\377\1\234\234\234\206::<\1\316" \
- "\316\316\224\377\377\377\1\376\376\376\225\377\377\377\1\316\316\316" \
- "\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\212[\267" \
- "\350\4[\267\346\265\340\361\377\376\377\376\376\377\202\377\377\375\1" \
- "\374\377\377\230\377\377\377\3\376\376\376\377\377\377\377\377\375\202" \
- "\377\377\377\3\243\265\301\0>j\0>i\210\0=i\3\0>i\0=i\177\236\263\232" \
- "\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236" \
- "\206::<\1\234\234\236\236\377\377\377\2__a;;=\204::<\5;;=\265\265\265" \
- "\376\376\376\377\377\377\376\376\376\202\377\377\377\1SSU\204::<\3;;" \
- "=::<\346\346\350\235\377\377\377\1kkm\206::<\1\316\316\316\270\377\377" \
- "\377\2\363\363\365GGI\205::<\3;;=\333\333\333\376\376\376\237\377\377" \
- "\377\10FFH::<;;=::<;;=99;;;=\233\233\235\217\377\377\377\5\346\346\346" \
- "::<;;=::<;;=\203::<\1\234\234\234\210\377\377\377\1\376\376\376\217\377" \
- "\377\377\1\376\376\376\206\377\377\377\1TTT\205::<\3;;=\221\221\221\376" \
- "\376\376\237\377\377\377\1kkm\206::<\1\234\234\236\234\377\377\377\12" \
- "\233\233\233::<;;=::<;;=::<;;=::<SSU\363\363\363\212\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\221\377\377\377\1\376\376\376\204\377" \
- "\377\377\1\315\315\317\203::<\1;;=\203::<\2FFH\363\363\365\220\377\377" \
- "\377\1\234\234\234\206::<\1\316\316\316\252\377\377\377\1\316\316\316" \
- "\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267" \
- "\350\6Y\270\350[\267\346\227\324\363\377\375\376\377\377\377\376\377" \
- "\375\213\377\377\377\6\376\376\376\377\377\377\373\377\376\377\377\377" \
- "\377\376\377\376\377\377\211\377\377\377\10\377\376\377\374\377\377\377" \
- "\377\375\377\377\377\377\376\377_\207\240\0>l\0\77j\210\0=i\3\0>i\0=" \
- "i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377" \
- "\1\234\234\236\206::<\1\234\234\236\236\377\377\377\1\265\265\265\204" \
- "::<\3;;=::<__a\204\377\377\377\1\317\317\321\206::<\1kkk\236\377\377" \
- "\377\1kkm\206::<\1\316\316\316\267\377\377\377\3\376\376\376\250\250" \
- "\25299;\202;;=\203::<\1kkm\233\377\377\377\1\376\376\376\205\377\377" \
- "\377\10\234\234\236;;=::<;;=::<;;=99;GGI\204\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\210\377\377\377\5\376\376\376__a::<;;=99;\203" \
- ";;=\2FFH\363\363\363\204\377\377\377\3\376\376\376\377\377\377\376\376" \
- "\376\224\377\377\377\5\376\376\376\377\377\377\301\301\301:::;;=\202" \
- "::<\202;;=\4::<\332\332\332\377\377\377\376\376\376\236\377\377\377\1" \
- "kkm\206::<\1\234\234\236\233\377\377\377\3\376\376\376\364\364\364FF" \
- "H\205::<\4;;=99;xxx\376\376\376\203\377\377\377\1\376\376\376\203\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\224\377\377\377" \
- "\4\376\376\376\377\377\377\362\362\362GGI\202::<\6;;=::<;;=::<99;\250" \
- "\250\252\221\377\377\377\1\234\234\234\206::<\1\316\316\316\252\377\377" \
- "\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363" \
- "Y\270\350\211[\267\350\7Y\267\352X\267\347[\266\353\301\344\367\377\377" \
- "\377\376\376\376\376\377\377\211\377\377\377\6\377\376\377\377\377\377" \
- "\377\375\376\377\377\377\377\377\375\377\376\377\202\377\377\377\210" \
- "\377\376\377\10\377\377\375\376\377\377\377\377\377\376\377\375\237\266" \
- "\306\0=i\2=g\0>e\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316" \
- "\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234\236" \
- "\237\377\377\377\1EEG\202::<\202;;=\11""99;;;=\332\332\332\377\377\377" \
- "\376\376\376\377\377\377xxz::<;;=\204::<\1\302\302\302\236\377\377\377" \
- "\1kkm\206::<\1\316\316\316\266\377\377\377\4\376\376\376\377\377\377" \
- "SSU;;=\202::<\1;;=\202::<\1\316\316\320\235\377\377\377\15\376\376\376" \
- "\377\377\377\376\376\376\377\377\377\363\363\365::<;;=99;;;=::<;;=::" \
- "<\265\265\265\215\377\377\377\3\376\376\376\377\377\377\266\266\270\202" \
- "::<\1;;=\203::<\2;;=\204\204\206\205\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\213\377\377\377\1\376\376\376\205\377\377\377\1\376" \
- "\376\376\202\377\377\377\2\363\363\363SSU\203::<\4;;=99;;;=SSU\241\377" \
- "\377\377\1kkm\206::<\1\234\234\236\235\377\377\377\3\265\265\265;;=9" \
- "9;\202::<\1;;=\203::<\1\204\204\206\206\377\377\377\1\376\376\376\216" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\206\377\377\377\6" \
- "\376\376\376\377\377\377\362\362\364``b::<;;=\202::<\1;;=\202::<\2aa" \
- "c\376\376\376\221\377\377\377\1\234\234\234\206::<\1\316\316\316\252" \
- "\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255" \
- "\333\363Y\270\350\211[\267\350\10X\267\347[\267\346[\265\347[\267\346" \
- "\230\320\361\327\360\367\325\356\365\331\355\370\210\326\354\371\10\325" \
- "\355\367\323\355\372\366\373\377\377\376\374\376\377\375\276\320\332" \
- "\277\320\330\301\317\330\210\276\317\331\10\276\317\327\276\320\334\301" \
- "\316\327_\207\241\0>i\0=l\0\77k\0>i\210\0=i\3\0>i\0=i\177\236\263\232" \
- "\377\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236" \
- "\206::<\1\234\234\236\237\377\377\377\3\222\222\224::<;;=\202::<\3;;" \
- "=99;\205\205\207\202\377\377\377\2\346\346\346;;=\202::<\1;;=\202::<" \
- "\1SSU\237\377\377\377\1kkm\206::<\1\316\316\316\267\377\377\377\5\265" \
- "\265\26799;;;=::<;;=\202::<\1TTV\243\377\377\377\1\204\204\206\205::" \
- "<\2;;=SSU\206\377\377\377\1\376\376\376\210\377\377\377\3\376\376\376" \
- "GGI;;=\202::<\5;;=::<;;=::<\301\301\303\203\377\377\377\1\376\376\376" \
- "\214\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\204\377\377\377\3\204\204\206;;=::<\202;;=\203" \
- "::<\1\265\265\265\241\377\377\377\1kkm\206::<\1\234\234\236\236\377\377" \
- "\377\12kkk::<99;;;=::<99;;;=::<;;=\204\204\206\210\377\377\377\202\376" \
- "\376\376\213\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\376\376\376\202\377\377\377\2\364\364\366__a\206:" \
- ":<\3;;=::<\332\332\332\222\377\377\377\1\234\234\234\206::<\1\316\316" \
- "\316\252\377\377\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377" \
- "\2\255\333\363Y\270\350\211[\267\350\3\\\266\350X\270\352\\\266\352\202" \
- "[\267\350\3X\267\347Y\270\350Z\266\347\210Y\270\350\10[\267\350[\265" \
- "\351\327\355\372\376\377\377\377\377\375\0>j\0>i\1\77h\210\0>i\10\0\77" \
- "k\0>g\2=g\0=i\0\77j\0<h\0\77h\1>j\210\0=i\3\0>i\0=i\177\236\263\232\377" \
- "\377\377\1\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206" \
- "::<\1\234\234\236\236\377\377\377\2\376\376\376\346\346\346\202::<\10" \
- ";;=::<99;;;=::<\363\363\363\377\377\377\234\234\236\202::<\6;;=::<;;" \
- "=::<\250\250\250\376\376\376\236\377\377\377\1kkm\206::<\1\316\316\316" \
- "\267\377\377\377\10kkm;;=::<;;=99;::<;;=\264\264\266\236\377\377\377" \
- "\1\376\376\376\204\377\377\377\2\346\346\346;;=\202::<\202;;=\202::<" \
- "\2\316\316\320\376\376\376\203\377\377\377\1\376\376\376\205\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377\3\234\234" \
- "\234::<;;=\202::<\6;;=::<;;=GGI\332\332\332\376\376\376\224\377\377\377" \
- "\1\376\376\376\203\377\377\377\2\266\266\266;;=\202::<\6;;=::<;;=::<" \
- "SSU\376\376\376\241\377\377\377\1kkm\206::<\1\234\234\236\236\377\377" \
- "\377\2\363\363\363GGI\203::<\1;;=\203::<\3""99;\204\204\204\363\363\363" \
- "\225\377\377\377\1\376\376\376\204\377\377\377\4\376\376\376\346\346" \
- "\346``b::<\202;;=\3::<99;<<>\202::<\1\250\250\250\223\377\377\377\1\234" \
- "\234\234\206::<\1\316\316\316\252\377\377\377\1\316\316\316\206::<\1" \
- "\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350\10Y" \
- "\270\350X\270\353Y\267\352X\266\351X\271\346[\267\350\\\266\353[\267" \
- "\350\210Y\270\350\7X\267\345]\267\351\323\355\372\377\376\377\376\377" \
- "\377\4=h\0>g\211\0=i\10\2=i\0@j\0>i\1>j\0>i\1\77h\0>g\0>j\210\0=i\3\0" \
- ">i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377" \
- "\377\377\1\234\234\236\206::<\1\234\234\236\237\377\377\377\6\376\376" \
- "\376yy{::<;;=::<;;=\202::<\4\251\251\251\376\376\376SSU;;=\203::<\3;" \
- ";=FFH\363\363\363\237\377\377\377\1kkm\206::<\1\316\316\316\264\377\377" \
- "\377\5\376\376\376\377\377\377\315\315\317::<;;=\204::<\2FFH\376\376" \
- "\376\237\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376kkm;" \
- ";=\204::<\6""99;lln\377\377\377\376\376\376\377\377\377\376\376\376\202" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\205\377\377\377\10" \
- "\376\376\376\377\377\377SSU::<99;;;=99;;;=\202::<\2FFF\332\332\332\203" \
- "\377\377\377\1\376\376\376\212\377\377\377\1\376\376\376\210\377\377" \
- "\377\1\265\265\265\206::<\3""99;::<\265\265\265\203\377\377\377\1\376" \
- "\376\376\236\377\377\377\1kkm\206::<\1\234\234\236\233\377\377\377\1" \
- "\376\376\376\203\377\377\377\1\331\331\331\204::<\3""99;;;=99;\202;;" \
- "=\2^^^\332\332\332\202\377\377\377\1\376\376\376\216\377\377\377\1\376" \
- "\376\376\206\377\377\377\5\376\376\376\316\316\316FFH::<;;=\204::<\7" \
- "99;::<\204\204\204\377\377\377\376\376\376\377\377\377\376\376\376\220" \
- "\377\377\377\1\234\234\234\206::<\1\316\316\316\252\377\377\377\1\316" \
- "\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363Y\270\350" \
- "\213[\267\350\6Y\270\350[\266\353[\267\350]\267\351X\266\351X\270\350" \
- "\210[\267\350\10X\266\351Z\266\351\326\354\367\377\376\377\376\377\372" \
- "\0>j\0>i\1>j\210\0=i\10\1\77h\0=h\0>i\1\77h\0>j\0=i\0>i\1>j\210\0=i\3" \
- "\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm\240\377" \
- "\377\377\1\234\234\236\206::<\1\234\234\236\237\377\377\377\2\376\376" \
- "\376\316\316\316\203::<\1;;=\202::<\4SSU\265\265\267;;=99;\202::<\5;" \
- ";=99;\204\204\204\377\377\377\376\376\376\236\377\377\377\1kkm\206::" \
- "<\1\316\316\316\263\377\377\377\1\376\376\376\202\377\377\377\1xxz\202" \
- "::<\1;;=\202::<\3""99;\234\234\236\376\376\376\236\377\377\377\1\375" \
- "\375\375\202\377\377\377\1\376\376\376\202\377\377\377\5\317\317\317" \
- "99;::<;;=::<\202;;=\2::<\332\332\332\210\377\377\377\3\376\376\376\377" \
- "\377\377\376\376\376\204\377\377\377\2\316\316\316;;=\206::<\3;;=::<" \
- "\250\250\252\217\377\377\377\1\376\376\376\204\377\377\377\2\363\363" \
- "\363\222\222\224\202::<\2;;=::<\202;;=\3""99;;;=kkm\205\377\377\377\1" \
- "\376\376\376\235\377\377\377\1kkm\206::<\1\234\234\236\235\377\377\377" \
- "\1\376\376\376\202\377\377\377\2\266\266\26699;\202::<\3;;=::<;;=\202" \
- "::<\3;;=FFH\234\234\234\202\377\377\377\1\376\376\376\223\377\377\377" \
- "\2\364\364\364\204\204\206\202::<\1;;=\202::<\1;;=\202::<\3""99;``b\376" \
- "\376\376\224\377\377\377\1\234\234\234\206::<\1\316\316\316\252\377\377" \
- "\377\1\316\316\316\206::<\1\234\234\236\213\377\377\377\2\255\333\363" \
- "Y\270\350\211[\267\350\10Y\271\353Z\266\347\\\267\344[\267\346X\267\347" \
- "[\267\350X\270\353Z\266\347\210Y\270\350\10Y\267\352\\\267\346\325\355" \
- "\371\377\377\377\376\377\377\0>g\0\77k\0>i\210\0\77j\10\0>i\3>h\0=i\0" \
- "\77i\0=j\0>g\0=j\0=f\210\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1" \
- "\316\316\316\206::<\1kkm\240\377\377\377\1\234\234\236\206::<\1\234\234" \
- "\236\234\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377" \
- "\377\2SSU;;=\202::<\202;;=\3::<SSU::<\202;;=\203::<\1\332\332\332\240" \
- "\377\377\377\1kkm\206::<\1\316\316\316\265\377\377\377\1\346\346\346" \
- "\203::<\1;;=\202::<\2;;=\363\363\365\235\377\377\377\1\376\376\376\210" \
- "\377\377\377\1SSU\202;;=\204::<\1\204\204\204\202\377\377\377\202\376" \
- "\376\376\214\377\377\377\1\221\221\221\205::<\202;;=\4::<;;=kkm\316\316" \
- "\316\221\377\377\377\2\301\301\301SSS\210::<\2FFH\363\363\365\243\377" \
- "\377\377\1kkm\206::<\1\234\234\236\241\377\377\377\1\266\266\270\203" \
- "::<\1;;=\205::<\3:::RRR\265\265\265\222\377\377\377\3\363\363\363\234" \
- "\234\234FFF\202::<\1;;=\206::<\2``b\363\363\363\225\377\377\377\1\234" \
- "\234\234\206::<\1\316\316\316\252\377\377\377\1\316\316\316\206::<\1" \
- "\234\234\236\213\377\377\377\2\255\333\363Y\270\350\211[\267\350\10Z" \
- "\266\347[\267\346Z\265\352X\266\351\\\270\351[\267\346X\267\347[\265" \
- "\347\210[\267\350\10Y\267\352[\266\345\325\355\367\376\375\377\377\377" \
- "\375\3>j\0=i\1>j\210\0>i\10\0\77j\1\77h\0>j\0>g\3>j\0\77i\0=j\0>i\210" \
- "\0=i\3\0>i\0=i\177\236\263\232\377\377\377\1\316\316\316\206::<\1kkm" \
- "\240\377\377\377\1\234\234\236\206::<\1\234\234\236\241\377\377\377\6" \
- "\266\266\270::<;;=::<99;::<\202;;=\205::<\2kkm\376\376\376\240\377\377" \
- "\377\1kkm\206::<\1\316\316\316\265\377\377\377\4\205\205\205;;=::<;;" \
- "=\203::<\3\204\204\206\377\377\377\376\376\376\245\377\377\377\1\265" \
- "\265\267\207::<\2\346\346\346\376\376\376\216\377\377\377\4\376\376\376" \
- "lll::<;;=\202::<\13;;=::<;;=::<;;=::<kkm\264\264\266\363\363\365\377" \
- "\377\377\376\376\376\202\377\377\377\1\376\376\376\206\377\377\377\3" \
- "\346\346\350\250\250\252TTV\204::<\3;;=::<;;=\202::<\2;;=\333\333\333" \
- "\202\377\377\377\1\376\376\376\237\377\377\377\3\376\376\376\377\377" \
- "\377kkm\203::<\1;;=\202::<\1\235\235\237\242\377\377\377\1\265\265\265" \
- "\203::<\1;;=\207::<\4GGI\220\220\222\332\332\334\376\376\376\206\377" \
- "\377\377\1\376\376\376\204\377\377\377\5\376\376\376\302\302\302\204" \
- "\204\206::<;;=\202::<\11""99;;;=::<;;=::<;;=::<```\363\363\363\226\377" \
- "\377\377\1\234\234\234\202::<\1;;=\202::<\2;;=\316\316\316\252\377\377" \
- "\377\4\316\316\316::<;;=99;\203::<\3\234\234\234\377\377\377\376\376" \
- "\376\204\377\377\377\7\373\377\376\377\376\377\377\377\377\376\377\377" \
- "\377\376\377\253\333\362[\265\351\203[\267\352\6Y\267\352[\267\350X\267" \
- "\345Y\270\346Y\270\350Y\267\352\220[\267\350\5X\267\347Y\270\350\325" \
- "\355\371\377\376\377\377\377\377\202\0>g\1\1>k\220\0=i\15\0>g\1>j\0>" \
- "i\0\77j\1>j\0=i\0\77j\0>j\0=i\1<h}\237\270\376\377\377\377\376\374\226" \
- "\377\377\377\3\376\376\376\377\377\377\316\316\316\204::<\3""99;;;=l" \
- "ln\240\377\377\377\5\234\234\234::<;;=::<;;=\202::<\1\235\235\237\241" \
- "\377\377\377\10\363\363\363FFF::<;;=::<;;=::<;;=\203::<\3;;=::<\265\265" \
- "\265\237\377\377\377\3\376\376\376\377\377\377kkm\202::<\1;;=\202::<" \
- "\4;;=\316\316\316\377\377\377\376\376\376\250\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\203\377" \
- "\377\377\6\364\364\364::<99;;;=::<;;=\202::<\1\347\347\351\203\377\377" \
- "\377\1\376\376\376\244\377\377\377\4FFH;;=::<99;\203::<\1\220\220\222" \
- "\220\377\377\377\2\363\363\363``b\202::<\1;;=\203::<\1;;=\205::<\5__" \
- "_\222\222\222\234\234\234\316\316\316\317\317\317\202\316\316\316\7\301" \
- "\301\301\234\234\236\204\204\206__a;;=99;;;=\203::<\2;;=99;\203;;=\2" \
- "::<\265\265\265\204\377\377\377\1\376\376\376\235\377\377\377\5\376\376" \
- "\376\377\377\377\376\376\376kkm::<\202;;=\6::<;;=::<\234\234\236\377" \
- "\377\377\376\376\376\236\377\377\377\1\376\376\376\202\377\377\377\5" \
- "\301\301\303GGI;;=::<;;=\206::<\7;;=::<99;GGIwwy\235\235\235\300\300" \
- "\300\202\316\316\316\10\315\315\315\317\317\317\315\315\315\265\265\265" \
- "\234\234\234jjj<<>99;\203::<\1;;=\202::<\2""99;;;=\203::<\1\204\204\206" \
- "\206\377\377\377\1\376\376\376\221\377\377\377\10\234\234\234;;=::<9" \
- "9;;;=::<99;\316\316\316\252\377\377\377\4\317\317\317;;=88:;;=\202::" \
- "<\3;;=\234\234\234\376\376\376\205\377\377\377\1\377\375\377\202\377" \
- "\377\375\6\377\376\377\377\377\375\253\333\362Y\270\350X\267\347Z\266" \
- "\347\202Y\270\350\1[\267\350\202Z\266\347\2[\267\350Z\266\347\220[\267" \
- "\350\5[\267\352Z\266\351\327\355\372\377\375\376\377\376\377\202\1>j" \
- "\1\1>k\220\0>i\202\0=i\14\0\77k\0>i\0=i\1>j\0=i\0=j\0\77k\0=i\177\236" \
- "\263\377\377\377\376\377\377\375\376\377\224\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\316\316\316\203::<\202;;=\3""99;kkm\376\376\376\234" \
- "\377\377\377\1\376\376\376\202\377\377\377\1\233\233\233\202::<\7;;=" \
- "::<;;=::<\234\234\236\377\377\377\376\376\376\233\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\202\377\377\377\4\221\221\221;;=99;;;=\202" \
- "::<\202;;=\203::<\1SSU\203\377\377\377\1\376\376\376\233\377\377\377" \
- "\10\376\376\376\377\377\377\376\376\376kkm::<;;=::<;;=\202::<\1;;=\202" \
- "::<\1;;=\240::<\1kkk\207\377\377\377\1\376\376\376\203\377\377\377\3" \
- "\375\375\375\377\377\377\376\376\376\202\377\377\377\2\233\233\235::" \
- "<\202;;=\203::<\1xxz\251\377\377\377\1\235\235\237\202::<\1;;=\203::" \
- "<\3GGI\363\363\363\376\376\376\217\377\377\377\2\363\363\363yyy\204:" \
- ":<\1;;=\203::<\1;;=\206::<\1""99;\203::<\1;;=\203::<\6;;=99;;;=::<;;" \
- "=99;\202;;=\3""99;GGI\301\301\301\206\377\377\377\1\376\376\376\232\377" \
- "\377\377\1\376\376\376\204\377\377\377\1lln\202::<\1;;=\202::<\2;;=\234" \
- "\234\236\241\377\377\377\1\376\376\376\202\377\377\377\2\332\332\334" \
- "__a\211::<\1;;=\205::<\1;;=\202::<\1;;=\202::<\4;;=::<99;;;=\202::<\1" \
- ";;=\202::<\1;;=\203::<\2FFH\265\265\267\206\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\220\377\377\377\3\234\234\236::<;;=\203::<\2" \
- ";;=\316\316\316\252\377\377\377\2\315\315\31599;\203::<\5;;=::<\234\234" \
- "\234\377\377\377\376\376\376\205\377\377\377\7\377\377\375\375\377\376" \
- "\377\377\377\375\376\377\255\333\365Z\266\345[\267\350\202Y\270\350\1" \
- "X\267\347\202Y\267\352\3Z\266\351Z\266\347Y\270\350\221[\267\350\2[\267" \
- "\352\323\355\372\202\376\377\377\1\0=j\222\0=i\204\0>i\14\1\77h\0>g\0" \
- "=f\1>j\0\77i\0>i\177\237\266\377\377\375\377\376\375\377\377\377\376" \
- "\377\377\377\376\377\225\377\377\377\2\316\316\316::<\202;;=\202::<\4" \
- ";;=kkm\377\377\377\376\376\376\235\377\377\377\2\376\376\376\235\235" \
- "\235\202::<\1;;=\202::<\2;;=\234\234\236\242\377\377\377\3\346\346\346" \
- "::<;;=\210::<\2\235\235\237\376\376\376\234\377\377\377\1\376\376\376" \
- "\204\377\377\377\1lln\202::<\3;;=::<;;=\203::<\2;;=99;\240::<\1kkk\210" \
- "\377\377\377\11\376\376\376\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\377\377\377\376\376\376\364\364\366GGI\205::<\6;;=\316\316\316\377" \
- "\377\377\376\376\376\377\377\377\376\376\376\245\377\377\377\11\345\345" \
- "\345;;=::<;;=::<;;=::<;;=\234\234\236\222\377\377\377\7\234\234\234;" \
- ";=::<;;=99;;;=99;\203::<\1;;=\202::<\203;;=\2::<;;=\202::<\1;;=\202:" \
- ":<\1;;=\202::<\12;;=::<;;=99;::<``b\332\332\332\376\376\376\377\377\377" \
- "\376\376\376\202\377\377\377\5\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\376\376\376\232\377\377\377\5\376\376\376\377\377\377\376\376" \
- "\376kkm;;=\202::<\1;;=\202::<\1\234\234\236\236\377\377\377\1\376\376" \
- "\376\207\377\377\377\2\234\234\236;;=\202::<\1;;=\204::<\1;;=\211::<" \
- "\1;;=\202::<\1;;=\202::<\1;;=\202::<\1;;=\203::<\3;;=kkm\346\346\346" \
- "\203\377\377\377\1\376\376\376\204\377\377\377\1\376\376\376\221\377" \
- "\377\377\2\234\234\236;;=\202::<\1;;=\202::<\1\316\316\316\252\377\377" \
- "\377\4\316\316\316;;=99;;;=\203::<\1\234\234\234\210\377\377\377\7\376" \
- "\377\377\377\375\376\377\377\375\256\332\363Y\270\350Y\267\352[\267\352" \
- "\202[\267\350\5X\270\350X\270\352Y\267\352Y\270\350X\267\347\220[\267" \
- "\350\5X\267\347[\267\350\325\355\367\377\377\373\377\377\375\202\0\77" \
- "j\1\0>g\220\0>i\1\0\77j\203\0>i\202\0=i\6\1>j\0>i\0\77h\0>g\177\236\263" \
- "\377\377\375\203\377\377\377\1\377\376\377\222\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\316\316\316\203::<\1;;=\202::<\2kkm\376\376\376" \
- "\233\377\377\377\1\376\376\376\203\377\377\377\5\234\234\234::<;;=::" \
- "<;;=\202::<\1\234\234\236\235\377\377\377\202\376\376\376\202\377\377" \
- "\377\5\376\376\376\377\377\377xxz99;;;=\204::<\4;;=::<;;=\362\362\362" \
- "\237\377\377\377\5\376\376\376\377\377\377\376\376\376kkm;;=\207::<\2" \
- "99;;;=\240::<\1lll\205\377\377\377\1\376\376\376\203\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\202\377\377\377\4\265\265\267" \
- ";;=::<;;=\202::<\2;;=__a\205\377\377\377\1\376\376\376\245\377\377\377" \
- "\3\204\204\206::<;;=\204::<\2SSU\376\376\376\215\377\377\377\1\376\376" \
- "\376\204\377\377\377\2\316\316\316__a\206::<\1;;=\214::<\5;;=::<;;=:" \
- ":<;;=\203::<\2\234\234\234\363\363\363\204\377\377\377\1\376\376\376" \
- "\243\377\377\377\1lln\206::<\2\233\233\235\376\376\376\233\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\207\377\377\377\3\345\345" \
- "\345lln;;=\204::<\5;;=99;::<99;;;=\205::<\1;;=\203::<\3""99;;;=99;\206" \
- "::<\2TTV\265\265\265\234\377\377\377\10\234\234\234;;=::<;;=::<;;=::" \
- "<\316\316\316\252\377\377\377\1\315\315\315\206::<\4\235\235\235\376" \
- "\376\376\377\377\377\376\376\376\205\377\377\377\12\377\377\373\377\377" \
- "\377\377\377\375\267\340\366[\270\344Z\266\351[\267\352Z\266\351[\265" \
- "\347[\267\350\202Y\270\350\2\\\270\351Z\266\347\220[\267\350\10X\267" \
- "\347X\266\351\325\355\371\377\376\377\377\377\377\0\77k\0=h\3>j\220\0" \
- "\77j\16\1>j\0=i\1>j\0=i\0\77j\0>i\0=h\0\77j\0\77h\1<f\177\236\263\377" \
- "\377\375\376\376\377\376\377\377\225\377\377\377\202\376\376\376\2\317" \
- "\317\317::<\202;;=\1::<\202;;=\1kkm\235\377\377\377\1\376\376\376\202" \
- "\377\377\377\2\234\234\234;;=\205::<\2\233\233\235\376\376\376\232\377" \
- "\377\377\1\376\376\376\204\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\316\316\316\203::<\1;;=\204::<\3\204\204\206\377\377\377\376\376\376" \
- "\241\377\377\377\1lln\203::<\202;;=\203::<\1;;=\241::<\1kkk\206\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\206\377\377\377\1TTV\203:" \
- ":<\4""99;;;=99;\265\265\267\253\377\377\377\3\331\331\331;;=99;\204:" \
- ":<\2;;=\264\264\264\217\377\377\377\1\376\376\376\204\377\377\377\2\264" \
- "\264\266SSU\202::<\2""99;;;=\203::<\3;;=::<;;=\206::<\5;;=99;;;=::<;" \
- ";=\20299;\6\204\204\206\346\346\346\377\377\377\376\376\376\377\377\377" \
- "\376\376\376\203\377\377\377\202\376\376\376\202\377\377\377\1\376\376" \
- "\376\231\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377" \
- "\377\12lll::<;;=::<99;::<;;=\234\234\236\377\377\377\376\376\376\233" \
- "\377\377\377\1\375\375\375\213\377\377\377\4\316\316\316xxx;;=99;\204" \
- "::<\1;;=\202::<\1;;=\204::<\4;;=::<;;=99;\203::<\1;;=\202::<\2SSS\265" \
- "\265\265\210\377\377\377\3\376\376\376\377\377\377\376\376\376\223\377" \
- "\377\377\1\234\234\234\206::<\1\316\316\316\250\377\377\377\3\376\376" \
- "\376\377\377\377\315\315\315\202::<\7;;=::<;;=::<\234\234\234\377\377" \
- "\377\376\376\376\202\377\377\377\21\376\376\376\377\377\377\376\377\373" \
- "\377\377\377\376\377\377\376\377\375\377\376\377\353\366\374X\266\351" \
- "X\270\350W\267\347X\270\350X\267\347Z\266\347\\\270\347X\267\345Y\270" \
- "\350\221[\267\350\7Z\266\347[\267\350\327\355\372\377\375\377\377\377" \
- "\377\0>g\0\77h\221\0=i\1\0>g\202\1\77h\1\0=i\202\0>i\11\0\77j\0>g\0>" \
- "j\0\77m\336\347\354\376\377\377\377\376\377\376\377\377\377\377\375\222" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\316\316\316\202::<\1;;=" \
- "\203::<\2kkm\376\376\376\233\377\377\377\1\376\376\376\202\377\377\377" \
- "\3\376\376\376\234\234\234;;=\202::<\6""99;::<;;=\234\234\236\377\377" \
- "\377\376\376\376\237\377\377\377\1\376\376\376\202\377\377\377\1SSS\202" \
- ";;=\1""99;\204;;=\3\331\331\331\377\377\377\376\376\376\234\377\377\377" \
- "\3\376\376\376\377\377\377\376\376\376\202\377\377\377\3lll::<;;=\202" \
- "::<\202;;=\203::<\1;;=\240::<\1kkk\204\377\377\377\1\376\376\376\211" \
- "\377\377\377\3\302\302\302;;;999\202::<\3;;=::<TTT\210\377\377\377\1" \
- "\376\376\376\244\377\377\377\2kkk;;=\202::<\203:::\1TTT\226\377\377\377" \
- "\3\301\301\301xxz;;=\202::<\1;;=\202::<\1;;=\202::<\5;;=::<;;=::<;;=" \
- "\202::<\5;;=99;SSU\235\235\237\347\347\351\204\377\377\377\1\376\376" \
- "\376\207\377\377\377\3\376\376\376\377\377\377\376\376\376\235\377\377" \
- "\377\10kkk:::::<999;;;:::;;;\233\233\233\236\377\377\377\1\376\376\376" \
- "\211\377\377\377\1\376\376\376\202\377\377\377\3\346\346\350\251\251" \
- "\253``b\202::<\3;;=::<;;=\202::<\1;;=\205::<\1;;=\203::<\5;;=FFH\204" \
- "\204\204\316\316\316\376\376\376\204\377\377\377\1\376\376\376\232\377" \
- "\377\377\1\234\234\234\202::<\5""99;;;=99;;;;\315\315\315\252\377\377" \
- "\377\3\316\316\316:::;;;\202:::\3;;;::<\234\234\234\206\377\377\377\1" \
- "\377\377\375\203\377\376\377\11\377\377\377\377\377\375\303\344\367W" \
- "\270\345^\266\344X\267\347Y\271\353Z\266\351\\\266\350\202Y\270\350\221" \
- "[\267\352\3[\267\350[\265\347\325\355\371\202\376\377\377\3\2=e\0>g\0" \
- "\77m\220\0=i\6\0\77j\0>i\0=h\0\77j\0=i\0\77j\202\0>g\2\1\77h\240\266" \
- "\304\204\377\377\377\2\376\376\376\377\377\375\223\377\377\377\14\376" \
- "\376\376\377\377\377\315\315\315;;=::<:::;;;:::;;;kkk\377\377\377\376" \
- "\376\376\233\377\377\377\1\376\376\376\202\377\377\377\10\235\235\235" \
- "99;::<999;;;:::;;;\233\233\233\234\377\377\377\1\376\376\376\207\377" \
- "\377\377\1\265\265\265\202::<\1;;=\203::<\1kkk\203\377\377\377\1\376" \
- "\376\376\240\377\377\377\2kkk:::\202::<\3;;=99;;;=\244::<\1kkk\205\377" \
- "\377\377\1\376\376\376\210\377\377\377\1\346\346\346\206\316\316\316" \
- "\3\332\332\332\377\377\377\377\377\375\253\377\377\377\2\346\346\346" \
- "\316\316\316\202\316\316\320\203\316\316\316\1\315\315\315\225\377\377" \
- "\377\202\376\376\376\202\377\377\377\4\316\316\320\234\234\236kkmSSU" \
- "\205::<\1;;=\203::<\5kkm\204\204\206\264\264\266\346\346\350\376\376" \
- "\376\214\377\377\377\1\376\376\376\202\377\377\377\202\376\376\376\231" \
- "\377\377\377\1\376\376\376\203\377\377\377\2\331\331\331\317\317\317" \
- "\205\316\316\316\1\347\347\347\243\377\377\377\1\376\376\376\211\377" \
- "\377\377\5\376\376\377\347\347\351\265\265\267\204\204\206lln\212::<" \
- "\4``bxxz\234\234\236\332\332\332\207\377\377\377\1\376\376\376\210\377" \
- "\377\377\1\376\376\376\222\377\377\377\1\346\346\346\203\316\316\320" \
- "\4\316\316\316\316\316\320\315\315\315\364\364\364\251\377\377\377\2" \
- "\376\376\376\364\364\364\205\316\316\316\2\316\316\320\346\346\346\210" \
- "\377\377\377\16\377\376\377\377\377\375\376\377\377\377\377\377\377\375" \
- "\377\326\354\371\241\326\366\206\310\352\200\312\357\202\312\362\204" \
- "\310\357\204\312\356\203\311\355\205\311\360\220\204\312\356\10\203\311" \
- "\355\201\311\361\342\360\371\376\377\377\377\377\375>n\222Bm\215@n\220" \
- "\220@n\217\3@l\217An\217Bo\220\202An\217\5@m\214Dm\213l\223\260\277\320" \
- "\332\376\377\377\202\377\377\377\1\377\377\375\202\377\377\377\1\376" \
- "\377\377\225\377\377\377\3\363\363\363\317\317\321\316\316\320\204\316" \
- "\316\316\1\332\332\332\240\377\377\377\1\346\346\346\202\316\316\320" \
- "\204\316\316\316\1\347\347\347\243\377\377\377\3\376\376\376\363\363" \
- "\363lln\202kkm\1lln\202kkm\1\301\301\301\240\377\377\377\1\376\376\376" \
- "\203\377\377\377\2\331\331\331\317\317\317\202\316\316\316\202\317\317" \
- "\317\245\316\316\316\2\332\332\332\376\376\376\351\377\377\377\5\332" \
- "\332\332\315\315\315\316\316\316\315\315\315\363\363\363\361\377\377" \
- "\377\202\316\316\316\1\317\317\317\202\316\316\316\2\315\315\315\363" \
- "\363\363\377\377\377\377\377\377\377\377\377\377\377\377\334\377\377" \
- "\377\1\376\376\376\375\377\377\377\1\376\376\376\377\377\377\377\377" \
- "\377\377\377\377\377\377\377\340\377\377\377\1\376\376\376\370\377\377" \
- "\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\342" \
- "\377\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377" \
- "\377\377\377\377\377\334\377\377\377\1\376\376\376\362\377\377\377\1" \
- "\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\346\377" \
- "\377\377\1\376\376\376\363\377\377\377\1\376\376\376\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\342\377\377\377\1\376\376\376\373\377" \
- "\377\377\1\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377" \
- "\340\377\377\377\3\376\376\376\377\377\377\376\376\376\377\377\377\377" \
- "\377\377\377\377\377\377\377\377\377\377\377\377\243\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\203\377\377\377\1\376\376\376\233\377" \
- "\377\377\1\376\376\376\205\377\377\377\1\376\376\376\214\377\377\377" \
- "\1\376\376\376\205\377\377\377\1\376\376\376\260\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\300\377\377\377\1\376\376\376\306\377\377" \
- "\377\1\376\376\376\233\377\377\377\4\376\377\377\376\376\376\377\376" \
- "\377\377\377\377\203\376\377\375\203\377\377\377\3\377\377\375\376\377" \
- "\375\376\377\377\265\377\377\377\4\377\377\375\377\376\377\376\377\377" \
- "\377\377\375\202\377\376\377\210\377\377\377\7\377\377\375\376\377\377" \
- "\377\377\377\375\377\376\376\377\377\377\376\377\376\377\377\211\377" \
- "\377\377\4\376\377\375\377\377\377\376\376\376\377\377\375\202\377\377" \
- "\377\2\377\377\375\376\376\376\220\377\377\377\1\376\377\375\202\377" \
- "\377\375\5\377\376\377\377\377\373\377\377\377\375\377\376\377\377\375" \
- "\210\377\377\377\1\377\376\377\202\377\377\375\202\377\377\377\3\376" \
- "\377\377\377\377\375\377\376\377\213\377\377\377\3\376\377\377\376\377" \
- "\375\377\377\375\203\377\377\377\203\376\377\375\4\377\377\377\377\376" \
- "\377\376\376\376\376\377\377\233\377\377\377\3\376\377\377\376\377\375" \
- "\377\377\375\203\377\377\377\203\376\377\375\4\377\377\377\377\376\377" \
- "\376\376\376\376\377\377\210\377\377\377\1\377\376\377\203\377\377\377" \
- "\4\376\377\377\377\377\375\377\376\377\376\377\373\211\377\377\377\4" \
- "\376\377\377\376\376\374\377\376\377\377\375\376\226\377\377\377\5\376" \
- "\377\377\375\377\374\377\377\375\376\375\377\377\377\375\210\377\377" \
- "\377\1\377\377\375\202\376\377\377\1\377\377\373\242\377\377\377\1\376" \
- "\376\376\212\377\377\377\1\376\376\376\207\377\377\377\1\376\376\376" \
- "\237\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\214\377" \
- "\377\377\1\376\376\376\204\377\377\377\202\376\376\376\257\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\246\377\377\377\1\376\376\376\224\377\377\377\1\376\376\376\250" \
- "\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\236\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\230\377\377\377\4\377\377" \
- "\373\376\377\377\376\376\376\377\376\377\203\377\377\377\1\377\377\375" \
- "\202\377\377\377\1\377\376\377\202\377\377\375\3\377\377\377\377\377" \
- "\375\376\376\374\260\377\377\377\2\377\377\375\376\376\376\203\377\376" \
- "\377\214\377\377\377\7\376\377\377\377\376\377\377\377\375\377\377\377" \
- "\377\376\377\375\377\376\377\377\375\210\377\377\377\7\377\376\374\377" \
- "\377\375\377\376\377\377\377\375\376\376\376\377\377\377\376\376\376" \
- "\221\377\377\377\1\377\376\377\203\377\377\377\202\377\377\375\212\377" \
- "\377\377\2\377\377\375\377\377\377\202\377\377\375\214\377\377\377\3" \
- "\376\376\374\377\377\375\377\377\377\202\377\377\375\1\377\376\377\202" \
- "\377\377\377\1\377\377\375\203\377\377\377\4\377\376\377\376\376\376" \
- "\376\377\377\377\377\373\230\377\377\377\3\376\376\374\377\377\375\377" \
- "\377\377\202\377\377\375\1\377\376\377\202\377\377\377\1\377\377\375" \
- "\203\377\377\377\4\377\376\377\376\376\376\376\377\377\377\377\373\213" \
- "\377\377\377\1\377\376\374\214\377\377\377\2\377\377\375\377\376\377" \
- "\202\377\377\375\3\376\377\377\377\377\377\377\377\373\221\377\377\377" \
- "\3\376\377\375\376\377\377\377\376\377\204\377\377\377\1\377\377\375" \
- "\212\377\377\377\5\377\376\377\377\377\375\377\377\377\376\377\375\376" \
- "\377\373\243\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376" \
- "\204\377\377\377\1\376\376\376\242\377\377\377\1\376\376\376\205\377" \
- "\377\377\1\376\376\376\213\377\377\377\1\376\376\376\206\377\377\377" \
- "\1\376\376\376\263\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\270\377\377\377\1\376\376\376\312\377\377\377\1\376\376\376\234\377" \
- "\377\377\1\377\377\375\202\376\377\377\7\377\376\377\377\377\377\376" \
- "\377\377\377\376\377\377\377\375\377\377\377\376\377\377\202\377\376" \
- "\377\2\376\377\375\376\377\377\262\377\377\377\10\377\377\375\376\377" \
- "\377\377\376\377\377\377\373\377\377\377\377\376\377\376\377\375\377" \
- "\377\375\211\377\377\377\3\376\377\377\377\376\377\377\377\375\202\377" \
- "\377\377\2\376\377\377\376\376\376\210\377\377\377\202\377\376\377\4" \
- "\374\377\377\376\377\377\377\376\377\377\377\375\222\377\377\377\4\377" \
- "\376\375\376\377\377\377\377\377\376\377\377\202\377\376\377\202\377" \
- "\377\375\210\377\377\377\4\377\377\375\377\377\377\377\377\375\377\377" \
- "\377\202\377\376\377\2\377\377\377\376\377\377\212\377\377\377\2\376" \
- "\377\377\376\377\375\202\377\376\377\7\376\377\377\377\377\377\377\377" \
- "\375\377\376\377\376\377\377\377\377\377\377\376\377\202\376\377\377" \
- "\1\377\377\375\232\377\377\377\2\376\377\377\376\377\375\202\377\376" \
- "\377\7\376\377\377\377\377\377\377\377\375\377\376\377\376\377\377\377" \
- "\377\377\377\376\377\202\376\377\377\1\377\377\375\210\377\377\377\1" \
- "\377\377\375\202\377\377\377\4\377\377\375\377\376\377\377\377\377\376" \
- "\377\377\211\377\377\377\7\375\376\377\377\377\375\377\376\377\376\376" \
- "\377\376\377\375\375\377\376\377\377\375\222\377\377\377\6\376\377\377" \
- "\377\376\377\377\377\377\377\377\375\377\376\377\376\377\377\213\377" \
- "\377\377\202\377\376\377\3\377\377\375\376\377\377\376\377\375\236\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\203\377\377\377\2\376\376\376\377\377\377\202\376\376" \
- "\376\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\204" \
- "\377\377\377\1\376\376\376\235\377\377\377\1\376\376\376\217\377\377" \
- "\377\1\376\376\376\206\377\377\377\1\376\376\376\260\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\241\377\377\377\202\376\376\376\204" \
- "\377\377\377\1\376\376\376\222\377\377\377\1\376\376\376\205\377\377" \
- "\377\1\376\376\376\246\377\377\377\1\376\376\376\233\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\234\377\377\377\15\376\376\376\377\377" \
- "\377\377\376\377\377\377\375\375\377\376\377\377\377\376\377\375\377" \
- "\377\377\375\376\377\377\377\377\377\377\375\376\377\377\377\377\377" \
- "\202\377\376\377\260\377\377\377\7\377\376\377\376\377\377\377\377\377" \
- "\376\377\377\377\377\377\377\377\375\376\377\377\212\377\377\377\1\376" \
- "\376\374\203\377\377\377\3\376\376\377\377\377\375\376\377\377\210\377" \
- "\377\377\10\376\377\377\377\376\377\374\377\373\376\377\373\377\376\377" \
- "\376\376\376\377\377\377\376\377\375\220\377\377\377\2\377\376\377\377" \
- "\377\377\202\377\377\375\202\377\377\377\2\376\376\374\376\377\377\210" \
- "\377\377\377\1\376\377\377\202\377\377\377\5\376\377\377\377\377\377" \
- "\376\376\376\377\377\377\376\377\375\210\377\377\377\202\377\376\377" \
- "\15\377\377\377\376\377\377\377\377\375\377\377\377\375\376\377\377\377" \
- "\377\376\377\375\377\377\377\375\377\376\377\377\375\377\376\377\377" \
- "\377\377\376\376\376\231\377\377\377\202\377\376\377\15\377\377\377\376" \
- "\377\377\377\377\375\377\377\377\375\376\377\377\377\377\376\377\375" \
- "\377\377\377\375\377\376\377\377\375\377\376\377\377\377\377\376\376" \
- "\376\211\377\377\377\4\377\376\377\377\377\377\376\377\375\376\377\377" \
- "\202\377\377\377\2\376\377\377\376\377\375\210\377\377\377\1\376\377" \
- "\375\202\376\376\376\202\377\377\377\2\377\377\375\375\376\377\221\377" \
- "\377\377\10\377\377\375\377\377\377\376\376\374\376\377\373\376\376\376" \
- "\377\376\377\376\377\377\377\377\375\210\377\377\377\6\376\376\376\377" \
- "\377\377\377\377\375\377\377\377\374\375\377\377\377\375\242\377\377" \
- "\377\1\376\376\376\214\377\377\377\1\376\376\376\204\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\235\377\377\377\1\376\376\376\203\377" \
- "\377\377\202\376\376\376\212\377\377\377\1\376\376\376\202\377\377\377" \
- "\202\376\376\376\264\377\377\377\5\376\376\376\377\377\377\376\376\376" \
- "\377\377\377\376\376\376\242\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\202\377\377\377\1\376\376\376\223\377\377\377\1\376\376\376" \
- "\244\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\233\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\234\377\377\377" \
- "\1\375\377\372\202\377\377\377\3\376\376\376\377\377\375\377\377\377" \
- "\202\376\377\377\204\377\377\377\4\376\377\377\377\377\377\377\376\377" \
- "\375\377\372\260\377\377\377\202\377\377\375\2\377\377\377\376\375\377" \
- "\202\377\377\377\1\375\377\376\212\377\377\377\6\377\377\375\377\377" \
- "\377\376\377\375\377\377\375\377\376\377\377\376\375\212\377\377\377" \
- "\1\377\376\377\202\377\377\377\4\377\375\376\377\377\377\377\377\373" \
- "\376\375\377\221\377\377\377\203\376\376\376\4\377\377\375\376\376\374" \
- "\377\376\377\376\376\374\210\377\377\377\5\377\376\377\377\377\375\377" \
- "\376\377\376\376\376\376\377\375\202\377\377\377\1\376\376\376\210\377" \
- "\377\377\4\375\377\372\377\376\377\377\377\377\376\377\377\204\377\377" \
- "\377\202\376\377\377\3\377\377\377\377\377\375\376\376\376\202\377\377" \
- "\377\1\375\377\372\230\377\377\377\4\375\377\372\377\376\377\377\377" \
- "\377\376\377\377\204\377\377\377\202\376\377\377\3\377\377\377\377\377" \
- "\375\376\376\376\202\377\377\377\1\375\377\372\210\377\377\377\3\376" \
- "\377\377\377\377\377\376\376\376\202\376\377\377\202\377\377\377\1\376" \
- "\377\375\210\377\377\377\7\376\376\377\377\377\375\376\377\375\376\376" \
- "\376\377\376\377\377\377\377\376\377\377\221\377\377\377\5\376\376\376" \
- "\376\377\377\377\377\377\375\375\375\377\376\377\202\377\377\377\1\377" \
- "\377\375\211\377\377\377\7\377\376\377\376\376\374\376\377\377\377\377" \
- "\377\377\376\377\377\377\375\377\377\373\233\377\377\377\1\376\376\376" \
- "\205\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\203\377" \
- "\377\377\1\376\376\376\204\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\204\377\377\377\1\376\376\376\237\377\377\377\1\376\376\376" \
- "\212\377\377\377\1\376\376\376\213\377\377\377\1\376\376\376\255\377" \
- "\377\377\1\376\376\376\247\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\224\377\377\377\1\376\376\376\247\377\377\377\1\376\376" \
- "\376\236\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\232" \
- "\377\377\377\10\377\376\377\377\377\375\377\377\377\376\377\377\376\376" \
- "\376\377\376\377\377\377\375\377\376\377\202\377\377\375\1\377\376\377" \
- "\202\377\377\377\3\377\376\377\377\375\376\377\376\377\260\377\377\377" \
- "\2\377\376\377\377\377\377\202\377\376\377\4\377\377\375\376\376\374" \
- "\377\375\377\377\376\377\210\377\377\377\3\376\376\374\377\376\377\376" \
- "\376\376\204\377\377\377\1\376\377\375\210\377\377\377\4\375\377\374" \
- "\377\377\377\377\375\376\377\376\377\203\377\377\377\1\377\377\375\220" \
- "\377\377\377\3\376\377\377\377\377\375\376\377\377\202\377\377\377\3" \
- "\377\376\377\373\377\377\376\377\377\211\377\377\377\202\376\377\375" \
- "\1\377\377\375\203\377\377\377\1\377\376\377\210\377\377\377\3\377\376" \
- "\377\377\375\376\377\376\377\202\377\377\377\1\377\376\377\202\377\377" \
- "\375\10\377\376\377\377\377\375\377\376\377\376\376\376\376\377\377\377" \
- "\377\377\377\377\375\377\376\377\230\377\377\377\3\377\376\377\377\375" \
- "\376\377\376\377\202\377\377\377\1\377\376\377\202\377\377\375\10\377" \
- "\376\377\377\377\375\377\376\377\376\376\376\376\377\377\377\377\377" \
- "\377\377\375\377\376\377\210\377\377\377\2\377\377\375\375\376\371\202" \
- "\377\376\377\3\377\377\377\377\377\375\377\376\377\212\377\377\377\1" \
- "\377\375\376\202\377\377\377\4\377\377\375\376\376\376\376\377\377\377" \
- "\376\377\220\377\377\377\2\376\377\377\376\376\377\202\377\377\377\2" \
- "\376\377\375\375\377\374\212\377\377\377\10\373\377\376\377\377\377\377" \
- "\377\375\376\376\374\377\377\375\377\376\377\377\377\377\376\377\377" \
- "\235\377\377\377\1\376\376\376\202\377\377\377\7\316\316\320\250\250" \
- "\252\221\221\223llnjjlGGI99;\204::<\7TTVkkmyy{\234\234\236\265\265\267" \
- "\332\332\332\376\376\376\237\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\222\377\377\377\1\376\376\376\205\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\255\377\377\377\1\376\376\376\246\377\377\377" \
- "\1\376\376\376\227\377\377\377\1\376\376\376\252\377\377\377\1\376\376" \
- "\376\233\377\377\377\1\376\376\376\236\377\377\377\17\305\344\240\303" \
- "\342\237\304\343\240\304\343\237\307\342\237\303\342\236\305\342\240" \
- "\303\342\236\305\342\237\304\343\240\304\343\237\304\341\237\304\343" \
- "\237\323\352\266\376\377\375\250\377\377\377\210\305\342\240\10\305\342" \
- "\237\303\342\234\304\343\237\306\341\236\304\343\240\322\352\270\376" \
- "\377\377\375\377\376\211\377\377\377\5\377\376\377\376\376\376\377\376" \
- "\377\360\371\350\305\342\237\202\304\341\236\210\305\342\240\5\304\341" \
- "\236\327\356\302\376\377\377\377\377\373\376\377\375\202\377\377\375" \
- "\1\377\376\377\220\377\377\377\202\377\377\375\2\376\377\377\377\377" \
- "\377\202\377\377\375\2\304\343\237\306\341\236\210\305\342\240\5\307" \
- "\342\237\303\342\236\304\341\236\341\357\314\377\377\375\213\377\377" \
- "\377\17\376\377\375\323\352\266\304\343\237\304\341\237\304\343\237\304" \
- "\343\240\305\342\237\303\342\236\305\342\240\303\342\236\307\342\237" \
- "\304\343\237\304\343\240\303\342\237\305\344\240\231\377\377\377\17\376" \
- "\377\375\323\352\266\304\343\237\304\341\237\304\343\237\304\343\240" \
- "\305\342\237\303\342\236\305\342\240\303\342\236\307\342\237\304\343" \
- "\237\304\343\240\303\342\237\305\344\240\211\377\377\377\10\360\367\347" \
- "\306\343\241\303\342\237\307\342\237\303\342\237\304\343\235\307\341" \
- "\240\304\343\240\210\305\342\240\7\315\347\252\376\377\375\377\375\376" \
- "\376\377\375\377\377\377\377\377\373\376\377\377\221\377\377\377\10\377" \
- "\377\375\376\377\375\323\352\266\307\341\240\307\342\237\305\342\240" \
- "\307\340\236\306\341\236\210\305\342\240\4\304\343\237\311\335\236\377" \
- "\377\377\377\376\377\203\377\377\377\1\376\377\377\230\377\377\377\1" \
- "\376\376\376\203\377\377\377\3\346\346\346\251\251\251jjl\202;;=\210" \
- "::<\1;;=\202::<\2;;=99;\203::<\5FFHxxx\265\265\265\363\363\363\376\376" \
- "\376\234\377\377\377\2\376\376\376\346\346\346\214\234\234\234\1\235" \
- "\235\235\203\234\234\234\3\235\235\235\234\234\234\250\250\250\203\316" \
- "\316\316\1\346\346\346\263\377\377\377\202\250\250\250\245\377\377\377" \
- "\1\316\316\316\222\234\234\234\1\302\302\302\203\316\316\316\1\363\363" \
- "\363\247\377\377\377\3\316\316\316\234\234\234\235\235\235\240\234\234" \
- "\234\1\316\316\316\231\377\377\377\6\215\305>\216\306A\215\305@\213\310" \
- "=\215\305>\212\307>\202\214\305@\6\214\306>\212\306@\214\306<\215\304" \
- "B\214\306>\252\323m\251\377\377\377\210\214\306>\10\215\305@\215\307" \
- "\77\212\307>\217\304@\214\305@\251\323m\377\377\377\377\377\375\213\377" \
- "\377\377\5\377\375\377\341\363\315\215\305>\212\307>\215\305@\210\214" \
- "\306>\6\215\306A\220\305\77\350\365\333\377\377\377\376\377\377\377\376" \
- "\377\202\376\377\377\225\377\377\377\3\377\376\377\214\306>\215\306A" \
- "\210\214\306>\6\215\305>\212\310\77\215\305@\307\341\240\376\377\377" \
- "\377\376\377\213\377\377\377\6\252\323m\214\306>\215\304B\214\306<\212" \
- "\306@\214\306>\202\214\305@\6\212\307>\215\305>\213\310=\215\305@\216" \
- "\306A\215\305>\232\377\377\377\6\252\323m\214\306>\215\304B\214\306<" \
- "\212\306@\214\306>\202\214\305@\6\212\307>\215\305>\213\310=\215\305" \
- "@\216\306A\215\305>\211\377\377\377\4\376\377\377\242\321a\213\307A\215" \
- "\305>\202\214\306>\2\215\305@\215\307\77\210\214\306>\7\215\305<\332" \
- "\354\304\377\377\377\376\377\375\376\376\376\377\376\377\376\376\376" \
- "\221\377\377\377\10\377\376\377\342\362\316\215\305>\213\310\77\212\305" \
- "D\212\307<\216\306\77\211\307>\211\214\306>\4\304\343\240\373\377\376" \
- "\377\377\377\375\377\376\202\377\377\377\1\377\377\375\225\377\377\377" \
- "\1\376\376\376\204\377\377\377\6\265\265\267__a99;;;=::<;;=\202::<\1" \
- ";;=\202::<\1;;=\202::<\1;;=\203::<\1;;=\203::<\3;;=::<99;\202::<\2xx" \
- "z\301\301\301\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\206\377\377\377\1\376\376\376\217\377\377\377\1\316\316\316\205" \
- "::<\202;;=\221::<\4TTVwwy\250\250\252\346\346\350\255\377\377\377\1\316" \
- "\316\320\202::<\1\316\316\316\244\377\377\377\1\234\234\236\204::<\1" \
- ";;=\205::<\3;;=::<;;=\206::<\1;;=\204::<\6SSUkkm\204\204\206\250\250" \
- "\250\316\316\316\376\376\376\206\377\377\377\1\376\376\376\231\377\377" \
- "\377\1\234\234\234\206::<\3;;=::<;;=\222::<\1;;=\204::<\3;;=::<\234\234" \
- "\236\231\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214" \
- "\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210\214\306>" \
- "\15\212\306@\215\307\77\233\316W\365\374\364\377\376\375\376\377\377" \
- "\377\376\377\377\377\375\377\377\377\377\377\375\376\376\376\377\377" \
- "\377\376\376\374\202\377\377\377\1\376\376\376\216\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\212\377\377\377\7\350\364\334\215\305>\212\307" \
- "<\214\305@\215\304B\215\305@\213\310\77\210\214\306>\10\214\305@\225" \
- "\311J\370\373\362\377\376\377\376\377\377\377\377\375\377\377\377\376" \
- "\377\377\210\377\377\377\40\376\377\377\376\377\375\377\376\377\377\377" \
- "\377\375\376\377\377\377\375\377\376\377\376\377\377\370\373\364\233" \
- "\314W\215\307\77\214\304=\212\306@\215\307\77\213\305=\215\307\77\214" \
- "\306>\217\304@\215\306A\212\307>\214\306<\215\306A\214\306>\211\307@" \
- "\242\321a\377\377\377\377\376\377\376\377\377\377\376\377\377\377\377" \
- "\376\377\377\377\376\377\223\377\377\377\7\376\376\376\377\377\377\376" \
- "\376\376\377\377\377\363\363\365\234\234\236FFH\202::<\10;;=99;;;=::" \
- "<;;=::<99;;;=\203::<\1;;=\203::<\2;;=99;\204::<\11""99;;;=::<;;=::<;" \
- ";=TTV\265\265\265\363\363\363\203\377\377\377\1\376\376\376\207\377\377" \
- "\377\1\376\376\376\215\377\377\377\1\316\316\316\205::<\3;;=::<;;=\202" \
- "::<\1;;=\214::<\3;;=99;;;=\202::<\4lln\316\316\316\376\376\376\377\377" \
- "\377\202\376\376\376\246\377\377\377\2\376\376\376xxz\202::<\2xxx\376" \
- "\376\376\243\377\377\377\1\234\234\236\204::<\202;;=\205::<\1;;=\204" \
- "::<\1;;=\202::<\1""99;\206::<\1;;=\202::<\6;;=kkk\250\250\250\346\346" \
- "\346\377\377\377\376\376\376\205\377\377\377\1\376\376\376\225\377\377" \
- "\377\1\234\234\234\204::<\1;;=\202::<\4;;=::<99;;;=\225::<\3;;=::<\234" \
- "\234\236\231\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4" \
- "\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250" \
- "\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210\214\306" \
- ">\4\215\306A\213\304\77\215\305@\262\327x\202\377\377\377\1\376\377\375" \
- "\203\377\377\375\204\377\377\377\1\376\376\376\217\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\212\377\377\377\7\376\376\376\305\342\237\212" \
- "\307>\214\306>\212\307<\214\306>\212\307>\210\214\306>\3\214\306<\215" \
- "\306A\300\337\221\202\377\377\377\3\377\376\377\376\376\376\377\377\375" \
- "\210\377\377\377\1\377\375\377\202\377\377\377\2\376\376\377\376\377" \
- "\375\202\377\376\377\30\377\377\377\277\340\221\215\306A\213\305=\215" \
- "\305>\212\306B\214\306>\216\306\77\214\306<\212\307>\215\307=\213\305" \
- ";\215\307\77\216\305C\214\306>\214\305@\216\306\77\347\365\333\377\376" \
- "\377\377\377\375\376\377\377\377\376\374\377\377\377\377\377\375\222" \
- "\377\377\377\1\376\376\376\204\377\377\377\12\265\265\267FFH;;=::<;;" \
- "=99;::<;;=::<;;=\202::<\4<<>99;::<;;=\202::<\1;;=\203::<\1<<>\204::<" \
- "\5<<>99;;;=99;;;=\202::<\4:::SSS\266\266\266\376\376\376\203\377\377" \
- "\377\1\376\376\376\204\377\377\377\1\376\376\376\216\377\377\377\1\316" \
- "\316\316\204::<\3;;=::<;;=\204::<\1;;=\214::<\1;;=\202::<\1;;=\202::" \
- "<\2yyy\363\363\363\202\377\377\377\1\376\376\376\245\377\377\377\3\346" \
- "\346\346::<;;=\202::<\1\347\347\347\202\377\377\377\1\376\376\376\240" \
- "\377\377\377\1\234\234\236\203::<\4;;=99;::<;;=\202::<\7;;=::<;;=99;" \
- ";;=::<;;=\203::<\202;;=\210::<\1""99;\202::<\4;;=xxz\317\317\317\376" \
- "\376\376\202\377\377\377\1\376\376\376\227\377\377\377\1\234\234\234" \
- "\204::<\1""99;\203;;=\224::<\1;;=\204::<\2<<>\234\234\236\231\377\377" \
- "\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214" \
- "\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377" \
- "\1\342\361\320\202\214\306>\1\214\305@\210\214\306>\10\215\305>\214\306" \
- ">\213\307A\214\306>\315\345\253\377\377\375\377\376\377\376\377\377\226" \
- "\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377" \
- "\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214" \
- "\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@" \
- "\207\214\306>\3\214\305@\214\306>\214\305@\211\377\377\377\7\377\377" \
- "\375\377\376\377\376\376\376\241\321a\212\307>\211\305\77\215\306A\211" \
- "\214\306>\4\213\310\77\214\305@\213\305=\342\361\320\202\377\376\377" \
- "\2\377\377\375\377\376\377\210\377\377\377\1\377\376\377\202\377\377" \
- "\377\30\377\377\375\376\377\377\377\377\375\376\377\377\351\366\334\214" \
- "\305B\211\306;\215\307\77\214\306>\212\306@\215\305>\215\305@\212\307" \
- ">\214\305@\212\306B\214\306>\213\305=\213\310\77\215\305>\215\307\77" \
- "\314\345\253\377\375\377\377\376\374\376\377\377\203\377\377\377\1\377" \
- "\376\374\225\377\377\377\2\345\345\345kkm\205::<\202;;=\203::<\1;;=\203" \
- "::<\1;;=\202::<\202;;=\202::<\1;;=\210::<\2;;=99;\205::<\2```\331\331" \
- "\331\211\377\377\377\1\376\376\376\214\377\377\377\1\316\316\316\206" \
- "::<\5""99;::<;;=::<99;\212::<\1;;=\202::<\1;;=\204::<\4;;=::<FFF\316" \
- "\316\316\247\377\377\377\3\205\205\207;;=99;\202::<\1\204\204\206\203" \
- "\377\377\377\1\376\376\376\237\377\377\377\1\234\234\236\205::<\1;;=" \
- "\204::<\1""99;\202;;=\202::<\3;;=::<;;=\203::<\1;;=\202::<\1;;=\204:" \
- ":<\1;;=\205::<\2jjl\316\316\316\203\377\377\377\1\376\376\376\225\377" \
- "\377\377\1\234\234\234\204::<\1;;=\202::<\3;;=::<;;=\222::<\7;;=::<;" \
- ";=::<;;=::<\234\234\236\231\377\377\377\3\214\305@\214\306>\214\305@" \
- "\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215" \
- "\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214" \
- "\305@\210\214\306>\10\215\305@\212\307>\214\305@\215\306A\214\305@\352" \
- "\364\334\376\376\377\377\377\373\202\377\377\377\3\376\376\376\377\377" \
- "\377\377\377\375\202\377\377\377\1\376\376\374\216\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\211\377\377\377\1\376\377\377\202\377\377\375" \
- "\5\347\364\332\215\307\77\215\306C\214\307;\216\306\77\210\214\306>\10" \
- "\214\305@\214\305D\215\307\77\233\314V\371\374\363\376\377\377\377\377" \
- "\377\377\377\375\210\377\377\377\20\375\377\374\377\376\377\376\376\377" \
- "\376\377\377\377\376\377\376\377\375\376\377\377\244\317d\212\307>\215" \
- "\306A\215\305@\214\305@\211\306=\215\307=\215\306A\214\305@\204\214\306" \
- ">\14\211\305A\212\307>\251\324k\377\376\377\377\375\376\376\377\377\377" \
- "\377\377\377\377\375\377\377\377\377\377\375\377\377\377\377\377\375" \
- "\217\377\377\377\1\376\376\376\203\377\377\377\2\265\265\267FFH\205:" \
- ":<\1;;=\203::<\202;;=\7:::TTT\203\203\203\235\235\235\316\316\316\332" \
- "\332\332\377\377\377\202\376\376\376\202\377\377\377\5\316\316\316\317" \
- "\317\317\234\234\234yyyFFF\202::<\1;;=\202::<\3""99;;;=99;\204::<\2;" \
- ";=\233\233\233\206\377\377\377\1\376\376\376\216\377\377\377\1\316\316" \
- "\316\204::<\1;;=\205::<\1;;=\212::<\3""99;::<;;=\202::<\2;;=99;\204:" \
- ":<\2;;=\265\265\265\245\377\377\377\4\346\346\346::<99;;;=\202::<\4""9" \
- "9;\347\347\347\377\377\377\376\376\376\240\377\377\377\1\234\234\236" \
- "\205::<\1;;=\203::<\202;;=\1""99;\203;;=\2::<;;=\203::<\1;;=\202::<\2" \
- ";;=::<\202;;=\7::<;;=99;::<;;=99;;;=\202::<\3;;=xxx\362\362\362\227\377" \
- "\377\377\1\234\234\234\205::<\202;;=\4::<;;=::<;;=\223::<\2;;=99;\202" \
- ";;=\1\234\234\236\231\377\377\377\3\214\305@\214\306>\214\305@\207\214" \
- "\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306" \
- ">\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210" \
- "\214\306>\12\212\307>\215\306A\214\305@\215\307\77\213\306:\226\312N" \
- "\372\374\361\375\376\377\377\377\375\377\377\373\224\377\377\377\213" \
- "\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p" \
- "\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>" \
- "\3\214\305@\214\306>\214\305@\211\377\377\377\10\376\377\377\376\376" \
- "\377\376\377\377\377\375\376\307\342\237\214\306<\215\306A\214\305@\210" \
- "\214\306>\5\215\307\77\213\305=\216\306A\213\310\77\277\337\223\202\377" \
- "\377\375\1\377\376\377\210\377\377\377\14\376\377\375\376\376\376\377" \
- "\376\377\377\377\375\377\376\377\377\377\377\303\342\236\215\307\77\216" \
- "\306A\215\305>\214\306<\215\306A\203\214\306>\20\215\307\77\212\307>" \
- "\215\305@\216\306\77\214\305@\216\307<\223\312K\356\372\346\377\377\377" \
- "\376\377\377\375\377\376\377\377\377\377\376\377\377\377\375\377\377" \
- "\377\377\377\375\216\377\377\377\1\376\376\376\203\377\377\377\2\375" \
- "\375\375\205\205\207\202::<\202;;=\3::<;;=::<\202;;=\6::<:::SSS\250\250" \
- "\250\346\346\346\376\376\376\216\377\377\377\3\332\332\332\220\220\220" \
- "SSS\202::<\4;;=99;::<;;=\202::<\1""99;\202;;=\2__a\332\332\334\223\377" \
- "\377\377\1\316\316\316\204::<\6;;=RRT\235\235\237\235\235\235\233\233" \
- "\233\234\234\234\212\234\234\236\5xxzkkm__a99;;;=\204::<\202;;=\1""9" \
- "9;\202::<\1\316\316\316\244\377\377\377\4\204\204\206;;=::<;;=\202::" \
- "<\2;;=\220\220\222\203\377\377\377\1\376\376\376\236\377\377\377\1\234" \
- "\234\236\203::<\3;;=::<kkm\203\234\234\236\3\233\233\235\234\234\236" \
- "\235\235\237\204\234\234\236\2xxzlln\202kkm\1FFH\202;;=\2""99;;;=\202" \
- "::<\3""99;::<;;=\202::<\1;;=\205::<\3GGI\301\301\301\376\376\376\225" \
- "\377\377\377\1\234\234\234\205::<\5lln\234\234\236\233\233\233\235\235" \
- "\235\234\234\234\224\234\234\236\5\234\234\234\235\235\235\233\233\233" \
- "\234\234\234\316\316\316\231\377\377\377\3\214\305@\214\306>\214\305" \
- "@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377" \
- "\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1" \
- "\214\305@\210\214\306>\7\212\306@\214\306<\217\307@\214\304\77\214\311" \
- ">\214\306>\251\323m\202\376\377\377\4\376\376\374\377\377\375\377\377" \
- "\377\376\376\376\202\377\377\377\1\376\376\376\216\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\212\377\377\377\7\377\377\375\377\376\377\376" \
- "\377\377\377\376\377\251\323o\211\307>\214\305@\210\214\306>\7\212\307" \
- ">\215\305>\214\305@\214\306>\215\307\77\347\365\334\377\376\377\211\377" \
- "\377\377\2\377\376\377\375\377\374\203\377\376\377\15\352\364\333\212" \
- "\306@\215\306A\214\306>\215\307\77\213\310\77\214\306>\216\306A\215\306" \
- "A\214\306<\212\307>\213\310=\212\307>\202\214\305@\4\214\306>\314\345" \
- "\253\377\376\377\376\377\377\202\377\377\375\6\377\376\377\375\376\377" \
- "\377\377\377\377\376\377\376\377\375\377\376\377\217\377\377\377\3\376" \
- "\376\376\362\362\362lln\20299;\1;;=\204::<\202;;=\6::<\204\204\204\317" \
- "\317\317\376\376\376\377\377\377\376\376\376\206\377\377\377\1\376\376" \
- "\376\213\377\377\377\2\301\301\301kkm\211::<\6;;=FFH\301\301\301\376" \
- "\376\376\377\377\377\376\376\376\217\377\377\377\1\316\316\316\204::" \
- "<\3;;=kkm\376\376\376\221\377\377\377\3\316\316\316\204\204\204FFF\202" \
- "::<\1;;=\202::<\202;;=\2FFH\363\363\363\242\377\377\377\5\364\364\364" \
- "::<;;=99;;;=\203::<\3GGI\363\363\363\376\376\376\240\377\377\377\1\234" \
- "\234\236\205::<\1\234\234\236\210\377\377\377\1\376\376\376\204\377\377" \
- "\377\1\376\376\376\202\377\377\377\6\362\362\362\316\316\316\265\265" \
- "\265\234\234\234kkmFFH\202::<\2;;=99;\205::<\1;;=\202::<\1\221\221\221" \
- "\225\377\377\377\1\234\234\234\205::<\1\234\234\236\202\377\377\377\1" \
- "\376\376\376\225\377\377\377\1\375\375\375\235\377\377\377\3\214\305" \
- "@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324" \
- "p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320" \
- "\202\214\306>\1\214\305@\210\214\306>\4\215\307\77\214\306>\214\304\77" \
- "\214\306>\202\214\305@\6\215\307\77\307\341\240\376\377\375\376\377\377" \
- "\376\376\374\377\377\373\202\377\377\377\202\377\377\375\216\377\377" \
- "\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252" \
- "\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214" \
- "\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\212\377\377\377\7\377\376\377\376\376" \
- "\377\377\377\377\376\376\377\361\372\347\222\312K\215\305>\210\214\306" \
- ">\10\214\305@\215\306A\214\305@\214\306<\213\304A\243\322b\376\376\374" \
- "\376\377\375\211\377\377\377\24\377\377\373\377\377\377\376\377\377\377" \
- "\377\375\242\320c\215\307=\214\306>\213\310\77\213\304A\212\306@\215" \
- "\307\77\215\305@\214\306>\215\307\77\212\306@\215\305>\215\307\77\213" \
- "\310\77\213\306:\253\325q\202\377\377\377\11\377\377\375\377\376\377" \
- "\377\377\377\377\377\375\376\377\375\377\377\375\377\375\377\376\377" \
- "\377\377\377\375\214\377\377\377\7\376\376\376\377\377\377\376\376\376" \
- "\363\363\363__a::<;;=\203::<\202;;=\202::<\4xxz\347\347\351\377\377\377" \
- "\376\376\376\210\377\377\377\1\376\376\376\204\377\377\377\2\376\376" \
- "\376\377\377\377\203\376\376\376\205\377\377\377\2\316\316\320kkm\202" \
- "::<\3;;=::<;;=\202::<\202;;=\2:::\250\250\250\202\377\377\377\1\376\376" \
- "\376\216\377\377\377\1\316\316\316\205::<\1kkm\203\377\377\377\1\376" \
- "\376\376\215\377\377\377\1\376\376\376\202\377\377\377\3\363\363\363" \
- "xxx::<\202;;=\203::<\2;;=xxz\242\377\377\377\1\234\234\234\202::<\1;" \
- ";=\202::<\1;;=\202::<\1\234\234\234\241\377\377\377\1\234\234\236\202" \
- "::<\10;;=::<;;=\234\234\236\377\377\377\376\376\376\377\377\377\376\376" \
- "\376\216\377\377\377\1\376\376\376\203\377\377\377\3\332\332\332\221" \
- "\221\223FFH\205::<\2;;=::<\202;;=\2::<\204\204\204\224\377\377\377\1" \
- "\234\234\234\205::<\3\234\234\236\377\377\377\376\376\376\264\377\377" \
- "\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214" \
- "\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377" \
- "\1\342\361\320\202\214\306>\1\214\305@\210\214\306>\5\216\306\77\212" \
- "\307>\215\307=\212\306@\214\306>\202\215\305>\5\215\305@\345\356\317" \
- "\376\377\375\376\377\377\377\377\375\202\377\377\377\1\377\377\375\217" \
- "\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377" \
- "\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214" \
- "\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@" \
- "\207\214\306>\3\214\305@\214\306>\214\305@\211\377\377\377\4\376\377" \
- "\377\377\377\377\377\377\375\376\377\377\202\377\377\377\2\315\347\252" \
- "\212\306@\210\214\306>\10\216\306A\212\306@\212\307>\215\305<\213\310" \
- "\77\215\305>\307\341\240\376\377\377\212\377\377\377\10\375\377\374\377" \
- "\377\377\305\342\237\215\305@\212\306@\216\306\77\215\307=\215\305>\202" \
- "\214\306>\24\213\307A\213\310=\215\304B\214\306>\212\306@\215\304B\212" \
- "\307>\225\311K\370\373\362\377\377\377\376\377\375\377\377\375\377\377" \
- "\377\374\377\375\376\376\376\377\377\377\377\377\375\377\376\377\376" \
- "\377\377\377\377\375\211\377\377\377\1\376\376\376\205\377\377\377\1" \
- "___\204::<\1;;=\203::<\2SSS\316\316\316\235\377\377\377\2\317\317\317" \
- "``b\207::<\3;;=::<\204\204\206\220\377\377\377\1\316\316\316\205::<\1" \
- "kkm\226\377\377\377\3\204\204\206::<;;=\205::<\1\316\316\316\232\377" \
- "\377\377\1\376\376\376\205\377\377\377\2\364\364\364FFF\202;;=\202::" \
- "<\6;;=99;;;=::<FFH\363\363\363\240\377\377\377\1\234\234\236\205::<\1" \
- "\234\234\234\226\377\377\377\1\376\376\376\202\377\377\377\3\265\265" \
- "\265RRR:::\202::<\1;;=\202::<\4;;=::<;;=\204\204\204\203\377\377\377" \
- "\1\376\376\376\217\377\377\377\1\234\234\234\205::<\1\234\234\236\266" \
- "\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215" \
- "\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377" \
- "\377\377\1\342\361\320\202\214\306>\1\214\305@\220\214\306>\2\222\313" \
- "J\366\373\364\202\377\376\377\4\377\377\373\376\376\374\376\377\377\377" \
- "\376\377\216\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240" \
- "\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3" \
- "\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305" \
- ">\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\211\377\377\377" \
- "-\377\377\375\376\377\377\377\377\377\376\376\374\376\377\377\377\376" \
- "\377\376\377\377\252\324p\212\306@\215\305>\212\307<\215\305@\215\305" \
- "<\214\305B\215\305@\214\306<\212\307>\215\305>\214\306>\211\306=\215" \
- "\305>\212\307>\214\306<\350\364\334\374\377\377\377\376\377\376\376\376" \
- "\374\377\375\377\377\377\376\377\375\377\377\375\377\376\377\377\377" \
- "\375\377\377\377\377\376\377\357\367\350\223\312K\213\310\77\215\305" \
- ">\214\306>\215\305>\213\310\77\212\306@\214\306>\215\305@\202\214\306" \
- ">\10\214\305@\216\306=\212\307>\215\305>\333\355\303\376\376\374\377" \
- "\377\377\377\377\375\223\377\377\377\1\376\376\376\203\377\377\377\1" \
- "\203\203\203\206::<\4;;=::<\204\204\206\363\363\363\230\377\377\377\1" \
- "\376\376\376\207\377\377\377\1\235\235\237\202::<\1;;=\203::<\5;;=99" \
- ";;;=\204\204\204\376\376\376\216\377\377\377\1\316\316\316\205::<\1k" \
- "km\227\377\377\377\12\204\204\206::<;;=::<99;;;=::<\204\204\204\377\377" \
- "\377\376\376\376\232\377\377\377\1\376\376\376\203\377\377\377\2\234" \
- "\234\234;;=\203::<\1;;=\204::<\3<<>\250\250\250\376\376\376\237\377\377" \
- "\377\1\234\234\236\205::<\1\234\234\234\231\377\377\377\10\376\376\376" \
- "\377\377\377\265\265\265FFH::<;;=::<;;=\203::<\2;;=\204\204\204\222\377" \
- "\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305" \
- "@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324" \
- "p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320" \
- "\202\214\306>\1\214\305@\220\214\306>\4\216\306\77\250\322n\376\377\375" \
- "\376\377\373\222\377\377\377\213\214\306>\3\215\305>\214\306>\305\342" \
- "\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215" \
- "\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\211\377\377" \
- "\377\13\376\376\377\376\377\377\377\376\377\376\376\374\374\377\377\377" \
- "\377\375\377\376\377\356\372\346\225\311K\214\306>\213\310=\203\214\306" \
- ">\2\213\310\77\214\306>\202\214\305@\7\214\306<\213\307A\214\304\77\214" \
- "\305B\212\307>\244\317d\377\376\377\202\377\377\377\1\377\375\377\202" \
- "\377\377\377\25\376\377\377\377\376\377\377\377\377\374\377\375\376\376" \
- "\374\253\324n\214\306<\215\307\77\215\305>\211\307@\216\305C\214\305" \
- "@\215\307\77\214\305@\214\306<\212\307<\211\306=\214\306>\214\305@\213" \
- "\307A\263\327}\202\376\377\377\3\377\377\377\377\375\376\377\377\375" \
- "\221\377\377\377\1\376\376\376\203\377\377\377\1\250\250\250\204::<\1" \
- ";;=\202::<\2;;=\264\264\264\202\377\377\377\1\376\376\376\232\377\377" \
- "\377\1\376\376\376\205\377\377\377\2\332\332\332SSS\202::<\1;;=\204:" \
- ":<\4xxx\364\364\364\377\377\377\376\376\376\214\377\377\377\1\316\316" \
- "\316\205::<\1kkm\227\377\377\377\2\363\363\363SSU\202::<\4;;=99;::<;" \
- ";;\202\377\377\377\1\376\376\376\226\377\377\377\1\376\376\376\204\377" \
- "\377\377\11\376\376\376\363\363\363FFH99;;;=::<;;=99;;;=\203::<\4""9" \
- "9;SSU\377\377\377\376\376\376\236\377\377\377\1\234\234\236\205::<\1" \
- "\234\234\234\225\377\377\377\1\376\376\376\204\377\377\377\10\376\376" \
- "\376\377\377\377\363\363\363yyy::<;;=99;;;=\204::<\1\266\266\266\221" \
- "\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214" \
- "\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252" \
- "\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361" \
- "\320\202\214\306>\1\214\305@\220\214\306>\4\214\306<\213\307A\275\335" \
- "\222\376\377\377\203\377\377\377\1\377\377\375\216\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\211\377\377\377\4\377\376\377\376\376\377\377" \
- "\377\377\377\377\375\202\376\377\377\5\377\375\376\377\376\377\315\346" \
- "\255\212\307>\214\305@\202\215\306A\22\214\305@\212\307<\214\305B\214" \
- "\306>\213\307A\214\306>\213\305=\214\306>\215\305>\213\307A\211\310<" \
- "\313\347\254\377\377\375\377\375\377\376\377\377\376\377\373\376\377" \
- "\377\377\376\377\202\376\377\377\10\377\377\377\315\346\254\212\307>" \
- "\212\306@\215\306A\216\306A\212\307>\214\306<\202\215\306A\10\215\306" \
- "C\214\305B\215\307\77\214\306<\214\305@\213\310<\222\310L\372\373\363" \
- "\225\377\377\377\1\376\376\376\202\377\377\377\6\376\376\376\333\333" \
- "\333::<;;=::<;;=\202::<\3;;=FFH\315\315\315\205\377\377\377\1\376\376" \
- "\376\225\377\377\377\202\376\376\376\202\377\377\377\1\376\376\376\202" \
- "\377\377\377\1\376\376\376\202\377\377\377\2\363\363\363xxx\204::<\2" \
- ";;=\203\203\203\220\377\377\377\1\316\316\316\205::<\1kkm\230\377\377" \
- "\377\3\266\266\27099;;;=\204::<\1\316\316\316\230\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\202\377\377\377\3\265\265\267::<;" \
- ";=\204::<\202;;=\202::<\202;;=\1\265\265\265\237\377\377\377\1\234\234" \
- "\236\205::<\1\234\234\234\236\377\377\377\5\234\234\234::<;;=::<;;=\202" \
- "::<\3;;=FFH\332\332\332\220\377\377\377\1\234\234\234\205::<\1\234\234" \
- "\236\266\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214" \
- "\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\220\214\306>" \
- "\4\215\307\77\214\304\77\213\310\77\333\355\303\202\377\377\377\1\376" \
- "\377\375\217\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240" \
- "\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3" \
- "\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305" \
- ">\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\213\377\377\377" \
- "\5\377\377\373\377\376\377\377\377\377\375\377\374\376\377\377\202\376" \
- "\376\376\22\260\331{\212\307>\214\306>\215\305>\215\305@\215\307\77\215" \
- "\307=\214\305@\214\306>\215\306A\214\306>\213\307C\214\306>\214\304;" \
- "\213\307A\222\312K\357\370\345\377\377\375\202\377\377\377\15\377\375" \
- "\376\377\377\375\376\376\376\377\377\375\361\367\351\222\311J\213\310" \
- "\77\214\305B\215\310<\213\305=\216\306\77\212\307<\214\305B\202\214\306" \
- ">\6\216\306\77\215\305@\215\306A\214\305@\215\305<\333\356\301\202\377" \
- "\376\377\3\377\377\375\377\377\377\377\376\377\225\377\377\377\1``b\202" \
- "::<\6;;=::<;;=::<FFH\331\331\333\233\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\206\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\205\205\207\203::<\1\204\204\206\221\377\377\377\1\316\316\316\205" \
- "::<\1kkm\231\377\377\377\1GGI\203;;=\202::<\3\235\235\237\377\377\377" \
- "\376\376\376\233\377\377\377\2\376\376\376SSU\203::<\5;;=99;llnkkm::" \
- "<\202;;=\202::<\1SSU\237\377\377\377\1\234\234\236\205::<\1\234\234\234" \
- "\224\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376\203\377" \
- "\377\377\4\376\376\376\266\266\270::<;;=\203::<\5""99;::<__a\377\377" \
- "\377\376\376\376\216\377\377\377\1\234\234\234\205::<\1\234\234\236\266" \
- "\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215" \
- "\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377" \
- "\377\377\1\342\361\320\202\214\306>\1\214\305@\220\214\306>\10\216\306" \
- "\77\215\306A\214\305@\224\310J\360\371\350\377\377\377\377\376\377\376" \
- "\377\377\216\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240" \
- "\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3" \
- "\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305" \
- ">\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\212\377\377\377" \
- "\1\377\377\375\202\377\377\377\2\377\376\377\377\377\377\202\376\377" \
- "\377\25\377\377\375\370\373\362\223\312K\212\307>\215\305>\216\306A\212" \
- "\307<\214\305B\215\307\77\214\305@\214\306>\214\305@\212\306@\215\307" \
- "=\216\306A\215\305>\214\306<\252\324n\376\377\377\376\376\376\377\376" \
- "\377\202\377\377\375\4\377\376\377\376\376\377\252\324n\215\306A\202" \
- "\214\306>\21\214\305@\215\307\77\215\305>\212\307>\214\306<\213\304A" \
- "\215\307=\214\304=\215\307\77\212\307>\214\306>\277\337\226\377\376\377" \
- "\376\377\375\377\377\375\377\377\377\376\376\376\225\377\377\377\3\234" \
- "\234\236::<;;=\204::<\4;;=\265\265\267\377\377\377\376\376\376\204\377" \
- "\377\377\202\376\376\376\202\377\377\377\1\376\376\376\225\377\377\377" \
- "\1\376\376\376\203\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\202\377\377\377\3\250\250\250::<\204\204\206\205\377\377\377\1\376" \
- "\376\376\214\377\377\377\1\316\316\316\205::<\1kkm\226\377\377\377\1" \
- "\376\376\376\202\377\377\377\2kkm99;\202::<\4;;=::<\204\204\206\376\376" \
- "\376\202\377\377\377\1\376\376\376\224\377\377\377\1\376\376\376\203" \
- "\377\377\377\2\376\376\376\265\265\265\202::<\1;;=\202::<\3;;=\316\316" \
- "\320\316\316\316\204::<\3;;=::<\266\266\266\236\377\377\377\1\234\234" \
- "\236\205::<\1\234\234\234\226\377\377\377\202\376\376\376\2\377\377\377" \
- "\376\376\376\205\377\377\377\4\376\376\376\251\251\253;;=99;\202::<\4" \
- "<<>99;::<\250\250\252\217\377\377\377\1\234\234\234\205::<\1\234\234" \
- "\236\266\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214" \
- "\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\220\214\306>" \
- "\202\214\305@\6\212\306@\215\307\77\243\321d\377\377\375\377\375\377" \
- "\376\377\377\216\377\377\377\213\214\306>\3\215\305>\214\306>\305\342" \
- "\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215" \
- "\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\211\377\377" \
- "\377\2\376\377\377\377\377\375\202\377\377\377\1\376\376\376\202\377" \
- "\377\377\6\376\377\372\376\377\377\377\376\377\331\357\301\213\304\77" \
- "\215\307=\202\214\305@\25\214\305B\214\306<\215\305@\212\307<\214\306" \
- ">\216\306=\212\307>\212\306B\214\305@\215\306E\212\306@\313\347\255\376" \
- "\377\375\376\376\377\376\377\377\377\376\377\377\377\377\333\355\305" \
- "\212\307>\216\306\77\215\307\77\202\214\306>\1\215\307\77\202\214\306" \
- ">\13\215\305<\212\306@\212\307<\215\307\77\211\306=\213\307A\233\314" \
- "V\370\373\362\377\377\375\377\377\377\376\377\377\202\377\377\375\2\374" \
- "\377\377\377\375\376\222\377\377\377\3\363\363\363GGI::<\202;;=\202:" \
- ":<\2;;=\234\234\234\214\377\377\377\1\376\376\376\221\377\377\377\1\376" \
- "\376\376\202\377\377\377\3\376\376\376\377\377\377\376\376\376\206\377" \
- "\377\377\3\376\376\376\377\377\377\316\316\316\203\377\377\377\1\376" \
- "\376\376\203\377\377\377\1\376\376\376\213\377\377\377\1\316\316\316" \
- "\205::<\1kkm\227\377\377\377\5\376\376\376\377\377\377\235\235\237::" \
- "<;;=\203::<\2lln\376\376\376\203\377\377\377\1\376\376\376\224\377\377" \
- "\377\13\376\376\376\377\377\377\376\376\376\377\377\377RRR::<99;::<;" \
- ";=::<kkm\202\377\377\377\1__a\203;;=\202::<\1kkk\236\377\377\377\1\234" \
- "\234\236\205::<\1\234\234\234\241\377\377\377\2\204\204\204;;=\202::" \
- "<\5""99;::<;;=FFH\363\363\363\216\377\377\377\1\234\234\234\205::<\1" \
- "\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305@\207\214\306" \
- ">\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>" \
- "\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\221" \
- "\214\306>\5\213\307A\216\306\77\212\307<\214\306>\277\337\223\220\377" \
- "\377\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377" \
- "\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306" \
- ">\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207" \
- "\214\306>\3\214\305@\214\306>\214\305@\211\377\377\377\4\376\377\377" \
- "\377\377\375\377\375\377\377\377\377\202\377\377\375\202\377\376\377" \
- "\202\376\377\377\22\377\376\377\262\331~\213\304\77\213\310\77\216\306" \
- "A\212\307<\215\306A\214\304=\213\310\77\214\305@\215\304B\214\305B\214" \
- "\306<\212\307>\212\307<\216\306A\221\312I\370\373\362\203\377\377\377" \
- "\13\370\373\364\226\310K\214\306>\212\307>\215\304B\214\306>\215\306" \
- "A\213\304\77\215\306A\214\306>\215\305@\202\212\306@\13\215\307\77\213" \
- "\310=\220\303@\336\362\315\377\376\377\377\377\377\374\377\377\377\376" \
- "\377\377\377\377\376\376\374\376\377\375\223\377\377\377\1\204\204\206" \
- "\203::<\4""99;;;=::<kkm\211\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\221\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\237\377\377\377\1\316\316\316\205::<\1kkm\231\377\377\377\4\234" \
- "\234\236;;=::<;;=\202::<\3jjl\377\377\377\376\376\376\232\377\377\377" \
- "\10\265\265\265:::::<;;=::<99;::<\316\316\316\202\377\377\377\1\265\265" \
- "\267\204::<\3;;=::<\316\316\316\235\377\377\377\1\234\234\236\205::<" \
- "\1\234\234\234\241\377\377\377\2\363\363\363__a\203::<\4;;=::<;;=\234" \
- "\234\236\216\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377" \
- "\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214" \
- "\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377" \
- "\1\342\361\320\202\214\306>\1\214\305@\220\214\306>\10\215\304B\214\306" \
- "<\214\305@\215\305@\212\306@\215\305>\323\354\265\377\376\377\216\377" \
- "\377\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377" \
- "\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306" \
- ">\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207" \
- "\214\306>\3\214\305@\214\306>\214\305@\212\377\377\377\3\375\377\376" \
- "\377\377\377\377\377\375\202\377\377\377\26\377\377\375\375\377\374\376" \
- "\377\377\377\376\377\377\377\375\365\375\362\225\311K\212\306@\214\306" \
- ">\214\305@\212\306@\216\306=\211\306;\215\306A\214\306>\215\307\77\217" \
- "\304@\214\306>\212\307>\215\305@\214\305@\262\327z\203\377\377\377\13" \
- "\260\331{\213\310\77\214\305B\214\305@\215\305@\215\307\77\212\307<\216" \
- "\306A\213\305;\214\305@\215\305>\202\214\306>\11\215\305@\214\306<\276" \
- "\340\224\377\376\375\377\377\375\376\377\377\377\376\375\376\377\375" \
- "\377\376\377\202\377\377\377\1\376\377\375\221\377\377\377\1\346\346" \
- "\346\206::<\2:::\346\346\346\202\377\377\377\1\376\376\376\276\377\377" \
- "\377\1\316\316\316\205::<\1kkm\216\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\207\377\377\377\3\234\234\236::<;;=\203::<\1k" \
- "km\226\377\377\377\1\376\376\376\204\377\377\377\2\376\376\376lln\205" \
- "::<\1``b\204\377\377\377\1SSS\205::<\1kkm\235\377\377\377\1\234\234\236" \
- "\205::<\1\234\234\234\242\377\377\377\2\316\316\316:::\202::<\5;;=::" \
- "<;;=FFH\363\363\363\206\377\377\377\1\376\376\376\206\377\377\377\1\234" \
- "\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214" \
- "\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377" \
- "\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306" \
- ">\1\214\305@\210\214\306>\27\215\306A\212\307>\215\305>\215\305@\215" \
- "\307=\217\304B\214\306<\214\305@\215\307\77\215\305@\215\307\77\214\305" \
- "@\216\306\77\211\310<\226\312L\347\364\332\377\377\377\377\376\377\377" \
- "\377\375\374\377\377\377\376\377\376\376\376\376\377\377\207\377\377" \
- "\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252" \
- "\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214" \
- "\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\221\377\377\377\1\377\377\375\203\377" \
- "\377\377\5\333\355\303\214\306>\212\307<\216\306A\214\305@\202\214\306" \
- ">\15\215\305@\214\306>\212\306@\213\310\77\215\305>\216\306A\211\306" \
- "=\212\306@\212\307<\334\354\305\377\377\375\335\354\303\212\307>\210" \
- "\214\306>\10\216\306A\212\307;\215\306A\216\306A\214\305@\241\321a\371" \
- "\374\361\375\376\377\223\377\377\377\1\376\376\376\204\377\377\377\2" \
- "\376\376\376\234\234\234\203::<\1""99;\202::<\1\234\234\234\302\377\377" \
- "\377\1\316\316\316\205::<\1kkm\217\377\377\377\1\376\376\376\202\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377\377\3\376" \
- "\376\376\377\377\377xxz\202::<\5""99;::<;;=xxz\376\376\377\232\377\377" \
- "\377\3\317\317\31799;;;=\202::<\5;;=::<\265\265\265\377\377\377\376\376" \
- "\376\202\377\377\377\2\265\265\265;;=\202::<\203;;=\1\332\332\332\203" \
- "\377\377\377\1\376\376\376\230\377\377\377\1\234\234\236\205::<\1\234" \
- "\234\234\242\377\377\377\4\376\376\376\204\204\204::<;;=\202::<\3;;=" \
- "::<\266\266\266\207\377\377\377\1\376\376\376\205\377\377\377\1\234\234" \
- "\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305" \
- "@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377" \
- "\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1" \
- "\214\305@\211\214\306>\27\216\306A\214\306>\212\306@\214\306<\213\310" \
- "\77\215\305@\215\307\77\213\305=\216\306\77\212\307;\212\306@\215\305" \
- ">\215\306A\212\307>\245\320d\367\375\361\376\377\377\377\376\377\377" \
- "\377\377\376\376\377\377\376\377\375\377\376\377\377\375\206\377\377" \
- "\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252" \
- "\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214" \
- "\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\221\377\377\377\6\376\376\376\377\376" \
- "\377\377\377\377\375\377\376\376\377\377\270\333\207\203\214\306>\17" \
- "\211\306=\212\307<\214\306<\214\305@\215\307\77\214\305@\216\305C\214" \
- "\306>\212\310A\215\305@\216\306\77\223\312K\360\371\346\222\311I\214" \
- "\305@\210\214\306>\10\214\305@\212\307>\214\305@\216\306A\215\307=\350" \
- "\364\334\375\377\376\377\376\377\225\377\377\377\7\376\376\376\377\377" \
- "\377\376\376\376\377\377\377SSS::<;;=\203::<\5FFH\364\364\364\376\376" \
- "\376\377\377\377\376\376\376\277\377\377\377\1\316\316\316\205::<\1k" \
- "km\222\377\377\377\1\376\376\376\204\377\377\377\3\376\376\376\377\377" \
- "\377SSU\205::<\1\234\234\236\202\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\220\377\377\377\1\376\376\376\204\377\377\377\2kk" \
- "m;;=\202::<\5;;=::<SSU\377\377\377\376\376\376\204\377\377\377\7SSU:" \
- ":<;;=::<;;=::<\205\205\205\234\377\377\377\1\234\234\236\205::<\1\234" \
- "\234\234\240\377\377\377\1\376\376\376\202\377\377\377\1\346\346\346" \
- "\202::<\1;;=\202::<\2;;=__a\205\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\204\377\377\377\1\234\234\234\205::<\1\234\234\236" \
- "\266\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305" \
- "@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p" \
- "\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\27" \
- "\214\304=\215\305>\213\307A\212\306@\214\305B\215\305<\213\310=\215\307" \
- "\77\215\304B\214\306<\213\307A\215\305>\216\306A\212\306@\212\307>\270" \
- "\332\204\377\376\377\377\377\377\377\376\377\376\376\374\377\377\373" \
- "\377\376\377\377\377\375\206\377\377\377\213\214\306>\3\215\305>\214" \
- "\306>\305\342\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305" \
- "@\207\214\306>\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324" \
- "p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\223\377\377\377\1\377\377\375\202\377\377\377\2\371\372\364\232\315" \
- "W\202\214\305@\4\214\306<\215\307\77\214\305B\215\306C\202\215\306A\1" \
- "\214\306<\202\212\307>\6\215\305@\212\307>\215\305>\212\306B\216\306" \
- "A\212\307>\210\214\306>\10\214\305B\215\307\77\214\306<\214\306>\304" \
- "\341\237\377\377\377\377\376\377\377\377\375\220\377\377\377\1\376\376" \
- "\376\203\377\377\377\1\376\376\376\203\377\377\377\10\301\301\301::<" \
- ";;=99;;;=::<99;\234\234\236\207\377\377\377\1\376\376\376\273\377\377" \
- "\377\1\316\316\316\205::<\1kkm\216\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\204\377\377\377\3\376\376\376\377\377\377\315" \
- "\315\315\202;;=\203::<\6;;=\265\265\267\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\225\377\377\377\2\376\376\376\317\317\317\203::<\4;" \
- ";=::<;;=\264\264\264\206\377\377\377\10\234\234\234;;=::<;;=99;;;=::" \
- "<\346\346\346\233\377\377\377\1\234\234\236\205::<\1\234\234\234\237" \
- "\377\377\377\1\376\376\376\204\377\377\377\1\204\204\206\202::<\6;;=" \
- "99;;;=::<\346\346\346\376\376\376\204\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\204\377\377\377\1\234\234\234\205::<\1\234\234\236\266" \
- "\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215" \
- "\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377" \
- "\377\377\1\342\361\320\202\214\306>\1\214\305@\210\214\306>\22\215\307" \
- "\77\212\307>\216\306A\212\304<\215\307\77\215\305@\216\306\77\213\307" \
- "A\214\306>\214\305@\215\307\77\213\310=\212\307>\214\306>\214\306<\214" \
- "\306>\216\306\77\324\353\267\202\376\376\376\3\377\377\377\376\376\377" \
- "\376\377\375\207\377\377\377\213\214\306>\3\215\305>\214\306>\305\342" \
- "\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215" \
- "\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\221\377\377" \
- "\377\3\376\377\377\377\377\377\376\377\375\202\377\377\377\7\377\376" \
- "\377\341\363\315\215\305@\214\305@\215\306A\215\305@\216\306\77\202\214" \
- "\306>\12\214\305B\212\307<\213\304A\213\310=\216\306A\211\306;\213\310" \
- "=\214\305@\212\307>\215\305>\210\214\306>\10\215\307\77\214\304=\212" \
- "\307>\243\322b\377\377\377\376\377\377\377\376\377\377\377\375\226\377" \
- "\377\377\4\376\376\376\377\377\377\204\204\206;;=\203::<\3""99;;;=\364" \
- "\364\364\205\377\377\377\1\376\376\376\275\377\377\377\1\316\316\316" \
- "\205::<\1kkm\217\377\377\377\202\376\376\376\202\377\377\377\1\376\376" \
- "\376\203\377\377\377\4\376\376\376xxz;;=99;\202;;=\4::<;;=\346\346\346" \
- "\376\376\376\204\377\377\377\1\376\376\376\224\377\377\377\1xxz\203:" \
- ":<\3;;=::<SSU\203\377\377\377\1\376\376\376\203\377\377\377\2\363\363" \
- "\363FFH\202::<\4;;=99;::<\204\204\206\233\377\377\377\1\234\234\236\205" \
- "::<\1\234\234\234\244\377\377\377\1\316\316\316\202;;=\5::<;;=99;;;=" \
- "\250\250\252\203\377\377\377\1\376\376\376\210\377\377\377\1\234\234" \
- "\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305" \
- "@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377" \
- "\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1" \
- "\214\305@\210\214\306>\7\213\305=\214\306<\210\306\77\216\306\77\215" \
- "\307=\214\306>\215\307\77\202\214\306>\14\215\307\77\214\305B\214\306" \
- "<\212\307<\214\305@\216\306\77\215\305>\214\305@\224\313L\352\364\331" \
- "\374\377\377\377\376\377\211\377\377\377\213\214\306>\3\215\305>\214" \
- "\306>\305\342\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305" \
- "@\207\214\306>\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324" \
- "p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\222\377\377\377\1\376\377\377\202\377\377\377\24\376\376\374\376\377" \
- "\375\377\375\377\277\337\224\214\306>\212\307>\215\307\77\214\304=\215" \
- "\307=\213\304A\214\306<\212\307>\215\307\77\214\305@\213\304\77\215\307" \
- "\77\215\305@\214\304=\215\305<\215\306A\210\214\306>\1\212\307>\202\215" \
- "\306A\4\350\365\333\377\375\376\377\376\377\375\376\377\226\377\377\377" \
- "\1\376\376\376\202\377\377\377\3TTV::<99;\202;;=\4::<\203\203\203\377" \
- "\377\377\376\376\376\302\377\377\377\1\316\316\316\205::<\1kkm\222\377" \
- "\377\377\1\376\376\376\204\377\377\377\3\300\300\302;;=::<\202;;=\202" \
- "::<\2```\376\376\376\227\377\377\377\7\376\376\376\377\377\377\346\346" \
- "\346;;=99;::<;;=\202::<\3\251\251\251\377\377\377\376\376\376\206\377" \
- "\377\377\1\234\234\234\202::<\1;;=\202::<\2;;=\346\346\346\232\377\377" \
- "\377\1\234\234\236\205::<\1\234\234\234\235\377\377\377\1\376\376\376" \
- "\207\377\377\377\11SSU::<;;=99;<<>::<xxz\377\377\377\376\376\376\212" \
- "\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214" \
- "\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252" \
- "\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361" \
- "\320\202\214\306>\1\214\305@\210\214\306>\25\213\307A\216\306A\232\315" \
- "W\215\306C\212\306@\214\305@\212\307;\216\306A\215\305>\215\307\77\214" \
- "\305@\215\307\77\214\306>\214\305@\212\306B\213\307C\214\306>\215\305" \
- "@\232\315V\372\374\367\376\376\376\202\377\377\375\1\376\376\376\206" \
- "\377\377\377\213\214\306>\3\215\305>\214\306>\305\342\240\215\377\377" \
- "\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214" \
- "\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@" \
- "\207\214\306>\3\214\305@\214\306>\214\305@\221\377\377\377\5\377\376" \
- "\377\376\377\377\377\375\376\377\376\377\376\377\377\202\377\377\377" \
- "\10\370\373\362\233\314V\213\307A\211\306=\215\307\77\212\307<\212\306" \
- "@\215\305<\202\214\306>\7\215\307=\215\306A\214\305@\212\307>\216\306" \
- "A\212\306@\215\307=\210\214\306>\10\212\307>\212\307<\313\347\254\376" \
- "\377\377\377\377\377\377\376\377\376\377\377\377\377\375\223\377\377" \
- "\377\1\376\376\376\203\377\377\377\1\332\332\332\202::<\1;;=\203::<\1" \
- "\302\302\302\203\377\377\377\5\376\376\376\377\377\377\376\376\376\377" \
- "\377\377\376\376\376\274\377\377\377\1\316\316\316\205::<\1kkm\217\377" \
- "\377\377\1\376\376\376\206\377\377\377\3\332\332\334FFH;;=\205::<\1\265" \
- "\265\265\202\377\377\377\1\376\376\376\224\377\377\377\1\376\376\376" \
- "\202\377\377\377\1\205\205\207\202::<\1;;=\202::<\2GGI\363\363\363\202" \
- "\377\377\377\1\376\376\376\205\377\377\377\1\363\363\363\202::<\1;;=" \
- "\202::<\2""99;\234\234\234\203\377\377\377\1\376\376\376\226\377\377" \
- "\377\1\234\234\236\205::<\1\234\234\234\234\377\377\377\1\376\376\376" \
- "\210\377\377\377\3\222\222\222::<99;\202;;=\5""99;GGI\376\376\376\377" \
- "\377\377\376\376\376\211\377\377\377\1\234\234\234\205::<\1\234\234\236" \
- "\266\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305" \
- "@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p" \
- "\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210\214\306>\10" \
- "\213\307A\214\306>\331\356\303\232\315W\215\305>\215\306A\214\305B\214" \
- "\306>\202\214\305@\7\213\310=\214\306>\215\304B\215\306A\211\306;\213" \
- "\310\77\214\305@\202\215\307\77\2\257\326{\376\377\373\202\377\377\377" \
- "\1\377\377\375\206\377\377\377\213\214\306>\3\215\305>\214\306>\305\342" \
- "\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306" \
- ">\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215" \
- "\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\221\377\377" \
- "\377\6\377\377\373\377\377\375\377\377\377\376\376\377\377\376\377\373" \
- "\377\374\202\377\376\377\4\336\362\315\220\303@\213\310=\215\307\77\202" \
- "\212\306@\1\215\305@\202\214\306>\7\213\305=\214\306>\213\305=\214\305" \
- "@\213\310\77\212\306@\213\307A\210\214\306>\10\215\307\77\252\324p\377" \
- "\377\375\376\377\377\377\377\375\377\377\377\377\376\377\377\377\375" \
- "\220\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\265\265\265\204::<\5;;=::<\363\363\363\377\377\377\376\376" \
- "\376\302\377\377\377\1\316\316\316\205::<\1kkm\225\377\377\377\2\317" \
- "\317\317FFH\206::<\1SSU\204\377\377\377\1\376\376\376\225\377\377\377" \
- "\2\346\346\346;;=\203::<\3;;=::<\234\234\236\202\377\377\377\1\376\376" \
- "\376\207\377\377\377\2\204\204\206;;=\204::<\2FFF\362\362\362\231\377" \
- "\377\377\1\234\234\236\205::<\1\234\234\234\245\377\377\377\1\301\301" \
- "\301\202::<\6;;=::<;;=::<\347\347\347\376\376\376\212\377\377\377\1\234" \
- "\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214" \
- "\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377" \
- "\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306" \
- ">\1\214\305@\210\214\306>\27\214\305@\215\305<\342\362\315\353\365\334" \
- "\223\312K\215\305<\212\306@\215\305<\212\307>\215\306A\214\306>\212\307" \
- ">\215\307\77\215\304B\215\307\77\215\305@\214\306>\215\305>\214\305@" \
- "\215\305<\315\345\253\377\377\375\376\377\377\207\377\377\377\213\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\221\377\377\377\14\376\377\377\376\376\377\377" \
- "\377\377\377\377\373\376\377\375\377\376\377\376\377\377\377\377\377" \
- "\377\376\375\276\340\224\214\306<\215\305@\202\214\306>\12\215\305>\214" \
- "\305@\215\305@\214\305@\213\310\77\214\306>\216\306\77\211\305\77\215" \
- "\307=\214\305@\210\214\306>\4\223\312K\360\367\347\377\377\377\377\377" \
- "\375\232\377\377\377\2\376\376\376\234\234\236\204::<\2;;=___\234\377" \
- "\377\377\1\376\376\376\203\377\377\377\1\376\376\376\244\377\377\377" \
- "\1\316\316\316\205::<\1kkm\202\377\377\377\1\376\376\376\216\377\377" \
- "\377\4\376\376\376\377\377\377\347\347\347\204\204\204\203::<\6;;=::" \
- "<;;=::<;;=\301\301\303\226\377\377\377\1\376\376\376\203\377\377\377" \
- "\1\203\203\205\202;;=\5::<;;=::<GGG\363\363\363\206\377\377\377\1\376" \
- "\376\376\203\377\377\377\3\347\347\34799;;;=\202::<\202;;=\1\234\234" \
- "\236\231\377\377\377\1\234\234\236\205::<\1\234\234\234\245\377\377\377" \
- "\1\363\363\363\202::<\1""99;\203::<\1\316\316\316\213\377\377\377\1\234" \
- "\234\234\204::<\2;;=kkm\203\234\234\236\2\235\235\237\234\234\234\220" \
- "\234\234\236\204\234\234\234\4\235\235\235\234\234\234\234\234\236\346" \
- "\346\350\231\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4" \
- "\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250" \
- "\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210\214\306" \
- ">\40\213\307A\215\305>\341\360\317\377\375\376\324\353\267\215\304B\214" \
- "\306>\215\307=\214\305@\212\307>\212\307<\215\305<\215\306A\214\306>" \
- "\214\306<\212\306@\214\305@\215\307\77\216\306=\212\306B\214\306>\352" \
- "\364\333\377\376\377\377\377\377\377\376\377\377\377\377\377\377\375" \
- "\376\377\373\375\376\377\377\376\377\214\306>\215\307\77\211\214\306" \
- ">\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214\306" \
- ">\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232\377" \
- "\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305" \
- "@\214\306>\214\305@\232\377\377\377\7\374\377\375\242\321a\216\306A\212" \
- "\307>\214\306>\215\307\77\212\307<\210\214\306>\16\215\307\77\214\307" \
- ";\213\304\77\216\306A\214\305B\215\307\77\215\305>\212\307>\320\345\254" \
- "\374\377\377\377\376\377\377\377\375\377\376\377\375\377\372\223\377" \
- "\377\377\1\376\376\376\203\377\377\377\3\376\376\376\377\377\377kkm\203" \
- "::<\3<<>::<\221\221\221\305\377\377\377\1\316\316\316\204::<\2;;=jjl" \
- "\217\377\377\377\16\316\316\316\300\300\300\234\234\234__a::<;;=::<;" \
- ";=::<99;;;=::<;;=\204\204\206\232\377\377\377\1\362\362\362\202;;=\202" \
- "::<\3""99;::<\235\235\235\212\377\377\377\12\376\376\376\377\377\377" \
- "\205\205\20799;;;=::<;;=::<GGI\376\376\376\230\377\377\377\1\234\234" \
- "\236\205::<\1\234\234\234\246\377\377\377\10EEG::<;;=::<99;;;=\234\234" \
- "\234\377\377\377\202\376\376\376\202\377\377\377\1\376\376\376\205\377" \
- "\377\377\1\234\234\234\205::<\2;;=99;\202;;=\2""99;;;=\221::<\1""99;" \
- "\203::<\3;;=::<\316\316\316\231\377\377\377\3\214\305@\214\306>\214\305" \
- "@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377" \
- "\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1" \
- "\214\305@\210\214\306>\202\214\306<\32\342\361\322\377\377\377\377\377" \
- "\375\266\334\205\212\306B\215\307\77\212\306@\220\306=\214\306>\215\307" \
- "\77\214\305B\213\305=\216\306\77\215\307\77\215\305<\212\306B\215\306" \
- "A\215\305@\216\306=\232\315V\371\373\360\377\377\375\377\377\377\375" \
- "\376\377\377\375\377\376\376\377\202\377\377\377\2\214\305@\212\307>" \
- "\211\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324" \
- "p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>" \
- "\3\214\305@\214\306>\214\305@\233\377\377\377\5\347\365\334\211\306=" \
- "\215\305>\216\306=\214\305@\211\214\306>\2\215\304B\212\307>\202\214" \
- "\306>\14\215\306A\214\306<\215\305@\252\324p\374\377\377\377\377\377" \
- "\377\375\376\377\376\377\376\376\377\377\377\375\377\377\377\377\375" \
- "\377\222\377\377\377\1\376\376\376\203\377\377\377\4\376\376\376lln:" \
- ":<;;=\203::<\2\235\235\235\376\376\376\304\377\377\377\1\316\316\316" \
- "\205::<\202;;=\2::<;;=\202::<\1;;=\211::<\202;;=\204::<\1""99;\202::" \
- "<\5;;=::<;;=__a\376\376\376\224\377\377\377\1\376\376\376\205\377\377" \
- "\377\1\235\235\235\206::<\3\346\346\346\377\377\377\376\376\376\207\377" \
- "\377\377\5\376\376\376\377\377\377\376\376\376\346\346\350;;=\203::<" \
- "\3;;=::<\265\265\265\230\377\377\377\1\234\234\236\205::<\1\234\234\234" \
- "\246\377\377\377\1lln\202::<\4""99;;;=99;\234\234\234\213\377\377\377" \
- "\1\234\234\234\203::<\7;;=::<;;=::<;;=::<;;=\222::<\7;;=99;;;=::<;;=" \
- "::<\316\316\316\231\377\377\377\3\214\305@\214\306>\214\305@\207\214" \
- "\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306" \
- ">\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210" \
- "\214\306>\13\216\306A\213\310\77\343\361\320\377\377\375\375\377\376" \
- "\371\374\361\242\320c\213\310\77\216\306\77\214\306>\215\306A\202\214" \
- "\305@\2\216\306A\213\305=\204\214\306>\11\213\307A\216\306A\212\307>" \
- "\260\331y\377\376\377\376\377\375\377\377\373\376\377\377\377\377\377" \
- "\202\377\376\377\2\212\311=\215\306A\211\214\306>\3\215\305>\214\306" \
- ">\305\342\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207" \
- "\214\306>\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\231" \
- "\377\377\377\6\377\376\377\377\377\373\377\376\377\305\342\240\212\310" \
- "\77\214\304=\202\215\305@\210\214\306>\4\215\305>\213\305=\212\306@\215" \
- "\306A\202\214\306>\10\222\312M\370\373\362\377\376\377\377\375\376\377" \
- "\376\377\377\377\377\376\377\375\377\377\377\202\377\376\377\221\377" \
- "\377\377\1\376\376\376\205\377\377\377\2::<;;=\202::<\202;;=\3\300\300" \
- "\300\377\377\377\376\376\376\235\377\377\377\1\376\376\376\245\377\377" \
- "\377\1\316\316\316\207::<\5;;=::<;;=::<;;=\210::<\202;;=\2""99;;;=\202" \
- "::<\3;;=::<;;=\202::<\3;;=xxz\363\363\363\225\377\377\377\3\376\376\376" \
- "\377\377\377\376\376\376\202\377\377\377\3\363\363\363FFH::<\202;;=\202" \
- "::<\1\204\204\206\205\377\377\377\1\376\376\376\205\377\377\377\1\376" \
- "\376\376\202\377\377\377\1kkm\202::<\1;;=\202::<\1SSU\230\377\377\377" \
- "\1\234\234\236\205::<\1\234\234\234\244\377\377\377\3\376\376\376\377" \
- "\377\377xxz\202::<\1;;=\202::<\3xxx\377\377\377\376\376\376\211\377\377" \
- "\377\1\234\234\234\203::<\1;;=\202::<\1;;=\224::<\5;;=99;;;=::<;;=\202" \
- "::<\1\316\316\316\231\377\377\377\3\214\305@\214\306>\214\305@\207\214" \
- "\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306" \
- ">\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210" \
- "\214\306>\3\214\305@\214\306<\343\361\316\202\377\377\377\26\377\376" \
- "\374\353\365\335\223\312K\211\305\77\215\307=\215\306C\211\306;\214\306" \
- ">\215\305@\215\307\77\214\305@\213\307A\214\306>\212\307<\216\306\77" \
- "\212\306B\215\305>\212\306@\304\341\236\377\376\377\375\377\376\377\377" \
- "\375\203\377\377\377\2\212\306@\214\306<\211\214\306>\3\215\305>\214" \
- "\306>\305\342\240\215\377\377\377\4\252\324p\214\306>\215\305>\214\305" \
- "@\207\214\306>\3\214\305@\214\306>\214\305@\232\377\377\377\4\252\324" \
- "p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\231\377\377\377\2\377\377\373\376\377\377\202\377\377\377\4\241\321" \
- "c\215\306A\215\305>\213\310\77\210\214\306>\20\215\305@\215\307=\213" \
- "\310\77\214\304;\216\306\77\213\310\77\333\355\303\377\375\376\377\377" \
- "\375\377\376\377\377\377\377\375\377\374\376\377\377\377\377\377\377" \
- "\377\375\376\376\376\222\377\377\377\1\376\376\376\204\377\377\377\206" \
- "::<\2\316\316\316\376\376\376\234\377\377\377\1\376\376\376\247\377\377" \
- "\377\1\316\316\316\204::<\1;;=\205::<\1;;=\212::<\4""99;;;=::<;;=\203" \
- "::<\1;;=\202::<\1\233\233\233\234\377\377\377\3\235\235\23799;;;=\203" \
- "::<\2;;=\346\346\346\203\377\377\377\1\376\376\376\204\377\377\377\3" \
- "\376\376\376\377\377\377\376\376\376\203\377\377\377\4\316\316\320;;" \
- "=::<;;=\202::<\2;;=\264\264\264\227\377\377\377\1\234\234\236\205::<" \
- "\1\234\234\234\246\377\377\377\2\234\234\236;;=\203::<\2;;=kkk\213\377" \
- "\377\377\1\234\234\234\204::<\3;;=::<;;=\225::<\2;;=99;\202::<\3;;=:" \
- "::\316\316\316\231\377\377\377\3\214\305@\214\306>\214\305@\207\214\306" \
- ">\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214\306>" \
- "\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\210" \
- "\214\306>\14\215\307\77\215\305@\340\361\315\376\376\376\377\376\377" \
- "\377\377\375\377\377\377\323\353\267\212\307>\215\305@\214\305@\214\311" \
- "@\202\214\306>\22\212\307>\215\305@\214\306>\212\306@\214\305@\215\305" \
- ">\215\307=\214\306>\214\304=\215\307\77\341\362\316\377\376\377\377\377" \
- "\377\376\376\376\377\377\375\375\376\377\217\307@\212\306@\211\214\306" \
- ">\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214\306" \
- ">\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232\377" \
- "\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305" \
- "@\214\306>\214\305@\232\377\377\377\7\377\376\377\376\377\377\377\377" \
- "\377\352\364\331\212\307<\215\307=\212\307>\211\214\306>\13\212\306@" \
- "\214\306<\216\306A\214\305@\252\322q\376\376\377\376\377\373\377\376" \
- "\377\376\376\377\377\377\375\376\377\377\203\377\377\377\1\376\377\375" \
- "\227\377\377\377\202::<\202;;=\3::<;;=\316\316\316\233\377\377\377\1" \
- "\375\375\375\251\377\377\377\1\316\316\316\211::<\1;;=\213::<\3;;=::" \
- "<;;=\204::<\3""99;\205\205\207\346\346\346\233\377\377\377\4\376\376" \
- "\376\364\364\364FFH;;=\202::<\202;;=\1\204\204\204\215\377\377\377\1" \
- "\376\376\376\202\377\377\377\7kkm::<99;::<;;=99;TTV\227\377\377\377\1" \
- "\234\234\236\205::<\1\234\234\234\246\377\377\377\1\234\234\236\202:" \
- ":<\202;;=\2::<kkk\202\377\377\377\3\376\376\376\377\377\377\376\376\376" \
- "\206\377\377\377\1\234\234\234\203::<\1;;=\202::<\2;;=::<\202;;=\223" \
- "::<\2""99;;;=\202::<\2;;;\316\316\316\231\377\377\377\3\214\305@\214" \
- "\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251" \
- "\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202" \
- "\214\306>\1\214\305@\210\214\306>\202\214\305@\15\341\362\316\377\377" \
- "\375\376\377\375\377\377\377\373\377\374\377\376\377\271\332\211\212" \
- "\307>\212\307<\214\305B\214\305@\216\306\77\212\307>\202\215\307\77\11" \
- "\214\305B\215\306A\212\311=\214\303A\214\306>\215\306A\212\307>\225\311" \
- "K\371\372\362\202\377\377\375\202\377\377\377\2\214\305@\215\306A\211" \
- "\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p" \
- "\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305" \
- "@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>" \
- "\3\214\305@\214\306>\214\305@\231\377\377\377\10\376\377\377\377\376" \
- "\377\377\377\375\377\375\376\331\356\303\214\306>\214\305B\215\307\77" \
- "\210\214\306>\12\215\305>\212\306B\215\304B\214\306>\215\307=\224\310" \
- "J\364\370\351\376\376\374\375\377\372\377\377\375\203\377\377\377\3\377" \
- "\376\377\377\377\377\376\377\375\221\377\377\377\3\376\376\376\377\377" \
- "\377\376\376\376\203\377\377\377\7::<;;=99;::<;;=::<\315\315\315\232" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\246\377\377" \
- "\377\1\316\316\316\204::<\1;;=\202::<\1;;=\203::<\1;;=\210::<\1;;=\202" \
- "::<\1;;=\202::<\4``b\233\233\235\347\347\351\376\376\376\235\377\377" \
- "\377\2\265\265\265;;=\202::<\1;;=\202::<\1\332\332\332\216\377\377\377" \
- "\3\376\376\376\377\377\377\302\302\302\206::<\1\315\315\315\226\377\377" \
- "\377\1\234\234\236\205::<\1\234\234\234\245\377\377\377\2\376\376\376" \
- "\235\235\237\205::<\1jjj\203\377\377\377\3\376\376\376\377\377\377\376" \
- "\376\376\205\377\377\377\1\234\234\234\204::<\2;;=kkm\202\234\234\236" \
- "\1\233\233\235\223\234\234\234\202\235\235\235\1\233\233\233\203\234" \
- "\234\234\1\346\346\346\231\377\377\377\3\214\305@\214\306>\214\305@\207" \
- "\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214" \
- "\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305" \
- "@\210\214\306>\17\212\307>\216\306A\342\360\315\376\377\377\376\376\374" \
- "\375\377\376\377\376\377\377\376\374\377\377\375\242\320d\215\307=\214" \
- "\306>\214\305@\215\305@\212\306@\202\214\305@\17\215\305@\212\307>\215" \
- "\307\77\214\306<\215\306A\213\304\77\215\306A\215\307\77\252\324n\377" \
- "\377\377\375\377\376\377\376\377\377\377\375\212\307<\215\305@\211\214" \
- "\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\4\252\324p\214" \
- "\306>\215\305>\214\305@\207\214\306>\3\214\305@\214\306>\214\305@\232" \
- "\377\377\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214" \
- "\305@\214\306>\214\305@\232\377\377\377\6\376\377\375\377\375\377\367" \
- "\375\363\223\312H\216\306\77\215\305>\212\214\306>\2\215\305@\214\306" \
- ">\202\212\307>\3\214\305@\247\324o\377\376\377\202\377\377\377\2\377" \
- "\376\377\377\377\375\233\377\377\377\2::<;;=\204::<\2\316\316\316\376" \
- "\376\376\236\377\377\377\3\316\316\316;;;:::\230::<\213\377\377\377\1" \
- "\316\316\316\224::<\6kkmlln\205\205\207\234\234\236\301\301\303\363\363" \
- "\363\202\377\377\377\1\376\376\376\202\377\377\377\3\376\376\376\377" \
- "\377\377\376\376\376\231\377\377\377\1SSS\204::<\2;;=lln\213\377\377" \
- "\377\1\376\376\376\205\377\377\377\2\376\376\376TTV\205::<\1lll\226\377" \
- "\377\377\1\234\234\236\205::<\1\234\234\234\246\377\377\377\2\233\233" \
- "\235;;=\204::<\2kkk\376\376\376\203\377\377\377\1\376\376\376\206\377" \
- "\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305" \
- "@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324" \
- "p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320" \
- "\202\214\306>\1\214\305@\210\214\306>\3\212\307>\215\305>\342\362\315" \
- "\202\377\377\377\22\377\376\377\376\377\377\377\377\375\376\377\377\363" \
- "\367\346\225\311K\211\307@\216\306\77\212\307>\215\305@\214\306<\212" \
- "\307>\214\305@\214\306>\212\306@\215\306C\214\304\77\215\307\77\202\214" \
- "\306>\7\212\306@\307\341\240\377\376\377\376\377\372\377\377\377\212" \
- "\307>\215\305>\211\214\306>\3\215\305>\214\306>\305\342\240\215\377\377" \
- "\377\4\252\324p\214\306>\215\305>\214\305@\207\214\306>\3\214\305@\214" \
- "\306>\214\305@\232\377\377\377\4\252\324p\214\306>\215\305>\214\305@" \
- "\207\214\306>\3\214\305@\214\306>\214\305@\231\377\377\377\4\377\376" \
- "\377\376\377\375\376\377\377\257\330z\202\214\305@\1\215\307\77\211\214" \
- "\306>\14\212\307>\215\307\77\214\305@\215\305@\212\307>\215\307=\214" \
- "\305B\313\347\252\377\377\377\377\375\377\377\376\377\376\376\376\202" \
- "\376\377\375\231\377\377\377\4GGI;;=::<;;=\202::<\1\233\233\235\237\377" \
- "\377\377\3\316\316\316::<;;=\230::<\213\377\377\377\1\316\316\316\205" \
- "::<\1kkm\202\377\377\377\2\376\376\376\250\250\250\206::<\2FFH\346\346" \
- "\346\210\377\377\377\1\376\376\376\237\377\377\377\1\264\264\266\203" \
- ";;=\4::<;;=;;;\316\316\316\222\377\377\377\1\265\265\265\204::<\3;;=" \
- "::<\316\316\316\203\377\377\377\1\376\376\376\221\377\377\377\1\234\234" \
- "\236\205::<\1\234\234\234\245\377\377\377\2\376\376\376\235\235\237\205" \
- "::<\1lll\213\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377" \
- "\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214" \
- "\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377" \
- "\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361" \
- "\316\205\377\377\377\10\376\377\375\377\377\377\333\355\303\215\305@" \
- "\214\306>\214\306<\214\305@\215\305>\202\214\305@\207\214\306>\6\212" \
- "\306@\214\307;\330\355\304\377\376\377\377\377\377\215\305>\212\214\306" \
- ">\3\215\305>\214\306>\305\342\240\215\377\377\377\17\251\323q\214\306" \
- ">\215\307\77\214\305B\215\307\77\213\305=\215\307\77\214\305@\212\307" \
- ">\215\305@\213\310\77\214\305@\215\305<\214\306>\376\377\377\230\377" \
- "\377\377\6\376\377\377\253\323p\215\305@\213\307A\214\306<\212\306B\202" \
- "\214\306>\4\214\305@\214\306>\212\307>\214\305@\202\214\306>\2\214\305" \
- "@\376\377\375\220\377\377\377\1\377\377\375\202\377\377\377\16\376\377" \
- "\375\377\376\377\377\375\376\374\377\377\377\377\375\376\377\375\377" \
- "\377\377\336\355\304\214\306>\215\306A\214\306>\215\306A\212\306@\216" \
- "\306A\202\214\305@\4\215\307\77\214\306>\215\307\77\214\306>\202\214" \
- "\305@\16\214\306>\215\307\77\214\306>\215\307\77\214\305@\214\305B\222" \
- "\313H\361\370\346\376\377\377\377\377\377\377\376\377\377\377\377\374" \
- "\377\377\377\376\377\230\377\377\377\1kkm\202::<\1""99;\202::<\1\235" \
- "\235\237\233\377\377\377\1\376\376\376\203\377\377\377\1\316\316\316" \
- "\224::<\1;;=\205::<\213\377\377\377\1\316\316\316\205::<\1kkm\204\377" \
- "\377\377\3wwy::<;;=\202::<\4""99;;;=``b\363\363\363\206\377\377\377\1" \
- "\376\376\376\235\377\377\377\4\376\376\376\377\377\377\376\376\376TT" \
- "V\205::<\1lln\223\377\377\377\10\376\376\376SSU;;=::<;;=99;::<lll\205" \
- "\377\377\377\1\376\376\376\217\377\377\377\1\234\234\236\205::<\1\234" \
- "\234\234\246\377\377\377\1\204\204\206\202::<\1;;=\202::<\3xxx\377\377" \
- "\377\376\376\376\211\377\377\377\1\234\234\234\205::<\1\234\234\236\266" \
- "\377\377\377\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215" \
- "\305>\214\306>\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377" \
- "\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305" \
- "@\343\361\316\205\377\377\377\7\377\375\377\377\377\375\376\377\377\276" \
- "\337\220\213\310\77\213\304A\216\306=\207\214\306>\3\215\307\77\214\306" \
- ">\212\307>\202\215\305>\5\223\312J\361\371\344\377\375\377\212\307<\214" \
- "\305@\211\214\306>\3\215\305>\214\306>\305\342\240\214\377\377\377\14" \
- "\376\376\374\252\324n\214\306>\213\305=\215\307\77\214\305@\215\306A" \
- "\214\306>\215\307\77\213\310\77\215\305@\212\307>\202\214\306>\1\214" \
- "\305@\232\377\377\377\3\247\324m\215\305>\214\305@\202\214\306>\1\215" \
- "\307=\202\214\305@\6\214\306<\215\307=\214\305B\215\307\77\214\306>\214" \
- "\305@\224\377\377\377\15\377\377\375\376\376\376\377\377\377\377\376" \
- "\377\376\377\375\377\377\375\372\373\366\222\312M\216\306A\215\305<\214" \
- "\306>\212\307>\215\305<\202\214\306>\2\215\307\77\213\305=\204\214\306" \
- ">\1\214\305@\203\214\306>\14\215\307\77\214\305@\213\304\77\214\305B" \
- "\253\324n\376\376\377\376\377\377\377\376\377\377\377\377\376\377\375" \
- "\377\377\375\376\377\375\227\377\377\377\3lln::<;;=\203::<\2kkm\376\376" \
- "\376\236\377\377\377\2\316\316\316;;=\226::<\3;;=::<kkm\213\377\377\377" \
- "\1\316\316\316\204::<\2;;=kkm\204\377\377\377\3\363\363\363__a;;=\203" \
- "::<\4;;=99;\205\205\207\376\376\376\202\377\377\377\1\376\376\376\203" \
- "\377\377\377\1\376\376\376\236\377\377\377\1\301\301\301\204::<\4;;=" \
- "::<wwy\235\235\237\223\234\234\236\1kkm\204::<\5;;=99;\345\345\345\377" \
- "\377\377\376\376\376\222\377\377\377\1\234\234\236\205::<\1\234\234\234" \
- "\246\377\377\377\1kkm\204::<\2;;=\234\234\234\213\377\377\377\1\234\234" \
- "\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305" \
- "@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377" \
- "\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1" \
- "\214\305@\211\214\306>\2\214\305@\343\361\316\205\377\377\377\2\377\377" \
- "\375\377\375\377\202\377\377\377\1\242\322b\202\214\305@\2\214\305B\215" \
- "\307\77\205\214\306>\12\215\307\77\214\306>\215\306A\214\306>\212\306" \
- "@\215\307=\241\321c\377\377\377\215\304B\212\307>\211\214\306>\3\215" \
- "\305>\214\306>\305\342\240\214\377\377\377\5\376\377\375\251\323o\215" \
- "\307\77\214\306>\215\307\77\202\214\305@\2\214\306>\215\307\77\202\214" \
- "\306>\5\213\310\77\215\305>\214\305@\214\306>\377\376\377\230\377\377" \
- "\377\12\377\376\377\247\326p\213\304\77\215\307\77\214\305B\214\306<" \
- "\214\306>\215\307\77\214\305@\214\306>\202\215\307\77\3\214\306>\215" \
- "\306A\216\306\77\223\377\377\377\5\376\377\372\377\377\375\376\376\376" \
- "\377\377\377\377\377\375\202\377\376\377\4\250\325p\212\307<\214\305" \
- "@\215\307\77\202\214\305@\3\214\307;\215\307=\214\306>\202\214\305@\202" \
- "\214\306>\1\215\307\77\207\214\306>\202\214\305@\5\212\307>\307\341\240" \
- "\376\376\374\377\377\377\377\376\377\202\377\377\377\1\376\376\374\227" \
- "\377\377\377\7\234\234\236;;=99;<<>99;::<;;=\237\377\377\377\1\316\316" \
- "\316\223::<\7;;=99;;;=99;::<;;=kkm\213\377\377\377\1\316\316\316\205" \
- "::<\2mmo\376\376\377\204\377\377\377\12\332\332\332FFH;;=::<;;=99;<<" \
- ">::<\266\266\270\376\376\376\203\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\230\377\377\377\3\376\376\376\377\377\377\376\376" \
- "\376\202\377\377\377\1kkm\205::<\202;;=\224::<\10;;=::<;;=::<;;=88:;" \
- ";=\205\205\205\224\377\377\377\1\234\234\236\205::<\1\234\234\234\246" \
- "\377\377\377\3SSU;;=::<\203;;=\1\234\234\234\206\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377" \
- "\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306" \
- ">\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1" \
- "\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361" \
- "\316\205\377\377\377\10\376\376\374\376\377\375\377\375\377\377\377\377" \
- "\367\372\357\224\313L\214\305B\215\305<\203\214\306>\202\215\307\77\204" \
- "\214\306>\6\215\306A\213\307A\214\306>\212\306@\277\337\223\215\305>" \
- "\212\214\306>\3\215\305>\214\306>\305\342\240\214\377\377\377\2\376\377" \
- "\377\251\322r\202\215\307\77\1\214\305B\202\214\306>\202\215\307\77\7" \
- "\214\306>\215\307\77\214\306>\214\304\77\212\306@\215\307\77\377\376" \
- "\377\230\377\377\377\7\377\377\375\215\305@\214\306>\214\305@\214\306" \
- ">\216\306\77\214\306<\203\214\305@\6\215\306C\215\307=\214\305@\215\306" \
- "A\233\314V\377\377\375\220\377\377\377\5\376\376\376\377\377\377\377" \
- "\376\377\377\375\377\377\377\375\202\376\377\377\21\377\376\377\314\346" \
- "\251\212\306B\215\307=\212\307>\216\306\77\215\306C\212\307>\215\306" \
- "C\214\305@\215\307\77\213\304\77\215\306A\214\306>\214\305@\215\307\77" \
- "\215\306A\203\214\306>\1\215\307\77\202\214\306>\202\215\307\77\10\214" \
- "\306>\214\305@\350\364\334\377\377\375\377\376\377\377\377\377\376\376" \
- "\376\377\376\377\222\377\377\377\1\376\376\376\204\377\377\377\1\301" \
- "\301\301\202::<\2""99;;;=\202::<\1\316\316\316\233\377\377\377\1\376" \
- "\376\376\202\377\377\377\2\316\316\316;;;\222::<\7""99;;;=::<;;=::<9" \
- "9;\204\204\206\213\377\377\377\1\316\316\316\205::<\1jjl\202\377\377" \
- "\377\202\376\376\376\202\377\377\377\1\265\265\267\202::<\202;;=\202" \
- "::<\2FFH\332\332\332\205\377\377\377\1\376\376\376\234\377\377\377\2" \
- "\376\376\376\317\317\317\202::<\1;;=\204::<\3;;=::<;;=\222::<\2""99;" \
- ";;=\202::<\1;;=\203::<\3\346\346\346\377\377\377\376\376\376\221\377" \
- "\377\377\1\234\234\236\205::<\1\234\234\234\246\377\377\377\1;;=\203" \
- "::<\4;;=::<\316\316\316\376\376\376\203\377\377\377\1\376\376\376\206" \
- "\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214" \
- "\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306>\252" \
- "\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361" \
- "\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361\316\205" \
- "\377\377\377\203\376\377\377\202\377\376\377\2\341\361\315\214\305@\203" \
- "\215\307\77\202\214\306>\1\215\307\77\203\214\306>\10\214\305@\215\307" \
- "\77\214\306>\212\307>\216\306A\213\305;\214\305@\215\305<\211\214\306" \
- ">\3\215\305>\214\306>\305\342\240\214\377\377\377\2\376\377\377\252\324" \
- "p\202\214\306>\3\214\305B\214\306<\215\307\77\203\214\306>\6\214\306" \
- "<\214\307;\217\307@\212\307>\214\305@\376\377\377\231\377\377\377\10" \
- "\215\307=\214\305B\213\304A\216\310@\214\304\77\215\307=\214\305@\215" \
- "\307\77\203\214\306>\3\215\307\77\214\306>\247\324o\222\377\377\377\3" \
- "\377\377\375\377\377\377\377\375\376\203\377\377\377\20\360\371\346\223" \
- "\312K\216\306\77\213\304A\215\306A\213\305=\215\305@\212\307>\215\305" \
- "<\214\305B\214\305@\214\306>\214\306<\214\306>\215\307\77\213\305=\204" \
- "\214\306>\202\215\307\77\203\214\306>\10\215\306A\212\307<\243\321d\377" \
- "\377\373\375\377\376\377\376\377\377\377\377\376\376\374\223\377\377" \
- "\377\5\375\375\375\377\377\377\376\376\376\377\377\377\346\346\346\202" \
- "::<\1;;=\203::<\1\221\221\221\235\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\222\377\377\377\1__a\204::<\2;;=\234\234\234\213\377\377" \
- "\377\1\316\316\316\205::<\3jjl\377\377\377\376\376\376\205\377\377\377" \
- "\2\204\204\206;;=\204::<\3;;=RRT\363\363\363\237\377\377\377\1\376\376" \
- "\376\202\377\377\377\2jjl;;=\206::<\4;;=::<99;;;=\223::<\1;;=\205::<" \
- "\1\204\204\206\203\377\377\377\1\376\376\376\217\377\377\377\1\234\234" \
- "\236\205::<\1\234\234\234\245\377\377\377\3\315\315\315;;=99;\202::<" \
- "\5""99;;;=\346\346\346\377\377\377\376\376\376\211\377\377\377\1\234" \
- "\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214" \
- "\305@\207\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377" \
- "\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306" \
- ">\1\214\305@\211\214\306>\2\214\305@\343\361\316\207\377\377\377\202" \
- "\377\377\375\4\376\377\377\377\377\375\303\342\237\212\306@\202\214\305" \
- "@\206\214\306>\7\216\306\77\213\305;\214\305@\216\306A\214\306>\215\307" \
- "\77\213\307A\212\214\306>\3\215\305>\214\306>\305\342\240\215\377\377" \
- "\377\17\252\323k\215\306A\214\306>\215\307\77\214\306>\215\307\77\214" \
- "\305@\214\306>\213\304A\215\306C\214\305@\213\304A\213\310=\214\306<" \
- "\342\357\321\230\377\377\377\6\360\371\346\214\305B\212\307<\215\307" \
- "=\213\305=\215\307\77\202\214\305@\7\215\306A\214\306>\214\306<\214\305" \
- "@\214\306>\214\305@\252\324p\222\377\377\377\11\377\376\377\376\377\377" \
- "\377\377\377\377\377\375\376\376\374\377\377\377\253\323p\215\307\77" \
- "\211\306;\202\215\306A\6\214\306>\214\306<\215\305>\216\305C\215\307" \
- "\77\213\304\77\202\215\307\77\2\215\307=\213\305;\202\215\307\77\2\214" \
- "\306>\215\307\77\205\214\306>\5\215\307\77\212\306@\214\306>\215\307" \
- "\77\304\341\236\202\377\377\377\2\376\376\377\374\377\377\230\377\377" \
- "\377\7SSU;;=99;::<;;=::<FFH\232\377\377\377\1\376\376\376\205\377\377" \
- "\377\1\376\376\376\220\377\377\377\2\376\376\376;;=\202::<\1;;=\202:" \
- ":<\1\316\316\316\213\377\377\377\1\316\316\316\205::<\1kkm\210\377\377" \
- "\377\2__a;;=\204::<\2;;=xxz\202\377\377\377\1\376\376\376\233\377\377" \
- "\377\1\376\376\376\202\377\377\377\2\315\315\315;;=\206::<\2;;=99;\203" \
- ";;=\223::<\1;;=\205::<\6FFH\363\363\363\377\377\377\376\376\376\377\377" \
- "\377\376\376\376\216\377\377\377\1\234\234\236\205::<\1\234\234\234\244" \
- "\377\377\377\4\376\376\376\223\223\22399;;;=\202::<\4;;=EEG\377\377\377" \
- "\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376" \
- "\376\204\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377" \
- "\3\214\305@\214\306>\214\305@\207\214\306>\4\214\305@\215\305>\214\306" \
- ">\252\324p\251\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1" \
- "\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361" \
- "\316\206\377\377\377\13\377\376\377\377\377\377\376\377\375\377\377\377" \
- "\377\376\377\376\377\377\253\324l\214\305B\213\304\77\214\305@\215\307" \
- "\77\203\214\306>\11\214\305@\214\306<\216\306=\214\306>\212\306@\215" \
- "\306C\214\304;\212\307>\214\305@\211\214\306>\3\215\305>\214\306>\305" \
- "\342\240\215\377\377\377\1\261\330\177\202\214\306>\2\214\306<\215\306" \
- "A\203\214\306>\7\215\307\77\214\306>\214\306<\215\307=\214\306>\215\306" \
- "C\323\353\267\230\377\377\377\4\340\361\315\215\305@\215\306A\214\305" \
- "@\202\214\306>\2\213\305=\215\306A\202\214\305@\5\214\306>\215\307\77" \
- "\214\306>\214\305@\260\330x\221\377\377\377\3\376\376\376\377\377\373" \
- "\375\377\376\202\377\377\377\25\376\377\377\314\345\253\214\305@\213" \
- "\304\77\216\306\77\212\307>\215\305@\214\306>\214\305@\215\305>\214\305" \
- "@\214\306>\214\306<\214\305@\215\306A\214\305@\215\306C\214\306>\214" \
- "\305@\214\306>\215\307\77\207\214\306>\7\212\306@\220\306=\215\306C\350" \
- "\364\336\376\377\373\377\377\375\376\377\377\230\377\377\377\1\221\221" \
- "\223\203::<\1;;=\202::<\1\265\265\265\230\377\377\377\1\376\376\376\227" \
- "\377\377\377\1\316\316\316\202::<\1;;=\203::<\1\363\363\363\213\377\377" \
- "\377\1\316\316\316\205::<\1kkm\204\377\377\377\1\376\376\376\203\377" \
- "\377\377\2\346\346\346FFH\206::<\2\234\234\236\376\376\376\237\377\377" \
- "\377\1\205\205\205\206::<\3;;=::<;;=\223::<\1;;=\203::<\202;;=\204::" \
- "<\2\234\234\234\376\376\376\221\377\377\377\1\234\234\236\205::<\1\234" \
- "\234\234\245\377\377\377\1RRR\204::<\2""99;yy{\203\377\377\377\1\376" \
- "\376\376\202\377\377\377\202\376\376\376\204\377\377\377\1\234\234\234" \
- "\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305@\207" \
- "\214\306>\4\214\305@\215\305>\214\306>\252\324p\251\377\377\377\215\214" \
- "\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305" \
- "@\211\214\306>\2\214\305@\343\361\316\205\377\377\377\30\377\377\375" \
- "\377\377\377\375\377\376\377\377\377\377\376\377\377\377\377\376\377" \
- "\377\371\372\365\222\313H\214\305B\214\305@\215\307\77\214\306>\215\307" \
- "\77\214\306>\214\305@\212\306B\214\305@\212\307>\216\306\77\212\307>" \
- "\215\307\77\214\306<\214\305@\211\214\306>\3\215\305>\214\306>\305\342" \
- "\240\214\377\377\377\20\377\376\377\301\345\237\215\305>\215\306A\213" \
- "\304\77\215\306C\214\306>\214\306<\216\306\77\214\306>\214\305B\215\307" \
- "\77\214\306>\215\307\77\214\305@\271\332\211\230\377\377\377\10\307\341" \
- "\240\215\305>\214\305@\214\306>\215\305<\212\307>\214\305B\214\306<\202" \
- "\214\306>\5\215\305<\214\305B\215\307\77\214\306>\303\344\235\222\377" \
- "\377\377\6\376\376\377\377\377\375\376\377\377\377\376\377\352\364\333" \
- "\215\305@\202\215\307\77\16\214\306>\215\307\77\214\306>\215\307\77\214" \
- "\306<\216\306A\213\310\77\214\305D\215\3108\214\305@\215\305>\223\312" \
- "K\236\323a\215\307\77\207\214\306>\202\214\305@\10\214\306>\215\307\77" \
- "\212\307>\212\307<\241\321c\377\376\377\377\375\376\377\375\377\230\377" \
- "\377\377\3\332\332\332:::;;=\204::<\1SSU\203\377\377\377\1\376\376\376" \
- "\247\377\377\377\1\376\376\376\204\377\377\377\1\221\221\221\202::<\1" \
- ";:\77\202::<\1RRT\214\377\377\377\1\316\316\316\205::<\1kkm\211\377\377" \
- "\377\2\316\316\316;;=\202::<\5;;=::<;;=::<\316\316\316\210\377\377\377" \
- "\1\376\376\376\215\377\377\377\1\376\376\376\207\377\377\377\2\346\346" \
- "\350::<\202;;=\202::<\2:::xxx\230\234\234\234\3\235\235\235\234\234\234" \
- "kkm\203::<\4;;=::<FFH\364\364\364\203\377\377\377\1\376\376\376\215\377" \
- "\377\377\1\234\234\236\205::<\1\234\234\234\241\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\332\332\334\206::<\1\250\250\252\214\377\377\377" \
- "\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306" \
- ">\214\305@\204\214\306>\2\213\307A\213\310\77\204\214\306>\1\252\324" \
- "p\232\377\377\377\1\377\377\375\216\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>" \
- "\2\214\305@\343\361\316\215\377\377\377\10\352\363\336\214\306>\212\306" \
- "B\215\307\77\212\307<\215\305>\214\305@\215\307\77\221\214\306>\3\215" \
- "\305>\214\306>\305\342\240\214\377\377\377\30\377\376\377\313\347\254" \
- "\215\307\77\214\304=\215\307\77\212\306@\215\307\77\215\306A\214\305" \
- "@\214\306>\215\307\77\214\306>\215\307\77\214\305@\214\305B\222\313H" \
- "\377\376\377\377\375\376\377\376\377\377\377\377\377\376\377\377\377" \
- "\373\376\377\377\377\376\377\211\377\377\377\26\377\377\375\377\376\377" \
- "\377\377\377\376\377\377\377\377\375\376\377\375\377\377\377\241\323" \
- "b\215\304D\214\307;\215\307\77\214\305B\215\307\77\214\306<\215\306A" \
- "\212\307>\215\305@\214\306>\213\310=\215\305@\215\306A\323\352\264\221" \
- "\377\377\377\11\376\377\377\376\376\374\376\377\377\377\376\374\377\376" \
- "\377\242\320c\215\307\77\215\306A\214\306>\202\214\305@\203\214\306>" \
- "\25\214\305@\215\306A\214\305@\215\307\77\214\306>\215\307=\315\345\253" \
- "\361\370\346\215\307\77\214\306>\212\306@\216\306A\214\306>\215\305>" \
- "\215\305@\214\305@\212\307>\215\305@\212\306@\215\305<\215\305@\202\214" \
- "\306>\12\277\337\223\377\377\377\376\377\375\377\376\377\377\377\375" \
- "\376\377\377\377\377\377\376\376\376\377\377\377\377\377\375\222\377" \
- "\377\377\1___\202::<\202;;=\202::<\1\266\266\266\250\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\203\377\377\377\1SSU\203::<\3" \
- ";;=::<\221\221\223\214\377\377\377\1\316\316\316\205::<\1kkm\210\377" \
- "\377\377\3\376\376\376\377\377\377\233\233\233\203::<\5;;=::<;;=FFH\364" \
- "\364\364\210\377\377\377\1\376\376\376\213\377\377\377\2\376\376\376" \
- "\377\377\377\202\376\376\376\205\377\377\377\1\204\204\206\202::<\1;" \
- ";=\202::<\3FFF\363\363\363\376\376\376\231\377\377\377\3\346\346\346" \
- "::<;;=\204::<\3\234\234\234\377\377\377\376\376\376\217\377\377\377\1" \
- "\234\234\236\205::<\1\234\234\234\234\377\377\377\1\376\376\376\207\377" \
- "\377\377\3\205\205\207::<;;=\204::<\1\346\346\350\214\377\377\377\1\234" \
- "\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214" \
- "\305@\205\214\306>\7\214\306<\214\306>\215\307\77\214\305@\214\306>\252" \
- "\324p\376\377\375\230\377\377\377\203\377\376\377\203\377\377\377\1\376" \
- "\376\377\211\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342" \
- "\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361\316" \
- "\215\377\377\377\2\376\377\375\313\347\254\203\214\306>\3\214\305@\216" \
- "\306\77\211\306=\221\214\306>\3\215\305>\214\306>\305\342\240\214\377" \
- "\377\377\11\375\376\377\343\361\316\215\305>\215\307\77\213\304A\215" \
- "\307\77\215\305>\214\306<\214\305@\203\214\306>\14\215\307\77\214\305" \
- "@\213\304\77\214\305B\322\353\264\377\377\377\377\377\375\377\377\377" \
- "\377\376\377\376\377\377\377\377\377\376\377\377\210\377\377\377\13\377" \
- "\377\375\377\377\377\376\377\375\377\376\377\376\376\374\377\377\375" \
- "\377\377\377\350\364\334\215\304D\215\305>\215\307\77\202\214\305@\202" \
- "\214\306>\10\214\305@\215\306A\214\306<\215\306C\214\304=\215\307=\212" \
- "\307<\351\366\332\222\377\377\377\14\377\377\375\377\377\377\377\377" \
- "\375\304\343\237\214\306>\212\307>\217\307@\214\305@\215\307\77\214\306" \
- ">\214\305@\215\306A\202\214\306>\5\214\306<\215\305>\211\307>\216\306" \
- "=\251\323o\202\376\377\377\31\304\341\241\212\306@\215\306A\212\307>" \
- "\215\307\77\214\306<\216\305C\212\307<\216\306A\214\306<\215\307\77\215" \
- "\305>\212\307>\216\306A\214\305@\216\306A\341\361\315\377\376\377\377" \
- "\377\375\376\377\377\377\376\377\376\376\376\377\377\377\377\376\377" \
- "\376\377\375\222\377\377\377\1\265\265\265\202;;=\204::<\2SSU\364\364" \
- "\364\203\377\377\377\1\376\376\376\245\377\377\377\1\376\376\376\203" \
- "\377\377\377\1\316\316\316\203::<\1;;=\202::<\1\302\302\302\214\377\377" \
- "\377\1\316\316\316\205::<\1kkm\213\377\377\377\1lln\204::<\3;;=::<__" \
- "a\202\377\377\377\1\376\376\376\206\377\377\377\1\376\376\376\213\377" \
- "\377\377\1\376\376\376\202\377\377\377\1\376\376\376\203\377\377\377" \
- "\3\346\346\346::<;;=\204::<\1\234\234\234\234\377\377\377\1\204\204\206" \
- "\202;;=\202::<\2;;=SSU\221\377\377\377\1\234\234\236\205::<\1\234\234" \
- "\234\235\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\202" \
- "\377\377\377\2\346\346\346::<\202;;=\4""99;;;=::<kkm\215\377\377\377" \
- "\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306" \
- ">\214\305@\204\214\306>\10\214\305@\215\306A\215\305@\213\305=\214\306" \
- ">\215\307\77\252\324p\376\377\377\230\377\377\377\1\376\376\376\205\377" \
- "\377\377\2\376\377\377\376\377\375\210\377\377\377\215\214\306>\1\250" \
- "\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306" \
- ">\2\214\305@\343\361\316\215\377\377\377\10\377\377\375\377\375\376\262" \
- "\331|\214\305@\215\306A\214\306>\214\305B\215\307\77\221\214\306>\3\215" \
- "\305>\214\306>\305\342\240\214\377\377\377\10\376\377\375\377\377\377" \
- "\214\304\77\212\307>\216\306A\214\306>\215\305@\215\307\77\206\214\306" \
- ">\202\214\305@\3\233\316X\376\376\377\376\377\373\202\377\377\377\3\377" \
- "\375\376\377\377\375\377\376\377\210\377\377\377\12\377\376\377\376\377" \
- "\375\377\375\376\376\376\374\377\377\377\377\377\375\377\377\377\257" \
- "\330x\214\307;\215\307\77\202\214\305@\2\215\307\77\213\305=\202\214" \
- "\306>\1\215\305>\202\214\306>\5\216\306\77\215\306A\215\305@\376\377" \
- "\375\377\376\377\220\377\377\377\11\377\377\375\377\377\377\376\377\377" \
- "\350\364\334\212\307>\213\310\77\216\306\77\212\307>\214\305@\202\214" \
- "\306>%\215\306A\214\306>\213\305=\214\306>\215\307\77\215\305@\211\307" \
- ">\223\311M\363\367\350\376\377\375\377\377\377\377\377\375\242\320d\212" \
- "\307<\215\306A\214\305@\212\306@\215\306A\214\306>\212\307>\215\307\77" \
- "\217\304@\211\310<\215\305>\213\310\77\212\307>\214\306>\234\315W\367" \
- "\372\363\376\377\377\377\376\377\377\377\375\377\377\377\376\376\376" \
- "\377\377\375\377\377\377\376\377\375\222\377\377\377\1RRR\202::<\203" \
- ";;=\2::<\234\234\236\204\377\377\377\1\376\376\376\246\377\377\377\3" \
- "\376\376\376\377\377\377kkk\202::<\4;;=99;;;=FFH\215\377\377\377\1\316" \
- "\316\316\205::<\1kkm\211\377\377\377\5\376\376\376\377\377\377\363\363" \
- "\363SSU;;=\202::<\202;;=\2""99;\222\222\222\207\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\214\377\377\377\1\376\376\376\204\377\377" \
- "\377\3\204\204\204;;=99;\202;;=\3::<FFH\363\363\363\230\377\377\377\1" \
- "\376\376\376\202\377\377\377\2\376\376\376\317\317\317\203::<\4;;=::" \
- "<;;=\266\266\266\220\377\377\377\1\234\234\236\205::<\1\234\234\234\243" \
- "\377\377\377\2\204\204\204;;=\204::<\2""99;\264\264\264\215\377\377\377" \
- "\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306" \
- ">\214\305@\204\214\306>\2\214\305@\214\306>\203\215\306A\2\215\307\77" \
- "\251\323q\231\377\377\377\203\377\377\375\202\377\377\377\1\377\375\376" \
- "\202\377\376\377\210\377\377\377\215\214\306>\1\250\325p\216\377\377" \
- "\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343" \
- "\361\316\215\377\377\377\7\376\376\376\377\377\375\366\373\364\233\316" \
- "X\215\305@\215\307=\215\305>\222\214\306>\3\215\305>\214\306>\305\342" \
- "\240\216\377\377\377\6\243\322b\214\306>\215\305@\215\307\77\215\305" \
- "@\215\306A\203\214\306>\1\215\307\77\202\214\306>\202\215\307\77\2\214" \
- "\306>\315\346\254\202\377\377\377\4\377\376\375\376\377\375\376\376\377" \
- "\377\376\377\212\377\377\377\7\377\377\375\377\376\377\377\377\373\377" \
- "\377\375\327\356\304\214\306>\215\307\77\202\214\305@\203\214\306>\12" \
- "\215\307\77\214\306>\214\305@\216\306\77\214\306<\214\304\77\212\307" \
- ">\260\331{\376\377\375\377\376\377\220\377\377\377\13\376\377\377\377" \
- "\377\375\370\373\362\233\315Z\216\306A\214\305@\212\307>\215\306A\214" \
- "\306>\214\305@\215\306A\202\214\306>\6\215\307\77\214\305@\214\305B\214" \
- "\306>\215\307=\313\347\254\202\377\377\377\23\377\376\377\377\377\375" \
- "\350\364\334\212\307>\220\306=\214\305@\216\306=\214\306>\214\305@\214" \
- "\306>\212\306@\215\305>\212\306@\215\307\77\212\307>\215\307\77\214\305" \
- "@\212\306@\277\340\221\202\377\377\377\1\377\377\375\203\377\377\377" \
- "\2\377\376\377\377\377\375\220\377\377\377\4\376\376\376\377\377\377" \
- "\265\265\265::<\202;;=\5""99;::<;;=99;\317\317\317\250\377\377\377\1" \
- "\376\376\376\202\377\377\377\2\316\316\31699;\202::<\202;;=\2::<\221" \
- "\221\223\215\377\377\377\1\316\316\316\205::<\1kkm\207\377\377\377\1" \
- "\376\376\376\204\377\377\377\1\332\332\334\203::<\5;;=::<;;=99;\302\302" \
- "\302\202\377\377\377\1\376\376\376\216\377\377\377\1\376\376\376\202" \
- "\377\377\377\1\376\376\376\204\377\377\377\4\362\362\362FFH::<;;=\202" \
- "::<\2;;=\221\221\223\204\377\377\377\202\376\376\376\224\377\377\377" \
- "\1\376\376\376\203\377\377\377\1kkm\202;;=\203::<\1SSU\220\377\377\377" \
- "\1\234\234\236\205::<\1\234\234\234\240\377\377\377\3\376\376\376\377" \
- "\377\377\315\315\315\203::<\1;;=\202::<\1SSU\216\377\377\377\1\234\234" \
- "\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305" \
- "@\204\214\306>\3\215\306A\214\306<\215\307=\202\214\305@\3\214\306>\253" \
- "\324n\377\377\375\230\377\377\377\2\375\376\377\376\376\376\203\377\377" \
- "\377\1\377\377\375\212\377\377\377\215\214\306>\1\250\325p\216\377\377" \
- "\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343" \
- "\361\316\220\377\377\377\5\350\365\333\214\306>\214\305@\214\306>\215" \
- "\306A\221\214\306>\3\215\305>\214\306>\305\342\240\215\377\377\377\7" \
- "\377\377\375\277\337\224\212\306@\215\305@\212\307>\215\306A\215\307" \
- "\77\203\214\306>\202\215\307\77\203\214\306>\3\214\306<\214\306>\351" \
- "\363\330\202\377\377\377\3\376\376\376\374\377\377\376\377\377\211\377" \
- "\377\377\1\376\377\377\202\377\377\377\7\375\376\377\351\365\337\223" \
- "\311M\215\307=\214\305B\214\305@\215\307\77\202\214\306>\12\215\306A" \
- "\214\305@\214\306>\212\307>\215\306A\214\306>\215\307=\213\310\77\316" \
- "\345\255\376\377\377\221\377\377\377\7\376\377\377\377\377\375\300\337" \
- "\223\216\306A\213\305=\215\307=\215\305>\202\214\306>\1\215\307\77\203" \
- "\214\306>\202\214\305@\5\215\307\77\213\307A\251\322r\377\377\377\377" \
- "\377\375\202\377\377\377\14\377\376\377\377\377\377\305\342\237\212\307" \
- "<\220\305\77\214\306>\212\306@\215\306A\214\306<\214\305@\214\306<\216" \
- "\305C\202\214\306>\7\215\305<\214\306>\215\305>\214\305@\342\362\316" \
- "\377\377\377\377\377\375\202\377\377\377\3\376\377\377\377\376\377\376" \
- "\376\376\221\377\377\377\3\376\376\376\377\377\377___\205::<\4;;=FFH" \
- "\363\363\363\377\377\377\202\376\376\376\246\377\377\377\3\363\363\363" \
- "SSU;;=\204::<\4;;=\345\345\345\377\377\377\376\376\376\213\377\377\377" \
- "\1\316\316\316\205::<\1kkm\211\377\377\377\1\376\376\376\203\377\377" \
- "\377\4\264\264\266;;=99;::<\202;;=\3::<GGI\332\332\332\206\377\377\377" \
- "\1\376\376\376\215\377\377\377\1\376\376\376\203\377\377\377\3\234\234" \
- "\236::<;;=\204::<\2\346\346\346\376\376\376\202\377\377\377\1\376\376" \
- "\376\202\377\377\377\202\376\376\376\220\377\377\377\1\376\376\376\204" \
- "\377\377\377\2\376\376\376\317\317\317\204::<\3;;=::<\265\265\265\217" \
- "\377\377\377\1\234\234\236\205::<\1\234\234\234\235\377\377\377\1\376" \
- "\376\376\203\377\377\377\2\363\363\363TTV\203::<\5;;=99;::<\235\235\235" \
- "\376\376\376\215\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377" \
- "\377\377\3\214\305@\214\306>\214\305@\204\214\306>\2\212\306@\213\310" \
- "\77\202\214\305@\3\215\307\77\214\306<\251\323o\231\377\377\377\4\377" \
- "\376\377\377\377\375\377\377\377\376\376\377\214\377\377\377\215\214" \
- "\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305" \
- "@\211\214\306>\2\214\305@\343\361\316\215\377\377\377\1\377\377\375\203" \
- "\377\377\377\4\323\353\267\212\307<\214\306<\212\306B\221\214\306>\3" \
- "\215\305>\214\306>\305\342\240\214\377\377\377\7\376\377\377\377\376" \
- "\377\350\365\331\215\307\77\215\305>\214\306>\212\307>\202\214\306>\1" \
- "\215\307\77\205\214\306>\11\215\307\77\213\304A\212\307>\222\312M\343" \
- "\361\316\376\376\377\377\376\377\377\377\377\377\375\377\210\377\377" \
- "\377\1\377\376\377\202\377\377\375\12\377\376\377\350\364\334\220\313" \
- "K\216\306=\215\305<\215\307\77\214\306>\213\305=\214\306>\215\306A\202" \
- "\214\306>\1\214\305@\202\212\307>\6\214\305@\215\306C\215\305>\360\370" \
- "\351\377\377\373\376\377\377\221\377\377\377\7\345\360\322\215\305@\214" \
- "\305@\215\307=\214\304=\213\310=\215\305>\202\214\306>\2\213\305=\215" \
- "\307\77\202\214\305@\7\215\307\77\214\307;\214\305@\363\367\346\376\377" \
- "\377\377\377\373\377\376\377\202\377\377\377\30\376\377\375\377\376\377" \
- "\241\321a\216\306\77\212\306@\213\310=\215\305@\213\307A\217\304>\215" \
- "\305@\214\306<\216\306A\215\306A\212\307>\214\306<\214\306>\212\307<" \
- "\233\314W\366\373\365\377\377\375\377\377\377\377\376\377\373\377\377" \
- "\377\376\377\224\377\377\377\1\317\317\317\205::<\4;;=::<``b\362\362" \
- "\362\247\377\377\377\2\376\376\376\221\221\221\206::<\3\204\204\206\377" \
- "\377\377\376\376\376\214\377\377\377\1\316\316\316\205::<\1kkm\212\377" \
- "\377\377\6\376\376\376\377\377\377\376\376\376\377\377\377\203\203\203" \
- ";;=\205::<\3``b\363\363\363\376\376\376\216\377\377\377\1\376\376\376" \
- "\206\377\377\377\3\363\363\363FFH;;=\203::<\2;;=\203\203\203\203\377" \
- "\377\377\3\376\376\376\377\377\377\376\376\376\225\377\377\377\1\376" \
- "\376\376\204\377\377\377\3kkk::<<<>\202::<\2;;=kkm\217\377\377\377\1" \
- "\234\234\236\205::<\1\234\234\234\236\377\377\377\4\376\376\376\377\377" \
- "\377\376\376\376kkk\202::<\5;;=::<99;;;=TTV\202\377\377\377\1\376\376" \
- "\376\214\377\377\377\1\234\234\234\205::<\1\234\234\236\266\377\377\377" \
- "\3\214\305@\214\306>\214\305@\204\214\306>\10\214\306<\214\306>\214\305" \
- "@\214\306>\215\307\77\214\306>\252\324r\376\377\377\230\377\377\377\1" \
- "\377\377\375\202\377\377\377\2\377\377\375\376\376\374\203\377\376\377" \
- "\210\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320" \
- "\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361\316\215\377" \
- "\377\377\10\375\377\374\377\376\377\375\377\376\376\376\377\377\377\377" \
- "\270\333\207\214\305@\215\307\77\221\214\306>\3\215\305>\214\306>\305" \
- "\342\240\214\377\377\377\12\375\376\377\377\376\377\376\377\377\234\313" \
- "Y\215\306A\214\305@\212\307>\214\305@\214\306>\215\307\77\206\214\306" \
- ">\7\215\307\77\214\306>\215\305@\213\310\77\304\343\240\371\372\364\376" \
- "\377\377\212\377\377\377\10\376\377\377\377\376\377\315\345\251\223\311" \
- "M\214\306>\216\306\77\214\305B\214\306<\202\214\306>\15\215\306A\214" \
- "\305@\214\306>\215\307\77\214\305@\214\306<\214\305@\215\307\77\213\304" \
- "A\263\330{\377\377\377\376\376\376\377\377\375\220\377\377\377\7\370" \
- "\373\364\232\315V\216\306=\212\311=\214\306>\216\306A\213\307A\202\214" \
- "\305@\202\214\306>\202\214\305@\10\215\307\77\215\305>\215\304D\304\341" \
- "\237\376\377\377\377\376\377\376\376\377\377\377\375\202\377\376\377" \
- "\24\376\377\377\377\377\373\350\365\333\215\305>\214\306<\214\306>\212" \
- "\306@\215\307\77\213\305=\215\305@\215\307\77\214\306>\215\305>\215\306" \
- "A\211\305A\215\305@\214\305B\213\310=\262\327z\374\377\377\202\377\377" \
- "\377\2\377\377\375\373\377\376\225\377\377\377\1\221\221\223\203::<\6" \
- ";;=99;;;=::<``b\362\362\362\246\377\377\377\2\265\265\265:::\202::<\1" \
- ";;=\203::<\1\346\346\350\216\377\377\377\1\316\316\316\205::<\1kkm\216" \
- "\377\377\377\6\363\363\363__a::<;;=::<;;=\202::<\1\204\204\204\204\377" \
- "\377\377\1\376\376\376\221\377\377\377\1\234\234\234\204::<\3;;=::<\347" \
- "\347\347\202\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376" \
- "\225\377\377\377\3\376\376\376\377\377\377\265\265\265\202::<\202;;=" \
- "\3::<;;=\316\316\316\216\377\377\377\1\234\234\236\205::<\1\234\234\234" \
- "\240\377\377\377\2\204\204\204:::\206::<\1\301\301\303\217\377\377\377" \
- "\1\234\234\234\205::<\1\234\234\236\266\377\377\377\3\214\305@\214\306" \
- ">\214\305@\205\214\306>\7\214\305@\216\306A\215\307=\213\304\77\213\307" \
- "A\242\321a\345\356\317\230\342\362\316\7\341\361\315\342\361\322\342" \
- "\361\320\343\361\315\345\360\322\365\373\357\376\377\377\211\377\377" \
- "\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214\306" \
- ">\1\214\305@\211\214\306>\2\214\305@\343\361\316\216\377\377\377\7\376" \
- "\377\375\377\377\375\377\377\377\377\376\377\371\374\365\242\322d\215" \
- "\306A\221\214\306>\3\215\305>\214\306>\305\342\240\214\377\377\377\10" \
- "\377\377\375\377\377\377\377\377\373\312\346\253\215\307=\212\307>\214" \
- "\305B\216\306=\206\214\306>\202\214\305@\10\214\306>\212\307>\216\306" \
- "\77\214\306>\212\307>\233\316W\306\340\237\361\370\346\210\377\377\377" \
- "\12\361\370\350\314\345\253\233\314W\214\306>\213\310\77\215\305<\214" \
- "\305@\212\307<\215\306A\214\305@\203\214\306>\202\214\305@\202\214\306" \
- ">\4\216\306A\212\306@\213\310\77\333\356\301\202\377\377\377\1\377\377" \
- "\375\220\377\377\377\26\270\332\204\215\306A\212\306B\214\306>\213\307" \
- "A\215\305@\214\306<\214\306>\215\306A\214\306<\215\307\77\214\305B\215" \
- "\307\77\214\307;\215\304D\241\323b\377\377\375\376\377\377\377\377\377" \
- "\377\377\373\377\377\377\376\377\377\202\377\377\375\16\377\377\377\376" \
- "\377\377\277\337\224\214\305@\215\306A\214\306>\215\305>\212\310\77\214" \
- "\305@\215\307\77\212\307>\214\305B\216\306=\215\306A\202\214\306<\6\214" \
- "\306>\213\307C\331\356\305\377\376\377\377\377\373\376\376\376\227\377" \
- "\377\377\3__a::<;:\77\205::<\2__a\363\363\363\203\377\377\377\1\376\376" \
- "\376\213\377\377\377\1\376\376\376\203\377\377\377\3\376\376\376\377" \
- "\377\377\376\376\376\213\377\377\377\1\376\376\376\202\377\377\377\1" \
- "\265\265\267\205::<\3;;=:::\234\234\234\217\377\377\377\1\316\316\316" \
- "\205::<\1kkm\217\377\377\377\4\332\332\332GGI::<;;=\204::<\1\250\250" \
- "\252\225\377\377\377\1FFH\205::<\1\204\204\204\242\377\377\377\1TTV\205" \
- "::<\4lln\376\376\376\377\377\377\376\376\376\203\377\377\377\1\376\376" \
- "\376\207\377\377\377\1\234\234\236\205::<\1\235\235\237\221\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\202\377\377\377\202\376" \
- "\376\376\205\377\377\377\3\363\363\365\204\204\206;;=\204::<\3;;=:::" \
- "xxx\220\377\377\377\1\234\234\234\203::<\3;;=::<\234\234\234\204\377" \
- "\377\377\1\376\376\376\261\377\377\377\3\214\305@\214\306>\214\305@\250" \
- "\214\306>\2\215\307\77\342\362\316\212\377\377\377\215\214\306>\1\250" \
- "\325p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306" \
- ">\2\214\305@\343\361\316\216\377\377\377\11\375\376\377\377\376\377\377" \
- "\377\375\376\377\377\377\376\377\351\365\335\223\311M\212\307<\214\306" \
- ">\202\216\306A\4\212\307<\215\306A\215\305>\215\307\77\211\214\306>\3" \
- "\215\305>\214\306>\305\342\240\214\377\377\377\20\377\376\377\377\377" \
- "\375\377\376\377\365\374\364\223\312J\217\304>\215\307\77\212\307;\215" \
- "\306A\214\305B\214\305@\215\307\77\214\306<\213\310\77\214\305@\215\305" \
- ">\210\214\306>\10\234\315Z\257\327~\304\343\235\306\340\237\307\341\240" \
- "\304\343\237\257\327\177\241\321a\210\214\306>\20\217\304>\215\306A\212" \
- "\306@\212\307>\213\305;\216\306A\213\305=\215\306C\211\310<\216\306A" \
- "\214\306>\234\314V\377\377\377\375\377\374\376\377\377\377\376\377\211" \
- "\377\377\377\7\377\376\377\376\377\375\376\377\377\376\377\375\377\376" \
- "\377\377\377\377\333\355\303\210\214\306>\10\215\306A\214\305@\216\306" \
- "=\214\306>\215\307\77\214\305@\215\307\77\352\364\334\211\377\377\377" \
- "\6\377\376\377\367\375\363\232\315V\215\307\77\214\306>\214\305@\212" \
- "\214\306>\6\212\307>\223\311M\366\373\364\377\376\377\377\377\377\376" \
- "\377\373\221\377\377\377\1\376\376\376\204\377\377\377\2\346\346\346" \
- "FFH\203::<\1""99;\203::<\2__a\332\332\332\211\377\377\377\1\376\376\376" \
- "\203\377\377\377\1\376\376\376\205\377\377\377\1\376\376\376\206\377" \
- "\377\377\1\376\376\376\207\377\377\377\1\265\265\267\202::<\1;;=\204" \
- "::<\2```\376\376\376\217\377\377\377\1\316\316\316\205::<\1kkm\216\377" \
- "\377\377\4\376\376\376\377\377\377\301\301\301;;=\205::<\2;;=\331\331" \
- "\331\202\377\377\377\3\376\376\376\377\377\377\376\376\376\216\377\377" \
- "\377\1\265\265\267\205::<\3;;=\332\332\332\376\376\376\241\377\377\377" \
- "\1\266\266\270\205::<\2""99;\316\316\320\215\377\377\377\1\234\234\236" \
- "\203::<\5;;=::<\234\234\234\377\377\377\376\376\376\220\377\377\377\1" \
- "\376\376\376\206\377\377\377\1\376\376\376\203\377\377\377\2\346\346" \
- "\346``b\202::<\2""99;;;=\203::<\4FFF\363\363\363\377\377\377\376\376" \
- "\376\216\377\377\377\1\234\234\234\204::<\3;;=\234\234\234\376\376\376" \
- "\265\377\377\377\3\214\305@\214\306>\214\305@\250\214\306>\2\215\307" \
- "\77\342\362\316\212\377\377\377\215\214\306>\1\250\325p\216\377\377\377" \
- "\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361" \
- "\316\215\377\377\377\16\377\376\377\376\377\377\377\376\377\377\377\377" \
- "\376\377\377\377\376\377\375\377\374\323\353\267\215\305<\215\306C\215" \
- "\305<\213\306:\213\310\77\212\306@\202\214\305@\211\214\306>\3\215\305" \
- ">\214\306>\305\342\240\215\377\377\377\4\376\377\377\377\377\375\377" \
- "\376\377\305\342\242\202\214\305@\5\216\306A\214\306>\215\307=\215\307" \
- "\77\213\304A\202\214\305@\2\214\306>\212\306@\210\214\306>\7\214\306" \
- "<\215\307=\215\307\77\213\305=\214\306>\215\307\77\213\305=\211\214\306" \
- ">\11\215\306A\215\305>\212\307;\213\304\77\215\306A\211\306=\215\306" \
- "A\212\307<\216\306A\202\215\307\77\4\343\361\320\376\377\375\377\377" \
- "\375\376\376\377\212\377\377\377\1\377\376\377\202\377\377\377\4\377" \
- "\376\377\376\377\377\367\375\363\225\311J\210\214\306>\10\215\307=\213" \
- "\310\77\214\305@\216\306\77\214\305@\212\307>\307\341\240\376\377\375" \
- "\210\377\377\377\5\377\376\377\374\377\375\377\376\377\343\361\320\212" \
- "\306@\202\214\306>\1\213\310\77\210\214\306>\10\215\306A\215\305>\214" \
- "\305@\260\327z\377\376\374\374\377\377\377\377\377\377\376\377\226\377" \
- "\377\377\1\332\332\332\210::<\2GGI\250\250\250\223\377\377\377\3\376" \
- "\376\376\377\377\377\376\376\376\202\377\377\377\1\376\376\376\202\377" \
- "\377\377\1\376\376\376\204\377\377\377\2\250\250\252;;=\204::<\202;;" \
- "=\2EEG\331\331\331\220\377\377\377\1\316\316\316\205::<\1kkm\221\377" \
- "\377\377\5\222\222\224::<;;=::<;;=\202::<\5SSU\364\364\364\376\376\376" \
- "\377\377\377\376\376\376\216\377\377\377\2\376\376\376TTV\203::<\4;;" \
- "=99;lln\376\376\376\243\377\377\377\1TTV\204::<\5;;=\204\204\206\376" \
- "\376\376\377\377\377\376\376\376\212\377\377\377\1\234\234\236\202::" \
- "<\1;;=\202::<\1\234\234\234\215\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\212\377\377\377\6\376\376\376\250\250\252FFH99;::" \
- "<;;=\205::<\1\316\316\316\221\377\377\377\1\234\234\234\203::<\3;;=:" \
- ":<\234\234\236\266\377\377\377\3\214\305@\214\306>\214\305@\250\214\306" \
- ">\2\215\307\77\342\362\316\212\377\377\377\215\214\306>\1\250\325p\216" \
- "\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214" \
- "\305@\343\361\316\215\377\377\377\3\377\376\377\376\377\375\376\377\377" \
- "\202\377\377\377\13\377\377\375\377\376\377\376\376\374\271\332\211\215" \
- "\306A\211\306;\216\306A\212\307>\213\307A\215\306A\212\307>\211\214\306" \
- ">\3\215\305>\214\306>\305\342\240\214\377\377\377\20\376\377\375\377" \
- "\377\377\377\377\375\377\377\377\371\370\364\233\316U\214\306>\214\305" \
- "@\215\306A\214\306>\214\305@\215\307=\214\306>\215\305@\215\304B\213" \
- "\310=\210\214\306>\3\215\305@\214\306>\213\305=\202\213\310\77\3\214" \
- "\306>\215\307\77\215\305@\210\214\306>\20\212\306@\212\307;\216\306\77" \
- "\215\307\77\212\306@\214\306<\215\305>\215\307\77\220\305\77\211\307" \
- ">\263\330{\377\376\377\377\377\375\376\377\377\377\377\377\376\376\376" \
- "\211\377\377\377\7\377\377\373\377\377\377\377\375\376\377\377\377\377" \
- "\377\375\257\330|\213\310\77\211\214\306>\6\215\306C\211\306=\214\305" \
- "@\214\306>\242\322e\377\377\375\212\377\377\377\7\376\377\377\377\377" \
- "\375\377\375\376\277\337\224\216\307B\212\307>\214\305@\210\214\306>" \
- "\2\214\305@\216\306\77\202\212\307>\4\332\360\302\376\376\374\376\376" \
- "\376\377\376\377\227\377\377\377\1\266\266\266\202::<\1;;=\202::<\2;" \
- ";=::<\202;;=\2kkm\346\346\350\202\377\377\377\1\376\376\376\207\377\377" \
- "\377\1\376\376\376\203\377\377\377\5\376\376\376\377\377\377\376\376" \
- "\376\377\377\377\376\376\376\202\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\204\377\377\377\2\364\364\364yy{\203::<\2;;=99;\203::<\3" \
- "\265\265\267\377\377\377\376\376\376\217\377\377\377\1\316\316\316\205" \
- "::<\1kkm\222\377\377\377\1kkm\203::<\1;;=\202::<\5kkm\377\377\377\376" \
- "\376\376\377\377\377\376\376\376\212\377\377\377\5\376\376\376\377\377" \
- "\377\376\376\376\265\265\267;;=\204::<\2;;=\315\315\315\244\377\377\377" \
- "\11\234\234\234::<99;;;=::<;;=::<\347\347\347\376\376\376\213\377\377" \
- "\377\1\234\234\236\204::<\2;;=\233\233\233\217\377\377\377\1\376\376" \
- "\376\206\377\377\377\6\376\376\376\377\377\377\376\376\376\377\377\377" \
- "\265\265\265TTT\202::<\202;;=\203::<\3;;=::<\266\266\270\202\377\377" \
- "\377\1\376\376\376\217\377\377\377\1\234\234\234\204::<\4;;=\235\235" \
- "\237\377\377\377\376\376\376\224\377\377\377\1\376\376\376\203\377\377" \
- "\377\1\376\376\376\233\377\377\377\3\214\305@\214\306>\214\305@\250\214" \
- "\306>\2\215\307\77\342\362\316\212\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>" \
- "\2\214\305@\343\361\316\215\377\377\377\202\377\377\375\16\377\377\377" \
- "\377\377\375\377\377\377\376\377\375\376\376\374\377\376\377\375\377" \
- "\376\241\322_\215\306A\212\306B\215\305>\215\307\77\214\306<\214\305" \
- "B\211\214\306>\3\215\305>\214\306>\305\342\240\214\377\377\377\1\377" \
- "\376\377\202\377\377\375\15\376\377\377\377\375\376\340\361\317\214\306" \
- ">\212\307>\214\306>\215\307\77\214\306>\212\307<\215\307\77\215\305>" \
- "\216\306=\213\305=\210\214\306>\1\212\307>\202\214\305@\202\214\306>" \
- "\3\214\305@\215\306A\212\307>\210\214\306>\20\212\307>\213\304\77\214" \
- "\306>\211\310<\214\306>\216\306A\212\306@\215\305@\214\306>\223\313N" \
- "\367\372\363\376\377\377\377\377\377\377\376\377\376\377\373\377\376" \
- "\377\212\377\377\377\202\376\377\377\3\377\375\376\324\353\265\215\306" \
- "A\211\214\306>\7\215\305>\213\305=\215\307\77\215\306A\212\307>\351\363" \
- "\333\377\377\375\211\377\377\377\10\377\376\377\375\377\376\376\377\377" \
- "\377\376\377\370\373\362\233\314W\215\307\77\215\305<\210\214\306>\1" \
- "\215\307\77\202\214\306>\4\214\306<\225\310O\360\366\350\377\376\377" \
- "\221\377\377\377\3\376\376\376\377\377\377\376\376\376\205\377\377\377" \
- "\1\266\266\266\202::<\4;;=99;::<;;=\202::<\4;;=::<\204\204\206\346\346" \
- "\350\207\377\377\377\1\376\376\376\206\377\377\377\202\376\376\376\202" \
- "\377\377\377\1\376\376\376\203\377\377\377\1\376\376\376\202\377\377" \
- "\377\3\251\251\251FFF99;\202::<\1""99;\202::<\5;;=::<\234\234\236\377" \
- "\377\377\376\376\376\220\377\377\377\1\316\316\316\205::<\1kkm\222\377" \
- "\377\377\11\363\363\363GGI99;::<99;;;=::<;;=\234\234\234\214\377\377" \
- "\377\1\376\376\376\203\377\377\377\1SSU\202::<\1;;=\202::<\1kkm\245\377" \
- "\377\377\5\362\362\362GGI;;=::<;;=\202::<\1\204\204\206\206\377\377\377" \
- "\1\376\376\376\205\377\377\377\1\234\234\236\203::<\3""99;::<\234\234" \
- "\234\223\377\377\377\1\376\376\376\203\377\377\377\3\331\331\331\222" \
- "\222\222SSU\203::<\2;;=::<\202;;=\4::<;;=::<\265\265\267\202\377\377" \
- "\377\1\376\376\376\203\377\377\377\1\376\376\376\214\377\377\377\1\234" \
- "\234\234\205::<\1\234\234\236\203\377\377\377\1\376\376\376\223\377\377" \
- "\377\1\376\376\376\236\377\377\377\3\214\305@\214\306>\214\305@\250\214" \
- "\306>\2\215\307\77\342\362\316\212\377\377\377\215\214\306>\1\250\325" \
- "p\216\377\377\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>" \
- "\2\214\305@\343\361\316\216\377\377\377\17\377\376\377\377\377\377\376" \
- "\376\376\377\376\377\377\377\375\376\377\377\375\377\376\377\377\377" \
- "\363\367\350\222\312K\214\305@\213\310\77\214\304\77\215\307\77\216\306" \
- "A\211\214\306>\3\215\305>\214\306>\305\342\240\214\377\377\377\14\377" \
- "\376\377\376\377\375\376\377\377\377\376\377\376\377\377\376\377\375" \
- "\307\342\237\214\305@\214\306<\215\304D\214\306>\214\305D\202\212\307" \
- "<\2\212\307>\213\307A\210\214\306>\3\215\307\77\214\306>\215\307\77\202" \
- "\214\305@\213\214\306>\12\213\305;\215\306A\212\306@\214\306>\213\307" \
- "C\212\307>\215\305>\212\307>\215\305>\333\356\301\202\377\377\377\3\377" \
- "\377\375\377\377\377\377\376\377\211\377\377\377\10\376\377\375\377\377" \
- "\375\376\377\375\374\377\375\362\371\347\225\311M\215\307\77\215\305" \
- "<\210\214\306>\2\214\305@\216\306=\202\212\306@\2\305\342\237\377\375" \
- "\376\212\377\377\377\1\376\376\374\203\377\377\377\4\376\376\376\337" \
- "\363\316\215\306C\215\305<\211\214\306>\1\215\307\77\202\214\305@\4\214" \
- "\306<\253\324n\375\377\374\377\377\375\224\377\377\377\1\376\376\376" \
- "\204\377\377\377\2\301\301\301FFH\202::<\2;;=99;\202;;=\2::<;;=\202:" \
- ":<\2\204\204\206\316\316\320\207\377\377\377\1\376\376\376\203\377\377" \
- "\377\1\376\376\376\206\377\377\377\6\376\376\376\377\377\377\364\364" \
- "\364\265\265\267SSU::<\202;;=\202::<\5;;=::<;;=::<\204\204\204\223\377" \
- "\377\377\1\316\316\316\205::<\1kkm\223\377\377\377\11\315\315\315;;=" \
- "::<;;=::<;;=::<99;\302\302\302\216\377\377\377\5\301\301\303::<;;=::" \
- "<;;=\202::<\2\316\316\316\377\377\377\202\376\376\376\241\377\377\377" \
- "\14\376\376\376\377\377\377\234\234\234;;=::<;;=::<;;=::<\347\347\351" \
- "\377\377\377\376\376\376\211\377\377\377\1\234\234\236\203::<\3;;=::" \
- "<\234\234\236\216\377\377\377\202\376\376\376\1\377\377\377\202\316\316" \
- "\316\6\250\250\250\234\234\234jjjFFF;;=99;\202;;=\2::<;;=\202::<\5<<" \
- ">99;;;=::<\265\265\267\204\377\377\377\1\376\376\376\217\377\377\377" \
- "\1\234\234\234\204::<\2;;=\234\234\236\202\377\377\377\1\376\376\376" \
- "\223\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\234\377" \
- "\377\377\3\214\305@\214\306>\214\305@\250\214\306>\2\215\307\77\342\362" \
- "\316\212\377\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361" \
- "\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343\361\316\215" \
- "\377\377\377\202\377\376\377\16\377\377\375\376\377\377\377\377\377\377" \
- "\377\375\377\376\377\376\376\376\377\376\377\377\377\377\333\354\302" \
- "\212\307>\213\310\77\214\306<\213\310=\215\305@\211\214\306>\3\215\305" \
- ">\214\306>\305\342\240\214\377\377\377\1\377\376\377\202\376\377\377" \
- "\202\377\377\375\13\376\377\377\377\375\376\271\333\205\215\305>\214" \
- "\306>\212\307>\214\306>\215\306A\214\306>\212\306@\214\305@\210\214\306" \
- ">\3\214\305@\215\307\77\214\306>\202\212\307>\3\214\306>\215\307\77\215" \
- "\306A\210\214\306>\4\216\306A\211\306=\214\306<\216\306A\202\212\307" \
- ">\202\215\306A\10\322\352\270\377\377\375\376\376\374\377\377\377\376" \
- "\377\377\377\376\377\377\377\375\376\377\377\210\377\377\377\10\377\377" \
- "\375\377\377\377\377\376\377\374\376\373\250\325n\216\306\77\212\307" \
- ">\214\305B\210\214\306>\202\212\307>\6\214\305@\242\322d\376\376\374" \
- "\377\377\375\375\377\376\377\376\377\210\377\377\377\10\376\377\377\377" \
- "\377\375\377\375\376\377\377\375\375\376\377\376\377\375\270\333\207" \
- "\211\310<\210\214\306>\10\214\304=\216\307B\214\306>\212\307>\216\306" \
- "A\215\307\77\313\350\250\376\376\377\221\377\377\377\1\376\376\376\203" \
- "\377\377\377\1\376\376\376\204\377\377\377\7\332\332\332RRT;;=::<;;=" \
- "::<;;=\202::<\1;;=\203::<\3RRT\221\221\223\317\317\321\214\377\377\377" \
- "\11\376\376\376\377\377\377\364\364\364\301\301\301\204\204\206EEG;;" \
- "=99;;;=\204::<\1""99;\202::<\1\251\251\251\207\377\377\377\1\376\376" \
- "\376\214\377\377\377\1\316\316\316\205::<\1kkm\224\377\377\377\1\247" \
- "\247\247\203::<\5;;=::<;;=FFH\345\345\345\214\377\377\377\2\376\376\376" \
- "kkm\205::<\1SSU\202\377\377\377\1\376\376\376\244\377\377\377\2\363\363" \
- "\363FFH\204::<\2;;=\221\221\223\213\377\377\377\1\234\234\236\204::<" \
- "\4;;=SSUkkmlln\213kkm\5;;=::<;;=::<;;=\204::<\2;;=99;\202;;=\2::<;;=" \
- "\202::<\7;;=99;::<FFH\301\301\301\377\377\377\376\376\376\223\377\377" \
- "\377\1\234\234\234\205::<\1SSU\202kkm\1lln\223kkm\1lln\205kkm\1\332\332" \
- "\334\231\377\377\377\3\214\305@\214\306>\214\305@\250\214\306>\2\215" \
- "\307\77\342\362\316\212\377\377\377\215\214\306>\1\250\325p\216\377\377" \
- "\377\1\342\361\320\202\214\306>\1\214\305@\211\214\306>\2\214\305@\343" \
- "\361\316\215\377\377\377\1\377\376\377\202\377\377\375\202\377\377\377" \
- "\202\377\376\377\11\377\377\375\377\377\377\376\377\377\377\376\377\276" \
- "\336\223\214\306<\213\310\77\214\304=\215\306A\211\214\306>\3\215\305" \
- ">\214\306>\305\342\240\214\377\377\377\20\377\377\375\376\377\375\376" \
- "\376\376\377\376\377\375\377\376\377\375\377\376\377\377\376\377\375" \
- "\270\333\207\217\305<\212\307>\214\305@\216\306\77\213\305=\214\305@" \
- "\216\306=\211\214\306>\2\215\306A\215\305@\202\216\306\77\3\215\305@" \
- "\214\305@\215\307\77\210\214\306>\13\213\305=\215\306A\215\305>\212\306" \
- "@\215\305>\215\306A\220\305A\323\352\266\376\377\375\377\376\377\377" \
- "\377\375\202\377\377\377\3\376\377\377\377\375\377\376\377\375\213\377" \
- "\377\377\5\316\347\256\212\307>\213\305;\216\306A\212\307<\210\214\306" \
- ">\10\212\307>\216\306\77\215\305>\350\364\336\377\376\377\376\376\374" \
- "\377\377\377\377\376\377\210\377\377\377\1\377\376\377\202\377\377\377" \
- "\5\377\376\377\376\377\375\377\376\377\370\373\360\225\311K\210\214\306" \
- ">\10\216\306=\214\305@\215\310<\212\307>\214\306>\214\305@\223\312J\356" \
- "\371\350\231\377\377\377\4\376\376\376\377\377\377\363\363\363xxz\202" \
- "::<\1""99;\202::<\1;;=\203::<\202;;=\203::<\4__a\205\205\205\234\234" \
- "\234\250\250\250\205\316\316\316\4\250\250\250\234\234\234xxx___\202" \
- "::<\3""99;;;=99;\203::<\1;;=\203::<\2FFH\265\265\265\205\377\377\377" \
- "\1\376\376\376\217\377\377\377\1\316\316\316\205::<\1kkm\225\377\377" \
- "\377\3xxx::<;;=\204::<\1```\213\377\377\377\4\376\376\376\317\317\317" \
- "::<;;=\204::<\1\266\266\270\203\377\377\377\1\376\376\376\241\377\377" \
- "\377\1\377\377\375\202\377\377\377\1\204\204\206\202::<\1;;=\202::<\2" \
- "GGI\363\363\363\212\377\377\377\1\234\234\236\203::<\1;;=\202::<\1;;" \
- "=\221::<\1;;=\207::<\1;;=\202::<\1;;=\202::<\2``b\346\346\350\210\377" \
- "\377\377\1\376\376\376\215\377\377\377\1\234\234\234\207::<\3;;=::<;" \
- ";=\221::<\1;;=\203::<\1;;=\202::<\1\316\316\320\231\377\377\377\3\214" \
- "\305@\214\306>\214\305@\250\214\306>\2\215\307\77\342\362\316\212\377" \
- "\377\377\215\214\306>\1\250\325p\216\377\377\377\1\342\361\320\202\214" \
- "\306>\1\214\305@\211\214\306>\2\214\305@\343\361\316\215\377\377\377" \
- "\7\377\377\375\376\377\375\377\377\377\377\376\377\376\376\374\376\377" \
- "\377\377\377\377\202\376\377\377\202\377\377\375\4\377\377\377\242\320" \
- "d\211\306=\215\305@\212\214\306>\3\215\305>\214\306>\305\342\240\214" \
- "\377\377\377\6\377\376\377\377\377\377\377\377\375\377\375\377\376\377" \
- "\372\375\376\377\202\377\377\377\10\376\377\377\304\343\240\215\305@" \
- "\214\306>\216\306A\215\307\77\212\307>\215\307\77\212\214\306>\3\215" \
- "\307\77\214\306>\214\305@\202\215\307\77\211\214\306>\12\215\306C\212" \
- "\307<\215\307\77\215\305@\213\310\77\215\306A\323\352\266\377\376\377" \
- "\377\377\377\376\377\377\204\377\377\377\2\377\377\375\377\376\377\210" \
- "\377\377\377\10\376\377\377\377\376\377\361\370\346\225\311K\212\307" \
- ">\215\306A\214\305@\215\305>\210\214\306>\3\214\305@\214\306>\307\341" \
- "\240\203\376\377\377\2\377\377\375\376\377\377\210\377\377\377\5\376" \
- "\377\377\377\376\372\376\377\375\376\376\376\377\377\377\202\377\376" \
- "\377\1\334\355\301\210\214\306>\10\215\306A\213\310\77\215\305@\214\306" \
- ">\214\306<\215\306A\214\306>\254\322o\232\377\377\377\6\376\376\376\377" \
- "\377\377\376\376\376\302\302\302FFH;;=\206::<\1;;=\202::<\202;;=\203" \
- "::<\1;;=\204::<\3;;=::<;;=\202::<\1;;=\202::<\1;;=\203::<\2;;=::<\202" \
- ";;=\2__a\332\332\332\226\377\377\377\3\316\316\316::<;;=\203::<\1kkm" \
- "\222\377\377\377\7\376\376\376\377\377\377\376\376\376\363\363\363__" \
- "a::<;;=\204::<\1\203\203\203\202\377\377\377\2\376\376\376\377\377\377" \
- "\202\376\376\376\205\377\377\377\1kkm\202::<\1;;=\202::<\5TTV\377\377" \
- "\377\376\376\376\377\377\377\376\376\376\245\377\377\377\2\347\347\347" \
- "99;\202::<\1;;=\202::<\1\235\235\237\206\377\377\377\1\376\376\376\202" \
- "\377\377\377\2\376\376\376\234\234\234\224::<\1;;=\202::<\3""99;::<;" \
- ";=\204::<\1;;=\204::<\3;;=GGI\250\250\252\230\377\377\377\2\234\234\236" \
- ";;=\232::<\10;;=99;;;=::<;;=::<:::\316\316\316\230\377\377\377\10\377" \
- "\376\377\212\306@\214\305@\213\310=\214\306<\215\306A\214\307;\215\306" \
- "A\240\214\306>\10\214\305@\212\307<\214\306<\214\305@\212\306@\342\360" \
- "\315\376\377\377\377\376\377\210\377\377\377\212\214\306>\4\216\306\77" \
- "\212\306B\214\306>\250\325n\202\377\376\377\210\377\377\377\1\377\376" \
- "\377\202\377\377\377\5\376\377\375\342\362\316\214\305B\215\305@\214" \
- "\306<\210\214\306>\202\212\307>\5\343\361\320\377\377\377\377\377\375" \
- "\376\377\377\377\376\377\223\377\377\377\6\377\376\377\377\377\375\371" \
- "\372\364\223\312J\212\306@\215\305@\210\214\306>\10\214\305@\215\305" \
- ">\212\307>\304\343\240\377\377\375\377\377\377\377\377\375\377\376\377" \
- "\220\377\377\377\11\376\377\377\377\377\377\333\355\303\226\310K\213" \
- "\310\77\214\306>\215\305@\215\306A\214\305@\203\214\306>\7\215\305>\215" \
- "\305@\214\305@\212\307>\215\305>\215\307\77\215\306A\202\214\306<\5\215" \
- "\306A\213\305=\215\305@\215\307\77\213\305;\202\215\305@\13\215\307\77" \
- "\213\310\77\214\305@\215\307\77\212\307>\215\305>\214\306>\212\306@\235" \
- "\315U\347\365\334\377\376\377\220\377\377\377\15\376\376\376\377\377" \
- "\375\377\377\377\244\317c\213\307A\214\306<\213\307A\215\305>\215\305" \
- "<\215\307\77\214\306<\215\307\77\214\305@\202\215\307\77\12\214\305@" \
- "\215\306A\215\305@\234\315W\367\375\363\377\376\377\376\377\377\377\377" \
- "\375\376\377\377\377\376\377\220\377\377\377\10\260\331{\215\307=\212" \
- "\307>\213\307A\214\306>\215\305@\215\307\77\215\305>\210\214\306>\3\314" \
- "\345\253\377\377\377\376\377\375\202\377\376\377\2\377\377\377\376\377" \
- "\377\222\377\377\377\3\376\376\376\377\377\377\376\376\376\202\377\377" \
- "\377\3\364\364\364\220\220\220;;=\211::<\2;;=::<\202;;=\2::<;;=\202:" \
- ":<\4;;=::<;;=99;\203::<\2;;=99;\206::<\2GGI\247\247\251\203\377\377\377" \
- "\1\376\376\376\222\377\377\377\6\376\376\376\377\377\377\316\316\316" \
- ";;=99;;;=\202::<\2lln\376\376\376\202\377\377\377\1\376\376\376\221\377" \
- "\377\377\4\376\376\376\333\333\333FFH;;=\202::<\1;;=\202::<\1\265\265" \
- "\265\202\377\377\377\1\376\376\376\202\377\377\377\5\376\376\376\377" \
- "\377\377\376\376\376\377\377\377\316\316\320\202::<\2;;=99;\202;;=\1" \
- "\264\264\266\202\377\377\377\1\376\376\376\244\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\205\205\207\204::<\3;;=FFH\363\363\363\206\377" \
- "\377\377\1\376\376\376\202\377\377\377\3\233\233\233::<;;=\220::<\3""9" \
- "9;;;=99;\202::<\1;;=\203::<\1;;=\204::<\7;;=::<SSU\250\250\252\362\362" \
- "\364\377\377\377\376\376\376\225\377\377\377\3\376\376\376\377\377\377" \
- "\235\235\237\202::<\1;;=\231::<\2;;=99;\204::<\1\316\316\316\230\377" \
- "\377\377\10\377\377\373\212\311=\212\306@\216\306A\215\305>\215\307\77" \
- "\214\306>\215\306A\240\214\306>\7\214\306<\214\306>\216\306\77\214\306" \
- ">\214\305@\343\361\320\377\377\375\211\377\377\377\210\214\306>\10\213" \
- "\307A\212\306@\215\305@\212\307<\215\307\77\247\324o\375\377\376\376" \
- "\377\377\211\377\377\377\7\376\377\375\377\377\377\377\377\375\342\360" \
- "\315\214\305@\213\305=\215\307\77\210\214\306>\10\215\305>\215\307\77" \
- "\343\361\316\376\376\376\377\376\377\376\377\377\377\377\375\376\377" \
- "\372\220\377\377\377\10\376\377\377\377\376\377\377\377\375\377\376\374" \
- "\376\377\375\343\362\321\212\307>\214\307;\210\214\306>\4\215\307=\215" \
- "\304B\213\307A\305\342\240\203\377\377\377\1\376\377\377\222\377\377" \
- "\377\21\377\376\377\367\374\365\267\332\206\215\306A\212\306@\214\306" \
- "<\214\306>\215\306A\215\307\77\214\306>\214\305@\212\306B\212\306@\212" \
- "\307<\215\307\77\214\306>\214\305@\202\215\305@\5\214\305@\214\306>\214" \
- "\305@\212\307>\215\306A\202\214\305@\11\214\307;\214\306>\215\306A\214" \
- "\305@\215\305>\212\306@\222\311I\306\343\240\366\373\364\224\377\377" \
- "\377\6\303\342\237\217\304@\214\306<\214\306>\215\306C\212\306B\204\214" \
- "\305@\1\215\306A\202\214\305@\11\215\306A\214\306<\214\306>\341\361\314" \
- "\377\377\377\376\377\375\377\377\377\377\375\377\377\377\375\221\377" \
- "\377\377\10\370\373\364\224\307N\215\305@\215\305>\212\307<\215\306A" \
- "\212\307<\215\306A\210\214\306>\10\215\307=\346\364\332\376\377\375\376" \
- "\377\373\377\377\377\376\376\377\377\376\377\377\377\375\230\377\377" \
- "\377\5\346\346\350\204\204\206GGI::<;;=\202::<\5;;=::<;;=::<;;=\202:" \
- ":<\3;;=::<;;=\202::<\5;;=99;;;=::<;;=\207::<\3FFH\234\234\234\363\363" \
- "\363\203\377\377\377\1\376\376\376\222\377\377\377\1\376\376\376\202" \
- "\377\377\377\4\316\316\316::<;;=99;\202;;=\1kkm\202\377\377\377\1\376" \
- "\376\376\220\377\377\377\1\376\376\376\202\377\377\377\5\376\376\376" \
- "\266\266\26699;;;=::<\202;;=\3::<GGG\332\332\332\207\377\377\377\2\376" \
- "\376\376\204\204\206\202;;=\4::<;;=::<SSU\252\377\377\377\2\376\376\376" \
- "\346\346\350\202::<\5;;=::<99;;;;\266\266\266\203\377\377\377\1\376\376" \
- "\376\205\377\377\377\3\235\235\235::<99;\220::<\1;;=\205::<\203;;=\1" \
- "99;\203::<\3SSS\221\221\221\316\316\316\205\377\377\377\1\376\376\376" \
- "\222\377\377\377\1\376\376\376\203\377\377\377\3\234\234\236::<;;=\232" \
- "::<\7""99;::<;:\77::<;;=99;\317\317\321\230\377\377\377\7\377\375\377" \
- "\214\306<\213\307A\215\305>\215\307\77\212\307>\216\306\77\241\214\306" \
- ">\1\215\306C\202\215\305@\5\212\306@\215\307=\343\361\320\377\377\377" \
- "\377\376\377\210\377\377\377\210\214\306>\10\215\305<\215\307\77\216" \
- "\306\77\214\306>\216\305C\252\324r\377\377\377\377\377\373\211\377\377" \
- "\377\7\375\377\376\377\377\377\377\375\376\343\361\316\215\307=\212\307" \
- ">\215\305>\210\214\306>\10\214\305@\215\305<\342\362\316\377\377\375" \
- "\377\376\377\375\377\374\376\376\377\376\377\377\222\377\377\377\1\375" \
- "\377\372\202\377\377\377\3\377\376\377\304\341\237\215\307\77\210\214" \
- "\306>\10\212\307;\215\307\77\213\305=\305\342\240\377\377\377\377\376" \
- "\374\377\377\375\376\377\377\221\377\377\377\22\377\376\377\377\377\375" \
- "\376\377\377\377\375\376\361\367\351\270\334\204\214\306>\215\307\77" \
- "\214\305@\212\306@\213\307A\212\306@\213\310\77\214\306>\215\304B\214" \
- "\306>\212\307<\214\306>\202\216\306A\6\214\306>\213\310\77\214\305@\215" \
- "\305<\215\305>\215\307=\202\213\310\77\10\215\306A\214\306>\215\306A" \
- "\222\311I\300\336\226\361\370\346\376\376\376\377\377\377\202\377\376" \
- "\377\1\376\377\373\217\377\377\377\10\377\377\375\347\365\333\214\307" \
- ";\211\305A\213\304\77\215\307\77\215\305<\213\310\77\202\214\306>\1\215" \
- "\307\77\203\214\306>\4\215\307\77\214\306>\215\306A\275\337\223\202\377" \
- "\377\377\5\377\376\377\377\377\377\376\377\375\377\376\377\376\377\377" \
- "\220\377\377\377\10\375\377\376\331\357\301\215\307\77\215\305>\216\305" \
- "C\211\306=\220\305A\211\307@\210\214\306>\10\214\305@\246\321e\377\377" \
- "\377\377\376\377\376\377\377\377\377\375\376\377\377\377\376\377\227" \
- "\377\377\377\1\376\376\376\202\377\377\377\3\363\363\363\266\266\270" \
- "__a\207::<\202;;=\203::<\2;;=99;\202;;=\2""99;::<\202;;=\1::<\203;;=" \
- "\3^^^\250\250\250\363\363\363\203\377\377\377\1\376\376\376\202\377\377" \
- "\377\1\376\376\376\224\377\377\377\4\316\316\316999::<;;=\202::<\1ll" \
- "l\205\377\377\377\1\376\376\376\217\377\377\377\6\376\376\376\377\377" \
- "\377\376\376\376\204\204\204::<;;=\203::<\3:::TTT\363\363\363\206\377" \
- "\377\377\10\347\347\347;;;99;::<;;=::<:::\234\234\236\253\377\377\377" \
- "\3\376\376\376lln;;=\202::<\3;;=999SSS\202\377\377\377\1\376\376\376" \
- "\203\377\377\377\4\376\376\376\377\377\377\376\376\376\234\234\234\223" \
- "::<\1""99;\202::<\1;;=\203::<\5kkmxxz\235\235\237\301\301\301\346\346" \
- "\346\207\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\221" \
- "\377\377\377\1\376\376\376\202\377\377\377\3\235\235\235::<;;=\232::" \
- "<\2;;=99;\202::<\3;;=::<\316\316\316\230\377\377\377\10\373\377\376\216" \
- "\306A\214\306<\213\304A\212\306@\214\305@\214\304\77\215\307\77\240\214" \
- "\306>\6\214\306<\215\306A\215\305@\216\310@\217\304@\341\361\314\212" \
- "\377\377\377\210\214\306>\7\215\307\77\213\310\77\213\305=\215\307\77" \
- "\214\304\77\253\323r\374\377\373\211\377\377\377\1\377\376\377\203\377" \
- "\377\377\3\342\362\315\215\305@\215\307=\211\214\306>\10\214\306<\215" \
- "\304B\341\363\313\374\377\375\376\376\377\377\377\377\377\375\376\377" \
- "\377\375\221\377\377\377\7\376\377\375\376\376\377\377\377\377\375\377" \
- "\374\377\377\377\377\377\375\253\323p\210\214\306>\5\215\307\77\215\305" \
- ">\217\304@\305\342\237\376\377\375\202\377\377\377\1\377\377\375\220" \
- "\377\377\377\1\376\377\377\202\377\376\377\202\376\377\375\202\377\377" \
- "\377\5\360\370\351\311\347\247\245\320e\215\305>\212\307>\202\214\306" \
- ">\5\215\306A\212\307>\215\305@\214\306>\214\306<\202\214\306>\2\214\306" \
- "<\214\306>\202\216\306A\14\214\306>\215\306A\215\305<\214\306>\213\305" \
- "=\255\331x\323\353\267\366\374\362\377\377\377\377\377\375\377\377\377" \
- "\376\377\377\217\377\377\377\2\376\376\376\377\377\377\202\377\377\375" \
- "\11\244\317d\214\306>\213\307A\214\306>\214\305@\214\306>\215\306A\214" \
- "\306<\215\307\77\202\214\306>\202\214\305@\13\215\305<\215\305@\230\316" \
- "V\370\373\360\376\377\375\377\377\377\377\376\377\376\376\376\377\377" \
- "\375\377\376\377\376\377\377\220\377\377\377\10\376\376\376\377\376\377" \
- "\262\327x\214\306>\216\306A\215\307=\215\305<\215\306A\211\214\306>\6" \
- "\215\306C\307\341\240\376\377\373\376\377\377\376\377\375\376\376\374" \
- "\236\377\377\377\4\346\346\350\266\266\270\204\204\206SSU\202::<\1;;" \
- "=\202::<\1;;=\202::<\202;;=\3""99;::<;;=\203::<\4GGIxxz\247\247\247\347" \
- "\347\347\212\377\377\377\1\376\376\376\223\377\377\377\1\364\364\364" \
- "\205\316\316\316\1\332\332\332\203\377\377\377\202\376\376\376\221\377" \
- "\377\377\1\376\376\376\202\377\377\377\202\316\316\316\203\316\316\320" \
- "\3\316\316\316\317\317\317\346\346\346\206\377\377\377\5\346\346\346" \
- "\316\316\316\317\317\317\316\316\316\315\315\315\202\316\316\316\1\363" \
- "\363\363\250\377\377\377\1\376\376\376\203\377\377\377\3\346\346\346" \
- "\315\315\315\317\317\317\202\316\316\320\3\317\317\317\315\315\315\363" \
- "\363\363\202\377\377\377\202\376\376\376\204\377\377\377\3\346\346\346" \
- "\316\316\316\316\316\320\224\316\316\316\1\315\315\315\203\377\377\377" \
- "\1\376\376\376\215\377\377\377\1\376\376\376\225\377\377\377\2\346\346" \
- "\346\317\317\317\232\316\316\316\1\317\317\317\203\316\316\316\4\317" \
- "\317\317\315\315\315\316\316\316\363\363\363\231\377\377\377\3\340\361" \
- "\317\342\360\317\342\362\316\202\343\361\316\2\342\360\315\343\361\316" \
- "\240\342\361\320\10\342\362\316\342\361\320\343\363\317\341\360\317\342" \
- "\361\320\370\373\364\376\377\375\376\377\377\210\377\377\377\210\342" \
- "\361\320\7\341\360\317\342\362\316\343\361\316\342\360\314\342\361\320" \
- "\350\364\336\377\376\374\211\377\377\377\10\377\376\377\377\377\375\377" \
- "\377\377\377\377\375\370\373\362\341\360\321\340\357\316\342\362\316" \
- "\210\342\361\320\3\342\362\316\342\361\320\371\373\360\203\377\377\377" \
- "\202\377\376\377\220\377\377\377\4\377\377\375\376\376\376\377\376\377" \
- "\376\377\375\203\377\377\377\1\365\375\362\210\342\361\320\4\341\360" \
- "\321\342\361\322\343\363\317\360\367\345\224\377\377\377\7\376\377\377" \
- "\376\377\375\377\377\375\377\376\377\377\377\375\377\375\376\377\376" \
- "\377\202\377\377\377\30\376\376\377\364\370\351\333\354\277\277\337\224" \
- "\247\324k\224\313K\214\305@\214\306>\212\306@\214\306>\214\305B\215\306" \
- "C\215\307\77\212\306@\214\306>\215\307\77\241\321c\257\330|\304\342\242" \
- "\341\361\315\377\377\377\377\376\377\376\377\373\377\377\377\202\377" \
- "\377\375\1\377\376\377\203\377\377\377\1\376\377\377\212\377\377\377" \
- "\1\376\376\376\203\377\377\377\13\376\376\374\372\372\370\342\361\320" \
- "\343\361\316\342\362\316\341\360\317\342\361\320\341\360\317\342\362" \
- "\316\342\361\322\342\361\320\202\341\361\315\6\342\361\320\341\360\317" \
- "\343\361\315\343\361\320\356\371\350\377\376\377\203\377\377\377\1\376" \
- "\377\375\202\377\377\377\1\376\377\375\222\377\377\377\6\366\373\364" \
- "\342\361\320\342\362\316\342\360\317\341\362\316\343\361\320\210\342" \
- "\361\320\10\341\362\316\341\361\315\352\364\334\377\377\377\377\376\377" \
- "\377\377\377\376\377\377\376\377\375\222\377\377\377\202\376\376\376" \
- "\202\377\377\377\1\376\376\376\202\377\377\377\1\376\376\376\202\377" \
- "\377\377\3\376\376\376\377\377\377\375\375\375\202\377\377\377\5\363" \
- "\363\363\316\316\316\264\264\264\235\235\235\233\233\233\202kkk\202k" \
- "km\3llnkkmyy{\202\234\234\236\6\316\316\320\346\346\346\377\377\377\376" \
- "\376\376\377\377\377\376\376\376\204\377\377\377\1\376\376\376\204\377" \
- "\377\377\1\376\376\376\240\377\377\377\1\376\376\376\231\377\377\377" \
- "\1\375\375\375\203\377\377\377\1\376\376\376\214\377\377\377\1\376\376" \
- "\376\202\377\377\377\1\376\376\376\242\377\377\377\1\376\376\376\206" \
- "\377\377\377\3\376\376\376\377\377\377\376\376\376\204\377\377\377\1" \
- "\376\376\376\202\377\377\377\202\376\376\376\225\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\202\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\214\377\377\377\3\376\376\376\377\377\377\376\376\376\265" \
- "\377\377\377\1\375\375\375\234\377\377\377\7\376\377\377\377\376\377" \
- "\376\377\377\376\376\374\377\376\377\377\377\377\377\377\375\240\377" \
- "\377\377\1\377\377\375\202\377\377\377\5\377\376\377\376\376\376\377" \
- "\376\377\376\376\377\377\377\375\221\377\377\377\7\375\376\377\377\377" \
- "\377\377\376\377\377\377\375\376\377\377\377\377\373\377\376\377\210" \
- "\377\377\377\5\377\376\377\377\377\377\376\376\374\376\377\377\377\377" \
- "\377\202\377\377\375\1\376\377\377\210\377\377\377\6\376\377\377\375" \
- "\376\377\377\376\377\377\377\377\376\377\377\377\377\377\202\377\377" \
- "\375\224\377\377\377\202\377\376\377\2\374\377\377\377\376\377\210\377" \
- "\377\377\3\376\377\377\376\376\376\376\377\377\202\377\377\377\3\375" \
- "\377\376\377\377\377\377\376\377\220\377\377\377\202\377\376\377\2\376" \
- "\377\377\375\376\377\202\377\377\377\4\377\377\375\377\376\377\377\377" \
- "\377\377\377\375\202\376\377\377\7\377\377\377\377\376\377\377\377\377" \
- "\376\377\375\370\373\364\344\357\315\342\361\320\202\342\362\315\14\340" \
- "\357\316\345\360\316\376\377\373\376\376\376\377\377\377\377\375\376" \
- "\377\377\375\377\377\377\375\377\376\377\377\377\377\376\377\377\377" \
- "\375\202\376\377\375\5\376\377\377\377\377\377\377\377\375\376\376\376" \
- "\377\376\377\214\377\377\377\1\376\376\376\202\377\377\377\5\377\377" \
- "\375\376\375\377\377\377\377\376\376\377\377\377\375\204\377\377\377" \
- "\1\377\377\375\205\377\377\377\202\377\376\377\2\377\377\377\377\377" \
- "\375\202\377\377\377\202\376\377\377\222\377\377\377\5\377\377\375\377" \
- "\377\377\377\377\375\377\377\377\377\377\375\202\377\377\377\1\377\376" \
- "\372\212\377\377\377\1\377\375\377\202\377\377\377\3\377\376\377\377" \
- "\377\377\377\377\375\225\377\377\377\1\376\376\376\211\377\377\377\1" \
- "\376\376\376\204\377\377\377\1\376\376\376\205\377\377\377\1\376\376" \
- "\376\206\377\377\377\3\376\376\376\377\377\377\376\376\376\206\377\377" \
- "\377\1\376\376\376\233\377\377\377\1\376\376\376\203\377\377\377\5\376" \
- "\376\376\377\377\377\376\376\376\377\377\377\376\376\376\223\377\377" \
- "\377\3\376\376\376\377\377\377\376\376\376\205\377\377\377\3\376\376" \
- "\376\377\377\377\376\376\376\203\377\377\377\3\376\376\376\377\377\377" \
- "\376\376\376\203\377\377\377\1\376\376\376\205\377\377\377\1\376\376" \
- "\376\246\377\377\377\3\376\376\376\377\377\377\376\376\376\220\377\377" \
- "\377\1\376\376\376\246\377\377\377\1\376\376\376\225\377\377\377\1\376" \
- "\376\376\202\377\377\377\1\376\376\376\240\377\377\377\1\376\376\376" \
- "\230\377\377\377\6\377\377\375\377\377\377\377\376\377\376\377\375\374" \
- "\377\377\376\375\377\242\377\377\377\202\377\376\377\6\376\376\376\375" \
- "\376\377\377\377\377\377\377\375\377\377\377\376\377\375\220\377\377" \
- "\377\7\377\377\375\377\377\377\377\377\375\377\375\376\376\377\375\376" \
- "\377\377\376\376\376\212\377\377\377\4\377\376\377\377\377\375\377\377" \
- "\377\377\377\375\203\377\376\377\210\377\377\377\5\377\377\375\377\377" \
- "\377\377\375\376\377\376\377\377\377\375\202\377\377\377\1\376\377\377" \
- "\221\377\377\377\1\375\376\377\203\377\377\375\2\376\377\375\377\375" \
- "\376\211\377\377\377\204\377\376\377\4\377\377\377\376\377\375\377\377" \
- "\375\377\376\377\221\377\377\377\5\376\377\377\376\376\376\377\377\373" \
- "\376\376\377\376\377\377\202\377\377\377\2\377\376\377\377\377\375\202" \
- "\377\377\377\7\377\377\375\377\376\377\376\376\377\377\377\377\376\377" \
- "\377\376\377\375\376\377\377\202\377\377\377\203\376\377\377\2\377\377" \
- "\377\376\376\374\202\377\376\377\13\376\376\376\377\377\375\377\377\377" \
- "\377\375\376\376\377\377\377\377\377\376\376\377\377\376\377\376\376" \
- "\374\376\377\377\377\377\375\221\377\377\377\203\377\377\375\4\377\377" \
- "\377\377\377\375\377\376\377\376\376\376\210\377\377\377\1\377\377\373" \
- "\203\377\377\377\1\377\377\375\202\376\377\377\222\377\377\377\1\377" \
- "\377\375\202\377\376\377\3\377\377\377\377\376\377\377\376\374\202\376" \
- "\377\377\210\377\377\377\4\377\377\375\377\377\377\376\377\375\377\375" \
- "\377\202\376\377\377\1\377\376\375\227\377\377\377\1\376\376\376\207" \
- "\377\377\377\1\376\376\376\217\377\377\377\1\376\376\376\205\377\377" \
- "\377\1\376\376\376\204\377\377\377\1\376\376\376\233\377\377\377\1\376" \
- "\376\376\211\377\377\377\1\376\376\376\222\377\377\377\1\376\376\376" \
- "\206\377\377\377\1\376\376\376\207\377\377\377\1\376\376\376\262\377" \
- "\377\377\1\376\376\376\212\377\377\377\1\376\376\376\202\377\377\377" \
- "\1\376\376\376\202\377\377\377\1\376\376\376\225\377\377\377\1\376\376" \
- "\376\306\377\377\377\1\376\376\376\235\377\377\377\7\377\376\377\376" \
- "\377\377\377\377\377\377\377\375\376\375\377\377\377\375\377\376\377" \
- "\241\377\377\377\1\376\377\377\203\377\377\377\3\377\377\375\377\375" \
- "\376\377\376\377\221\377\377\377\202\376\377\377\5\377\377\377\377\377" \
- "\375\377\377\377\377\376\377\377\377\375\211\377\377\377\203\377\377" \
- "\375\202\377\377\377\202\376\377\377\1\377\377\375\212\377\377\377\202" \
- "\376\377\375\3\376\377\377\377\377\375\377\376\377\223\377\377\377\6" \
- "\377\377\375\377\376\377\374\377\377\377\377\377\377\376\377\376\377" \
- "\375\210\377\377\377\3\377\377\375\376\377\377\377\377\375\202\377\377" \
- "\377\1\377\377\375\223\377\377\377\4\376\376\376\377\377\375\376\376" \
- "\376\377\376\377\202\377\377\375\1\376\376\376\206\377\377\377\1\377" \
- "\377\375\215\377\377\377\1\377\377\375\202\377\377\377\5\376\377\377" \
- "\377\377\377\376\376\374\377\377\377\377\376\377\202\377\377\377\1\376" \
- "\376\376\221\377\377\377\7\376\377\375\377\375\377\377\377\377\376\377" \
- "\377\377\377\377\377\377\373\377\376\377\202\377\377\377\1\377\377\375" \
- "\202\377\377\377\1\377\377\375\204\377\377\377\6\376\376\377\377\377" \
- "\375\376\377\377\377\377\375\377\376\377\375\377\374\222\377\377\377" \
- "\3\376\377\375\377\377\377\376\377\375\203\376\377\377\1\377\376\377" \
- "\211\377\377\377\7\377\377\373\377\376\377\377\377\375\377\377\377\377" \
- "\376\377\376\376\376\376\377\377")
-
-
diff --git a/meta-agl/recipes-core/psplash/files/psplash-quit.service b/meta-agl/recipes-core/psplash/files/psplash-quit.service
deleted file mode 100644
index 14bd4994b..000000000
--- a/meta-agl/recipes-core/psplash/files/psplash-quit.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Terminate Psplash Boot Screen
-After=psplash-start.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/bin/psplash-write QUIT
-TimeoutSec=20
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-agl/recipes-core/psplash/files/psplash-start.service b/meta-agl/recipes-core/psplash/files/psplash-start.service
deleted file mode 100644
index 67619d378..000000000
--- a/meta-agl/recipes-core/psplash/files/psplash-start.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Start Psplash Boot Screen
-Wants=systemd-vconsole-setup.service
-After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service
-DefaultDependencies=no
-
-[Service]
-ExecStartPre=/bin/sh -c "if [ -e /sys/class/graphics/fbcon/cursor_blink ]; then echo 0 > /sys/class/graphics/fbcon/cursor_blink; fi"
-ExecStart=/usr/bin/psplash -n -a 90
-
-[Install]
-WantedBy=sysinit.target
diff --git a/meta-agl/recipes-core/psplash/psplash_git.bbappend b/meta-agl/recipes-core/psplash/psplash_git.bbappend
deleted file mode 100644
index c2c58c562..000000000
--- a/meta-agl/recipes-core/psplash/psplash_git.bbappend
+++ /dev/null
@@ -1,25 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://psplash-colors.h \
- file://psplash-start.service \
- file://psplash-quit.service \
- "
-
-SPLASH_IMAGES="file://psplash-poky-img.h;outsuffix=default"
-
-inherit systemd
-
-SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${PN}', '', d)}"
-SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'psplash-start.service psplash-quit.service', '', d)}"
-
-do_configure_append () {
- cd ${S}
- cp ../psplash-colors.h ./
-}
-
-do_install_append () {
- if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
- install -d ${D}${systemd_unitdir}/system
- install -m 644 ${WORKDIR}/*.service ${D}/${systemd_unitdir}/system
- fi
-}
diff --git a/meta-agl/recipes-core/systemd/.appends.core b/meta-agl/recipes-core/systemd/.appends.core
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-core/systemd/.appends.core
+++ /dev/null
diff --git a/meta-agl/recipes-core/systemd/systemd/wired.network b/meta-agl/recipes-core/systemd/systemd/wired.network
deleted file mode 100644
index 3559b0155..000000000
--- a/meta-agl/recipes-core/systemd/systemd/wired.network
+++ /dev/null
@@ -1,5 +0,0 @@
-[Match]
-Name=eth* en*
-
-[Network]
-DHCP=yes
diff --git a/meta-agl/recipes-core/systemd/systemd_%.bbappend b/meta-agl/recipes-core/systemd/systemd_%.bbappend
deleted file mode 100644
index ef877c0c1..000000000
--- a/meta-agl/recipes-core/systemd/systemd_%.bbappend
+++ /dev/null
@@ -1,22 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://e2fsck.conf \
- ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \
- "
-
-# enable networkd/resolved support
-PACKAGECONFIG_append_pn-systemd = " \
- ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','networkd resolved','',d)} \
-"
-
-do_install_append() {
- # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
- install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}${sysconfdir}/e2fsck.conf
-
- if ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','true','false',d)}; then
- # Install DHCP configuration for Ethernet adapters
- install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
- fi
-}
-
-FILES_${PN} += "${sysconfdir}/e2fsck.conf "
diff --git a/meta-agl/recipes-core/xmlsec1/xmlsec1_1.2.20.bb b/meta-agl/recipes-core/xmlsec1/xmlsec1_1.2.20.bb
deleted file mode 100644
index 7faf7bfd4..000000000
--- a/meta-agl/recipes-core/xmlsec1/xmlsec1_1.2.20.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-inherit autotools pkgconfig
-
-SUMMARY = "Library providing support for "XML Signature" and "XML Encryption" standards"
-DESCRIPTION = "XML Security Library is a C library based on LibXML2 and OpenSSL. \
-The library was created with a goal to support major XML security \
-standards "XML Digital Signature" and "XML Encryption". \
-"
-
-HOMEPAGE = "https://www.aleksey.com/xmlsec"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://Copyright;md5=32e47e213c77c55d2c666351d7ce16b5"
-
-SRC_URI = "git://git.gnome.org/xmlsec;branch=master;protocol=git"
-SRCREV = "84c8281cf927b1cdcc38f343f61c3aa448a5a10f"
-
-SECTION = "base"
-
-S = "${WORKDIR}/git"
-
-RDEPENDS_${PN} = "openssl libxml2"
-
-# choice is made to use openssl only and to not use xslt
-# nss would be a valuable choice
-EXTRA_OECONF = "\
- --disable-crypto-dl \
- --disable-apps-crypto-dl \
- --enable-shared \
- --disable-static \
- --without-gnutls \
- --without-gcrypt \
- --without-nss \
- --without-libxslt \
-"
-
-do_install_append() {
- # discarding this optional file is good for AGL
- rm ${D}${libdir}/xmlsec1Conf.sh
-}
-
-
diff --git a/meta-agl/recipes-devtools/python/python-pycrypto/cross-compiling.patch b/meta-agl/recipes-devtools/python/python-pycrypto/cross-compiling.patch
deleted file mode 100644
index 712f3e8dd..000000000
--- a/meta-agl/recipes-devtools/python/python-pycrypto/cross-compiling.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: pycrypto-2.6/setup.py
-===================================================================
---- pycrypto-2.6.orig/setup.py
-+++ pycrypto-2.6/setup.py
-@@ -271,7 +271,8 @@ class PCTBuildConfigure(Command):
- if not os.path.exists("config.status"):
- if os.system("chmod 0755 configure") != 0:
- raise RuntimeError("chmod error")
-- cmd = "sh configure" # we use "sh" here so that it'll work on mingw32 with standard python.org binaries
-+ host = os.environ.get("HOST_SYS")
-+ cmd = "ac_cv_func_malloc_0_nonnull=yes sh configure --host " + host # we use "sh" here so that it'll work on mingw32 with standard python.org binaries
- if self.verbose < 1:
- cmd += " -q"
- if os.system(cmd) != 0:
-@@ -370,7 +371,7 @@ kw = {'name':"pycrypto",
- 'ext_modules': plat_ext + [
- # _fastmath (uses GNU mp library)
- Extension("Crypto.PublicKey._fastmath",
-- include_dirs=['src/','/usr/include/'],
-+ include_dirs=['src/'],
- libraries=['gmp'],
- sources=["src/_fastmath.c"]),
-
diff --git a/meta-agl/recipes-devtools/python/python-pycrypto_2.6.1.bb b/meta-agl/recipes-devtools/python/python-pycrypto_2.6.1.bb
deleted file mode 100644
index f7a69dc9a..000000000
--- a/meta-agl/recipes-devtools/python/python-pycrypto_2.6.1.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-DESCRIPTION = "Cryptographic modules for Python."
-HOMEPAGE = "http://www.pycrypto.org/"
-LICENSE = "PSFv2"
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=35f354d199e8cb7667b059a23578e63d"
-
-DEPENDS += " gmp"
-PYPI_PACKAGE = "pycrypto"
-
-SRC_URI = "file://cross-compiling.patch"
-
-SRC_URI[md5sum] = "55a61a054aa66812daf5161a0d5d7eda"
-SRC_URI[sha256sum] = "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
-
-inherit pypi autotools-brokensep distutils
-BBCLASSEXTEND = "native"
-do_compile[noexec] = "1"
-
-# We explicitly call distutils_do_install, since we want it to run, but
-# *don't* want the autotools install to run, since this package doesn't
-# provide a "make install" target.
-do_install() {
- distutils_do_install
-}
diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts
deleted file mode 100755
index 7c2effa70..000000000
--- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2017 IoT.bzh.
-
-# Author: Ronan Le Martret <ronan.lemartret@iot.bzh>
-#
-
-# The following script will run all the scriptlets found in #SYSCONFDIR#/agl-postinsts.
-
-agl_pi_dir="#SYSCONFDIR#/agl-postinsts"
-
-POSTINST_LOGGING=1
-LOGFILE=/var/log/agl-postinstall.log
-
-[ -e $LOGFILE ] && mv ${LOGFILE} ${LOGFILE}.old.$(date +%F--%H%M.%S)
-
-append_log=">>$LOGFILE 2>&1"
-
-exec_postinst_scriptlets() {
- for i in `ls $agl_pi_dir`; do
- i=$agl_pi_dir/$i
- echo "Running postinst $i..."
- [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
- if [ -x $i ]; then
- eval sh -c $i $append_log
- rm $i
- else
- echo "ERROR: postinst $i failed."
- [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
- remove_agl_pi_dir=0
- fi
- done
-}
-
-remove_agl_pi_dir=1
-exec_postinst_scriptlets
-
-# since all postinstalls executed successfully, remove the postinstalls directory
-if [ $remove_agl_pi_dir = 1 ]; then
- rm -rf $agl_pi_dir
-fi
diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service
deleted file mode 100644
index 61d6d4679..000000000
--- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Run pending agl postinsts
-DefaultDependencies=no
-After=#SYSTEMD_SERVICE_AFTER#
-Before=#SYSTEMD_SERVICE_BEFORE#
-ConditionPathExists=#SYSCONFDIR#/agl-postinsts
-
-[Service]
-Type=oneshot
-ExecStart=#SBINDIR#/run-agl-postinsts
-ExecStartPost=#BASE_BINDIR#/systemctl disable run-agl-postinsts.service
-RemainAfterExit=No
-TimeoutSec=0
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb
deleted file mode 100644
index 96c171fa8..000000000
--- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bb
+++ /dev/null
@@ -1,47 +0,0 @@
-SUMMARY = "Runs AGL postinstall scripts on first boot of the target device"
-SECTION = "devel"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
- file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-SRC_URI = "file://run-agl-postinsts \
- file://run-agl-postinsts.service"
-
-S = "${WORKDIR}"
-
-inherit allarch systemd
-
-SYSTEMD_SERVICE_${PN} = "run-agl-postinsts.service"
-
-SYSTEMD_SERVICE_AFTER ?= "dbus.service cynara.service"
-
-SYSTEMD_SERVICE_BEFORE ?= "systemd-user-sessions.service"
-
-do_configure() {
- :
-}
-
-do_compile () {
- :
-}
-
-do_install() {
- install -d ${D}${sbindir}
- install -m 0755 ${WORKDIR}/run-agl-postinsts ${D}${sbindir}/
-
- install -d ${D}${systemd_unitdir}/system/
- install -m 0644 ${WORKDIR}/run-agl-postinsts.service ${D}${systemd_unitdir}/system/
-
- sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
- -e 's:#SBINDIR#:${sbindir}:g' \
- -e 's:#BASE_BINDIR#:${base_bindir}:g' \
- -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
- ${D}${sbindir}/run-agl-postinsts \
- ${D}${systemd_unitdir}/system/run-agl-postinsts.service
-
- sed -i -e 's:#SYSTEMD_SERVICE_AFTER#:${SYSTEMD_SERVICE_AFTER}:g' \
- -e 's:#SYSTEMD_SERVICE_BEFORE#:${SYSTEMD_SERVICE_BEFORE}:g' \
- ${D}${systemd_unitdir}/system/run-agl-postinsts.service
-}
-
diff --git a/meta-agl/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/meta-agl/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
deleted file mode 100644
index a486ac7ba..000000000
--- a/meta-agl/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Target Communication Framework agent
-After=network.target
-
-[Service]
-Type=forking
-ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
-KillSignal=USR2
-SuccessExitStatus=USR2
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-agl/recipes-devtools/tcf-agent/tcf-agent_git.bbappend b/meta-agl/recipes-devtools/tcf-agent/tcf-agent_git.bbappend
deleted file mode 100644
index 6f444b32f..000000000
--- a/meta-agl/recipes-devtools/tcf-agent/tcf-agent_git.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-# This is a backport of:
-# https://patchwork.openembedded.org/patch/140355/
-FILESEXTRAPATHS_prepend := "${THISDIR}/tcf-agent:"
diff --git a/meta-agl/recipes-extended/ltp/.appends.core b/meta-agl/recipes-extended/ltp/.appends.core
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-extended/ltp/.appends.core
+++ /dev/null
diff --git a/meta-agl/recipes-extended/ltp/ltp_%.bbappend b/meta-agl/recipes-extended/ltp/ltp_%.bbappend
deleted file mode 100644
index 22dda1d3f..000000000
--- a/meta-agl/recipes-extended/ltp/ltp_%.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-SRCREV = "52f4cf73fc1304e1339136729cfc03960d2d7c85"
-
-SRC_URI = "git://github.com/linux-test-project/ltp.git"
diff --git a/meta-agl/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb b/meta-agl/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb
deleted file mode 100644
index e0358d615..000000000
--- a/meta-agl/recipes-graphics/agl-desktop-config/agl-desktop-config_0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "AGL desktop config"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-SRC_URI += " \
- file://user-weston-term.service \
- file://user-weston-term.path \
-"
-
-do_install_append() {
- install -d ${D}${systemd_user_unitdir}
- install -m 0644 ${WORKDIR}/user-weston-term.service ${D}${systemd_user_unitdir}
- install -m 0644 ${WORKDIR}/user-weston-term.path ${D}${systemd_user_unitdir}
-
- install -d ${D}${systemd_user_unitdir}/default.target.wants
- ln -sf ${systemd_user_unitdir}/user-weston-term.path ${D}${libdir}/systemd/user/default.target.wants
-}
-
-FILES_${PN} += "${systemd_user_unitdir}/*"
-FILES_${PN} += "${systemd_user_unitdir}/default.target.wants/default.target.wants"
diff --git a/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.path b/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.path
deleted file mode 100644
index 9481840e5..000000000
--- a/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.path
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Terminal for weston user unit path
-
-[Path]
-PathExists=%t/wayland-0
-
-[Install]
-WantedBy=default.target
diff --git a/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.service b/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.service
deleted file mode 100644
index ad8b9583b..000000000
--- a/meta-agl/recipes-graphics/agl-desktop-config/files/user-weston-term.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Terminal for weston user
-After=user-config.service
-Requires=user-config.service
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/weston-terminal
-Restart=always
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-agl/recipes-graphics/images/agl-image-weston.bb b/meta-agl/recipes-graphics/images/agl-image-weston.bb
deleted file mode 100644
index 427132ed6..000000000
--- a/meta-agl/recipes-graphics/images/agl-image-weston.bb
+++ /dev/null
@@ -1,12 +0,0 @@
-SUMMARY = "A very basic Wayland image with a terminal"
-
-require agl-image-weston.inc
-
-LICENSE = "MIT"
-
-IMAGE_INSTALL_append = "\
- packagegroup-agl-image-weston \
- "
-
-DISTRO_FEATURES_append = " agl-core-image-profile"
-IMAGE_INSTALL_append = " agl-desktop-config"
diff --git a/meta-agl/recipes-graphics/images/agl-image-weston.inc b/meta-agl/recipes-graphics/images/agl-image-weston.inc
deleted file mode 100644
index 947d22b50..000000000
--- a/meta-agl/recipes-graphics/images/agl-image-weston.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-require recipes-core/images/agl-image-minimal.inc
-
-IMAGE_FEATURES += "splash package-management ssh-server-dropbear"
-
-inherit distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "wayland"
diff --git a/meta-agl/recipes-graphics/packagegroups/packagegroup-agl-image-weston.bb b/meta-agl/recipes-graphics/packagegroups/packagegroup-agl-image-weston.bb
deleted file mode 100644
index dcf21bcfb..000000000
--- a/meta-agl/recipes-graphics/packagegroups/packagegroup-agl-image-weston.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-DESCRIPTION = "The minimal set of packages required for basic Wayland image"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-image-weston \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "weston weston-init weston-ini-conf weston-examples"
-RDEPENDS_${PN} += "agl-login-manager"
-
-RDEPENDS_${PN} += "\
- packagegroup-agl-image-minimal \
- "
diff --git a/meta-agl/recipes-graphics/wayland/Readme.weston-ini-conf b/meta-agl/recipes-graphics/wayland/Readme.weston-ini-conf
deleted file mode 100644
index eb30a9a96..000000000
--- a/meta-agl/recipes-graphics/wayland/Readme.weston-ini-conf
+++ /dev/null
@@ -1,36 +0,0 @@
-#Generate a weston.ini file:
-
-To generate the weston.ini file:
-
-'''
-[core]
-backend=drm-backend.so
-shell=desktop-shell.so
-'''
-
-Just create a Variable Flag:
-
-'''
-WESTONCORE[backend]??="drm-backend.so"
-WESTONCORE[shell]??="desktop-shell.so"
-'''
-
-And add it to the Variable Flag WESTONSECTION, with the name of the section:
-'''
-WESTONSECTION[WESTONCORE]?="core"
-'''
-
-#You can custumize weston.ini by create a weston-ini-conf.bbappend:
-
-'''
-WESTONCORE[repaint-window] ??= "34"
-'''
-
-This will generate weston.ini file:
-
-'''
-[core]
-backend=drm-backend.so
-shell=ivi-shell.so
-repaint-window=34
-'''
diff --git a/meta-agl/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch b/meta-agl/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch
deleted file mode 100644
index b04127b57..000000000
--- a/meta-agl/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9162f7d4cfeec7103474e8703218b3679ca9ed10 Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Tue, 18 Apr 2017 13:53:26 +0200
-Subject: [PATCH] Change socket mode:add rw for group
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- src/wayland-server.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/wayland-server.c b/src/wayland-server.c
-index 64d1bec..313c5a0 100644
---- a/src/wayland-server.c
-+++ b/src/wayland-server.c
-@@ -1189,7 +1189,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s)
- wl_log("bind() failed with error: %m\n");
- return -1;
- }
--
-+ if (chmod(s->addr.sun_path, 0660) < 0) {
-+ wl_log("chmod() failed with error: %m\n");
-+ return -1;
-+ }
- if (listen(s->fd, 128) < 0) {
- wl_log("listen() failed with error: %m\n");
- return -1;
---
-2.6.6
-
diff --git a/meta-agl/recipes-graphics/wayland/wayland_%.bbappend b/meta-agl/recipes-graphics/wayland/wayland_%.bbappend
deleted file mode 100644
index 9d1822697..000000000
--- a/meta-agl/recipes-graphics/wayland/wayland_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI_append = "\
- file://0001-Change-socket-mode-add-rw-for-group.patch \
- "
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf.bb b/meta-agl/recipes-graphics/wayland/weston-ini-conf.bb
deleted file mode 100644
index 986a9eda9..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf.bb
+++ /dev/null
@@ -1,58 +0,0 @@
-SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
-
-S = "${WORKDIR}"
-
-require weston-ini-conf/screen.inc
-
-DEFAULT_SCREEN[transform]?="270"
-DEFAULT_SCREEN[name]?="HDMI-A-1"
-
-WESTONCORE[shell]??="desktop-shell.so"
-WESTONCORE[backend]??="drm-backend.so"
-
-WESTONSHELL[locking]="true"
-# hide panel
-WESTONSHELL[panel-location]="none"
-
-
-WESTONOUTPUT1[agl_screen]??="DEFAULT_SCREEN"
-
-WESTONSECTION[WESTONCORE]?="core"
-WESTONSECTION[WESTONSHELL]?="shell"
-WESTONSECTION[WESTONOUTPUT1]?="output"
-
-python do_generate_weston_init() {
- with open(d.getVar('WORKDIR', True)+"/weston.ini" ,'w') as weston_ini:
- dicoSection=d.getVarFlags('WESTONSECTION')
- keysSection=list(dicoSection.keys())
- keysSection.sort()
- for section in keysSection:
- weston_ini.writelines( "["+dicoSection[section]+"]\n")
- dicoSectionValues=d.getVarFlags(section)
- keysSectionValues=list(dicoSectionValues.keys())
- keysSectionValues.sort()
- for sectionValue in keysSectionValues:
- if (dicoSection[section] == "output" and sectionValue == "agl_screen"):
- screen=dicoSectionValues[sectionValue]
- dicoScreenConfig=d.getVarFlags(screen)
- keysScreenConfig=list(dicoScreenConfig.keys())
- keysScreenConfig.sort()
- for screenConfig in keysScreenConfig:
- weston_ini.writelines( screenConfig+"="+dicoScreenConfig[screenConfig]+"\n")
- else:
- weston_ini.writelines( str(sectionValue)+"="+str(dicoSectionValues[sectionValue])+"\n")
-
- weston_ini.writelines( "\n")
-}
-
-#ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
-
-addtask do_generate_weston_init after do_compile before do_install
-
-do_install_append() {
- WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
- install -d ${D}${WESTON_INI_CONFIG}
- install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
-}
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc
deleted file mode 100644
index 1c7718c70..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-require screen_dell.inc
-require screen_qemu.inc
-require screen_GeChic.inc
-require screen_DSI.inc
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc
deleted file mode 100644
index d5d91bf68..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_DSI.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-SCREEN_DSI[name] ?= "DSI-1"
-SCREEN_DSI[transform] ?= "270"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc
deleted file mode 100644
index d82b18027..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_GeChic.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-SCREEN_GECHIC[name] ?= "HDMI-A-1"
-SCREEN_GECHIC[transform] ?= "270"
-# for 1080p on GeChic 1502i:
-SCREEN_GECHIC[mode] = "173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc
deleted file mode 100644
index 051e2ee0d..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_dell.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-SCREEN_DELL[name]?="HDMI-A-1"
-SCREEN_DELL[transform]?="180"
diff --git a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_qemu.inc b/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_qemu.inc
deleted file mode 100644
index 76dd8b81f..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-ini-conf/screen_qemu.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-SCREEN_QEMU[name]?="Virtual-1"
-#mode=1920x1080
-#mode=1600x1200
-#mode=1680x1050
-#mode=1400x1050
-SCREEN_QEMU[mode]?="1600x900"
-#mode=1280x1024
-#mode=1440x900
-#mode=1280x960
-#mode=1360x768
-#mode=1280x800
-#mode=1280x768
-#mode=1280x720
-#mode=800x600
-#mode=848x480
-#mode=640x480
diff --git a/meta-agl/recipes-graphics/wayland/weston-init.bbappend b/meta-agl/recipes-graphics/wayland/weston-init.bbappend
deleted file mode 100644
index 4975b8e68..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-init.bbappend
+++ /dev/null
@@ -1,71 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-inherit agl-graphical
-
-WESTONSTART ??= "/usr/bin/weston --idle-time=4294967 --tty=${WESTONTTY}"
-WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/weston.log", "",d)}"
-
-SRC_URI += " \
- file://weston_tmpfiles.conf \
- file://weston.service.add \
-"
-
-do_install_append() {
- sed -i "/\[Unit\]/aConflicts=getty@tty${WESTONTTY}.service" \
- ${D}${systemd_system_unitdir}/weston.service
-
- sed -i "/\[Service\]/r ${S}/weston.service.add" \
- ${D}${systemd_system_unitdir}/weston.service
-
- sed -e 's,User=root,User=${WESTONUSER},g' \
- -e 's,ExecStart=.*,ExecStart=${WESTONSTART},g' \
- -e 's,@WESTONTTY@,${WESTONTTY},g' \
- -e 's,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \
- -i ${D}${systemd_system_unitdir}/weston.service
-
- # Add a rule to ensure the 'display' user has permissions to
- # open the graphics device
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/udev/rules.d
- cat >${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF'
-SUBSYSTEM=="drm", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*"
-EOF
-
- # user 'display' must own /dev/tty${WESTONTTY} for weston to start correctly
- cat >${D}${sysconfdir}/udev/rules.d/zz-tty.rules <<'EOF'
-SUBSYSTEM=="tty", KERNEL=="tty${WESTONTTY}", OWNER="${WESTONUSER}", SECLABEL{smack}="^"
-EOF
-
- # user 'display' must also be able to access /dev/input/*
- cat >${D}${sysconfdir}/udev/rules.d/zz-input.rules <<'EOF'
-SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="^"
-EOF
-
- # user 'display' must also be able to access /dev/media*, etc.
- cat >${D}${sysconfdir}/udev/rules.d/zz-remote-display.rules <<'EOF'
-SUBSYSTEM=="media", MODE="0660", GROUP="display", SECLABEL{smack}="*"
-SUBSYSTEM=="video4linux", MODE="0660", GROUP="display", SECLABEL{smack}="*"
-KERNEL=="uvcs", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*"
-KERNEL=="rgnmm", SUBSYSTEM=="misc", MODE="0660", GROUP="display", SECLABEL{smack}="*"
-EOF
-
- install -d ${D}${sysconfdir}/tmpfiles.d
- install -Dm755 ${WORKDIR}/weston_tmpfiles.conf ${D}/${libdir}/tmpfiles.d/weston.conf
-
- sed -e 's,@WESTONUSER@,${WESTONUSER},g' \
- -e 's,@WESTONGROUP@,${WESTONGROUP},g' \
- -i ${D}/${libdir}/tmpfiles.d/weston.conf
-}
-
-do_install_append_imx() {
-
- install -d ${D}${sysconfdir}/udev/rules.d
- cat >>${D}${sysconfdir}/udev/rules.d/zz-dri.rules <<'EOF'
-SUBSYSTEM=="gpu_class", MODE="0660", GROUP="${WESTONGROUP}", SECLABEL{smack}="*"
-EOF
-
-}
-
-FILES_${PN} += "${libdir}/tmpfiles.d/*.conf"
-
-
diff --git a/meta-agl/recipes-graphics/wayland/weston-init/weston.service.add b/meta-agl/recipes-graphics/wayland/weston-init/weston.service.add
deleted file mode 100644
index 3596e9c39..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-init/weston.service.add
+++ /dev/null
@@ -1,7 +0,0 @@
-Environment="XDG_RUNTIME_DIR=@XDG_RUNTIME_DIR@"
-TTYPath=/dev/tty@WESTONTTY@
-StandardInput=tty
-TTYReset=yes
-TTYVHangup=yes
-TTYVTDisallocate=yes
-UtmpIdentifier=tty@WESTONTTY@
diff --git a/meta-agl/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf b/meta-agl/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf
deleted file mode 100644
index c4b302faf..000000000
--- a/meta-agl/recipes-graphics/wayland/weston-init/weston_tmpfiles.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-# This file is distributed to create weston XDG_RUNTIME_DIR (/run/deamon/@WESTONUSER@)
-#
-# See tmpfiles.d(5) for details
-
-d /run/platform/ 0775 root root -
-d /run/platform/@WESTONUSER@ 0770 @WESTONUSER@ @WESTONGROUP@ -
diff --git a/meta-agl/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston.patch b/meta-agl/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston.patch
deleted file mode 100644
index 7b84a67ba..000000000
--- a/meta-agl/recipes-graphics/wayland/weston/0001-Allow-regular-users-to-launch-Weston.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From f5555b045a64231d4beaba51cbbf5f5485173900 Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Fri, 14 Apr 2017 19:04:32 +0200
-Subject: [PATCH] Allow regular users to launch Weston
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- configure.ac | 6 ++++++
- src/launcher-direct.c | 2 ++
- 2 files changed, 8 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 1d11864..4e48d52 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -131,6 +131,12 @@ if test x$enable_xkbcommon = xyes; then
- COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0"
- fi
-
-+AC_ARG_ENABLE(sys-uid, [ --enable-sys-uid],,
-+ enable_sys_uid=no)
-+if test x$enable_sys_uid = xyes; then
-+ AC_DEFINE(ENABLE_SYS_UID, [1], [Allow regular users to launch Weston])
-+fi
-+
- AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
- enable_setuid_install=yes)
- AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes)
-diff --git a/src/launcher-direct.c b/src/launcher-direct.c
-index 29d9c28..1ac6651 100644
---- a/src/launcher-direct.c
-+++ b/src/launcher-direct.c
-@@ -272,8 +272,10 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
- {
- struct launcher_direct *launcher;
-
-+#ifndef ENABLE_SYS_UID
- if (geteuid() != 0)
- return -EINVAL;
-+#endif
-
- launcher = zalloc(sizeof(*launcher));
- if (launcher == NULL)
---
-2.6.6
-
diff --git a/meta-agl/recipes-graphics/wayland/weston/0001-compositor-drm.c-Launch-without-input-devices.patch b/meta-agl/recipes-graphics/wayland/weston/0001-compositor-drm.c-Launch-without-input-devices.patch
deleted file mode 100644
index 93b7739fd..000000000
--- a/meta-agl/recipes-graphics/wayland/weston/0001-compositor-drm.c-Launch-without-input-devices.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 43f66e20a6788388df4fc052d257f005c359080f Mon Sep 17 00:00:00 2001
-From: Leon Anavi <leon.anavi@konsulko.com>
-Date: Wed, 14 Dec 2016 12:26:31 +0200
-Subject: [PATCH] compositor-drm.c: Launch without input devices
-
-Launch Weston 11 even if input devices (such as
-a keyboard, a mouse or a touchscreen) are not
-present.
-
-Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
----
- src/compositor-drm.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/compositor-drm.c b/src/compositor-drm.c
-index fd89627..f66e0af 100644
---- a/src/compositor-drm.c
-+++ b/src/compositor-drm.c
-@@ -3123,7 +3123,6 @@ drm_backend_create(struct weston_compositor *compositor,
- if (udev_input_init(&b->input,
- compositor, b->udev, seat_id) < 0) {
- weston_log("failed to create input devices\n");
-- goto err_sprite;
- }
-
- if (create_outputs(b, config->connector, drm_device) < 0) {
---
-2.7.4
diff --git a/meta-agl/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/recipes-graphics/wayland/weston_%.bbappend
deleted file mode 100644
index 0fe75ede6..000000000
--- a/meta-agl/recipes-graphics/wayland/weston_%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-SRC_URI_append = "\
- file://0001-compositor-drm.c-Launch-without-input-devices.patch \
- file://0001-Allow-regular-users-to-launch-Weston.patch \
- "
-
-EXTRA_OECONF_append = " --enable-sys-uid"
diff --git a/meta-agl/recipes-ivi/images/agl-image-ivi-crosssdk.bb b/meta-agl/recipes-ivi/images/agl-image-ivi-crosssdk.bb
deleted file mode 100644
index 0303d051d..000000000
--- a/meta-agl/recipes-ivi/images/agl-image-ivi-crosssdk.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "Cross SDK of AGL Distribution for IVI profile"
-
-DESCRIPTION = "Basic image for baseline of AGL Distribution for IVI profile. \
-It includes the full meta-toolchain, plus developement headers and libraries \
-to form a standalone cross SDK."
-
-require agl-image-ivi.bb
-
-LICENSE = "MIT"
-
-IMAGE_FEATURES += "dev-pkgs"
-IMAGE_INSTALL += "kernel-dev"
-
-inherit populate_sdk
-
-# Task do_populate_sdk and do_rootfs can't be exec simultaneously.
-# Both exec "createrepo" on the same directory, and so one of them
-# can failed (randomly).
-addtask do_populate_sdk after do_rootfs
diff --git a/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb b/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb
deleted file mode 100644
index 017439454..000000000
--- a/meta-agl/recipes-ivi/images/agl-image-ivi-qa.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-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
-
-LICENSE = "MIT"
-
-IMAGE_INSTALL_append = " \
- packagegroup-agl-test \
- packagegroup-ivi-common-test \
- "
-
diff --git a/meta-agl/recipes-ivi/images/agl-image-ivi.bb b/meta-agl/recipes-ivi/images/agl-image-ivi.bb
deleted file mode 100644
index dd4f89b15..000000000
--- a/meta-agl/recipes-ivi/images/agl-image-ivi.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "A basic system of AGL distribution of IVI profile"
-
-DESCRIPTION = "Basic image for baseline of AGL Distribution for IVI profile."
-
-require agl-image-ivi.inc
-
-LICENSE = "MIT"
-
-IMAGE_INSTALL_append = "\
- packagegroup-agl-image-ivi \
- "
-
-DISTRO_FEATURES_append = " agl-core-image-profile"
-
-IMAGE_INSTALL += "\
- agl-desktop-config \
- "
diff --git a/meta-agl/recipes-ivi/images/agl-image-ivi.inc b/meta-agl/recipes-ivi/images/agl-image-ivi.inc
deleted file mode 100644
index 0b564840b..000000000
--- a/meta-agl/recipes-ivi/images/agl-image-ivi.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-require recipes-core/images/agl-image-minimal.inc
-
-IMAGE_FEATURES += "splash package-management ssh-server-dropbear"
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-image-ivi.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-image-ivi.bb
deleted file mode 100644
index 27e90f808..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-image-ivi.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required for AGL Distribution"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-image-ivi \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- packagegroup-agl-image-minimal \
- packagegroup-ivi-common-core \
-"
-
-RDEPENDS_${PN} += "\
- packagegroup-agl-ivi-automotive \
- packagegroup-agl-ivi-connectivity \
- packagegroup-agl-ivi-graphics \
- packagegroup-agl-ivi-multimedia \
- packagegroup-agl-ivi-navi-lbs \
- packagegroup-agl-ivi-os-commonlibs \
- packagegroup-agl-ivi-speech-services \
- packagegroup-agl-ivi-security \
- packagegroup-agl-ivi-kernel \
- "
-
-RDEPENDS_${PN} += "\
- agl-login-manager \
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-automotive.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-automotive.bb
deleted file mode 100644
index f7221517f..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-automotive.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Automotive Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-automotive \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-connectivity.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-connectivity.bb
deleted file mode 100644
index 664180d55..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-connectivity.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Connectivity Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-connectivity \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- ofono \
- rtl-sdr \
- rygel \
- rygel-plugin-media-export \
- rygel-plugin-lms \
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-graphics.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-graphics.bb
deleted file mode 100644
index d7650564b..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-graphics.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Graphics Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-graphics \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-kernel.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-kernel.bb
deleted file mode 100644
index be51817b7..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-kernel.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Kernel Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-kernel \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-multimedia.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-multimedia.bb
deleted file mode 100644
index 11536405e..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-multimedia.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Multimedia Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-multimedia \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- gstreamer1.0-plugins-base-meta \
- gstreamer1.0-plugins-good-meta \
- lightmediascanner-meta \
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-navi-lbs.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-navi-lbs.bb
deleted file mode 100644
index 0a3ba2752..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-navi-lbs.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The packages of middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Navigation and Location Based Services Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-navi-lbs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-os-commonlibs.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-os-commonlibs.bb
deleted file mode 100644
index 0a9de8d5f..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-os-commonlibs.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The packages of middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Operating System and Common libraries Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-os-commonlibs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-security.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-security.bb
deleted file mode 100644
index f651c50cd..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-security.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The packages of middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Security Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-security \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-speech-services.bb b/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-speech-services.bb
deleted file mode 100644
index eccebee9f..000000000
--- a/meta-agl/recipes-ivi/packagegroups/packagegroup-agl-ivi-speech-services.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The packages of middlewares for AGL IVI profile"
-DESCRIPTION = "The set of packages required by Speech Services Subsystem"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-ivi-speech-services \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-agl/recipes-multimedia/faac/faac_%.bbappend b/meta-agl/recipes-multimedia/faac/faac_%.bbappend
deleted file mode 100644
index eb975881b..000000000
--- a/meta-agl/recipes-multimedia/faac/faac_%.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI += "file://0001-frontend-Fix-format-string-security-error.patch \
- file://0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch \
- "
diff --git a/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch b/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
deleted file mode 100644
index 75e003eac..000000000
--- a/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From c1d7a8b992dc36d0012cc3d54b7d3abf4ad4d5d8 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 28 Mar 2017 21:33:01 -0700
-Subject: [PATCH 1/2] frontend: Fix format string security error
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- frontend/main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/frontend/main.c b/frontend/main.c
-index 02146a8..cb9329c 100644
---- a/frontend/main.c
-+++ b/frontend/main.c
-@@ -715,7 +715,7 @@ int main(int argc, char *argv[])
- break;
- #endif
- case 'L':
-- fprintf(stderr, faac_copyright_string);
-+ fprintf(stderr, "%s", faac_copyright_string);
- dieMessage = license;
- break;
- case 'X':
---
-2.12.1
-
diff --git a/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch b/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
deleted file mode 100644
index d845ddf59..000000000
--- a/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 46cc9298c38b9dd735fec3f39aa2d6e56a362410 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 28 Mar 2017 21:33:36 -0700
-Subject: [PATCH 2/2] mp4v2: Define __STRING if cdefs.h does not exist
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- common/mp4v2/mp4util.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/common/mp4v2/mp4util.h b/common/mp4v2/mp4util.h
-index 1f9cb64..1e7aced 100644
---- a/common/mp4v2/mp4util.h
-+++ b/common/mp4v2/mp4util.h
-@@ -23,6 +23,10 @@
- #define __MP4_UTIL_INCLUDED__
- #include <assert.h>
-
-+#ifndef __STRING
-+#define __STRING(x) #x
-+#endif
-+
- #ifndef ASSERT
- #define ASSERT(expr) \
- if (!(expr)) { \
---
-2.12.1
-
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/.appends.meta-efl b/meta-agl/recipes-multimedia/lightmediascanner/.appends.meta-efl
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-multimedia/lightmediascanner/.appends.meta-efl
+++ /dev/null
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/dbus-lightmediascanner.conf b/meta-agl/recipes-multimedia/lightmediascanner/files/dbus-lightmediascanner.conf
deleted file mode 100644
index 9cb321ba9..000000000
--- a/meta-agl/recipes-multimedia/lightmediascanner/files/dbus-lightmediascanner.conf
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <policy context="default">
- <allow send_destination="org.lightmediascanner"/>
- <allow receive_type="signal" receive_sender="org.lightmediascanner" receive_interface="org.freedesktop.DBus.Properties"/>
- </policy>
-</busconfig>
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service b/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
deleted file mode 100644
index 78e449dc6..000000000
--- a/meta-agl/recipes-multimedia/lightmediascanner/files/lightmediascanner.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Lightmediascanner (LMS)
-
-[Service]
-Type=dbus
-BusName=org.lightmediascanner
-ExecStart=/usr/bin/lightmediascannerd --startup-scan --directory=/media
-
-[Install]
-WantedBy=default.target
-Alias=dbus-org.lightmediascanner.service
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/files/plugin-ogg-fix-chucksize-issue.patch b/meta-agl/recipes-multimedia/lightmediascanner/files/plugin-ogg-fix-chucksize-issue.patch
deleted file mode 100644
index 6a0b8ff93..000000000
--- a/meta-agl/recipes-multimedia/lightmediascanner/files/plugin-ogg-fix-chucksize-issue.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 3e66b97221440b17a184feb48692dce7e0561cac Mon Sep 17 00:00:00 2001
-From: Matt Ranostay <matt.ranostay@konsulko.com>
-Date: Wed, 8 Mar 2017 16:30:01 -0800
-Subject: [PATCH] plugin: ogg: fix chucksize issue
-
-There are some OGG files that have metadata chucks that go over the
-hardcoded 10 * 4096 size due to album art. This patchset just parses
-each chuck and continues till it runs out of valid chunks.
-
-Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
----
- src/plugins/ogg/ogg.c | 11 ++---------
- 1 file changed, 2 insertions(+), 9 deletions(-)
-
-diff --git a/src/plugins/ogg/ogg.c b/src/plugins/ogg/ogg.c
-index 1c0818e..c94dc38 100644
---- a/src/plugins/ogg/ogg.c
-+++ b/src/plugins/ogg/ogg.c
-@@ -47,8 +47,6 @@
- int CHUNKSIZE = 4096;
- #endif
-
--#define MAX_CHUNKS_PER_PAGE 10
--
- struct stream {
- struct lms_stream base;
- int serial;
-@@ -122,10 +120,8 @@ _set_lms_info(struct lms_string_size *info, const char *tag)
-
- static bool _ogg_read_page(FILE *fp, ogg_sync_state *osync, ogg_page *page)
- {
-- int i;
--
-- for (i = 0; i < MAX_CHUNKS_PER_PAGE && ogg_sync_pageout(osync, page) != 1;
-- i++) {
-+ while(ogg_sync_pageout(osync, page) != 1)
-+ {
- lms_ogg_buffer_t buffer = lms_get_ogg_sync_buffer(osync, CHUNKSIZE);
- int bytes = fread(buffer, 1, CHUNKSIZE, fp);
-
-@@ -136,9 +132,6 @@ static bool _ogg_read_page(FILE *fp, ogg_sync_state *osync, ogg_page *page)
- ogg_sync_wrote(osync, bytes);
- }
-
-- if (i > MAX_CHUNKS_PER_PAGE)
-- return false;
--
- return true;
- }
-
---
-2.7.4
-
diff --git a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend b/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
deleted file mode 100644
index cf248d3fd..000000000
--- a/meta-agl/recipes-multimedia/lightmediascanner/lightmediascanner_%.bbappend
+++ /dev/null
@@ -1,33 +0,0 @@
-# Disable everything but the roygalty-free formats
-PACKAGECONFIG = "ogg flac wave m3u pls jpeg png"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://lightmediascanner.service \
- file://plugin-ogg-fix-chucksize-issue.patch \
- file://dbus-lightmediascanner.conf \
- "
-
-CFLAGS_append = " -D_FILE_OFFSET_BITS=64"
-
-inherit systemd
-
-do_install_append() {
- # Install LMS systemd service
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- install -m 644 -p -D ${WORKDIR}/lightmediascanner.service ${D}${systemd_user_unitdir}/lightmediascanner.service
-
- # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
- # because it does not support systemd's user mode.
- mkdir -p ${D}/etc/systemd/user/default.target.wants/
- ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/dbus-org.lightmediascanner.service
- ln -sf ${systemd_user_unitdir}/lightmediascanner.service ${D}/etc/systemd/user/default.target.wants/lightmediascanner.service
- fi
-
- install -d ${D}/etc/dbus-1/session.d
- install -m 0644 ${WORKDIR}/dbus-lightmediascanner.conf ${D}/etc/dbus-1/session.d/lightmediascanner.conf
-}
-
-FILES_${PN} += " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/lightmediascanner.service', '', d)} \
- "
diff --git a/meta-agl/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb b/meta-agl/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb
deleted file mode 100644
index 196b76f08..000000000
--- a/meta-agl/recipes-multimedia/pulseaudio/agl-audio-plugin_0.1.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-SUMMARY = "AGL Audio Policy Plugin"
-DESCRIPTION = "AGL PulseAudio Routing plugin, forked from the Tizen IVI \
-PulseAudio Routing plugin, also known as module-murphy-ivi. This is a \
-stripped-down version of the former, not needing Murphy anymore and using \
-either a JSON configuration file or its own embedded configuration."
-HOMEPAGE = "http://www.iot.bzh"
-
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
-
-DEPENDS = "json-c pulseaudio"
-RDEPENDS_${PN} = "pulseaudio-server pulseaudio-module-null-sink pulseaudio-module-loopback"
-
-SRCREV = "952d404e87ca6001e546fe9105bdb6760c468760"
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/agl-audio-plugin;protocol=https"
-
-S = "${WORKDIR}/git"
-
-inherit cmake pkgconfig
-
-FULL_OPTIMIZATION = "-O1 -pipe ${DEBUG_FLAGS}"
-
-PULSE_PV="9.0"
-
-EXTRA_OECMAKE_append = " -DPULSE_PV:STRING=${PULSE_PV}"
-
-FILES_${PN} += "${libdir}/pulse-${PULSE_PV}/modules/* ${sysconfdir}/pulse/*"
-FILES_${PN}-dbg += "${libdir}/pulse-${PULSE_PV}/modules/.debug/*"
diff --git a/meta-agl/recipes-navi-lbs/.gitkeep b/meta-agl/recipes-navi-lbs/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-navi-lbs/.gitkeep
+++ /dev/null
diff --git a/meta-agl/recipes-support/.gitkeep b/meta-agl/recipes-support/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-support/.gitkeep
+++ /dev/null
diff --git a/meta-agl/recipes-support/gpm/.appends.meta-oe b/meta-agl/recipes-support/gpm/.appends.meta-oe
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-agl/recipes-support/gpm/.appends.meta-oe
+++ /dev/null
diff --git a/meta-agl/recipes-support/gpm/gpm_1.99.7.bbappend b/meta-agl/recipes-support/gpm/gpm_1.99.7.bbappend
deleted file mode 100644
index 5f68521d5..000000000
--- a/meta-agl/recipes-support/gpm/gpm_1.99.7.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
-# Original src_uri n/a, Use mirror.
-SRC_URI = "http://www.nico.schottelius.org/software/gpm/archives/gpm-1.99.7.tar.bz2 \
- file://no-docs.patch \
- file://processcreds.patch \
- file://eglibc-2.17.patch \
- file://init \
- "
diff --git a/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb b/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb
deleted file mode 100644
index 2a18cbc89..000000000
--- a/meta-agl/recipes-test/packagegroups/packagegroup-agl-test.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-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-app-framework/README b/meta-app-framework/README
new file mode 120000
index 000000000..4a7a1a175
--- /dev/null
+++ b/meta-app-framework/README
@@ -0,0 +1 @@
+README-AGL.md \ No newline at end of file
diff --git a/meta-app-framework/README-AGL.md b/meta-app-framework/README-AGL.md
new file mode 100644
index 000000000..bd0c2de8f
--- /dev/null
+++ b/meta-app-framework/README-AGL.md
@@ -0,0 +1,31 @@
+Overview
+========
+
+The
+[AGL Project](https://www.automotivelinux.org/) is an automotive-specific
+development environment that provides a Linux distribution
+[AGL UCB](https://www.automotivelinux.org/software/unified-code-base).
+
+AGL uses layers designed to be compatible with the
+[Yocto Project](https://www.yoctoproject.org) and the
+[OpenEmbedded Project (OE)](https://www.openembedded.org/wiki/Main_Page).
+
+This section provides information about the layers used by the AGL Project:
+
+* **`meta-agl/meta-app-framework`**: Application (lifecycle) manager
+
+ ```
+ $ git clone https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl
+ ```
+
+Maintenance
+-----------
+
+All patches must be submitted via the AGL Gerrit instance at
+<https://gerrit.automotivelinux.org>. See this wiki page for
+details:
+
+<https://wiki.automotivelinux.org/agl-distro/contributing>
+
+Layer maintainers:
+* Jan-Simon Möller <jsmoeller@linuxfoundation.org>
diff --git a/meta-app-framework/classes/agl-app.bbclass b/meta-app-framework/classes/agl-app.bbclass
new file mode 100644
index 000000000..491a36e02
--- /dev/null
+++ b/meta-app-framework/classes/agl-app.bbclass
@@ -0,0 +1,83 @@
+#
+# AGL application systemd unit installation class
+#
+
+# Systemd template unit
+# * agl-app, agl-app-web, agl-app-flutter valid
+AGL_APP_TEMPLATE ?= "agl-app"
+
+# Application ID
+# This is what the application will be referred to in the list
+# exposed to clients by applaunchd, and generally ends up as the
+# identifier used by agl-compositor for application surface
+# activation.
+AGL_APP_ID ?= "${BPN}"
+
+# Application display name
+AGL_APP_NAME ?= "${AGL_APP_ID}"
+
+# Application executable
+# * agl-app template only
+# Use if the application ID and the executable name are both
+# different from the package name and each other as well.
+AGL_APP_EXEC ?= "${AGL_APP_ID}"
+
+# Web application bundle directory (non-absolute, so directory
+# name under /usr/lib/wam_apps)
+# * agl-app-web template only
+# Use if the web application bundle installs to a directory that
+# is not the same as the package name.
+AGL_APP_WAM_DIR ?= "${BPN}"
+
+do_install:append () {
+ install -d ${D}${systemd_system_unitdir}
+ ln -s ${AGL_APP_TEMPLATE}\@.service \
+ ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service
+
+ # NOTE: Unit & Service changes could potentially be collected
+ # and a single override .conf created, but things will be
+ # kept simple for now.
+
+ if [ "${AGL_APP_EXEC}" != "${AGL_APP_ID}" ]; then
+ install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
+ cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/exec.conf
+ [Service]
+ ExecStart=
+ ExecStart=${AGL_APP_EXEC}
+ EOF
+ fi
+
+ if [ "${AGL_APP_NAME}" != "${AGL_APP_ID}" ]; then
+ install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
+ cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/name.conf
+ [Unit]
+ Description=
+ Description=${AGL_APP_NAME}
+ EOF
+ fi
+
+ if [ "${AGL_APP_TEMPLATE}" = "agl-app-web" -a "${AGL_APP_ID}" != "${BPN}" ]; then
+ # The application ID does not necessarily match the package name
+ # used in the WAM install hierarchy, and the IDs are hard-coded in
+ # some of the web apps, so if necessary create an override for the
+ # environment variable used in place of directly deriving from %i
+ # (which will always be the app id).
+ install -d ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d
+ cat <<-EOF > ${D}${systemd_system_unitdir}/${AGL_APP_TEMPLATE}\@${AGL_APP_ID}.service.d/wam.conf
+ [Service]
+ Environment=AGL_APP_WAM_DIR=${AGL_APP_WAM_DIR}
+ EOF
+ fi
+
+ if [ "${AGL_APP_TEMPLATE}" = "agl-app-flutter" ]; then
+ # Install icon if present
+ if [ -f ${S}/package/${AGL_APP_ID}.svg ]; then
+ install -d ${D}${datadir}/icons/hicolor/scalable
+ install -m 0644 ${S}/package/${AGL_APP_ID}.svg ${D}${datadir}/icons/hicolor/scalable/
+ fi
+ fi
+}
+
+FILES:${PN}:append = " ${systemd_system_unitdir} ${datadir}/icons"
+
+RDEPENDS:${PN}:append = " applaunchd-template-${AGL_APP_TEMPLATE}"
diff --git a/meta-app-framework/classes/aglwgt.bbclass b/meta-app-framework/classes/aglwgt.bbclass
deleted file mode 100644
index afe9a5516..000000000
--- a/meta-app-framework/classes/aglwgt.bbclass
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# aglwgt bbclass
-#
-# Jan-Simon Moeller, jsmoeller@linuxfoundation.org
-#
-# This class expects a "make package" target in the makefile
-# which creates the wgt files in the package/ subfolder.
-# The makefile needs to use wgtpkg-pack.
-#
-
-
-# 'wgtpkg-pack' in af-main-native is required.
-DEPENDS_append = " af-main-native"
-
-# for bindings af-binder is required.
-DEPENDS_append = " af-binder"
-
-do_aglwgt_package() {
- cd ${B}
- make package || ( \
- bbwarn "Your makefile must support the 'make package' target" ; \
- bbwarn "and generate a .wgt file using wgtpack in the"; \
- bbwarn "subfolder ./package/ !" ; \
- bbwarn "Fix your package as it will not work within the SDK" ; \
- bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes" \
- )
-}
-
-python () {
- d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1')
-}
-
-
-POST_INSTALL_LEVEL ?= "10"
-POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh"
-
-EXTRA_WGT_POSTINSTALL ?= ""
-
-do_aglwgt_deploy() {
- install -d ${D}/usr/AGL/apps
- install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/
- APP_FILES=""
- for file in ${D}/usr/AGL/apps/*.wgt;do
- APP_FILES="${APP_FILES} $(basename $file)";
- done
- install -d ${D}/${sysconfdir}/agl-postinsts
- cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <<EOF
-#!/bin/sh -e
-for file in ${APP_FILES}; do
- /usr/bin/afm-install install /usr/AGL/apps/\$file
-done
-sync
-${EXTRA_WGT_POSTINSTALL}
-EOF
- chmod a+x ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}
-}
-
-FILES_${PN} += "/usr/AGL/apps/*.wgt ${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT}"
-
-addtask aglwgt_deploy before do_package after do_install
-addtask aglwgt_package before do_aglwgt_deploy after do_compile
diff --git a/meta-app-framework/conf/include/agl-app-framework.inc b/meta-app-framework/conf/include/agl-app-framework.inc
new file mode 100644
index 000000000..296f49e79
--- /dev/null
+++ b/meta-app-framework/conf/include/agl-app-framework.inc
@@ -0,0 +1,2 @@
+# enable the layer
+AGL_FEATURES:append = " agl-app-fw"
diff --git a/meta-app-framework/conf/include/agl-appfw-smack.inc b/meta-app-framework/conf/include/agl-appfw-smack.inc
deleted file mode 100644
index 133f6b04c..000000000
--- a/meta-app-framework/conf/include/agl-appfw-smack.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-# enable security features (smack, cynara) - required by Application Framework
-OVERRIDES .= ":smack"
-DISTRO_FEATURES_append = " smack dbus-cynara xattr"
-
-# use tar-native to support SMACK extended attributes independently of host config
-IMAGE_CMD_TAR = "tar --xattrs --xattrs-include='*'"
-IMAGE_DEPENDS_tar_append = " tar-replacement-native"
-EXTRANATIVEPATH += "tar-native"
-
-# security: enable ssh server in place of dropbear to support PAM on user sessions
-IMAGE_FEATURES += "ssh-server-openssh"
-
-# enforce copy of xattrs (to be removed, see SPEC-475)
-PACKAGECONFIG_append_pn-shadow = " attr"
-PACKAGECONFIG_append_pn-shadow-native = " attr"
-
diff --git a/meta-app-framework/conf/layer.conf b/meta-app-framework/conf/layer.conf
index f74ebd658..0fe82784b 100644
--- a/meta-app-framework/conf/layer.conf
+++ b/meta-app-framework/conf/layer.conf
@@ -5,7 +5,9 @@ BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
-BBFILE_COLLECTIONS += "app-framework"
-BBFILE_PATTERN_app-framework = "^${LAYERDIR}/"
-BBFILE_PRIORITY_app-framework = "7"
+BBFILE_COLLECTIONS += "meta-app-framework"
+BBFILE_PATTERN_meta-app-framework = "^${LAYERDIR}/"
+BBFILE_PRIORITY_meta-app-framework = "60"
+LAYERSERIES_COMPAT_meta-app-framework = "scarthgap"
+LAYERDEPENDS_meta-app-framework = "core aglcore openembedded-layer"
diff --git a/meta-app-framework/recipes-config/agl-users/agl-users_0.1.bb b/meta-app-framework/recipes-config/agl-users/agl-users_0.1.bb
deleted file mode 100644
index f98888d28..000000000
--- a/meta-app-framework/recipes-config/agl-users/agl-users_0.1.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-inherit allarch useradd
-
-SUMMARY = "AGL Users Seed"
-DESCRIPTION = "This is a core framework component that\
- defines how users are managed and who are the default users."
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-ALLOW_EMPTY_${PN} = "1"
-
-USERADD_PACKAGES = "${PN}"
-
-GROUPADD_PARAM_${PN} = " --system display ; --system weston-launch"
-
-USERADD_PARAM_${PN} = "\
- -g users -G display -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \
- -g users -G display -d /home/agl-passenger -m -K PASS_MAX_DAYS=-1 agl-passenger ; \
- --gid display --groups weston-launch,video,input --home-dir /run/platform/display --shell /bin/false --comment \"Display daemon\" --key PASS_MAX_DAYS=-1 display \
-"
diff --git a/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules b/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules
new file mode 100644
index 000000000..35b9559c5
--- /dev/null
+++ b/meta-app-framework/recipes-config/polkit-rule-agl-app/files/50-agl-app.rules
@@ -0,0 +1,7 @@
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.systemd1.manage-units" &&
+ action.lookup("unit").indexOf("agl-app") == 0 &&
+ subject.isInGroup("applaunchd")) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb b/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb
new file mode 100644
index 000000000..57dda7787
--- /dev/null
+++ b/meta-app-framework/recipes-config/polkit-rule-agl-app/polkit-rule-agl-app.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Rule for agl-driver to control agl-app@ services"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://50-agl-app.rules"
+
+DEPENDS += "polkit"
+
+inherit useradd features_check
+REQUIRED_DISTRO_FEATURES = "polkit"
+
+do_install() {
+ install -m 700 -d ${D}${datadir}/polkit-1/rules.d
+ chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
+ install -m 0644 ${WORKDIR}/50-agl-app.rules ${D}${datadir}/polkit-1/rules.d
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM:${PN} += "--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;"
+
+FILES:${PN} += "${datadir}/polkit-1/rules.d/*.rules"
diff --git a/meta-app-framework/recipes-core/af-binder/af-binder_1.0.bb b/meta-app-framework/recipes-core/af-binder/af-binder_1.0.bb
deleted file mode 100644
index 2c9a7840c..000000000
--- a/meta-app-framework/recipes-core/af-binder/af-binder_1.0.bb
+++ /dev/null
@@ -1,84 +0,0 @@
-SUMMARY = "HTTP REST interface to automotive backends for HTML5 UI support"
-DESCRIPTION = "Automotive-Framework-Binder Daemon provides a HTTP REST \
-interface to various automotive-oriented bindings, \
-allowing HTML5 UIs to send platform-specific requests in a secure way."
-HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder"
-
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
-
-DEPENDS = "file json-c libmicrohttpd systemd util-linux openssl cynara"
-
-SRC_URI_git = "git://gerrit.automotivelinux.org/gerrit/src/app-framework-binder;protocol=https;branch=master"
-SRC_URI_files = ""
-SRC_URI = "${SRC_URI_git} \
- ${SRC_URI_files} \
- "
-
-SRCREV = "305d98f7b6db1a3207cc877bd2cda819e3b90656"
-S = "${WORKDIR}/git"
-
-inherit cmake pkgconfig
-
-pkg_postinst_${PN}() {
- mkdir -p "$D${libdir}/afb"
-}
-
-#############################################
-# setup package
-#############################################
-PACKAGES += "${PN}-tools ${PN}-meta"
-
-FILES_${PN} += "${datadir}"
-
-ALLOW_EMPTY_${PN}-meta = "1"
-
-FILES_${PN}-tools = "\
- ${bindir}/afb-client-demo \
- ${bindir}/afb-genskel \
-"
-
-RDEPENDS_${PN}-dev += "libafbwsc-dev"
-
-#############################################
-# setup sample binding packages
-#############################################
-PACKAGES_DYNAMIC = "${PN}-binding-*"
-
-python populate_packages_prepend () {
- afb_libdir = d.expand('${libdir}/afb')
- postinst = d.getVar('binding_postinst', True)
- pkgs = []
- pkgs_dbg = []
-
- pkgs += do_split_packages(d, afb_libdir, '(.*)-api\.so$', d.expand('${PN}-binding-%s'), 'AFB binding for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
- pkgs += do_split_packages(d, afb_libdir, '(.*(?!-api))\.so$', d.expand('${PN}-binding-%s'), 'AFB binding for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
-
- pkgs_dbg += do_split_packages(d, oe.path.join(afb_libdir, ".debug"), '(.*)-api\.so$', d.expand('${PN}-binding-%s-dbg'), 'AFB binding for %s, debug info', postinst=postinst, extra_depends=d.expand('${PN}'))
- pkgs_dbg += do_split_packages(d, oe.path.join(afb_libdir, ".debug"), '(.*(?!-api))\.so$', d.expand('${PN}-binding-%s-dbg'), 'AFB binding for %s, debug info', postinst=postinst, extra_depends=d.expand('${PN}'))
-
- metapkg = d.getVar('PN', True) + '-meta'
- d.setVar('RDEPENDS_' + metapkg, ' '.join(pkgs))
-}
-
-#############################################
-# setup libafbwsc package
-#############################################
-PACKAGES =+ "libafbwsc libafbwsc-dev libafbwsc-dbg"
-
-FILES_libafbwsc = "\
- ${libdir}/libafbwsc.so.* \
-"
-FILES_libafbwsc-dev = "\
- ${includedir}/afb/afb-wsj1.h \
- ${includedir}/afb/afb-ws-client.h \
- ${libdir}/libafbwsc.so \
- ${libdir}/pkgconfig/libafbwsc.pc \
-"
-FILES_libafbwsc-dbg = "\
- ${libdir}/.debug/libafbwsc.so.* \
- ${bindir}/.debug/afb-client-demo \
-"
-RDEPENDS_libafbwsc-dbg += "${PN}-dbg libafbwsc-dev"
-
-
diff --git a/meta-app-framework/recipes-core/af-main/af-main/Hack-to-allow-the-debugging.patch b/meta-app-framework/recipes-core/af-main/af-main/Hack-to-allow-the-debugging.patch
deleted file mode 100644
index 44e8bce1e..000000000
--- a/meta-app-framework/recipes-core/af-main/af-main/Hack-to-allow-the-debugging.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From a4fbfb88f1b7c4f4287d9279767220fae80d26da Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
-Date: Thu, 21 Jan 2016 15:07:29 +0100
-Subject: [PATCH] Hack to allow the debugging
-
-This is a temporarily fix to continue debugging
-afm-main. This should be removed later.
-
-Change-Id: I2f10f0cb1fce2ee30bd0754ad2e7bc8e2f6513aa
----
- conf/afm-user-daemon.conf | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/conf/afm-user-daemon.conf b/conf/afm-user-daemon.conf
-index 801c7ae..98a3152 100644
---- a/conf/afm-user-daemon.conf
-+++ b/conf/afm-user-daemon.conf
-@@ -25,7 +25,7 @@
- </policy>
-
- <policy context="default">
-- <deny own="org.AGL.afm.user"/>
-+ <allow own="org.AGL.afm.user"/>
- <allow send_destination="org.AGL.afm.system"/>
- </policy>
-
---
-2.1.4
-
diff --git a/meta-app-framework/recipes-core/af-main/af-main/afm-install b/meta-app-framework/recipes-core/af-main/af-main/afm-install
deleted file mode 100755
index aadcae213..000000000
--- a/meta-app-framework/recipes-core/af-main/af-main/afm-install
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-pretty() {
- sed \
- -e '/^method return .*/d' \
- -e 's/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/' \
- -e 's/^ string "\(.*\)"/\1/' \
- -e 's/},/&\n/'
-}
-
-send() {
- dbus-send --system --print-reply \
- --dest=org.AGL.afm.system \
- /org/AGL/afm/system \
- org.AGL.afm.system.$1 \
- "string:$2" |
- pretty
- return ${PIPESTATUS[0]}
-}
-
-case "$1" in
-
- add|install)
- f=$(realpath $2)
- send install '{"wgt":"'"$f"'","force":true,"reload":false}'
- ;;
-
- -h|--help|help)
- cat << EOC
-
-The commands are:
-
- add wgt
- install wgt install the wgt file
-
-EOC
- ;;
-
- *)
- echo "unknown command $1" >&2
- exit 1
- ;;
-esac
-
-
diff --git a/meta-app-framework/recipes-core/af-main/af-main_1.0.bb b/meta-app-framework/recipes-core/af-main/af-main_1.0.bb
deleted file mode 100644
index b71a4cba3..000000000
--- a/meta-app-framework/recipes-core/af-main/af-main_1.0.bb
+++ /dev/null
@@ -1,121 +0,0 @@
-require af-main_${PV}.inc
-
-# NOTE: using libcap-native and setcap in install doesn't work
-# NOTE: there is no SYSTEMD_USER_SERVICE_...
-# NOTE: maybe setting afm_name to agl-framework is cleaner but has implications
-# NOTE: there is a hack of security for using groups and dbus (to be checked)
-# NOTE: using ZIP programs creates directories with mode 777 (very bad)
-
-inherit cmake pkgconfig useradd systemd
-BBCLASSEXTEND = "native"
-
-SECTION = "base"
-
-DEPENDS = "openssl libxml2 xmlsec1 systemd libzip json-c systemd security-manager libcap-native af-binder"
-DEPENDS_class-native = "openssl libxml2 xmlsec1 libzip json-c"
-
-EXTRA_OECMAKE_class-native = "\
- -DUSE_LIBZIP=1 \
- -DUSE_SIMULATION=1 \
- -DUSE_SDK=1 \
- -Dafm_name=${afm_name} \
- -Dafm_confdir=${afm_confdir} \
- -Dafm_datadir=${afm_datadir} \
-"
-
-EXTRA_OECMAKE = "\
- -DUSE_LIBZIP=1 \
- -DUSE_SIMULATION=0 \
- -DUSE_SDK=0 \
- -Dafm_name=${afm_name} \
- -Dafm_confdir=${afm_confdir} \
- -Dafm_datadir=${afm_datadir} \
- -Dsystemd_units_root=${systemd_units_root} \
- -DUNITDIR_USER=${systemd_user_unitdir} \
- -DUNITDIR_SYSTEM=${systemd_system_unitdir} \
-"
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "-g ${afm_name} -d ${afm_datadir} -r ${afm_name}"
-GROUPADD_PARAM_${PN} = "-r ${afm_name}"
-
-SYSTEMD_SERVICE_${PN} = "afm-system-daemon.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-FILES_${PN} += "\
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/afm-user-daemon.service', '', d)} \
-"
-RDEPENDS_${PN}_append_smack = " smack-userspace"
-DEPENDS_append_smack = " smack-userspace-native"
-
-# short hacks here
-SRC_URI += "\
- file://Hack-to-allow-the-debugging.patch \
-"
-
-# tools used to install wgt at first boot
-SRC_URI += "\
- file://afm-install \
-"
-
-do_install_append_class-target() {
- install -d ${D}${bindir}
- install -d -m 0775 ${D}${systemd_units_root}/system
- install -d -m 0775 ${D}${systemd_units_root}/user
- install -d -m 0775 ${D}${systemd_units_root}/system/default.target.wants
- install -d -m 0775 ${D}${systemd_units_root}/user/default.target.wants
- install -d -m 0775 ${D}${systemd_units_root}/system/sockets.target.wants
- install -d -m 0775 ${D}${systemd_units_root}/user/sockets.target.wants
- install -d ${D}${afm_datadir}/applications
- install -d ${D}${afm_datadir}/icons
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- mkdir -p ${D}${sysconfdir}/systemd/system/default.target.wants
- mkdir -p ${D}${sysconfdir}/systemd/user/default.target.wants
- ln -sf ${systemd_user_unitdir}/afm-user-daemon.service ${D}${sysconfdir}/systemd/user/default.target.wants
- fi
- install -m 0755 ${WORKDIR}/afm-install ${D}${bindir}
- echo "QT_WAYLAND_SHELL_INTEGRATION=ivi-shell" > ${D}${afm_confdir}/unit.env.d/qt-for-ivi-shell
-}
-
-do_install_append_porter() {
- echo "LD_PRELOAD=/usr/lib/libEGL.so" > ${D}${afm_confdir}/unit.env.d/preload-libEGL
-}
-
-pkg_postinst_${PN}() {
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- for SYS in "system" "user";do
- for DEST in "default.target.wants" ".";do
- chgrp ${afm_name} $D${systemd_units_root}/${SYS}/${DEST};
- done
- done
- fi
- for DEST in "applications" "icons" ".";do
- chown ${afm_name}:${afm_name} $D${afm_datadir}/${DEST};
- done
- setcap cap_mac_override,cap_dac_override=ep $D${bindir}/afm-system-daemon
-}
-
-pkg_postinst_${PN}_smack() {
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- for SYS in "system" "user";do
- for DEST in "default.target.wants" ".";do
- chgrp ${afm_name} $D${systemd_units_root}/${SYS}/${DEST};
- chsmack -a 'System::Shared' -t $D${systemd_units_root}/${SYS}/${DEST};
- done
- done
- fi
- for DEST in "applications" "icons" ".";do
- chown ${afm_name}:${afm_name} $D${afm_datadir}/${DEST};
- chsmack -a 'System::Shared' -t $D${afm_datadir}/${DEST};
- done
- setcap cap_mac_override,cap_dac_override=ep $D${bindir}/afm-system-daemon
-}
-FILES_${PN} += " ${systemd_units_root} "
-
-PACKAGES =+ "${PN}-binding ${PN}-binding-dbg"
-FILES_${PN}-binding = " ${afb_binding_dir}/afm-main-binding.so "
-FILES_${PN}-binding-dbg = " ${afb_binding_dir}/.debug/afm-main-binding.so "
-
-PACKAGES =+ "${PN}-tools ${PN}-tools-dbg"
-FILES_${PN}-tools = "${bindir}/wgtpkg-*"
-FILES_${PN}-tools-dbg = "${bindir}/.debug/wgtpkg-*"
diff --git a/meta-app-framework/recipes-core/af-main/af-main_1.0.inc b/meta-app-framework/recipes-core/af-main/af-main_1.0.inc
deleted file mode 100644
index f7d3bc8e1..000000000
--- a/meta-app-framework/recipes-core/af-main/af-main_1.0.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-SUMMARY = "AGL Framework Main part"
-DESCRIPTION = "\
-This is a core framework component for managing \
-applications, widgets, and components. \
-"
-
-HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-main"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
-
-SRC_URI_git = "git://gerrit.automotivelinux.org/gerrit/src/app-framework-main;protocol=https;branch=master"
-SRC_URI_files = ""
-SRC_URI = "${SRC_URI_git} \
- ${SRC_URI_files} \
- "
-
-SRCREV = "5cea66506dff09e8bdebbd623115ea103e87aba6"
-
-S = "${WORKDIR}/git"
-
-afm_name = "afm"
-afm_confdir = "${sysconfdir}/${afm_name}"
-afm_datadir = "/var/local/lib/${afm_name}"
-afb_binding_dir = "${libdir}/afb"
-systemd_units_root = "/usr/local/lib/systemd"
-
diff --git a/meta-app-framework/recipes-core/af-main/nativesdk-af-main_1.0.bb b/meta-app-framework/recipes-core/af-main/nativesdk-af-main_1.0.bb
deleted file mode 100644
index 8d044345f..000000000
--- a/meta-app-framework/recipes-core/af-main/nativesdk-af-main_1.0.bb
+++ /dev/null
@@ -1,26 +0,0 @@
-require af-main_${PV}.inc
-
-inherit nativesdk cmake pkgconfig
-
-SECTION = "base"
-
-DEPENDS = "nativesdk-openssl nativesdk-libxml2 nativesdk-xmlsec1 nativesdk-libzip nativesdk-json-c"
-
-EXTRA_OECMAKE = "\
- -DUSE_LIBZIP=1 \
- -DUSE_SIMULATION=1 \
- -DUSE_SDK=1 \
- -Dafm_name=${afm_name} \
- -Dafm_confdir=${afm_confdir} \
- -Dafm_datadir=${afm_datadir} \
-"
-
-do_install_append() {
- # remove unused .pc file we don't want to package
- rm -rf ${D}/${libdir}
-}
-
-PACKAGES = "${PN}-tools ${PN}-tools-dbg"
-FILES_${PN}-tools = "${bindir}/wgtpkg-* ${afm_confdir}/*"
-FILES_${PN}-tools-dbg = "${bindir}/.debug/wgtpkg-*"
-
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service
new file mode 100644
index 000000000..a9a2527e0
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-flutter@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=%I
+
+[Service]
+Type=simple
+User=agl-driver
+Environment=FLUTTER_VERSION=3.3.7
+Environment=FLUTTER_RUNTIME=release
+EnvironmentFile=-/etc/default/flutter
+EnvironmentFile=-/etc/default/%I
+Environment=XDG_RUNTIME_DIR=/run/user/1001/
+ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/%I/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --xdg-shell-app-id=%I
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service
new file mode 100644
index 000000000..e0353b6ae
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app-web@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=%I
+
+[Service]
+Type=simple
+User=agl-driver
+EnvironmentFile=-/etc/default/WebAppMgr.env
+Environment=XDG_RUNTIME_DIR=/run/user/1001/
+Environment=AGL_APP_WAM_DIR=%I
+ExecStart=/usr/bin/WebAppMgrCli --appid=%I --app-install-dir=/usr/lib/wam_apps/${AGL_APP_WAM_DIR}/
+
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app@.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app@.service
new file mode 100644
index 000000000..234348846
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/agl-app@.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=%I
+
+[Service]
+Type=simple
+User=agl-driver
+Environment=XDG_RUNTIME_DIR=/run/user/1001/
+ExecStart=%i
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service b/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service
new file mode 100644
index 000000000..73d36bd0c
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/applaunchd.service
@@ -0,0 +1,13 @@
+[Unit]
+Wants=network.target polkit.service
+After=network.target polkit.service
+
+[Service]
+Type=notify
+User=applaunchd
+Environment=XDG_DATA_DIRS=/usr/share
+ExecStart=/usr/bin/applaunchd
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/no-network.conf b/meta-app-framework/recipes-core/applaunchd/applaunchd/no-network.conf
new file mode 100644
index 000000000..c7c4f8a31
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/no-network.conf
@@ -0,0 +1,2 @@
+[Service]
+PrivateNetwork=true
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd/private-tmp.conf b/meta-app-framework/recipes-core/applaunchd/applaunchd/private-tmp.conf
new file mode 100644
index 000000000..0bdba7c99
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd/private-tmp.conf
@@ -0,0 +1,2 @@
+[Service]
+PrivateTmp=yes
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb
new file mode 100644
index 000000000..c1bafad8e
--- /dev/null
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb
@@ -0,0 +1,78 @@
+SUMMARY = "AGL Application Launcher service"
+DESCRIPTION = "AGL Application Launcher service build with recipe method"
+HOMEPAGE = "https://git.automotivelinux.org/src/applaunchd"
+SECTION = "apps"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ae6497158920d9524cf208c09cc4c984"
+
+DEPENDS = " \
+ glib-2.0 \
+ glib-2.0-native \
+ protobuf-native \
+ grpc-native \
+ grpc \
+ systemd \
+"
+
+PV = "2.0+git${SRCPV}"
+
+SRC_URI = " \
+ git://gerrit.automotivelinux.org/gerrit/src/applaunchd;protocol=https;branch=${AGL_BRANCH} \
+ file://applaunchd.service \
+ file://agl-app@.service \
+ file://agl-app-web@.service \
+ file://agl-app-flutter@.service \
+ file://no-network.conf \
+ file://private-tmp.conf \
+"
+SRCREV = "c32fe42f40d0af8b31b6113a3140f52b83be7769"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig systemd useradd features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd polkit"
+
+USERADD_PACKAGES = "${PN}"
+USERADDEXTENSION = "useradd-staticids"
+GROUPADD_PARAM:${PN} = "-g 1003 applaunchd ; "
+USERADD_PARAM:${PN} = "\
+ -g 1003 -u 1003 -o -d / -K PASS_MAX_DAYS=-1 applaunchd ; \
+"
+
+SYSTEMD_SERVICE:${PN} = "applaunchd.service"
+
+do_install:append() {
+ # Install generic template for all agl-app services
+ install -d ${D}${systemd_system_unitdir}
+ install -m 644 ${WORKDIR}/applaunchd.service ${D}${systemd_system_unitdir}/
+ install -m 644 ${WORKDIR}/agl-app@.service ${D}${systemd_system_unitdir}/
+ install -m 644 ${WORKDIR}/agl-app-web@.service ${D}${systemd_system_unitdir}/
+ install -m 644 ${WORKDIR}/agl-app-flutter@.service ${D}${systemd_system_unitdir}/
+
+ # Install individual sandboxing overrides/drop-ins to be used by apps
+ install -d ${D}${systemd_system_unitdir}/sandboxing
+ install -m 644 ${WORKDIR}/no-network.conf ${D}${systemd_system_unitdir}/sandboxing/
+ install -m 644 ${WORKDIR}/private-tmp.conf ${D}${systemd_system_unitdir}/sandboxing/
+}
+
+PACKAGE_BEFORE_PN += "${PN}-template-agl-app ${PN}-template-agl-app-web ${PN}-template-agl-app-flutter"
+
+FILES:${PN} += "${systemd_system_unitdir}"
+
+FILES:${PN}-template-agl-app = "${systemd_system_unitdir}/agl-app@.service"
+
+FILES:${PN}-template-agl-app-web = "${systemd_system_unitdir}/agl-app-web@.service"
+
+FILES:${PN}-template-agl-app-flutter = "${systemd_system_unitdir}/agl-app-flutter@.service"
+
+RDEPENDS:${PN} += " \
+ agl-users \
+ polkit-rule-agl-app \
+"
+
+RDEPENDS:${PN}-template-agl-app = "${PN}"
+
+RDEPENDS:${PN}-template-agl-app-web = "${PN}"
+
+RDEPENDS:${PN}-template-agl-app-flutter = "${PN}"
diff --git a/meta-app-framework/recipes-core/base-files/base-files_%.bbappend b/meta-app-framework/recipes-core/base-files/base-files_%.bbappend
deleted file mode 100644
index 0e93b4d65..000000000
--- a/meta-app-framework/recipes-core/base-files/base-files_%.bbappend
+++ /dev/null
@@ -1,29 +0,0 @@
-DEPENDS_append_smack = " smack-userspace-native"
-RDEPENDS_${PN}_append_smack = " smack-userspace"
-
-do_install_append() {
- install -d ${D}/${sysconfdir}/skel/app-data
- install -d ${D}/${sysconfdir}/skel/.config
- install -m 0755 -d ${D}/var
- if [ -d ${D}/usr/local ]; then
- mv ${D}/usr/local ${D}/var
- else
- install -m 0755 -d ${D}/var/local
- fi
- ln -s ../../var/local ${D}/usr/local
-}
-
-do_install_append_smack () {
- install -d ${D}/${sysconfdir}/smack/accesses.d
- cat > ${D}/${sysconfdir}/smack/accesses.d/default-access-domains-no-user <<EOF
-System User::App-Shared rwxat
-System User::Home rwxat
-EOF
- chmod 0644 ${D}/${sysconfdir}/smack/accesses.d/default-access-domains-no-user
-}
-
-pkg_postinst_${PN}_append_smack() {
- chsmack -r -a 'User::Home' -t -D $D/${sysconfdir}/skel
- chsmack -a 'User::App-Shared' -D $D/${sysconfdir}/skel/app-data
-}
-
diff --git a/meta-app-framework/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/meta-app-framework/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
deleted file mode 100644
index ca0b54f73..000000000
--- a/meta-app-framework/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-RDEPENDS_${PN} =+ "nativesdk-af-main-tools"
-
diff --git a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework-examples.bb b/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework-examples.bb
deleted file mode 100644
index e95b7548b..000000000
--- a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework-examples.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "AGL Application Framework examples"
-DESCRIPTION = "The set of examples associated to the AGL Application Framework"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-app-framework-examples \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- afm-client \
- afb-client \
- "
diff --git a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework.bb b/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework.bb
deleted file mode 100644
index 0fdaabc91..000000000
--- a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-app-framework.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-SUMMARY = "AGL Application Framework core packages"
-DESCRIPTION = "The set of packages required by the AGL Application Framework"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-agl-app-framework \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- af-binder \
- af-binder-binding-afb-dbus-binding \
- af-binder-binding-authlogin \
- libafbwsc \
- af-main \
- ${@bb.utils.contains('DISTRO_FEATURES', 'webruntime', 'virtual/webruntime', '', d)} \
- "
diff --git a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-core-security.bbappend b/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-core-security.bbappend
deleted file mode 100644
index 0c9efe465..000000000
--- a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-core-security.bbappend
+++ /dev/null
@@ -1,9 +0,0 @@
-RDEPENDS_${PN} += "\
- xmlsec1 \
- cynara \
- dbus-cynara \
- security-manager \
- security-manager-policy \
- agl-users \
- "
-
diff --git a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-image-minimal.bbappend b/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-image-minimal.bbappend
deleted file mode 100644
index ad09e5ddf..000000000
--- a/meta-app-framework/recipes-core/packagegroups/packagegroup-agl-image-minimal.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-RDEPENDS_${PN} += "\
- packagegroup-agl-app-framework \
- "
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Adapt-rules-to-AGL.patch b/meta-app-framework/recipes-core/security-manager/security-manager/0001-Adapt-rules-to-AGL.patch
deleted file mode 100644
index 4c91f7fa3..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Adapt-rules-to-AGL.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 935e4e4e746b5ffcda80c80097dc75c2581c1a89 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
-Date: Wed, 19 Oct 2016 13:45:54 +0200
-Subject: [PATCH] Adapt rules to AGL
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-AGL distribution uses the repository https://github.com/01org/meta-intel-iot-security.git
-as basis for the integration of security framework. The security framework
-that it provides is an evolution of the security framework of tizen refited
-to the distribution Ostro of Intel. This refit took the decision to simplify
-the model by removing the running label "User". More can be viewed here:
-https://github.com/01org/meta-intel-iot-security/pull/116
-
-This commits adapt the template to the rules that are now needed
-after this evolution.
-
-It also integrates one other evolutions: the shared label becomes User::App-Shared instead
-of User::App::Shared to avoid collision with application of id "Shared".
-
-Change-Id: Ieb566b63f8c8e691b5f75e06499a3b576d042546
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- policy/app-rules-template.smack | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/policy/app-rules-template.smack b/policy/app-rules-template.smack
-index 1311169..b4cd2e3 100644
---- a/policy/app-rules-template.smack
-+++ b/policy/app-rules-template.smack
-@@ -1,12 +1,10 @@
--System ~APP~ rwx
-+System ~APP~ rwxa
-+System ~PKG~ rwxat
- ~APP~ System wx
- ~APP~ System::Shared rx
- ~APP~ System::Run rwxat
- ~APP~ System::Log rwxa
- ~APP~ _ l
--User ~APP~ rwxa
--User ~PKG~ rwxat
--~APP~ User wx
- ~APP~ User::Home rxl
--~APP~ User::App::Shared rwxat
-+~APP~ User::App-Shared rwxat
- ~APP~ ~PKG~ rwxat
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-Cmake-conf-for-gcc6-build.patch b/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-Cmake-conf-for-gcc6-build.patch
deleted file mode 100644
index 43a3ee103..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-Cmake-conf-for-gcc6-build.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 19c99315a5dcba3b696c30d1fdd42a1dcd574a80 Mon Sep 17 00:00:00 2001
-From: Ronan <ronan.lemartret@iot.bzh>
-Date: Thu, 13 Oct 2016 11:37:47 +0200
-Subject: [PATCH] Fix Cmake conf for gcc6 build
-
-Signed-off-by: Ronan <ronan.lemartret@iot.bzh>
----
- src/cmd/CMakeLists.txt | 4 +---
- src/server/CMakeLists.txt | 1 -
- 2 files changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt
-index ee9a160..aa7a12c 100644
---- a/src/cmd/CMakeLists.txt
-+++ b/src/cmd/CMakeLists.txt
-@@ -1,8 +1,6 @@
- FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options)
-
--INCLUDE_DIRECTORIES(SYSTEM
-- ${Boost_INCLUDE_DIRS}
-- )
-+
-
- INCLUDE_DIRECTORIES(
- ${INCLUDE_PATH}
-diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
-index 753eb96..8eef25d 100644
---- a/src/server/CMakeLists.txt
-+++ b/src/server/CMakeLists.txt
-@@ -8,7 +8,6 @@ FIND_PACKAGE(Threads REQUIRED)
-
- INCLUDE_DIRECTORIES(SYSTEM
- ${SERVER_DEP_INCLUDE_DIRS}
-- ${Boost_INCLUDE_DIRS}
- ${Threads_INCLUDE_DIRS}
- )
-
---
-2.6.6
-
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-gcc6-build.patch b/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-gcc6-build.patch
deleted file mode 100644
index 1b3c8c427..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager/0001-Fix-gcc6-build.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From cb9acc2b723b297ee373bf814282711f02657aa5 Mon Sep 17 00:00:00 2001
-From: Ronan <ronan.lemartret@iot.bzh>
-Date: Wed, 12 Oct 2016 17:48:55 +0200
-Subject: [PATCH] Fix gcc6 build
-
-Signed-off-by: ronan <ronan@ot.bzh>
----
- src/client/client-security-manager.cpp | 1 +
- src/common/include/privilege_db.h | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/src/client/client-security-manager.cpp b/src/client/client-security-manager.cpp
-index 74a6b30..347cddd 100644
---- a/src/client/client-security-manager.cpp
-+++ b/src/client/client-security-manager.cpp
-@@ -46,6 +46,7 @@
- #include <service_impl.h>
- #include <security-manager.h>
- #include <client-offline.h>
-+#include <linux/xattr.h>
-
- static const char *EMPTY = "";
-
-diff --git a/src/common/include/privilege_db.h b/src/common/include/privilege_db.h
-index 03c6680..8dd39a1 100644
---- a/src/common/include/privilege_db.h
-+++ b/src/common/include/privilege_db.h
-@@ -32,6 +32,7 @@
- #include <map>
- #include <stdbool.h>
- #include <string>
-+#include <vector>
-
- #include <dpl/db/sql_connection.h>
-
---
-2.6.6
-
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager/Removing-tizen-platform-config.patch b/meta-app-framework/recipes-core/security-manager/security-manager/Removing-tizen-platform-config.patch
deleted file mode 100644
index 1c9edcfc2..000000000
--- a/meta-app-framework/recipes-core/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?= <jose.bollo@iot.bzh>
-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=/var/db/security-manager/.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 <dpl/exception.h>
- #include <dpl/noncopyable.h>
--#include <tzplatform_config.h>
-
- 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 <string>
-
- #include <dpl/db/sql_connection.h>
--#include <tzplatform_config.h>
-
- #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 = "/var/db/security-manager/.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 <algorithm>
-
- #include <dpl/log/log.h>
--#include <tzplatform_config.h>
-
- #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("afm", &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 <memory>
-
- #include <dpl/log/log.h>
--#include <tzplatform_config.h>
-
- #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<std::string> &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<std::string> &pkgContents, const std::vector<std::string> &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-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.service b/meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.service
deleted file mode 100644
index 8ed5e8601..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.service
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Install security-manager DB to /var
-
-[Unit]
-Description=Install Security Manager database
-After=sysinit.target
-Before=security-manager.service
-
-[Install]
-WantedBy=default.target
-
-[Service]
-Type=oneshot
-User=root
-ExecStart=/usr/bin/init-security-manager-db.sh
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.sh b/meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.sh
deleted file mode 100644
index ef41286c8..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager/init-security-manager-db.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-if [ ! -e "/var/db/security-manager" ]; then
- mkdir -p /var/db
- cp -ra /usr/dbspace/ /var/db/security-manager
-fi
diff --git a/meta-app-framework/recipes-core/security-manager/security-manager_%.bbappend b/meta-app-framework/recipes-core/security-manager/security-manager_%.bbappend
deleted file mode 100644
index 23ceb2937..000000000
--- a/meta-app-framework/recipes-core/security-manager/security-manager_%.bbappend
+++ /dev/null
@@ -1,22 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/security-manager:"
-
-SRC_URI += " file://0001-Adapt-rules-to-AGL.patch \
- file://init-security-manager-db.service \
- file://init-security-manager-db.sh \
- file://0001-Fix-gcc6-build.patch \
- file://0001-Fix-Cmake-conf-for-gcc6-build.patch \
-"
-
-FILES_${PN}_append = "${bindir}/init-security-manager-db.sh \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/init-security-manager-db.service', '', d)} \
-"
-
-do_install_append () {
- install -p -D ${WORKDIR}/init-security-manager-db.sh ${D}${bindir}/init-security-manager-db.sh
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- mkdir -p ${D}${systemd_unitdir}/system
- mkdir -p ${D}${sysconfdir}/systemd/system/default.target.wants
- install -m 644 -p -D ${WORKDIR}/init-security-manager-db.service ${D}${systemd_unitdir}/system/init-security-manager-db.service
- ln -sf ${systemd_unitdir}/system/init-security-manager-db.service ${D}${sysconfdir}/systemd/system/default.target.wants
- fi
-}
diff --git a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime b/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime
deleted file mode 100755
index ca712e155..000000000
--- a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /usr/bin/qt5/qmlscene "$1" /usr/bin/web-runtime-webkit.qml
diff --git a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime-webkit.qml b/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime-webkit.qml
deleted file mode 100644
index d18b672cd..000000000
--- a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime-webkit.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.1
-import QtQuick.Controls 1.1
-import QtWebKit 3.0
-
-ApplicationWindow {
- width: 1024
- height: 768
- visible: true
- WebView {
- url: Qt.application.arguments[1]
- anchors.fill: parent
- }
-}
diff --git a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime.qml b/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime.qml
deleted file mode 100644
index afe8a77d0..000000000
--- a/meta-app-framework/recipes-core/web-runtime/web-runtime/web-runtime.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.1
-import QtQuick.Controls 1.1
-import QtWebEngine 1.1
-
-ApplicationWindow {
- width: 1024
- height: 768
- visible: true
- WebEngineView {
- url: Qt.application.arguments[1]
- anchors.fill: parent
- }
-}
diff --git a/meta-app-framework/recipes-core/web-runtime/web-runtime_0.1.bb b/meta-app-framework/recipes-core/web-runtime/web-runtime_0.1.bb
deleted file mode 100644
index c58daea30..000000000
--- a/meta-app-framework/recipes-core/web-runtime/web-runtime_0.1.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-inherit allarch
-
-SUMMARY = "Provides the 'web-runtime' command"
-DESCRIPTION = "The command 'web-runtime' is an abstraction that allows to "
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-SRC_URI = "\
- file://web-runtime;md5sum=6114c0bdd20290912a423fa01beb50f0 \
- file://web-runtime.qml;md5sum=5d6a379e9b7e5654319e5ba638824a58 \
- file://web-runtime-webkit.qml;md5sum=4daf9df39078634c27a7923d37e82e3d \
-"
-
-RDEPENDS_${PN} = "\
- qtdeclarative-tools \
- qtwebkit-qmlplugins \
- qtwayland-qmlplugins \
- qtquickcontrols-qmlplugins \
-"
-
-PROVIDES += "virtual/webruntime"
-# add also RPROVIDES to satisfy the packagegroup
-RPROVIDES_${PN} += "virtual/webruntime"
-
-do_configure() {
- :
-}
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${WORKDIR}/web-runtime ${D}${bindir}/web-runtime
- install -m 0644 ${WORKDIR}/web-runtime.qml ${D}${bindir}/web-runtime.qml
- install -m 0644 ${WORKDIR}/web-runtime-webkit.qml ${D}${bindir}/web-runtime-webkit.qml
-}
-
-do_install_append_rcar-gen2() {
- # workaround for porter board: force the use of libEGL provided by mesa at runtime
- # otherwise, the proprietary libEGL is used and a problem then occurs due to a missing EGL function
- sed -i 's|^\(exec /usr/bin/qt5/qmlscene\)|LD_PRELOAD=/usr/lib/libEGL.so \1|g' ${D}${bindir}/web-runtime
-}
-
-
diff --git a/meta-app-framework/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend b/meta-app-framework/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend
deleted file mode 100644
index 590ab708a..000000000
--- a/meta-app-framework/recipes-devtools/run-agl-postinsts/run-agl-postinsts_1.0.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-SYSTEMD_SERVICE_AFTER_append = " afm-system-daemon.service"
diff --git a/meta-app-framework/recipes-example/afb-client/afb-client_1.0.bb b/meta-app-framework/recipes-example/afb-client/afb-client_1.0.bb
deleted file mode 100644
index 21605d20b..000000000
--- a/meta-app-framework/recipes-example/afb-client/afb-client_1.0.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "HTML5 demo template for AFB"
-DESCRIPTION = "afb-client is a sample AngularJS/HTML5 application using \
-Application Framework Binder with token binding."
-HOMEPAGE = "http://www.iot.bzh"
-
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6cb04bdb88e11107e3af4d8e3f301be5"
-
-#DEPENDS = "nodejs-native"
-RDEPENDS_${PN} = "af-binder af-binder-binding-authlogin"
-
-SRC_URI_git = "git://gerrit.automotivelinux.org/gerrit/src/app-framework-demo;protocol=https;branch=master"
-SRC_URI_files = "file://afb-client \
- "
-SRC_URI = "${SRC_URI_git} \
- ${SRC_URI_files} \
- "
-SRCREV = "9e9b459fa27d7a359a060024c9639b99b45813d5"
-S = "${WORKDIR}/git/afb-client"
-
-do_install () {
- mkdir -p ${D}/${datadir}/agl/afb-client
- cp -ra ${S}/dist.prod/* ${D}/${datadir}/agl/afb-client/
-
- mkdir -p ${D}/${bindir}
- install -m 0755 ${WORKDIR}/afb-client ${D}/${bindir}/afb-client
-}
-
-FILES_${PN} += "${datadir}"
diff --git a/meta-app-framework/recipes-example/afb-client/files/afb-client b/meta-app-framework/recipes-example/afb-client/files/afb-client
deleted file mode 100644
index 99e6aa968..000000000
--- a/meta-app-framework/recipes-example/afb-client/files/afb-client
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if [ -z "${XDG_RUNTIME_DIR+1}" ]; then
- export XDG_RUNTIME_DIR=/run/user/$UID
-fi
-LD_PRELOAD=/usr/lib/libEGL.so /usr/bin/qt5/qmlscene http://localhost:1234/opa /usr/share/agl/afb-viewer.qml
-
diff --git a/meta-app-framework/recipes-example/afm-client/afm-client_1.0.bb b/meta-app-framework/recipes-example/afm-client/afm-client_1.0.bb
deleted file mode 100644
index 4cd80db64..000000000
--- a/meta-app-framework/recipes-example/afm-client/afm-client_1.0.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-SUMMARY = "Sample client for AFM to install/start/stop/remove applications"
-DESCRIPTION = "afm-client is a sample AngularJS/HTML5 application using \
-Application Framework Manager to install, start, stop, or remove \
-applications provided as .wgt widget packages."
-HOMEPAGE = "http://www.iot.bzh"
-
-inherit systemd
-
-LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=6cb04bdb88e11107e3af4d8e3f301be5"
-
-#DEPENDS = "nodejs-native"
-RDEPENDS_${PN} = "af-main af-binder af-main-binding af-binder-binding-demopost af-binder-binding-authlogin"
-
-SRC_URI_git = "git://gerrit.automotivelinux.org/gerrit/src/app-framework-demo;protocol=https;branch=master"
-SRC_URI_files = "file://afm-client \
- file://afm-client.service \
- "
-SRC_URI = "${SRC_URI_git} \
- ${SRC_URI_files} \
- "
-SRCREV = "9e9b459fa27d7a359a060024c9639b99b45813d5"
-S = "${WORKDIR}/git/afm-client"
-
-do_install () {
- mkdir -p ${D}/${datadir}/agl/afm-client
- cp -ra ${S}/dist.prod/* ${D}/${datadir}/agl/afm-client/
-
- mkdir -p ${D}/${bindir}
- install -m 0755 ${WORKDIR}/afm-client ${D}/${bindir}/afm-client
-
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- install -d ${D}${systemd_user_unitdir}
- install -d ${D}${sysconfdir}/systemd/user/default.target.wants
- install -m 0644 ${WORKDIR}/afm-client.service ${D}/${systemd_user_unitdir}/afm-client.service
- ln -sf ${systemd_user_unitdir}/afm-client.service ${D}${sysconfdir}/systemd/user/default.target.wants
- fi
-}
-
-FILES_${PN} += "${datadir} ${systemd_user_unitdir}"
diff --git a/meta-app-framework/recipes-example/afm-client/files/afm-client b/meta-app-framework/recipes-example/afm-client/files/afm-client
deleted file mode 100644
index ba868e93d..000000000
--- a/meta-app-framework/recipes-example/afm-client/files/afm-client
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if [ -z "${XDG_RUNTIME_DIR+1}" ]; then
- export XDG_RUNTIME_DIR=/run/user/$UID
-fi
-LD_PRELOAD=/usr/lib/libEGL.so /usr/bin/web-runtime http://localhost:1236/opa
-
diff --git a/meta-app-framework/recipes-example/afm-client/files/afm-client.service b/meta-app-framework/recipes-example/afm-client/files/afm-client.service
deleted file mode 100644
index 735717439..000000000
--- a/meta-app-framework/recipes-example/afm-client/files/afm-client.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Simplest application manager
-
-[Service]
-ExecStart=/usr/bin/afb-daemon --mode=remote --port=1234 --token='' --sessiondir=/home/root/.afb-daemon --rootdir=/usr/share/agl/afm-client --alias=/icons:/var/lib/afm/icons
-Restart=on-failure
-RestartSec=5
-
-[Install]
-WantedBy=default.target
-
diff --git a/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home-native.patch b/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home-native.patch
deleted file mode 100644
index ff420d8a2..000000000
--- a/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home-native.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 008637fc8bd7f601eb6554d572bba025613913b7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
-Date: Wed, 8 Mar 2017 14:10:10 +0100
-Subject: [PATCH] useradd: copy extended attributes of home (native)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The Home directory wasn't getting the extended attributes
-of /etc/skel. This patch fixes that issue and adds the copy
-of the extended attributes of the root of the home directory.
-
-Change-Id: Ib6836e1b18c4c7f73e02c1f1fc9558dc749ba9da
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- src/useradd.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/useradd.c b/src/useradd.c
-index 4c418af..8ba8af6 100644
---- a/src/useradd.c
-+++ b/src/useradd.c
-@@ -55,6 +55,9 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <time.h>
-+#ifdef WITH_ATTR
-+#include <attr/libattr.h>
-+#endif
- #include "chkname.h"
- #include "defines.h"
- #include "faillog.h"
-@@ -1950,6 +1953,9 @@ static void create_home (void)
- chown (user_home, user_id, user_gid);
- chmod (user_home,
- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
-+#ifdef WITH_ATTR
-+ attr_copy_file (def_template, user_home, NULL, NULL);
-+#endif
- home_added = true;
- #ifdef WITH_AUDIT
- audit_logger (AUDIT_ADD_USER, Prog,
---
-2.9.3
-
diff --git a/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch b/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
deleted file mode 100644
index f231c3cfe..000000000
--- a/meta-app-framework/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From acec93540eba6899661c607408498ac72ab07a47 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
-Date: Tue, 7 Mar 2017 16:03:03 +0100
-Subject: [PATCH] useradd: copy extended attributes of home
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The Home directory wasn't getting the extended attributes
-of /etc/skel. This patch fixes that issue and adds the copy
-of the extended attributes of the root of the home directory.
-
-Change-Id: Icd633f7c6c494efd2a30cb8f04c306f749ad0c3b
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- src/useradd.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/useradd.c b/src/useradd.c
-index a8a1f76..8aefb9c 100644
---- a/src/useradd.c
-+++ b/src/useradd.c
-@@ -52,6 +52,9 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <time.h>
-+#ifdef WITH_ATTR
-+#include <attr/libattr.h>
-+#endif
- #include "chkname.h"
- #include "defines.h"
- #include "faillog.h"
-@@ -1915,6 +1918,9 @@ static void create_home (void)
- chown (user_home, user_id, user_gid);
- chmod (user_home,
- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
-+#ifdef WITH_ATTR
-+ attr_copy_file (def_template, user_home, NULL, NULL);
-+#endif
- home_added = true;
- #ifdef WITH_AUDIT
- audit_logger (AUDIT_ADD_USER, Prog,
---
-2.9.3
-
diff --git a/meta-app-framework/recipes-extended/shadow/shadow_%.bbappend b/meta-app-framework/recipes-extended/shadow/shadow_%.bbappend
deleted file mode 100644
index f08435502..000000000
--- a/meta-app-framework/recipes-extended/shadow/shadow_%.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI_append_class-target = " file://0001-useradd-copy-extended-attributes-of-home.patch "
-SRC_URI_append_class-native = " file://0001-useradd-copy-extended-attributes-of-home-native.patch "
diff --git a/meta-app-framework/recipes-kernel/linux/linux-%.bbappend b/meta-app-framework/recipes-kernel/linux/linux-%.bbappend
deleted file mode 100644
index 02595efdf..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux-%.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux:"
-SRC_URI_append_smack = " file://audit.cfg"
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux-yocto_4.1.bbappend b/meta-app-framework/recipes-kernel/linux/linux-yocto_4.1.bbappend
deleted file mode 100644
index c1c657201..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux-yocto_4.1.bbappend
+++ /dev/null
@@ -1,12 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux/linux-yocto-4.1:"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0001-Smack-File-receive-for-sockets.patch \
- file://0002-smack-fix-cache-of-access-labels.patch \
- file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux-yocto_4.4.bbappend b/meta-app-framework/recipes-kernel/linux/linux-yocto_4.4.bbappend
deleted file mode 100644
index 51df08719..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux-yocto_4.4.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux/linux-yocto-4.4:"
-
-#-------------------------------------------------------------------------
-# smack patches for handling bluetooth
-
-SRC_URI_append_smack = "\
- file://0002-smack-fix-cache-of-access-labels.patch \
- file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \
- file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \
-"
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/audit.cfg b/meta-app-framework/recipes-kernel/linux/linux/audit.cfg
deleted file mode 100644
index 214dbe33f..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/audit.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_AUDIT=y
-CONFIG_AUDITSYSCALL=y
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0001-Smack-File-receive-for-sockets.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0001-Smack-File-receive-for-sockets.patch
deleted file mode 100644
index b0c5ee8f4..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0001-Smack-File-receive-for-sockets.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 2e65b888820ea372984d412cee3bd7dcba05d7d2 Mon Sep 17 00:00:00 2001
-From: Casey Schaufler <casey@schaufler-ca.com>
-Date: Mon, 7 Dec 2015 14:34:32 -0800
-Subject: [PATCH 1/4] Smack: File receive for sockets
-
-The existing file receive hook checks for access on
-the file inode even for UDS. This is not right, as
-the inode is not used by Smack to make access checks
-for sockets. This change checks for an appropriate
-access relationship between the receiving (current)
-process and the socket. If the process can't write
-to the socket's send label or the socket's receive
-label can't write to the process fail.
-
-This will allow the legitimate cases, where the
-socket sender and socket receiver can freely communicate.
-Only strangly set socket labels should cause a problem.
-
-Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b644757..487b2f3 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1672,9 +1672,31 @@ static int smack_file_receive(struct file *file)
- int may = 0;
- struct smk_audit_info ad;
- struct inode *inode = file_inode(file);
-+ struct socket *sock;
-+ struct task_smack *tsp;
-+ struct socket_smack *ssp;
-
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
- smk_ad_setfield_u_fs_path(&ad, file->f_path);
-+
-+ if (S_ISSOCK(inode->i_mode)) {
-+ sock = SOCKET_I(inode);
-+ ssp = sock->sk->sk_security;
-+ tsp = current_security();
-+ /*
-+ * If the receiving process can't write to the
-+ * passed socket or if the passed socket can't
-+ * write to the receiving process don't accept
-+ * the passed socket.
-+ */
-+ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ if (rc < 0)
-+ return rc;
-+ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ return rc;
-+ }
- /*
- * This code relies on bitmasks.
- */
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0002-smack-fix-cache-of-access-labels.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0002-smack-fix-cache-of-access-labels.patch
deleted file mode 100644
index 51c3b31ec..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0002-smack-fix-cache-of-access-labels.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 5bcea0fc4e5360deca133e211fdc76717a1693a4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jobol@nonadev.net>
-Date: Tue, 12 Jan 2016 21:23:40 +0100
-Subject: [PATCH 2/4] smack: fix cache of access labels
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before this commit, removing the access property of
-a file, aka, the extended attribute security.SMACK64
-was not effictive until the cache had been cleaned.
-
-This patch fixes that problem.
-
-Signed-off-by: José Bollo <jobol@nonadev.net>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index 487b2f3..b9393e3 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1256,9 +1256,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name)
- * Don't do anything special for these.
- * XATTR_NAME_SMACKIPIN
- * XATTR_NAME_SMACKIPOUT
-- * XATTR_NAME_SMACKEXEC
- */
-- if (strcmp(name, XATTR_NAME_SMACK) == 0)
-+ if (strcmp(name, XATTR_NAME_SMACK) == 0) {
-+ struct super_block *sbp = d_backing_inode(dentry)->i_sb;
-+ struct superblock_smack *sbsp = sbp->s_security;
-+
-+ isp->smk_inode = sbsp->smk_default;
-+ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0)
- isp->smk_task = NULL;
- else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0)
- isp->smk_mmap = NULL;
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
deleted file mode 100644
index 67761ae46..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From aa63c4f8ece0c54a9be735ac38667f11fcd6f44a Mon Sep 17 00:00:00 2001
-From: Rafal Krypa <r.krypa@samsung.com>
-Date: Mon, 4 Apr 2016 11:14:53 +0200
-Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill
-
-Kill with signal number 0 is commonly used for checking PID existence.
-Smack treated such cases like any other kills, although no signal is
-actually delivered when sig == 0.
-
-Checking permissions when sig == 0 didn't prevent an unprivileged caller
-from learning whether PID exists or not. When it existed, kernel returned
-EPERM, when it didn't - ESRCH. The only effect of policy check in such
-case is noise in audit logs.
-
-This change lets Smack silently ignore kill() invocations with sig == 0.
-
-Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b9393e3..c916f58 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2056,6 +2056,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
- struct smack_known *tkp = smk_of_task_struct(p);
- int rc;
-
-+ if (!sig)
-+ return 0; /* null signal; existence test */
-+
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
- smk_ad_setfield_u_tsk(&ad, p);
- /*
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index 4281c201c..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.1/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From b2b9e7ec8e79ede841104f76464f4b77c057b011 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index c916f58..cc6769b 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2138,8 +2138,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0001-Smack-File-receive-for-sockets.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0001-Smack-File-receive-for-sockets.patch
deleted file mode 100644
index 4021e5d38..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0001-Smack-File-receive-for-sockets.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 2b206c36b16e72cfe41cd22448d8527359ffd962 Mon Sep 17 00:00:00 2001
-From: Casey Schaufler <casey@schaufler-ca.com>
-Date: Mon, 7 Dec 2015 14:34:32 -0800
-Subject: [PATCH 1/4] Smack: File receive for sockets
-
-The existing file receive hook checks for access on
-the file inode even for UDS. This is not right, as
-the inode is not used by Smack to make access checks
-for sockets. This change checks for an appropriate
-access relationship between the receiving (current)
-process and the socket. If the process can't write
-to the socket's send label or the socket's receive
-label can't write to the process fail.
-
-This will allow the legitimate cases, where the
-socket sender and socket receiver can freely communicate.
-Only strangly set socket labels should cause a problem.
-
-Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index ff81026..b20ef06 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file)
- int may = 0;
- struct smk_audit_info ad;
- struct inode *inode = file_inode(file);
-+ struct socket *sock;
-+ struct task_smack *tsp;
-+ struct socket_smack *ssp;
-
- if (unlikely(IS_PRIVATE(inode)))
- return 0;
-
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
- smk_ad_setfield_u_fs_path(&ad, file->f_path);
-+
-+ if (S_ISSOCK(inode->i_mode)) {
-+ sock = SOCKET_I(inode);
-+ ssp = sock->sk->sk_security;
-+ tsp = current_security();
-+ /*
-+ * If the receiving process can't write to the
-+ * passed socket or if the passed socket can't
-+ * write to the receiving process don't accept
-+ * the passed socket.
-+ */
-+ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ if (rc < 0)
-+ return rc;
-+ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad);
-+ rc = smk_bu_file(file, may, rc);
-+ return rc;
-+ }
- /*
- * This code relies on bitmasks.
- */
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0002-smack-fix-cache-of-access-labels.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0002-smack-fix-cache-of-access-labels.patch
deleted file mode 100644
index c516f3aa5..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0002-smack-fix-cache-of-access-labels.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 99267706991ab84bd44ceaea9a7ec886bbdd58e0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jobol@nonadev.net>
-Date: Tue, 12 Jan 2016 21:23:40 +0100
-Subject: [PATCH 2/4] smack: fix cache of access labels
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Before this commit, removing the access property of
-a file, aka, the extended attribute security.SMACK64
-was not effictive until the cache had been cleaned.
-
-This patch fixes that problem.
-
-Signed-off-by: José Bollo <jobol@nonadev.net>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b20ef06..b2bcb14 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -1444,9 +1444,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name)
- * Don't do anything special for these.
- * XATTR_NAME_SMACKIPIN
- * XATTR_NAME_SMACKIPOUT
-- * XATTR_NAME_SMACKEXEC
- */
-- if (strcmp(name, XATTR_NAME_SMACK) == 0)
-+ if (strcmp(name, XATTR_NAME_SMACK) == 0) {
-+ struct super_block *sbp = d_backing_inode(dentry)->i_sb;
-+ struct superblock_smack *sbsp = sbp->s_security;
-+
-+ isp->smk_inode = sbsp->smk_default;
-+ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0)
- isp->smk_task = NULL;
- else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0)
- isp->smk_mmap = NULL;
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
deleted file mode 100644
index c9180bb9f..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0003-Smack-ignore-null-signal-in-smack_task_kill.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From ec4eb03af07b0fbc330aecca6ac4ebd6accd8825 Mon Sep 17 00:00:00 2001
-From: Rafal Krypa <r.krypa@samsung.com>
-Date: Mon, 4 Apr 2016 11:14:53 +0200
-Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill
-
-Kill with signal number 0 is commonly used for checking PID existence.
-Smack treated such cases like any other kills, although no signal is
-actually delivered when sig == 0.
-
-Checking permissions when sig == 0 didn't prevent an unprivileged caller
-from learning whether PID exists or not. When it existed, kernel returned
-EPERM, when it didn't - ESRCH. The only effect of policy check in such
-case is noise in audit logs.
-
-This change lets Smack silently ignore kill() invocations with sig == 0.
-
-Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
-Acked-by: Casey Schaufler <casey@schaufler-ca.com>
----
- security/smack/smack_lsm.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index b2bcb14..cf8a93f 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2239,6 +2239,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info,
- struct smack_known *tkp = smk_of_task_struct(p);
- int rc;
-
-+ if (!sig)
-+ return 0; /* null signal; existence test */
-+
- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK);
- smk_ad_setfield_u_tsk(&ad, p);
- /*
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
deleted file mode 100644
index a1eeac3d7..000000000
--- a/meta-app-framework/recipes-kernel/linux/linux/linux-yocto-4.4/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001
-From: jooseong lee <jooseong.lee@samsung.com>
-Date: Thu, 3 Nov 2016 10:55:43 +0100
-Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook
-
-Creating struct sock by sk_alloc function in various kernel subsystems
-like bluetooth dosen't call smack_socket_post_create(). In such case,
-received sock label is the floor('_') label and makes access deny.
-
-Refers-to: https://review.tizen.org/gerrit/#/c/80717/4
-
-Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8
-Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
-Signed-off-by: José Bollo <jose.bollo@iot.bzh>
----
- security/smack/smack_lsm.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
-index cf8a93f..21651bc 100644
---- a/security/smack/smack_lsm.c
-+++ b/security/smack/smack_lsm.c
-@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
- if (ssp == NULL)
- return -ENOMEM;
-
-- ssp->smk_in = skp;
-- ssp->smk_out = skp;
-+ /*
-+ * Sockets created by kernel threads receive web label.
-+ */
-+ if (unlikely(current->flags & PF_KTHREAD)) {
-+ ssp->smk_in = &smack_known_web;
-+ ssp->smk_out = &smack_known_web;
-+ } else {
-+ ssp->smk_in = skp;
-+ ssp->smk_out = skp;
-+ }
- ssp->smk_packet = NULL;
-
- sk->sk_security = ssp;
---
-2.7.4
-
diff --git a/meta-app-framework/recipes-support/libcap/libcap/removing-capability-enforcement.patch b/meta-app-framework/recipes-support/libcap/libcap/removing-capability-enforcement.patch
deleted file mode 100644
index fa359fa87..000000000
--- a/meta-app-framework/recipes-support/libcap/libcap/removing-capability-enforcement.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From c34b2725817d4fd1fd6878bbb16617cb9e3e3a70 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
-Date: Fri, 22 Jan 2016 16:23:59 +0100
-Subject: [PATCH] removing capability enforcement
-
-Signed-off-by: ronan <ronan@iot.bzh>
-
-Change-Id: Idb724192ceab176a611bbed45c0ebc9c8eb5dd30
----
- progs/setcap.c | 45 +--------------------------------------------
- 1 file changed, 1 insertion(+), 44 deletions(-)
-
-diff --git a/progs/setcap.c b/progs/setcap.c
-index 7304343..71999b6 100644
---- a/progs/setcap.c
-+++ b/progs/setcap.c
-@@ -58,11 +58,9 @@ static int read_caps(int quiet, const char *filename, char *buffer)
-
- int main(int argc, char **argv)
- {
-- int tried_to_cap_setfcap = 0;
- char buffer[MAXCAP+1];
- int retval, quiet=0, verify=0;
- cap_t mycaps;
-- cap_value_t capflag;
-
- if (argc < 3) {
- usage();
-@@ -150,54 +148,13 @@ int main(int argc, char **argv)
- printf("%s: OK\n", *argv);
- }
- } else {
-- if (!tried_to_cap_setfcap) {
-- capflag = CAP_SETFCAP;
--
-- /*
-- * Raise the effective CAP_SETFCAP.
-- */
-- if (cap_set_flag(mycaps, CAP_EFFECTIVE, 1, &capflag, CAP_SET)
-- != 0) {
-- perror("unable to manipulate CAP_SETFCAP - "
-- "try a newer libcap?");
-- exit(1);
-- }
-- if (cap_set_proc(mycaps) != 0) {
-- perror("unable to set CAP_SETFCAP effective capability");
-- exit(1);
-- }
-- tried_to_cap_setfcap = 1;
-- }
- retval = cap_set_file(*++argv, cap_d);
- if (retval != 0) {
-- int explained = 0;
- int oerrno = errno;
--#ifdef linux
-- cap_value_t cap;
-- cap_flag_value_t per_state;
--
-- for (cap = 0;
-- cap_get_flag(cap_d, cap, CAP_PERMITTED, &per_state) != -1;
-- cap++) {
-- cap_flag_value_t inh_state, eff_state;
--
-- cap_get_flag(cap_d, cap, CAP_INHERITABLE, &inh_state);
-- cap_get_flag(cap_d, cap, CAP_EFFECTIVE, &eff_state);
-- if ((inh_state | per_state) != eff_state) {
-- fprintf(stderr, "NOTE: Under Linux, effective file capabilities must either be empty, or\n"
-- " exactly match the union of selected permitted and inheritable bits.\n");
-- explained = 1;
-- break;
-- }
-- }
--#endif /* def linux */
--
- fprintf(stderr,
- "Failed to set capabilities on file `%s' (%s)\n",
- argv[0], strerror(oerrno));
-- if (!explained) {
-- usage();
-- }
-+
- }
- }
- if (cap_d) {
---
-2.6.6
-
diff --git a/meta-app-framework/recipes-support/libcap/libcap_%.bbappend b/meta-app-framework/recipes-support/libcap/libcap_%.bbappend
deleted file mode 100644
index fbe893501..000000000
--- a/meta-app-framework/recipes-support/libcap/libcap_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-FILESEXTRAPATHS_append_class-native := ":${THISDIR}/${PN}"
-SRC_URI_append_class-native = " file://removing-capability-enforcement.patch"
-PACKAGECONFIG_class-native ?= "attr"
-DEPENDS_append_class-native = " attr-native"
-
diff --git a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.55.bb b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.55.bb
deleted file mode 100644
index bb650ce23..000000000
--- a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.55.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-DESCRIPTION = "A small C library that is supposed to make it easy to run an HTTP server as part of another application"
-HOMEPAGE = "http://www.gnu.org/software/libmicrohttpd/"
-LICENSE = "LGPL-2.1+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=9331186f4f80db7da0e724bdd6554ee5"
-SECTION = "net"
-DEPENDS = "libgcrypt gnutls file"
-
-SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "1c20f84a8b9cf692dd50b558b3571a3a"
-SRC_URI[sha256sum] = "0c1cab8dc9f2588bd3076a28f77a7f8de9560cbf2d80e53f9a8696ada80ed0f8"
-
-inherit autotools lib_package pkgconfig gettext
-
-EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
-
-PACKAGECONFIG ?= "curl"
-PACKAGECONFIG_append_class-target = "\
- ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
-"
-PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
-PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
-
-do_compile_append() {
- sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc
-}
diff --git a/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb b/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb
deleted file mode 100644
index 450971176..000000000
--- a/meta-app-framework/recipes-support/libzip/libzip_1.1.1.bb
+++ /dev/null
@@ -1,32 +0,0 @@
-inherit autotools
-
-SUMMARY = "Library providing support for handling zip files"
-DESCRIPTION = "\
- This library is wrapping zlib and allows \
- to easily create, browse, inflate of deflate \
- the zip files. \
- It also provides tools for zip comparing, merging or browsing.\
-"
-
-HOMEPAGE = "http://nih.at/libzip/index.html"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=23ebf7ca347ed9703b4ef40824d0ef66"
-
-SRC_URI = "http://nih.at/libzip/libzip-1.1.1.tar.xz;md5sum=0c86a1a94fbc3ec6724801036726ae1f"
-
-#SRC_URI = "hg://hg.nih.at/libzip;module=libzip;protocol=http"
-#SRCREV = "5895e34af7f9"
-#S = "${HGDIR}"
-
-SECTION = "base"
-
-DEPENDS = "zlib"
-
-RDEPENDS_${PN} = "zlib"
-
-PROVIDES += "${PN}-tools"
-RDEPENDS_${PN}-tools = "${PN}"
-FILES_${PN}-tools = "${bindir}/zipcmp ${bindir}/zipmerge ${bindir}/ziptool"
-
-BBCLASSEXTEND = "native nativesdk"
-
diff --git a/meta-app-framework/recipes-support/xmlsec1/xmlsec1/Only-require-libxslt-in-.pc-files-when-necessary.patch b/meta-app-framework/recipes-support/xmlsec1/xmlsec1/Only-require-libxslt-in-.pc-files-when-necessary.patch
deleted file mode 100644
index c92df77f0..000000000
--- a/meta-app-framework/recipes-support/xmlsec1/xmlsec1/Only-require-libxslt-in-.pc-files-when-necessary.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 1e39acf581ef47876b058da41774cbc92560d797 Mon Sep 17 00:00:00 2001
-From: Manuel Bachmann <manuel.bachmann@iot.bzh>
-Date: Wed, 27 Jan 2016 14:16:40 +0100
-Subject: [PATCH] Only require libxslt in .pc files when necessary
-
-If we build xmlsec without libxslt ("--without-libxslt" at
-configure time), dependent packages will still require it
-because it is unconditionally mentioned in .pc files (used
-by pkg-config).
-
-We now make sure that this dependency is mentioned only if
-the configure script validates libxslt presence.
-
-Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
----
- configure.in | 4 ++++
- xmlsec-gcrypt.pc.in | 2 +-
- xmlsec-gnutls.pc.in | 2 +-
- xmlsec-nss.pc.in | 2 +-
- xmlsec-openssl.pc.in | 2 +-
- xmlsec.pc.in | 2 +-
- 6 files changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index 7d976d0..a8350a9 100644
---- a/configure.in
-+++ b/configure.in
-@@ -255,6 +255,7 @@ dnl ==========================================================================
- dnl find libxslt
- dnl ==========================================================================
- XMLSEC_NO_LIBXSLT="1"
-+LIBXSLT_COND="libxslt >="
- LIBXSLT_MIN_VERSION=1.0.20
- LIBXSLT_CONFIG="xslt-config"
- LIBXSLT_CFLAGS=""
-@@ -324,6 +325,8 @@ fi
- if test "z$LIBXSLT_FOUND" = "zyes" ; then
- XMLSEC_NO_LIBXSLT="0"
- else
-+ LIBXSLT_COND=""
-+ LIBXSLT_MIN_VERSION=""
- XMLSEC_DEFINES="$XMLSEC_DEFINES -DXMLSEC_NO_XSLT=1"
- fi
-
-@@ -332,6 +335,7 @@ AC_SUBST(LIBXSLT_CFLAGS)
- AC_SUBST(LIBXSLT_LIBS)
- AC_SUBST(LIBXSLT_CONFIG)
- AC_SUBST(LIBXSLT_MIN_VERSION)
-+AC_SUBST(LIBXSLT_COND)
-
- dnl ==========================================================================
- dnl See if we can find a crypto library
-diff --git a/xmlsec-gcrypt.pc.in b/xmlsec-gcrypt.pc.in
-index 1c00496..33bc2ff 100644
---- a/xmlsec-gcrypt.pc.in
-+++ b/xmlsec-gcrypt.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: xmlsec1-gcrypt
- Version: @VERSION@
- Description: XML Security Library implements XML Signature and XML Encryption standards
--Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ libxslt >= @LIBXSLT_MIN_VERSION@
-+Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_COND@ @LIBXSLT_MIN_VERSION@
- Cflags: -DXMLSEC_CRYPTO=\"gcrypt\" @XMLSEC_GCRYPT_CFLAGS@
- Libs: @XMLSEC_GCRYPT_LIBS@
-diff --git a/xmlsec-gnutls.pc.in b/xmlsec-gnutls.pc.in
-index e538cd4..d01cf82 100644
---- a/xmlsec-gnutls.pc.in
-+++ b/xmlsec-gnutls.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: xmlsec1-gnutls
- Version: @VERSION@
- Description: XML Security Library implements XML Signature and XML Encryption standards
--Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ libxslt >= @LIBXSLT_MIN_VERSION@
-+Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_COND@ @LIBXSLT_MIN_VERSION@
- Cflags: -DXMLSEC_CRYPTO=\"gnutls\" @XMLSEC_GNUTLS_CFLAGS@
- Libs: @XMLSEC_GNUTLS_LIBS@
-diff --git a/xmlsec-nss.pc.in b/xmlsec-nss.pc.in
-index a6d6c5c..75f0232 100644
---- a/xmlsec-nss.pc.in
-+++ b/xmlsec-nss.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: xmlsec1-nss
- Version: @VERSION@
- Description: XML Security Library implements XML Signature and XML Encryption standards
--Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ libxslt >= @LIBXSLT_MIN_VERSION@ @NSPR_PACKAGE@ >= @MOZILLA_MIN_VERSION@ @NSS_PACKAGE@ >= @MOZILLA_MIN_VERSION@
-+Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_COND@ @LIBXSLT_MIN_VERSION@ @NSPR_PACKAGE@ >= @MOZILLA_MIN_VERSION@ @NSS_PACKAGE@ >= @MOZILLA_MIN_VERSION@
- Cflags: -DXMLSEC_CRYPTO=\"nss\" -DXMLSEC_CRYPTO_NSS=1 @XMLSEC_CORE_CFLAGS@
- Libs: -L${libdir} -lxmlsec1-nss @XMLSEC_CORE_LIBS@
-diff --git a/xmlsec-openssl.pc.in b/xmlsec-openssl.pc.in
-index 85ee2b0..e9d0651 100644
---- a/xmlsec-openssl.pc.in
-+++ b/xmlsec-openssl.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: xmlsec1-openssl
- Version: @VERSION@
- Description: XML Security Library implements XML Signature and XML Encryption standards
--Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ libxslt >= @LIBXSLT_MIN_VERSION@
-+Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_COND@ @LIBXSLT_MIN_VERSION@
- Cflags: -DXMLSEC_CRYPTO=\"openssl\" @XMLSEC_OPENSSL_CFLAGS@
- Libs: @XMLSEC_OPENSSL_LIBS@
-diff --git a/xmlsec.pc.in b/xmlsec.pc.in
-index a750ab8..14ea670 100644
---- a/xmlsec.pc.in
-+++ b/xmlsec.pc.in
-@@ -6,6 +6,6 @@ includedir=@includedir@
- Name: xmlsec1
- Version: @VERSION@
- Description: XML Security Library implements XML Signature and XML Encryption standards
--Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ libxslt >= @LIBXSLT_MIN_VERSION@
-+Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_COND@ @LIBXSLT_MIN_VERSION@
- Cflags: -DXMLSEC_CRYPTO=\"@XMLSEC_CRYPTO@\" -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 @XMLSEC_CORE_CFLAGS@
- Libs: -L${libdir} @XMLSEC_CORE_LIBS@
---
-2.6.2
-
diff --git a/meta-app-framework/recipes-support/xmlsec1/xmlsec1_1.%.bbappend b/meta-app-framework/recipes-support/xmlsec1/xmlsec1_1.%.bbappend
deleted file mode 100644
index 8f1972f07..000000000
--- a/meta-app-framework/recipes-support/xmlsec1/xmlsec1_1.%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-SRC_URI += "file://Only-require-libxslt-in-.pc-files-when-necessary.patch"
-
-DEPENDS += "libxml2"
-
-BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-app-framework/scripts/run-yocto-check-layer.sh b/meta-app-framework/scripts/run-yocto-check-layer.sh
new file mode 100755
index 000000000..cbe35ed8d
--- /dev/null
+++ b/meta-app-framework/scripts/run-yocto-check-layer.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we cannot import the distro config right away
+# as the initial values are poky only till the layer
+# is added in
+
+AGL_DEFAULT_DISTRO_FEATURES := "usrmerge largefile opengl wayland pam bluetooth bluez5 3g polkit"
+DISTRO_FEATURES:append := " systemd wayland pam \${AGL_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+EOF
+
+yocto-check-layer --no-auto-dependency \
+ --dependency \
+ $AGLROOT/meta-agl/meta-agl-core \
+ $AGLROOT/external/meta-openembedded/meta-oe \
+ -- \
+ $AGLROOT/meta-agl/meta-app-framework
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl
+
+exit 0
diff --git a/meta-ivi-common/classes/.gitkeep b/meta-ivi-common/classes/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/classes/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/conf/layer.conf b/meta-ivi-common/conf/layer.conf
deleted file mode 100644
index e19cacc4f..000000000
--- a/meta-ivi-common/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH =. "${LAYERDIR}:"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "ivi-common"
-BBFILE_PATTERN_ivi-common = "^${LAYERDIR}/"
-BBFILE_PRIORITY_ivi-common = "7"
diff --git a/meta-ivi-common/recipes-connectivity/.gitkeep b/meta-ivi-common/recipes-connectivity/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/recipes-connectivity/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-automotive.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-automotive.bb
deleted file mode 100644
index e63333157..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-automotive.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Automotive Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-automotive \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += " "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-connectivity.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-connectivity.bb
deleted file mode 100644
index 2453c3cb0..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-connectivity.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Connectivity Subsystem "
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-connectivity \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-graphics.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-graphics.bb
deleted file mode 100644
index c474b9fc5..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-graphics.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Graphics Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-graphics \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- weston weston-init weston-ini-conf weston-examples \
- wayland-ivi-extension \
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-kernel.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-kernel.bb
deleted file mode 100644
index 14e5f4347..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-kernel.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Kernel Subysystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-kernel \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb
deleted file mode 100644
index b43215b99..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-multimedia.bb
+++ /dev/null
@@ -1,29 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Multimedia Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-multimedia \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- agl-audio-plugin \
- alsa-lib \
- alsa-utils \
- pulseaudio-server \
- pulseaudio-misc \
- ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '\
- pulseaudio-module-bluetooth-discover \
- pulseaudio-module-bluetooth-policy \
- pulseaudio-module-bluez5-discover \
- pulseaudio-module-bluez5-device \
- pulseaudio-module-switch-on-connect \
- pulseaudio-module-loopback \
- ','', d)} \
- gstreamer1.0-meta-base \
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-navi-lbs.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-navi-lbs.bb
deleted file mode 100644
index 63c27348c..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-navi-lbs.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Navigation and Location Based Services Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-navi-lbs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-os-commonlibs.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-os-commonlibs.bb
deleted file mode 100644
index 99a3abd31..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-os-commonlibs.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Operating System and Common libraries Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-os-commonlibs \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- procps \
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-security.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-security.bb
deleted file mode 100644
index b7c15399b..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-security.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Security Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-security \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-speech-services.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-speech-services.bb
deleted file mode 100644
index 72105ee3a..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core-speech-services.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of common packages required by Speech Services Subsystem"
-
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core-speech-services \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- "
diff --git a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core.bb b/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core.bb
deleted file mode 100644
index b3cff10a6..000000000
--- a/meta-ivi-common/recipes-core/packagegroups/packagegroup-ivi-common-core.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "The middlewares for AGL IVI profile"
-DESCRIPTION = "A set of packagegroups which contain common packages required by AGL Distribution"
-LICENSE = "MIT"
-
-inherit packagegroup
-
-PACKAGES = "\
- packagegroup-ivi-common-core \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- packagegroup-ivi-common-core-automotive \
- packagegroup-ivi-common-core-connectivity \
- packagegroup-ivi-common-core-graphics \
- packagegroup-ivi-common-core-multimedia \
- packagegroup-ivi-common-core-navi-lbs \
- packagegroup-ivi-common-core-os-commonlibs \
- packagegroup-ivi-common-core-speech-services \
- packagegroup-ivi-common-core-security \
- packagegroup-ivi-common-core-kernel \
- "
diff --git a/meta-ivi-common/recipes-devtools/.gitkeep b/meta-ivi-common/recipes-devtools/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/recipes-devtools/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/recipes-extended/.gitkeep b/meta-ivi-common/recipes-extended/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/recipes-extended/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch
deleted file mode 100644
index 5bf6bf88e..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0001-Fix-build-with-systemd-209.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 8080b7395c1638baee60fb3c46667f21e00b87fb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Erik=20Bot=C3=B6?= <erik.boto@pelagicore.com>
-Date: Fri, 4 Apr 2014 10:59:18 +0200
-Subject: [PATCH 1/4] Fix build with systemd >= 209
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Upstream-Status: Inappropriate [Configuration Specific]
-Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
----
- src/system/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt
-index ce87914..1d0d224 100644
---- a/src/system/CMakeLists.txt
-+++ b/src/system/CMakeLists.txt
-@@ -23,7 +23,7 @@ set(dlt_system_SRCS dlt-system.c dlt-system-options.c dlt-system-process-handlin
- dlt-system-syslog.c dlt-system-watchdog.c dlt-system-journal.c)
- add_executable(dlt-system ${dlt_system_SRCS} ${systemd_SRCS})
- if(WITH_SYSTEMD_JOURNAL)
-- target_link_libraries(dlt-system dlt ${ZLIB_LIBRARIES} systemd-journal systemd-id128)
-+ target_link_libraries(dlt-system dlt ${ZLIB_LIBRARIES} systemd)
- else(WITH_SYSTEMD_JOURNAL)
- target_link_libraries(dlt-system dlt ${ZLIB_LIBRARIES})
- endif(WITH_SYSTEMD_JOURNAL)
---
-1.9.3
-
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch
deleted file mode 100644
index 168847990..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From bcca4c99394ba422d03a5e76f2a0023ef248824a Mon Sep 17 00:00:00 2001
-From: Andrei Gherzan <andrei.gherzan@windriver.com>
-Date: Tue, 18 Nov 2014 15:47:22 +0100
-Subject: [PATCH 2/4] Don't execute processes as a specific user.
-
-Upstream-Status: Inappropriate [Configuration Specific]
-Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
----
- systemd/dlt-adaptor-udp.service.cmake | 1 -
- systemd/dlt-example-user.service.cmake | 1 -
- systemd/dlt-receive.service.cmake | 1 -
- systemd/dlt-system.service.cmake | 1 -
- systemd/dlt.service.cmake | 1 -
- 5 files changed, 5 deletions(-)
-
-diff --git a/systemd/dlt-adaptor-udp.service.cmake b/systemd/dlt-adaptor-udp.service.cmake
-index 8dac1f2..ecf9f9e 100644
---- a/systemd/dlt-adaptor-udp.service.cmake
-+++ b/systemd/dlt-adaptor-udp.service.cmake
-@@ -21,9 +21,8 @@ Wants=dlt.service
-
- [Service]
- Type=simple
--User=@DLT_USER@
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-adaptor-udp -a @DLT_ADAPTOR_UDP_APPID@ -c @DLT_ADAPTOR_UDP_CTID@ -p @DLT_ADAPTOR_UDP_PORT@
- LimitCORE=infinity
-
- [Install]
--WantedBy=multi-user.target
-\ No newline at end of file
-+WantedBy=multi-user.target
-diff --git a/systemd/dlt-example-user.service.cmake b/systemd/dlt-example-user.service.cmake
-index b665742..35009b0 100644
---- a/systemd/dlt-example-user.service.cmake
-+++ b/systemd/dlt-example-user.service.cmake
-@@ -21,6 +21,5 @@ Wants=dlt.service
-
- [Service]
- Type=simple
--User=@DLT_USER@
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-example-user "Hallo from GENIVI DLT example user application"
--LimitCORE=infinity
-\ No newline at end of file
-+LimitCORE=infinity
-diff --git a/systemd/dlt-receive.service.cmake b/systemd/dlt-receive.service.cmake
-index c07d447..8f88f00 100644
---- a/systemd/dlt-receive.service.cmake
-+++ b/systemd/dlt-receive.service.cmake
-@@ -22,6 +22,5 @@ Wants=dlt.service
-
- [Service]
- Type=simple
--User=@DLT_USER@
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-receive -o /tmp/dlt_receive_log.dlt localhost
--LimitCORE=infinity
-\ No newline at end of file
-+LimitCORE=infinity
-diff --git a/systemd/dlt-system.service.cmake b/systemd/dlt-system.service.cmake
-index 0e91f42..1a5b913 100755
---- a/systemd/dlt-system.service.cmake
-+++ b/systemd/dlt-system.service.cmake
-@@ -22,7 +22,6 @@ Wants=dlt.service
-
- [Service]
- Type=simple
--User=@DLT_USER@
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-system
- WatchdogSec=@DLT_WatchdogSec@
- NotifyAccess=main
-diff --git a/systemd/dlt.service.cmake b/systemd/dlt.service.cmake
-index 0b3ee2c..e4753a2 100755
---- a/systemd/dlt.service.cmake
-+++ b/systemd/dlt.service.cmake
-@@ -21,7 +21,6 @@ Documentation=man:dlt-daemon(1) man:dlt.conf(5)
-
- [Service]
- Type=simple
--User=@DLT_USER@
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-daemon
- WatchdogSec=@DLT_WatchdogSec@
- NotifyAccess=main
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0003-systemd-unit-type-should-be-in-lowercase-so-use-Type.patch b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0003-systemd-unit-type-should-be-in-lowercase-so-use-Type.patch
deleted file mode 100644
index 691a50027..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0003-systemd-unit-type-should-be-in-lowercase-so-use-Type.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 6804c68ed61f4436818c58cb0abe1c21b4d48aea Mon Sep 17 00:00:00 2001
-From: Andrei Gherzan <andrei.gherzan@windriver.com>
-Date: Tue, 18 Nov 2014 15:48:50 +0100
-Subject: [PATCH 3/4] systemd/*: unit type should be in lowercase, so use
- Type=simple
-
-Upstream-Status: Submitted [http://lists.genivi.org/pipermail/genivi-diagnostic-log-and-trace/2014-October/000546.html]
-Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
----
- systemd/dlt-adaptor-udp.service.cmake | 2 +-
- systemd/dlt-dbus.service.cmake | 2 +-
- systemd/dlt-example-user.service.cmake | 2 +-
- systemd/dlt-receive.service.cmake | 2 +-
- systemd/dlt-system.service.cmake | 2 +-
- systemd/dlt.service.cmake | 2 +-
- 6 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/systemd/dlt-adaptor-udp.service.cmake b/systemd/dlt-adaptor-udp.service.cmake
-index f446757..81a7158 100644
---- a/systemd/dlt-adaptor-udp.service.cmake
-+++ b/systemd/dlt-adaptor-udp.service.cmake
-@@ -19,7 +19,7 @@ Description=GENIVI DLT adaptor stdin. Adaptor for forwarding received UDP messag
- Wants=dlt.service
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-adaptor-udp -a @DLT_ADAPTOR_UDP_APPID@ -c @DLT_ADAPTOR_UDP_CTID@ -p @DLT_ADAPTOR_UDP_PORT@
- LimitCORE=infinity
-
-diff --git a/systemd/dlt-dbus.service.cmake b/systemd/dlt-dbus.service.cmake
-index d1e3b12..75dcdc3 100755
---- a/systemd/dlt-dbus.service.cmake
-+++ b/systemd/dlt-dbus.service.cmake
-@@ -20,7 +20,7 @@ Documentation=man:dlt-dbus(1) man:dlt-dbus.conf(5)
- Wants=dlt.service
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-dbus
- WatchdogSec=@DLT_WatchdogSec@
- NotifyAccess=main
-diff --git a/systemd/dlt-example-user.service.cmake b/systemd/dlt-example-user.service.cmake
-index b67a83c..fe9c567 100644
---- a/systemd/dlt-example-user.service.cmake
-+++ b/systemd/dlt-example-user.service.cmake
-@@ -19,6 +19,6 @@ Description=GENIVI DLT example user. Generate DLT messages and store them to fil
- Wants=dlt.service
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-example-user "Hallo from GENIVI DLT example user application"
- LimitCORE=infinity
-\ No newline at end of file
-diff --git a/systemd/dlt-receive.service.cmake b/systemd/dlt-receive.service.cmake
-index 4bbdfc2..3b47dd3 100644
---- a/systemd/dlt-receive.service.cmake
-+++ b/systemd/dlt-receive.service.cmake
-@@ -20,6 +20,6 @@ Documentation=man:dlt-receive(1)
- Wants=dlt.service
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-receive -o /tmp/dlt_receive_log.dlt localhost
- LimitCORE=infinity
-\ No newline at end of file
-diff --git a/systemd/dlt-system.service.cmake b/systemd/dlt-system.service.cmake
-index 7ec995c..d4a4c96 100755
---- a/systemd/dlt-system.service.cmake
-+++ b/systemd/dlt-system.service.cmake
-@@ -20,7 +20,7 @@ Documentation=man:dlt-system(1) man:dlt-system.conf(5)
- Wants=dlt.service
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-system
- WatchdogSec=@DLT_WatchdogSec@
- NotifyAccess=main
-diff --git a/systemd/dlt.service.cmake b/systemd/dlt.service.cmake
-index 7bb05bc..5386ffd 100755
---- a/systemd/dlt.service.cmake
-+++ b/systemd/dlt.service.cmake
-@@ -19,7 +19,7 @@ Description=GENIVI DLT logging daemon
- Documentation=man:dlt-daemon(1) man:dlt.conf(5)
-
- [Service]
--Type=Simple
-+Type=simple
- ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-daemon
- WatchdogSec=@DLT_WatchdogSec@
- NotifyAccess=main
---
-1.9.3
-
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch
deleted file mode 100644
index 685dfcddc..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 9a5e655cf57301008cd61d53c8a410a7f397e650 Mon Sep 17 00:00:00 2001
-From: Andrei Gherzan <andrei.gherzan@windriver.com>
-Date: Tue, 18 Nov 2014 15:51:30 +0100
-Subject: [PATCH 4/4] Modify systemd config directory
-
-Upstream-Status: Inappropriate [Configuration Specific]
-Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
----
- systemd/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e6b44a2..0e885bf 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -175,7 +175,7 @@ if(WITH_SYSTEMD OR WITH_SYSTEMD_WATCHDOG OR WITH_SYSTEMD_JOURNAL)
-
- set( systemd_SRCS ${CMAKE_SOURCE_DIR}/systemd/3rdparty/sd-daemon.c)
-
-- set(SYSTEMD_UNITDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system" CACHE PATH
-+ set(SYSTEMD_UNITDIR "/lib/systemd/system" CACHE PATH
- "Set directory to install systemd unit files")
-
- add_subdirectory( systemd )
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.11.1.bb b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.11.1.bb
deleted file mode 100644
index e6204c46f..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.11.1.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-SUMMARY = "Diagnostic Log and Trace"
-DESCRIPTION = "This component provides a standardised log and trace interface, \
-based on the standardised protocol specified in the AUTOSAR standard 4.0 DLT. \
-This component can be used by GENIVI components and other applications as \
-logging facility providing: \
-- the DLT shared library \
-- the DLT daemon, including startup scripts \
-- the DLT daemon adaptors- the DLT client console utilities \
-- the DLT test applications"
-HOMEPAGE = "https://www.genivi.org/"
-SECTION = "console/utils"
-LICENSE = "MPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=99ba60c3fad7eaf8c56bca6dd75cba09 \
- file://MPL.txt;md5=ccdb2761cef70c8b2612624c323f89dc"
-
-DEPENDS = "dbus zlib"
-
-# FIX ME
-# This should be TAG = "v${PV}" but yocto doesn't support lightweight tags for now
-# https://bugzilla.yoctoproject.org/show_bug.cgi?id=6881
-TAG = "b8b3ea3a31f7deb681941a19878c82e7b7350ae7"
-BRANCH = "v2.11.x"
-SRC_URI = "git://git.projects.genivi.org/${PN}.git;branch=${BRANCH};tag=${TAG} \
- file://0001-Fix-build-with-systemd-209.patch \
- file://0002-Don-t-execute-processes-as-a-specific-user.patch \
- file://0003-systemd-unit-type-should-be-in-lowercase-so-use-Type.patch \
- file://0004-Modify-systemd-config-directory.patch"
-S = "${WORKDIR}/git"
-
-inherit gzipnative autotools gettext cmake systemd
-
-# -fPIC is needed to prevent relocation errors when we compile gtest with
-# Yocto security flags. See this issue for more details:
-#
-# https://github.com/google/googletest/issues/854
-#
-# If that issue is fixed, we can probably remove the manual -fPIC flags here.
-OECMAKE_C_FLAGS += "-fPIC"
-OECMAKE_CXX_FLAGS += "-fPIC"
-
-PACKAGES += "${PN}-systemd"
-SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "dlt-system.service dlt.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "enable"
-SYSTEMD_SERVICE_${PN}-systemd = "dlt-example-user.service \
- dlt-dbus.service \
- dlt-adaptor-udp.service \
- dlt-receive.service"
-SYSTEMD_AUTO_ENABLE_${PN}-systemd = "disable"
-
-EXTRA_OECMAKE = "-DWITH_SYSTEMD=ON"
-
-FILES_${PN}-doc += "/usr/share/dlt-filetransfer"
diff --git a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.15.0.bb b/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.15.0.bb
deleted file mode 100644
index cdd80de50..000000000
--- a/meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.15.0.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-SUMMARY = "Diagnostic Log and Trace"
-DESCRIPTION = "This component provides a standardised log and trace interface, \
-based on the standardised protocol specified in the AUTOSAR standard 4.0 DLT. \
-This component can be used by GENIVI components and other applications as \
-logging facility providing: \
-- the DLT shared library \
-- the DLT daemon, including startup scripts \
-- the DLT daemon adaptors- the DLT client console utilities \
-- the DLT test applications"
-HOMEPAGE = "https://www.genivi.org/"
-SECTION = "console/utils"
-LICENSE = "MPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=8184208060df880fe3137b93eb88aeea"
-
-DEPENDS = "dbus zlib"
-
-SRCREV = "e9a486a08fff6d3cc7133a350cec3ee10f463207"
-SRC_URI = "git://git.projects.genivi.org/${BPN}.git;protocol=http \
- file://0002-Don-t-execute-processes-as-a-specific-user.patch \
- file://0004-Modify-systemd-config-directory.patch \
- "
-S = "${WORKDIR}/git"
-
-inherit gzipnative autotools gettext cmake systemd
-
-# -fPIC is needed to prevent relocation errors when we compile gtest with
-# Yocto security flags. See this issue for more details:
-#
-# https://github.com/google/googletest/issues/854
-#
-# If that issue is fixed, we can probably remove the manual -fPIC flags here.
-OECMAKE_C_FLAGS += "-fPIC"
-OECMAKE_CXX_FLAGS += "-fPIC"
-
-PACKAGES += "${PN}-systemd"
-SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "dlt-system.service dlt.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "enable"
-SYSTEMD_SERVICE_${PN}-systemd = "dlt-example-user.service \
- dlt-dbus.service \
- dlt-adaptor-udp.service \
- dlt-receive.service"
-SYSTEMD_AUTO_ENABLE_${PN}-systemd = "disable"
-
-EXTRA_OECMAKE = "-DWITH_SYSTEMD=ON"
-
-FILES_${PN}-doc += "/usr/share/dlt-filetransfer"
-
-do_install_append() {
- rm -f ${D}${bindir}/dlt-test-*
-}
diff --git a/meta-ivi-common/recipes-graphics/.gitkeep b/meta-ivi-common/recipes-graphics/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/recipes-graphics/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Fix-ivi-application-lib-install.patch b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Fix-ivi-application-lib-install.patch
deleted file mode 100644
index 4140ce576..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/0001-Fix-ivi-application-lib-install.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 1e13c6d494a8b542c2a7f8251afc7aec401e3ad8 Mon Sep 17 00:00:00 2001
-From: Ronan Le Martret <ronan.lemartret@iot.bzh>
-Date: Tue, 7 Feb 2017 17:13:47 +0100
-Subject: [PATCH] Fix ivi-application lib install
-
- * libivi-application.so must be a link to
- libivi-application.so.X.X.XX
- * fix yocto package QA
-
-Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
----
- protocol/CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/protocol/CMakeLists.txt b/protocol/CMakeLists.txt
-index 613a1a6..09d5126 100644
---- a/protocol/CMakeLists.txt
-+++ b/protocol/CMakeLists.txt
-@@ -170,6 +170,8 @@ install(
- DESTINATION include/ilm
- )
-
-+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${ILM_API_VERSION} SOVERSION ${ILM_API_VERSION})
-+
- #=============================================================================================
- # generate documentation for ivi-application API
- #=============================================================================================
---
-2.6.6
-
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
deleted file mode 100644
index 86b448be1..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/wandboard_fix_build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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.11.0.bb b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb
deleted file mode 100644
index 581cc5b13..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "Wayland IVI Extension"
-DESCRIPTION = "GENIVI Layer Management API based on Wayland IVI Extension"
-HOMEPAGE = "http://projects.genivi.org/wayland-ivi-extension"
-BUGTRACKER = "http://bugs.genivi.org/enter_bug.cgi?product=Wayland%20IVI%20Extension"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1f1a56bb2dadf5f2be8eb342acf4ed79"
-
-SRCREV = "c9001582b10ce209c37b42dd560947c5aa8928b3"
-SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \
- "
-S = "${WORKDIR}/git"
-
-DEPENDS = "weston virtual/libgles2 pixman"
-
-inherit cmake
-
-EXTRA_OECMAKE := "-DWITH_ILM_INPUT=1"
-
-FILES_${PN} += "${libdir}/weston/*"
-FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
-
-EXTRA_OECMAKE += "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
diff --git a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend b/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
deleted file mode 100755
index 6e0789f26..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension_1.11.0.bbappend
+++ /dev/null
@@ -1,12 +0,0 @@
-FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:"
-
-
-SRC_URI_append = " \
- file://0001-Fix-ivi-application-lib-install.patch \
- "
-
-SRC_URI_append_wandboard = "file://wandboard_fix_build.patch"
-
-
-# workaround paralellism issue:
-PARALLEL_MAKE = "" \ No newline at end of file
diff --git a/meta-ivi-common/recipes-graphics/wayland/weston_%.bbappend b/meta-ivi-common/recipes-graphics/wayland/weston_%.bbappend
deleted file mode 100644
index 226126378..000000000
--- a/meta-ivi-common/recipes-graphics/wayland/weston_%.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_OECONF_append = " --enable-ivi-shell"
diff --git a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/0001-Fix-duplicated-command-line-arg-t.patch b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/0001-Fix-duplicated-command-line-arg-t.patch
deleted file mode 100644
index fcdf9c540..000000000
--- a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/0001-Fix-duplicated-command-line-arg-t.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From c4b6030f575e38dfc9cca7dfd029d207f3af6a13 Mon Sep 17 00:00:00 2001
-From: "Andre Moreira Magalhaes (andrunko)" <andre.magalhaes@collabora.co.uk>
-Date: Thu, 5 May 2016 00:01:19 -0300
-Subject: [PATCH] Fix duplicated command line arg -t.
-
----
- AudioManagerDaemon/src/main.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
-index 795795d..67c0977 100755
---- a/AudioManagerDaemon/src/main.cpp
-+++ b/AudioManagerDaemon/src/main.cpp
-@@ -87,7 +87,7 @@ TCLAP::ValueArg<std::string> commandPluginDir("l","CommandPluginDir","path for l
- TCLAP::ValueArg<std::string> databasePath ("p","databasePath","path for sqlite database (default is in memory)",false,":memory:","string");
- TCLAP::ValueArg<unsigned int> telnetPort ("t","telnetport","The port that is used for telnet",false,DEFAULT_TELNETPORT,"int");
- TCLAP::ValueArg<unsigned int> maxConnections ("m","maxConnections","Maximal number of connections for telnet",false,MAX_TELNETCONNECTIONS,"int");
--TCLAP::SwitchArg dbusWrapperTypeBool ("t","dbusType","DbusType to be used by CAmDbusWrapper: if option is selected, DBUS_SYSTEM is used otherwise DBUS_SESSION",false);
-+TCLAP::SwitchArg dbusWrapperTypeBool ("T","dbusType","DbusType to be used by CAmDbusWrapper: if option is selected, DBUS_SYSTEM is used otherwise DBUS_SESSION",false);
- TCLAP::SwitchArg enableNoDLTDebug ("V","logDlt","print DLT logs to stdout",false);
- TCLAP::SwitchArg currentSettings("i","currentSettings","print current settings and exit",false);
- TCLAP::SwitchArg daemonizeAM("d","daemonize","daemonize Audiomanager. Better use systemd...",false);
---
-2.5.0
-
diff --git a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/audiomanager.service b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/audiomanager.service
deleted file mode 100644
index 2210a377b..000000000
--- a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager/audiomanager.service
+++ /dev/null
@@ -1,17 +0,0 @@
-# AudioManager systemd service file
-
-[Unit]
-Description=GENIVI AudioManager
-Requires=dbus.service
-After=dbus.service
-Before=pulseaudio.service
-
-[Service]
-Type=notify
-ExecStart=/usr/bin/AudioManager -T
-Restart=always
-TimeoutSec=2
-WatchdogSec=2
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager_7.4.bb b/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager_7.4.bb
deleted file mode 100644
index 15eb36252..000000000
--- a/meta-ivi-common/recipes-multimedia/audiomanager/audiomanager_7.4.bb
+++ /dev/null
@@ -1,56 +0,0 @@
-DESCRIPTION = "GENIVI Audio Manager"
-HOMEPAGE = "http://projects.genivi.org/audio-manager/home"
-LICENSE = "MPLv2"
-SECTION = "multimedia"
-DEPENDS = "dbus dlt-daemon systemd"
-LIC_FILES_CHKSUM = "file://LICENCE;md5=f164349b56ed530a6642e9b9f244eec5"
-
-SRC_URI = " \
- git://github.com/GENIVI/AudioManager.git;protocol=https;branch=master \
- file://audiomanager.service \
-"
-RDEPENDS_${PN} = "audiomanager-plugins module-router"
-SRCREV = "daf851ee7a41d1b0572c0c95e15f61e427ce97f1"
-
-S = "${WORKDIR}/git"
-inherit cmake systemd
-SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE_${PN} = "audiomanager.service"
-SYSTEMD_AUTO_ENABLE = "enable"
-
-EXTRA_OECMAKE = " \
- -DWITH_TESTS=OFF \
- -DWITH_DOCUMENTATION=OFF \
- -DWITH_DLT=ON \
- -DWITH_TELNET=OFF \
- -DWITH_SYSTEMD_WATCHDOG=ON \
- -DGLIB_DBUS_TYPES_TOLERANT=ON \
- -DWITH_CAPI_WRAPPER=OFF \
- -DWITH_DBUS_WRAPPER=ON \
- -DWITH_SHARED_UTILITIES=ON \
- -DWITH_SHARED_CORE=ON \
-"
-
-FILES_${PN} = " \
- ${bindir}/AudioManager \
- ${libdir}/libAudioManagerCore.so.7 \
- ${libdir}/libAudioManagerCore.so.7.4 \
- ${libdir}/libAudioManagerCore.so.7.4.12 \
- ${libdir}/libAudioManagerUtilities.so.7 \
- ${libdir}/libAudioManagerUtilities.so.7.4 \
- ${libdir}/libAudioManagerUtilities.so.7.4.12 \
- ${systemd_unitdir}/audiomanager.service \
-"
-
-FILES_${PN}-dev = " \
- ${includedir}/audiomanager/* \
- ${libdir}/cmake/* \
- ${libdir}/pkgconfig/* \
- ${libdir}/libAudioManagerCore.so \
- ${libdir}/libAudioManagerUtilities.so \
-"
-
-do_install_append() {
- install -d ${D}${systemd_unitdir}/system/
- install -m 0644 ${WORKDIR}/audiomanager.service ${D}${systemd_unitdir}/system/
-}
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0001-install-files-for-a-module-development.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0001-install-files-for-a-module-development.patch
deleted file mode 100644
index 8c5f9efd4..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0001-install-files-for-a-module-development.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 53281e2d11f84e2dae0704e0167369710ee2cb30 Mon Sep 17 00:00:00 2001
-From: Yannick Gicquel <yannick.gicquel@iot.bzh>
-Date: Fri, 23 Sep 2016 14:26:03 +0200
-Subject: [PATCH 1/6] install files for a module development
-
-Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh>
----
- Makefile.am | 14 +++++++++++++-
- configure.ac | 1 +
- pulseaudio-module-devel.pc.in | 12 ++++++++++++
- 3 files changed, 26 insertions(+), 1 deletion(-)
- create mode 100644 pulseaudio-module-devel.pc.in
-
-diff --git a/Makefile.am b/Makefile.am
-index 13bc469..f0d68a2 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -53,7 +53,16 @@ dist_vapi_DATA = \
- vala/libpulse-simple.deps vala/libpulse-simple.vapi
-
- pkgconfigdir = $(libdir)/pkgconfig
--pkgconfig_DATA = libpulse.pc libpulse-simple.pc
-+pkgconfig_DATA = libpulse.pc libpulse-simple.pc pulseaudio-module-devel.pc
-+
-+moduledev_DATA = pulsecore-config.h $(top_srcdir)/src/pulsecore/*.h
-+moduledevdir = $(includedir)/pulsemodule/pulsecore
-+
-+moduledevfilter_DATA = $(top_srcdir)/src/pulsecore/filter/*.h
-+moduledevfilterdir = $(includedir)/pulsemodule/pulsecore/filter
-+
-+moduledevinternal_DATA = src/pulse/internal.h src/pulse/client-conf.h src/pulse/fork-detect.h
-+moduledevinternaldir = $(includedir)/pulsemodule/pulse
-
- if HAVE_GLIB20
- pkgconfig_DATA += \
-@@ -107,6 +116,9 @@ dist-hook:
- check-daemon:
- $(MAKE) -C src check-daemon
-
-+pulsecore-config.h: config.h
-+ cp $< $@
-+
- .PHONY: homepage distcleancheck doxygen
-
- # see git-version-gen
-diff --git a/configure.ac b/configure.ac
-index 9250c05..f9201ee 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1502,6 +1502,7 @@ man/pulse-client.conf.5.xml
- man/default.pa.5.xml
- man/pulse-cli-syntax.5.xml
- man/start-pulseaudio-x11.1.xml
-+pulseaudio-module-devel.pc
- ])
-
- AC_CONFIG_FILES([src/esdcompat:src/daemon/esdcompat.in], [chmod +x src/esdcompat])
-diff --git a/pulseaudio-module-devel.pc.in b/pulseaudio-module-devel.pc.in
-new file mode 100644
-index 0000000..85aadbc
---- /dev/null
-+++ b/pulseaudio-module-devel.pc.in
-@@ -0,0 +1,12 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+modlibexecdir=@modlibexecdir@
-+
-+Name: pulseaudio-module-devel
-+Description: PulseAudio Module Development Interface
-+Version: @PACKAGE_VERSION@
-+Libs: -L${libdir} -L${libdir}/pulseaudio -L${modlibexecdir} -lpulsecommon-@PA_MAJORMINOR@ -lpulsecore-@PA_MAJORMINOR@ -lprotocol-native
-+Libs.private:
-+Cflags: -I${includedir}/pulsemodule -D_REENTRANT
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0002-volume-ramp-additions-to-the-low-level-infra.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0002-volume-ramp-additions-to-the-low-level-infra.patch
deleted file mode 100644
index 9cee6f5de..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0002-volume-ramp-additions-to-the-low-level-infra.patch
+++ /dev/null
@@ -1,566 +0,0 @@
-From 7757059ffc6e63ea20ba9013682d72d619e7aefc Mon Sep 17 00:00:00 2001
-From: Sangchul Lee <sangchul1011@gmail.com>
-Date: Sat, 27 Aug 2016 21:33:16 +0900
-Subject: [PATCH 2/6] volume ramp: additions to the low level infra
-
-The original patch is
- - https://review.tizen.org/git/?p=platform/upstream/pulseaudio.git;a=commit;h=df1c4275ed79e0b708c75b92f9d247e0492bc1f0
- - by Jaska Uimonen <jaska.uimonen <at> helsinki.fi>
-
-Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
----
- src/map-file | 4 +
- src/pulse/def.h | 13 ++-
- src/pulse/volume.c | 74 ++++++++++++-
- src/pulse/volume.h | 33 ++++++
- src/pulsecore/mix.c | 310 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/pulsecore/mix.h | 27 +++++
- 6 files changed, 459 insertions(+), 2 deletions(-)
-
-diff --git a/src/map-file b/src/map-file
-index 93a62b8..ef9b57d 100644
---- a/src/map-file
-+++ b/src/map-file
-@@ -138,6 +138,10 @@ pa_cvolume_max_mask;
- pa_cvolume_merge;
- pa_cvolume_min;
- pa_cvolume_min_mask;
-+pa_cvolume_ramp_equal;
-+pa_cvolume_ramp_init;
-+pa_cvolume_ramp_set;
-+pa_cvolume_ramp_channel_ramp_set;
- pa_cvolume_remap;
- pa_cvolume_scale;
- pa_cvolume_scale_mask;
-diff --git a/src/pulse/def.h b/src/pulse/def.h
-index 680bdc9..bc3cedd 100644
---- a/src/pulse/def.h
-+++ b/src/pulse/def.h
-@@ -347,11 +347,15 @@ typedef enum pa_stream_flags {
- * consider absolute when the sink is in flat volume mode,
- * relative otherwise. \since 0.9.20 */
-
-- PA_STREAM_PASSTHROUGH = 0x80000U
-+ PA_STREAM_PASSTHROUGH = 0x80000U,
- /**< Used to tag content that will be rendered by passthrough sinks.
- * The data will be left as is and not reformatted, resampled.
- * \since 1.0 */
-
-+ PA_STREAM_START_RAMP_MUTED = 0x100000U
-+ /**< Used to tag content that the stream will be started ramp volume
-+ * muted so that you can nicely fade it in */
-+
- } pa_stream_flags_t;
-
- /** \cond fulldocs */
-@@ -380,6 +384,7 @@ typedef enum pa_stream_flags {
- #define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
- #define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
- #define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH
-+#define PA_STREAM_START_RAMP_MUTED PA_STREAM_START_RAMP_MUTED
-
- /** \endcond */
-
-@@ -1047,6 +1052,12 @@ typedef enum pa_port_available {
- /** \endcond */
- #endif
-
-+/** \cond fulldocs */
-+#define PA_VOLUMER_RAMP_TYPE_LINEAR PA_VOLUMER_RAMP_TYPE_LINEAR
-+#define PA_VOLUMER_RAMP_TYPE_LOGARITHMIC PA_VOLUMER_RAMP_TYPE_LOGARITHMIC
-+#define PA_VOLUMER_RAMP_TYPE_CUBIC PA_VOLUMER_RAMP_TYPE_CUBIC
-+/** \endcond */
-+
- PA_C_DECL_END
-
- #endif
-diff --git a/src/pulse/volume.c b/src/pulse/volume.c
-index 1667b94..85072c1 100644
---- a/src/pulse/volume.c
-+++ b/src/pulse/volume.c
-@@ -445,7 +445,10 @@ int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) {
- unsigned c;
- pa_assert(a);
-
-- pa_return_val_if_fail(pa_cvolume_valid(a), 0);
-+ if (pa_cvolume_valid(a) == 0)
-+ abort();
-+
-+ /* pa_return_val_if_fail(pa_cvolume_valid(a), 0); */
- pa_return_val_if_fail(PA_VOLUME_IS_VALID(v), 0);
-
- for (c = 0; c < a->channels; c++)
-@@ -977,3 +980,72 @@ pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec) {
-
- return pa_cvolume_scale(v, m);
- }
-+
-+int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b) {
-+ int i;
-+ pa_assert(a);
-+ pa_assert(b);
-+
-+ if (PA_UNLIKELY(a == b))
-+ return 1;
-+
-+ if (a->channels != b->channels)
-+ return 0;
-+
-+ for (i = 0; i < a->channels; i++) {
-+ if (a->ramps[i].type != b->ramps[i].type ||
-+ a->ramps[i].length != b->ramps[i].length ||
-+ a->ramps[i].target != b->ramps[i].target)
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp) {
-+ unsigned c;
-+
-+ pa_assert(ramp);
-+
-+ ramp->channels = 0;
-+
-+ for (c = 0; c < PA_CHANNELS_MAX; c++) {
-+ ramp->ramps[c].type = PA_VOLUME_RAMP_TYPE_LINEAR;
-+ ramp->ramps[c].length = 0;
-+ ramp->ramps[c].target = PA_VOLUME_INVALID;
-+ }
-+
-+ return ramp;
-+}
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channels, pa_volume_ramp_type_t type, long time, pa_volume_t vol) {
-+ int i;
-+
-+ pa_assert(ramp);
-+ pa_assert(channels > 0);
-+ pa_assert(time >= 0);
-+ pa_assert(channels <= PA_CHANNELS_MAX);
-+
-+ ramp->channels = (uint8_t) channels;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ ramp->ramps[i].type = type;
-+ ramp->ramps[i].length = time;
-+ ramp->ramps[i].target = PA_CLAMP_VOLUME(vol);
-+ }
-+
-+ return ramp;
-+}
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol) {
-+
-+ pa_assert(ramp);
-+ pa_assert(channel <= ramp->channels);
-+ pa_assert(time >= 0);
-+
-+ ramp->ramps[channel].type = type;
-+ ramp->ramps[channel].length = time;
-+ ramp->ramps[channel].target = PA_CLAMP_VOLUME(vol);
-+
-+ return ramp;
-+}
-diff --git a/src/pulse/volume.h b/src/pulse/volume.h
-index 8cf4fa4..2ae3451 100644
---- a/src/pulse/volume.h
-+++ b/src/pulse/volume.h
-@@ -431,6 +431,39 @@ pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc);
- * the channels are kept. \since 0.9.16 */
- pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec);
-
-+/** Volume ramp type
-+*/
-+typedef enum pa_volume_ramp_type {
-+ PA_VOLUME_RAMP_TYPE_LINEAR = 0, /**< linear */
-+ PA_VOLUME_RAMP_TYPE_LOGARITHMIC = 1, /**< logarithmic */
-+ PA_VOLUME_RAMP_TYPE_CUBIC = 2,
-+} pa_volume_ramp_type_t;
-+
-+/** A structure encapsulating a volume ramp */
-+typedef struct pa_volume_ramp_t {
-+ pa_volume_ramp_type_t type;
-+ long length;
-+ pa_volume_t target;
-+} pa_volume_ramp_t;
-+
-+/** A structure encapsulating a multichannel volume ramp */
-+typedef struct pa_cvolume_ramp {
-+ uint8_t channels;
-+ pa_volume_ramp_t ramps[PA_CHANNELS_MAX];
-+} pa_cvolume_ramp;
-+
-+/** Return non-zero when *a == *b */
-+int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b);
-+
-+/** Init volume ramp struct */
-+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp);
-+
-+/** Set first n channels of ramp struct to certain value */
-+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-+
-+/** Set individual channel in the channel struct */
-+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-+
- PA_C_DECL_END
-
- #endif
-diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c
-index 59622d7..1e4cc1e 100644
---- a/src/pulsecore/mix.c
-+++ b/src/pulsecore/mix.c
-@@ -724,3 +724,313 @@ void pa_volume_memchunk(
-
- pa_memblock_release(c->memblock);
- }
-+
-+static void calc_linear_integer_volume_no_mapping(int32_t linear[], float volume[], unsigned nchannels) {
-+ unsigned channel, padding;
-+
-+ pa_assert(linear);
-+ pa_assert(volume);
-+
-+ for (channel = 0; channel < nchannels; channel++)
-+ linear[channel] = (int32_t) lrint(volume[channel] * 0x10000U);
-+
-+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++)
-+ linear[channel] = linear[padding];
-+}
-+
-+static void calc_linear_float_volume_no_mapping(float linear[], float volume[], unsigned nchannels) {
-+ unsigned channel, padding;
-+
-+ pa_assert(linear);
-+ pa_assert(volume);
-+
-+ for (channel = 0; channel < nchannels; channel++)
-+ linear[channel] = volume[channel];
-+
-+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++)
-+ linear[channel] = linear[padding];
-+}
-+
-+typedef void (*pa_calc_volume_no_mapping_func_t) (void *volumes, float *volume, int channels);
-+
-+static const pa_calc_volume_no_mapping_func_t calc_volume_table_no_mapping[] = {
-+ [PA_SAMPLE_U8] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_ALAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_ULAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S16LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S16BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_FLOAT32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping,
-+ [PA_SAMPLE_FLOAT32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping,
-+ [PA_SAMPLE_S32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24_32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24_32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping
-+};
-+
-+static const unsigned format_sample_size_table[] = {
-+ [PA_SAMPLE_U8] = 1,
-+ [PA_SAMPLE_ALAW] = 1,
-+ [PA_SAMPLE_ULAW] = 1,
-+ [PA_SAMPLE_S16LE] = 2,
-+ [PA_SAMPLE_S16BE] = 2,
-+ [PA_SAMPLE_FLOAT32LE] = 4,
-+ [PA_SAMPLE_FLOAT32BE] = 4,
-+ [PA_SAMPLE_S32LE] = 4,
-+ [PA_SAMPLE_S32BE] = 4,
-+ [PA_SAMPLE_S24LE] = 3,
-+ [PA_SAMPLE_S24BE] = 3,
-+ [PA_SAMPLE_S24_32LE] = 4,
-+ [PA_SAMPLE_S24_32BE] = 4
-+};
-+
-+static float calc_volume_ramp_linear(pa_volume_ramp_int_t *ramp) {
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ /* basic linear interpolation */
-+ return ramp->start + (ramp->length - ramp->left) * (ramp->end - ramp->start) / (float) ramp->length;
-+}
-+
-+static float calc_volume_ramp_logarithmic(pa_volume_ramp_int_t *ramp) {
-+ float x_val, s, e;
-+ long temp;
-+
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ if (ramp->end > ramp->start) {
-+ temp = ramp->left;
-+ s = ramp->end;
-+ e = ramp->start;
-+ } else {
-+ temp = ramp->length - ramp->left;
-+ s = ramp->start;
-+ e = ramp->end;
-+ }
-+
-+ x_val = temp == 0 ? 0.0 : powf(temp, 10);
-+
-+ /* base 10 logarithmic interpolation */
-+ return s + x_val * (e - s) / powf(ramp->length, 10);
-+}
-+
-+static float calc_volume_ramp_cubic(pa_volume_ramp_int_t *ramp) {
-+ float x_val, s, e;
-+ long temp;
-+
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ if (ramp->end > ramp->start) {
-+ temp = ramp->left;
-+ s = ramp->end;
-+ e = ramp->start;
-+ } else {
-+ temp = ramp->length - ramp->left;
-+ s = ramp->start;
-+ e = ramp->end;
-+ }
-+
-+ x_val = temp == 0 ? 0.0 : cbrtf(temp);
-+
-+ /* cubic interpolation */
-+ return s + x_val * (e - s) / cbrtf(ramp->length);
-+}
-+
-+typedef float (*pa_calc_volume_ramp_func_t) (pa_volume_ramp_int_t *);
-+
-+static const pa_calc_volume_ramp_func_t calc_volume_ramp_table[] = {
-+ [PA_VOLUME_RAMP_TYPE_LINEAR] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_linear,
-+ [PA_VOLUME_RAMP_TYPE_LOGARITHMIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_logarithmic,
-+ [PA_VOLUME_RAMP_TYPE_CUBIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_cubic
-+};
-+
-+static void calc_volume_ramps(pa_cvolume_ramp_int *ram, float *vol)
-+{
-+ int i;
-+
-+ for (i = 0; i < ram->channels; i++) {
-+ if (ram->ramps[i].left <= 0) {
-+ if (ram->ramps[i].target == PA_VOLUME_NORM) {
-+ vol[i] = 1.0;
-+ }
-+ } else {
-+ vol[i] = ram->ramps[i].curr = calc_volume_ramp_table[ram->ramps[i].type] (&ram->ramps[i]);
-+ ram->ramps[i].left--;
-+ }
-+ }
-+}
-+
-+void pa_volume_ramp_memchunk(
-+ pa_memchunk *c,
-+ const pa_sample_spec *spec,
-+ pa_cvolume_ramp_int *ramp) {
-+
-+ void *ptr;
-+ volume_val linear[PA_CHANNELS_MAX + VOLUME_PADDING];
-+ float vol[PA_CHANNELS_MAX + VOLUME_PADDING];
-+ pa_do_volume_func_t do_volume;
-+ long length_in_frames;
-+ int i;
-+
-+ pa_assert(c);
-+ pa_assert(spec);
-+ pa_assert(pa_frame_aligned(c->length, spec));
-+ pa_assert(ramp);
-+
-+ length_in_frames = c->length / format_sample_size_table[spec->format] / spec->channels;
-+
-+ if (pa_memblock_is_silence(c->memblock)) {
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].length > 0)
-+ ramp->ramps[i].length -= length_in_frames;
-+ }
-+ return;
-+ }
-+
-+ if (spec->format < 0 || spec->format >= PA_SAMPLE_MAX) {
-+ pa_log_warn("Unable to change volume of format");
-+ return;
-+ }
-+
-+ do_volume = pa_get_volume_func(spec->format);
-+ pa_assert(do_volume);
-+
-+ ptr = (uint8_t*) pa_memblock_acquire(c->memblock) + c->index;
-+
-+ for (i = 0; i < length_in_frames; i++) {
-+ calc_volume_ramps(ramp, vol);
-+ calc_volume_table_no_mapping[spec->format] ((void *)linear, vol, spec->channels);
-+
-+ /* we only process one frame per iteration */
-+ do_volume (ptr, (void *)linear, spec->channels, format_sample_size_table[spec->format] * spec->channels);
-+
-+ /* pa_log_debug("1: %d 2: %d", linear[0], linear[1]); */
-+
-+ ptr = (uint8_t*)ptr + format_sample_size_table[spec->format] * spec->channels;
-+ }
-+
-+ pa_memblock_release(c->memblock);
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate) {
-+
-+ int i, j, channels, remaining_channels;
-+ float temp;
-+
-+ if (dst->channels < src->channels) {
-+ channels = dst->channels;
-+ remaining_channels = 0;
-+ }
-+ else {
-+ channels = src->channels;
-+ remaining_channels = dst->channels;
-+ }
-+
-+ for (i = 0; i < channels; i++) {
-+ dst->ramps[i].type = src->ramps[i].type;
-+ /* ms to samples */
-+ dst->ramps[i].length = src->ramps[i].length * sample_rate / 1000;
-+ dst->ramps[i].left = dst->ramps[i].length;
-+ dst->ramps[i].start = dst->ramps[i].end;
-+ dst->ramps[i].target = src->ramps[i].target;
-+ /* scale to pulse internal mapping so that when ramp is over there's no glitch in volume */
-+ temp = src->ramps[i].target / (float)0x10000U;
-+ dst->ramps[i].end = temp * temp * temp;
-+ }
-+
-+ j = i;
-+
-+ for (i--; j < remaining_channels; j++) {
-+ dst->ramps[j].type = dst->ramps[i].type;
-+ dst->ramps[j].length = dst->ramps[i].length;
-+ dst->ramps[j].left = dst->ramps[i].left;
-+ dst->ramps[j].start = dst->ramps[i].start;
-+ dst->ramps[j].target = dst->ramps[i].target;
-+ dst->ramps[j].end = dst->ramps[i].end;
-+ }
-+
-+ return dst;
-+}
-+
-+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp) {
-+ int i;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].left > 0)
-+ return true;
-+ }
-+
-+ return false;
-+}
-+
-+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp) {
-+ int i;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].target != PA_VOLUME_NORM)
-+ return true;
-+ }
-+
-+ return false;
-+}
-+
-+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume) {
-+ int i = 0;
-+
-+ volume->channels = ramp->channels;
-+
-+ for (i = 0; i < ramp->channels; i++)
-+ volume->values[i] = ramp->ramps[i].target;
-+
-+ return volume;
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst) {
-+ int i;
-+
-+ for (i = 0; i < src->channels; i++) {
-+ /* if new vols are invalid, copy old ramp i.e. no effect */
-+ if (dst->ramps[i].target == PA_VOLUME_INVALID)
-+ dst->ramps[i] = src->ramps[i];
-+ /* if there's some old ramp still left */
-+ else if (src->ramps[i].left > 0)
-+ dst->ramps[i].start = src->ramps[i].curr;
-+ }
-+
-+ return dst;
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels) {
-+ int i;
-+ float temp;
-+
-+ src->channels = channels;
-+
-+ for (i = 0; i < channels; i++) {
-+ src->ramps[i].type = PA_VOLUME_RAMP_TYPE_LINEAR;
-+ src->ramps[i].length = 0;
-+ src->ramps[i].left = 0;
-+ if (vol == PA_VOLUME_NORM) {
-+ src->ramps[i].start = 1.0;
-+ src->ramps[i].end = 1.0;
-+ src->ramps[i].curr = 1.0;
-+ }
-+ else if (vol == PA_VOLUME_MUTED) {
-+ src->ramps[i].start = 0.0;
-+ src->ramps[i].end = 0.0;
-+ src->ramps[i].curr = 0.0;
-+ }
-+ else {
-+ temp = vol / (float)0x10000U;
-+ src->ramps[i].start = temp * temp * temp;
-+ src->ramps[i].end = src->ramps[i].start;
-+ src->ramps[i].curr = src->ramps[i].start;
-+ }
-+ src->ramps[i].target = vol;
-+ }
-+
-+ return src;
-+}
-diff --git a/src/pulsecore/mix.h b/src/pulsecore/mix.h
-index 8102bcd..0f86b6f 100644
---- a/src/pulsecore/mix.h
-+++ b/src/pulsecore/mix.h
-@@ -59,4 +59,31 @@ void pa_volume_memchunk(
- const pa_sample_spec *spec,
- const pa_cvolume *volume);
-
-+typedef struct pa_volume_ramp_int_t {
-+ pa_volume_ramp_type_t type;
-+ long length;
-+ long left;
-+ float start;
-+ float end;
-+ float curr;
-+ pa_volume_t target;
-+} pa_volume_ramp_int_t;
-+
-+typedef struct pa_cvolume_ramp_int {
-+ uint8_t channels;
-+ pa_volume_ramp_int_t ramps[PA_CHANNELS_MAX];
-+} pa_cvolume_ramp_int;
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate);
-+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp);
-+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp);
-+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst);
-+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels);
-+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume);
-+
-+void pa_volume_ramp_memchunk(
-+ pa_memchunk *c,
-+ const pa_sample_spec *spec,
-+ pa_cvolume_ramp_int *ramp);
-+
- #endif
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch
deleted file mode 100644
index eb485ca7c..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0003-volume-ramp-adding-volume-ramping-to-sink-input.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-From e4469df7c69316b49cad93dd288badc98fa1cad5 Mon Sep 17 00:00:00 2001
-From: Sangchul Lee <sangchul1011@gmail.com>
-Date: Sat, 27 Aug 2016 21:33:17 +0900
-Subject: [PATCH 3/6] volume ramp: adding volume ramping to sink-input
-
-The original patch is
- - https://review.tizen.org/git/?p=platform/upstream/pulseaudio.git;a=commit;h=98042248fd67ce0ab3807c5c472c0d5d8b0f99d3
- - by Jaska Uimonen <jaska.uimonen <at> helsinki.fi>
-
-Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
----
- src/pulsecore/sink-input.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++
- src/pulsecore/sink-input.h | 11 ++++++++-
- 2 files changed, 71 insertions(+), 1 deletion(-)
-
-diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
-index 8ec63b5..cc8953f 100644
---- a/src/pulsecore/sink-input.c
-+++ b/src/pulsecore/sink-input.c
-@@ -526,6 +526,11 @@ int pa_sink_input_new(
- reset_callbacks(i);
- i->userdata = NULL;
-
-+ if (data->flags & PA_SINK_INPUT_START_RAMP_MUTED)
-+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_MUTED, data->sample_spec.channels);
-+ else
-+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_NORM, data->sample_spec.channels);
-+
- i->thread_info.state = i->state;
- i->thread_info.attached = false;
- pa_atomic_store(&i->thread_info.drained, 1);
-@@ -542,6 +547,8 @@ int pa_sink_input_new(
- i->thread_info.playing_for = 0;
- i->thread_info.direct_outputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
-
-+ i->thread_info.ramp = i->ramp;
-+
- pa_assert_se(pa_idxset_put(core->sink_inputs, i, &i->index) == 0);
- pa_assert_se(pa_idxset_put(i->sink->inputs, pa_sink_input_ref(i), NULL) == 0);
-
-@@ -923,6 +930,8 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
- while (tchunk.length > 0) {
- pa_memchunk wchunk;
- bool nvfs = need_volume_factor_sink;
-+ pa_cvolume target;
-+ pa_bool_t tmp;
-
- wchunk = tchunk;
- pa_memblock_ref(wchunk.memblock);
-@@ -959,6 +968,16 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
- pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
-+ /* check for possible volume ramp */
-+ if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp));
-+ } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
-+ pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target);
-+ }
-+
- pa_memblockq_push_align(i->thread_info.render_memblockq, &wchunk);
- } else {
- pa_memchunk rchunk;
-@@ -975,6 +994,16 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
- pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
-+ /* check for possible volume ramp */
-+ if (pa_cvolume_ramp_active(&(i->thread_info.ramp))) {
-+ pa_memchunk_make_writable(&rchunk, 0);
-+ pa_volume_ramp_memchunk(&rchunk, &i->sink->sample_spec, &(i->thread_info.ramp));
-+ } else if (pa_cvolume_ramp_target_active(&(i->thread_info.ramp))) {
-+ pa_memchunk_make_writable(&rchunk, 0);
-+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
-+ pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &target);
-+ }
-+
- pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
- pa_memblock_unref(rchunk.memblock);
- }
-@@ -1339,6 +1368,31 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) {
- return 0;
- }
-
-+/* Called from main thread */
-+void pa_sink_input_set_volume_ramp(
-+ pa_sink_input *i,
-+ const pa_cvolume_ramp *ramp,
-+ pa_bool_t send_msg,
-+ pa_bool_t save) {
-+
-+ pa_sink_input_assert_ref(i);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+ pa_assert(ramp);
-+
-+ pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate);
-+
-+ pa_log_debug("setting volume ramp with target vol:%d and length:%ld",
-+ i->ramp.ramps[0].target,
-+ i->ramp.ramps[0].length);
-+
-+
-+ /* This tells the sink that volume ramp changed */
-+ if (send_msg)
-+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
-+ NULL, 0, NULL) == 0);
-+}
-+
- /* Called from main context */
- static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) {
- pa_sink_input_assert_ref(i);
-@@ -1932,6 +1986,13 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t
- }
- return 0;
-
-+ case PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP:
-+ /* we have ongoing ramp where we take current start values */
-+ pa_cvolume_ramp_start_from(&i->thread_info.ramp, &i->ramp);
-+ i->thread_info.ramp = i->ramp;
-+ pa_sink_input_request_rewind(i, 0, true, false, false);
-+ return 0;
-+
- case PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE:
- if (i->thread_info.muted != i->muted) {
- i->thread_info.muted = i->muted;
-diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
-index 86deab2..6e1b211 100644
---- a/src/pulsecore/sink-input.h
-+++ b/src/pulsecore/sink-input.h
-@@ -32,6 +32,7 @@
- #include <pulsecore/client.h>
- #include <pulsecore/sink.h>
- #include <pulsecore/core.h>
-+#include <pulsecore/mix.h>
-
- typedef enum pa_sink_input_state {
- PA_SINK_INPUT_INIT, /*< The stream is not active yet, because pa_sink_input_put() has not been called yet */
-@@ -58,7 +59,8 @@ typedef enum pa_sink_input_flags {
- PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND = 256,
- PA_SINK_INPUT_NO_CREATE_ON_SUSPEND = 512,
- PA_SINK_INPUT_KILL_ON_SUSPEND = 1024,
-- PA_SINK_INPUT_PASSTHROUGH = 2048
-+ PA_SINK_INPUT_PASSTHROUGH = 2048,
-+ PA_SINK_INPUT_START_RAMP_MUTED = 4096,
- } pa_sink_input_flags_t;
-
- struct pa_sink_input {
-@@ -121,6 +123,9 @@ struct pa_sink_input {
- * this.*/
- bool save_sink:1, save_volume:1, save_muted:1;
-
-+ /* for volume ramps */
-+ pa_cvolume_ramp_int ramp;
-+
- pa_resample_method_t requested_resample_method, actual_resample_method;
-
- /* Returns the chunk of audio data and drops it from the
-@@ -249,6 +254,8 @@ struct pa_sink_input {
- pa_usec_t requested_sink_latency;
-
- pa_hashmap *direct_outputs;
-+
-+ pa_cvolume_ramp_int ramp;
- } thread_info;
-
- void *userdata;
-@@ -265,6 +272,7 @@ enum {
- PA_SINK_INPUT_MESSAGE_SET_STATE,
- PA_SINK_INPUT_MESSAGE_SET_REQUESTED_LATENCY,
- PA_SINK_INPUT_MESSAGE_GET_REQUESTED_LATENCY,
-+ PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
- PA_SINK_INPUT_MESSAGE_MAX
- };
-
-@@ -370,6 +378,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s
- void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor);
- int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
- pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute);
-+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save);
-
- void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);
-
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch
deleted file mode 100644
index 64d7b141d..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0004-sink-input-Code-cleanup-regarding-volume-ramping.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 49d8943b151a73be3dd726561a720c0f4bfdccac Mon Sep 17 00:00:00 2001
-From: Sangchul Lee <sangchul1011@gmail.com>
-Date: Sat, 27 Aug 2016 21:33:18 +0900
-Subject: [PATCH 4/6] sink-input: Code cleanup regarding volume ramping
-
-Remove unused parameter of pa_sink_input_set_volume_ramp().
-Use bool instead of pa_bool_t.
-
-Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
----
- src/pulsecore/sink-input.c | 7 ++-----
- src/pulsecore/sink-input.h | 2 +-
- 2 files changed, 3 insertions(+), 6 deletions(-)
-
-diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
-index cc8953f..e1968e0 100644
---- a/src/pulsecore/sink-input.c
-+++ b/src/pulsecore/sink-input.c
-@@ -931,7 +931,6 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
- pa_memchunk wchunk;
- bool nvfs = need_volume_factor_sink;
- pa_cvolume target;
-- pa_bool_t tmp;
-
- wchunk = tchunk;
- pa_memblock_ref(wchunk.memblock);
-@@ -972,7 +971,7 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa
- if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
- pa_memchunk_make_writable(&wchunk, 0);
- pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp));
-- } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
-+ } else if ((pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
- pa_memchunk_make_writable(&wchunk, 0);
- pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
- pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target);
-@@ -1372,9 +1371,7 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) {
- void pa_sink_input_set_volume_ramp(
- pa_sink_input *i,
- const pa_cvolume_ramp *ramp,
-- pa_bool_t send_msg,
-- pa_bool_t save) {
--
-+ bool send_msg) {
- pa_sink_input_assert_ref(i);
- pa_assert_ctl_context();
- pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
-index 6e1b211..92f61c3 100644
---- a/src/pulsecore/sink-input.h
-+++ b/src/pulsecore/sink-input.h
-@@ -378,7 +378,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s
- void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor);
- int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
- pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute);
--void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save);
-+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg);
-
- void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);
-
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch
deleted file mode 100644
index e371b7ec5..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-From a98e78ccc4f12d6efad2832a09202651e2a8b6cd Mon Sep 17 00:00:00 2001
-From: Sangchul Lee <sangchul1011@gmail.com>
-Date: Sat, 27 Aug 2016 21:33:19 +0900
-Subject: [PATCH 5/6] sink-input, volume: Add support for volume ramp factor
-
-Previously, using pa_sink_input_set_volume_ramp() is hard to manage
-if there are several callers. These new volume ramp factor APIs make it
-easy for caller to use and to set more than one volume ramp factor.
-New volume ramp factor will be applied by the multiplication of the other
-ramp factors that have been already set.
-
-APIs are added as below.
- - pa_sink_input_add_volume_ramp_factor()
- - pa_sink_input_remove_volume_ramp_factor()
- - pa_cvolume_ramp_compatible()
- - pa_sw_cvolume_ramp_multiply()
- - pa_cvolume_ramp_valid()
-
-Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
----
- src/map-file | 3 ++
- src/pulse/volume.c | 44 ++++++++++++++++++
- src/pulse/volume.h | 9 ++++
- src/pulsecore/sink-input.c | 108 +++++++++++++++++++++++++++++++++++++++++++++
- src/pulsecore/sink-input.h | 5 +++
- 5 files changed, 169 insertions(+)
-
-diff --git a/src/map-file b/src/map-file
-index ef9b57d..7577c14 100644
---- a/src/map-file
-+++ b/src/map-file
-@@ -142,6 +142,8 @@ pa_cvolume_ramp_equal;
- pa_cvolume_ramp_init;
- pa_cvolume_ramp_set;
- pa_cvolume_ramp_channel_ramp_set;
-+pa_cvolume_ramp_compatible;
-+pa_cvolume_ramp_valid;
- pa_cvolume_remap;
- pa_cvolume_scale;
- pa_cvolume_scale_mask;
-@@ -344,6 +346,7 @@ pa_sw_cvolume_divide_scalar;
- pa_sw_cvolume_multiply;
- pa_sw_cvolume_multiply_scalar;
- pa_sw_cvolume_snprint_dB;
-+pa_sw_cvolume_ramp_multiply;
- pa_sw_volume_divide;
- pa_sw_volume_from_dB;
- pa_sw_volume_from_linear;
-diff --git a/src/pulse/volume.c b/src/pulse/volume.c
-index 85072c1..8d99150 100644
---- a/src/pulse/volume.c
-+++ b/src/pulse/volume.c
-@@ -1049,3 +1049,47 @@ pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigne
-
- return ramp;
- }
-+
-+int pa_cvolume_ramp_compatible(const pa_cvolume_ramp *ramp, const pa_sample_spec *ss) {
-+
-+ pa_assert(ramp);
-+ pa_assert(ss);
-+
-+ pa_return_val_if_fail(pa_cvolume_ramp_valid(ramp), 0);
-+ pa_return_val_if_fail(pa_sample_spec_valid(ss), 0);
-+
-+ return ramp->channels == ss->channels;
-+}
-+
-+pa_cvolume_ramp *pa_sw_cvolume_ramp_multiply(pa_cvolume_ramp *dest, const pa_cvolume_ramp *a, const pa_cvolume_ramp *b) {
-+ unsigned i;
-+
-+ pa_assert(dest);
-+ pa_assert(a);
-+ pa_assert(b);
-+
-+ pa_return_val_if_fail(pa_cvolume_ramp_valid(a), NULL);
-+ pa_return_val_if_fail(pa_cvolume_ramp_valid(b), NULL);
-+
-+ for (i = 0; i < a->channels && i < b->channels; i++)
-+ dest->ramps[i].target = pa_sw_volume_multiply(a->ramps[i].target, b->ramps[i].target);
-+
-+ dest->channels = (uint8_t) i;
-+
-+ return dest;
-+}
-+
-+int pa_cvolume_ramp_valid(const pa_cvolume_ramp *ramp) {
-+ unsigned c;
-+
-+ pa_assert(ramp);
-+
-+ if (!pa_channels_valid(ramp->channels))
-+ return 0;
-+
-+ for (c = 0; c < ramp->channels; c++)
-+ if (!PA_VOLUME_IS_VALID(ramp->ramps[c].target))
-+ return 0;
-+
-+ return 1;
-+}
-diff --git a/src/pulse/volume.h b/src/pulse/volume.h
-index 2ae3451..65fcb08 100644
---- a/src/pulse/volume.h
-+++ b/src/pulse/volume.h
-@@ -458,12 +458,21 @@ int pa_cvolume_ramp_equal(const pa_cvolume_ramp *a, const pa_cvolume_ramp *b);
- /** Init volume ramp struct */
- pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp);
-
-+/** Set the volume ramp of the first n channels to PA_VOLUME_NORM */
-+#define pa_cvolume_ramp_reset(a, n, t, l) pa_cvolume_ramp_set((a), (n), (t), (l), PA_VOLUME_NORM)
-+
- /** Set first n channels of ramp struct to certain value */
- pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-
- /** Set individual channel in the channel struct */
- pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-
-+int pa_cvolume_ramp_compatible(const pa_cvolume_ramp *ramp, const pa_sample_spec *ss);
-+
-+int pa_cvolume_ramp_valid(const pa_cvolume_ramp *ramp);
-+
-+pa_cvolume_ramp *pa_sw_cvolume_ramp_multiply(pa_cvolume_ramp *dest, const pa_cvolume_ramp *a, const pa_cvolume_ramp *b);
-+
- PA_C_DECL_END
-
- #endif
-diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
-index e1968e0..6f89aa1 100644
---- a/src/pulsecore/sink-input.c
-+++ b/src/pulsecore/sink-input.c
-@@ -53,6 +53,11 @@ struct volume_factor_entry {
- pa_cvolume volume;
- };
-
-+struct volume_ramp_factor_entry {
-+ char *key;
-+ pa_cvolume_ramp ramp;
-+};
-+
- static struct volume_factor_entry *volume_factor_entry_new(const char *key, const pa_cvolume *volume) {
- struct volume_factor_entry *entry;
-
-@@ -83,6 +88,37 @@ static void volume_factor_from_hashmap(pa_cvolume *v, pa_hashmap *items, uint8_t
- pa_sw_cvolume_multiply(v, v, &entry->volume);
- }
-
-+static struct volume_ramp_factor_entry *volume_ramp_factor_entry_new(const char *key, const pa_cvolume_ramp *ramp) {
-+ struct volume_ramp_factor_entry *entry;
-+
-+ pa_assert(key);
-+ pa_assert(ramp);
-+
-+ entry = pa_xnew(struct volume_ramp_factor_entry, 1);
-+ entry->key = pa_xstrdup(key);
-+
-+ entry->ramp = *ramp;
-+
-+ return entry;
-+}
-+
-+static void volume_ramp_factor_entry_free(struct volume_ramp_factor_entry *ramp_entry) {
-+ pa_assert(ramp_entry);
-+
-+ pa_xfree(ramp_entry->key);
-+ pa_xfree(ramp_entry);
-+}
-+
-+static void volume_ramp_factor_from_hashmap(pa_cvolume_ramp *r, pa_hashmap *items, uint8_t channels, pa_volume_ramp_type_t type, long length) {
-+ struct volume_ramp_factor_entry *entry;
-+ void *state = NULL;
-+
-+ pa_cvolume_ramp_reset(r, channels, type, length);
-+ PA_HASHMAP_FOREACH(entry, items, state)
-+ pa_sw_cvolume_ramp_multiply(r, r, &entry->ramp);
-+
-+}
-+
- static void sink_input_free(pa_object *o);
- static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v);
-
-@@ -500,6 +536,8 @@ int pa_sink_input_new(
- i->volume_factor_sink_items = data->volume_factor_sink_items;
- data->volume_factor_sink_items = NULL;
- volume_factor_from_hashmap(&i->volume_factor_sink, i->volume_factor_sink_items, i->sink->sample_spec.channels);
-+ i->ramp_factor_items = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL,
-+ (pa_free_cb_t) volume_ramp_factor_entry_free);
-
- i->real_ratio = i->reference_ratio = data->volume;
- pa_cvolume_reset(&i->soft_volume, i->sample_spec.channels);
-@@ -764,6 +802,9 @@ static void sink_input_free(pa_object *o) {
- if (i->volume_factor_sink_items)
- pa_hashmap_free(i->volume_factor_sink_items);
-
-+ if (i->ramp_factor_items)
-+ pa_hashmap_free(i->ramp_factor_items);
-+
- pa_xfree(i->driver);
- pa_xfree(i);
- }
-@@ -1367,6 +1408,73 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key) {
- return 0;
- }
-
-+void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg) {
-+ struct volume_ramp_factor_entry *r;
-+
-+ pa_sink_input_assert_ref(i);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+ pa_assert(ramp_factor);
-+ pa_assert(key);
-+ pa_assert(pa_cvolume_ramp_valid(ramp_factor));
-+ pa_assert(ramp_factor->channels == 1 || pa_cvolume_ramp_compatible(ramp_factor, &i->sample_spec));
-+
-+ r = volume_ramp_factor_entry_new(key, ramp_factor);
-+ if (!pa_cvolume_ramp_compatible(ramp_factor, &i->sample_spec))
-+ pa_cvolume_ramp_set(&r->ramp, i->sample_spec.channels, ramp_factor->ramps[0].type, ramp_factor->ramps[0].length, ramp_factor->ramps[0].target);
-+
-+ pa_assert_se(pa_hashmap_put(i->ramp_factor_items, r->key, r) >= 0);
-+ if (pa_hashmap_size(i->ramp_factor_items) == 1)
-+ pa_cvolume_ramp_set(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length, r->ramp.ramps[0].target);
-+ else
-+ pa_sw_cvolume_ramp_multiply(&i->ramp_factor, &i->ramp_factor, &r->ramp);
-+
-+ pa_cvolume_ramp_convert(&i->ramp_factor, &i->ramp, i->sample_spec.rate);
-+
-+ if (send_msg)
-+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, NULL, 0, NULL) == 0);
-+
-+ return 0;
-+}
-+
-+/* Returns 0 if an entry was removed and -1 if no entry for the given key was
-+ * found. */
-+int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg) {
-+ struct volume_ramp_factor_entry *r;
-+
-+ pa_sink_input_assert_ref(i);
-+ pa_assert(key);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+
-+ r = pa_hashmap_remove(i->ramp_factor_items, key);
-+ if (!r)
-+ return -1;
-+
-+ switch (pa_hashmap_size(i->ramp_factor_items)) {
-+ case 0:
-+ pa_cvolume_ramp_reset(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length);
-+ break;
-+ case 1: {
-+ struct volume_ramp_factor_entry *rf;
-+ rf = pa_hashmap_first(i->ramp_factor_items);
-+ pa_cvolume_ramp_set(&i->ramp_factor, i->sample_spec.channels, r->ramp.ramps[0].type, r->ramp.ramps[0].length, rf->ramp.ramps[0].target);
-+ break;
-+ }
-+ default:
-+ volume_ramp_factor_from_hashmap(&i->ramp_factor, i->ramp_factor_items, i->ramp_factor.channels, i->ramp_factor.ramps[0].type, i->ramp_factor.ramps[0].length);
-+ }
-+
-+ volume_ramp_factor_entry_free(r);
-+
-+ pa_cvolume_ramp_convert(&i->ramp_factor, &i->ramp, i->sample_spec.rate);
-+
-+ if (send_msg)
-+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP, NULL, 0, NULL) == 0);
-+
-+ return 0;
-+}
-+
- /* Called from main thread */
- void pa_sink_input_set_volume_ramp(
- pa_sink_input *i,
-diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
-index 92f61c3..5430d53 100644
---- a/src/pulsecore/sink-input.h
-+++ b/src/pulsecore/sink-input.h
-@@ -113,6 +113,9 @@ struct pa_sink_input {
- pa_cvolume volume_factor_sink; /* A second volume factor in format of the sink this stream is connected to. */
- pa_hashmap *volume_factor_sink_items;
-
-+ pa_cvolume_ramp ramp_factor;
-+ pa_hashmap *ramp_factor_items;
-+
- bool volume_writable:1;
-
- bool muted:1;
-@@ -379,6 +382,8 @@ void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa
- int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
- pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute);
- void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg);
-+void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg);
-+int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg);
-
- void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);
-
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch
deleted file mode 100644
index 50110bd14..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From ac9a99505fd768b66dd92e9091e80b576cabc00d Mon Sep 17 00:00:00 2001
-From: Sangchul Lee <sangchul1011@gmail.com>
-Date: Sat, 27 Aug 2016 21:33:20 +0900
-Subject: [PATCH 6/6] sink-input: Remove pa_sink_input_set_volume_ramp()
-
-Please use pa_sink_input_add_volume_ramp_factor() or
-pa_sink_input_remove_volume_ramp_factor() instead of it.
-
-Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
----
- src/pulsecore/sink-input.c | 23 -----------------------
- src/pulsecore/sink-input.h | 1 -
- 2 files changed, 24 deletions(-)
-
-diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
-index 6f89aa1..4c7c568 100644
---- a/src/pulsecore/sink-input.c
-+++ b/src/pulsecore/sink-input.c
-@@ -1475,29 +1475,6 @@ int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, b
- return 0;
- }
-
--/* Called from main thread */
--void pa_sink_input_set_volume_ramp(
-- pa_sink_input *i,
-- const pa_cvolume_ramp *ramp,
-- bool send_msg) {
-- pa_sink_input_assert_ref(i);
-- pa_assert_ctl_context();
-- pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-- pa_assert(ramp);
--
-- pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate);
--
-- pa_log_debug("setting volume ramp with target vol:%d and length:%ld",
-- i->ramp.ramps[0].target,
-- i->ramp.ramps[0].length);
--
--
-- /* This tells the sink that volume ramp changed */
-- if (send_msg)
-- pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
-- NULL, 0, NULL) == 0);
--}
--
- /* Called from main context */
- static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) {
- pa_sink_input_assert_ref(i);
-diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
-index 5430d53..5fef3d5 100644
---- a/src/pulsecore/sink-input.h
-+++ b/src/pulsecore/sink-input.h
-@@ -381,7 +381,6 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s
- void pa_sink_input_add_volume_factor(pa_sink_input *i, const char *key, const pa_cvolume *volume_factor);
- int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
- pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute);
--void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg);
- void pa_sink_input_add_volume_ramp_factor(pa_sink_input *i, const char *key, const pa_cvolume_ramp *ramp_factor, bool send_msg);
- int pa_sink_input_remove_volume_ramp_factor(pa_sink_input *i, const char *key, bool send_msg);
-
---
-1.9.1
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/enable-ofono-hfp-backend.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/enable-ofono-hfp-backend.patch
deleted file mode 100644
index 85b1ae03d..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio-9.0/enable-ofono-hfp-backend.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- pulseaudio-9.0/src/daemon/default.pa.in.orig 2017-05-17 17:26:20.415369638 +0000
-+++ pulseaudio-9.0/src/daemon/default.pa.in 2017-05-17 17:26:49.995316383 +0000
-@@ -82,7 +82,7 @@
- .endif
-
- .ifexists module-bluetooth-discover@PA_SOEXT@
--load-module module-bluetooth-discover
-+load-module module-bluetooth-discover headset=ofono
- .endif
- ])dnl
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0008-install-files-for-a-module-development.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0008-install-files-for-a-module-development.patch
deleted file mode 100644
index ac164d643..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0008-install-files-for-a-module-development.patch
+++ /dev/null
@@ -1,53 +0,0 @@
---- a/Makefile.am 2016-04-12 11:28:10.832997230 +0200
-+++ b/Makefile.am 2016-04-12 11:32:41.868996777 +0200
-@@ -49,7 +49,13 @@
- vala/libpulse-simple.deps vala/libpulse-simple.vapi
-
- pkgconfigdir = $(libdir)/pkgconfig
--pkgconfig_DATA = libpulse.pc libpulse-simple.pc
-+pkgconfig_DATA = libpulse.pc libpulse-simple.pc pulseaudio-module-devel.pc
-+
-+moduledev_DATA = pulsecore-config.h $(top_srcdir)/src/pulsecore/*.h
-+moduledevdir = $(includedir)/pulsemodule/pulsecore
-+
-+moduledevinternal_DATA = src/pulse/internal.h src/pulse/client-conf.h src/pulse/fork-detect.h
-+moduledevinternaldir = $(includedir)/pulsemodule/pulse
-
- if HAVE_GLIB20
- pkgconfig_DATA += \
-@@ -103,6 +109,9 @@
- check-daemon:
- $(MAKE) -C src check-daemon
-
-+pulsecore-config.h: config.h
-+ cp $< $@
-+
- .PHONY: homepage distcleancheck doxygen
-
- # see git-version-gen
---- a/configure.ac 2016-04-12 11:34:10.605996629 +0200
-+++ b/configure.ac 2016-04-12 11:37:43.502996274 +0200
-@@ -1464,6 +1464,7 @@
- man/default.pa.5.xml
- man/pulse-cli-syntax.5.xml
- man/start-pulseaudio-x11.1.xml
-+pulseaudio-module-devel.pc
- ])
-
- AC_CONFIG_FILES([src/esdcompat:src/daemon/esdcompat.in], [chmod +x src/esdcompat])
---- /dev/null 2016-03-15 16:08:23.302999643 +0100
-+++ b/pulseaudio-module-devel.pc.in 2016-03-17 16:16:58.427977484 +0100
-@@ -0,0 +1,12 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+modlibexecdir=@modlibexecdir@
-+
-+Name: pulseaudio-module-devel
-+Description: PulseAudio Module Development Interface
-+Version: @PACKAGE_VERSION@
-+Libs: -L${libdir} -L${libdir}/pulseaudio -L${modlibexecdir} -lpulsecommon-@PA_MAJORMINOR@ -lpulsecore-@PA_MAJORMINOR@ -lprotocol-native
-+Libs.private:
-+Cflags: -I${includedir}/pulsemodule -D_REENTRANT
-
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0010-volume-ramp-additions-to-the-low-level-infra.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0010-volume-ramp-additions-to-the-low-level-infra.patch
deleted file mode 100644
index e249bc438..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0010-volume-ramp-additions-to-the-low-level-infra.patch
+++ /dev/null
@@ -1,503 +0,0 @@
---- a/src/map-file 2016-04-12 15:03:17.009975690 +0200
-+++ b/src/map-file 2016-04-12 15:03:52.389975631 +0200
-@@ -136,6 +136,9 @@
- pa_cvolume_merge;
- pa_cvolume_min;
- pa_cvolume_min_mask;
-+pa_cvolume_ramp_init;
-+pa_cvolume_ramp_set;
-+pa_cvolume_ramp_channel_ramp_set;
- pa_cvolume_remap;
- pa_cvolume_scale;
- pa_cvolume_scale_mask;
---- a/src/pulse/def.h 2016-04-12 15:05:58.245975421 +0200
-+++ b/src/pulse/def.h 2016-04-12 15:13:19.424974685 +0200
-@@ -347,11 +347,15 @@
- * consider absolute when the sink is in flat volume mode,
- * relative otherwise. \since 0.9.20 */
-
-- PA_STREAM_PASSTHROUGH = 0x80000U
-+ PA_STREAM_PASSTHROUGH = 0x80000U,
- /**< Used to tag content that will be rendered by passthrough sinks.
- * The data will be left as is and not reformatted, resampled.
- * \since 1.0 */
-
-+ PA_STREAM_START_RAMP_MUTED = 0x100000U
-+ /**< Used to tag content that the stream will be started ramp volume
-+ * muted so that you can nicely fade it in */
-+
- } pa_stream_flags_t;
-
- /** \cond fulldocs */
-@@ -380,6 +384,7 @@
- #define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
- #define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
- #define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH
-+#define PA_STREAM_START_RAMP_MUTED PA_STREAM_START_RAMP_MUTED
-
- /** \endcond */
-
-@@ -1047,6 +1052,13 @@
- /** \endcond */
- #endif
-
-+/** \cond fulldocs */
-+#define PA_VOLUMER_RAMP_TYPE_LINEAR PA_VOLUMER_RAMP_TYPE_LINEAR
-+#define PA_VOLUMER_RAMP_TYPE_LOGARITHMIC PA_VOLUMER_RAMP_TYPE_LOGARITHMIC
-+#define PA_VOLUMER_RAMP_TYPE_CUBIC PA_VOLUMER_RAMP_TYPE_CUBIC
-+
-+/** \endcond */
-+
- PA_C_DECL_END
-
- #endif
---- a/src/pulse/volume.c 2016-04-12 15:13:38.598974653 +0200
-+++ b/src/pulse/volume.c 2016-04-12 15:27:57.729973219 +0200
-@@ -445,7 +445,10 @@
- unsigned c;
- pa_assert(a);
-
-- pa_return_val_if_fail(pa_cvolume_valid(a), 0);
-+ if (pa_cvolume_valid(a) == 0)
-+ abort();
-+
-+ /* pa_return_val_if_fail(pa_cvolume_valid(a), 0); */
- pa_return_val_if_fail(PA_VOLUME_IS_VALID(v), 0);
-
- for (c = 0; c < a->channels; c++)
-@@ -986,3 +989,51 @@
-
- return pa_cvolume_scale(v, m);
- }
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp) {
-+ unsigned c;
-+
-+ pa_assert(ramp);
-+
-+ ramp->channels = 0;
-+
-+ for (c = 0; c < PA_CHANNELS_MAX; c++) {
-+ ramp->ramps[c].type = PA_VOLUME_RAMP_TYPE_LINEAR;
-+ ramp->ramps[c].length = 0;
-+ ramp->ramps[c].target = PA_VOLUME_INVALID;
-+ }
-+
-+ return ramp;
-+}
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channels, pa_volume_ramp_type_t type, long time, pa_volume_t vol) {
-+ int i;
-+
-+ pa_assert(ramp);
-+ pa_assert(channels > 0);
-+ pa_assert(time >= 0);
-+ pa_assert(channels <= PA_CHANNELS_MAX);
-+
-+ ramp->channels = (uint8_t) channels;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ ramp->ramps[i].type = type;
-+ ramp->ramps[i].length = time;
-+ ramp->ramps[i].target = PA_CLAMP_VOLUME(vol);
-+ }
-+
-+ return ramp;
-+}
-+
-+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol) {
-+
-+ pa_assert(ramp);
-+ pa_assert(channel <= ramp->channels);
-+ pa_assert(time >= 0);
-+
-+ ramp->ramps[channel].type = type;
-+ ramp->ramps[channel].length = time;
-+ ramp->ramps[channel].target = PA_CLAMP_VOLUME(vol);
-+
-+ return ramp;
-+}
---- a/src/pulse/volume.h 2016-04-12 15:40:34.989971955 +0200
-+++ b/src/pulse/volume.h 2016-04-12 15:38:50.708972129 +0200
-@@ -413,6 +413,36 @@
- * the channels are kept. \since 0.9.16 */
- pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec);
-
-+/** Volume ramp type
-+*/
-+typedef enum pa_volume_ramp_type {
-+ PA_VOLUME_RAMP_TYPE_LINEAR = 0, /**< linear */
-+ PA_VOLUME_RAMP_TYPE_LOGARITHMIC = 1, /**< logarithmic */
-+ PA_VOLUME_RAMP_TYPE_CUBIC = 2,
-+} pa_volume_ramp_type_t;
-+
-+/** A structure encapsulating a volume ramp */
-+typedef struct pa_volume_ramp_t {
-+ pa_volume_ramp_type_t type;
-+ long length;
-+ pa_volume_t target;
-+} pa_volume_ramp_t;
-+
-+/** A structure encapsulating a multichannel volume ramp */
-+typedef struct pam_cvolume_ramp {
-+ uint8_t channels;
-+ pa_volume_ramp_t ramps[PA_CHANNELS_MAX];
-+} pa_cvolume_ramp;
-+
-+/** Init volume ramp struct */
-+pa_cvolume_ramp* pa_cvolume_ramp_init(pa_cvolume_ramp *ramp);
-+
-+/** Set first n channels of ramp struct to certain value */
-+pa_cvolume_ramp* pa_cvolume_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-+
-+/** Set individual channel in the channel struct */
-+pa_cvolume_ramp* pa_cvolume_ramp_channel_ramp_set(pa_cvolume_ramp *ramp, unsigned channel, pa_volume_ramp_type_t type, long time, pa_volume_t vol);
-+
- PA_C_DECL_END
-
- #endif
---- a/src/pulsecore/sample-util.c 2016-04-12 15:41:51.812971827 +0200
-+++ b/src/pulsecore/sample-util.c 2016-04-12 16:31:56.795966812 +0200
-@@ -41,6 +41,13 @@
-
- #define PA_SILENCE_MAX (PA_PAGE_SIZE*16)
-
-+#define VOLUME_PADDING 32
-+
-+typedef union {
-+ float f;
-+ uint32_t i;
-+} volume_val;
-+
- pa_memblock *pa_silence_memblock(pa_memblock* b, const pa_sample_spec *spec) {
- void *data;
-
-@@ -403,3 +410,292 @@
- usec = pa_bytes_to_usec_round_up(size, from);
- return pa_usec_to_bytes_round_up(usec, to);
- }
-+
-+static void calc_linear_integer_volume_no_mapping(int32_t linear[], float volume[], unsigned nchannels) {
-+ unsigned channel, padding;
-+
-+ pa_assert(linear);
-+ pa_assert(volume);
-+
-+ for (channel = 0; channel < nchannels; channel++)
-+ linear[channel] = (int32_t) lrint(volume[channel] * 0x10000U);
-+
-+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++)
-+ linear[channel] = linear[padding];
-+}
-+
-+static void calc_linear_float_volume_no_mapping(float linear[], float volume[], unsigned nchannels) {
-+ unsigned channel, padding;
-+
-+ pa_assert(linear);
-+ pa_assert(volume);
-+
-+ for (channel = 0; channel < nchannels; channel++)
-+ linear[channel] = volume[channel];
-+
-+ for (padding = 0; padding < VOLUME_PADDING; padding++, channel++)
-+ linear[channel] = linear[padding];
-+}
-+
-+typedef void (*pa_calc_volume_no_mapping_func_t) (void *volumes, float *volume, int channels);
-+
-+static const pa_calc_volume_no_mapping_func_t calc_volume_table_no_mapping[] = {
-+ [PA_SAMPLE_U8] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_ALAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_ULAW] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S16LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S16BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_FLOAT32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping,
-+ [PA_SAMPLE_FLOAT32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_float_volume_no_mapping,
-+ [PA_SAMPLE_S32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24_32LE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping,
-+ [PA_SAMPLE_S24_32BE] = (pa_calc_volume_no_mapping_func_t) calc_linear_integer_volume_no_mapping
-+};
-+
-+static const unsigned format_sample_size_table[] = {
-+ [PA_SAMPLE_U8] = 1,
-+ [PA_SAMPLE_ALAW] = 1,
-+ [PA_SAMPLE_ULAW] = 1,
-+ [PA_SAMPLE_S16LE] = 2,
-+ [PA_SAMPLE_S16BE] = 2,
-+ [PA_SAMPLE_FLOAT32LE] = 4,
-+ [PA_SAMPLE_FLOAT32BE] = 4,
-+ [PA_SAMPLE_S32LE] = 4,
-+ [PA_SAMPLE_S32BE] = 4,
-+ [PA_SAMPLE_S24LE] = 3,
-+ [PA_SAMPLE_S24BE] = 3,
-+ [PA_SAMPLE_S24_32LE] = 4,
-+ [PA_SAMPLE_S24_32BE] = 4
-+};
-+
-+static float calc_volume_ramp_linear(pa_volume_ramp_int_t *ramp) {
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ /* basic linear interpolation */
-+ return ramp->start + (ramp->length - ramp->left) * (ramp->end - ramp->start) / (float) ramp->length;
-+}
-+
-+static float calc_volume_ramp_logarithmic(pa_volume_ramp_int_t *ramp) {
-+ float x_val, s, e;
-+ long temp;
-+
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ if (ramp->end > ramp->start) {
-+ temp = ramp->left;
-+ s = ramp->end;
-+ e = ramp->start;
-+ } else {
-+ temp = ramp->length - ramp->left;
-+ s = ramp->start;
-+ e = ramp->end;
-+ }
-+
-+ x_val = temp == 0 ? 0.0 : powf(temp, 10);
-+
-+ /* base 10 logarithmic interpolation */
-+ return s + x_val * (e - s) / powf(ramp->length, 10);
-+}
-+
-+static float calc_volume_ramp_cubic(pa_volume_ramp_int_t *ramp) {
-+ float x_val, s, e;
-+ long temp;
-+
-+ pa_assert(ramp);
-+ pa_assert(ramp->length > 0);
-+
-+ if (ramp->end > ramp->start) {
-+ temp = ramp->left;
-+ s = ramp->end;
-+ e = ramp->start;
-+ } else {
-+ temp = ramp->length - ramp->left;
-+ s = ramp->start;
-+ e = ramp->end;
-+ }
-+
-+ x_val = temp == 0 ? 0.0 : cbrtf(temp);
-+
-+ /* cubic interpolation */
-+ return s + x_val * (e - s) / cbrtf(ramp->length);
-+}
-+
-+typedef float (*pa_calc_volume_ramp_func_t) (pa_volume_ramp_int_t *);
-+
-+static const pa_calc_volume_ramp_func_t calc_volume_ramp_table[] = {
-+ [PA_VOLUME_RAMP_TYPE_LINEAR] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_linear,
-+ [PA_VOLUME_RAMP_TYPE_LOGARITHMIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_logarithmic,
-+ [PA_VOLUME_RAMP_TYPE_CUBIC] = (pa_calc_volume_ramp_func_t) calc_volume_ramp_cubic
-+};
-+
-+static void calc_volume_ramps(pa_cvolume_ramp_int *ram, float *vol)
-+{
-+ int i;
-+
-+ for (i = 0; i < ram->channels; i++) {
-+ if (ram->ramps[i].left <= 0) {
-+ if (ram->ramps[i].target == PA_VOLUME_NORM) {
-+ vol[i] = 1.0;
-+ }
-+ } else {
-+ vol[i] = ram->ramps[i].curr = calc_volume_ramp_table[ram->ramps[i].type] (&ram->ramps[i]);
-+ ram->ramps[i].left--;
-+ }
-+ }
-+}
-+
-+void pa_volume_ramp_memchunk(
-+ pa_memchunk *c,
-+ const pa_sample_spec *spec,
-+ pa_cvolume_ramp_int *ramp) {
-+
-+ void *ptr;
-+ volume_val linear[PA_CHANNELS_MAX + VOLUME_PADDING];
-+ float vol[PA_CHANNELS_MAX + VOLUME_PADDING];
-+ pa_do_volume_func_t do_volume;
-+ long length_in_frames;
-+ int i;
-+
-+ pa_assert(c);
-+ pa_assert(spec);
-+ pa_assert(pa_frame_aligned(c->length, spec));
-+ pa_assert(ramp);
-+
-+ length_in_frames = c->length / format_sample_size_table[spec->format] / spec->channels;
-+
-+ if (pa_memblock_is_silence(c->memblock)) {
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].length > 0)
-+ ramp->ramps[i].length -= length_in_frames;
-+ }
-+ return;
-+ }
-+
-+ if (spec->format < 0 || spec->format >= PA_SAMPLE_MAX) {
-+ pa_log_warn("Unable to change volume of format");
-+ return;
-+ }
-+
-+ do_volume = pa_get_volume_func(spec->format);
-+ pa_assert(do_volume);
-+
-+ ptr = (uint8_t*) pa_memblock_acquire(c->memblock) + c->index;
-+
-+ for (i = 0; i < length_in_frames; i++) {
-+ calc_volume_ramps(ramp, vol);
-+ calc_volume_table_no_mapping[spec->format] ((void *)linear, vol, spec->channels);
-+
-+ /* we only process one frame per iteration */
-+ do_volume (ptr, (void *)linear, spec->channels, format_sample_size_table[spec->format] * spec->channels);
-+
-+ /* pa_log_debug("1: %d 2: %d", linear[0], linear[1]); */
-+
-+ ptr = (uint8_t*)ptr + format_sample_size_table[spec->format] * spec->channels;
-+ }
-+
-+ pa_memblock_release(c->memblock);
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate) {
-+ int i;
-+ float temp;
-+
-+ for (i = 0; i < dst->channels; i++) {
-+ dst->ramps[i].type = src->ramps[i].type;
-+ /* ms to samples */
-+ dst->ramps[i].length = src->ramps[i].length * sample_rate / 1000;
-+ dst->ramps[i].left = dst->ramps[i].length;
-+ dst->ramps[i].start = dst->ramps[i].end;
-+ dst->ramps[i].target = src->ramps[i].target;
-+ /* scale to pulse internal mapping so that when ramp is over there's no glitch in volume */
-+ temp = src->ramps[i].target / (float)0x10000U;
-+ dst->ramps[i].end = temp * temp * temp;
-+ }
-+
-+ return dst;
-+}
-+
-+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp) {
-+ int i;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].left > 0)
-+ return true;
-+ }
-+
-+ return false;
-+}
-+
-+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp) {
-+ int i;
-+
-+ for (i = 0; i < ramp->channels; i++) {
-+ if (ramp->ramps[i].target != PA_VOLUME_NORM)
-+ return true;
-+ }
-+
-+ return false;
-+}
-+
-+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume) {
-+ int i = 0;
-+
-+ volume->channels = ramp->channels;
-+
-+ for (i = 0; i < ramp->channels; i++)
-+ volume->values[i] = ramp->ramps[i].target;
-+
-+ return volume;
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst) {
-+ int i;
-+
-+ for (i = 0; i < src->channels; i++) {
-+ /* if new vols are invalid, copy old ramp i.e. no effect */
-+ if (dst->ramps[i].target == PA_VOLUME_INVALID)
-+ dst->ramps[i] = src->ramps[i];
-+ /* if there's some old ramp still left */
-+ else if (src->ramps[i].left > 0)
-+ dst->ramps[i].start = src->ramps[i].curr;
-+ }
-+
-+ return dst;
-+}
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels) {
-+ int i;
-+ float temp;
-+
-+ src->channels = channels;
-+
-+ for (i = 0; i < channels; i++) {
-+ src->ramps[i].type = PA_VOLUME_RAMP_TYPE_LINEAR;
-+ src->ramps[i].length = 0;
-+ src->ramps[i].left = 0;
-+ if (vol == PA_VOLUME_NORM) {
-+ src->ramps[i].start = 1.0;
-+ src->ramps[i].end = 1.0;
-+ src->ramps[i].curr = 1.0;
-+ }
-+ else if (vol == PA_VOLUME_MUTED) {
-+ src->ramps[i].start = 0.0;
-+ src->ramps[i].end = 0.0;
-+ src->ramps[i].curr = 0.0;
-+ }
-+ else {
-+ temp = vol / (float)0x10000U;
-+ src->ramps[i].start = temp * temp * temp;
-+ src->ramps[i].end = src->ramps[i].start;
-+ src->ramps[i].curr = src->ramps[i].start;
-+ }
-+ src->ramps[i].target = vol;
-+ }
-+
-+ return src;
-+}
---- a/src/pulsecore/sample-util.h 2016-04-12 15:53:06.327970701 +0200
-+++ b/src/pulsecore/sample-util.h 2016-04-12 16:24:16.356967580 +0200
-@@ -45,6 +45,33 @@
-
- pa_memchunk* pa_silence_memchunk_get(pa_silence_cache *cache, pa_mempool *pool, pa_memchunk* ret, const pa_sample_spec *spec, size_t length);
-
-+typedef struct pa_volume_ramp_int_t {
-+ pa_volume_ramp_type_t type;
-+ long length;
-+ long left;
-+ float start;
-+ float end;
-+ float curr;
-+ pa_volume_t target;
-+} pa_volume_ramp_int_t;
-+
-+typedef struct pa_cvolume_ramp_int {
-+ uint8_t channels;
-+ pa_volume_ramp_int_t ramps[PA_CHANNELS_MAX];
-+} pa_cvolume_ramp_int;
-+
-+pa_cvolume_ramp_int* pa_cvolume_ramp_convert(const pa_cvolume_ramp *src, pa_cvolume_ramp_int *dst, int sample_rate);
-+bool pa_cvolume_ramp_active(pa_cvolume_ramp_int *ramp);
-+bool pa_cvolume_ramp_target_active(pa_cvolume_ramp_int *ramp);
-+pa_cvolume_ramp_int* pa_cvolume_ramp_start_from(pa_cvolume_ramp_int *src, pa_cvolume_ramp_int *dst);
-+pa_cvolume_ramp_int* pa_cvolume_ramp_int_init(pa_cvolume_ramp_int *src, pa_volume_t vol, int channels);
-+pa_cvolume * pa_cvolume_ramp_get_targets(pa_cvolume_ramp_int *ramp, pa_cvolume *volume);
-+
-+void pa_volume_ramp_memchunk(
-+ pa_memchunk *c,
-+ const pa_sample_spec *spec,
-+ pa_cvolume_ramp_int *ramp);
-+
- size_t pa_frame_align(size_t l, const pa_sample_spec *ss) PA_GCC_PURE;
-
- bool pa_frame_aligned(size_t l, const pa_sample_spec *ss) PA_GCC_PURE;
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0011-volume-ramp-adding-volume-ramping-to-sink-input.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0011-volume-ramp-adding-volume-ramping-to-sink-input.patch
deleted file mode 100644
index 08fb79248..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0011-volume-ramp-adding-volume-ramping-to-sink-input.patch
+++ /dev/null
@@ -1,159 +0,0 @@
---- a/src/pulsecore/sink-input.c 2016-04-12 16:50:41.311964935 +0200
-+++ b/src/pulsecore/sink-input.c 2016-04-12 17:22:40.420961732 +0200
-@@ -525,6 +525,11 @@
- reset_callbacks(i);
- i->userdata = NULL;
-
-+ if (data->flags & PA_SINK_INPUT_START_RAMP_MUTED)
-+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_MUTED, data->sample_spec.channels);
-+ else
-+ pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_NORM, data->sample_spec.channels);
-+
- i->thread_info.state = i->state;
- i->thread_info.attached = false;
- pa_atomic_store(&i->thread_info.drained, 1);
-@@ -541,6 +546,8 @@
- i->thread_info.playing_for = 0;
- i->thread_info.direct_outputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
-
-+ i->thread_info.ramp = i->ramp;
-+
- pa_assert_se(pa_idxset_put(core->sink_inputs, i, &i->index) == 0);
- pa_assert_se(pa_idxset_put(i->sink->inputs, pa_sink_input_ref(i), NULL) == 0);
-
-@@ -922,6 +929,8 @@
- while (tchunk.length > 0) {
- pa_memchunk wchunk;
- bool nvfs = need_volume_factor_sink;
-+ pa_cvolume target;
-+ bool tmp;
-
- wchunk = tchunk;
- pa_memblock_ref(wchunk.memblock);
-@@ -958,6 +967,16 @@
- pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
-+ /* check for possible volume ramp */
-+ if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp));
-+ } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
-+ pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target);
-+ }
-+
- pa_memblockq_push_align(i->thread_info.render_memblockq, &wchunk);
- } else {
- pa_memchunk rchunk;
-@@ -974,6 +993,16 @@
- pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
-+ /* check for possible volume ramp */
-+ if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_volume_ramp_memchunk(&wchunk, &i->sink->sample_spec, &(i->thread_info.ramp));
-+ } else if ((tmp = pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
-+ pa_memchunk_make_writable(&wchunk, 0);
-+ pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
-+ pa_volume_memchunk(&wchunk, &i->sink->sample_spec, &target);
-+ }
-+
- pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
- pa_memblock_unref(rchunk.memblock);
- }
-@@ -1338,6 +1367,31 @@
- return 0;
- }
-
-+/* Called from main thread */
-+void pa_sink_input_set_volume_ramp(
-+ pa_sink_input *i,
-+ const pa_cvolume_ramp *ramp,
-+ bool send_msg,
-+ bool save) {
-+
-+ pa_sink_input_assert_ref(i);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+ pa_assert(ramp);
-+
-+ pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate);
-+
-+ pa_log_debug("setting volume ramp with target vol:%d and length:%ld",
-+ i->ramp.ramps[0].target,
-+ i->ramp.ramps[0].length);
-+
-+
-+ /* This tells the sink that volume ramp changed */
-+ if (send_msg)
-+ pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
-+ NULL, 0, NULL) == 0);
-+}
-+
- /* Called from main context */
- static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) {
- pa_sink_input_assert_ref(i);
-@@ -1929,6 +1983,12 @@
- }
- return 0;
-
-+ case PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP:
-+ /* we have ongoing ramp where we take current start values */
-+ pa_cvolume_ramp_start_from(&i->thread_info.ramp, &i->ramp);
-+ i->thread_info.ramp = i->ramp;
-+ return 0;
-+
- case PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE:
- if (i->thread_info.muted != i->muted) {
- i->thread_info.muted = i->muted;
---- a/src/pulsecore/sink-input.h 2016-04-12 16:50:46.712964926 +0200
-+++ b/src/pulsecore/sink-input.h 2016-04-12 17:30:24.289960958 +0200
-@@ -59,7 +59,8 @@
- PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND = 256,
- PA_SINK_INPUT_NO_CREATE_ON_SUSPEND = 512,
- PA_SINK_INPUT_KILL_ON_SUSPEND = 1024,
-- PA_SINK_INPUT_PASSTHROUGH = 2048
-+ PA_SINK_INPUT_PASSTHROUGH = 2048,
-+ PA_SINK_INPUT_START_RAMP_MUTED = 4096,
- } pa_sink_input_flags_t;
-
- struct pa_sink_input {
-@@ -122,6 +123,9 @@
- * this.*/
- bool save_sink:1, save_volume:1, save_muted:1;
-
-+ /* for volume ramps */
-+ pa_cvolume_ramp_int ramp;
-+
- pa_resample_method_t requested_resample_method, actual_resample_method;
-
- /* Returns the chunk of audio data and drops it from the
-@@ -250,6 +254,8 @@
- pa_usec_t requested_sink_latency;
-
- pa_hashmap *direct_outputs;
-+
-+ pa_cvolume_ramp_int ramp;
- } thread_info;
-
- void *userdata;
-@@ -266,6 +272,7 @@
- PA_SINK_INPUT_MESSAGE_SET_STATE,
- PA_SINK_INPUT_MESSAGE_SET_REQUESTED_LATENCY,
- PA_SINK_INPUT_MESSAGE_GET_REQUESTED_LATENCY,
-+ PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
- PA_SINK_INPUT_MESSAGE_MAX
- };
-
-@@ -374,6 +381,8 @@
-
- void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);
-
-+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const pa_cvolume_ramp *ramp, bool send_msg, bool save);
-+
- void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_proplist *p);
-
- pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i);
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0012-volume-ramp-add-volume-ramping-to-sink.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0012-volume-ramp-add-volume-ramping-to-sink.patch
deleted file mode 100644
index 43e8283ef..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0012-volume-ramp-add-volume-ramping-to-sink.patch
+++ /dev/null
@@ -1,159 +0,0 @@
---- a/src/pulsecore/sink.c 2016-04-12 18:01:23.403957855 +0200
-+++ b/src/pulsecore/sink.c 2016-04-12 18:44:49.677953506 +0200
-@@ -324,6 +324,8 @@
- &s->sample_spec,
- 0);
-
-+ pa_cvolume_ramp_int_init(&s->ramp, PA_VOLUME_NORM, data->sample_spec.channels);
-+
- s->thread_info.rtpoll = NULL;
- s->thread_info.inputs = pa_hashmap_new_full(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func, NULL,
- (pa_free_cb_t) pa_sink_input_unref);
-@@ -347,6 +349,8 @@
- s->thread_info.volume_change_extra_delay = core->deferred_volume_extra_delay_usec;
- s->thread_info.latency_offset = s->latency_offset;
-
-+ s->thread_info.ramp = s->ramp;
-+
- /* FIXME: This should probably be moved to pa_sink_put() */
- pa_assert_se(pa_idxset_put(core->sinks, s, &s->index) >= 0);
-
-@@ -1182,6 +1186,7 @@
-
- } else if (n == 1) {
- pa_cvolume volume;
-+ pa_cvolume target;
-
- *result = info[0].chunk;
- pa_memblock_ref(result->memblock);
-@@ -1198,9 +1203,20 @@
- result,
- &s->sample_spec,
- result->length);
-- } else if (!pa_cvolume_is_norm(&volume)) {
-+ } else if (!pa_cvolume_is_norm(&volume) || pa_cvolume_ramp_target_active(&s->thread_info.ramp) || pa_cvolume_ramp_active(&s->thread_info.ramp)) {
- pa_memchunk_make_writable(result, 0);
-- pa_volume_memchunk(result, &s->sample_spec, &volume);
-+ if (!pa_cvolume_ramp_active(&s->thread_info.ramp)) {
-+ if (!pa_cvolume_is_norm(&volume))
-+ pa_volume_memchunk(result, &s->sample_spec, &volume);
-+ pa_volume_ramp_memchunk(result, &s->sample_spec, &(s->thread_info.ramp));
-+ }
-+ else {
-+ if (pa_cvolume_ramp_target_active(&s->thread_info.ramp)) {
-+ pa_cvolume_ramp_get_targets(&s->thread_info.ramp, &target);
-+ pa_sw_cvolume_multiply(&volume, &volume, &target);
-+ }
-+ pa_volume_memchunk(result, &s->sample_spec, &volume);
-+ }
- }
- } else {
- void *ptr;
-@@ -1290,6 +1306,7 @@
-
- } else {
- void *ptr;
-+ pa_cvolume target_vol;
-
- ptr = pa_memblock_acquire(target->memblock);
-
-@@ -1299,6 +1316,15 @@
- &s->thread_info.soft_volume,
- s->thread_info.soft_muted);
-
-+ if (pa_cvolume_ramp_target_active(&s->thread_info.ramp) || pa_cvolume_ramp_active(&s->thread_info.ramp)) {
-+ if (pa_cvolume_ramp_active(&s->thread_info.ramp))
-+ pa_volume_ramp_memchunk(target, &s->sample_spec, &(s->thread_info.ramp));
-+ else {
-+ pa_cvolume_ramp_get_targets(&s->thread_info.ramp, &target_vol);
-+ pa_volume_memchunk(target, &s->sample_spec, &target_vol);
-+ }
-+ }
-+
- pa_memblock_release(target->memblock);
- }
-
-@@ -2058,6 +2084,32 @@
- pa_assert_se(pa_asyncmsgq_send(root_sink->asyncmsgq, PA_MSGOBJECT(root_sink), PA_SINK_MESSAGE_SET_SHARED_VOLUME, NULL, 0, NULL) == 0);
- }
-
-+/* Called from main thread */
-+void pa_sink_set_volume_ramp(
-+ pa_sink *s,
-+ const pa_cvolume_ramp *ramp,
-+ bool send_msg,
-+ bool save) {
-+
-+ pa_sink_assert_ref(s);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_IS_LINKED(s->state));
-+ pa_assert(ramp);
-+
-+ /* make sure we don't change the volume when a PASSTHROUGH input is connected ...
-+ * ... *except* if we're being invoked to reset the volume to ensure 0 dB gain */
-+ if (pa_sink_is_passthrough(s)) {
-+ pa_log_warn("Cannot do volume ramp, Sink is connected to PASSTHROUGH input");
-+ return;
-+ }
-+
-+ pa_cvolume_ramp_convert(ramp, &s->ramp, s->sample_spec.rate);
-+
-+ /* This tells the sink that volume ramp changed */
-+ if (send_msg)
-+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_VOLUME_RAMP, NULL, 0, NULL) == 0);
-+}
-+
- /* Called from the io thread if sync volume is used, otherwise from the main thread.
- * Only to be called by sink implementor */
- void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume) {
-@@ -2713,6 +2765,12 @@
- sync_input_volumes_within_thread(s);
- return 0;
-
-+ case PA_SINK_MESSAGE_SET_VOLUME_RAMP:
-+ /* if we have ongoing ramp where we take current start values */
-+ pa_cvolume_ramp_start_from(&s->thread_info.ramp, &s->ramp);
-+ s->thread_info.ramp = s->ramp;
-+ return 0;
-+
- case PA_SINK_MESSAGE_GET_VOLUME:
-
- if ((s->flags & PA_SINK_DEFERRED_VOLUME) && s->get_volume) {
---- a/src/pulsecore/sink.h 2016-04-12 18:01:42.117957824 +0200
-+++ b/src/pulsecore/sink.h 2016-04-12 18:23:29.394955642 +0200
-@@ -105,6 +105,9 @@
- pa_cvolume saved_volume;
- bool saved_save_volume:1;
-
-+ /* for volume ramps */
-+ pa_cvolume_ramp_int ramp;
-+
- pa_asyncmsgq *asyncmsgq;
-
- pa_memchunk silence;
-@@ -300,6 +303,8 @@
- uint32_t volume_change_safety_margin;
- /* Usec delay added to all volume change events, may be negative. */
- int32_t volume_change_extra_delay;
-+
-+ pa_cvolume_ramp_int ramp;
- } thread_info;
-
- void *userdata;
-@@ -333,6 +338,7 @@
- PA_SINK_MESSAGE_SET_MAX_REQUEST,
- PA_SINK_MESSAGE_SET_PORT,
- PA_SINK_MESSAGE_UPDATE_VOLUME_AND_MUTE,
-+ PA_SINK_MESSAGE_SET_VOLUME_RAMP,
- PA_SINK_MESSAGE_SET_LATENCY_OFFSET,
- PA_SINK_MESSAGE_MAX
- } pa_sink_message_t;
-@@ -453,6 +459,8 @@
- void pa_sink_set_mute(pa_sink *sink, bool mute, bool save);
- bool pa_sink_get_mute(pa_sink *sink, bool force_refresh);
-
-+void pa_sink_set_volume_ramp(pa_sink *s, const pa_cvolume_ramp *ramp, bool send_msg, bool save);
-+
- bool pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode, pa_proplist *p);
-
- int pa_sink_set_port(pa_sink *s, const char *name, bool save);
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0013-add-internal-corking-state-for-sink-input.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0013-add-internal-corking-state-for-sink-input.patch
deleted file mode 100644
index cb68e26af..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0013-add-internal-corking-state-for-sink-input.patch
+++ /dev/null
@@ -1,72 +0,0 @@
---- a/src/pulsecore/sink-input.c 2016-04-13 11:44:04.389999429 +0200
-+++ b/src/pulsecore/sink-input.c 2016-04-13 11:52:45.167998560 +0200
-@@ -786,6 +786,9 @@
- update_n_corked(i, state);
- i->state = state;
-
-+ i->corked = false;
-+ i->corked_internal = false;
-+
- /* We might need to update the sink's volume if we are in flat volume mode. */
- if (pa_sink_flat_volume_enabled(i->sink))
- pa_sink_set_volume(i->sink, NULL, false, i->save_volume);
-@@ -1493,13 +1496,38 @@
- }
- }
-
-+static void pa_sink_input_cork_really(pa_sink_input *i, bool b) {
-+ pa_sink_input_assert_ref(i);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+
-+ if (i->corked_internal == false && i->corked == false)
-+ b = false;
-+ else
-+ b = true;
-+
-+ sink_input_set_state(i, b ? PA_SINK_INPUT_CORKED : PA_SINK_INPUT_RUNNING);
-+}
-+
- /* Called from main context */
- void pa_sink_input_cork(pa_sink_input *i, bool b) {
- pa_sink_input_assert_ref(i);
- pa_assert_ctl_context();
- pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-
-- sink_input_set_state(i, b ? PA_SINK_INPUT_CORKED : PA_SINK_INPUT_RUNNING);
-+ i->corked = b;
-+
-+ pa_sink_input_cork_really(i, b);
-+}
-+
-+void pa_sink_input_cork_internal(pa_sink_input *i, bool b) {
-+ pa_sink_input_assert_ref(i);
-+ pa_assert_ctl_context();
-+ pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
-+
-+ i->corked_internal = b;
-+
-+ pa_sink_input_cork_really(i, b);
- }
-
- /* Called from main context */
---- a/src/pulsecore/sink-input.h 2016-04-13 11:44:28.035999390 +0200
-+++ b/src/pulsecore/sink-input.h 2016-04-13 11:53:56.325998441 +0200
-@@ -126,6 +126,9 @@
- /* for volume ramps */
- pa_cvolume_ramp_int ramp;
-
-+ bool corked;
-+ bool corked_internal;
-+
- pa_resample_method_t requested_resample_method, actual_resample_method;
-
- /* Returns the chunk of audio data and drops it from the
-@@ -357,6 +360,7 @@
- void pa_sink_input_request_rewind(pa_sink_input *i, size_t nbytes, bool rewrite, bool flush, bool dont_rewind_render);
-
- void pa_sink_input_cork(pa_sink_input *i, bool b);
-+void pa_sink_input_cork_internal(pa_sink_input *i, bool b);
-
- int pa_sink_input_set_rate(pa_sink_input *i, uint32_t rate);
- int pa_sink_input_update_rate(pa_sink_input *i);
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0020-core-util-Add-pa_join.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0020-core-util-Add-pa_join.patch
deleted file mode 100644
index 891a5b83a..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0020-core-util-Add-pa_join.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- a/src/pulsecore/core-util.c 2016-04-13 16:17:33.314016929 +0200
-+++ b/src/pulsecore/core-util.c 2016-04-13 16:18:31.186016833 +0200
-@@ -1104,6 +1104,24 @@
- return pa_xstrndup(current, l);
- }
-
-+char *pa_join(const char * const *strings, unsigned n_strings, const char *delimiter) {
-+ pa_strbuf *buf;
-+ unsigned i;
-+
-+ pa_assert(strings || n_strings == 0);
-+
-+ buf = pa_strbuf_new();
-+
-+ for (i = 0; i < n_strings; i++) {
-+ if (i > 0 && delimiter)
-+ pa_strbuf_puts(buf, delimiter);
-+
-+ pa_strbuf_puts(buf, strings[i]);
-+ }
-+
-+ return pa_strbuf_tostring_free(buf);
-+}
-+
- PA_STATIC_TLS_DECLARE(signame, pa_xfree);
-
- /* Return the name of an UNIX signal. Similar to Solaris sig2str() */
---- a/src/pulsecore/core-util.h 2016-04-13 16:17:39.177016919 +0200
-+++ b/src/pulsecore/core-util.h 2016-04-13 16:19:09.141016769 +0200
-@@ -108,6 +108,7 @@
- char *pa_split(const char *c, const char*delimiters, const char **state);
- const char *pa_split_in_place(const char *c, const char*delimiters, int *n, const char **state);
- char *pa_split_spaces(const char *c, const char **state);
-+char *pa_join(const char * const *strings, unsigned n_strings, const char *delimiter);
-
- char *pa_strip_nl(char *s);
- char *pa_strip(char *s);
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0021-dynarray-Add-pa_dynarray_get_raw_array.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0021-dynarray-Add-pa_dynarray_get_raw_array.patch
deleted file mode 100644
index 040913c8f..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0021-dynarray-Add-pa_dynarray_get_raw_array.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/src/pulsecore/dynarray.c 2016-04-13 16:25:38.628016119 +0200
-+++ b/src/pulsecore/dynarray.c 2016-04-13 16:26:54.694015992 +0200
-@@ -91,3 +91,9 @@
-
- return array->n_entries;
- }
-+
-+void * const *pa_dynarray_get_raw_array(pa_dynarray *array) {
-+ pa_assert(array);
-+
-+ return array->data;
-+}
---- a/src/pulsecore/dynarray.h 2016-04-13 16:25:43.225016112 +0200
-+++ b/src/pulsecore/dynarray.h 2016-04-13 16:27:47.414015904 +0200
-@@ -52,5 +52,5 @@
- void *pa_dynarray_steal_last(pa_dynarray *array);
-
- unsigned pa_dynarray_size(pa_dynarray *array);
--
-+void * const *pa_dynarray_get_raw_array(pa_dynarray *array);
- #endif
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0022-device-port-Add-pa_device_port.active.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0022-device-port-Add-pa_device_port.active.patch
deleted file mode 100644
index 4a8143f61..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0022-device-port-Add-pa_device_port.active.patch
+++ /dev/null
@@ -1,198 +0,0 @@
---- a/src/pulsecore/core.h 2016-04-13 16:38:56.392014788 +0200
-+++ b/src/pulsecore/core.h 2016-04-13 16:41:50.331014498 +0200
-@@ -125,6 +125,7 @@
- PA_CORE_HOOK_CARD_PROFILE_ADDED,
- PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED,
- PA_CORE_HOOK_PORT_AVAILABLE_CHANGED,
-+ PA_CORE_HOOK_PORT_ACTIVE_CHANGED,
- PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED,
- PA_CORE_HOOK_MAX
- } pa_core_hook_t;
---- a/src/pulsecore/device-port.c 2016-04-13 16:39:37.411014719 +0200
-+++ b/src/pulsecore/device-port.c 2016-04-13 17:06:47.393011999 +0200
-@@ -175,6 +175,21 @@
- pa_hook_fire(&core->hooks[PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED], p);
- }
-
-+void pa_device_port_active_changed(pa_device_port *port, bool new_active) {
-+ bool old_active;
-+
-+ pa_assert(port);
-+
-+ old_active = port->active;
-+
-+ if (new_active == old_active)
-+ return;
-+
-+ port->active = new_active;
-+ pa_log_debug("Port %s %s.", port->name, new_active ? "activated" : "deactivated");
-+ pa_hook_fire(&port->core->hooks[PA_CORE_HOOK_PORT_ACTIVE_CHANGED], port);
-+}
-+
- pa_device_port *pa_device_port_find_best(pa_hashmap *ports)
- {
- void *state;
---- a/src/pulsecore/device-port.h 2016-04-13 16:39:51.603014696 +0200
-+++ b/src/pulsecore/device-port.h 2016-04-13 17:07:12.649011957 +0200
-@@ -46,6 +46,7 @@
-
- unsigned priority;
- pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
-+ bool active;
-
- pa_proplist *proplist;
- pa_hashmap *profiles; /* Does not own the profiles */
---- a/src/pulsecore/sink.c 2016-04-13 16:40:11.131014663 +0200
-+++ b/src/pulsecore/sink.c 2016-04-13 17:14:30.963011225 +0200
-@@ -658,6 +658,9 @@
- else
- pa_assert_se(sink_set_state(s, PA_SINK_IDLE) == 0);
-
-+ if (s->active_port)
-+ pa_device_port_active_changed(s->active_port, true);
-+
- pa_source_put(s->monitor_source);
-
- pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_NEW, s->index);
-@@ -685,6 +688,9 @@
- if (linked)
- pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_UNLINK], s);
-
-+ if (s->active_port)
-+ pa_device_port_active_changed(s->active_port, false);
-+
- if (s->state != PA_SINK_UNLINKED)
- pa_namereg_unregister(s->core, s->name);
- pa_idxset_remove_by_data(s->core->sinks, s, NULL);
-@@ -3297,6 +3303,7 @@
- /* Called from main context */
- int pa_sink_set_port(pa_sink *s, const char *name, bool save) {
- pa_device_port *port;
-+ pa_device_port *old_port;
- int ret;
-
- pa_sink_assert_ref(s);
-@@ -3313,11 +3320,15 @@
- if (!(port = pa_hashmap_get(s->ports, name)))
- return -PA_ERR_NOENTITY;
-
-- if (s->active_port == port) {
-+ old_port = s->active_port;
-+
-+ if (port == old_port) {
- s->save_port = s->save_port || save;
- return 0;
- }
-
-+ pa_device_port_active_changed(old_port, false);
-+
- if (s->flags & PA_SINK_DEFERRED_VOLUME) {
- struct sink_message_set_port msg = { .port = port, .ret = 0 };
- pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_PORT, &msg, 0, NULL) == 0);
-@@ -3326,17 +3337,26 @@
- else
- ret = s->set_port(s, port);
-
-- if (ret < 0)
-- return -PA_ERR_NOENTITY;
-+ if (ret < 0) {
-+ pa_log("Failed to set the port of sink %s from %s to %s.", s->name, old_port->name, port->name);
-+
-+ /* We don't know the real state of the device, but let's assume that
-+ * the old port is still active, because s->active_port is left to
-+ * point to the old port anyway. */
-+ pa_device_port_active_changed(old_port, true);
-+
-+ return ret;
-+ }
-
- pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
-
-- pa_log_info("Changed port of sink %u \"%s\" to %s", s->index, s->name, port->name);
-+ pa_log_info("Changed port of sink %u \"%s\" from %s to %s", s->index, s->name, old_port->name, port->name);
-
- s->active_port = port;
- s->save_port = save;
-
- pa_sink_set_latency_offset(s, s->active_port->latency_offset);
-+ pa_device_port_active_changed(port, true);
-
- pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_PORT_CHANGED], s);
-
---- a/src/pulsecore/source.c 2016-04-13 16:40:25.290014640 +0200
-+++ b/src/pulsecore/source.c 2016-04-13 17:21:26.051010533 +0200
-@@ -603,6 +603,9 @@
- else
- pa_assert_se(source_set_state(s, PA_SOURCE_IDLE) == 0);
-
-+ if (s->active_port)
-+ pa_device_port_active_changed(s->active_port, true);
-+
- pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_NEW, s->index);
- pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PUT], s);
- }
-@@ -623,6 +626,9 @@
- if (linked)
- pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_UNLINK], s);
-
-+ if (s->active_port)
-+ pa_device_port_active_changed(s->active_port, false);
-+
- if (s->state != PA_SOURCE_UNLINKED)
- pa_namereg_unregister(s->core, s->name);
- pa_idxset_remove_by_data(s->core->sources, s, NULL);
-@@ -2576,6 +2582,7 @@
- /* Called from main context */
- int pa_source_set_port(pa_source *s, const char *name, bool save) {
- pa_device_port *port;
-+ pa_device_port *old_port;
- int ret;
-
- pa_source_assert_ref(s);
-@@ -2592,11 +2599,15 @@
- if (!(port = pa_hashmap_get(s->ports, name)))
- return -PA_ERR_NOENTITY;
-
-- if (s->active_port == port) {
-+ old_port = s->active_port;
-+
-+ if (port == old_port) {
- s->save_port = s->save_port || save;
- return 0;
- }
-
-+ pa_device_port_active_changed(old_port, false);
-+
- if (s->flags & PA_SOURCE_DEFERRED_VOLUME) {
- struct source_message_set_port msg = { .port = port, .ret = 0 };
- pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_PORT, &msg, 0, NULL) == 0);
-@@ -2605,16 +2616,26 @@
- else
- ret = s->set_port(s, port);
-
-- if (ret < 0)
-- return -PA_ERR_NOENTITY;
-+ if (ret < 0) {
-+ pa_log("Failed to set the port of sink %s from %s to %s.", s->name, old_port->name, port->name);
-+
-+ /* We don't know the real state of the device, but let's assume that
-+ * the old port is still active, because s->active_port is left to
-+ * point to the old port anyway. */
-+ pa_device_port_active_changed(old_port, true);
-+
-+ return ret;
-+ }
-
- pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
-
-- pa_log_info("Changed port of source %u \"%s\" to %s", s->index, s->name, port->name);
-+ pa_log_info("Changed port of source %u \"%s\" from %s to %s", s->index, s->name, old_port->name, port->name);
-
- s->active_port = port;
- s->save_port = save;
-
-+ pa_device_port_active_changed(port, true);
-+
- pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PORT_CHANGED], s);
-
- return 0;
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0030-volume-api-Add-libvolume-api.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0030-volume-api-Add-libvolume-api.patch
deleted file mode 100644
index b904ac315..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0030-volume-api-Add-libvolume-api.patch
+++ /dev/null
@@ -1,6118 +0,0 @@
-From 0223ac3e092249c792bedcab2bf5dbaec443f960 Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
-Date: Wed, 21 May 2014 11:51:27 +0300
-Subject: [PATCH 1/1] volume-api: Add libvolume-api.so
-
-This library implements the "core" of the new volume system, which
-will be used by several modules.
-
-Change-Id: Ib25ada1392e83237a3908e6064ee0ad6dff7afaf
-Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
----
- Makefile.am | 3 +
- src/Makefile.am | 19 +-
- src/map-file | 15 +
- src/modules/volume-api/audio-group.c | 448 +++++++++++++
- src/modules/volume-api/audio-group.h | 85 +++
- src/modules/volume-api/binding.c | 386 +++++++++++
- src/modules/volume-api/binding.h | 128 ++++
- src/modules/volume-api/bvolume.h | 43 ++
- src/modules/volume-api/device-creator.c | 1108 +++++++++++++++++++++++++++++++
- src/modules/volume-api/device-creator.h | 32 +
- src/modules/volume-api/device.c | 293 ++++++++
- src/modules/volume-api/device.h | 76 +++
- src/modules/volume-api/mute-control.c | 306 +++++++++
- src/modules/volume-api/mute-control.h | 102 +++
- src/modules/volume-api/sstream.c | 366 ++++++++++
- src/modules/volume-api/sstream.h | 108 +++
- src/modules/volume-api/stream-creator.c | 691 +++++++++++++++++++
- src/modules/volume-api/stream-creator.h | 32 +
- src/modules/volume-api/volume-api.c | 647 ++++++++++++++++++
- src/modules/volume-api/volume-api.h | 163 +++++
- src/modules/volume-api/volume-control.c | 363 ++++++++++
- src/modules/volume-api/volume-control.h | 112 ++++
- src/pulse/ext-volume-api.c | 275 ++++++++
- src/pulse/ext-volume-api.h | 68 ++
- 24 files changed, 5868 insertions(+), 1 deletion(-)
- create mode 100644 src/modules/volume-api/audio-group.c
- create mode 100644 src/modules/volume-api/audio-group.h
- create mode 100644 src/modules/volume-api/binding.c
- create mode 100644 src/modules/volume-api/binding.h
- create mode 100644 src/modules/volume-api/bvolume.h
- create mode 100644 src/modules/volume-api/device-creator.c
- create mode 100644 src/modules/volume-api/device-creator.h
- create mode 100644 src/modules/volume-api/device.c
- create mode 100644 src/modules/volume-api/device.h
- create mode 100644 src/modules/volume-api/mute-control.c
- create mode 100644 src/modules/volume-api/mute-control.h
- create mode 100644 src/modules/volume-api/sstream.c
- create mode 100644 src/modules/volume-api/sstream.h
- create mode 100644 src/modules/volume-api/stream-creator.c
- create mode 100644 src/modules/volume-api/stream-creator.h
- create mode 100644 src/modules/volume-api/volume-api.c
- create mode 100644 src/modules/volume-api/volume-api.h
- create mode 100644 src/modules/volume-api/volume-control.c
- create mode 100644 src/modules/volume-api/volume-control.h
- create mode 100644 src/pulse/ext-volume-api.c
- create mode 100644 src/pulse/ext-volume-api.h
-
-diff --git a/Makefile.am b/Makefile.am
-index 9431d4a..cf4a648 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -57,6 +57,9 @@
- moduledevinternal_DATA = src/pulse/internal.h src/pulse/client-conf.h src/pulse/fork-detect.h
- moduledevinternaldir = $(includedir)/pulsemodule/pulse
-
-+moduledevvolumeapi_DATA = $(top_srcdir)/src/modules/volume-api/*.h
-+moduledevvolumeapidir = $(includedir)/pulsemodule/modules/volume-api
-+
- if HAVE_GLIB20
- pkgconfig_DATA += \
- libpulse-mainloop-glib.pc
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 22b9b81..bc41dca 100644
---- a/src/Makefile.am 2016-04-13 15:51:34.439019531 +0200
-+++ b/src/Makefile.am 2016-04-13 15:53:03.721019382 +0200
-@@ -792,6 +792,7 @@
- pulse/ext-device-manager.h \
- pulse/ext-device-restore.h \
- pulse/ext-stream-restore.h \
-+ pulse/ext-volume-api.h \
- pulse/format.h \
- pulse/gccmacro.h \
- pulse/introspect.h \
-@@ -838,6 +839,7 @@
- pulse/ext-device-manager.c pulse/ext-device-manager.h \
- pulse/ext-device-restore.c pulse/ext-device-restore.h \
- pulse/ext-stream-restore.c pulse/ext-stream-restore.h \
-+ pulse/ext-volume-api.c pulse/ext-volume-api.h \
- pulse/format.c pulse/format.h \
- pulse/gccmacro.h \
- pulse/internal.h \
-@@ -1018,7 +1020,8 @@ modlibexec_LTLIBRARIES = \
- libprotocol-cli.la \
- libprotocol-simple.la \
- libprotocol-http.la \
-- libprotocol-native.la
-+ libprotocol-native.la \
-+ libvolume-api.la
-
- if HAVE_WEBRTC
- modlibexec_LTLIBRARIES += libwebrtc-util.la
-@@ -1065,6 +1068,20 @@ libprotocol_native_la_CFLAGS += $(DBUS_CFLAGS)
- libprotocol_native_la_LIBADD += $(DBUS_LIBS)
- endif
-
-+libvolume_api_la_SOURCES = \
-+ modules/volume-api/audio-group.c modules/volume-api/audio-group.h \
-+ modules/volume-api/binding.c modules/volume-api/binding.h \
-+ modules/volume-api/bvolume.h \
-+ modules/volume-api/device.c modules/volume-api/device.h \
-+ modules/volume-api/device-creator.c modules/volume-api/device-creator.h \
-+ modules/volume-api/mute-control.c modules/volume-api/mute-control.h \
-+ modules/volume-api/sstream.c modules/volume-api/sstream.h \
-+ modules/volume-api/stream-creator.c modules/volume-api/stream-creator.h \
-+ modules/volume-api/volume-api.c modules/volume-api/volume-api.h \
-+ modules/volume-api/volume-control.c modules/volume-api/volume-control.h
-+libvolume_api_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
-+libvolume_api_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la
-+
- if HAVE_ESOUND
- libprotocol_esound_la_SOURCES = pulsecore/protocol-esound.c pulsecore/protocol-esound.h pulsecore/esound.h
- libprotocol_esound_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
-diff --git a/src/map-file b/src/map-file
-index fbf3f22..1f64a2f 100644
---- a/src/map-file
-+++ b/src/map-file
-@@ -172,6 +172,21 @@
- pa_ext_stream_restore_subscribe;
- pa_ext_stream_restore_test;
- pa_ext_stream_restore_write;
-+pa_ext_volume_api_balance_valid;
-+pa_ext_volume_api_bvolume_copy_balance;
-+pa_ext_volume_api_bvolume_get_left_right_balance;
-+pa_ext_volume_api_bvolume_get_rear_front_balance;
-+pa_ext_volume_api_bvolume_equal;
-+pa_ext_volume_api_bvolume_from_cvolume;
-+pa_ext_volume_api_bvolume_init_invalid;
-+pa_ext_volume_api_bvolume_init_mono;
-+pa_ext_volume_api_bvolume_remap;
-+pa_ext_volume_api_bvolume_reset_balance;
-+pa_ext_volume_api_bvolume_set_left_right_balance;
-+pa_ext_volume_api_bvolume_set_rear_front_balance;
-+pa_ext_volume_api_bvolume_snprint_balance;
-+pa_ext_volume_api_bvolume_to_cvolume;
-+pa_ext_volume_api_bvolume_valid;
- pa_format_info_copy;
- pa_format_info_free;
- pa_format_info_from_string;
-diff --git a/src/modules/volume-api/audio-group.c b/src/modules/volume-api/audio-group.c
-new file mode 100644
-index 0000000..76bfa69
---- /dev/null
-+++ b/src/modules/volume-api/audio-group.c
-@@ -0,0 +1,448 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "audio-group.h"
-+
-+#include <modules/volume-api/sstream.h>
-+
-+#include <pulsecore/core-util.h>
-+
-+int pa_audio_group_new(pa_volume_api *api, const char *name, const char *description, pa_audio_group **group) {
-+ pa_audio_group *group_local;
-+ int r;
-+
-+ pa_assert(api);
-+ pa_assert(name);
-+ pa_assert(description);
-+ pa_assert(group);
-+
-+ group_local = pa_xnew0(pa_audio_group, 1);
-+ group_local->volume_api = api;
-+ group_local->index = pa_volume_api_allocate_audio_group_index(api);
-+
-+ r = pa_volume_api_register_name(api, name, true, &group_local->name);
-+ if (r < 0)
-+ goto fail;
-+
-+ group_local->description = pa_xstrdup(description);
-+ group_local->proplist = pa_proplist_new();
-+ group_local->volume_streams = pa_hashmap_new(NULL, NULL);
-+ group_local->mute_streams = pa_hashmap_new(NULL, NULL);
-+
-+ *group = group_local;
-+
-+ return 0;
-+
-+fail:
-+ pa_audio_group_free(group_local);
-+
-+ return r;
-+}
-+
-+void pa_audio_group_put(pa_audio_group *group) {
-+ const char *prop_key;
-+ void *state = NULL;
-+
-+ pa_assert(group);
-+
-+ pa_volume_api_add_audio_group(group->volume_api, group);
-+
-+ group->linked = true;
-+
-+ pa_log_debug("Created audio group #%u.", group->index);
-+ pa_log_debug(" Name: %s", group->name);
-+ pa_log_debug(" Description: %s", group->description);
-+ pa_log_debug(" Volume control: %s", group->volume_control ? group->volume_control->name : "(unset)");
-+ pa_log_debug(" Mute control: %s", group->mute_control ? group->mute_control->name : "(unset)");
-+ pa_log_debug(" Properties:");
-+
-+ while ((prop_key = pa_proplist_iterate(group->proplist, &state)))
-+ pa_log_debug(" %s = %s", prop_key, pa_strnull(pa_proplist_gets(group->proplist, prop_key)));
-+
-+ pa_hook_fire(&group->volume_api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_PUT], group);
-+}
-+
-+void pa_audio_group_unlink(pa_audio_group *group) {
-+ pas_stream *stream;
-+
-+ pa_assert(group);
-+
-+ if (group->unlinked) {
-+ pa_log_debug("Unlinking audio group %s (already unlinked, this is a no-op).", group->name);
-+ return;
-+ }
-+
-+ group->unlinked = true;
-+
-+ pa_log_debug("Unlinking audio group %s.", group->name);
-+
-+ if (group->linked)
-+ pa_hook_fire(&group->volume_api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_UNLINK], group);
-+
-+ pa_volume_api_remove_audio_group(group->volume_api, group);
-+
-+ while ((stream = pa_hashmap_first(group->mute_streams)))
-+ pas_stream_set_audio_group_for_mute(stream, NULL);
-+
-+ while ((stream = pa_hashmap_first(group->volume_streams)))
-+ pas_stream_set_audio_group_for_volume(stream, NULL);
-+
-+ if (group->mute_control_binding) {
-+ pa_binding_free(group->mute_control_binding);
-+ group->mute_control_binding = NULL;
-+ }
-+
-+ if (group->volume_control_binding) {
-+ pa_binding_free(group->volume_control_binding);
-+ group->volume_control_binding = NULL;
-+ }
-+
-+ pa_audio_group_set_have_own_mute_control(group, false);
-+ pa_audio_group_set_have_own_volume_control(group, false);
-+
-+ if (group->mute_control) {
-+ pa_mute_control_remove_audio_group(group->mute_control, group);
-+ group->mute_control = NULL;
-+ }
-+
-+ if (group->volume_control) {
-+ pa_volume_control_remove_audio_group(group->volume_control, group);
-+ group->volume_control = NULL;
-+ }
-+}
-+
-+void pa_audio_group_free(pa_audio_group *group) {
-+ pa_assert(group);
-+
-+ if (!group->unlinked)
-+ pa_audio_group_unlink(group);
-+
-+ if (group->mute_streams)
-+ pa_hashmap_free(group->mute_streams);
-+
-+ if (group->volume_streams)
-+ pa_hashmap_free(group->volume_streams);
-+
-+ if (group->proplist)
-+ pa_proplist_free(group->proplist);
-+
-+ pa_xfree(group->description);
-+
-+ if (group->name)
-+ pa_volume_api_unregister_name(group->volume_api, group->name);
-+
-+ pa_xfree(group);
-+}
-+
-+const char *pa_audio_group_get_name(pa_audio_group *group) {
-+ pa_assert(group);
-+
-+ return group->name;
-+}
-+
-+static int volume_control_set_volume_cb(pa_volume_control *control, const pa_bvolume *volume, bool set_volume,
-+ bool set_balance) {
-+ pa_audio_group *group;
-+ pas_stream *stream;
-+ void *state;
-+
-+ pa_assert(control);
-+ pa_assert(volume);
-+
-+ group = control->userdata;
-+
-+ PA_HASHMAP_FOREACH(stream, group->volume_streams, state) {
-+ if (stream->own_volume_control)
-+ pa_volume_control_set_volume(stream->own_volume_control, volume, set_volume, set_balance);
-+ }
-+
-+ return 0;
-+}
-+
-+static void volume_control_set_initial_volume_cb(pa_volume_control *control) {
-+ pa_audio_group *group;
-+ pas_stream *stream;
-+ void *state;
-+
-+ pa_assert(control);
-+
-+ group = control->userdata;
-+
-+ PA_HASHMAP_FOREACH(stream, group->volume_streams, state) {
-+ if (stream->own_volume_control)
-+ pa_volume_control_set_volume(stream->own_volume_control, &control->volume, true, true);
-+ }
-+}
-+
-+void pa_audio_group_set_have_own_volume_control(pa_audio_group *group, bool have) {
-+ pa_assert(group);
-+
-+ if (have == group->have_own_volume_control)
-+ return;
-+
-+ if (have) {
-+ pa_bvolume initial_volume;
-+
-+ if (group->volume_api->core->flat_volumes)
-+ /* Usually the initial volume should get overridden by some module
-+ * that manages audio group volume levels, but if there's no such
-+ * module, let's try to avoid too high volume in flat volume
-+ * mode. */
-+ pa_bvolume_init_mono(&initial_volume, 0.3 * PA_VOLUME_NORM);
-+ else
-+ pa_bvolume_init_mono(&initial_volume, PA_VOLUME_NORM);
-+
-+ pa_assert(!group->own_volume_control);
-+ group->own_volume_control = pa_volume_control_new(group->volume_api, "audio-group-volume-control",
-+ group->description, false, false);
-+ pa_volume_control_set_owner_audio_group(group->own_volume_control, group);
-+ group->own_volume_control->set_volume = volume_control_set_volume_cb;
-+ group->own_volume_control->userdata = group;
-+ pa_volume_control_put(group->own_volume_control, &initial_volume, volume_control_set_initial_volume_cb);
-+ } else {
-+ pa_volume_control_free(group->own_volume_control);
-+ group->own_volume_control = NULL;
-+ }
-+
-+ group->have_own_volume_control = have;
-+}
-+
-+static int mute_control_set_mute_cb(pa_mute_control *control, bool mute) {
-+ pa_audio_group *group;
-+ pas_stream *stream;
-+ void *state;
-+
-+ pa_assert(control);
-+
-+ group = control->userdata;
-+
-+ PA_HASHMAP_FOREACH(stream, group->mute_streams, state) {
-+ if (stream->own_mute_control)
-+ pa_mute_control_set_mute(stream->own_mute_control, mute);
-+ }
-+
-+ return 0;
-+}
-+
-+static void mute_control_set_initial_mute_cb(pa_mute_control *control) {
-+ pa_audio_group *group;
-+ pas_stream *stream;
-+ void *state;
-+
-+ pa_assert(control);
-+
-+ group = control->userdata;
-+
-+ PA_HASHMAP_FOREACH(stream, group->mute_streams, state) {
-+ if (stream->own_mute_control)
-+ pa_mute_control_set_mute(stream->own_mute_control, control->mute);
-+ }
-+}
-+
-+void pa_audio_group_set_have_own_mute_control(pa_audio_group *group, bool have) {
-+ pa_assert(group);
-+
-+ if (have == group->have_own_mute_control)
-+ return;
-+
-+ group->have_own_mute_control = have;
-+
-+ if (have) {
-+ pa_assert(!group->own_mute_control);
-+ group->own_mute_control = pa_mute_control_new(group->volume_api, "audio-group-mute-control", group->description);
-+ pa_mute_control_set_owner_audio_group(group->own_mute_control, group);
-+ group->own_mute_control->set_mute = mute_control_set_mute_cb;
-+ group->own_mute_control->userdata = group;
-+ pa_mute_control_put(group->own_mute_control, false, true, mute_control_set_initial_mute_cb);
-+ } else {
-+ pa_mute_control_free(group->own_mute_control);
-+ group->own_mute_control = NULL;
-+ }
-+}
-+
-+static void set_volume_control_internal(pa_audio_group *group, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(group);
-+
-+ old_control = group->volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_volume_control_remove_audio_group(old_control, group);
-+
-+ group->volume_control = control;
-+
-+ if (control)
-+ pa_volume_control_add_audio_group(control, group);
-+
-+ if (!group->linked || group->unlinked)
-+ return;
-+
-+ pa_log_debug("The volume control of audio group %s changed from %s to %s.", group->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&group->volume_api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_VOLUME_CONTROL_CHANGED], group);
-+}
-+
-+void pa_audio_group_set_volume_control(pa_audio_group *group, pa_volume_control *control) {
-+ pa_assert(group);
-+
-+ if (group->volume_control_binding) {
-+ pa_binding_free(group->volume_control_binding);
-+ group->volume_control_binding = NULL;
-+ }
-+
-+ set_volume_control_internal(group, control);
-+}
-+
-+static void set_mute_control_internal(pa_audio_group *group, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(group);
-+
-+ old_control = group->mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_mute_control_remove_audio_group(old_control, group);
-+
-+ group->mute_control = control;
-+
-+ if (control)
-+ pa_mute_control_add_audio_group(control, group);
-+
-+ if (!group->linked || group->unlinked)
-+ return;
-+
-+ pa_log_debug("The mute control of audio group %s changed from %s to %s.", group->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&group->volume_api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_MUTE_CONTROL_CHANGED], group);
-+}
-+
-+void pa_audio_group_set_mute_control(pa_audio_group *group, pa_mute_control *control) {
-+ pa_assert(group);
-+
-+ if (group->mute_control_binding) {
-+ pa_binding_free(group->mute_control_binding);
-+ group->mute_control_binding = NULL;
-+ }
-+
-+ set_mute_control_internal(group, control);
-+}
-+
-+void pa_audio_group_bind_volume_control(pa_audio_group *group, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = group,
-+ .set_value = (pa_binding_set_value_cb_t) set_volume_control_internal,
-+ };
-+
-+ pa_assert(group);
-+ pa_assert(target_info);
-+
-+ if (group->volume_control_binding)
-+ pa_binding_free(group->volume_control_binding);
-+
-+ group->volume_control_binding = pa_binding_new(group->volume_api, &owner_info, target_info);
-+}
-+
-+void pa_audio_group_bind_mute_control(pa_audio_group *group, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = group,
-+ .set_value = (pa_binding_set_value_cb_t) set_mute_control_internal,
-+ };
-+
-+ pa_assert(group);
-+ pa_assert(target_info);
-+
-+ if (group->mute_control_binding)
-+ pa_binding_free(group->mute_control_binding);
-+
-+ group->mute_control_binding = pa_binding_new(group->volume_api, &owner_info, target_info);
-+}
-+
-+void pa_audio_group_add_volume_stream(pa_audio_group *group, pas_stream *stream) {
-+ pa_assert(group);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_put(group->volume_streams, stream, stream) >= 0);
-+
-+ if (stream->own_volume_control && group->own_volume_control)
-+ pa_volume_control_set_volume(stream->own_volume_control, &group->own_volume_control->volume, true, true);
-+
-+ pa_log_debug("Stream %s added to audio group %s (volume).", stream->name, group->name);
-+}
-+
-+void pa_audio_group_remove_volume_stream(pa_audio_group *group, pas_stream *stream) {
-+ pa_assert(group);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_remove(group->volume_streams, stream));
-+
-+ pa_log_debug("Stream %s removed from audio group %s (volume).", stream->name, group->name);
-+}
-+
-+void pa_audio_group_add_mute_stream(pa_audio_group *group, pas_stream *stream) {
-+ pa_assert(group);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_put(group->mute_streams, stream, stream) >= 0);
-+
-+ if (stream->own_mute_control && group->own_mute_control)
-+ pa_mute_control_set_mute(stream->own_mute_control, group->own_mute_control->mute);
-+
-+ pa_log_debug("Stream %s added to audio group %s (mute).", stream->name, group->name);
-+}
-+
-+void pa_audio_group_remove_mute_stream(pa_audio_group *group, pas_stream *stream) {
-+ pa_assert(group);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_remove(group->mute_streams, stream));
-+
-+ pa_log_debug("Stream %s removed from audio group %s (mute).", stream->name, group->name);
-+}
-+
-+pa_binding_target_type *pa_audio_group_create_binding_target_type(pa_volume_api *api) {
-+ pa_binding_target_type *type;
-+
-+ pa_assert(api);
-+
-+ type = pa_binding_target_type_new(PA_AUDIO_GROUP_BINDING_TARGET_TYPE, api->audio_groups,
-+ &api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_PUT],
-+ &api->hooks[PA_VOLUME_API_HOOK_AUDIO_GROUP_UNLINK],
-+ (pa_binding_target_type_get_name_cb_t) pa_audio_group_get_name);
-+ pa_binding_target_type_add_field(type, PA_AUDIO_GROUP_BINDING_TARGET_FIELD_VOLUME_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_audio_group, volume_control));
-+ pa_binding_target_type_add_field(type, PA_AUDIO_GROUP_BINDING_TARGET_FIELD_MUTE_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_audio_group, mute_control));
-+
-+ return type;
-+}
-diff --git a/src/modules/volume-api/audio-group.h b/src/modules/volume-api/audio-group.h
-new file mode 100644
-index 0000000..41591ba
---- /dev/null
-+++ b/src/modules/volume-api/audio-group.h
-@@ -0,0 +1,85 @@
-+#ifndef fooaudiogrouphfoo
-+#define fooaudiogrouphfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/binding.h>
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulse/proplist.h>
-+
-+#include <inttypes.h>
-+
-+typedef struct pa_audio_group pa_audio_group;
-+
-+#define PA_AUDIO_GROUP_BINDING_TARGET_TYPE "AudioGroup"
-+#define PA_AUDIO_GROUP_BINDING_TARGET_FIELD_VOLUME_CONTROL "volume_control"
-+#define PA_AUDIO_GROUP_BINDING_TARGET_FIELD_MUTE_CONTROL "mute_control"
-+
-+struct pa_audio_group {
-+ pa_volume_api *volume_api;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_proplist *proplist;
-+ pa_volume_control *volume_control;
-+ pa_mute_control *mute_control;
-+ bool have_own_volume_control;
-+ bool have_own_mute_control;
-+ pa_volume_control *own_volume_control;
-+ pa_mute_control *own_mute_control;
-+
-+ pa_binding *volume_control_binding;
-+ pa_binding *mute_control_binding;
-+ pa_hashmap *volume_streams; /* pas_stream -> pas_stream (hashmap-as-a-set) */
-+ pa_hashmap *mute_streams; /* pas_stream -> pas_stream (hashmap-as-a-set) */
-+
-+ bool linked;
-+ bool unlinked;
-+};
-+
-+int pa_audio_group_new(pa_volume_api *api, const char *name, const char *description, pa_audio_group **group);
-+void pa_audio_group_put(pa_audio_group *group);
-+void pa_audio_group_unlink(pa_audio_group *group);
-+void pa_audio_group_free(pa_audio_group *group);
-+
-+const char *pa_audio_group_get_name(pa_audio_group *group);
-+
-+/* Called by policy modules. */
-+void pa_audio_group_set_have_own_volume_control(pa_audio_group *group, bool have);
-+void pa_audio_group_set_have_own_mute_control(pa_audio_group *group, bool have);
-+void pa_audio_group_set_volume_control(pa_audio_group *group, pa_volume_control *control);
-+void pa_audio_group_set_mute_control(pa_audio_group *group, pa_mute_control *control);
-+void pa_audio_group_bind_volume_control(pa_audio_group *group, pa_binding_target_info *target_info);
-+void pa_audio_group_bind_mute_control(pa_audio_group *group, pa_binding_target_info *target_info);
-+
-+/* Called from sstream.c only. */
-+void pa_audio_group_add_volume_stream(pa_audio_group *group, pas_stream *stream);
-+void pa_audio_group_remove_volume_stream(pa_audio_group *group, pas_stream *stream);
-+void pa_audio_group_add_mute_stream(pa_audio_group *group, pas_stream *stream);
-+void pa_audio_group_remove_mute_stream(pa_audio_group *group, pas_stream *stream);
-+
-+/* Called from volume-api.c only. */
-+pa_binding_target_type *pa_audio_group_create_binding_target_type(pa_volume_api *api);
-+
-+#endif
-diff --git a/src/modules/volume-api/binding.c b/src/modules/volume-api/binding.c
-new file mode 100644
-index 0000000..6e73119
---- /dev/null
-+++ b/src/modules/volume-api/binding.c
-@@ -0,0 +1,386 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "binding.h"
-+
-+#include <pulse/def.h>
-+#include <pulse/xmalloc.h>
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/macro.h>
-+
-+struct field_entry {
-+ char *name;
-+ size_t offset;
-+};
-+
-+static void set_target_type(pa_binding *binding, pa_binding_target_type *type);
-+static void set_target_object(pa_binding *binding, void *object);
-+
-+pa_binding_owner_info *pa_binding_owner_info_new(pa_binding_set_value_cb_t set_value, void *userdata) {
-+ pa_binding_owner_info *info;
-+
-+ pa_assert(set_value);
-+
-+ info = pa_xnew0(pa_binding_owner_info, 1);
-+ info->set_value = set_value;
-+ info->userdata = userdata;
-+
-+ return info;
-+}
-+
-+pa_binding_owner_info *pa_binding_owner_info_copy(const pa_binding_owner_info *info) {
-+ pa_assert(info);
-+
-+ return pa_binding_owner_info_new(info->set_value, info->userdata);
-+}
-+
-+void pa_binding_owner_info_free(pa_binding_owner_info *info) {
-+ pa_assert(info);
-+
-+ pa_xfree(info);
-+}
-+
-+pa_binding_target_info *pa_binding_target_info_new(const char *type, const char *name, const char *field) {
-+ pa_binding_target_info *info;
-+
-+ pa_assert(type);
-+ pa_assert(name);
-+ pa_assert(field);
-+
-+ info = pa_xnew0(pa_binding_target_info, 1);
-+ info->type = pa_xstrdup(type);
-+ info->name = pa_xstrdup(name);
-+ info->field = pa_xstrdup(field);
-+
-+ return info;
-+}
-+
-+int pa_binding_target_info_new_from_string(const char *str, const char *field, pa_binding_target_info **info) {
-+ const char *colon;
-+ char *type = NULL;
-+ char *name = NULL;
-+
-+ pa_assert(str);
-+ pa_assert(field);
-+ pa_assert(info);
-+
-+ if (!pa_startswith(str, "bind:"))
-+ goto fail;
-+
-+ colon = strchr(str + 5, ':');
-+ if (!colon)
-+ goto fail;
-+
-+ type = pa_xstrndup(str + 5, colon - (str + 5));
-+
-+ if (!*type)
-+ goto fail;
-+
-+ name = pa_xstrdup(colon + 1);
-+
-+ if (!*name)
-+ goto fail;
-+
-+ *info = pa_binding_target_info_new(type, name, field);
-+ pa_xfree(name);
-+ pa_xfree(type);
-+
-+ return 0;
-+
-+fail:
-+ pa_log("Invalid binding target: %s", str);
-+ pa_xfree(name);
-+ pa_xfree(type);
-+
-+ return -PA_ERR_INVALID;
-+}
-+
-+pa_binding_target_info *pa_binding_target_info_copy(const pa_binding_target_info *info) {
-+ pa_assert(info);
-+
-+ return pa_binding_target_info_new(info->type, info->name, info->field);
-+}
-+
-+void pa_binding_target_info_free(pa_binding_target_info *info) {
-+ pa_assert(info);
-+
-+ pa_xfree(info->field);
-+ pa_xfree(info->name);
-+ pa_xfree(info->type);
-+ pa_xfree(info);
-+}
-+
-+static void field_entry_free(struct field_entry *entry) {
-+ pa_assert(entry);
-+
-+ pa_xfree(entry->name);
-+ pa_xfree(entry);
-+}
-+
-+pa_binding_target_type *pa_binding_target_type_new(const char *name, pa_hashmap *objects, pa_hook *put_hook,
-+ pa_hook *unlink_hook, pa_binding_target_type_get_name_cb_t get_name) {
-+ pa_binding_target_type *type;
-+
-+ pa_assert(name);
-+ pa_assert(objects);
-+ pa_assert(put_hook);
-+ pa_assert(unlink_hook);
-+ pa_assert(get_name);
-+
-+ type = pa_xnew0(pa_binding_target_type, 1);
-+ type->name = pa_xstrdup(name);
-+ type->objects = objects;
-+ type->put_hook = put_hook;
-+ type->unlink_hook = unlink_hook;
-+ type->get_name = get_name;
-+ type->fields = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, (pa_free_cb_t) field_entry_free);
-+
-+ return type;
-+}
-+
-+void pa_binding_target_type_free(pa_binding_target_type *type) {
-+ pa_assert(type);
-+
-+ if (type->fields)
-+ pa_hashmap_free(type->fields);
-+
-+ pa_xfree(type->name);
-+ pa_xfree(type);
-+}
-+
-+void pa_binding_target_type_add_field(pa_binding_target_type *type, const char *name, size_t offset) {
-+ struct field_entry *entry;
-+
-+ pa_assert(type);
-+ pa_assert(name);
-+
-+ entry = pa_xnew0(struct field_entry, 1);
-+ entry->name = pa_xstrdup(name);
-+ entry->offset = offset;
-+
-+ pa_assert_se(pa_hashmap_put(type->fields, entry->name, entry) >= 0);
-+}
-+
-+int pa_binding_target_type_get_field_offset(pa_binding_target_type *type, const char *field, size_t *offset) {
-+ struct field_entry *entry;
-+
-+ pa_assert(type);
-+ pa_assert(field);
-+ pa_assert(offset);
-+
-+ entry = pa_hashmap_get(type->fields, field);
-+ if (!entry)
-+ return -PA_ERR_NOENTITY;
-+
-+ *offset = entry->offset;
-+
-+ return 0;
-+}
-+
-+static pa_hook_result_t target_type_added_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_binding_target_type *type = call_data;
-+ pa_binding *binding = userdata;
-+
-+ pa_assert(type);
-+ pa_assert(binding);
-+
-+ if (!pa_streq(type->name, binding->target_info->type))
-+ return PA_HOOK_OK;
-+
-+ set_target_type(binding, type);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t target_type_removed_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_binding_target_type *type = call_data;
-+ pa_binding *binding = userdata;
-+
-+ pa_assert(type);
-+ pa_assert(binding);
-+
-+ if (type != binding->target_type)
-+ return PA_HOOK_OK;
-+
-+ set_target_type(binding, NULL);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t target_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_binding *binding = userdata;
-+
-+ pa_assert(call_data);
-+ pa_assert(binding);
-+
-+ if (!pa_streq(binding->target_type->get_name(call_data), binding->target_info->name))
-+ return PA_HOOK_OK;
-+
-+ set_target_object(binding, call_data);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t target_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_binding *binding = userdata;
-+
-+ pa_assert(call_data);
-+ pa_assert(binding);
-+
-+ if (call_data != binding->target_object)
-+ return PA_HOOK_OK;
-+
-+ set_target_object(binding, NULL);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void set_target_object(pa_binding *binding, void *object) {
-+ pa_assert(binding);
-+
-+ binding->target_object = object;
-+
-+ if (object) {
-+ if (binding->target_put_slot) {
-+ pa_hook_slot_free(binding->target_put_slot);
-+ binding->target_put_slot = NULL;
-+ }
-+
-+ if (!binding->target_unlink_slot)
-+ binding->target_unlink_slot = pa_hook_connect(binding->target_type->unlink_hook, PA_HOOK_NORMAL, target_unlink_cb,
-+ binding);
-+
-+ if (binding->target_field_offset_valid)
-+ binding->owner_info->set_value(binding->owner_info->userdata,
-+ *((void **) (((uint8_t *) object) + binding->target_field_offset)));
-+ else
-+ binding->owner_info->set_value(binding->owner_info->userdata, NULL);
-+ } else {
-+ if (binding->target_unlink_slot) {
-+ pa_hook_slot_free(binding->target_unlink_slot);
-+ binding->target_unlink_slot = NULL;
-+ }
-+
-+ if (binding->target_type) {
-+ if (!binding->target_put_slot)
-+ binding->target_put_slot = pa_hook_connect(binding->target_type->put_hook, PA_HOOK_NORMAL, target_put_cb, binding);
-+ } else {
-+ if (binding->target_put_slot) {
-+ pa_hook_slot_free(binding->target_put_slot);
-+ binding->target_put_slot = NULL;
-+ }
-+ }
-+
-+ binding->owner_info->set_value(binding->owner_info->userdata, NULL);
-+ }
-+}
-+
-+static void set_target_type(pa_binding *binding, pa_binding_target_type *type) {
-+ pa_assert(binding);
-+
-+ binding->target_type = type;
-+
-+ if (type) {
-+ int r;
-+
-+ if (binding->target_type_added_slot) {
-+ pa_hook_slot_free(binding->target_type_added_slot);
-+ binding->target_type_added_slot = NULL;
-+ }
-+
-+ if (!binding->target_type_removed_slot)
-+ binding->target_type_removed_slot =
-+ pa_hook_connect(&binding->volume_api->hooks[PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_REMOVED],
-+ PA_HOOK_NORMAL, target_type_removed_cb, binding);
-+
-+ r = pa_binding_target_type_get_field_offset(type, binding->target_info->field, &binding->target_field_offset);
-+ if (r >= 0)
-+ binding->target_field_offset_valid = true;
-+ else {
-+ pa_log_warn("Reference to non-existing field \"%s\" in binding target type \"%s\".", binding->target_info->field,
-+ type->name);
-+ binding->target_field_offset_valid = false;
-+ }
-+
-+ set_target_object(binding, pa_hashmap_get(type->objects, binding->target_info->name));
-+ } else {
-+ if (binding->target_type_removed_slot) {
-+ pa_hook_slot_free(binding->target_type_removed_slot);
-+ binding->target_type_removed_slot = NULL;
-+ }
-+
-+ if (!binding->target_type_added_slot)
-+ binding->target_type_added_slot =
-+ pa_hook_connect(&binding->volume_api->hooks[PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_ADDED],
-+ PA_HOOK_NORMAL, target_type_added_cb, binding);
-+
-+ binding->target_field_offset_valid = false;
-+
-+ set_target_object(binding, NULL);
-+ }
-+}
-+
-+pa_binding *pa_binding_new(pa_volume_api *api, const pa_binding_owner_info *owner_info,
-+ const pa_binding_target_info *target_info) {
-+ pa_binding *binding;
-+
-+ pa_assert(api);
-+ pa_assert(owner_info);
-+ pa_assert(target_info);
-+
-+ binding = pa_xnew0(pa_binding, 1);
-+ binding->volume_api = api;
-+ binding->owner_info = pa_binding_owner_info_copy(owner_info);
-+ binding->target_info = pa_binding_target_info_copy(target_info);
-+
-+ set_target_type(binding, pa_hashmap_get(api->binding_target_types, target_info->type));
-+
-+ return binding;
-+}
-+
-+void pa_binding_free(pa_binding *binding) {
-+ pa_assert(binding);
-+
-+ if (binding->target_unlink_slot)
-+ pa_hook_slot_free(binding->target_unlink_slot);
-+
-+ if (binding->target_put_slot)
-+ pa_hook_slot_free(binding->target_put_slot);
-+
-+ if (binding->target_type_removed_slot)
-+ pa_hook_slot_free(binding->target_type_removed_slot);
-+
-+ if (binding->target_type_added_slot)
-+ pa_hook_slot_free(binding->target_type_added_slot);
-+
-+ if (binding->target_info)
-+ pa_binding_target_info_free(binding->target_info);
-+
-+ if (binding->owner_info)
-+ pa_binding_owner_info_free(binding->owner_info);
-+
-+ pa_xfree(binding);
-+}
-diff --git a/src/modules/volume-api/binding.h b/src/modules/volume-api/binding.h
-new file mode 100644
-index 0000000..ba4dea8
---- /dev/null
-+++ b/src/modules/volume-api/binding.h
-@@ -0,0 +1,128 @@
-+#ifndef foobindinghfoo
-+#define foobindinghfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+typedef struct pa_binding pa_binding;
-+typedef struct pa_binding_owner_info pa_binding_owner_info;
-+typedef struct pa_binding_target_info pa_binding_target_info;
-+typedef struct pa_binding_target_type pa_binding_target_type;
-+
-+typedef void (*pa_binding_set_value_cb_t)(void *userdata, void *value);
-+
-+struct pa_binding_owner_info {
-+ /* This is the object that has the variable that the binding is created
-+ * for. */
-+ void *userdata;
-+
-+ /* Called when the owner object's value needs to be updated. The userdata
-+ * parameter of the callback is the same as the userdata field in this
-+ * struct, and the value parameter is the new value for whatever variable
-+ * the binding was created for. */
-+ pa_binding_set_value_cb_t set_value;
-+};
-+
-+pa_binding_owner_info *pa_binding_owner_info_new(pa_binding_set_value_cb_t set_value, void *userdata);
-+pa_binding_owner_info *pa_binding_owner_info_copy(const pa_binding_owner_info *info);
-+void pa_binding_owner_info_free(pa_binding_owner_info *info);
-+
-+struct pa_binding_target_info {
-+ /* The target type name as registered with
-+ * pa_binding_target_type_register(). */
-+ char *type;
-+
-+ /* The target object name as returned by the get_name callback of
-+ * pa_binding_target_type. */
-+ char *name;
-+
-+ /* The target field of the target object. */
-+ char *field;
-+};
-+
-+pa_binding_target_info *pa_binding_target_info_new(const char *type, const char *name, const char *field);
-+
-+/* The string format is "bind:TYPE:NAME". */
-+int pa_binding_target_info_new_from_string(const char *str, const char *field, pa_binding_target_info **info);
-+
-+pa_binding_target_info *pa_binding_target_info_copy(const pa_binding_target_info *info);
-+void pa_binding_target_info_free(pa_binding_target_info *info);
-+
-+typedef const char *(*pa_binding_target_type_get_name_cb_t)(void *object);
-+
-+struct pa_binding_target_type {
-+ /* Identifier for this target type. */
-+ char *name;
-+
-+ /* name -> object. Points directly to some "master" object hashmap, so the
-+ * hashmap is not owned by pa_binding_target_type. */
-+ pa_hashmap *objects;
-+
-+ /* The hook that notifies of new objects if this target type. The call data
-+ * of the hook must be a pointer to the new object (this should be true for
-+ * all PUT hooks, so don't worry too much). */
-+ pa_hook *put_hook;
-+
-+ /* The hook that notifies of unlinked objects of this target type. The call
-+ * data of the hook must be a pointer to the removed object (this should be
-+ * true for all UNLINK hooks, so don't worry too much). */
-+ pa_hook *unlink_hook;
-+
-+ /* Function for getting the name of an object of this target type. */
-+ pa_binding_target_type_get_name_cb_t get_name;
-+
-+ pa_hashmap *fields;
-+};
-+
-+pa_binding_target_type *pa_binding_target_type_new(const char *name, pa_hashmap *objects, pa_hook *put_hook,
-+ pa_hook *unlink_hook, pa_binding_target_type_get_name_cb_t get_name);
-+void pa_binding_target_type_free(pa_binding_target_type *type);
-+
-+/* Useful when calling pa_binding_target_type_add_field(). */
-+#define PA_BINDING_CALCULATE_FIELD_OFFSET(type, field) ((size_t) &(((type *) 0)->field))
-+
-+/* Called during the type initialization (right after
-+ * pa_binding_target_type_new()). */
-+void pa_binding_target_type_add_field(pa_binding_target_type *type, const char *name, size_t offset);
-+
-+int pa_binding_target_type_get_field_offset(pa_binding_target_type *type, const char *field, size_t *offset);
-+
-+struct pa_binding {
-+ pa_volume_api *volume_api;
-+ pa_binding_owner_info *owner_info;
-+ pa_binding_target_info *target_info;
-+ pa_binding_target_type *target_type;
-+ void *target_object;
-+ size_t target_field_offset;
-+ bool target_field_offset_valid;
-+ pa_hook_slot *target_type_added_slot;
-+ pa_hook_slot *target_type_removed_slot;
-+ pa_hook_slot *target_put_slot;
-+ pa_hook_slot *target_unlink_slot;
-+};
-+
-+pa_binding *pa_binding_new(pa_volume_api *api, const pa_binding_owner_info *owner_info,
-+ const pa_binding_target_info *target_info);
-+void pa_binding_free(pa_binding *binding);
-+
-+#endif
-diff --git a/src/modules/volume-api/bvolume.h b/src/modules/volume-api/bvolume.h
-new file mode 100644
-index 0000000..0317fb6
---- /dev/null
-+++ b/src/modules/volume-api/bvolume.h
-@@ -0,0 +1,43 @@
-+#ifndef foobvolumehfoo
-+#define foobvolumehfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <pulse/ext-volume-api.h>
-+
-+typedef pa_ext_volume_api_bvolume pa_bvolume;
-+
-+#define pa_balance_valid pa_ext_volume_api_balance_valid
-+#define pa_bvolume_valid pa_ext_volume_api_bvolume_valid
-+#define pa_bvolume_init_invalid pa_ext_volume_api_bvolume_init_invalid
-+#define pa_bvolume_init_mono pa_ext_volume_api_bvolume_init_mono
-+#define pa_bvolume_equal pa_ext_volume_api_bvolume_equal
-+#define pa_bvolume_from_cvolume pa_ext_volume_api_bvolume_from_cvolume
-+#define pa_bvolume_to_cvolume pa_ext_volume_api_bvolume_to_cvolume
-+#define pa_bvolume_copy_balance pa_ext_volume_api_bvolume_copy_balance
-+#define pa_bvolume_reset_balance pa_ext_volume_api_bvolume_reset_balance
-+#define pa_bvolume_remap pa_ext_volume_api_bvolume_remap
-+
-+#define PA_BVOLUME_SNPRINT_BALANCE_MAX PA_EXT_VOLUME_API_BVOLUME_SNPRINT_BALANCE_MAX
-+#define pa_bvolume_snprint_balance pa_ext_volume_api_bvolume_snprint_balance
-+
-+#endif
-diff --git a/src/modules/volume-api/device-creator.c b/src/modules/volume-api/device-creator.c
-new file mode 100644
-index 0000000..1d912ba
---- /dev/null
-+++ b/src/modules/volume-api/device-creator.c
-@@ -0,0 +1,1108 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "device-creator.h"
-+
-+#include <modules/volume-api/device.h>
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/i18n.h>
-+
-+struct pa_device_creator {
-+ pa_volume_api *volume_api;
-+ pa_hashmap *devices; /* pa_device_port/pa_sink/pa_source -> struct device */
-+ pa_hook_slot *card_put_slot;
-+ pa_hook_slot *card_unlink_slot;
-+ pa_hook_slot *sink_put_slot;
-+ pa_hook_slot *sink_unlink_slot;
-+ pa_hook_slot *source_put_slot;
-+ pa_hook_slot *source_unlink_slot;
-+};
-+
-+enum device_type {
-+ DEVICE_TYPE_PORT,
-+ DEVICE_TYPE_PORT_MONITOR,
-+ DEVICE_TYPE_SINK,
-+ DEVICE_TYPE_SOURCE,
-+};
-+
-+struct device_volume_control {
-+ struct device *device;
-+ pa_volume_control *volume_control;
-+
-+ bool unlinked;
-+
-+ pa_hook_slot *volume_changed_slot;
-+};
-+
-+struct device_mute_control {
-+ struct device *device;
-+ pa_mute_control *mute_control;
-+
-+ bool unlinked;
-+
-+ pa_hook_slot *mute_changed_slot;
-+};
-+
-+struct device {
-+ pa_device_creator *creator;
-+ enum device_type type;
-+ pa_device_port *port;
-+ pa_sink *sink;
-+ pa_source *source;
-+ pa_device *device;
-+ struct device_volume_control *volume_control;
-+ struct device_mute_control *mute_control;
-+
-+ bool unlinked;
-+
-+ pa_hook_slot *proplist_changed_slot;
-+ pa_hook_slot *port_active_changed_slot;
-+ struct device *monitor;
-+};
-+
-+static const char *device_type_from_icon_name(const char *icon_name) {
-+ if (!icon_name)
-+ return NULL;
-+
-+ if (pa_streq(icon_name, "audio-input-microphone"))
-+ return "microphone";
-+
-+ if (pa_streq(icon_name, "audio-speakers"))
-+ return "speakers";
-+
-+ if (pa_streq(icon_name, "audio-headphones"))
-+ return "headphones";
-+
-+ return NULL;
-+}
-+
-+static const char *device_type_from_port_name(pa_device_port *port) {
-+ pa_assert(port);
-+
-+ if (strstr(port->name, "analog")) {
-+ if (port->direction == PA_DIRECTION_INPUT)
-+ return "analog-input";
-+ else
-+ return "analog-output";
-+ }
-+
-+ if (strstr(port->name, "hdmi")) {
-+ if (port->direction == PA_DIRECTION_INPUT)
-+ return "hdmi-input";
-+ else
-+ return "hdmi-output";
-+ }
-+
-+ if (strstr(port->name, "iec958")) {
-+ if (port->direction == PA_DIRECTION_INPUT)
-+ return "spdif-input";
-+ else
-+ return "spdif-output";
-+ }
-+
-+ return NULL;
-+}
-+
-+static const char *device_type_from_port(pa_device_port *port) {
-+ const char *device_type;
-+
-+ pa_assert(port);
-+
-+ device_type = device_type_from_icon_name(pa_proplist_gets(port->proplist, PA_PROP_DEVICE_ICON_NAME));
-+ if (device_type)
-+ return device_type;
-+
-+ device_type = device_type_from_port_name(port);
-+ if (device_type)
-+ return device_type;
-+
-+ return NULL;
-+}
-+
-+static const char *get_sink_description(pa_sink *sink) {
-+ const char *description;
-+
-+ pa_assert(sink);
-+
-+ description = pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION);
-+ if (description)
-+ return description;
-+
-+ return sink->name;
-+}
-+
-+static const char *get_source_description(pa_source *source) {
-+ const char *description;
-+
-+ pa_assert(source);
-+
-+ description = pa_proplist_gets(source->proplist, PA_PROP_DEVICE_DESCRIPTION);
-+ if (description)
-+ return description;
-+
-+ return source->name;
-+}
-+
-+static int volume_control_set_volume_cb(pa_volume_control *c, const pa_bvolume *volume, bool set_volume, bool set_balance) {
-+ struct device_volume_control *control;
-+ struct device *device;
-+ pa_bvolume bvolume;
-+ pa_cvolume cvolume;
-+
-+ pa_assert(c);
-+ pa_assert(volume);
-+
-+ control = c->userdata;
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ pa_bvolume_from_cvolume(&bvolume, &device->sink->reference_volume, &device->sink->channel_map);
-+ else
-+ pa_bvolume_from_cvolume(&bvolume, &device->source->reference_volume, &device->source->channel_map);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ pa_bvolume_from_cvolume(&bvolume, &device->sink->reference_volume, &device->sink->channel_map);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_bvolume_from_cvolume(&bvolume, &device->source->reference_volume, &device->source->channel_map);
-+ break;
-+ }
-+
-+ if (set_volume)
-+ bvolume.volume = volume->volume;
-+
-+ if (set_balance)
-+ pa_bvolume_copy_balance(&bvolume, volume);
-+
-+ pa_bvolume_to_cvolume(&bvolume, &cvolume);
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ pa_sink_set_volume(device->sink, &cvolume, true, true);
-+ else
-+ pa_source_set_volume(device->source, &cvolume, true, true);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_source_set_volume(device->source, &cvolume, true, true);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ pa_sink_set_volume(device->sink, &cvolume, true, true);
-+ break;
-+ }
-+
-+ return 0;
-+}
-+
-+static struct device_volume_control *device_volume_control_new(struct device *device) {
-+ struct device_volume_control *control;
-+ const char *name = NULL;
-+ bool convertible_to_dB = false;
-+ bool channel_map_is_writable;
-+
-+ pa_assert(device);
-+
-+ control = pa_xnew0(struct device_volume_control, 1);
-+ control->device = device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ name = "port-volume-control";
-+
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ convertible_to_dB = device->sink->flags & PA_SINK_DECIBEL_VOLUME;
-+ else
-+ convertible_to_dB = device->source->flags & PA_SOURCE_DECIBEL_VOLUME;
-+
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ name = "port-monitor-volume-control";
-+ convertible_to_dB = device->source->flags & PA_SOURCE_DECIBEL_VOLUME;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ name = "sink-volume-control";
-+ convertible_to_dB = device->sink->flags & PA_SINK_DECIBEL_VOLUME;
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE:
-+ name = "source-volume-control";
-+ convertible_to_dB = device->source->flags & PA_SOURCE_DECIBEL_VOLUME;
-+ break;
-+ }
-+
-+ channel_map_is_writable = false;
-+ control->volume_control = pa_volume_control_new(device->creator->volume_api, name, device->device->description,
-+ convertible_to_dB, channel_map_is_writable);
-+ control->volume_control->set_volume = volume_control_set_volume_cb;
-+ control->volume_control->userdata = control;
-+
-+ return control;
-+}
-+
-+static pa_hook_result_t sink_or_source_volume_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct device_volume_control *control = userdata;
-+ struct device *device;
-+ pa_sink *sink = NULL;
-+ pa_source *source = NULL;
-+ pa_bvolume bvolume;
-+
-+ pa_assert(control);
-+ pa_assert(call_data);
-+
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ sink = call_data;
-+ else
-+ source = call_data;
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ source = call_data;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ sink = call_data;
-+ break;
-+ }
-+
-+ if ((sink && sink != device->sink) || (source && source != device->source))
-+ return PA_HOOK_OK;
-+
-+ if (sink)
-+ pa_bvolume_from_cvolume(&bvolume, &sink->reference_volume, &sink->channel_map);
-+ else
-+ pa_bvolume_from_cvolume(&bvolume, &source->reference_volume, &source->channel_map);
-+
-+ pa_volume_control_volume_changed(control->volume_control, &bvolume, true, true);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void volume_control_set_initial_volume_cb(pa_volume_control *c) {
-+ struct device_volume_control *control;
-+ struct device *device;
-+ pa_cvolume cvolume;
-+
-+ pa_assert(c);
-+
-+ control = c->userdata;
-+ device = control->device;
-+ pa_bvolume_to_cvolume(&control->volume_control->volume, &cvolume);
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ pa_sink_set_volume(device->sink, &cvolume, true, true);
-+ else
-+ pa_source_set_volume(device->source, &cvolume, true, true);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_source_set_volume(device->source, &cvolume, true, true);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ pa_sink_set_volume(device->sink, &cvolume, true, true);
-+ break;
-+ }
-+}
-+
-+static void device_volume_control_put(struct device_volume_control *control) {
-+ struct device *device;
-+ pa_bvolume volume;
-+
-+ pa_assert(control);
-+
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT) {
-+ control->volume_changed_slot = pa_hook_connect(&device->port->core->hooks[PA_CORE_HOOK_SINK_VOLUME_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_volume_changed_cb, control);
-+ pa_bvolume_from_cvolume(&volume, &device->sink->reference_volume, &device->sink->channel_map);
-+ } else {
-+ control->volume_changed_slot = pa_hook_connect(&device->port->core->hooks[PA_CORE_HOOK_SOURCE_VOLUME_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_volume_changed_cb, control);
-+ pa_bvolume_from_cvolume(&volume, &device->source->reference_volume, &device->source->channel_map);
-+ }
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ control->volume_changed_slot = pa_hook_connect(&device->source->core->hooks[PA_CORE_HOOK_SOURCE_VOLUME_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_volume_changed_cb, control);
-+ pa_bvolume_from_cvolume(&volume, &device->source->reference_volume, &device->source->channel_map);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ control->volume_changed_slot = pa_hook_connect(&device->sink->core->hooks[PA_CORE_HOOK_SINK_VOLUME_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_volume_changed_cb, control);
-+ pa_bvolume_from_cvolume(&volume, &device->sink->reference_volume, &device->sink->channel_map);
-+ break;
-+ }
-+
-+ pa_volume_control_put(control->volume_control, &volume, volume_control_set_initial_volume_cb);
-+}
-+
-+static void device_volume_control_unlink(struct device_volume_control *control) {
-+ pa_assert(control);
-+
-+ if (control->unlinked)
-+ return;
-+
-+ control->unlinked = true;
-+
-+ if (control->volume_control)
-+ pa_volume_control_unlink(control->volume_control);
-+
-+ if (control->volume_changed_slot) {
-+ pa_hook_slot_free(control->volume_changed_slot);
-+ control->volume_changed_slot = NULL;
-+ }
-+}
-+
-+static void device_volume_control_free(struct device_volume_control *control) {
-+ pa_assert(control);
-+
-+ if (!control->unlinked)
-+ device_volume_control_unlink(control);
-+
-+ if (control->volume_control)
-+ pa_volume_control_free(control->volume_control);
-+
-+ pa_xfree(control);
-+}
-+
-+static int mute_control_set_mute_cb(pa_mute_control *c, bool mute) {
-+ struct device_mute_control *control;
-+ struct device *device;
-+
-+ pa_assert(c);
-+
-+ control = c->userdata;
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ pa_sink_set_mute(device->sink, mute, true);
-+ else
-+ pa_source_set_mute(device->source, mute, true);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_source_set_mute(device->source, mute, true);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ pa_sink_set_mute(device->sink, mute, true);
-+ break;
-+ }
-+
-+ return 0;
-+}
-+
-+static struct device_mute_control *device_mute_control_new(struct device *device) {
-+ struct device_mute_control *control;
-+ const char *name = NULL;
-+
-+ pa_assert(device);
-+
-+ control = pa_xnew0(struct device_mute_control, 1);
-+ control->device = device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ name = "port-mute-control";
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ name = "port-monitor-mute-control";
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ name = "sink-mute-control";
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE:
-+ name = "source-mute-control";
-+ break;
-+ }
-+
-+ control->mute_control = pa_mute_control_new(device->creator->volume_api, name, device->device->description);
-+ control->mute_control->set_mute = mute_control_set_mute_cb;
-+ control->mute_control->userdata = control;
-+
-+ return control;
-+}
-+
-+static pa_hook_result_t sink_or_source_mute_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct device_mute_control *control = userdata;
-+ struct device *device;
-+ pa_sink *sink = NULL;
-+ pa_source *source = NULL;
-+ bool mute;
-+
-+ pa_assert(control);
-+ pa_assert(call_data);
-+
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ sink = call_data;
-+ else
-+ source = call_data;
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ source = call_data;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ sink = call_data;
-+ break;
-+ }
-+
-+ if ((sink && sink != device->sink) || (source && source != device->source))
-+ return PA_HOOK_OK;
-+
-+ if (sink)
-+ mute = sink->muted;
-+ else
-+ mute = source->muted;
-+
-+ pa_mute_control_mute_changed(control->mute_control, mute);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void mute_control_set_initial_mute_cb(pa_mute_control *c) {
-+ struct device_volume_control *control;
-+ struct device *device;
-+
-+ pa_assert(c);
-+
-+ control = c->userdata;
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ pa_sink_set_mute(device->sink, c->mute, true);
-+ else
-+ pa_source_set_mute(device->source, c->mute, true);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_source_set_mute(device->source, c->mute, true);
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ pa_sink_set_mute(device->sink, c->mute, true);
-+ break;
-+ }
-+}
-+
-+static void device_mute_control_put(struct device_mute_control *control) {
-+ struct device *device;
-+ bool mute = false;
-+
-+ pa_assert(control);
-+
-+ device = control->device;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT) {
-+ control->mute_changed_slot = pa_hook_connect(&device->port->core->hooks[PA_CORE_HOOK_SINK_MUTE_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_mute_changed_cb, control);
-+ mute = device->sink->muted;
-+ } else {
-+ control->mute_changed_slot = pa_hook_connect(&device->port->core->hooks[PA_CORE_HOOK_SOURCE_MUTE_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_mute_changed_cb, control);
-+ mute = device->source->muted;
-+ }
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ case DEVICE_TYPE_SOURCE:
-+ control->mute_changed_slot = pa_hook_connect(&device->source->core->hooks[PA_CORE_HOOK_SOURCE_MUTE_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_mute_changed_cb, control);
-+ mute = device->source->muted;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ control->mute_changed_slot = pa_hook_connect(&device->sink->core->hooks[PA_CORE_HOOK_SINK_MUTE_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_mute_changed_cb, control);
-+ mute = device->sink->muted;
-+ break;
-+ }
-+
-+ pa_mute_control_put(control->mute_control, mute, true, mute_control_set_initial_mute_cb);
-+}
-+
-+static void device_mute_control_unlink(struct device_mute_control *control) {
-+ pa_assert(control);
-+
-+ if (control->unlinked)
-+ return;
-+
-+ control->unlinked = true;
-+
-+ if (control->mute_control)
-+ pa_mute_control_unlink(control->mute_control);
-+
-+ if (control->mute_changed_slot) {
-+ pa_hook_slot_free(control->mute_changed_slot);
-+ control->mute_changed_slot = NULL;
-+ }
-+}
-+
-+static void device_mute_control_free(struct device_mute_control *control) {
-+ pa_assert(control);
-+
-+ if (!control->unlinked)
-+ device_mute_control_unlink(control);
-+
-+ if (control->mute_control)
-+ pa_mute_control_free(control->mute_control);
-+
-+ pa_xfree(control);
-+}
-+
-+static void device_set_sink_and_source_from_port(struct device *device) {
-+ pa_sink *sink;
-+ pa_source *source;
-+ uint32_t idx;
-+
-+ pa_assert(device);
-+
-+ device->sink = NULL;
-+ device->source = NULL;
-+
-+ if (!device->port->active)
-+ return;
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT) {
-+ PA_IDXSET_FOREACH(sink, device->port->card->sinks, idx) {
-+ if (sink->active_port == device->port) {
-+ device->sink = sink;
-+ break;
-+ }
-+ }
-+
-+ pa_assert(device->sink);
-+ } else {
-+ PA_IDXSET_FOREACH(source, device->port->card->sources, idx) {
-+ if (source->active_port == device->port) {
-+ device->source = source;
-+ break;
-+ }
-+ }
-+
-+ pa_assert(device->source);
-+ }
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR: {
-+ PA_IDXSET_FOREACH(sink, device->port->card->sinks, idx) {
-+ if (sink->active_port == device->port) {
-+ device->sink = sink;
-+ device->source = sink->monitor_source;
-+ break;
-+ }
-+ }
-+
-+ pa_assert(device->sink);
-+ break;
-+ }
-+
-+ case DEVICE_TYPE_SINK:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_assert_not_reached();
-+ }
-+}
-+
-+static pa_hook_result_t sink_or_source_proplist_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct device *device = userdata;
-+ pa_sink *sink = NULL;
-+ pa_source *source = NULL;
-+ const char *description = NULL;
-+
-+ pa_assert(device);
-+ pa_assert(call_data);
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ pa_assert_not_reached();
-+
-+ case DEVICE_TYPE_SINK:
-+ sink = call_data;
-+
-+ if (sink != device->sink)
-+ return PA_HOOK_OK;
-+
-+ description = get_sink_description(sink);
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE:
-+ source = call_data;
-+
-+ if (source != device->source)
-+ return PA_HOOK_OK;
-+
-+ description = get_source_description(source);
-+ break;
-+ }
-+
-+ pa_device_description_changed(device->device, description);
-+ pa_volume_control_description_changed(device->volume_control->volume_control, description);
-+ pa_mute_control_description_changed(device->mute_control->mute_control, description);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static struct device *device_new(pa_device_creator *creator, enum device_type type, void *core_device) {
-+ struct device *device = NULL;
-+ const char *name = NULL;
-+ char *description = NULL;
-+ pa_direction_t direction = PA_DIRECTION_OUTPUT;
-+ const char *device_type = NULL;
-+ bool create_volume_and_mute_controls = true;
-+
-+ pa_assert(creator);
-+ pa_assert(core_device);
-+
-+ device = pa_xnew0(struct device, 1);
-+ device->creator = creator;
-+ device->type = type;
-+
-+ switch (type) {
-+ case DEVICE_TYPE_PORT:
-+ device->port = core_device;
-+ device_set_sink_and_source_from_port(device);
-+ name = "port-device";
-+ description = pa_xstrdup(device->port->description);
-+ direction = device->port->direction;
-+ device_type = device_type_from_port(device->port);
-+
-+ if (!device->sink && !device->source)
-+ create_volume_and_mute_controls = false;
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ device->port = core_device;
-+ device_set_sink_and_source_from_port(device);
-+ name = "port-monitor-device";
-+ description = pa_sprintf_malloc(_("Monitor of %s"), device->port->description);
-+ direction = PA_DIRECTION_INPUT;
-+
-+ if (!device->source)
-+ create_volume_and_mute_controls = false;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ device->sink = core_device;
-+ name = "sink-device";
-+ description = pa_xstrdup(get_sink_description(device->sink));
-+ direction = PA_DIRECTION_OUTPUT;
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE:
-+ device->source = core_device;
-+ name = "source-device";
-+ description = pa_xstrdup(get_source_description(device->source));
-+ direction = PA_DIRECTION_INPUT;
-+ break;
-+ }
-+
-+ device->device = pa_device_new(creator->volume_api, name, description, direction, &device_type, device_type ? 1 : 0);
-+ pa_xfree(description);
-+
-+ if (create_volume_and_mute_controls) {
-+ device->volume_control = device_volume_control_new(device);
-+ device->mute_control = device_mute_control_new(device);
-+ }
-+
-+ switch (type) {
-+ case DEVICE_TYPE_PORT:
-+ if (device->port->direction == PA_DIRECTION_OUTPUT)
-+ device->monitor = device_new(creator, DEVICE_TYPE_PORT_MONITOR, device->port);
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ device->proplist_changed_slot = pa_hook_connect(&device->sink->core->hooks[PA_CORE_HOOK_SINK_PROPLIST_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_proplist_changed_cb, device);
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE:
-+ device->proplist_changed_slot = pa_hook_connect(&device->source->core->hooks[PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED],
-+ PA_HOOK_NORMAL, sink_or_source_proplist_changed_cb, device);
-+ break;
-+ }
-+
-+ return device;
-+}
-+
-+static pa_hook_result_t port_active_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct device *device = userdata;
-+ pa_device_port *port = call_data;
-+ bool should_have_volume_and_mute_controls = false;
-+
-+ pa_assert(device);
-+ pa_assert(port);
-+
-+ if (port != device->port)
-+ return PA_HOOK_OK;
-+
-+ device_set_sink_and_source_from_port(device);
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ should_have_volume_and_mute_controls = device->sink || device->source;
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ should_have_volume_and_mute_controls = !!device->source;
-+ break;
-+
-+ case DEVICE_TYPE_SINK:
-+ case DEVICE_TYPE_SOURCE:
-+ pa_assert_not_reached();
-+ }
-+
-+ if (should_have_volume_and_mute_controls && !device->volume_control) {
-+ pa_assert(!device->mute_control);
-+
-+ device->volume_control = device_volume_control_new(device);
-+ device_volume_control_put(device->volume_control);
-+ pa_device_set_default_volume_control(device->device, device->volume_control->volume_control);
-+
-+ device->mute_control = device_mute_control_new(device);
-+ device_mute_control_put(device->mute_control);
-+ pa_device_set_default_mute_control(device->device, device->mute_control->mute_control);
-+ }
-+
-+ if (!should_have_volume_and_mute_controls && device->volume_control) {
-+ pa_assert(device->mute_control);
-+
-+ device_mute_control_free(device->mute_control);
-+ device->mute_control = NULL;
-+ device_volume_control_free(device->volume_control);
-+ device->volume_control = NULL;
-+ }
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void device_put(struct device *device) {
-+ pa_assert(device);
-+
-+ switch (device->type) {
-+ case DEVICE_TYPE_PORT:
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ device->port_active_changed_slot = pa_hook_connect(&device->port->core->hooks[PA_CORE_HOOK_PORT_ACTIVE_CHANGED],
-+ PA_HOOK_NORMAL, port_active_changed_cb, device);
-+
-+ case DEVICE_TYPE_SINK:
-+ case DEVICE_TYPE_SOURCE:
-+ break;
-+ }
-+
-+ if (device->volume_control)
-+ device_volume_control_put(device->volume_control);
-+
-+ if (device->mute_control)
-+ device_mute_control_put(device->mute_control);
-+
-+ pa_device_put(device->device, device->volume_control ? device->volume_control->volume_control : NULL,
-+ device->mute_control ? device->mute_control->mute_control : NULL);
-+
-+ if (device->monitor)
-+ device_put(device->monitor);
-+}
-+
-+static void device_unlink(struct device *device) {
-+ pa_assert(device);
-+
-+ if (device->unlinked)
-+ return;
-+
-+ device->unlinked = true;
-+
-+ if (device->monitor)
-+ device_unlink(device->monitor);
-+
-+ if (device->device)
-+ pa_device_unlink(device->device);
-+
-+ if (device->mute_control)
-+ device_mute_control_unlink(device->mute_control);
-+
-+ if (device->volume_control)
-+ device_volume_control_unlink(device->volume_control);
-+
-+ if (device->port_active_changed_slot) {
-+ pa_hook_slot_free(device->port_active_changed_slot);
-+ device->port_active_changed_slot = NULL;
-+ }
-+}
-+
-+static void device_free(struct device *device) {
-+ pa_assert(device);
-+
-+ if (!device->unlinked)
-+ device_unlink(device);
-+
-+ if (device->monitor)
-+ device_free(device->monitor);
-+
-+ if (device->proplist_changed_slot)
-+ pa_hook_slot_free(device->proplist_changed_slot);
-+
-+ if (device->mute_control)
-+ device_mute_control_free(device->mute_control);
-+
-+ if (device->volume_control)
-+ device_volume_control_free(device->volume_control);
-+
-+ if (device->device)
-+ pa_device_free(device->device);
-+
-+ pa_xfree(device);
-+}
-+
-+static void create_device(pa_device_creator *creator, enum device_type type, void *core_device) {
-+ struct device *device;
-+
-+ pa_assert(creator);
-+ pa_assert(core_device);
-+
-+ switch (type) {
-+ case DEVICE_TYPE_PORT:
-+ break;
-+
-+ case DEVICE_TYPE_PORT_MONITOR:
-+ pa_assert_not_reached();
-+
-+ case DEVICE_TYPE_SINK:
-+ if (!pa_hashmap_isempty(((pa_sink *) core_device)->ports))
-+ return;
-+ break;
-+
-+ case DEVICE_TYPE_SOURCE: {
-+ pa_source *source = core_device;
-+
-+ if (source->monitor_of && !pa_hashmap_isempty(source->monitor_of->ports))
-+ return;
-+
-+ if (!pa_hashmap_isempty(((pa_source *) core_device)->ports))
-+ return;
-+ break;
-+ }
-+ }
-+
-+ device = device_new(creator, type, core_device);
-+ pa_hashmap_put(creator->devices, core_device, device);
-+ device_put(device);
-+}
-+
-+static pa_hook_result_t card_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_card *card = call_data;
-+ pa_device_port *port;
-+ void *state;
-+
-+ pa_assert(creator);
-+ pa_assert(card);
-+
-+ PA_HASHMAP_FOREACH(port, card->ports, state)
-+ create_device(creator, DEVICE_TYPE_PORT, port);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t card_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_card *card = call_data;
-+ pa_device_port *port;
-+ void *state;
-+
-+ pa_assert(creator);
-+ pa_assert(card);
-+
-+ PA_HASHMAP_FOREACH(port, card->ports, state)
-+ pa_hashmap_remove_and_free(creator->devices, port);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t sink_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_sink *sink = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(sink);
-+
-+ create_device(creator, DEVICE_TYPE_SINK, sink);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t sink_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_sink *sink = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(sink);
-+
-+ pa_hashmap_remove_and_free(creator->devices, sink);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t source_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_source *source = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(source);
-+
-+ create_device(creator, DEVICE_TYPE_SOURCE, source);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t source_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_device_creator *creator = userdata;
-+ pa_source *source = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(source);
-+
-+ pa_hashmap_remove_and_free(creator->devices, source);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+pa_device_creator *pa_device_creator_new(pa_volume_api *api) {
-+ pa_device_creator *creator;
-+ pa_card *card;
-+ uint32_t idx;
-+ pa_sink *sink;
-+ pa_source *source;
-+
-+ pa_assert(api);
-+
-+ creator = pa_xnew0(pa_device_creator, 1);
-+ creator->volume_api = api;
-+ creator->devices = pa_hashmap_new_full(NULL, NULL, NULL, (pa_free_cb_t) device_free);
-+ creator->card_put_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_CARD_PUT], PA_HOOK_NORMAL, card_put_cb, creator);
-+ creator->card_unlink_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_CARD_UNLINK], PA_HOOK_NORMAL, card_unlink_cb,
-+ creator);
-+ creator->sink_put_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SINK_PUT], PA_HOOK_NORMAL, sink_put_cb, creator);
-+ creator->sink_unlink_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SINK_UNLINK], PA_HOOK_NORMAL, sink_unlink_cb,
-+ creator);
-+ creator->source_put_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SOURCE_PUT], PA_HOOK_NORMAL, source_put_cb,
-+ creator);
-+ creator->source_unlink_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SOURCE_UNLINK], PA_HOOK_NORMAL,
-+ source_unlink_cb, creator);
-+
-+ PA_IDXSET_FOREACH(card, api->core->cards, idx) {
-+ pa_device_port *port;
-+ void *state;
-+
-+ PA_HASHMAP_FOREACH(port, card->ports, state)
-+ create_device(creator, DEVICE_TYPE_PORT, port);
-+ }
-+
-+ PA_IDXSET_FOREACH(sink, api->core->sinks, idx)
-+ create_device(creator, DEVICE_TYPE_SINK, sink);
-+
-+ PA_IDXSET_FOREACH(source, api->core->sources, idx)
-+ create_device(creator, DEVICE_TYPE_SOURCE, source);
-+
-+ return creator;
-+}
-+
-+void pa_device_creator_free(pa_device_creator *creator) {
-+ pa_assert(creator);
-+
-+ if (creator->devices)
-+ pa_hashmap_remove_all(creator->devices);
-+
-+ if (creator->source_unlink_slot)
-+ pa_hook_slot_free(creator->source_unlink_slot);
-+
-+ if (creator->source_put_slot)
-+ pa_hook_slot_free(creator->source_put_slot);
-+
-+ if (creator->sink_unlink_slot)
-+ pa_hook_slot_free(creator->sink_unlink_slot);
-+
-+ if (creator->sink_put_slot)
-+ pa_hook_slot_free(creator->sink_put_slot);
-+
-+ if (creator->card_unlink_slot)
-+ pa_hook_slot_free(creator->card_unlink_slot);
-+
-+ if (creator->card_put_slot)
-+ pa_hook_slot_free(creator->card_put_slot);
-+
-+ if (creator->devices)
-+ pa_hashmap_free(creator->devices);
-+
-+ pa_xfree(creator);
-+}
-diff --git a/src/modules/volume-api/device-creator.h b/src/modules/volume-api/device-creator.h
-new file mode 100644
-index 0000000..bcec8d9
---- /dev/null
-+++ b/src/modules/volume-api/device-creator.h
-@@ -0,0 +1,32 @@
-+#ifndef foodevicecreatorhfoo
-+#define foodevicecreatorhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+typedef struct pa_device_creator pa_device_creator;
-+
-+pa_device_creator *pa_device_creator_new(pa_volume_api *api);
-+void pa_device_creator_free(pa_device_creator *creator);
-+
-+#endif
-diff --git a/src/modules/volume-api/device.c b/src/modules/volume-api/device.c
-new file mode 100644
-index 0000000..ea496ba
---- /dev/null
-+++ b/src/modules/volume-api/device.c
-@@ -0,0 +1,293 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "device.h"
-+
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulse/direction.h>
-+
-+#include <pulsecore/core-util.h>
-+
-+pa_device *pa_device_new(pa_volume_api *api, const char *name, const char *description, pa_direction_t direction,
-+ const char * const *device_types, unsigned n_device_types) {
-+ pa_device *device;
-+ unsigned i;
-+
-+ pa_assert(api);
-+ pa_assert(name);
-+ pa_assert(description);
-+ pa_assert(device_types || n_device_types == 0);
-+
-+ device = pa_xnew0(pa_device, 1);
-+ device->volume_api = api;
-+ device->index = pa_volume_api_allocate_device_index(api);
-+ pa_assert_se(pa_volume_api_register_name(api, name, false, &device->name) >= 0);
-+ device->description = pa_xstrdup(description);
-+ device->direction = direction;
-+ device->device_types = pa_dynarray_new(pa_xfree);
-+
-+ for (i = 0; i < n_device_types; i++)
-+ pa_dynarray_append(device->device_types, pa_xstrdup(device_types[i]));
-+
-+ device->proplist = pa_proplist_new();
-+ device->use_default_volume_control = true;
-+ device->use_default_mute_control = true;
-+
-+ return device;
-+}
-+
-+void pa_device_put(pa_device *device, pa_volume_control *default_volume_control, pa_mute_control *default_mute_control) {
-+ char *device_types_str;
-+ const char *prop_key;
-+ void *state = NULL;
-+
-+ pa_assert(device);
-+
-+ if (default_volume_control) {
-+ device->default_volume_control = default_volume_control;
-+ pa_volume_control_add_default_for_device(default_volume_control, device);
-+
-+ device->volume_control = default_volume_control;
-+ pa_volume_control_add_device(default_volume_control, device);
-+ }
-+
-+ if (default_mute_control) {
-+ device->default_mute_control = default_mute_control;
-+ pa_mute_control_add_default_for_device(default_mute_control, device);
-+
-+ device->mute_control = default_mute_control;
-+ pa_mute_control_add_device(default_mute_control, device);
-+ }
-+
-+ pa_volume_api_add_device(device->volume_api, device);
-+
-+ device->linked = true;
-+
-+ device_types_str = pa_join((const char * const *) pa_dynarray_get_raw_array(device->device_types),
-+ pa_dynarray_size(device->device_types), ", ");
-+
-+ pa_log_debug("Created device #%u.", device->index);
-+ pa_log_debug(" Name: %s", device->name);
-+ pa_log_debug(" Description: %s", device->description);
-+ pa_log_debug(" Direction: %s", pa_direction_to_string(device->direction));
-+ pa_log_debug(" Device Types: %s", *device_types_str ? device_types_str : "(none)");
-+ pa_log_debug(" Volume control: %s", device->volume_control ? device->volume_control->name : "(unset)");
-+ pa_log_debug(" Mute control: %s", device->mute_control ? device->mute_control->name : "(unset)");
-+ pa_log_debug(" Properties:");
-+
-+ while ((prop_key = pa_proplist_iterate(device->proplist, &state)))
-+ pa_log_debug(" %s = %s", prop_key, pa_strnull(pa_proplist_gets(device->proplist, prop_key)));
-+
-+ pa_xfree(device_types_str);
-+
-+ pa_hook_fire(&device->volume_api->hooks[PA_VOLUME_API_HOOK_DEVICE_PUT], device);
-+}
-+
-+void pa_device_unlink(pa_device *device) {
-+ pa_assert(device);
-+
-+ if (device->unlinked) {
-+ pa_log_debug("Unlinking device %s (already unlinked, this is a no-op).", device->name);
-+ return;
-+ }
-+
-+ device->unlinked = true;
-+
-+ pa_log_debug("Unlinking device %s.", device->name);
-+
-+ if (device->linked)
-+ pa_hook_fire(&device->volume_api->hooks[PA_VOLUME_API_HOOK_DEVICE_UNLINK], device);
-+
-+ pa_volume_api_remove_device(device->volume_api, device);
-+
-+ if (device->mute_control) {
-+ pa_mute_control_remove_device(device->mute_control, device);
-+ device->mute_control = NULL;
-+ }
-+
-+ if (device->default_mute_control) {
-+ pa_mute_control_remove_default_for_device(device->default_mute_control, device);
-+ device->default_mute_control = NULL;
-+ }
-+
-+ if (device->volume_control) {
-+ pa_volume_control_remove_device(device->volume_control, device);
-+ device->volume_control = NULL;
-+ }
-+
-+ if (device->default_volume_control) {
-+ pa_volume_control_remove_default_for_device(device->default_volume_control, device);
-+ device->default_volume_control = NULL;
-+ }
-+}
-+
-+void pa_device_free(pa_device *device) {
-+ pa_assert(device);
-+
-+ if (!device->unlinked)
-+ pa_device_unlink(device);
-+
-+ if (device->proplist)
-+ pa_proplist_free(device->proplist);
-+
-+ if (device->device_types)
-+ pa_dynarray_free(device->device_types);
-+
-+ pa_xfree(device->description);
-+
-+ if (device->name)
-+ pa_volume_api_unregister_name(device->volume_api, device->name);
-+
-+ pa_xfree(device);
-+}
-+
-+static void set_volume_control_internal(pa_device *device, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(device);
-+
-+ old_control = device->volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_volume_control_remove_device(old_control, device);
-+
-+ device->volume_control = control;
-+
-+ if (control)
-+ pa_volume_control_add_device(control, device);
-+
-+ if (!device->linked || device->unlinked)
-+ return;
-+
-+ pa_log_debug("The volume control of device %s changed from %s to %s.", device->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&device->volume_api->hooks[PA_VOLUME_API_HOOK_DEVICE_VOLUME_CONTROL_CHANGED], device);
-+}
-+
-+void pa_device_set_volume_control(pa_device *device, pa_volume_control *control) {
-+ pa_assert(device);
-+
-+ device->use_default_volume_control = false;
-+ set_volume_control_internal(device, control);
-+}
-+
-+static void set_mute_control_internal(pa_device *device, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(device);
-+
-+ old_control = device->mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_mute_control_remove_device(old_control, device);
-+
-+ device->mute_control = control;
-+
-+ if (control)
-+ pa_mute_control_add_device(control, device);
-+
-+ pa_log_debug("The mute control of device %s changed from %s to %s.", device->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&device->volume_api->hooks[PA_VOLUME_API_HOOK_DEVICE_MUTE_CONTROL_CHANGED], device);
-+}
-+
-+void pa_device_set_mute_control(pa_device *device, pa_mute_control *control) {
-+ pa_assert(device);
-+
-+ device->use_default_mute_control = false;
-+ set_mute_control_internal(device, control);
-+}
-+
-+void pa_device_description_changed(pa_device *device, const char *new_description) {
-+ char *old_description;
-+
-+ pa_assert(device);
-+ pa_assert(new_description);
-+
-+ old_description = device->description;
-+
-+ if (pa_streq(new_description, old_description))
-+ return;
-+
-+ device->description = pa_xstrdup(new_description);
-+ pa_log_debug("The description of device %s changed from \"%s\" to \"%s\".", device->name, old_description,
-+ new_description);
-+ pa_xfree(old_description);
-+ pa_hook_fire(&device->volume_api->hooks[PA_VOLUME_API_HOOK_DEVICE_DESCRIPTION_CHANGED], device);
-+}
-+
-+void pa_device_set_default_volume_control(pa_device *device, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(device);
-+
-+ old_control = device->default_volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_volume_control_remove_default_for_device(old_control, device);
-+
-+ device->default_volume_control = control;
-+
-+ if (control)
-+ pa_volume_control_add_default_for_device(control, device);
-+
-+ if (device->use_default_volume_control)
-+ set_volume_control_internal(device, control);
-+}
-+
-+void pa_device_set_default_mute_control(pa_device *device, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(device);
-+
-+ old_control = device->default_mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control)
-+ pa_mute_control_remove_default_for_device(old_control, device);
-+
-+ device->default_mute_control = control;
-+
-+ if (control)
-+ pa_mute_control_add_default_for_device(control, device);
-+
-+ if (device->use_default_mute_control)
-+ set_mute_control_internal(device, control);
-+}
-diff --git a/src/modules/volume-api/device.h b/src/modules/volume-api/device.h
-new file mode 100644
-index 0000000..9eac7e9
---- /dev/null
-+++ b/src/modules/volume-api/device.h
-@@ -0,0 +1,76 @@
-+#ifndef foodevicehfoo
-+#define foodevicehfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+#include <pulsecore/dynarray.h>
-+
-+typedef struct pa_device pa_device;
-+
-+struct pa_device {
-+ pa_volume_api *volume_api;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_direction_t direction;
-+ pa_dynarray *device_types;
-+ pa_proplist *proplist;
-+ pa_volume_control *volume_control;
-+ pa_mute_control *mute_control;
-+
-+ /* The device implementation can provide default volume and mute controls,
-+ * which are used in case there's no policy module that wants to override
-+ * the defaults. */
-+ pa_volume_control *default_volume_control;
-+ bool use_default_volume_control;
-+ pa_mute_control *default_mute_control;
-+ bool use_default_mute_control;
-+
-+ bool linked;
-+ bool unlinked;
-+};
-+
-+pa_device *pa_device_new(pa_volume_api *api, const char *name, const char *description, pa_direction_t direction,
-+ const char * const *device_types, unsigned n_device_types);
-+void pa_device_put(pa_device *device, pa_volume_control *default_volume_control, pa_mute_control *default_mute_control);
-+void pa_device_unlink(pa_device *device);
-+void pa_device_free(pa_device *device);
-+
-+/* Called by policy modules. */
-+void pa_device_set_volume_control(pa_device *device, pa_volume_control *control);
-+void pa_device_set_mute_control(pa_device *device, pa_mute_control *control);
-+
-+/* Called by policy modules. Note that pa_device_set_volume_control() and
-+ * pa_device_set_mute_control() automatically disable the corresponding
-+ * use_default flags, so these functions are mainly useful for re-enabling the
-+ * flags. */
-+void pa_device_set_use_default_volume_control(pa_device *device, bool use);
-+void pa_device_set_use_default_mute_control(pa_device *device, bool use);
-+
-+/* Called by the device implementation. */
-+void pa_device_description_changed(pa_device *device, const char *new_description);
-+void pa_device_set_default_volume_control(pa_device *device, pa_volume_control *control);
-+void pa_device_set_default_mute_control(pa_device *device, pa_mute_control *control);
-+
-+#endif
-diff --git a/src/modules/volume-api/mute-control.c b/src/modules/volume-api/mute-control.c
-new file mode 100644
-index 0000000..adc008e
---- /dev/null
-+++ b/src/modules/volume-api/mute-control.c
-@@ -0,0 +1,306 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "mute-control.h"
-+
-+#include <modules/volume-api/audio-group.h>
-+#include <modules/volume-api/device.h>
-+#include <modules/volume-api/sstream.h>
-+
-+#include <pulsecore/core-util.h>
-+
-+pa_mute_control *pa_mute_control_new(pa_volume_api *api, const char *name, const char *description) {
-+ pa_mute_control *control;
-+
-+ pa_assert(api);
-+ pa_assert(name);
-+ pa_assert(description);
-+
-+ control = pa_xnew0(pa_mute_control, 1);
-+ control->volume_api = api;
-+ control->index = pa_volume_api_allocate_mute_control_index(api);
-+ pa_assert_se(pa_volume_api_register_name(api, name, false, &control->name) >= 0);
-+ control->description = pa_xstrdup(description);
-+ control->proplist = pa_proplist_new();
-+ control->devices = pa_hashmap_new(NULL, NULL);
-+ control->default_for_devices = pa_hashmap_new(NULL, NULL);
-+ control->streams = pa_hashmap_new(NULL, NULL);
-+ control->audio_groups = pa_hashmap_new(NULL, NULL);
-+
-+ return control;
-+}
-+
-+void pa_mute_control_put(pa_mute_control *control, bool initial_mute, bool initial_mute_is_set,
-+ pa_mute_control_set_initial_mute_cb_t set_initial_mute_cb) {
-+ const char *prop_key;
-+ void *state = NULL;
-+
-+ pa_assert(control);
-+ pa_assert(initial_mute_is_set || control->set_mute);
-+ pa_assert(set_initial_mute_cb || !control->set_mute);
-+
-+ if (initial_mute_is_set)
-+ control->mute = initial_mute;
-+ else
-+ control->mute = false;
-+
-+ if (set_initial_mute_cb)
-+ set_initial_mute_cb(control);
-+
-+ pa_volume_api_add_mute_control(control->volume_api, control);
-+
-+ control->linked = true;
-+
-+ pa_log_debug("Created mute control #%u.", control->index);
-+ pa_log_debug(" Name: %s", control->name);
-+ pa_log_debug(" Description: %s", control->description);
-+ pa_log_debug(" Mute: %s", pa_yes_no(control->mute));
-+ pa_log_debug(" Properties:");
-+
-+ while ((prop_key = pa_proplist_iterate(control->proplist, &state)))
-+ pa_log_debug(" %s = %s", prop_key, pa_strnull(pa_proplist_gets(control->proplist, prop_key)));
-+
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_MUTE_CONTROL_PUT], control);
-+}
-+
-+void pa_mute_control_unlink(pa_mute_control *control) {
-+ pa_audio_group *group;
-+ pa_device *device;
-+ pas_stream *stream;
-+
-+ pa_assert(control);
-+
-+ if (control->unlinked) {
-+ pa_log_debug("Unlinking mute control %s (already unlinked, this is a no-op).", control->name);
-+ return;
-+ }
-+
-+ control->unlinked = true;
-+
-+ pa_log_debug("Unlinking mute control %s.", control->name);
-+
-+ if (control->linked)
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_MUTE_CONTROL_UNLINK], control);
-+
-+ pa_volume_api_remove_mute_control(control->volume_api, control);
-+
-+ while ((group = pa_hashmap_first(control->audio_groups)))
-+ pa_audio_group_set_mute_control(group, NULL);
-+
-+ while ((stream = pa_hashmap_first(control->streams)))
-+ pas_stream_set_mute_control(stream, NULL);
-+
-+ while ((device = pa_hashmap_first(control->default_for_devices)))
-+ pa_device_set_default_mute_control(device, NULL);
-+
-+ while ((device = pa_hashmap_first(control->devices))) {
-+ /* Why do we have this assertion here? The concern is that if we call
-+ * pa_device_set_mute_control() for some device that has the
-+ * use_default_mute_control flag set, then that flag will be unset as
-+ * a side effect, and we don't want that side effect. This assertion
-+ * should be safe, because we just called
-+ * pa_device_set_default_mute_control(NULL) for each device that this
-+ * control was the default for, and that should ensure that we don't
-+ * any more hold any references to devices that used to use this
-+ * control as the default. */
-+ pa_assert(!device->use_default_mute_control);
-+ pa_device_set_mute_control(device, NULL);
-+ }
-+}
-+
-+void pa_mute_control_free(pa_mute_control *control) {
-+ pa_assert(control);
-+
-+ if (!control->unlinked)
-+ pa_mute_control_unlink(control);
-+
-+ if (control->audio_groups) {
-+ pa_assert(pa_hashmap_isempty(control->audio_groups));
-+ pa_hashmap_free(control->audio_groups);
-+ }
-+
-+ if (control->streams) {
-+ pa_assert(pa_hashmap_isempty(control->streams));
-+ pa_hashmap_free(control->streams);
-+ }
-+
-+ if (control->default_for_devices) {
-+ pa_assert(pa_hashmap_isempty(control->default_for_devices));
-+ pa_hashmap_free(control->default_for_devices);
-+ }
-+
-+ if (control->devices) {
-+ pa_assert(pa_hashmap_isempty(control->devices));
-+ pa_hashmap_free(control->devices);
-+ }
-+
-+ if (control->proplist)
-+ pa_proplist_free(control->proplist);
-+
-+ pa_xfree(control->description);
-+
-+ if (control->name)
-+ pa_volume_api_unregister_name(control->volume_api, control->name);
-+
-+ pa_xfree(control);
-+}
-+
-+void pa_mute_control_set_owner_audio_group(pa_mute_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ control->owner_audio_group = group;
-+}
-+
-+static void set_mute_internal(pa_mute_control *control, bool mute) {
-+ bool old_mute;
-+
-+ pa_assert(control);
-+
-+ old_mute = control->mute;
-+
-+ if (mute == old_mute)
-+ return;
-+
-+ control->mute = mute;
-+
-+ if (!control->linked || control->unlinked)
-+ return;
-+
-+ pa_log_debug("The mute of mute control %s changed from %s to %s.", control->name, pa_yes_no(old_mute),
-+ pa_yes_no(control->mute));
-+
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_MUTE_CONTROL_MUTE_CHANGED], control);
-+}
-+
-+int pa_mute_control_set_mute(pa_mute_control *control, bool mute) {
-+ int r;
-+
-+ pa_assert(control);
-+
-+ if (!control->set_mute) {
-+ pa_log_info("Tried to set the mute of mute control %s, but the mute control doesn't support the operation.",
-+ control->name);
-+ return -PA_ERR_NOTSUPPORTED;
-+ }
-+
-+ if (mute == control->mute)
-+ return 0;
-+
-+ control->set_mute_in_progress = true;
-+ r = control->set_mute(control, mute);
-+ control->set_mute_in_progress = false;
-+
-+ if (r >= 0)
-+ set_mute_internal(control, mute);
-+
-+ return r;
-+}
-+
-+void pa_mute_control_description_changed(pa_mute_control *control, const char *new_description) {
-+ char *old_description;
-+
-+ pa_assert(control);
-+ pa_assert(new_description);
-+
-+ old_description = control->description;
-+
-+ if (pa_streq(new_description, old_description))
-+ return;
-+
-+ control->description = pa_xstrdup(new_description);
-+ pa_log_debug("The description of mute control %s changed from \"%s\" to \"%s\".", control->name, old_description,
-+ new_description);
-+ pa_xfree(old_description);
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_MUTE_CONTROL_DESCRIPTION_CHANGED], control);
-+}
-+
-+void pa_mute_control_mute_changed(pa_mute_control *control, bool new_mute) {
-+ pa_assert(control);
-+
-+ if (!control->linked)
-+ return;
-+
-+ if (control->set_mute_in_progress)
-+ return;
-+
-+ set_mute_internal(control, new_mute);
-+}
-+
-+void pa_mute_control_add_device(pa_mute_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_put(control->devices, device, device) >= 0);
-+}
-+
-+void pa_mute_control_remove_device(pa_mute_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_remove(control->devices, device));
-+}
-+
-+void pa_mute_control_add_default_for_device(pa_mute_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_put(control->default_for_devices, device, device) >= 0);
-+}
-+
-+void pa_mute_control_remove_default_for_device(pa_mute_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_remove(control->default_for_devices, device));
-+}
-+
-+void pa_mute_control_add_stream(pa_mute_control *control, pas_stream *stream) {
-+ pa_assert(control);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_put(control->streams, stream, stream) >= 0);
-+}
-+
-+void pa_mute_control_remove_stream(pa_mute_control *control, pas_stream *stream) {
-+ pa_assert(control);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_remove(control->streams, stream));
-+}
-+
-+void pa_mute_control_add_audio_group(pa_mute_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ pa_assert_se(pa_hashmap_put(control->audio_groups, group, group) >= 0);
-+}
-+
-+void pa_mute_control_remove_audio_group(pa_mute_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ pa_assert_se(pa_hashmap_remove(control->audio_groups, group));
-+}
-diff --git a/src/modules/volume-api/mute-control.h b/src/modules/volume-api/mute-control.h
-new file mode 100644
-index 0000000..1f70a43
---- /dev/null
-+++ b/src/modules/volume-api/mute-control.h
-@@ -0,0 +1,102 @@
-+#ifndef foomutecontrolhfoo
-+#define foomutecontrolhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+typedef struct pa_mute_control pa_mute_control;
-+
-+struct pa_mute_control {
-+ pa_volume_api *volume_api;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_proplist *proplist;
-+ bool mute;
-+
-+ /* If this mute control is the "own mute control" of an audio group, this
-+ * is set to point to that group, otherwise this is NULL. */
-+ pa_audio_group *owner_audio_group;
-+
-+ pa_hashmap *devices; /* pa_device -> pa_device (hashmap-as-a-set) */
-+ pa_hashmap *default_for_devices; /* pa_device -> pa_device (hashmap-as-a-set) */
-+ pa_hashmap *streams; /* pas_stream -> pas_stream (hashmap-as-a-set) */
-+ pa_hashmap *audio_groups; /* pa_audio_group -> pa_audio_group (hashmap-as-a-set) */
-+
-+ bool linked;
-+ bool unlinked;
-+ bool set_mute_in_progress;
-+
-+ /* Called from pa_mute_control_set_mute(). The implementation is expected
-+ * to return a negative error code on failure. May be NULL, if the mute
-+ * control is read-only. */
-+ int (*set_mute)(pa_mute_control *control, bool mute);
-+
-+ void *userdata;
-+};
-+
-+pa_mute_control *pa_mute_control_new(pa_volume_api *api, const char *name, const char *description);
-+
-+typedef void (*pa_mute_control_set_initial_mute_cb_t)(pa_mute_control *control);
-+
-+/* initial_mute is the preferred initial mute of the mute control
-+ * implementation. It may be unset, if the implementation doesn't care about
-+ * the initial state of the mute control. Read-only mute controls, however,
-+ * must always set initial_mute.
-+ *
-+ * The implementation's initial mute preference may be overridden by policy, if
-+ * the mute control isn't read-only. When the final initial mute is known, the
-+ * the implementation is notified via set_initial_mute_cb (the mute can be read
-+ * from control->mute). set_initial_mute_cb may be NULL, if the mute control is
-+ * read-only. */
-+void pa_mute_control_put(pa_mute_control *control, bool initial_mute, bool initial_mute_is_set,
-+ pa_mute_control_set_initial_mute_cb_t set_initial_mute_cb);
-+
-+void pa_mute_control_unlink(pa_mute_control *control);
-+void pa_mute_control_free(pa_mute_control *control);
-+
-+/* Called by audio-group.c only. */
-+void pa_mute_control_set_owner_audio_group(pa_mute_control *control, pa_audio_group *group);
-+
-+/* Called by clients and policy modules. */
-+int pa_mute_control_set_mute(pa_mute_control *control, bool mute);
-+
-+/* Called by the mute control implementation. */
-+void pa_mute_control_description_changed(pa_mute_control *control, const char *new_description);
-+void pa_mute_control_mute_changed(pa_mute_control *control, bool new_mute);
-+
-+/* Called from device.c only. */
-+void pa_mute_control_add_device(pa_mute_control *control, pa_device *device);
-+void pa_mute_control_remove_device(pa_mute_control *control, pa_device *device);
-+void pa_mute_control_add_default_for_device(pa_mute_control *control, pa_device *device);
-+void pa_mute_control_remove_default_for_device(pa_mute_control *control, pa_device *device);
-+
-+/* Called from sstream.c only. */
-+void pa_mute_control_add_stream(pa_mute_control *control, pas_stream *stream);
-+void pa_mute_control_remove_stream(pa_mute_control *control, pas_stream *stream);
-+
-+/* Called from audio-group.c only. */
-+void pa_mute_control_add_audio_group(pa_mute_control *control, pa_audio_group *group);
-+void pa_mute_control_remove_audio_group(pa_mute_control *control, pa_audio_group *group);
-+
-+#endif
-diff --git a/src/modules/volume-api/sstream.c b/src/modules/volume-api/sstream.c
-new file mode 100644
-index 0000000..e3531a8
---- /dev/null
-+++ b/src/modules/volume-api/sstream.c
-@@ -0,0 +1,366 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "sstream.h"
-+
-+#include <modules/volume-api/audio-group.h>
-+#include <modules/volume-api/binding.h>
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulse/direction.h>
-+
-+#include <pulsecore/core-util.h>
-+
-+pas_stream *pas_stream_new(pa_volume_api *api, const char *name, const char *description, pa_direction_t direction) {
-+ pas_stream *stream;
-+
-+ pa_assert(api);
-+ pa_assert(name);
-+ pa_assert(description);
-+
-+ stream = pa_xnew0(pas_stream, 1);
-+ stream->volume_api = api;
-+ stream->index = pa_volume_api_allocate_stream_index(api);
-+ pa_assert_se(pa_volume_api_register_name(api, name, false, &stream->name) >= 0);
-+ stream->description = pa_xstrdup(description);
-+ stream->direction = direction;
-+ stream->proplist = pa_proplist_new();
-+ stream->use_default_volume_control = true;
-+ stream->use_default_mute_control = true;
-+
-+ return stream;
-+}
-+
-+static void set_volume_control_internal(pas_stream *stream, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(stream);
-+
-+ old_control = stream->volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control) {
-+ /* If the old control pointed to the own volume control of an audio
-+ * group, then the stream's audio group for volume needs to be
-+ * updated. We set it to NULL here, and if it should be non-NULL, that
-+ * will be fixed very soon (a few lines down). */
-+ pas_stream_set_audio_group_for_volume(stream, NULL);
-+
-+ pa_volume_control_remove_stream(old_control, stream);
-+ }
-+
-+ stream->volume_control = control;
-+
-+ if (control) {
-+ pa_volume_control_add_stream(control, stream);
-+ pas_stream_set_audio_group_for_volume(stream, control->owner_audio_group);
-+ }
-+
-+ if (!stream->linked || stream->unlinked)
-+ return;
-+
-+ pa_log_debug("The volume control of stream %s changed from %s to %s.", stream->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_VOLUME_CONTROL_CHANGED], stream);
-+}
-+
-+static void set_mute_control_internal(pas_stream *stream, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(stream);
-+
-+ old_control = stream->mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ if (old_control) {
-+ /* If the old control pointed to the own mute control of an audio
-+ * group, then the stream's audio group for mute needs to be updated.
-+ * We set it to NULL here, and if it should be non-NULL, that will be
-+ * fixed very soon (a few lines down). */
-+ pas_stream_set_audio_group_for_mute(stream, NULL);
-+
-+ pa_mute_control_remove_stream(old_control, stream);
-+ }
-+
-+ stream->mute_control = control;
-+
-+ if (control) {
-+ pa_mute_control_add_stream(control, stream);
-+ pas_stream_set_audio_group_for_mute(stream, control->owner_audio_group);
-+ }
-+
-+ if (!stream->linked || stream->unlinked)
-+ return;
-+
-+ pa_log_debug("The mute control of stream %s changed from %s to %s.", stream->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_MUTE_CONTROL_CHANGED], stream);
-+}
-+
-+void pas_stream_put(pas_stream *stream, pa_proplist *initial_properties) {
-+ const char *prop_key;
-+ void *state = NULL;
-+
-+ pa_assert(stream);
-+ pa_assert(!stream->create_own_volume_control || stream->delete_own_volume_control);
-+ pa_assert(!stream->create_own_mute_control || stream->delete_own_mute_control);
-+
-+ if (initial_properties)
-+ pa_proplist_update(stream->proplist, PA_UPDATE_REPLACE, initial_properties);
-+
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_SET_INITIAL_VOLUME_CONTROL], stream);
-+
-+ if (stream->use_default_volume_control)
-+ set_volume_control_internal(stream, stream->own_volume_control);
-+
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_SET_INITIAL_MUTE_CONTROL], stream);
-+
-+ if (stream->use_default_mute_control)
-+ set_mute_control_internal(stream, stream->own_mute_control);
-+
-+ pa_volume_api_add_stream(stream->volume_api, stream);
-+
-+ stream->linked = true;
-+
-+ pa_log_debug("Created stream #%u.", stream->index);
-+ pa_log_debug(" Name: %s", stream->name);
-+ pa_log_debug(" Description: %s", stream->description);
-+ pa_log_debug(" Direction: %s", pa_direction_to_string(stream->direction));
-+ pa_log_debug(" Volume control: %s", stream->volume_control ? stream->volume_control->name : "(unset)");
-+ pa_log_debug(" Mute control: %s", stream->mute_control ? stream->mute_control->name : "(unset)");
-+ pa_log_debug(" Properties:");
-+
-+ while ((prop_key = pa_proplist_iterate(stream->proplist, &state)))
-+ pa_log_debug(" %s = %s", prop_key, pa_strnull(pa_proplist_gets(stream->proplist, prop_key)));
-+
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_PUT], stream);
-+}
-+
-+void pas_stream_unlink(pas_stream *stream) {
-+ pa_assert(stream);
-+
-+ if (stream->unlinked) {
-+ pa_log_debug("Unlinking stream %s (already unlinked, this is a no-op).", stream->name);
-+ return;
-+ }
-+
-+ stream->unlinked = true;
-+
-+ pa_log_debug("Unlinking stream %s.", stream->name);
-+
-+ if (stream->linked)
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_UNLINK], stream);
-+
-+ pa_volume_api_remove_stream(stream->volume_api, stream);
-+
-+ pas_stream_set_audio_group_for_mute(stream, NULL);
-+ pas_stream_set_audio_group_for_volume(stream, NULL);
-+ pas_stream_set_mute_control(stream, NULL);
-+ pas_stream_set_volume_control(stream, NULL);
-+ pas_stream_set_have_own_mute_control(stream, false);
-+ pas_stream_set_have_own_volume_control(stream, false);
-+}
-+
-+void pas_stream_free(pas_stream *stream) {
-+ pa_assert(stream);
-+
-+ if (!stream->unlinked)
-+ pas_stream_unlink(stream);
-+
-+ if (stream->proplist)
-+ pa_proplist_free(stream->proplist);
-+
-+ pa_xfree(stream->description);
-+
-+ if (stream->name)
-+ pa_volume_api_unregister_name(stream->volume_api, stream->name);
-+
-+ pa_xfree(stream);
-+}
-+
-+int pas_stream_set_have_own_volume_control(pas_stream *stream, bool have) {
-+ pa_assert(stream);
-+
-+ if (have == stream->have_own_volume_control)
-+ return 0;
-+
-+ if (have) {
-+ pa_assert(!stream->own_volume_control);
-+
-+ if (!stream->create_own_volume_control) {
-+ pa_log_debug("Stream %s doesn't support own volume control.", stream->name);
-+ return -PA_ERR_NOTSUPPORTED;
-+ }
-+
-+ stream->own_volume_control = stream->create_own_volume_control(stream);
-+ } else {
-+ stream->delete_own_volume_control(stream);
-+ stream->own_volume_control = NULL;
-+ }
-+
-+ stream->have_own_volume_control = have;
-+
-+ return 0;
-+}
-+
-+int pas_stream_set_have_own_mute_control(pas_stream *stream, bool have) {
-+ pa_assert(stream);
-+
-+ if (have == stream->have_own_mute_control)
-+ return 0;
-+
-+ if (have) {
-+ pa_assert(!stream->own_mute_control);
-+
-+ if (!stream->create_own_mute_control) {
-+ pa_log_debug("Stream %s doesn't support own mute control.", stream->name);
-+ return -PA_ERR_NOTSUPPORTED;
-+ }
-+
-+ stream->own_mute_control = stream->create_own_mute_control(stream);
-+ } else {
-+ stream->delete_own_mute_control(stream);
-+ stream->own_mute_control = NULL;
-+ }
-+
-+ stream->have_own_mute_control = have;
-+
-+ return 0;
-+}
-+
-+void pas_stream_set_volume_control(pas_stream *stream, pa_volume_control *control) {
-+ pa_assert(stream);
-+
-+ stream->use_default_volume_control = false;
-+
-+ if (stream->volume_control_binding) {
-+ pa_binding_free(stream->volume_control_binding);
-+ stream->volume_control_binding = NULL;
-+ }
-+
-+ set_volume_control_internal(stream, control);
-+}
-+
-+void pas_stream_set_mute_control(pas_stream *stream, pa_mute_control *control) {
-+ pa_assert(stream);
-+
-+ stream->use_default_mute_control = false;
-+
-+ if (stream->mute_control_binding) {
-+ pa_binding_free(stream->mute_control_binding);
-+ stream->mute_control_binding = NULL;
-+ }
-+
-+ set_mute_control_internal(stream, control);
-+}
-+
-+void pas_stream_bind_volume_control(pas_stream *stream, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = stream,
-+ .set_value = (pa_binding_set_value_cb_t) set_volume_control_internal,
-+ };
-+
-+ pa_assert(stream);
-+ pa_assert(target_info);
-+
-+ stream->use_default_volume_control = false;
-+
-+ if (stream->volume_control_binding)
-+ pa_binding_free(stream->volume_control_binding);
-+
-+ stream->volume_control_binding = pa_binding_new(stream->volume_api, &owner_info, target_info);
-+}
-+
-+void pas_stream_bind_mute_control(pas_stream *stream, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = stream,
-+ .set_value = (pa_binding_set_value_cb_t) set_mute_control_internal,
-+ };
-+
-+ pa_assert(stream);
-+ pa_assert(target_info);
-+
-+ stream->use_default_mute_control = false;
-+
-+ if (stream->mute_control_binding)
-+ pa_binding_free(stream->mute_control_binding);
-+
-+ stream->mute_control_binding = pa_binding_new(stream->volume_api, &owner_info, target_info);
-+}
-+
-+void pas_stream_description_changed(pas_stream *stream, const char *new_description) {
-+ char *old_description;
-+
-+ pa_assert(stream);
-+ pa_assert(new_description);
-+
-+ old_description = stream->description;
-+
-+ if (pa_streq(new_description, old_description))
-+ return;
-+
-+ stream->description = pa_xstrdup(new_description);
-+ pa_log_debug("The description of stream %s changed from \"%s\" to \"%s\".", stream->name, old_description,
-+ new_description);
-+ pa_xfree(old_description);
-+ pa_hook_fire(&stream->volume_api->hooks[PA_VOLUME_API_HOOK_STREAM_DESCRIPTION_CHANGED], stream);
-+}
-+
-+void pas_stream_set_audio_group_for_volume(pas_stream *stream, pa_audio_group *group) {
-+ pa_assert(stream);
-+
-+ if (group == stream->audio_group_for_volume)
-+ return;
-+
-+ if (stream->audio_group_for_volume)
-+ pa_audio_group_remove_volume_stream(stream->audio_group_for_volume, stream);
-+
-+ stream->audio_group_for_volume = group;
-+
-+ if (group)
-+ pa_audio_group_add_volume_stream(group, stream);
-+}
-+
-+void pas_stream_set_audio_group_for_mute(pas_stream *stream, pa_audio_group *group) {
-+ pa_assert(stream);
-+
-+ if (group == stream->audio_group_for_mute)
-+ return;
-+
-+ if (stream->audio_group_for_mute)
-+ pa_audio_group_remove_mute_stream(stream->audio_group_for_mute, stream);
-+
-+ stream->audio_group_for_mute = group;
-+
-+ if (group)
-+ pa_audio_group_add_mute_stream(group, stream);
-+}
-diff --git a/src/modules/volume-api/sstream.h b/src/modules/volume-api/sstream.h
-new file mode 100644
-index 0000000..a65b34c
---- /dev/null
-+++ b/src/modules/volume-api/sstream.h
-@@ -0,0 +1,108 @@
-+#ifndef foosstreamhfoo
-+#define foosstreamhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+/* We use the "pas_" prefix in pas_stream, because there's already pa_stream in
-+ * the client API, and there's no good alternative term for streams. The 's' in
-+ * "pas" means "server", i.e. the point is that this stuff is for servers,
-+ * while pa_stream is for clients. */
-+
-+typedef struct pas_stream pas_stream;
-+
-+struct pas_stream {
-+ pa_volume_api *volume_api;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_direction_t direction;
-+ pa_proplist *proplist;
-+ pa_volume_control *volume_control;
-+ pa_mute_control *mute_control;
-+ bool use_default_volume_control;
-+ bool use_default_mute_control;
-+ bool have_own_volume_control;
-+ bool have_own_mute_control;
-+ pa_volume_control *own_volume_control;
-+ pa_mute_control *own_mute_control;
-+
-+ pa_binding *volume_control_binding;
-+ pa_binding *mute_control_binding;
-+ pa_audio_group *audio_group_for_volume;
-+ pa_audio_group *audio_group_for_mute;
-+
-+ bool linked;
-+ bool unlinked;
-+
-+ /* Called when the own volume control is enabled. The callback
-+ * implementation should return a new linked volume control object. The
-+ * callback may be NULL, in which case the own volume control can't be
-+ * enabled. */
-+ pa_volume_control *(*create_own_volume_control)(pas_stream *stream);
-+
-+ /* Called when the own volume control is disabled. The implementation
-+ * should free stream->own_volume_control. The callback may be NULL only if
-+ * create_own_volume_control is NULL also. */
-+ void (*delete_own_volume_control)(pas_stream *stream);
-+
-+ /* Called when the own mute control is enabled. The callback implementation
-+ * should return a new linked mute control object. The callback may be
-+ * NULL, in which case the own mute control can't be enabled. */
-+ pa_mute_control *(*create_own_mute_control)(pas_stream *stream);
-+
-+ /* Called when the own mute control is disabled. The implementation should
-+ * free stream->own_mute_control. The callback may be NULL only if
-+ * create_own_mute_control is NULL also. */
-+ void (*delete_own_mute_control)(pas_stream *stream);
-+
-+ void *userdata;
-+};
-+
-+pas_stream *pas_stream_new(pa_volume_api *api, const char *name, const char *description, pa_direction_t direction);
-+void pas_stream_put(pas_stream *stream, pa_proplist *initial_properties);
-+void pas_stream_unlink(pas_stream *stream);
-+void pas_stream_free(pas_stream *stream);
-+
-+/* Called by the stream implementation and possibly by policy modules.
-+ * Enabling own controls may fail (the stream may not support own controls),
-+ * disabling will never fail. */
-+int pas_stream_set_have_own_volume_control(pas_stream *stream, bool have);
-+int pas_stream_set_have_own_mute_control(pas_stream *stream, bool have);
-+
-+/* Called by policy modules. */
-+void pas_stream_set_volume_control(pas_stream *stream, pa_volume_control *control);
-+void pas_stream_set_mute_control(pas_stream *stream, pa_mute_control *control);
-+void pas_stream_bind_volume_control(pas_stream *stream, pa_binding_target_info *target_info);
-+void pas_stream_bind_mute_control(pas_stream *stream, pa_binding_target_info *target_info);
-+
-+/* Called by the stream implementation. */
-+void pas_stream_description_changed(pas_stream *stream, const char *new_description);
-+
-+/* Called by audio-group.c only. Adding a stream to an audio group happens
-+ * implicitly when the volume or mute control of a stream is set to point to
-+ * the own control of an audio group. */
-+void pas_stream_set_audio_group_for_volume(pas_stream *stream, pa_audio_group *group);
-+void pas_stream_set_audio_group_for_mute(pas_stream *stream, pa_audio_group *group);
-+
-+#endif
-diff --git a/src/modules/volume-api/stream-creator.c b/src/modules/volume-api/stream-creator.c
-new file mode 100644
-index 0000000..2bd0053
---- /dev/null
-+++ b/src/modules/volume-api/stream-creator.c
-@@ -0,0 +1,691 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "stream-creator.h"
-+
-+#include <modules/volume-api/sstream.h>
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/i18n.h>
-+
-+struct pa_stream_creator {
-+ pa_volume_api *volume_api;
-+ pa_hashmap *streams; /* pa_sink_input/pa_source_output -> struct stream */
-+ pa_hook_slot *sink_input_put_slot;
-+ pa_hook_slot *sink_input_unlink_slot;
-+ pa_hook_slot *source_output_put_slot;
-+ pa_hook_slot *source_output_unlink_slot;
-+};
-+
-+enum stream_type {
-+ STREAM_TYPE_SINK_INPUT,
-+ STREAM_TYPE_SOURCE_OUTPUT,
-+};
-+
-+struct stream {
-+ pa_stream_creator *creator;
-+ enum stream_type type;
-+ pa_sink_input *sink_input;
-+ pa_source_output *source_output;
-+ pa_client *client;
-+ pas_stream *stream;
-+
-+ bool unlinked;
-+
-+ pa_hook_slot *proplist_changed_slot;
-+ pa_hook_slot *client_proplist_changed_slot;
-+ pa_hook_slot *volume_changed_slot;
-+ pa_hook_slot *mute_changed_slot;
-+};
-+
-+static char *get_stream_volume_and_mute_control_description_malloc(struct stream *stream) {
-+ const char *application_name = NULL;
-+ char *description;
-+
-+ pa_assert(stream);
-+
-+ if (stream->client)
-+ application_name = pa_proplist_gets(stream->client->proplist, PA_PROP_APPLICATION_NAME);
-+
-+ if (application_name)
-+ description = pa_sprintf_malloc("%s: %s", application_name, stream->stream->description);
-+ else
-+ description = pa_xstrdup(stream->stream->description);
-+
-+ return description;
-+}
-+
-+static int volume_control_set_volume_cb(pa_volume_control *control, const pa_bvolume *volume, bool set_volume, bool set_balance) {
-+ struct stream *stream;
-+ pa_bvolume bvolume;
-+ pa_cvolume cvolume;
-+
-+ pa_assert(control);
-+ pa_assert(volume);
-+
-+ stream = control->userdata;
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ pa_bvolume_from_cvolume(&bvolume, &stream->sink_input->volume, &stream->sink_input->channel_map);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ pa_bvolume_from_cvolume(&bvolume, &stream->source_output->volume, &stream->source_output->channel_map);
-+ break;
-+ }
-+
-+ if (set_volume)
-+ bvolume.volume = volume->volume;
-+
-+ if (set_balance)
-+ pa_bvolume_copy_balance(&bvolume, volume);
-+
-+ pa_bvolume_to_cvolume(&bvolume, &cvolume);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ pa_sink_input_set_volume(stream->sink_input, &cvolume, true, true);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ pa_source_output_set_volume(stream->source_output, &cvolume, true, true);
-+ break;
-+ }
-+
-+ return 0;
-+}
-+
-+static pa_hook_result_t sink_input_or_source_output_volume_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct stream *stream = userdata;
-+ pa_sink_input *input = NULL;
-+ pa_source_output *output = NULL;
-+ pa_bvolume bvolume;
-+
-+ pa_assert(stream);
-+ pa_assert(call_data);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ input = call_data;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ output = call_data;
-+ break;
-+ }
-+
-+ if ((input && input != stream->sink_input) || (output && output != stream->source_output))
-+ return PA_HOOK_OK;
-+
-+ if (input)
-+ pa_bvolume_from_cvolume(&bvolume, &input->volume, &input->channel_map);
-+ else
-+ pa_bvolume_from_cvolume(&bvolume, &output->volume, &output->channel_map);
-+
-+ pa_volume_control_volume_changed(stream->stream->own_volume_control, &bvolume, true, true);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void volume_control_set_initial_volume_cb(pa_volume_control *control) {
-+ struct stream *stream;
-+ pa_cvolume cvolume;
-+
-+ pa_assert(control);
-+
-+ stream = control->userdata;
-+ pa_bvolume_to_cvolume(&control->volume, &cvolume);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ pa_sink_input_set_volume(stream->sink_input, &cvolume, true, true);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ pa_source_output_set_volume(stream->source_output, &cvolume, true, true);
-+ break;
-+ }
-+}
-+
-+static int mute_control_set_mute_cb(pa_mute_control *control, bool mute) {
-+ struct stream *stream;
-+
-+ pa_assert(control);
-+
-+ stream = control->userdata;
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ pa_sink_input_set_mute(stream->sink_input, mute, true);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ pa_source_output_set_mute(stream->source_output, mute, true);
-+ break;
-+ }
-+
-+ return 0;
-+}
-+
-+static pa_hook_result_t sink_input_or_source_output_mute_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct stream *stream = userdata;
-+ pa_sink_input *input = NULL;
-+ pa_source_output *output = NULL;
-+ bool mute;
-+
-+ pa_assert(stream);
-+ pa_assert(call_data);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ input = call_data;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ output = call_data;
-+ break;
-+ }
-+
-+ if ((input && input != stream->sink_input) || (output && output != stream->source_output))
-+ return PA_HOOK_OK;
-+
-+ if (input)
-+ mute = input->muted;
-+ else
-+ mute = output->muted;
-+
-+ pa_mute_control_mute_changed(stream->stream->own_mute_control, mute);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static void mute_control_set_initial_mute_cb(pa_mute_control *control) {
-+ struct stream *stream;
-+
-+ pa_assert(control);
-+
-+ stream = control->userdata;
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ pa_sink_input_set_mute(stream->sink_input, control->mute, true);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ pa_source_output_set_mute(stream->source_output, control->mute, true);
-+ break;
-+ }
-+}
-+
-+static const char *get_sink_input_description(pa_sink_input *input) {
-+ const char *description;
-+
-+ pa_assert(input);
-+
-+ description = pa_proplist_gets(input->proplist, PA_PROP_MEDIA_NAME);
-+ if (description)
-+ return description;
-+
-+ return NULL;
-+}
-+
-+static const char *get_source_output_description(pa_source_output *output) {
-+ const char *description;
-+
-+ pa_assert(output);
-+
-+ description = pa_proplist_gets(output->proplist, PA_PROP_MEDIA_NAME);
-+ if (description)
-+ return description;
-+
-+ return NULL;
-+}
-+
-+static pa_volume_control *stream_create_own_volume_control_cb(pas_stream *s) {
-+ struct stream *stream;
-+ const char *name = NULL;
-+ char *description;
-+ pa_volume_control *control;
-+ pa_bvolume volume;
-+
-+ pa_assert(s);
-+
-+ stream = s->userdata;
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ name = "sink-input-volume-control";
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ name = "source-output-volume-control";
-+ break;
-+ }
-+
-+ description = get_stream_volume_and_mute_control_description_malloc(stream);
-+ control = pa_volume_control_new(stream->creator->volume_api, name, description, true, false);
-+ pa_xfree(description);
-+ control->set_volume = volume_control_set_volume_cb;
-+ control->userdata = stream;
-+
-+ pa_assert(!stream->volume_changed_slot);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ stream->volume_changed_slot =
-+ pa_hook_connect(&stream->sink_input->core->hooks[PA_CORE_HOOK_SINK_INPUT_VOLUME_CHANGED], PA_HOOK_NORMAL,
-+ sink_input_or_source_output_volume_changed_cb, stream);
-+ pa_bvolume_from_cvolume(&volume, &stream->sink_input->volume, &stream->sink_input->channel_map);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ stream->volume_changed_slot =
-+ pa_hook_connect(&stream->source_output->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_VOLUME_CHANGED],
-+ PA_HOOK_NORMAL, sink_input_or_source_output_volume_changed_cb, stream);
-+ pa_bvolume_from_cvolume(&volume, &stream->source_output->volume, &stream->source_output->channel_map);
-+ break;
-+ }
-+
-+ pa_volume_control_put(control, &volume, volume_control_set_initial_volume_cb);
-+
-+ return control;
-+}
-+
-+static void stream_delete_own_volume_control_cb(pas_stream *s) {
-+ struct stream *stream;
-+
-+ pa_assert(s);
-+
-+ stream = s->userdata;
-+ pa_hook_slot_free(stream->volume_changed_slot);
-+ stream->volume_changed_slot = NULL;
-+ pa_volume_control_free(s->own_volume_control);
-+}
-+
-+static pa_mute_control *stream_create_own_mute_control_cb(pas_stream *s) {
-+ struct stream *stream;
-+ const char *name = NULL;
-+ char *description;
-+ pa_mute_control *control;
-+ bool mute = false;
-+
-+ pa_assert(s);
-+
-+ stream = s->userdata;
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ name = "sink-input-mute-control";
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ name = "source-output-mute-control";
-+ break;
-+ }
-+
-+ description = get_stream_volume_and_mute_control_description_malloc(stream);
-+ control = pa_mute_control_new(stream->creator->volume_api, name, description);
-+ pa_xfree(description);
-+ control->set_mute = mute_control_set_mute_cb;
-+ control->userdata = stream;
-+
-+ pa_assert(!stream->mute_changed_slot);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ stream->mute_changed_slot =
-+ pa_hook_connect(&stream->sink_input->core->hooks[PA_CORE_HOOK_SINK_INPUT_MUTE_CHANGED], PA_HOOK_NORMAL,
-+ sink_input_or_source_output_mute_changed_cb, stream);
-+ mute = stream->sink_input->muted;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ stream->mute_changed_slot =
-+ pa_hook_connect(&stream->source_output->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_MUTE_CHANGED],
-+ PA_HOOK_NORMAL, sink_input_or_source_output_mute_changed_cb, stream);
-+ mute = stream->source_output->muted;
-+ break;
-+ }
-+
-+ pa_mute_control_put(control, mute, true, mute_control_set_initial_mute_cb);
-+
-+ return control;
-+}
-+
-+static void stream_delete_own_mute_control_cb(pas_stream *s) {
-+ struct stream *stream;
-+
-+ pa_assert(s);
-+
-+ stream = s->userdata;
-+ pa_hook_slot_free(stream->mute_changed_slot);
-+ stream->mute_changed_slot = NULL;
-+ pa_mute_control_free(s->own_mute_control);
-+}
-+
-+static pa_hook_result_t sink_input_or_source_output_proplist_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct stream *stream = userdata;
-+ pa_sink_input *input = NULL;
-+ pa_source_output *output = NULL;
-+ const char *new_stream_description = NULL;
-+ char *new_control_description;
-+
-+ pa_assert(stream);
-+ pa_assert(call_data);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ input = call_data;
-+
-+ if (input != stream->sink_input)
-+ return PA_HOOK_OK;
-+
-+ new_stream_description = get_sink_input_description(input);
-+ if (!new_stream_description)
-+ new_stream_description = stream->stream->name;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ output = call_data;
-+
-+ if (output != stream->source_output)
-+ return PA_HOOK_OK;
-+
-+ new_stream_description = get_source_output_description(output);
-+ if (!new_stream_description)
-+ new_stream_description = stream->stream->name;
-+ break;
-+ }
-+
-+ pas_stream_description_changed(stream->stream, new_stream_description);
-+
-+ new_control_description = get_stream_volume_and_mute_control_description_malloc(stream);
-+
-+ if (stream->stream->own_volume_control)
-+ pa_volume_control_description_changed(stream->stream->own_volume_control, new_control_description);
-+
-+ if (stream->stream->own_mute_control)
-+ pa_mute_control_description_changed(stream->stream->own_mute_control, new_control_description);
-+
-+ pa_xfree(new_control_description);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t client_proplist_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct stream *stream = userdata;
-+ pa_client *client = call_data;
-+ char *description;
-+
-+ pa_assert(stream);
-+ pa_assert(client);
-+
-+ if (client != stream->client)
-+ return PA_HOOK_OK;
-+
-+ description = get_stream_volume_and_mute_control_description_malloc(stream);
-+
-+ if (stream->stream->own_volume_control)
-+ pa_volume_control_description_changed(stream->stream->own_volume_control, description);
-+
-+ if (stream->stream->own_mute_control)
-+ pa_mute_control_description_changed(stream->stream->own_mute_control, description);
-+
-+ pa_xfree(description);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static struct stream *stream_new(pa_stream_creator *creator, enum stream_type type, void *core_stream) {
-+ struct stream *stream;
-+ const char *name = NULL;
-+ const char *description = NULL;
-+ pa_direction_t direction = PA_DIRECTION_OUTPUT;
-+
-+ pa_assert(creator);
-+ pa_assert(core_stream);
-+
-+ stream = pa_xnew0(struct stream, 1);
-+ stream->creator = creator;
-+ stream->type = type;
-+
-+ switch (type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ stream->sink_input = core_stream;
-+ stream->client = stream->sink_input->client;
-+ name = "sink-input-stream";
-+
-+ description = get_sink_input_description(stream->sink_input);
-+ if (!description)
-+ description = name;
-+
-+ direction = PA_DIRECTION_OUTPUT;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ stream->source_output = core_stream;
-+ stream->client = stream->source_output->client;
-+ name = "source-output-stream";
-+
-+ description = get_source_output_description(stream->source_output);
-+ if (!description)
-+ description = name;
-+
-+ direction = PA_DIRECTION_INPUT;
-+ break;
-+ }
-+
-+ stream->stream = pas_stream_new(creator->volume_api, name, description, direction);
-+ stream->stream->create_own_volume_control = stream_create_own_volume_control_cb;
-+ stream->stream->delete_own_volume_control = stream_delete_own_volume_control_cb;
-+ stream->stream->create_own_mute_control = stream_create_own_mute_control_cb;
-+ stream->stream->delete_own_mute_control = stream_delete_own_mute_control_cb;
-+ stream->stream->userdata = stream;
-+ pas_stream_set_have_own_volume_control(stream->stream, true);
-+ pas_stream_set_have_own_mute_control(stream->stream, true);
-+
-+ switch (type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ stream->proplist_changed_slot =
-+ pa_hook_connect(&stream->sink_input->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], PA_HOOK_NORMAL,
-+ sink_input_or_source_output_proplist_changed_cb, stream);
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ stream->proplist_changed_slot =
-+ pa_hook_connect(&stream->source_output->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PROPLIST_CHANGED],
-+ PA_HOOK_NORMAL, sink_input_or_source_output_proplist_changed_cb, stream);
-+ break;
-+ }
-+
-+ stream->client_proplist_changed_slot =
-+ pa_hook_connect(&stream->creator->volume_api->core->hooks[PA_CORE_HOOK_CLIENT_PROPLIST_CHANGED],
-+ PA_HOOK_NORMAL, client_proplist_changed_cb, stream);
-+
-+ return stream;
-+}
-+
-+static void stream_put(struct stream *stream) {
-+ pa_proplist *proplist = NULL;
-+
-+ pa_assert(stream);
-+
-+ switch (stream->type) {
-+ case STREAM_TYPE_SINK_INPUT:
-+ proplist = stream->sink_input->proplist;
-+ break;
-+
-+ case STREAM_TYPE_SOURCE_OUTPUT:
-+ proplist = stream->source_output->proplist;
-+ break;
-+ }
-+
-+ pas_stream_put(stream->stream, proplist);
-+}
-+
-+static void stream_unlink(struct stream *stream) {
-+ pa_assert(stream);
-+
-+ if (stream->unlinked)
-+ return;
-+
-+ stream->unlinked = true;
-+
-+ if (stream->stream)
-+ pas_stream_unlink(stream->stream);
-+}
-+
-+static void stream_free(struct stream *stream) {
-+ pa_assert(stream);
-+
-+ if (!stream->unlinked)
-+ stream_unlink(stream);
-+
-+ if (stream->client_proplist_changed_slot)
-+ pa_hook_slot_free(stream->client_proplist_changed_slot);
-+
-+ if (stream->proplist_changed_slot)
-+ pa_hook_slot_free(stream->proplist_changed_slot);
-+
-+ if (stream->stream)
-+ pas_stream_free(stream->stream);
-+
-+ pa_xfree(stream);
-+}
-+
-+static void create_stream(pa_stream_creator *creator, enum stream_type type, void *core_stream) {
-+ struct stream *stream;
-+
-+ pa_assert(creator);
-+ pa_assert(core_stream);
-+
-+ stream = stream_new(creator, type, core_stream);
-+ pa_hashmap_put(creator->streams, core_stream, stream);
-+ stream_put(stream);
-+}
-+
-+static pa_hook_result_t sink_input_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_stream_creator *creator = userdata;
-+ pa_sink_input *input = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(input);
-+
-+ create_stream(creator, STREAM_TYPE_SINK_INPUT, input);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t sink_input_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_stream_creator *creator = userdata;
-+ pa_sink_input *input = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(input);
-+
-+ pa_hashmap_remove_and_free(creator->streams, input);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t source_output_put_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_stream_creator *creator = userdata;
-+ pa_source_output *output = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(output);
-+
-+ create_stream(creator, STREAM_TYPE_SOURCE_OUTPUT, output);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static pa_hook_result_t source_output_unlink_cb(void *hook_data, void *call_data, void *userdata) {
-+ pa_stream_creator *creator = userdata;
-+ pa_source_output *output = call_data;
-+
-+ pa_assert(creator);
-+ pa_assert(output);
-+
-+ pa_hashmap_remove_and_free(creator->streams, output);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+pa_stream_creator *pa_stream_creator_new(pa_volume_api *api) {
-+ pa_stream_creator *creator;
-+ uint32_t idx;
-+ pa_sink_input *input;
-+ pa_source_output *output;
-+
-+ pa_assert(api);
-+
-+ creator = pa_xnew0(pa_stream_creator, 1);
-+ creator->volume_api = api;
-+ creator->streams = pa_hashmap_new_full(NULL, NULL, NULL, (pa_free_cb_t) stream_free);
-+ creator->sink_input_put_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_NORMAL,
-+ sink_input_put_cb, creator);
-+ creator->sink_input_unlink_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_NORMAL,
-+ sink_input_unlink_cb, creator);
-+ creator->source_output_put_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], PA_HOOK_NORMAL,
-+ source_output_put_cb, creator);
-+ creator->source_output_unlink_slot = pa_hook_connect(&api->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], PA_HOOK_NORMAL,
-+ source_output_unlink_cb, creator);
-+
-+ PA_IDXSET_FOREACH(input, api->core->sink_inputs, idx)
-+ create_stream(creator, STREAM_TYPE_SINK_INPUT, input);
-+
-+ PA_IDXSET_FOREACH(output, api->core->source_outputs, idx)
-+ create_stream(creator, STREAM_TYPE_SOURCE_OUTPUT, output);
-+
-+ return creator;
-+}
-+
-+void pa_stream_creator_free(pa_stream_creator *creator) {
-+ pa_assert(creator);
-+
-+ if (creator->streams)
-+ pa_hashmap_remove_all(creator->streams);
-+
-+ if (creator->source_output_unlink_slot)
-+ pa_hook_slot_free(creator->source_output_unlink_slot);
-+
-+ if (creator->source_output_put_slot)
-+ pa_hook_slot_free(creator->source_output_put_slot);
-+
-+ if (creator->sink_input_unlink_slot)
-+ pa_hook_slot_free(creator->sink_input_unlink_slot);
-+
-+ if (creator->sink_input_put_slot)
-+ pa_hook_slot_free(creator->sink_input_put_slot);
-+
-+ if (creator->streams)
-+ pa_hashmap_free(creator->streams);
-+
-+ pa_xfree(creator);
-+}
-diff --git a/src/modules/volume-api/stream-creator.h b/src/modules/volume-api/stream-creator.h
-new file mode 100644
-index 0000000..97a03a4
---- /dev/null
-+++ b/src/modules/volume-api/stream-creator.h
-@@ -0,0 +1,32 @@
-+#ifndef foostreamcreatorhfoo
-+#define foostreamcreatorhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/volume-api.h>
-+
-+typedef struct pa_stream_creator pa_stream_creator;
-+
-+pa_stream_creator *pa_stream_creator_new(pa_volume_api *api);
-+void pa_stream_creator_free(pa_stream_creator *creator);
-+
-+#endif
-diff --git a/src/modules/volume-api/volume-api.c b/src/modules/volume-api/volume-api.c
-new file mode 100644
-index 0000000..9abea7e
---- /dev/null
-+++ b/src/modules/volume-api/volume-api.c
-@@ -0,0 +1,647 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "volume-api.h"
-+
-+#include <modules/volume-api/audio-group.h>
-+#include <modules/volume-api/binding.h>
-+#include <modules/volume-api/device.h>
-+#include <modules/volume-api/device-creator.h>
-+#include <modules/volume-api/sstream.h>
-+#include <modules/volume-api/stream-creator.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/shared.h>
-+
-+static pa_volume_api *volume_api_new(pa_core *core);
-+static void volume_api_free(pa_volume_api *api);
-+
-+pa_volume_api *pa_volume_api_get(pa_core *core) {
-+ pa_volume_api *api;
-+
-+ pa_assert(core);
-+
-+ api = pa_shared_get(core, "volume-api");
-+
-+ if (api)
-+ pa_volume_api_ref(api);
-+ else {
-+ api = volume_api_new(core);
-+ pa_assert_se(pa_shared_set(core, "volume-api", api) >= 0);
-+ }
-+
-+ return api;
-+}
-+
-+pa_volume_api *pa_volume_api_ref(pa_volume_api *api) {
-+ pa_assert(api);
-+
-+ api->refcnt++;
-+
-+ return api;
-+}
-+
-+void pa_volume_api_unref(pa_volume_api *api) {
-+ pa_assert(api);
-+ pa_assert(api->refcnt > 0);
-+
-+ api->refcnt--;
-+
-+ if (api->refcnt == 0) {
-+ pa_assert_se(pa_shared_remove(api->core, "volume-api") >= 0);
-+ volume_api_free(api);
-+ }
-+}
-+
-+void pa_volume_api_add_binding_target_type(pa_volume_api *api, pa_binding_target_type *type) {
-+ pa_assert(api);
-+ pa_assert(type);
-+
-+ pa_assert_se(pa_hashmap_put(api->binding_target_types, type->name, type) >= 0);
-+
-+ pa_log_debug("Added binding target type %s.", type->name);
-+
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_ADDED], type);
-+}
-+
-+void pa_volume_api_remove_binding_target_type(pa_volume_api *api, pa_binding_target_type *type) {
-+ pa_assert(api);
-+ pa_assert(type);
-+
-+ pa_log_debug("Removing binding target type %s.", type->name);
-+
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_REMOVED], type);
-+
-+ pa_assert_se(pa_hashmap_remove(api->binding_target_types, type->name));
-+}
-+
-+static void create_builtin_binding_target_types(pa_volume_api *api) {
-+ pa_binding_target_type *type;
-+
-+ pa_assert(api);
-+
-+ type = pa_audio_group_create_binding_target_type(api);
-+ pa_volume_api_add_binding_target_type(api, type);
-+}
-+
-+static void delete_builtin_binding_target_types(pa_volume_api *api) {
-+ pa_binding_target_type *type;
-+
-+ pa_assert(api);
-+
-+ type = pa_hashmap_get(api->binding_target_types, PA_AUDIO_GROUP_BINDING_TARGET_TYPE);
-+ pa_volume_api_remove_binding_target_type(api, type);
-+}
-+
-+static void create_objects_defer_event_cb(pa_mainloop_api *mainloop_api, pa_defer_event *event, void *userdata) {
-+ pa_volume_api *volume_api = userdata;
-+
-+ pa_assert(volume_api);
-+ pa_assert(event == volume_api->create_objects_defer_event);
-+
-+ mainloop_api->defer_free(event);
-+ volume_api->create_objects_defer_event = NULL;
-+
-+ volume_api->device_creator = pa_device_creator_new(volume_api);
-+ volume_api->stream_creator = pa_stream_creator_new(volume_api);
-+}
-+
-+static pa_volume_api *volume_api_new(pa_core *core) {
-+ pa_volume_api *api;
-+ unsigned i;
-+
-+ pa_assert(core);
-+
-+ api = pa_xnew0(pa_volume_api, 1);
-+ api->core = core;
-+ api->refcnt = 1;
-+ api->binding_target_types = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+ api->names = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, pa_xfree);
-+ api->volume_controls = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+ api->mute_controls = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+ api->devices = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+ api->streams = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+ api->audio_groups = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+
-+ for (i = 0; i < PA_VOLUME_API_HOOK_MAX; i++)
-+ pa_hook_init(&api->hooks[i], api);
-+
-+ create_builtin_binding_target_types(api);
-+
-+ /* We delay the object creation to ensure that policy modules have a chance
-+ * to affect the initialization of the objects. If we created the objects
-+ * immediately, policy modules wouldn't have a chance of connecting to the
-+ * object creation hooks before the objects are created. */
-+ api->create_objects_defer_event = core->mainloop->defer_new(core->mainloop, create_objects_defer_event_cb, api);
-+
-+ pa_log_debug("Created a pa_volume_api object.");
-+
-+ return api;
-+}
-+
-+static void volume_api_free(pa_volume_api *api) {
-+ unsigned i;
-+
-+ pa_assert(api);
-+ pa_assert(api->refcnt == 0);
-+
-+ pa_log_debug("Freeing the pa_volume_api object.");
-+
-+ if (api->stream_creator)
-+ pa_stream_creator_free(api->stream_creator);
-+
-+ if (api->device_creator)
-+ pa_device_creator_free(api->device_creator);
-+
-+ if (api->create_objects_defer_event)
-+ api->core->mainloop->defer_free(api->create_objects_defer_event);
-+
-+ if (api->binding_target_types)
-+ delete_builtin_binding_target_types(api);
-+
-+ for (i = 0; i < PA_VOLUME_API_HOOK_MAX; i++)
-+ pa_hook_done(&api->hooks[i]);
-+
-+ if (api->audio_groups) {
-+ pa_assert(pa_hashmap_isempty(api->audio_groups));
-+ pa_hashmap_free(api->audio_groups);
-+ }
-+
-+ if (api->streams) {
-+ pa_assert(pa_hashmap_isempty(api->streams));
-+ pa_hashmap_free(api->streams);
-+ }
-+
-+ if (api->devices) {
-+ pa_assert(pa_hashmap_isempty(api->devices));
-+ pa_hashmap_free(api->devices);
-+ }
-+
-+ if (api->mute_controls) {
-+ pa_assert(pa_hashmap_isempty(api->mute_controls));
-+ pa_hashmap_free(api->mute_controls);
-+ }
-+
-+ if (api->volume_controls) {
-+ pa_assert(pa_hashmap_isempty(api->volume_controls));
-+ pa_hashmap_free(api->volume_controls);
-+ }
-+
-+ if (api->names) {
-+ pa_assert(pa_hashmap_isempty(api->names));
-+ pa_hashmap_free(api->names);
-+ }
-+
-+ if (api->binding_target_types) {
-+ pa_assert(pa_hashmap_isempty(api->binding_target_types));
-+ pa_hashmap_free(api->binding_target_types);
-+ }
-+
-+ pa_xfree(api);
-+}
-+
-+int pa_volume_api_register_name(pa_volume_api *api, const char *requested_name, bool fail_if_already_registered,
-+ const char **registered_name) {
-+ char *n;
-+
-+ pa_assert(api);
-+ pa_assert(requested_name);
-+ pa_assert(registered_name);
-+
-+ n = pa_xstrdup(requested_name);
-+
-+ if (pa_hashmap_put(api->names, n, n) < 0) {
-+ unsigned i = 1;
-+
-+ pa_xfree(n);
-+
-+ if (fail_if_already_registered) {
-+ pa_log("Name %s already registered.", requested_name);
-+ return -PA_ERR_EXIST;
-+ }
-+
-+ do {
-+ i++;
-+ n = pa_sprintf_malloc("%s.%u", requested_name, i);
-+ } while (pa_hashmap_put(api->names, n, n) < 0);
-+ }
-+
-+ *registered_name = n;
-+
-+ return 0;
-+}
-+
-+void pa_volume_api_unregister_name(pa_volume_api *api, const char *name) {
-+ pa_assert(api);
-+ pa_assert(name);
-+
-+ pa_assert_se(pa_hashmap_remove_and_free(api->names, name) >= 0);
-+}
-+
-+uint32_t pa_volume_api_allocate_volume_control_index(pa_volume_api *api) {
-+ uint32_t idx;
-+
-+ pa_assert(api);
-+
-+ idx = api->next_volume_control_index++;
-+
-+ return idx;
-+}
-+
-+static void set_main_output_volume_control_internal(pa_volume_api *api, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(api);
-+
-+ old_control = api->main_output_volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ api->main_output_volume_control = control;
-+ pa_log_debug("Main output volume control changed from %s to %s.", old_control ? old_control->name : "(unset)",
-+ control ? control->name : "(unset)");
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_MAIN_OUTPUT_VOLUME_CONTROL_CHANGED], api);
-+}
-+
-+static void set_main_input_volume_control_internal(pa_volume_api *api, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(api);
-+
-+ old_control = api->main_input_volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ api->main_input_volume_control = control;
-+ pa_log_debug("Main input volume control changed from %s to %s.", old_control ? old_control->name : "(unset)",
-+ control ? control->name : "(unset)");
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_MAIN_INPUT_VOLUME_CONTROL_CHANGED], api);
-+}
-+
-+void pa_volume_api_add_volume_control(pa_volume_api *api, pa_volume_control *control) {
-+ pa_assert(api);
-+ pa_assert(control);
-+
-+ pa_assert_se(pa_hashmap_put(api->volume_controls, (void *) control->name, control) >= 0);
-+}
-+
-+int pa_volume_api_remove_volume_control(pa_volume_api *api, pa_volume_control *control) {
-+ pa_assert(api);
-+ pa_assert(control);
-+
-+ if (!pa_hashmap_remove(api->volume_controls, control->name))
-+ return -1;
-+
-+ if (control == api->main_output_volume_control)
-+ set_main_output_volume_control_internal(api, NULL);
-+
-+ if (control == api->main_input_volume_control)
-+ set_main_input_volume_control_internal(api, NULL);
-+
-+ return 0;
-+}
-+
-+pa_volume_control *pa_volume_api_get_volume_control_by_index(pa_volume_api *api, uint32_t idx) {
-+ pa_volume_control *control;
-+ void *state;
-+
-+ pa_assert(api);
-+
-+ PA_HASHMAP_FOREACH(control, api->volume_controls, state) {
-+ if (control->index == idx)
-+ return control;
-+ }
-+
-+ return NULL;
-+}
-+
-+uint32_t pa_volume_api_allocate_mute_control_index(pa_volume_api *api) {
-+ uint32_t idx;
-+
-+ pa_assert(api);
-+
-+ idx = api->next_mute_control_index++;
-+
-+ return idx;
-+}
-+
-+static void set_main_output_mute_control_internal(pa_volume_api *api, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(api);
-+
-+ old_control = api->main_output_mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ api->main_output_mute_control = control;
-+ pa_log_debug("Main output mute control changed from %s to %s.", old_control ? old_control->name : "(unset)",
-+ control ? control->name : "(unset)");
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_MAIN_OUTPUT_MUTE_CONTROL_CHANGED], api);
-+}
-+
-+static void set_main_input_mute_control_internal(pa_volume_api *api, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(api);
-+
-+ old_control = api->main_input_mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ api->main_input_mute_control = control;
-+ pa_log_debug("Main input mute control changed from %s to %s.", old_control ? old_control->name : "(unset)",
-+ control ? control->name : "(unset)");
-+ pa_hook_fire(&api->hooks[PA_VOLUME_API_HOOK_MAIN_INPUT_MUTE_CONTROL_CHANGED], api);
-+}
-+
-+void pa_volume_api_add_mute_control(pa_volume_api *api, pa_mute_control *control) {
-+ pa_assert(api);
-+ pa_assert(control);
-+
-+ pa_assert_se(pa_hashmap_put(api->mute_controls, (void *) control->name, control) >= 0);
-+}
-+
-+int pa_volume_api_remove_mute_control(pa_volume_api *api, pa_mute_control *control) {
-+ pa_assert(api);
-+ pa_assert(control);
-+
-+ if (!pa_hashmap_remove(api->mute_controls, control->name))
-+ return -1;
-+
-+ if (control == api->main_output_mute_control)
-+ set_main_output_mute_control_internal(api, NULL);
-+
-+ if (control == api->main_input_mute_control)
-+ set_main_input_mute_control_internal(api, NULL);
-+
-+ return 0;
-+}
-+
-+pa_mute_control *pa_volume_api_get_mute_control_by_index(pa_volume_api *api, uint32_t idx) {
-+ pa_mute_control *control;
-+ void *state;
-+
-+ pa_assert(api);
-+
-+ PA_HASHMAP_FOREACH(control, api->mute_controls, state) {
-+ if (control->index == idx)
-+ return control;
-+ }
-+
-+ return NULL;
-+}
-+
-+uint32_t pa_volume_api_allocate_device_index(pa_volume_api *api) {
-+ uint32_t idx;
-+
-+ pa_assert(api);
-+
-+ idx = api->next_device_index++;
-+
-+ return idx;
-+}
-+
-+void pa_volume_api_add_device(pa_volume_api *api, pa_device *device) {
-+ pa_assert(api);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_put(api->devices, (void *) device->name, device) >= 0);
-+}
-+
-+int pa_volume_api_remove_device(pa_volume_api *api, pa_device *device) {
-+ pa_assert(api);
-+ pa_assert(device);
-+
-+ if (!pa_hashmap_remove(api->devices, device->name))
-+ return -1;
-+
-+ return 0;
-+}
-+
-+pa_device *pa_volume_api_get_device_by_index(pa_volume_api *api, uint32_t idx) {
-+ pa_device *device;
-+ void *state;
-+
-+ pa_assert(api);
-+
-+ PA_HASHMAP_FOREACH(device, api->devices, state) {
-+ if (device->index == idx)
-+ return device;
-+ }
-+
-+ return NULL;
-+}
-+
-+uint32_t pa_volume_api_allocate_stream_index(pa_volume_api *api) {
-+ uint32_t idx;
-+
-+ pa_assert(api);
-+
-+ idx = api->next_stream_index++;
-+
-+ return idx;
-+}
-+
-+void pa_volume_api_add_stream(pa_volume_api *api, pas_stream *stream) {
-+ pa_assert(api);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_put(api->streams, (void *) stream->name, stream) >= 0);
-+}
-+
-+int pa_volume_api_remove_stream(pa_volume_api *api, pas_stream *stream) {
-+ pa_assert(api);
-+ pa_assert(stream);
-+
-+ if (!pa_hashmap_remove(api->streams, stream->name))
-+ return -1;
-+
-+ return 0;
-+}
-+
-+pas_stream *pa_volume_api_get_stream_by_index(pa_volume_api *api, uint32_t idx) {
-+ pas_stream *stream;
-+ void *state;
-+
-+ pa_assert(api);
-+
-+ PA_HASHMAP_FOREACH(stream, api->streams, state) {
-+ if (stream->index == idx)
-+ return stream;
-+ }
-+
-+ return NULL;
-+}
-+
-+uint32_t pa_volume_api_allocate_audio_group_index(pa_volume_api *api) {
-+ uint32_t idx;
-+
-+ pa_assert(api);
-+
-+ idx = api->next_audio_group_index++;
-+
-+ return idx;
-+}
-+
-+void pa_volume_api_add_audio_group(pa_volume_api *api, pa_audio_group *group) {
-+ pa_assert(api);
-+ pa_assert(group);
-+
-+ pa_assert_se(pa_hashmap_put(api->audio_groups, (void *) group->name, group) >= 0);
-+}
-+
-+int pa_volume_api_remove_audio_group(pa_volume_api *api, pa_audio_group *group) {
-+ pa_assert(api);
-+ pa_assert(group);
-+
-+ if (!pa_hashmap_remove(api->audio_groups, group->name))
-+ return -1;
-+
-+ return 0;
-+}
-+
-+pa_audio_group *pa_volume_api_get_audio_group_by_index(pa_volume_api *api, uint32_t idx) {
-+ pa_audio_group *group;
-+ void *state;
-+
-+ pa_assert(api);
-+
-+ PA_HASHMAP_FOREACH(group, api->audio_groups, state) {
-+ if (group->index == idx)
-+ return group;
-+ }
-+
-+ return NULL;
-+}
-+
-+void pa_volume_api_set_main_output_volume_control(pa_volume_api *api, pa_volume_control *control) {
-+ pa_assert(api);
-+
-+ if (api->main_output_volume_control_binding) {
-+ pa_binding_free(api->main_output_volume_control_binding);
-+ api->main_output_volume_control_binding = NULL;
-+ }
-+
-+ set_main_output_volume_control_internal(api, control);
-+}
-+
-+void pa_volume_api_set_main_input_volume_control(pa_volume_api *api, pa_volume_control *control) {
-+ pa_assert(api);
-+
-+ if (api->main_input_volume_control_binding) {
-+ pa_binding_free(api->main_input_volume_control_binding);
-+ api->main_input_volume_control_binding = NULL;
-+ }
-+
-+ set_main_input_volume_control_internal(api, control);
-+}
-+
-+void pa_volume_api_set_main_output_mute_control(pa_volume_api *api, pa_mute_control *control) {
-+ pa_assert(api);
-+
-+ if (api->main_output_mute_control_binding) {
-+ pa_binding_free(api->main_output_mute_control_binding);
-+ api->main_output_mute_control_binding = NULL;
-+ }
-+
-+ set_main_output_mute_control_internal(api, control);
-+}
-+
-+void pa_volume_api_set_main_input_mute_control(pa_volume_api *api, pa_mute_control *control) {
-+ pa_assert(api);
-+
-+ if (api->main_input_mute_control_binding) {
-+ pa_binding_free(api->main_input_mute_control_binding);
-+ api->main_input_mute_control_binding = NULL;
-+ }
-+
-+ set_main_input_mute_control_internal(api, control);
-+}
-+
-+void pa_volume_api_bind_main_output_volume_control(pa_volume_api *api, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = api,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_output_volume_control_internal,
-+ };
-+
-+ pa_assert(api);
-+ pa_assert(target_info);
-+
-+ if (api->main_output_volume_control_binding)
-+ pa_binding_free(api->main_output_volume_control_binding);
-+
-+ api->main_output_volume_control_binding = pa_binding_new(api, &owner_info, target_info);
-+}
-+
-+void pa_volume_api_bind_main_input_volume_control(pa_volume_api *api, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = api,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_input_volume_control_internal,
-+ };
-+
-+ pa_assert(api);
-+ pa_assert(target_info);
-+
-+ if (api->main_input_volume_control_binding)
-+ pa_binding_free(api->main_input_volume_control_binding);
-+
-+ api->main_input_volume_control_binding = pa_binding_new(api, &owner_info, target_info);
-+}
-+
-+void pa_volume_api_bind_main_output_mute_control(pa_volume_api *api, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = api,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_output_mute_control_internal,
-+ };
-+
-+ pa_assert(api);
-+ pa_assert(target_info);
-+
-+ if (api->main_output_mute_control_binding)
-+ pa_binding_free(api->main_output_mute_control_binding);
-+
-+ api->main_output_mute_control_binding = pa_binding_new(api, &owner_info, target_info);
-+}
-+
-+void pa_volume_api_bind_main_input_mute_control(pa_volume_api *api, pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = api,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_input_mute_control_internal,
-+ };
-+
-+ pa_assert(api);
-+ pa_assert(target_info);
-+
-+ if (api->main_input_mute_control_binding)
-+ pa_binding_free(api->main_input_mute_control_binding);
-+
-+ api->main_input_mute_control_binding = pa_binding_new(api, &owner_info, target_info);
-+}
-diff --git a/src/modules/volume-api/volume-api.h b/src/modules/volume-api/volume-api.h
-new file mode 100644
-index 0000000..73a1410
---- /dev/null
-+++ b/src/modules/volume-api/volume-api.h
-@@ -0,0 +1,163 @@
-+#ifndef foovolumeapihfoo
-+#define foovolumeapihfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <pulsecore/core.h>
-+
-+typedef struct pa_volume_api pa_volume_api;
-+
-+/* Avoid circular dependencies... */
-+typedef struct pa_audio_group pa_audio_group;
-+typedef struct pa_binding pa_binding;
-+typedef struct pa_binding_target_info pa_binding_target_info;
-+typedef struct pa_binding_target_type pa_binding_target_type;
-+typedef struct pa_device pa_device;
-+typedef struct pa_device_creator pa_device_creator;
-+typedef struct pa_mute_control pa_mute_control;
-+typedef struct pas_stream pas_stream;
-+typedef struct pa_stream_creator pa_stream_creator;
-+typedef struct pa_volume_control pa_volume_control;
-+
-+enum {
-+ PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_ADDED,
-+ PA_VOLUME_API_HOOK_BINDING_TARGET_TYPE_REMOVED,
-+ PA_VOLUME_API_HOOK_VOLUME_CONTROL_PUT,
-+ PA_VOLUME_API_HOOK_VOLUME_CONTROL_UNLINK,
-+ PA_VOLUME_API_HOOK_VOLUME_CONTROL_DESCRIPTION_CHANGED,
-+ PA_VOLUME_API_HOOK_VOLUME_CONTROL_VOLUME_CHANGED,
-+ PA_VOLUME_API_HOOK_MUTE_CONTROL_PUT,
-+ PA_VOLUME_API_HOOK_MUTE_CONTROL_UNLINK,
-+ PA_VOLUME_API_HOOK_MUTE_CONTROL_DESCRIPTION_CHANGED,
-+ PA_VOLUME_API_HOOK_MUTE_CONTROL_MUTE_CHANGED,
-+ PA_VOLUME_API_HOOK_DEVICE_PUT,
-+ PA_VOLUME_API_HOOK_DEVICE_UNLINK,
-+ PA_VOLUME_API_HOOK_DEVICE_DESCRIPTION_CHANGED,
-+ PA_VOLUME_API_HOOK_DEVICE_VOLUME_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_DEVICE_MUTE_CONTROL_CHANGED,
-+
-+ /* Policy modules can use this to set the initial volume control for a
-+ * stream. The hook callback should use pas_stream_set_volume_control() to
-+ * set the volume control. The hook callback should not do anything if
-+ * stream->volume_control is already non-NULL. */
-+ PA_VOLUME_API_HOOK_STREAM_SET_INITIAL_VOLUME_CONTROL,
-+
-+ /* Policy modules can use this to set the initial mute control for a
-+ * stream. The hook callback should use pas_stream_set_mute_control() to
-+ * set the mute control. The hook callback should not do anything if
-+ * stream->mute_control is already non-NULL. */
-+ PA_VOLUME_API_HOOK_STREAM_SET_INITIAL_MUTE_CONTROL,
-+
-+ PA_VOLUME_API_HOOK_STREAM_PUT,
-+ PA_VOLUME_API_HOOK_STREAM_UNLINK,
-+ PA_VOLUME_API_HOOK_STREAM_DESCRIPTION_CHANGED,
-+ PA_VOLUME_API_HOOK_STREAM_VOLUME_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_STREAM_MUTE_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_AUDIO_GROUP_PUT,
-+ PA_VOLUME_API_HOOK_AUDIO_GROUP_UNLINK,
-+ PA_VOLUME_API_HOOK_AUDIO_GROUP_VOLUME_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_AUDIO_GROUP_MUTE_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_MAIN_OUTPUT_VOLUME_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_MAIN_INPUT_VOLUME_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_MAIN_OUTPUT_MUTE_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_MAIN_INPUT_MUTE_CONTROL_CHANGED,
-+ PA_VOLUME_API_HOOK_MAX
-+};
-+
-+struct pa_volume_api {
-+ pa_core *core;
-+ unsigned refcnt;
-+ pa_hashmap *binding_target_types; /* name -> pa_binding_target_type */
-+ pa_hashmap *names; /* object name -> object name (hashmap-as-a-set) */
-+ pa_hashmap *volume_controls; /* name -> pa_volume_control */
-+ pa_hashmap *mute_controls; /* name -> pa_mute_control */
-+ pa_hashmap *devices; /* name -> pa_device */
-+ pa_hashmap *streams; /* name -> pas_stream */
-+ pa_hashmap *audio_groups; /* name -> pa_audio_group */
-+ pa_volume_control *main_output_volume_control;
-+ pa_volume_control *main_input_volume_control;
-+ pa_mute_control *main_output_mute_control;
-+ pa_mute_control *main_input_mute_control;
-+
-+ uint32_t next_volume_control_index;
-+ uint32_t next_mute_control_index;
-+ uint32_t next_device_index;
-+ uint32_t next_stream_index;
-+ uint32_t next_audio_group_index;
-+ pa_binding *main_output_volume_control_binding;
-+ pa_binding *main_input_volume_control_binding;
-+ pa_binding *main_output_mute_control_binding;
-+ pa_binding *main_input_mute_control_binding;
-+ pa_hook hooks[PA_VOLUME_API_HOOK_MAX];
-+ pa_defer_event *create_objects_defer_event;
-+ pa_device_creator *device_creator;
-+ pa_stream_creator *stream_creator;
-+};
-+
-+pa_volume_api *pa_volume_api_get(pa_core *core);
-+pa_volume_api *pa_volume_api_ref(pa_volume_api *api);
-+void pa_volume_api_unref(pa_volume_api *api);
-+
-+void pa_volume_api_add_binding_target_type(pa_volume_api *api, pa_binding_target_type *type);
-+void pa_volume_api_remove_binding_target_type(pa_volume_api *api, pa_binding_target_type *type);
-+
-+/* If fail_if_already_registered is false, this function never fails. */
-+int pa_volume_api_register_name(pa_volume_api *api, const char *requested_name, bool fail_if_already_registered,
-+ const char **registered_name);
-+
-+void pa_volume_api_unregister_name(pa_volume_api *api, const char *name);
-+
-+uint32_t pa_volume_api_allocate_volume_control_index(pa_volume_api *api);
-+void pa_volume_api_add_volume_control(pa_volume_api *api, pa_volume_control *control);
-+int pa_volume_api_remove_volume_control(pa_volume_api *api, pa_volume_control *control);
-+pa_volume_control *pa_volume_api_get_volume_control_by_index(pa_volume_api *api, uint32_t idx);
-+
-+uint32_t pa_volume_api_allocate_mute_control_index(pa_volume_api *api);
-+void pa_volume_api_add_mute_control(pa_volume_api *api, pa_mute_control *control);
-+int pa_volume_api_remove_mute_control(pa_volume_api *api, pa_mute_control *control);
-+pa_mute_control *pa_volume_api_get_mute_control_by_index(pa_volume_api *api, uint32_t idx);
-+
-+uint32_t pa_volume_api_allocate_device_index(pa_volume_api *api);
-+void pa_volume_api_add_device(pa_volume_api *api, pa_device *device);
-+int pa_volume_api_remove_device(pa_volume_api *api, pa_device *device);
-+pa_device *pa_volume_api_get_device_by_index(pa_volume_api *api, uint32_t idx);
-+
-+uint32_t pa_volume_api_allocate_stream_index(pa_volume_api *api);
-+void pa_volume_api_add_stream(pa_volume_api *api, pas_stream *stream);
-+int pa_volume_api_remove_stream(pa_volume_api *api, pas_stream *stream);
-+pas_stream *pa_volume_api_get_stream_by_index(pa_volume_api *api, uint32_t idx);
-+
-+uint32_t pa_volume_api_allocate_audio_group_index(pa_volume_api *api);
-+void pa_volume_api_add_audio_group(pa_volume_api *api, pa_audio_group *group);
-+int pa_volume_api_remove_audio_group(pa_volume_api *api, pa_audio_group *group);
-+pa_audio_group *pa_volume_api_get_audio_group_by_index(pa_volume_api *api, uint32_t idx);
-+
-+void pa_volume_api_set_main_output_volume_control(pa_volume_api *api, pa_volume_control *control);
-+void pa_volume_api_set_main_input_volume_control(pa_volume_api *api, pa_volume_control *control);
-+void pa_volume_api_set_main_output_mute_control(pa_volume_api *api, pa_mute_control *control);
-+void pa_volume_api_set_main_input_mute_control(pa_volume_api *api, pa_mute_control *control);
-+void pa_volume_api_bind_main_output_volume_control(pa_volume_api *api, pa_binding_target_info *target_info);
-+void pa_volume_api_bind_main_input_volume_control(pa_volume_api *api, pa_binding_target_info *target_info);
-+void pa_volume_api_bind_main_output_mute_control(pa_volume_api *api, pa_binding_target_info *target_info);
-+void pa_volume_api_bind_main_input_mute_control(pa_volume_api *api, pa_binding_target_info *target_info);
-+
-+#endif
-diff --git a/src/modules/volume-api/volume-control.c b/src/modules/volume-api/volume-control.c
-new file mode 100644
-index 0000000..c7f5dbb
---- /dev/null
-+++ b/src/modules/volume-api/volume-control.c
-@@ -0,0 +1,363 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "volume-control.h"
-+
-+#include <modules/volume-api/audio-group.h>
-+#include <modules/volume-api/device.h>
-+#include <modules/volume-api/sstream.h>
-+
-+#include <pulsecore/core-util.h>
-+
-+pa_volume_control *pa_volume_control_new(pa_volume_api *api, const char *name, const char *description, bool convertible_to_dB,
-+ bool channel_map_is_writable) {
-+ pa_volume_control *control;
-+
-+ pa_assert(api);
-+ pa_assert(name);
-+ pa_assert(description);
-+
-+ control = pa_xnew0(pa_volume_control, 1);
-+ control->volume_api = api;
-+ control->index = pa_volume_api_allocate_volume_control_index(api);
-+ pa_assert_se(pa_volume_api_register_name(api, name, false, &control->name) >= 0);
-+ control->description = pa_xstrdup(description);
-+ control->proplist = pa_proplist_new();
-+ pa_bvolume_init_invalid(&control->volume);
-+ control->convertible_to_dB = convertible_to_dB;
-+ control->channel_map_is_writable = channel_map_is_writable;
-+ control->devices = pa_hashmap_new(NULL, NULL);
-+ control->default_for_devices = pa_hashmap_new(NULL, NULL);
-+ control->streams = pa_hashmap_new(NULL, NULL);
-+ control->audio_groups = pa_hashmap_new(NULL, NULL);
-+
-+ return control;
-+}
-+
-+void pa_volume_control_put(pa_volume_control *control, const pa_bvolume *initial_volume,
-+ pa_volume_control_set_initial_volume_cb_t set_initial_volume_cb) {
-+ const char *prop_key;
-+ void *state = NULL;
-+ char volume_str[PA_VOLUME_SNPRINT_VERBOSE_MAX];
-+ char balance_str[PA_BVOLUME_SNPRINT_BALANCE_MAX];
-+
-+ pa_assert(control);
-+ pa_assert((initial_volume && pa_bvolume_valid(initial_volume, true, true)) || control->set_volume);
-+ pa_assert((initial_volume && pa_channel_map_valid(&initial_volume->channel_map)) || control->channel_map_is_writable);
-+ pa_assert(set_initial_volume_cb || !control->set_volume);
-+
-+ if (initial_volume && pa_bvolume_valid(initial_volume, true, false))
-+ control->volume.volume = initial_volume->volume;
-+ else
-+ control->volume.volume = PA_VOLUME_NORM / 3;
-+
-+ if (initial_volume && pa_bvolume_valid(initial_volume, false, true))
-+ pa_bvolume_copy_balance(&control->volume, initial_volume);
-+ else if (initial_volume && pa_channel_map_valid(&initial_volume->channel_map))
-+ pa_bvolume_reset_balance(&control->volume, &initial_volume->channel_map);
-+ else {
-+ pa_channel_map_init_mono(&control->volume.channel_map);
-+ pa_bvolume_reset_balance(&control->volume, &control->volume.channel_map);
-+ }
-+
-+ if (set_initial_volume_cb)
-+ set_initial_volume_cb(control);
-+
-+ pa_volume_api_add_volume_control(control->volume_api, control);
-+
-+ control->linked = true;
-+
-+ pa_log_debug("Created volume control #%u.", control->index);
-+ pa_log_debug(" Name: %s", control->name);
-+ pa_log_debug(" Description: %s", control->description);
-+ pa_log_debug(" Properties:");
-+
-+ while ((prop_key = pa_proplist_iterate(control->proplist, &state)))
-+ pa_log_debug(" %s = %s", prop_key, pa_strnull(pa_proplist_gets(control->proplist, prop_key)));
-+
-+ pa_log_debug(" Volume: %s", pa_volume_snprint_verbose(volume_str, sizeof(volume_str), control->volume.volume,
-+ control->convertible_to_dB));
-+ pa_log_debug(" Balance: %s", pa_bvolume_snprint_balance(balance_str, sizeof(balance_str), &control->volume));
-+ pa_log_debug(" Channel map is writable: %s", pa_yes_no(control->channel_map_is_writable));
-+
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_VOLUME_CONTROL_PUT], control);
-+}
-+
-+void pa_volume_control_unlink(pa_volume_control *control) {
-+ pa_audio_group *group;
-+ pa_device *device;
-+ pas_stream *stream;
-+
-+ pa_assert(control);
-+
-+ if (control->unlinked) {
-+ pa_log_debug("Unlinking volume control %s (already unlinked, this is a no-op).", control->name);
-+ return;
-+ }
-+
-+ control->unlinked = true;
-+
-+ pa_log_debug("Unlinking volume control %s.", control->name);
-+
-+ if (control->linked)
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_VOLUME_CONTROL_UNLINK], control);
-+
-+ pa_volume_api_remove_volume_control(control->volume_api, control);
-+
-+ while ((group = pa_hashmap_first(control->audio_groups)))
-+ pa_audio_group_set_volume_control(group, NULL);
-+
-+ while ((stream = pa_hashmap_first(control->streams)))
-+ pas_stream_set_volume_control(stream, NULL);
-+
-+ while ((device = pa_hashmap_first(control->default_for_devices)))
-+ pa_device_set_default_volume_control(device, NULL);
-+
-+ while ((device = pa_hashmap_first(control->devices))) {
-+ /* Why do we have this assertion here? The concern is that if we call
-+ * pa_device_set_volume_control() for some device that has the
-+ * use_default_volume_control flag set, then that flag will be unset as
-+ * a side effect, and we don't want that side effect. This assertion
-+ * should be safe, because we just called
-+ * pa_device_set_default_volume_control(NULL) for each device that this
-+ * control was the default for, and that should ensure that we don't
-+ * any more hold any references to devices that used to use this
-+ * control as the default. */
-+ pa_assert(!device->use_default_volume_control);
-+ pa_device_set_volume_control(device, NULL);
-+ }
-+}
-+
-+void pa_volume_control_free(pa_volume_control *control) {
-+ pa_assert(control);
-+
-+ if (!control->unlinked)
-+ pa_volume_control_unlink(control);
-+
-+ if (control->audio_groups) {
-+ pa_assert(pa_hashmap_isempty(control->audio_groups));
-+ pa_hashmap_free(control->audio_groups);
-+ }
-+
-+ if (control->streams) {
-+ pa_assert(pa_hashmap_isempty(control->streams));
-+ pa_hashmap_free(control->streams);
-+ }
-+
-+ if (control->default_for_devices) {
-+ pa_assert(pa_hashmap_isempty(control->default_for_devices));
-+ pa_hashmap_free(control->default_for_devices);
-+ }
-+
-+ if (control->devices) {
-+ pa_assert(pa_hashmap_isempty(control->devices));
-+ pa_hashmap_free(control->devices);
-+ }
-+
-+ if (control->proplist)
-+ pa_proplist_free(control->proplist);
-+
-+ pa_xfree(control->description);
-+
-+ if (control->name)
-+ pa_volume_api_unregister_name(control->volume_api, control->name);
-+
-+ pa_xfree(control);
-+}
-+
-+void pa_volume_control_set_owner_audio_group(pa_volume_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ control->owner_audio_group = group;
-+}
-+
-+static void set_volume_internal(pa_volume_control *control, const pa_bvolume *volume, bool set_volume, bool set_balance) {
-+ pa_bvolume old_volume;
-+ bool volume_changed;
-+ bool balance_changed;
-+
-+ pa_assert(control);
-+ pa_assert(volume);
-+
-+ old_volume = control->volume;
-+ volume_changed = !pa_bvolume_equal(volume, &old_volume, set_volume, false);
-+ balance_changed = !pa_bvolume_equal(volume, &old_volume, false, set_balance);
-+
-+ if (!volume_changed && !balance_changed)
-+ return;
-+
-+ if (volume_changed)
-+ control->volume.volume = volume->volume;
-+
-+ if (balance_changed)
-+ pa_bvolume_copy_balance(&control->volume, volume);
-+
-+ if (!control->linked || control->unlinked)
-+ return;
-+
-+ if (volume_changed) {
-+ char old_volume_str[PA_VOLUME_SNPRINT_VERBOSE_MAX];
-+ char new_volume_str[PA_VOLUME_SNPRINT_VERBOSE_MAX];
-+
-+ pa_log_debug("The volume of volume control %s changed from %s to %s.", control->name,
-+ pa_volume_snprint_verbose(old_volume_str, sizeof(old_volume_str), old_volume.volume,
-+ control->convertible_to_dB),
-+ pa_volume_snprint_verbose(new_volume_str, sizeof(new_volume_str), control->volume.volume,
-+ control->convertible_to_dB));
-+ }
-+
-+ if (balance_changed) {
-+ char old_balance_str[PA_BVOLUME_SNPRINT_BALANCE_MAX];
-+ char new_balance_str[PA_BVOLUME_SNPRINT_BALANCE_MAX];
-+
-+ pa_log_debug("The balance of volume control %s changed from %s to %s.", control->name,
-+ pa_bvolume_snprint_balance(old_balance_str, sizeof(old_balance_str), &control->volume),
-+ pa_bvolume_snprint_balance(new_balance_str, sizeof(new_balance_str), &control->volume));
-+ }
-+
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_VOLUME_CONTROL_VOLUME_CHANGED], control);
-+}
-+
-+int pa_volume_control_set_volume(pa_volume_control *control, const pa_bvolume *volume, bool set_volume, bool set_balance) {
-+ pa_bvolume volume_local;
-+ int r;
-+
-+ pa_assert(control);
-+ pa_assert(volume);
-+
-+ volume_local = *volume;
-+
-+ if (!control->set_volume) {
-+ pa_log_info("Tried to set the volume of volume control %s, but the volume control doesn't support the operation.",
-+ control->name);
-+ return -PA_ERR_NOTSUPPORTED;
-+ }
-+
-+ if (set_balance
-+ && !control->channel_map_is_writable
-+ && !pa_channel_map_equal(&volume_local.channel_map, &control->volume.channel_map))
-+ pa_bvolume_remap(&volume_local, &control->volume.channel_map);
-+
-+ if (pa_bvolume_equal(&volume_local, &control->volume, set_volume, set_balance))
-+ return 0;
-+
-+ control->set_volume_in_progress = true;
-+ r = control->set_volume(control, &volume_local, set_volume, set_balance);
-+ control->set_volume_in_progress = false;
-+
-+ if (r >= 0)
-+ set_volume_internal(control, &volume_local, set_volume, set_balance);
-+
-+ return r;
-+}
-+
-+void pa_volume_control_description_changed(pa_volume_control *control, const char *new_description) {
-+ char *old_description;
-+
-+ pa_assert(control);
-+ pa_assert(new_description);
-+
-+ old_description = control->description;
-+
-+ if (pa_streq(new_description, old_description))
-+ return;
-+
-+ control->description = pa_xstrdup(new_description);
-+ pa_log_debug("The description of volume control %s changed from \"%s\" to \"%s\".", control->name, old_description,
-+ new_description);
-+ pa_xfree(old_description);
-+ pa_hook_fire(&control->volume_api->hooks[PA_VOLUME_API_HOOK_VOLUME_CONTROL_DESCRIPTION_CHANGED], control);
-+}
-+
-+void pa_volume_control_volume_changed(pa_volume_control *control, const pa_bvolume *new_volume, bool volume_changed,
-+ bool balance_changed) {
-+ pa_assert(control);
-+ pa_assert(new_volume);
-+
-+ if (!control->linked)
-+ return;
-+
-+ if (control->set_volume_in_progress)
-+ return;
-+
-+ set_volume_internal(control, new_volume, volume_changed, balance_changed);
-+}
-+
-+void pa_volume_control_add_device(pa_volume_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_put(control->devices, device, device) >= 0);
-+}
-+
-+void pa_volume_control_remove_device(pa_volume_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_remove(control->devices, device));
-+}
-+
-+void pa_volume_control_add_default_for_device(pa_volume_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_put(control->default_for_devices, device, device) >= 0);
-+}
-+
-+void pa_volume_control_remove_default_for_device(pa_volume_control *control, pa_device *device) {
-+ pa_assert(control);
-+ pa_assert(device);
-+
-+ pa_assert_se(pa_hashmap_remove(control->default_for_devices, device));
-+}
-+
-+void pa_volume_control_add_stream(pa_volume_control *control, pas_stream *stream) {
-+ pa_assert(control);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_put(control->streams, stream, stream) >= 0);
-+}
-+
-+void pa_volume_control_remove_stream(pa_volume_control *control, pas_stream *stream) {
-+ pa_assert(control);
-+ pa_assert(stream);
-+
-+ pa_assert_se(pa_hashmap_remove(control->streams, stream));
-+}
-+
-+void pa_volume_control_add_audio_group(pa_volume_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ pa_assert_se(pa_hashmap_put(control->audio_groups, group, group) >= 0);
-+}
-+
-+void pa_volume_control_remove_audio_group(pa_volume_control *control, pa_audio_group *group) {
-+ pa_assert(control);
-+ pa_assert(group);
-+
-+ pa_assert_se(pa_hashmap_remove(control->audio_groups, group));
-+}
-diff --git a/src/modules/volume-api/volume-control.h b/src/modules/volume-api/volume-control.h
-new file mode 100644
-index 0000000..aaba758
---- /dev/null
-+++ b/src/modules/volume-api/volume-control.h
-@@ -0,0 +1,112 @@
-+#ifndef foovolumecontrolhfoo
-+#define foovolumecontrolhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/bvolume.h>
-+#include <modules/volume-api/volume-api.h>
-+
-+typedef struct pa_volume_control pa_volume_control;
-+
-+struct pa_volume_control {
-+ pa_volume_api *volume_api;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_proplist *proplist;
-+ pa_bvolume volume;
-+ bool convertible_to_dB;
-+ bool channel_map_is_writable;
-+
-+ /* If this volume control is the "own volume control" of an audio group,
-+ * this is set to point to that group, otherwise this is NULL. */
-+ pa_audio_group *owner_audio_group;
-+
-+ pa_hashmap *devices; /* pa_device -> pa_device (hashmap-as-a-set) */
-+ pa_hashmap *default_for_devices; /* pa_device -> pa_device (hashmap-as-a-set) */
-+ pa_hashmap *streams; /* pas_stream -> pas_stream (hashmap-as-a-set) */
-+ pa_hashmap *audio_groups; /* pa_audio_group -> pa_audio_group (hashmap-as-a-set) */
-+
-+ bool linked;
-+ bool unlinked;
-+ bool set_volume_in_progress;
-+
-+ /* Called from pa_volume_control_set_volume(). The implementation is
-+ * expected to return a negative error code on failure. May be NULL, if the
-+ * volume control is read-only. */
-+ int (*set_volume)(pa_volume_control *control, const pa_bvolume *volume, bool set_volume, bool set_balance);
-+
-+ void *userdata;
-+};
-+
-+pa_volume_control *pa_volume_control_new(pa_volume_api *api, const char *name, const char *description, bool convertible_to_dB,
-+ bool channel_map_is_writable);
-+
-+typedef void (*pa_volume_control_set_initial_volume_cb_t)(pa_volume_control *control);
-+
-+/* initial_volume is the preferred initial volume of the volume control
-+ * implementation. It may be NULL or partially invalid, if the implementation
-+ * doesn't care about the initial state of the volume control, as long as these
-+ * two rules are followed:
-+ *
-+ * 1) Read-only volume controls must always specify fully valid initial
-+ * volume.
-+ * 2) Volume controls with read-only channel map must always specify a valid
-+ * channel map in initial_volume.
-+ *
-+ * The implementation's initial volume preference may be overridden by policy,
-+ * if the volume control isn't read-only. When the final initial volume is
-+ * known, the implementation is notified via set_initial_volume_cb (the volume
-+ * can be read from control->volume). set_initial_volume_cb may be NULL, if the
-+ * volume control is read-only. */
-+void pa_volume_control_put(pa_volume_control *control, const pa_bvolume *initial_volume,
-+ pa_volume_control_set_initial_volume_cb_t set_initial_volume_cb);
-+
-+void pa_volume_control_unlink(pa_volume_control *control);
-+void pa_volume_control_free(pa_volume_control *control);
-+
-+/* Called by audio-group.c only. */
-+void pa_volume_control_set_owner_audio_group(pa_volume_control *control, pa_audio_group *group);
-+
-+/* Called by clients and policy modules. */
-+int pa_volume_control_set_volume(pa_volume_control *control, const pa_bvolume *volume, bool set_volume, bool set_balance);
-+
-+/* Called by the volume control implementation. */
-+void pa_volume_control_description_changed(pa_volume_control *control, const char *new_description);
-+void pa_volume_control_volume_changed(pa_volume_control *control, const pa_bvolume *new_volume, bool volume_changed,
-+ bool balance_changed);
-+
-+/* Called from device.c only. */
-+void pa_volume_control_add_device(pa_volume_control *control, pa_device *device);
-+void pa_volume_control_remove_device(pa_volume_control *control, pa_device *device);
-+void pa_volume_control_add_default_for_device(pa_volume_control *control, pa_device *device);
-+void pa_volume_control_remove_default_for_device(pa_volume_control *control, pa_device *device);
-+
-+/* Called from sstream.c only. */
-+void pa_volume_control_add_stream(pa_volume_control *control, pas_stream *stream);
-+void pa_volume_control_remove_stream(pa_volume_control *control, pas_stream *stream);
-+
-+/* Called from audio-group.c only. */
-+void pa_volume_control_add_audio_group(pa_volume_control *control, pa_audio_group *group);
-+void pa_volume_control_remove_audio_group(pa_volume_control *control, pa_audio_group *group);
-+
-+#endif
-diff --git a/src/pulse/ext-volume-api.c b/src/pulse/ext-volume-api.c
-new file mode 100644
-index 0000000..8e93bce
---- /dev/null
-+++ b/src/pulse/ext-volume-api.c
-@@ -0,0 +1,275 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "ext-volume-api.h"
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/i18n.h>
-+#include <pulsecore/macro.h>
-+
-+#include <math.h>
-+
-+int pa_ext_volume_api_balance_valid(double balance) {
-+ return balance >= 0.0 && balance <= 1.0;
-+}
-+
-+int pa_ext_volume_api_bvolume_valid(const pa_ext_volume_api_bvolume *volume, int check_volume, int check_balance) {
-+ unsigned channel;
-+
-+ pa_assert(volume);
-+
-+ if (check_volume && !PA_VOLUME_IS_VALID(volume->volume))
-+ return 0;
-+
-+ if (!check_balance)
-+ return 1;
-+
-+ if (!pa_channel_map_valid(&volume->channel_map))
-+ return 0;
-+
-+ for (channel = 0; channel < volume->channel_map.channels; channel++) {
-+ if (!pa_ext_volume_api_balance_valid(volume->balance[channel]))
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+void pa_ext_volume_api_bvolume_init_invalid(pa_ext_volume_api_bvolume *volume) {
-+ unsigned i;
-+
-+ pa_assert(volume);
-+
-+ volume->volume = PA_VOLUME_INVALID;
-+
-+ for (i = 0; i < PA_CHANNELS_MAX; i++)
-+ volume->balance[i] = -1.0;
-+
-+ pa_channel_map_init(&volume->channel_map);
-+}
-+
-+void pa_ext_volume_api_bvolume_init_mono(pa_ext_volume_api_bvolume *bvolume, pa_volume_t volume) {
-+ pa_assert(bvolume);
-+ pa_assert(PA_VOLUME_IS_VALID(volume));
-+
-+ bvolume->volume = volume;
-+ bvolume->balance[0] = 1.0;
-+ pa_channel_map_init_mono(&bvolume->channel_map);
-+}
-+
-+int pa_ext_volume_api_bvolume_equal(const pa_ext_volume_api_bvolume *a, const pa_ext_volume_api_bvolume *b,
-+ int check_volume, int check_balance) {
-+ unsigned i;
-+
-+ pa_assert(a);
-+ pa_assert(b);
-+
-+ if (check_volume && a->volume != b->volume)
-+ return 0;
-+
-+ if (!check_balance)
-+ return 1;
-+
-+ if (!pa_channel_map_equal(&a->channel_map, &b->channel_map))
-+ return 0;
-+
-+ for (i = 0; i < a->channel_map.channels; i++) {
-+ if (fabs(a->balance[i] - b->balance[i]) > 0.00001)
-+ return 0;
-+ }
-+
-+ return 1;
-+}
-+
-+void pa_ext_volume_api_bvolume_from_cvolume(pa_ext_volume_api_bvolume *bvolume, const pa_cvolume *cvolume,
-+ const pa_channel_map *map) {
-+ unsigned i;
-+
-+ pa_assert(bvolume);
-+ pa_assert(cvolume);
-+ pa_assert(map);
-+ pa_assert(cvolume->channels == map->channels);
-+
-+ bvolume->volume = pa_cvolume_max(cvolume);
-+ bvolume->channel_map = *map;
-+
-+ for (i = 0; i < map->channels; i++) {
-+ if (bvolume->volume != PA_VOLUME_MUTED)
-+ bvolume->balance[i] = ((double) cvolume->values[i]) / ((double) bvolume->volume);
-+ else
-+ bvolume->balance[i] = 1.0;
-+ }
-+}
-+
-+void pa_ext_volume_api_bvolume_to_cvolume(const pa_ext_volume_api_bvolume *bvolume, pa_cvolume *cvolume) {
-+ unsigned i;
-+
-+ pa_assert(bvolume);
-+ pa_assert(cvolume);
-+ pa_assert(pa_ext_volume_api_bvolume_valid(bvolume, true, true));
-+
-+ cvolume->channels = bvolume->channel_map.channels;
-+
-+ for (i = 0; i < bvolume->channel_map.channels; i++)
-+ cvolume->values[i] = bvolume->volume * bvolume->balance[i];
-+}
-+
-+void pa_ext_volume_api_bvolume_copy_balance(pa_ext_volume_api_bvolume *to,
-+ const pa_ext_volume_api_bvolume *from) {
-+ pa_assert(to);
-+ pa_assert(from);
-+
-+ memcpy(to->balance, from->balance, sizeof(from->balance));
-+ to->channel_map = from->channel_map;
-+}
-+
-+void pa_ext_volume_api_bvolume_reset_balance(pa_ext_volume_api_bvolume *volume, const pa_channel_map *map) {
-+ unsigned i;
-+
-+ pa_assert(volume);
-+ pa_assert(map);
-+ pa_assert(pa_channel_map_valid(map));
-+
-+ for (i = 0; i < map->channels; i++)
-+ volume->balance[i] = 1.0;
-+
-+ volume->channel_map = *map;
-+}
-+
-+void pa_ext_volume_api_bvolume_remap(pa_ext_volume_api_bvolume *volume, const pa_channel_map *to) {
-+ unsigned i;
-+ pa_cvolume cvolume;
-+
-+ pa_assert(volume);
-+ pa_assert(to);
-+ pa_assert(pa_ext_volume_api_bvolume_valid(volume, false, true));
-+ pa_assert(pa_channel_map_valid(to));
-+
-+ cvolume.channels = volume->channel_map.channels;
-+
-+ for (i = 0; i < cvolume.channels; i++)
-+ cvolume.values[i] = volume->balance[i] * (double) PA_VOLUME_NORM;
-+
-+ pa_cvolume_remap(&cvolume, &volume->channel_map, to);
-+
-+ for (i = 0; i < to->channels; i++)
-+ volume->balance[i] = (double) cvolume.values[i] / (double) PA_VOLUME_NORM;
-+
-+ volume->channel_map = *to;
-+}
-+
-+double pa_ext_volume_api_bvolume_get_left_right_balance(const pa_ext_volume_api_bvolume *volume) {
-+ pa_ext_volume_api_bvolume bvolume;
-+ pa_cvolume cvolume;
-+ double ret;
-+
-+ pa_assert(volume);
-+
-+ bvolume.volume = PA_VOLUME_NORM;
-+ pa_ext_volume_api_bvolume_copy_balance(&bvolume, volume);
-+ pa_ext_volume_api_bvolume_to_cvolume(&bvolume, &cvolume);
-+ ret = pa_cvolume_get_balance(&cvolume, &volume->channel_map);
-+
-+ return ret;
-+}
-+
-+void pa_ext_volume_api_bvolume_set_left_right_balance(pa_ext_volume_api_bvolume *volume, double balance) {
-+ pa_cvolume cvolume;
-+ pa_volume_t old_volume;
-+
-+ pa_assert(volume);
-+
-+ if (!pa_channel_map_can_balance(&volume->channel_map))
-+ return;
-+
-+ pa_cvolume_reset(&cvolume, volume->channel_map.channels);
-+ pa_cvolume_set_balance(&cvolume, &volume->channel_map, balance);
-+ old_volume = volume->volume;
-+ pa_ext_volume_api_bvolume_from_cvolume(volume, &cvolume, &volume->channel_map);
-+ volume->volume = old_volume;
-+}
-+
-+double pa_ext_volume_api_bvolume_get_rear_front_balance(const pa_ext_volume_api_bvolume *volume) {
-+ pa_ext_volume_api_bvolume bvolume;
-+ pa_cvolume cvolume;
-+ double ret;
-+
-+ pa_assert(volume);
-+
-+ bvolume.volume = PA_VOLUME_NORM;
-+ pa_ext_volume_api_bvolume_copy_balance(&bvolume, volume);
-+ pa_ext_volume_api_bvolume_to_cvolume(&bvolume, &cvolume);
-+ ret = pa_cvolume_get_fade(&cvolume, &volume->channel_map);
-+
-+ return ret;
-+}
-+
-+void pa_ext_volume_api_bvolume_set_rear_front_balance(pa_ext_volume_api_bvolume *volume, double balance) {
-+ pa_cvolume cvolume;
-+ pa_volume_t old_volume;
-+
-+ pa_assert(volume);
-+
-+ if (!pa_channel_map_can_fade(&volume->channel_map))
-+ return;
-+
-+ pa_cvolume_reset(&cvolume, volume->channel_map.channels);
-+ pa_cvolume_set_fade(&cvolume, &volume->channel_map, balance);
-+ old_volume = volume->volume;
-+ pa_ext_volume_api_bvolume_from_cvolume(volume, &cvolume, &volume->channel_map);
-+ volume->volume = old_volume;
-+}
-+
-+char *pa_ext_volume_api_bvolume_snprint_balance(char *buf, size_t buf_len,
-+ const pa_ext_volume_api_bvolume *volume) {
-+ char *e;
-+ unsigned channel;
-+ bool first = true;
-+
-+ pa_assert(buf);
-+ pa_assert(buf_len > 0);
-+ pa_assert(volume);
-+
-+ pa_init_i18n();
-+
-+ if (!pa_ext_volume_api_bvolume_valid(volume, true, true)) {
-+ pa_snprintf(buf, buf_len, _("(invalid)"));
-+ return buf;
-+ }
-+
-+ *(e = buf) = 0;
-+
-+ for (channel = 0; channel < volume->channel_map.channels && buf_len > 1; channel++) {
-+ buf_len -= pa_snprintf(e, buf_len, "%s%s: %u%%",
-+ first ? "" : ", ",
-+ pa_channel_position_to_string(volume->channel_map.map[channel]),
-+ (unsigned) (volume->balance[channel] * 100 + 0.5));
-+
-+ e = strchr(e, 0);
-+ first = false;
-+ }
-+
-+ return buf;
-+}
-diff --git a/src/pulse/ext-volume-api.h b/src/pulse/ext-volume-api.h
-new file mode 100644
-index 0000000..36b7748
---- /dev/null
-+++ b/src/pulse/ext-volume-api.h
-@@ -0,0 +1,68 @@
-+#ifndef fooextvolumeapihfoo
-+#define fooextvolumeapihfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <pulse/cdecl.h>
-+#include <pulse/context.h>
-+#include <pulse/volume.h>
-+
-+/* This API is temporary, and has no stability guarantees whatsoever. Think
-+ * twice before making anything that relies on this API. This is undocumented
-+ * for a reason. */
-+
-+PA_C_DECL_BEGIN
-+
-+typedef struct pa_ext_volume_api_bvolume pa_ext_volume_api_bvolume;
-+
-+struct pa_ext_volume_api_bvolume {
-+ pa_volume_t volume;
-+ double balance[PA_CHANNELS_MAX];
-+ pa_channel_map channel_map;
-+};
-+
-+int pa_ext_volume_api_balance_valid(double balance) PA_GCC_CONST;
-+int pa_ext_volume_api_bvolume_valid(const pa_ext_volume_api_bvolume *volume, int check_volume, int check_balance)
-+ PA_GCC_PURE;
-+void pa_ext_volume_api_bvolume_init_invalid(pa_ext_volume_api_bvolume *volume);
-+void pa_ext_volume_api_bvolume_init_mono(pa_ext_volume_api_bvolume *bvolume, pa_volume_t volume);
-+int pa_ext_volume_api_bvolume_equal(const pa_ext_volume_api_bvolume *a, const pa_ext_volume_api_bvolume *b,
-+ int check_volume, int check_balance) PA_GCC_PURE;
-+void pa_ext_volume_api_bvolume_from_cvolume(pa_ext_volume_api_bvolume *bvolume, const pa_cvolume *cvolume,
-+ const pa_channel_map *map);
-+void pa_ext_volume_api_bvolume_to_cvolume(const pa_ext_volume_api_bvolume *bvolume, pa_cvolume *cvolume);
-+void pa_ext_volume_api_bvolume_copy_balance(pa_ext_volume_api_bvolume *to,
-+ const pa_ext_volume_api_bvolume *from);
-+void pa_ext_volume_api_bvolume_reset_balance(pa_ext_volume_api_bvolume *volume, const pa_channel_map *map);
-+void pa_ext_volume_api_bvolume_remap(pa_ext_volume_api_bvolume *volume, const pa_channel_map *to);
-+double pa_ext_volume_api_bvolume_get_left_right_balance(const pa_ext_volume_api_bvolume *volume) PA_GCC_PURE;
-+void pa_ext_volume_api_bvolume_set_left_right_balance(pa_ext_volume_api_bvolume *volume, double balance);
-+double pa_ext_volume_api_bvolume_get_rear_front_balance(const pa_ext_volume_api_bvolume *volume) PA_GCC_PURE;
-+void pa_ext_volume_api_bvolume_set_rear_front_balance(pa_ext_volume_api_bvolume *volume, double balance);
-+
-+#define PA_EXT_VOLUME_API_BVOLUME_SNPRINT_BALANCE_MAX 500
-+char *pa_ext_volume_api_bvolume_snprint_balance(char *buf, size_t buf_size,
-+ const pa_ext_volume_api_bvolume *volume);
-+
-+PA_C_DECL_END
-+
-+#endif
---
-2.1.4
-
---- a/po/POTFILES.in 2016-04-13 17:40:00.818008672 +0200
-+++ b/po/POTFILES.in 2016-04-13 17:40:30.885008622 +0200
-@@ -198,3 +198,5 @@
- src/utils/padsp.c
- src/utils/pasuspender.c
- src/utils/pax11publish.c
-+src/modules/volume-api/device-creator.c
-+src/pulse/ext-volume-api.c
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0031-Add-module-main-volume-policy.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0031-Add-module-main-volume-policy.patch
deleted file mode 100644
index 216ed21e9..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0031-Add-module-main-volume-policy.patch
+++ /dev/null
@@ -1,1418 +0,0 @@
-From cfb39f18569679f59c9b6283c47e8d90ddd9763d Mon Sep 17 00:00:00 2001
-From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
-Date: Wed, 21 May 2014 14:13:41 +0300
-Subject: [PATCH] Add module-main-volume-policy
-
-Change-Id: I787141b43cafb652aa752c64ae28b6b7aa052d8e
-Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
----
- Makefile.am | 3 +
- src/Makefile.am | 15 +
- src/daemon/default.pa.in | 4 +
- .../main-volume-policy/main-volume-context.c | 325 ++++++++++++
- .../main-volume-policy/main-volume-context.h | 75 +++
- .../main-volume-policy/main-volume-policy.c | 213 ++++++++
- .../main-volume-policy.conf.example | 20 +
- .../main-volume-policy/main-volume-policy.h | 72 +++
- .../main-volume-policy/module-main-volume-policy.c | 556 +++++++++++++++++++++
- 9 files changed, 1283 insertions(+)
- create mode 100644 src/modules/main-volume-policy/main-volume-context.c
- create mode 100644 src/modules/main-volume-policy/main-volume-context.h
- create mode 100644 src/modules/main-volume-policy/main-volume-policy.c
- create mode 100644 src/modules/main-volume-policy/main-volume-policy.conf.example
- create mode 100644 src/modules/main-volume-policy/main-volume-policy.h
- create mode 100644 src/modules/main-volume-policy/module-main-volume-policy.c
-
-diff --git a/Makefile.am b/Makefile.am
-index cf4a648..646b7fc 100644
---- a/Makefile.am 2016-04-13 15:14:28.942023245 +0200
-+++ b/Makefile.am 2016-04-13 15:16:32.691023039 +0200
-@@ -60,6 +60,9 @@
- moduledevvolumeapi_DATA = src/modules/volume-api/*.h
- moduledevvolumeapidir = $(includedir)/pulsemodule/modules/volume-api
-
-+moduledevmainvolumepolicy_DATA = $(top_srcdir)/src/modules/main-volume-policy/*.h
-+moduledevmainvolumepolicydir = $(includedir)/pulsemodule/modules/main-volume-policy
-+
- if HAVE_GLIB20
- pkgconfig_DATA += \
- libpulse-mainloop-glib.pc
- libpulse-mainloop-glib.pc
-diff --git a/src/Makefile.am b/src/Makefile.am
-index a6bb319..8fa60ec 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -1050,7 +1050,8 @@
- libprotocol-simple.la \
- libprotocol-http.la \
- libprotocol-native.la \
-- libvolume-api.la
-+ libvolume-api.la \
-+ libmain-volume-policy.la
-
- if HAVE_WEBRTC
- modlibexec_LTLIBRARIES += libwebrtc-util.la
-@@ -1051,6 +1052,12 @@ libcli_la_SOURCES = pulsecore/cli.c pulsecore/cli.h
- libcli_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
- libcli_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la
-
-+libmain_volume_policy_la_SOURCES = \
-+ modules/main-volume-policy/main-volume-context.c modules/main-volume-policy/main-volume-context.h \
-+ modules/main-volume-policy/main-volume-policy.c modules/main-volume-policy/main-volume-policy.h
-+libmain_volume_policy_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
-+libmain_volume_policy_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la libvolume-api.la
-+
- libprotocol_cli_la_SOURCES = pulsecore/protocol-cli.c pulsecore/protocol-cli.h
- libprotocol_cli_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
- libprotocol_cli_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la libcli.la
-@@ -1136,6 +1136,7 @@ endif
- modlibexec_LTLIBRARIES += \
- module-cli.la \
- module-cli-protocol-tcp.la \
-+ module-main-volume-policy.la \
- module-simple-protocol-tcp.la \
- module-null-sink.la \
- module-null-source.la \
-@@ -1426,6 +1434,7 @@ SYMDEF_FILES = \
- module-cli-symdef.h \
- module-cli-protocol-tcp-symdef.h \
- module-cli-protocol-unix-symdef.h \
-+ module-main-volume-policy-symdef.h \
- module-pipe-sink-symdef.h \
- module-pipe-source-symdef.h \
- module-simple-protocol-tcp-symdef.h \
-@@ -1575,6 +1584,12 @@ module_cli_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_CLI $(AM_
- module_cli_protocol_unix_la_LDFLAGS = $(MODULE_LDFLAGS)
- module_cli_protocol_unix_la_LIBADD = $(MODULE_LIBADD) libprotocol-cli.la
-
-+# Main volume and mute policy
-+
-+module_main_volume_policy_la_SOURCES = modules/main-volume-policy/module-main-volume-policy.c
-+module_main_volume_policy_la_LDFLAGS = $(MODULE_LDFLAGS)
-+module_main_volume_policy_la_LIBADD = $(MODULE_LIBADD) libmain-volume-policy.la libvolume-api.la
-+
- # HTTP protocol
-
- module_http_protocol_tcp_la_SOURCES = modules/module-protocol-stub.c
-diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
-index 7cf52a4..f70804c 100755
---- a/src/daemon/default.pa.in
-+++ b/src/daemon/default.pa.in
-@@ -188,6 +188,10 @@
- #.endif
- ])dnl
-
-+.ifexists module-main-volume-policy
-+load-module module-main-volume-policy
-+.endif
-+
- ### Make some devices default
- #set-default-sink output
- #set-default-source input
-diff --git a/src/modules/main-volume-policy/main-volume-context.c b/src/modules/main-volume-policy/main-volume-context.c
-new file mode 100644
-index 0000000..7ac35c6
---- /dev/null
-+++ b/src/modules/main-volume-policy/main-volume-context.c
-@@ -0,0 +1,325 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "main-volume-context.h"
-+
-+#include <modules/volume-api/mute-control.h>
-+#include <modules/volume-api/volume-control.h>
-+
-+int pa_main_volume_context_new(pa_main_volume_policy *policy, const char *name, const char *description,
-+ pa_main_volume_context **context) {
-+ pa_main_volume_context *context_local;
-+ int r;
-+
-+ pa_assert(policy);
-+ pa_assert(name);
-+ pa_assert(description);
-+ pa_assert(context);
-+
-+ context_local = pa_xnew0(struct pa_main_volume_context, 1);
-+ context_local->main_volume_policy = policy;
-+ context_local->index = pa_main_volume_policy_allocate_main_volume_context_index(policy);
-+
-+ r = pa_main_volume_policy_register_name(policy, name, true, &context_local->name);
-+ if (r < 0)
-+ goto fail;
-+
-+ context_local->description = pa_xstrdup(description);
-+
-+ *context = context_local;
-+
-+ return 0;
-+
-+fail:
-+ pa_main_volume_context_free(context_local);
-+
-+ return r;
-+}
-+
-+void pa_main_volume_context_put(pa_main_volume_context *context) {
-+ pa_assert(context);
-+
-+ pa_main_volume_policy_add_main_volume_context(context->main_volume_policy, context);
-+
-+ context->linked = true;
-+
-+ pa_log_debug("Created main volume context #%u.", context->index);
-+ pa_log_debug(" Name: %s", context->name);
-+ pa_log_debug(" Description: %s", context->description);
-+ pa_log_debug(" Main output volume control: %s",
-+ context->main_output_volume_control ? context->main_output_volume_control->name : "(unset)");
-+ pa_log_debug(" Main input volume control: %s",
-+ context->main_input_volume_control ? context->main_input_volume_control->name : "(unset)");
-+ pa_log_debug(" Main output mute control: %s",
-+ context->main_output_mute_control ? context->main_output_mute_control->name : "(unset)");
-+ pa_log_debug(" Main input mute control: %s",
-+ context->main_input_mute_control ? context->main_input_mute_control->name : "(unset)");
-+
-+ pa_hook_fire(&context->main_volume_policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_PUT], context);
-+}
-+
-+void pa_main_volume_context_unlink(pa_main_volume_context *context) {
-+ pa_assert(context);
-+
-+ if (context->unlinked) {
-+ pa_log_debug("Unlinking main volume context %s (already unlinked, this is a no-op).", context->name);
-+ return;
-+ }
-+
-+ context->unlinked = true;
-+
-+ pa_log_debug("Unlinking main volume context %s.", context->name);
-+
-+ if (context->linked)
-+ pa_hook_fire(&context->main_volume_policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_UNLINK], context);
-+
-+ if (context->main_input_mute_control_binding) {
-+ pa_binding_free(context->main_input_mute_control_binding);
-+ context->main_input_mute_control_binding = NULL;
-+ }
-+
-+ if (context->main_output_mute_control_binding) {
-+ pa_binding_free(context->main_output_mute_control_binding);
-+ context->main_output_mute_control_binding = NULL;
-+ }
-+
-+ if (context->main_input_volume_control_binding) {
-+ pa_binding_free(context->main_input_volume_control_binding);
-+ context->main_input_volume_control_binding = NULL;
-+ }
-+
-+ if (context->main_output_volume_control_binding) {
-+ pa_binding_free(context->main_output_volume_control_binding);
-+ context->main_output_volume_control_binding = NULL;
-+ }
-+
-+ context->main_input_mute_control = NULL;
-+ context->main_output_mute_control = NULL;
-+ context->main_input_volume_control = NULL;
-+ context->main_output_volume_control = NULL;
-+
-+ pa_main_volume_policy_remove_main_volume_context(context->main_volume_policy, context);
-+}
-+
-+void pa_main_volume_context_free(pa_main_volume_context *context) {
-+ pa_assert(context);
-+
-+ if (!context->unlinked)
-+ pa_main_volume_context_unlink(context);
-+
-+ pa_xfree(context->description);
-+
-+ if (context->name)
-+ pa_main_volume_policy_unregister_name(context->main_volume_policy, context->name);
-+
-+ pa_xfree(context);
-+}
-+
-+const char *pa_main_volume_context_get_name(pa_main_volume_context *context) {
-+ pa_assert(context);
-+
-+ return context->name;
-+}
-+
-+static void set_main_output_volume_control_internal(pa_main_volume_context *context, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(context);
-+
-+ old_control = context->main_output_volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ context->main_output_volume_control = control;
-+
-+ if (!context->linked || context->unlinked)
-+ return;
-+
-+ pa_log_debug("The main output volume control of main volume context %s changed from %s to %s.", context->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&context->main_volume_policy->hooks
-+ [PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_OUTPUT_VOLUME_CONTROL_CHANGED],
-+ context);
-+}
-+
-+void pa_main_volume_context_bind_main_output_volume_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = context,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_output_volume_control_internal,
-+ };
-+
-+ pa_assert(context);
-+ pa_assert(target_info);
-+
-+ if (context->main_output_volume_control_binding)
-+ pa_binding_free(context->main_output_volume_control_binding);
-+
-+ context->main_output_volume_control_binding = pa_binding_new(context->main_volume_policy->volume_api, &owner_info,
-+ target_info);
-+}
-+
-+static void set_main_input_volume_control_internal(pa_main_volume_context *context, pa_volume_control *control) {
-+ pa_volume_control *old_control;
-+
-+ pa_assert(context);
-+
-+ old_control = context->main_input_volume_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ context->main_input_volume_control = control;
-+
-+ if (!context->linked || context->unlinked)
-+ return;
-+
-+ pa_log_debug("The main input volume control of main volume context %s changed from %s to %s.", context->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&context->main_volume_policy->hooks
-+ [PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_INPUT_VOLUME_CONTROL_CHANGED],
-+ context);
-+}
-+
-+void pa_main_volume_context_bind_main_input_volume_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = context,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_input_volume_control_internal,
-+ };
-+
-+ pa_assert(context);
-+ pa_assert(target_info);
-+
-+ if (context->main_input_volume_control_binding)
-+ pa_binding_free(context->main_input_volume_control_binding);
-+
-+ context->main_input_volume_control_binding = pa_binding_new(context->main_volume_policy->volume_api, &owner_info,
-+ target_info);
-+}
-+
-+static void set_main_output_mute_control_internal(pa_main_volume_context *context, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(context);
-+
-+ old_control = context->main_output_mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ context->main_output_mute_control = control;
-+
-+ if (!context->linked || context->unlinked)
-+ return;
-+
-+ pa_log_debug("The main output mute control of main volume context %s changed from %s to %s.", context->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&context->main_volume_policy->hooks
-+ [PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_OUTPUT_MUTE_CONTROL_CHANGED],
-+ context);
-+}
-+
-+void pa_main_volume_context_bind_main_output_mute_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = context,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_output_mute_control_internal,
-+ };
-+
-+ pa_assert(context);
-+ pa_assert(target_info);
-+
-+ if (context->main_output_mute_control_binding)
-+ pa_binding_free(context->main_output_mute_control_binding);
-+
-+ context->main_output_mute_control_binding = pa_binding_new(context->main_volume_policy->volume_api, &owner_info,
-+ target_info);
-+}
-+
-+static void set_main_input_mute_control_internal(pa_main_volume_context *context, pa_mute_control *control) {
-+ pa_mute_control *old_control;
-+
-+ pa_assert(context);
-+
-+ old_control = context->main_input_mute_control;
-+
-+ if (control == old_control)
-+ return;
-+
-+ context->main_input_mute_control = control;
-+
-+ if (!context->linked || context->unlinked)
-+ return;
-+
-+ pa_log_debug("The main input mute control of main volume context %s changed from %s to %s.", context->name,
-+ old_control ? old_control->name : "(unset)", control ? control->name : "(unset)");
-+
-+ pa_hook_fire(&context->main_volume_policy->hooks
-+ [PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_INPUT_MUTE_CONTROL_CHANGED],
-+ context);
-+}
-+
-+void pa_main_volume_context_bind_main_input_mute_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info) {
-+ pa_binding_owner_info owner_info = {
-+ .userdata = context,
-+ .set_value = (pa_binding_set_value_cb_t) set_main_input_mute_control_internal,
-+ };
-+
-+ pa_assert(context);
-+ pa_assert(target_info);
-+
-+ if (context->main_input_mute_control_binding)
-+ pa_binding_free(context->main_input_mute_control_binding);
-+
-+ context->main_input_mute_control_binding = pa_binding_new(context->main_volume_policy->volume_api, &owner_info,
-+ target_info);
-+}
-+
-+pa_binding_target_type *pa_main_volume_context_create_binding_target_type(pa_main_volume_policy *policy) {
-+ pa_binding_target_type *type;
-+
-+ pa_assert(policy);
-+
-+ type = pa_binding_target_type_new(PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE, policy->main_volume_contexts,
-+ &policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_PUT],
-+ &policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_UNLINK],
-+ (pa_binding_target_type_get_name_cb_t) pa_main_volume_context_get_name);
-+ pa_binding_target_type_add_field(type, PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_VOLUME_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_main_volume_context, main_output_volume_control));
-+ pa_binding_target_type_add_field(type, PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_VOLUME_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_main_volume_context, main_input_volume_control));
-+ pa_binding_target_type_add_field(type, PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_MUTE_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_main_volume_context, main_output_mute_control));
-+ pa_binding_target_type_add_field(type, PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_MUTE_CONTROL,
-+ PA_BINDING_CALCULATE_FIELD_OFFSET(pa_main_volume_context, main_input_mute_control));
-+
-+ return type;
-+}
-diff --git a/src/modules/main-volume-policy/main-volume-context.h b/src/modules/main-volume-policy/main-volume-context.h
-new file mode 100644
-index 0000000..4a0a6f7
---- /dev/null
-+++ b/src/modules/main-volume-policy/main-volume-context.h
-@@ -0,0 +1,75 @@
-+#ifndef foomainvolumecontexthfoo
-+#define foomainvolumecontexthfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/main-volume-policy/main-volume-policy.h>
-+
-+#include <modules/volume-api/binding.h>
-+
-+typedef struct pa_main_volume_context pa_main_volume_context;
-+
-+#define PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE "MainVolumeContext"
-+#define PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_VOLUME_CONTROL "main_output_volume_control"
-+#define PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_VOLUME_CONTROL "main_input_volume_control"
-+#define PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_MUTE_CONTROL "main_output_mute_control"
-+#define PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_MUTE_CONTROL "main_input_mute_control"
-+
-+struct pa_main_volume_context {
-+ pa_main_volume_policy *main_volume_policy;
-+ uint32_t index;
-+ const char *name;
-+ char *description;
-+ pa_volume_control *main_output_volume_control;
-+ pa_volume_control *main_input_volume_control;
-+ pa_mute_control *main_output_mute_control;
-+ pa_mute_control *main_input_mute_control;
-+
-+ pa_binding *main_output_volume_control_binding;
-+ pa_binding *main_input_volume_control_binding;
-+ pa_binding *main_output_mute_control_binding;
-+ pa_binding *main_input_mute_control_binding;
-+
-+ bool linked;
-+ bool unlinked;
-+};
-+
-+int pa_main_volume_context_new(pa_main_volume_policy *policy, const char *name, const char *description,
-+ pa_main_volume_context **context);
-+void pa_main_volume_context_put(pa_main_volume_context *context);
-+void pa_main_volume_context_unlink(pa_main_volume_context *context);
-+void pa_main_volume_context_free(pa_main_volume_context *context);
-+
-+const char *pa_main_volume_context_get_name(pa_main_volume_context *context);
-+
-+void pa_main_volume_context_bind_main_output_volume_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info);
-+void pa_main_volume_context_bind_main_input_volume_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info);
-+void pa_main_volume_context_bind_main_output_mute_control(pa_main_volume_context *context,
-+ pa_binding_target_info *target_info);
-+void pa_main_volume_context_bind_main_input_mute_control(pa_main_volume_context *context, pa_binding_target_info *target_info);
-+
-+/* Called from main-volume-policy.c only. */
-+pa_binding_target_type *pa_main_volume_context_create_binding_target_type(pa_main_volume_policy *policy);
-+
-+#endif
-diff --git a/src/modules/main-volume-policy/main-volume-policy.c b/src/modules/main-volume-policy/main-volume-policy.c
-new file mode 100644
-index 0000000..b0b4ede
---- /dev/null
-+++ b/src/modules/main-volume-policy/main-volume-policy.c
-@@ -0,0 +1,213 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "main-volume-policy.h"
-+
-+#include <modules/main-volume-policy/main-volume-context.h>
-+
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/shared.h>
-+
-+static pa_main_volume_policy *main_volume_policy_new(pa_core *core);
-+static void main_volume_policy_free(pa_main_volume_policy *policy);
-+
-+pa_main_volume_policy *pa_main_volume_policy_get(pa_core *core) {
-+ pa_main_volume_policy *policy;
-+
-+ pa_assert(core);
-+
-+ policy = pa_shared_get(core, "main-volume-policy");
-+
-+ if (policy)
-+ pa_main_volume_policy_ref(policy);
-+ else {
-+ policy = main_volume_policy_new(core);
-+ pa_assert_se(pa_shared_set(core, "main-volume-policy", policy) >= 0);
-+ }
-+
-+ return policy;
-+}
-+
-+pa_main_volume_policy *pa_main_volume_policy_ref(pa_main_volume_policy *policy) {
-+ pa_assert(policy);
-+
-+ policy->refcnt++;
-+
-+ return policy;
-+}
-+
-+void pa_main_volume_policy_unref(pa_main_volume_policy *policy) {
-+ pa_assert(policy);
-+ pa_assert(policy->refcnt > 0);
-+
-+ policy->refcnt--;
-+
-+ if (policy->refcnt == 0) {
-+ pa_assert_se(pa_shared_remove(policy->core, "main-volume-policy") >= 0);
-+ main_volume_policy_free(policy);
-+ }
-+}
-+
-+static pa_main_volume_policy *main_volume_policy_new(pa_core *core) {
-+ pa_main_volume_policy *policy;
-+ unsigned i;
-+
-+ pa_assert(core);
-+
-+ policy = pa_xnew0(pa_main_volume_policy, 1);
-+ policy->core = core;
-+ policy->refcnt = 1;
-+ policy->volume_api = pa_volume_api_get(core);
-+ policy->names = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, pa_xfree);
-+ policy->main_volume_contexts = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-+
-+ for (i = 0; i < PA_MAIN_VOLUME_POLICY_HOOK_MAX; i++)
-+ pa_hook_init(&policy->hooks[i], policy);
-+
-+ policy->main_volume_context_binding_target_type = pa_main_volume_context_create_binding_target_type(policy);
-+ pa_volume_api_add_binding_target_type(policy->volume_api, policy->main_volume_context_binding_target_type);
-+
-+ pa_log_debug("Created a pa_main_volume_policy object.");
-+
-+ return policy;
-+}
-+
-+static void main_volume_policy_free(pa_main_volume_policy *policy) {
-+ unsigned i;
-+
-+ pa_assert(policy);
-+ pa_assert(policy->refcnt == 0);
-+
-+ pa_log_debug("Freeing the pa_main_volume_policy object.");
-+
-+ if (policy->main_volume_context_binding_target_type) {
-+ pa_volume_api_remove_binding_target_type(policy->volume_api, policy->main_volume_context_binding_target_type);
-+ pa_binding_target_type_free(policy->main_volume_context_binding_target_type);
-+ }
-+
-+ for (i = 0; i < PA_MAIN_VOLUME_POLICY_HOOK_MAX; i++)
-+ pa_hook_done(&policy->hooks[i]);
-+
-+ if (policy->main_volume_contexts) {
-+ pa_assert(pa_hashmap_isempty(policy->main_volume_contexts));
-+ pa_hashmap_free(policy->main_volume_contexts);
-+ }
-+
-+ if (policy->names) {
-+ pa_assert(pa_hashmap_isempty(policy->names));
-+ pa_hashmap_free(policy->names);
-+ }
-+
-+ if (policy->volume_api)
-+ pa_volume_api_unref(policy->volume_api);
-+
-+ pa_xfree(policy);
-+}
-+
-+int pa_main_volume_policy_register_name(pa_main_volume_policy *policy, const char *requested_name,
-+ bool fail_if_already_registered, const char **registered_name) {
-+ char *n;
-+
-+ pa_assert(policy);
-+ pa_assert(requested_name);
-+ pa_assert(registered_name);
-+
-+ n = pa_xstrdup(requested_name);
-+
-+ if (pa_hashmap_put(policy->names, n, n) < 0) {
-+ unsigned i = 1;
-+
-+ pa_xfree(n);
-+
-+ if (fail_if_already_registered) {
-+ pa_log("Name %s already registered.", requested_name);
-+ return -PA_ERR_EXIST;
-+ }
-+
-+ do {
-+ i++;
-+ n = pa_sprintf_malloc("%s.%u", requested_name, i);
-+ } while (pa_hashmap_put(policy->names, n, n) < 0);
-+ }
-+
-+ *registered_name = n;
-+
-+ return 0;
-+}
-+
-+void pa_main_volume_policy_unregister_name(pa_main_volume_policy *policy, const char *name) {
-+ pa_assert(policy);
-+ pa_assert(name);
-+
-+ pa_assert_se(pa_hashmap_remove_and_free(policy->names, name) >= 0);
-+}
-+
-+uint32_t pa_main_volume_policy_allocate_main_volume_context_index(pa_main_volume_policy *policy) {
-+ uint32_t idx;
-+
-+ pa_assert(policy);
-+
-+ idx = policy->next_main_volume_context_index++;
-+
-+ return idx;
-+}
-+
-+void pa_main_volume_policy_add_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context) {
-+ pa_assert(policy);
-+ pa_assert(context);
-+
-+ pa_assert_se(pa_hashmap_put(policy->main_volume_contexts, (void *) context->name, context) >= 0);
-+}
-+
-+int pa_main_volume_policy_remove_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context) {
-+ pa_assert(policy);
-+ pa_assert(context);
-+
-+ if (!pa_hashmap_remove(policy->main_volume_contexts, context->name))
-+ return -1;
-+
-+ if (context == policy->active_main_volume_context)
-+ pa_main_volume_policy_set_active_main_volume_context(policy, NULL);
-+
-+ return 0;
-+}
-+
-+void pa_main_volume_policy_set_active_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context) {
-+ pa_main_volume_context *old_context;
-+
-+ pa_assert(policy);
-+
-+ old_context = policy->active_main_volume_context;
-+
-+ if (context == old_context)
-+ return;
-+
-+ policy->active_main_volume_context = context;
-+
-+ pa_log_debug("The active main volume context changed from %s to %s.", old_context ? old_context->name : "(unset)",
-+ context ? context->name : "(unset)");
-+
-+ pa_hook_fire(&policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_ACTIVE_MAIN_VOLUME_CONTEXT_CHANGED], NULL);
-+}
-diff --git a/src/modules/main-volume-policy/main-volume-policy.conf.example b/src/modules/main-volume-policy/main-volume-policy.conf.example
-new file mode 100644
-index 0000000..a4a35d3
---- /dev/null
-+++ b/src/modules/main-volume-policy/main-volume-policy.conf.example
-@@ -0,0 +1,20 @@
-+[General]
-+output-volume-model = by-active-main-volume-context
-+input-volume-model = by-active-main-volume-context
-+output-mute-model = none
-+input-mute-model = none
-+main-volume-contexts = x-example-call-main-volume-context x-example-default-main-volume-context
-+
-+[MainVolumeContext x-example-call-main-volume-context]
-+description = Call main volume context
-+main-output-volume-control = bind:AudioGroup:x-example-call-downlink-audio-group
-+main-input-volume-control = bind:AudioGroup:x-example-call-uplink-audio-group
-+main-output-mute-control = none
-+main-input-mute-control = none
-+
-+[MainVolumeContext x-example-default-main-volume-context]
-+description = Default main volume context
-+main-output-volume-control = bind:AudioGroup:x-example-default-output-audio-group
-+main-input-volume-control = bind:AudioGroup:x-example-default-input-audio-group
-+main-output-mute-control = none
-+main-input-mute-control = none
-diff --git a/src/modules/main-volume-policy/main-volume-policy.h b/src/modules/main-volume-policy/main-volume-policy.h
-new file mode 100644
-index 0000000..5cd669e
---- /dev/null
-+++ b/src/modules/main-volume-policy/main-volume-policy.h
-@@ -0,0 +1,72 @@
-+#ifndef foomainvolumepolicyhfoo
-+#define foomainvolumepolicyhfoo
-+
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#include <modules/volume-api/binding.h>
-+#include <modules/volume-api/volume-api.h>
-+
-+#include <pulsecore/core.h>
-+
-+typedef struct pa_main_volume_policy pa_main_volume_policy;
-+
-+/* Avoid circular dependencies... */
-+typedef struct pa_main_volume_context pa_main_volume_context;
-+
-+enum {
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_PUT,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_UNLINK,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_OUTPUT_VOLUME_CONTROL_CHANGED,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_INPUT_VOLUME_CONTROL_CHANGED,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_OUTPUT_MUTE_CONTROL_CHANGED,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAIN_VOLUME_CONTEXT_MAIN_INPUT_MUTE_CONTROL_CHANGED,
-+ PA_MAIN_VOLUME_POLICY_HOOK_ACTIVE_MAIN_VOLUME_CONTEXT_CHANGED,
-+ PA_MAIN_VOLUME_POLICY_HOOK_MAX,
-+};
-+
-+struct pa_main_volume_policy {
-+ pa_core *core;
-+ unsigned refcnt;
-+ pa_volume_api *volume_api;
-+ pa_hashmap *names; /* object name -> object name (hashmap-as-a-set) */
-+ pa_hashmap *main_volume_contexts; /* name -> pa_main_volume_context */
-+ pa_main_volume_context *active_main_volume_context;
-+
-+ uint32_t next_main_volume_context_index;
-+ pa_hook hooks[PA_MAIN_VOLUME_POLICY_HOOK_MAX];
-+ pa_binding_target_type *main_volume_context_binding_target_type;
-+};
-+
-+pa_main_volume_policy *pa_main_volume_policy_get(pa_core *core);
-+pa_main_volume_policy *pa_main_volume_policy_ref(pa_main_volume_policy *policy);
-+void pa_main_volume_policy_unref(pa_main_volume_policy *policy);
-+
-+int pa_main_volume_policy_register_name(pa_main_volume_policy *policy, const char *requested_name,
-+ bool fail_if_already_registered, const char **registered_name);
-+void pa_main_volume_policy_unregister_name(pa_main_volume_policy *policy, const char *name);
-+
-+uint32_t pa_main_volume_policy_allocate_main_volume_context_index(pa_main_volume_policy *policy);
-+void pa_main_volume_policy_add_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context);
-+int pa_main_volume_policy_remove_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context);
-+void pa_main_volume_policy_set_active_main_volume_context(pa_main_volume_policy *policy, pa_main_volume_context *context);
-+
-+#endif
-diff --git a/src/modules/main-volume-policy/module-main-volume-policy.c b/src/modules/main-volume-policy/module-main-volume-policy.c
-new file mode 100644
-index 0000000..a14699d
---- /dev/null
-+++ b/src/modules/main-volume-policy/module-main-volume-policy.c
-@@ -0,0 +1,556 @@
-+/***
-+ This file is part of PulseAudio.
-+
-+ Copyright 2014 Intel Corporation
-+
-+ PulseAudio is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU Lesser General Public License as published
-+ by the Free Software Foundation; either version 2.1 of the License,
-+ or (at your option) any later version.
-+
-+ PulseAudio is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public License
-+ along with PulseAudio; if not, write to the Free Software
-+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-+ USA.
-+***/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include "module-main-volume-policy-symdef.h"
-+
-+#include <modules/main-volume-policy/main-volume-context.h>
-+
-+#include <modules/volume-api/binding.h>
-+#include <modules/volume-api/volume-api.h>
-+
-+#include <pulse/direction.h>
-+
-+#include <pulsecore/conf-parser.h>
-+#include <pulsecore/core-util.h>
-+#include <pulsecore/i18n.h>
-+
-+PA_MODULE_AUTHOR("Tanu Kaskinen");
-+PA_MODULE_DESCRIPTION(_("Main volume and mute policy"));
-+PA_MODULE_VERSION(PACKAGE_VERSION);
-+PA_MODULE_LOAD_ONCE(true);
-+
-+enum control_type {
-+ CONTROL_TYPE_VOLUME,
-+ CONTROL_TYPE_MUTE,
-+};
-+
-+enum model {
-+ MODEL_NONE,
-+ MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT,
-+};
-+
-+struct userdata {
-+ pa_main_volume_policy *main_volume_policy;
-+ enum model output_volume_model;
-+ enum model input_volume_model;
-+ enum model output_mute_model;
-+ enum model input_mute_model;
-+ pa_hashmap *contexts; /* name -> struct context */
-+
-+ pa_hook_slot *active_main_volume_context_changed_slot;
-+
-+ /* The following fields are only used during initialization. */
-+ pa_hashmap *context_names; /* name -> name (hashmap-as-a-set) */
-+ pa_hashmap *unused_contexts; /* name -> struct context */
-+};
-+
-+struct context {
-+ struct userdata *userdata;
-+ char *name;
-+ char *description;
-+ pa_binding_target_info *main_output_volume_control_target_info;
-+ pa_binding_target_info *main_input_volume_control_target_info;
-+ pa_binding_target_info *main_output_mute_control_target_info;
-+ pa_binding_target_info *main_input_mute_control_target_info;
-+ pa_main_volume_context *main_volume_context;
-+
-+ bool unlinked;
-+};
-+
-+static void context_unlink(struct context *context);
-+
-+static const char *model_to_string(enum model model) {
-+ switch (model) {
-+ case MODEL_NONE:
-+ return "none";
-+
-+ case MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT:
-+ return "by-active-main-volume-context";
-+ }
-+
-+ pa_assert_not_reached();
-+}
-+
-+static int model_from_string(const char *str, enum model *model) {
-+ pa_assert(str);
-+ pa_assert(model);
-+
-+ if (pa_streq(str, "none"))
-+ *model = MODEL_NONE;
-+ else if (pa_streq(str, "by-active-main-volume-context"))
-+ *model = MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT;
-+ else
-+ return -PA_ERR_INVALID;
-+
-+ return 0;
-+}
-+
-+static struct context *context_new(struct userdata *u, const char *name) {
-+ struct context *context;
-+
-+ pa_assert(u);
-+ pa_assert(name);
-+
-+ context = pa_xnew0(struct context, 1);
-+ context->userdata = u;
-+ context->name = pa_xstrdup(name);
-+ context->description = pa_xstrdup(name);
-+
-+ return context;
-+}
-+
-+static int context_put(struct context *context) {
-+ int r;
-+
-+ pa_assert(context);
-+
-+ r = pa_main_volume_context_new(context->userdata->main_volume_policy, context->name, context->description,
-+ &context->main_volume_context);
-+ if (r < 0)
-+ goto fail;
-+
-+ if (context->main_output_volume_control_target_info)
-+ pa_main_volume_context_bind_main_output_volume_control(context->main_volume_context,
-+ context->main_output_volume_control_target_info);
-+
-+ if (context->main_input_volume_control_target_info)
-+ pa_main_volume_context_bind_main_input_volume_control(context->main_volume_context,
-+ context->main_input_volume_control_target_info);
-+
-+ if (context->main_output_mute_control_target_info)
-+ pa_main_volume_context_bind_main_output_mute_control(context->main_volume_context,
-+ context->main_output_mute_control_target_info);
-+
-+ if (context->main_input_mute_control_target_info)
-+ pa_main_volume_context_bind_main_input_mute_control(context->main_volume_context,
-+ context->main_input_mute_control_target_info);
-+
-+ pa_main_volume_context_put(context->main_volume_context);
-+
-+ return 0;
-+
-+fail:
-+ context_unlink(context);
-+
-+ return r;
-+}
-+
-+static void context_unlink(struct context *context) {
-+ pa_assert(context);
-+
-+ if (context->unlinked)
-+ return;
-+
-+ context->unlinked = true;
-+
-+ if (context->main_volume_context) {
-+ pa_main_volume_context_free(context->main_volume_context);
-+ context->main_volume_context = NULL;
-+ }
-+}
-+
-+static void context_free(struct context *context) {
-+ pa_assert(context);
-+
-+ if (!context->unlinked)
-+ context_unlink(context);
-+
-+ if (context->main_input_mute_control_target_info)
-+ pa_binding_target_info_free(context->main_input_mute_control_target_info);
-+
-+ if (context->main_output_mute_control_target_info)
-+ pa_binding_target_info_free(context->main_output_mute_control_target_info);
-+
-+ if (context->main_input_volume_control_target_info)
-+ pa_binding_target_info_free(context->main_input_volume_control_target_info);
-+
-+ if (context->main_output_volume_control_target_info)
-+ pa_binding_target_info_free(context->main_output_volume_control_target_info);
-+
-+ pa_xfree(context->description);
-+ pa_xfree(context->name);
-+ pa_xfree(context);
-+}
-+
-+static void context_set_description(struct context *context, const char *description) {
-+ pa_assert(context);
-+ pa_assert(description);
-+
-+ pa_xfree(context->description);
-+ context->description = pa_xstrdup(description);
-+}
-+
-+static void context_set_main_control_target_info(struct context *context, enum control_type type, pa_direction_t direction,
-+ pa_binding_target_info *info) {
-+ pa_assert(context);
-+
-+ switch (type) {
-+ case CONTROL_TYPE_VOLUME:
-+ if (direction == PA_DIRECTION_OUTPUT) {
-+ if (context->main_output_volume_control_target_info)
-+ pa_binding_target_info_free(context->main_output_volume_control_target_info);
-+
-+ if (info)
-+ context->main_output_volume_control_target_info = pa_binding_target_info_copy(info);
-+ else
-+ context->main_output_volume_control_target_info = NULL;
-+ } else {
-+ if (context->main_input_volume_control_target_info)
-+ pa_binding_target_info_free(context->main_input_volume_control_target_info);
-+
-+ if (info)
-+ context->main_input_volume_control_target_info = pa_binding_target_info_copy(info);
-+ else
-+ context->main_input_volume_control_target_info = NULL;
-+ }
-+ break;
-+
-+ case CONTROL_TYPE_MUTE:
-+ if (direction == PA_DIRECTION_OUTPUT) {
-+ if (context->main_output_mute_control_target_info)
-+ pa_binding_target_info_free(context->main_output_mute_control_target_info);
-+
-+ if (info)
-+ context->main_output_mute_control_target_info = pa_binding_target_info_copy(info);
-+ else
-+ context->main_output_mute_control_target_info = NULL;
-+ } else {
-+ if (context->main_input_mute_control_target_info)
-+ pa_binding_target_info_free(context->main_input_mute_control_target_info);
-+
-+ if (info)
-+ context->main_input_mute_control_target_info = pa_binding_target_info_copy(info);
-+ else
-+ context->main_input_mute_control_target_info = NULL;
-+ }
-+ break;
-+ }
-+}
-+
-+static pa_hook_result_t active_main_volume_context_changed_cb(void *hook_data, void *call_data, void *userdata) {
-+ struct userdata *u = userdata;
-+ pa_main_volume_context *context;
-+ pa_volume_api *api;
-+ pa_binding_target_info *info = NULL;
-+
-+ pa_assert(u);
-+
-+ context = u->main_volume_policy->active_main_volume_context;
-+ api = u->main_volume_policy->volume_api;
-+
-+ if (u->output_volume_model == MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT) {
-+ if (context) {
-+ info = pa_binding_target_info_new(PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE, context->name,
-+ PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_VOLUME_CONTROL);
-+ pa_volume_api_bind_main_output_volume_control(api, info);
-+ } else
-+ pa_volume_api_set_main_output_volume_control(api, NULL);
-+ }
-+
-+ if (u->input_volume_model == MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT) {
-+ if (context) {
-+ info = pa_binding_target_info_new(PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE, context->name,
-+ PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_VOLUME_CONTROL);
-+ pa_volume_api_bind_main_input_volume_control(api, info);
-+ } else
-+ pa_volume_api_set_main_input_volume_control(api, NULL);
-+ }
-+
-+ if (u->output_mute_model == MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT) {
-+ if (context) {
-+ info = pa_binding_target_info_new(PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE, context->name,
-+ PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_OUTPUT_MUTE_CONTROL);
-+ pa_volume_api_bind_main_output_mute_control(api, info);
-+ } else
-+ pa_volume_api_set_main_output_mute_control(api, NULL);
-+ }
-+
-+ if (u->input_mute_model == MODEL_BY_ACTIVE_MAIN_VOLUME_CONTEXT) {
-+ if (context) {
-+ info = pa_binding_target_info_new(PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_TYPE, context->name,
-+ PA_MAIN_VOLUME_CONTEXT_BINDING_TARGET_FIELD_MAIN_INPUT_MUTE_CONTROL);
-+ pa_volume_api_bind_main_input_mute_control(api, info);
-+ } else
-+ pa_volume_api_set_main_input_mute_control(api, NULL);
-+ }
-+
-+ if (info)
-+ pa_binding_target_info_free(info);
-+
-+ return PA_HOOK_OK;
-+}
-+
-+static int parse_model(pa_config_parser_state *state) {
-+ int r;
-+
-+ pa_assert(state);
-+
-+ r = model_from_string(state->rvalue, state->data);
-+ if (r < 0)
-+ pa_log("[%s:%u] Failed to parse model: %s", state->filename, state->lineno, state->rvalue);
-+
-+ return r;
-+}
-+
-+static int parse_main_volume_contexts(pa_config_parser_state *state) {
-+ struct userdata *u;
-+ char *name;
-+ const char *split_state = NULL;
-+
-+ pa_assert(state);
-+
-+ u = state->userdata;
-+
-+ while ((name = pa_split_spaces(state->rvalue, &split_state)))
-+ pa_hashmap_put(u->context_names, name, name);
-+
-+ return 0;
-+}
-+
-+static struct context *get_context(struct userdata *u, const char *section) {
-+ const char *name;
-+ struct context *context;
-+
-+ pa_assert(u);
-+
-+ if (!section)
-+ return NULL;
-+
-+ if (!pa_startswith(section, "MainVolumeContext "))
-+ return NULL;
-+
-+ name = section + 18;
-+
-+ context = pa_hashmap_get(u->unused_contexts, name);
-+ if (!context) {
-+ context = context_new(u, name);
-+ pa_hashmap_put(u->unused_contexts, context->name, context);
-+ }
-+
-+ return context;
-+}
-+
-+static int parse_description(pa_config_parser_state *state) {
-+ struct userdata *u;
-+ struct context *context;
-+
-+ pa_assert(state);
-+
-+ u = state->userdata;
-+
-+ context = get_context(u, state->section);
-+ if (!context) {
-+ pa_log("[%s:%u] Key \"%s\" not expected in section %s.", state->filename, state->lineno, state->lvalue,
-+ pa_strnull(state->section));
-+ return -PA_ERR_INVALID;
-+ }
-+
-+ context_set_description(context, state->rvalue);
-+
-+ return 0;
-+}
-+
-+static const char *get_target_field_name(enum control_type type) {
-+ switch (type) {
-+ case CONTROL_TYPE_VOLUME:
-+ return "volume_control";
-+
-+ case CONTROL_TYPE_MUTE:
-+ return "mute_control";
-+ }
-+
-+ pa_assert_not_reached();
-+}
-+
-+static int parse_main_control(pa_config_parser_state *state, enum control_type type, pa_direction_t direction) {
-+ struct userdata *u;
-+ struct context *context;
-+
-+ pa_assert(state);
-+
-+ u = state->userdata;
-+
-+ context = get_context(u, state->section);
-+ if (!context) {
-+ pa_log("[%s:%u] Key \"%s\" not expected in section %s.", state->filename, state->lineno, state->lvalue,
-+ pa_strnull(state->section));
-+ return -PA_ERR_INVALID;
-+ }
-+
-+ if (pa_streq(state->rvalue, "none"))
-+ context_set_main_control_target_info(context, type, direction, NULL);
-+ else if (pa_startswith(state->rvalue, "bind:")) {
-+ int r;
-+ pa_binding_target_info *info;
-+
-+ r = pa_binding_target_info_new_from_string(state->rvalue, get_target_field_name(type), &info);
-+ if (r < 0) {
-+ pa_log("[%s:%u] Failed to parse binding target \"%s\".", state->filename, state->lineno, state->rvalue);
-+ return r;
-+ }
-+
-+ context_set_main_control_target_info(context, type, direction, info);
-+ pa_binding_target_info_free(info);
-+ } else {
-+ pa_log("[%s:%u] Failed to parse value \"%s\".", state->filename, state->lineno, state->rvalue);
-+ return -PA_ERR_INVALID;
-+ }
-+
-+ return 0;
-+}
-+
-+static int parse_main_output_volume_control(pa_config_parser_state *state) {
-+ pa_assert(state);
-+
-+ return parse_main_control(state, CONTROL_TYPE_VOLUME, PA_DIRECTION_OUTPUT);
-+}
-+
-+static int parse_main_input_volume_control(pa_config_parser_state *state) {
-+ pa_assert(state);
-+
-+ return parse_main_control(state, CONTROL_TYPE_VOLUME, PA_DIRECTION_INPUT);
-+}
-+
-+static int parse_main_output_mute_control(pa_config_parser_state *state) {
-+ pa_assert(state);
-+
-+ return parse_main_control(state, CONTROL_TYPE_MUTE, PA_DIRECTION_OUTPUT);
-+}
-+
-+static int parse_main_input_mute_control(pa_config_parser_state *state) {
-+ pa_assert(state);
-+
-+ return parse_main_control(state, CONTROL_TYPE_MUTE, PA_DIRECTION_INPUT);
-+}
-+
-+static void finalize_config(struct userdata *u) {
-+ const char *context_name;
-+ void *state;
-+ struct context *context;
-+
-+ pa_assert(u);
-+
-+ PA_HASHMAP_FOREACH(context_name, u->context_names, state) {
-+ int r;
-+
-+ context = pa_hashmap_remove(u->unused_contexts, context_name);
-+ if (!context)
-+ context = context_new(u, context_name);
-+
-+ r = context_put(context);
-+ if (r < 0) {
-+ pa_log_warn("Failed to create main volume context %s.", context_name);
-+ context_free(context);
-+ continue;
-+ }
-+
-+ pa_assert_se(pa_hashmap_put(u->contexts, context->name, context) >= 0);
-+ }
-+
-+ PA_HASHMAP_FOREACH(context, u->unused_contexts, state)
-+ pa_log_debug("Main volume context %s is not used.", context->name);
-+
-+ pa_hashmap_free(u->unused_contexts);
-+ u->unused_contexts = NULL;
-+
-+ pa_hashmap_free(u->context_names);
-+ u->context_names = NULL;
-+}
-+
-+int pa__init(pa_module *module) {
-+ struct userdata *u;
-+ FILE *f;
-+ char *fn = NULL;
-+
-+ pa_assert(module);
-+
-+ u = module->userdata = pa_xnew0(struct userdata, 1);
-+ u->main_volume_policy = pa_main_volume_policy_get(module->core);
-+ u->output_volume_model = MODEL_NONE;
-+ u->input_volume_model = MODEL_NONE;
-+ u->output_mute_model = MODEL_NONE;
-+ u->input_mute_model = MODEL_NONE;
-+ u->contexts = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL,
-+ (pa_free_cb_t) context_free);
-+ u->active_main_volume_context_changed_slot =
-+ pa_hook_connect(&u->main_volume_policy->hooks[PA_MAIN_VOLUME_POLICY_HOOK_ACTIVE_MAIN_VOLUME_CONTEXT_CHANGED],
-+ PA_HOOK_NORMAL, active_main_volume_context_changed_cb, u);
-+ u->context_names = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, pa_xfree);
-+ u->unused_contexts = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL,
-+ (pa_free_cb_t) context_free);
-+
-+ f = pa_open_config_file(PA_DEFAULT_CONFIG_DIR PA_PATH_SEP "main-volume-policy.conf", "main-volume-policy.conf", NULL, &fn);
-+ if (f) {
-+ pa_config_item config_items[] = {
-+ { "output-volume-model", parse_model, &u->output_volume_model, "General" },
-+ { "input-volume-model", parse_model, &u->input_volume_model, "General" },
-+ { "output-mute-model", parse_model, &u->output_mute_model, "General" },
-+ { "input-mute-model", parse_model, &u->input_mute_model, "General" },
-+ { "main-volume-contexts", parse_main_volume_contexts, NULL, "General" },
-+ { "description", parse_description, NULL, NULL },
-+ { "main-output-volume-control", parse_main_output_volume_control, NULL, NULL },
-+ { "main-input-volume-control", parse_main_input_volume_control, NULL, NULL },
-+ { "main-output-mute-control", parse_main_output_mute_control, NULL, NULL },
-+ { "main-input-mute-control", parse_main_input_mute_control, NULL, NULL },
-+ { NULL },
-+ };
-+
-+ pa_config_parse(fn, f, config_items, NULL, u);
-+ pa_xfree(fn);
-+ fn = NULL;
-+ fclose(f);
-+ f = NULL;
-+ }
-+
-+ finalize_config(u);
-+
-+ pa_log_debug("Output volume model: %s", model_to_string(u->output_volume_model));
-+ pa_log_debug("Input volume model: %s", model_to_string(u->input_volume_model));
-+ pa_log_debug("Output mute model: %s", model_to_string(u->output_mute_model));
-+ pa_log_debug("Input mute model: %s", model_to_string(u->input_mute_model));
-+
-+ return 0;
-+}
-+
-+void pa__done(pa_module *module) {
-+ struct userdata *u;
-+
-+ pa_assert(module);
-+
-+ u = module->userdata;
-+ if (!u)
-+ return;
-+
-+ if (u->active_main_volume_context_changed_slot)
-+ pa_hook_slot_free(u->active_main_volume_context_changed_slot);
-+
-+ if (u->contexts)
-+ pa_hashmap_free(u->contexts);
-+
-+ if (u->main_volume_policy)
-+ pa_main_volume_policy_unref(u->main_volume_policy);
-+
-+ pa_xfree(u);
-+}
---
-2.1.4
-
---- a/po/POTFILES.in 2016-04-14 13:03:50.715006116 +0200
-+++ b/po/POTFILES.in 2016-04-14 13:04:23.097006062 +0200
-@@ -200,3 +200,4 @@
- src/utils/pax11publish.c
- src/modules/volume-api/device-creator.c
- src/pulse/ext-volume-api.c
-+src/modules/main-volume-policy/module-main-volume-policy.c
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0039-main-volume-policy-adapt-to-pa6rev.patch b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0039-main-volume-policy-adapt-to-pa6rev.patch
deleted file mode 100644
index 4f2777112..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio/0039-main-volume-policy-adapt-to-pa6rev.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/modules/main-volume-policy/module-main-volume-policy.c 2016-04-18 10:59:46.124086205 +0200
-+++ b/src/modules/main-volume-policy/module-main-volume-policy.c 2016-04-18 11:01:31.497089360 +0200
-@@ -517,7 +517,7 @@
- { NULL },
- };
-
-- pa_config_parse(fn, f, config_items, NULL, u);
-+ pa_config_parse(fn, f, config_items, NULL, false, u);
- pa_xfree(fn);
- fn = NULL;
- fclose(f);
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
deleted file mode 100644
index a54ec60f1..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend
+++ /dev/null
@@ -1,28 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-inherit systemd
-
-do_install_append() {
- # Install pulseaudio systemd service
- if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
- install -m 644 -p -D ${WORKDIR}/build/src/pulseaudio.service ${D}${systemd_user_unitdir}/pulseaudio.service
- install -m 644 -p -D ${WORKDIR}/pulseaudio-${PV}/src/daemon/systemd/user/pulseaudio.socket ${D}${systemd_user_unitdir}/pulseaudio.socket
-
- # Execute these manually on behalf of systemctl script (from systemd-systemctl-native.bb)
- # because it does not support systemd's user mode.
- install -d ${D}${systemd_user_unitdir}/sockets.target.wants/
- ln -sf ${systemd_user_unitdir}/pulseaudio.socket ${D}${systemd_user_unitdir}/sockets.target.wants/
-
- install -d ${D}${systemd_user_unitdir}/default.target.wants/
- ln -sf ${systemd_user_unitdir}/pulseaudio.service ${D}${systemd_user_unitdir}/default.target.wants/
- fi
- mkdir -p ${D}/${bindir}
- install -m 755 -p -D ${WORKDIR}/build/src/.libs/pacat ${D}/${bindir}/
-}
-
-FILES_${PN}-server += " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.socket', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/sockets.target.wants/pulseaudio.socket', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/pulseaudio.service', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_user_unitdir}/default.target.wants/pulseaudio.service', '', d)} \
-"
diff --git a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_9.0.bbappend b/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_9.0.bbappend
deleted file mode 100644
index d87693ad2..000000000
--- a/meta-ivi-common/recipes-multimedia/pulseaudio/pulseaudio_9.0.bbappend
+++ /dev/null
@@ -1,15 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/pulseaudio-9.0:"
-
-SRC_URI += " \
- file://0001-install-files-for-a-module-development.patch \
- file://0002-volume-ramp-additions-to-the-low-level-infra.patch \
- file://0003-volume-ramp-adding-volume-ramping-to-sink-input.patch \
- file://0004-sink-input-Code-cleanup-regarding-volume-ramping.patch \
- file://0005-sink-input-volume-Add-support-for-volume-ramp-factor.patch \
- file://0006-sink-input-Remove-pa_sink_input_set_volume_ramp.patch;apply=no \
- file://enable-ofono-hfp-backend.patch \
-"
-
-PACKAGES =+ " pulseaudio-module-dev"
-
-FILES_pulseaudio-module-dev = "${includedir}/pulsemodule/* ${libdir}/pkgconfig/pulseaudio-module-devel.pc"
diff --git a/meta-ivi-common/recipes-support/.gitkeep b/meta-ivi-common/recipes-support/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/meta-ivi-common/recipes-support/.gitkeep
+++ /dev/null
diff --git a/meta-ivi-common/recipes-test/aiostress/aiostress_0.22.bb b/meta-ivi-common/recipes-test/aiostress/aiostress_0.22.bb
deleted file mode 100644
index 7803d74ed..000000000
--- a/meta-ivi-common/recipes-test/aiostress/aiostress_0.22.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "Async IO testing utility"
-DESCRIPTION = "aio-stress will open or create each file on the command line, and start a series of aio to it.\
-aio is done in a rotating loop. first file1 gets 8 requests, then file2, then file3 etc.\
-As each file finishes writing, it is switched to reads io buffers are aligned in case you want to do raw io"
-HOMEPAGE = "https://oss.oracle.com/~mason/aio-stress/"
-LICENSE = "GPLv2"
-
-S="${WORKDIR}"
-
-LIC_FILES_CHKSUM = "file://${S}/aio-stress.c;md5=ccb5d196a3736bbd835d582a4e2329c3"
-
-SRC_URI = "https://oss.oracle.com/~mason/aio-stress/aio-stress.c"
-SRC_URI[md5sum] = "ccb5d196a3736bbd835d582a4e2329c3"
-SRC_URI[sha256sum] = "3f4cffcc946fb717fff9d8fe932c7c2ee606efff198408d9fbe16955151445f7"
-
-do_compile () {
- ${CC} -Wall -Wshadow -o aio-stress -lpthread -laio aio-stress.c
-}
-
-do_install () {
- install -d ${D}${bindir}
- install -m 0755 aio-stress ${D}${bindir}
-}
-
diff --git a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch b/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch
deleted file mode 100755
index 0ae56cee1..000000000
--- a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0001-Makefile.patch
+++ /dev/null
@@ -1,53 +0,0 @@
---- 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
deleted file mode 100755
index b61da2c1f..000000000
--- a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0002-auto.patch
+++ /dev/null
@@ -1,95 +0,0 @@
---- 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
deleted file mode 100755
index 630871dfd..000000000
--- a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0003-printcleanup.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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
deleted file mode 100755
index ae15408de..000000000
--- a/meta-ivi-common/recipes-test/blobsallad/blobsallad/0004-bs_main.c.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- 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
deleted file mode 100644
index 373d4ddc6..000000000
--- a/meta-ivi-common/recipes-test/blobsallad/blobsallad_2006-11-14-23-57.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-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"
-
-INSANE_SKIP_${PN} = "ldflags"
-
-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}
-}
-
diff --git a/meta-ivi-common/recipes-test/dung/dung_3.4.25-m2.bb b/meta-ivi-common/recipes-test/dung/dung_3.4.25-m2.bb
deleted file mode 100644
index 190e4d7e7..000000000
--- a/meta-ivi-common/recipes-test/dung/dung_3.4.25-m2.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "Kernel test scripts"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/qa-test-misc;protocol=https;branch=master"
-SRCREV = "e2472c7b1d061aef8bb05a4d7940fd8159c4a329"
-
-inherit allarch
-
-S = "${WORKDIR}/git/${PN}-${PV}"
-
-do_install () {
- for subdir in arch_timer cmt common scifab sdhi.0; do
- install -d -m 0755 ${D}/${datadir}/${PN}/$subdir
- install -m 0755 -t ${D}/${datadir}/${PN}/$subdir ${S}/$subdir/*
- done
-}
-
diff --git a/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb b/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb
deleted file mode 100644
index 08b0425c0..000000000
--- a/meta-ivi-common/recipes-test/ebizzy/ebizzy_0.3.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-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"
-
-INSANE_SKIP_${PN} = "ldflags"
-
-do_compile () {
- ${CC} -Wall -Wshadow -lpthread -o ebizzy ebizzy.c
-}
-
-do_install () {
- install -d ${D}${bindir}
- install -m 0755 ebizzy ${D}${bindir}
-}
-
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
deleted file mode 100644
index 66db133e3..000000000
--- a/meta-ivi-common/recipes-test/ffsb/ffsb_6.0-rc2.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-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 = ""
-
diff --git a/meta-ivi-common/recipes-test/fontconfig/fontconfig_%.bbappend b/meta-ivi-common/recipes-test/fontconfig/fontconfig_%.bbappend
deleted file mode 100644
index c4bebdc1f..000000000
--- a/meta-ivi-common/recipes-test/fontconfig/fontconfig_%.bbappend
+++ /dev/null
@@ -1,17 +0,0 @@
-PACKAGES =+ "fontconfig-test"
-
-do_install_append() {
- install -m 755 -d ${D}/${datadir}/fontconfig-test
- install -m 755 ${S}/test/run-test.sh ${D}/${datadir}/fontconfig-test/
-
- sed -i -e "s/FCLIST=\.\.\/fc\-list\/fc\-list/FCLIST=\/usr\/bin\/fc\-list/g" -e "s/FCCACHE=\.\.\/fc\-cache\/fc\-cache/FCCACHE=\/usr\/bin\/fc\-cache/g" ${D}/${datadir}/fontconfig-test/run-test.sh
-
- for x in 4x6.pcf 8x16.pcf out.expected fonts.conf.in; do
- install -m 644 ${S}/test/$x ${D}/${datadir}/fontconfig-test/
- done
-}
-
-DEBIAN_NOAUTONAME_fontconfig-test = "1"
-FILES_fontconfig-test = "${datadir}/fontconfig-test/*"
-
-
diff --git a/meta-ivi-common/recipes-test/freetype/files/0001-Makefile-dont-build-gfx-demos.patch b/meta-ivi-common/recipes-test/freetype/files/0001-Makefile-dont-build-gfx-demos.patch
deleted file mode 100644
index 1f3acf28e..000000000
--- a/meta-ivi-common/recipes-test/freetype/files/0001-Makefile-dont-build-gfx-demos.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -urN /tmp/ft2demos-2.6.orig/Makefile /tmp/ft2demos-2.6/Makefile
---- ft2demos-2.6.orig/Makefile 2015-06-07 07:34:19.000000000 +0000
-+++ ft2demos-2.6/Makefile 2016-06-17 14:25:37.640456725 +0000
-@@ -153,7 +153,8 @@
-
- ifeq ($(PLATFORM),unix)
- CC = $(CCraw)
-- LINK_CMD = $(subst /,$(SEP),$(OBJ_BUILD)/libtool) \
-+ LIBTOOL = $(OBJ_BUILD)/libtool
-+ LINK_CMD = $(subst /,$(SEP),$(LIBTOOL)) \
- --mode=link $(CC) \
- $(subst /,$(COMPILER_SEP),$(LDFLAGS))
- LINK_LIBS = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE))
-@@ -279,12 +280,12 @@
- ttdebug
-
- # Comment out the next line if you don't have a graphics subsystem.
-- EXES += ftdiff \
-- ftgamma \
-- ftgrid \
-- ftmulti \
-- ftstring \
-- ftview
-+ # EXES += ftdiff \
-+ # ftgamma \
-+ # ftgrid \
-+ # ftmulti \
-+ # ftstring \
-+ # ftview
-
- # ftvalid requires ftgxval.c and ftotval.c
- #
diff --git a/meta-ivi-common/recipes-test/freetype/files/0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch b/meta-ivi-common/recipes-test/freetype/files/0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch
deleted file mode 100644
index 7803ad7e0..000000000
--- a/meta-ivi-common/recipes-test/freetype/files/0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 8c4f135619de929f9348b830a07a46a0c2c38e51 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= <jsmoeller@linuxfoundation.org>
-Date: Fri, 7 Oct 2016 15:26:20 +0200
-Subject: [PATCH] Do not hardcode libtool path
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-It is already known and imported through config.mk.
-
-Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
----
- Makefile | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index a5d34bd..254aad4 100644
---- a/Makefile
-+++ b/Makefile
-@@ -153,7 +153,6 @@ else
-
- ifeq ($(PLATFORM),unix)
- CC = $(CCraw)
-- LIBTOOL = $(OBJ_BUILD)/libtool
- LINK_CMD = $(subst /,$(SEP),$(LIBTOOL)) \
- --mode=link $(CC) \
- $(subst /,$(COMPILER_SEP),$(LDFLAGS))
---
-2.1.4
-
diff --git a/meta-ivi-common/recipes-test/freetype/freetype_%.bbappend b/meta-ivi-common/recipes-test/freetype/freetype_%.bbappend
deleted file mode 100644
index a5c67299b..000000000
--- a/meta-ivi-common/recipes-test/freetype/freetype_%.bbappend
+++ /dev/null
@@ -1,32 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI =+ "${SOURCEFORGE_MIRROR}/freetype/ft2demos-${PV}.tar.bz2;name=ft2demos \
- file://0001-Makefile-dont-build-gfx-demos.patch;patchdir=../ft2demos-${PV} \
- file://0001-ft2demos-Makefile-Do-not-hardcode-libtool-path.patch;patchdir=../ft2demos-${PV} \
- "
-SRC_URI[ft2demos.md5sum] = "b8185d15751e9decd21d0e7e63cccbf6"
-SRC_URI[ft2demos.sha256sum] = "568a8f3a6301189a881d2f7ec95da280d20c862de94d81815341870e380b00e6"
-
-PACKAGES =+ "${PN}-demos"
-
-B = "${S}"
-
-do_compile_append () {
-
- oe_runmake -C ${WORKDIR}/ft2demos-${PV} TOP_DIR=${WORKDIR}/${BPN}-${PV}/
-}
-
-do_install_append () {
- install -d -m 0755 ${D}/${bindir}
- for x in ftbench ftdump ftlint ftvalid ttdebug; do
- install -m 0755 ${WORKDIR}/ft2demos-${PV}/bin/.libs/$x ${D}/${bindir}
- done
-}
-
-FILES_${PN}-demos = "\
- ${bindir}/ftbench \
- ${bindir}/ftdump \
- ${bindir}/ftlint \
- ${bindir}/ftvalid \
- ${bindir}/ttdebug \
-"
diff --git a/meta-ivi-common/recipes-test/fsfuzzer/files/0001-fix_missing_header_sys_stat.patch b/meta-ivi-common/recipes-test/fsfuzzer/files/0001-fix_missing_header_sys_stat.patch
deleted file mode 100644
index e834becf3..000000000
--- a/meta-ivi-common/recipes-test/fsfuzzer/files/0001-fix_missing_header_sys_stat.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -urN fsfuzzer-0.7.orig/fstest.c fsfuzzer-0.7/fstest.c
---- fsfuzzer-0.7.orig/fstest.c 2009-01-25 14:50:06.000000000 +0000
-+++ fsfuzzer-0.7/fstest.c 2016-06-16 17:49:27.264565819 +0000
-@@ -35,6 +35,7 @@
- #include <signal.h>
- #include <sys/file.h>
- #include <sys/mman.h>
-+#include <sys/stat.h>
-
- #define LOGGIT 1
- #define CHECK_XATTR 1
diff --git a/meta-ivi-common/recipes-test/fsfuzzer/fsfuzzer_0.7.bb b/meta-ivi-common/recipes-test/fsfuzzer/fsfuzzer_0.7.bb
deleted file mode 100644
index d2ddb59b1..000000000
--- a/meta-ivi-common/recipes-test/fsfuzzer/fsfuzzer_0.7.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-SUMMARY = "The fsfuzzer is a filesystem fuzzer tool that does stress tests of various filesystems in a reproducible and logged way."
-DESCRIPTION = "This tool creates initial (valid) filesystem images and then manipulates their binary format and structure for detecting flaws/bugs/design problems in the parsing/handling code for that particular filesystem. The program expects that you have a /media directory. It uses that one for mounting test images in."
-HOMEPAGE = "https://www.ee.oulu.fi/research/ouspg/fsfuzzer"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
-
-SRC_URI = "http://people.redhat.com/sgrubb/files/fsfuzzer-${PV}.tar.gz \
- file://0001-fix_missing_header_sys_stat.patch \
- "
-SRC_URI[md5sum] = "d69ac4b67aaba52a889c9188eb456c15"
-SRC_URI[sha256sum] = "094aa17c4f66c525a04e5db5ad444b4a561b6f8e310d0bd70b9ca421cdf0a434"
-
-inherit autotools
-
-# Specify any options you want to pass to the configure script using EXTRA_OECONF:
-EXTRA_OECONF = ""
-
diff --git a/meta-ivi-common/recipes-test/glmark2/glmark2_%.bbappend b/meta-ivi-common/recipes-test/glmark2/glmark2_%.bbappend
deleted file mode 100644
index a64e0506c..000000000
--- a/meta-ivi-common/recipes-test/glmark2/glmark2_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-PACKAGECONFIG = "wayland-gles2"
-PACKAGECONFIG[wayland-gles2] = ",,virtual/egl virtual/libgles2 wayland"
diff --git a/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb b/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb
deleted file mode 100644
index f890e23a4..000000000
--- a/meta-ivi-common/recipes-test/himeno/himeno_2.0.bb
+++ /dev/null
@@ -1,27 +0,0 @@
-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
- cd ${S}
- sed -i -e 's/CC= gcc/#CC= gcc/' Makefile
- sed -i -e 's/CFLAGS = /#CFLAGS = /' Makefile
-}
-
-do_install () {
- install -d ${D}${bindir}
- install -m 0755 bmt ${D}${bindir}
-}
diff --git a/meta-ivi-common/recipes-test/interbench/files/interbench.c.patch b/meta-ivi-common/recipes-test/interbench/files/interbench.c.patch
deleted file mode 100755
index c882739ba..000000000
--- a/meta-ivi-common/recipes-test/interbench/files/interbench.c.patch
+++ /dev/null
@@ -1,68 +0,0 @@
---- interbench.c.orig 2009-10-30 23:14:59.000000000 -0500
-+++ interbench.c 2012-07-10 19:06:00.000000000 -0500
-@@ -71,6 +71,7 @@ struct user_data {
- char datestamp[13];
- FILE *logfile;
- } ud = {
-+ .ram = 0,
- .duration = 30,
- .cpu_load = 4,
- .log = 1,
-@@ -652,6 +653,8 @@ void emulate_write(struct thread *th)
- terminal_error("fopen");
- if (stat(name, &statbuf) == -1)
- terminal_fileopen_error(fp, "stat");
-+ if (statbuf.st_blksize < MIN_BLK_SIZE)
-+ statbuf.st_blksize = MIN_BLK_SIZE;
- for (i = 0 ; i < mem; i++) {
- if (fwrite(buf, statbuf.st_blksize, 1, fp) != 1)
- terminal_fileopen_error(fp, "fwrite");
-@@ -1136,14 +1139,17 @@ void get_ram(void)
- if(!(meminfo = fopen("/proc/meminfo", "r")))
- terminal_error("fopen");
-
-- ud.ram = ud.swap = 0;
-- while( !feof(meminfo) && !fscanf(meminfo, "MemTotal: %lu kB", &ud.ram) )
-- fgets(aux,sizeof(aux),meminfo);
-+ if (!ud.ram)
-+ {
-+ while( !feof(meminfo) && !fscanf(meminfo, "MemTotal: %lu kB", &ud.ram) )
-+ fgets(aux,sizeof(aux),meminfo);
-+ }
-+ ud.swap = 0;
- while( !feof(meminfo) && !fscanf(meminfo, "SwapTotal: %lu kB", &ud.swap) )
- fgets(aux,sizeof(aux),meminfo);
- if (fclose(meminfo) == -1)
- terminal_error("fclose");
--
-+
- if( !ud.ram || !ud.swap ) {
- unsigned long i;
- fprintf(stderr, "\nCould not get memory or swap size. ");
-@@ -1399,6 +1405,7 @@ void usage(void)
- fprintf(stderr, "\t[-h]\n\n");
- fprintf(stderr, " -l\tUse <int> loops per sec (default: use saved benchmark)\n");
- fprintf(stderr, " -L\tUse cpu load of <int> with burn load (default: 4)\n");
-+ fprintf(stderr, " -M\tForce RAM size to <int>. Useful when disk is smaller than RAM.\n");
- fprintf(stderr, " -t\tSeconds to run each benchmark (default: 30)\n");
- fprintf(stderr, " -B\tNice the benchmarked thread to <int> (default: 0)\n");
- fprintf(stderr, " -N\tNice the load thread to <int> (default: 0)\n");
-@@ -1482,7 +1489,7 @@ int main(int argc, char **argv)
- terminal_error("signal");
- #endif
-
-- while ((q = getopt(argc, argv, "hl:L:B:N:ut:bcnrC:I:m:w:x:W:X:")) != -1) {
-+ while ((q = getopt(argc, argv, "hl:L:M:B:N:ut:bcnrC:I:m:w:x:W:X:")) != -1) {
- switch (q) {
- case 'h':
- usage();
-@@ -1496,6 +1503,9 @@ int main(int argc, char **argv)
- case 'L':
- ud.cpu_load = atoi(optarg);
- break;
-+ case 'M':
-+ ud.ram = atoi(optarg);
-+ break;
- case 'B':
- ud.bench_nice = atoi(optarg);
- break;
diff --git a/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb b/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb
deleted file mode 100644
index 3e6490374..000000000
--- a/meta-ivi-common/recipes-test/interbench/interbench_0.31.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-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"
-
-SRC_URI += "file://interbench.c.patch;striplevel=0"
-
-inherit autotools
-
-INSANE_SKIP_${PN} = "ldflags"
-
-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"
-
diff --git a/meta-ivi-common/recipes-test/ipv6connect/ipv6connect.bb b/meta-ivi-common/recipes-test/ipv6connect/ipv6connect.bb
deleted file mode 100644
index 208ac5c13..000000000
--- a/meta-ivi-common/recipes-test/ipv6connect/ipv6connect.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "ipv6connect test"
-HOMEPAGE = "https://chromium.googlesource.com/chromiumos/third_party/autotest/+/0.12.369.B/client/tests/ipv6connect"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/${PN}/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/qa-test-misc;protocol=https;branch=master"
-SRCREV = "b355b7e1f43a19938895964f314484ffd8a39542"
-
-inherit autotools
-
-INSANE_SKIP_${PN} = "ldflags"
-
-B = "${WORKDIR}/git/ipv6connect"
-S = "${WORKDIR}/git"
-
-# configure script is not delivered, only a makefile.
-do_configure() {
- :
-}
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${B}/ipv6connect ${D}${bindir}
-}
diff --git a/meta-ivi-common/recipes-test/linpack/linpack.bb b/meta-ivi-common/recipes-test/linpack/linpack.bb
deleted file mode 100644
index 7ac1eb987..000000000
--- a/meta-ivi-common/recipes-test/linpack/linpack.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-SUMMARY = "Linpack benchmark"
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://${S}/${PN}/linpack.c;md5=076f1fd8d313056103f98d4253862eae"
-
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/qa-test-misc;protocol=https;branch=master"
-SRCREV = "920cae73a918d1f516113b0ae967be3ecaba86ef"
-
-inherit autotools
-
-S = "${WORKDIR}/git"
-
-# configure script is not delivered, only a makefile.
-do_configure() {
- mkdir -p ${B}
- rsync -a ${S}/${PN}/* ${B}
-}
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${B}/linpack ${D}${bindir}
-}
diff --git a/meta-ivi-common/recipes-test/linus-stress/linus-stress.bb b/meta-ivi-common/recipes-test/linus-stress/linus-stress.bb
deleted file mode 100644
index 465118013..000000000
--- a/meta-ivi-common/recipes-test/linus-stress/linus-stress.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "linus_stress test"
-HOMEPAGE = "https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/client/tests/linus_stress"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/linus_stress/LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-
-SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/qa-test-misc;protocol=https;branch=master"
-SRCREV = "87cdfd4626c0cb47fc22f328867e49d6268df85c"
-
-inherit autotools
-INSANE_SKIP_${PN} = "ldflags"
-
-B = "${WORKDIR}/git/linus_stress"
-S = "${WORKDIR}/git"
-
-# configure script is not delivered, only a makefile.
-do_configure() {
- :
-}
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${B}/linus_stress ${D}${bindir}
-}
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
deleted file mode 100644
index bd42820fc..000000000
--- a/meta-ivi-common/recipes-test/packagegroups/packagegroup-ivi-common-test.bb
+++ /dev/null
@@ -1,53 +0,0 @@
-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 \
- packagegroup-ivi-common-test-ltp \
- "
-
-ALLOW_EMPTY_${PN} = "1"
-
-RDEPENDS_${PN} += "\
- bc \
- blobsallad \
- dbench \
- ebizzy \
- ffsb \
- interbench \
- iozone3 \
- iperf \
- ipv6connect \
- linpack \
- linus-stress \
- lmbench \
- ltp \
- nbench-byte \
- packagegroup-ivi-common-test-ltp \
- rt-tests \
- stress \
- trinity \
- "
-# to be added, but needs LICENSE_FLAGS_WHITELIST="non-commercial"
-# netperf
-# wayland-fits is broken in jethro, https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg46505.html
-# http://errors.yoctoproject.org/Errors/Details/35141/
-# wayland-fits
-
-# FTBS, SPEC-316
-# himeno
-
-
-# Packages for shell commands which are required by LTP
-# readelf, logrotate, vsftpd, crontab, sar, arp, ftp,
-# host, rcp, rlogin, rsh, tcpdump, expect, iptables, dnsmasq,
-# pgrep
-RDEPENDS_packagegroup-ivi-common-test-ltp += " \
- initscripts-functions bind-utils binutils \
- cronie dnsmasq expect inetutils-ftp inetutils-rsh \
- iptables logrotate net-tools sysstat tcpdump vsftpd \
- "
diff --git a/meta-ivi-common/recipes-test/trinity/trinity_git.bb b/meta-ivi-common/recipes-test/trinity/trinity_git.bb
deleted file mode 100644
index f0f09a855..000000000
--- a/meta-ivi-common/recipes-test/trinity/trinity_git.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-SUMMARY = "a Linux System call fuzz teste."
-DESCRIPTION = "Trinity, a Linux System call fuzz tester."
-HOMEPAGE = "http://codemonkey.org.uk/projects/trinity/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=96094d47cfbd2cc45eb46ce0fc423c04"
-
-COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
-
-PV = "1.5"
-SRCREV = "edc2e693e298e0372010a361354c4a79a3cd93f3"
-SRC_URI = "git://github.com/kernelslacker/trinity.git;protocol=https;nobranch=1 \
- "
-
-S = "${WORKDIR}/git"
-
-inherit useradd
-
-USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --create-home --shell /bin/sh ${PN} "
-
-do_configure () {
- ./configure.sh
-}
-
-# workaround random build failures
-do_compile () {
- ${MAKE}
-}
-
-do_install () {
- oe_runmake install DESTDIR=${D}/usr
- install -o ${PN} -d -m 0755 ${D}/${datadir}/${PN}
- install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-parallel.sh ${D}/${datadir}/${PN}
- install -o ${PN} -m 0755 ${S}/scripts/test-all-syscalls-sequentially.sh ${D}/${datadir}/${PN}
- install -o ${PN} -m 0755 ${S}/scripts/test-multi.sh ${D}/${datadir}/${PN}
- install -o ${PN} -m 0755 ${S}/scripts/test-vm.sh ${D}/${datadir}/${PN}
-}
-
-PACKAGES =+ "${PN}-example"
-
-FILES_${PN} = "${bindir}/trinity"
-FILES_${PN}-example = "${datadir}/${PN}"
diff --git a/meta-ivi-common/recipes-test/wayland/wayland-fits_%.bbappend b/meta-ivi-common/recipes-test/wayland/wayland-fits_%.bbappend
deleted file mode 100644
index 772f81b0f..000000000
--- a/meta-ivi-common/recipes-test/wayland/wayland-fits_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-# Disable GTK+ and EFL tests
-PACKAGECONFIG = ""
-
-# UInput driver is necessary on QEMU
-RDEPENDS_${PN}_append_qemux86-64 = " kernel-module-uinput"
diff --git a/meta-ivi-common/recipes-test/wayland/wayland-fits_git.bbappend b/meta-ivi-common/recipes-test/wayland/wayland-fits_git.bbappend
deleted file mode 100644
index 84c7cfdbe..000000000
--- a/meta-ivi-common/recipes-test/wayland/wayland-fits_git.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-# Updating to latest version is necessary for Weston >= 1.9.0
-SRCREV = "f108335e374772ae2818a30ae37fe6fcda81980f"
diff --git a/meta-netboot/LICENSE b/meta-netboot/LICENSE
new file mode 100644
index 000000000..e8758f89c
--- /dev/null
+++ b/meta-netboot/LICENSE
@@ -0,0 +1,20 @@
+Different components of the AGL layers are under different licenses (a mix
+of MIT and GPLv2). See LICENSE.GPL-2.0-only and LICENSE.MIT for further
+details of the individual licenses.
+
+All metadata (e.g. .bb, .bbappend, .bbclass, .inc, templates/* and similar)
+is MIT licensed unless otherwise stated.
+Source code included in tree for individual recipes (e.g. patches) are under
+the LICENSE stated in the associated recipe (.bb file) unless otherwise stated.
+
+License information for any other files (scripts) is either explicitly stated
+or defaults to GPL version 2 only.
+
+Individual files can contain the following style tags instead of the full
+license text to identify their license:
+
+ SPDX-License-Identifier: GPL-2.0-only
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-netboot/LICENSE.GPL-2.0-only b/meta-netboot/LICENSE.GPL-2.0-only
new file mode 100644
index 000000000..5db3c0a21
--- /dev/null
+++ b/meta-netboot/LICENSE.GPL-2.0-only
@@ -0,0 +1,288 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: GPL-2.0-only
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-netboot/LICENSE.MIT b/meta-netboot/LICENSE.MIT
new file mode 100644
index 000000000..a6919eb7e
--- /dev/null
+++ b/meta-netboot/LICENSE.MIT
@@ -0,0 +1,25 @@
+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 above copyright notice and this permission notice 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.
+
+Note:
+Individual files contain the following tag instead of the full license text.
+
+ SPDX-License-Identifier: MIT
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
diff --git a/meta-netboot/README b/meta-netboot/README
index c1bb6a164..a30238b9d 100644
--- a/meta-netboot/README
+++ b/meta-netboot/README
@@ -3,16 +3,38 @@ meta-netboot
This layer contains some recipes and configuration adjustments to allow network boot through NBD (network block device).
+Maintenance
+-----------
+
+All patches must be submitted via the AGL Gerrit instance at
+https://gerrit.automotivelinux.org. See this wiki page for
+details:
+
+https://wiki.automotivelinux.org/agl-distro/contributing
+
+Layer maintainers:
+ Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+
+
Content and usage
-----------------
This layer creates a new supplementary initrd image which can be downloaded through TFTP with the kernel.
At boot time, the init script will try to mount the rootfs based on the following kernel command line parameters:
+
* nbd.server: IP address to reach the NBD server
-* nbd.port: TCP port on which server is listening (default: 10809)
* nbd.dev: nbd device to use (default: /dev/nbd0)
* nbd.debug: activate debug mode (init script is then interruptible)
+For nbd v2:
+
+* nbd.port: TCP port on which server is listening (default: 10809)
+
+For nbd v3:
+
+* nbd.namev3: The name of the image served by nbd-server.
+
+
The layer meta-netboot contains recipes for the following components:
* busybox: activate the built-in NBD client
* initramfs-netboot: contains the init script started by the kernel: basically, this script mounts the real root filesystem, then pivot_root on it and finally exec systemd.
@@ -40,29 +62,8 @@ On the server side (assuming that the build dir is stored in $BUILD) we can run:
Target side
-----------
-On the target board, a specific setup should also be done. For example, for Renesas Porter board, the following U-boot environment could be used (adjust IP addresses !):
-
-------------------------------------------------------------------
-setenv 'bootkfile' 'uImage+dtb'
-setenv 'bootkaddr' '0x40007fc0'
-setenv 'bootifile' 'initramfs-netboot-image-porter.ext4.gz.u-boot'
-setenv 'bootiaddr' '0x50000000'
-setenv 'ipaddr' '<board_IP>'
-setenv 'serverip' '<server_IP>'
-
-setenv 'bootargs_console' 'console=ttySC6,38400 ignore_loglevel'
-setenv 'bootargs_video' 'vmalloc=384M video=HDMI-A-1:1280x960-32@60'
-setenv 'bootargs_extra' 'rw rootfstype=ext4 rootwait rootdelay=2'
-setenv 'bootargs_root' 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
-setenv 'bootkload_net' 'tftp ${bootkaddr} porter/${bootkfile}'
-setenv 'bootiload_net' 'tftp ${bootiaddr} porter/${bootifile}'
-setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run bootkload_net; run bootiload_net; bootm ${bootkaddr} ${bootiaddr}'
-
-saveenv # optional: saves env in flash
-run bootcmd # boots the board, executed automatically after power up
-------------------------------------------------------------------
-
-About Renesas Gen3 board, u-boot is updated and environment is more like :
+On the target board, a specific setup should also be done.\
+For Renesas Gen3 board, u-boot is updated and environment is more like :
------------------------------------------------------------------
setenv bootargs_console 'console=ttySC0,115200 ignore_loglevel'
@@ -71,14 +72,14 @@ setenv bootargs_root 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60'
setenv serverip '<your_serverip>'
setenv 'bootdaddr' '0x48000000'
-setenv 'bootdfile' 'Image-r8a7795-h3ulcb.dtb'
+setenv 'bootdfile' 'Image-r8a77951-ulcb.dtb'
setenv 'bootdload_net' 'tftp ${bootdaddr} h3ulcb/${bootdfile}'
setenv 'bootkaddr' '0x48080000'
setenv 'bootkfile' 'Image'
setenv 'bootkload_net' 'tftp ${bootkaddr} h3ulcb/${bootkfile}'
setenv 'bootiaddr' '0x5C3F9520'
setenv 'bootifile' 'initramfs-netboot-image-h3ulcb.ext4.gz'
-setenv 'bootiload_net' 'tftp ${bootraddr} h3ulcb/${bootrfile}'
+setenv 'bootiload_net' 'tftp ${bootiaddr} h3ulcb/${bootifile}'
setenv 'load_net' 'run bootkload_net; run bootdload_net; run bootiload_net; setenv initrd_size ${filesize}'
setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run load_net; booti ${bootkaddr} ${bootiaddr}:${initrd_size} ${bootdaddr}'
diff --git a/meta-netboot/README.renesas-gen3 b/meta-netboot/README.renesas-gen3
deleted file mode 100644
index 225051af2..000000000
--- a/meta-netboot/README.renesas-gen3
+++ /dev/null
@@ -1,70 +0,0 @@
-Below are the environment variables that can be set in the u-boot console to boot the Renesas Gen3 ULCB boards.
-
-Adjust board type with the following identifiers:
-
-* 'm3ulcb' for Renesas Gen3 Starter Kit Pro
-* 'h3ulcb' for Renesas Gen3 Starter Kit Premium
-
-################## Common options #####################
-# these options are common to all configurations:
-
-# choose board
-setenv board m3ulcb
-# or
-setenv board h3ulcb
-
-# kernel file
-setenv set_bootkfile 'setenv bootkfile Image'
-setenv bootkaddr 0x48080000
-
-# dtb file
-setenv set_bootdfile 'setenv bootdfile Image-r8a7796-${board}.dtb'
-setenv bootdaddr 0x48000000
-
-# initrd
-setenv set_bootifile 'setenv bootifile initramfs-netboot-image-${board}.ext4.gz'
-setenv bootiaddr 0x5C3F9520
-setenv bootisize 3A6AB6
-
-# kernel args
-setenv bootargs_console 'console=ttySC0,115200 ignore_loglevel'
-setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60'
-setenv bootargs_extra 'rw rootfstype=ext4 rootwait rootdelay=2'
-
-################ Boot on MMC (SDcard) #################
-
-setenv bootargs_root 'root=/dev/mmcblk1p1'
-setenv bootmmc '0:1'
-setenv bootkload_sd 'ext4load mmc ${bootmmc} ${bootkaddr} boot/${bootkfile}'
-setenv bootdload_sd 'ext4load mmc ${bootmmc} ${bootdaddr} boot/${bootdfile}'
-setenv bootload_sd 'run set_bootkfile; run bootkload_sd; run set_bootdfile; run bootdload_sd'
-setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra}; run bootload_sd; booti ${bootkaddr} - ${bootdaddr}'
-
-################ Boot on MMC (SDcard) with initrd ######
-
-setenv bootargs_root 'root=/dev/ram0 ramdisk_size=16384'
-setenv bootmmc '0:1'
-setenv bootkload_sd 'ext4load mmc ${bootmmc} ${bootkaddr} boot/${bootkfile}'
-setenv bootdload_sd 'ext4load mmc ${bootmmc} ${bootdaddr} boot/${bootdfile}'
-setenv bootiload_sd 'ext4load mmc ${bootmmc} ${bootiaddr} boot/${bootifile}'
-setenv bootload_sd 'run set_bootkfile; run bootkload_sd; run set_bootdfile; run bootdload_sd; run set_bootifile; run bootiload_sd'
-
-setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra}; run bootload_sd; booti ${bootkaddr} ${bootiaddr}:${bootisize} ${bootdaddr}'
-
-################ Netboot through TFTP+NBD ##################
-# replace <IP> addresses by appropriate addresses
-
-setenv ipaddr '<board_IP>'
-setenv serverip '<server_IP>'
-setenv ethact ravb
-setenv ethaddr DE:AD:C0:FF:EE:01
-
-setenv bootargs_root 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
-setenv bootkload_net 'tftp ${bootkaddr} ${board}/${bootkfile}'
-setenv bootdload_net 'tftp ${bootdaddr} ${board}/${bootdfile}'
-setenv bootiload_net 'tftp ${bootiaddr} ${board}/${bootifile}'
-setenv bootload_net 'run set_bootkfile; run bootkload_net; run set_bootdfile; run bootdload_net; run set_bootifile; run bootiload_net'
-
-setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run bootload_net; booti ${bootkaddr} ${bootiaddr}:${bootisize} ${bootdaddr}'
-
-
diff --git a/meta-netboot/README.renesas-porter b/meta-netboot/README.renesas-porter
deleted file mode 100644
index 7ab0803fb..000000000
--- a/meta-netboot/README.renesas-porter
+++ /dev/null
@@ -1,41 +0,0 @@
-Below are the environment variables that can be set in the u-boot console to boot the porter board in various configurations
-
-################## Common options #####################
-# these options are common to all configurations:
-
-setenv 'bootkfile' 'uImage+dtb'
-setenv 'bootkaddr' '0x40007fc0'
-
-setenv 'bootifile' 'initramfs-netboot-image-porter.ext4.gz.u-boot'
-setenv 'bootiaddr' '0x50000000'
-
-setenv 'bootargs_console' 'console=ttySC6,38400 ignore_loglevel'
-setenv 'bootargs_video' 'vmalloc=384M video=HDMI-A-1:1280x960-32@60'
-setenv 'bootargs_extra' 'rw rootfstype=ext4 rootwait rootdelay=2'
-
-################ Boot on MMC (SDcard) #################
-
-setenv 'bootargs_root' 'root=/dev/mmcblk0p1'
-setenv 'bootmmc' '1:1'
-setenv 'bootkload_sd' 'ext4load mmc ${bootmmc} ${bootkaddr} boot/${bootkfile}'
-setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; bootm ${bootkaddr}'
-
-################ Boot on MMC (SDcard) with initrd ######
-
-setenv 'bootargs_root' 'root=/dev/ram0 ramdisk_size=16384'
-setenv 'bootmmc' '1:1'
-setenv 'bootkload_sd' 'ext4load mmc ${bootmmc} ${bootkaddr} boot/${bootkfile}'
-setenv 'bootiload_sd' 'ext4load mmc ${bootmmc} ${bootiaddr} boot/${bootifile}'
-setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; bootm ${bootkaddr} ${bootiaddr}'
-
-################ Netboot through TFTP+NBD ##################
-# replace <IP> addresses by appropriate addresses
-
-setenv 'ipaddr' '<board_IP>'
-setenv 'serverip' '<server_IP>'
-
-setenv 'bootargs_root' 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
-setenv 'bootkload_net' 'tftp ${bootkaddr} porter/${bootkfile}'
-setenv 'bootiload_net' 'tftp ${bootiaddr} porter/${bootifile}'
-setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run bootkload_net; run bootiload_net; bootm ${bootkaddr} ${bootiaddr}'
-
diff --git a/meta-netboot/classes/netboot.bbclass b/meta-netboot/classes/netboot.bbclass
index c74c10510..a18d64f5b 100644
--- a/meta-netboot/classes/netboot.bbclass
+++ b/meta-netboot/classes/netboot.bbclass
@@ -1,25 +1,27 @@
# Enable network bootable image and initrd/initramfs
-# add image classes for uboot
-IMAGE_CLASSES += "${@'image_types_uboot' if (d.getVar("KERNEL_IMAGETYPE", True) == "uImage") else ''}"
+OVERRIDES .= ":netboot"
+# add 512MB of extra space in ext4 output image
+IMAGE_ROOTFS_EXTRA_SPACE = "524288"
+NETBOOT_ENABLED ??= "1"
python () {
- if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)):
- # typical case for Minnowboard Max
- d.setVar("INITRD_IMAGE","initramfs-netboot-image")
- d.setVar("INITRD_IMAGE_LIVE",d.getVar("INITRD_IMAGE",True))
- d.setVar("INITRD_LIVE","%s/%s-%s.ext4.gz" % (
- d.getVar("DEPLOY_DIR_IMAGE",True),
- d.getVar("INITRD_IMAGE_LIVE",True),
- d.getVar("MACHINE",True)
- ))
- else:
- d.setVar("INITRAMFS_IMAGE","initramfs-netboot-image")
- if (d.getVar("KERNEL_IMAGETYPE",True) == "uImage"):
- # case for "old" u-boot images, like Porter board
- d.setVar("NETBOOT_FSTYPES", "ext4.gz.u-boot");
- else:
- # case for new u-boot images which don't require uImage format
- d.setVar("NETBOOT_FSTYPES", "ext4.gz");
+ if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)):
+ # typical case for Minnowboard Max
+ d.setVar("INITRD_IMAGE","initramfs-netboot-image")
+ d.setVar("INITRD_IMAGE_LIVE",d.getVar("INITRD_IMAGE",True))
+ d.setVar("INITRD_LIVE","%s/%s-%s.ext4.gz" % (
+ d.getVar("DEPLOY_DIR_IMAGE",True),
+ d.getVar("INITRD_IMAGE_LIVE",True),
+ d.getVar("MACHINE",True)
+ ))
+ else:
+ d.setVar("INITRAMFS_IMAGE","initramfs-netboot-image")
+ if (d.getVar("KERNEL_IMAGETYPE",True) == "uImage"):
+ # case for "old" u-boot images, like Porter board
+ d.setVar("NETBOOT_FSTYPES", "ext4.gz.u-boot");
+ else:
+ # case for new u-boot images which don't require uImage format
+ d.setVar("NETBOOT_FSTYPES", "ext4.gz");
}
diff --git a/meta-netboot/conf/include/agl-netboot.inc b/meta-netboot/conf/include/agl-netboot.inc
index fcff8c318..2c1307e81 100644
--- a/meta-netboot/conf/include/agl-netboot.inc
+++ b/meta-netboot/conf/include/agl-netboot.inc
@@ -1,5 +1,6 @@
INHERIT += "netboot"
-OVERRIDES .= ":netboot"
-# add 512MB of extra space in ext4 output image
-IMAGE_ROOTFS_EXTRA_SPACE = "524288"
+IMAGE_INSTALL:append:netboot = " \
+ curl \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'resolv-conf-relabel policycoreutils-loadpolicy', '', d)} \
+"
diff --git a/meta-netboot/conf/layer.conf b/meta-netboot/conf/layer.conf
index 324f1f1bb..a41406cbb 100644
--- a/meta-netboot/conf/layer.conf
+++ b/meta-netboot/conf/layer.conf
@@ -1,6 +1,3 @@
-# Added for futur conditionnals tests
-DISTRO_FEATURES_append = " netboot"
-
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
@@ -10,4 +7,7 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "meta-netboot"
BBFILE_PATTERN_meta-netboot = "^${LAYERDIR}/"
-BBFILE_PRIORITY_meta-netboot = "20"
+BBFILE_PRIORITY_meta-netboot = "60"
+
+LAYERSERIES_COMPAT_meta-netboot = "scarthgap"
+LAYERDEPENDS_meta-netboot = "core networking-layer"
diff --git a/meta-netboot/recipes-core/busybox/busybox_%.bbappend b/meta-netboot/recipes-core/busybox/busybox_%.bbappend
index 358913448..fcf6acfd1 100644
--- a/meta-netboot/recipes-core/busybox/busybox_%.bbappend
+++ b/meta-netboot/recipes-core/busybox/busybox_%.bbappend
@@ -1,6 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += " \
- file://enable_nbd.cfg \
- "
-
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'busybox_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-core/busybox/busybox_netboot.inc b/meta-netboot/recipes-core/busybox/busybox_netboot.inc
new file mode 100644
index 000000000..836493834
--- /dev/null
+++ b/meta-netboot/recipes-core/busybox/busybox_netboot.inc
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = " \
+ file://enable_nbd.cfg \
+ "
+
diff --git a/meta-netboot/recipes-core/images/initramfs-netboot-image.bb b/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
index cc6bc6753..b5610f30d 100644
--- a/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
+++ b/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
@@ -1,20 +1,2 @@
-# Netboot initramfs image.
-DESCRIPTION = "Netboot initrd image"
-
-PACKAGE_INSTALL = "initramfs-netboot busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
-
-# Do not pollute the initrd image with rootfs features
-IMAGE_FEATURES = ""
-
-export IMAGE_BASENAME = "initramfs-netboot-image"
-IMAGE_LINGUAS = ""
-
LICENSE = "MIT"
-
-IMAGE_FSTYPES = "${NETBOOT_FSTYPES}"
-inherit core-image
-
-IMAGE_ROOTFS_SIZE = "8192"
-IMAGE_ROOTFS_EXTRA_SPACE = "256"
-
-BAD_RECOMMENDATIONS += "busybox-syslog"
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'initramfs-netboot-image_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc b/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc
new file mode 100644
index 000000000..b98024de6
--- /dev/null
+++ b/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc
@@ -0,0 +1,23 @@
+# Netboot initramfs image.
+DESCRIPTION = "Netboot initrd image"
+
+PACKAGE_INSTALL = "initramfs-netboot busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "initramfs-netboot-image"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES := "${NETBOOT_FSTYPES}"
+inherit core-image
+
+# hotfix for dragonboard (which uses _append in the bsp)
+IMAGE_FSTYPES:remove = "wic.gz"
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "256"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta-netboot/recipes-core/initramfs-netboot/files/init.sh b/meta-netboot/recipes-core/initramfs-netboot/files/init.sh
index d31988fd6..87a1acb80 100644
--- a/meta-netboot/recipes-core/initramfs-netboot/files/init.sh
+++ b/meta-netboot/recipes-core/initramfs-netboot/files/init.sh
@@ -21,10 +21,10 @@ EOF
# global variables
-SMACK=n
NBD_SERVER=
NBD_PORT=10809
NBD_DEV=/dev/nbd0
+NBD_NAMEV3=
DEBUG=n
# -------------------------------------------
@@ -56,6 +56,29 @@ check_debug() {
esac
}
+find_active_interface() {
+ [[ ! -d /sys/class/net ]] && { log_error "find_active_interface: /sys/class/net doesn't exist"; return 2; }
+ local iface
+ for x in $(ls -d /sys/class/net/* 2>/dev/null); do
+ iface=$(basename $x)
+ # find interfaces with:
+ # - type == 1 (ethernet)
+ # - not wireless
+ # - with state up
+
+ [[ $(cat $x/type) != 1 ]] && continue
+ [[ -d $x/wireless ]] && continue
+ [[ $(cat $x/operstate) != "up" ]] && continue
+
+ log_info "find_active_interface: first active interface is $iface"
+ echo $iface
+ return 0
+ done
+
+ log_error "Unable to find any active network interface."
+ return 1
+}
+
# -------------------------------------------
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
@@ -76,6 +99,7 @@ for x in $(cat /proc/cmdline); do
nbd.server=*) NBD_SERVER=${x/*=/};;
nbd.port=*) NBD_PORT=${x/*=/};;
nbd.dev=*) NBD_DEV=/dev/${x/*=/};;
+ nbd.namev3=*) NBD_NAMEV3=${x/*=/};;
nbd.debug=*) DEBUG=${x/*=/};;
esac
done
@@ -84,23 +108,17 @@ check_debug "Debug point 1. Exit to continue initrd script (mount NBD device)."
log_info "NBD parameters: device $NBD_DEV, server $NBD_SERVER:$NBD_PORT"
-# check if smack is active (and if so, mount smackfs)
-grep -q smackfs /proc/filesystems && {
- SMACK=y
-
- do_mount_fs smackfs /sys/fs/smackfs
-
- # adjust current label and network label
- echo System >/proc/self/attr/current
- echo System >/sys/fs/smackfs/ambient
-}
-
# start nbd client
try=5
while :;do
log_info "Starting NBD client"
- nbd-client $NBD_SERVER $NBD_PORT $NBD_DEV && { log_info "NBD client successfully started"; break; }
- log_info "NBD client failed"
+ if [ -z "${NBD_NAMEV3}" ]; then
+ nbd-client -persist $NBD_SERVER $NBD_PORT $NBD_DEV && { log_info "NBD client successfully started"; break; }
+ log_info "NBD client failed"
+ else
+ nbd3-client $NBD_SERVER $NBD_DEV --name $NBD_NAMEV3 && { log_info "NBD3 client successfully started"; break; }
+ log_info "NBDv3 client failed"
+ fi
[[ $try -gt 0 ]] && { log_info "Retrying ($try trie(s) left)..."; sleep 3; try=$(( try - 1 )); continue; }
bail_out "Unable to mount NBD device $NBD_DEV using server $NBD_SERVER:$NBD_PORT"
@@ -119,19 +137,44 @@ done
# switch to new rootfs
log_info "Switching to new rootfs"
-mkdir -p run/initramfs
-pivot_root . run/initramfs || bail_out "pivot_root failed."
+mkdir -p boot/initramfs
+pivot_root . boot/initramfs || bail_out "pivot_root failed."
# workaround for connman (avoid bringing down the network interface used for booting, disable DNS proxy)
if [[ -f /lib/systemd/system/connman.service ]]; then
- log_info "Adjusting Connman configuration"
- iface=$(ip -o link show up | tr ':' ' ' | awk '{print $2}' | grep -v -e "^lo$" | head -1)
- sed -i "s|connmand -n\$|connmand -r -n -I $iface|g" /lib/systemd/system/connman.service
+ newopts="-r -n"
+ iface=$(find_active_interface)
+ [[ -n "$iface" ]] && newopts="$newopts -I $iface"
+
+ log_info "Adjusting Connman command line. Will be: 'connmand $newopts'"
+ sed -i "s|connmand -n\$|connmand $newopts|g" /lib/systemd/system/connman.service
fi
# also use /proc/net/pnp to generate /etc/resolv.conf
+rm -f /etc/resolv.conf
grep -v bootserver /proc/net/pnp | sed 's/^domain/search/g' >/etc/resolv.conf
+# Do SELinux relabeling if required, to avoid a reboot that would complicate CI
+if [ -f /.autorelabel ]; then
+ # Nothing SELinux related works w/o the fs mounted
+ do_mount_fs selinuxfs /sys/fs/selinux
+
+ # Labeling requires the policy to be loaded
+ log_info "Loading SELinux policy"
+ /usr/sbin/load_policy
+
+ /usr/bin/selinux-autorelabel.sh
+
+ # Will get remounted by systemd startup, unmount to keep that behavior
+ # more like the non-netboot case.
+ umount /sys/fs/selinux
+fi
+
+# unmount tmp and run to let systemd remount them
+log_info "Unmounting /tmp and /run"
+umount /tmp
+umount /run
+
# finally, run systemd
check_debug "Debug point 2. Exit to continue initrd script (run systemd)."
diff --git a/meta-netboot/recipes-core/initramfs-netboot/initramfs-netboot_1.0.bb b/meta-netboot/recipes-core/initramfs-netboot/initramfs-netboot_1.0.bb
index 5c85bee8f..dd61a1ea8 100644
--- a/meta-netboot/recipes-core/initramfs-netboot/initramfs-netboot_1.0.bb
+++ b/meta-netboot/recipes-core/initramfs-netboot/initramfs-netboot_1.0.bb
@@ -5,15 +5,17 @@ SRC_URI = "file://init.sh"
S = "${WORKDIR}"
+RDEPENDS:${PN} += "nbd-client"
+
do_install() {
- install -dm 0755 ${D}/etc
- touch ${D}/etc/initrd-release
+ install -dm 0755 ${D}${sysconfdir}
+ touch ${D}${sysconfdir}/initrd-release
install -dm 0755 ${D}/dev
- install -dm 0755 ${D}/sbin
- install -m 0755 ${WORKDIR}/init.sh ${D}/sbin/init
+ install -dm 0755 ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/init.sh ${D}${sbindir}/init
}
inherit allarch
-FILES_${PN} += " /dev /etc/initrd-release /sbin/init "
+FILES:${PN} += " /dev ${sysconfdir}/initrd-release ${sbindir}/init "
diff --git a/meta-netboot/recipes-core/systemd/files/resolv-conf-relabel.service b/meta-netboot/recipes-core/systemd/files/resolv-conf-relabel.service
new file mode 100644
index 000000000..5d9216cc2
--- /dev/null
+++ b/meta-netboot/recipes-core/systemd/files/resolv-conf-relabel.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=SELinux resolv.conf relabeling
+DefaultDependencies=no
+ConditionKernelCommandLine=ip
+ConditionKernelCommandLine=nbd.server
+After=local-fs.target
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/restorecon -Fi /etc/resolv.conf
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta-netboot/recipes-core/systemd/resolv-conf-relabel.bb b/meta-netboot/recipes-core/systemd/resolv-conf-relabel.bb
new file mode 100644
index 000000000..36d096b44
--- /dev/null
+++ b/meta-netboot/recipes-core/systemd/resolv-conf-relabel.bb
@@ -0,0 +1,21 @@
+SUMMARY = "System unit to relabel resolve.conf"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://resolv-conf-relabel.service"
+
+inherit systemd allarch features_check
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/resolv-conf-relabel.service ${D}${systemd_system_unitdir}/
+}
+
+FILES:${PN} += "${systemd_system_unitdir}"
diff --git a/meta-netboot/recipes-kernel/linux/files/nbd.cfg b/meta-netboot/recipes-kernel/linux/files/nbd.cfg
deleted file mode 100644
index af37685e4..000000000
--- a/meta-netboot/recipes-kernel/linux/files/nbd.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_BLK_DEV_NBD=y
diff --git a/meta-netboot/recipes-kernel/linux/files/ramdisk.cfg b/meta-netboot/recipes-kernel/linux/files/ramdisk.cfg
deleted file mode 100644
index 41530dd6e..000000000
--- a/meta-netboot/recipes-kernel/linux/files/ramdisk.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_BLK_DEV_RAM=y
diff --git a/meta-netboot/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-netboot/recipes-kernel/linux/linux-yocto_%.bbappend
deleted file mode 100644
index f20d57a22..000000000
--- a/meta-netboot/recipes-kernel/linux/linux-yocto_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-# Extra configuration options for NBD support and netboot over RAMFS
-SRC_URI_append = " file://nbd.cfg \
- file://ramdisk.cfg \
- "
diff --git a/meta-netboot/recipes-support/nbd/nbd_%.bbappend b/meta-netboot/recipes-support/nbd/nbd_%.bbappend
new file mode 100644
index 000000000..e67e591ff
--- /dev/null
+++ b/meta-netboot/recipes-support/nbd/nbd_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'nbd_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-support/nbd/nbd_netboot.inc b/meta-netboot/recipes-support/nbd/nbd_netboot.inc
new file mode 100644
index 000000000..4c9489de1
--- /dev/null
+++ b/meta-netboot/recipes-support/nbd/nbd_netboot.inc
@@ -0,0 +1,5 @@
+do_install:append() {
+ mv ${D}/${sbindir}/nbd-client ${D}/${sbindir}/nbd3-client
+}
+
+FILES:${PN}-client:append = " ${sbindir}/nbd3-client"
diff --git a/meta-netboot/scripts/run-yocto-check-layer.sh b/meta-netboot/scripts/run-yocto-check-layer.sh
new file mode 100755
index 000000000..979c76838
--- /dev/null
+++ b/meta-netboot/scripts/run-yocto-check-layer.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we cannot import the distro config right away
+# as the initial values are poky only till the layer
+# is added in
+
+AGL_DEFAULT_DISTRO_FEATURES = "usrmerge largefile opengl wayland pam bluetooth bluez5 3g polkit"
+DISTRO_FEATURES:append = " systemd wayland pam \${AGL_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+EOF
+
+yocto-check-layer --no-auto-dependency \
+ --dependency \
+ $AGLROOT/external/meta-openembedded/meta-oe \
+ $AGLROOT/external/meta-openembedded/meta-python \
+ $AGLROOT/external/meta-openembedded/meta-networking \
+ -- \
+ $AGLROOT/meta-agl/meta-netboot
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl
+
+exit 0
diff --git a/meta-pipewire/README b/meta-pipewire/README
new file mode 100644
index 000000000..3df3a289c
--- /dev/null
+++ b/meta-pipewire/README
@@ -0,0 +1,16 @@
+meta-pipewire
+=============
+
+This layer holds the sound manager 'pipewire' and session manager 'wireplumber'.
+
+Maintenance
+-----------
+
+All patches must be submitted via the AGL Gerrit instance at
+https://gerrit.automotivelinux.org. See this wiki page for
+details:
+
+https://wiki.automotivelinux.org/agl-distro/contributing
+
+Layer maintainers:
+ Jan-Simon Möller <jsmoeller@linuxfoundation.org>
diff --git a/meta-pipewire/conf/include/agl-pipewire.inc b/meta-pipewire/conf/include/agl-pipewire.inc
new file mode 100644
index 000000000..03b419c2a
--- /dev/null
+++ b/meta-pipewire/conf/include/agl-pipewire.inc
@@ -0,0 +1 @@
+DISTRO_FEATURES:append = " pipewire"
diff --git a/meta-pipewire/conf/layer.conf b/meta-pipewire/conf/layer.conf
new file mode 100644
index 000000000..4a28a4244
--- /dev/null
+++ b/meta-pipewire/conf/layer.conf
@@ -0,0 +1,16 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "meta-pipewire"
+BBFILE_PATTERN_meta-pipewire = "^${LAYERDIR}/"
+BBFILE_PRIORITY_meta-pipewire = "71"
+
+LAYERSERIES_COMPAT_meta-pipewire = "scarthgap"
+LAYERDEPENDS_meta-pipewire = "openembedded-layer"
+
+#
+LICENSE_PATH += "${LAYERDIR}/licenses"
diff --git a/meta-pipewire/licenses/GPL-2.0-only b/meta-pipewire/licenses/GPL-2.0-only
new file mode 100644
index 000000000..7f5abbce2
--- /dev/null
+++ b/meta-pipewire/licenses/GPL-2.0-only
@@ -0,0 +1,132 @@
+
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program`s name and an idea of what it does.
+Copyright (C) yyyy name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w`. This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c`
+for details.
+The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision`
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+
diff --git a/meta-pipewire/licenses/LGPL-2.1-or-later b/meta-pipewire/licenses/LGPL-2.1-or-later
new file mode 100644
index 000000000..04bb156e7
--- /dev/null
+++ b/meta-pipewire/licenses/LGPL-2.1-or-later
@@ -0,0 +1,468 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts as the
+successor of the GNU Library Public License, version 2, hence the version
+number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it. By contrast, the GNU General Public Licenses are intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially
+designated software packages--typically libraries--of the Free Software Foundation
+and other authors who decide to use it. You can use it too, but we suggest
+you first think carefully about whether this license or the ordinary General
+Public License is the better strategy to use in any particular case, based
+on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price.
+Our General Public Licenses are designed to make sure that you have the freedom
+to distribute copies of free software (and charge for this service if you
+wish); that you receive source code or can get it if you want it; that you
+can change the software and use pieces of it in new free programs; and that
+you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors
+to deny you these rights or to ask you to surrender these rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of
+the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for
+a fee, you must give the recipients all the rights that we gave you. You must
+make sure that they, too, receive or can get the source code. If you link
+other code with the library, you must provide complete object files to the
+recipients, so that they can relink them with the library after making changes
+to the library and recompiling it. And you must show them these terms so they
+know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library,
+and (2) we offer you this license, which gives you legal permission to copy,
+distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no
+warranty for the free library. Also, if the library is modified by someone
+else and passed on, the recipients should know that what they have is not
+the original version, so that the original author's reputation will not be
+affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free
+program. We wish to make sure that a company cannot effectively restrict the
+users of a free program by obtaining a restrictive license from a patent holder.
+Therefore, we insist that any patent license obtained for a version of the
+library must be consistent with the full freedom of use specified in this
+license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU
+General Public License. This license, the GNU Lesser General Public License,
+applies to certain designated libraries, and is quite different from the ordinary
+General Public License. We use this license for certain libraries in order
+to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared
+library, the combination of the two is legally speaking a combined work, a
+derivative of the original library. The ordinary General Public License therefore
+permits such linking only if the entire combination fits its criteria of freedom.
+The Lesser General Public License permits more lax criteria for linking other
+code with the library.
+
+We call this license the "Lesser" General Public License because it does Less
+to protect the user's freedom than the ordinary General Public License. It
+also provides other free software developers Less of an advantage over competing
+non-free programs. These disadvantages are the reason we use the ordinary
+General Public License for many libraries. However, the Lesser license provides
+advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the
+widest possible use of a certain library, so that it becomes a de-facto standard.
+To achieve this, non-free programs must be allowed to use the library. A more
+frequent case is that a free library does the same job as widely used non-free
+libraries. In this case, there is little to gain by limiting the free library
+to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs
+enables a greater number of people to use a large body of free software. For
+example, permission to use the GNU C Library in non-free programs enables
+many more people to use the whole GNU operating system, as well as its variant,
+the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users'
+freedom, it does ensure that the user of a program that is linked with the
+Library has the freedom and the wherewithal to run that program using a modified
+version of the Library.
+
+The precise terms and conditions for copying, distribution and modification
+follow. Pay close attention to the difference between a "work based on the
+library" and a "work that uses the library". The former contains code derived
+from the library, whereas the latter must be combined with the library in
+order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program
+which contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Lesser General
+Public License (also called "this License"). Each licensee is addressed as
+"you".
+
+A "library" means a collection of software functions and/or data prepared
+so as to be conveniently linked with application programs (which use some
+of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has
+been distributed under these terms. A "work based on the Library" means either
+the Library or any derivative work under copyright law: that is to say, a
+work containing the Library or a portion of it, either verbatim or with modifications
+and/or translated straightforwardly into another language. (Hereinafter, translation
+is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications
+to it. For a library, complete source code means all the source code for all
+modules it contains, plus any associated interface definition files, plus
+the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered
+by this License; they are outside its scope. The act of running a program
+using the Library is not restricted, and output from such a program is covered
+only if its contents constitute a work based on the Library (independent of
+the use of the Library in a tool for writing it). Whether that is true depends
+on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and disclaimer
+of warranty; keep intact all the notices that refer to this License and to
+the absence of any warranty; and distribute a copy of this License along with
+the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you
+may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it,
+thus forming a work based on the Library, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all
+of these conditions:
+
+ a) The modified work must itself be a software library.
+
+b) You must cause the files modified to carry prominent notices stating that
+you changed the files and the date of any change.
+
+c) You must cause the whole of the work to be licensed at no charge to all
+third parties under the terms of this License.
+
+d) If a facility in the modified Library refers to a function or a table of
+data to be supplied by an application program that uses the facility, other
+than as an argument passed when the facility is invoked, then you must make
+a good faith effort to ensure that, in the event an application does not supply
+such function or table, the facility still operates, and performs whatever
+part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a purpose
+that is entirely well-defined independent of the application. Therefore, Subsection
+2d requires that any application-supplied function or table used by this function
+must be optional: if the application does not supply it, the square root function
+must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable
+sections of that work are not derived from the Library, and can be reasonably
+considered independent and separate works in themselves, then this License,
+and its terms, do not apply to those sections when you distribute them as
+separate works. But when you distribute the same sections as part of a whole
+which is a work based on the Library, the distribution of the whole must be
+on the terms of this License, whose permissions for other licensees extend
+to the entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise
+the right to control the distribution of derivative or collective works based
+on the Library.
+
+In addition, mere aggregation of another work not based on the Library with
+the Library (or with a work based on the Library) on a volume of a storage
+or distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License
+instead of this License to a given copy of the Library. To do this, you must
+alter all the notices that refer to this License, so that they refer to the
+ordinary GNU General Public License, version 2, instead of to this License.
+(If a newer version than version 2 of the ordinary GNU General Public License
+has appeared, then you can specify that version instead if you wish.) Do not
+make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy,
+so the ordinary GNU General Public License applies to all subsequent copies
+and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library
+into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of
+it, under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you accompany it with the complete corresponding
+machine-readable source code, which must be distributed under the terms of
+Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated
+place, then offering equivalent access to copy the source code from the same
+place satisfies the requirement to distribute the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but
+is designed to work with the Library by being compiled or linked with it,
+is called a "work that uses the Library". Such a work, in isolation, is not
+a derivative work of the Library, and therefore falls outside the scope of
+this License.
+
+However, linking a "work that uses the Library" with the Library creates an
+executable that is a derivative of the Library (because it contains portions
+of the Library), rather than a "work that uses the library". The executable
+is therefore covered by this License. Section 6 states terms for distribution
+of such executables.
+
+When a "work that uses the Library" uses material from a header file that
+is part of the Library, the object code for the work may be a derivative work
+of the Library even though the source code is not. Whether this is true is
+especially significant if the work can be linked without the Library, or if
+the work is itself a library. The threshold for this to be true is not precisely
+defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts
+and accessors, and small macros and small inline functions (ten lines or less
+in length), then the use of the object file is unrestricted, regardless of
+whether it is legally a derivative work. (Executables containing this object
+code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute
+the object code for the work under the terms of Section 6. Any executables
+containing that work also fall under Section 6, whether or not they are linked
+directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work
+that uses the Library" with the Library to produce a work containing portions
+of the Library, and distribute that work under terms of your choice, provided
+that the terms permit modification of the work for the customer's own use
+and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library
+is used in it and that the Library and its use are covered by this License.
+You must supply a copy of this License. If the work during execution displays
+copyright notices, you must include the copyright notice for the Library among
+them, as well as a reference directing the user to the copy of this License.
+Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source
+code for the Library including whatever changes were used in the work (which
+must be distributed under Sections 1 and 2 above); and, if the work is an
+executable linked with the Library, with the complete machine-readable "work
+that uses the Library", as object code and/or source code, so that the user
+can modify the Library and then relink to produce a modified executable containing
+the modified Library. (It is understood that the user who changes the contents
+of definitions files in the Library will not necessarily be able to recompile
+the application to use the modified definitions.)
+
+b) Use a suitable shared library mechanism for linking with the Library. A
+suitable mechanism is one that (1) uses at run time a copy of the library
+already present on the user's computer system, rather than copying library
+functions into the executable, and (2) will operate properly with a modified
+version of the library, if the user installs one, as long as the modified
+version is interface-compatible with the version that the work was made with.
+
+c) Accompany the work with a written offer, valid for at least three years,
+to give the same user the materials specified in Subsection 6a, above, for
+a charge no more than the cost of performing this distribution.
+
+d) If distribution of the work is made by offering access to copy from a designated
+place, offer equivalent access to copy the above specified materials from
+the same place.
+
+e) Verify that the user has already received a copy of these materials or
+that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must
+include any data and utility programs needed for reproducing the executable
+from it. However, as a special exception, the materials to be distributed
+need not include anything that is normally distributed (in either source or
+binary form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component itself
+accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of
+other proprietary libraries that do not normally accompany the operating system.
+Such a contradiction means you cannot use both them and the Library together
+in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side
+in a single library together with other library facilities not covered by
+this License, and distribute such a combined library, provided that the separate
+distribution of the work based on the Library and of the other library facilities
+is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the
+Library, uncombined with any other library facilities. This must be distributed
+under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that part of
+it is a work based on the Library, and explaining where to find the accompanying
+uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library
+except as expressly provided under this License. Any attempt otherwise to
+copy, modify, sublicense, link with, or distribute the Library is void, and
+will automatically terminate your rights under this License. However, parties
+who have received copies, or rights, from you under this License will not
+have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed
+it. However, nothing else grants you permission to modify or distribute the
+Library or its derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or distributing the Library
+(or any work based on the Library), you indicate your acceptance of this License
+to do so, and all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library),
+the recipient automatically receives a license from the original licensor
+to copy, distribute, link with or modify the Library subject to these terms
+and conditions. You may not impose any further restrictions on the recipients'
+exercise of the rights granted herein. You are not responsible for enforcing
+compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement
+or for any other reason (not limited to patent issues), conditions are imposed
+on you (whether by court order, agreement or otherwise) that contradict the
+conditions of this License, they do not excuse you from the conditions of
+this License. If you cannot distribute so as to satisfy simultaneously your
+obligations under this License and any other pertinent obligations, then as
+a consequence you may not distribute the Library at all. For example, if a
+patent license would not permit royalty-free redistribution of the Library
+by all those who receive copies directly or indirectly through you, then the
+only way you could satisfy both it and this License would be to refrain entirely
+from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents
+or other property right claims or to contest validity of any such claims;
+this section has the sole purpose of protecting the integrity of the free
+software distribution system which is implemented by public license practices.
+Many people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose
+that choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain
+countries either by patents or by copyrighted interfaces, the original copyright
+holder who places the Library under this License may add an explicit geographical
+distribution limitation excluding those countries, so that distribution is
+permitted only in or among countries not thus excluded. In such case, this
+License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of
+the Lesser General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to address
+new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies
+a version number of this License which applies to it and "any later version",
+you have the option of following the terms and conditions either of that version
+or of any later version published by the Free Software Foundation. If the
+Library does not specify a license version number, you may choose any version
+ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs
+whose distribution conditions are incompatible with these, write to the author
+to ask for permission. For software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we sometimes make exceptions
+for this. Our decision will be guided by the two goals of preserving the free
+status of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
+"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
+THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
+OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
+OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
+OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
+HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Libraries
+
+If you develop a new library, and you want it to be of the greatest possible
+use to the public, we recommend making it free software that everyone can
+redistribute and change. You can do so by permitting redistribution under
+these terms (or, alternatively, under the terms of the ordinary General Public
+License).
+
+To apply these terms, attach the following notices to the library. It is safest
+to attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the "copyright"
+line and a pointer to where the full notice is found.
+
+<one line to give the library's name and an idea of what it does.>
+
+Copyright (C) <year> <name of author>
+
+This library is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2.1 of the License, or (at your option)
+any later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this library; if not, write to the Free Software Foundation, Inc., 51
+Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the library, if necessary. Here
+is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+
+the library `Frob' (a library for tweaking knobs) written
+
+by James Random Hacker.
+
+< signature of Ty Coon > , 1 April 1990
+
+Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire-base.bb b/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire-base.bb
new file mode 100644
index 000000000..6237dcf80
--- /dev/null
+++ b/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire-base.bb
@@ -0,0 +1,17 @@
+SUMMARY = "PipeWire Media Server Base"
+DESCRIPTION = "The set of packages required to use PipeWire API in AGL"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-pipewire-base \
+ "
+
+RDEPENDS:${PN} += "\
+ pipewire-spa-plugins-meta \
+ pipewire-modules-meta \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'pipewire-tools pipewire-spa-tools alsa-utils', '', d)} \
+ pipewire-alsa \
+ pipewire-alsa-card-profile \
+"
diff --git a/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb b/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb
new file mode 100644
index 000000000..e7ad14258
--- /dev/null
+++ b/meta-pipewire/recipes-core/packagegroups/packagegroup-pipewire.bb
@@ -0,0 +1,24 @@
+SUMMARY = "PipeWire Media Server"
+DESCRIPTION = "The set of packages required to use PipeWire in AGL"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-pipewire \
+ packagegroup-pipewire-tools \
+ "
+
+RDEPENDS:${PN} += "\
+ pipewire \
+ pipewire-modules-meta \
+ pipewire-spa-plugins-meta \
+ pipewire-alsa \
+ gstreamer1.0-pipewire \
+ wireplumber \
+"
+
+RDEPENDS:${PN}-tools += "\
+ pipewire-tools \
+ pipewire-spa-tools \
+" \ No newline at end of file
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch
new file mode 100644
index 000000000..45d09e6b0
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire/0001-systemd-Do-not-override-rootprefix.patch
@@ -0,0 +1,35 @@
+From 2501972518a67b1710998452d164cd077a4370f1 Mon Sep 17 00:00:00 2001
+From: Scott Murray <scott.murray@konsulko.com>
+Date: Thu, 17 Mar 2022 10:44:00 -0400
+Subject: [PATCH] systemd: Do not override rootprefix
+
+Do not override rootprefix with the value of prefix when querying
+systemdsystemunitdir from the systemd pkgconfig, as doing so forces
+the assumption that the system is running with usrmerge, which may
+not be the case. Instead, rely on the systemd.pc correctly
+representing the desired install locations.
+
+Reworked version of change in:
+
+https://git.automotivelinux.org/AGL/meta-agl/tree/meta-pipewire/recipes-multimedia/pipewire/pipewire/0012-Miscellanous-changes-to-account-for-lower-version-of.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ src/daemon/systemd/system/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/daemon/systemd/system/meson.build b/src/daemon/systemd/system/meson.build
+index 84ca0b068..6956f2be3 100644
+--- a/src/daemon/systemd/system/meson.build
++++ b/src/daemon/systemd/system/meson.build
+@@ -1,4 +1,4 @@
+-systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir', pkgconfig_define : [ 'rootprefix', prefix])
++systemd_system_services_dir = systemd.get_variable('systemdsystemunitdir')
+ if get_option('systemd-system-unit-dir') != ''
+ systemd_system_services_dir = get_option('systemd-system-unit-dir')
+ endif
+--
+2.35.1
+
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb
new file mode 100644
index 000000000..6fa851caa
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bb
@@ -0,0 +1,329 @@
+# This recipe was written by Carlos Rafael Giani <crg7475@mailbox.org>
+# for meta-oe
+#
+# The intention is to keep this synced with meta-oe and remove it when we
+# can depend on meta-oe to provide this recipe for us
+#
+# AGL-specific overrides and configuration should go in the .bbappend file
+#
+SUMMARY = "Multimedia processing server for Linux"
+DESCRIPTION = "Linux server for handling and routing audio and video streams between applications and multimedia I/O devices"
+HOMEPAGE = "https://pipewire.org/"
+BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/pipewire/issues"
+LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-or-later"
+
+LIC_FILES_CHKSUM = " \
+ file://LICENSE;md5=2158739e172e58dc9ab1bdd2d6ec9c72 \
+ file://COPYING;md5=97be96ca4fab23e9657ffa590b931c1a \
+"
+SECTION = "multimedia"
+
+DEPENDS = "dbus"
+
+# v1.0.0(El Presidente)
+SRCREV = "4debdcd40b055b3eaa83a8f4443aa990ea566bfe"
+SRC_URI = "git://gitlab.freedesktop.org/pipewire/pipewire.git;branch=master;protocol=https"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig systemd manpages gettext useradd
+
+USERADD_PACKAGES = "${PN}"
+
+GROUPADD_PARAM:${PN} = "--system pipewire"
+
+USERADD_PARAM:${PN} = "--system --home / --no-create-home \
+ --comment 'PipeWire multimedia daemon' \
+ --gid pipewire --groups audio,video \
+ pipewire"
+
+# For "EVL", look up https://evlproject.org/ . It involves
+# a specially prepared kernel, and is currently unavailable
+# in Yocto.
+#
+# FFmpeg and Vulkan aren't really supported - at the current
+# stage (version 0.3.22), these are just experiments, not
+# actual features.
+#
+# libcamera support currently does not build successfully.
+#
+# systemd user service files are disabled because per-user
+# PipeWire instances aren't really something that makes
+# much sense in an embedded environment. A system-wide
+# instance does.
+#
+# manpage generation requires xmltoman, which is not available.
+#
+# Dont build any session managers along with pipewire
+# wireplumber is the session manger used in AGL and it will
+# be build in a different recipe
+#
+EXTRA_OEMESON += " \
+ -Daudiotestsrc=enabled \
+ -Devl=disabled \
+ -Dsystemd-user-service=disabled \
+ -Dtests=disabled \
+ -Dudevrulesdir=${nonarch_base_libdir}/udev/rules.d/ \
+ -Dvideotestsrc=enabled \
+ -Dffmpeg=disabled \
+ -Dvulkan=disabled \
+ -Dlibcamera=disabled \
+ -Dman=disabled \
+ -Dsession-managers=[] \
+"
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa systemd', d)} \
+ gstreamer jack v4l2 \
+"
+
+# "jack" and "pipewire-jack" packageconfigs cannot be both enabled,
+# since "jack" imports libjack, and "pipewire-jack" generates
+# libjack.so* files, thus colliding with the libpack package. This
+# is why these two are marked in their respective packageconfigs
+# as being in conflict.
+
+PACKAGECONFIG[alsa] = "-Dalsa=enabled,-Dalsa=disabled,alsa-lib udev,,pipewire-alsa-card-profile"
+PACKAGECONFIG[bluez] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc"
+PACKAGECONFIG[docs] = "-Ddocs=enabled,-Ddocs=disabled,doxygen-native"
+PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
+PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack,,,pipewire-jack"
+PACKAGECONFIG[sdl2] = "-Dsdl2=enabled,-Dsdl2=disabled,virtual/libsdl2"
+PACKAGECONFIG[sndfile] = "-Dsndfile=enabled,-Dsndfile=disabled,libsndfile1"
+PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=enabled ,-Dsystemd=disabled -Dsystemd-system-service=disabled,systemd"
+PACKAGECONFIG[v4l2] = "-Dv4l2=enabled,-Dv4l2=disabled,udev"
+PACKAGECONFIG[pipewire-alsa] = "-Dpipewire-alsa=enabled,-Dpipewire-alsa=disabled,alsa-lib"
+PACKAGECONFIG[pipewire-jack] = "-Dpipewire-jack=enabled -Dlibjack-path=${libdir}/${PW_MODULE_SUBDIR}/jack,-Dpipewire-jack=disabled,jack,,,jack"
+PACKAGECONFIG[pipewire-v4l2] = "-Dpipewire-v4l2=enabled -Dpipewire-v4l2=${libdir}/${PW_MODULE_SUBDIR}/v4l2,-Dpipewire-v4l2=disabled,v4l2"
+
+PACKAGESPLITFUNCS:prepend = " split_dynamic_packages "
+PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends "
+PACKAGESPLITFUNCS:append = " fixup_dynamic_pkg_licenses "
+
+SPA_SUBDIR = "spa-0.2"
+PW_MODULE_SUBDIR = "pipewire-0.3"
+
+remove_unused_installed_files() {
+ # jack.conf is used by pipewire-jack (not the JACK SPA plugin).
+ # Remove it if pipewire-jack is not built to avoid creating the
+ # pipewire-jack package.
+ if ${@bb.utils.contains('PACKAGECONFIG', 'pipewire-jack', 'false', 'true', d)}; then
+ rm -f "${D}${datadir}/pipewire/jack.conf"
+ fi
+}
+
+do_install[postfuncs] += "remove_unused_installed_files"
+
+python fixup_dynamic_pkg_licenses () {
+ #dynamic packages inherit currently whatever is specified in LICENSE (thus multiple)
+ packages = (d.getVar('PACKAGES') or "").split()
+
+ for pkg in packages:
+ # we manually assign the LICENSES here to cover all packages (even dynamically created ones)
+ d.setVar("LICENSE:" + pkg ,"MIT")
+
+ # next handle special cases
+ # ==> LICENSE:${PN}-spa-plugins-alsa = "LGPL-2.1-or-later"
+ if "pipewire-spa-plugins-alsa" in pkg:
+ d.setVar("LICENSE:pipewire-spa-plugins-alsa", "LGPL-2.1-or-later")
+ # ==> LICENSE:${PN}-alsa-card-profile = "LGPL-2.1-or-later"
+ if "pipewire-alsa-card-profile" in pkg:
+ d.setVar("LICENSE:pipewire-alsa-card-profile", "LGPL-2.1-or-later")
+ # ==> LICENSE:${PN}-jack = "GPL-2.0-only"
+ if "pipewire-jack" in pkg:
+ d.setVar("LICENSE:pipewire-jack", "GPL-2.0-only")
+}
+
+python split_dynamic_packages () {
+ # Create packages for each SPA plugin. These plugins are located
+ # in individual subdirectories, so a recursive search is needed.
+ spa_libdir = d.expand('${libdir}/${SPA_SUBDIR}')
+ do_split_packages(d, spa_libdir, r'^libspa-(.*)\.so$', d.expand('${PN}-spa-plugins-%s'), 'PipeWire SPA plugin for %s', extra_depends='', recursive=True)
+
+ # Create packages for each PipeWire module.
+ pw_module_libdir = d.expand('${libdir}/${PW_MODULE_SUBDIR}')
+ do_split_packages(d, pw_module_libdir, r'^libpipewire-module-(.*)\.so$', d.expand('${PN}-modules-%s'), 'PipeWire %s module', extra_depends='', recursive=False)
+}
+
+python set_dynamic_metapkg_rdepends () {
+ import os
+ import oe.utils
+
+ # Go through all generated SPA plugin and PipeWire module packages
+ # (excluding the main package and the -meta package itself) and
+ # add them to the -meta package as RDEPENDS.
+
+ base_pn = d.getVar('PN')
+
+ spa_pn = base_pn + '-spa-plugins'
+ spa_metapkg = spa_pn + '-meta'
+
+ pw_module_pn = base_pn + '-modules'
+ pw_module_metapkg = pw_module_pn + '-meta'
+
+ d.setVar('ALLOW_EMPTY:' + spa_metapkg, "1")
+ d.setVar('FILES:' + spa_metapkg, "")
+
+ d.setVar('ALLOW_EMPTY:' + pw_module_metapkg, "1")
+ d.setVar('FILES:' + pw_module_metapkg, "")
+
+ blacklist = [ spa_pn, spa_metapkg, pw_module_pn, pw_module_metapkg ]
+ spa_metapkg_rdepends = []
+ pw_module_metapkg_rdepends = []
+ pkgdest = d.getVar('PKGDEST')
+
+ for pkg in oe.utils.packages_filter_out_system(d):
+ if pkg in blacklist:
+ continue
+
+ is_spa_pkg = pkg.startswith(spa_pn)
+ is_pw_module_pkg = pkg.startswith(pw_module_pn)
+ if not is_spa_pkg and not is_pw_module_pkg:
+ continue
+
+ if pkg in spa_metapkg_rdepends or pkg in pw_module_metapkg_rdepends:
+ continue
+
+ # See if the package is empty by looking at the contents of its
+ # PKGDEST subdirectory. If this subdirectory is empty, then then
+ # package is empty as well. Empty packages do not get added to
+ # the meta package's RDEPENDS.
+ pkgdir = os.path.join(pkgdest, pkg)
+ if os.path.exists(pkgdir):
+ dir_contents = os.listdir(pkgdir) or []
+ else:
+ dir_contents = []
+ is_empty = len(dir_contents) == 0
+ if not is_empty:
+ if is_spa_pkg:
+ spa_metapkg_rdepends.append(pkg)
+ if is_pw_module_pkg:
+ pw_module_metapkg_rdepends.append(pkg)
+
+ d.setVar('RDEPENDS:' + spa_metapkg, ' '.join(spa_metapkg_rdepends))
+ d.setVar('DESCRIPTION:' + spa_metapkg, spa_pn + ' meta package')
+
+ d.setVar('RDEPENDS:' + pw_module_metapkg, ' '.join(pw_module_metapkg_rdepends))
+ d.setVar('DESCRIPTION:' + pw_module_metapkg, pw_module_pn + ' meta package')
+}
+
+PACKAGES =+ "\
+ libpipewire \
+ ${PN}-tools \
+ ${PN}-pulse \
+ ${PN}-alsa \
+ ${PN}-jack \
+ ${PN}-v4l2 \
+ ${PN}-spa-plugins \
+ ${PN}-spa-plugins-meta \
+ ${PN}-spa-tools \
+ ${PN}-modules \
+ ${PN}-modules-meta \
+ ${PN}-alsa-card-profile \
+ gstreamer1.0-pipewire \
+"
+
+PACKAGES_DYNAMIC = "^${PN}-spa-plugins.* ^${PN}-modules.*"
+
+SYSTEMD_SERVICE:${PN} = "pipewire.service"
+CONFFILES:${PN} += "${datadir}/pipewire/pipewire.conf"
+FILES:${PN} = " \
+ ${datadir}/pipewire/pipewire.conf \
+ ${datadir}/pipewire/filter-chain.conf \
+ ${datadir}/pipewire/filter-chain \
+ ${systemd_user_unitdir}/pipewire.* \
+ ${systemd_system_unitdir}/pipewire* \
+ ${bindir}/pipewire \
+ ${datadir}/pipewire/pipewire-avb.conf \
+ ${bindir}/pipewire-avb \
+ ${datadir}/pipewire/pipewire-aes67.conf \
+ ${bindir}/pipewire-aes67 \
+ ${datadir}/pipewire/pipewire.conf.avail \
+ ${datadir}/pipewire/pipewire-pulse.conf.avail \
+ ${datadir}/pipewire/client-rt.conf.avail \
+ ${datadir}/pipewire/client.conf.avail \
+ ${sysconfdir}/security/limits.d \
+"
+
+FILES:${PN}-dev += " \
+ ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so \
+"
+
+CONFFILES:libpipewire += "${datadir}/pipewire/client.conf"
+FILES:libpipewire = " \
+ ${datadir}/pipewire/client.conf \
+ ${datadir}/pipewire/client-rt.conf \
+ ${datadir}/pipewire/minimal.conf \
+ ${libdir}/libpipewire-*.so.* \
+"
+# Add the bare minimum modules and plugins required to be able
+# to use libpipewire. Without these, it is essentially unusable.
+RDEPENDS:libpipewire += " \
+ ${PN}-modules-client-node \
+ ${PN}-modules-protocol-native \
+ ${PN}-spa-plugins-support \
+"
+
+FILES:${PN}-tools = " \
+ ${bindir}/pw-* \
+"
+
+# This is a shim daemon that is intended to be used as a
+# drop-in PulseAudio replacement, providing a pulseaudio-compatible
+# socket that can be used by applications that use libpulse.
+CONFFILES:${PN}-pulse += "${datadir}/pipewire/pipewire-pulse.conf"
+
+FILES:${PN}-pulse = " \
+ ${datadir}/pipewire/pipewire-pulse.conf \
+ ${systemd_user_unitdir}/pipewire-pulse.* \
+ ${bindir}/pipewire-pulse \
+"
+RDEPENDS:${PN}-pulse += " \
+ ${PN}-modules-protocol-pulse \
+"
+
+# alsa plugin to redirect audio to pipewire
+FILES:${PN}-alsa = "\
+ ${libdir}/alsa-lib/* \
+ ${datadir}/alsa/alsa.conf.d/* \
+"
+
+#lib to emulate v4l2 system calls on top of PipeWire
+FILES:${PN}-v4l2 = "\
+ ${libdir}/${PW_MODULE_SUBDIR}/v4l2/libpw-v4l2.so \
+"
+
+# jack drop-in libraries to redirect audio to pipewire
+CONFFILES:${PN}-jack = "${datadir}/pipewire/jack.conf"
+FILES:${PN}-jack = "\
+ ${datadir}/pipewire/jack.conf \
+ ${libdir}/${PW_MODULE_SUBDIR}/jack/libjack*.so.* \
+"
+# Dynamic packages (see set_dynamic_metapkg_rdepends).
+FILES:${PN}-spa-plugins-bluez5 += " \
+ ${datadir}/${SPA_SUBDIR}/bluez5/bluez-hardware.conf \
+"
+RRECOMMENDS:${PN}-spa-plugins += "${PN}-spa-plugins-meta"
+
+FILES:${PN}-spa-tools = " \
+ ${bindir}/spa-* \
+"
+
+# Dynamic packages (see set_dynamic_metapkg_rdepends).
+FILES:${PN}-modules = ""
+RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"
+
+CONFFILES:${PN}-modules-rtkit = "${datadir}/pipewire/client-rt.conf"
+FILES:${PN}-modules-rtkit += " \
+ ${datadir}/pipewire/client-rt.conf \
+ "
+
+FILES:${PN}-alsa-card-profile = " \
+ ${datadir}/alsa-card-profile/* \
+ ${nonarch_base_libdir}/udev/rules.d/90-pipewire-alsa.rules \
+"
+
+FILES:gstreamer1.0-pipewire = " \
+ ${libdir}/gstreamer-1.0/* \
+"
diff --git a/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend
new file mode 100644
index 000000000..beb7c0817
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/pipewire/pipewire_1.0.0.bbappend
@@ -0,0 +1,25 @@
+SRC_URI += "\
+ file://0001-systemd-Do-not-override-rootprefix.patch \
+"
+
+PACKAGECONFIG = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa pipewire-alsa', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'sndfile', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ gstreamer v4l2 \
+"
+
+do_install:append() {
+ # install symlinks to alsalib configuration files
+ for i in 50-pipewire.conf 99-pipewire-default.conf; do
+ if [ -f ${D}${datadir}/alsa/alsa.conf.d/${i} ]; then
+ install -d ${D}${sysconfdir}/alsa/conf.d
+ ln -s ${datadir}/alsa/alsa.conf.d/${i} ${D}${sysconfdir}/alsa/conf.d/${i}
+ fi
+ done
+}
+
+FILES:${PN}-alsa:append = "\
+ ${sysconfdir}/alsa/conf.d/* \
+"
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/00-functions.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/00-functions.lua
new file mode 100644
index 000000000..7e1794df0
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/00-functions.lua
@@ -0,0 +1,27 @@
+components = {}
+
+function load_module(m)
+ if not components[m] then
+ components[m] = { "libwireplumber-module-" .. m, type = "module" }
+ end
+end
+
+function load_pw_module(m)
+ if not components[m] then
+ components[m] = { "libpipewire-module-" .. m, type = "pw_module" }
+ end
+end
+
+function load_script(s, a)
+ if not components[s] then
+ components[s] = { s, type = "script/lua", args = a }
+ end
+end
+
+function load_monitor(s, a)
+ load_script("monitors/" .. s .. ".lua", a)
+end
+
+function load_access(s, a)
+ load_script("access/access-" .. s .. ".lua", a)
+end
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/alsa-suspend.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/alsa-suspend.lua
new file mode 100644
index 000000000..55edd12cf
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/alsa-suspend.lua
@@ -0,0 +1,45 @@
+-- WirePlumber
+--
+-- This script mutes all ALSA sinks when the "suspend.playback" metadata
+-- key is set to 1; compliments pipewire-ic-ipc and the respective support
+-- for handling "suspend.playback" in the policy scripts
+--
+-- Copyright © 2021 Collabora Ltd.
+-- @author George Kiagiadakis <george.kiagiadakis@collabora.com>
+--
+-- SPDX-License-Identifier: MIT
+
+mixer_api = Plugin.find("mixer-api")
+
+nodes_om = ObjectManager {
+ Interest { type = "node",
+ Constraint { "media.class", "matches", "Audio/Sink" },
+ Constraint { "object.path", "matches", "alsa:pcm:*" },
+ },
+}
+
+metadata_om = ObjectManager {
+ Interest { type = "metadata",
+ Constraint { "metadata.name", "=", "default" },
+ }
+}
+
+metadata_om:connect("object-added", function (om, metadata)
+ metadata:connect("changed", function (m, subject, key, t, value)
+ if key == "suspend.playback" then
+ local suspended = (value == "1")
+
+ Log.info(string.format("%s ALSA nodes for IC sound",
+ suspended and "muting" or "unmuting"))
+
+ for n in nodes_om:iterate() do
+ mixer_api:call("set-volume", n["bound-id"], {
+ ["mute"] = suspended,
+ })
+ end
+ end
+ end)
+end)
+
+nodes_om:activate()
+metadata_om:activate()
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.conf b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.conf
new file mode 100644
index 000000000..9077e3f45
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.conf
@@ -0,0 +1,74 @@
+# WirePlumber daemon context configuration #
+
+context.properties = {
+ ## Properties to configure the PipeWire context and some modules
+
+ application.name = "WirePlumber Bluetooth"
+ log.level = 2
+ wireplumber.script-engine = lua-scripting
+ wireplumber.export-core = true
+
+ #mem.mlock-all = false
+ #support.dbus = true
+}
+
+context.spa-libs = {
+ #<factory-name regex> = <library-name>
+ #
+ # Used to find spa factory names. It maps an spa factory name
+ # regular expression to a library name that should contain
+ # that factory.
+ #
+ api.bluez5.* = bluez5/libspa-bluez5
+ audio.convert.* = audioconvert/libspa-audioconvert
+ support.* = support/libspa-support
+}
+
+context.modules = [
+ #{ name = <module-name>
+ # [ args = { <key> = <value> ... } ]
+ # [ flags = [ [ ifexists ] [ nofail ] ]
+ #}
+ #
+ # PipeWire modules to load.
+ # If ifexists is given, the module is ignored when it is not found.
+ # If nofail is given, module initialization failures are ignored.
+ #
+
+ # The native communication protocol.
+ { name = libpipewire-module-protocol-native }
+
+ # Allows creating nodes that run in the context of the
+ # client. Is used by all clients that want to provide
+ # data to PipeWire.
+ { name = libpipewire-module-client-node }
+
+ # Allows creating devices that run in the context of the
+ # client. Is used by the session manager.
+ { name = libpipewire-module-client-device }
+
+ # Makes a factory for wrapping nodes in an adapter with a
+ # converter and resampler.
+ { name = libpipewire-module-adapter }
+
+ # Allows applications to create metadata objects. It creates
+ # a factory for Metadata objects.
+ { name = libpipewire-module-metadata }
+
+ # Provides factories to make session manager objects.
+ { name = libpipewire-module-session-manager }
+]
+
+wireplumber.components = [
+ #{ name = <component-name>, type = <component-type> }
+ #
+ # WirePlumber components to load
+ #
+
+ # The lua scripting engine
+ { name = libwireplumber-module-lua-scripting, type = module }
+
+ # The lua configuration file
+ # Other components are loaded from there
+ { name = bluetooth.lua, type = config/lua }
+]
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
new file mode 100644
index 000000000..530f4cc62
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/bluetooth.lua.d/30-bluez-monitor.lua
@@ -0,0 +1,110 @@
+-- Bluez monitor config file --
+
+bluez_monitor = {}
+
+bluez_monitor.properties = {
+ -- These features do not work on all headsets, so they are enabled
+ -- by default based on the hardware database. They can also be
+ -- forced on/off for all devices by the following options:
+
+ --["bluez5.enable-sbc-xq"] = true,
+ --["bluez5.enable-msbc"] = true,
+ --["bluez5.enable-hw-volume"] = true,
+
+ -- See bluez-hardware.conf for the hardware database.
+
+ -- Enabled headset roles (default: [ hsp_hs hfp_ag ]), this
+ -- property only applies to native backend. Currently some headsets
+ -- (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag
+ -- enabled, disable either hsp_ag or hfp_ag to work around it.
+ --
+ -- Supported headset roles: hsp_hs (HSP Headset),
+ -- hsp_ag (HSP Audio Gateway),
+ -- hfp_hf (HFP Hands-Free),
+ -- hfp_ag (HFP Audio Gateway)
+ ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]",
+
+ -- Enabled A2DP codecs (default: all).
+ --["bluez5.codecs"] = "[ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ]",
+
+ -- HFP/HSP backend (default: native).
+ -- Available values: any, none, hsphfpd, ofono, native
+ ["bluez5.hfphsp-backend"] = "ofono",
+
+ -- Properties for the A2DP codec configuration
+ --["bluez5.default.rate"] = 48000,
+ --["bluez5.default.channels"] = 2,
+}
+
+bluez_monitor.rules = {
+ -- An array of matches/actions to evaluate.
+ {
+ -- Rules for matching a device or node. It is an array of
+ -- properties that all need to match the regexp. If any of the
+ -- matches work, the actions are executed for the object.
+ matches = {
+ {
+ -- This matches all cards.
+ { "device.name", "matches", "bluez_card.*" },
+ },
+ },
+ -- Apply properties on the matched object.
+ apply_properties = {
+ -- Auto-connect device profiles on start up or when only partial
+ -- profiles have connected. Disabled by default if the property
+ -- is not specified.
+ --["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]",
+ ["bluez5.auto-connect"] = "[ hfp_hf hsp_hs a2dp_sink ]",
+
+ -- Hardware volume control (default: [ hfp_ag hsp_ag a2dp_source ])
+ --["bluez5.hw-volume"] = "[ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]",
+
+ -- LDAC encoding quality
+ -- Available values: auto (Adaptive Bitrate, default)
+ -- hq (High Quality, 990/909kbps)
+ -- sq (Standard Quality, 660/606kbps)
+ -- mq (Mobile use Quality, 330/303kbps)
+ --["bluez5.a2dp.ldac.quality"] = "auto",
+
+ -- AAC variable bitrate mode
+ -- Available values: 0 (cbr, default), 1-5 (quality level)
+ --["bluez5.a2dp.aac.bitratemode"] = 0,
+
+ -- Profile connected first
+ -- Available values: a2dp-sink (default), headset-head-unit
+ --["device.profile"] = "a2dp-sink",
+ },
+ },
+ {
+ -- Make output hsp/hfp stream nodes go through the Communication endpoint
+ -- Unfortunately we cannot match on "media.class" because this property
+ -- is not known before the node is created
+ matches = {
+ {
+ { "api.bluez5.profile", "equals", "headset-audio-gateway" },
+ { "factory.name", "matches", "*source*" },
+ },
+ },
+ apply_properties = {
+ ["media.role"] = "Communication",
+ },
+ },
+ {
+ -- Make output a2dp stream nodes go through the Multimedia endpoint
+ -- Unfortunately we cannot match on "media.class" because this property
+ -- is not known before the node is created
+ matches = {
+ {
+ { "api.bluez5.profile", "equals", "a2dp-source" },
+ },
+ },
+ apply_properties = {
+ ["media.role"] = "Multimedia",
+ },
+ },
+}
+
+load_monitor("bluez", {
+ properties = bluez_monitor.properties,
+ rules = bluez_monitor.rules,
+})
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-alsa-monitor.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-alsa-monitor.lua
new file mode 100644
index 000000000..d07f7ab85
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-alsa-monitor.lua
@@ -0,0 +1,151 @@
+-- ALSA monitor config file --
+
+alsa_monitor = {}
+
+alsa_monitor.properties = {
+ ["alsa.jack-device"] = false,
+ ["alsa.reserve"] = false,
+}
+
+alsa_monitor.rules = {
+ -- enable ACP (PulseAudio-like profiles)
+ {
+ matches = {
+ {
+ { "device.name", "matches", "alsa_card.*" },
+ },
+ },
+ apply_properties = {
+ ["api.alsa.use-acp"] = true,
+ },
+ },
+
+ --
+ -- Bump priority of well-known output devices
+ -- Higher priority means it gets selected as the default if it's present
+ --
+
+ -- USB card
+ {
+ matches = {
+ {
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.card.driver", "=", "USB-Audio" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 1300,
+ ["priority.session"] = 1300,
+ }
+ },
+
+ -- fiberdyne amp
+ {
+ matches = {
+ {
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.card.id", "=", "ep016ch" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 1200,
+ ["priority.session"] = 1200,
+ }
+ },
+
+ -- well-known internal devices
+ {
+ matches = {
+ {
+ -- ak4613
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.card.id", "=", "ak4613" },
+ { "api.alsa.pcm.device", "=", "0" },
+ },
+ {
+ -- imx8mq
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.card.id", "=", "wm8524audio" },
+ },
+ {
+ -- rcarsound
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.card.id", "=", "rcarsound" },
+ { "api.alsa.pcm.device", "=", "0" },
+ },
+ {
+ -- rpi3
+ { "node.name", "matches", "alsa_output.*" },
+ { "api.alsa.pcm.name", "=", "bcm2835 ALSA" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 1100,
+ ["priority.session"] = 1100,
+ }
+ },
+
+ --
+ -- Same for input devices
+ --
+
+ -- USB card
+ {
+ matches = {
+ {
+ { "node.name", "matches", "alsa_input.*" },
+ { "api.alsa.card.driver", "=", "USB-Audio" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 2300,
+ ["priority.session"] = 2300,
+ }
+ },
+
+ -- microchip mic
+ {
+ matches = {
+ {
+ { "node.name", "matches", "alsa_input.*" },
+ { "api.alsa.card.id", "=", "ep811ch" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 2200,
+ ["priority.session"] = 2200,
+ }
+ },
+
+ -- well-known internal devices
+ {
+ matches = {
+ {
+ -- ak4613
+ { "node.name", "matches", "alsa_input.*" },
+ { "api.alsa.card.id", "=", "ak4613" },
+ },
+ {
+ -- imx8mq
+ { "node.name", "matches", "alsa_input.*" },
+ { "api.alsa.card.id", "=", "wm8524audio" },
+ },
+ {
+ -- rcarsound
+ { "node.name", "matches", "alsa_input.*" },
+ { "api.alsa.card.id", "=", "rcarsound" },
+ },
+ },
+ apply_properties = {
+ ["priority.driver"] = 2100,
+ ["priority.session"] = 2100,
+ }
+ },
+}
+
+function alsa_monitor.enable()
+ load_monitor("alsa", {
+ properties = alsa_monitor.properties,
+ rules = alsa_monitor.rules,
+ })
+end
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-v4l2-monitor.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-v4l2-monitor.lua
new file mode 100644
index 000000000..a4eb58ac8
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/30-v4l2-monitor.lua
@@ -0,0 +1,48 @@
+-- V4L2 monitor config file --
+
+v4l2_monitor = {}
+v4l2_monitor.properties = {}
+
+v4l2_monitor.rules = {
+ -- An array of matches/actions to evaluate.
+ {
+ -- Rules for matching a device or node. It is an array of
+ -- properties that all need to match the regexp. If any of the
+ -- matches work, the actions are executed for the object.
+ matches = {
+ {
+ -- This matches all cards.
+ { "device.name", "matches", "v4l2_device.*" },
+ },
+ },
+ -- Apply properties on the matched object.
+ apply_properties = {
+ -- ["device.nick"] = "My Device",
+ },
+ },
+ {
+ matches = {
+ {
+ -- Matches all sources.
+ { "node.name", "matches", "v4l2_input.*" },
+ },
+ {
+ -- Matches all sinks.
+ { "node.name", "matches", "v4l2_output.*" },
+ },
+ },
+ apply_properties = {
+ --["node.nick"] = "My Node",
+ --["priority.driver"] = 100,
+ --["priority.session"] = 100,
+ --["node.pause-on-idle"] = false,
+ },
+ },
+}
+
+function v4l2_monitor.enable()
+ load_monitor("v4l2", {
+ properties = v4l2_monitor.properties,
+ rules = v4l2_monitor.rules,
+ })
+end
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua
new file mode 100644
index 000000000..e0d332422
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/40-device-defaults.lua
@@ -0,0 +1,26 @@
+device_defaults = {}
+
+device_defaults.properties = {
+ -- store preferences to the file system and restore them at startup;
+ -- when set to false, default nodes and routes are selected based on
+ -- their priorities and any runtime changes do not persist after restart
+ ["use-persistent-storage"] = false,
+}
+
+function device_defaults.enable()
+ -- Selects appropriate default nodes and enables saving and restoring them
+ load_module("default-nodes", device_defaults.properties)
+
+ -- Selects appropriate default routes ("ports" in pulseaudio terminology)
+ -- and enables saving and restoring them together with
+ -- their properties (per-route/port volume levels, channel maps, etc)
+ load_script("policy-device-routes.lua", device_defaults.properties)
+
+ if device_defaults.properties["use-persistent-storage"] then
+ -- Enables functionality to save and restore default device profiles
+ load_module("default-profile")
+
+ -- Save and restore stream-specific properties
+ load_script("restore-stream.lua")
+ end
+end
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/90-enable-all.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/90-enable-all.lua
new file mode 100644
index 000000000..ecb7da476
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/host.lua.d/90-enable-all.lua
@@ -0,0 +1,20 @@
+-- Provide the "default" pw_metadata, which stores
+-- dynamic properties of pipewire objects in RAM
+load_module("metadata")
+
+-- Load devices
+alsa_monitor.enable()
+v4l2_monitor.enable()
+
+-- Track/store/restore user choices about devices
+device_defaults.enable()
+
+-- Automatically suspends idle nodes after 3 seconds
+load_script("suspend-node.lua")
+
+-- Automatically sets device profiles to 'On'
+load_script("policy-device-profile.lua")
+
+-- Mute ALSA sinks when requested by pipewire-ic-ipc
+load_module("mixer-api")
+load_script("alsa-suspend.lua")
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber-bluetooth.conf b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber-bluetooth.conf
new file mode 100644
index 000000000..950e6a5d2
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber-bluetooth.conf
@@ -0,0 +1,13 @@
+<!-- This configuration file specifies the required security policies
+ for wireplumber to talk to system bluetooth-related services. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <policy user="pipewire">
+ <allow send_destination="org.bluez"/>
+ <allow send_destination="org.ofono"/>
+ </policy>
+
+</busconfig>
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber.conf b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber.conf
new file mode 100644
index 000000000..46ad11302
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/wireplumber.conf
@@ -0,0 +1,115 @@
+# WirePlumber daemon context configuration #
+
+context.properties = {
+ ## Properties to configure the PipeWire context and some modules
+
+ # 1=error/critical/warning, 2=message, 3=info, 4=debug, 5=trace
+ log.level = 2
+
+ wireplumber.script-engine = lua-scripting
+}
+
+context.spa-libs = {
+ #<factory-name regex> = <library-name>
+ #
+ # Used to find spa factory names. It maps an spa factory name
+ # regular expression to a library name that should contain
+ # that factory.
+ #
+ api.alsa.* = alsa/libspa-alsa
+ api.bluez5.* = bluez5/libspa-bluez5
+ api.v4l2.* = v4l2/libspa-v4l2
+ api.libcamera.* = libcamera/libspa-libcamera
+ audio.convert.* = audioconvert/libspa-audioconvert
+ support.* = support/libspa-support
+}
+
+context.modules = [
+ #{ name = <module-name>
+ # [ args = { <key> = <value> ... } ]
+ # [ flags = [ [ ifexists ] [ nofail ] ]
+ #}
+ #
+ # PipeWire modules to load.
+ # If ifexists is given, the module is ignored when it is not found.
+ # If nofail is given, module initialization failures are ignored.
+ #
+
+ # The native communication protocol.
+ { name = libpipewire-module-protocol-native }
+
+ # Allows creating nodes that run in the context of the
+ # client. Is used by all clients that want to provide
+ # data to PipeWire.
+ { name = libpipewire-module-client-node }
+
+ # Allows creating devices that run in the context of the
+ # client. Is used by the session manager.
+ { name = libpipewire-module-client-device }
+
+ # Makes a factory for wrapping nodes in an adapter with a
+ # converter and resampler.
+ { name = libpipewire-module-adapter }
+
+ # Allows applications to create metadata objects. It creates
+ # a factory for Metadata objects.
+ { name = libpipewire-module-metadata }
+
+ # Provides factories to make session manager objects.
+ { name = libpipewire-module-session-manager }
+
+ { name = libpipewire-module-filter-chain
+ args = {
+ node.description = "Equalizer Sink"
+ media.name = "Equalizer Sink"
+ filter.graph = {
+ nodes = [
+ {
+ type = builtin
+ name = bass
+ label = bq_lowshelf
+ # the cut off freq of the bass filter can be adjusted here.
+ control = { "Freq" = 250.0 "Q" = 1.0 "Gain" = 0.0 }
+ }
+ {
+ type = builtin
+ name = treble
+ label = bq_peaking
+ # the cut off freq of the treble filter can be adjusted here.
+ control = { "Freq" = 6000.0 "Q" = 1.0 "Gain" = 0.0 }
+ }
+ ]
+ links = [
+ { output = "bass:Out" input = "treble:In" }
+ ]
+ }
+ audio.channels = 2
+ audio.position = [ FL FR ]
+ capture.props = {
+ node.name = "eq-sink"
+ media.class = Audio/Sink
+ # select the endpoint to which the node is attached
+ target.endpoint = "endpoint.multimedia"
+ node.passive = true
+ }
+ playback.props = {
+ node.name = "eq-output-stream"
+ node.passive = true
+ }
+ }
+ }
+]
+
+wireplumber.components = [
+ #{ name = <component-name>, type = <component-type> }
+ #
+ # WirePlumber components to load
+ #
+
+ # The lua scripting engine
+ { name = libwireplumber-module-lua-scripting, type = module }
+
+ # The lua configuration file(s)
+ # Other components are loaded from there
+ { name = host.lua, type = config/lua }
+]
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl_git.bb
new file mode 100644
index 000000000..22ffe5bf3
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl_git.bb
@@ -0,0 +1,61 @@
+SUMMARY = "AGL configuration file for wireplumber"
+HOMEPAGE = "https://gitlab.freedesktop.org/gkiagia/wireplumber"
+BUGTRACKER = "https://jira.automotivelinux.org"
+AUTHOR = "George Kiagiadakis <george.kiagiadakis@collabora.com>"
+SECTION = "multimedia"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+SRC_URI = "\
+ file://bluetooth.lua.d/ \
+ file://host.lua.d/ \
+ file://00-functions.lua \
+ file://alsa-suspend.lua \
+ file://bluetooth.conf \
+ file://wireplumber.conf \
+ file://wireplumber-bluetooth.conf \
+"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install:append() {
+ config_dir="${D}${sysconfdir}/wireplumber/"
+ scripts_dir="${D}${datadir}/wireplumber/scripts/"
+ dbus_config_dir="${D}${sysconfdir}/dbus-1/system.d/"
+ systemd_dir="${D}${sysconfdir}/systemd/system/pipewire.service.wants/"
+
+ install -d ${config_dir}
+ install -m 0644 ${WORKDIR}/00-functions.lua ${config_dir}
+
+ # config of the main (host) instance
+ install -d ${config_dir}/host.lua.d/
+ ln -s ../00-functions.lua ${config_dir}/host.lua.d/00-functions.lua
+ install -m 0644 ${WORKDIR}/host.lua.d/*.lua ${config_dir}/host.lua.d/
+ install -m 0644 ${WORKDIR}/wireplumber.conf ${config_dir}
+
+ # config of the bluetooth instance
+ install -d ${config_dir}/bluetooth.lua.d/
+ ln -s ../00-functions.lua ${config_dir}/bluetooth.lua.d/00-functions.lua
+ install -m 0644 ${WORKDIR}/bluetooth.lua.d/*.lua ${config_dir}/bluetooth.lua.d/
+ install -m 0644 ${WORKDIR}/bluetooth.conf ${config_dir}
+
+ # install the alsa-suspend script, loaded by the main instance
+ install -d ${scripts_dir}
+ install -m 0644 ${WORKDIR}/alsa-suspend.lua ${scripts_dir}
+
+ # install dbus daemon configuration
+ install -d ${dbus_config_dir}
+ install -m 0644 ${WORKDIR}/wireplumber-bluetooth.conf ${dbus_config_dir}
+
+ # enable additional systemd services
+ install -d ${systemd_dir}
+ ln -s ${systemd_system_unitdir}/wireplumber@.service ${systemd_dir}/wireplumber@bluetooth.service
+}
+
+FILES:${PN} += "\
+ ${sysconfdir}/* \
+ ${datadir}/wireplumber/* \
+"
+CONFFILES:${PN} += "\
+ ${sysconfdir}/* \
+"
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/00-functions.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/00-functions.lua
new file mode 100644
index 000000000..7e1794df0
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/00-functions.lua
@@ -0,0 +1,27 @@
+components = {}
+
+function load_module(m)
+ if not components[m] then
+ components[m] = { "libwireplumber-module-" .. m, type = "module" }
+ end
+end
+
+function load_pw_module(m)
+ if not components[m] then
+ components[m] = { "libpipewire-module-" .. m, type = "pw_module" }
+ end
+end
+
+function load_script(s, a)
+ if not components[s] then
+ components[s] = { s, type = "script/lua", args = a }
+ end
+end
+
+function load_monitor(s, a)
+ load_script("monitors/" .. s .. ".lua", a)
+end
+
+function load_access(s, a)
+ load_script("access/access-" .. s .. ".lua", a)
+end
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.conf b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.conf
new file mode 100644
index 000000000..42f714849
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.conf
@@ -0,0 +1,73 @@
+# WirePlumber daemon context configuration #
+
+context.properties = {
+ ## Properties to configure the PipeWire context and some modules
+
+ application.name = "WirePlumber Policy"
+ log.level = 2
+ wireplumber.script-engine = lua-scripting
+ wireplumber.export-core = false
+
+ #mem.mlock-all = false
+ #support.dbus = true
+}
+
+context.spa-libs = {
+ #<factory-name regex> = <library-name>
+ #
+ # Used to find spa factory names. It maps an spa factory name
+ # regular expression to a library name that should contain
+ # that factory.
+ #
+ audio.convert.* = audioconvert/libspa-audioconvert
+ support.* = support/libspa-support
+}
+
+context.modules = [
+ #{ name = <module-name>
+ # [ args = { <key> = <value> ... } ]
+ # [ flags = [ [ ifexists ] [ nofail ] ]
+ #}
+ #
+ # PipeWire modules to load.
+ # If ifexists is given, the module is ignored when it is not found.
+ # If nofail is given, module initialization failures are ignored.
+ #
+
+ # The native communication protocol.
+ { name = libpipewire-module-protocol-native }
+
+ # Allows creating nodes that run in the context of the
+ # client. Is used by all clients that want to provide
+ # data to PipeWire.
+ { name = libpipewire-module-client-node }
+
+ # Allows creating devices that run in the context of the
+ # client. Is used by the session manager.
+ { name = libpipewire-module-client-device }
+
+ # Makes a factory for wrapping nodes in an adapter with a
+ # converter and resampler.
+ { name = libpipewire-module-adapter }
+
+ # Allows applications to create metadata objects. It creates
+ # a factory for Metadata objects.
+ { name = libpipewire-module-metadata }
+
+ # Provides factories to make session manager objects.
+ { name = libpipewire-module-session-manager }
+]
+
+wireplumber.components = [
+ #{ name = <component-name>, type = <component-type> }
+ #
+ # WirePlumber components to load
+ #
+
+ # The lua scripting engine
+ { name = libwireplumber-module-lua-scripting, type = module }
+
+ # The lua configuration file
+ # Other components are loaded from there
+ { name = policy.lua, type = config/lua }
+]
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.lua.d/10-default-policy.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.lua.d/10-default-policy.lua
new file mode 100644
index 000000000..6814fce4d
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl/policy.lua.d/10-default-policy.lua
@@ -0,0 +1,137 @@
+-- Policy config file --
+
+policy_config = {}
+
+policy_config.endpoints = {
+ -- [endpoint name] = { endpoint properties }
+ ["endpoint.capture"] = {
+ ["media.class"] = "Audio/Source",
+ ["role"] = "Capture",
+ },
+ ["endpoint.multimedia"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Multimedia",
+ },
+ ["endpoint.speech_low"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Speech-Low",
+ },
+ ["endpoint.custom_low"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Custom-Low",
+ },
+ ["endpoint.navigation"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Navigation",
+ },
+ ["endpoint.speech_high"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Speech-High",
+ },
+ ["endpoint.custom_high"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Custom-High",
+ },
+ ["endpoint.communication"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Communication",
+ },
+ ["endpoint.emergency"] = {
+ ["media.class"] = "Audio/Sink",
+ ["role"] = "Emergency",
+ },
+}
+
+policy_config.policy = {
+ ["move"] = false, -- moves session items when metadata target.node changes
+ ["follow"] = true, -- moves session items to the default device when it has changed
+
+ -- Set to 'true' to disable channel splitting & merging on nodes and enable
+ -- passthrough of audio in the same format as the format of the device.
+ -- Note that this breaks JACK support; it is generally not recommended
+ ["audio.no-dsp"] = false,
+
+ -- how much to lower the volume of lower priority streams when ducking
+ -- note that this is a linear volume modifier (not cubic as in pulseaudio)
+ ["duck.level"] = 0.2,
+
+ ["roles"] = {
+ ["Capture"] = {
+ ["alias"] = { "Multimedia", "Music", "Voice", "Capture" },
+ ["priority"] = 25,
+ ["action.default"] = "cork",
+ ["action.Capture"] = "mix",
+ ["media.class"] = "Audio/Source",
+ },
+ ["Multimedia"] = {
+ ["alias"] = { "Movie", "Music", "Game" },
+ ["priority"] = 25,
+ ["action.default"] = "mix",
+ },
+ ["Speech-Low"] = {
+ ["priority"] = 30,
+ ["action.default"] = "cork",
+ ["action.Speech-Low"] = "mix",
+ },
+ ["Custom-Low"] = {
+ ["priority"] = 35,
+ ["action.default"] = "cork",
+ ["action.Custom-Low"] = "mix",
+ },
+ ["Navigation"] = {
+ ["priority"] = 50,
+ ["action.default"] = "duck",
+ ["action.Navigation"] = "mix",
+ },
+ ["Speech-High"] = {
+ ["priority"] = 60,
+ ["action.default"] = "cork",
+ ["action.Speech-High"] = "mix",
+ },
+ ["Custom-High"] = {
+ ["priority"] = 65,
+ ["action.default"] = "cork",
+ ["action.Custom-High"] = "mix",
+ },
+ ["Communication"] = {
+ ["priority"] = 75,
+ ["action.default"] = "cork",
+ ["action.Communication"] = "mix",
+ },
+ ["Emergency"] = {
+ ["alias"] = { "Alert" },
+ ["priority"] = 99,
+ ["action.default"] = "cork",
+ ["action.Emergency"] = "mix",
+ },
+ },
+}
+
+-- Session item factories, building blocks for the session management graph
+-- Do not disable these unless you really know what you are doing
+load_module("si-node")
+load_module("si-audio-adapter")
+load_module("si-standard-link")
+load_module("si-audio-endpoint")
+
+-- API to access default nodes from scripts
+load_module("default-nodes-api")
+
+-- API to access mixer controls, needed for volume ducking
+load_module("mixer-api")
+
+-- Create endpoints statically at startup
+load_script("static-endpoints.lua", policy_config.endpoints)
+
+-- Create session items for nodes that appear in the graph
+load_script("create-item.lua", policy_config.policy)
+
+-- Link nodes to each other to make media flow in the graph
+load_script("policy-node.lua", policy_config.policy)
+
+-- Link client nodes with endpoints to make media flow in the graph
+load_script("policy-endpoint-client.lua", policy_config.policy)
+load_script("policy-endpoint-client-links.lua", policy_config.policy)
+
+-- Link endpoints with device nodes to make media flow in the graph
+load_script("policy-endpoint-device.lua", policy_config.policy)
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bb
new file mode 100644
index 000000000..1a031160e
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-policy-config-agl_git.bb
@@ -0,0 +1,41 @@
+SUMMARY = "AGL configuration file for wireplumber policy"
+HOMEPAGE = "https://gitlab.freedesktop.org/gkiagia/wireplumber"
+BUGTRACKER = "https://jira.automotivelinux.org"
+AUTHOR = "Ashok Sidipotu <ashok.sidipotu@collabora.com>"
+SECTION = "multimedia"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+SRC_URI = "\
+ file://policy.lua.d \
+ file://00-functions.lua \
+ file://policy.conf \
+"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install:append() {
+ config_dir="${D}${sysconfdir}/wireplumber/"
+ systemd_dir="${D}${sysconfdir}/systemd/system/pipewire.service.wants"
+
+ install -d ${config_dir}
+ install -m 0644 ${WORKDIR}/00-functions.lua ${config_dir}
+
+ # config of the policy instance
+ install -d ${config_dir}/policy.lua.d/
+ ln -s ../00-functions.lua ${config_dir}/policy.lua.d/00-functions.lua
+ install -m 0644 ${WORKDIR}/policy.lua.d/*.lua ${config_dir}/policy.lua.d/
+ install -m 0644 ${WORKDIR}/policy.conf ${config_dir}
+
+ # enable additional systemd services
+ install -d ${systemd_dir}
+ ln -s ${systemd_system_unitdir}/wireplumber@.service ${systemd_dir}/wireplumber@policy.service
+}
+
+FILES:${PN} += "\
+ ${sysconfdir}/* \
+ ${datadir}/wireplumber/* \
+"
+CONFFILES:${PN} += "\
+ ${sysconfdir}/* \
+"
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
new file mode 100644
index 000000000..a04f115c3
--- /dev/null
+++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
@@ -0,0 +1,85 @@
+SUMMARY = "Session / Policy Manager for PipeWire"
+HOMEPAGE = "https://gitlab.freedesktop.org/pipewire/wireplumber"
+BUGTRACKER = "https://gitlab.freedesktop.org/pipewire/wireplumber/issues"
+AUTHOR = "George Kiagiadakis <george.kiagiadakis@collabora.com>"
+SECTION = "multimedia"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=3;md5=e8ad01a5182f2c1b3a2640e9ea268264"
+
+inherit meson pkgconfig systemd
+
+DEPENDS = "glib-2.0 glib-2.0-native pipewire lua"
+
+SRC_URI = "\
+ git://gitlab.freedesktop.org/pipewire/wireplumber.git;protocol=https;branch=master \
+"
+# v0.4.17
+SRCREV = "d3eb77b292655cef333a8f4cab4e861415bc37c2"
+
+# patches to be able to compile with lower version of meson that is available in AGL.
+SRC_URI += "\
+"
+
+PV = "0.4.17"
+S = "${WORKDIR}/git"
+
+WPAPI="0.4"
+
+# use shared lua from the system instead of the static bundled one
+EXTRA_OEMESON += "-Dsystem-lua=true"
+
+# introspection in practice is only used for generating API docs
+# API docs are available on the website and we don't need to build them
+# (plus they depend on hotdoc which is not available here)
+EXTRA_OEMESON += "-Dintrospection=disabled -Ddoc=disabled"
+
+PACKAGECONFIG = "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+"
+
+PACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemd-system-service=true -Dsystemd-user-service=false,-Dsystemd=disabled -Dsystemd-system-service=false -Dsystemd-user-service=false,systemd"
+
+do_configure:prepend() {
+ # relax meson version requirement
+ # we only need 0.54 when building with -Dsystem-lua=false
+ sed "s/meson_version : '>= 0.56.0'/meson_version : '>= 0.53.2'/" ${S}/meson.build > ${S}/tmp.build
+ mv -f ${S}/tmp.build ${S}/meson.build
+}
+
+PACKAGES =+ "\
+ lib${PN}-${WPAPI} \
+ ${PN}-config \
+"
+
+SYSTEMD_SERVICE:${PN} = "wireplumber.service"
+FILES:${PN} = "\
+ ${bindir}/wireplumber \
+ ${bindir}/wpctl \
+ ${bindir}/wpexec \
+ ${libdir}/wireplumber-${WPAPI}/* \
+ ${datadir}/wireplumber/scripts/* \
+ ${datadir}/zsh/* \
+ ${systemd_system_unitdir}/* \
+"
+
+FILES:lib${PN}-${WPAPI} = "\
+ ${libdir}/libwireplumber-${WPAPI}.so.* \
+"
+
+FILES:${PN}-config += "\
+ ${sysconfdir}/wireplumber/* \
+ ${datadir}/wireplumber/*conf \
+ ${datadir}/wireplumber/common/* \
+ ${datadir}/wireplumber/main.lua.d/* \
+ ${datadir}/wireplumber/bluetooth.lua.d/* \
+ ${datadir}/wireplumber/policy.lua.d/* \
+"
+do_install:append() {
+ rm -rf ${D}${sysconfdir}/wireplumber/
+ rm -f ${D}${datadir}/wireplumber/*conf
+ rm -rf ${D}${datadir}/wireplumber/common
+ rm -rf ${D}${datadir}/wireplumber/main.lua.d
+ rm -rf ${D}${datadir}/wireplumber/bluetooth.lua.d
+ rm -rf ${D}${datadir}/wireplumber/policy.lua.d
+}
diff --git a/meta-pipewire/scripts/run-yocto-check-layer.sh b/meta-pipewire/scripts/run-yocto-check-layer.sh
new file mode 100755
index 000000000..0e911a145
--- /dev/null
+++ b/meta-pipewire/scripts/run-yocto-check-layer.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we cannot import the distro config right away
+# as the initial values are poky only till the layer
+# is added in
+
+AGL_DEFAULT_DISTRO_FEATURES = "usrmerge largefile opengl wayland pam bluetooth bluez5 3g polkit"
+DISTRO_FEATURES:append = " systemd wayland pam \${AGL_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+EOF
+
+yocto-check-layer --no-auto-dependency \
+ --dependency \
+ $AGLROOT/external/meta-openembedded/meta-oe \
+ -- \
+ $AGLROOT/meta-agl/meta-pipewire
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl
+
+exit 0
diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash
index 48af0fbe6..3d380e69d 100755
--- a/scripts/.aglsetup_genconfig.bash
+++ b/scripts/.aglsetup_genconfig.bash
@@ -4,7 +4,7 @@
#
# The MIT License (MIT)
#
-# Copyright (c) 2016 Stéphane Desneux <sdx@iot.bzh>
+# Copyright (c) 2016-2019 Stéphane Desneux <sdx@iot.bzh>
# (c) 2016 Jan-Simon Möller <jsmoeller@linuxfoundation.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -27,15 +27,16 @@
#
################################################################################
-# this script shouldn't be called directly, but through aglsetup.sh that will in
-# turn execute (source) generated instructions back in the parent shell,
+# this script shouldn't be called directly, but through aglsetup.sh that will in
+# turn execute (source) generated instructions back in the parent shell,
# whether it's bash, zsh, or any other supported shell
-VERSION=1.1.0
+VERSION=1.2.0
DEFAULT_MACHINE=qemux86-64
DEFAULT_BUILDDIR=./build
VERBOSE=0
-DEBUG=0
+SHOWVERSION=0
+: ${DEBUG:=false}
#SCRIPT=$(basename $BASH_SOURCE)
SCRIPT=aglsetup.sh
@@ -46,16 +47,16 @@ function info() { echo "$@" >&2; }
function infon() { echo -n "$@" >&2; }
function error() { echo "ERROR: $@" >&2; return 1; }
function verbose() { [[ $VERBOSE == 1 ]] && echo "$@" >&2; return 0; }
-function debug() { [[ $DEBUG == 1 ]] && echo "DEBUG: $@" >&2; return 0;}
+function debug() { $DEBUG && echo "DEBUG: $@" >&2; return 0;}
-info "------------ $SCRIPT: Starting"
+debug "------------ $SCRIPT: starting with command line arguments: $@"
#compute AGL_REPOSITORIES
-AGL_REPOSITORIES=$(for x in $(ls -d $METADIR/*/templates/{machine,feature}); do echo $(basename $(dirname $(dirname $x))); done | sort -u)
+AGL_REPOSITORIES=$(for x in $(ls -d $METADIR/meta-*/templates/{machine,feature} $METADIR/bsp/*/templates/machine 2>/dev/null); do echo $(basename $(dirname $(dirname $x))); done | sort -u)
function list_machines() {
- for x in $@; do
- for y in $(ls -d $METADIR/$x/templates/machine/* 2>/dev/null); do
+ for a in $@; do
+ for y in $(ls -d $METADIR/{.,bsp}/$a/templates/machine/* 2>/dev/null); do
echo $(basename $y)
done
done
@@ -78,7 +79,7 @@ function validate_machines() {
list_all_machines | sort | uniq -c | while read cnt machine; do
[[ $cnt == 1 ]] && continue
info "Machine $machine found in the following repositories:"
- for x in $(ls -d $METADIR/*/templates/machine/$machine); do
+ for x in $(ls -d $METADIR/*/templates/machine/$machine $METADIR/bsp/*/templates/machine/$machine 2>/dev/null); do
info " - $x"
done
error "Multiple machine templates are not allowed"
@@ -104,7 +105,7 @@ function validate_features() {
list_all_features | sort | uniq -c | while read cnt feature; do
[[ $cnt == 1 ]] && continue;
info "Feature $feature found in the following repositories:"
- for x in $(ls -d $METADIR/*/templates/feature/$feature); do
+ for x in $(ls -d $METADIR/*/templates/feature/$feature 2>/dev/null); do
info " - $x"
done
error "Multiple feature templates are not allowed"
@@ -115,8 +116,10 @@ function validate_features() {
function find_machine_dir() {
machine=$1
for x in $AGL_REPOSITORIES; do
- dir=$METADIR/$x/templates/machine/$machine
- [[ -d $dir ]] && { echo $dir; return 0; }
+ dirs=$(ls -d $METADIR/{.,bsp}/$x/templates/machine/$machine 2>/dev/null)
+ for dir in $dirs; do
+ [[ -d $dir ]] && { echo $dir; return 0; }
+ done
done
return 1
}
@@ -150,24 +153,44 @@ Options:
-f|--force
flag to force overwriting any existing configuration
default: false
+ -r|--rpm-revision <schema>
+ Specify how to handle RPM packages revisions
+ <schema> can be:
+ 'prservice[:<address>]' : Use a PR service daemon.
+ if <address> is not specified, the default value 'localhost:0'
+ is used (shortcut for a PR service started by bitbake)
+ 'timestamp' : Use a generated time stamp (UTC).
+ 'value:<revision>' : Use <revision> explicitly.
+ 'none' : Do nothing.
+ -t|--topic <value>
+ Specify an optional topic for this setup.
+ If specified, the topic will be propagated in build manifests:
+ - in deployment dir: tmp/deploy/images/*/build-info
+ - in target image: /etc/platform-info/build
+ - in SDK: tmp/deploy/sdk/*.build-info
-v|--verbose
verbose mode
default: false
+ -V|--version
+ display version, set AGLSETUP_VERSION variable with version value and exit
-d|--debug
debug mode
+ for early debug, set env variable DEBUG.
+ for example:
+ DEBUG=true source aglsetup.sh -V
default: false
-h|--help
get some help
EOF
local buf
-
+
echo "Available machines:" >&2
for x in $AGL_REPOSITORIES; do
buf=$(list_machines $x)
[[ -z "$buf" ]] && continue
echo " [$x]"
- for y in $buf; do
+ for y in $buf; do
[[ $y == $DEFAULT_MACHINE ]] && def="* " || def=" "
echo " $def$y"
done
@@ -200,21 +223,22 @@ function append_fragment() {
echo >>$basefile
echo "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #" >>$basefile
echo "# fragment { " >>$basefile
- [[ -f $f ]] && echo "# $f" >>$basefile || true
+ [[ -n $f ]] && echo "# $f" >>$basefile || true
echo "#" >>$basefile
[[ -n "$label" ]] && echo "$label" >>$basefile
- [[ -f $f ]] && cat $f >>$basefile || true
+ [[ -n $f ]] && cat $f >>$basefile || true
+ echo "" >>$basefile
echo "#" >>$basefile
echo "# }" >>$basefile
echo "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #" >>$basefile
- [[ -f $f ]] && echo $f >>$BUILDDIR/conf/fragments.log || true
+ [[ -n $f ]] && echo $f >>$BUILDDIR/conf/fragments.log || true
}
function execute_setup() {
script=$1
debug "Executing script $script"
- opts=
- [[ $DEBUG == 1 ]] && opts="$opts -x"
+ opts="-e"
+ $DEBUG && opts="$opts -x"
pushd $BUILDDIR &>/dev/null
$BASH $opts $script \
&& rc=0 \
@@ -281,7 +305,7 @@ function find_feature_dependency() {
GLOBAL_ARGS=( "$@" )
debug "Parsing arguments: $@"
-TEMP=$(getopt -o m:b:s:fvdh --long machine:,builddir:,script:,force,verbose,debug,help -n $SCRIPT -- "$@")
+TEMP=$(getopt -o m:b:r:t:s:fvVdh --long machine:,builddir:,rpm-revision:,topic:,script:,force,verbose,version,debug,help -n $SCRIPT -- "$@")
[[ $? != 0 ]] && { usage; exit 1; }
eval set -- "$TEMP"
@@ -292,23 +316,47 @@ MACHINE=$DEFAULT_MACHINE
BUILDDIR=$DEFAULT_BUILDDIR
SETUPSCRIPT=
FORCE=
+RPMREVISION=
+TOPIC=
+SETUP_MANIFEST=aglsetup.manifest
while true; do
case "$1" in
- -m|--machine) MACHINE=$2; shift 2;;
- -b|--builddir) BUILDDIR=$2; shift 2;;
- -s|--setupscript) SETUPSCRIPT=$2; shift 2;;
- -f|--force) FORCE=1; shift;;
- -v|--verbose) VERBOSE=1; shift;;
- -d|--debug) VERBOSE=1; DEBUG=1; shift;;
- -h|--help) HELP=1; shift;;
- --) shift; break;;
+ -m|--machine) MACHINE=$2; shift 2;;
+ -b|--builddir) BUILDDIR=$2; shift 2;;
+ -s|--setupscript) SETUPSCRIPT=$2; shift 2;;
+ -f|--force) FORCE=1; shift;;
+ -r|--rpm-revision) RPMREVISION=$2; shift 2;;
+ -t|--topic) TOPIC=$2; shift 2;;
+ -v|--verbose) VERBOSE=1; shift;;
+ -V|--version) SHOWVERSION=1; shift;;
+ -d|--debug) VERBOSE=1; DEBUG=true; shift;;
+ -h|--help) HELP=1; shift;;
+ --) shift; break;;
*) error "Arguments parsing error"; exit 1;;
esac
done
[[ "$HELP" == 1 ]] && { usage; exit 0; }
+if [[ "$SHOWVERSION" == 1 ]]; then
+ # display version on stdout
+ echo "$VERSION"
+
+ # generate output script if requested by caller
+ if [[ -n "$SETUPSCRIPT" ]]; then
+ cat <<EOF >$SETUPSCRIPT
+AGLSETUP_VERSION=$VERSION
+EOF
+ fi
+
+ # IMPORTANT: exit successfully
+ # older aglsetup scripts with version <1.2.0 will fail with option --version
+ exit 0
+fi
+
+info "------------ $SCRIPT: Starting"
+
verbose "Command line arguments: ${GLOBAL_ARGS[@]}"
# the remaining args are the features
@@ -359,17 +407,18 @@ function genconfig() {
info " Features: $FEATURES"
# step 1: run usual OE setup to generate conf dir
- export TEMPLATECONF=$(cd $SCRIPTDIR/../templates/base && pwd -P)
+ export TEMPLATECONF=$(cd $SCRIPTDIR/../meta-agl-core/conf/templates/base && pwd -P)
debug "running oe-init-build-env with TEMPLATECONF=$TEMPLATECONF"
- info " Running $METADIR/poky/oe-init-build-env"
+ info " Running $METADIR/external/poky/oe-init-build-env"
info " Templates dir: $TEMPLATECONF"
CURDIR=$(pwd -P)
- . $METADIR/poky/oe-init-build-env $BUILDDIR >/dev/null
+ . $METADIR/external/poky/oe-init-build-env $BUILDDIR >/dev/null
cd $CURDIR
# step 2: concatenate other remaining fragments coming from base
- process_fragments $TEMPLATECONF
+ FRAGMENTS=$(cd $SCRIPTDIR/../templates/base && pwd -P)
+ process_fragments $FRAGMENTS
# step 3: fragments for machine
process_fragments $(find_machine_dir $MACHINE)
@@ -397,6 +446,12 @@ function genconfig() {
append_fragment $BUILDDIR/conf/local.conf $file
verbose " + $file"
done
+ # special fragment to call distro-manifest-generator.sh from
+ # meta-agl-profile-core/recipes-core/distro-build-manifest/distro-build-manifest.bb
+ append_fragment $BUILDDIR/conf/local.conf /dev/stdin "# generated by $(realpath $BASH_SOURCE)" <<-EOF
+ DISTRO_SETUP_MANIFEST = "$(realpath -Ls $BUILDDIR)/$SETUP_MANIFEST"
+ DISTRO_MANIFEST_GENERATOR = "$(dirname $(realpath $BASH_SOURCE))/distro-manifest-generator.sh"
+ EOF
FRAGMENTS_SETUP=$(sed 's/ /\n/g' <<<$FRAGMENTS_SETUP | sort)
debug "setup fragments: $FRAGMENTS_SETUP"
@@ -409,6 +464,8 @@ export MACHINE="$MACHINE"
export FEATURES="$FEATURES"
export BUILDDIR="$BUILDDIR"
export METADIR="$METADIR"
+export RPMREVISION="$RPMREVISION"
+export LOCALCONF="$BUILDDIR/conf/local.conf"
echo "--- beginning of setup script"
EOF
@@ -432,7 +489,6 @@ EOF
dump_log $BUILDDIR/conf/setup.log
return 1
}
- # NOTE: the setup.sh script is removed if execution succeeded (only the log remains)
}
###########################################################################################
@@ -441,13 +497,16 @@ EOF
[[ $FORCE -eq 1 ]] && rm -f \
$BUILDDIR/conf/local.conf \
$BUILDDIR/conf/bblayers.conf \
+ $BUILDDIR/conf/templateconf.cfg \
$BUILDDIR/conf/setup.* \
$BUILDDIR/conf/*.log
+####### step 1: generate configuration file #######
+
if [[ -f $BUILDDIR/conf/local.conf || -f $BUILDDIR/conf/bblayers.conf ]]; then
info "Configuration files already exist:"
for x in $BUILDDIR/conf/local.conf $BUILDDIR/conf/bblayers.conf; do
- [[ -f $x ]] && info " - $x"
+ [[ -f $x ]] && info " - $x"
done
info "Skipping configuration files generation."
info "Use option -f|--force to overwrite existing configuration."
@@ -455,21 +514,65 @@ else
genconfig
fi
+####### step 2: generate aglsetup.manifest #######
+
+infon "Generating setup manifest: $BUILDDIR/$SETUP_MANIFEST ... "
+for x in /etc/os-release /usr/lib/os-release; do
+ [[ -f $x ]] && . $x
+done
+FEATURES_md5=$(echo $FEATURES|md5sum -|awk '{print $1;}')
+cat <<EOF >$BUILDDIR/$SETUP_MANIFEST
+# ----------------------------------------------
+# This fragment has been generated by $SCRIPT at setup time
+
+# distro name
+DIST_DISTRO_NAME="AGL"
+
+# target machine as passed to $SCRIPT
+DIST_MACHINE="$MACHINE"
+
+# features as resolved by $SCRIPT
+DIST_FEATURES="$FEATURES"
+DIST_FEATURES_MD5="${FEATURES_md5}"
+
+# build host information deduced from os-release
+DIST_BUILD_HOST="$(id -un)@$(hostname -f || hostname || hostname -s)"
+DIST_BUILD_OS="${PRETTY_NAME:-${NAME} ${VERSION} [COMPUTED]}"
+
+# meta directory
+DIST_METADIR="$METADIR"
+
+# timestamp
+DIST_SETUP_TS="$(date -u +%Y%m%d_%H%M%S_%Z)"
+
+# topic
+DIST_SETUP_TOPIC="$TOPIC"
+
+# ------------ end of $SCRIPT fragment --------
+EOF
+info "OK"
+
+####### step 3: generate agl-init-build-env #######
+
# always generate setup script in builddir: it can be sourced later manually without re-running the setup
infon "Generating setup file: $BUILDDIR/agl-init-build-env ... "
+
cat <<EOF >$BUILDDIR/agl-init-build-env
-. $METADIR/poky/oe-init-build-env $BUILDDIR
+export TEMPLATECONF=${METADIR}/meta-agl/meta-agl-core/conf/templates/base
+. $METADIR/external/poky/oe-init-build-env $BUILDDIR
if [ -n "\$DL_DIR" ]; then
- BB_ENV_EXTRAWHITE="\$BB_ENV_EXTRAWHITE DL_DIR"
+ BB_ENV_PASSTHROUGH_ADDITIONS="\$BB_ENV_PASSTHROUGH_ADDITIONS DL_DIR"
fi
if [ -n "\$SSTATE_DIR" ]; then
- BB_ENV_EXTRAWHITE="\$BB_ENV_EXTRAWHITE SSTATE_DIR"
+ BB_ENV_PASSTHROUGH_ADDITIONS="\$BB_ENV_PASSTHROUGH_ADDITIONS SSTATE_DIR"
fi
-export BB_ENV_EXTRAWHITE
+export BB_ENV_PASSTHROUGH_ADDITIONS
unset TEMPLATECONF
EOF
info "OK"
+####### step 4: generate output script #######
+
# finally, generate output script if requested by caller
if [[ -n "$SETUPSCRIPT" ]]; then
debug "generating setupscript in $SETUPSCRIPT"
diff --git a/scripts/README-mkefi-agl.md b/scripts/README-mkefi-agl.md
deleted file mode 100644
index f415747d8..000000000
--- a/scripts/README-mkefi-agl.md
+++ /dev/null
@@ -1,16 +0,0 @@
-## Introduction
-This script will install the AGL distribution on a removable device to boot on Intel UEFI-based computer.
-
-In particular it can create a USB or SD bootable support for (MinnowBoard)[www.minnowboard.org].
-
-Usage:
-
- mkefi-agl.sh [-v] HDDIMG REMOVABLE_DEVICE
- -v: verbose debug
- HDDIMG: the hddimg file to generate the efi disk from
- REMOVABLE_DEVICE: the block device to write the image to, e.g. /dev/sdh
-
-Example: `mkefi-agl.sh agl-demo-platform-intel-corei7-64.hddimg /dev/sdd`
-
-## Documentation
-Additional documentation: https://wiki.automotivelinux.org/agl-distro/developer_resources_intel
diff --git a/scripts/aglsetup.sh b/scripts/aglsetup.sh
index b11a54196..3bb6e0cde 100644
--- a/scripts/aglsetup.sh
+++ b/scripts/aglsetup.sh
@@ -26,7 +26,7 @@
# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
SOURCED=0
-if [ -n "$ZSH_EVAL_CONTEXT" ]; then
+if [ -n "$ZSH_EVAL_CONTEXT" ]; then
[[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); }
elif [ -n "$KSH_VERSION" ]; then
[[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd $(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- ${.sh.file}) && pwd -P); }
@@ -37,9 +37,9 @@ fi
if [ $SOURCED -ne 1 ]; then
unset SOURCED
unset SOURCEDIR
- echo "Error: this script needs to be sourced in a supported shell" >&2
- echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
- return 1
+ echo "Error: this script needs to be sourced in a supported shell" >&2
+ echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
+ exit 56
else
unset SOURCED
tmpfile=$(mktemp /tmp/aglsetup.XXXXXXXX)
diff --git a/scripts/ci-yocto-check-layer.sh b/scripts/ci-yocto-check-layer.sh
new file mode 100755
index 000000000..c22114356
--- /dev/null
+++ b/scripts/ci-yocto-check-layer.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+pushd .
+
+pushd meta-agl-core
+./scripts/run-yocto-check-layer.sh
+popd
+
+pushd meta-netboot
+./scripts/run-yocto-check-layer.sh
+popd
+
+pushd meta-pipewire
+./scripts/run-yocto-check-layer.sh
+popd
+
+pushd meta-app-framework
+./scripts/run-yocto-check-layer.sh
+popd
+
+popd \ No newline at end of file
diff --git a/scripts/distro-manifest-generator.sh b/scripts/distro-manifest-generator.sh
new file mode 100755
index 000000000..0db3e132f
--- /dev/null
+++ b/scripts/distro-manifest-generator.sh
@@ -0,0 +1,310 @@
+#!/usr/bin/env bash
+
+################################################################################
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2018 Stéphane Desneux <sdx@iot.bzh>
+#
+# 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 above copyright notice and this permission notice 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.
+#
+################################################################################
+
+mode=deploy
+manifest=
+verbose=0
+format=bash
+sourcefile=
+timestamp="$(date -u +%Y%m%d_%H%M%S_%Z)"
+
+function info() { echo "$@" >&2; }
+function error() { echo "$BASH_SOURCE: $@" >&2; }
+function out() { echo -n "$@"; }
+function out_object() {
+ # expected stdin stream is:
+ # --------------
+ # key
+ # value
+ # key
+ # value
+ # ...
+ # --------------
+ local sep=""
+ local k
+ case $format in
+ bash)
+ while read x; do
+ [[ -z "$k" ]] && { k="$x"; continue; }
+ out "$sep${k}="
+ out_value "$x"
+ sep=$'\n'
+ k=
+ done
+ out "$sep"
+ ;;
+ json)
+ out "{"
+ while read x; do
+ [[ -z "$k" ]] && { k="$x"; continue; }
+ out "$sep\"${k}\":"
+ out_value "$x"
+ sep=","
+ k=
+ done
+ out "}"
+ ;;
+ esac
+}
+
+function out_array() {
+ # expected stdin stream is:
+ # --------------
+ # value
+ # value
+ # ...
+ # --------------
+ local sep=""
+ case $format in
+ bash)
+ while read x; do
+ out "$sep"
+ out_value "$x"
+ sep=" "
+ done
+ ;;
+ json)
+ out "["
+ while read x; do
+ out $sep
+ out_value "$x"
+ sep=","
+ done
+ out "]"
+ ;;
+ esac
+}
+
+function out_value() {
+ # string
+ # number
+ # object
+ # array
+ # 'true'
+ # 'false'
+ # 'null'
+
+ x=$1
+
+ # litterals
+ if [[ "$x" =~ ^(true|false|null)$ ]]; then
+ out "$x"
+ # number
+ elif [[ "$x" =~ ^[+-]?[0-9]+(\.[0-9]+)?$ ]]; then
+ out "$x"
+ # object
+ elif [[ "$x" =~ ^\{.*\}$ ]]; then
+ out "$x"
+ # array
+ elif [[ "$x" =~ ^\[.*\]$ ]]; then
+ out "$x"
+ # string
+ else
+ out "\"$(sed 's/\("\)/\\\1/g' <<<$x)\""
+ fi
+}
+
+function out_comment() {
+ case $format in
+ bash)
+ [[ "$verbose" == 1 ]] && echo "# $@" || true
+ ;;
+ json)
+ ;;
+ esac
+}
+
+function _getgitmanifest() {
+ # this function takes the setup.manifest generated by setup script and uses DIST_METADIR
+ # to analyze git repos
+
+ local manifest=$1 mode=$2
+ [[ -f $manifest ]] && source $manifest || { error "Invalid setup manifest '$manifest'"; return 1; }
+ [[ ! -d "$DIST_METADIR" ]] && {
+ error "Invalid meta directory. Check variable DIST_METADIR in manifest file '$manifest'."
+ error "$BASH_SOURCE: Also, check directory '$DIST_METADIR'."
+ return 2
+ }
+ local GIT=$(which git) REALPATH=$(which realpath)
+ [[ ! -x $GIT ]] && { error "$BASH_SOURCE: Unable to find git command in $PATH."; return 3; }
+ [[ ! -x $REALPATH ]] && { error "$BASH_SOURCE: Unable to find realpath command in $PATH."; return 4; }
+
+ local gitrepo gitrev metagitdir sep=""
+ DIST_LAYERS=""
+ for metagitdir in $(find $DIST_METADIR -maxdepth 2 -type d \( -not -path '*/.*' \) -exec test -d "{}/.git" \; -print -prune); do
+ gitrepo=$($REALPATH -Ls $metagitdir --relative-to=$DIST_METADIR)
+ pushd $DIST_METADIR/$gitrepo &>/dev/null && {
+ gitrev=$( { $GIT describe --long --dirty --always 2>/dev/null || echo "unknown_revision"; } | tr ' \t' '__' )
+ popd &>/dev/null
+ } || {
+ gitrev=unknown
+ }
+ DIST_LAYERS="${DIST_LAYERS}${sep}${gitrepo}:${gitrev}"
+ sep=" "
+ done
+
+ # layers checksum
+ DIST_LAYERS_MD5=$(echo $DIST_LAYERS|md5sum -|awk '{print $1;}')
+
+ # in json, transform layers in an object, features in array
+ [[ "$format" == "json" ]] && {
+ DIST_FEATURES=$(for x in $DIST_FEATURES; do
+ echo $x
+ done | out_array)
+ DIST_LAYERS=$(for x in $DIST_LAYERS; do
+ echo ${x%%:*}
+ echo ${x#*:}
+ done | out_object)
+ }
+
+
+ # compute build hash
+ DIST_BUILD_HASH="F${DIST_FEATURES_MD5:0:8}-L${DIST_LAYERS_MD5:0:8}"
+ DIST_BUILD_ID="${DIST_DISTRO_NAME}-${DIST_MACHINE}-F${DIST_FEATURES_MD5:0:8}-L${DIST_LAYERS_MD5:0:8}"
+
+
+ # compute setup manifest path and build TS
+ DIST_SETUP_MANIFEST="$($REALPATH $manifest)"
+
+ # Manifest build timestamp
+ DIST_BUILD_TS="$timestamp"
+
+ # build topic from setup topic
+ DIST_BUILD_TOPIC="${DIST_SETUP_TOPIC}"
+
+ # what to retain from setup manifest?
+ # to generate the full list: cat setup.manifest | grep = | cut -f1 -d"=" | awk '{printf("%s ",$1);}'
+ declare -A SETUP_VARS
+ SETUP_VARS[deploy]="DIST_MACHINE DIST_FEATURES DIST_FEATURES_MD5 DIST_BUILD_HOST DIST_BUILD_OS DIST_SETUP_TS"
+ SETUP_VARS[target]="DIST_MACHINE DIST_FEATURES"
+ SETUP_VARS[sdk]="DIST_MACHINE DIST_FEATURES"
+
+ # extra vars not coming from setup.manifest but generated here
+ declare -A EXTRA_VARS
+ EXTRA_VARS[deploy]="DIST_SETUP_MANIFEST DIST_BUILD_TS DIST_LAYERS DIST_LAYERS_MD5 DIST_BUILD_HASH DIST_BUILD_ID DIST_BUILD_TOPIC"
+ EXTRA_VARS[target]="DIST_LAYERS DIST_BUILD_HASH DIST_BUILD_ID DIST_BUILD_TS DIST_BUILD_TOPIC"
+ EXTRA_VARS[sdk]="DIST_LAYERS DIST_BUILD_HASH DIST_BUILD_ID DIST_BUILD_TS DIST_BUILD_TOPIC"
+
+ # BITBAKE_VARS may be defined from external file to source (--source arg)
+ # this is used to dump extra vars from inside bitbake recipe
+
+ { for x in ${SETUP_VARS[$mode]} ${EXTRA_VARS[$mode]} ${BITBAKE_VARS[$mode]}; do
+ k=$x
+ [[ "$format" == "json" ]] && {
+ k=${k#DIST_} # remove prefix
+ k=${k,,*} # to lower case
+ }
+ echo $k
+ echo ${!x}
+ done } | out_object
+}
+
+function getmanifest() {
+ local rc=0
+ out_comment "DISTRO BUILD MANIFEST"
+ out_comment
+
+ # add layers manifest
+ out_comment "----- this fragment has been generated by $BASH_SOURCE"
+ _getgitmanifest $1 $2 || rc=$?
+ out_comment "------------ end of $BASH_SOURCE fragment --------"
+
+ return $rc
+}
+
+function __usage() {
+ cat <<EOF >&2
+Usage: $BASH_SOURCE [-v|--verbose] [-f|--format <fmt>] [-t|--timestamp <value>] [-m|--mode <mode>] [-s|--source <file>] <setup_manifest_file>
+ Options:
+ -v|--verbose: generate comments in the output file
+ -s|--source: extra file to source (get extra variables generated from bitbake recipe)
+ -t|--timestamp: set build timestamp (default: current date - may not be the same ts as bitbake)
+ -f|--format: specify output format: 'bash' or 'json'
+ -m|--mode: specify the destination for the generated manifest
+ 'deploy' : for the tmp/deploy/images/* directories
+ 'target' : for the manifest to be installed inside a target image
+ 'sdk' : for the manifest to be installed inside the SDK
+
+ <setup_manifest_file> is the input manifest generated from setup script
+EOF
+}
+
+set -e
+
+tmp=$(getopt -o h,v,m:,f:,t:,s: --long help,verbose,mode:,format:,timestamp:,source: -n "$BASH_SOURCE" -- "$@") || {
+ error "Invalid arguments."
+ __usage
+ exit 1
+}
+eval set -- $tmp
+
+while true; do
+ case "$1" in
+ -h|--help) __usage; exit 0;;
+ -v|--verbose) verbose=1; shift ;;
+ -f|--format) format=$2; shift 2;;
+ -m|--mode) mode=$2; shift 2;;
+ -t|--timestamp) timestamp=$2; shift 2;;
+ -s|--source) sourcefile=$2; shift 2;;
+ --) shift; break;;
+ *) fatal "Internal error";;
+ esac
+done
+
+manifest=$1
+shift
+[[ ! -f "$manifest" ]] && { __usage; exit 1; }
+
+case $mode in
+ deploy|target|sdk) ;;
+ *) error "Invalid mode specified. Allowed modes are: 'deploy', 'target', 'sdk'"; __usage; exit 42;;
+esac
+
+case $format in
+ bash|json) ;;
+ *) error "Invalid format specified. Allowed formats are 'json' or 'bash'"; __usage; exit 43;;
+esac
+
+info "Generating manifest: mode=$mode format=$format manifest=$manifest"
+[[ -f "$sourcefile" ]] && {
+ info "Sourcing file $sourcefile"
+ . $sourcefile
+ # this may define extra vars: to be taken into account BITBAKE_VARS must be defined
+}
+
+[[ "$format" == "json" ]] && {
+ # if jq is present, use it to format json output
+ jq=$(which jq || true)
+ [[ -n "$jq" ]] && {
+ getmanifest $manifest $mode | $jq ""
+ exit ${PIPESTATUS[0]}
+ }
+}
+
+getmanifest $manifest $mode
+
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh
index 27b1de19a..f13256a8c 100644
--- a/scripts/envsetup.sh
+++ b/scripts/envsetup.sh
@@ -75,7 +75,7 @@ else
| To support the newest/upcoming features, please use the script aglsetup.sh. |
------------------------------------------------------------------------------
EOF
- . $SOURCEDIR/aglsetup.sh -m $1 -b $BUILD_DIR agl-devel agl-netboot agl-appfw-smack agl-demo
+ . $SOURCEDIR/aglsetup.sh -m $1 -b $BUILD_DIR agl-devel agl-netboot agl-demo
rc=$?
unset SOURCEDIR
unset BUILD_DIR
diff --git a/scripts/mkefi-agl.sh b/scripts/mkefi-agl.sh
deleted file mode 100755
index 2dafa9edd..000000000
--- a/scripts/mkefi-agl.sh
+++ /dev/null
@@ -1,417 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2012, Intel Corporation.
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-# the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Modification from mkefidisk.sh provided by the Yocto project by Dominig
-# to install Automotive Grade Linux (AGL) on Minnowboard and any PC with UEFI boot
-#
-# changes
-# - simpler use model
-# - keep initrd if present
-# - create a grub config with PARTUID to ease boot from various devices automaticaly
-# - add a UEFI startup.nsh script for autoboot
-# - does not allocate swap
-#
-
-LANG=C
-
-# Set to 1 to enable additional output
-DEBUG=0
-OUT="/dev/null"
-
-#
-# Defaults
-#
-# 100 Mb for the boot partition
-BOOT_SIZE=100
-
-# Cleanup after die()
-cleanup() {
- debug "Syncing and unmounting devices"
- # Unmount anything we mounted
- unmount $ROOTFS_MNT || error "Failed to unmount $ROOTFS_MNT"
- unmount $BOOTFS_MNT || error "Failed to unmount $BOOTFS_MNT"
- unmount $HDDIMG_ROOTFS_MNT || error "Failed to unmount $HDDIMG_ROOTFS_MNT"
- unmount $HDDIMG_MNT || error "Failed to unmount $HDDIMG_MNT"
-
- # Remove the TMPDIR
- debug "Removing temporary files"
- if [ -d "$TMPDIR" ]; then
- rm -rf $TMPDIR || error "Failed to remove $TMPDIR"
- fi
-}
-
-trap 'die "Signal Received, Aborting..."' HUP INT TERM
-
-# Logging routines
-WARNINGS=0
-ERRORS=0
-CLEAR="$(tput sgr0)"
-INFO="$(tput bold)"
-RED="$(tput setaf 1)$(tput bold)"
-GREEN="$(tput setaf 2)$(tput bold)"
-YELLOW="$(tput setaf 3)$(tput bold)"
-info() {
- echo "${INFO}$1${CLEAR}"
-}
-error() {
- ERRORS=$((ERRORS+1))
- echo "${RED}$1${CLEAR}"
-}
-warn() {
- WARNINGS=$((WARNINGS+1))
- echo "${YELLOW}$1${CLEAR}"
-}
-success() {
- echo "${GREEN}$1${CLEAR}"
-}
-die() {
- error "$1"
- cleanup
- exit 1
-}
-debug() {
- if [ $DEBUG -eq 1 ]; then
- echo "$1"
- fi
-}
-
-usage() {
- echo "Install AGL on a removable device to boot on IA UEFI based computer"
- echo "In particular is can create USB or SD bootable support for Minnowboard"
- echo ""
- echo "Usage: $(basename $0) [-v] HDDIMG REMOVABLE_DEVICE"
- echo " -v: Verbose debug"
- echo " HDDIMG: The hddimg file to generate the efi disk from"
- echo " REMOVABLE_DEVICE: The block device to write the image to, e.g. /dev/sdh"
- echo "ex:"
- echo " mkefi-agl.sh agl-demo-platform-intel-corei7-64.hddimg /dev/sdd"
- exit 1
-}
-
-image_details() {
- IMG=$1
- info "Image details"
- echo " image: $(stat --printf '%N\n' $IMG)"
- echo " size: $(stat -L --printf '%s bytes\n' $IMG)"
- echo " modified: $(stat -L --printf '%y\n' $IMG)"
- echo " type: $(file -L -b $IMG)"
- echo ""
-}
-
-device_details() {
- DEV=$1
- BLOCK_SIZE=512
-
- info "Device details"
- echo " device: $DEVICE"
- if [ -f "/sys/class/block/$DEV/device/vendor" ]; then
- echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)"
- else
- echo " vendor: UNKOWN"
- fi
- if [ -f "/sys/class/block/$DEV/device/model" ]; then
- echo " model: $(cat /sys/class/block/$DEV/device/model)"
- else
- echo " model: UNKNOWN"
- fi
- if [ -f "/sys/class/block/$DEV/size" ]; then
- echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes"
- else
- echo " size: UNKNOWN"
- fi
- echo ""
-}
-
-unmount_device() {
- grep -q $DEVICE /proc/mounts
- if [ $? -eq 0 ]; then
- warn "$DEVICE listed in /proc/mounts, attempting to unmount"
- umount $DEVICE* 2>/dev/null
- return $?
- fi
- return 0
-}
-
-unmount() {
- if [ "$1" = "" ] ; then
- return 0
- fi
- grep -q $1 /proc/mounts
- if [ $? -eq 0 ]; then
- debug "Unmounting $1"
- umount $1
- return $?
- fi
- return 0
-}
-
-#
-# Parse and validate arguments
-#
-if [ "$1" != "-v" ] && [ $# -ne 2 ]; then
- usage
-fi
-if [ "$1" == "-v" ] && [ $# -ne 3 ]; then
- usage
-fi
-
-if [ "$1" = "-v" ] ; then
- DEBUG=1
- OUT="1"
- shift
-fi
-
-HDDIMG=$1
-DEVICE=$2
-
-LINK=$(readlink $DEVICE)
-if [ $? -eq 0 ]; then
- DEVICE="$LINK"
-fi
-
-if [ ! -w "$DEVICE" ]; then
- if [ ! -e "${DEVICE}" ] ; then
- die "Device $DEVICE cannot be found"
- else
- die "Device $DEVICE is not writable (need to run under sudo?)"
- fi
-fi
-
-if [ ! -e "$HDDIMG" ]; then
- die "HDDIMG $HDDIMG does not exist"
-fi
-
-#
-# Ensure the hddimg is not mounted
-#
-unmount "$HDDIMG" || die "Failed to unmount $HDDIMG"
-
-#
-# Check if any $DEVICE partitions are mounted
-#
-unmount_device || die "Failed to unmount $DEVICE"
-
-#
-# Confirm device with user
-#
-image_details $HDDIMG
-device_details $(basename $DEVICE)
-echo -n "${INFO}Prepare EFI image on $DEVICE [y/N]?${CLEAR} "
-read RESPONSE
-if [ "$RESPONSE" != "y" ]; then
- echo "Image creation aborted"
- exit 0
-fi
-
-
-#
-# Prepare the temporary working space
-#
-TMPDIR=$(mktemp -d mkefidisk-XXX) || die "Failed to create temporary mounting directory."
-HDDIMG_MNT=$TMPDIR/hddimg
-HDDIMG_ROOTFS_MNT=$TMPDIR/hddimg_rootfs
-ROOTFS_MNT=$TMPDIR/rootfs
-BOOTFS_MNT=$TMPDIR/bootfs
-mkdir $HDDIMG_MNT || die "Failed to create $HDDIMG_MNT"
-mkdir $HDDIMG_ROOTFS_MNT || die "Failed to create $HDDIMG_ROOTFS_MNT"
-mkdir $ROOTFS_MNT || die "Failed to create $ROOTFS_MNT"
-mkdir $BOOTFS_MNT || die "Failed to create $BOOTFS_MNT"
-
-
-#
-# Partition $DEVICE
-#
-DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//")
-# If the device size is not reported there may not be a valid label
-if [ "$DEVICE_SIZE" = "" ] ; then
- parted -s $DEVICE mklabel msdos || die "Failed to create MSDOS partition table"
- DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//")
-fi
-ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE))
-ROOTFS_START=$((BOOT_SIZE))
-ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE))
-
-# MMC devices use a partition prefix character 'p'
-PART_PREFIX=""
-if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then
- PART_PREFIX="p"
-fi
-BOOTFS=$DEVICE${PART_PREFIX}1
-ROOTFS=$DEVICE${PART_PREFIX}2
-
-TARGET_PART_PREFIX=""
-if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then
- TARGET_PART_PREFIX="p"
-fi
-TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2
-
-echo ""
-info "Boot partition size: $BOOT_SIZE MB ($BOOTFS)"
-info "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)"
-echo ""
-
-# Use MSDOS by default as GPT cannot be reliably distributed in disk image form
-# as it requires the backup table to be on the last block of the device, which
-# of course varies from device to device.
-
-info "Partitioning installation media ($DEVICE)"
-
-debug "Deleting partition table on $DEVICE"
-dd if=/dev/zero of=$DEVICE bs=512 count=2 >$OUT 2>&1 || die "Failed to zero beginning of $DEVICE"
-
-debug "Creating new partition table (MSDOS) on $DEVICE"
-parted -s $DEVICE mklabel msdos >$OUT 2>&1 || die "Failed to create MSDOS partition table"
-
-debug "Creating boot partition on $BOOTFS"
-parted -s $DEVICE mkpart primary 0% $BOOT_SIZE >$OUT 2>&1 || die "Failed to create BOOT partition"
-
-debug "Enabling boot flag on $BOOTFS"
-parted -s $DEVICE set 1 boot on >$OUT 2>&1 || die "Failed to enable boot flag"
-
-debug "Creating ROOTFS partition on $ROOTFS"
-parted -s $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END >$OUT 2>&1 || die "Failed to create ROOTFS partition"
-
-# as blkid does not provide PARTUUID on Ubuntu LTS 14.04 we myst hack via fdisk
-#ROOTFS_PARTUUID=$(blkid |grep -e "$ROOTFS" |sed -n 's/^.*PARTUUID=/PARTUUID=/p')
-export LC_ALL=C
-ROOTFS_DISKID=$(fdisk -l "$DEVICE" | grep -e "Disk identifier" | sed -n 's/^.*Disk identifier: 0x/PARTUUID=/p')
-if [ $ROOTFS_DISKID == "" ]; then
- die "Failed to read DISKID"
-fi
-ROOTFS_PARTUUID="$ROOTFS_DISKID-02"
-debug "PARTUUID for ROOTFS is $ROOTFS_PARTUUID"
-
-if [ $DEBUG -eq 1 ]; then
- parted -s $DEVICE print
-fi
-
-
-#
-# Check if any $DEVICE partitions are mounted after partitioning
-#
-unmount_device || die "Failed to unmount $DEVICE partitions"
-
-
-#
-# Format $DEVICE partitions
-#
-info "Formatting partitions"
-debug "Formatting $BOOTFS as vfat"
-if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then
- mkfs.vfat -I $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS"
-else
- mkfs.vfat $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS"
-fi
-
-debug "Formatting $ROOTFS as ext4"
-mkfs.ext4 -F $ROOTFS -L "ROOT" >$OUT 2>&1 || die "Failed to format $ROOTFS"
-
-
-#
-# Installing to $DEVICE
-#
-debug "Mounting images and device in preparation for installation"
-mount -o loop $HDDIMG $HDDIMG_MNT >$OUT 2>&1 || error "Failed to mount $HDDIMG"
-mount -o loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT >$OUT 2>&1 || error "Failed to mount rootfs.img"
-mount $ROOTFS $ROOTFS_MNT >$OUT 2>&1 || error "Failed to mount $ROOTFS on $ROOTFS_MNT"
-mount $BOOTFS $BOOTFS_MNT >$OUT 2>&1 || error "Failed to mount $BOOTFS on $BOOTFS_MNT"
-
-info "Preparing boot partition"
-EFIDIR="$BOOTFS_MNT/EFI/BOOT"
-cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz"
-if [ -f $HDDIMG_MNT/initrd ]; then
- cp $HDDIMG_MNT/initrd $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy initrd"
-fi
-echo "bootx64.efi" > $BOOTFS_MNT/startup.nsh || error "Failed to create startup.nsh"
-# Copy the efi loader and configs (booti*.efi and grub.cfg if it exists)
-cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir"
-# Silently ignore a missing systemd-boot or gummiboot loader dir (we might just be a GRUB image)
-cp -r $HDDIMG_MNT/loader $BOOTFS_MNT >$OUT 2>&1
-
-# Update the boot loaders configurations for an installed image
-# Remove any existing root= kernel parameters and:
-# o Add a root= parameter with the target rootfs
-# o Specify ro so fsck can be run during boot
-# o Specify rootwait in case the target media is an asyncronous block device
-# such as MMC or USB disks
-# o Specify "quiet" to minimize boot time when using slow serial consoles
-
-# Look for a GRUB installation
-GRUB_CFG="$EFIDIR/grub.cfg"
-if [ -e "$GRUB_CFG" ]; then
- info "Configuring GRUB"
- # Delete the install entry
- sed -i "/menuentry 'install'/,/^}/d" $GRUB_CFG
- # Delete any LABEL= strings
- sed -i "s/ LABEL=[^ ]*/ /" $GRUB_CFG
-
- sed -i "s@ root=[^ ]*@ @" $GRUB_CFG
- sed -i "s@vmlinuz @vmlinuz root=$ROOTFS_PARTUUID @" $GRUB_CFG
-fi
-
-# look for a systemd-boot loader.conf file and create a default boot entry
-SYSTEMDBOOT_CFG="$BOOTFS_MNT/loader/loader.conf"
-if [ -e "$SYSTEMDBOOT_CFG" ]; then
- info "Configuring SYSTEMD-BOOT"
- SYSTEMDBOOT_BOOT="$BOOTFS_MNT/loader/entries/boot.conf"
- SYSTEMDBOOT_DEBUG="$BOOTFS_MNT/loader/entries/debug.conf"
- # Delete the install entry
- sed -i "/menuentry 'install'/,/^}/d" $SYSTEMDBOOT_CFG
- rm -rf "$BOOTFS_MNT/loader/entries/install.conf" >$OUT 2>&1
- # Add PARTUUID to the boot entry file
- if [ ! -e "$SYSTEMDBOOT_BOOT" ]; then
- die "no boot.conf entry found in systemd-boot directories"
- fi
- # Delete any LABEL= strings
- sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_BOOT
-
- sed -i "s@ root=[^ ]*@ @" $SYSTEMDBOOT_BOOT
- sed -i "s@options @options root=$ROOTFS_PARTUUID @" $SYSTEMDBOOT_BOOT
-fi
-
-
-# Ensure we have at least one EFI bootloader configured
-if [ ! -e $GRUB_CFG ] && [ ! -e $SYSTEMDBOOT_CFG ] ; then
- die "No EFI bootloader configuration found"
-fi
-
-info "Copying ROOTFS files (this may take a while)"
-cp -a $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT >$OUT 2>&1 || die "Root FS copy failed"
-
-# We dont want udev to mount our root device while we're booting...
-if [ -d $ROOTFS_MNT/etc/udev/ ] ; then
- echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist
-fi
-
-
-# Call cleanup to unmount devices and images and remove the TMPDIR
-cleanup
-
-echo ""
-if [ $WARNINGS -ne 0 ] && [ $ERRORS -eq 0 ]; then
- echo "${YELLOW}Installation completed with warnings${CLEAR}"
- echo "${YELLOW}Warnings: $WARNINGS${CLEAR}"
-elif [ $ERRORS -ne 0 ]; then
- echo "${RED}Installation encountered errors${CLEAR}"
- echo "${RED}Errors: $ERRORS${CLEAR}"
- echo "${YELLOW}Warnings: $WARNINGS${CLEAR}"
-else
- success "Installation completed successfully"
-fi
-echo ""
diff --git a/templates/base/00_local.conf.agl.inc b/templates/base/00_local.conf.agl.inc
index 1cfd90557..d55cbef4b 100644
--- a/templates/base/00_local.conf.agl.inc
+++ b/templates/base/00_local.conf.agl.inc
@@ -4,5 +4,5 @@
# Set DISTRO for AGL
DISTRO = "poky-agl"
-#see meta-agl/meta-agl/conf/include/base-agl.inc
+#see meta-agl/meta-agl-profile-core/conf/include/base-agl.inc
require conf/include/base-agl.inc
diff --git a/templates/base/01_setup_pkg_revision.sh b/templates/base/01_setup_pkg_revision.sh
new file mode 100644
index 000000000..a9e4ceb8c
--- /dev/null
+++ b/templates/base/01_setup_pkg_revision.sh
@@ -0,0 +1,68 @@
+# use a function to be neutral with other fragments
+function 01_setup_pkg_revision() {
+ # BASH_SOURCE can't be used as this fragment is concatenated in a larger script
+ local THIS=meta-agl/templates/base/01_setup_pkg_revision.sh
+
+ # RPMREVISION and LOCALCONF must be set previously in the setup script
+ [[ -z "$RPMREVISION" || -z "$LOCALCONF" ]] && return 0
+
+ echo "INFO: using RPM revision schema $RPMREVISION"
+
+ cat <<EOF >> $LOCALCONF
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# fragment {
+# generated by $THIS "$RPMREVISION"
+#
+
+EOF
+
+ case "$RPMREVISION" in
+ prservice*)
+ [[ $RPMREVISION =~ ^prservice(:([^ \t\n]+))?$ ]] && {
+ echo "PRSERV_HOST ?= \"${BASH_REMATCH[2]:-localhost:0}\"" >> $LOCALCONF
+ } || {
+ echo "ERROR ($THIS): invalid address specified for PR Service"
+ return 1
+ }
+ ;;
+ timestamp)
+ AGL_PR=$(date --utc '+%Y%m%d.%H%M%S')
+ cat <<'EOF' >> $LOCALCONF
+# to re-generate AGL_PR the same way as aglsetup does, run:
+# echo "AGL_PR ?= \"$(date --utc '+%Y%m%d.%H%M%S')\""
+EOF
+ echo "AGL_PR ?= \"${AGL_PR}\"" >> $LOCALCONF;
+ cat <<'EOF' >> $LOCALCONF
+PKGR = "${PR}${EXTENDPRAUTO}.${AGL_PR}"
+PKGV = "${@ '${PV}'.replace('AUTOINC','${AGL_PR}')}"
+BB_BASEHASH_IGNORE_VARS:append = " PKGR PKGV"
+EOF
+ ;;
+ value:*)
+ echo "AGL_PR ?= \"${RPMREVISION#value:}\"" >> $LOCALCONF;
+ cat <<'EOF' >> $LOCALCONF
+PKGR = "${PR}${EXTENDPRAUTO}.${AGL_PR}"
+PKGV = "${@ '${PV}'.replace('AUTOINC','${AGL_PR}')}"
+BB_BASEHASH_IGNORE_VARS:append = " PKGR PKGV"
+EOF
+ ;;
+ none)
+ # do nothing
+ ;;
+ *)
+ echo "ERROR ($THIS): unknown package revision method '$REVISION'"
+ return 1
+ ;;
+ esac
+
+ cat <<'EOF' >> $LOCALCONF
+
+#
+# }
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+EOF
+
+}
+
+01_setup_pkg_revision
diff --git a/templates/base/99_local.conf.inc b/templates/base/99_local.conf.inc
new file mode 100644
index 000000000..be5dd9321
--- /dev/null
+++ b/templates/base/99_local.conf.inc
@@ -0,0 +1,33 @@
+########################
+# AGL DISTRO VARIABLES #
+########################
+
+# ARM 32bit 'medium' compiler (armv7thf instead of armv7ve)
+# (only use for CPUs <= cortex-a9 / w/o virt extension - e.g. cortex-a8)
+# AGL_FEATURES:append = " agl-medium-arm-compiler"
+
+
+######################
+# AGL USER VARIABLES #
+######################
+
+# Add additional IMAGE_FSTYPES here on-top of the default ext4.xz and tar.xz
+#AGL_EXTRA_IMAGE_FSTYPES = ""
+
+# Additional free disk space created in the image in Kbytes.
+#IMAGE_ROOTFS_EXTRA_SPACE="524288"
+
+# meta-agl/meta-agl-profile-graphical/recipes-graphics/wayland/weston-init.bbappend
+# AGL's compositor is started instead of weston like so
+# AGL_DEFAULT_WESTONSTART ?= "/usr/bin/agl-compositor --config ${sysconfdir}/xdg/weston/weston.ini"
+# you can redefine it using this variable to go back to weston,
+# but be careful that this needs further changes to work !
+# Especially the AGL demo apps will not work as-is.
+#AGL_DEFAULT_WESTONSTART = "/usr/bin/weston"
+
+# meta-agl-profile-graphical-qt5/recipes-qt/qt5/qtwayland_%.bbappend
+# This defines the QT integration. We default to xdg-shell
+# AGL_DEFAULT_WM_SHELL ?= "xdg-shell"
+# you can redefine it using this variable to e.g. use ivi-shell
+# but be careful that this needs further changes to work !
+#AGL_DEFAULT_WM_SHELL = ""
diff --git a/templates/base/conf-notes.txt b/templates/base/conf-notes.txt
deleted file mode 100644
index 1279e2979..000000000
--- a/templates/base/conf-notes.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Common targets are:
- - meta-agl: (core system)
- agl-image-minimal
- agl-image-minimal-qa
-
- agl-image-ivi
- agl-image-ivi-qa
- agl-image-ivi-crosssdk
-
- agl-image-weston
-
- - meta-agl-demo: (demo with UI)
- agl-demo-platform (* default demo target)
- agl-demo-platform-qa
- agl-demo-platform-crosssdk
-
- agl-demo-platform-html5
diff --git a/templates/feature/agl-all-features/README_feature_agl-all-features.md b/templates/feature/agl-all-features/README_feature_agl-all-features.md
new file mode 100644
index 000000000..9dab654df
--- /dev/null
+++ b/templates/feature/agl-all-features/README_feature_agl-all-features.md
@@ -0,0 +1,16 @@
+---
+description: Feature agl-all-features
+authors: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Phong Tran <tranmanphong@gmail.com>, Ronan Le Martret <ronan.lemartret@iot.bzh>
+---
+
+### Feature agl-all-features
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-all-features/README_feature_agl-all-features.md*
+
+#### Dependent features pulled by agl-all-features
+
+The following features are pulled:
+
+* agl-demo
+* agl-netboot
+
diff --git a/templates/feature/agl-all-features/included.dep b/templates/feature/agl-all-features/included.dep
index 1ed6763e7..80717ded0 100644
--- a/templates/feature/agl-all-features/included.dep
+++ b/templates/feature/agl-all-features/included.dep
@@ -1 +1 @@
-agl-demo agl-netboot agl-sota
+agl-demo agl-netboot
diff --git a/templates/feature/agl-app-framework/50_bblayers.conf.inc b/templates/feature/agl-app-framework/50_bblayers.conf.inc
new file mode 100644
index 000000000..e6eacd9d8
--- /dev/null
+++ b/templates/feature/agl-app-framework/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+
+BBLAYERS =+ " \
+ ${METADIR}/meta-agl/meta-app-framework \
+ "
diff --git a/templates/feature/agl-app-framework/50_local.conf.inc b/templates/feature/agl-app-framework/50_local.conf.inc
new file mode 100644
index 000000000..ce541a7b0
--- /dev/null
+++ b/templates/feature/agl-app-framework/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl/meta-app-framework/conf/include/agl-app-framework.inc
+require conf/include/agl-app-framework.inc
diff --git a/templates/feature/agl-appfw-smack/50_bblayers.conf.inc b/templates/feature/agl-appfw-smack/50_bblayers.conf.inc
deleted file mode 100644
index 344c25070..000000000
--- a/templates/feature/agl-appfw-smack/50_bblayers.conf.inc
+++ /dev/null
@@ -1,6 +0,0 @@
-BBLAYERS =+ " \
- ${METADIR}/meta-intel-iot-security/meta-security-smack \
- ${METADIR}/meta-intel-iot-security/meta-security-framework \
- ${METADIR}/meta-agl/meta-app-framework \
- "
-
diff --git a/templates/feature/agl-appfw-smack/50_local.conf.inc b/templates/feature/agl-appfw-smack/50_local.conf.inc
deleted file mode 100644
index 0a11f07c2..000000000
--- a/templates/feature/agl-appfw-smack/50_local.conf.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-#see meta-agl/meta-app-framework/conf/include/agl-appfw-smack.inc
-require conf/include/agl-appfw-smack.inc
diff --git a/templates/feature/agl-archiver/50_local.conf.inc b/templates/feature/agl-archiver/50_local.conf.inc
index 946c262df..6ff284cdb 100644
--- a/templates/feature/agl-archiver/50_local.conf.inc
+++ b/templates/feature/agl-archiver/50_local.conf.inc
@@ -1,2 +1,4 @@
INHERIT += "archiver"
ARCHIVER_MODE[src] = "original"
+COPYLEFT_LICENSE_INCLUDE = "*"
+COPYLEFT_LICENSE_EXCLUDE += "CLOSED Proprietary Custom Firmware-* Freescale-* NXP-* TI TI-*"
diff --git a/templates/feature/agl-archiver/README_feature_agl-archiver.md b/templates/feature/agl-archiver/README_feature_agl-archiver.md
new file mode 100644
index 000000000..bcd11b320
--- /dev/null
+++ b/templates/feature/agl-archiver/README_feature_agl-archiver.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-archiver
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Stéphane Desneux <stephane.desneux@iot.bzh>
+---
+
+### Feature agl-archiver
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-archiver/README_feature_agl-archiver.md*
+
diff --git a/templates/feature/agl-buildstats/50_local.conf.inc b/templates/feature/agl-buildstats/50_local.conf.inc
new file mode 100644
index 000000000..34110d35d
--- /dev/null
+++ b/templates/feature/agl-buildstats/50_local.conf.inc
@@ -0,0 +1,2 @@
+INHERIT += "buildstats"
+INHERIT += "buildstats-summary"
diff --git a/templates/feature/agl-buildstats/README_feature_agl-buildstats.md b/templates/feature/agl-buildstats/README_feature_agl-buildstats.md
new file mode 100644
index 000000000..d10bd7e31
--- /dev/null
+++ b/templates/feature/agl-buildstats/README_feature_agl-buildstats.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-buildstats
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Feature agl-buildstats
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-buildstats/README_feature_agl-buildstats.md*
+
diff --git a/templates/feature/agl-ci-change-features-nogfx/README_feature_agl-ci-change-features-nogfx.md b/templates/feature/agl-ci-change-features-nogfx/README_feature_agl-ci-change-features-nogfx.md
new file mode 100644
index 000000000..6889d0840
--- /dev/null
+++ b/templates/feature/agl-ci-change-features-nogfx/README_feature_agl-ci-change-features-nogfx.md
@@ -0,0 +1,19 @@
+---
+description: Feature agl-ci-change-features-nogfx
+authors: George Kiagiadakis <george.kiagiadakis@collabora.com>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Feature agl-ci-change-features-nogfx
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ci-change-features-nogfx/README_feature_agl-ci-change-features-nogfx.md*
+
+#### Dependent features pulled by agl-ci-change-features-nogfx
+
+The following features are pulled:
+
+* agl-devel
+* agl-netboot
+* agl-pipewire
+* agl-buildstats
+* agl-ptest
+
diff --git a/templates/feature/agl-ci-change-features-nogfx/included.dep b/templates/feature/agl-ci-change-features-nogfx/included.dep
index 49f5dd12d..27e9852f7 100644
--- a/templates/feature/agl-ci-change-features-nogfx/included.dep
+++ b/templates/feature/agl-ci-change-features-nogfx/included.dep
@@ -1 +1 @@
-agl-devel agl-netboot agl-appfw-smack \ No newline at end of file
+agl-demo agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest
diff --git a/templates/feature/agl-ci-change-features/README_feature_agl-ci-change-features.md b/templates/feature/agl-ci-change-features/README_feature_agl-ci-change-features.md
new file mode 100644
index 000000000..d60499bc3
--- /dev/null
+++ b/templates/feature/agl-ci-change-features/README_feature_agl-ci-change-features.md
@@ -0,0 +1,20 @@
+---
+description: Feature agl-ci-change-features
+authors: George Kiagiadakis <george.kiagiadakis@collabora.com>, Jan-Simon Moeller <jsmoeller@linuxfoundation.org>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Phong Tran <tranmanphong@gmail.com>
+---
+
+### Feature agl-ci-change-features
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ci-change-features/README_feature_agl-ci-change-features.md*
+
+#### Dependent features pulled by agl-ci-change-features
+
+The following features are pulled:
+
+* agl-demo
+* agl-devel
+* agl-netboot
+* agl-pipewire
+* agl-buildstats
+* agl-ptest
+
diff --git a/templates/feature/agl-ci-change-features/included.dep b/templates/feature/agl-ci-change-features/included.dep
index 3f111d36c..27e9852f7 100644
--- a/templates/feature/agl-ci-change-features/included.dep
+++ b/templates/feature/agl-ci-change-features/included.dep
@@ -1 +1 @@
-agl-demo agl-devel agl-netboot agl-appfw-smack \ No newline at end of file
+agl-demo agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest
diff --git a/templates/feature/agl-ci-snapshot-features-nogfx/README_feature_agl-ci-snapshot-features-nogfx.md b/templates/feature/agl-ci-snapshot-features-nogfx/README_feature_agl-ci-snapshot-features-nogfx.md
new file mode 100644
index 000000000..0289143f0
--- /dev/null
+++ b/templates/feature/agl-ci-snapshot-features-nogfx/README_feature_agl-ci-snapshot-features-nogfx.md
@@ -0,0 +1,20 @@
+---
+description: Feature agl-ci-snapshot-features-nogfx
+authors: George Kiagiadakis <george.kiagiadakis@collabora.com>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Feature agl-ci-snapshot-features-nogfx
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ci-snapshot-features-nogfx/README_feature_agl-ci-snapshot-features-nogfx.md*
+
+#### Dependent features pulled by agl-ci-snapshot-features-nogfx
+
+The following features are pulled:
+
+* agl-devel
+* agl-netboot
+* agl-archiver
+* agl-pipewire
+* agl-buildstats
+* agl-ptest
+
diff --git a/templates/feature/agl-ci-snapshot-features-nogfx/included.dep b/templates/feature/agl-ci-snapshot-features-nogfx/included.dep
index 0a88d5ef9..01ef6c813 100644
--- a/templates/feature/agl-ci-snapshot-features-nogfx/included.dep
+++ b/templates/feature/agl-ci-snapshot-features-nogfx/included.dep
@@ -1 +1 @@
-agl-devel agl-netboot agl-appfw-smack agl-isafw agl-archiver \ No newline at end of file
+agl-demo agl-devel agl-netboot agl-archiver agl-pipewire agl-buildstats agl-ptest
diff --git a/templates/feature/agl-ci-snapshot-features/README_feature_agl-ci-snapshot-features.md b/templates/feature/agl-ci-snapshot-features/README_feature_agl-ci-snapshot-features.md
new file mode 100644
index 000000000..42dec5707
--- /dev/null
+++ b/templates/feature/agl-ci-snapshot-features/README_feature_agl-ci-snapshot-features.md
@@ -0,0 +1,21 @@
+---
+description: Feature agl-ci-snapshot-features
+authors: George Kiagiadakis <george.kiagiadakis@collabora.com>, Jan-Simon Moeller <jsmoeller@linuxfoundation.org>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Phong Tran <tranmanphong@gmail.com>
+---
+
+### Feature agl-ci-snapshot-features
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ci-snapshot-features/README_feature_agl-ci-snapshot-features.md*
+
+#### Dependent features pulled by agl-ci-snapshot-features
+
+The following features are pulled:
+
+* agl-demo
+* agl-devel
+* agl-netboot
+* agl-archiver
+* agl-pipewire
+* agl-buildstats
+* agl-ptest
+
diff --git a/templates/feature/agl-ci-snapshot-features/included.dep b/templates/feature/agl-ci-snapshot-features/included.dep
index 481ed89a5..01ef6c813 100644
--- a/templates/feature/agl-ci-snapshot-features/included.dep
+++ b/templates/feature/agl-ci-snapshot-features/included.dep
@@ -1 +1 @@
-agl-demo agl-devel agl-netboot agl-appfw-smack agl-isafw agl-archiver \ No newline at end of file
+agl-demo agl-devel agl-netboot agl-archiver agl-pipewire agl-buildstats agl-ptest
diff --git a/templates/feature/agl-ci/99_local.conf.inc b/templates/feature/agl-ci/99_local.conf.inc
new file mode 100644
index 000000000..e17bc83a9
--- /dev/null
+++ b/templates/feature/agl-ci/99_local.conf.inc
@@ -0,0 +1,32 @@
+AGL_FEATURES:append = " AGLCI"
+# opencv seems to have a parallel make bug
+# ...contrib/modules/xfeatures2d/test/test_features2d.cpp:51:10: fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory
+PARALLEL_MAKE:pn-opencv = "-j 1"
+
+AGL_HOST_PREMIRROR ?= "http://download.automotivelinux.org"
+AGL_HOST_SSTATE_MIRROR ?= "http://download.automotivelinux.org"
+
+PREMIRRORS = " \
+git://.*/.* ${AGL_HOST_PREMIRROR}/AGL/mirror/ \n \
+ftp://.*/.* ${AGL_HOST_PREMIRROR}/AGL/mirror/ \n \
+http://.*/.* ${AGL_HOST_PREMIRROR}/AGL/mirror/ \n \
+https://.*/.* ${AGL_HOST_PREMIRROR}/AGL/mirror/ \n \
+"
+
+SSTATE_MIRRORS = " file://.* ${AGL_HOST_SSTATE_MIRROR}/sstate-mirror/master/${DEFAULTTUNE}/PATH;downloadfilename=PATH \n "
+
+#INHERIT += "packagefeed-stability"
+INHERIT += "buildhistory"
+INHERIT += "buildstats"
+INHERIT += "buildstats-summary"
+
+# setup for PRSERV and HASHSERV
+#AGL_HOST_PRSERV ?= "10.30.72.18"
+#AGL_HOST_HASHSERV ?= "10.30.72.18"
+
+#BB_HASHSERVE = "${AGL_HOST_HASHSERV}:8383"
+#BB_SIGNATURE_HANDLER = "OEEquivHash"
+
+#PRSERV_HOST = "${AGL_HOST_PRSERV}:8181"
+
+IMAGE_INSTALL:append = " curl"
diff --git a/templates/feature/agl-ci/README_feature_agl-ci.md b/templates/feature/agl-ci/README_feature_agl-ci.md
new file mode 100644
index 000000000..3d983cfd3
--- /dev/null
+++ b/templates/feature/agl-ci/README_feature_agl-ci.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-ci
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Feature agl-ci
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ci/README_feature_agl-ci.md*
+
diff --git a/templates/feature/agl-ci/included.dep b/templates/feature/agl-ci/included.dep
new file mode 100644
index 000000000..21543697b
--- /dev/null
+++ b/templates/feature/agl-ci/included.dep
@@ -0,0 +1 @@
+agl-create-spdx
diff --git a/templates/feature/agl-create-spdx/50_local.conf.inc b/templates/feature/agl-create-spdx/50_local.conf.inc
new file mode 100644
index 000000000..2dd5314f3
--- /dev/null
+++ b/templates/feature/agl-create-spdx/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl/meta-agl/conf/include/agl-devel.inc
+require conf/include/agl-create-spdx.inc
diff --git a/templates/feature/agl-create-spdx/README_feature_agl-create-spdx.md b/templates/feature/agl-create-spdx/README_feature_agl-create-spdx.md
new file mode 100644
index 000000000..332a9dbd5
--- /dev/null
+++ b/templates/feature/agl-create-spdx/README_feature_agl-create-spdx.md
@@ -0,0 +1,7 @@
+---
+description: Feature agl-create-spdx
+authors: Jan-Simon Moeller <jsmoeller@linuxfoundation.rg>
+---
+
+### Feature agl-create-spdx
+Activation of the create-spdx class in oe-core.
diff --git a/templates/feature/agl-devel/README_feature_agl-devel.md b/templates/feature/agl-devel/README_feature_agl-devel.md
new file mode 100644
index 000000000..588bb3cdc
--- /dev/null
+++ b/templates/feature/agl-devel/README_feature_agl-devel.md
@@ -0,0 +1,42 @@
+---
+description: Feature agl-devel
+authors: José Bollo <jose.bollo@iot.bzh>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Stephane Desneux <stephane.desneux@iot.bzh>, Yannick Gicquel <yannick.gicquel@iot.bzh>
+---
+
+### Feature agl-devel
+
+Activation of the agl-devel features turns on
+features needed for developping and debugging
+agl distribution.
+
+This includes:
+
+* adding to images some useful packages
+* adding to images the package group 'packagegroup-agl-devel'
+* definition of a contionnal the tag 'agl-devel'
+ for conditionnal building
+
+ * definition of the distro feature 'agl-devel'
+ * adds packages for development in SDK
+
+### How to use agl-devel in conditionnal builds
+
+The following example shows how to activate C/C++ code
+specific to agl-devel:
+
+```yocto
+CPPFLAGS:append:agl-devel = " -DAGL_DEVEL"
+```
+
+Using this, any code enclosed in
+
+```yocto
+#ifdef AGL_DEVEL
+...my code specific to agl-devel...
+#endif
+```
+
+will normaly be effective only if agl-devel is set on.
+
+At this time, it is recommended to use AGL_DEVEL as tag
+within C/C++ code.
diff --git a/templates/feature/agl-devel/agl-devel.md b/templates/feature/agl-devel/agl-devel.md
deleted file mode 100644
index 85a2b9177..000000000
--- a/templates/feature/agl-devel/agl-devel.md
+++ /dev/null
@@ -1,40 +0,0 @@
-The features of agl-devel
-=========================
-
-Activation of the agl-devel features turns on
-features needed for developping and debugging
-agl distribution.
-
-This includes:
-
- - adding to images some useful packages
-
- - adding to images the package group 'packagegroup-agl-devel'
-
- - definition of a contionnal the tag 'agl-devel'
- for conditionnal building
-
- - definition of the distro feature 'agl-devel'
-
- - adds packages for development in SDK
-
-
-How to use agl-devel in conditionnal builds ?
----------------------------------------------
-
-The following example shows how to activate C/C++ code
-specific to agl-devel:
-
- CPPFLAGS_append_agl-devel = " -DAGL_DEVEL"
-
-Using this, any code enclosed in
-
- #ifdef AGL_DEVEL
- ...my code specific to agl-devel...
- #endif
-
-will normaly be effective only if agl-devel is set on.
-
-At this time, it is recommended to use AGL_DEVEL as tag
-within C/C++ code.
-
diff --git a/templates/feature/agl-devel/included.dep b/templates/feature/agl-devel/included.dep
new file mode 100644
index 000000000..115ecf19a
--- /dev/null
+++ b/templates/feature/agl-devel/included.dep
@@ -0,0 +1 @@
+agl-package-management
diff --git a/templates/feature/agl-fossdriver/50_bblayers.conf.inc b/templates/feature/agl-fossdriver/50_bblayers.conf.inc
new file mode 100644
index 000000000..eea04c4e8
--- /dev/null
+++ b/templates/feature/agl-fossdriver/50_bblayers.conf.inc
@@ -0,0 +1 @@
+BBLAYERS =+ "${METADIR}/external/meta-spdxscanner"
diff --git a/templates/feature/agl-fossdriver/50_local.conf.inc b/templates/feature/agl-fossdriver/50_local.conf.inc
new file mode 100644
index 000000000..9dea9a0da
--- /dev/null
+++ b/templates/feature/agl-fossdriver/50_local.conf.inc
@@ -0,0 +1 @@
+INHERIT += "fossdriver-host" \ No newline at end of file
diff --git a/templates/feature/agl-fossdriver/README_feature_agl-fossdriver.md b/templates/feature/agl-fossdriver/README_feature_agl-fossdriver.md
new file mode 100644
index 000000000..5a9284366
--- /dev/null
+++ b/templates/feature/agl-fossdriver/README_feature_agl-fossdriver.md
@@ -0,0 +1,13 @@
+---
+description: Feature agl-fossdriver
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Stéphane Desneux <stephane.desneux@iot.bzh>
+---
+
+### Feature agl-fossdriver
+
+Integration with meta-spdxscanner.
+
+This needs fossdriver setup and a fossology instance before it can work.
+
+*Full description is missing - please complete file meta-agl/templates/feature/agl-fossdriver/README_feature_agl-fossdriver.md*
+
diff --git a/templates/feature/agl-isafw/50_bblayers.conf.inc b/templates/feature/agl-isafw/50_bblayers.conf.inc
deleted file mode 100644
index a0c626f9e..000000000
--- a/templates/feature/agl-isafw/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-security-isafw"
diff --git a/templates/feature/agl-isafw/50_local.conf.inc b/templates/feature/agl-isafw/50_local.conf.inc
deleted file mode 100644
index c1c13e1f5..000000000
--- a/templates/feature/agl-isafw/50_local.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-INHERIT += "isafw"
diff --git a/templates/feature/agl-localdev/80_bblayers.conf.inc b/templates/feature/agl-localdev/80_bblayers.conf.inc
new file mode 100644
index 000000000..d9bb9d070
--- /dev/null
+++ b/templates/feature/agl-localdev/80_bblayers.conf.inc
@@ -0,0 +1,3 @@
+# Local derivations during development, just add a layer in the folder meta-localdev
+BBLAYERS =+ "${@'${METADIR}/meta-localdev' if os.path.exists('${METADIR}/meta-localdev') else ''}"
+
diff --git a/templates/feature/agl-localdev/80_local.conf.inc b/templates/feature/agl-localdev/80_local.conf.inc
new file mode 100644
index 000000000..6c9213512
--- /dev/null
+++ b/templates/feature/agl-localdev/80_local.conf.inc
@@ -0,0 +1,2 @@
+# (weak) include userspecific local.dev.inc
+include local.dev.inc
diff --git a/templates/feature/agl-localdev/README_feature_agl-localdev.md b/templates/feature/agl-localdev/README_feature_agl-localdev.md
new file mode 100644
index 000000000..111ae4ec0
--- /dev/null
+++ b/templates/feature/agl-localdev/README_feature_agl-localdev.md
@@ -0,0 +1,9 @@
+---
+description: enable local layer for development purposes
+authors: Stéphane Desneux <stephane.desneux@iot.bzh>
+---
+
+### Feature agl-localdev
+
+Adds a local layer named "meta-localdev" in meta directory and a local.dev.inc conf file if present.
+
diff --git a/templates/feature/agl-netboot/50_bblayers.conf.inc b/templates/feature/agl-netboot/50_bblayers.conf.inc
index 3d2ed6460..94e784a1a 100644
--- a/templates/feature/agl-netboot/50_bblayers.conf.inc
+++ b/templates/feature/agl-netboot/50_bblayers.conf.inc
@@ -1 +1,7 @@
-BBLAYERS =+ "${METADIR}/meta-agl/meta-netboot"
+BBLAYERS =+ " ${METADIR}/meta-agl/meta-netboot \
+ "
+
+# Indirection to avoid duplicate inclusions of the same folder into BBLAYERS
+# the evaluation is in the bblayers.conf.sample in meta-agl/meta-agl-core/conf/templates/base
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+AGL_META_NETWORKING = "${METADIR}/external/meta-openembedded/meta-networking"
diff --git a/templates/feature/agl-netboot/README_feature_agl-netboot.md b/templates/feature/agl-netboot/README_feature_agl-netboot.md
new file mode 100644
index 000000000..171f852b6
--- /dev/null
+++ b/templates/feature/agl-netboot/README_feature_agl-netboot.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-netboot
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Stephane Desneux <stephane.desneux@iot.bzh>
+---
+
+### Feature agl-netboot
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-netboot/README_feature_agl-netboot.md*
+
diff --git a/templates/feature/agl-package-management/50_local.conf.inc b/templates/feature/agl-package-management/50_local.conf.inc
new file mode 100644
index 000000000..641a327c9
--- /dev/null
+++ b/templates/feature/agl-package-management/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl/meta-agl/conf/include/agl-package-management.inc
+require conf/include/agl-package-management.inc
diff --git a/templates/feature/agl-package-management/README_feature_agl-package-management.md b/templates/feature/agl-package-management/README_feature_agl-package-management.md
new file mode 100644
index 000000000..37562dd00
--- /dev/null
+++ b/templates/feature/agl-package-management/README_feature_agl-package-management.md
@@ -0,0 +1,8 @@
+---
+description: Feature agl-package-management
+authors: Scott Murray <scott.murray@konsulko.com>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Feature agl-package-management
+
+Adds package management to images.
diff --git a/templates/feature/agl-pipewire/50_bblayers.conf.inc b/templates/feature/agl-pipewire/50_bblayers.conf.inc
new file mode 100644
index 000000000..e05cd4090
--- /dev/null
+++ b/templates/feature/agl-pipewire/50_bblayers.conf.inc
@@ -0,0 +1,7 @@
+
+BBLAYERS =+ " \
+ ${METADIR}/meta-agl/meta-pipewire \
+ "
+
+# we ship our own pipewire
+BBMASK += "meta-openembedded/meta-oe/recipes-multimedia/pipewire/"
diff --git a/templates/feature/agl-pipewire/50_local.conf.inc b/templates/feature/agl-pipewire/50_local.conf.inc
new file mode 100644
index 000000000..33838b088
--- /dev/null
+++ b/templates/feature/agl-pipewire/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl-devel/meta-pipewire/conf/include/agl-pipewire.inc
+require conf/include/agl-pipewire.inc
diff --git a/templates/feature/agl-pipewire/README_feature_agl-pipewire.md b/templates/feature/agl-pipewire/README_feature_agl-pipewire.md
new file mode 100644
index 000000000..55e1931c3
--- /dev/null
+++ b/templates/feature/agl-pipewire/README_feature_agl-pipewire.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-pipewire
+authors: George Kiagiadakis <george.kiagiadakis@collabora.com>
+---
+
+### Feature agl-pipewire
+
+*Description is missing - please complete file meta-agl-devel/templates/feature/agl-pipewire/README_feature_agl-pipewire.md*
+
diff --git a/templates/feature/agl-ptest/90_local.conf.inc b/templates/feature/agl-ptest/90_local.conf.inc
new file mode 100644
index 000000000..dcaf72ab3
--- /dev/null
+++ b/templates/feature/agl-ptest/90_local.conf.inc
@@ -0,0 +1,9 @@
+
+# Enabling ptest in image ...
+
+OVERRIDES:append = ":agl-ptest"
+DISTRO_FEATURES:append = " ptest"
+EXTRA_IMAGE_FEATURES:append = " ptest-pkgs"
+IMAGE_INSTALL:append = " lua-ptest xmlsec1-ptest libxml2-ptest"
+
+# / ptest
diff --git a/templates/feature/agl-ptest/README_feature_agl-ptest.md b/templates/feature/agl-ptest/README_feature_agl-ptest.md
new file mode 100644
index 000000000..89ba4936b
--- /dev/null
+++ b/templates/feature/agl-ptest/README_feature_agl-ptest.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-ptest
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Romain Forlot <romain.forlot@iot.bzh>
+---
+
+### Feature agl-ptest
+
+*Description is missing - please complete file meta-agl/templates/feature/agl-ptest/README_feature_agl-ptest.md*
+
diff --git a/templates/feature/agl-refhw-h3/50_bblayers.conf.inc b/templates/feature/agl-refhw-h3/50_bblayers.conf.inc
new file mode 100644
index 000000000..7aee6eac5
--- /dev/null
+++ b/templates/feature/agl-refhw-h3/50_bblayers.conf.inc
@@ -0,0 +1,3 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-agl-refhw/meta-agl-refhw-gen3 \
+ "
diff --git a/templates/feature/agl-refhw-h3/50_local.conf.inc b/templates/feature/agl-refhw-h3/50_local.conf.inc
new file mode 100644
index 000000000..dc39dd52a
--- /dev/null
+++ b/templates/feature/agl-refhw-h3/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl/meta-agl-bsp/conf/include/agl_refhw-h3.inc
+require conf/include/agl_refhw-h3.inc
diff --git a/templates/feature/agl-refhw-h3/README_feature_agl-refhw-h3.md b/templates/feature/agl-refhw-h3/README_feature_agl-refhw-h3.md
new file mode 100644
index 000000000..57720bef1
--- /dev/null
+++ b/templates/feature/agl-refhw-h3/README_feature_agl-refhw-h3.md
@@ -0,0 +1,8 @@
+---
+description: AGL H3-based reference hardware support
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Feature agl-refhw-h3
+
+Enable support for AGL H3-based reference hardware. Should only be used with "h3ulcb" or "h3ulcb-nogfx" machine types.
diff --git a/templates/feature/agl-selinux/50_bblayers.conf.inc b/templates/feature/agl-selinux/50_bblayers.conf.inc
new file mode 100644
index 000000000..b17e292e9
--- /dev/null
+++ b/templates/feature/agl-selinux/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+
+BBLAYERS =+ " \
+ ${METADIR}/external/meta-selinux \
+ "
diff --git a/templates/feature/agl-selinux/50_local.conf.inc b/templates/feature/agl-selinux/50_local.conf.inc
new file mode 100644
index 000000000..4aaac2d14
--- /dev/null
+++ b/templates/feature/agl-selinux/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-agl/meta-agl/conf/include/agl-selinux.inc
+require conf/include/agl-selinux.inc
diff --git a/templates/feature/agl-selinux/README_feature_agl-selinux.md b/templates/feature/agl-selinux/README_feature_agl-selinux.md
new file mode 100644
index 000000000..c48ce06b0
--- /dev/null
+++ b/templates/feature/agl-selinux/README_feature_agl-selinux.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-selinux
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Feature agl-selinux
+
+Enables building with SELinux enabled, with the default mode
+being permissive.
diff --git a/templates/feature/agl-sota/50_bblayers.conf.inc b/templates/feature/agl-sota/50_bblayers.conf.inc
deleted file mode 100644
index bdcf07605..000000000
--- a/templates/feature/agl-sota/50_bblayers.conf.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-BBLAYERS =+ " \
- ${METADIR}/meta-updater \
- ${METADIR}/meta-openembedded/meta-filesystems \
- ${METADIR}/meta-openembedded/meta-python \
- ${METADIR}/meta-openembedded/meta-ruby \
- ${METADIR}/meta-rust \
- "
-
diff --git a/templates/feature/agl-sota/50_local.conf.inc b/templates/feature/agl-sota/50_local.conf.inc
deleted file mode 100644
index 42ff6bc1c..000000000
--- a/templates/feature/agl-sota/50_local.conf.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-#see meta-updater/conf/distro/sota.conf.inc
-require conf/distro/sota.conf.inc
diff --git a/templates/feature/agl-virt-guest-xen/50_local.conf.inc b/templates/feature/agl-virt-guest-xen/50_local.conf.inc
new file mode 100644
index 000000000..07950559e
--- /dev/null
+++ b/templates/feature/agl-virt-guest-xen/50_local.conf.inc
@@ -0,0 +1,3 @@
+# Set Xen flag
+
+AGL_XEN_GUEST_WANTED = "1"
diff --git a/templates/feature/agl-virt-xen/50_local.conf.inc b/templates/feature/agl-virt-xen/50_local.conf.inc
new file mode 100644
index 000000000..48f4b2b7d
--- /dev/null
+++ b/templates/feature/agl-virt-xen/50_local.conf.inc
@@ -0,0 +1,3 @@
+# Set Xen flag
+
+AGL_XEN_WANTED = "1"
diff --git a/templates/feature/agl-virt-xen/included.dep b/templates/feature/agl-virt-xen/included.dep
new file mode 100644
index 000000000..e4acef2bf
--- /dev/null
+++ b/templates/feature/agl-virt-xen/included.dep
@@ -0,0 +1 @@
+agl-virt
diff --git a/templates/feature/agl-virt/50_bblayers.conf.inc b/templates/feature/agl-virt/50_bblayers.conf.inc
new file mode 100644
index 000000000..65dc19580
--- /dev/null
+++ b/templates/feature/agl-virt/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+AGL_META_NETWORKING = "${METADIR}/external/meta-openembedded/meta-networking"
+AGL_META_FILESYSTEMS = "${METADIR}/external/meta-openembedded/meta-filesystems"
+AGL_META_VIRTUALIZATION = "${METADIR}/external/meta-virtualization"
+
diff --git a/templates/feature/agl-virt/50_local.conf.inc b/templates/feature/agl-virt/50_local.conf.inc
new file mode 100644
index 000000000..8a7e44a71
--- /dev/null
+++ b/templates/feature/agl-virt/50_local.conf.inc
@@ -0,0 +1,3 @@
+# meta-virtualization needs the "virtualization in DISTRO_FEATURES
+
+DISTRO_FEATURES:append = " virtualization"
diff --git a/templates/feature/agl-weston-remoting/50_local.conf.inc b/templates/feature/agl-weston-remoting/50_local.conf.inc
new file mode 100644
index 000000000..63e0a984a
--- /dev/null
+++ b/templates/feature/agl-weston-remoting/50_local.conf.inc
@@ -0,0 +1 @@
+DISTRO_FEATURES:append = " weston-remoting"
diff --git a/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md b/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md
new file mode 100644
index 000000000..03b05d496
--- /dev/null
+++ b/templates/feature/agl-weston-remoting/README_feature_agl-weston-remoting.md
@@ -0,0 +1,9 @@
+---
+description: Feature agl-weston-remoting
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Feature agl-weston-remoting
+
+Enables secondary remote display configuration using Weston's remoting feaure.
+
diff --git a/templates/feature/agl-weston-remoting/included.dep b/templates/feature/agl-weston-remoting/included.dep
new file mode 100644
index 000000000..82639da07
--- /dev/null
+++ b/templates/feature/agl-weston-remoting/included.dep
@@ -0,0 +1 @@
+agl-demo
diff --git a/templates/machine/am62xx-evm/50_bblayers.conf.inc b/templates/machine/am62xx-evm/50_bblayers.conf.inc
new file mode 100644
index 000000000..6ef08c43e
--- /dev/null
+++ b/templates/machine/am62xx-evm/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ "
diff --git a/templates/machine/am62xx-evm/50_local.conf.inc b/templates/machine/am62xx-evm/50_local.conf.inc
new file mode 100644
index 000000000..782d11a76
--- /dev/null
+++ b/templates/machine/am62xx-evm/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "am62xx-evm"
+#see meta-agl/meta-agl-bsp/conf/include/agl_am62xx-evm.inc
+require conf/include/agl_am62xx-evm.inc
diff --git a/templates/machine/aws-ec2-arm64/50_bblayers.conf.inc b/templates/machine/aws-ec2-arm64/50_bblayers.conf.inc
new file mode 100644
index 000000000..4e619cde0
--- /dev/null
+++ b/templates/machine/aws-ec2-arm64/50_bblayers.conf.inc
@@ -0,0 +1,8 @@
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+AGL_META_MULTIMEDIA = "${METADIR}/external/meta-openembedded/meta-multimedia"
+AGL_META_NETWORKING = "${METADIR}/external/meta-openembedded/meta-networking"
+AGL_META_VIRTUALIZATION = "${METADIR}/external/meta-virtualization"
+
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-aws \
+ "
diff --git a/templates/machine/aws-ec2-arm64/50_local.conf.inc b/templates/machine/aws-ec2-arm64/50_local.conf.inc
new file mode 100644
index 000000000..ca20e0bf2
--- /dev/null
+++ b/templates/machine/aws-ec2-arm64/50_local.conf.inc
@@ -0,0 +1,21 @@
+MACHINE = "aws-ec2-arm64"
+
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
+IMAGE_INSTALL:append = " cloud-init"
+DISTRO_FEATURES:append = " virtualization"
+
+
+# can we shuffle this out so CI still works
+INHERIT += "extrausers"
+# Hardening: Locking the root password. Creating the user without password for ssh key-based login only
+EXTRA_USERS_PARAMS = "usermod -L root; useradd -p '*' user"
+
+EXTRA_IMAGE_FEATURES:append = " ssh-server-openssh"
+
+# Forcing removal of debug-tweakes as that leads to reversing some sshd_config hardening done in our bbappend when do_rootfs runs
+EXTRA_IMAGE_FEATURES:remove = "debug-tweaks"
+
+AGL_DEFAULT_IMAGE_FSTYPES := "wic.vhd"
+
+# workaround bug in cloud-init leading to empty cloud-init-systemd package
+PACKAGES:pn-cloud-init:forcevariable = "cloud-init-src cloud-init-dbg cloud-init-staticdev cloud-init-dev cloud-init-doc cloud-init-locale cloud-init-systemd cloud-init"
diff --git a/templates/machine/aws-ec2-x86-64/50_bblayers.conf.inc b/templates/machine/aws-ec2-x86-64/50_bblayers.conf.inc
new file mode 100644
index 000000000..4e619cde0
--- /dev/null
+++ b/templates/machine/aws-ec2-x86-64/50_bblayers.conf.inc
@@ -0,0 +1,8 @@
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+AGL_META_MULTIMEDIA = "${METADIR}/external/meta-openembedded/meta-multimedia"
+AGL_META_NETWORKING = "${METADIR}/external/meta-openembedded/meta-networking"
+AGL_META_VIRTUALIZATION = "${METADIR}/external/meta-virtualization"
+
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-aws \
+ "
diff --git a/templates/machine/aws-ec2-x86-64/50_local.conf.inc b/templates/machine/aws-ec2-x86-64/50_local.conf.inc
new file mode 100644
index 000000000..58b4b087d
--- /dev/null
+++ b/templates/machine/aws-ec2-x86-64/50_local.conf.inc
@@ -0,0 +1,21 @@
+MACHINE = "aws-ec2-x86-64"
+
+VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
+IMAGE_INSTALL:append = " cloud-init"
+DISTRO_FEATURES:append = " virtualization"
+
+
+# can we shuffle this out so CI still works
+INHERIT += "extrausers"
+# Hardening: Locking the root password. Creating the user without password for ssh key-based login only
+EXTRA_USERS_PARAMS = "usermod -L root; useradd -p '*' user"
+
+EXTRA_IMAGE_FEATURES:append = " ssh-server-openssh"
+
+# Forcing removal of debug-tweakes as that leads to reversing some sshd_config hardening done in our bbappend when do_rootfs runs
+EXTRA_IMAGE_FEATURES:remove = "debug-tweaks"
+
+AGL_DEFAULT_IMAGE_FSTYPES := "wic.vhd"
+
+# workaround bug in cloud-init leading to empty cloud-init-systemd package
+PACKAGES:pn-cloud-init:forcevariable = "cloud-init-src cloud-init-dbg cloud-init-staticdev cloud-init-dev cloud-init-doc cloud-init-locale cloud-init-systemd cloud-init"
diff --git a/templates/machine/bbe/50_bblayers.conf.inc b/templates/machine/bbe/50_bblayers.conf.inc
new file mode 100644
index 000000000..c94c1db8f
--- /dev/null
+++ b/templates/machine/bbe/50_bblayers.conf.inc
@@ -0,0 +1,7 @@
+BBLAYERS =+ " \
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ ${METADIR}/bsp/meta-sancloud \
+ ${METADIR}/bsp/meta-rtlwifi \
+ "
diff --git a/templates/machine/bbe/50_local.conf.inc b/templates/machine/bbe/50_local.conf.inc
new file mode 100644
index 000000000..7f378e5cb
--- /dev/null
+++ b/templates/machine/bbe/50_local.conf.inc
@@ -0,0 +1,2 @@
+MACHINE = "bbe"
+require conf/include/agl_bbe.inc
diff --git a/templates/machine/bbe/README_machine_bbe.md b/templates/machine/bbe/README_machine_bbe.md
new file mode 100644
index 000000000..3161a0195
--- /dev/null
+++ b/templates/machine/bbe/README_machine_bbe.md
@@ -0,0 +1,12 @@
+---
+description: SanCloud BeagleBone Enhanced (BBE)
+authors: SanCloud Ltd <yocto@sancloud.co.uk>
+---
+
+### SanCloud BeagleBone Enhanced (BBE)
+
+* [SanCloud website](https://www.sancloud.co.uk/)
+
+* [BeagleBone Enhanced Description](https://www.sancloud.co.uk/beaglebone-enhanced-bbe)
+
+* [Sancloud repositories on GitHub](https://github.com/SanCloudLtd)
diff --git a/templates/machine/beaglebone-ai64/50_bblayers.conf.inc b/templates/machine/beaglebone-ai64/50_bblayers.conf.inc
new file mode 100644
index 000000000..6ef08c43e
--- /dev/null
+++ b/templates/machine/beaglebone-ai64/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ "
diff --git a/templates/machine/beaglebone-ai64/50_local.conf.inc b/templates/machine/beaglebone-ai64/50_local.conf.inc
new file mode 100644
index 000000000..80d4aac97
--- /dev/null
+++ b/templates/machine/beaglebone-ai64/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "beaglebone-ai64"
+#see meta-agl/meta-agl-bsp/conf/include/agl_beaglebone-ai64.inc
+require conf/include/agl_beaglebone-ai64.inc
diff --git a/templates/machine/beaglebone-ai64/README_machine_beaglebone-ai64.md b/templates/machine/beaglebone-ai64/README_machine_beaglebone-ai64.md
new file mode 100644
index 000000000..7edf758a5
--- /dev/null
+++ b/templates/machine/beaglebone-ai64/README_machine_beaglebone-ai64.md
@@ -0,0 +1,9 @@
+---
+description: Machine beaglebone-ai64
+authors: Denys Dmytriyenko <denys@konsulko.com>
+---
+
+### Machine beaglebone-ai64
+
+BeagleBoard.org BeagleBone AI-64 (uses Texas Instruments J721e/TDA4VM SoC).
+
diff --git a/templates/machine/beaglebone/50_bblayers.conf.inc b/templates/machine/beaglebone/50_bblayers.conf.inc
index c62a1bbb3..6ef08c43e 100644
--- a/templates/machine/beaglebone/50_bblayers.conf.inc
+++ b/templates/machine/beaglebone/50_bblayers.conf.inc
@@ -1 +1,5 @@
-BBLAYERS =+ "${METADIR}/meta-ti"
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ "
diff --git a/templates/machine/beaglebone/README_machine_beaglebone.md b/templates/machine/beaglebone/README_machine_beaglebone.md
new file mode 100644
index 000000000..06fbcee2f
--- /dev/null
+++ b/templates/machine/beaglebone/README_machine_beaglebone.md
@@ -0,0 +1,9 @@
+---
+description: Machine beaglebone
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Machine beaglebone
+
+*Description is missing - please complete file meta-agl/templates/machine/beaglebone/README_machine_beaglebone.md*
+
diff --git a/templates/machine/beagleplay/50_bblayers.conf.inc b/templates/machine/beagleplay/50_bblayers.conf.inc
new file mode 100644
index 000000000..6ef08c43e
--- /dev/null
+++ b/templates/machine/beagleplay/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ "
diff --git a/templates/machine/beagleplay/50_local.conf.inc b/templates/machine/beagleplay/50_local.conf.inc
new file mode 100644
index 000000000..334f81819
--- /dev/null
+++ b/templates/machine/beagleplay/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "beagleplay"
+#see meta-agl/meta-agl-bsp/conf/include/agl_beagleplay.inc
+require conf/include/agl_beagleplay.inc
diff --git a/templates/machine/beagleplay/README_machine_beagleplay.md b/templates/machine/beagleplay/README_machine_beagleplay.md
new file mode 100644
index 000000000..d4528fba2
--- /dev/null
+++ b/templates/machine/beagleplay/README_machine_beagleplay.md
@@ -0,0 +1,9 @@
+---
+description: Machine beagleplay
+authors: Denys Dmytriyenko <denys@konsulko.com>
+---
+
+### Machine beagleplay
+
+BeagleBoard.org BeaglePlay (uses Texas Instruments AM625x SoC).
+
diff --git a/templates/machine/imx6qsabreauto/40_bblayers.conf.inc b/templates/machine/cubox-i/40_bblayers.conf.inc
index f09144959..a4323be1a 100644
--- a/templates/machine/imx6qsabreauto/40_bblayers.conf.inc
+++ b/templates/machine/cubox-i/40_bblayers.conf.inc
@@ -1,7 +1,6 @@
# This must be parsed after qt5, etc. layers so that they are correctly
# recognized by meta-freescale/dynamic-layers
BBLAYERS =+ "\
- ${METADIR}/meta-freescale \
- ${METADIR}/meta-freescale-3rdparty \
- ${METADIR}/meta-freescale-distro \
+ ${METADIR}/bsp/meta-freescale \
+ ${METADIR}/bsp/meta-freescale-3rdparty \
"
diff --git a/templates/machine/cubox-i/50_local.conf.inc b/templates/machine/cubox-i/50_local.conf.inc
new file mode 100644
index 000000000..b0835bf6e
--- /dev/null
+++ b/templates/machine/cubox-i/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "cubox-i"
+#see meta-agl/meta-agl-bsp/conf/include/agl_cubox-i.inc
+require conf/include/agl_cubox-i.inc
+
diff --git a/templates/machine/cubox-i/50_setup.sh b/templates/machine/cubox-i/50_setup.sh
new file mode 100644
index 000000000..eefd1eb7f
--- /dev/null
+++ b/templates/machine/cubox-i/50_setup.sh
@@ -0,0 +1,2 @@
+find_and_ack_eula $METADIR/bsp/meta-freescale EULA
+export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/cubox-i/README_machine_cubox-i.md b/templates/machine/cubox-i/README_machine_cubox-i.md
new file mode 100644
index 000000000..2d264d5d8
--- /dev/null
+++ b/templates/machine/cubox-i/README_machine_cubox-i.md
@@ -0,0 +1,9 @@
+---
+description: Machine cubox-i
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Machine cubox-i
+
+*Description is missing - please complete file meta-agl/templates/machine/cubox-i/README_machine_cubox-i.md*
+
diff --git a/templates/machine/cyclone5/50_bblayers.conf.inc b/templates/machine/cyclone5/50_bblayers.conf.inc
deleted file mode 100644
index fe60a267f..000000000
--- a/templates/machine/cyclone5/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-altera"
diff --git a/templates/machine/cyclone5/50_local.conf.inc b/templates/machine/cyclone5/50_local.conf.inc
deleted file mode 100644
index a4761ef4c..000000000
--- a/templates/machine/cyclone5/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "cyclone5"
-#see meta-agl/meta-agl-bsp/conf/include/agl_cyclone5.inc
-require conf/include/agl_cyclone5.inc
diff --git a/templates/machine/dra7xx-evm/50_bblayers.conf.inc b/templates/machine/dra7xx-evm/50_bblayers.conf.inc
deleted file mode 100644
index c62a1bbb3..000000000
--- a/templates/machine/dra7xx-evm/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-ti"
diff --git a/templates/machine/dra7xx-evm/50_local.conf.inc b/templates/machine/dra7xx-evm/50_local.conf.inc
deleted file mode 100644
index e43a4f294..000000000
--- a/templates/machine/dra7xx-evm/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "dra7xx-evm"
-#see meta-agl/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
-require conf/include/agl_dra7xx-evm.inc
diff --git a/templates/machine/dra7xx-evm/test/hwtest.enable b/templates/machine/dra7xx-evm/test/hwtest.enable
deleted file mode 100644
index d00491fd7..000000000
--- a/templates/machine/dra7xx-evm/test/hwtest.enable
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/templates/machine/dra7xx-evm/test/hwtest.short.enable b/templates/machine/dra7xx-evm/test/hwtest.short.enable
deleted file mode 100644
index d00491fd7..000000000
--- a/templates/machine/dra7xx-evm/test/hwtest.short.enable
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/templates/machine/dra7xx-evm/test/hwtest.short.environment b/templates/machine/dra7xx-evm/test/hwtest.short.environment
deleted file mode 100644
index 2db9ab26e..000000000
--- a/templates/machine/dra7xx-evm/test/hwtest.short.environment
+++ /dev/null
@@ -1,11 +0,0 @@
-DEVICE_TYPE=ti-vayu-uboot
-DEVICE_NAME=dra7xx-evm
-DEVICE_DTB=zImage-dra7-evm-lcd-lg.dtb
-DEVICE_KERNEL=zImage
-DEVICE_INITRAMFS=initramfs-netboot-image-dra7xx-evm.ext4.gz
-DEVICE_NBDROOT=agl-demo-platform-dra7xx-evm.ext4.xz
-DEVICE_NBDROOT_COMPRESSION=xz
-DEVICE_BOOT_METHOD=u-boot
-DEVICE_BOOT_TYPE=bootz
-#DEVICE_URL_PREFIX=https://download.automotivelinux.org/AGL
-# \ No newline at end of file
diff --git a/templates/machine/dra7xx-evm/test/testjob_short.yaml b/templates/machine/dra7xx-evm/test/testjob_short.yaml
deleted file mode 100644
index 304cc8a6b..000000000
--- a/templates/machine/dra7xx-evm/test/testjob_short.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-# Your first LAVA JOB definition for a vayu board
-device_type: @REPLACE_DEVICE_TYPE@
-job_name: AGL-short-smoke
-
-protocols:
- lava-xnbd:
- port: auto
-
-timeouts:
- job:
- minutes: 30
- action:
- minutes: 15
- connection:
- minutes: 5
- bootloader-commands:
- minutes: 4
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
- timeout:
- minutes: 15
- to: nbd
- dtb:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
- kernel:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
- initrd:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
- allow_modify: false
- nbdroot:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
- compression: @REPLACE_NBDROOT_COMPRESSION@
- os: debian
- failure_retry: 2
-
-# BOOT_BLOCK
-- boot:
- method: @REPLACE_BOOT_METHOD@
- commands: nbd
- type: @REPLACE_BOOT_TYPE@
- prompts: ["root@@REPLACE_MACHINE@:~"]
- auto_login:
- login_prompt: "login:"
- username: root
- failure_retry: 2
-
-
diff --git a/templates/machine/dragonboard-410c/50_bblayers.conf.inc b/templates/machine/dragonboard-410c/50_bblayers.conf.inc
deleted file mode 100644
index 01ffb7f17..000000000
--- a/templates/machine/dragonboard-410c/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-qcom"
diff --git a/templates/machine/dragonboard-410c/50_local.conf.inc b/templates/machine/dragonboard-410c/50_local.conf.inc
deleted file mode 100644
index f717fd8ee..000000000
--- a/templates/machine/dragonboard-410c/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "dragonboard-410c"
-#see meta-agl/meta-agl-bsp/conf/include/agl_dragonboard-410c.inc
-require conf/include/agl_dragonboard-410c.inc
diff --git a/templates/machine/dragonboard-410c/50_setup.sh b/templates/machine/dragonboard-410c/50_setup.sh
deleted file mode 100644
index 7be1dad32..000000000
--- a/templates/machine/dragonboard-410c/50_setup.sh
+++ /dev/null
@@ -1 +0,0 @@
-find_and_ack_eula $METADIR/meta-qcom
diff --git a/templates/machine/ebisu/50_bblayers.conf.inc b/templates/machine/ebisu/50_bblayers.conf.inc
new file mode 100644
index 000000000..e06bd413d
--- /dev/null
+++ b/templates/machine/ebisu/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/ebisu/50_local.conf.inc b/templates/machine/ebisu/50_local.conf.inc
new file mode 100644
index 000000000..c62dec4ae
--- /dev/null
+++ b/templates/machine/ebisu/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "ebisu"
+#see meta-agl/meta-agl-bsp/conf/include/agl_ebisu.inc
+require conf/include/agl_ebisu.inc
diff --git a/templates/machine/ebisu/50_setup.sh b/templates/machine/ebisu/50_setup.sh
new file mode 100644
index 000000000..188da6e5e
--- /dev/null
+++ b/templates/machine/ebisu/50_setup.sh
@@ -0,0 +1,45 @@
+# setup proprietary gfx drivers and multimedia packages
+pushd $METADIR 2>/dev/null
+
+COPY_SCRIPT="$METADIR/bsp/meta-renesas/meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh"
+EXTRACT_DIR=$METADIR/binary-tmp
+#EBISU_BIN_PATH should contain the path where the .zip archive of E3 binaries is.
+#CUSTOM_RENESAS_CONFIG_SCRIPT should contain the custom script needed for setup. If not filled, do not failed, just warn.
+
+# Check the ebisu binaries path
+if [[ ! -d $EBISU_BIN_PATH ]] || [[ $EBISU_BIN_PATH == "" ]]; then
+ echo "ERROR: E3 Binary path not valid."
+ echo "HELP: Export the path where the E3 Binaries ZIP file is into 'EBISU_BIN_PATH' then launch the setup again."
+ echo "HELP: Example: '$ export EBISU_BIN_PATH=`pwd`/ebisu_binaries'"
+ exit 1
+else
+ [ -z "$(ls -A $EBISU_BIN_PATH)" ] && echo "ERROR: $EBISU_BIN_PATH is empty. Add the E3 Binaries ZIP file inside and try again." && exit 1
+fi
+
+if [ -f $COPY_SCRIPT ]; then
+ # Extract the ZIP into the tmp directory
+ mkdir -p $EXTRACT_DIR
+ for PROPRIETARY_BIN in `ls -1 $EBISU_BIN_PATH/*.zip`
+ do
+ unzip -q -o $PROPRIETARY_BIN -d $EXTRACT_DIR
+ done
+
+ cd $METADIR/bsp/meta-renesas/
+ $COPY_SCRIPT $EXTRACT_DIR
+ cd ..
+
+ # Clean temp dir
+ rm -r $EXTRACT_DIR
+else
+ echo "ERROR: Script to copy Renesas proprietary drivers for $MACHINE not found. No additionnal setup to do."
+ exit 1
+fi
+
+if [[ ! -z $CUSTOM_RENESAS_CONFIG_SCRIPT ]] && [[ -f $CUSTOM_RENESAS_CONFIG_SCRIPT ]]; then
+ echo "Launching Renesas custom setup script ($CUSTOM_RENESAS_CONFIG_SCRIPT)..."
+ $CUSTOM_RENESAS_CONFIG_SCRIPT
+else
+ echo "WARNING: Renesas custom setup script for $MACHINE not found."
+fi
+
+popd 2>/dev/null
diff --git a/templates/machine/ebisu/README_machine_ebisu.md b/templates/machine/ebisu/README_machine_ebisu.md
new file mode 100644
index 000000000..eb5666ecc
--- /dev/null
+++ b/templates/machine/ebisu/README_machine_ebisu.md
@@ -0,0 +1,44 @@
+---
+description: machine ebisu
+author: <undefined>
+---
+## Machine 'ebisu'
+
+### Prepare the build
+
+Before building the AGL distribution for Renesas 'ebisu' board, it is necessary to prepare the environnement. See [AGL Doc - Initializing Your Build Environment](https://docs.automotivelinux.org/docs/en/master/getting_started/reference/getting-started/image-workflow-initialize-build-environment.html) before going to the next step.
+
+The 'ebisu' board need some specifics binaries in order to build. These binaries contain Graphics support, specific drivers... They are only delivered by Renesas.
+Before setting up the build with `meta-agl/scripts/aglsetup.sh`, the environment variable `EBISU_BIN_PATH` need to be set. This variable specify the path to a folder which contains all ebisu's binaries zip files.
+
+Moreover, it's possible to launch a custom bash script during the setup. This optional step will be called at the end of the `aglsetup.sh` sequence. This can be used to add a specific configuration to the official setup or add a hotfix.
+
+Example:
+```bash
+$ cd $AGL_TOP
+$ export EBISU_BIN_PATH=/home/user/Downloads/ebisu_binaries
+$ export CUSTOM_RENESAS_CONFIG_SCRIPT=/path/to/my/Renesas_custom_setup_ebisu.sh #optional
+$ source meta-agl/scripts/aglsetup.sh -m ebisu agl-demo -f
+```
+
+### Launch the build
+
+When your environnment is ready, you can launch the AGL build with `bitbake` :
+
+```bash
+$ cd $AGL_TOP
+$ bitbake agl-demo-platform
+```
+
+### Debugging the board
+
+To debug the ebisu board, the PC should be connected to the CN25 USB serial port.
+And the serial communication's protocol of the terminal software on the PC should be set as follows:
+
+Parameter | Value
+--- | ---
+Transfer rate | 115200 bps
+Data length | 8 bits
+Parity | Not in use
+Stop bit | 1 bit
+Flow control | Not provided
diff --git a/templates/machine/generic-arm64/50_bblayers.conf.inc b/templates/machine/generic-arm64/50_bblayers.conf.inc
new file mode 100644
index 000000000..05e60f69b
--- /dev/null
+++ b/templates/machine/generic-arm64/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ "
diff --git a/templates/machine/generic-arm64/50_local.conf.inc b/templates/machine/generic-arm64/50_local.conf.inc
new file mode 100644
index 000000000..3918af8dd
--- /dev/null
+++ b/templates/machine/generic-arm64/50_local.conf.inc
@@ -0,0 +1,2 @@
+MACHINE = "generic-arm64"
+
diff --git a/templates/machine/generic-arm64/README_machine_generic-arm64.md b/templates/machine/generic-arm64/README_machine_generic-arm64.md
new file mode 100644
index 000000000..22dcb1fec
--- /dev/null
+++ b/templates/machine/generic-arm64/README_machine_generic-arm64.md
@@ -0,0 +1,10 @@
+---
+description: Machine generic-arm64
+authors: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+
+### Machine generic-arm64
+
+This is a standard aarch64 (ARM 64bit) machine for use with 'SystemReady'
+(aka UEFI) systems.
+
diff --git a/templates/machine/h3-salvator-x/50_bblayers.conf.inc b/templates/machine/h3-salvator-x/50_bblayers.conf.inc
new file mode 100644
index 000000000..e06bd413d
--- /dev/null
+++ b/templates/machine/h3-salvator-x/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/h3-salvator-x/50_local.conf.inc b/templates/machine/h3-salvator-x/50_local.conf.inc
new file mode 100644
index 000000000..05cca9743
--- /dev/null
+++ b/templates/machine/h3-salvator-x/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "salvator-x"
+#see meta-agl/meta-agl-bsp/conf/include/agl_h3-salvator-x.inc
+require conf/include/agl_h3-salvator-x.inc
+
diff --git a/templates/machine/h3-salvator-x/50_setup.sh b/templates/machine/h3-salvator-x/50_setup.sh
new file mode 100644
index 000000000..abd2a33af
--- /dev/null
+++ b/templates/machine/h3-salvator-x/50_setup.sh
@@ -0,0 +1,10 @@
+# setup proprietary gfx drivers and multimedia packages
+pushd $METADIR 2>/dev/null
+
+SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
+if [ -f $SETUP_MM_SCRIPT ]; then
+ . $SETUP_MM_SCRIPT
+ copy_mm_packages
+fi
+
+popd 2>/dev/null
diff --git a/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md b/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md
new file mode 100644
index 000000000..9cd793f7a
--- /dev/null
+++ b/templates/machine/h3-salvator-x/README_machine_h3-salvator-x.md
@@ -0,0 +1,11 @@
+---
+description: Machine h3-salvator-x
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Martin Kelly <mkelly@xevo.com>, Ronan Le Martret <ronan.lemartret@iot.bzh> Duy Dang <duy.dang.yw@renesas.com>
+---
+
+### Machine h3-salvator-x
+
+salvator-x board with an h3 SoC.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Salvator-X](https://elinux.org/R-Car/Boards/Salvator-X)
diff --git a/templates/machine/h3ulcb-kf/50_bblayers.conf.inc b/templates/machine/h3ulcb-kf/50_bblayers.conf.inc
new file mode 100644
index 000000000..25e36b019
--- /dev/null
+++ b/templates/machine/h3ulcb-kf/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/h3ulcb-kf/50_local.conf.inc b/templates/machine/h3ulcb-kf/50_local.conf.inc
new file mode 100644
index 000000000..43e117372
--- /dev/null
+++ b/templates/machine/h3ulcb-kf/50_local.conf.inc
@@ -0,0 +1,7 @@
+MACHINE = "h3ulcb"
+#see meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb.inc
+require conf/include/agl_h3ulcb.inc
+
+#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
+require conf/include/rcar-gen3-adas.inc
+
diff --git a/templates/machine/h3ulcb-kf/50_setup.sh b/templates/machine/h3ulcb-kf/50_setup.sh
new file mode 100644
index 000000000..abd2a33af
--- /dev/null
+++ b/templates/machine/h3ulcb-kf/50_setup.sh
@@ -0,0 +1,10 @@
+# setup proprietary gfx drivers and multimedia packages
+pushd $METADIR 2>/dev/null
+
+SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
+if [ -f $SETUP_MM_SCRIPT ]; then
+ . $SETUP_MM_SCRIPT
+ copy_mm_packages
+fi
+
+popd 2>/dev/null
diff --git a/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md b/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md
new file mode 100644
index 000000000..cdef9afa8
--- /dev/null
+++ b/templates/machine/h3ulcb-kf/README_machine_h3ulcb-kf.md
@@ -0,0 +1,12 @@
+---
+description: Machine h3ulcb-kf
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh>
+---
+
+### Machine h3ulcb-kf
+
+Renesas RCar Gen3 "h3ulcb" board with Kingfisher baseboard.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
+* [R-Car/Boards/Kingfisher](https://elinux.org/R-Car/Boards/Kingfisher)
diff --git a/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc b/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc
new file mode 100644
index 000000000..e06bd413d
--- /dev/null
+++ b/templates/machine/h3ulcb-nogfx/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/h3ulcb-nogfx/50_local.conf.inc b/templates/machine/h3ulcb-nogfx/50_local.conf.inc
new file mode 100644
index 000000000..2f7cd6b35
--- /dev/null
+++ b/templates/machine/h3ulcb-nogfx/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "h3ulcb"
+#see meta-agl/meta-agl-bsp/conf/include/agl_h3ulcb-nogfx.inc
+require conf/include/agl_h3ulcb-nogfx.inc
diff --git a/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md b/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md
new file mode 100644
index 000000000..a1f3b9f61
--- /dev/null
+++ b/templates/machine/h3ulcb-nogfx/README_machine_h3ulcb-nogfx.md
@@ -0,0 +1,11 @@
+---
+description: Machine h3ulcb-nogfx
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Kevin Hilman <khilman@baylibre.com>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Yannick Gicquel <yannick.gicquel@iot.bzh>
+---
+
+### Machine h3ulcb-nogfx
+
+This is a "h3ulcb" machine without proprietary graphics driver support.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
diff --git a/templates/machine/h3ulcb/50_bblayers.conf.inc b/templates/machine/h3ulcb/50_bblayers.conf.inc
index b58989c6f..e06bd413d 100644
--- a/templates/machine/h3ulcb/50_bblayers.conf.inc
+++ b/templates/machine/h3ulcb/50_bblayers.conf.inc
@@ -1,3 +1,4 @@
BBLAYERS =+ "\
- ${METADIR}/meta-renesas-rcar-gen3/meta-rcar-gen3 \
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
"
diff --git a/templates/machine/h3ulcb/README_machine_h3ulcb.md b/templates/machine/h3ulcb/README_machine_h3ulcb.md
new file mode 100644
index 000000000..fffad09b2
--- /dev/null
+++ b/templates/machine/h3ulcb/README_machine_h3ulcb.md
@@ -0,0 +1,11 @@
+---
+description: Machine h3ulcb
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh>
+---
+
+### Machine h3ulcb
+
+Renesas RCar Gen3 "h3ulcb" board.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
diff --git a/templates/machine/imx6qdlsabreauto/40_bblayers.conf.inc b/templates/machine/imx6qdlsabreauto/40_bblayers.conf.inc
new file mode 100644
index 000000000..edcb6a3a2
--- /dev/null
+++ b/templates/machine/imx6qdlsabreauto/40_bblayers.conf.inc
@@ -0,0 +1,5 @@
+# This must be parsed after qt5, etc. layers so that they are correctly
+# recognized by meta-freescale/dynamic-layers
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-freescale \
+ "
diff --git a/templates/machine/imx6qdlsabreauto/50_local.conf.inc b/templates/machine/imx6qdlsabreauto/50_local.conf.inc
new file mode 100644
index 000000000..58e3c7d02
--- /dev/null
+++ b/templates/machine/imx6qdlsabreauto/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "imx6qdlsabreauto"
+#see meta-agl/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc
+require conf/include/agl_imx6qdlsabreauto.inc
+
diff --git a/templates/machine/imx6qdlsabreauto/50_setup.sh b/templates/machine/imx6qdlsabreauto/50_setup.sh
new file mode 100644
index 000000000..eefd1eb7f
--- /dev/null
+++ b/templates/machine/imx6qdlsabreauto/50_setup.sh
@@ -0,0 +1,2 @@
+find_and_ack_eula $METADIR/bsp/meta-freescale EULA
+export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/imx6qdlsabreauto/README_machine_imx6qdlsabreauto.md b/templates/machine/imx6qdlsabreauto/README_machine_imx6qdlsabreauto.md
new file mode 100644
index 000000000..6b354e9fa
--- /dev/null
+++ b/templates/machine/imx6qdlsabreauto/README_machine_imx6qdlsabreauto.md
@@ -0,0 +1,9 @@
+---
+description: Machine imx6qdlsabreauto
+authors: Bechir Mghirbi <bechir.mghirbi@grammer.com>, Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Machine imx6qdlsabreauto
+
+*Description is missing - please complete file meta-agl/templates/machine/imx6qdlsabreauto/README_machine_imx6qdlsabreauto.md*
+
diff --git a/templates/machine/imx6qsabreauto/50_local.conf.inc b/templates/machine/imx6qsabreauto/50_local.conf.inc
deleted file mode 100644
index cbfda6a86..000000000
--- a/templates/machine/imx6qsabreauto/50_local.conf.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-MACHINE = "imx6qsabreauto"
-#see meta-agl/meta-agl-bsp/conf/include/agl_imx6qsabreauto.inc
-require conf/include/agl_imx6qsabreauto.inc
-
diff --git a/templates/machine/imx6qsabreauto/50_setup.sh b/templates/machine/imx6qsabreauto/50_setup.sh
deleted file mode 100644
index bb22790dc..000000000
--- a/templates/machine/imx6qsabreauto/50_setup.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-find_and_ack_eula $METADIR/meta-freescale EULA
-export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/imx6qsabrelite/50_bblayers.conf.inc b/templates/machine/imx6qsabrelite/50_bblayers.conf.inc
deleted file mode 100644
index 0198eb464..000000000
--- a/templates/machine/imx6qsabrelite/50_bblayers.conf.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-BBLAYERS =+ "\
- ${METADIR}/meta-fsl-arm \
- ${METADIR}/meta-fsl-arm-extra \
- "
diff --git a/templates/machine/imx6qsabrelite/50_local.conf.inc b/templates/machine/imx6qsabrelite/50_local.conf.inc
deleted file mode 100644
index 83754d860..000000000
--- a/templates/machine/imx6qsabrelite/50_local.conf.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-MACHINE = "imx6qsabrelite"
-
diff --git a/templates/machine/imx6qsabrelite/50_setup.sh b/templates/machine/imx6qsabrelite/50_setup.sh
deleted file mode 100644
index ea340a763..000000000
--- a/templates/machine/imx6qsabrelite/50_setup.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-find_and_ack_eula $METADIR/meta-fsl-arm EULA
-export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/imx8mq-evk-viv/40_bblayers.conf.inc b/templates/machine/imx8mq-evk-viv/40_bblayers.conf.inc
new file mode 100644
index 000000000..edcb6a3a2
--- /dev/null
+++ b/templates/machine/imx8mq-evk-viv/40_bblayers.conf.inc
@@ -0,0 +1,5 @@
+# This must be parsed after qt5, etc. layers so that they are correctly
+# recognized by meta-freescale/dynamic-layers
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-freescale \
+ "
diff --git a/templates/machine/imx8mq-evk-viv/50_local.conf.inc b/templates/machine/imx8mq-evk-viv/50_local.conf.inc
new file mode 100644
index 000000000..7504c1120
--- /dev/null
+++ b/templates/machine/imx8mq-evk-viv/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "imx8mq-evk"
+#see meta-agl/meta-agl-bsp/conf/include/agl_imx8mq-evk-viv.inc
+require conf/include/agl_imx8mq-evk-viv.inc
diff --git a/templates/machine/imx8mq-evk-viv/50_setup.sh b/templates/machine/imx8mq-evk-viv/50_setup.sh
new file mode 100644
index 000000000..eefd1eb7f
--- /dev/null
+++ b/templates/machine/imx8mq-evk-viv/50_setup.sh
@@ -0,0 +1,2 @@
+find_and_ack_eula $METADIR/bsp/meta-freescale EULA
+export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/imx8mq-evk-viv/README_machine_imx8mq-evk-viv.md b/templates/machine/imx8mq-evk-viv/README_machine_imx8mq-evk-viv.md
new file mode 100644
index 000000000..be30e00fe
--- /dev/null
+++ b/templates/machine/imx8mq-evk-viv/README_machine_imx8mq-evk-viv.md
@@ -0,0 +1,9 @@
+---
+description: i.MX8MQ EVK with Vivante GPU driver
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Machine imx8mqevk-viv
+
+i.MX8MQ EVK and EVKB boards with Vivante GPU driver support.
+
diff --git a/templates/machine/imx8mq-evk/40_bblayers.conf.inc b/templates/machine/imx8mq-evk/40_bblayers.conf.inc
new file mode 100644
index 000000000..edcb6a3a2
--- /dev/null
+++ b/templates/machine/imx8mq-evk/40_bblayers.conf.inc
@@ -0,0 +1,5 @@
+# This must be parsed after qt5, etc. layers so that they are correctly
+# recognized by meta-freescale/dynamic-layers
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-freescale \
+ "
diff --git a/templates/machine/imx8mq-evk/50_local.conf.inc b/templates/machine/imx8mq-evk/50_local.conf.inc
new file mode 100644
index 000000000..8a178e28b
--- /dev/null
+++ b/templates/machine/imx8mq-evk/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "imx8mq-evk"
+#see meta-agl/meta-agl-bsp/conf/include/agl_imx8mq-evk.inc
+require conf/include/agl_imx8mq-evk.inc
diff --git a/templates/machine/imx8mq-evk/50_setup.sh b/templates/machine/imx8mq-evk/50_setup.sh
new file mode 100644
index 000000000..eefd1eb7f
--- /dev/null
+++ b/templates/machine/imx8mq-evk/50_setup.sh
@@ -0,0 +1,2 @@
+find_and_ack_eula $METADIR/bsp/meta-freescale EULA
+export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/imx8mq-evk/README_machine_imx8mq-evk.md b/templates/machine/imx8mq-evk/README_machine_imx8mq-evk.md
new file mode 100644
index 000000000..ea9ddacce
--- /dev/null
+++ b/templates/machine/imx8mq-evk/README_machine_imx8mq-evk.md
@@ -0,0 +1,13 @@
+---
+description: i.MX8MQ EVK with etnaviv GPU driver
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Machine imx8mq-evk
+
+i.MX8MQ EVK and EVKB boards with etnaviv GPU driver support.
+Note that etnaviv on the GC7000L GPU in the i.MX8MQ is currently still
+a work in progress, the imx8mq-evk-viv template using the NXP Vivante
+driver may be a better choice for those not interested in etnaviv
+debugging and development.
+
diff --git a/templates/machine/intel-corei7-64 b/templates/machine/intel-corei7-64
new file mode 120000
index 000000000..9d4684394
--- /dev/null
+++ b/templates/machine/intel-corei7-64
@@ -0,0 +1 @@
+qemux86-64 \ No newline at end of file
diff --git a/templates/machine/intel-corei7-64/50_bblayers.conf.inc b/templates/machine/intel-corei7-64/50_bblayers.conf.inc
deleted file mode 100644
index d50ccc922..000000000
--- a/templates/machine/intel-corei7-64/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-intel"
diff --git a/templates/machine/intel-corei7-64/50_local.conf.inc b/templates/machine/intel-corei7-64/50_local.conf.inc
deleted file mode 100644
index 48d26c567..000000000
--- a/templates/machine/intel-corei7-64/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "intel-corei7-64"
-#see meta-agl/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
-require conf/include/agl_intel-corei7-64.inc
diff --git a/templates/machine/j721e-evm/50_bblayers.conf.inc b/templates/machine/j721e-evm/50_bblayers.conf.inc
new file mode 100644
index 000000000..6ef08c43e
--- /dev/null
+++ b/templates/machine/j721e-evm/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-arm/meta-arm \
+ ${METADIR}/bsp/meta-arm/meta-arm-toolchain \
+ ${METADIR}/bsp/meta-ti/meta-ti-bsp \
+ "
diff --git a/templates/machine/j721e-evm/50_local.conf.inc b/templates/machine/j721e-evm/50_local.conf.inc
new file mode 100644
index 000000000..917ca73a7
--- /dev/null
+++ b/templates/machine/j721e-evm/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "j721e-evm"
+#see meta-agl/meta-agl-bsp/conf/include/agl_j721e-evm.inc
+require conf/include/agl_j721e-evm.inc
diff --git a/templates/machine/j721e-evm/README_machine_j721e-evm.md b/templates/machine/j721e-evm/README_machine_j721e-evm.md
new file mode 100644
index 000000000..c6f7320d6
--- /dev/null
+++ b/templates/machine/j721e-evm/README_machine_j721e-evm.md
@@ -0,0 +1,9 @@
+---
+description: Machine j721e-evm
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Machine j721e-evm
+
+Texas Instruments J721e EVM (formerly J7 EVM).
+
diff --git a/templates/machine/joule/50_bblayers.conf.inc b/templates/machine/joule/50_bblayers.conf.inc
deleted file mode 100644
index d50ccc922..000000000
--- a/templates/machine/joule/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-intel"
diff --git a/templates/machine/joule/50_local.conf.inc b/templates/machine/joule/50_local.conf.inc
deleted file mode 100644
index 04b7e6f20..000000000
--- a/templates/machine/joule/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "intel-corei7-64"
-#see meta-agl/meta-agl-bsp/conf/include/agl_joule.inc
-require conf/include/agl_joule.inc
diff --git a/templates/machine/m3-salvator-x/50_bblayers.conf.inc b/templates/machine/m3-salvator-x/50_bblayers.conf.inc
new file mode 100644
index 000000000..e06bd413d
--- /dev/null
+++ b/templates/machine/m3-salvator-x/50_bblayers.conf.inc
@@ -0,0 +1,4 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/m3-salvator-x/50_local.conf.inc b/templates/machine/m3-salvator-x/50_local.conf.inc
new file mode 100644
index 000000000..82766fd5e
--- /dev/null
+++ b/templates/machine/m3-salvator-x/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "salvator-x"
+#see meta-agl/meta-agl-bsp/conf/include/agl_m3-salvator-x.inc
+require conf/include/agl_m3-salvator-x.inc
+
diff --git a/templates/machine/m3-salvator-x/50_setup.sh b/templates/machine/m3-salvator-x/50_setup.sh
new file mode 100644
index 000000000..abd2a33af
--- /dev/null
+++ b/templates/machine/m3-salvator-x/50_setup.sh
@@ -0,0 +1,10 @@
+# setup proprietary gfx drivers and multimedia packages
+pushd $METADIR 2>/dev/null
+
+SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
+if [ -f $SETUP_MM_SCRIPT ]; then
+ . $SETUP_MM_SCRIPT
+ copy_mm_packages
+fi
+
+popd 2>/dev/null
diff --git a/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md b/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md
new file mode 100644
index 000000000..99c9dffbf
--- /dev/null
+++ b/templates/machine/m3-salvator-x/README_machine_m3-salvator-x.md
@@ -0,0 +1,11 @@
+---
+description: Machine m3-salvator-x
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh> Duy Dang <duy.dang.yw@renesas.com>
+---
+
+### Machine m3-salvator-x
+
+salvator-x board with an m3 SoC.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Salvator-X](https://elinux.org/R-Car/Boards/Salvator-X)
diff --git a/templates/machine/m3ulcb-kf/50_bblayers.conf.inc b/templates/machine/m3ulcb-kf/50_bblayers.conf.inc
new file mode 100644
index 000000000..25e36b019
--- /dev/null
+++ b/templates/machine/m3ulcb-kf/50_bblayers.conf.inc
@@ -0,0 +1,5 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/meta-agl/meta-agl-bsp/meta-rcar-gen3-adas \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
diff --git a/templates/machine/m3ulcb-kf/50_local.conf.inc b/templates/machine/m3ulcb-kf/50_local.conf.inc
new file mode 100644
index 000000000..e2fe41a8a
--- /dev/null
+++ b/templates/machine/m3ulcb-kf/50_local.conf.inc
@@ -0,0 +1,6 @@
+MACHINE = "m3ulcb"
+#see meta-agl/meta-agl-bsp/conf/include/agl_m3ulcb.inc
+require conf/include/agl_m3ulcb.inc
+
+#see meta-agl/meta-agl-bsp/meta-rcar-gen3-adas/conf/include/rcar-gen3-adas.inc
+require conf/include/rcar-gen3-adas.inc
diff --git a/templates/machine/m3ulcb-kf/50_setup.sh b/templates/machine/m3ulcb-kf/50_setup.sh
new file mode 100644
index 000000000..abd2a33af
--- /dev/null
+++ b/templates/machine/m3ulcb-kf/50_setup.sh
@@ -0,0 +1,10 @@
+# setup proprietary gfx drivers and multimedia packages
+pushd $METADIR 2>/dev/null
+
+SETUP_MM_SCRIPT=$METADIR/meta-agl/meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh
+if [ -f $SETUP_MM_SCRIPT ]; then
+ . $SETUP_MM_SCRIPT
+ copy_mm_packages
+fi
+
+popd 2>/dev/null
diff --git a/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md b/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md
new file mode 100644
index 000000000..075c203f4
--- /dev/null
+++ b/templates/machine/m3ulcb-kf/README_machine_m3ulcb-kf.md
@@ -0,0 +1,12 @@
+---
+description: Machine m3ulcb
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Yannick Gicquel <yannick.gicquel@iot.bzh>
+---
+
+### Machine m3ulcb
+
+Renesas RCar Gen3 "m3ulcb" board with Kingfisher baseboard.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
+* [R-Car/Boards/Kingfisher](https://elinux.org/R-Car/Boards/Kingfisher)
diff --git a/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc b/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc
index b58989c6f..e06bd413d 100644
--- a/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc
+++ b/templates/machine/m3ulcb-nogfx/50_bblayers.conf.inc
@@ -1,3 +1,4 @@
BBLAYERS =+ "\
- ${METADIR}/meta-renesas-rcar-gen3/meta-rcar-gen3 \
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
"
diff --git a/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md b/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md
new file mode 100644
index 000000000..5c87986df
--- /dev/null
+++ b/templates/machine/m3ulcb-nogfx/README_machine_m3ulcb-nogfx.md
@@ -0,0 +1,11 @@
+---
+description: Machine m3ulcb-nogfx
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Kevin Hilman <khilman@baylibre.com>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Yannick Gicquel <yannick.gicquel@iot.bzh>
+---
+
+### Machine m3ulcb-nogfx
+
+This is a "m3ulcb" machine without proprietary graphics driver support.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
diff --git a/templates/machine/m3ulcb-nogfx/test/hwtest.short.environment b/templates/machine/m3ulcb-nogfx/test/hwtest.short.environment
deleted file mode 100644
index 758ca7e6f..000000000
--- a/templates/machine/m3ulcb-nogfx/test/hwtest.short.environment
+++ /dev/null
@@ -1,9 +0,0 @@
-DEVICE_TYPE=r8a7796-m3ulcb
-DEVICE_NAME=m3ulcb-nogfx
-DEVICE_DTB=Image-r8a7796-m3ulcb.dtb
-DEVICE_KERNEL=Image
-DEVICE_INITRAMFS=initramfs-netboot-image-m3ulcb.ext4.gz
-DEVICE_NBDROOT=agl-demo-platform-m3ulcb.ext4.xz
-DEVICE_NBDROOT_COMPRESSION=xz
-DEVICE_BOOT_METHOD=u-boot
-DEVICE_BOOT_TYPE=booti
diff --git a/templates/machine/m3ulcb-nogfx/test/testjob_short.yaml b/templates/machine/m3ulcb-nogfx/test/testjob_short.yaml
deleted file mode 100644
index d14b7704f..000000000
--- a/templates/machine/m3ulcb-nogfx/test/testjob_short.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-device_type: @REPLACE_DEVICE_TYPE@
-job_name: AGL-short-smoke
-
-protocols:
- lava-xnbd:
- port: auto
-
-timeouts:
- job:
- minutes: 30
- action:
- minutes: 15
- connection:
- minutes: 5
- bootloader-commands:
- minutes: 4
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
- timeout:
- minutes: 15
- to: nbd
- dtb:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
- kernel:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
- initrd:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
- allow_modify: false
- nbdroot:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
- compression: @REPLACE_NBDROOT_COMPRESSION@
- os: debian
- failure_retry: 2
-
-# BOOT_BLOCK
-- boot:
- method: @REPLACE_BOOT_METHOD@
- commands: nbd
- type: @REPLACE_BOOT_TYPE@
- prompts: ["root@@REPLACE_MACHINE@:~"]
- auto_login:
- login_prompt: "login:"
- username: root
-
diff --git a/templates/machine/m3ulcb/50_bblayers.conf.inc b/templates/machine/m3ulcb/50_bblayers.conf.inc
index b58989c6f..e06bd413d 100644
--- a/templates/machine/m3ulcb/50_bblayers.conf.inc
+++ b/templates/machine/m3ulcb/50_bblayers.conf.inc
@@ -1,3 +1,4 @@
BBLAYERS =+ "\
- ${METADIR}/meta-renesas-rcar-gen3/meta-rcar-gen3 \
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gen3 \
+ ${METADIR}/external/poky/meta-yocto-bsp \
"
diff --git a/templates/machine/m3ulcb/README_machine_m3ulcb.md b/templates/machine/m3ulcb/README_machine_m3ulcb.md
new file mode 100644
index 000000000..07034a6db
--- /dev/null
+++ b/templates/machine/m3ulcb/README_machine_m3ulcb.md
@@ -0,0 +1,11 @@
+---
+description: Machine m3ulcb
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Yannick Gicquel <yannick.gicquel@iot.bzh>
+---
+
+### Machine m3ulcb
+
+Renesas RCar Gen3 "m3ulcb" board.
+
+* [R-Car H3 and M3 Starter Kit website](https://www.renesas.com/br/en/solutions/automotive/adas/solution-kits/r-car-starter-kit.html)
+* [elinux H3 Starter Kit](https://elinux.org/R-Car/Boards/H3SK)
diff --git a/templates/machine/nitrogen6x/50_bblayers.conf.inc b/templates/machine/nitrogen6x/50_bblayers.conf.inc
deleted file mode 100644
index 2852303b4..000000000
--- a/templates/machine/nitrogen6x/50_bblayers.conf.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-BBLAYERS =+ "\
- ${METADIR}/meta-fsl-arm \
- ${METADIR}/meta-fsl-arm-extra \
- ${METADIR}/meta-boundary \
- "
diff --git a/templates/machine/nitrogen6x/50_local.conf.inc b/templates/machine/nitrogen6x/50_local.conf.inc
deleted file mode 100644
index fec3a7f6d..000000000
--- a/templates/machine/nitrogen6x/50_local.conf.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-MACHINE = "nitrogen6x"
-
diff --git a/templates/machine/nitrogen6x/50_setup.sh b/templates/machine/nitrogen6x/50_setup.sh
deleted file mode 100644
index ea340a763..000000000
--- a/templates/machine/nitrogen6x/50_setup.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-find_and_ack_eula $METADIR/meta-fsl-arm EULA
-export EULA_FLAG_NAME="ACCEPT_FSL_EULA"
diff --git a/templates/machine/porter-nogfx/50_bblayers.conf.inc b/templates/machine/porter-nogfx/50_bblayers.conf.inc
deleted file mode 100644
index ba0e17ef3..000000000
--- a/templates/machine/porter-nogfx/50_bblayers.conf.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-BBLAYERS =+ "\
- ${METADIR}/meta-renesas \
- ${METADIR}/meta-renesas/meta-rcar-gen2 \
- "
-
diff --git a/templates/machine/porter-nogfx/50_local.conf.inc b/templates/machine/porter-nogfx/50_local.conf.inc
deleted file mode 100644
index 87ec427e3..000000000
--- a/templates/machine/porter-nogfx/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "porter"
-#see meta-agl/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
-require conf/include/agl_porter-nogfx.inc
diff --git a/templates/machine/porter-nogfx/test/hwtest.enable b/templates/machine/porter-nogfx/test/hwtest.enable
deleted file mode 100644
index d00491fd7..000000000
--- a/templates/machine/porter-nogfx/test/hwtest.enable
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/templates/machine/porter-nogfx/test/hwtest.short.enable b/templates/machine/porter-nogfx/test/hwtest.short.enable
deleted file mode 100644
index d00491fd7..000000000
--- a/templates/machine/porter-nogfx/test/hwtest.short.enable
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/templates/machine/porter-nogfx/test/hwtest.short.environment b/templates/machine/porter-nogfx/test/hwtest.short.environment
deleted file mode 100644
index 6cb0b9a0b..000000000
--- a/templates/machine/porter-nogfx/test/hwtest.short.environment
+++ /dev/null
@@ -1,11 +0,0 @@
-DEVICE_TYPE=renesas-porter-uboot
-DEVICE_NAME=porter
-DEVICE_DTB=uImage-r8a7791-porter.dtb
-DEVICE_KERNEL=uImage
-DEVICE_INITRAMFS=initramfs-netboot-image-porter.ext4.gz.u-boot
-DEVICE_NBDROOT=core-image-minimal-porter.ext4.xz
-DEVICE_NBDROOT_COMPRESSION=xz
-DEVICE_BOOT_METHOD=u-boot
-DEVICE_BOOT_TYPE=bootm
-#DEVICE_URL_PREFIX=https://download.automotivelinux.org/AGL
-# \ No newline at end of file
diff --git a/templates/machine/porter-nogfx/test/testjob_short.yaml b/templates/machine/porter-nogfx/test/testjob_short.yaml
deleted file mode 100644
index 2ff1ac995..000000000
--- a/templates/machine/porter-nogfx/test/testjob_short.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
-# Your first LAVA JOB definition for a porter board
-device_type: @REPLACE_DEVICE_TYPE@
-job_name: AGL-short-smoke
-
-protocols:
- lava-xnbd:
- port: auto
-
-timeouts:
- job:
- minutes: 30
- action:
- minutes: 15
- connection:
- minutes: 5
- bootloader-commands:
- minutes: 4
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
- timeout:
- minutes: 15
- to: nbd
- dtb:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
- kernel:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
- initrd:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
- allow_modify: false
- nbdroot:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
- compression: @REPLACE_NBDROOT_COMPRESSION@
- os: debian
- failure_retry: 2
-
-# BOOT_BLOCK
-- boot:
- method: @REPLACE_BOOT_METHOD@
- commands: nbd
- type: @REPLACE_BOOT_TYPE@
- prompts: ["root@@REPLACE_MACHINE@:~"]
- auto_login:
- login_prompt: "login:"
- username: root
-
diff --git a/templates/machine/porter/50_bblayers.conf.inc b/templates/machine/porter/50_bblayers.conf.inc
deleted file mode 100644
index ba0e17ef3..000000000
--- a/templates/machine/porter/50_bblayers.conf.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-BBLAYERS =+ "\
- ${METADIR}/meta-renesas \
- ${METADIR}/meta-renesas/meta-rcar-gen2 \
- "
-
diff --git a/templates/machine/porter/50_local.conf.inc b/templates/machine/porter/50_local.conf.inc
deleted file mode 100644
index f2794b0d0..000000000
--- a/templates/machine/porter/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "porter"
-#see meta-agl/meta-agl-bsp/conf/include/agl_porter.inc
-require conf/include/agl_porter.inc
diff --git a/templates/machine/porter/50_setup.sh b/templates/machine/porter/50_setup.sh
deleted file mode 100644
index f51d4f4f5..000000000
--- a/templates/machine/porter/50_setup.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-# setup proprietary gfx drivers and multimedia packages
-pushd $METADIR 2>/dev/null
-
-SETUP_MM_SCRIPT=$METADIR/meta-renesas/meta-rcar-gen2/scripts/setup_mm_packages.sh
-if [ -f $SETUP_MM_SCRIPT ]; then
- . $SETUP_MM_SCRIPT $MACHINE
- copy_mm_packages $MACHINE
- if [ $? -ne 0 ]; then
- echo "Copying gfx drivers and multimedia packages for '$MACHINE' failed."
- exit 1
- fi
-fi
-
-popd 2>/dev/null
diff --git a/templates/machine/qemuarm/50_local.conf.inc b/templates/machine/qemuarm/50_local.conf.inc
new file mode 100644
index 000000000..84204fb8c
--- /dev/null
+++ b/templates/machine/qemuarm/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "qemuarm"
+#see meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc
+require conf/include/agl_qemuarm.inc
diff --git a/templates/machine/qemuarm/README_machine_qemuarm.md b/templates/machine/qemuarm/README_machine_qemuarm.md
new file mode 100644
index 000000000..42e5a5cdd
--- /dev/null
+++ b/templates/machine/qemuarm/README_machine_qemuarm.md
@@ -0,0 +1,9 @@
+---
+description: Machine qemuarm
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Machine qemuarm
+
+*Description is missing - please complete file meta-agl/templates/machine/qemuarm/README_machine_qemuarm.md*
+
diff --git a/templates/machine/qemuarm64/50_local.conf.inc b/templates/machine/qemuarm64/50_local.conf.inc
new file mode 100644
index 000000000..65605b530
--- /dev/null
+++ b/templates/machine/qemuarm64/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "qemuarm64"
+#see meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc
+require conf/include/agl_qemuarm64.inc
diff --git a/templates/machine/qemuarm64/README_machine_qemuarm64.md b/templates/machine/qemuarm64/README_machine_qemuarm64.md
new file mode 100644
index 000000000..6fc8c69b1
--- /dev/null
+++ b/templates/machine/qemuarm64/README_machine_qemuarm64.md
@@ -0,0 +1,9 @@
+---
+description: Machine qemuarm64
+authors: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
+---
+
+### Machine qemuarm64
+
+*Description is missing - please complete file meta-agl/templates/machine/qemuarm64/README_machine_qemuarm64.md*
+
diff --git a/templates/machine/qemuriscv64/50_local.conf.inc b/templates/machine/qemuriscv64/50_local.conf.inc
new file mode 100644
index 000000000..5eba64f0d
--- /dev/null
+++ b/templates/machine/qemuriscv64/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "qemuriscv64"
+#see meta-agl/meta-agl-bsp/conf/include/agl_qemux86-64.inc
+require conf/include/agl_qemuriscv64.inc
diff --git a/templates/machine/qemuriscv64/README_machine_qemuriscv64.md b/templates/machine/qemuriscv64/README_machine_qemuriscv64.md
new file mode 100644
index 000000000..00eb1d300
--- /dev/null
+++ b/templates/machine/qemuriscv64/README_machine_qemuriscv64.md
@@ -0,0 +1,9 @@
+---
+description: Machine qemuriscv64
+authors: Alistair Francis <alistair.francis@wdc.com>
+---
+
+### Machine qemuarm64
+
+The 64-bit RISC-V QEMU virt machine.
+
diff --git a/templates/machine/qemux86-64/README_machine_qemux86-64.md b/templates/machine/qemux86-64/README_machine_qemux86-64.md
new file mode 100644
index 000000000..88b6375ba
--- /dev/null
+++ b/templates/machine/qemux86-64/README_machine_qemux86-64.md
@@ -0,0 +1,9 @@
+---
+description: Machine qemux86-64
+authors: Anton Gerasimov <anton@advancedtelematic.com>, Kevin Hilman <khilman@baylibre.com>, Ronan Le Martret <ronan.lemartret@iot.bzh>, Stephane Desneux <stephane.desneux@iot.bzh>
+---
+
+### Machine qemux86-64
+
+*Description is missing - please complete file meta-agl/templates/machine/qemux86-64/README_machine_qemux86-64.md*
+
diff --git a/templates/machine/qemux86/50_local.conf.inc b/templates/machine/qemux86/50_local.conf.inc
deleted file mode 100644
index b500b3c60..000000000
--- a/templates/machine/qemux86/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "qemux86"
-#see meta-agl/meta-agl-bsp/conf/include/agl_qemux86.inc
-require conf/include/agl_qemux86.inc
diff --git a/templates/machine/raspberrypi2/50_bblayers.conf.inc b/templates/machine/raspberrypi2/50_bblayers.conf.inc
deleted file mode 100644
index 1250b359f..000000000
--- a/templates/machine/raspberrypi2/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-raspberrypi"
diff --git a/templates/machine/raspberrypi2/50_local.conf.inc b/templates/machine/raspberrypi2/50_local.conf.inc
deleted file mode 100644
index 5d314eeb4..000000000
--- a/templates/machine/raspberrypi2/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "raspberrypi2"
-#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
-require conf/include/agl_raspberrypi2.inc
diff --git a/templates/machine/raspberrypi3-64/50_bblayers.conf.inc b/templates/machine/raspberrypi3-64/50_bblayers.conf.inc
deleted file mode 120000
index 653316c5c..000000000
--- a/templates/machine/raspberrypi3-64/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-../raspberrypi3/50_bblayers.conf.inc \ No newline at end of file
diff --git a/templates/machine/raspberrypi3-64/50_local.conf.inc b/templates/machine/raspberrypi3-64/50_local.conf.inc
deleted file mode 100644
index 74d952ed9..000000000
--- a/templates/machine/raspberrypi3-64/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "raspberrypi3-64"
-#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3-64.inc
-require conf/include/agl_raspberrypi3-64.inc
diff --git a/templates/machine/raspberrypi3-64/test/hwtest.short.environment b/templates/machine/raspberrypi3-64/test/hwtest.short.environment
deleted file mode 100644
index 9e2dcbd0f..000000000
--- a/templates/machine/raspberrypi3-64/test/hwtest.short.environment
+++ /dev/null
@@ -1,10 +0,0 @@
-DEVICE_TYPE=bcm2837-rpi-3-b
-DEVICE_NAME=raspberrypi3-64
-DEVICE_DTB=Image-bcm2837-rpi-3-b.dtb
-DEVICE_KERNEL=Image
-DEVICE_INITRAMFS=initramfs-netboot-image-raspberrypi3-64.ext4.gz.u-boot
-DEVICE_NBDROOT=agl-demo-platform-raspberrypi3-64.ext4.xz
-DEVICE_NBDROOT_COMPRESSION=xz
-DEVICE_BOOT_METHOD=u-boot
-DEVICE_BOOT_TYPE=booti
-#DEVICE_URL_PREFIX=https://download.automotivelinux.org/AGL
diff --git a/templates/machine/raspberrypi3-64/test/testjob_short.yaml b/templates/machine/raspberrypi3-64/test/testjob_short.yaml
deleted file mode 100644
index 2ff1ac995..000000000
--- a/templates/machine/raspberrypi3-64/test/testjob_short.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
-# Your first LAVA JOB definition for a porter board
-device_type: @REPLACE_DEVICE_TYPE@
-job_name: AGL-short-smoke
-
-protocols:
- lava-xnbd:
- port: auto
-
-timeouts:
- job:
- minutes: 30
- action:
- minutes: 15
- connection:
- minutes: 5
- bootloader-commands:
- minutes: 4
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
- timeout:
- minutes: 15
- to: nbd
- dtb:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
- kernel:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
- initrd:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
- allow_modify: false
- nbdroot:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
- compression: @REPLACE_NBDROOT_COMPRESSION@
- os: debian
- failure_retry: 2
-
-# BOOT_BLOCK
-- boot:
- method: @REPLACE_BOOT_METHOD@
- commands: nbd
- type: @REPLACE_BOOT_TYPE@
- prompts: ["root@@REPLACE_MACHINE@:~"]
- auto_login:
- login_prompt: "login:"
- username: root
-
diff --git a/templates/machine/raspberrypi3/50_bblayers.conf.inc b/templates/machine/raspberrypi3/50_bblayers.conf.inc
deleted file mode 100644
index 1250b359f..000000000
--- a/templates/machine/raspberrypi3/50_bblayers.conf.inc
+++ /dev/null
@@ -1 +0,0 @@
-BBLAYERS =+ "${METADIR}/meta-raspberrypi"
diff --git a/templates/machine/raspberrypi3/50_local.conf.inc b/templates/machine/raspberrypi3/50_local.conf.inc
deleted file mode 100644
index e47637178..000000000
--- a/templates/machine/raspberrypi3/50_local.conf.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-MACHINE = "raspberrypi3"
-#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
-require conf/include/agl_raspberrypi3.inc
diff --git a/templates/machine/raspberrypi3/test/hwtest.enable b/templates/machine/raspberrypi3/test/hwtest.enable
deleted file mode 100644
index 573541ac9..000000000
--- a/templates/machine/raspberrypi3/test/hwtest.enable
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/templates/machine/raspberrypi3/test/hwtest.short.enable b/templates/machine/raspberrypi3/test/hwtest.short.enable
deleted file mode 100644
index 573541ac9..000000000
--- a/templates/machine/raspberrypi3/test/hwtest.short.enable
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/templates/machine/raspberrypi3/test/hwtest.short.environment b/templates/machine/raspberrypi3/test/hwtest.short.environment
deleted file mode 100644
index db4a5a044..000000000
--- a/templates/machine/raspberrypi3/test/hwtest.short.environment
+++ /dev/null
@@ -1,10 +0,0 @@
-DEVICE_TYPE=raspberrypi3-uboot
-DEVICE_NAME=raspberrypi3
-DEVICE_DTB=Image-bcm2710-rpi-3-b.dtb
-DEVICE_KERNEL=Image
-DEVICE_INITRAMFS=initramfs-netboot-image-raspberrypi3.ext4.gz
-DEVICE_NBDROOT=agl-demo-platform-raspberrypi3.ext4.xz
-DEVICE_NBDROOT_COMPRESSION=xz
-DEVICE_BOOT_METHOD=u-boot
-DEVICE_BOOT_TYPE=booti
-#DEVICE_URL_PREFIX=https://download.automotivelinux.org/AGL \ No newline at end of file
diff --git a/templates/machine/raspberrypi3/test/testjob_short.yaml b/templates/machine/raspberrypi3/test/testjob_short.yaml
deleted file mode 100644
index 2ff1ac995..000000000
--- a/templates/machine/raspberrypi3/test/testjob_short.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
-# Your first LAVA JOB definition for a porter board
-device_type: @REPLACE_DEVICE_TYPE@
-job_name: AGL-short-smoke
-
-protocols:
- lava-xnbd:
- port: auto
-
-timeouts:
- job:
- minutes: 30
- action:
- minutes: 15
- connection:
- minutes: 5
- bootloader-commands:
- minutes: 4
-priority: medium
-visibility: public
-
-# ACTION_BLOCK
-actions:
-- deploy:
- timeout:
- minutes: 15
- to: nbd
- dtb:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_DTB@'
- kernel:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_KERNEL@'
- initrd:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_INITRAMFS@'
- allow_modify: false
- nbdroot:
- url: '@REPLACE_URL_PREFIX@/@REPLACE_NBDROOT@'
- compression: @REPLACE_NBDROOT_COMPRESSION@
- os: debian
- failure_retry: 2
-
-# BOOT_BLOCK
-- boot:
- method: @REPLACE_BOOT_METHOD@
- commands: nbd
- type: @REPLACE_BOOT_TYPE@
- prompts: ["root@@REPLACE_MACHINE@:~"]
- auto_login:
- login_prompt: "login:"
- username: root
-
diff --git a/templates/machine/raspberrypi4/50_bblayers.conf.inc b/templates/machine/raspberrypi4/50_bblayers.conf.inc
new file mode 100644
index 000000000..2e677dd8a
--- /dev/null
+++ b/templates/machine/raspberrypi4/50_bblayers.conf.inc
@@ -0,0 +1 @@
+BBLAYERS =+ "${METADIR}/bsp/meta-raspberrypi"
diff --git a/templates/machine/raspberrypi4/50_local.conf.inc b/templates/machine/raspberrypi4/50_local.conf.inc
new file mode 100644
index 000000000..e12f4a4a3
--- /dev/null
+++ b/templates/machine/raspberrypi4/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "raspberrypi4-64"
+
+#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc
+require conf/include/agl_raspberrypi4.inc
diff --git a/templates/machine/raspberrypi5/50_bblayers.conf.inc b/templates/machine/raspberrypi5/50_bblayers.conf.inc
new file mode 100644
index 000000000..2e677dd8a
--- /dev/null
+++ b/templates/machine/raspberrypi5/50_bblayers.conf.inc
@@ -0,0 +1 @@
+BBLAYERS =+ "${METADIR}/bsp/meta-raspberrypi"
diff --git a/templates/machine/raspberrypi5/50_local.conf.inc b/templates/machine/raspberrypi5/50_local.conf.inc
new file mode 100644
index 000000000..9ee2644ab
--- /dev/null
+++ b/templates/machine/raspberrypi5/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "raspberrypi5"
+
+#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi5.inc
+require conf/include/agl_raspberrypi5.inc
diff --git a/templates/machine/s4sk/50_bblayers.conf.inc b/templates/machine/s4sk/50_bblayers.conf.inc
new file mode 100644
index 000000000..0cc25a9ab
--- /dev/null
+++ b/templates/machine/s4sk/50_bblayers.conf.inc
@@ -0,0 +1,7 @@
+BBLAYERS =+ "\
+ ${METADIR}/bsp/meta-renesas/meta-rcar-gateway \
+ ${METADIR}/external/poky/meta-yocto-bsp \
+ "
+
+AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
+
diff --git a/templates/machine/s4sk/50_local.conf.inc b/templates/machine/s4sk/50_local.conf.inc
new file mode 100644
index 000000000..b804b3845
--- /dev/null
+++ b/templates/machine/s4sk/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "s4sk"
+#see meta-agl/meta-agl-bsp/conf/include/agl_s4sk.inc
+require conf/include/agl_s4sk.inc
+
diff --git a/templates/machine/s4sk/README_machine_s4sk.md b/templates/machine/s4sk/README_machine_s4sk.md
new file mode 100644
index 000000000..275be67a6
--- /dev/null
+++ b/templates/machine/s4sk/README_machine_s4sk.md
@@ -0,0 +1,11 @@
+---
+description: Machine s4sk
+authors: Loc Nguyen <loc.nguyen.wt@renesas.com>
+---
+
+### Machine s4sk
+
+Renesas RCar Gen4 "s4sk" board.
+
+* [R-Car S4 Starter Kit website](https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/y-ask-rcar-s4-1000base-t-r-car-s4-starter-kit)
+* [elinux S4 Starter Kit](https://elinux.org/R-Car/Boards/S4SK)
diff --git a/templates/machine/unmatched/50_bblayers.conf.inc b/templates/machine/unmatched/50_bblayers.conf.inc
new file mode 100644
index 000000000..03565bafd
--- /dev/null
+++ b/templates/machine/unmatched/50_bblayers.conf.inc
@@ -0,0 +1,6 @@
+# This is the original place, but we need to tweak layer.conf
+BBLAYERS =+ "${METADIR}/bsp/meta-sifive"
+
+# For now, tweak the layer's compatibility to allow using with kirkstone,
+# since we know it works without major issues.
+LAYERSERIES_COMPAT_meta-sifive:append = " kirkstone"
diff --git a/templates/machine/unmatched/50_local.conf.inc b/templates/machine/unmatched/50_local.conf.inc
new file mode 100644
index 000000000..c4d2b3ae5
--- /dev/null
+++ b/templates/machine/unmatched/50_local.conf.inc
@@ -0,0 +1,4 @@
+MACHINE = "unmatched"
+
+#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc
+require conf/include/agl_unmatched.inc
diff --git a/templates/machine/virtio-aarch64/50_bblayers.conf.inc b/templates/machine/virtio-aarch64/50_bblayers.conf.inc
new file mode 100644
index 000000000..16c7ec5f8
--- /dev/null
+++ b/templates/machine/virtio-aarch64/50_bblayers.conf.inc
@@ -0,0 +1,6 @@
+BBFILES += " \
+ ${METADIR}/meta-agl/meta-agl-bsp/virtualization-layer/recipes*/*/*.bb \
+ ${METADIR}/meta-agl/meta-agl-bsp/virtualization-layer/recipes*/*/*.bbappend \
+ "
+
+BBMASK += "meta-agl/meta-agl-bsp/virtualization-layer/recipes-extended/xen"
diff --git a/templates/machine/virtio-aarch64/50_local.conf.inc b/templates/machine/virtio-aarch64/50_local.conf.inc
new file mode 100644
index 000000000..3328d6ab8
--- /dev/null
+++ b/templates/machine/virtio-aarch64/50_local.conf.inc
@@ -0,0 +1,3 @@
+MACHINE = "virtio-aarch64"
+# see meta-agl/meta-agl-bsp/conf/include/agl_virtio-aarch64.inc
+require conf/include/agl_virtio-aarch64.inc
diff --git a/templates/machine/virtio-aarch64/README_machine_virtio-aarch64.md b/templates/machine/virtio-aarch64/README_machine_virtio-aarch64.md
new file mode 100644
index 000000000..8149c4324
--- /dev/null
+++ b/templates/machine/virtio-aarch64/README_machine_virtio-aarch64.md
@@ -0,0 +1,10 @@
+---
+description: Machine virtio-aarch64
+authors: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
+---
+
+### Machine virtio-aarch64
+
+This machine is intended to run in an ARMv8 virtualized environment that
+provides VirtIO devices. For now, virtio-aarch64 machine was verified under QEMU
+and OpenSynergy COQOS Hypervisor.
diff --git a/templates/machine/wandboard/50_bblayers.conf.inc b/templates/machine/wandboard/50_bblayers.conf.inc
deleted file mode 100644
index 0198eb464..000000000
--- a/templates/machine/wandboard/50_bblayers.conf.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-BBLAYERS =+ "\
- ${METADIR}/meta-fsl-arm \
- ${METADIR}/meta-fsl-arm-extra \
- "
diff --git a/templates/machine/wandboard/50_local.conf.inc b/templates/machine/wandboard/50_local.conf.inc
deleted file mode 100644
index 42f9e5f77..000000000
--- a/templates/machine/wandboard/50_local.conf.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-MACHINE = "wandboard"
-