summaryrefslogtreecommitdiffstats
path: root/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-renesas/meta-rcar-gen3/recipes-graphics')
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cairo/cairo_%.bbappend3
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend4
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb136
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch10
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service13
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc68
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc102
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb15
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend2
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc16
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc0
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc24
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend10
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb39
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb21
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb36
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb25
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend48
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.ini2
-rwxr-xr-xbsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.sh5
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch49
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend23
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg.inc180
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch40
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch61
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch53
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch47
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch46
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch25
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch18
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend3
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb35
32 files changed, 1159 insertions, 0 deletions
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cairo/cairo_%.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cairo/cairo_%.bbappend
new file mode 100644
index 00000000..8b3cca45
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cairo/cairo_%.bbappend
@@ -0,0 +1,3 @@
+require include/gles-control.inc
+
+DEPENDS_append_rcar-gen3 = "${@ ' gles-user-module' if '${USE_GLES_WAYLAND}' == '1' else ''}"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend
new file mode 100644
index 00000000..12a5417e
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/cogl/cogl-1.0_1.%.bbappend
@@ -0,0 +1,4 @@
+require include/gles-control.inc
+DEPENDS_append_rcar-gen3 = " \
+ ${@'gles-user-module libgbm' if '${USE_GLES_WAYLAND}' == '1' else ''} \
+"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb
new file mode 100644
index 00000000..084e5cee
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module.bb
@@ -0,0 +1,136 @@
+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|r8a77965|r8a77990)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}/rogue"
+GLES = "gsx"
+
+SRC_URI_r8a7795 = "file://r8a77951_linux_gsx_binaries_gles.tar.bz2"
+SRC_URI_r8a7796 = "file://r8a77960_linux_gsx_binaries_gles.tar.bz2"
+SRC_URI_r8a77965 = "file://r8a77965_linux_gsx_binaries_gles.tar.bz2"
+SRC_URI_r8a77990 = "file://r8a77990_linux_gsx_binaries_gles.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"
+
+do_install() {
+ # Install configuration files
+ install -d ${D}${sysconfdir}/init.d
+ install -m 644 ${S}/etc/powervr.ini ${D}${sysconfdir}
+ install -m 755 ${S}/etc/init.d/rc.pvr ${D}${sysconfdir}/init.d/pvrinit
+ install -m 755 ${S}/etc/init.d/rc.pvr ${D}${sysconfdir}/init.d/
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 644 ${S}/etc/udev/rules.d/72-pvr-seat.rules ${D}${sysconfdir}/udev/rules.d/
+
+ # Install header files
+ install -d ${D}${includedir}/EGL
+ install -m 644 ${S}/usr/include/EGL/*.h ${D}${includedir}/EGL/
+ install -d ${D}${includedir}/GLES2
+ install -m 644 ${S}/usr/include/GLES2/*.h ${D}${includedir}/GLES2/
+ install -d ${D}${includedir}/GLES3
+ install -m 644 ${S}/usr/include/GLES3/*.h ${D}${includedir}/GLES3/
+ install -d ${D}${includedir}/KHR
+ install -m 644 ${S}/usr/include/KHR/khrplatform.h ${D}${includedir}/KHR/khrplatform.h
+
+ # Install pre-builded binaries
+ install -d ${D}${libdir}
+ install -m 755 ${S}/usr/lib/*.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}/usr/lib/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}/
+
+ # Fix weston dependency, needs to be weston@.service
+ sed -i 's/^RequiredBy=weston.service$/RequiredBy=weston@.service/' \
+ ${D}${systemd_system_unitdir}/rc.pvr.service
+
+ install -d ${D}${exec_prefix}/bin
+ install -m 755 ${S}/etc/init.d/rc.pvr ${D}${exec_prefix}/bin/pvrinit
+ fi
+}
+
+PACKAGES = "\
+ ${PN} \
+ ${PN}-dev \
+"
+
+FILES_${PN} = " \
+ ${sysconfdir}/* \
+ ${libdir}/* \
+ /lib/firmware/rgx.fw* \
+ ${RENESAS_DATADIR}/bin/* \
+ ${exec_prefix}/bin/* \
+"
+
+FILES_${PN}-dev = " \
+ ${includedir}/* \
+ ${libdir}/pkgconfig/* \
+"
+
+PROVIDES = "virtual/libgles2"
+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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch
new file mode 100644
index 00000000..f6025709
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/change-shell.patch
@@ -0,0 +1,10 @@
+Index: rogue/etc/init.d/rc.pvr
+===================================================================
+--- rogue.orig/etc/init.d/rc.pvr
++++ rogue/etc/init.d/rc.pvr
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ ############################################################################ ###
+ # File rc.pvr
+ # Copyright Copyright (C) 2013-2016 Renesas Electronics Corporation
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/gles-module/gles-user-module/rc.pvr.service
new file mode 100644
index 00000000..da7fc300
--- /dev/null
+++ b/bsp/meta-renesas/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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc
new file mode 100644
index 00000000..b64abad9
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-base.inc
@@ -0,0 +1,68 @@
+require include/iccom-control.inc
+
+COMPATIBLE_MACHINE = "(salvator-x|ulcb|ebisu)"
+
+# Basic packages
+IMAGE_INSTALL_append = " \
+ bash \
+ v4l-utils \
+ i2c-tools \
+ coreutils \
+"
+
+# Support secure environment
+IMAGE_INSTALL_append = " \
+ 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 = " \
+ ${@oe.utils.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 = " \
+ ${@oe.utils.conditional("USE_ICCOM", "1", " ${ICCOM_PKGS}", "", d)} \
+"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc
new file mode 100644
index 00000000..88062204
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-renesas-mmp-base.inc
@@ -0,0 +1,102 @@
+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 \
+"
+
+# DVD Encryption Library packages
+DVD_ENCRYPTION_PKGS = " \
+ dvd-encryption-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 \
+ openavnu-mrpd \
+ openavnu-gptp \
+ openavnu-maap \
+ avb-demoapps-avblauncher \
+ avb-demoapps-mrpdummy \
+ avb-demoapps-simple \
+"
+
+# Renesas MMP 32bit packages
+MMP_32BIT_PKGS = " \
+ ${@oe.utils.conditional("USE_MULTIMEDIA", "1", "lib32-packagegroup-multimedia-libs lib32-omx-user-module", "", d)} \
+ ${@oe.utils.conditional("USE_MULTIMEDIA_TP", "1", "lib32-vspmif-tp-user-module", "", d)} \
+ ${@oe.utils.conditional("USE_CMS", "1", "lib32-cms-user-module", "", d)} \
+ ${@oe.utils.conditional("USE_DTV", "1", "lib32-dtv-user-module", "", d)} \
+ ${@oe.utils.conditional("USE_DVD", "1", "lib32-dvd-user-module", "", d)} \
+ ${@oe.utils.conditional("USE_ADSP", "1", "lib32-adsp-if-module", "", d)} \
+"
+
+# Install pkg selection
+IMAGE_INSTALL_append = " \
+ ${@oe.utils.conditional("USE_MULTIMEDIA", "1", " ${MULTIMEDIA_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_MULTIMEDIA_TP", "1", " ${MULTIMEDIA_TP_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_OMX_USER_MODULE", "1", " ${OMX_MULTIMEDIA_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_CMS", "1", " ${CMS_MULTIMEDIA_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_DTV", "1", " ${DTV_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_DVD", "1", " ${DVD_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_DVD_ENCRYPTION_LIB", "1", " ${DVD_ENCRYPTION_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_ADSP", "1", " ${ADSP_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_AVB", "1", " ${AVB_PKGS}", "", d)} \
+ ${@oe.utils.conditional("USE_32BIT_MMP", "1", " ${MMP_32BIT_PKGS}", "", d)} \
+"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston-sdk.bb
new file mode 100644
index 00000000..fd4e6a09
--- /dev/null
+++ b/bsp/meta-renesas/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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend
new file mode 100644
index 00000000..41f1cb04
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.bbappend
@@ -0,0 +1,2 @@
+require ${@"core-image-renesas-base.inc" if "rcar-gen3" in d.getVar("OVERRIDES") else ""}
+require ${@"core-image-weston.inc" if "rcar-gen3" in d.getVar("OVERRIDES") else ""}
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc
new file mode 100644
index 00000000..4ae567a1
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/images/core-image-weston.inc
@@ -0,0 +1,16 @@
+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 \
+ libx11-locale \
+"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-dummy.inc
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc
new file mode 100644
index 00000000..eee68630
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa-wayland.inc
@@ -0,0 +1,24 @@
+# FIXME: can not override PACKAGECONFIG.
+PACKAGECONFIG[gles] = "-Dgles1=true -Dgles2=false"
+PACKAGECONFIG[egl] = "-Degl=true"
+
+# 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 \
+ libwayland-egl libwayland-egl-dev \
+"
+
+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
+}
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 00000000..022144ef
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,10 @@
+require include/gles-control.inc
+
+def map_libs(d):
+ if oe.utils.conditional('USE_GLES_WAYLAND', "1", "1", "0", d) == "1":
+ return "wayland"
+
+ return "dummy"
+
+MESATARGET := "${@map_libs(d)}"
+include mesa-${MESATARGET}.inc
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb
new file mode 100644
index 00000000..b5cff820
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/packagegroups/packagegroup-graphic-renesas.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Renesas package group for Weston"
+LICENSE = "CLOSED & MIT"
+
+inherit packagegroup
+require include/gles-control.inc
+
+COMPATIBLE_MACHINE = "(salvator-x|ulcb|ebisu)"
+
+PACKAGES = " \
+ packagegroup-wayland-community \
+ packagegroup-graphics-renesas-proprietary \
+ packagegroup-graphics-renesas-wayland \
+"
+
+PR = "r0"
+
+RDEPENDS_packagegroup-wayland-community = " \
+ wayland \
+ weston \
+ weston-examples \
+ 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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb
new file mode 100644
index 00000000..06c56f73
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libegl.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Recipe for libegl"
+LICENSE = "CLOSED"
+
+COMPATIBLE_MACHINE = "(salvator-x|ulcb|ebisu)"
+
+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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb
new file mode 100644
index 00000000..87d52f0e
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/libgbm.bb
@@ -0,0 +1,36 @@
+SUMMARY = "gbm library"
+LICENSE = "MIT"
+SECTION = "libs"
+
+LIC_FILES_CHKSUM = " \
+ file://gbm.c;beginline=4;endline=22;md5=5cdaac262c876e98e47771f11c7036b5"
+
+SRCREV = "953f6515dc07c717360c499273dccc227857e6ed"
+SRC_URI = "git://github.com/renesas-rcar/libgbm;branch=match-mesa-19.0.1"
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = "(r8a7795|r8a7796|r8a77965|r8a77990)"
+DEPENDS = "wayland-kms udev"
+
+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"
+PROVIDES += "virtual/libgbm"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/wayland-kms_1.6.0.bb
new file mode 100644
index 00000000..134e8d2e
--- /dev/null
+++ b/bsp/meta-renesas/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|r8a77965|r8a77990)"
+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/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 00000000..17225873
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,48 @@
+require include/gles-control.inc
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_rcar-gen3 = " \
+ file://weston.ini \
+ file://weston.sh \
+"
+
+do_install_append_rcar-gen3() {
+ if [ "X${USE_GLES}" = "X1" ]; then
+ sed -e "/^After=/s/$/ dbus.service multi-user.target/" \
+ -e "s/\$OPTARGS/--idle-time=0 \$OPTARGS/" \
+ -i ${D}/${systemd_system_unitdir}/weston@.service
+ fi
+
+ install -d ${D}/${sysconfdir}/xdg/weston
+ # install weston.ini as sample settings of gl-renderer
+ install -m 644 ${WORKDIR}/weston.ini ${D}/${sysconfdir}/xdg/weston/
+
+ # Checking for ivi-shell configuration
+ # If ivi-shell is enable, we will add its configs to weston.ini
+ if [ "X${USE_WAYLAND_IVI_SHELL}" = "X1" ]; then
+ sed -i '/repaint-window=34/c\repaint-window=34\nshell=ivi-shell.so' \
+ ${D}/${sysconfdir}/xdg/weston/weston.ini
+ sed -e '$a\\' \
+ -e '$a\[ivi-shell]' \
+ -e '$a\ivi-module=ivi-controller.so' \
+ -e '$a\ivi-input-module=ivi-input-controller.so' \
+ -e '$a\transition-duration=300' \
+ -e '$a\cursor-theme=default' \
+ -i ${D}/${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ # Set XDG_RUNTIME_DIR to /run/user/$UID (e.g. run/user/0)
+ install -d ${D}/${sysconfdir}/profile.d
+ install -m 0755 ${WORKDIR}/weston.sh ${D}/${sysconfdir}/profile.d/weston.sh
+
+ # Fix weston.service and weston@.service run simultaneously.
+ mv ${D}/${sysconfdir}/init.d/weston ${D}/${sysconfdir}/init.d/weston@
+}
+
+FILES_${PN}_append_rcar-gen3 = " \
+ ${sysconfdir}/profile.d/weston.sh \
+"
+
+INITSCRIPT_NAME = "weston@"
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.ini b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.ini
new file mode 100644
index 00000000..f31c2906
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.ini
@@ -0,0 +1,2 @@
+[core]
+repaint-window=34
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.sh b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.sh
new file mode 100755
index 00000000..33ed8a4a
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston-init/weston.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if test -z "$XDG_RUNTIME_DIR"; then
+ export XDG_RUNTIME_DIR=/run/user/$UID
+fi
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch
new file mode 100644
index 00000000..2c797df8
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston/0001-drm-change-timing-to-set-color-format-for-primary-pl.patch
@@ -0,0 +1,49 @@
+From 51048463dae4ace13776bb77675316007083a6ee Mon Sep 17 00:00:00 2001
+From: Tomohito Esaki <etom@igel.co.jp>
+Date: Mon, 30 Mar 2020 17:10:54 +0900
+Subject: [PATCH] drm: change timing to set color format for primary plane
+ without universal plane
+
+Without universal plane, the weston crashes with null pointer access in
+set_gbm_format function because that function called before output
+enable function. By changing timing to set color format for primary
+plane in this case, this issue fixes.
+
+Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
+---
+ libweston/backend-drm/drm.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
+index 3c5ca65..2aea82f 100644
+--- a/libweston/backend-drm/drm.c
++++ b/libweston/backend-drm/drm.c
+@@ -1389,12 +1389,6 @@ drm_output_set_gbm_format(struct weston_output *base,
+
+ if (parse_gbm_format(gbm_format, b->gbm_format, &output->gbm_format) == -1)
+ output->gbm_format = b->gbm_format;
+-
+- /* Without universal planes, we can't discover which formats are
+- * supported by the primary plane; we just hope that the GBM format
+- * works. */
+- if (!b->universal_planes)
+- output->scanout_plane->formats[0].format = output->gbm_format;
+ }
+
+ static void
+@@ -1626,6 +1620,12 @@ drm_output_init_crtc(struct drm_output *output, drmModeRes *resources)
+ goto err_crtc;
+ }
+
++ /* Without universal planes, we can't discover which formats are
++ * supported by the primary plane; we just hope that the GBM format
++ * works. */
++ if (!b->universal_planes)
++ output->scanout_plane->formats[0].format = output->gbm_format;
++
+ /* Failing to find a cursor plane is not fatal, as we'll fall back
+ * to software cursor. */
+ output->cursor_plane =
+--
+2.7.4
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 00000000..c2f75afc
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1,23 @@
+require include/gles-control.inc
+require include/multimedia-control.inc
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_rcar-gen3 = " \
+ file://0001-drm-change-timing-to-set-color-format-for-primary-pl.patch \
+"
+
+PACKAGECONFIG_remove_virtclass-multilib-lib32 = "launch"
+
+DEPENDS_append_rcar-gen3 = " \
+ ${@oe.utils.conditional('USE_GLES', '1', ' libgbm', '', d)}"
+
+RDEPENDS_${PN}_append_rcar-gen3 = " \
+ ${@oe.utils.conditional('USE_GLES', '1', ' libgbm', '', d)} \
+"
+RDEPENDS_${PN}-examples_append_rcar-gen3 = " \
+ ${@oe.utils.conditional('USE_GLES', '1', ' libgbm', '', d)}"
+
+EXTRA_OECONF_append_rcar-gen3 = " \
+ ${@oe.utils.conditional('USE_GLES', '1', '', \
+ ' WESTON_NATIVE_BACKEND="fbdev-backend.so"', d)}"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg.inc b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg.inc
new file mode 100644
index 00000000..3a6d2aef
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -0,0 +1,180 @@
+SUMMARY = "The X.Org X server"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
+
+# xf86-*-* packages depend on an X server built with the xfree86 DDX
+# so we have a virtual to represent that:
+# deprecated, we should use virtual/xserver instead
+PROVIDES = "virtual/xserver-xf86"
+
+# Other packages tend to just care that there is *an* X server:
+PROVIDES += "virtual/xserver"
+
+PE = "2"
+INC_PR = "r8"
+
+XORG_PN = "xorg-server"
+SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.bz2"
+SRC_URI += "file://macro_tweak.patch"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig
+
+inherit features_check
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PROTO_DEPS = "xorgproto"
+LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess"
+DEPENDS = "${PROTO_DEPS} ${LIB_DEPS} font-util"
+
+# Split out some modules and extensions from the main package
+# These aren't needed for basic operations and only take up space:
+# 32.0k libdri.so
+# 91.0k libexa.so
+# 336.0k libglx.so
+# 1360k libint10.so
+# 180.0k libwfb.so
+# 320.0k libxaa.so
+# 124.0k libxf1bpp.so
+# 84.0k libxf4bpp.so
+# librecord.so
+# libextmod.so
+# libdbe.so
+
+PACKAGES =+ "${PN}-sdl \
+ ${PN}-fbdev \
+ ${PN}-xvfb \
+ ${PN}-utils \
+ ${PN}-xephyr \
+ ${PN}-xwayland \
+ ${PN}-multimedia-modules \
+ ${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-glx \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ ${PN}-module-libint10 \
+ ${PN}-module-libafb \
+ ${PN}-module-libwfb \
+ ${PN}-module-libmfb \
+ ${PN}-module-libcfb \
+ ${PN}-module-exa \
+ ${PN}-module-xaa \
+ ${PN}-module-libxf1bpp \
+ ${PN}-module-libxf4bpp \
+ xf86-video-modesetting"
+
+SUMMARY_xf86-video-modesetting = "X.Org X server -- modesetting display driver"
+INSANE_SKIP_${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
+
+XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
+RRECOMMENDS_${PN} += "${XSERVER_RRECOMMENDS}"
+RRECOMMENDS_${PN}-xwayland += "${XSERVER_RRECOMMENDS}"
+RDEPENDS_${PN}-xvfb += "xkeyboard-config"
+RDEPENDS_${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
+
+FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d"
+FILES_${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la"
+FILES_${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled"
+FILES_${PN}-sdl = "${bindir}/Xsdl"
+FILES_${PN}-fbdev = "${bindir}/Xfbdev"
+FILES_${PN}-xvfb = "${bindir}/Xvfb"
+FILES_${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
+FILES_${PN}-xephyr = "${bindir}/Xephyr"
+FILES_${PN}-xwayland = "${bindir}/Xwayland"
+FILES_${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
+FILES_${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
+FILES_${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
+FILES_${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
+FILES_${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so"
+FILES_${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so"
+FILES_${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so"
+FILES_${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
+FILES_${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
+FILES_${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
+FILES_${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
+FILES_${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
+FILES_${PN}-module-exa = "${libdir}/xorg/modules/libexa.so"
+FILES_${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
+FILES_${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
+FILES_${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
+FILES_xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so"
+
+EXTRA_OECONF += "--with-fop=no \
+ --with-pic \
+ --disable-static \
+ --disable-record \
+ --disable-dmx \
+ --disable-xnest \
+ --enable-xvfb \
+ --enable-composite \
+ --without-dtrace \
+ --with-int10=x86emu \
+ --sysconfdir=/etc/X11 \
+ --localstatedir=/var \
+ --with-xkb-output=/var/lib/xkb \
+"
+
+OPENGL_PKGCONFIGS = "dri glx glamor dri3 xshmfence"
+PACKAGECONFIG ??= "dri2 udev ${XORG_CRYPTO} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl wayland', 'xwayland', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-logind', '', d)} \
+"
+
+PACKAGECONFIG[udev] = "--enable-config-udev,--disable-config-udev,udev"
+PACKAGECONFIG[dri] = "--enable-dri,--disable-dri,xorgproto virtual/mesa"
+PACKAGECONFIG[dri2] = "--enable-dri2,--disable-dri2,xorgproto"
+# DRI3 requires xshmfence to also be enabled
+PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,xorgproto"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,xorgproto virtual/libgl virtual/libx11"
+PACKAGECONFIG[glamor] = "--enable-glamor,--disable-glamor,libepoxy virtual/libgbm,libegl"
+PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+PACKAGECONFIG[xshmfence] = "--enable-xshmfence,--disable-xshmfence,libxshmfence"
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[systemd-logind] = "--enable-systemd-logind=yes,--enable-systemd-logind=no,dbus,"
+PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd"
+PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,xorgproto"
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,wayland wayland-native wayland-protocols libepoxy"
+
+# Xorg requires a SHA1 implementation, pick one
+XORG_CRYPTO ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
+PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
+PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
+
+do_install_append () {
+ # Its assumed base-files creates this for us
+ rmdir ${D}${localstatedir}/log/
+}
+
+# Add runtime provides for the ABI versions of the video and input subsystems,
+# so that drivers can depend on the relevant version.
+python populate_packages_prepend() {
+ import subprocess
+
+ # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
+ # into the new package, not the staged ones.
+ newenv = dict(os.environ)
+ newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
+
+ def get_abi(name):
+ abis = {
+ "video": "abi_videodrv",
+ "input": "abi_xinput"
+ }
+ p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
+ shell=True, env=newenv, stdout=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ output = stdout.decode("utf-8").split(".")[0]
+ mlprefix = d.getVar('MLPREFIX') or ''
+ return "%sxorg-abi-%s-%s" % (mlprefix, name, output)
+
+ pn = d.getVar("PN")
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
+}
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
new file mode 100644
index 00000000..964d5dd4
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch
@@ -0,0 +1,40 @@
+From a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri, 5 Jan 2018 11:58:42 +1000
+Subject: [PATCH] config: fix NULL value detection for ID_INPUT being unset
+
+Erroneous condition caused us to keep going with all devices that didn't have
+ID_INPUT set.
+
+Fixes: 5aad81445c8c3d6
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382
+Reviewed-by: Adam Jackson <ajax@redhat.com>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+Upstream-status: Backport
+https://patchwork.freedesktop.org/patch/196090/
+Affects: < 1.20.0
+[Yocto # 12899]
+
+Signed-off-by: Armin Kuster <akuser808@gmail.com>
+
+---
+ config/udev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/udev.c b/config/udev.c
+index e198e8609..3a73189e2 100644
+--- a/config/udev.c
++++ b/config/udev.c
+@@ -135,7 +135,7 @@ device_added(struct udev_device *udev_device)
+ #endif
+
+ value = udev_device_get_property_value(udev_device, "ID_INPUT");
+- if (value && !strcmp(value, "0")) {
++ if (!value || !strcmp(value, "0")) {
+ LogMessageVerb(X_INFO, 10,
+ "config/udev: ignoring device %s without "
+ "property ID_INPUT set\n", path);
+--
+2.17.1
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
new file mode 100644
index 00000000..16ec3edb
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
@@ -0,0 +1,61 @@
+Discover monotonic clock using compile-time check
+
+monotonic clock check does not work when cross-compiling.
+
+Upstream-Status: Denied [Does not work on OpenBSD]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+Original patch follows:
+
+When xorg-xserver is being cross-compiled, there is currently no way
+for us to detect whether the monotonic clock is available on the
+target system, because we aren't able to run a test program on the host
+system. Currently, in this situation, we default to not use the
+monotonic clock. One problem with this situation is that the user will
+be treated as idle when the date is updated.
+
+To fix this situation, we now use a compile-time check to detect whether the
+monotonic clock is available. This check can run just fine when we are
+cross-compiling.
+
+Signed-off-by: David James <davidjames at google.com>
+---
+ configure.ac | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f7ab48c..26e85cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1048,19 +1048,16 @@ if ! test "x$have_clock_gettime" = xno; then
+ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+ fi
+
+- AC_RUN_IFELSE([AC_LANG_SOURCE([
++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <time.h>
+-
+-int main(int argc, char *argv[[]]) {
+- struct timespec tp;
+-
+- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
++#include <unistd.h>
++int main() {
++#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
++ #error No monotonic clock
++#endif
+ return 0;
+- else
+- return 1;
+ }
+- ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+- [MONOTONIC_CLOCK="cross compiling"])
++]])],[MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no])
+
+ LIBS="$LIBS_SAVE"
+ CPPFLAGS="$CPPFLAGS_SAVE"
+--
+2.1.4
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
new file mode 100644
index 00000000..d05eec5b
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
@@ -0,0 +1,53 @@
+From d77cdc5e1eee26821ab98c947abea53fb7b18fe5 Mon Sep 17 00:00:00 2001
+From: California Sullivan <california.l.sullivan@intel.com>
+Date: Fri, 16 Mar 2018 17:23:11 -0700
+Subject: [PATCH] xf86pciBus.c: use Intel ddx only for pre-gen4 hardware
+
+Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
+Author: Timo Aaltonen <tjaalton@debian.org>
+
+Instead of defaulting to the Intel driver for all Intel hardware, only
+default it for older hardware for which it has shown to be better for.
+
+Others fall through to the -modesetting default.
+
+Upstream-Status: Pending [Debian/Fedora patch
+https://src.fedoraproject.org/rpms/xorg-x11-server/c/ee515e44b07e37689abf48cf2fffb41578f3bc1d]
+
+Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
+---
+ hw/xfree86/common/xf86pciBus.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
+index e61ae0cd4..d70c99197 100644
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -1173,7 +1173,23 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
+ case 0x0bef:
+ /* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+ break;
+- default:
++ /* Default to intel only on pre-gen4 chips */
++ case 0x3577:
++ case 0x2562:
++ case 0x3582:
++ case 0x358e:
++ case 0x2572:
++ case 0x2582:
++ case 0x258a:
++ case 0x2592:
++ case 0x2772:
++ case 0x27a2:
++ case 0x27ae:
++ case 0x29b2:
++ case 0x29c2:
++ case 0x29d2:
++ case 0xa001:
++ case 0xa011:
+ driverList[0] = "intel";
+ break;
+ }
+--
+2.14.3
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
new file mode 100644
index 00000000..beed6cb4
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
@@ -0,0 +1,47 @@
+From cf407b16cd65ad6e26a9c8e5984e163409a5c0f7 Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+Date: Mon, 30 Jan 2017 16:32:06 -0600
+Subject: [PATCH] Remove check for useSIGIO option
+
+Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removes the configure of useSIGIO
+option.
+
+As the xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO
+and OsReleaseSIGIO.
+
+No longer the check for useSIGIO is needed
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+---
+ hw/xfree86/os-support/shared/sigio.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
+index 884a71c..be76498 100644
+--- a/hw/xfree86/os-support/shared/sigio.c
++++ b/hw/xfree86/os-support/shared/sigio.c
+@@ -185,9 +185,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
+ int i;
+ int installed = FALSE;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ for (i = 0; i < MAX_FUNCS; i++) {
+ if (!xf86SigIOFuncs[i].f) {
+ if (xf86IsPipe(fd))
+@@ -256,9 +253,6 @@ xf86RemoveSIGIOHandler(int fd)
+ int max;
+ int ret;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ max = 0;
+ ret = 0;
+ for (i = 0; i < MAX_FUNCS; i++) {
+--
+2.7.4
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
new file mode 100644
index 00000000..5243761f
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
@@ -0,0 +1,46 @@
+From 5028ef46ff4ab0930224b71024a7349b05610d42 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan@agner.ch>
+Date: Thu, 22 Dec 2016 15:41:06 +0100
+Subject: [PATCH] modesetting: Fix 16 bit depth/bpp mode
+
+When setting DefaultDepth to 16 in the Screen section, the current
+code requests a 32 bpp framebuffer, however the X-Server seems to
+assumes 16 bpp.
+
+Fixes commit 21217d02168d ("modesetting: Implement 32->24 bpp
+conversion in shadow update")
+
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+
+Upstream-Status: Submitted [1]
+
+[1] https://lists.x.org/archives/xorg-devel/2016-December/052113.html
+---
+ hw/xfree86/drivers/modesetting/driver.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
+index d7030e5..647ad83 100644
+--- a/hw/xfree86/drivers/modesetting/driver.c
++++ b/hw/xfree86/drivers/modesetting/driver.c
+@@ -930,7 +930,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+ "Using 24bpp hw front buffer with 32bpp shadow\n");
+ defaultbpp = 32;
+ } else {
+- ms->drmmode.kbpp = defaultbpp;
++ ms->drmmode.kbpp = 0;
+ }
+ bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb;
+
+@@ -950,6 +950,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+ return FALSE;
+ }
+ xf86PrintDepthBpp(pScrn);
++ if (!ms->drmmode.kbpp)
++ ms->drmmode.kbpp = pScrn->bitsPerPixel;
+
+ /* Process the options */
+ xf86CollectOptions(pScrn, NULL);
+--
+2.7.4
+
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
new file mode 100644
index 00000000..c36e4e73
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
@@ -0,0 +1,25 @@
+This is the revised version of files/macro_tweak.patch for
+xorg-server 1.8.99.904 and newer.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+Index: xorg-server-1.19.6/xorg-server.m4
+===================================================================
+--- xorg-server-1.19.6.orig/xorg-server.m4
++++ xorg-server-1.19.6/xorg-server.m4
+@@ -28,10 +28,12 @@ dnl
+ # Checks for the MACRO define in xorg-server.h (from the sdk). If it
+ # is defined, then add the given PROTO to $REQUIRED_MODULES.
+
++m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
++
+ AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
++ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include "xorg-server.h"
+ #if !defined $1
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
new file mode 100644
index 00000000..4be441fb
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
@@ -0,0 +1,18 @@
+inb/outb family for arm is only implemented on glibc
+so assumption across linux is wrong
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: xorg-server-1.18.0/hw/xfree86/common/compiler.h
+===================================================================
+--- xorg-server-1.18.0.orig/hw/xfree86/common/compiler.h
++++ xorg-server-1.18.0/hw/xfree86/common/compiler.h
+@@ -758,7 +758,7 @@ inl(unsigned short port)
+ return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+
+-#elif defined(__arm__) && defined(__linux__)
++#elif defined(__arm__) && defined(__GLIBC__)
+
+ /* for Linux on ARM, we use the LIBC inx/outx routines */
+ /* note that the appropriate setup via "ioperm" needs to be done */
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
new file mode 100644
index 00000000..c51bcd54
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -0,0 +1,3 @@
+# Glamor for Xorg requires gbm >= 10.2.0.
+# Glamor is not necessary with current env, so disable it.
+PACKAGECONFIG_remove_rcar-gen3 = "glamor"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb
new file mode 100644
index 00000000..bec021d6
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb
@@ -0,0 +1,35 @@
+require xserver-xorg.inc
+
+COMPATIBLE_MACHINE = "(salvator-x|ebisu|ulcb)"
+
+SRC_URI += "file://musl-arm-inb-outb.patch \
+ file://0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch \
+ file://0003-modesetting-Fix-16-bit-depth-bpp-mode.patch \
+ file://0003-Remove-check-for-useSIGIO-option.patch \
+ file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
+ file://0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch \
+ "
+SRC_URI[md5sum] = "3e47777ff034a331aed2322b078694a8"
+SRC_URI[sha256sum] = "a732502f1db000cf36a376cd0c010ffdbf32ecdd7f1fa08ba7f5bdf9601cc197"
+
+# These extensions are now integrated into the server, so declare the migration
+# path for in-place upgrades.
+
+RREPLACES_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "
+RPROVIDES_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "
+RCONFLICTS_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "