summaryrefslogtreecommitdiffstats
path: root/recipes-graphics
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2015-07-15 17:14:27 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2015-07-16 15:01:29 -0300
commitf8517afc7a5ada4538b3b7d397fa32586d57ffe5 (patch)
tree79349f091306d1760fd4687e62336ffa8fb8c721 /recipes-graphics
parentc92b415d653afc55f33b6b93fb9248193bfd4fa0 (diff)
downloadmeta-freescale-f8517afc7a5ada4538b3b7d397fa32586d57ffe5.tar.gz
Move meta-fsl-arm content to layer root
The meta-fsl-arm is going to be used as the base for this layer. It contains a clean history and allowing a more granullar set of changes. This commit is just a rename of all contents of meta-fsl-arm subdirectory to this layer's root, subsequent changes are based on top of that. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
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.inc110
-rw-r--r--recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb25
-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.bb36
-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/Check-input-NULL-pointer.patch42
-rw-r--r--recipes-graphics/directfb/directfb/bashism.patch18
-rw-r--r--recipes-graphics/directfb/directfb/configurefix.patch60
-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_1.7.4.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_%.bbappend4
-rw-r--r--recipes-graphics/eglinfo/eglinfo-x11_%.bbappend4
-rw-r--r--recipes-graphics/images/core-image-weston.bbappend4
-rw-r--r--recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc346
-rw-r--r--recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-hfp.bb9
-rw-r--r--recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-sfp.bb12
-rw-r--r--recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch355
-rw-r--r--recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch17
-rw-r--r--recipes-graphics/mesa/mesa-demos_%.bbappend6
-rw-r--r--recipes-graphics/mesa/mesa_%.bbappend22
-rw-r--r--recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend3
-rw-r--r--recipes-graphics/piglit/piglit_git.bbappend7
-rw-r--r--recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch1709
-rw-r--r--recipes-graphics/wayland/weston_%.bbappend42
-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.inc79
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi42
-rw-r--r--recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb8
-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/glibc-2.20.patch57
-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.bb48
-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
49 files changed, 4327 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 00000000..ecf38f2f
--- /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 00000000..76c7bc43
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-mx51.inc
@@ -0,0 +1,110 @@
1# Copyright (C) 2011, 2012, 2013 Freescale
2# Copyright (C) 2011-2015 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 = "amd-gpu-mx51 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# For the packages that make up the OpenGL interfaces, inject variables so that
21# they don't get Debian-renamed (which would remove the -mx51 suffix).
22#
23# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
24# the source we cannot fix it. Disable the insane check for now.
25python __anonymous() {
26 for p in d.getVar('PACKAGES', True).split():
27 d.setVar("INSANE_SKIP_%s" % p, "ldflags")
28
29 for p in (("libegl", "libegl1"), ("libgl", "libgl1"),
30 ("libgles2", "libglesv2-2")):
31 fullp = p[0] + "-mx51"
32 pkgs = " ".join(p)
33 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
34 d.appendVar("RREPLACES_" + fullp, pkgs)
35 d.appendVar("RPROVIDES_" + fullp, pkgs)
36 d.appendVar("RCONFLICTS_" + fullp, pkgs)
37
38 # For -dev, the first element is both the Debian and original name
39 fullp += "-dev"
40 pkgs = p[0] + "-dev"
41 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
42 d.appendVar("RREPLACES_" + fullp, pkgs)
43 d.appendVar("RPROVIDES_" + fullp, pkgs)
44 d.appendVar("RCONFLICTS_" + fullp, pkgs)
45}
46
47do_install () {
48 install -d ${D}${libdir}
49 install -d ${D}${bindir}
50 install -d ${D}${includedir}
51
52 cp -Pr ${S}/usr/bin/* ${D}${bindir}
53 cp -Pr ${S}/usr/lib/* ${D}${libdir}
54 cp -Pr ${S}/usr/include/* ${D}${includedir}
55
56 find ${D}${bindir} -type f -exec chmod 755 {} \;
57 find ${D}${libdir} -type f -exec chmod 644 {} \;
58 find ${D}${includedir} -type f -exec chmod 644 {} \;
59
60 # FIXME: Fix sonames of broken libraries
61 mv ${D}${libdir}/lib2dz160.so ${D}${libdir}/lib2dz160.so.0
62 mv ${D}${libdir}/lib2dz430.so ${D}${libdir}/lib2dz430.so.0
63 ln -sf lib2dz160.so.0 ${D}${libdir}/lib2dz160.so
64 ln -sf lib2dz430.so.0 ${D}${libdir}/lib2dz430.so
65
66 # FIXME: Remove unknown files
67 rm -r ${D}${libdir}/libcsi.a \
68 ${D}${libdir}/libres.a
69
70 # FIXME: Add pkgconfig files
71 install -d ${D}${libdir}/pkgconfig
72 install -m 644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig
73 install -m 644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig
74}
75
76PACKAGES =+ "libgsl-fsl-mx51 libgsl-fsl-mx51-dev libgsl-fsl-mx51-dbg \
77 libegl-mx51 libegl-mx51-dev libegl-mx51-dbg \
78 libgles-mx51 libgles-mx51-dev libgles-mx51-dbg \
79 libgles2-mx51 libgles2-mx51-dev libgles2-mx51-dbg \
80 libopenvg-mx51 libopenvg-mx51-dev libopenvg-mx51-dbg \
81 lib2dz160-mx51 lib2dz160-mx51-dbg \
82 lib2dz430-mx51 lib2dz430-mx51-dbg"
83
84FILES_${PN}-dbg = "${bindir}/.debug/*"
85
86FILES_libgsl-fsl-mx51 = "${libdir}/libgsl-fsl${SOLIBS}"
87FILES_libgsl-fsl-mx51-dev = "${libdir}/libgsl-fsl${SOLIBSDEV}"
88FILES_libgsl-fsl-mx51-dbg = "${libdir}/.debug/libgsl-fsl${SOLIBS}"
89
90FILES_libegl-mx51 = "${libdir}/libEGL${SOLIBS}"
91FILES_libegl-mx51-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/libEGL${SOLIBSDEV}"
92FILES_libegl-mx51-dbg = "${libdir}/.debug/libEGL${SOLIBS}"
93
94FILES_libgles-mx51 = "${libdir}/libGLESv1*${SOLIBS}"
95FILES_libgles-mx51-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBSDEV}"
96FILES_libgles-mx51-dbg = "${libdir}/.debug/libGLESv1*${SOLIBS}"
97
98FILES_libgles2-mx51 = "${libdir}/libGLESv2${SOLIBS}"
99FILES_libgles2-mx51-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV}"
100FILES_libgles2-mx51-dbg = "${libdir}/.debug/libGLESv2${SOLIBS}"
101
102FILES_libopenvg-mx51 = "${libdir}/libOpenVG${SOLIBS}"
103FILES_libopenvg-mx51-dev = "${includedir}/VG ${libdir}/libOpenVG${SOLIBSDEV}"
104FILES_libopenvg-mx51-dbg = "${libdir}/.debug/libOpenVG${SOLIBS}"
105
106FILES_lib2dz160-mx51 = "${libdir}/lib2dz160${SOLIBS}"
107FILES_lib2dz160-mx51-dbg = "${libdir}/.debug/lib2dz160${SOLIBS}"
108
109FILES_lib2dz430-mx51 = "${libdir}/lib2dz430${SOLIBS}"
110FILES_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 00000000..7fc351b0
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/amd-gpu-x11-bin-mx51_11.09.01.bb
@@ -0,0 +1,25 @@
1# Copyright (C) 2011-2015 O.S. Systems Software LTDA.
2# Copyright (C) 2011, 2012 Freescale
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5DESCRIPTION = "GPU driver and apps for x11 on mx51"
6PR = "r12"
7
8# FIXME: Replace for correct AMD license
9LIC_FILES_CHKSUM = "file://usr/include/VG/openvg.h;endline=30;md5=b0109611dd76961057d4c45ae6519802"
10DEPENDS = "virtual/libx11 libxrender libxext"
11
12include amd-gpu-mx51.inc
13
14SRC_URI[md5sum] = "54391a4e670b597d06d01253fb217cad"
15SRC_URI[sha256sum] = "c7a6fa03b7aa2a375556c59908876554ba720c1e744baba2debb84a408f790db"
16
17RCONFLICTS_${PN} = "amd-gpu-bin-mx51"
18
19COMPATIBLE_MACHINE = "${@base_contains('DISTRO_FEATURES', 'x11', '(mx5)', 'Invalid!', d)}"
20
21do_install_append() {
22 # eglplatform_1.4.h contains X11 compatible headers
23 rm ${D}${includedir}/EGL/eglplatform.h
24 mv ${D}${includedir}/EGL/eglplatform_1.4.h ${D}${includedir}/EGL/eglplatform.h
25}
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 00000000..3d2ab5db
--- /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 00000000..946bfac7
--- /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 00000000..62e1cb65
--- /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 00000000..43b9f7ff
--- /dev/null
+++ b/recipes-graphics/amd-gpu-x11-bin/libz160_11.09.01.bb
@@ -0,0 +1,36 @@
1# Copyright (C) 2011-2015 O.S. Systems Software LTDA.
2# Copyright (C) 2011, 2012 Freescale
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5DESCRIPTION = "AMD libz160 gpu driver"
6LICENSE = "Proprietary"
7SECTION = "libs"
8DEPENDS = "amd-gpu-mx51"
9
10PR = "r2"
11
12#todo: Replace for correct AMD license
13LIC_FILES_CHKSUM = "file://usr/include/z160.h;endline=28;md5=65dd44cd769091092f38e34cd52cc271"
14
15SRC_URI = "${FSL_MIRROR}/libz160-bin-${PV}.bin;fsl-eula=true"
16SRC_URI[md5sum] = "9a9c2c93f4b44e89316772d348eead7d"
17SRC_URI[sha256sum] = "08767eb269a0a30ca0aa3d3b5aa9a53a2d17ed1c24651b7e8cefc7704b883f19"
18
19inherit fsl-eula-unpack
20
21do_install () {
22 install -d ${D}${libdir}
23 install -d ${D}${includedir}
24 install -m 0755 ${S}/usr/lib/* ${D}${libdir}
25 install -m 0644 ${S}/usr/include/* ${D}${includedir}
26}
27
28S = "${WORKDIR}/${PN}-bin-${PV}"
29
30# Avoid QA Issue: No GNU_HASH in the elf binary
31INSANE_SKIP_${PN} = "ldflags"
32INSANE_SKIP_${PN}-dev = "ldflags"
33FILES_${PN} = "${libdir}/*.so"
34FILES_${PN}-dev = "${includedir}"
35
36COMPATIBLE_MACHINE = "(mx5)"
diff --git a/recipes-graphics/cairo/cairo_%.bbappend b/recipes-graphics/cairo/cairo_%.bbappend
new file mode 100644
index 00000000..ab1c37a5
--- /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_append_mx6q = " egl glesv2"
10PACKAGECONFIG_append_mx6dl = " egl glesv2"
11PACKAGECONFIG_append_mx6sx = " egl glesv2"
diff --git a/recipes-graphics/clutter/clutter-1.0_%.bbappend b/recipes-graphics/clutter/clutter-1.0_%.bbappend
new file mode 100644
index 00000000..cdeac1f2
--- /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 00000000..f77581df
--- /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/Check-input-NULL-pointer.patch b/recipes-graphics/directfb/directfb/Check-input-NULL-pointer.patch
new file mode 100644
index 00000000..1d541722
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/Check-input-NULL-pointer.patch
@@ -0,0 +1,42 @@
1From 0c1e3d1d54b7f2e637b0984ea10aef1de278ff87 Mon Sep 17 00:00:00 2001
2From: "yong.gan" <yong.gan@freescale.com>
3Date: Fri, 23 May 2014 14:15:09 +0800
4Subject: [PATCH] Check input NULL pointer
5
6Fix the segmentation fault in multi-instance test.
7
8Upstream Status: Pending
9---
10 inputdrivers/linux_input/linux_input.c | 2 +-
11 src/core/input.c | 2 ++
12 2 files changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/inputdrivers/linux_input/linux_input.c b/inputdrivers/linux_input/linux_input.c
15index e275762..35cfbdd 100644
16--- a/inputdrivers/linux_input/linux_input.c
17+++ b/inputdrivers/linux_input/linux_input.c
18@@ -1979,7 +1979,7 @@ driver_get_keymap_entry( CoreInputDevice *device,
19 unsigned short value;
20 DFBInputDeviceKeyIdentifier identifier;
21
22- if (data->vt_fd < 0)
23+ if (data == NULL || data->vt_fd < 0)
24 return DFB_UNSUPPORTED;
25
26 /* fetch the base level */
27diff --git a/src/core/input.c b/src/core/input.c
28index d77bc9f..ee23909 100644
29--- a/src/core/input.c
30+++ b/src/core/input.c
31@@ -723,6 +723,8 @@ dfb_input_core_suspend( DFBInputCore *data )
32 driver->info.name );
33 }
34 }
35+ if(data == NULL)
36+ return DFB_FAILURE;
37
38 direct_list_foreach (device, data->devices) {
39 InputDeviceShared *devshared;
40--
411.9.1
42
diff --git a/recipes-graphics/directfb/directfb/bashism.patch b/recipes-graphics/directfb/directfb/bashism.patch
new file mode 100644
index 00000000..2ef4e938
--- /dev/null
+++ b/recipes-graphics/directfb/directfb/bashism.patch
@@ -0,0 +1,18 @@
1${x//y/} is a bash syntax. Replace with something dash compatible
2
3RP 2015/5/3
4Upstream-Status: Pending
5
6Index: DirectFB-1.7.7/configure.in
7===================================================================
8--- DirectFB-1.7.7.orig/configure.in
9+++ DirectFB-1.7.7/configure.in
10@@ -2696,7 +2696,7 @@ AM_CONDITIONAL(BUILD_TOOLS, test "$with_
11 AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
12
13 CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS"
14-CXXFLAGS="$CXXFLAGS ${CFLAGS//-Werror-implicit-function-declaration/}"
15+CXXFLAGS="$CXXFLAGS $(printf '%s\n' "$CFLAGS" | sed 's/-Werror-implicit-function-declaration//g')"
16 DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS"
17
18 CFLAGS="$CFLAGS $CFLAGS_STD"
diff --git a/recipes-graphics/directfb/directfb/configurefix.patch b/recipes-graphics/directfb/directfb/configurefix.patch
new file mode 100644
index 00000000..dd8c0190
--- /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/fixsepbuild.patch b/recipes-graphics/directfb/directfb/fixsepbuild.patch
new file mode 100644
index 00000000..94a9ba5f
--- /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 00000000..1f81a679
--- /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_1.7.4.bb b/recipes-graphics/directfb/directfb_1.7.4.bb
new file mode 100644
index 00000000..9bc26373
--- /dev/null
+++ b/recipes-graphics/directfb/directfb_1.7.4.bb
@@ -0,0 +1,26 @@
1require recipes-graphics/directfb/directfb.inc
2
3RV = "1.7-4"
4
5DEPENDS += "sysfsutils"
6
7SRC_URI += "file://fixsepbuild.patch \
8 file://Check-input-NULL-pointer.patch"
9
10EXTRA_OECONF = "\
11 --enable-freetype=yes \
12 --enable-zlib \
13 --with-gfxdrivers=none \
14 --disable-sdl \
15 --disable-vnc \
16 --disable-x11 \
17 --disable-imlib2 \
18 --disable-mesa \
19 --with-tests \
20"
21LEAD_SONAME = "libdirectfb-1.7.so.0"
22
23SRC_URI[md5sum] = "f5bdacde77fc653279819796ae11341e"
24SRC_URI[sha256sum] = "20ccd60011c788e50c940ab566943d050679067bc84dc37ca447f1b4af08481b"
25
26PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
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 00000000..1160cd10
--- /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 00000000..6bd7968d
--- /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 00000000..0fd67814
--- /dev/null
+++ b/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
@@ -0,0 +1,4 @@
1# Set i.MX specific dependencies and device type
2EGLINFO_DEVICE_mx6q = "imx6"
3EGLINFO_DEVICE_mx6dl = "imx6"
4EGLINFO_DEVICE_mx6sx = "imx6"
diff --git a/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend b/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
new file mode 100644
index 00000000..0fd67814
--- /dev/null
+++ b/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
@@ -0,0 +1,4 @@
1# Set i.MX specific dependencies and device type
2EGLINFO_DEVICE_mx6q = "imx6"
3EGLINFO_DEVICE_mx6dl = "imx6"
4EGLINFO_DEVICE_mx6sx = "imx6"
diff --git a/recipes-graphics/images/core-image-weston.bbappend b/recipes-graphics/images/core-image-weston.bbappend
new file mode 100644
index 00000000..6e33067f
--- /dev/null
+++ b/recipes-graphics/images/core-image-weston.bbappend
@@ -0,0 +1,4 @@
1# FIXME: Vivante GPU driver cannot operate in X11 and Wayland in same
2# distribution as it needs to have different libraries installed. So
3# in case 'x11' is in DISTRO_FEATURES, Wayland is disabled.
4CONFLICT_DISTRO_FEATURES_append_mx6 = " x11"
diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
new file mode 100644
index 00000000..4b6e030e
--- /dev/null
+++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
@@ -0,0 +1,346 @@
1# Copyright (C) 2012-2015 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://gpu-core/usr/include/gc_vdk.h;beginline=5;endline=11;md5=12c028cbbbedb4b8770267131500592c"
9
10DEPENDS += "${@base_contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxdamage libxext libxfixes mesa', \
11 base_contains('DISTRO_FEATURES', 'wayland', 'wayland', \
12 '', d), d)}"
13
14EXTRA_PROVIDES = ""
15EXTRA_PROVIDES_mx6q = " virtual/libgl virtual/libgles1 virtual/libgles2"
16EXTRA_PROVIDES_mx6dl = " virtual/libgl virtual/libgles1 virtual/libgles2"
17EXTRA_PROVIDES_mx6sx = " virtual/libgl virtual/libgles1 virtual/libgles2"
18PROVIDES += "virtual/wayland-egl virtual/libgal-x11 virtual/egl virtual/libopenvg virtual/libg2d ${EXTRA_PROVIDES}"
19
20PE = "1"
21
22inherit fsl-eula-unpack
23
24SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
25
26PACKAGES =+ "libclc-mx6 libclc-mx6-dev libclc-mx6-dbg \
27 libgl-mx6 libgl-mx6-dev libgl-mx6-dbg \
28 libgles-mx6 libgles-mx6-dev libgles-mx6-dbg \
29 libgles2-mx6 libgles2-mx6-dev libgles2-mx6-dbg \
30 libgles3-mx6-dev \
31 libglslc-mx6 libglslc-mx6-dev libglslc-mx6-dbg \
32 libopencl-mx6 libopencl-mx6-dev libopencl-mx6-dbg \
33 libopenvg-mx6 libopenvg-mx6-dev libopenvg-mx6-dbg \
34 libvdk-mx6 libvdk-mx6-dev libvdk-mx6-dbg \
35 libegl-mx6 libegl-mx6-dev libegl-mx6-dbg \
36 libgal-mx6 libgal-mx6-dev libgal-mx6-dbg \
37 libvivante-mx6 libvivante-mx6-dev libvivante-mx6-dbg \
38 libvivante-dri-mx6 \
39 libvivante-dfb-mx6 \
40 libvsc-mx6 \
41 libwayland-viv-mx6 libwayland-viv-mx6-dev libwayland-viv-mx6-dbg \
42 libgc-wayland-protocol-mx6 libgc-wayland-protocol-mx6-dev libgc-wayland-protocol-mx6-dbg \
43 libwayland-egl-mx6-dev \
44 imx-gpu-viv-g2d imx-gpu-viv-g2d-dev imx-gpu-viv-g2d-dbg \
45 imx-gpu-viv-tools imx-gpu-viv-tools-dbg \
46 imx-gpu-viv-tools-apitrace imx-gpu-viv-tools-apitrace-dbg \
47 imx-gpu-viv-demos imx-gpu-viv-demos-dbg \
48"
49
50# Skip package if it does not match the machine float-point type in use
51python __anonymous () {
52 is_machine_hardfp = base_contains("TUNE_FEATURES", "callconvention-hard", True, False, d)
53 is_package_hardfp = d.getVar("PACKAGE_FP_TYPE", True) == "hardfp"
54
55 if is_package_hardfp != is_machine_hardfp:
56 PN = d.getVar("PN", True)
57 PV = d.getVar("PV", True)
58 bb.debug(1, "Skipping %s (%s) as machine and package float-point does not match" % (PN, PV))
59 raise bb.parse.SkipPackage("Package Float-Point is not compatible with the machine")
60}
61
62USE_X11 = "${@base_contains("DISTRO_FEATURES", "x11", "yes", "no", d)}"
63USE_DFB = "${@base_contains("DISTRO_FEATURES", "directfb", "yes", "no", d)}"
64USE_WL = "${@base_contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
65
66# Inhibit warnings about files being stripped.
67INHIBIT_PACKAGE_STRIP = "1"
68INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
69
70# FIXME: The provided binary doesn't provide soname. If in future BSP
71# release the libraries are fixed, we can drop this hack.
72REALSOLIBS := "${SOLIBS}"
73SOLIBS = "${SOLIBSDEV}"
74
75# For the packages that make up the OpenGL interfaces, inject variables so that
76# they don't get Debian-renamed (which would remove the -mx6 suffix).
77#
78# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have
79# the source we cannot fix it. Disable the insane check for now.
80python __anonymous() {
81 packages = d.getVar('PACKAGES', True).split()
82 for p in packages:
83 d.appendVar("INSANE_SKIP_%s" % p, " ldflags")
84
85 for p in (("libegl", "libegl1"), ("libgl", "libgl1"),
86 ("libgles1", "libglesv1-cm1"), ("libgles2", "libglesv2-2"),
87 ("libgles3",)):
88 fullp = p[0] + "-mx6"
89 pkgs = " ".join(p)
90 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
91 d.appendVar("RREPLACES_" + fullp, pkgs)
92 d.appendVar("RPROVIDES_" + fullp, pkgs)
93 d.appendVar("RCONFLICTS_" + fullp, pkgs)
94
95 # For -dev, the first element is both the Debian and original name
96 fullp += "-dev"
97 pkgs = p[0] + "-dev"
98 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
99 d.appendVar("RREPLACES_" + fullp, pkgs)
100 d.appendVar("RPROVIDES_" + fullp, pkgs)
101 d.appendVar("RCONFLICTS_" + fullp, pkgs)
102}
103
104IS_MX6SL = "0"
105IS_MX6SL_mx6sl = "1"
106
107do_install () {
108 install -d ${D}${libdir}
109 install -d ${D}${includedir}
110 install -d ${D}${bindir}
111
112 cp -P ${S}/gpu-core/usr/lib/*.so* ${D}${libdir}
113 cp ${S}/g2d/usr/lib/*.so* ${D}${libdir}
114 cp -r ${S}/gpu-core/usr/include/* ${D}${includedir}
115 cp -Pr ${S}/g2d/usr/include/* ${D}${includedir}
116 cp -r ${S}/gpu-demos/opt ${D}
117 cp -axr ${S}/gpu-tools/gmem-info/usr/bin/* ${D}${bindir}
118
119 install -d ${D}${libdir}/pkgconfig
120
121 # The preference order, based in DISTRO_FEATURES, is x11, wayland, directfb and fb
122 if [ "${USE_X11}" = "yes" ]; then
123 cp -r ${S}/gpu-core/usr/lib/dri ${D}${libdir}
124 cp -axr ${S}/apitrace/x11/usr/lib/* ${D}${libdir}
125 cp -axr ${S}/apitrace/x11/usr/bin/* ${D}${bindir}
126
127 backend=x11
128
129 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_x11.pc ${D}${libdir}/pkgconfig/egl.pc
130 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm_x11.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
131 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2_x11.pc ${D}${libdir}/pkgconfig/glesv2.pc
132 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg_x11.pc ${D}${libdir}/pkgconfig/vg.pc
133 mv ${D}${libdir}/libGAL_egl.dri.so ${D}${libdir}/libGAL_egl.so
134 #FIXME: WL & X11 is not currently functional
135 #if [ "${USE_WL}" = "yes" ]; then
136 # install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gc_wayland_protocol.pc ${D}${libdir}/pkgconfig/gc_wayland_protocol.pc
137 # install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc
138 # install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-viv.pc ${D}${libdir}/pkgconfig/wayland-viv.pc
139 #fi
140 elif [ "${USE_WL}" = "yes" ]; then
141 cp -axr ${S}/apitrace/non-x11/usr/lib/* ${D}${libdir}
142 cp -axr ${S}/apitrace/non-x11/usr/bin/* ${D}${bindir}
143
144 backend=wl
145
146 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_wayland.pc ${D}${libdir}/pkgconfig/egl.pc
147 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
148 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
149 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc
150 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gc_wayland_protocol.pc ${D}${libdir}/pkgconfig/gc_wayland_protocol.pc
151 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc
152 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-viv.pc ${D}${libdir}/pkgconfig/wayland-viv.pc
153 mv ${D}${libdir}/libGAL_egl.${backend}.so ${D}${libdir}/libGAL_egl.so
154 else
155 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
156 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
157 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc
158
159 if [ "${USE_DFB}" = "yes" ]; then
160 install -d ${D}/${sysconfdir}
161 install -m 644 ${S}/gpu-core/etc/directfbrc ${D}/${sysconfdir}/directfbrc
162 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_directfb.pc ${D}${libdir}/pkgconfig/egl.pc
163
164 cp -r ${S}/gpu-core/usr/lib/directfb-* ${D}${libdir}
165 cp -axr ${S}/apitrace/non-x11/usr/lib/* ${D}${libdir}
166 cp -axr ${S}/apitrace/non-x11/usr/bin/* ${D}${bindir}
167 backend=dfb
168 else
169 # Regular framebuffer
170 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_linuxfb.pc ${D}${libdir}/pkgconfig/egl.pc
171 cp -axr ${S}/apitrace/non-x11/usr/lib/* ${D}${libdir}
172 cp -axr ${S}/apitrace/non-x11/usr/bin/* ${D}${bindir}
173 backend=fb
174 fi
175 mv ${D}${libdir}/libGAL_egl.${backend}.so ${D}${libdir}/libGAL_egl.so
176 fi
177
178 # Install Vendor ICDs for OpenCL's installable client driver loader (ICDs Loader)
179 install -d ${D}${sysconfdir}/OpenCL/vendors/
180 install -m 0644 ${S}/gpu-core/etc/Vivante.icd ${D}${sysconfdir}/OpenCL/vendors/Vivante.icd
181
182 # We'll only have one backend here so we rename it to generic name
183 # and avoid rework in other packages, when possible
184 mv ${D}${libdir}/libGL.so.1.2 ${D}${libdir}/libGL.so.1.2.0
185 ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1.2
186 ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1
187 ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so
188 mv ${D}${libdir}/libEGL-${backend}.so ${D}${libdir}/libEGL.so.1.0
189 ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so.1
190 ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so
191 mv ${D}${libdir}/libGAL-${backend}.so ${D}${libdir}/libGAL.so
192 mv ${D}${libdir}/libVIVANTE-${backend}.so ${D}${libdir}/libVIVANTE.so
193
194 # update libglesv2 as backend dependent
195 rm -rf ${D}${libdir}/libGLESv2*
196 cp ${S}/gpu-core/usr/lib/libGLESv2-${backend}.so ${D}${libdir}/libGLESv2.so.2.0.0
197 ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so.2
198 ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so
199
200 # FIXME: The libGL.so* libraries depend on the X11 libraries and
201 # libglapi.so from mesa. For non-X11 distros, neither of them are listed
202 # as build dependencies, which can lead to non-deterministic package
203 # dependencies. If the intention is that the GL backend should be usable
204 # without X11, the linking should be fixed. For now just skip
205 # packaging them.
206 if [ "${USE_X11}" = "no" ]; then
207 rm ${D}${libdir}/libGL.*
208 fi
209
210 # skip packaging wayland libraries if no support is requested
211 if [ "${USE_WL}" = "no" ]; then
212 rm ${D}${libdir}/libgc_wayland_protocol.*
213 rm ${D}${libdir}/libwayland-viv.*
214 fi
215
216 for backend in wl x11 fb dfb dri; do
217 find ${D}${libdir} -name "*-$backend.so" -exec rm '{}' ';'
218 find ${D}${libdir} -name "*.$backend.so" -exec rm '{}' ';'
219 done
220
221 # FIXME: MX6SL does not have 3D support; hack it for now
222 if [ "${IS_MX6SL}" = "1" ]; then
223 rm -rf ${D}${libdir}/libCLC* ${D}${includedir}/CL \
224 \
225 ${D}${libdir}/libGL* ${D}${includedir}/GL* \
226 \
227 ${D}${libdir}/libGLES* \
228 \
229 ${D}${libdir}/libOpenCL* ${D}${includedir}/CL \
230 \
231 ${D}${libdir}/libOpenVG.so ${D}${libdir}/libOpenVG.3d.so \
232 \
233 ${D}${libdir}/libVivanteOpenCL.so \
234 \
235 ${D}/opt/viv_samples/vdk \
236 ${D}/opt/viv_samples/es20 ${D}/opt/viv_samples/cl11
237
238 ln -sf libOpenVG.2d.so ${D}${libdir}/libOpenVG.so
239 fi
240
241 find ${D}${libdir} -type f -exec chmod 644 {} \;
242 find ${D}${includedir} -type f -exec chmod 644 {} \;
243}
244
245ALLOW_EMPTY_${PN} = "1"
246
247FILES_libclc-mx6 = "${libdir}/libCLC${SOLIBS}"
248FILES_libclc-mx6-dev = "${includedir}/CL ${libdir}/libCLC${SOLIBSDEV}"
249FILES_libclc-mx6-dbg = "${libdir}/.debug/libCLC${SOLIBS}"
250
251# libEGL.so is used by some demo apps from Freescale
252INSANE_SKIP_libegl-mx6 += "dev-so"
253FILES_libegl-mx6 = "${libdir}/libEGL${REALSOLIBS} ${libdir}/libEGL${SOLIBSDEV} "
254FILES_libegl-mx6-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
255FILES_libegl-mx6-dbg = "${libdir}/.debug/libEGL${SOLIBS}"
256
257FILES_libgal-mx6 = "${libdir}/libGAL${SOLIBS} ${libdir}/libGAL_egl${SOLIBS}"
258FILES_libgal-mx6-dev = "${libdir}/libGAL${SOLIBSDEV} ${includedir}/HAL"
259FILES_libgal-mx6-dbg = "${libdir}/.debug/libGAL${SOLIBS}"
260
261FILES_libvsc-mx6 = "${libdir}/libVSC${SOLIBS}"
262
263FILES_libgl-mx6 = "${libdir}/libGL${REALSOLIBS}"
264FILES_libgl-mx6-dev = "${libdir}/libGL${SOLIBSDEV}"
265FILES_libgl-mx6-dbg = "${libdir}/.debug/libGL.${SOLIBS}"
266RDEPENDS_libgl-mx6 = "libglapi"
267# Includes GL headers from mesa
268RDEPENDS_libgl-mx6-dev += "libgl-mesa-dev"
269
270# libEGL needs to open libGLESv1.so
271INSANE_SKIP_libgles-mx6 += "dev-so"
272FILES_libgles-mx6 = "${libdir}/libGLESv1*${REALSOLIBS} ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${REALSOLIBS} ${libdir}/libGLES_*${SOLIBS}"
273FILES_libgles-mx6-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${SOLIBSDEV} ${libdir}/pkgconfig/glesv1_cm.pc"
274FILES_libgles-mx6-dbg = "${libdir}/.debug/libGLESv1*${SOLIBS} ${libdir}/.debug/libGLES_*${SOLIBS}"
275
276# libEGL needs to open libGLESv2.so
277INSANE_SKIP_libgles2-mx6 += "dev-so"
278FILES_libgles2-mx6 = "${libdir}/libGLESv2${REALSOLIBS} ${libdir}/libGLESv2${SOLIBS}"
279FILES_libgles2-mx6-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV} ${libdir}/pkgconfig/glesv2.pc"
280FILES_libgles2-mx6-dbg = "${libdir}/.debug/libGLESv2${SOLIBS}"
281RDEPENDS_libgles2-mx6 = "libglslc-mx6"
282
283FILES_libgles3-mx6-dev = "${includedir}/GLES3"
284# as long as there is no libgles3-mx6: ship libgles3-mx6-dev along with
285# libgles2-mx6-dev - otherwise GLES3 headers have to be added manually
286RDEPENDS_libgles2-mx6-dev += "libgles3-mx6-dev"
287
288FILES_libglslc-mx6 = "${libdir}/libGLSLC${SOLIBS}"
289FILES_libglslc-mx6-dev = "${includedir}/CL ${libdir}/libGLSLC${SOLIBSDEV}"
290FILES_libglslc-mx6-dbg = "${libdir}/.debug/libGLSLC${SOLIBS}"
291
292FILES_libopencl-mx6 = "${libdir}/libOpenCL${SOLIBS} \
293 ${libdir}/libVivanteOpenCL${SOLIBS} \
294 ${sysconfdir}/OpenCL/vendors/Vivante.icd"
295FILES_libopencl-mx6-dev = "${includedir}/CL ${libdir}/libOpenCL${SOLIBSDEV}"
296FILES_libopencl-mx6-dbg = "${libdir}/.debug/libOpenCL${SOLIBS}"
297RDEPENDS_libopencl-mx6 = "libclc-mx6"
298
299INSANE_SKIP_libopenvg-mx6 += "dev-so"
300FILES_libopenvg-mx6 = "${libdir}/libOpenVG*${SOLIBS}"
301FILES_libopenvg-mx6-dev = "${includedir}/VG ${libdir}/libOpenVG*${SOLIBSDEV} ${libdir}/pkgconfig/vg.pc"
302FILES_libopenvg-mx6-dbg = "${libdir}/.debug/libOpenVG*${SOLIBS}"
303
304FILES_libvdk-mx6 = "${libdir}/libVDK${SOLIBS}"
305FILES_libvdk-mx6-dev = "${includedir}/*vdk*.h ${libdir}/libVDK${SOLIBSDEV}"
306FILES_libvdk-mx6-dbg = "${libdir}/.debug/libVDK${SOLIBS}"
307
308FILES_libvivante-mx6 = "${libdir}/libVIVANTE${SOLIBS}"
309FILES_libvivante-mx6-dev = "${libdir}/libVIVANTE${SOLIBSDEV}"
310FILES_libvivante-mx6-dbg = "${libdir}/.debug/libVIVANTE${SOLIBS}"
311
312FILES_libvivante-dri-mx6 = "${libdir}/dri/vivante_dri.so"
313RDEPENDS_libvivante-dri-mx6 = "libdrm"
314
315FILES_libvivante-dfb-mx6 = "${libdir}/directfb-*/gfxdrivers/libdirectfb_gal.so"
316
317INSANE_SKIP_libwayland-viv-mx6 += "dev-so"
318FILES_libwayland-viv-mx6 = "${libdir}/libwayland-viv${REALSOLIBS} ${libdir}/libwayland-viv${SOLIBS}"
319FILES_libwayland-viv-mx6-dev = "${includedir}/wayland-viv ${libdir})/libwayland-viv${SOLIBSDEV} ${libdir}/pkgconfig/wayland-viv.pc"
320FILES_libwayland-viv-mx6-dbg = "${libdir}/.debug/libwayland-viv${SOLIBS}"
321
322INSANE_SKIP_libgc-wayland-protocol-mx6 += "dev-so"
323FILES_libgc-wayland-protocol-mx6 = "${libdir}/libgc_wayland_protocol${REALSOLIBS} ${libdir}/libgc_wayland_protocol${SOLIBS}"
324FILES_libgc-wayland-protocol-mx6-dev = "${libdir}/libgc_wayland_protocol${SOLIBSDEV} ${libdir}/pkgconfig/gc_wayland_protocol.pc"
325FILES_libgc-wayland-protocol-mx6-dbg = "${libdir}/libgc_wayland_protocol${SOLIBS}"
326
327FILES_libwayland-egl-mx6-dev = "${libdir}/pkgconfig/wayland-egl.pc"
328
329FILES_libvivante-dfb-mx6 += "${sysconfdir}/directfbrc"
330
331INSANE_SKIP_imx-gpu-viv-g2d += "dev-so"
332FILES_imx-gpu-viv-g2d = "${libdir}/libg2d* "
333FILES_imx-gpu-viv-g2d-dev = "${includedir}/g2d.h"
334FILES_imx-gpu-viv-g2d-dbg = "${libdir}/.debug/libg2d${SOLIBS}"
335
336FILES_imx-gpu-viv-tools = "${bindir}/gmem_info"
337FILES_imx-gpu-viv-tools-dbg = "${bindir}/gmem_info"
338
339FILES_imx-gpu-viv-tools-apitrace = "${bindir} ${libdir}"
340FILES_imx-gpu-viv-tools-apitrace-dbg = "${libdir}/*/*/.debug"
341
342FILES_imx-gpu-viv-demos = "/opt"
343FILES_imx-gpu-viv-demos-dbg = "/opt/viv_samples/*/*/.debug"
344INSANE_SKIP_imx-gpu-viv-demos += "rpaths"
345
346COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-hfp.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-hfp.bb
new file mode 100644
index 00000000..fab7ca11
--- /dev/null
+++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-hfp.bb
@@ -0,0 +1,9 @@
1# Copyright (C) 2013-2015 Freescale Semiconductor
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require imx-gpu-viv.inc
5
6SRC_URI[md5sum] = "8314408acb6b3bc58fcbbb8a0f48b54b"
7SRC_URI[sha256sum] = "0591b495cd1c2547ae007d405b90729e2fb90603a5728b39d1a99cb4e1cf1eb4"
8
9PACKAGE_FP_TYPE = "hardfp"
diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-sfp.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-sfp.bb
new file mode 100644
index 00000000..30d28008
--- /dev/null
+++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_5.0.11.p4.5-sfp.bb
@@ -0,0 +1,12 @@
1# Copyright (C) 2013-2015 Freescale Semiconductor
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4require imx-gpu-viv.inc
5
6SRC_URI[md5sum] = "479dce20e0e2f9f7d0a4e4ff70d4a4b2"
7SRC_URI[sha256sum] = "b5b9c8e216b2bc4281c2443e07eab90547de0abd705614756ed68c7ad2fcf97a"
8
9# FIXME skip the QA error for viv-samples
10INSANE_SKIP_${PN} += "rpaths"
11
12PACKAGE_FP_TYPE = "softfp"
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 00000000..d899540f
--- /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/fix-clear-build-break.patch b/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch
new file mode 100644
index 00000000..eb541d65
--- /dev/null
+++ b/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch
@@ -0,0 +1,17 @@
1mesa-demos: Add extension header to fix build break now that gl1 is removed
2
3Upstream Status: Pending
4
5diff --git a/src/egl/opengles1/clear.c b/src/egl/opengles1/clear.c
6index 9fe1b5291e1905fd6fe572063ed707d59ce45a81..ca9954a21b5f475709dbdef07f90b900962fcbc7 100644
7--- a/src/egl/opengles1/clear.c
8+++ b/src/egl/opengles1/clear.c
9@@ -34,7 +34,7 @@
10 #include <stdio.h>
11 #include <EGL/egl.h>
12 #include <GLES/gl.h>
13-
14+#include <GLES/glext.h>
15 #include "eglut.h"
16
17 typedef void (GL_APIENTRY *type_ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
diff --git a/recipes-graphics/mesa/mesa-demos_%.bbappend b/recipes-graphics/mesa/mesa-demos_%.bbappend
new file mode 100644
index 00000000..9f675a25
--- /dev/null
+++ b/recipes-graphics/mesa/mesa-demos_%.bbappend
@@ -0,0 +1,6 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3SRC_URI_append_mx6 = " file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \
4 file://fix-clear-build-break.patch"
5
6PACKAGECONFIG_remove_mx6sl = "gles1 gles2"
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 00000000..ec11097c
--- /dev/null
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,22 @@
1PACKAGECONFIG_remove_mx5 = "egl gles"
2PROVIDES_remove_mx5 = "virtual/libgles1 virtual/libgles2 virtual/egl"
3
4PACKAGECONFIG_remove_mx6 = "egl gles"
5
6# i.MX6SL uses mesa software rendering
7
8PROVIDES_remove_mx6 = "virtual/libgles1 virtual/libgles2 virtual/egl"
9PROVIDES_remove_mx6q = "virtual/libgl"
10PROVIDES_remove_mx6dl = "virtual/libgl"
11PROVIDES_remove_mx6sx = "virtual/libgl"
12
13USE_VIV_LIBGL = "yes"
14USE_VIV_LIBGL_mx6sl = "no"
15
16# FIXME: Dirty hack to allow use of Vivante GPU libGL binary
17do_install_append_mx6 () {
18 if [ "${USE_VIV_LIBGL}" = "yes" ]; then
19 rm -f ${D}${libdir}/libGL.*
20 fi
21}
22EXTRA_OECONF_mx6 := "${@'${EXTRA_OECONF}'.replace('--enable-glx-tls','--enable-glx')}"
diff --git a/recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend b/recipes-graphics/packagegroups/packagegroup-core-directfb.bbappend
new file mode 100644
index 00000000..a95af537
--- /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 00000000..316bec99
--- /dev/null
+++ b/recipes-graphics/piglit/piglit_git.bbappend
@@ -0,0 +1,7 @@
1DEPENDS_append_mx6 = " virtual/egl"
2
3# Provide the need flags and backend settings to work with Vivante GPU
4CFLAGS_append_mx6 = " -DLINUX \
5 ${@base_contains('DISTRO_FEATURES', 'x11', '-DEGL_API_FB', \
6 base_contains('DISTRO_FEATURES', 'wayland', \
7 '-DEGL_API_WL', '', d), d)}"
diff --git a/recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch b/recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch
new file mode 100644
index 00000000..80505bdc
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-MGS-840-Add-i.MX6-support-for-weston.patch
@@ -0,0 +1,1709 @@
1From 0da66b0b96a7059392f0b62d3a13fcedf1023ba8 Mon Sep 17 00:00:00 2001
2From: Prabhu <prabhu.sundararaj@freescale.com>
3Date: Wed, 24 Jun 2015 17:29:03 -0500
4Subject: [PATCH] MGS-840 Add i.MX6 support for weston
5
6Add fbdev backend support for Vivante FBdev EGL
7
8Date: June 24, 2015
9Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com>
10---
11 Makefile.am | 13 +
12 src/compositor-fbdev.c | 139 ++++-
13 src/gal2d-renderer.c | 1337 ++++++++++++++++++++++++++++++++++++++++++++++++
14 src/gal2d-renderer.h | 47 ++
15 4 files changed, 1519 insertions(+), 17 deletions(-)
16 mode change 100644 => 100755 Makefile.am
17 create mode 100644 src/gal2d-renderer.c
18 create mode 100644 src/gal2d-renderer.h
19
20diff --git a/Makefile.am b/Makefile.am
21old mode 100644
22new mode 100755
23index 5819b19..e7e2d49
24--- a/Makefile.am
25+++ b/Makefile.am
26@@ -207,6 +207,19 @@ gl_renderer_la_SOURCES = \
27 src/vertex-clipping.h
28 endif
29
30+module_LTLIBRARIES += gal2d-renderer.la
31+gal2d_renderer_la_LDFLAGS = -module -avoid-version
32+gal2d_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS)
33+gal2d_renderer_la_CFLAGS = \
34+ $(COMPOSITOR_CFLAGS) \
35+ $(EGL_CFLAGS) \
36+ $(GCC_CFLAGS)
37+gal2d_renderer_la_SOURCES = \
38+ src/gal2d-renderer.h \
39+ src/gal2d-renderer.c \
40+ src/vertex-clipping.c \
41+ src/vertex-clipping.h
42+
43 if ENABLE_X11_COMPOSITOR
44 module_LTLIBRARIES += x11-backend.la
45 x11_backend_la_LDFLAGS = -module -avoid-version
46diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
47index 3f3394f..9d18c45 100644
48--- a/src/compositor-fbdev.c
49+++ b/src/compositor-fbdev.c
50@@ -45,6 +45,7 @@
51 #include "libinput-seat.h"
52 #include "gl-renderer.h"
53 #include "presentation_timing-server-protocol.h"
54+#include "gal2d-renderer.h"
55
56 struct fbdev_compositor {
57 struct weston_compositor base;
58@@ -53,7 +54,9 @@ struct fbdev_compositor {
59 struct udev *udev;
60 struct udev_input input;
61 int use_pixman;
62+ int use_gal2d;
63 struct wl_listener session_listener;
64+ NativeDisplayType display;
65 };
66
67 struct fbdev_screeninfo {
68@@ -88,15 +91,20 @@ struct fbdev_output {
69 pixman_image_t *shadow_surface;
70 void *shadow_buf;
71 uint8_t depth;
72+
73+ NativeDisplayType display;
74+ NativeWindowType window;
75 };
76
77 struct fbdev_parameters {
78 int tty;
79 char *device;
80 int use_gl;
81+ int use_gal2d;
82 };
83
84 struct gl_renderer_interface *gl_renderer;
85+struct gal2d_renderer_interface *gal2d_renderer;
86
87 static const char default_seat[] = "seat0";
88
89@@ -471,6 +479,10 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output)
90 strerror(errno));
91
92 output->fb = NULL;
93+ if(output->window)
94+ fbDestroyWindow(output->window);
95+ if(output->display)
96+ fbDestroyDisplay(output->display);
97 }
98
99 static void fbdev_output_destroy(struct weston_output *base);
100@@ -478,7 +490,7 @@ static void fbdev_output_disable(struct weston_output *base);
101
102 static int
103 fbdev_output_create(struct fbdev_compositor *compositor,
104- const char *device)
105+ int x, int y, const char *device)
106 {
107 struct fbdev_output *output;
108 struct weston_config_section *section;
109@@ -489,7 +501,7 @@ fbdev_output_create(struct fbdev_compositor *compositor,
110 uint32_t config_transform;
111 char *s;
112
113- weston_log("Creating fbdev output.\n");
114+ weston_log("Creating fbdev output. %s x=%d y=%d\n", device, x, y);
115
116 output = zalloc(sizeof *output);
117 if (output == NULL)
118@@ -542,7 +554,7 @@ fbdev_output_create(struct fbdev_compositor *compositor,
119 free(s);
120
121 weston_output_init(&output->base, &compositor->base,
122- 0, 0, output->fb_info.width_mm,
123+ x, y, output->fb_info.width_mm,
124 output->fb_info.height_mm,
125 config_transform,
126 1);
127@@ -565,12 +577,43 @@ fbdev_output_create(struct fbdev_compositor *compositor,
128 if (compositor->use_pixman) {
129 if (pixman_renderer_output_create(&output->base) < 0)
130 goto out_shadow_surface;
131- } else {
132+ }
133+ else if(compositor->use_gal2d) {
134+
135+ char* fbenv = getenv("FB_FRAMEBUFFER_0");
136+ setenv("FB_FRAMEBUFFER_0", device, 1);
137+ output->display = fbGetDisplay(compositor->base.wl_display);
138+ if (output->display == NULL) {
139+ fprintf(stderr, "failed to get display\n");
140+ return 0;
141+ }
142+
143+ output->window = fbCreateWindow(output->display, -1, -1, 0, 0);
144+ if (output->window == NULL) {
145+ fprintf(stderr, "failed to create window\n");
146+ return 0;
147+ }
148+ setenv("FB_FRAMEBUFFER_0", fbenv, 1);
149+
150+ if (gal2d_renderer->output_create(&output->base,
151+ output->display,
152+ (NativeWindowType)output->window) < 0) {
153+ weston_log("gal_renderer_output_create failed.\n");
154+ goto out_shadow_surface;
155+ }
156+
157+ }
158+ else {
159 setenv("HYBRIS_EGLPLATFORM", "wayland", 1);
160+ output->window = fbCreateWindow(compositor->display, -1, -1, 0, 0);
161+ if (output->window == NULL) {
162+ fprintf(stderr, "failed to create window\n");
163+ return 0;
164+ }
165 if (gl_renderer->output_create(&output->base,
166- (EGLNativeWindowType)NULL, NULL,
167- gl_renderer->opaque_attribs,
168- NULL, 0) < 0) {
169+ (NativeWindowType)output->window, NULL,
170+ gl_renderer->opaque_attribs,
171+ NULL, 0) < 0) {
172 weston_log("gl_renderer_output_create failed.\n");
173 goto out_shadow_surface;
174 }
175@@ -629,7 +672,11 @@ fbdev_output_destroy(struct weston_output *base)
176 free(output->shadow_buf);
177 output->shadow_buf = NULL;
178 }
179- } else {
180+ }
181+ else if (compositor->use_gal2d) {
182+ gal2d_renderer->output_destroy(base);
183+ }
184+ else {
185 gl_renderer->output_destroy(base);
186 }
187
188@@ -692,7 +739,7 @@ fbdev_output_reenable(struct fbdev_compositor *compositor,
189 * are re-initialised. */
190 device = output->device;
191 fbdev_output_destroy(base);
192- fbdev_output_create(compositor, device);
193+ fbdev_output_create(compositor, 0, 0, device);
194
195 return 0;
196 }
197@@ -850,7 +897,10 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
198 compositor->base.restore = fbdev_restore;
199
200 compositor->prev_state = WESTON_COMPOSITOR_ACTIVE;
201- compositor->use_pixman = !param->use_gl;
202+ compositor->use_gal2d = param->use_gal2d;
203+ weston_log("compositor->use_gal2d=%d\n", compositor->use_gal2d);
204+ if(param->use_gl == 0 && param->use_gal2d == 0)
205+ compositor->use_pixman = 1;
206
207 for (key = KEY_F1; key < KEY_F9; key++)
208 weston_compositor_add_key_binding(&compositor->base, key,
209@@ -860,7 +910,50 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
210 if (compositor->use_pixman) {
211 if (pixman_renderer_init(&compositor->base) < 0)
212 goto out_launcher;
213- } else {
214+ }
215+ else if (compositor->use_gal2d) {
216+ int x = 0, y = 0;
217+ int i=0;
218+ int count = 0;
219+ int k=0, dispCount = 0;
220+ char displays[5][32];
221+ gal2d_renderer = weston_load_module("gal2d-renderer.so",
222+ "gal2d_renderer_interface");
223+ if (!gal2d_renderer) {
224+ weston_log("could not load gal2d renderer\n");
225+ goto out_launcher;
226+ }
227+
228+ if (gal2d_renderer->create(&compositor->base) < 0) {
229+ weston_log("gal2d_renderer_create failed.\n");
230+ goto out_launcher;
231+ }
232+
233+ weston_log("param->device=%s\n",param->device);
234+ count = strlen(param->device);
235+
236+ for(i= 0; i < count; i++) {
237+ if(param->device[i] == ',') {
238+ displays[dispCount][k] = '\0';
239+ dispCount++;
240+ k = 0;
241+ continue;
242+ }
243+ displays[dispCount][k++] = param->device[i];
244+ }
245+ displays[dispCount][k] = '\0';
246+ dispCount++;
247+
248+ for(i=0; i<dispCount; i++)
249+ {
250+ if (fbdev_output_create(compositor, x, y, displays[i]) < 0)
251+ goto out_pixman;
252+ x += container_of(compositor->base.output_list.prev,
253+ struct weston_output,
254+ link)->width;
255+ }
256+ }
257+ else {
258 gl_renderer = weston_load_module("gl-renderer.so",
259 "gl_renderer_interface");
260 if (!gl_renderer) {
261@@ -868,17 +961,22 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
262 goto out_launcher;
263 }
264
265- if (gl_renderer->create(&compositor->base, NO_EGL_PLATFORM,
266- EGL_DEFAULT_DISPLAY,
267+ compositor->display = fbGetDisplay(compositor->base.wl_display);
268+ if (compositor->display == NULL) {
269+ weston_log("fbGetDisplay failed.\n");
270+ goto out_launcher;
271+ }
272+
273+ if (gl_renderer->create(&compositor->base, NO_EGL_PLATFORM, compositor->display,
274 gl_renderer->opaque_attribs,
275 NULL, 0) < 0) {
276 weston_log("gl_renderer_create failed.\n");
277 goto out_launcher;
278 }
279 }
280-
281- if (fbdev_output_create(compositor, param->device) < 0)
282- goto out_pixman;
283+ if(!compositor->use_gal2d)
284+ if (fbdev_output_create(compositor, 0, 0, param->device) < 0)
285+ goto out_pixman;
286
287 udev_input_init(&compositor->input, &compositor->base, compositor->udev, seat_id);
288
289@@ -911,13 +1009,20 @@ backend_init(struct wl_display *display, int *argc, char *argv[],
290 struct fbdev_parameters param = {
291 .tty = 0, /* default to current tty */
292 .device = "/dev/fb0", /* default frame buffer */
293+#ifdef ENABLE_EGL
294+ .use_gl = 1,
295+ .use_gal2d = 0,
296+#else
297 .use_gl = 0,
298+ .use_gal2d = 1,
299+#endif
300 };
301
302 const struct weston_option fbdev_options[] = {
303 { WESTON_OPTION_INTEGER, "tty", 0, &param.tty },
304 { WESTON_OPTION_STRING, "device", 0, &param.device },
305- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &param.use_gl },
306+ { WESTON_OPTION_INTEGER, "use-gl", 0, &param.use_gl },
307+ { WESTON_OPTION_INTEGER, "use-gal2d", 0, &param.use_gal2d },
308 };
309
310 parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv);
311diff --git a/src/gal2d-renderer.c b/src/gal2d-renderer.c
312new file mode 100644
313index 0000000..7ebbf98
314--- /dev/null
315+++ b/src/gal2d-renderer.c
316@@ -0,0 +1,1337 @@
317+/*
318+ * Copyright (c) 2015 Freescale Semiconductor, Inc.
319+ * Copyright © 2012 Intel Corporation
320+ *
321+ * Permission to use, copy, modify, distribute, and sell this software and
322+ * its documentation for any purpose is hereby granted without fee, provided
323+ * that the above copyright notice appear in all copies and that both that
324+ * copyright notice and this permission notice appear in supporting
325+ * documentation, and that the name of the copyright holders not be used in
326+ * advertising or publicity pertaining to distribution of the software
327+ * without specific, written prior permission. The copyright holders make
328+ * no representations about the suitability of this software for any
329+ * purpose. It is provided "as is" without express or implied warranty.
330+ *
331+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
332+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
333+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
334+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
335+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
336+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
337+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
338+ */
339+
340+#define _GNU_SOURCE
341+
342+#include <stdlib.h>
343+#include <string.h>
344+#include <ctype.h>
345+#include <float.h>
346+#include <assert.h>
347+#include <pthread.h>
348+
349+#include "compositor.h"
350+#include "gal2d-renderer.h"
351+#include "vertex-clipping.h"
352+#include "HAL/gc_hal.h"
353+#include "HAL/gc_hal_raster.h"
354+#include "HAL/gc_hal_eglplatform.h"
355+
356+#define galONERROR(x) if(status < 0) printf("Error in function %s\n", __func__);
357+
358+struct gal2d_output_state {
359+
360+ int current_buffer;
361+ pixman_region32_t buffer_damage[2];
362+ NativeDisplayType display;
363+ gcoSURF* renderSurf;
364+ gctUINT32 nNumBuffers;
365+ int activebuffer;
366+ gcoSURF offscreenSurface;
367+ gceSURF_FORMAT format;
368+ pthread_mutex_t workerMutex;
369+ pthread_t workerId;
370+ gctUINT32 exitWorker;
371+ gctSIGNAL signal;
372+ gctSIGNAL busySignal;
373+ gcsHAL_INTERFACE iface;
374+ int directBlit;
375+ gctINT width;
376+ gctINT height;
377+};
378+
379+struct gal2d_surface_state {
380+ float color[4];
381+ struct weston_buffer_reference buffer_ref;
382+ int pitch; /* in pixels */
383+ pixman_region32_t texture_damage;
384+ gcoSURF gco_Surface;
385+
386+ struct weston_surface *surface;
387+ struct wl_listener surface_destroy_listener;
388+ struct wl_listener renderer_destroy_listener;
389+};
390+
391+struct gal2d_renderer {
392+ struct weston_renderer base;
393+ struct wl_signal destroy_signal;
394+ gcoOS gcos;
395+ gcoHAL gcoHal;
396+ gco2D gcoEngine2d;
397+ gctPOINTER localInfo;
398+};
399+
400+static int
401+gal2d_renderer_create_surface(struct weston_surface *surface);
402+
403+static inline struct gal2d_surface_state *
404+get_surface_state(struct weston_surface *surface)
405+{
406+ if (!surface->renderer_state)
407+ gal2d_renderer_create_surface(surface);
408+ return (struct gal2d_surface_state *)surface->renderer_state;
409+}
410+
411+static inline struct gal2d_renderer *
412+get_renderer(struct weston_compositor *ec)
413+{
414+ return (struct gal2d_renderer *)ec->renderer;
415+}
416+
417+
418+
419+#define max(a, b) (((a) > (b)) ? (a) : (b))
420+#define min(a, b) (((a) > (b)) ? (b) : (a))
421+/*
422+ * Compute the boundary vertices of the intersection of the global coordinate
423+ * aligned rectangle 'rect', and an arbitrary quadrilateral produced from
424+ * 'surf_rect' when transformed from surface coordinates into global coordinates.
425+ * The vertices are written to 'ex' and 'ey', and the return value is the
426+ * number of vertices. Vertices are produced in clockwise winding order.
427+ * Guarantees to produce either zero vertices, or 3-8 vertices with non-zero
428+ * polygon area.
429+ */
430+static int
431+calculate_edges(struct weston_view *ev, pixman_box32_t *rect,
432+ pixman_box32_t *surf_rect, float *ex, float *ey)
433+{
434+
435+ struct clip_context ctx;
436+ int i, n;
437+ float min_x, max_x, min_y, max_y;
438+ struct polygon8 surf = {
439+ { surf_rect->x1, surf_rect->x2, surf_rect->x2, surf_rect->x1 },
440+ { surf_rect->y1, surf_rect->y1, surf_rect->y2, surf_rect->y2 },
441+ 4
442+ };
443+
444+ ctx.clip.x1 = rect->x1;
445+ ctx.clip.y1 = rect->y1;
446+ ctx.clip.x2 = rect->x2;
447+ ctx.clip.y2 = rect->y2;
448+
449+ /* transform surface to screen space: */
450+ for (i = 0; i < surf.n; i++)
451+ weston_view_to_global_float(ev, surf.x[i], surf.y[i],
452+ &surf.x[i], &surf.y[i]);
453+
454+ /* find bounding box: */
455+ min_x = max_x = surf.x[0];
456+ min_y = max_y = surf.y[0];
457+
458+ for (i = 1; i < surf.n; i++) {
459+ min_x = min(min_x, surf.x[i]);
460+ max_x = max(max_x, surf.x[i]);
461+ min_y = min(min_y, surf.y[i]);
462+ max_y = max(max_y, surf.y[i]);
463+ }
464+
465+ /* First, simple bounding box check to discard early transformed
466+ * surface rects that do not intersect with the clip region:
467+ */
468+ if ((min_x >= ctx.clip.x2) || (max_x <= ctx.clip.x1) ||
469+ (min_y >= ctx.clip.y2) || (max_y <= ctx.clip.y1))
470+ return 0;
471+
472+ /* Simple case, bounding box edges are parallel to surface edges,
473+ * there will be only four edges. We just need to clip the surface
474+ * vertices to the clip rect bounds:
475+ */
476+ if (!ev->transform.enabled)
477+ return clip_simple(&ctx, &surf, ex, ey);
478+
479+ /* Transformed case: use a general polygon clipping algorithm to
480+ * clip the surface rectangle with each side of 'rect'.
481+ * The algorithm is Sutherland-Hodgman, as explained in
482+ * http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c8965/Polygon-Clipping.htm
483+ * but without looking at any of that code.
484+ */
485+ n = clip_transformed(&ctx, &surf, ex, ey);
486+
487+ if (n < 3)
488+ return 0;
489+
490+ return n;
491+}
492+
493+
494+static inline struct gal2d_output_state *
495+get_output_state(struct weston_output *output)
496+{
497+ return (struct gal2d_output_state *)output->renderer_state;
498+}
499+
500+static gctUINT32
501+galGetStretchFactor(gctINT32 SrcSize, gctINT32 DestSize)
502+{
503+ gctUINT stretchFactor;
504+ if ( (SrcSize > 0) && (DestSize > 1) )
505+ {
506+ stretchFactor = ((SrcSize - 1) << 16) / (DestSize - 1);
507+ }
508+ else
509+ {
510+ stretchFactor = 0;
511+ }
512+ return stretchFactor;
513+}
514+
515+static gceSTATUS
516+galGetStretchFactors(
517+ IN gcsRECT_PTR SrcRect,
518+ IN gcsRECT_PTR DestRect,
519+ OUT gctUINT32 * HorFactor,
520+ OUT gctUINT32 * VerFactor
521+ )
522+{
523+ if (HorFactor != gcvNULL)
524+ {
525+ gctINT32 src, dest;
526+
527+ /* Compute width of rectangles. */
528+ gcmVERIFY_OK(gcsRECT_Width(SrcRect, &src));
529+ gcmVERIFY_OK(gcsRECT_Width(DestRect, &dest));
530+
531+ /* Compute and return horizontal stretch factor. */
532+ *HorFactor = galGetStretchFactor(src, dest);
533+ }
534+
535+ if (VerFactor != gcvNULL)
536+ {
537+ gctINT32 src, dest;
538+
539+ /* Compute height of rectangles. */
540+ gcmVERIFY_OK(gcsRECT_Height(SrcRect, &src));
541+ gcmVERIFY_OK(gcsRECT_Height(DestRect, &dest));
542+
543+ /* Compute and return vertical stretch factor. */
544+ *VerFactor = galGetStretchFactor(src, dest);
545+ }
546+ /* Success. */
547+ return gcvSTATUS_OK;
548+}
549+
550+static gceSTATUS
551+gal2d_getSurfaceFormat(halDISPLAY_INFO info, gceSURF_FORMAT * Format)
552+{
553+ /* Get the color format. */
554+ switch (info.greenLength)
555+ {
556+ case 4:
557+ if (info.blueOffset == 0)
558+ {
559+ *Format = (info.alphaLength == 0) ? gcvSURF_X4R4G4B4 : gcvSURF_A4R4G4B4;
560+ }
561+ else
562+ {
563+ *Format = (info.alphaLength == 0) ? gcvSURF_X4B4G4R4 : gcvSURF_A4B4G4R4;
564+ }
565+ break;
566+
567+ case 5:
568+ if (info.blueOffset == 0)
569+ {
570+ *Format = (info.alphaLength == 0) ? gcvSURF_X1R5G5B5 : gcvSURF_A1R5G5B5;
571+ }
572+ else
573+ {
574+ *Format = (info.alphaLength == 0) ? gcvSURF_X1B5G5R5 : gcvSURF_A1B5G5R5;
575+ }
576+ break;
577+
578+ case 6:
579+ *Format = gcvSURF_R5G6B5;
580+ break;
581+
582+ case 8:
583+ if (info.blueOffset == 0)
584+ {
585+ *Format = (info.alphaLength == 0) ? gcvSURF_X8R8G8B8 : gcvSURF_A8R8G8B8;
586+ }
587+ else
588+ {
589+ *Format = (info.alphaLength == 0) ? gcvSURF_X8B8G8R8 : gcvSURF_A8B8G8R8;
590+ }
591+ break;
592+
593+ default:
594+ /* Unsupported color depth. */
595+ return gcvSTATUS_INVALID_ARGUMENT;
596+ }
597+ /* Success. */
598+ return gcvSTATUS_OK;
599+}
600+
601+static gceSTATUS galIsYUVFormat(IN gceSURF_FORMAT Format)
602+{
603+ switch (Format)
604+ {
605+ case gcvSURF_YUY2:
606+ case gcvSURF_UYVY:
607+ case gcvSURF_I420:
608+ case gcvSURF_YV12:
609+ case gcvSURF_NV16:
610+ case gcvSURF_NV12:
611+ case gcvSURF_NV61:
612+ case gcvSURF_NV21:
613+
614+ return gcvSTATUS_TRUE;
615+
616+ default:
617+ return gcvSTATUS_FALSE;
618+ }
619+}
620+
621+static gceSTATUS galQueryUVStride(
622+ IN gceSURF_FORMAT Format,
623+ IN gctUINT32 yStride,
624+ OUT gctUINT32_PTR uStride,
625+ OUT gctUINT32_PTR vStride
626+ )
627+{
628+ switch (Format)
629+ {
630+ case gcvSURF_YUY2:
631+ case gcvSURF_UYVY:
632+ *uStride = *vStride = 0;
633+ break;
634+
635+ case gcvSURF_I420:
636+ case gcvSURF_YV12:
637+ *uStride = *vStride = yStride / 2;
638+ break;
639+
640+ case gcvSURF_NV16:
641+ case gcvSURF_NV12:
642+ case gcvSURF_NV61:
643+ case gcvSURF_NV21:
644+
645+ *uStride = yStride;
646+ *vStride = 0;
647+ break;
648+
649+ default:
650+ return gcvSTATUS_NOT_SUPPORTED;
651+ }
652+
653+ return gcvSTATUS_OK;
654+}
655+
656+static int
657+make_current(struct gal2d_renderer *gr, gcoSURF surface)
658+{
659+ gceSTATUS status = gcvSTATUS_OK;
660+ gctUINT width = 0;
661+ gctUINT height = 0;
662+ gctINT stride = 0;
663+ gctUINT32 physical[3];
664+ gctPOINTER va =0;
665+ gceSURF_FORMAT format;
666+
667+ if(!surface)
668+ goto OnError;
669+
670+
671+ gcmONERROR(gcoSURF_GetAlignedSize(surface, &width, &height, &stride));
672+ gcmONERROR(gcoSURF_GetFormat(surface, gcvNULL, &format));
673+ gcmONERROR(gcoSURF_Lock(surface, &physical[0], (gctPOINTER *)&va));
674+ gco2D_SetGenericTarget(gr->gcoEngine2d,
675+ &physical[0], 1,
676+ &stride, 1,
677+ gcvLINEAR, format,
678+ gcvSURF_0_DEGREE, width, height);
679+
680+ gcmONERROR(gcoSURF_Unlock(surface, (gctPOINTER *)&va));
681+OnError:
682+ galONERROR(status);
683+ return status;
684+}
685+
686+static gceSTATUS
687+gal2d_clear(struct weston_output *base)
688+{
689+ struct gal2d_renderer *gr = get_renderer(base->compositor);
690+ struct gal2d_output_state *go = get_output_state(base);
691+ gceSTATUS status = gcvSTATUS_OK;
692+
693+ gctINT stride = 0;
694+ gctUINT width = 0, height = 0;
695+ gcsRECT dstRect = {0};
696+ gcmONERROR(gcoSURF_GetAlignedSize(go->renderSurf[go->activebuffer],
697+ &width, &height, &stride));
698+ dstRect.right = width;
699+ dstRect.bottom = height;
700+ gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
701+ gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
702+ gcmONERROR(gco2D_Clear(gr->gcoEngine2d, 1, &dstRect, 0xff0000ff, 0xCC, 0xCC, go->format));
703+ gcmONERROR(gcoHAL_Commit(gr->gcoHal, gcvTRUE));
704+
705+OnError:
706+ galONERROR(status);
707+
708+ return status;
709+}
710+
711+static gcoSURF getSurfaceFromShm(struct weston_surface *es, struct weston_buffer *buffer)
712+{
713+ struct gal2d_renderer *gr = get_renderer(es->compositor);
714+
715+ gcoSURF surface = 0;
716+ gceSURF_FORMAT format;
717+ gcePOOL pool = gcvPOOL_DEFAULT;
718+
719+ if (wl_shm_buffer_get_format(buffer->shm_buffer) == WL_SHM_FORMAT_XRGB8888)
720+ format = gcvSURF_X8R8G8B8;
721+ else
722+ format = gcvSURF_A8R8G8B8;
723+
724+ if(buffer->width == ((buffer->width + 0x7) & ~0x7))
725+ {
726+ pool = gcvPOOL_USER;
727+ }
728+
729+ gcmVERIFY_OK(gcoSURF_Construct(gr->gcoHal,
730+ (gctUINT) buffer->width,
731+ (gctUINT) buffer->height,
732+ 1, gcvSURF_BITMAP,
733+ format, pool, &surface));
734+
735+ if(pool == gcvPOOL_USER)
736+ {
737+ gcmVERIFY_OK(gcoSURF_MapUserSurface(surface, 1,
738+ (gctPOINTER)wl_shm_buffer_get_data(buffer->shm_buffer), gcvINVALID_ADDRESS));
739+ }
740+
741+ return surface;
742+}
743+
744+static int
745+gal2dBindBuffer(struct weston_surface* es)
746+{
747+ struct gal2d_surface_state *gs = get_surface_state(es);
748+ gceSTATUS status = gcvSTATUS_OK;
749+ gcoSURF surface = gs->gco_Surface;
750+ struct weston_buffer *buffer = gs->buffer_ref.buffer;
751+ gcePOOL pool = gcvPOOL_DEFAULT;
752+
753+ gcmVERIFY_OK(gcoSURF_QueryVidMemNode(surface, gcvNULL,
754+ &pool, gcvNULL));
755+
756+ if(pool != gcvPOOL_USER)
757+ {
758+ gctUINT alignedWidth;
759+ gctPOINTER logical = (gctPOINTER)wl_shm_buffer_get_data(buffer->shm_buffer);
760+ gctPOINTER va =0;
761+
762+
763+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(surface, &alignedWidth, gcvNULL, gcvNULL));
764+ gcmVERIFY_OK(gcoSURF_Lock(surface, gcvNULL, (gctPOINTER *)&va));
765+
766+ if(alignedWidth == (unsigned int)buffer->width)
767+ {
768+ int size = wl_shm_buffer_get_stride(buffer->shm_buffer)*buffer->height;
769+ memcpy(va, logical, size);
770+ }
771+ else
772+ {
773+ int i, j;
774+ for (i = 0; i < buffer->height; i++)
775+ {
776+ for (j = 0; j < buffer->width; j++)
777+ {
778+ gctUINT dstOff = i * alignedWidth + j;
779+ gctUINT srcOff = (i * buffer->width + j);
780+
781+ memcpy(va + dstOff * 4, logical + srcOff * 4, 4);
782+ }
783+ }
784+ }
785+ gcmVERIFY_OK(gcoSURF_Unlock(surface, (gctPOINTER)va));
786+ }
787+
788+ return status;
789+}
790+
791+static void
792+gal2d_flip_surface(struct weston_output *output)
793+{
794+ struct gal2d_output_state *go = get_output_state(output);
795+
796+ if(go->nNumBuffers > 1)
797+ {
798+ gctUINT Offset;
799+ gctINT X;
800+ gctINT Y;
801+
802+ gcmVERIFY_OK(gcoOS_GetDisplayBackbuffer(go->display, gcvNULL,
803+ gcvNULL, gcvNULL, &Offset, &X, &Y));
804+
805+ gcmVERIFY_OK(gcoOS_SetDisplayVirtual(go->display, gcvNULL,
806+ Offset, X, Y));
807+ }
808+}
809+
810+static void *gal2d_output_worker(void *arg)
811+{
812+ struct weston_output *output = (struct weston_output *)arg;
813+ struct gal2d_output_state *go = get_output_state(output);
814+
815+ while(1)
816+ {
817+ if(gcoOS_WaitSignal(gcvNULL, go->signal, gcvINFINITE) == gcvSTATUS_OK )
818+ {
819+ gal2d_flip_surface(output);
820+ gcoOS_Signal(gcvNULL,go->busySignal, gcvTRUE);
821+ }
822+ pthread_mutex_lock(&go->workerMutex);
823+ if(go->exitWorker == 1)
824+ {
825+ pthread_mutex_unlock(&go->workerMutex);
826+ break;
827+ }
828+ pthread_mutex_unlock(&go->workerMutex);
829+ }
830+ return 0;
831+}
832+
833+static int
834+update_surface(struct weston_output *output)
835+{
836+ struct gal2d_renderer *gr = get_renderer(output->compositor);
837+ struct gal2d_output_state *go = get_output_state(output);
838+ gceSTATUS status = gcvSTATUS_OK;
839+
840+ if(go->nNumBuffers == 1)
841+ {
842+ if(!go->directBlit && go->offscreenSurface)
843+ {
844+ make_current(gr, go->renderSurf[go->activebuffer]);
845+
846+ gctUINT srcWidth = 0;
847+ gctUINT srcHeight = 0;
848+ gceSURF_FORMAT srcFormat;;
849+ gcsRECT dstRect = {0};
850+ gcoSURF srcSurface = go->offscreenSurface;
851+ gctUINT32 srcPhyAddr[3];
852+ gctUINT32 srcStride[3];
853+
854+ gctPOINTER va =0;
855+
856+ gcmONERROR(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, (gctINT *)&srcStride[0]));
857+ gcmONERROR(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
858+
859+ gcmONERROR(gcoSURF_Lock(srcSurface, srcPhyAddr, (gctPOINTER *)&va));
860+ gcmONERROR(gco2D_SetCurrentSourceIndex(gr->gcoEngine2d, 0U));
861+
862+ gco2D_SetGenericSource(gr->gcoEngine2d, srcPhyAddr, 1,
863+ srcStride, 1,
864+ gcvLINEAR, srcFormat, gcvSURF_0_DEGREE,
865+ srcWidth, srcHeight);
866+
867+ dstRect.left = 0;
868+ dstRect.top = 0;
869+ dstRect.right = srcWidth;
870+ dstRect.bottom = srcHeight;
871+
872+ gcmONERROR(gco2D_SetSource(gr->gcoEngine2d, &dstRect));
873+ gcmONERROR(gco2D_SetClipping(gr->gcoEngine2d, &dstRect));
874+ gcmONERROR(gco2D_Blit(gr->gcoEngine2d, 1, &dstRect, 0xCC, 0xCC, go->format));
875+ gcmONERROR(gcoSURF_Unlock(srcSurface, (gctPOINTER *)&va));
876+ }
877+ gcmONERROR(gcoHAL_Commit(gr->gcoHal, gcvFALSE));
878+ }
879+ else if(go->nNumBuffers > 1)
880+ {
881+ gcoHAL_ScheduleEvent(gr->gcoHal, &go->iface);
882+ gcmVERIFY_OK(gcoHAL_Commit(gr->gcoHal, gcvFALSE));
883+ }
884+OnError:
885+ galONERROR(status);
886+ return status;
887+ }
888+
889+static int
890+is_view_visible(struct weston_view *view)
891+{
892+ /* Return false, if surface is guaranteed to be totally obscured. */
893+ int ret;
894+ pixman_region32_t unocc;
895+
896+ pixman_region32_init(&unocc);
897+ pixman_region32_subtract(&unocc, &view->transform.boundingbox,
898+ &view->clip);
899+ ret = pixman_region32_not_empty(&unocc);
900+ pixman_region32_fini(&unocc);
901+
902+ return ret;
903+}
904+
905+static int
906+use_output(struct weston_output *output)
907+{
908+ struct weston_compositor *compositor = output->compositor;
909+ struct weston_view *view;
910+ struct gal2d_output_state *go = get_output_state(output);
911+ struct gal2d_renderer *gr = get_renderer(output->compositor);
912+ gceSTATUS status = gcvSTATUS_OK;
913+
914+ gcoSURF surface;
915+ int visibleViews=0;
916+ int fullscreenViews=0;
917+
918+ surface = go->renderSurf[go->activebuffer];
919+ if(go->nNumBuffers == 1)
920+ {
921+ wl_list_for_each_reverse(view, &compositor->view_list, link)
922+ if (view->plane == &compositor->primary_plane && is_view_visible(view))
923+ {
924+ visibleViews++;
925+ if(view->surface->width == go->width && view->surface->height == go->height)
926+ {
927+ pixman_box32_t *bb_rects;
928+ int nbb=0;
929+ bb_rects = pixman_region32_rectangles(&view->transform.boundingbox, &nbb);
930+ if(nbb == 1)
931+ if(bb_rects[0].x1 == 0 && bb_rects[0].y1 ==0)
932+ fullscreenViews++;
933+ }
934+ }
935+
936+ go->directBlit = ((visibleViews == 1) || (fullscreenViews > 1));
937+
938+ if(!go->directBlit)
939+ {
940+ surface = go->offscreenSurface;
941+ }
942+ }
943+ make_current(gr, surface);
944+ return status;
945+}
946+
947+static int
948+gal2d_renderer_read_pixels(struct weston_output *output,
949+ pixman_format_code_t format, void *pixels,
950+ uint32_t x, uint32_t y,
951+ uint32_t width, uint32_t height)
952+{
953+ return 0;
954+}
955+
956+static int gal2d_int_from_double(double d)
957+{
958+ return wl_fixed_to_int(wl_fixed_from_double(d));
959+}
960+
961+static void
962+repaint_region(struct weston_view *ev, struct weston_output *output, struct gal2d_output_state *go, pixman_region32_t *region,
963+ pixman_region32_t *surf_region){
964+
965+ struct gal2d_renderer *gr = get_renderer(ev->surface->compositor);
966+ struct gal2d_surface_state *gs = get_surface_state(ev->surface);
967+
968+ pixman_box32_t *rects, *surf_rects, *bb_rects;
969+ int i, j, nrects, nsurf, nbb=0;
970+ gceSTATUS status = gcvSTATUS_OK;
971+ gcoSURF srcSurface = gs->gco_Surface;
972+ gcsRECT srcRect = {0};
973+ gcsRECT dstrect = {0};
974+ gctUINT32 horFactor, verFactor;
975+ int useStretch =1;
976+ int useFilterBlit = 0;
977+ gctUINT srcWidth = 0;
978+ gctUINT srcHeight = 0;
979+ gctUINT32 srcStride[3];
980+ gceSURF_FORMAT srcFormat;;
981+ gctUINT32 srcPhyAddr[3];
982+ gctUINT32 dstPhyAddr[3];
983+ gctUINT dstWidth = 0;
984+ gctUINT dstHeight = 0;
985+ gctUINT32 dstStrides[3];
986+ gcoSURF dstsurface;
987+ int geoWidth = ev->surface->width;
988+ int geoheight = ev->surface->height;
989+ gceTILING tiling;
990+
991+ bb_rects = pixman_region32_rectangles(&ev->transform.boundingbox, &nbb);
992+
993+ if(!srcSurface || nbb <= 0)
994+ goto OnError;
995+ rects = pixman_region32_rectangles(region, &nrects);
996+ surf_rects = pixman_region32_rectangles(surf_region, &nsurf);
997+
998+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(srcSurface, &srcWidth, &srcHeight, (gctINT *)&srcStride[0]));
999+
1000+ gcmVERIFY_OK(gcoSURF_GetFormat(srcSurface, gcvNULL, &srcFormat));
1001+
1002+ if(galIsYUVFormat(srcFormat) == gcvSTATUS_TRUE)
1003+ {
1004+ useFilterBlit = 1;
1005+ }
1006+
1007+ gcmVERIFY_OK(gcoSURF_Lock(srcSurface, &srcPhyAddr[0], gcvNULL));
1008+
1009+ gcmVERIFY_OK(gcoSURF_Unlock(srcSurface, gcvNULL));
1010+
1011+ srcRect.left = ev->geometry.x < 0.0 ? gal2d_int_from_double(fabsf(ev->geometry.x)) : 0;
1012+ srcRect.top = 0; /*es->geometry.y < 0.0 ? gal2d_int_from_double(fabsf(es->geometry.y)) : 0;*/
1013+ srcRect.right = ev->surface->width;
1014+ srcRect.bottom = ev->surface->height;
1015+
1016+ if(useFilterBlit)
1017+ {
1018+ dstsurface = go->nNumBuffers > 1 ?
1019+ go->renderSurf[go->activebuffer] :
1020+ go->offscreenSurface;
1021+ gcmVERIFY_OK(gcoSURF_GetAlignedSize(dstsurface, &dstWidth, &dstHeight, (gctINT *)&dstStrides));
1022+ gcmVERIFY_OK(gcoSURF_Lock(dstsurface, &dstPhyAddr[0], gcvNULL));
1023+ gcmVERIFY_OK(gcoSURF_Unlock(dstsurface, gcvNULL));
1024+ }
1025+ else
1026+ {
1027+ gcoSURF_GetTiling(srcSurface, &tiling);
1028+ if (gcoHAL_IsFeatureAvailable(gr->gcoHal, gcvFEATURE_2D_TILING) != gcvTRUE && (tiling > gcvLINEAR))
1029+ {
1030+ weston_log("Tiling not supported \n");
1031+ status = gcvSTATUS_NOT_SUPPORTED;
1032+ gcmONERROR(status);
1033+ }
1034+ gco2D_SetGenericSource(gr->gcoEngine2d, srcPhyAddr, 1,
1035+ srcStride, 1,
1036+ tiling, srcFormat, gcvSURF_0_DEGREE,
1037+ srcWidth, srcHeight);
1038+ /* Setup mirror. */
1039+ gcmONERROR(gco2D_SetBitBlitMirror(gr->gcoEngine2d, gcvFALSE, gcvFALSE));
1040+ gcmONERROR(gco2D_SetROP(gr->gcoEngine2d, 0xCC, 0xCC));
1041+ }
1042+
1043+ for (i = 0; i < nrects; i++)
1044+ {
1045+ pixman_box32_t *rect = &rects[i];
1046+ gctFLOAT min_x, max_x, min_y, max_y;
1047+
1048+ dstrect.left = (bb_rects[0].x1 < 0) ? rect->x1 : bb_rects[0].x1;
1049+ dstrect.top = (bb_rects[0].y1 < 0) ? rect->y1 : bb_rects[0].y1;
1050+ dstrect.right = bb_rects[0].x2;
1051+ dstrect.bottom = bb_rects[0].y2;
1052+
1053+ if(dstrect.right < 0 || dstrect.bottom < 0)
1054+ {
1055+ break;
1056+ }
1057+
1058+ for (j = 0; j < nsurf; j++)
1059+ {
1060+ pixman_box32_t *surf_rect = &surf_rects[j];
1061+ gctFLOAT ex[8], ey[8]; /* edge points in screen space */
1062+ int n;
1063+ gcsRECT clipRect = {0};
1064+ int m=0;
1065+ n = calculate_edges(ev, rect, surf_rect, ex, ey);
1066+ if (n < 3)
1067+ continue;
1068+
1069+ min_x = max_x = ex[0];
1070+ min_y = max_y = ey[0];
1071+ for (m = 1; m < n; m++)
1072+ {
1073+ min_x = min(min_x, ex[m]);
1074+ max_x = max(max_x, ex[m]);
1075+ min_y = min(min_y, ey[m]);
1076+ max_y = max(max_y, ey[m]);
1077+ }
1078+
1079+ clipRect.left = gal2d_int_from_double(min_x);
1080+ clipRect.top = gal2d_int_from_double(min_y);
1081+ clipRect.right = gal2d_int_from_double(max_x);
1082+ clipRect.bottom = gal2d_int_from_double(max_y);
1083+
1084+ if(output->x > 0)
1085+ {
1086+ dstrect.left = dstrect.left - output->x;
1087+ dstrect.right = dstrect.right - output->x;
1088+ clipRect.left = clipRect.left - output->x;
1089+ clipRect.right = clipRect.right - output->x;
1090+ }
1091+
1092+ dstrect.left = (dstrect.left < 0) ? 0 : dstrect.left;
1093+
1094+ status = gco2D_SetClipping(gr->gcoEngine2d, &clipRect);
1095+ if(status < 0)
1096+ {
1097+ weston_log("Error in gco2D_SetClipping %s\n", __func__);
1098+ goto OnError;
1099+ }
1100+
1101+ if(useFilterBlit)
1102+ {
1103+ gctINT srcStrideNum;
1104+ gctINT srcAddressNum;
1105+ gcmVERIFY_OK(galQueryUVStride(srcFormat, srcStride[0],
1106+ &srcStride[1], &srcStride[2]));
1107+
1108+ switch (srcFormat)
1109+ {
1110+ case gcvSURF_YUY2:
1111+ case gcvSURF_UYVY:
1112+ srcStrideNum = srcAddressNum = 1;
1113+ break;
1114+
1115+ case gcvSURF_I420:
1116+ case gcvSURF_YV12:
1117+ srcStrideNum = srcAddressNum = 3;
1118+ break;
1119+
1120+ case gcvSURF_NV16:
1121+ case gcvSURF_NV12:
1122+ case gcvSURF_NV61:
1123+ case gcvSURF_NV21:
1124+ srcStrideNum = srcAddressNum = 2;
1125+ break;
1126+
1127+ default:
1128+ gcmONERROR(gcvSTATUS_NOT_SUPPORTED);
1129+ }
1130+ gco2D_FilterBlitEx2(gr->gcoEngine2d,
1131+ srcPhyAddr, srcAddressNum,
1132+ srcStride, srcStrideNum,
1133+ gcvLINEAR, srcFormat, gcvSURF_0_DEGREE,
1134+ geoWidth, geoheight, &srcRect,
1135+ dstPhyAddr, 1,
1136+ dstStrides, 1,
1137+ gcvLINEAR, go->format, gcvSURF_0_DEGREE,
1138+ dstWidth, dstHeight,
1139+ &dstrect, gcvNULL);
1140+ }
1141+ else
1142+ {
1143+ if(useStretch)
1144+ gcmVERIFY_OK(galGetStretchFactors(&srcRect, &dstrect, &horFactor, &verFactor));
1145+
1146+ if(verFactor == 65536 && horFactor == 65536)
1147+ {
1148+ gcmVERIFY_OK(gco2D_Blit(gr->gcoEngine2d, 1, &dstrect,
1149+ 0xCC, 0xCC, go->format));
1150+ }
1151+ else
1152+ {
1153+ /* Program the stretch factors. */
1154+ gcmVERIFY_OK(gco2D_SetStretchFactors(gr->gcoEngine2d, horFactor, verFactor));
1155+
1156+ gcmVERIFY_OK(gco2D_StretchBlit(gr->gcoEngine2d, 1, &dstrect,
1157+ 0xCC, 0xCC, go->format));
1158+ }
1159+ }
1160+
1161+ if(status < 0)
1162+ {
1163+ printf("cr l=%d r=%d t=%d b=%d w=%d h=%d\n",
1164+ clipRect.left, clipRect.right, clipRect.top ,clipRect.bottom,
1165+ clipRect.right - clipRect.left, clipRect.bottom -clipRect.top);
1166+ printf("dr l=%d r=%d t=%d b=%d w=%d h=%d\n",
1167+ dstrect.left, dstrect.right, dstrect.top ,dstrect.bottom,
1168+ dstrect.right - dstrect.left, dstrect.bottom -dstrect.top);
1169+ printf("horFactor=%d, verFactor=%d\n",horFactor, verFactor);
1170+
1171+ goto OnError;
1172+ }
1173+ }
1174+ }
1175+
1176+OnError:
1177+ galONERROR(status);
1178+}
1179+
1180+static void
1181+draw_view(struct weston_view *ev, struct weston_output *output,
1182+ pixman_region32_t *damage) /* in global coordinates */
1183+{
1184+ struct weston_compositor *ec = ev->surface->compositor;
1185+ struct gal2d_output_state *go = get_output_state(output);
1186+ /* repaint bounding region in global coordinates: */
1187+ pixman_region32_t repaint;
1188+ /* non-opaque region in surface coordinates: */
1189+ pixman_region32_t surface_blend;
1190+ pixman_region32_t *buffer_damage;
1191+
1192+ pixman_region32_init(&repaint);
1193+ pixman_region32_intersect(&repaint,
1194+ &ev->transform.boundingbox, damage);
1195+ pixman_region32_subtract(&repaint, &repaint, &ev->clip);
1196+
1197+ if (!pixman_region32_not_empty(&repaint))
1198+ goto out;
1199+
1200+ buffer_damage = &go->buffer_damage[go->current_buffer];
1201+ pixman_region32_subtract(buffer_damage, buffer_damage, &repaint);
1202+
1203+ /* blended region is whole surface minus opaque region: */
1204+ pixman_region32_init_rect(&surface_blend, 0, 0,
1205+ ev->surface->width, ev->surface->height);
1206+ pixman_region32_subtract(&surface_blend, &surface_blend, &ev->surface->opaque);
1207+
1208+ struct gal2d_renderer *gr = get_renderer(ec);
1209+ gco2D_SetCurrentSourceIndex(gr->gcoEngine2d, 0U);
1210+
1211+ if (pixman_region32_not_empty(&ev->surface->opaque)) {
1212+ repaint_region(ev, output, go, &repaint, &ev->surface->opaque);
1213+ }
1214+
1215+ if (pixman_region32_not_empty(&surface_blend)) {
1216+ gco2D_EnableAlphaBlend(gr->gcoEngine2d,
1217+ ev->alpha * 0xFF, ev->alpha * 0xFF,
1218+ gcvSURF_PIXEL_ALPHA_STRAIGHT, gcvSURF_PIXEL_ALPHA_STRAIGHT,
1219+ gcvSURF_GLOBAL_ALPHA_SCALE, gcvSURF_GLOBAL_ALPHA_SCALE,
1220+ gcvSURF_BLEND_STRAIGHT, gcvSURF_BLEND_INVERSED,
1221+ gcvSURF_COLOR_STRAIGHT, gcvSURF_COLOR_STRAIGHT);
1222+
1223+ repaint_region(ev, output, go, &repaint, &surface_blend);
1224+ }
1225+
1226+ gco2D_DisableAlphaBlend(gr->gcoEngine2d);
1227+ pixman_region32_fini(&surface_blend);
1228+
1229+out:
1230+ pixman_region32_fini(&repaint);
1231+
1232+}
1233+
1234+static void
1235+repaint_views(struct weston_output *output, pixman_region32_t *damage)
1236+{
1237+ struct weston_compositor *compositor = output->compositor;
1238+ struct weston_view *view;
1239+ struct gal2d_output_state *go = get_output_state(output);
1240+
1241+ if(go->nNumBuffers > 1)
1242+ {
1243+ /*500ms is more than enough to process a frame */
1244+ gcoOS_WaitSignal(gcvNULL, go->busySignal, 500);
1245+ }
1246+ go->activebuffer = (go->activebuffer+1) % go->nNumBuffers;
1247+
1248+ wl_list_for_each_reverse(view, &compositor->view_list, link)
1249+ if (view->plane == &compositor->primary_plane)
1250+ draw_view(view, output, damage);
1251+}
1252+
1253+static void
1254+gal2d_renderer_repaint_output(struct weston_output *output,
1255+ pixman_region32_t *output_damage)
1256+{
1257+ struct gal2d_output_state *go = get_output_state(output);
1258+ gctUINT32 i;
1259+
1260+ if (use_output(output) < 0)
1261+ return;
1262+
1263+ for (i = 0; i < 2; i++)
1264+ pixman_region32_union(&go->buffer_damage[i],
1265+ &go->buffer_damage[i],
1266+ output_damage);
1267+
1268+ pixman_region32_union(output_damage, output_damage,
1269+ &go->buffer_damage[go->current_buffer]);
1270+
1271+ repaint_views(output, output_damage);
1272+
1273+ pixman_region32_copy(&output->previous_damage, output_damage);
1274+ wl_signal_emit(&output->frame_signal, output);
1275+
1276+ update_surface(output);
1277+
1278+ go->current_buffer ^= 1;
1279+}
1280+
1281+static void
1282+gal2d_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer)
1283+{
1284+ gcsWL_VIV_BUFFER *vivBuffer = wl_resource_get_user_data(buffer->resource);
1285+ gcoSURF srcSurf = vivBuffer->surface;
1286+ gceSTATUS status = gcvSTATUS_OK;
1287+ struct gal2d_surface_state *gs = get_surface_state(es);
1288+
1289+ if(gs->gco_Surface != gcvNULL)
1290+ {
1291+ gcmONERROR(gcoSURF_Destroy(gs->gco_Surface));
1292+ }
1293+
1294+ gs->gco_Surface = srcSurf;
1295+ gcoSURF_ReferenceSurface(srcSurf);
1296+ buffer->width = vivBuffer->width;
1297+ buffer->height = vivBuffer->height;
1298+
1299+ OnError:
1300+ galONERROR(status);
1301+}
1302+
1303+static void
1304+gal2d_renderer_flush_damage(struct weston_surface *surface)
1305+{
1306+ struct gal2d_surface_state *gs = get_surface_state(surface);
1307+ struct weston_buffer *buffer = gs->buffer_ref.buffer;
1308+ struct weston_view *view;
1309+ int texture_used;
1310+ pixman_region32_union(&gs->texture_damage,
1311+ &gs->texture_damage, &surface->damage);
1312+
1313+ if (!buffer)
1314+ return;
1315+
1316+ texture_used = 0;
1317+ wl_list_for_each(view, &surface->views, surface_link) {
1318+ if (view->plane == &surface->compositor->primary_plane) {
1319+ texture_used = 1;
1320+ break;
1321+ }
1322+ }
1323+ if (!texture_used)
1324+ return;
1325+
1326+ if (!pixman_region32_not_empty(&gs->texture_damage))
1327+ goto done;
1328+
1329+ if(wl_shm_buffer_get(buffer->resource))
1330+ {
1331+ if(gs->gco_Surface==NULL)
1332+ {
1333+ gs->gco_Surface = getSurfaceFromShm(surface, buffer);
1334+ }
1335+ gal2dBindBuffer(surface);
1336+ }
1337+ else
1338+ gal2d_renderer_attach_egl(surface, buffer);
1339+
1340+done:
1341+ pixman_region32_fini(&gs->texture_damage);
1342+ pixman_region32_init(&gs->texture_damage);
1343+
1344+ weston_buffer_reference(&gs->buffer_ref, NULL);
1345+}
1346+
1347+static void
1348+gal2d_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
1349+{
1350+ struct gal2d_surface_state *gs = get_surface_state(es);
1351+ struct wl_shm_buffer *shm_buffer;
1352+ weston_buffer_reference(&gs->buffer_ref, buffer);
1353+
1354+ if(buffer==NULL)
1355+ return;
1356+
1357+ shm_buffer = wl_shm_buffer_get(buffer->resource);
1358+
1359+ if(shm_buffer)
1360+ {
1361+ buffer->width = wl_shm_buffer_get_width(shm_buffer);
1362+ buffer->height = wl_shm_buffer_get_height(shm_buffer);
1363+ buffer->shm_buffer = shm_buffer;
1364+
1365+ if(gs->gco_Surface)
1366+ {
1367+ gcoSURF_Destroy(gs->gco_Surface);
1368+ gs->gco_Surface = getSurfaceFromShm(es, buffer);
1369+ }
1370+ }
1371+ else
1372+ gal2d_renderer_attach_egl(es, buffer);
1373+}
1374+
1375+static void
1376+surface_state_destroy(struct gal2d_surface_state *gs, struct gal2d_renderer *gr)
1377+{
1378+ if(gs->gco_Surface)
1379+ {
1380+ gcoSURF_Destroy(gs->gco_Surface);
1381+ }
1382+ wl_list_remove(&gs->surface_destroy_listener.link);
1383+ wl_list_remove(&gs->renderer_destroy_listener.link);
1384+ if(gs->surface)
1385+ gs->surface->renderer_state = NULL;
1386+
1387+ weston_buffer_reference(&gs->buffer_ref, NULL);
1388+ free(gs);
1389+}
1390+
1391+static void
1392+surface_state_handle_surface_destroy(struct wl_listener *listener, void *data)
1393+{
1394+ struct gal2d_surface_state *gs;
1395+ struct gal2d_renderer *gr;
1396+
1397+ gs = container_of(listener, struct gal2d_surface_state,
1398+ surface_destroy_listener);
1399+
1400+ gr = get_renderer(gs->surface->compositor);
1401+ surface_state_destroy(gs, gr);
1402+}
1403+
1404+static void
1405+surface_state_handle_renderer_destroy(struct wl_listener *listener, void *data)
1406+{
1407+ struct gal2d_surface_state *gs;
1408+ struct gal2d_renderer *gr;
1409+
1410+ gr = data;
1411+
1412+ gs = container_of(listener, struct gal2d_surface_state,
1413+ renderer_destroy_listener);
1414+
1415+ surface_state_destroy(gs, gr);
1416+}
1417+
1418+
1419+static int
1420+gal2d_renderer_create_surface(struct weston_surface *surface)
1421+{
1422+ struct gal2d_surface_state *gs;
1423+ struct gal2d_renderer *gr = get_renderer(surface->compositor);
1424+
1425+ gs = zalloc(sizeof *gs);
1426+ if (gs == NULL)
1427+ return -1;
1428+
1429+ /* A buffer is never attached to solid color surfaces, yet
1430+ * they still go through texcoord computations. Do not divide
1431+ * by zero there.
1432+ */
1433+ gs->pitch = 1;
1434+
1435+ gs->surface = surface;
1436+
1437+ pixman_region32_init(&gs->texture_damage);
1438+ surface->renderer_state = gs;
1439+
1440+ gs->surface_destroy_listener.notify =
1441+ surface_state_handle_surface_destroy;
1442+ wl_signal_add(&surface->destroy_signal,
1443+ &gs->surface_destroy_listener);
1444+
1445+ gs->renderer_destroy_listener.notify =
1446+ surface_state_handle_renderer_destroy;
1447+ wl_signal_add(&gr->destroy_signal,
1448+ &gs->renderer_destroy_listener);
1449+
1450+ if (surface->buffer_ref.buffer) {
1451+ gal2d_renderer_attach(surface, surface->buffer_ref.buffer);
1452+ gal2d_renderer_flush_damage(surface);
1453+ }
1454+
1455+ return 0;
1456+}
1457+
1458+static void
1459+gal2d_renderer_surface_set_color(struct weston_surface *surface,
1460+ float red, float green, float blue, float alpha)
1461+{
1462+ struct gal2d_surface_state *gs = get_surface_state(surface);
1463+
1464+ gs->color[0] = red;
1465+ gs->color[1] = green;
1466+ gs->color[2] = blue;
1467+ gs->color[3] = alpha;
1468+}
1469+
1470+
1471+static void
1472+gal2d_renderer_output_destroy(struct weston_output *output)
1473+{
1474+ struct gal2d_output_state *go = get_output_state(output);
1475+ gctUINT32 i;
1476+
1477+ for (i = 0; i < 2; i++)
1478+ {
1479+ pixman_region32_fini(&go->buffer_damage[i]);
1480+ }
1481+ if(go->nNumBuffers <= 1 )
1482+ {
1483+ if(go->offscreenSurface)
1484+ gcmVERIFY_OK(gcoSURF_Destroy(go->offscreenSurface));
1485+ }
1486+ else
1487+ {
1488+ gcoOS_Signal(gcvNULL,go->signal, gcvTRUE);
1489+ pthread_mutex_lock(&go->workerMutex);
1490+ go->exitWorker = 1;
1491+ pthread_mutex_unlock(&go->workerMutex);
1492+ pthread_join(go->workerId, NULL);
1493+ }
1494+
1495+ for(i=0; i < go->nNumBuffers; i++)
1496+ {
1497+ gcmVERIFY_OK(gcoSURF_Destroy(go->renderSurf[i]));
1498+ }
1499+ free(go->renderSurf);
1500+ go->renderSurf = gcvNULL;
1501+
1502+ free(go);
1503+}
1504+
1505+static void
1506+gal2d_renderer_destroy(struct weston_compositor *ec)
1507+{
1508+ struct gal2d_renderer *gr = get_renderer(ec);
1509+
1510+ wl_signal_emit(&gr->destroy_signal, gr);
1511+ free(ec->renderer);
1512+ ec->renderer = NULL;
1513+}
1514+
1515+
1516+static int
1517+gal2d_renderer_create(struct weston_compositor *ec)
1518+{
1519+ struct gal2d_renderer *gr;
1520+ gceSTATUS status = gcvSTATUS_OK;
1521+ gr = malloc(sizeof *gr);
1522+ if (gr == NULL)
1523+ return -1;
1524+
1525+ gr->base.read_pixels = gal2d_renderer_read_pixels;
1526+ gr->base.repaint_output = gal2d_renderer_repaint_output;
1527+ gr->base.flush_damage = gal2d_renderer_flush_damage;
1528+ gr->base.attach = gal2d_renderer_attach;
1529+ gr->base.surface_set_color = gal2d_renderer_surface_set_color;
1530+ gr->base.destroy = gal2d_renderer_destroy;
1531+
1532+ /* Construct the gcoOS object. */
1533+ gcmONERROR(gcoOS_Construct(gcvNULL, &gr->gcos));
1534+
1535+ /* Construct the gcoHAL object. */
1536+ gcmONERROR(gcoHAL_Construct(gcvNULL, gr->gcos, &gr->gcoHal));
1537+ gcmONERROR(gcoHAL_Get2DEngine(gr->gcoHal, &gr->gcoEngine2d));
1538+ gcmONERROR(gcoHAL_SetHardwareType(gr->gcoHal, gcvHARDWARE_2D));
1539+
1540+ ec->renderer = &gr->base;
1541+ wl_signal_init(&gr->destroy_signal);
1542+OnError:
1543+ galONERROR(status);
1544+
1545+ /* Return the status. */
1546+ return status;
1547+
1548+}
1549+
1550+static int
1551+gal2d_renderer_output_create(struct weston_output *output, NativeDisplayType display,
1552+ NativeWindowType window)
1553+
1554+ {
1555+ struct gal2d_renderer *gr = get_renderer(output->compositor);
1556+ struct gal2d_output_state *go;
1557+ halDISPLAY_INFO info;
1558+ gctUINT32 backOffset = 0;
1559+ gceSTATUS status = gcvSTATUS_OK;
1560+ gctUINT32 i;
1561+
1562+ go = zalloc(sizeof *go);
1563+ if (go == NULL)
1564+ return -1;
1565+
1566+ output->renderer_state = go;
1567+ go->display = display;
1568+ gcmONERROR(gcoOS_InitLocalDisplayInfo(go->display, &gr->localInfo));
1569+
1570+ /* Get display information. */
1571+ gcmONERROR(gcoOS_GetDisplayInfoEx2(
1572+ go->display, gcvNULL, gr->localInfo,
1573+ sizeof(info), &info));
1574+ go->nNumBuffers = info.multiBuffer;
1575+
1576+ weston_log("Number of buffers=%d\n",go->nNumBuffers);
1577+
1578+ gcmONERROR(gal2d_getSurfaceFormat(info, &go->format));
1579+ backOffset = (gctUINT32)(info.stride * info.height );
1580+
1581+ go->activebuffer = 0;
1582+
1583+ go->renderSurf = malloc(sizeof(gcoSURF) * go->nNumBuffers);
1584+ gcoOS_GetDisplayVirtual(go->display, &go->width, &go->height);
1585+ gcoOS_SetSwapInterval(go->display, 1);
1586+
1587+ /*Needed only for multi Buffer */
1588+ if(go->nNumBuffers > 1)
1589+ {
1590+ gcmVERIFY_OK(gcoOS_CreateSignal(gcvNULL, gcvFALSE,
1591+ &go->signal));
1592+ gcmVERIFY_OK(gcoOS_CreateSignal(gcvNULL, gcvFALSE,
1593+ &go->busySignal));
1594+
1595+ go->iface.command = gcvHAL_SIGNAL;
1596+ go->iface.u.Signal.signal = gcmPTR_TO_UINT64(go->signal);
1597+ go->iface.u.Signal.auxSignal = 0;
1598+ go->iface.u.Signal.process = gcmPTR_TO_UINT64(gcoOS_GetCurrentProcessID());
1599+ go->iface.u.Signal.fromWhere = gcvKERNEL_PIXEL;
1600+
1601+ go->exitWorker = 0;
1602+ pthread_create(&go->workerId, NULL, gal2d_output_worker, output);
1603+ pthread_mutex_init(&go->workerMutex, gcvNULL);
1604+ }
1605+ for(i=0; i < go->nNumBuffers; i++)
1606+ {
1607+ gcmONERROR(gcoSURF_Construct(gr->gcoHal, info.width, info.height, 1,
1608+ gcvSURF_BITMAP, go->format, gcvPOOL_USER, &go->renderSurf[i]));
1609+
1610+ gcoSURF_MapUserSurface(go->renderSurf[i], 0,info.logical + (i * backOffset),
1611+ info.physical + (i * backOffset));
1612+
1613+ //Clear surfaces
1614+ make_current(gr, go->renderSurf[go->activebuffer]);
1615+ gal2d_clear(output);
1616+ gal2d_flip_surface(output);
1617+ }
1618+ if(go->nNumBuffers <= 1)
1619+ go->activebuffer = 0;
1620+ else
1621+ go->activebuffer = 1;
1622+
1623+ if(go->nNumBuffers <= 1 )
1624+ {
1625+ gcmVERIFY_OK(gcoSURF_Construct(gr->gcoHal,
1626+ (gctUINT) info.width,
1627+ (gctUINT) info.height,
1628+ 1,
1629+ gcvSURF_BITMAP,
1630+ go->format,
1631+ gcvPOOL_DEFAULT,
1632+ &go->offscreenSurface));
1633+ make_current(gr, go->offscreenSurface);
1634+ gal2d_clear(output);
1635+ }
1636+ else
1637+ {
1638+ gcoOS_Signal(gcvNULL,go->busySignal, gcvTRUE);
1639+ }
1640+
1641+ for (i = 0; i < 2; i++)
1642+ pixman_region32_init(&go->buffer_damage[i]);
1643+OnError:
1644+ galONERROR(status);
1645+ /* Return the status. */
1646+ return status;
1647+ }
1648+
1649+ WL_EXPORT struct gal2d_renderer_interface gal2d_renderer_interface = {
1650+ .create = gal2d_renderer_create,
1651+ .output_create = gal2d_renderer_output_create,
1652+ .output_destroy = gal2d_renderer_output_destroy,
1653+};
1654diff --git a/src/gal2d-renderer.h b/src/gal2d-renderer.h
1655new file mode 100644
1656index 0000000..fefcfd1
1657--- /dev/null
1658+++ b/src/gal2d-renderer.h
1659@@ -0,0 +1,47 @@
1660+/*
1661+ * Copyright (c) 2015 Freescale Semiconductor, Inc.
1662+ * Copyright © 2013 Vasily Khoruzhick <anarsoul@gmail.com>
1663+ *
1664+ * Permission to use, copy, modify, distribute, and sell this software and
1665+ * its documentation for any purpose is hereby granted without fee, provided
1666+ * that the above copyright notice appear in all copies and that both that
1667+ * copyright notice and this permission notice appear in supporting
1668+ * documentation, and that the name of the copyright holders not be used in
1669+ * advertising or publicity pertaining to distribution of the software
1670+ * without specific, written prior permission. The copyright holders make
1671+ * no representations about the suitability of this software for any
1672+ * purpose. It is provided "as is" without express or implied warranty.
1673+ *
1674+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
1675+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
1676+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
1677+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
1678+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
1679+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1680+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1681+ */
1682+#ifndef __gal_2d_renderer_h_
1683+#define __gal_2d_renderer_h_
1684+
1685+#include "compositor.h"
1686+#ifdef ENABLE_EGL
1687+#include <EGL/egl.h>
1688+#else
1689+#include <HAL/gc_hal_eglplatform.h>
1690+typedef HALNativeDisplayType NativeDisplayType;
1691+typedef HALNativeWindowType NativeWindowType;
1692+#endif
1693+
1694+
1695+struct gal2d_renderer_interface {
1696+
1697+ int (*create)(struct weston_compositor *ec);
1698+
1699+ int (*output_create)(struct weston_output *output,
1700+ NativeDisplayType display,
1701+ NativeWindowType window);
1702+
1703+ void (*output_destroy)(struct weston_output *output);
1704+};
1705+
1706+#endif
1707--
17082.3.6
1709
diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend
new file mode 100644
index 00000000..a254f07f
--- /dev/null
+++ b/recipes-graphics/wayland/weston_%.bbappend
@@ -0,0 +1,42 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3# only install patch for mx6 with a GPU
4GPU_PATCH = "file://0001-MGS-840-Add-i.MX6-support-for-weston.patch"
5SRC_URI_append_mx6q = " ${GPU_PATCH}"
6SRC_URI_append_mx6dl = " ${GPU_PATCH}"
7SRC_URI_append_mx6sx = " ${GPU_PATCH}"
8SRC_URI_append_mx6sl = " ${GPU_PATCH}"
9
10PACKAGECONFIG_append_mx6q = " cairo-glesv2"
11PACKAGECONFIG_append_mx6dl = " cairo-glesv2"
12PACKAGECONFIG_append_mx6sx = " cairo-glesv2"
13PACKAGECONFIG_remove_mx6sl = "egl"
14
15EXTRA_OECONF_append_mx6 = " \
16 --disable-libunwind \
17 --disable-xwayland-test \
18 WESTON_NATIVE_BACKEND=fbdev-backend.so \
19"
20EXTRA_OEMAKE_append_mx6 = " \
21 COMPOSITOR_CFLAGS="-I ${STAGING_INCDIR}/pixman-1 -DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
22 FB_COMPOSITOR_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL" \
23 SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
24 EGL_TESTS_CFLAGS="-DLINUX -DEGL_API_FB -DEGL_API_WL" \
25 CLIENT_CFLAGS="-I ${STAGING_INCDIR}/cairo -I ${STAGING_INCDIR}/pixman-1 -DLINUX -DEGL_API_FB -DEGL_API_WL" \
26"
27EXTRA_OEMAKE_append_mx6q = " \
28 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
29 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
30"
31EXTRA_OEMAKE_append_mx6dl = " \
32 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
33 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
34"
35EXTRA_OEMAKE_append_mx6sx = " \
36 COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
37 FB_COMPOSITOR_LIBS="-lGLESv2 -lEGL -lwayland-server -lxkbcommon" \
38"
39EXTRA_OEMAKE_append_mx6sl = " \
40 COMPOSITOR_LIBS="-lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1" \
41 FB_COMPOSITOR_LIBS="-lEGL -lwayland-server -lxkbcommon" \
42"
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 00000000..59f76300
--- /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 00000000..bd140ff9
--- /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 00000000..a9c60f3e
--- /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.inc b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc
new file mode 100644
index 00000000..684cdb4c
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc
@@ -0,0 +1,79 @@
1# Copyright (C) 2012-2015 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 update-rc.d pkgconfig
10
11DEPENDS += "virtual/xserver virtual/libx11 virtual/libgal-x11 imx-gpu-viv pixman"
12
13LIC_FILES_CHKSUM = "file://EXA/src/vivante_fbdev/vivante.h;endline=19;md5=95cf961a2ceacdf7cf43caef25766779"
14
15SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz \
16 file://rc.autohdmi"
17
18INITSCRIPT_PACKAGES = "xserver-xorg-extension-viv-autohdmi"
19INITSCRIPT_NAME = "rc.autohdmi"
20INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
21
22EXTRA_OEMAKE += "-C ${S} -d -f Makefile prefix=${D}/usr \
23 sysroot=${STAGING_DIR_TARGET} \
24 BUSID_HAS_NUMBER=1 \
25 BUILD_IN_YOCTO=1 \
26 XSERVER_GREATER_THAN_13=1"
27
28CFLAGS += "-I${STAGING_INCDIR}/xorg \
29 -I${STAGING_INCDIR}/drm \
30 -I../../DRI_1.10.4/src"
31
32S = "${WORKDIR}/xserver-xorg-video-imx-viv-${PV}/"
33
34PACKAGES =+ "xserver-xorg-extension-viv-autohdmi"
35
36# FIXME: The Freescale provided Makefile has hardcodec include paths
37# and this does not work in case prefix is different than /usr,
38# sed it.
39do_configure_prepend () {
40 sed -i 's,$(sysroot)/usr/include,${STAGING_INCDIR},g' \
41 ${S}EXA/src/makefile.linux
42}
43
44# FIXME: This is need as Freescale didn't use standard Makefile filename
45# thus oe_runmame thinks nothing is need to be done, use ln to
46# workaround it.
47base_do_compile () {
48 oe_runmake || die "make failed"
49}
50
51do_install_append () {
52 install -d ${D}${includedir}
53 cp -axr ${S}/EXA/src/vivante_gal/vivante_priv.h ${D}${includedir}
54 cp -axr ${S}/EXA/src/vivante_gal/vivante_gal.h ${D}${includedir}
55
56 install -d ${D}/${sysconfdir}/init.d
57 install -m 755 ${WORKDIR}/rc.autohdmi ${D}/${sysconfdir}/init.d/rc.autohdmi
58
59 find ${D}${includedir} -type f -exec chmod 660 {} \;
60}
61
62RDEPENDS_${PN} += "libvivante-dri-mx6 \
63 xserver-xorg-module-exa \
64 mesa-driver-swrast \
65 xserver-xorg-extension-dri \
66 xserver-xorg-extension-dri2 \
67 xserver-xorg-extension-glx"
68
69REALSOLIBS := "${SOLIBS}"
70SOLIBS = "${SOLIBSDEV}"
71
72FILES_${PN} = "${libdir}/*/*/*/vivante_drv${SOLIBS}"
73FILES_${PN}-dev = "${includedir} /usr/src ${libdir}/libfsl_x11_ext${SOLIBSDEV}"
74FILES_${PN}-dbg = "${libdir}/*/*/*/.debug ${libdir}/.debug/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/.debug/autohdmi"
75
76FILES_xserver-xorg-extension-viv-autohdmi = " ${libdir}/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/autohdmi ${sysconfdir}/init.d/rc.autohdmi"
77
78PACKAGE_ARCH = "${MACHINE_SOCARCH}"
79COMPATIBLE_MACHINE = "(mx6)"
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
new file mode 100644
index 00000000..8c16a1d7
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
@@ -0,0 +1,42 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: rc.autohdmi
4# Required-Start: $all
5# Required-Stop:
6# Default-Start: 2 3 4 5
7# Default-Stop:
8### END INIT INFO
9
10PATH=/sbin:/usr/sbin:/bin:/usr/bin
11
12# Source function library.
13. /etc/init.d/functions
14
15case "$1" in
16 start)
17 echo -n "Starting autohdmi: "
18 export DISPLAY=:0
19 autohdmi &
20 echo
21 exit 0
22 ;;
23 reload|force-reload)
24 echo "Error: argument '$1' not supported" >&2
25 exit 3
26 ;;
27 stop)
28 echo -n "Shutting down autohdmi: "
29 killproc autohdmi
30 echo
31 ;;
32 restart)
33 echo -n "Restarting autohdmi: "
34 $0 stop
35 $0 start
36 echo
37 ;;
38 *)
39 echo "Usage: $0 start|stop" >&2
40 exit 3
41 ;;
42esac
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb
new file mode 100644
index 00000000..c5cf2715
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_5.0.11.p4.5.bb
@@ -0,0 +1,8 @@
1# Copyright (C) 2012-2015 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 xf86-video-imxfb-vivante.inc
6
7SRC_URI[md5sum] = "e89cd72f6d35d53accfd6b6bb3e05f42"
8SRC_URI[sha256sum] = "1a0b25a91b493e99dfa94a802290320ea998ebd45d7aab0f73d7c7bb521b7e84"
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 00000000..6a2fcdf4
--- /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 00000000..2ac6311f
--- /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 00000000..05be6b32
--- /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/glibc-2.20.patch b/recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch
new file mode 100644
index 00000000..3b1b84d1
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb/glibc-2.20.patch
@@ -0,0 +1,57 @@
1Fix build errors seen with glibc 2.20
2
3/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/imx53qsb/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
4 strndup(const char *str, size_t n);
5 ^
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8Upstream-Status: Pending
9Index: xserver-xorg-video-imx-11.09.01/src/imx_accel.c
10===================================================================
11--- xserver-xorg-video-imx-11.09.01.orig/src/imx_accel.c 2011-07-26 14:22:47.000000000 -0700
12+++ xserver-xorg-video-imx-11.09.01/src/imx_accel.c 2014-08-29 15:54:43.648070587 -0700
13@@ -21,6 +21,7 @@
14 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 * SOFTWARE.
16 */
17+#include <xorg-server.h>
18
19 #include <stdint.h>
20 #include "xf86.h"
21Index: xserver-xorg-video-imx-11.09.01/src/imx_exa_offscreen.c
22===================================================================
23--- xserver-xorg-video-imx-11.09.01.orig/src/imx_exa_offscreen.c 2014-08-29 15:26:31.992070587 -0700
24+++ xserver-xorg-video-imx-11.09.01/src/imx_exa_offscreen.c 2014-08-29 15:54:54.632070587 -0700
25@@ -53,7 +53,7 @@
26 * When allocating, the contiguous block of areas with the minimum eviction
27 * cost is found and evicted in order to make room for the new allocation.
28 */
29-
30+#include <xorg-server.h>
31
32 #include "xf86.h"
33 #include "exa.h"
34Index: xserver-xorg-video-imx-11.09.01/src/imx_exa_z160.c
35===================================================================
36--- xserver-xorg-video-imx-11.09.01.orig/src/imx_exa_z160.c 2014-08-29 15:26:31.992070587 -0700
37+++ xserver-xorg-video-imx-11.09.01/src/imx_exa_z160.c 2014-08-29 15:54:36.056070587 -0700
38@@ -21,6 +21,7 @@
39 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40 * SOFTWARE.
41 */
42+#include <xorg-server.h>
43
44 #include "xf86.h"
45 #include "xf86_OSproc.h"
46Index: xserver-xorg-video-imx-11.09.01/src/imx_ext.c
47===================================================================
48--- xserver-xorg-video-imx-11.09.01.orig/src/imx_ext.c 2014-08-29 15:26:32.064070587 -0700
49+++ xserver-xorg-video-imx-11.09.01/src/imx_ext.c 2014-08-29 15:55:18.048070587 -0700
50@@ -21,6 +21,7 @@
51 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52 * SOFTWARE.
53 */
54+#include <xorg-server.h>
55
56 #include <X11/X.h>
57 #include <X11/Xproto.h>
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 00000000..64af7732
--- /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 00000000..14ccbbf9
--- /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 00000000..51f243fc
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb_11.09.01.bb
@@ -0,0 +1,48 @@
1# Copyright (C) 2011-2015 O.S. Systems Software LTDA.
2# Copyright (C) 2011, 2012 Freescale
3# Released under the MIT license (see COPYING.MIT for the terms)
4
5require recipes-graphics/xorg-driver/xorg-driver-video.inc
6
7DESCRIPTION = "X.Org X server -- Freescale iMx framebuffer driver"
8LIC_FILES_CHKSUM = "file://COPYING;md5=f7bdc0c63080175d1667091b864cb12c"
9DEPENDS = "virtual/kernel virtual/xserver virtual/libx11 xproto randrproto util-macros amd-gpu-x11-bin-mx51 libz160"
10
11PR = "r12"
12
13SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-${PV}.tar.gz \
14 file://xf86-video-imxfb-fix-m4-hardcodded-paths.patch \
15 file://Make-video-API-forward-and-backward-compatible.patch \
16 file://ext-Update-to-newer-swap-macros.patch \
17 file://Fix-error-unknown-type-name-uint.patch \
18 file://xserver-1.14-compat.patch \
19 file://glibc-2.20.patch \
20"
21SRC_URI[md5sum] = "d19148399b5d1c4dab90d0cc6f2c4789"
22SRC_URI[sha256sum] = "d7d85e9f13c6dd58addab89847f3a8a67f6382a54135c7978c9a95368af024d4"
23
24inherit autotools pkgconfig
25
26# Make sure kernel sources are available
27do_configure[depends] += "virtual/kernel:do_shared_workdir"
28
29# Skip warning
30UNKNOWN_CONFIGURE_WHITELIST += "--enable-neon"
31
32FILES_${PN} += " ${libdir}/xorg/modules/drivers/*.so"
33FILES_${PN}-dbg += " ${libdir}/xorg/modules/drivers/.debug"
34EXTRA_OECONF_armv7a = " --enable-neon "
35CFLAGS += " -I${STAGING_INCDIR}/xorg -I${STAGING_KERNEL_DIR}/include"
36
37S = "${WORKDIR}/xserver-xorg-video-imx-${PV}"
38
39do_install_append () {
40 # driver's la files are not packaged
41 rm -f ${D}${libdir}/xorg/modules/drivers/*.la
42}
43
44RDEPENDS_${PN} += "xserver-xorg-module-exa"
45
46INSANE_SKIP_${PN} = "ldflags"
47INSANE_SKIP_${PN}-dbg = "ldflags"
48COMPATIBLE_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 00000000..a99e6f24
--- /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 00000000..b89bed60
--- /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 00000000..79b6c0fc
--- /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 00000000..ceb438e3
--- /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}:"