diff options
Diffstat (limited to 'meta-rcar-gen2/recipes-graphics/gles-module')
6 files changed, 180 insertions, 0 deletions
diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module.bb b/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module.bb new file mode 100644 index 0000000..7a8fcb9 --- /dev/null +++ b/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "RGX/SGX unit test module" +LICENSE = "CLOSED" +DEPENDS += "gles-kernel-module gles-user-module" +PN = "gles-test-module" +PR = "r0" +OPENGLES3 ?= "0" + +COMPATIBLE_MACHINE = "(r8a7790|r8a7791|r8a7793|r8a7794)" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +SRC_URI = '${@base_conditional( "OPENGLES3", "1", "file://gles3-sample-unittest.tar.bz2", "file://gles2-sample-unittest.tar.bz2", d )}' +S = '${@base_conditional( "OPENGLES3", "1", "${WORKDIR}/gles3-sample-unittest", "${WORKDIR}/gles2-sample-unittest", d )}' + +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_populate_lic[noexec] = "1" + +do_compile() { + cd ${S} + make PKGROOT=${STAGING_DIR_HOST} LIBDRMROOT=${STAGING_DIR_HOST}${prefix} +} + +do_install() { + # Copy binary into sysroot + mkdir -p ${D}/usr/local/bin/ + if [ "X${OPENGLES3}" = "X0" ]; then + cp ${S}/OES2_Texture ${D}/usr/local/bin/ + cp ${S}/FragShaderSample.fsh ${D}/usr/local/bin/ + cp ${S}/VertShaderSample.vsh ${D}/usr/local/bin/ + else + cp ${S}/OES3_Texture ${D}/usr/local/bin/ + cp ${S}/OES3_FragShaderSample.fsh ${D}/usr/local/bin/ + cp ${S}/OES3_VertShaderSample.vsh ${D}/usr/local/bin/ + fi +} + +PACKAGES = "\ + ${PN} \ + " +FILES_${PN} = " \ + /usr/local/bin/* \ +" +RPROVIDES_${PN} += "gles-test-module" +INSANE_SKIP_${PN} += "ldflags" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module/.gitkeep b/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/meta-rcar-gen2/recipes-graphics/gles-module/gles-test-module/.gitkeep diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module.bb b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module.bb new file mode 100644 index 0000000..3a12b27 --- /dev/null +++ b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module.bb @@ -0,0 +1,95 @@ +require ../../include/gles-control.inc + +DESCRIPTION = "SGX/RGX user module" +LICENSE = "CLOSED" + +PN = "gles-user-module" +PR = "r0" + +COMPATIBLE_MACHINE = "(r8a7790|r8a7791|r8a7793|r8a7794)" +PACKAGE_ARCH = "${MACHINE_ARCH}" + +S_r8a7790 = "${WORKDIR}/rogue" +GLES_r8a7790 = "rgx" +S_r8a7791 = "${WORKDIR}/eurasia" +GLES_r8a7791 = "sgx" +S_r8a7793 = "${WORKDIR}/eurasia" +GLES_r8a7793 = "sgx" +S_r8a7794 = "${WORKDIR}/eurasia" +GLES_r8a7794 = "sgx" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +OPENGLES3 ?= "0" +SRC_URI_r8a7790 = '${@base_conditional( "OPENGLES3", "1", \ + "file://r8a7790_linux_rgx_binaries_gles3.tar.bz2", \ + "file://r8a7790_linux_rgx_binaries_gles2.tar.bz2", d )}' +SRC_URI_append_r8a7790 = " ${@base_contains("DISTRO_FEATURES", "wayland", " \ + file://EGL_headers_for_wayland.patch \ + file://change-shell.patch \ + ", "", d)}" + +SRC_URI_r8a7791 = "file://r8a7791_linux_sgx_binaries_gles2.tar.bz2" +SRC_URI_append_r8a7791 = " ${@base_contains("DISTRO_FEATURES", "wayland", " \ + file://EGL_headers_for_wayland.patch \ + ", "", d)}" + +SRC_URI_r8a7793 = "file://r8a7791_linux_sgx_binaries_gles2.tar.bz2" +SRC_URI_append_r8a7793 = " ${@base_contains("DISTRO_FEATURES", "wayland", " \ + file://EGL_headers_for_wayland.patch \ + ", "", d)}" + +SRC_URI_r8a7794 = "file://r8a7794_linux_sgx_binaries_gles2.tar.bz2" +SRC_URI_append_r8a7794 = " ${@base_contains("DISTRO_FEATURES", "wayland", " \ + file://EGL_headers_for_wayland.patch \ + ", "", d)}" + +do_populate_lic[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + # Copy binary into sysroot + cp -r ${S}/etc ${D} + cp -r ${S}/usr ${D} + + if [ "${USE_WAYLAND}" = "1" ]; then + # Rename libEGL.so + mv ${D}/usr/lib/libEGL.so ${D}/usr/lib/libEGL-pvr.so + + # Set the "WindowSystem" parameter for wayland + if [ "${GLES}" = "rgx" ]; then + sed -i -e "s/WindowSystem=libpvrNULL_WSEGL.so/WindowSystem=libpvrWAYLAND_WSEGL.so/g" \ + ${D}/${sysconfdir}/powervr.ini + elif [ "${GLES}" = "sgx" ]; then + sed -i -e "s/WindowSystem=libpvrPVR2D_FLIPWSEGL.so/WindowSystem=libpvrPVR2D_WAYLANDWSEGL.so/g" \ + ${D}/${sysconfdir}/powervr.ini + fi + fi +} + +PACKAGES = "\ + ${PN} \ + ${PN}-dev \ +" + +FILES_${PN} = " \ + ${sysconfdir}/* \ + ${libdir}/* \ + /usr/local/bin/* \ +" + +FILES_${PN}-dev = " \ + ${includedir}/* \ +" + +inherit update-rc.d + +PROVIDES = "virtual/libgles2" +PROVIDES_append = "${@base_contains("DISTRO_FEATURES", "wayland", "", " virtual/egl", d)}" +RPROVIDES_${PN} += "${GLES}-user-module libgles2-mesa libgles2-mesa-dev libgles2 libgles2-dev" +INSANE_SKIP_${PN} += "ldflags already-stripped" +INSANE_SKIP_${PN}-dev += "ldflags" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +PRIVATE_LIBS_${PN} = "libEGL.so.1" +INITSCRIPT_NAME = "rc.pvr" +INITSCRIPT_PARAMS = "start 8 5 2 . stop 61 0 1 6 ." diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/.gitkeep b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/.gitkeep diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/EGL_headers_for_wayland.patch b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/EGL_headers_for_wayland.patch new file mode 100644 index 0000000..bd906c0 --- /dev/null +++ b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/EGL_headers_for_wayland.patch @@ -0,0 +1,32 @@ +--- a/usr/include/EGL/eglext.h ++++ b/usr/include/EGL/eglext.h +@@ -638,6 +638,8 @@ + #endif /* KHRONOS_SUPPORT_INT64 */ + #endif /* EGL_NV_system_time */ + ++#include <EGL/eglmesaext.h> ++ + #ifdef __cplusplus + } + #endif +--- a/usr/include/EGL/eglplatform.h ++++ b/usr/include/EGL/eglplatform.h +@@ -105,6 +105,18 @@ + typedef Pixmap EGLNativePixmapType; + typedef Window EGLNativeWindowType; + ++#elif defined(WL_EGL_PLATFORM) ++ ++typedef struct wl_display *EGLNativeDisplayType; ++typedef struct wl_egl_pixmap *EGLNativePixmapType; ++typedef struct wl_egl_window *EGLNativeWindowType; ++ ++#elif defined(__GBM__) ++ ++typedef struct gbm_device *EGLNativeDisplayType; ++typedef struct gbm_bo *EGLNativePixmapType; ++typedef void *EGLNativeWindowType; ++ + #else + + /* NULLWS fallback */ diff --git a/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/change-shell.patch b/meta-rcar-gen2/recipes-graphics/gles-module/gles-user-module/change-shell.patch new file mode 100644 index 0000000..1dd22f4 --- /dev/null +++ b/meta-rcar-gen2/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. |