summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'meta-rcar-gen3/recipes-graphics')
-rw-r--r--meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend4
-rw-r--r--meta-rcar-gen3/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch24
-rw-r--r--meta-rcar-gen3/recipes-graphics/drm/libdrm/installtests.patch15
-rw-r--r--meta-rcar-gen3/recipes-graphics/drm/libdrm_2.4.68.bb45
-rw-r--r--meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb135
-rw-r--r--meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch8
-rw-r--r--meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service13
-rw-r--r--meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc67
-rw-r--r--meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc96
-rw-r--r--meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb15
-rw-r--r--meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend2
-rw-r--r--meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc15
-rw-r--r--meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc0
-rw-r--r--meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc33
-rw-r--r--meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend10
-rw-r--r--meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb36
-rw-r--r--meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphics-libegl.bb25
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/libegl.bb19
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb35
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb25
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend16
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.service12
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston.inc16
-rw-r--r--meta-rcar-gen3/recipes-graphics/wayland/weston_2.%.bbappend1
-rw-r--r--meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend1
25 files changed, 668 insertions, 0 deletions
diff --git a/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend b/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend
new file mode 100644
index 0000000..f06b451
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend
@@ -0,0 +1,4 @@
+require include/gles-control.inc
+DEPENDS_append = " \
+ ${@'gles-user-module libgbm' if '${USE_GLES_WAYLAND}' == '1' else ''} \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch b/meta-rcar-gen3/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
new file mode 100644
index 0000000..286e548
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
@@ -0,0 +1,24 @@
+drmdevice.c: define _GNU_SOURCE
+
+Include config.h to fix this build error with uclibc:
+
+libdrm-2.4.66/tests/drmdevice.c: In function 'main':
+libdrm-2.4.66/tests/drmdevice.c:96:60: error:
+'O_CLOEXEC' undeclared (first use in this function)
+fd = open(devices[i]->nodes[j],O_RDONLY | O_CLOEXEC, 0);
+
+Upstream-Status: Pending
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libdrm-2.4.66-orig/tests/drmdevice.c libdrm-2.4.66/tests/drmdevice.c
+--- libdrm-2.4.66-orig/tests/drmdevice.c 2016-02-23 11:34:02.054904502 +0200
++++ libdrm-2.4.66/tests/drmdevice.c 2016-02-23 11:35:34.371750383 +0200
+@@ -21,6 +21,7 @@
+ *
+ */
+
++#include <config.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/stat.h>
diff --git a/meta-rcar-gen3/recipes-graphics/drm/libdrm/installtests.patch b/meta-rcar-gen3/recipes-graphics/drm/libdrm/installtests.patch
new file mode 100644
index 0000000..30e0a61
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/drm/libdrm/installtests.patch
@@ -0,0 +1,15 @@
+tests: also install tests app
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+Index: libdrm-2.4.66/tests/Makefile.am
+===================================================================
+--- libdrm-2.4.66.orig/tests/Makefile.am
++++ libdrm-2.4.66/tests/Makefile.am
+@@ -73,3 +73,4 @@ TESTS += \
+ endif
+
+ check_PROGRAMS += $(TESTS)
++bin_PROGRAMS = $(check_PROGRAMS)
diff --git a/meta-rcar-gen3/recipes-graphics/drm/libdrm_2.4.68.bb b/meta-rcar-gen3/recipes-graphics/drm/libdrm_2.4.68.bb
new file mode 100644
index 0000000..758f801
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/drm/libdrm_2.4.68.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services. DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI). DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs udev libpciaccess"
+
+SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
+ file://installtests.patch \
+ file://fix_O_CLOEXEC_undeclared.patch \
+ "
+
+SRC_URI[md5sum] = "bcc96848d969cecf28223f668eeff354"
+SRC_URI[sha256sum] = "5b4bd9a5922929bc716411cb74061fbf31b06ba36feb89bc1358a91a8d0ca9df"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-cairo-tests \
+ --enable-omap-experimental-api \
+ --enable-install-test-programs \
+ --disable-manpages \
+ --disable-valgrind \
+ "
+
+ALLOW_EMPTY_${PN}-drivers = "1"
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
+ ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno ${PN}-amdgpu"
+
+RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
+ ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu"
+
+FILES_${PN}-tests = "${bindir}/*"
+FILES_${PN}-radeon = "${libdir}/libdrm_radeon.so.*"
+FILES_${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*"
+FILES_${PN}-omap = "${libdir}/libdrm_omap.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
+FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*"
diff --git a/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb
new file mode 100644
index 0000000..14a4c5d
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb
@@ -0,0 +1,135 @@
+require include/gles-control.inc
+require include/rcar-gen3-path-common.inc
+
+DESCRIPTION = "PowerVR GPU user module"
+LICENSE = "CLOSED"
+
+PN = "gles-user-module"
+PR = "r0"
+
+COMPATIBLE_MACHINE = "(r8a7795|r8a7796)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}/rogue"
+GLES = "gsx"
+
+SRC_URI_r8a7795 = "file://r8a7795_linux_gsx_binaries_gles3.tar.bz2"
+SRC_URI_r8a7796 = "file://r8a7796_linux_gsx_binaries_gles3.tar.bz2"
+SRC_URI_append = " \
+ file://change-shell.patch \
+ file://rc.pvr.service \
+"
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "pvrinit"
+INITSCRIPT_PARAMS = "start 7 5 2 . stop 62 0 1 6 ."
+SYSTEMD_SERVICE_${PN} = "rc.pvr.service"
+
+do_populate_lic[noexec] = "1"
+do_compile[noexec] = "1"
+
+#The headers of gles-user-module need headers from virtual/mesa.
+do_populate_sysroot[depends] += "virtual/mesa:do_populate_sysroot"
+
+do_install() {
+ # Install configuration files
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 644 ${S}/${sysconfdir}/powervr.ini ${D}/${sysconfdir}
+ install -m 755 ${S}/${sysconfdir}/init.d/rc.pvr ${D}/${sysconfdir}/init.d/
+ install -d ${D}/${sysconfdir}/udev/rules.d
+ install -m 644 ${S}/${sysconfdir}/udev/rules.d/72-pvr-seat.rules ${D}/${sysconfdir}/udev/rules.d/
+
+ # Install header files
+ install -d ${D}/${includedir}/EGL
+ install -m 644 ${S}/${includedir}/EGL/*.h ${D}/${includedir}/EGL/
+ install -d ${D}/${includedir}/GLES2
+ install -m 644 ${S}/${includedir}/GLES2/*.h ${D}/${includedir}/GLES2/
+ install -d ${D}/${includedir}/GLES3
+ install -m 644 ${S}/${includedir}/GLES3/*.h ${D}/${includedir}/GLES3/
+ install -d ${D}/${includedir}/KHR
+ install -m 644 ${S}/${includedir}/KHR/khrplatform.h ${D}/${includedir}/KHR/khrplatform.h
+
+ # Install pre-builded binaries
+ install -d ${D}/${libdir}
+ install -m 755 ${S}/${libdir}/*.so ${D}/${libdir}/
+ install -d ${D}/${RENESAS_DATADIR}/bin
+ install -m 755 ${S}/usr/local/bin/dlcsrv_REL ${D}/${RENESAS_DATADIR}/bin/dlcsrv_REL
+ install -d ${D}/lib/firmware
+ install -m 644 ${S}/lib/firmware/* ${D}/lib/firmware/
+
+ # Install pkgconfig
+ install -d ${D}/${libdir}/pkgconfig
+ install -m 644 ${S}/${libdir}/pkgconfig/*.pc ${D}/${libdir}/pkgconfig/
+
+ # Create symbolic link
+ cd ${D}/${libdir}
+ ln -s libEGL.so libEGL.so.1
+ ln -s libGLESv2.so libGLESv2.so.2
+
+ if [ "${USE_GLES_WAYLAND}" = "1" ]; then
+ # Set the "WindowSystem" parameter for wayland
+ if [ "${GLES}" = "gsx" ]; then
+ sed -i -e "s/WindowSystem=libpvrDRM_WSEGL.so/WindowSystem=libpvrWAYLAND_WSEGL.so/g" \
+ ${D}/${sysconfdir}/powervr.ini
+ fi
+ fi
+
+ # Install systemd service
+ if [ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)} ]; then
+ install -d ${D}/${systemd_system_unitdir}/
+ install -m 644 ${WORKDIR}/rc.pvr.service ${D}/${systemd_system_unitdir}/
+ install -d ${D}/${exec_prefix}/bin
+ install -m 755 ${S}/${sysconfdir}/init.d/rc.pvr ${D}/${exec_prefix}/bin/pvrinit
+ fi
+}
+
+PACKAGES = "\
+ ${PN} \
+ ${PN}-dev \
+ ${PN}-debug \
+"
+
+FILES_${PN} = " \
+ ${sysconfdir}/* \
+ ${libdir}/* \
+ /lib/firmware/rgx.fw* \
+ ${RENESAS_DATADIR}/bin/* \
+ ${exec_prefix}/bin/* \
+"
+
+FILES_${PN}-dev = " \
+ ${includedir}/* \
+ ${libdir}/pkgconfig/* \
+"
+
+PROVIDES = "virtual/libgles2"
+FILES_${PN}-debug = " \
+ ${RENESAS_DATADIR}/bin/dlcsrv_REL \
+"
+
+RPROVIDES_${PN} += " \
+ ${GLES}-user-module \
+ libgles2-mesa \
+ libgles2-mesa-dev \
+ libgles2 \
+ libgles2-dev \
+"
+
+RDEPENDS_${PN} = " \
+ kernel-module-gles \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgbm wayland-kms', '', d)} \
+"
+
+INSANE_SKIP_${PN} = "ldflags build-deps file-rdeps"
+INSANE_SKIP_${PN}-dev = "ldflags build-deps file-rdeps"
+INSANE_SKIP_${PN} += "arch"
+INSANE_SKIP_${PN}-dev += "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
+
+# Skip debug strip of do_populate_sysroot()
+INHIBIT_SYSROOT_STRIP = "1"
+
+# Skip debug split and strip of do_package()
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch
new file mode 100644
index 0000000..1dd22f4
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch
@@ -0,0 +1,8 @@
+--- a/etc/init.d/rc.pvr 2014-08-01 09:56:47.528824893 +0900
++++ b/etc/init.d/rc.pvr 2014-08-01 09:56:55.744827677 +0900
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ ############################################################################ ###
+ #@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
+ #@License Strictly Confidential.
diff --git a/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service
new file mode 100644
index 0000000..da7fc30
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=PowerVR consumer services
+Before=weston.service
+
+[Service]
+ExecStart=/usr/bin/pvrinit start
+ExecStop=/usr/bin/pvrinit stop
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+RequiredBy=weston.service
diff --git a/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc b/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc
new file mode 100644
index 0000000..c1081ce
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc
@@ -0,0 +1,67 @@
+require include/iccom-control.inc
+
+# Basic packages
+IMAGE_INSTALL_append = " \
+ bash \
+ v4l-utils \
+ i2c-tools \
+"
+
+# Support secure environment
+IMAGE_INSTALL_append = " \
+ optee-linuxdriver \
+ optee-linuxdriver-armtz \
+ optee-client \
+"
+
+# Add overrides for selection 32 bit or 64 bit target
+OVERRIDES .= ":${TARGET_SYS}"
+
+# Qos user packages only supports 64bit.
+QOS_USER_PKGS = ""
+QOS_USER_PKGS_aarch64-poky-linux = " \
+ qosif-user-module \
+ qosif-tp-user-module \
+"
+
+# Installation for QoS packages
+IMAGE_INSTALL_append = " \
+ kernel-module-qos \
+ ${QOS_USER_PKGS} \
+"
+
+# Renesas Basic packages for 32bit
+BASIC_32BIT_PKGS = " \
+ lib32-coreutils \
+ lib32-libstdc++ \
+ lib32-optee-client \
+"
+
+# Installation for 32bit packages
+IMAGE_INSTALL_append = " \
+ ${@base_conditional("USE_32BIT_PKGS", "1", "${BASIC_32BIT_PKGS}", "", d)} \
+"
+
+# Kernel modules of ICCOM
+ICCOM_KERNEL_PKGS = " \
+ kernel-module-iccom-mfis \
+ kernel-module-iccom-hwspinlock-sample \
+"
+
+# User modules of ICCOM only supports 64bit
+ICCOM_USER_PKGS = ""
+ICCOM_USER_PKGS_aarch64-poky-linux = " \
+ iccom-user-module \
+ iccom-tp-user-module \
+"
+
+# ICCOM Packages
+ICCOM_PKGS = " \
+ ${ICCOM_KERNEL_PKGS} \
+ ${ICCOM_USER_PKGS} \
+"
+
+# Installation for ICCOM Packages
+IMAGE_INSTALL_append = " \
+ ${@base_conditional("USE_ICCOM", "1", " ${ICCOM_PKGS}", "", d)} \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc b/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc
new file mode 100644
index 0000000..7c85d04
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc
@@ -0,0 +1,96 @@
+require include/multimedia-control.inc
+require include/cms-control.inc
+require include/adsp-control.inc
+require include/dtv-dvd-control.inc
+require include/avb-control.inc
+require include/omx-control.inc
+
+# Common Multi Media Packages (MMP)
+MULTIMEDIA_PKGS = " \
+ packagegroup-multimedia-kernel-modules \
+ packagegroup-multimedia-libs \
+"
+
+# MMP test Packages
+MULTIMEDIA_TP_PKGS = " \
+ vspmif-tp-user-module \
+"
+
+# OMX MMP Packages
+OMX_MULTIMEDIA_PKGS = " \
+ omx-user-module \
+"
+
+# CMS MMP Packages
+CMS_MULTIMEDIA_PKGS = " \
+ cms-user-module \
+"
+
+# Kernel modules of DTV
+DTV_KERNEL_PKGS = " \
+ kernel-module-scu-src \
+ kernel-module-ssp \
+ kernel-module-tddmac \
+ kernel-module-tsif \
+"
+
+# DTV Packages
+DTV_PKGS = " \
+ ${DTV_KERNEL_PKGS} \
+ dtv-user-module \
+"
+
+# DVD Packages
+DVD_PKGS = " \
+ dvd-user-module \
+"
+
+# ADSP Packages
+ADSP_PKGS = " \
+ kernel-module-xtensa-hifi \
+ adsp-if-module \
+ adsp-fw-module \
+"
+
+# Kernel modules of AVB
+AVB_KERNEL_PKGS = " \
+ kernel-module-avb-streaming \
+ kernel-module-avb-mch \
+ kernel-module-avb-mse \
+"
+
+# AVB Packages
+AVB_PKGS = " \
+ ${AVB_KERNEL_PKGS} \
+ avbtool \
+ linuxptp \
+ open-avb-mrpd \
+ open-avb-gptp \
+ open-avb-maap \
+ avb-demoapps-avblauncher \
+ avb-demoapps-mrpdummy \
+ avb-demoapps-simple \
+"
+
+# Renesas MMP 32bit packages
+MMP_32BIT_PKGS = " \
+ ${@base_conditional("USE_MULTIMEDIA", "1", "lib32-packagegroup-multimedia-libs lib32-omx-user-module", "", d)} \
+ ${@base_conditional("USE_MULTIMEDIA_TP", "1", "lib32-vspmif-tp-user-module", "", d)} \
+ ${@base_conditional("USE_CMS", "1", "lib32-cms-user-module", "", d)} \
+ ${@base_conditional("USE_DTV", "1", "lib32-dtv-user-module", "", d)} \
+ ${@base_conditional("USE_DVD", "1", "lib32-dvd-user-module", "", d)} \
+ ${@base_conditional("USE_ADSP", "1", "lib32-adsp-if-module", "", d)} \
+"
+
+# Install pkg selection
+IMAGE_INSTALL_append = " \
+ ${@base_conditional("USE_MULTIMEDIA", "1", " ${MULTIMEDIA_PKGS}", "", d)} \
+ ${@base_conditional("USE_MULTIMEDIA_TP", "1", " ${MULTIMEDIA_TP_PKGS}", "", d)} \
+ ${@base_conditional("USE_OMX_USER_MODULE", "1", " ${OMX_MULTIMEDIA_PKGS}", "", d)} \
+ ${@base_conditional("USE_CMS", "1", " ${CMS_MULTIMEDIA_PKGS}", "", d)} \
+ ${@base_conditional("USE_DTV", "1", " ${DTV_PKGS}", "", d)} \
+ ${@base_conditional("USE_DVD", "1", " ${DVD_PKGS}", "", d)} \
+ ${@base_conditional("USE_ADSP", "1", " ${ADSP_PKGS}", "", d)} \
+ ${@base_conditional("USE_AVB", "1", " ${AVB_PKGS}", "", d)} \
+ ${@base_conditional("USE_32BIT_MMP", "1", " ${MMP_32BIT_PKGS}", "", d)} \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb b/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb
new file mode 100644
index 0000000..fd4e6a0
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb
@@ -0,0 +1,15 @@
+require recipes-graphics/images/core-image-weston.bb
+require core-image-renesas-base.inc
+require core-image-weston.inc
+
+DESCRIPTION = "Image with weston support that includes everything within \
+core-image-weston plus meta-toolchain, development headers and libraries to \
+form a standalone SDK."
+
+IMAGE_FEATURES += " \
+ dev-pkgs tools-sdk \
+ tools-debug debug-tweaks \
+ ssh-server-openssh \
+"
+
+IMAGE_INSTALL_append = " kernel-devsrc ltp"
diff --git a/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend b/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend
new file mode 100644
index 0000000..e30bc2e
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend
@@ -0,0 +1,2 @@
+require core-image-renesas-base.inc
+require core-image-weston.inc
diff --git a/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc b/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc
new file mode 100644
index 0000000..eb4f1b8
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc
@@ -0,0 +1,15 @@
+require include/gles-control.inc
+require core-image-renesas-mmp-base.inc
+
+# Gstreamer Packages
+GSTREAMER_PKGS = "packagegroup-gstreamer1.0-plugins"
+
+# Install packages for Wayland Env
+# default: Basic packages, Gstreamer packages
+# optional: GFX packages
+IMAGE_INSTALL_append = " \
+ ${GSTREAMER_PKGS} \
+ packagegroup-wayland-community \
+ packagegroup-graphics-renesas-proprietary \
+ packagegroup-graphics-renesas-wayland \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc b/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc
diff --git a/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc b/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc
new file mode 100644
index 0000000..55b8c15
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc
@@ -0,0 +1,33 @@
+# FIXME: can not override PACKAGECONFIG.
+PACKAGECONFIG[gles] = "--enable-gles1 --disable-gles2"
+PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=wayland"
+
+# Disable the gbm modules of mesa
+PACKAGECONFIG_remove = "gbm"
+
+# Remove the gbm and egl packages. These are provided in other recipes.
+PACKAGES_remove = " \
+ libgbm-dev libgbm \
+ libegl-mesa-dev libegl-mesa \
+ libegl-dev libegl \
+ libgles2-mesa libgles2-mesa-dev \
+"
+INSTALLED_HEADER = "src/egl/wayland/wayland-egl/wayland-egl-priv.h"
+
+do_install_append() {
+ # Remove libegl-mesa modules and headers
+ rm -f ${D}/${libdir}/libEGL.la
+ rm -f ${D}/${libdir}/libEGL.so*
+ rm -f ${D}/${libdir}/pkgconfig/egl.pc
+ rm -rf ${D}/${includedir}/EGL
+ rm -rf ${D}/${includedir}/KHR
+
+ # install required header for wayland
+ install -d ${D}/usr/include
+ install -m 644 ${S}/${INSTALLED_HEADER} ${D}/usr/include/
+}
+
+FILES_libwayland-egl-dev += " \
+ /usr/include \
+ /usr/include/*.h \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend b/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 0000000..e1b7ad2
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,10 @@
+require include/gles-control.inc
+
+def map_libs(d):
+ if base_conditional('USE_GLES_WAYLAND', "1", "1", "0", d) == "1":
+ return "wayland"
+
+ return "dummy"
+
+MESATARGET := "${@map_libs(d)}"
+include mesa-${MESATARGET}.inc
diff --git a/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb b/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb
new file mode 100644
index 0000000..f94d289
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Renesas package group for Weston"
+LICENSE = "CLOSED & MIT"
+
+inherit packagegroup
+require include/gles-control.inc
+
+PACKAGES = " \
+ packagegroup-wayland-community \
+ packagegroup-graphics-renesas-proprietary \
+ packagegroup-graphics-renesas-wayland \
+"
+
+PR = "r0"
+
+RDEPENDS_packagegroup-wayland-community = " \
+ wayland \
+ weston \
+ alsa-utils \
+ alsa-tools \
+ libdrm-tests \
+ libdrm-kms \
+"
+
+RDEPENDS_packagegroup-graphics-renesas-proprietary = " \
+ ${@bb.utils.contains('USE_GLES', '1', \
+ 'kernel-module-gles gles-user-module' , \
+ '', d)} \
+"
+
+DEPENDS_packagegroup-graphics-renesas-wayland = "libegl"
+
+RDEPENDS_packagegroup-graphics-renesas-wayland = " \
+ ${@bb.utils.contains('USE_GLES_WAYLAND', '1', \
+ 'libgbm libgbm-dev wayland-kms', \
+ '', d)} \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphics-libegl.bb b/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphics-libegl.bb
new file mode 100644
index 0000000..35bfd37
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphics-libegl.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Graphics OpenGL ES user libraries and depenencies package group"
+LICENSE = "CLOSED & MIT"
+
+DEPENDS = "gles-user-module \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgbm wayland-kms', '', d)} \
+"
+
+PR = "r0"
+
+inherit packagegroup
+
+PACKAGES = " \
+ packagegroup-graphics-libegl \
+"
+
+RDEPENDS_packagegroup-graphics-libegl = " \
+ gles-user-module \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgbm wayland-kms', '', d)} \
+"
+
+PROVIDES = "virtual/egl"
+RPROVIDES_${PN} += " \
+ libegl \
+ libegl1 \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb b/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb
new file mode 100644
index 0000000..0bde4ae
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Recipe for libegl"
+LICENSE = "CLOSED"
+
+DEPENDS = "gles-user-module \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgbm wayland-kms', '', d)} \
+"
+
+PR = "r0"
+
+RDEPENDS_${PN} = " \
+ gles-user-module \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgbm wayland-kms', '', d)} \
+"
+
+PROVIDES = "virtual/egl"
+RPROVIDES_${PN} += " \
+ libegl \
+ libegl1 \
+"
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb b/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb
new file mode 100644
index 0000000..d0d1499
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb
@@ -0,0 +1,35 @@
+SUMMARY = "gbm library"
+LICENSE = "MIT"
+SECTION = "libs"
+
+LIC_FILES_CHKSUM = " \
+ file://gbm.c;beginline=4;endline=22;md5=5cdaac262c876e98e47771f11c7036b5"
+
+SRCREV = "a0c7d6c97fe1fffe45eee524060cbb12767c6461"
+SRC_URI = "git://github.com/renesas-rcar/libgbm;branch=rcar-gen3"
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = "(r8a7795|r8a7796)"
+DEPENDS = "wayland-kms"
+
+inherit autotools pkgconfig
+
+PACKAGES = " \
+ ${PN} \
+ ${PN}-dev \
+ ${PN}-dbg \
+ ${PN}-staticdev \
+"
+
+FILES_${PN} = " \
+ ${libdir}/libgbm.so.* \
+ ${libdir}/gbm/libgbm_kms.so.* \
+ ${libdir}/gbm/*.so \
+ ${libdir}/*.so \
+"
+FILES_${PN}-dev += "${libdir}/gbm/*.la"
+FILES_${PN}-dbg += "${libdir}/gbm/.debug/*"
+FILES_${PN}-staticdev += "${libdir}/gbm/*.a"
+
+INSANE_SKIP_${PN} += "dev-so"
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb b/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb
new file mode 100644
index 0000000..e50cac0
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "KMS library for Wayland"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = " \
+ file://wayland-kms.c;beginline=6;endline=24;md5=5cdaac262c876e98e47771f11c7036b5"
+
+PV_append = "+git${SRCREV}"
+
+SRCREV = "15184e5bd3701938a6b30b8f03b471477fc742e8"
+SRC_URI = "git://github.com/renesas-rcar/wayland-kms.git;branch=rcar-gen3"
+
+COMPATIBLE_MACHINE = "(r8a7795|r8a7796)"
+S = "${WORKDIR}/git"
+DEPENDS = "libdrm wayland gles-user-module wayland-native"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${libdir}/libwayland-kms.so.*"
+FILES_${PN}-dev = " \
+ ${libdir}/libwayland-kms.la \
+ ${libdir}/libwayland-kms.so \
+ ${libdir}/pkgconfig/* \
+ ${includedir}/* \
+"
+FILES_${PN}-staticdev += "${libdir}/libwayland-kms.a"
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend b/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 0000000..2886bae
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,16 @@
+require include/gles-control.inc
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://weston.service \
+"
+
+do_install_append() {
+ if [ "X${USE_GLES}" = "X1" ]; then
+ sed -e "/RequiresMountsFor=\/run/a Wants=rc.pvr.service" \
+ -e "/RequiresMountsFor=\/run/a After=rc.pvr.service" \
+ -e "s/\$OPTARGS/--idle-time=0 \$OPTARGS/" \
+ -i ${D}/${systemd_system_unitdir}/weston.service
+ fi
+}
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.service b/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.service
new file mode 100644
index 0000000..79afa67
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Weston Wayland Compositor
+RequiresMountsFor=/run
+After=dbus.service rc.pvr.service
+
+[Service]
+User=root
+EnvironmentFile=-/etc/default/weston
+ExecStart=/usr/bin/weston-launch -u root -- $OPTARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston.inc b/meta-rcar-gen3/recipes-graphics/wayland/weston.inc
new file mode 100644
index 0000000..e475aea
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston.inc
@@ -0,0 +1,16 @@
+require include/gles-control.inc
+require include/multimedia-control.inc
+
+PACKAGECONFIG_remove_virtclass-multilib-lib32 = "launch"
+DEPENDS_append = " \
+ ${@base_conditional('USE_GLES', '1', ' libgbm', '', d)}"
+
+RDEPENDS_${PN}_append = " \
+ ${@base_conditional('USE_GLES', '1', ' libgbm', '', d)} \
+"
+RDEPENDS_${PN}-examples_append = " \
+ ${@base_conditional('USE_GLES', '1', ' libgbm', '', d)}"
+
+EXTRA_OECONF_append = " \
+ ${@base_conditional('USE_GLES', '1', '', \
+ ' WESTON_NATIVE_BACKEND="fbdev-backend.so"', d)}"
diff --git a/meta-rcar-gen3/recipes-graphics/wayland/weston_2.%.bbappend b/meta-rcar-gen3/recipes-graphics/wayland/weston_2.%.bbappend
new file mode 100644
index 0000000..34ea2c9
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/wayland/weston_2.%.bbappend
@@ -0,0 +1 @@
+require weston.inc
diff --git a/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
new file mode 100644
index 0000000..918407d
--- /dev/null
+++ b/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -0,0 +1 @@
+PACKAGECONFIG_remove = "glamor"