summaryrefslogtreecommitdiffstats
path: root/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics')
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/amd-gpu-bin-mx51_11.09.01.bb13
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/amd-gpu-mx51.inc90
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb18
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/files/egl.pc11
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/files/fix-linux-build-check.patch54
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/files/glesv2.pc11
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/libz160_11.09.01.bb33
-rw-r--r--recipes-graphics/cairo/cairo_%.bbappend11
-rw-r--r--recipes-graphics/clutter/clutter-1.0_%.bbappend9
-rw-r--r--recipes-graphics/cogl/cogl-1.0_%.bbappend10
-rw-r--r--recipes-graphics/directfb/directfb-examples_1.6.0.bb20
-rw-r--r--recipes-graphics/directfb/directfb.inc73
-rw-r--r--recipes-graphics/directfb/directfb/configurefix.patch60
-rw-r--r--recipes-graphics/directfb/directfb/fix-compilation-with-zlib.patch29
-rw-r--r--recipes-graphics/directfb/directfb/fixsepbuild.patch19
-rw-r--r--recipes-graphics/directfb/directfb/fusion.patch36
-rw-r--r--recipes-graphics/directfb/directfb/rename-no-instrument-function-macro.patch345
-rw-r--r--recipes-graphics/directfb/directfb_1.6.3.bb26
-rw-r--r--recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch35
-rw-r--r--recipes-graphics/drm/libdrm_%.bbappend5
-rw-r--r--recipes-graphics/eglinfo/eglinfo-fb_%.bbappend3
-rw-r--r--recipes-graphics/eglinfo/eglinfo-x11_%.bbappend3
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q.inc259
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/0001-change-header-path-to-HAL.patch30
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/directfbrc10
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl_x11.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/fix-conflicting-TLS-definition.patch31
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_hal_eglplatform-remove-xlib-undefs.patch34
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_wayland_protocol.pc10
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm_x11.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2_x11.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg_x11.pc12
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-egl.pc10
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-viv.pc10
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb9
-rw-r--r--recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-sfp.bb9
-rw-r--r--recipes-graphics/gpu-viv-g2d/gpu-viv-g2d.inc45
-rw-r--r--recipes-graphics/gpu-viv-g2d/gpu-viv-g2d_3.10.17-1.0.0.bb6
-rw-r--r--recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch355
-rw-r--r--recipes-graphics/mesa/mesa-demos_%.bbappend4
-rw-r--r--recipes-graphics/mesa/mesa_%.bbappend10
-rw-r--r--recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend3
-rw-r--r--recipes-graphics/piglit/piglit_git.bbappend5
-rw-r--r--recipes-graphics/wayland/weston/0001-Add-support-for-Vivante-FBDEV-EGL.patch69
-rw-r--r--recipes-graphics/wayland/weston/0002-weston-Add-Vivante-2D-compositor-support.patch1513
-rw-r--r--recipes-graphics/wayland/weston_%.bbappend21
-rw-r--r--recipes-graphics/xinput-calibrator/pointercal-xinput/imx28evk/pointercal.xinput2
-rw-r--r--recipes-graphics/xinput-calibrator/pointercal-xinput/mx6/pointercal.xinput2
-rw-r--r--recipes-graphics/xinput-calibrator/pointercal-xinput_%.bbappend2
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.17-1.0.0.bb62
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch33
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch787
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch65
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch53
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch34
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb39
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xf86-config/mx5/xorg.conf16
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xf86-config/mx6/xorg.conf14
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xf86-config/mxs/xorg.conf12
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend2
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg/aarch64.patch35
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg/crosscompile.patch22
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg/fix_open_max_preprocessor_error.patch15
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch25
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg/mips64-compiler.patch29
-rw-r--r--recipes-graphics/xorg-xserver/xserver-xorg_1.14.4.bb35
70 files changed, 4737 insertions, 0 deletions
diff --git a/recipes-graphics/amd-gpu-x11-bin/amd-gpu-bin-mx51_11.09.01.bb b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-bin-mx51_11.09.01.bb
new file mode 100644
index 0000000..ecf38f2
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-bin-mx51_11.09.01.bb
@@ -0,0 +1,13 @@
1# Copyright (C) 2011, 2012 Freescale
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4DESCRIPTION = "GPU driver and apps for frambuffer on mx51"
5
6include amd-gpu-mx51.inc
7
8SRC_URI[md5sum] = "9f9b5f67b595721a08793aae8bd8fc46"
9SRC_URI[sha256sum] = "f0db68a764b5fb199729e7435f606b8d12b61ca97990336c647b7e81f4a584d9"
10
11RCONFLICTS_${PN} = "amd-gpu-x11-bin-mx51"
12
13COMPATIBLE_MACHINE = "(mx5)"
diff --git a/recipes-graphics/amd-gpu-x11-bin/amd-gpu-mx51.inc b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-mx51.inc
new file mode 100644
index 0000000..02a4f21
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-mx51.inc
@@ -0,0 +1,90 @@
1# Copyright (C) 2011, 2012, 2013 Freescale
2# Copyright (C) 2011-2014 O.S. Systems Software LTDA.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5LICENSE = "Proprietary"
6SECTION = "libs"
7
8# FIXME: Replace for correct AMD license
9LIC_FILES_CHKSUM = "file://usr/include/VG/openvg.h;endline=30;md5=b0109611dd76961057d4c45ae6519802"
10
11PROVIDES = "virtual/egl virtual/libgles1 virtual/libgles2"
12
13SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true \
14 file://egl.pc \
15 file://glesv2.pc \
16 file://fix-linux-build-check.patch"
17
18inherit fsl-eula-unpack
19
20# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
21# the source we cannot fix it. Disable the insane check for now.
22python populate_packages_prepend() {
23 for p in d.getVar('PACKAGES', True).split():
24 d.setVar("INSANE_SKIP_%s" % p, "ldflags")
25}
26
27do_install () {
28 install -d ${D}${libdir}
29 install -d ${D}${bindir}
30 install -d ${D}${includedir}
31
32 cp -axr ${S}/usr/bin/* ${D}${bindir}
33 cp -axf ${S}/usr/lib/* ${D}${libdir}
34 cp -axr ${S}/usr/include/* ${D}${includedir}
35
36 find ${D}${bindir} -type f -exec chmod 755 {} \;
37 find ${D}${libdir} -type f -exec chmod 644 {} \;
38 find ${D}${includedir} -type f -exec chmod 644 {} \;
39
40 # FIXME: Fix sonames of broken libraries
41 mv ${D}${libdir}/lib2dz160.so ${D}${libdir}/lib2dz160.so.0
42 mv ${D}${libdir}/lib2dz430.so ${D}${libdir}/lib2dz430.so.0
43 ln -sf lib2dz160.so.0 ${D}${libdir}/lib2dz160.so
44 ln -sf lib2dz430.so.0 ${D}${libdir}/lib2dz430.so
45
46 # FIXME: Remove unkown files
47 rm -r ${D}${libdir}/libcsi.a \
48 ${D}${libdir}/libres.a
49
50 # FIXME: Add pkgconfig files
51 install -d ${D}${libdir}/pkgconfig
52 install -m 644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig
53 install -m 644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig
54}
55
56PACKAGES =+ "libgsl-fsl-mx51 libgsl-fsl-mx51-dev libgsl-fsl-mx51-dbg \
57 libegl-mx51 libegl-mx51-dev libegl-mx51-dbg \
58 libgles-mx51 libgles-mx51-dev libgles-mx51-dbg \
59 libgles2-mx51 libgles2-mx51-dev libgles2-mx51-dbg \
60 libopenvg-mx51 libopenvg-mx51-dev libopenvg-mx51-dbg \
61 lib2dz160-mx51 lib2dz160-mx51-dbg \
62 lib2dz430-mx51 lib2dz430-mx51-dbg"
63
64FILES_${PN}-dbg = "${bindir}/.debug/*"
65
66FILES_libgsl-fsl-mx51 = "${libdir}/libgsl-fsl${SOLIBS}"
67FILES_libgsl-fsl-mx51-dev = "${libdir}/libgsl-fsl${SOLIBSDEV}"
68FILES_libgsl-fsl-mx51-dbg = "${libdir}/.debug/libgsl-fsl${SOLIBS}"
69
70FILES_libegl-mx51 = "${libdir}/libEGL${SOLIBS}"
71FILES_libegl-mx51-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/libEGL${SOLIBSDEV}"
72FILES_libegl-mx51-dbg = "${libdir}/.debug/libEGL${SOLIBS}"
73
74FILES_libgles-mx51 = "${libdir}/libGLESv1*${SOLIBS}"
75FILES_libgles-mx51-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBSDEV}"
76FILES_libgles-mx51-dbg = "${libdir}/.debug/libGLESv1*${SOLIBS}"
77
78FILES_libgles2-mx51 = "${libdir}/libGLESv2${SOLIBS}"
79FILES_libgles2-mx51-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV}"
80FILES_libgles2-mx51-dbg = "${libdir}/.debug/libGLESv2${SOLIBS}"
81
82FILES_libopenvg-mx51 = "${libdir}/libOpenVG${SOLIBS}"
83FILES_libopenvg-mx51-dev = "${includedir}/VG ${libdir}/libOpenVG${SOLIBSDEV}"
84FILES_libopenvg-mx51-dbg = "${libdir}/.debug/libOpenVG${SOLIBS}"
85
86FILES_lib2dz160-mx51 = "${libdir}/lib2dz160${SOLIBS}"
87FILES_lib2dz160-mx51-dbg = "${libdir}/.debug/lib2dz160${SOLIBS}"
88
89FILES_lib2dz430-mx51 = "${libdir}/lib2dz430${SOLIBS}"
90FILES_lib2dz430-mx51-dbg = "${libdir}/.debug/lib2dz430${SOLIBS}"
diff --git a/recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb
new file mode 100644
index 0000000..6358aca
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb
@@ -0,0 +1,18 @@
1# Copyright (C) 2011, 2012 Freescale
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4DESCRIPTION = "GPU driver and apps for x11 on mx51"
5PR = "r12"
6
7# FIXME: Replace for correct AMD license
8LIC_FILES_CHKSUM = "file://usr/include/VG/openvg.h;endline=30;md5=b0109611dd76961057d4c45ae6519802"
9DEPENDS = "virtual/libx11 libxrender"
10
11include amd-gpu-mx51.inc
12
13SRC_URI[md5sum] = "54391a4e670b597d06d01253fb217cad"
14SRC_URI[sha256sum] = "c7a6fa03b7aa2a375556c59908876554ba720c1e744baba2debb84a408f790db"
15
16RCONFLICTS_${PN} = "amd-gpu-bin-mx51"
17
18COMPATIBLE_MACHINE = "${@base_contains('DISTRO_FEATURES', 'x11', '(mx5)', 'Invalid!', d)}"
diff --git a/recipes-graphics/amd-gpu-x11-bin/files/egl.pc b/recipes-graphics/amd-gpu-x11-bin/files/egl.pc
new file mode 100644
index 0000000..3d2ab5d
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/files/egl.pc
@@ -0,0 +1,11 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: egl
7Description: AMD EGL library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lEGL
11Cflags: -I${includedir}
diff --git a/recipes-graphics/amd-gpu-x11-bin/files/fix-linux-build-check.patch b/recipes-graphics/amd-gpu-x11-bin/files/fix-linux-build-check.patch
new file mode 100644
index 0000000..946bfac
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/files/fix-linux-build-check.patch
@@ -0,0 +1,54 @@
1diff -Nur amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/EGL/eglext.h amd-gpu-x11-bin-mx51-11.09.01/usr/include/EGL/eglext.h
2--- amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/EGL/eglext.h 2012-08-18 12:43:19.431788396 -0300
3+++ amd-gpu-x11-bin-mx51-11.09.01/usr/include/EGL/eglext.h 2012-08-18 12:43:50.799909873 -0300
4@@ -164,11 +164,11 @@
5 * nanoseconds (unadjusted standard time). Here, it is defined as
6 * appropriate for an ISO C compiler.
7 */
8-#ifndef _LINUX
9+#ifndef __linux__
10 typedef uint64_t EGLTimeKHR;
11-#else // _LINUX
12+#else // __linux__
13 typedef unsigned long long EGLTimeKHR;
14-#endif // _LINUX
15+#endif // __linux__
16
17 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0xFFF8
18 #define EGL_SYNC_STATUS_KHR 0xFFF7
19diff -Nur amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/EGL/eglfslext.h amd-gpu-x11-bin-mx51-11.09.01/usr/include/EGL/eglfslext.h
20--- amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/EGL/eglfslext.h 2012-08-18 12:43:19.431788396 -0300
21+++ amd-gpu-x11-bin-mx51-11.09.01/usr/include/EGL/eglfslext.h 2012-08-18 12:43:50.759785714 -0300
22@@ -65,7 +65,7 @@
23 } eglYUVInfo;
24 #endif
25
26-#ifdef _LINUX
27+#ifdef __linux__
28 struct EGLImageInfoFSL
29 {
30 void *mem_virt[3]; //virtual addresses for Y/U/V planes
31diff -Nur amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/VG/ext.h amd-gpu-x11-bin-mx51-11.09.01/usr/include/VG/ext.h
32--- amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/VG/ext.h 2012-08-18 12:43:19.431788396 -0300
33+++ amd-gpu-x11-bin-mx51-11.09.01/usr/include/VG/ext.h 2012-08-18 12:43:50.799909873 -0300
34@@ -15,7 +15,7 @@
35 extern "C" {
36 #endif
37
38-#ifndef _LINUX
39+#ifndef __linux__
40 #include <VG/openvg.h>
41 #else
42 #include "openvg.h"
43diff -Nur amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/VG/openvg.h amd-gpu-x11-bin-mx51-11.09.01/usr/include/VG/openvg.h
44--- amd-gpu-x11-bin-mx51-11.09.01.orig/usr/include/VG/openvg.h 2012-08-18 12:43:19.431788396 -0300
45+++ amd-gpu-x11-bin-mx51-11.09.01/usr/include/VG/openvg.h 2012-08-18 12:43:50.799909873 -0300
46@@ -449,7 +449,7 @@
47 # endif
48 # elif defined(__APPLE__)
49 # define VG_API_CALL extern
50-# elif defined(_LINUX)
51+# elif defined(__linux__)
52 # if defined (OPENVG_DLL_EXPORTS)
53 # define VG_API_CALL extern
54 # else
diff --git a/recipes-graphics/amd-gpu-x11-bin/files/glesv2.pc b/recipes-graphics/amd-gpu-x11-bin/files/glesv2.pc
new file mode 100644
index 0000000..62e1cb6
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/files/glesv2.pc
@@ -0,0 +1,11 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv2
7Description: AMD OpenGL ES 2.0 library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lGLESv2 -lEGL
11Cflags: -I${includedir}
diff --git a/recipes-graphics/amd-gpu-x11-bin/libz160_11.09.01.bb b/recipes-graphics/amd-gpu-x11-bin/libz160_11.09.01.bb
new file mode 100644
index 0000000..1ff762a
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/libz160_11.09.01.bb
@@ -0,0 +1,33 @@
1# Copyright (C) 2011, 2012 Freescale
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4DESCRIPTION = "AMD libz160 gpu driver"
5LICENSE = "Proprietary"
6SECTION = "libs"
7PR = "r2"
8
9#todo: Replace for correct AMD license
10LIC_FILES_CHKSUM = "file://usr/include/z160.h;endline=28;md5=65dd44cd769091092f38e34cd52cc271"
11
12SRC_URI = "${FSL_MIRROR}/libz160-bin-${PV}.bin;fsl-eula=true"
13SRC_URI[md5sum] = "9a9c2c93f4b44e89316772d348eead7d"
14SRC_URI[sha256sum] = "08767eb269a0a30ca0aa3d3b5aa9a53a2d17ed1c24651b7e8cefc7704b883f19"
15
16inherit fsl-eula-unpack
17
18do_install () {
19 install -d ${D}${libdir}
20 install -d ${D}${includedir}
21 install -m 0755 ${S}/usr/lib/* ${D}${libdir}
22 install -m 0644 ${S}/usr/include/* ${D}${includedir}
23}
24
25S = "${WORKDIR}/${PN}-bin-${PV}"
26
27# Avoid QA Issue: No GNU_HASH in the elf binary
28INSANE_SKIP_${PN} = "ldflags"
29INSANE_SKIP_${PN}-dev = "ldflags"
30FILES_${PN} = "${libdir}/*.so"
31FILES_${PN}-dev = "${includedir}"
32
33COMPATIBLE_MACHINE = "(mx5)"
diff --git a/recipes-graphics/cairo/cairo_%.bbappend b/recipes-graphics/cairo/cairo_%.bbappend
new file mode 100644
index 0000000..bd960e0
--- /dev/null
+++ b/recipes-graphics/cairo/cairo_%.bbappend
@@ -0,0 +1,11 @@
1CFLAGS_append_mx6 = " -DLINUX \
2 ${@base_contains('DISTRO_FEATURES', 'x11', '', \
3 base_contains('DISTRO_FEATURES', 'wayland', \
4 '-DEGL_API_FB -DEGL_API_WL', \
5 base_contains('DISTRO_FEATURES', 'directfb', \
6 '-DEGL_API_DFB', '-DEGL_API_FB', d),d),d)}"
7
8
9PACKAGECONFIG_class-target_mx6 = " \
10 egl glesv2 \
11 ${@base_contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}"
diff --git a/recipes-graphics/clutter/clutter-1.0_%.bbappend b/recipes-graphics/clutter/clutter-1.0_%.bbappend
new file mode 100644
index 0000000..cdeac1f
--- /dev/null
+++ b/recipes-graphics/clutter/clutter-1.0_%.bbappend
@@ -0,0 +1,9 @@
1# Provide the need flags and backend settings to work with Vivante GPU
2CFLAGS_append_mx6 = " -DLINUX \
3 ${@base_contains('DISTRO_FEATURES', 'x11', '', \
4 base_contains('DISTRO_FEATURES', 'wayland', \
5 '-DEGL_API_WL -DEGL_API_FB', '', d), d)}"
6
7PACKAGECONFIG_mx6 ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'glx x11', \
8 base_contains('DISTRO_FEATURES', 'wayland', \
9 'wayland egl', '', d), d)}"
diff --git a/recipes-graphics/cogl/cogl-1.0_%.bbappend b/recipes-graphics/cogl/cogl-1.0_%.bbappend
new file mode 100644
index 0000000..f77581d
--- /dev/null
+++ b/recipes-graphics/cogl/cogl-1.0_%.bbappend
@@ -0,0 +1,10 @@
1# Provide the need flags and backend settings to work with Vivante GPU
2CFLAGS_append_mx6 = " -DLINUX \
3 ${@base_contains('DISTRO_FEATURES', 'x11', '', \
4 base_contains('DISTRO_FEATURES', 'wayland', \
5 '-DEGL_API_WL -DEGL_API_FB', '', d), d)}"
6
7PACKAGECONFIG_mx6 ??= "cogl-pango gles2 \
8 ${@base_contains('DISTRO_FEATURES', 'x11', 'egl-x11', \
9 base_contains('DISTRO_FEATURES', 'wayland', \
10 'egl-wayland', '', d), d)}"
diff --git a/recipes-graphics/directfb/directfb-examples_1.6.0.bb b/recipes-graphics/directfb/directfb-examples_1.6.0.bb
new file mode 100644
index 0000000..499060b
--- /dev/null
+++ b/recipes-graphics/directfb/directfb-examples_1.6.0.bb
@@ -0,0 +1,20 @@
1SUMMARY = "Example DirectFB applications"
2DESCRIPTION = "The DirectFB-examples package contains a set of simple DirectFB \
3 applications that can be used to test and demonstrate various DirectFB \
4 features"
5DEPENDS = "directfb"
6SECTION = "libs"
7LICENSE = "MIT"
8
9SRC_URI = " \
10 http://www.directfb.org/downloads/Extras/DirectFB-examples-${PV}.tar.gz \
11 "
12
13LIC_FILES_CHKSUM = "file://COPYING;md5=ecf6fd2b19915afc4da56043926ca18f"
14
15S = "${WORKDIR}/DirectFB-examples-${PV}"
16
17inherit autotools
18
19SRC_URI[md5sum] = "27619d31e8a647fdd3023a0c1779b63d"
20SRC_URI[sha256sum] = "b08293697c211b690856f76a25ad7acd4ca458b4132851e0a1e471d0bf23c821"
diff --git a/recipes-graphics/directfb/directfb.inc b/recipes-graphics/directfb/directfb.inc
new file mode 100644
index 0000000..a23209f
--- /dev/null
+++ b/recipes-graphics/directfb/directfb.inc
@@ -0,0 +1,73 @@
1SUMMARY = "Graphics abstraction library for the Linux Framebuffer Device"
2DESCRIPTION = "DirectFB is a thin library that provides developers \
3with hardware graphics acceleration, input device handling and \
4abstraction, an integrated windowing system with support for \
5translucent windows and multiple display layers on top of the \
6Linux framebuffer device."
7SECTION = "libs"
8LICENSE = "LGPLv2.1"
9LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
10
11HOMEPAGE = "http://directfb.org"
12DEPENDS = "jpeg libpng freetype zlib tslib"
13
14INC_PR = "r0"
15
16SRC_URI = "http://directfb.org/downloads/Core/DirectFB-1.6/DirectFB-${PV}.tar.gz \
17 file://configurefix.patch \
18 file://fusion.patch"
19
20S = "${WORKDIR}/DirectFB-${PV}"
21
22LDFLAGS_append =" -lts -lm"
23
24inherit autotools binconfig pkgconfig
25
26PACKAGECONFIG ??= ""
27PACKAGECONFIG[jpeg2000] = "--enable-jpeg2000,--disable-jpeg2000,jasper"
28
29EXTRA_OECONF = "\
30 --with-gfxdrivers=none \
31 --enable-libmpeg3=no \
32 --enable-freetype=yes \
33 --enable-sdl=no \
34 --enable-vnc=no \
35 --disable-x11 \
36 --disable-mesa \
37"
38
39#Once -fno-omit-frame-pointer option of gcc is added into TARGET_CLFAGS as default
40#this will cause directfb build failure on x86 arch, so filter out it.
41TARGET_CFLAGS_x86 := "${@oe_filter_out('-fno-omit-frame-pointer', '${TARGET_CFLAGS}', d)}"
42
43#PACKAGES_DYNAMIC += "^directfb-inputdrivers-.*"
44#
45#python populate_packages_prepend () {
46# inputdrivers_libdir = d.expand('${libdir}/directfb-${RV}/inputdrivers')
47# do_split_packages(d, inputdrivers_libdir, '*.so$', 'directfb-inputdrivers-%s', 'Directfb plugin for %s')
48#}
49
50# NOTE: monolithic packaging for now, should improve that eventually
51
52
53
54FILES_${PN}-dbg += "\
55 ${libdir}/directfb-${RV}/*/*/.debug/*.so \
56 ${libdir}/directfb-${RV}/*/.debug/*.so \
57"
58
59FILES_${PN}-dev += "\
60 ${bindir}/directfb-config \
61 ${libdir}/directfb-${RV}/systems/*.la \
62 ${libdir}/directfb-${RV}/inputdrivers/*.la \
63 ${libdir}/directfb-${RV}/interfaces/*/*.la \
64 ${libdir}/directfb-${RV}/wm/*.la \
65"
66
67FILES_${PN} += "\
68 ${libdir}/directfb-${RV}/systems/*.so \
69 ${libdir}/directfb-${RV}/inputdrivers/*.so \
70 ${libdir}/directfb-${RV}/interfaces/*/*.so \
71 ${libdir}/directfb-${RV}/wm/*.so \
72 ${datadir}/directfb-${PV} \
73"
diff --git a/recipes-graphics/directfb/directfb/configurefix.patch b/recipes-graphics/directfb/directfb/configurefix.patch
new file mode 100644
index 0000000..dd8c019
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/configurefix.patch
@@ -0,0 +1,60 @@
1Libtool needs these set correctly else we end up with pointless rpaths
2such as the QA warnings:
3
4WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfblayer contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbmaster contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgifft contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbdump contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinput contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbfx contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbscreen contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgiff contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinspector contains probably-redundant RPATH /usr/lib
5WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdfiff contains probably-redundant RPATH /usr/lib
6WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinfo contains probably-redundant RPATH /usr/lib
7WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbpenmount contains probably-redundant RPATH /usr/lib
8WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbg contains probably-redundant RPATH /usr/lib
9WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6 contains probably-redundant RPATH /usr/lib
10WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
11WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6 contains probably-redundant RPATH /usr/lib
12WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
13WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_fbdev.so contains probably-redundant RPATH /usr/lib
14WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_devmem.so contains probably-redundant RPATH /usr/lib
15WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_dummy.so contains probably-redundant RPATH /usr/lib
16WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_v4l.so contains probably-redundant RPATH /usr/lib
17WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.so contains probably-redundant RPATH /usr/lib
18WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/ICoreResourceManager/libicoreresourcemanager_test.so contains probably-redundant RPATH /usr/lib
19WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.so contains probably-redundant RPATH /usr/lib
20WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.so contains probably-redundant RPATH /usr/lib
21WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_dfiff.so contains probably-redundant RPATH /usr/lib
22WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.so contains probably-redundant RPATH /usr/lib
23WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_ft2.so contains probably-redundant RPATH /usr/lib
24WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_dgiff.so contains probably-redundant RPATH /usr/lib
25WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/wm/libdirectfbwm_default.so contains probably-redundant RPATH /usr/lib
26WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_zytronic.so contains probably-redundant RPATH /usr/lib
27WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_penmount.so contains probably-redundant RPATH /usr/lib
28WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_linux_input.so contains probably-redundant RPATH /usr/lib
29WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_serialmouse.so contains probably-redundant RPATH /usr/lib
30WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_mutouch.so contains probably-redundant RPATH /usr/lib
31WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_tslib.so contains probably-redundant RPATH /usr/lib
32WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_joystick.so contains probably-redundant RPATH /usr/lib
33WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_sonypi.so contains probably-redundant RPATH /usr/lib
34WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_lirc.so contains probably-redundant RPATH /usr/lib
35WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_wm97xx_ts.so contains probably-redundant RPATH /usr/lib
36WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_ps2mouse.so contains probably-redundant RPATH /usr/lib
37WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_keyboard.so contains probably-redundant RPATH /usr/lib
38
39Upstream-Status: Pending
40
41RP 2012/03/16
42
43Index: DirectFB-1.4.15/configure.in
44===================================================================
45--- DirectFB-1.4.15.orig/configure.in 2012-03-16 13:32:23.692402879 +0000
46+++ DirectFB-1.4.15/configure.in 2012-03-16 13:33:22.312400960 +0000
47@@ -97,13 +97,6 @@
48 AC_CHECK_SIZEOF(long long)
49 AC_CHECK_FUNCS(fork)
50
51-
52-## Work around libstuhl during cross build...
53-if test "$host" != "$build"; then
54- sys_lib_dlsearch_path_spec=""
55- sys_lib_search_path_spec=""
56-fi
57-
58 AC_PATH_PROGS(PERL, perl5 perl)
59
60 AC_PATH_PROG(MAN2HTML, man2html, no)
diff --git a/recipes-graphics/directfb/directfb/fix-compilation-with-zlib.patch b/recipes-graphics/directfb/directfb/fix-compilation-with-zlib.patch
new file mode 100644
index 0000000..8b99b4e
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/fix-compilation-with-zlib.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Pending
2
3From 1d6d597050fc24769e9df2693f754bdc824a8b78 Mon Sep 17 00:00:00 2001
4From: Laurentiu Palcu <laurentiu.palcu@intel.com>
5Date: Tue, 3 Jul 2012 16:06:10 +0300
6Subject: [PATCH] fix compilation with zlib
7
8Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
9---
10 src/core/surface.c | 3 +++
11 1 file changed, 3 insertions(+)
12
13diff --git a/src/core/surface.c b/src/core/surface.c
14index 50434a2..52f50ab 100644
15--- a/src/core/surface.c
16+++ b/src/core/surface.c
17@@ -49,6 +49,9 @@
18 #include <gfx/convert.h>
19 #include <gfx/util.h>
20
21+#ifdef USE_ZLIB
22+#include <zlib.h>
23+#endif
24
25 D_DEBUG_DOMAIN( Core_Surface, "Core/Surface", "DirectFB Core Surface" );
26
27--
281.7.9.5
29
diff --git a/recipes-graphics/directfb/directfb/fixsepbuild.patch b/recipes-graphics/directfb/directfb/fixsepbuild.patch
new file mode 100644
index 0000000..94a9ba5
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/fixsepbuild.patch
@@ -0,0 +1,19 @@
1Fix out of tree builds
2
3Upstream-Status: Pending
4
5RP 2013/03/21
6
7Index: DirectFB-1.6.1/configure.in
8===================================================================
9--- DirectFB-1.6.1.orig/configure.in 2013-03-19 01:38:28.174004720 +0000
10+++ DirectFB-1.6.1/configure.in 2013-03-21 12:18:10.253113675 +0000
11@@ -111,7 +111,7 @@
12 AC_PATH_TOOL(FLUXCOMP, fluxcomp)
13 AC_SUBST(FLUXCOMP)
14 if test -z "$FLUXCOMP"; then
15- if ! test -e src/core/CoreDFB.cpp; then
16+ if ! test -e $srcdir/src/core/CoreDFB.cpp; then
17 AC_MSG_ERROR([
18 *** DirectFB compilation requires fluxcomp ***
19
diff --git a/recipes-graphics/directfb/directfb/fusion.patch b/recipes-graphics/directfb/directfb/fusion.patch
new file mode 100644
index 0000000..1f81a67
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/fusion.patch
@@ -0,0 +1,36 @@
1directfb: Fix for hangs in direct_test, fusion_skirmish on exit
2
3Upstream-Status: Pending
4Signed-off-by: Lauren Post <lauren.post@freescale.com>
5
6--- a/lib/fusion/fusion.c 2013-01-18 22:57:11.000000000 +0800
7+++ b/lib/fusion/fusion.c 2013-07-04 10:42:56.502699119 +0800
8@@ -2853,9 +2853,14 @@
9 direct_mutex_lock( &world->event_dispatcher_mutex );
10
11 while (1) {
12- if (!world->event_dispatcher_buffers)
13+ if (!world->event_dispatcher_buffers){
14 direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
15-
16+ if (world->dispatch_stop) {
17+ D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" );
18+ direct_mutex_unlock( &world->event_dispatcher_mutex );
19+ return NULL;
20+ }
21+ }
22 buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
23 D_MAGIC_ASSERT( buf, FusionEventDispatcherBuffer );
24
25@@ -2872,6 +2877,11 @@
26 //D_INFO("waiting...\n");
27 D_ASSERT( buf->read_pos == buf->write_pos );
28 direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
29+ if (world->dispatch_stop) {
30+ D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" );
31+ direct_mutex_unlock( &world->event_dispatcher_mutex );
32+ return NULL;
33+ }
34 }
35
36 buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
diff --git a/recipes-graphics/directfb/directfb/rename-no-instrument-function-macro.patch b/recipes-graphics/directfb/directfb/rename-no-instrument-function-macro.patch
new file mode 100644
index 0000000..443df5a
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/rename-no-instrument-function-macro.patch
@@ -0,0 +1,345 @@
1Rename __no_instrument_function__ macro to avoid conficting redefinitions
2of the same symbol.
3
4Upstream-Status: Pending
5Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
6
7Index: DirectFB-1.6.1/lib/direct/clock.c
8===================================================================
9--- DirectFB-1.6.1.orig/lib/direct/clock.c 2012-06-29 19:01:11.000000000 +0300
10+++ DirectFB-1.6.1/lib/direct/clock.c 2013-01-05 18:03:24.000000000 +0200
11@@ -36,28 +36,28 @@
12
13 /**********************************************************************************************************************/
14
15-__no_instrument_function__
16+__dfb_no_instrument_function__
17 long long
18 direct_clock_get_micros( void )
19 {
20 return direct_clock_get_time( DIRECT_CLOCK_SESSION );
21 }
22
23-__no_instrument_function__
24+__dfb_no_instrument_function__
25 long long
26 direct_clock_get_millis( void )
27 {
28 return direct_clock_get_time( DIRECT_CLOCK_SESSION ) / 1000LL;
29 }
30
31-__no_instrument_function__
32+__dfb_no_instrument_function__
33 long long
34 direct_clock_get_abs_micros( void )
35 {
36 return direct_clock_get_time( DIRECT_CLOCK_REALTIME );
37 }
38
39-__no_instrument_function__
40+__dfb_no_instrument_function__
41 long long
42 direct_clock_get_abs_millis( void )
43 {
44Index: DirectFB-1.6.1/lib/direct/debug.c
45===================================================================
46--- DirectFB-1.6.1.orig/lib/direct/debug.c 2012-06-29 19:01:11.000000000 +0300
47+++ DirectFB-1.6.1/lib/direct/debug.c 2013-01-05 18:03:49.000000000 +0200
48@@ -48,7 +48,7 @@
49
50 #if DIRECT_BUILD_DEBUGS /* Build with debug support? */
51
52-__no_instrument_function__
53+__dfb_no_instrument_function__
54 void
55 direct_debug_log( DirectLogDomain *domain,
56 unsigned int debug_level, /* 1-9, 0 = info */
57@@ -63,7 +63,7 @@
58 va_end( ap );
59 }
60
61-__no_instrument_function__
62+__dfb_no_instrument_function__
63 void
64 direct_debug_at( DirectLogDomain *domain,
65 const char *format, ... )
66@@ -77,7 +77,7 @@
67
68 #endif /* DIRECT_BUILD_DEBUGS */
69
70-__no_instrument_function__
71+__dfb_no_instrument_function__
72 void
73 direct_debug_at_always( DirectLogDomain *domain,
74 const char *format, ... )
75@@ -93,7 +93,7 @@
76
77 #if DIRECT_BUILD_DEBUGS /* Build with debug support? */
78
79-__no_instrument_function__
80+__dfb_no_instrument_function__
81 void
82 direct_break( const char *func,
83 const char *file,
84@@ -123,7 +123,7 @@
85 direct_trap( "Break", SIGABRT );
86 }
87
88-__no_instrument_function__
89+__dfb_no_instrument_function__
90 void
91 direct_assertion( const char *exp,
92 const char *func,
93@@ -144,7 +144,7 @@
94 direct_trap( "Assertion", SIGTRAP );
95 }
96
97-__no_instrument_function__
98+__dfb_no_instrument_function__
99 void
100 direct_assumption( const char *exp,
101 const char *func,
102Index: DirectFB-1.6.1/lib/direct/interface.c
103===================================================================
104--- DirectFB-1.6.1.orig/lib/direct/interface.c 2012-06-29 19:01:11.000000000 +0300
105+++ DirectFB-1.6.1/lib/direct/interface.c 2013-01-05 18:04:56.000000000 +0200
106@@ -522,7 +522,7 @@
107
108 /**************************************************************************************************/
109
110-__no_instrument_function__
111+__dfb_no_instrument_function__
112 static InterfaceDesc *
113 allocate_interface_desc( void )
114 {
115@@ -543,7 +543,7 @@
116 return &alloc_list[alloc_count++];
117 }
118
119-__no_instrument_function__
120+__dfb_no_instrument_function__
121 static __inline__ void
122 fill_interface_desc( InterfaceDesc *desc,
123 const void *interface_ptr,
124@@ -565,7 +565,7 @@
125
126 /**************************************************************************************************/
127
128-__no_instrument_function__
129+__dfb_no_instrument_function__
130 void
131 direct_dbg_interface_add( const char *func,
132 const char *file,
133@@ -586,7 +586,7 @@
134 direct_mutex_unlock( &alloc_lock );
135 }
136
137-__no_instrument_function__
138+__dfb_no_instrument_function__
139 void
140 direct_dbg_interface_remove( const char *func,
141 const char *file,
142Index: DirectFB-1.6.1/lib/direct/log.c
143===================================================================
144--- DirectFB-1.6.1.orig/lib/direct/log.c 2012-06-29 19:01:11.000000000 +0300
145+++ DirectFB-1.6.1/lib/direct/log.c 2013-01-05 18:04:18.000000000 +0200
146@@ -128,7 +128,7 @@
147 return DR_OK;
148 }
149
150-__no_instrument_function__
151+__dfb_no_instrument_function__
152 DirectResult
153 direct_log_printf( DirectLog *log,
154 const char *format, ... )
155@@ -197,7 +197,7 @@
156 return DR_OK;
157 }
158
159-__no_instrument_function__
160+__dfb_no_instrument_function__
161 void
162 direct_log_lock( DirectLog *log )
163 {
164@@ -211,7 +211,7 @@
165 direct_mutex_lock( &log->lock );
166 }
167
168-__no_instrument_function__
169+__dfb_no_instrument_function__
170 void
171 direct_log_unlock( DirectLog *log )
172 {
173@@ -262,7 +262,7 @@
174
175 /**********************************************************************************************************************/
176
177-__no_instrument_function__
178+__dfb_no_instrument_function__
179 DirectLog *
180 direct_log_default( void )
181 {
182Index: DirectFB-1.6.1/lib/direct/log_domain.c
183===================================================================
184--- DirectFB-1.6.1.orig/lib/direct/log_domain.c 2012-06-29 19:01:11.000000000 +0300
185+++ DirectFB-1.6.1/lib/direct/log_domain.c 2013-01-05 18:04:38.000000000 +0200
186@@ -69,7 +69,7 @@
187
188 /**********************************************************************************************************************/
189
190-__no_instrument_function__
191+__dfb_no_instrument_function__
192 static __inline__ LogDomainEntry *
193 lookup_domain( const char *name, bool sub );
194
195@@ -104,7 +104,7 @@
196 return NULL;
197 }
198
199-__no_instrument_function__
200+__dfb_no_instrument_function__
201 static DirectLogLevel
202 check_domain( DirectLogDomain *domain );
203
204@@ -207,7 +207,7 @@
205 /* FIXME: merge following */
206
207
208-__no_instrument_function__
209+__dfb_no_instrument_function__
210 DirectResult
211 direct_log_domain_vprintf( DirectLogDomain *domain,
212 DirectLogLevel level,
213@@ -268,7 +268,7 @@
214 return DR_OK;
215 }
216
217-__no_instrument_function__
218+__dfb_no_instrument_function__
219 DirectResult
220 direct_log_domain_log( DirectLogDomain *domain,
221 DirectLogLevel level,
222Index: DirectFB-1.6.1/lib/direct/mem.c
223===================================================================
224--- DirectFB-1.6.1.orig/lib/direct/mem.c 2012-06-29 19:01:11.000000000 +0300
225+++ DirectFB-1.6.1/lib/direct/mem.c 2013-01-05 18:03:08.000000000 +0200
226@@ -121,7 +121,7 @@
227
228 /**********************************************************************************************************************/
229
230-__no_instrument_function__
231+__dfb_no_instrument_function__
232 static __inline__ MemDesc *
233 fill_mem_desc( MemDesc *desc, int bytes, const char *func, const char *file, int line, DirectTraceBuffer *trace )
234 {
235Index: DirectFB-1.6.1/lib/direct/messages.c
236===================================================================
237--- DirectFB-1.6.1.orig/lib/direct/messages.c 2012-06-29 19:01:11.000000000 +0300
238+++ DirectFB-1.6.1/lib/direct/messages.c 2013-01-05 18:02:57.000000000 +0200
239@@ -40,7 +40,7 @@
240
241 #if DIRECT_BUILD_TEXT
242
243-__no_instrument_function__
244+__dfb_no_instrument_function__
245 void
246 direct_messages_info( const char *format, ... )
247 {
248@@ -57,7 +57,7 @@
249 direct_log_printf( NULL, "(*) %s", buf );
250 }
251
252-__no_instrument_function__
253+__dfb_no_instrument_function__
254 void
255 direct_messages_error( const char *format, ... )
256 {
257@@ -76,7 +76,7 @@
258 direct_trace_print_stack( NULL );
259 }
260
261-__no_instrument_function__
262+__dfb_no_instrument_function__
263 void
264 direct_messages_derror( DirectResult result, const char *format, ... )
265 {
266@@ -95,7 +95,7 @@
267 direct_trace_print_stack( NULL );
268 }
269
270-__no_instrument_function__
271+__dfb_no_instrument_function__
272 void
273 direct_messages_perror( int erno, const char *format, ... )
274 {
275@@ -114,7 +114,7 @@
276 direct_trace_print_stack( NULL );
277 }
278
279-__no_instrument_function__
280+__dfb_no_instrument_function__
281 void
282 direct_messages_dlerror( const char *dlerr, const char *format, ... )
283 {
284@@ -133,7 +133,7 @@
285 direct_trace_print_stack( NULL );
286 }
287
288-__no_instrument_function__
289+__dfb_no_instrument_function__
290 void
291 direct_messages_once( const char *func,
292 const char *file,
293@@ -155,7 +155,7 @@
294 direct_trace_print_stack( NULL );
295 }
296
297-__no_instrument_function__
298+__dfb_no_instrument_function__
299 void
300 direct_messages_unimplemented( const char *func,
301 const char *file,
302@@ -166,7 +166,7 @@
303 direct_trace_print_stack( NULL );
304 }
305
306-__no_instrument_function__
307+__dfb_no_instrument_function__
308 void
309 direct_messages_bug( const char *func,
310 const char *file,
311@@ -188,7 +188,7 @@
312 direct_trace_print_stack( NULL );
313 }
314
315-__no_instrument_function__
316+__dfb_no_instrument_function__
317 void
318 direct_messages_warn( const char *func,
319 const char *file,
320Index: DirectFB-1.6.1/lib/direct/os/linux/glibc/types.h
321===================================================================
322--- DirectFB-1.6.1.orig/lib/direct/os/linux/glibc/types.h 2012-06-29 19:01:11.000000000 +0300
323+++ DirectFB-1.6.1/lib/direct/os/linux/glibc/types.h 2013-01-05 18:06:04.000000000 +0200
324@@ -74,7 +74,7 @@
325
326 #define __inline__ inline
327 #define D_UNUSED __attribute__((unused))
328-#define __no_instrument_function__ __attribute__((no_instrument_function))
329+#define __dfb_no_instrument_function__ __attribute__((no_instrument_function))
330 #define __constructor__ __attribute__((constructor))
331 #define __destructor__ __attribute__((destructor))
332 #define __typeof__(x) typeof(x)
333Index: DirectFB-1.6.1/lib/direct/util.c
334===================================================================
335--- DirectFB-1.6.1.orig/lib/direct/util.c 2012-06-29 19:01:11.000000000 +0300
336+++ DirectFB-1.6.1/lib/direct/util.c 2013-01-05 18:03:59.000000000 +0200
337@@ -110,7 +110,7 @@
338 /*
339 * translates errno to DirectResult
340 */
341-__no_instrument_function__
342+__dfb_no_instrument_function__
343 DirectResult
344 errno2result( int erno )
345 {
diff --git a/recipes-graphics/directfb/directfb_1.6.3.bb b/recipes-graphics/directfb/directfb_1.6.3.bb
new file mode 100644
index 0000000..277e9a9
--- /dev/null
+++ b/recipes-graphics/directfb/directfb_1.6.3.bb
@@ -0,0 +1,26 @@
1require directfb.inc
2
3RV = "1.6-0"
4PR = "${INC_PR}.2"
5
6DEPENDS += "sysfsutils"
7
8SRC_URI += "file://fix-compilation-with-zlib.patch \
9 file://rename-no-instrument-function-macro.patch \
10 file://fixsepbuild.patch"
11
12EXTRA_OECONF = "\
13 --enable-freetype=yes \
14 --enable-zlib \
15 --with-gfxdrivers=none \
16 --disable-sdl \
17 --disable-vnc \
18 --disable-x11 \
19 --disable-imlib2 \
20 --disable-mesa \
21"
22
23LEAD_SONAME = "libdirectfb-1.6.so.0"
24
25SRC_URI[md5sum] = "641e8e999c017770da647f9b5b890906"
26SRC_URI[sha256sum] = "7a96aced0f69b2ec0810e9923068e61c21e6b19dd593e09394c872414df75e70"
diff --git a/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch b/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
new file mode 100644
index 0000000..1160cd1
--- /dev/null
+++ b/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
@@ -0,0 +1,35 @@
1Add ARM support into xf86arm.h. This provides support for Xorg interface.
2Without this the vivante samples will hang during close requiring a reboot
3
4Upstream-Status: Pending
5
6Signed-off-by: Lauren Post <lauren.post@freescale.com>
7Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
8
9diff --git a/xf86drm.h b/xf86drm.h
10--- a/xf86drm.h
11+++ b/xf86drm.h
12@@ -461,6 +461,23 @@ do { register unsigned int __old __asm("
13 : "cr0", "memory"); \
14 } while (0)
15
16+#elif defined(__arm__)
17+ #undef DRM_DEV_MODE
18+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
19+
20+ #define DRM_CAS(lock,old,new,__ret) \
21+ do { \
22+ __asm__ __volatile__ ( \
23+ "1: ldrex %0, [%1]\n" \
24+ " teq %0, %2\n" \
25+ " ite eq\n" \
26+ " strexeq %0, %3, [%1]\n" \
27+ " movne %0, #1\n" \
28+ : "=&r" (__ret) \
29+ : "r" (lock), "r" (old), "r" (new) \
30+ : "cc","memory"); \
31+ } while (0)
32+
33 #endif /* architecture */
34 #endif /* __GNUC__ >= 2 */
35
diff --git a/recipes-graphics/drm/libdrm_%.bbappend b/recipes-graphics/drm/libdrm_%.bbappend
new file mode 100644
index 0000000..1ef3340
--- /dev/null
+++ b/recipes-graphics/drm/libdrm_%.bbappend
@@ -0,0 +1,5 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI_append_mx6 = "file://drm-update-arm.patch"
4
5PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
diff --git a/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend b/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
new file mode 100644
index 0000000..5f359a3
--- /dev/null
+++ b/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
@@ -0,0 +1,3 @@
1# Set i.MX specific dependencies and device type
2DEPENDS += "virtual/libgles2"
3EGLINFO_DEVICE = "imx6"
diff --git a/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend b/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
new file mode 100644
index 0000000..5f359a3
--- /dev/null
+++ b/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
@@ -0,0 +1,3 @@
1# Set i.MX specific dependencies and device type
2DEPENDS += "virtual/libgles2"
3EGLINFO_DEVICE = "imx6"
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q.inc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q.inc
new file mode 100644
index 0000000..4106848
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q.inc
@@ -0,0 +1,259 @@
1# Copyright (C) 2012-2013 Freescale Semiconductor
2# Copyright (C) 2012-2014 O.S. Systems Software LTDA.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5DESCRIPTION = "GPU driver and apps for imx6"
6SECTION = "libs"
7LICENSE = "Proprietary"
8LIC_FILES_CHKSUM = "file://usr/include/gc_vdk.h;endline=11;md5=19f5925343fa3da65596eeaa4ddb5fd3"
9
10DEPENDS += "${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxdamage libxext libxfixes mesa', \
11 base_contains('DISTRO_FEATURES', 'wayland', 'wayland', \
12 '', d), d)}"
13
14PROVIDES += "virtual/wayland-egl virtual/libgl virtual/libgal-x11 virtual/egl virtual/libgles1 virtual/libgles2 virtual/libopenvg"
15
16PE = "1"
17
18inherit fsl-eula-unpack
19
20SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true \
21 file://egl.pc \
22 file://egl_x11.pc \
23 file://glesv1_cm.pc \
24 file://glesv1_cm_x11.pc \
25 file://glesv2.pc \
26 file://glesv2_x11.pc \
27 file://vg.pc \
28 file://vg_x11.pc \
29 file://gc_wayland_protocol.pc \
30 file://wayland-egl.pc \
31 file://wayland-viv.pc \
32 file://directfbrc \
33 "
34
35PACKAGES =+ "libclc-mx6 libclc-mx6-dev libclc-mx6-dbg \
36 libgl-mx6 libgl-mx6-dev libgl-mx6-dbg \
37 libgles-mx6 libgles-mx6-dev libgles-mx6-dbg \
38 libgles2-mx6 libgles2-mx6-dev libgles2-mx6-dbg \
39 libglslc-mx6 libglslc-mx6-dev libglslc-mx6-dbg \
40 libopencl-mx6 libopencl-mx6-dev libopencl-mx6-dbg \
41 libopenvg-mx6 libopenvg-mx6-dev libopenvg-mx6-dbg \
42 libvdk-mx6 libvdk-mx6-dev libvdk-mx6-dbg \
43 libegl-mx6 libegl-mx6-dev libegl-mx6-dbg \
44 libgal-mx6 libgal-mx6-dev libgal-mx6-dbg \
45 libvivante-mx6 libvivante-mx6-dev libvivante-mx6-dbg \
46 libvivante-dri-mx6 \
47 libvivante-dfb-mx6 \
48 libwayland-viv-mx6 libwayland-viv-mx6-dev libwayland-viv-mx6-dbg \
49 libgc-wayland-protocol-mx6 libgc-wayland-protocol-mx6-dev libgc-wayland-protocol-mx6-dbg \
50 libwayland-egl-mx6-dev \
51"
52
53# Skip package if it does not match the machine float-point type in use
54python __anonymous () {
55 is_machine_hardfp = base_contains("TUNE_FEATURES", "callconvention-hard", True, False, d)
56 is_package_hardfp = d.getVar("PACKAGE_FP_TYPE", True) == "hardfp"
57
58 if is_package_hardfp != is_machine_hardfp:
59 PN = d.getVar("PN", True)
60 PV = d.getVar("PV", True)
61 bb.debug(1, "Skipping %s (%s) as machine and package float-point does not match" % (PN, PV))
62 raise bb.parse.SkipPackage("Package Float-Point is not compatible with the machine")
63}
64
65USE_X11 = "${@base_contains("DISTRO_FEATURES", "x11", "yes", "no", d)}"
66USE_DFB = "${@base_contains("DISTRO_FEATURES", "directfb", "yes", "no", d)}"
67USE_WL = "${@base_contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
68
69# Inhibit warnings about files being stripped.
70INHIBIT_PACKAGE_STRIP = "1"
71INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
72
73# FIXME: The provided binary doesn't provide soname. If in future BSP
74# release the libraries are fixed, we can drop this hack.
75REALSOLIBS := "${SOLIBS}"
76SOLIBS = "${SOLIBSDEV}"
77
78# For the packages that make up the OpenGL interfaces, inject variables so that
79# they don't get Debian-renamed (which would remove the -mx6 suffix).
80#
81# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
82# the source we cannot fix it. Disable the insane check for now.
83python __anonymous() {
84 packages = d.getVar('PACKAGES', True).split()
85 for p in packages:
86 d.appendVar("INSANE_SKIP_%s" % p, " ldflags")
87
88 for p in (("libegl", "libegl1"), ("libgl", "libgl1"),
89 ("libgles1", "libglesv1-cm1"), ("libgles2", "libglesv2-2"),
90 ("libgles3",)):
91 fullp = p[0] + "-mx6"
92 pkgs = " ".join(p)
93 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
94 d.appendVar("RREPLACES_" + fullp, pkgs)
95 d.appendVar("RPROVIDES_" + fullp, pkgs)
96 d.appendVar("RCONFLICTS_" + fullp, pkgs)
97
98 # For -dev, the first element is both the Debian and original name
99 fullp += "-dev"
100 pkgs = p[0] + "-dev"
101 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
102 d.appendVar("RREPLACES_" + fullp, pkgs)
103 d.appendVar("RPROVIDES_" + fullp, pkgs)
104 d.appendVar("RCONFLICTS_" + fullp, pkgs)
105}
106
107do_install () {
108 install -d ${D}${libdir}
109 install -d ${D}${includedir}
110
111 cp -a ${S}/usr/lib/*.so* ${D}${libdir}
112 cp -axr ${S}/usr/include/* ${D}${includedir}
113 cp -axr ${S}/opt ${D}
114
115 install -d ${D}${libdir}/pkgconfig
116
117 # The preference order, based in DISTRO_FEATURES, is x11, wayland, directfb and fb
118 if [ "${USE_X11}" = "yes" ]; then
119 cp -r ${S}/usr/lib/dri ${D}${libdir}
120 backend=x11
121
122 install -m 0644 ${WORKDIR}/egl_x11.pc ${D}${libdir}/pkgconfig/egl.pc
123 install -m 0644 ${WORKDIR}/glesv1_cm_x11.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
124 install -m 0644 ${WORKDIR}/glesv2_x11.pc ${D}${libdir}/pkgconfig/glesv2.pc
125 install -m 0644 ${WORKDIR}/vg_x11.pc ${D}${libdir}/pkgconfig/vg.pc
126 #FIXME: WL & X11 is not currently functional
127 #if [ "${USE_WL}" = "yes" ]; then
128 # install -m 0644 ${WORKDIR}/gc_wayland_protocol.pc ${D}${libdir}/pkgconfig/gc_wayland_protocol.pc
129 # install -m 0644 ${WORKDIR}/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc
130 # install -m 0644 ${WORKDIR}/wayland-viv.pc ${D}${libdir}/pkgconfig/wayland-viv.pc
131 #fi
132 elif [ "${USE_WL}" = "yes" ]; then
133 backend=wl
134
135 install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc
136 install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
137 install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
138 install -m 0644 ${WORKDIR}/vg.pc ${D}${libdir}/pkgconfig/vg.pc
139 install -m 0644 ${WORKDIR}/gc_wayland_protocol.pc ${D}${libdir}/pkgconfig/gc_wayland_protocol.pc
140 install -m 0644 ${WORKDIR}/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc
141 install -m 0644 ${WORKDIR}/wayland-viv.pc ${D}${libdir}/pkgconfig/wayland-viv.pc
142 else
143 install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc
144 install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
145 install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
146 install -m 0644 ${WORKDIR}/vg.pc ${D}${libdir}/pkgconfig/vg.pc
147
148 if [ "${USE_DFB}" = "yes" ]; then
149 install -d ${D}/${sysconfdir}
150 install -m 644 ${WORKDIR}/directfbrc ${D}/${sysconfdir}/directfbrc
151
152 cp -r ${S}/usr/lib/directfb-1.6-0 ${D}${libdir}
153 backend=dfb
154 else
155 # Regular framebuffer
156 backend=fb
157 fi
158 fi
159
160 # We'll only have one backend here so we rename it to generic name
161 # and avoid rework in other packages, when possible
162 mv ${D}${libdir}/libGL.so.1.2 ${D}${libdir}/libGL.so.1.2.0
163 ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1.2
164 ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so
165 mv ${D}${libdir}/libEGL-${backend}.so ${D}${libdir}/libEGL.so.1.0
166 ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so.1
167 ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so
168 mv ${D}${libdir}/libGAL-${backend}.so ${D}${libdir}/libGAL.so
169 mv ${D}${libdir}/libVIVANTE-${backend}.so ${D}${libdir}/libVIVANTE.so
170
171 # update libglesv2 as backend dependent
172 rm -rf ${D}${libdir}/libGLESv2*
173 cp -a ${S}/usr/lib/libGLESv2-${backend}.so ${D}${libdir}/libGLESv2.so.2.0.0
174 ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so.2
175 ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so
176
177 for backend in wl x11 fb dfb; do
178 find ${D}${libdir} -name "*-$backend.so" -exec rm '{}' ';'
179 done
180
181 find ${D}${libdir} -type f -exec chmod 644 {} \;
182 find ${D}${includedir} -type f -exec chmod 644 {} \;
183}
184
185FILES_${PN} += "/opt"
186FILES_${PN}-dev = "${includedir}"
187FILES_${PN}-dbg = "${libdir}/.debug /opt/viv_samples/*/*/.debug"
188
189FILES_libclc-mx6 = "${libdir}/libCLC${SOLIBS}"
190FILES_libclc-mx6-dev = "${includedir}/CL ${libdir}/libCLC${SOLIBSDEV}"
191FILES_libclc-mx6-dbg = "${libdir}/.debug/libCLC${SOLIBS}"
192
193# libEGL.so is used by some demo apps from Freescale
194INSANE_SKIP_libegl-mx6 += "dev-so"
195FILES_libegl-mx6 = "${libdir}/libEGL${REALSOLIBS} ${libdir}/libEGL${SOLIBSDEV} "
196FILES_libegl-mx6-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
197FILES_libegl-mx6-dbg = "${libdir}/.debug/libEGL${SOLIBS}"
198
199FILES_libgal-mx6 = "${libdir}/libGAL${SOLIBS}"
200FILES_libgal-mx6-dev = "${libdir}/libGAL${SOLIBSDEV}"
201FILES_libgal-mx6-dbg = "${libdir}/.debug/libGAL${SOLIBS}"
202
203FILES_libgl-mx6 = "${libdir}/libGL${REALSOLIBS}"
204FILES_libgl-mx6-dev = "${libdir}/libGL${SOLIBSDEV}"
205FILES_libgl-mx6-dbg = "${libdir}/.debug/libGL.${SOLIBS}"
206
207# libEGL needs to open libGLESv1.so
208INSANE_SKIP_libgles-mx6 += "dev-so"
209FILES_libgles-mx6 = "${libdir}/libGLESv1*${REALSOLIBS} ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${SOLIBS}"
210FILES_libgles-mx6-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${SOLIBSDEV} ${libdir}/pkgconfig/glesv1_cm.pc"
211FILES_libgles-mx6-dbg = "${libdir}/.debug/libGLESv1*${SOLIBS} ${libdir}/.debug/libGLES_*${SOLIBS}"
212
213# libEGL needs to open libGLESv2.so
214INSANE_SKIP_libgles2-mx6 += "dev-so"
215FILES_libgles2-mx6 = "${libdir}/libGLESv2${REALSOLIBS} ${libdir}/libGLESv2${SOLIBS}"
216FILES_libgles2-mx6-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV} ${libdir}/pkgconfig/glesv2.pc"
217FILES_libgles2-mx6-dbg = "${libdir}/.debug/libGLESv2${SOLIBS}"
218RDEPENDS_libgles2-mx6 = "libglslc-mx6"
219
220FILES_libglslc-mx6 = "${libdir}/libGLSLC${SOLIBS}"
221FILES_libglslc-mx6-dev = "${includedir}/CL ${libdir}/libGLSLC${SOLIBSDEV}"
222FILES_libglslc-mx6-dbg = "${libdir}/.debug/libGLSLC${SOLIBS}"
223
224FILES_libopencl-mx6 = "${libdir}/libOpenCL${SOLIBS}"
225FILES_libopencl-mx6-dev = "${includedir}/CL ${libdir}/libOpenCL${SOLIBSDEV}"
226FILES_libopencl-mx6-dbg = "${libdir}/.debug/libOpenCL${SOLIBS}"
227RDEPENDS_libopencl-mx6 = "libclc-mx6"
228
229FILES_libopenvg-mx6 = "${libdir}/libOpenVG*${SOLIBS}"
230FILES_libopenvg-mx6-dev = "${includedir}/VG ${libdir}/libOpenVG*${SOLIBSDEV} ${libdir}/pkgconfig/vg.pc"
231FILES_libopenvg-mx6-dbg = "${libdir}/.debug/libOpenVG*${SOLIBS}"
232
233FILES_libvdk-mx6 = "${libdir}/libVDK${SOLIBS}"
234FILES_libvdk-mx6-dev = "${includedir}/*vdk.h ${libdir}/libVDK${SOLIBSDEV}"
235FILES_libvdk-mx6-dbg = "${libdir}/.debug/libVDK${SOLIBS}"
236
237FILES_libvivante-mx6 = "${libdir}/libVIVANTE${SOLIBS}"
238FILES_libvivante-mx6-dev = "${libdir}/libVIVANTE${SOLIBSDEV}"
239FILES_libvivante-mx6-dbg = "${libdir}/.debug/libVIVANTE${SOLIBS}"
240
241FILES_libvivante-dri-mx6 = "${libdir}/dri/vivante_dri.so"
242
243FILES_libvivante-dfb-mx6 = "${libdir}/directfb-1.6-0/gfxdrivers/libdirectfb_gal.so"
244
245INSANE_SKIP_libwayland-viv-mx6 += "dev-so"
246FILES_libwayland-viv-mx6 = "${libdir}/libwayland-viv${REALSOLIBS} ${libdir}/libwayland-viv${SOLIBS}"
247FILES_libwayland-viv-mx6-dev = "${libdir})/libwayland-viv${SOLIBSDEV} ${libdir}/pkgconfig/wayland-viv.pc"
248FILES_libwayland-viv-mx6-dbg = "${libdir}/.debug/libwayland-viv${SOLIBS}"
249
250INSANE_SKIP_libgc-wayland-protocol-mx6 += "dev-so"
251FILES_libgc-wayland-protocol-mx6 = "${libdir}/libgc_wayland_protocol${REALSOLIBS} ${libdir}/libgc_wayland_protocol${SOLIBS}"
252FILES_libgc-wayland-protocol-mx6-dev = "${libdir}/libgc_wayland_protocol${SOLIBSDEV} ${libdir}/pkgconfig/gc_wayland_protocol.pc"
253FILES_libgc-wayland-protocol-mx6-dbg = "${libdir}/libgc_wayland_protocol${SOLIBS}"
254
255FILES_libwayland-egl-mx6-dev = "${libdir}/pkgconfig/wayland-egl.pc"
256
257FILES_libvivante-dfb-mx6 += "${sysconfdir}/directfbrc"
258
259COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/0001-change-header-path-to-HAL.patch b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/0001-change-header-path-to-HAL.patch
new file mode 100644
index 0000000..dc91d7c
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/0001-change-header-path-to-HAL.patch
@@ -0,0 +1,30 @@
1From 1a4a35678ef70283d1a31835deecd39711a9db86 Mon Sep 17 00:00:00 2001
2From: Jeremy Stashluk <jstashluk@dekaresearch.com>
3Date: Wed, 30 Jan 2013 13:16:53 -0500
4Subject: [PATCH] change header path to HAL
5
6The gpu-viv-bin-mx6q package from Freescale puts this header in the HAL
7directory under the system. I think this is a problem in the LTIB release as
8well.
9
10Upstream-Status: Pending
11
12Signed-off-by: Jeremy Stashluk <jstashluk@dekaresearch.com>
13
14---
15 usr/include/gc_vdk_types.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18Index: gpu-viv-bin-mx6q-1.1.0/usr/include/gc_vdk_types.h
19===================================================================
20--- gpu-viv-bin-mx6q-1.1.0.orig/usr/include/gc_vdk_types.h
21+++ gpu-viv-bin-mx6q-1.1.0/usr/include/gc_vdk_types.h
22@@ -39,7 +39,7 @@ extern "C" {
23 #endif
24
25 #include <EGL/egl.h>
26-#include "gc_hal_eglplatform_type.h"
27+#include <HAL/gc_hal_eglplatform_type.h>
28
29
30 /*******************************************************************************
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/directfbrc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/directfbrc
new file mode 100644
index 0000000..bae398c
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/directfbrc
@@ -0,0 +1,10 @@
1# directfbrc begin
2system=fbdev
3mode=1024x768 # display size (change to fit your needs)
4desktop-buffer-mode=frontonly # if no double buffering in framebuffer driver
5depth=16
6pixelformat=RGB16
7#no-hardware # disable hardware acceleration
8#no-software # disable software fallbacks
9# directfbrc end
10
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl.pc
new file mode 100644
index 0000000..a21922d
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: egl
7Description: Vivante EGL library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lEGL
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir} -DLINUX
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl_x11.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl_x11.pc
new file mode 100644
index 0000000..5921583
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/egl_x11.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: egl
7Description: Vivante EGL library
8Requires.private: libdrm x11 xext xdamage xfixes xcb
9Version: 8.0
10Libs: -L${libdir} -lEGL
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir} -DLINUX
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/fix-conflicting-TLS-definition.patch b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/fix-conflicting-TLS-definition.patch
new file mode 100644
index 0000000..3eac116
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/fix-conflicting-TLS-definition.patch
@@ -0,0 +1,31 @@
1Avoid conflicting types with Xorg newer code
2
3Upstream-Status: Pending
4Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5
6Index: gpu-viv-bin-mx6q-1.1.0/usr/include/HAL/gc_hal_base.h
7===================================================================
8--- gpu-viv-bin-mx6q-1.1.0.orig/usr/include/HAL/gc_hal_base.h
9+++ gpu-viv-bin-mx6q-1.1.0/usr/include/HAL/gc_hal_base.h
10@@ -101,7 +101,7 @@ extern gcsPLS gcPLS;
11 typedef struct _gcsTLS * gcsTLS_PTR;
12
13 typedef void (* gctTLS_DESTRUCTOR) (
14- gcsTLS_PTR TLS
15+ gcsTLS_PTR pTLS
16 );
17
18 typedef struct _gcsTLS
19@@ -648,10 +648,10 @@ gcoOS_SetPLSValue(
20 /* Get access to the thread local storage. */
21 gceSTATUS
22 gcoOS_GetTLS(
23- OUT gcsTLS_PTR * TLS
24+ OUT gcsTLS_PTR * pTLS
25 );
26
27- /* Copy the TLS from a source thread. */
28+ /* Copy the pTLS from a source thread. */
29 gceSTATUS gcoOS_CopyTLS(IN gcsTLS_PTR Source);
30
31 /* Destroy the objects associated with the current thread. */
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_hal_eglplatform-remove-xlib-undefs.patch b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_hal_eglplatform-remove-xlib-undefs.patch
new file mode 100644
index 0000000..732a073
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_hal_eglplatform-remove-xlib-undefs.patch
@@ -0,0 +1,34 @@
1From c59f9640d185759208f9d55a93b6602936dcb5e8 Mon Sep 17 00:00:00 2001
2From: Adrian Alonso <aalonso00@gmail.com>
3Date: Sat, 26 Jan 2013 17:52:04 -0600
4Subject: [PATCH 2/2] gc_hal_eglplatform: remove xlib undefs
5
6* Remove header undefs for Always and Status definitions
7
8Signed-off-by: Adrian Alonso <aalonso00@gmail.com>
9---
10 usr/include/HAL/gc_hal_eglplatform.h | 3 ---
11 1 file changed, 3 deletions(-)
12
13diff --git a/usr/include/HAL/gc_hal_eglplatform.h b/usr/include/HAL/gc_hal_eglplatform.h
14index a968fe7..e80c65a 100644
15--- a/usr/include/HAL/gc_hal_eglplatform.h
16+++ b/usr/include/HAL/gc_hal_eglplatform.h
17@@ -341,14 +341,11 @@ typedef Pixmap HALNativePixmapType;
18 /* Rename some badly named X defines. */
19 #ifdef Status
20 # define XStatus int
21-# undef Status
22 #endif
23 #ifdef Always
24 # define XAlways 2
25-# undef Always
26 #endif
27 #ifdef CurrentTime
28-# undef CurrentTime
29 # define XCurrentTime 0
30 #endif
31
32--
331.8.1
34
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_wayland_protocol.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_wayland_protocol.pc
new file mode 100644
index 0000000..f4610ea
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/gc_wayland_protocol.pc
@@ -0,0 +1,10 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib
4includedir=${prefix}/include
5
6Name: gc_wayland_protocol
7Description: Vivante Wayland Protocol Extension Library
8Version: 0.1
9Cflags: -I${includedir}
10Libs: -L${libdir} -lgc_wayland_protocol
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm.pc
new file mode 100644
index 0000000..d97b067
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv1_cm
7Description: Vivante OpenGL ES 1.1 CM library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lGLESv1_CM -lEGL -lGAL
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm_x11.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm_x11.pc
new file mode 100644
index 0000000..e801633
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv1_cm_x11.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv1_cm
7Description: Vivante OpenGL ES 1.1 CM library
8Requires.private: libdrm x11 xext xdamage xfixes xcb
9Version: 8.0
10Libs: -L${libdir} -lGLESv1_CM -lEGL -lGAL
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2.pc
new file mode 100644
index 0000000..9be46f2
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv2
7Description: Vivante OpenGL ES 2.0 library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lGLESv2 -lEGL -lGAL
11Libs.private: -lpthread -lrt
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2_x11.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2_x11.pc
new file mode 100644
index 0000000..57ad807
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/glesv2_x11.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv2
7Description: Vivante OpenGL ES 2.0 library
8Requires.private: libdrm x11 xext xdamage xfixes xcb
9Version: 8.0
10Libs: -L${libdir} -lGLESv2 -lEGL -lGAL
11Libs.private: -lpthread -lrt
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg.pc
new file mode 100644
index 0000000..7c00def
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: vg
7Description: Vivante OpenVG 1.1 library
8Requires.private:
9Version: 8.0
10Libs: -L${libdir} -lOpenVG -lEGL -lGAL
11Libs.private: -lpthread -lrt
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg_x11.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg_x11.pc
new file mode 100644
index 0000000..94fb91e
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/vg_x11.pc
@@ -0,0 +1,12 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: vg
7Description: Vivante OpenVG 1.1 library
8Requires.private: libdrm x11 xext xdamage xfixes xcb
9Version: 8.0
10Libs: -L${libdir} -lOpenVG -lEGL -lGAL
11Libs.private: -lpthread -lrt
12Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-egl.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-egl.pc
new file mode 100644
index 0000000..ba1b898
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-egl.pc
@@ -0,0 +1,10 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib
4includedir=${prefix}/include
5
6Name: wayland-egl
7Description: Bind the driver EGL to the Wayland API
8Version: 1.0.0
9Libs: -L${libdir} -lEGL
10Cflags: -I${includedir}
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-viv.pc b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-viv.pc
new file mode 100644
index 0000000..3fdedd0
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q/wayland-viv.pc
@@ -0,0 +1,10 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib
4includedir=${prefix}/include
5
6Name: Wayland Vivante Lib
7Description: Wayland server side library for Vivante's EGL driver
8Version: 0.1
9Cflags: -I${includedir}/wayland-viv
10Libs: -L${libdir} -lwayland-viv
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb
new file mode 100644
index 0000000..0a16621
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb
@@ -0,0 +1,9 @@
1# Copyright (C) 2013, 2014 Freescale Semiconductor
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require gpu-viv-bin-mx6q.inc
5
6SRC_URI[md5sum] = "8b9c4f6181acf46028e39508a970ecc1"
7SRC_URI[sha256sum] = "7e5a3db22b99740756f408b881691f81c03090256754e44f69369bf039e9cbcf"
8
9PACKAGE_FP_TYPE = "hardfp"
diff --git a/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-sfp.bb b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-sfp.bb
new file mode 100644
index 0000000..44bbd6d
--- /dev/null
+++ b/recipes-graphics/gpu-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-sfp.bb
@@ -0,0 +1,9 @@
1# Copyright (C) 2013, 2014 Freescale Semiconductor
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require gpu-viv-bin-mx6q.inc
5
6SRC_URI[md5sum] = "d1137c148aff0a25bd19feca889329c2"
7SRC_URI[sha256sum] = "e6af458221041d2d1ce6338a666969bbda73aa26270b243cfc4d22f9c0d913c9"
8
9PACKAGE_FP_TYPE = "softfp"
diff --git a/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d.inc b/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d.inc
new file mode 100644
index 0000000..ce0c74f
--- /dev/null
+++ b/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d.inc
@@ -0,0 +1,45 @@
1# Copyright (C) 2013, 2014 Freescale Semiconductor
2
3DESCRIPTION = "GPU Vivante G2D library and sample applications for imx6"
4SECTION = "libs"
5LICENSE = "Proprietary"
6LIC_FILES_CHKSUM = "file://usr/include/g2d.h;endline=7;md5=861ebad4adc7236f8d1905338abd7eb2"
7
8PROVIDES += "virtual/libg2d"
9
10PACKAGES = "${PN} ${PN}-dev ${PN}-dbg"
11
12inherit fsl-eula-unpack
13
14PE = "1"
15
16SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
17
18PACKAGES += "libg2d"
19
20# Inhibit warnings about files being stripped.
21INHIBIT_PACKAGE_STRIP = "1"
22INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
23
24do_install () {
25 install -d ${D}${libdir}
26 install -d ${D}${includedir}
27
28 cp ${S}/usr/lib/*.so ${D}${libdir}
29 cp -axr ${S}/usr/include/* ${D}${includedir}
30 cp -axr ${S}/opt ${D}
31
32 find ${D}${libdir} -type f -exec chmod 644 {} \;
33 find ${D}${includedir} -type f -exec chmod 644 {} \;
34}
35
36# FIXME: The provided binary doesn't provide soname. If in future BSP
37# release the libraries are fixed, we can drop this hack.
38REALSOLIBS := "${SOLIBS}"
39SOLIBS = "${SOLIBSDEV}"
40
41FILES_${PN} = "/opt"
42FILES_libg2d = "${libdir}/libg2d-viv${SOLIBS} ${libdir}/libg2d${SOLIBS}"
43FILES_${PN}-dev = "${includedir}"
44
45COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d_3.10.17-1.0.0.bb b/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d_3.10.17-1.0.0.bb
new file mode 100644
index 0000000..de83d95
--- /dev/null
+++ b/recipes-graphics/gpu-viv-g2d/gpu-viv-g2d_3.10.17-1.0.0.bb
@@ -0,0 +1,6 @@
1# Copyright (C) 2013, 2014 Freescale Semiconductor
2
3include gpu-viv-g2d.inc
4
5SRC_URI[md5sum] = "58dfe0fe674dcf82045d0af999ebd2f4"
6SRC_URI[sha256sum] = "5fcb6f294f94c059162d7b178f76f660d27ddab7ba0fc4344f1b28b30f71e261"
diff --git a/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch b/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
new file mode 100644
index 0000000..d899540
--- /dev/null
+++ b/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
@@ -0,0 +1,355 @@
1From 757649a766f90e745f24df1d191caeef15c71399 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Tue, 4 Jun 2013 09:28:51 -0300
4Subject: [PATCH] Replace glWindowPos2iARB calls with glWindowPos2i
5
6Vivante libGL does not provide the glWindowPos2iARB symbol, but
7glWindowPos2i. Use this instead.
8
9Upstream-Status: Inapropriate [embedded specific]
10
11Reported-by: Jeremy Stashluk <jstashluk@dekaresearch.com>
12Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
13---
14 src/demos/copypix.c | 4 ++--
15 src/demos/engine.c | 2 +-
16 src/demos/fogcoord.c | 4 ++--
17 src/glsl/shadow_sampler.c | 2 +-
18 src/tests/auxbuffer.c | 2 +-
19 src/tests/copypixrate.c | 2 +-
20 src/tests/drawbuffers.c | 2 +-
21 src/tests/drawbuffers2.c | 2 +-
22 src/tests/fbotest1.c | 2 +-
23 src/tests/fbotest2.c | 4 ++--
24 src/tests/fbotest3.c | 2 +-
25 src/tests/readrate.c | 10 +++++-----
26 src/tests/viewmemory.c | 2 +-
27 src/trivial/clear-fbo-scissor.c | 2 +-
28 src/trivial/clear-fbo-tex.c | 2 +-
29 src/trivial/clear-fbo.c | 2 +-
30 src/trivial/readpixels.c | 2 +-
31 src/trivial/tri-fbo.c | 2 +-
32 src/xdemos/glxsnoop.c | 2 +-
33 src/xdemos/wincopy.c | 4 ++--
34 20 files changed, 28 insertions(+), 28 deletions(-)
35
36diff --git a/src/demos/copypix.c b/src/demos/copypix.c
37index 286c5a9..041b567 100644
38--- a/src/demos/copypix.c
39+++ b/src/demos/copypix.c
40@@ -54,7 +54,7 @@ static void Display( void )
41 glClear( GL_COLOR_BUFFER_BIT );
42
43 /* draw original image */
44- glWindowPos2iARB(dx, dy);
45+ glWindowPos2i(dx, dy);
46 glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
47
48 if (Scissor)
49@@ -71,7 +71,7 @@ static void Display( void )
50
51 /* draw copy */
52 glPixelZoom(Xzoom, Yzoom);
53- glWindowPos2iARB(Xpos, Ypos);
54+ glWindowPos2i(Xpos, Ypos);
55 glCopyPixels(dx, dy, ImgWidth, ImgHeight, GL_COLOR);
56 glPixelZoom(1, 1);
57
58diff --git a/src/demos/engine.c b/src/demos/engine.c
59index 928fcbb..beace4c 100644
60--- a/src/demos/engine.c
61+++ b/src/demos/engine.c
62@@ -971,7 +971,7 @@ Draw(void)
63 glDisable(GL_LIGHTING);
64 glDisable(GL_TEXTURE_2D);
65 glColor3f(1, 1 , 1);
66- glWindowPos2iARB(10, 10);
67+ glWindowPos2i(10, 10);
68 PrintString(s);
69 if (lit)
70 glEnable(GL_LIGHTING);
71diff --git a/src/demos/fogcoord.c b/src/demos/fogcoord.c
72index 567eec0..e833009 100644
73--- a/src/demos/fogcoord.c
74+++ b/src/demos/fogcoord.c
75@@ -68,14 +68,14 @@ PrintInfo(void)
76
77 sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g",
78 ModeStr, fogStart, fogEnd, fogDensity);
79- glWindowPos2iARB(5, 20);
80+ glWindowPos2i(5, 20);
81 PrintString(s);
82
83 sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g",
84 (Arrays ? "Yes" : "No"),
85 (fogCoord ? "Yes" : "No"),
86 camz);
87- glWindowPos2iARB(5, 5);
88+ glWindowPos2i(5, 5);
89 PrintString(s);
90 }
91
92diff --git a/src/glsl/shadow_sampler.c b/src/glsl/shadow_sampler.c
93index b830030..eb82d8b 100644
94--- a/src/glsl/shadow_sampler.c
95+++ b/src/glsl/shadow_sampler.c
96@@ -85,7 +85,7 @@ Redisplay(void)
97 glPopMatrix();
98
99 glUseProgram(0);
100- glWindowPos2iARB(80, 20);
101+ glWindowPos2i(80, 20);
102 PrintString("white black white black");
103
104 {
105diff --git a/src/tests/auxbuffer.c b/src/tests/auxbuffer.c
106index 5fa399a..0cd5f47 100644
107--- a/src/tests/auxbuffer.c
108+++ b/src/tests/auxbuffer.c
109@@ -419,7 +419,7 @@ event_loop(Display *dpy, Window win)
110 /* Copy aux buffer image to back color buffer */
111 glReadBuffer(GL_AUX0);
112 glDrawBuffer(GL_BACK);
113- glWindowPos2iARB(0, 0);
114+ glWindowPos2i(0, 0);
115 glDisable(GL_DEPTH_TEST);
116 glCopyPixels(0, 0, WinWidth, WinHeight, GL_COLOR);
117 glEnable(GL_DEPTH_TEST);
118diff --git a/src/tests/copypixrate.c b/src/tests/copypixrate.c
119index 2f64e0a..df1f9b0 100644
120--- a/src/tests/copypixrate.c
121+++ b/src/tests/copypixrate.c
122@@ -91,7 +91,7 @@ BlitOne(void)
123 else
124 #endif
125 {
126- glWindowPos2iARB(x, y);
127+ glWindowPos2i(x, y);
128 glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
129 }
130 }
131diff --git a/src/tests/drawbuffers.c b/src/tests/drawbuffers.c
132index fa2f8a7..cd5033f 100644
133--- a/src/tests/drawbuffers.c
134+++ b/src/tests/drawbuffers.c
135@@ -88,7 +88,7 @@ Display(void)
136 glUseProgram(0);
137 glDisable(GL_DEPTH_TEST);
138 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
139- glWindowPos2iARB(0, 0);
140+ glWindowPos2i(0, 0);
141 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
142
143 free(buffer);
144diff --git a/src/tests/drawbuffers2.c b/src/tests/drawbuffers2.c
145index 5bcf0b2..84d444b 100644
146--- a/src/tests/drawbuffers2.c
147+++ b/src/tests/drawbuffers2.c
148@@ -112,7 +112,7 @@ Display(void)
149 glUseProgram(0);
150 glDisable(GL_DEPTH_TEST);
151 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
152- glWindowPos2iARB(0, 0);
153+ glWindowPos2i(0, 0);
154 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
155
156 free(buffer);
157diff --git a/src/tests/fbotest1.c b/src/tests/fbotest1.c
158index 161903c..5930a6d 100644
159--- a/src/tests/fbotest1.c
160+++ b/src/tests/fbotest1.c
161@@ -61,7 +61,7 @@ Display( void )
162
163 /* draw to window */
164 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
165- glWindowPos2iARB(0, 0);
166+ glWindowPos2i(0, 0);
167 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
168
169 free(buffer);
170diff --git a/src/tests/fbotest2.c b/src/tests/fbotest2.c
171index 6ef7f12..11c867e 100644
172--- a/src/tests/fbotest2.c
173+++ b/src/tests/fbotest2.c
174@@ -72,7 +72,7 @@ Display( void )
175
176 glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
177
178- glWindowPos2iARB(0, 0);
179+ glWindowPos2i(0, 0);
180 glCopyPixels(0, 0, Width, Height, GL_COLOR);
181 }
182 else if (blitPix) {
183@@ -95,7 +95,7 @@ Display( void )
184 /* draw to window */
185 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
186 glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
187- glWindowPos2iARB(0, 0);
188+ glWindowPos2i(0, 0);
189 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
190
191 free(buffer);
192diff --git a/src/tests/fbotest3.c b/src/tests/fbotest3.c
193index 19f684d..e6d7710 100644
194--- a/src/tests/fbotest3.c
195+++ b/src/tests/fbotest3.c
196@@ -79,7 +79,7 @@ Display( void )
197 /* draw to window */
198 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
199 glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
200- glWindowPos2iARB(0, 0);
201+ glWindowPos2i(0, 0);
202 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
203
204 free(buffer);
205diff --git a/src/tests/readrate.c b/src/tests/readrate.c
206index 3859cf4..81eb8a3 100644
207--- a/src/tests/readrate.c
208+++ b/src/tests/readrate.c
209@@ -85,7 +85,7 @@ MeasureFormat(struct format_type *fmt, GLint width, GLint height, GLuint pbo)
210 glEnd();
211
212 #if DRAW
213- glWindowPos2iARB(0,0);
214+ glWindowPos2i(0,0);
215 glDrawPixels(width, height,
216 fmt->Format, fmt->Type, Buffer);
217 glFinish();
218@@ -137,21 +137,21 @@ Draw(void)
219
220 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
221
222- glWindowPos2iARB(10, y);
223+ glWindowPos2i(10, y);
224 sprintf(str, "ReadPixels size: %d x %d", width, height);
225 PrintString(str);
226 y -= 14;
227
228- glWindowPos2iARB(10, y);
229+ glWindowPos2i(10, y);
230 PrintString("Press up/down/left/right to change image size.");
231 y -= 14;
232
233- glWindowPos2iARB(10, y);
234+ glWindowPos2i(10, y);
235 PrintString("Press 'b' to run benchmark test.");
236 y -= 14;
237
238 if (Benchmark) {
239- glWindowPos2iARB(10, y);
240+ glWindowPos2i(10, y);
241 PrintString("Testing...");
242 }
243
244diff --git a/src/tests/viewmemory.c b/src/tests/viewmemory.c
245index 16044b9..3584c33 100644
246--- a/src/tests/viewmemory.c
247+++ b/src/tests/viewmemory.c
248@@ -95,7 +95,7 @@ Draw(void)
249
250 glDisable(GL_TEXTURE_2D);
251 glColor3f(0, 1, 0);
252- glWindowPos2iARB(10, 10);
253+ glWindowPos2i(10, 10);
254 PrintString(s);
255
256 glutSwapBuffers();
257diff --git a/src/trivial/clear-fbo-scissor.c b/src/trivial/clear-fbo-scissor.c
258index a30935c..5c15200 100644
259--- a/src/trivial/clear-fbo-scissor.c
260+++ b/src/trivial/clear-fbo-scissor.c
261@@ -182,7 +182,7 @@ Draw(void)
262
263 /* draw to window */
264 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
265- glWindowPos2iARB(0, 0);
266+ glWindowPos2i(0, 0);
267 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
268
269 free(buffer);
270diff --git a/src/trivial/clear-fbo-tex.c b/src/trivial/clear-fbo-tex.c
271index de84f98..f0fbdf6 100644
272--- a/src/trivial/clear-fbo-tex.c
273+++ b/src/trivial/clear-fbo-tex.c
274@@ -140,7 +140,7 @@ static void Draw( void )
275 glClearColor(0.8, 0.8, 0, 0.0);
276 glClear(GL_COLOR_BUFFER_BIT);
277
278- glWindowPos2iARB(30, 30);
279+ glWindowPos2i(30, 30);
280 glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
281
282 free(buffer);
283diff --git a/src/trivial/clear-fbo.c b/src/trivial/clear-fbo.c
284index 10d830b..3fee3e3 100644
285--- a/src/trivial/clear-fbo.c
286+++ b/src/trivial/clear-fbo.c
287@@ -116,7 +116,7 @@ Draw(void)
288 glClearColor(0.8, 0.8, 0, 0.0);
289 glClear(GL_COLOR_BUFFER_BIT);
290
291- glWindowPos2iARB(30, 30);
292+ glWindowPos2i(30, 30);
293 glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
294
295 free(buffer);
296diff --git a/src/trivial/readpixels.c b/src/trivial/readpixels.c
297index ccce4ed..74e0546 100644
298--- a/src/trivial/readpixels.c
299+++ b/src/trivial/readpixels.c
300@@ -71,7 +71,7 @@ static void Draw(void)
301 printf("Pixel(0,0) = %f, %f, %f, %f\n",
302 image[0], image[1], image[2], image[3]);
303 /* draw to right half of window */
304- glWindowPos2iARB(Width, 0);
305+ glWindowPos2i(Width, 0);
306 glPixelZoom(Zoom, Zoom);
307 glDrawPixels(Width, Height, GL_RGBA, GL_FLOAT, image);
308 free(image);
309diff --git a/src/trivial/tri-fbo.c b/src/trivial/tri-fbo.c
310index d5800b2..dd1f21a 100644
311--- a/src/trivial/tri-fbo.c
312+++ b/src/trivial/tri-fbo.c
313@@ -119,7 +119,7 @@ static void Draw( void )
314 glClearColor(0.8, 0.8, 0, 0.0);
315 glClear(GL_COLOR_BUFFER_BIT);
316
317- glWindowPos2iARB(30, 30);
318+ glWindowPos2i(30, 30);
319 glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
320
321
322diff --git a/src/xdemos/glxsnoop.c b/src/xdemos/glxsnoop.c
323index 2215cfd..13d2b2d 100644
324--- a/src/xdemos/glxsnoop.c
325+++ b/src/xdemos/glxsnoop.c
326@@ -91,7 +91,7 @@ redraw(Display *dpy, Window srcWin, Window dstWin )
327 }
328
329 glXMakeCurrent(dpy, dstWin, Context);
330- glWindowPos2iARB(0, 0);
331+ glWindowPos2i(0, 0);
332 glDrawBuffer(GL_FRONT);
333 glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, image);
334 glFlush();
335diff --git a/src/xdemos/wincopy.c b/src/xdemos/wincopy.c
336index f670983..d010085 100644
337--- a/src/xdemos/wincopy.c
338+++ b/src/xdemos/wincopy.c
339@@ -156,11 +156,11 @@ Redraw(void)
340 glClear(GL_COLOR_BUFFER_BIT);
341
342 if (TestClipping) {
343- glWindowPos2iARB(-2, -2);
344+ glWindowPos2i(-2, -2);
345 glCopyPixels(-2, -2, Width[0] + 4, Height[0] + 4, GL_COLOR);
346 }
347 else {
348- glWindowPos2iARB(0, 0);
349+ glWindowPos2i(0, 0);
350 glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
351 }
352
353--
3541.8.1
355
diff --git a/recipes-graphics/mesa/mesa-demos_%.bbappend b/recipes-graphics/mesa/mesa-demos_%.bbappend
new file mode 100644
index 0000000..989577d
--- /dev/null
+++ b/recipes-graphics/mesa/mesa-demos_%.bbappend
@@ -0,0 +1,4 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI_append_mx6 = " file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch"
4
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 0000000..8e0a36b
--- /dev/null
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,10 @@
1PACKAGECONFIG_remove_mx5 = "egl gles"
2PROVIDES_remove_mx5 = "virtual/libgles1 virtual/libgles2 virtual/egl"
3
4PACKAGECONFIG_remove_mx6 = "egl gles"
5PROVIDES_remove_mx6 = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
6
7# FIXME: Dirty hack to allow use of Vivante GPU libGL binary
8do_install_append_mx6 () {
9 rm -f ${D}${libdir}/libGL.*
10}
diff --git a/recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend b/recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend
new file mode 100644
index 0000000..a95af53
--- /dev/null
+++ b/recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend
@@ -0,0 +1,3 @@
1# i.MX6 has DirectFB acceleration support, so add it
2RDEPENDS_${PN}_append_mx6 = " libvivante-dfb-mx6"
3PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
diff --git a/recipes-graphics/piglit/piglit_git.bbappend b/recipes-graphics/piglit/piglit_git.bbappend
new file mode 100644
index 0000000..f5e16b3
--- /dev/null
+++ b/recipes-graphics/piglit/piglit_git.bbappend
@@ -0,0 +1,5 @@
1# Provide the need flags and backend settings to work with Vivante GPU
2CFLAGS_append_mx6 = " -DLINUX \
3 ${@base_contains('DISTRO_FEATURES', 'x11', '-DEGL_API_FB', \
4 base_contains('DISTRO_FEATURES', 'wayland', \
5 '-DEGL_API_WL', '', d), d)}"
diff --git a/recipes-graphics/wayland/weston/0001-Add-support-for-Vivante-FBDEV-EGL.patch b/recipes-graphics/wayland/weston/0001-Add-support-for-Vivante-FBDEV-EGL.patch
new file mode 100644
index 0000000..6c8dfe9
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-Add-support-for-Vivante-FBDEV-EGL.patch
@@ -0,0 +1,69 @@
1From bc8f870072b134ffc9b8047a53835b7b6f714d5d Mon Sep 17 00:00:00 2001
2From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
3Date: Tue, 11 Mar 2014 17:35:52 -0500
4Subject: [PATCH] Add support for Vivante FBDEV EGL
5
6Upstream-Status: Pending
7
8Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
9---
10 src/compositor-fbdev.c | 20 +++++++++++++++++---
11 1 file changed, 17 insertions(+), 3 deletions(-)
12
13diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
14index 0d96269..ada0019 100644
15--- a/src/compositor-fbdev.c
16+++ b/src/compositor-fbdev.c
17@@ -53,6 +53,7 @@ struct fbdev_compositor {
18 struct udev_input input;
19 int use_pixman;
20 struct wl_listener session_listener;
21+ EGLNativeDisplayType display;
22 };
23
24 struct fbdev_screeninfo {
25@@ -87,6 +88,9 @@ struct fbdev_output {
26 pixman_image_t *shadow_surface;
27 void *shadow_buf;
28 uint8_t depth;
29+
30+ EGLNativeDisplayType display;
31+ EGLNativeWindowType window;
32 };
33
34 struct fbdev_parameters {
35@@ -626,9 +630,13 @@ fbdev_output_create(struct fbdev_compositor *compositor,
36 if (pixman_renderer_output_create(&output->base) < 0)
37 goto out_shadow_surface;
38 } else {
39- setenv("HYBRIS_EGLPLATFORM", "wayland", 1);
40+ output->window = fbCreateWindow(compositor->display, -1, -1, 0, 0);
41+ if (output->window == NULL) {
42+ fprintf(stderr, "failed to create window\n");
43+ return 0;
44+ }
45 if (gl_renderer->output_create(&output->base,
46- (EGLNativeWindowType)NULL) < 0) {
47+ (EGLNativeWindowType)output->window) < 0) {
48 weston_log("gl_renderer_output_create failed.\n");
49 goto out_shadow_surface;
50 }
51@@ -920,8 +928,14 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
52 weston_log("could not load gl renderer\n");
53 goto out_launcher;
54 }
55+
56+ compositor->display = fbGetDisplay(compositor->base.wl_display);
57+ if (compositor->display == NULL) {
58+ weston_log("fbGetDisplay failed.\n");
59+ goto out_launcher;
60+ }
61
62- if (gl_renderer->create(&compositor->base, EGL_DEFAULT_DISPLAY,
63+ if (gl_renderer->create(&compositor->base, compositor->display,
64 gl_renderer->opaque_attribs,
65 NULL) < 0) {
66 weston_log("gl_renderer_create failed.\n");
67--
681.8.1.2
69
diff --git a/recipes-graphics/wayland/weston/0002-weston-Add-Vivante-2D-compositor-support.patch b/recipes-graphics/wayland/weston/0002-weston-Add-Vivante-2D-compositor-support.patch
new file mode 100644
index 0000000..f60a208
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0002-weston-Add-Vivante-2D-compositor-support.patch
@@ -0,0 +1,1513 @@
1From c5fa88cb08477384430d2ab1123319c9d5dfb31c Mon Sep 17 00:00:00 2001
2From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
3Date: Mon, 24 Mar 2014 07:30:25 -0500
4Subject: [PATCH 2/2] weston : Add Vivante 2D compositor support
5
6Upstream-Status: Pending
7
8Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
9---
10 src/Makefile.am | 14 +
11 src/compositor-fbdev.c | 111 ++++-
12 src/gal2d-renderer.c | 1186 ++++++++++++++++++++++++++++++++++++++++++++++++
13 src/gal2d-renderer.h | 43 ++
14 4 files changed, 1340 insertions(+), 14 deletions(-)
15 create mode 100644 src/gal2d-renderer.c
16 create mode 100644 src/gal2d-renderer.h
17
18diff --git a/src/Makefile.am b/src/Makefile.am
19index 446639c..ef6abd6 100644
20--- a/src/Makefile.am
21+++ b/src/Makefile.am
22@@ -112,6 +112,7 @@ module_LTLIBRARIES = \
23 $(cms_static) \
24 $(cms_colord) \
25 $(gl_renderer) \
26+ $(gal2d_renderer) \
27 $(x11_backend) \
28 $(drm_backend) \
29 $(wayland_backend) \
30@@ -138,6 +139,19 @@ gl_renderer_la_SOURCES = \
31 gl-renderer.c \
32 vertex-clipping.c \
33 vertex-clipping.h
34+
35+gal2d_renderer = gal2d-renderer.la
36+gal2d_renderer_la_LDFLAGS = -module -avoid-version
37+gal2d_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS)
38+gal2d_renderer_la_CFLAGS = \
39+ $(COMPOSITOR_CFLAGS) \
40+ $(EGL_CFLAGS) \
41+ $(GCC_CFLAGS)
42+gal2d_renderer_la_SOURCES = \
43+ gal2d-renderer.h \
44+ gal2d-renderer.c \
45+ vertex-clipping.c \
46+ vertex-clipping.h
47 endif
48
49 if ENABLE_X11_COMPOSITOR
50diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
51index 72939b4..28f1fca 100644
52--- a/src/compositor-fbdev.c
53+++ b/src/compositor-fbdev.c
54@@ -44,6 +44,7 @@
55 #include "pixman-renderer.h"
56 #include "udev-seat.h"
57 #include "gl-renderer.h"
58+#include "gal2d-renderer.h"
59
60 struct fbdev_compositor {
61 struct weston_compositor base;
62@@ -52,6 +53,7 @@ struct fbdev_compositor {
63 struct udev *udev;
64 struct udev_input input;
65 int use_pixman;
66+ int use_gal2d;
67 struct wl_listener session_listener;
68 NativeDisplayType display;
69 };
70@@ -97,9 +99,11 @@ struct fbdev_parameters {
71 int tty;
72 char *device;
73 int use_gl;
74+ int use_gal2d;
75 };
76
77 struct gl_renderer_interface *gl_renderer;
78+struct gal2d_renderer_interface *gal2d_renderer;
79
80 static const char default_seat[] = "seat0";
81
82@@ -502,7 +506,7 @@ static void fbdev_output_disable(struct weston_output *base);
83
84 static int
85 fbdev_output_create(struct fbdev_compositor *compositor,
86- const char *device)
87+ int x, int y, const char *device)
88 {
89 struct fbdev_output *output;
90 pixman_transform_t transform;
91@@ -512,7 +516,8 @@ fbdev_output_create(struct fbdev_compositor *compositor,
92 unsigned int bytes_per_pixel;
93 struct wl_event_loop *loop;
94
95- weston_log("Creating fbdev output.\n");
96+
97+ weston_log("Creating fbdev output. %s x=%d y=%d\n", device, x, y);
98
99 output = calloc(1, sizeof *output);
100 if (!output)
101@@ -559,7 +564,7 @@ fbdev_output_create(struct fbdev_compositor *compositor,
102 output->base.model = output->fb_info.id;
103
104 weston_output_init(&output->base, &compositor->base,
105- 0, 0, output->fb_info.width_mm,
106+ x, y, output->fb_info.width_mm,
107 output->fb_info.height_mm,
108 WL_OUTPUT_TRANSFORM_NORMAL,
109 1);
110@@ -629,14 +634,40 @@ fbdev_output_create(struct fbdev_compositor *compositor,
111 if (compositor->use_pixman) {
112 if (pixman_renderer_output_create(&output->base) < 0)
113 goto out_shadow_surface;
114- } else {
115+ }
116+ else if(compositor->use_gal2d) {
117+
118+ char* fbenv = getenv("FB_FRAMEBUFFER_0");
119+ setenv("FB_FRAMEBUFFER_0", device, 1);
120+ output->display = fbGetDisplay(compositor->base.wl_display);
121+ if (output->display == NULL) {
122+ fprintf(stderr, "failed to get display\n");
123+ return 0;
124+ }
125+
126+ output->window = fbCreateWindow(output->display, -1, -1, 0, 0);
127+ if (output->window == NULL) {
128+ fprintf(stderr, "failed to create window\n");
129+ return 0;
130+ }
131+ setenv("FB_FRAMEBUFFER_0", fbenv, 1);
132+
133+ if (gal2d_renderer->output_create(&output->base,
134+ output->display,
135+ (NativeWindowType)output->window) < 0) {
136+ weston_log("gal_renderer_output_create failed.\n");
137+ goto out_shadow_surface;
138+ }
139+
140+ }
141+ else {
142 output->window = fbCreateWindow(compositor->display, -1, -1, 0, 0);
143 if (output->window == NULL) {
144 fprintf(stderr, "failed to create window\n");
145 return 0;
146 }
147 if (gl_renderer->output_create(&output->base,
148- (EGLNativeWindowType)output->window) < 0) {
149+ (NativeWindowType)output->window) < 0) {
150 weston_log("gl_renderer_output_create failed.\n");
151 goto out_shadow_surface;
152 }
153@@ -695,7 +726,11 @@ fbdev_output_destroy(struct weston_output *base)
154 free(output->shadow_buf);
155 output->shadow_buf = NULL;
156 }
157- } else {
158+ }
159+ else if (compositor->use_gal2d) {
160+ gal2d_renderer->output_destroy(base);
161+ }
162+ else {
163 gl_renderer->output_destroy(base);
164 }
165
166@@ -758,7 +793,7 @@ fbdev_output_reenable(struct fbdev_compositor *compositor,
167 * are re-initialised. */
168 device = output->device;
169 fbdev_output_destroy(base);
170- fbdev_output_create(compositor, device);
171+ fbdev_output_create(compositor, 0, 0, device);
172
173 return 0;
174 }
175@@ -911,7 +946,10 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
176 compositor->base.restore = fbdev_restore;
177
178 compositor->prev_state = WESTON_COMPOSITOR_ACTIVE;
179- compositor->use_pixman = !param->use_gl;
180+ compositor->use_gal2d = param->use_gal2d;
181+ weston_log("compositor->use_gal2d=%d\n", compositor->use_gal2d);
182+ if(param->use_gl == 0 && param->use_gal2d == 0)
183+ compositor->use_pixman = 1;
184
185 for (key = KEY_F1; key < KEY_F9; key++)
186 weston_compositor_add_key_binding(&compositor->base, key,
187@@ -921,7 +959,50 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
188 if (compositor->use_pixman) {
189 if (pixman_renderer_init(&compositor->base) < 0)
190 goto out_launcher;
191- } else {
192+ }
193+ else if (compositor->use_gal2d) {
194+ int x = 0, y = 0;
195+ int i=0;
196+ int count = 0;
197+ int k=0, dispCount = 0;
198+ char displays[5][32];
199+ gal2d_renderer = weston_load_module("gal2d-renderer.so",
200+ "gal2d_renderer_interface");
201+ if (!gal2d_renderer) {
202+ weston_log("could not load gal2d renderer\n");
203+ goto out_launcher;
204+ }
205+
206+ if (gal2d_renderer->create(&compositor->base) < 0) {
207+ weston_log("gal2d_renderer_create failed.\n");
208+ goto out_launcher;
209+ }
210+
211+ weston_log("param->device=%s\n",param->device);
212+ count = strlen(param->device);
213+
214+ for(i= 0; i < count; i++) {
215+ if(param->device[i] == ',') {
216+ displays[dispCount][k] = '\0';
217+ dispCount++;
218+ k = 0;
219+ continue;
220+ }
221+ displays[dispCount][k++] = param->device[i];
222+ }
223+ displays[dispCount][k] = '\0';
224+ dispCount++;
225+
226+ for(i=0; i<dispCount; i++)
227+ {
228+ if (fbdev_output_create(compositor, x, y, displays[i]) < 0)
229+ goto out_pixman;
230+ x += container_of(compositor->base.output_list.prev,
231+ struct weston_output,
232+ link)->width;
233+ }
234+ }
235+ else {
236 gl_renderer = weston_load_module("gl-renderer.so",
237 "gl_renderer_interface");
238 if (!gl_renderer) {
239@@ -942,9 +1023,9 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
240 goto out_launcher;
241 }
242 }
243-
244- if (fbdev_output_create(compositor, param->device) < 0)
245- goto out_pixman;
246+ if(!compositor->use_gal2d)
247+ if (fbdev_output_create(compositor, 0, 0, param->device) < 0)
248+ goto out_pixman;
249
250 udev_input_init(&compositor->input, &compositor->base, compositor->udev, seat_id);
251
252@@ -977,13 +1058,15 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
253 struct fbdev_parameters param = {
254 .tty = 0, /* default to current tty */
255 .device = "/dev/fb0", /* default frame buffer */
256- .use_gl = 0,
257+ .use_gl = 1,
258+ .use_gal2d = 0,
259 };
260
261 const struct weston_option fbdev_options[] = {
262 { WESTON_OPTION_INTEGER, "tty", 0, &param.tty },
263 { WESTON_OPTION_STRING, "device", 0, &param.device },
264- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &param.use_gl },
265+ { WESTON_OPTION_INTEGER, "use-gl", 0, &param.use_gl },
266+ { WESTON_OPTION_INTEGER, "use-gal2d", 0, &param.use_gal2d },
267 };
268
269 parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv);
270diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c
271new file mode 100644
272index 0000000..be7af3c
273--- /dev/null
274+++ b/src/gal2d-renderer.c
275@@ -0,0 +1,1186 @@
276+/*
277+ * Copyright (c) 2014 Freescale Semiconductor, Inc.
278+ * Copyright © 2012 Intel Corporation
279+ *
280+ * Permission to use, copy, modify, distribute, and sell this software and
281+ * its documentation for any purpose is hereby granted without fee, provided
282+ * that the above copyright notice appear in all copies and that both that
283+ * copyright notice and this permission notice appear in supporting
284+ * documentation, and that the name of the copyright holders not be used in
285+ * advertising or publicity pertaining to distribution of the software
286+ * without specific, written prior permission. The copyright holders make
287+ * no representations about the suitability of this software for any
288+ * purpose. It is provided "as is" without express or implied warranty.
289+ *
290+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
291+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
292+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
293+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
294+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
295+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
296+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
297+ */
298+
299+#define _GNU_SOURCE
300+
301+#include <stdlib.h>
302+#include <string.h>
303+#include <ctype.h>
304+#include <float.h>
305+#include <assert.h>
306+#include "compositor.h"
307+#include "gal2d-renderer.h"
308+#include "vertex-clipping.h"
309+#include "HAL/gc_hal.h"
310+#include "HAL/gc_hal_raster.h"
311+#include "HAL/gc_hal_eglplatform.h"
312+
313+#define galONERROR(x) if(status < 0) printf("Error in function %s\n", __func__);
314+
315+
316+struct gal2d_output_state {
317+
318+ int current_buffer;
319+ pixman_region32_t buffer_damage[2];
320+ EGLNativeDisplayType display;
321+ gcoSURF* renderSurf;
322+ gctUINT32 nNumBuffers;
323+ int activebuffer;
324+ gcoSURF offscreenSurface;
325+ gceSURF_FORMAT format;
326+ gcoSURF tempSurf;
327+};
328+
329+struct gal2d_surface_state {
330+ float color[4];
331+ struct weston_buffer_reference buffer_ref;
332+ int pitch; /* in pixels */
333+ pixman_region32_t texture_damage;
334+ gcoSURF gco_Surface;
335+
336+ struct weston_surface *surface;
337+ struct wl_listener surface_destroy_listener;
338+ struct wl_listener renderer_destroy_listener;
339+};
340+
341+struct gal2d_renderer {
342+ struct weston_renderer base;
343+ struct wl_signal destroy_signal;
344+ gcoOS gcos;
345+ gcoHAL gcoHal;
346+ gco2D gcoEngine2d;
347+ gctPOINTER localInfo;
348+};
349+
350+static int
351+gal2d_renderer_create_surface(struct weston_surface *surface);
352+
353+static inline struct gal2d_surface_state *
354+get_surface_state(struct weston_surface *surface)
355+{
356+ if (!surface->renderer_state)
357+ gal2d_renderer_create_surface(surface);
358+ return (struct gal2d_surface_state *)surface->renderer_state;
359+}
360+
361+static inline struct gal2d_renderer *
362+get_renderer(struct weston_compositor *ec)
363+{
364+ return (struct gal2d_renderer *)ec->renderer;
365+}
366+
367+
368+
369+#define max(a, b) (((a) > (b)) ? (a) : (b))
370+#define min(a, b) (((a) > (b)) ? (b) : (a))
371+/*
372+ * Compute the boundary vertices of the intersection of the global coordinate
373+ * aligned rectangle 'rect', and an arbitrary quadrilateral produced from
374+ * 'surf_rect' when transformed from surface coordinates into global coordinates.
375+ * The vertices are written to 'ex' and 'ey', and the return value is the
376+ * number of vertices. Vertices are produced in clockwise winding order.
377+ * Guarantees to produce either zero vertices, or 3-8 vertices with non-zero
378+ * polygon area.
379+ */
380+static int
381+calculate_edges(struct weston_view *ev, pixman_box32_t *rect,
382+ pixman_box32_t *surf_rect, float *ex, float *ey)
383+{
384+
385+ struct clip_context ctx;
386+ int i, n;
387+ float min_x, max_x, min_y, max_y;
388+ struct polygon8 surf = {
389+ { surf_rect->x1, surf_rect->x2, surf_rect->x2, surf_rect->x1 },
390+ { surf_rect->y1, surf_rect->y1, surf_rect->y2, surf_rect->y2 },
391+ 4
392+ };
393+
394+ ctx.clip.x1 = rect->x1;
395+ ctx.clip.y1 = rect->y1;
396+ ctx.clip.x2 = rect->x2;
397+ ctx.clip.y2 = rect->y2;
398+
399+ /* transform surface to screen space: */
400+ for (i = 0; i < surf.n; i++)
401+ weston_view_to_global_float(ev, surf.x[i], surf.y[i],
402+ &surf.x[i], &surf.y[i]);
403+
404+ /* find bounding box: */
405+ min_x = max_x = surf.x[0];
406+ min_y = max_y = surf.y[0];
407+
408+ for (i = 1; i < surf.n; i++) {
409+ min_x = min(min_x, surf.x[i]);
410+ max_x = max(max_x, surf.x[i]);
411+ min_y = min(min_y, surf.y[i]);
412+ max_y = max(max_y, surf.y[i]);
413+ }
414+
415+ /* First, simple bounding box check to discard early transformed
416+ * surface rects that do not intersect with the clip region:
417+ */
418+ if ((min_x >= ctx.clip.x2) || (max_x <= ctx.clip.x1) ||
419+ (min_y >= ctx.clip.y2) || (max_y <= ctx.clip.y1))
420+ return 0;
421+
422+ /* Simple case, bounding box edges are parallel to surface edges,
423+ * there will be only four edges. We just need to clip the surface
424+ * vertices to the clip rect bounds:
425+ */
426+ if (!ev->transform.enabled)
427+ return clip_simple(&ctx, &surf, ex, ey);
428+
429+ /* Transformed case: use a general polygon clipping algorithm to
430+ * clip the surface rectangle with each side of 'rect'.
431+ * The algorithm is Sutherland-Hodgman, as explained in
432+ * http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c8965/Polygon-Clipping.htm
433+ * but without looking at any of that code.
434+ */
435+ n = clip_transformed(&ctx, &surf, ex, ey);
436+
437+ if (n < 3)
438+ return 0;
439+
440+ return n;
441+}
442+
443+
444+static inline struct gal2d_output_state *
445+get_output_state(struct weston_output *output)
446+{
447+ return (struct gal2d_output_state *)output->renderer_state;
448+}
449+
450+static gctUINT32
451+galGetStretchFactor(gctINT32 SrcSize, gctINT32 DestSize)
452+{
453+ gctUINT stretchFactor;
454+ if ( (SrcSize > 0) && (DestSize > 1) )
455+ {
456+ stretchFactor = ((SrcSize - 1) << 16) / (DestSize - 1);
457+ }
458+ else
459+ {
460+ stretchFactor = 0;
461+ }
462+ return stretchFactor;
463+}
464+
465+static gceSTATUS
466+galGetStretchFactors(
467+ IN gcsRECT_PTR SrcRect,
468+ IN gcsRECT_PTR DestRect,
469+ OUT gctUINT32 * HorFactor,
470+ OUT gctUINT32 * VerFactor
471+ )
472+{
473+ if (HorFactor != gcvNULL)
474+ {
475+ gctINT32 src, dest;
476+
477+ /* Compute width of rectangles. */
478+ gcmVERIFY_OK(gcsRECT_Width(SrcRect, &src));
479+ gcmVERIFY_OK(gcsRECT_Width(DestRect, &dest));
480+
481+ /* Compute and return horizontal stretch factor. */
482+ *HorFactor = galGetStretchFactor(src, dest);
483+ }
484+
485+ if (VerFactor != gcvNULL)
486+ {
487+ gctINT32 src, dest;
488+
489+ /* Compute height of rectangles. */
490+ gcmVERIFY_OK(gcsRECT_Height(SrcRect, &src));
491+ gcmVERIFY_OK(gcsRECT_Height(DestRect, &dest));
492+
493+ /* Compute and return vertical stretch factor. */
494+ *VerFactor = galGetStretchFactor(src, dest);
495+ }
496+ /* Success. */
497+ return gcvSTATUS_OK;
498+}
499+
500+static gceSTATUS
501+gal2d_getSurfaceFormat(halDISPLAY_INFO info, gceSURF_FORMAT * Format)
502+{
503+ /* Get the color format. */
504+ switch (info.greenLength)
505+ {
506+ case 4:
507+ if (info.blueOffset == 0)
508+ {
509+ *Format = (info.alphaLength == 0) ? gcvSURF_X4R4G4B4 : gcvSURF_A4R4G4B4;
510+ }
511+ else
512+ {
513+ *Format = (info.alphaLength == 0) ? gcvSURF_X4B4G4R4 : gcvSURF_A4B4G4R4;
514+ }
515+ break;
516+
517+ case 5:
518+ if (info.blueOffset == 0)
519+ {
520+ *Format = (info.alphaLength == 0) ? gcvSURF_X1R5G5B5 : gcvSURF_A1R5G5B5;
521+ }
522+ else
523+ {
524+ *Format = (info.alphaLength == 0) ? gcvSURF_X1B5G5R5 : gcvSURF_A1B5G5R5;
525+ }
526+ break;
527+
528+ case 6:
529+ *Format = gcvSURF_R5G6B5;
530+ break;
531+
532+ case 8:
533+ if (info.blueOffset == 0)
534+ {
535+ *Format = (info.alphaLength == 0) ? gcvSURF_X8R8G8B8 : gcvSURF_A8R8G8B8;
536+ }
537+ else
538+ {
539+ *Format = (info.alphaLength == 0) ? gcvSURF_X8B8G8R8 : gcvSURF_A8B8G8R8;
540+ }
541+ break;
542+
543+ default:
544+ /* Unsupported color depth. */
545+ return gcvSTATUS_INVALID_ARGUMENT;
546+ }
547+ /* Success. */
548+ return gcvSTATUS_OK;
549+}
550+
551+static gceSTATUS galIsYUVFormat(IN gceSURF_FORMAT Format)
552+{
553+ switch (Format)
554+ {
555+ case gcvSURF_YUY2:
556+ case gcvSURF_UYVY:
557+ case gcvSURF_I420:
558+ case gcvSURF_YV12:
559+ case gcvSURF_NV16:
560+ case gcvSURF_NV12:
561+ case gcvSURF_NV61:
562+ case gcvSURF_NV21:
563+
564+ return gcvSTATUS_TRUE;
565+
566+ default:
567+ return gcvSTATUS_FALSE;
568+ }
569+}
570+
571+static gceSTATUS galQueryUVStride(
572+ IN gceSURF_FORMAT Format,
573+ IN gctUINT32 yStride,
574+ OUT gctUINT32_PTR uStride,
575+ OUT gctUINT32_PTR vStride
576+ )
577+{
578+ switch (Format)
579+ {
580+ case gcvSURF_YUY2:
581+ case gcvSURF_UYVY:
582+ *uStride = *vStride = 0;
583+ break;
584+
585+ case gcvSURF_I420:
586+ case gcvSURF_YV12:
587+ *uStride = *vStride = yStride / 2;
588+ break;
589+
590+ case gcvSURF_NV16:
591+ case gcvSURF_NV12:
592+ case gcvSURF_NV61:
593+ case gcvSURF_NV21:
594+
595+ *uStride = yStride;
596+ *vStride = 0;
597+ break;
598+
599+ default:
600+ return gcvSTATUS_NOT_SUPPORTED;
601+ }
602+
603+ return gcvSTATUS_OK;
604+}
605+
606+static int
607+make_current(struct gal2d_renderer *gr, gcoSURF surface)
608+{
609+ gceSTATUS status = gcvSTATUS_OK;
610+ gctUINT width = 0;
611+ gctUINT height = 0;
612+ gctINT stride = 0;
613+ gctUINT32 physical;
614+ gctPOINTER va =0;
615+
616+ if(!surface)
617+ goto OnError;
618+
619+
620+ gcmONERROR(gcoSURF_GetAlignedSize(surface, &width, &height, &stride));
621+
622+ gcmONERROR(gcoSURF_Lock(surface, &physical, (gctPOINTER *)&va));
623+
624+ gcmONERROR(gco2D_SetTargetEx(gr->gcoEngine2d, physical, stride,
625+ gcvSURF_0_DEGREE, width, height));
626+
627+ gcmONERROR(gcoSURF_Unlock(surface, (gctPOINTER *)&va));
628+
629+OnError:
630+ galONERROR(status);
631+ return status;
632+}
633+
634+static gceSTATUS
635+gal2d_clear(struct weston_output *base)
636+{
637+ struct gal2d_renderer *gr = get_renderer(base->compositor);
638+ struct gal2d_output_state *go = get_output_state(base);
639+ gceSTATUS status = gcvSTATUS_OK;
640+
641+ gctINT stride = 0;
642+ gctUINT width = 0, height = 0;
643+ gcsRECT dstRect = {0};
644+ gcmONERROR(gcoSURF_GetAlignedSize(go->renderSurf[go->activebuffer],
645+ &width, &height, &stride));
646+ dstRect.right = width;
647+ dstRect.bottom = height;
648+ gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
649+ gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
650+ gcmONERROR(gco2D_Clear(gr->gcoEngine2d, 1, &dstRect, 0xff0000ff, 0xCC, 0xCC, go->format));
651+
652+ gcmONERROR(gcoHAL_Commit(gr->gcoHal, gcvFALSE));
653+
654+OnError:
655+ galONERROR(status);
656+
657+ return status;
658+}
659+
660+static gcoSURF getSurfaceFromShm(struct weston_surface *es, struct weston_buffer *buffer)
661+{
662+ struct gal2d_renderer *gr = get_renderer(es->compositor);
663+
664+ gcoSURF surface = 0;
665+ gceSURF_FORMAT format;
666+ gcePOOL pool = gcvPOOL_DEFAULT;
667+
668+ if (wl_shm_buffer_get_format(buffer->shm_buffer) == WL_SHM_FORMAT_XRGB8888)
669+ format = gcvSURF_X8R8G8B8;
670+ else
671+ format = gcvSURF_A8R8G8B8;
672+
673+ if(buffer->width == ((buffer->width + 0x7) & ~0x7))
674+ {
675+ pool = gcvPOOL_USER;
676+ }
677+
678+ gcmVERIFY_OK(gcoSURF_Construct(gr->gcoHal,
679+ (gctUINT) buffer->width,
680+ (gctUINT) buffer->height,
681+ 1, gcvSURF_BITMAP,
682+ format, pool, &surface));
683+
684+ if(pool == gcvPOOL_USER)
685+ {
686+ gcmVERIFY_OK(gcoSURF_MapUserSurface(surface, 1,
687+ (gctPOINTER)wl_shm_buffer_get_data(buffer->shm_buffer), gcvINVALID_ADDRESS));
688+ }
689+
690+ return surface;
691+}
692+
693+static int
694+gal2dBindBuffer(struct weston_surface* es)
695+{
696+ struct gal2d_surface_state *gs = get_surface_state(es);
697+ gceSTATUS status = gcvSTATUS_OK;
698+ gcoSURF surface = gs->gco_Surface;
699+ struct weston_buffer *buffer = gs->buffer_ref.buffer;
700+ gcePOOL pool = gcvPOOL_DEFAULT;
701+ gctUINT64 node = 0;
702+ gctUINT bytes;
703+
704+ gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, &node,
705+ &pool, &bytes));
706+
707+ if(pool != gcvPOOL_USER)
708+ {
709+ gctUINT alignedWidth;
710+ gctPOINTER logical = (gctPOINTER)wl_shm_buffer_get_data(buffer->shm_buffer);
711+ gctPOINTER va =0;
712+
713+
714+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(surface, &alignedWidth, gcvNULL, gcvNULL));
715+ gcmVERIFY_OK(gcoSURF_Lock(surface, gcvNULL, (gctPOINTER *)&va));
716+
717+ if(alignedWidth == (unsigned int)buffer->width)
718+ {
719+ int size = wl_shm_buffer_get_stride(buffer->shm_buffer)*buffer->height;
720+ memcpy(va, logical, size);
721+ }
722+ else
723+ {
724+ int i, j;
725+ for (i = 0; i < buffer->height; i++)
726+ {
727+ for (j = 0; j < buffer->width; j++)
728+ {
729+ gctUINT dstOff = i * alignedWidth + j;
730+ gctUINT srcOff = (i * buffer->width + j);
731+
732+ memcpy(va + dstOff * 4, logical + srcOff * 4, 4);
733+ }
734+ }
735+ }
736+ gcmVERIFY_OK(gcoSURF_Unlock(surface, (gctPOINTER)va));
737+ }
738+
739+ return status;
740+}
741+
742+static void
743+gal2d_flip_surface(struct weston_output *output)
744+{
745+ struct gal2d_renderer *gr = get_renderer(output->compositor);
746+ struct gal2d_output_state *go = get_output_state(output);
747+
748+ if(go->nNumBuffers > 1)
749+ {
750+ gctUINT Offset;
751+ gctINT X;
752+ gctINT Y;
753+ gcmVERIFY_OK(gcoHAL_Commit(gr->gcoHal, gcvTRUE));
754+
755+ gcmVERIFY_OK(gcoOS_GetDisplayBackbuffer(go->display, gcvNULL,
756+ gcvNULL, gcvNULL, &Offset, &X, &Y));
757+
758+ gcmVERIFY_OK(gcoOS_SetDisplayVirtual(go->display, gcvNULL,
759+ Offset, X, Y));
760+
761+ go->activebuffer = (go->activebuffer+1) % go->nNumBuffers;
762+ }
763+}
764+
765+static int
766+update_surface(struct weston_output *output)
767+{
768+ struct gal2d_renderer *gr = get_renderer(output->compositor);
769+ struct gal2d_output_state *go = get_output_state(output);
770+ gceSTATUS status = gcvSTATUS_OK;
771+
772+ if(go->offscreenSurface && go->nNumBuffers == 1)
773+ {
774+ make_current(gr, go->renderSurf[go->activebuffer]);
775+
776+ gctUINT srcWidth = 0;
777+ gctUINT srcHeight = 0;
778+ gctINT srcStride = 0;
779+ gceSURF_FORMAT srcFormat;;
780+ gcsRECT dstRect = {0};
781+ gcoSURF srcSurface = go->offscreenSurface;
782+ gctUINT32 physical;
783+ gctPOINTER va =0;
784+
785+ gcmONERROR(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, &srcStride));
786+ gcmONERROR(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
787+ gcmONERROR(gcoSURF_Lock(srcSurface, &physical, (gctPOINTER *)&va));
788+ gcmONERROR(gco2D_SetColorSource(gr->gcoEngine2d, physical, srcStride, srcFormat,
789+ gcvFALSE, srcWidth, gcvFALSE, gcvSURF_OPAQUE, 0));
790+
791+ dstRect.left = 0;
792+ dstRect.top = 0;
793+ dstRect.right = srcWidth;
794+ dstRect.bottom = srcHeight;
795+
796+ gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
797+ gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
798+ gcmONERROR(gco2D_Blit(gr->gcoEngine2d, 1, &dstRect, 0xCC, 0xCC, go->format));
799+ gcmONERROR(gcoSURF_Unlock(srcSurface, (gctPOINTER *)&va));
800+ gcmONERROR(gcoHAL_Commit(gr->gcoHal, gcvFALSE));
801+ }
802+
803+ gal2d_flip_surface(output);
804+
805+OnError:
806+ galONERROR(status);
807+ return status;
808+ }
809+
810+static int
811+use_output(struct weston_output *output)
812+{
813+ struct gal2d_output_state *go = get_output_state(output);
814+ struct gal2d_renderer *gr = get_renderer(output->compositor);
815+ gceSTATUS status = gcvSTATUS_OK;
816+
817+ gcoSURF surface;
818+ surface = go->nNumBuffers > 1 ?
819+ go->renderSurf[go->activebuffer] :
820+ go->offscreenSurface; /*go->renderSurf[0];*/
821+ make_current(gr, surface);
822+ return status;
823+}
824+
825+static int
826+gal2d_renderer_read_pixels(struct weston_output *output,
827+ pixman_format_code_t format, void *pixels,
828+ uint32_t x, uint32_t y,
829+ uint32_t width, uint32_t height)
830+{
831+ return 0;
832+}
833+
834+static int gal2d_int_from_double(double d)
835+{
836+ return wl_fixed_to_int(wl_fixed_from_double(d));
837+}
838+
839+static void
840+repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2d_output_state *go, pixman_region32_t *region,
841+ pixman_region32_t *surf_region){
842+
843+ struct gal2d_renderer *gr = get_renderer(ev->surface->compositor);
844+ struct gal2d_surface_state *gs = get_surface_state(ev->surface);
845+
846+ pixman_box32_t *rects, *surf_rects, *bb_rects;
847+ int i, j, nrects, nsurf, nbb=0;
848+ gceSTATUS status = gcvSTATUS_OK;
849+ gcoSURF srcSurface = gs->gco_Surface;
850+ gcsRECT srcRect = {0};
851+ gcsRECT dstrect = {0};
852+ gctUINT32 horFactor, verFactor;
853+ int useStretch =1;
854+ int useFilterBlit = 0;
855+ gctUINT srcWidth = 0;
856+ gctUINT srcHeight = 0;
857+ gctUINT32 srcStride[3];
858+ gceSURF_FORMAT srcFormat;;
859+ gctUINT32 srcPhyAddr[3];
860+ gctUINT32 dstPhyAddr[3];
861+ gctUINT dstWidth = 0;
862+ gctUINT dstHeight = 0;
863+ gctUINT32 dstStrides[3];
864+ gcoSURF dstsurface;
865+ int geoWidth = ev->surface->width;
866+ int geoheight = ev->surface->height;
867+
868+ bb_rects = pixman_region32_rectangles(&ev->transform.boundingbox, &nbb);
869+
870+ if(!srcSurface || nbb <= 0)
871+ goto OnError;
872+ rects = pixman_region32_rectangles(region, &nrects);
873+ surf_rects = pixman_region32_rectangles(surf_region, &nsurf);
874+
875+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, (gctINT *)&srcStride[0]));
876+
877+ gcmVERIFY_OK(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
878+
879+ if(galIsYUVFormat(srcFormat) == gcvSTATUS_TRUE)
880+ {
881+ useFilterBlit = 1;
882+ }
883+
884+ gcmVERIFY_OK(gcoSURF_Lock(srcSurface, &srcPhyAddr[0], gcvNULL));
885+
886+ gcmVERIFY_OK(gcoSURF_Unlock(srcSurface, gcvNULL));
887+
888+ srcRect.left = ev->geometry.x < 0.0 ? gal2d_int_from_double(fabsf(ev->geometry.x)) : 0;
889+ srcRect.top = 0; /*es->geometry.y < 0.0 ? gal2d_int_from_double(fabsf(es->geometry.y)) : 0;*/
890+ srcRect.right = ev->surface->width;
891+ srcRect.bottom = ev->surface->height;
892+
893+ if(useFilterBlit)
894+ {
895+ dstsurface = go->nNumBuffers > 1 ?
896+ go->renderSurf[go->activebuffer] :
897+ go->offscreenSurface;
898+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(dstsurface, &dstWidth, &dstHeight, (gctINT *)&dstStrides));
899+ gcmVERIFY_OK(gcoSURF_Lock(dstsurface, &dstPhyAddr[0], gcvNULL));
900+ gcmVERIFY_OK(gcoSURF_Unlock(dstsurface, gcvNULL));
901+ }
902+ else
903+ {
904+ gcmVERIFY_OK(gco2D_SetColorSourceEx(gr->gcoEngine2d, srcPhyAddr[0], srcStride[0], srcFormat,
905+ gcvFALSE, srcWidth, srcHeight, gcvFALSE, gcvSURF_OPAQUE, 0));
906+ gcmVERIFY_OK(gco2D_SetSource(gr->gcoEngine2d, &srcRect));
907+ }
908+
909+ for (i = 0; i < nrects; i++)
910+ {
911+ pixman_box32_t *rect = &rects[i];
912+ gctFLOAT min_x, max_x, min_y, max_y;
913+
914+ dstrect.left = (bb_rects[0].x1 < 0) ? rect->x1 : bb_rects[0].x1;
915+ dstrect.top = (bb_rects[0].y1 < 0) ? rect->y1 : bb_rects[0].y1;
916+ dstrect.right = bb_rects[0].x2;
917+ dstrect.bottom = bb_rects[0].y2;
918+
919+ if(dstrect.right < 0 || dstrect.bottom < 0)
920+ {
921+ break;
922+ }
923+
924+ for (j = 0; j < nsurf; j++)
925+ {
926+ pixman_box32_t *surf_rect = &surf_rects[j];
927+ gctFLOAT ex[8], ey[8]; /* edge points in screen space */
928+ int n;
929+ gcsRECT clipRect = {0};
930+ int m=0;
931+ n = calculate_edges(ev, rect, surf_rect, ex, ey);
932+ if (n < 3)
933+ continue;
934+
935+ min_x = max_x = ex[0];
936+ min_y = max_y = ey[0];
937+ for (m = 1; m < n; m++)
938+ {
939+ min_x = min(min_x, ex[m]);
940+ max_x = max(max_x, ex[m]);
941+ min_y = min(min_y, ey[m]);
942+ max_y = max(max_y, ey[m]);
943+ }
944+
945+ clipRect.left = gal2d_int_from_double(min_x);
946+ clipRect.top = gal2d_int_from_double(min_y);
947+ clipRect.right = gal2d_int_from_double(max_x);
948+ clipRect.bottom = gal2d_int_from_double(max_y);
949+
950+ if(output->x > 0)
951+ {
952+ dstrect.left = dstrect.left - output->x;
953+ dstrect.right = dstrect.right - output->x;
954+ clipRect.left = clipRect.left - output->x;
955+ clipRect.right = clipRect.right - output->x;
956+ }
957+
958+ dstrect.left = (dstrect.left < 0) ? 0 : dstrect.left;
959+
960+ status = gco2D_SetClipping(gr->gcoEngine2d, &clipRect);
961+ if(status < 0)
962+ {
963+ weston_log("Error in gco2D_SetClipping %s\n", __func__);
964+ goto OnError;
965+ }
966+
967+ if(useFilterBlit)
968+ {
969+ gctINT srcStrideNum;
970+ gctINT srcAddressNum;
971+ gcmVERIFY_OK(galQueryUVStride(srcFormat, srcStride[0],
972+ &srcStride[1], &srcStride[2]));
973+
974+ switch (srcFormat)
975+ {
976+ case gcvSURF_YUY2:
977+ case gcvSURF_UYVY:
978+ srcStrideNum = srcAddressNum = 1;
979+ break;
980+
981+ case gcvSURF_I420:
982+ case gcvSURF_YV12:
983+ srcStrideNum = srcAddressNum = 3;
984+ break;
985+
986+ case gcvSURF_NV16:
987+ case gcvSURF_NV12:
988+ case gcvSURF_NV61:
989+ case gcvSURF_NV21:
990+ srcStrideNum = srcAddressNum = 2;
991+ break;
992+
993+ default:
994+ gcmONERROR(gcvSTATUS_NOT_SUPPORTED);
995+ }
996+ gco2D_FilterBlitEx2(gr->gcoEngine2d,
997+ srcPhyAddr, srcAddressNum,
998+ srcStride, srcStrideNum,
999+ gcvLINEAR, srcFormat, gcvSURF_0_DEGREE,
1000+ geoWidth, geoheight, &srcRect,
1001+ dstPhyAddr, 1,
1002+ dstStrides, 1,
1003+ gcvLINEAR, go->format, gcvSURF_0_DEGREE,
1004+ dstWidth, dstHeight,
1005+ &dstrect, gcvNULL);
1006+ }
1007+ else
1008+ {
1009+ if(useStretch)
1010+ gcmVERIFY_OK(galGetStretchFactors(&srcRect, &dstrect, &horFactor, &verFactor));
1011+
1012+ if(verFactor == 65536 && horFactor == 65536)
1013+ {
1014+ gcmVERIFY_OK(gco2D_Blit(gr->gcoEngine2d, 1, &dstrect,
1015+ 0xCC, 0xCC, go->format));
1016+ }
1017+ else
1018+ {
1019+ /* Program the stretch factors. */
1020+ gcmVERIFY_OK(gco2D_SetStretchFactors(gr->gcoEngine2d, horFactor, verFactor));
1021+
1022+ gcmVERIFY_OK(gco2D_StretchBlit(gr->gcoEngine2d, 1, &dstrect,
1023+ 0xCC, 0xCC, go->format));
1024+ }
1025+ }
1026+ if(status < 0)
1027+ {
1028+ printf("cr l=%d r=%d t=%d b=%d w=%d h=%d\n",
1029+ clipRect.left, clipRect.right, clipRect.top ,clipRect.bottom,
1030+ clipRect.right - clipRect.left, clipRect.bottom -clipRect.top);
1031+ printf("dr l=%d r=%d t=%d b=%d w=%d h=%d\n",
1032+ dstrect.left, dstrect.right, dstrect.top ,dstrect.bottom,
1033+ dstrect.right - dstrect.left, dstrect.bottom -dstrect.top);
1034+ printf("horFactor=%d, verFactor=%d\n",horFactor, verFactor);
1035+
1036+ goto OnError;
1037+ }
1038+ }
1039+ status = (gcoHAL_Commit(gr->gcoHal, gcvFALSE));
1040+ if(status < 0)
1041+ {
1042+ printf("Error in gcoHAL_Commit %s\n", __func__);
1043+ goto OnError;
1044+ }
1045+ }
1046+
1047+OnError:
1048+ galONERROR(status);
1049+}
1050+
1051+static void
1052+draw_view(struct weston_view *ev, struct weston_output *output,
1053+ pixman_region32_t *damage) /* in global coordinates */
1054+{
1055+ struct weston_compositor *ec = ev->surface->compositor;
1056+ struct gal2d_output_state *go = get_output_state(output);
1057+ /* repaint bounding region in global coordinates: */
1058+ pixman_region32_t repaint;
1059+ /* non-opaque region in surface coordinates: */
1060+ pixman_region32_t surface_blend;
1061+ pixman_region32_t *buffer_damage;
1062+
1063+ pixman_region32_init(&repaint);
1064+ pixman_region32_intersect(&repaint,
1065+ &ev->transform.boundingbox, damage);
1066+ pixman_region32_subtract(&repaint, &repaint, &ev->clip);
1067+
1068+ if (!pixman_region32_not_empty(&repaint))
1069+ goto out;
1070+
1071+ buffer_damage = &go->buffer_damage[go->current_buffer];
1072+ pixman_region32_subtract(buffer_damage, buffer_damage, &repaint);
1073+
1074+ /* blended region is whole surface minus opaque region: */
1075+ pixman_region32_init_rect(&surface_blend, 0, 0,
1076+ ev->surface->width, ev->surface->height);
1077+ pixman_region32_subtract(&surface_blend, &surface_blend, &ev->surface->opaque);
1078+
1079+ if (pixman_region32_not_empty(&ev->surface->opaque)) {
1080+
1081+ repaint_region(ev, output, go, &repaint, &ev->surface->opaque);
1082+ }
1083+
1084+ if (pixman_region32_not_empty(&surface_blend)) {
1085+ struct gal2d_renderer *gr = get_renderer(ec);
1086+
1087+ gco2D_EnableAlphaBlend(gr->gcoEngine2d,
1088+ ev->alpha * 0xFF, ev->alpha * 0xFF,
1089+ gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT,
1090+ gcvSURF_GLOBAL_ALPHA_OFF, gcvSURF_GLOBAL_ALPHA_OFF,
1091+ gcvSURF_BLEND_ONE, gcvSURF_BLEND_INVERSED,
1092+ gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT);
1093+
1094+ repaint_region(ev, output, go, &repaint, &surface_blend);
1095+ }
1096+
1097+ pixman_region32_fini(&surface_blend);
1098+
1099+out:
1100+ pixman_region32_fini(&repaint);
1101+
1102+}
1103+
1104+static void
1105+repaint_views(struct weston_output *output, pixman_region32_t *damage)
1106+{
1107+ struct weston_compositor *compositor = output->compositor;
1108+ struct weston_view *view;
1109+
1110+ wl_list_for_each_reverse(view, &compositor->view_list, link)
1111+ if (view->plane == &compositor->primary_plane)
1112+ draw_view(view, output, damage);
1113+}
1114+
1115+static void
1116+gal2d_renderer_repaint_output(struct weston_output *output,
1117+ pixman_region32_t *output_damage)
1118+{
1119+ struct gal2d_output_state *go = get_output_state(output);
1120+ gctUINT32 i;
1121+
1122+ if (use_output(output) < 0)
1123+ return;
1124+
1125+ for (i = 0; i < 2; i++)
1126+ pixman_region32_union(&go->buffer_damage[i],
1127+ &go->buffer_damage[i],
1128+ output_damage);
1129+
1130+ pixman_region32_union(output_damage, output_damage,
1131+ &go->buffer_damage[go->current_buffer]);
1132+
1133+ repaint_views(output, output_damage);
1134+
1135+ pixman_region32_copy(&output->previous_damage, output_damage);
1136+ wl_signal_emit(&output->frame_signal, output);
1137+
1138+ update_surface(output);
1139+
1140+ go->current_buffer ^= 1;
1141+}
1142+
1143+static void
1144+gal2d_renderer_flush_damage(struct weston_surface *surface)
1145+{
1146+ struct gal2d_surface_state *gs = get_surface_state(surface);
1147+ struct weston_buffer *buffer = gs->buffer_ref.buffer;
1148+ struct weston_view *view;
1149+ int texture_used;
1150+ pixman_region32_union(&gs->texture_damage,
1151+ &gs->texture_damage, &surface->damage);
1152+
1153+ if (!buffer)
1154+ return;
1155+
1156+ texture_used = 0;
1157+ wl_list_for_each(view, &surface->views, surface_link) {
1158+ if (view->plane == &surface->compositor->primary_plane) {
1159+ texture_used = 1;
1160+ break;
1161+ }
1162+ }
1163+ if (!texture_used)
1164+ return;
1165+
1166+ if (!pixman_region32_not_empty(&gs->texture_damage))
1167+ goto done;
1168+
1169+ if(wl_shm_buffer_get(buffer->resource))
1170+ {
1171+ if(gs->gco_Surface==NULL)
1172+ {
1173+ gs->gco_Surface = getSurfaceFromShm(surface, buffer);
1174+ }
1175+ gal2dBindBuffer(surface);
1176+ }
1177+ else
1178+ {
1179+ gcsWL_VIV_BUFFER *vivBuffer = (gcsWL_VIV_BUFFER *)buffer;
1180+ gs->gco_Surface = vivBuffer->surface;
1181+ }
1182+
1183+done:
1184+ pixman_region32_fini(&gs->texture_damage);
1185+ pixman_region32_init(&gs->texture_damage);
1186+
1187+ weston_buffer_reference(&gs->buffer_ref, NULL);
1188+}
1189+
1190+static void
1191+gal2d_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
1192+{
1193+ struct gal2d_surface_state *gs = get_surface_state(es);
1194+ struct wl_shm_buffer *shm_buffer;
1195+ weston_buffer_reference(&gs->buffer_ref, buffer);
1196+
1197+ if(buffer==NULL)
1198+ return;
1199+
1200+ shm_buffer = wl_shm_buffer_get(buffer->resource);
1201+
1202+ if(shm_buffer)
1203+ {
1204+ buffer->width = wl_shm_buffer_get_width(shm_buffer);
1205+ buffer->height = wl_shm_buffer_get_height(shm_buffer);
1206+ buffer->shm_buffer = shm_buffer;
1207+
1208+ if(gs->gco_Surface)
1209+ {
1210+ gcoSURF_Destroy(gs->gco_Surface);
1211+ gs->gco_Surface = getSurfaceFromShm(es, buffer);
1212+ }
1213+ }
1214+ else
1215+ {
1216+ gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource);
1217+ gs->gco_Surface = vivBuffer->surface;
1218+
1219+ buffer->width = vivBuffer->width;
1220+ buffer->height = vivBuffer->height;
1221+ }
1222+}
1223+
1224+static void
1225+surface_state_destroy(struct gal2d_surface_state *gs, struct gal2d_renderer *gr)
1226+{
1227+ wl_list_remove(&gs->surface_destroy_listener.link);
1228+ wl_list_remove(&gs->renderer_destroy_listener.link);
1229+ if(gs->surface)
1230+ gs->surface->renderer_state = NULL;
1231+
1232+ free(gs);
1233+}
1234+
1235+static void
1236+surface_state_handle_surface_destroy(struct wl_listener *listener, void *data)
1237+{
1238+ struct gal2d_surface_state *gs;
1239+ struct gal2d_renderer *gr;
1240+
1241+ gs = container_of(listener, struct gal2d_surface_state,
1242+ surface_destroy_listener);
1243+
1244+ gr = get_renderer(gs->surface->compositor);
1245+ surface_state_destroy(gs, gr);
1246+}
1247+
1248+static void
1249+surface_state_handle_renderer_destroy(struct wl_listener *listener, void *data)
1250+{
1251+ struct gal2d_surface_state *gs;
1252+ struct gal2d_renderer *gr;
1253+
1254+ gr = data;
1255+
1256+ gs = container_of(listener, struct gal2d_surface_state,
1257+ renderer_destroy_listener);
1258+
1259+ surface_state_destroy(gs, gr);
1260+}
1261+
1262+
1263+static int
1264+gal2d_renderer_create_surface(struct weston_surface *surface)
1265+{
1266+ struct gal2d_surface_state *gs;
1267+ struct gal2d_renderer *gr = get_renderer(surface->compositor);
1268+
1269+ gs = calloc(1, sizeof *gs);
1270+ if (!gs)
1271+ return -1;
1272+
1273+ /* A buffer is never attached to solid color surfaces, yet
1274+ * they still go through texcoord computations. Do not divide
1275+ * by zero there.
1276+ */
1277+ gs->pitch = 1;
1278+
1279+ gs->surface = surface;
1280+
1281+ pixman_region32_init(&gs->texture_damage);
1282+ surface->renderer_state = gs;
1283+
1284+ gs->surface_destroy_listener.notify =
1285+ surface_state_handle_surface_destroy;
1286+ wl_signal_add(&surface->destroy_signal,
1287+ &gs->surface_destroy_listener);
1288+
1289+ gs->renderer_destroy_listener.notify =
1290+ surface_state_handle_renderer_destroy;
1291+ wl_signal_add(&gr->destroy_signal,
1292+ &gs->renderer_destroy_listener);
1293+
1294+ if (surface->buffer_ref.buffer) {
1295+ gal2d_renderer_attach(surface, surface->buffer_ref.buffer);
1296+ gal2d_renderer_flush_damage(surface);
1297+ }
1298+
1299+ return 0;
1300+}
1301+
1302+static void
1303+gal2d_renderer_surface_set_color(struct weston_surface *surface,
1304+ float red, float green, float blue, float alpha)
1305+{
1306+ struct gal2d_surface_state *gs = get_surface_state(surface);
1307+
1308+ gs->color[0] = red;
1309+ gs->color[1] = green;
1310+ gs->color[2] = blue;
1311+ gs->color[3] = alpha;
1312+}
1313+
1314+
1315+static void
1316+gal2d_renderer_output_destroy(struct weston_output *output)
1317+{
1318+ struct gal2d_output_state *go = get_output_state(output);
1319+ gctUINT32 i;
1320+
1321+ if(go->nNumBuffers <= 1 )
1322+ {
1323+ if(go->offscreenSurface)
1324+ gcmVERIFY_OK(gcoSURF_Destroy(go->offscreenSurface));
1325+ }
1326+
1327+ for(i=0; i < go->nNumBuffers; i++)
1328+ {
1329+ gcmVERIFY_OK(gcoSURF_Destroy(go->renderSurf[i]));
1330+ }
1331+
1332+ free(go->renderSurf);
1333+ go->renderSurf = gcvNULL;
1334+
1335+ free(go);
1336+}
1337+
1338+static void
1339+gal2d_renderer_destroy(struct weston_compositor *ec)
1340+{
1341+ struct gal2d_renderer *gr = get_renderer(ec);
1342+
1343+ wl_signal_emit(&gr->destroy_signal, gr);
1344+ free(ec->renderer);
1345+ ec->renderer = NULL;
1346+}
1347+
1348+
1349+static int
1350+gal2d_renderer_create(struct weston_compositor *ec)
1351+{
1352+ struct gal2d_renderer *gr;
1353+ gceSTATUS status = gcvSTATUS_OK;
1354+ gr = malloc(sizeof *gr);
1355+ if (gr == NULL)
1356+ return -1;
1357+
1358+ gr->base.read_pixels = gal2d_renderer_read_pixels;
1359+ gr->base.repaint_output = gal2d_renderer_repaint_output;
1360+ gr->base.flush_damage = gal2d_renderer_flush_damage;
1361+ gr->base.attach = gal2d_renderer_attach;
1362+ gr->base.surface_set_color = gal2d_renderer_surface_set_color;
1363+ gr->base.destroy = gal2d_renderer_destroy;
1364+
1365+ /* Construct the gcoOS object. */
1366+ gcmONERROR(gcoOS_Construct(gcvNULL, &gr->gcos));
1367+
1368+ /* Construct the gcoHAL object. */
1369+ gcmONERROR(gcoHAL_Construct(gcvNULL, gr->gcos, &gr->gcoHal));
1370+ gcmONERROR(gcoHAL_Get2DEngine(gr->gcoHal, &gr->gcoEngine2d));
1371+ gcmONERROR(gcoHAL_SetHardwareType(gr->gcoHal, gcvHARDWARE_2D));
1372+
1373+ ec->renderer = &gr->base;
1374+ wl_signal_init(&gr->destroy_signal);
1375+OnError:
1376+ galONERROR(status);
1377+
1378+ /* Return the status. */
1379+ return status;
1380+
1381+}
1382+
1383+static int
1384+gal2d_renderer_output_create(struct weston_output *output, EGLNativeDisplayType display,
1385+ EGLNativeWindowType window)
1386+
1387+ {
1388+ struct gal2d_renderer *gr = get_renderer(output->compositor);
1389+ struct gal2d_output_state *go = calloc(1, sizeof *go);
1390+ halDISPLAY_INFO info;
1391+ gctUINT32 backOffset = 0;
1392+ gctINT width, height;
1393+ gceSTATUS status = gcvSTATUS_OK;
1394+ gctUINT32 i;
1395+
1396+ if (!go)
1397+ return -1;
1398+
1399+ output->renderer_state = go;
1400+ go->display = display;
1401+ gcmONERROR(gcoOS_InitLocalDisplayInfo(go->display, &gr->localInfo));
1402+
1403+ /* Get display information. */
1404+ gcmONERROR(gcoOS_GetDisplayInfoEx2(
1405+ go->display, gcvNULL, gr->localInfo,
1406+ sizeof(info), &info));
1407+ go->nNumBuffers = info.multiBuffer;
1408+
1409+ weston_log("Number of buffers=%d\n",go->nNumBuffers);
1410+
1411+ gcmONERROR(gal2d_getSurfaceFormat(info, &go->format));
1412+ backOffset = (gctUINT32)(info.stride * info.height );
1413+
1414+ go->activebuffer = 0;
1415+
1416+ go->renderSurf = malloc(sizeof(gcoSURF) * go->nNumBuffers);
1417+ gcoOS_GetDisplayVirtual(go->display, &width, &height);
1418+ for(i=0; i < go->nNumBuffers; i++)
1419+ {
1420+
1421+ gcmONERROR(gcoSURF_Construct(gr->gcoHal, info.width, info.height, 1,
1422+ gcvSURF_BITMAP, go->format, gcvPOOL_USER, &go->renderSurf[i]));
1423+
1424+ gcoSURF_MapUserSurface(go->renderSurf[i], 0,info.logical + (i * backOffset),
1425+ info.physical + (i * backOffset));
1426+
1427+ //Clear surfaces
1428+ make_current(gr, go->renderSurf[go->activebuffer]);
1429+ gal2d_clear(output);
1430+ gal2d_flip_surface(output);
1431+ }
1432+ if(go->nNumBuffers <= 1)
1433+ go->activebuffer = 0;
1434+ else
1435+ go->activebuffer = 1;
1436+
1437+ if(go->nNumBuffers <= 1 )
1438+ {
1439+ gcmVERIFY_OK(gcoSURF_Construct(gr->gcoHal,
1440+ (gctUINT) info.width,
1441+ (gctUINT) info.height,
1442+ 1,
1443+ gcvSURF_BITMAP,
1444+ go->format,
1445+ gcvPOOL_DEFAULT,
1446+ &go->offscreenSurface));
1447+ make_current(gr, go->offscreenSurface);
1448+ gal2d_clear(output);
1449+ gal2d_flip_surface(output);
1450+ }
1451+OnError:
1452+ galONERROR(status);
1453+ /* Return the status. */
1454+ return status;
1455+ }
1456+
1457+ WL_EXPORT struct gal2d_renderer_interface gal2d_renderer_interface = {
1458+ .create = gal2d_renderer_create,
1459+ .output_create = gal2d_renderer_output_create,
1460+ .output_destroy = gal2d_renderer_output_destroy,
1461+};
1462diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h
1463new file mode 100644
1464index 0000000..ebffec1
1465--- /dev/null
1466+++ b/src/gal2d-renderer.h
1467@@ -0,0 +1,43 @@
1468+/*
1469+ * Copyright (c) 2014 Freescale Semiconductor, Inc.
1470+ * Copyright © 2013 Vasily Khoruzhick <anarsoul@gmail.com>
1471+ *
1472+ * Permission to use, copy, modify, distribute, and sell this software and
1473+ * its documentation for any purpose is hereby granted without fee, provided
1474+ * that the above copyright notice appear in all copies and that both that
1475+ * copyright notice and this permission notice appear in supporting
1476+ * documentation, and that the name of the copyright holders not be used in
1477+ * advertising or publicity pertaining to distribution of the software
1478+ * without specific, written prior permission. The copyright holders make
1479+ * no representations about the suitability of this software for any
1480+ * purpose. It is provided "as is" without express or implied warranty.
1481+ *
1482+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
1483+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1484+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
1485+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
1486+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
1487+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1488+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1489+ */
1490+#ifndef __gal_2d_renderer_h_
1491+#define __gal_2d_renderer_h_
1492+
1493+#include "compositor.h"
1494+#include <EGL/egl.h>
1495+
1496+
1497+struct gal2d_renderer_interface {
1498+
1499+ int (*create)(struct weston_compositor *ec);
1500+
1501+ int (*output_create)(struct weston_output *output,
1502+ NativeDisplayType display,
1503+ NativeWindowType window);
1504+
1505+ void (*output_destroy)(struct weston_output *output);
1506+};
1507+
1508+struct gal2d_renderer_interface gal2d_renderer_interface;
1509+
1510+#endif
1511--
15121.9.0
1513
diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 0000000..0576b37
--- /dev/null
+++ b/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1,21 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI += "file://0001-Add-support-for-Vivante-FBDEV-EGL.patch \
4 file://0002-weston-Add-Vivante-2D-compositor-support.patch "
5
6PACKAGECONFIG_mx6 = "fbdev egl cairo-glesv2"
7
8EXTRA_OECONF_append_mx6 = " \
9 --disable-libunwind \
10 --disable-xwayland-test \
11 WESTON_NATIVE_BACKEND=fbdev-backend.so \
12"
13
14EXTRA_OEMAKE_append_mx6 = " \
15 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
16 COMPOSITOR_CFLAGS="-I ${STAGING_INCDIR}/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
17 FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
18 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
19 SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
20 CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
21"
diff --git a/recipes-graphics/xinput-calibrator/pointercal-xinput/imx28evk/pointercal.xinput b/recipes-graphics/xinput-calibrator/pointercal-xinput/imx28evk/pointercal.xinput
new file mode 100644
index 0000000..59f7630
--- /dev/null
+++ b/recipes-graphics/xinput-calibrator/pointercal-xinput/imx28evk/pointercal.xinput
@@ -0,0 +1,2 @@
1xinput set-int-prop "MXS touchscreen" "Evdev Axis Calibration" 32 194 3938 301 3878
2xinput set-int-prop "MXS touchscreen" "Evdev Axes Swap" 8 1
diff --git a/recipes-graphics/xinput-calibrator/pointercal-xinput/mx6/pointercal.xinput b/recipes-graphics/xinput-calibrator/pointercal-xinput/mx6/pointercal.xinput
new file mode 100644
index 0000000..bd140ff
--- /dev/null
+++ b/recipes-graphics/xinput-calibrator/pointercal-xinput/mx6/pointercal.xinput
@@ -0,0 +1,2 @@
1xinput set-int-prop "eGalax Touch Screen" "Evdev Axis Calibration" 42060 2062 -8 -783544 1 1549 65536
2xinput set-int-prop "eGalax Touch Screen" "Evdev Axes Swap" 8 0
diff --git a/recipes-graphics/xinput-calibrator/pointercal-xinput_%.bbappend b/recipes-graphics/xinput-calibrator/pointercal-xinput_%.bbappend
new file mode 100644
index 0000000..a9c60f3
--- /dev/null
+++ b/recipes-graphics/xinput-calibrator/pointercal-xinput_%.bbappend
@@ -0,0 +1,2 @@
1# Append path for freescale layer to include bsp pointercal.xinput
2FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.17-1.0.0.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.17-1.0.0.bb
new file mode 100644
index 0000000..67d8863
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.17-1.0.0.bb
@@ -0,0 +1,62 @@
1# Copyright (C) 2012-2014 Freescale Semiconductor
2# Copyright (C) 2012-2014 O.S. Systems Software LTDA.
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5require recipes-graphics/xorg-driver/xorg-driver-video.inc
6
7PE = "3"
8
9inherit autotools-brokensep
10
11DEPENDS += "virtual/xserver virtual/libx11 virtual/libgal-x11 gpu-viv-bin-mx6q pixman"
12
13LIC_FILES_CHKSUM = "file://EXA/src/vivante_fbdev/vivante.h;endline=19;md5=641ac6e6d013833e36290797f4d7089c"
14
15SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz"
16
17SRC_URI[md5sum] = "697d9a3fb244eb95eae4207bf2d9c321"
18SRC_URI[sha256sum] = "9178c6b721e55645bedf6d2cfaf836f5c6e2684673215358a6b6845c10a7a085"
19
20EXTRA_OEMAKE += "-C EXA/src -f makefile.linux prefix=${D}/usr \
21 sysroot=${STAGING_DIR_TARGET} \
22 BUSID_HAS_NUMBER=1 \
23 BUILD_IN_YOCTO=1 \
24 XSERVER_GREATER_THAN_13=1"
25
26CFLAGS += "-I${STAGING_INCDIR}/xorg \
27 -I${STAGING_INCDIR}/drm \
28 -I../../DRI_1.10.4/src"
29
30S = "${WORKDIR}/xserver-xorg-video-imx-viv-${PV}/"
31
32# FIXME: The Freescale provided Makefile has hardcodec include paths
33# and this does not work in case prefix is different than /usr,
34# sed it.
35do_configure_prepend () {
36 sed -i 's,$(sysroot)/usr/include,${STAGING_INCDIR},g' \
37 ${S}EXA/src/makefile.linux
38}
39
40# FIXME: This is need as Freescale didn't use standard Makefile filename
41# thus oe_runmame thinks nothing is need to be done, use ln to
42# workaround it.
43base_do_compile () {
44 oe_runmake || die "make failed"
45}
46
47do_install_append () {
48 install -d ${D}${includedir}
49 cp -axr ${S}/EXA/src/vivante_gal/vivante_priv.h ${D}${includedir}
50 cp -axr ${S}/EXA/src/vivante_gal/vivante_gal.h ${D}${includedir}
51 find ${D}${includedir} -type f -exec chmod 660 {} \;
52}
53
54RDEPENDS_${PN} += "libvivante-dri-mx6 \
55 xserver-xorg-module-exa \
56 mesa-driver-swrast \
57 xserver-xorg-extension-dri \
58 xserver-xorg-extension-dri2 \
59 xserver-xorg-extension-glx"
60
61PACKAGE_ARCH = "${MACHINE_SOCARCH}"
62COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch
new file mode 100644
index 0000000..6a2fcdf
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/Fix-error-unknown-type-name-uint.patch
@@ -0,0 +1,33 @@
1From ccdfce5e75ba707deacdd5808a8f3de8744848d0 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
3Date: Tue, 5 Feb 2013 10:57:47 +0100
4Subject: [PATCH] Fix "error: unknown type name 'uint'"
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9In file included from imx_driver.c:33:0:
10.../sysroots/imx53qsb/usr/src/kernel/include/linux/mxcfb.h:107:2: error: unknown type name 'uint'
11
12Upstream-Status: Pending
13
14Signed-off-by: Eric Bénard <eric@eukrea.com>
15---
16 src/imx_driver.c | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/src/imx_driver.c b/src/imx_driver.c
20index f4b3e38..4cf662d 100644
21--- a/src/imx_driver.c
22+++ b/src/imx_driver.c
23@@ -29,6 +29,7 @@
24 #include <errno.h>
25 #include <fcntl.h>
26 #include <string.h>
27+#include <sys/types.h>
28 #include <linux/fb.h>
29 #include <linux/mxcfb.h>
30
31--
321.7.10.4
33
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch
new file mode 100644
index 0000000..2ac6311
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/Make-video-API-forward-and-backward-compatible.patch
@@ -0,0 +1,787 @@
1From 5216cb0f14414b5451f58df48a36c1c62c035276 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Sat, 29 Dec 2012 18:02:11 -0200
4Subject: [PATCH] Make video API forward and backward compatible
5
6This updates the video API in a forward and backward compatible way
7using the "compat-api.h" as used in Xorg maintained drivers.
8
9Upstream-Status: Pending
10
11Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
12---
13 src/compat-api.h | 106 +++++++++++++++++++++++++++++++++++++++++++++++
14 src/imx_display.c | 22 +++++-----
15 src/imx_display.h | 8 ++--
16 src/imx_driver.c | 60 ++++++++++++++-------------
17 src/imx_exa_offscreen.c | 12 +++---
18 src/imx_exa_z160.c | 53 ++++++++++++------------
19 src/imx_xv_ipu.c | 4 +-
20 7 files changed, 188 insertions(+), 77 deletions(-)
21 create mode 100644 src/compat-api.h
22
23diff --git a/src/compat-api.h b/src/compat-api.h
24new file mode 100644
25index 0000000..73ac8a2
26--- /dev/null
27+++ b/src/compat-api.h
28@@ -0,0 +1,106 @@
29+/*
30+ * Copyright 2012 Red Hat, Inc.
31+ *
32+ * Permission is hereby granted, free of charge, to any person obtaining a
33+ * copy of this software and associated documentation files (the "Software"),
34+ * to deal in the Software without restriction, including without limitation
35+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
36+ * and/or sell copies of the Software, and to permit persons to whom the
37+ * Software is furnished to do so, subject to the following conditions:
38+ *
39+ * The above copyright notice and this permission notice (including the next
40+ * paragraph) shall be included in all copies or substantial portions of the
41+ * Software.
42+ *
43+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
46+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
48+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
49+ * DEALINGS IN THE SOFTWARE.
50+ *
51+ * Author: Dave Airlie <airlied@redhat.com>
52+ */
53+
54+/* this file provides API compat between server post 1.13 and pre it,
55+ it should be reused inside as many drivers as possible */
56+#ifndef COMPAT_API_H
57+#define COMPAT_API_H
58+
59+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
60+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
61+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
62+#endif
63+
64+#ifndef XF86_HAS_SCRN_CONV
65+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
66+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
67+#endif
68+
69+#ifndef XF86_SCRN_INTERFACE
70+
71+#define SCRN_ARG_TYPE int
72+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
73+
74+#define SCREEN_ARG_TYPE int
75+#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
76+
77+#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
78+
79+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
80+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
81+
82+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
83+#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
84+#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
85+
86+#define FBDEVHWADJUSTFRAME_ARGS(x, y) scrnIndex, (x), (y), 0
87+
88+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
89+
90+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
91+
92+#define FREE_SCREEN_ARGS_DECL int arg, int flags
93+#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
94+
95+#define VT_FUNC_ARGS_DECL int arg, int flags
96+#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
97+
98+#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn->scrnIndex, b
99+
100+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
101+#else
102+#define SCRN_ARG_TYPE ScrnInfoPtr
103+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
104+
105+#define SCREEN_ARG_TYPE ScreenPtr
106+#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
107+
108+#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
109+
110+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
111+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
112+
113+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
114+#define CLOSE_SCREEN_ARGS pScreen
115+#define CLOSE_SCREEN_DECL_ScrnInfoPtr ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
116+
117+#define FBDEVHWADJUSTFRAME_ARGS(x, y) pScrn, (x), (y)
118+
119+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
120+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
121+
122+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
123+#define FREE_SCREEN_ARGS(x) (x)
124+
125+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
126+#define VT_FUNC_ARGS(flags) pScrn
127+
128+#define ENABLE_DISABLE_FB_ACCESS_ARGS(pScrn, b) pScrn, b
129+
130+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
131+
132+#endif
133+
134+#endif
135diff --git a/src/imx_display.c b/src/imx_display.c
136index fcb8195..e2dc36a 100644
137--- a/src/imx_display.c
138+++ b/src/imx_display.c
139@@ -42,6 +42,8 @@
140 #include "imx.h"
141 #include "imx_display.h"
142
143+#include "compat-api.h"
144+
145 #include <X11/Xatom.h>
146
147 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,6,0,0)
148@@ -1373,19 +1375,19 @@ imxDisplayPreInit(ScrnInfoPtr pScrn)
149 Bool
150 imxDisplayStartScreenInit(int scrnIndex, ScreenPtr pScreen)
151 {
152- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
153+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
154 ImxPtr fPtr = IMXPTR(pScrn);
155
156 if (!xf86SetDesiredModes(pScrn)) {
157
158- xf86DrvMsg(scrnIndex, X_ERROR, "mode initialization failed\n");
159+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mode initialization failed\n");
160 return FALSE;
161 }
162
163 #if 0
164 if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {
165
166- xf86DrvMsg(scrnIndex, X_ERROR, "mode initialization failed\n");
167+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "mode initialization failed\n");
168 return FALSE;
169 }
170 pScrn->displayWidth =
171@@ -1463,29 +1465,29 @@ imxDisplayFinishScreenInit(int scrnIndex, ScreenPtr pScreen)
172 /* -------------------------------------------------------------------- */
173
174 Bool
175-imxDisplaySwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
176+imxDisplaySwitchMode(SWITCH_MODE_ARGS_DECL)
177 {
178- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
179+ SCRN_INFO_PTR(arg);
180
181 return xf86SetSingleMode(pScrn, mode, RR_Rotate_0);
182 }
183
184 void
185-imxDisplayAdjustFrame(int scrnIndex, int x, int y, int flags)
186+imxDisplayAdjustFrame(ADJUST_FRAME_ARGS_DECL)
187 {
188-// fbdevHWAdjustFrame(scrnIndex, x, y, flags);
189+// fbdevHWAdjustFrame(pScrn->scrnIndex, x, y, flags);
190 }
191
192 Bool
193-imxDisplayEnterVT(int scrnIndex, int flags)
194+imxDisplayEnterVT(VT_FUNC_ARGS_DECL)
195 {
196- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
197+ SCRN_INFO_PTR(arg);
198
199 return xf86SetDesiredModes(pScrn);
200 }
201
202 void
203-imxDisplayLeaveVT(int scrnIndex, int flags)
204+imxDisplayLeaveVT(VT_FUNC_ARGS_DECL)
205 {
206 }
207
208diff --git a/src/imx_display.h b/src/imx_display.h
209index 4a5d5aa..3a3d43a 100644
210--- a/src/imx_display.h
211+++ b/src/imx_display.h
212@@ -59,16 +59,16 @@ imxDisplayValidMode(int scrnIndex, DisplayModePtr mode,
213 Bool verbose, int flags);
214
215 extern Bool
216-imxDisplaySwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
217+imxDisplaySwitchMode(SWITCH_MODE_ARGS_DECL);
218
219 extern void
220-imxDisplayAdjustFrame(int scrnIndex, int x, int y, int flags);
221+imxDisplayAdjustFrame(ADJUST_FRAME_ARGS_DECL);
222
223 extern Bool
224-imxDisplayEnterVT(int scrnIndex, int flags);
225+imxDisplayEnterVT(VT_FUNC_ARGS_DECL);
226
227 extern void
228-imxDisplayLeaveVT(int scrnIndex, int flags);
229+imxDisplayLeaveVT(VT_FUNC_ARGS_DECL);
230
231 extern Bool
232 imxDisplayChangeFrameBufferRotateEPDC(int scrnIndex, int fbRotate);
233diff --git a/src/imx_driver.c b/src/imx_driver.c
234index 178e36e..f4b3e38 100644
235--- a/src/imx_driver.c
236+++ b/src/imx_driver.c
237@@ -46,6 +46,8 @@
238 #include "fb.h"
239 #include "fbdevhw.h"
240
241+#include "compat-api.h"
242+
243 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
244 #include "xf86Resources.h"
245 #include "xf86RAC.h"
246@@ -435,17 +437,17 @@ errorPreInit:
247 }
248
249 static void
250-imxFreeScreen(int scrnIndex, int flags)
251+imxFreeScreen(FREE_SCREEN_ARGS_DECL)
252 {
253- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
254+ SCRN_INFO_PTR(arg);
255
256 imxFreeRec(pScrn);
257 }
258
259 static Bool
260-imxCloseScreen(int scrnIndex, ScreenPtr pScreen)
261+imxCloseScreen(CLOSE_SCREEN_ARGS_DECL)
262 {
263- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
264+ CLOSE_SCREEN_DECL_ScrnInfoPtr;
265 ImxPtr fPtr = IMXPTR(pScrn);
266
267 fbdevHWRestore(pScrn);
268@@ -453,7 +455,7 @@ imxCloseScreen(int scrnIndex, ScreenPtr pScreen)
269 pScrn->vtSema = FALSE;
270
271 pScreen->CloseScreen = fPtr->saveCloseScreen;
272- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
273+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
274 }
275
276 static int
277@@ -488,9 +490,9 @@ LCM(a, b)
278 }
279
280 static Bool
281-imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
282+imxScreenInit(SCREEN_INIT_ARGS_DECL)
283 {
284- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
285+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
286 ImxPtr fPtr = IMXPTR(pScrn);
287 VisualPtr visual;
288 int init_picture = 0;
289@@ -514,7 +516,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
290 /* Map frame buffer memory */
291 fPtr->fbMemoryBase = fbdevHWMapVidmem(pScrn);
292 if (NULL == fPtr->fbMemoryBase) {
293- xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"
294+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"
295 " failed\n");
296 return FALSE;
297 }
298@@ -558,7 +560,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
299 const int fbOffsetScreen2 =
300 IMX_ALIGN(fbMaxScreenSize, fbMaxAlignOffset);
301 fPtr->fbMemoryScreenReserve = fbMaxScreenSize;
302- xf86DrvMsg(scrnIndex, X_INFO,
303+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
304 "reserve %d bytes of frame buffer for screen\n",
305 fPtr->fbMemoryScreenReserve);
306 fPtr->fbMemoryStart2 = NULL;
307@@ -568,12 +570,12 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
308
309 fPtr->fbMemoryScreenReserve += fbOffsetScreen2;
310
311- xf86DrvMsg(scrnIndex, X_INFO,
312+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
313 "reserve same number of bytes for XRandR rotated screen at offset %d\n",
314 fbOffsetScreen2);
315 }
316
317- if (!imxDisplayStartScreenInit(scrnIndex, pScreen)) {
318+ if (!imxDisplayStartScreenInit(pScrn->scrnIndex, pScreen)) {
319
320 return FALSE;
321 }
322@@ -582,7 +584,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
323 miClearVisualTypes();
324 if (pScrn->bitsPerPixel > 8) {
325 if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {
326- xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
327+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
328 " for %d bits per pixel [1]\n",
329 pScrn->bitsPerPixel);
330 return FALSE;
331@@ -591,14 +593,14 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
332 if (!miSetVisualTypes(pScrn->depth,
333 miGetDefaultVisualMask(pScrn->depth),
334 pScrn->rgbBits, pScrn->defaultVisual)) {
335- xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"
336+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"
337 " for %d bits per pixel [2]\n",
338 pScrn->bitsPerPixel);
339 return FALSE;
340 }
341 }
342 if (!miSetPixmapDepths()) {
343- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
344+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
345 return FALSE;
346 }
347
348@@ -607,10 +609,10 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
349 has a padding which is independent from the depth (controlfb) */
350 pScrn->displayWidth = fbdevHWGetLineLength(pScrn) /
351 (pScrn->bitsPerPixel / 8);
352- xf86DrvMsg(scrnIndex, X_INFO, "displayWidth = %d\n", pScrn->displayWidth);
353+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "displayWidth = %d\n", pScrn->displayWidth);
354
355 if (pScrn->displayWidth != pScrn->virtualX) {
356- xf86DrvMsg(scrnIndex, X_INFO,
357+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
358 "Pitch updated to %d after ModeInit\n",
359 pScrn->displayWidth);
360 }
361@@ -633,7 +635,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
362 init_picture = 1;
363 break;
364 default:
365- xf86DrvMsg(scrnIndex, X_ERROR,
366+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
367 "internal error: invalid number of bits per"
368 " pixel (%d) encountered in"
369 " imxScreenInit()\n", pScrn->bitsPerPixel);
370@@ -644,7 +646,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
371 case FBDEVHW_INTERLEAVED_PLANES:
372 /* This should never happen ...
373 * we should check for this much much earlier ... */
374- xf86DrvMsg(scrnIndex, X_ERROR,
375+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
376 "internal error: interleaved planes are not yet "
377 "supported by the imx driver\n");
378 ret = FALSE;
379@@ -652,20 +654,20 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
380 case FBDEVHW_TEXT:
381 /* This should never happen ...
382 * we should check for this much much earlier ... */
383- xf86DrvMsg(scrnIndex, X_ERROR,
384+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
385 "internal error: text mode is not supported by the "
386 "imx driver\n");
387 ret = FALSE;
388 break;
389 case FBDEVHW_VGA_PLANES:
390 /* Not supported yet */
391- xf86DrvMsg(scrnIndex, X_ERROR,
392+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
393 "internal error: EGA/VGA Planes are not yet "
394 "supported by the imx driver\n");
395 ret = FALSE;
396 break;
397 default:
398- xf86DrvMsg(scrnIndex, X_ERROR,
399+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
400 "internal error: unrecognised hardware type (%d) "
401 "encountered in imxScreenInit()\n", type);
402 ret = FALSE;
403@@ -699,7 +701,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
404 /* INIT ACCELERATION BEFORE INIT FOR BACKING STORE & SOFTWARE CURSOR */
405 if (fPtr->useAccel) {
406
407- if (!imxExaZ160Setup(scrnIndex, pScreen)) {
408+ if (!imxExaZ160Setup(pScrn->scrnIndex, pScreen)) {
409
410 fPtr->useAccel = FALSE;
411 }
412@@ -731,29 +733,29 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
413 /* XXX It would be simpler to use miCreateDefColormap() in all cases. */
414 case FBDEVHW_PACKED_PIXELS:
415 if (!miCreateDefColormap(pScreen)) {
416- xf86DrvMsg(scrnIndex, X_ERROR,
417+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
418 "internal error: miCreateDefColormap failed "
419 "in imxScreenInit()\n");
420 return FALSE;
421 }
422 break;
423 case FBDEVHW_INTERLEAVED_PLANES:
424- xf86DrvMsg(scrnIndex, X_ERROR,
425+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
426 "internal error: interleaved planes are not yet "
427 "supported by the imx driver\n");
428 return FALSE;
429 case FBDEVHW_TEXT:
430- xf86DrvMsg(scrnIndex, X_ERROR,
431+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
432 "internal error: text mode is not supported by "
433 "the imx driver\n");
434 return FALSE;
435 case FBDEVHW_VGA_PLANES:
436- xf86DrvMsg(scrnIndex, X_ERROR,
437+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
438 "internal error: EGA/VGA planes are not yet "
439 "supported by the imx driver\n");
440 return FALSE;
441 default:
442- xf86DrvMsg(scrnIndex, X_ERROR,
443+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
444 "internal error: unrecognised imx hardware type "
445 "(%d) encountered in imxScreenInit()\n", type);
446 return FALSE;
447@@ -782,7 +784,7 @@ imxScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
448 }
449 #endif
450
451- if (!imxDisplayFinishScreenInit(scrnIndex, pScreen)) {
452+ if (!imxDisplayFinishScreenInit(pScrn->scrnIndex, pScreen)) {
453 return FALSE;
454 }
455
456@@ -810,7 +812,7 @@ IMXGetPixmapProperties(
457 }
458
459 /* Access screen associated with this pixmap. */
460- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
461+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
462
463 /* Check if the screen associated with this pixmap has IMX driver. */
464 if (0 != strcmp(IMX_DRIVER_NAME, pScrn->driverName)) {
465diff --git a/src/imx_exa_offscreen.c b/src/imx_exa_offscreen.c
466index 3a5c24d..0fbe2fc 100644
467--- a/src/imx_exa_offscreen.c
468+++ b/src/imx_exa_offscreen.c
469@@ -79,7 +79,7 @@ static void
470 imxExaOffscreenValidate (ScreenPtr pScreen)
471 {
472 /* Access the driver specific data. */
473- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
474+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
475 ImxPtr imxPtr = IMXPTR(pScrn);
476 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
477 ExaOffscreenArea *prev = 0, *area;
478@@ -135,7 +135,7 @@ imxExaOffscreenMerge (ImxExaPtr imxExaPtr, ExaOffscreenArea *area)
479 ExaOffscreenArea *
480 imxExaOffscreenFree (ScreenPtr pScreen, ExaOffscreenArea *area)
481 {
482- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
483+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
484 ImxPtr imxPtr = IMXPTR(pScrn);
485 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
486 ExaOffscreenArea *next = area->next;
487@@ -281,7 +281,7 @@ imxExaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
488 pointer privData)
489 {
490 ExaOffscreenArea *area;
491- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
492+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
493 ImxPtr imxPtr = IMXPTR(pScrn);
494 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
495 int real_size = 0, largest_avail = 0;
496@@ -418,7 +418,7 @@ imxExaOffscreenSwapIn (ScreenPtr pScreen)
497 Bool
498 imxExaOffscreenInit (ScreenPtr pScreen)
499 {
500- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
501+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
502 ImxPtr imxPtr = IMXPTR(pScrn);
503 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
504 ExaOffscreenArea *area;
505@@ -453,7 +453,7 @@ imxExaOffscreenInit (ScreenPtr pScreen)
506 void
507 imxExaOffscreenFini (ScreenPtr pScreen)
508 {
509- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
510+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
511 ImxPtr imxPtr = IMXPTR(pScrn);
512 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
513 ExaOffscreenArea *area;
514@@ -472,7 +472,7 @@ imxExaOffscreenFini (ScreenPtr pScreen)
515 void
516 imxExaOffscreenSwapOut (ScreenPtr pScreen)
517 {
518- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
519+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
520 ImxPtr imxPtr = IMXPTR(pScrn);
521 ImxExaPtr imxExaPtr = IMXEXAPTR(imxPtr);
522
523diff --git a/src/imx_exa_z160.c b/src/imx_exa_z160.c
524index fb718e0..3d0bc96 100644
525--- a/src/imx_exa_z160.c
526+++ b/src/imx_exa_z160.c
527@@ -32,6 +32,7 @@
528 #include <errno.h>
529 #include <fcntl.h>
530
531+#include "compat-api.h"
532
533 /* Set if handles pixmap allocation and migration, i.e, EXA_HANDLES_PIXMAPS */
534 #define IMX_EXA_ENABLE_HANDLES_PIXMAPS \
535@@ -299,7 +300,7 @@ imxExaZ160GetPixmapAddress(PixmapPtr pPixmap)
536 return fPixmapPtr->ptr;
537 #else
538 /* Access screen associated with this pixmap. */
539- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
540+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
541
542 /* Access driver specific data */
543 ImxPtr imxPtr = IMXPTR(pScrn);
544@@ -344,7 +345,7 @@ imxExaZ160GetPixmapProperties(
545 #else
546
547 /* Access screen associated with this pixmap. */
548- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
549+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
550
551 /* Make sure pixmap is in framebuffer */
552 if (!exaDrawableIsOffscreen(&(pPixmap->drawable))) {
553@@ -856,7 +857,7 @@ imxExaZ160SyncIfBusyPixmap(PixmapPtr pPixmap)
554 {
555 /* Access screen associated with this pixmap. */
556 ScreenPtr pScreen = pPixmap->drawable.pScreen;
557- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
558+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
559
560 /* Access driver specific data for screen. */
561 ImxPtr imxPtr = IMXPTR(pScrn);
562@@ -924,7 +925,7 @@ imxExaZ160CreatePixmap2(ScreenPtr pScreen, int width, int height,
563 }
564
565 /* Access the driver specific data. */
566- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
567+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
568 ImxPtr imxPtr = IMXPTR(pScrn);
569 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
570
571@@ -1028,7 +1029,7 @@ imxExaZ160DestroyPixmap(ScreenPtr pScreen, void *driverPriv)
572 ImxExaPixmapPtr fPixmapPtr = (ImxExaPixmapPtr)driverPriv;
573
574 /* Access the driver specific data. */
575- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
576+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
577 ImxPtr imxPtr = IMXPTR(pScrn);
578 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
579
580@@ -1068,7 +1069,7 @@ imxExaZ160ModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
581 }
582
583 /* Access screen associated with this pixmap */
584- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
585+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
586
587 /* Access driver specific data */
588 ImxPtr imxPtr = IMXPTR(pScrn);
589@@ -1194,7 +1195,7 @@ imxExaZ160TrackBusyPixmap(ImxExaZ160Ptr fPtr, PixmapPtr pPixmap)
590 static void
591 imxExaZ160WaitMarker(ScreenPtr pScreen, int marker)
592 {
593- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
594+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
595
596 /* Access driver specific data associated with the screen. */
597 ImxPtr imxPtr = IMXPTR(pScrn);
598@@ -1249,7 +1250,7 @@ imxExaZ160PrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
599 }
600
601 /* Access screen associated with this pixmap */
602- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
603+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
604
605 /* Access driver specific data */
606 ImxPtr imxPtr = IMXPTR(pScrn);
607@@ -1352,7 +1353,7 @@ static void
608 imxExaZ160Solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
609 {
610 /* Access screen associated with this pixmap */
611- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
612+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
613
614 /* Access driver specific data */
615 ImxPtr imxPtr = IMXPTR(pScrn);
616@@ -1423,7 +1424,7 @@ static void
617 imxExaZ160DoneSolid(PixmapPtr pPixmap)
618 {
619 /* Access screen associated with this pixmap */
620- ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
621+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
622
623 /* Access driver specific data */
624 ImxPtr imxPtr = IMXPTR(pScrn);
625@@ -1485,7 +1486,7 @@ imxExaZ160PrepareCopy(
626 }
627
628 /* Access the screen associated with this pixmap. */
629- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
630+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
631
632 /* Access driver specific data */
633 ImxPtr imxPtr = IMXPTR(pScrn);
634@@ -1599,7 +1600,7 @@ static void
635 imxExaZ160Copy(PixmapPtr pPixmapDst, int srcX, int srcY, int dstX, int dstY, int width, int height)
636 {
637 /* Access screen associated with dst pixmap */
638- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
639+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
640
641 /* Access driver specific data */
642 ImxPtr imxPtr = IMXPTR(pScrn);
643@@ -1661,7 +1662,7 @@ static void
644 imxExaZ160DoneCopy(PixmapPtr pPixmapDst)
645 {
646 /* Access screen associated with this pixmap */
647- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
648+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
649
650 /* Access driver specific data */
651 ImxPtr imxPtr = IMXPTR(pScrn);
652@@ -1770,7 +1771,7 @@ imxExaZ160CheckComposite(int op, PicturePtr pPictureSrc, PicturePtr pPictureMask
653 }
654
655 /* Access screen associated with dst pixmap (same screen as for src pixmap). */
656- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
657+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
658
659 /* Check the number of entities, and fail if it isn't one. */
660 if (pScrn->numEntities != 1) {
661@@ -1987,7 +1988,7 @@ imxExaZ160PrepareComposite(
662 {
663 /* Access screen associated with dst pixmap. */
664 /* Should be same screen as for src pixmap. */
665- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
666+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
667
668 /* NOTE - many preconditions already verified in CheckComposite. */
669
670@@ -2196,7 +2197,7 @@ imxExaZ160Composite(
671 int height)
672 {
673 /* Access screen associated with dst pixmap */
674- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
675+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
676
677 /* Access driver specific data */
678 ImxPtr imxPtr = IMXPTR(pScrn);
679@@ -2275,7 +2276,7 @@ static void
680 imxExaZ160DoneComposite(PixmapPtr pPixmapDst)
681 {
682 /* Access screen associated with this pixmap */
683- ScrnInfoPtr pScrn = xf86Screens[pPixmapDst->drawable.pScreen->myNum];
684+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmapDst->drawable.pScreen);
685
686 /* Access driver specific data */
687 ImxPtr imxPtr = IMXPTR(pScrn);
688@@ -2323,7 +2324,7 @@ imxExaZ160UploadToScreen(
689
690 /* Access screen associated with this pixmap */
691 ScreenPtr pScreen = pPixmapDst->drawable.pScreen;
692- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
693+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
694
695 /* Access driver specific data */
696 ImxPtr imxPtr = IMXPTR(pScrn);
697@@ -2381,7 +2382,7 @@ imxExaZ160DownloadFromScreen(
698
699 /* Access screen associated with this pixmap */
700 ScreenPtr pScreen = pPixmapSrc->drawable.pScreen;
701- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
702+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
703
704 /* Access driver specific data */
705 ImxPtr imxPtr = IMXPTR(pScrn);
706@@ -2412,9 +2413,9 @@ imxExaZ160DownloadFromScreen(
707 }
708
709 Bool
710-imxExaZ160CloseScreen(int scrnIndex, ScreenPtr pScreen)
711+imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS_DECL)
712 {
713- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
714+ CLOSE_SCREEN_DECL_ScrnInfoPtr;
715 ImxPtr imxPtr = IMXPTR(pScrn);
716
717 ImxExaZ160Ptr fPtr = IMXEXAZ160PTR(imxPtr);
718@@ -2504,7 +2505,7 @@ imxExaZ160CloseScreen(int scrnIndex, ScreenPtr pScreen)
719 /* Install our CloseScreen function so that it gets called. */
720 if (NULL != pScreen->CloseScreen) {
721
722- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
723+ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
724 }
725
726 return TRUE;
727@@ -2514,7 +2515,7 @@ Bool
728 imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
729 {
730 /* Access the screen info and then private data structures. */
731- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
732+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
733 ImxPtr imxPtr = IMXPTR(pScrn);
734
735 /* Private data structure must not already be in use. */
736@@ -2582,7 +2583,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
737
738 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
739 "Initialize Z160 interfaces failed.\n");
740- imxExaZ160CloseScreen(scrnIndex, pScreen);
741+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
742 return FALSE;
743 }
744
745@@ -2592,7 +2593,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
746
747 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
748 "Allocate EXA driver structure.\n");
749- imxExaZ160CloseScreen(scrnIndex, pScreen);
750+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
751 return FALSE;
752 }
753
754@@ -2657,7 +2658,7 @@ imxExaZ160Setup(int scrnIndex, ScreenPtr pScreen)
755 if (!exaDriverInit(pScreen, exaDriverPtr)) {
756
757 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "EXA initialization failed.\n");
758- imxExaZ160CloseScreen(scrnIndex, pScreen);
759+ imxExaZ160CloseScreen(CLOSE_SCREEN_ARGS);
760 return FALSE;
761 }
762 fPtr->imxExaRec.exaDriverPtr = exaDriverPtr;
763diff --git a/src/imx_xv_ipu.c b/src/imx_xv_ipu.c
764index a517742..fc8a827 100644
765--- a/src/imx_xv_ipu.c
766+++ b/src/imx_xv_ipu.c
767@@ -398,7 +398,7 @@ xf86XVFillKeyHelper1 (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
768 xRectangle *rects;
769 GCPtr gc;
770
771- if(!xf86Screens[pScreen->myNum]->vtSema) return;
772+ if(!xf86ScreenToScrn(pScreen)->vtSema) return;
773
774 gc = GetScratchGC(root->depth, pScreen);
775 pval[0] = key;
776@@ -771,7 +771,7 @@ MXXVInitializeAdaptor
777 XF86VideoAdaptorPtr **pppAdaptor
778 )
779 {
780- ScreenPtr pScreen = screenInfo.screens[pScreenInfo->scrnIndex];
781+ ScreenPtr pScreen = xf86ScrnToScreen(pScreenInfo);
782 XF86VideoAdaptorPtr *ppAdaptor = NULL;
783 IMXPtr fPtr = IMXPTR(pScreenInfo);
784 int nAdaptor;
785--
7861.7.10.4
787
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch
new file mode 100644
index 0000000..05be6b3
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/ext-Update-to-newer-swap-macros.patch
@@ -0,0 +1,65 @@
1From fc7f191a1a0f290a4e808dd8f9bd58ba1dbd2be4 Mon Sep 17 00:00:00 2001
2From: Otavio Salvador <otavio@ossystems.com.br>
3Date: Sat, 29 Dec 2012 18:00:36 -0200
4Subject: [PATCH 1/2] ext: Update to newer swap macros
5
6The swap macros now use an internal temporary variable so we need to
7adapt the code according.
8
9Upstream-Status: Pending
10
11Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
12---
13 src/imx_ext.c | 16 ++++++----------
14 1 file changed, 6 insertions(+), 10 deletions(-)
15
16diff --git a/src/imx_ext.c b/src/imx_ext.c
17index f12469a..710cba4 100644
18--- a/src/imx_ext.c
19+++ b/src/imx_ext.c
20@@ -57,8 +57,6 @@ void imxExtInit()
21 static int
22 Proc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
23 {
24- int n;
25-
26 REQUEST(xIMX_EXT_GetPixmapPhysAddrReq);
27 REQUEST_SIZE_MATCH(xIMX_EXT_GetPixmapPhysAddrReq);
28
29@@ -96,10 +94,10 @@ Proc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
30 /* Check if any reply values need byte swapping */
31 if (client->swapped) {
32
33- swaps(&rep.sequenceNumber, n);
34- swapl(&rep.length, n);
35- swapl(&rep.pixmapPhysAddr, n);
36- swapl(&rep.pixmapPitch, n);
37+ swaps(&rep.sequenceNumber);
38+ swapl(&rep.length);
39+ swapl(&rep.pixmapPhysAddr);
40+ swapl(&rep.pixmapPitch);
41 }
42
43 /* Reply to client */
44@@ -123,16 +121,14 @@ Proc_IMX_EXT_Dispatch(ClientPtr client)
45 static int
46 SProc_IMX_EXT_GetPixmapPhysAddr(ClientPtr client)
47 {
48- int n;
49-
50 REQUEST(xIMX_EXT_GetPixmapPhysAddrReq);
51
52 /* Swap request message length and verify it is correct. */
53- swaps(&stuff->length, n);
54+ swaps(&stuff->length);
55 REQUEST_SIZE_MATCH(xIMX_EXT_GetPixmapPhysAddrReq);
56
57 /* Swap remaining request message parameters. */
58- swapl(&stuff->pixmap, n);
59+ swapl(&stuff->pixmap);
60
61 return Proc_IMX_EXT_GetPixmapPhysAddr(client);
62 }
63--
641.7.10.4
65
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch
new file mode 100644
index 0000000..64af773
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/xf86-video-imxfb-fix-m4-hardcodded-paths.patch
@@ -0,0 +1,53 @@
1From 5b348e7be67957f4be6fcfa4942128c04f6db905 Mon Sep 17 00:00:00 2001
2From: Adrian Alonso <b38018@freescale.com>
3Date: Thu, 4 Aug 2011 14:24:26 -0500
4Subject: [PATCH] xf86-video-imxfb: fix m4 hardcodded paths
5
6* Fix m4 macros lookup location; remove /usr/share/aclocal path
7
8Signed-off-by: Adrian Alonso <b38018@freescale.com>
9---
10 Makefile.am | 2 +-
11 Makefile.in | 2 +-
12 configure.ac | 2 +-
13 3 files changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/Makefile.am b/Makefile.am
16index 6752256..e205657 100644
17--- a/Makefile.am
18+++ b/Makefile.am
19@@ -20,4 +20,4 @@
20
21 AUTOMAKE_OPTIONS = foreign
22 SUBDIRS = src
23-ACLOCAL_AMFLAGS = -I /usr/share/aclocal
24+ACLOCAL_AMFLAGS = -I m4
25diff --git a/Makefile.in b/Makefile.in
26index 5c0ba0e..f829db7 100644
27--- a/Makefile.in
28+++ b/Makefile.in
29@@ -243,7 +243,7 @@ top_builddir = @top_builddir@
30 top_srcdir = @top_srcdir@
31 AUTOMAKE_OPTIONS = foreign
32 SUBDIRS = src
33-ACLOCAL_AMFLAGS = -I /usr/share/aclocal
34+ACLOCAL_AMFLAGS = -I m4
35 all: config.h
36 $(MAKE) $(AM_MAKEFLAGS) all-recursive
37
38diff --git a/configure.ac b/configure.ac
39index a1ac73b..0078b86 100644
40--- a/configure.ac
41+++ b/configure.ac
42@@ -29,7 +29,7 @@ AC_INIT([xf86-video-imx],
43 AC_CONFIG_SRCDIR([Makefile.am])
44 AM_CONFIG_HEADER([config.h])
45 AC_CONFIG_AUX_DIR(.)
46-AC_CONFIG_MACRO_DIR([/usr/share/aclocal])
47+AC_CONFIG_MACRO_DIR([m4])
48
49 AM_INIT_AUTOMAKE([dist-bzip2])
50
51--
521.7.4.1
53
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch
new file mode 100644
index 0000000..14ccbbf
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/xserver-1.14-compat.patch
@@ -0,0 +1,34 @@
1Fix building using new Xorg 1.14
2
3mibstore functions are no longer supported. This patch removes them
4from this driver, following the pattern in
5http://patches.openembedded.org/patch/46133/
6
7This checkin shows when/where the changes to the X server were made
8that deleted the header mibstore.h and mentions the reasons.
9http://lists.x.org/archives/xorg-devel/2012-September/033575.html
10
11Upstream-Status: Pending
12
13Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
14
15Index: xserver-xorg-video-imx-11.09.01/src/imx_driver.c
16===================================================================
17--- xserver-xorg-video-imx-11.09.01.orig/src/imx_driver.c
18+++ xserver-xorg-video-imx-11.09.01/src/imx_driver.c
19@@ -37,7 +37,6 @@
20 #include "xf86_OSproc.h"
21
22 #include "mipointer.h"
23-#include "mibstore.h"
24 #include "micmap.h"
25 #include "colormapst.h"
26 #include "xf86cmap.h"
27@@ -722,7 +721,6 @@ imxScreenInit(SCREEN_INIT_ARGS_DECL)
28 /* Initialize for X extensions. */
29 imxExtInit();
30
31- miInitializeBackingStore(pScreen);
32 xf86SetBackingStore(pScreen);
33
34 /* software cursor */
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb
new file mode 100644
index 0000000..443cd4f
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb
@@ -0,0 +1,39 @@
1# Copyright (C) 2011, 2012 Freescale
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4DESCRIPTION = "X.Org X server -- Freescale iMx framebuffer driver"
5LICENSE = "MIT-X"
6DEPENDS = "virtual/kernel virtual/xserver virtual/libx11 xproto randrproto util-macros amd-gpu-x11-bin-mx51 libz160"
7LIC_FILES_CHKSUM = "file://COPYING;md5=f7bdc0c63080175d1667091b864cb12c"
8
9PR = "r12"
10
11SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-${PV}.tar.gz \
12 file://xf86-video-imxfb-fix-m4-hardcodded-paths.patch \
13 file://Make-video-API-forward-and-backward-compatible.patch \
14 file://ext-Update-to-newer-swap-macros.patch \
15 file://Fix-error-unknown-type-name-uint.patch \
16 file://xserver-1.14-compat.patch \
17"
18SRC_URI[md5sum] = "d19148399b5d1c4dab90d0cc6f2c4789"
19SRC_URI[sha256sum] = "d7d85e9f13c6dd58addab89847f3a8a67f6382a54135c7978c9a95368af024d4"
20
21inherit autotools pkgconfig
22
23FILES_${PN} += " ${libdir}/xorg/modules/drivers/*.so"
24FILES_${PN}-dbg += " ${libdir}/xorg/modules/drivers/.debug"
25EXTRA_OECONF_armv7a = " --enable-neon "
26CFLAGS += " -I${STAGING_INCDIR}/xorg -I${STAGING_KERNEL_DIR}/include"
27
28S = "${WORKDIR}/xserver-xorg-video-imx-${PV}"
29
30do_install_append () {
31 # driver's la files are not packaged
32 rm -f ${D}${libdir}/xorg/modules/drivers/*.la
33}
34
35RDEPENDS_${PN} += "xserver-xorg-module-exa"
36
37INSANE_SKIP_${PN} = "ldflags"
38INSANE_SKIP_${PN}-dbg = "ldflags"
39COMPATIBLE_MACHINE = "(mx5)"
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config/mx5/xorg.conf b/recipes-graphics/xorg-xserver/xserver-xf86-config/mx5/xorg.conf
new file mode 100644
index 0000000..a99e6f2
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xf86-config/mx5/xorg.conf
@@ -0,0 +1,16 @@
1Section "Device"
2 Identifier "i.MX Accelerated Framebuffer Device"
3 Driver "imx"
4 Option "fbdev" "/dev/fb0"
5 # This option only recognized when "mxc_epdc_fb" frame buffer driver in
6 # use. Values are "RGB565" (default, 16-bit RGB), "Y8" (8-bit gray),
7 # and "Y8INV" (8-bit gray inverted).
8 Option "FormatEPDC" "Y8INV"
9EndSection
10
11Section "ServerFlags"
12 Option "BlankTime" "0"
13 Option "StandbyTime" "0"
14 Option "SuspendTime" "0"
15 Option "OffTime" "0"
16EndSection
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6/xorg.conf b/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6/xorg.conf
new file mode 100644
index 0000000..b89bed6
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xf86-config/mx6/xorg.conf
@@ -0,0 +1,14 @@
1Section "Device"
2 Identifier "i.MX Accelerated Framebuffer Device"
3 Driver "vivante"
4 Option "fbdev" "/dev/fb0"
5 Option "vivante_fbdev" "/dev/fb0"
6 Option "HWcursor" "false"
7EndSection
8
9Section "ServerFlags"
10 Option "BlankTime" "0"
11 Option "StandbyTime" "0"
12 Option "SuspendTime" "0"
13 Option "OffTime" "0"
14EndSection
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config/mxs/xorg.conf b/recipes-graphics/xorg-xserver/xserver-xf86-config/mxs/xorg.conf
new file mode 100644
index 0000000..79b6c0f
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xf86-config/mxs/xorg.conf
@@ -0,0 +1,12 @@
1Section "Device"
2 Identifier "Kernel Framebuffer Device"
3 Driver "fbdev"
4 Option "fbdev" "/dev/fb0"
5EndSection
6
7Section "ServerFlags"
8 Option "BlankTime" "0"
9 Option "StandbyTime" "0"
10 Option "SuspendTime" "0"
11 Option "OffTime" "0"
12EndSection
diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend b/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend
new file mode 100644
index 0000000..ceb438e
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xf86-config_%.bbappend
@@ -0,0 +1,2 @@
1# Append path for freescale layer to include bsp xorg.conf
2FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/aarch64.patch b/recipes-graphics/xorg-xserver/xserver-xorg/aarch64.patch
new file mode 100644
index 0000000..045e24a
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg/aarch64.patch
@@ -0,0 +1,35 @@
1Subject: Add AArch64 support to xserver-xorg
2Author: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
3
4lnx_video.c parts are not existing in 1.14 branch.
5
6Xserver was checked in AArch64 fastmodel (commercial one with graphics support).
7
8http://patchwork.freedesktop.org/patch/12785/
9
10Upstream-Status: Pending
11
12---
13 include/servermd.h | 7 +++++++
14 1 files changed, 7 insertions(+), 0 deletions(-)
15
16--- xorg-server-1.13.1.orig/include/servermd.h
17+++ xorg-server-1.13.1/include/servermd.h
18@@ -243,10 +243,17 @@ SOFTWARE.
19 #define BITMAP_BIT_ORDER LSBFirst
20 #define GLYPHPADBYTES 4
21 /* ???? */
22 #endif /* AMD64 */
23
24+#if defined(__aarch64__) || defined(aarch64) || defined(__aarch64)
25+#define IMAGE_BYTE_ORDER MSBFirst
26+#define BITMAP_BIT_ORDER MSBFirst
27+#define GLYPHPADBYTES 4
28+/* ???? */
29+#endif /* AArch64 */
30+
31 #if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \
32 defined(__alpha__) || defined(__alpha) || \
33 defined(__i386__) || \
34 defined(__s390x__) || defined(__s390__)
35
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/crosscompile.patch b/recipes-graphics/xorg-xserver/xserver-xorg/crosscompile.patch
new file mode 100644
index 0000000..2f98bb8
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg/crosscompile.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Inappropriate [configuration]
2
3diff --git a/configure.ac b/configure.ac
4index b3b752c..600500b 100644
5--- a/configure.ac
6+++ b/configure.ac
7@@ -523,13 +523,9 @@ dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
8 dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross
9 dnl compiling, assume default font path uses standard FONTROOTDIR directories.
10 DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
11-if test "$cross_compiling" != yes; then
12- AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
13- [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'],
14- [case $host_os in
15+ case $host_os in
16 darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
17- esac])
18-fi
19+ esac
20 AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
21 [ FONTPATH="$withval" ],
22 [ FONTPATH="${DEFAULT_FONT_PATH}" ])
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/fix_open_max_preprocessor_error.patch b/recipes-graphics/xorg-xserver/xserver-xorg/fix_open_max_preprocessor_error.patch
new file mode 100644
index 0000000..2f62972
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg/fix_open_max_preprocessor_error.patch
@@ -0,0 +1,15 @@
1Upstream-Status: Pending
2
3Index: git/os/osdep.h
4===================================================================
5--- git.orig/os/osdep.h 2008-10-07 18:38:21.000000000 +0100
6+++ git/os/osdep.h 2008-10-07 18:39:36.000000000 +0100
7@@ -92,7 +92,7 @@
8 * like sysconf(_SC_OPEN_MAX) is not supported.
9 */
10
11-#if OPEN_MAX <= 256
12+#if 0
13 #define MAXSOCKS (OPEN_MAX - 1)
14 #else
15 #define MAXSOCKS 256
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch b/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
new file mode 100644
index 0000000..ec0eea6
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
@@ -0,0 +1,25 @@
1This is the revised version of files/macro_tweak.patch for
2xorg-server 1.8.99.904 and newer.
3
4Upstream-Status: Pending
5
6Signed-off-by: Yu Ke <ke.yu@intel.com>
7
8diff --git a/xorg-server.m4 b/xorg-server.m4
9index bdecf62..040fdb8 100644
10--- a/xorg-server.m4
11+++ b/xorg-server.m4
12@@ -28,10 +28,12 @@ dnl
13 # Checks for the $1 define in xorg-server.h (from the sdk). If it
14 # is defined, then add $1 to $REQUIRED_MODULES.
15
16+m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
17+
18 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
19 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
20 SAVE_CFLAGS="$CFLAGS"
21- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
22+ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
23 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
24 #include "xorg-server.h"
25 #if !defined $1
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/mips64-compiler.patch b/recipes-graphics/xorg-xserver/xserver-xorg/mips64-compiler.patch
new file mode 100644
index 0000000..168368e
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg/mips64-compiler.patch
@@ -0,0 +1,29 @@
1on mips64/n64 pointers are 64bit therefore the pointer conversions to int dont work well
2so we end up with incompatible conversion errors
3
4This patch choses the right values for mips64
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Pending
9Index: xorg-server-1.13.0/hw/xfree86/common/compiler.h
10===================================================================
11--- xorg-server-1.13.0-orig/hw/xfree86/common/compiler.h 2012-06-14 23:04:29.000000000 +0300
12+++ xorg-server-1.13.0/hw/xfree86/common/compiler.h 2012-11-08 10:06:50.865831783 +0200
13@@ -101,6 +101,7 @@
14 #if defined(NO_INLINE) || defined(DO_PROTOTYPES)
15 #if !defined(__arm__)
16 #if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) && !defined(__nds32__) \
17+ && !defined(__mips64) \
18 && !(defined(__alpha__) && defined(linux)) \
19 && !(defined(__ia64__) && defined(linux)) \
20
21@@ -721,7 +722,7 @@
22 }
23
24 #elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__))
25-#ifdef __arm32__
26+#if defined (__arm32__) || defined (__mips64)
27 #define PORT_SIZE long
28 #else
29 #define PORT_SIZE short
diff --git a/recipes-graphics/xorg-xserver/xserver-xorg_1.14.4.bb b/recipes-graphics/xorg-xserver/xserver-xorg_1.14.4.bb
new file mode 100644
index 0000000..c6e23be
--- /dev/null
+++ b/recipes-graphics/xorg-xserver/xserver-xorg_1.14.4.bb
@@ -0,0 +1,35 @@
1require recipes-graphics/xorg-xserver/xserver-xorg.inc
2
3LIC_FILES_CHKSUM = "file://COPYING;md5=bc098b9774ed096943f6c37b5beeef13"
4
5# Misc build failure for master HEAD
6SRC_URI += "file://crosscompile.patch \
7 file://fix_open_max_preprocessor_error.patch \
8 file://mips64-compiler.patch \
9 file://aarch64.patch \
10 "
11
12SRC_URI[md5sum] = "9d68a30258c67faa3c036a4a85e8bf97"
13SRC_URI[sha256sum] = "608ccfaafb845f6e559884a30f946d365209172416710d687b190e9e1ff65dc3"
14
15# These extensions are now integrated into the server, so declare the migration
16# path for in-place upgrades.
17
18RREPLACES_${PN} = "${PN}-extension-dri \
19 ${PN}-extension-dri2 \
20 ${PN}-extension-record \
21 ${PN}-extension-extmod \
22 ${PN}-extension-dbe \
23 "
24RPROVIDES_${PN} = "${PN}-extension-dri \
25 ${PN}-extension-dri2 \
26 ${PN}-extension-record \
27 ${PN}-extension-extmod \
28 ${PN}-extension-dbe \
29 "
30RCONFLICTS_${PN} = "${PN}-extension-dri \
31 ${PN}-extension-dri2 \
32 ${PN}-extension-record \
33 ${PN}-extension-extmod \
34 ${PN}-extension-dbe \
35 "