summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2013-07-03 12:27:18 +0300
committerSamuli Piippo <samuli.piippo@digia.com>2013-07-08 10:52:23 +0300
commit616ee21367fbc80d5839ac2441dba41be0f53f35 (patch)
treec6e56138cc30f29e9304fa800d89dc5e8dc0b1f3
parent2aaccd81fafa7b5b234ee07629af4fe15bef20d5 (diff)
downloadmeta-boot2qt-616ee21367fbc80d5839ac2441dba41be0f53f35.tar.gz
mesa: recipe for mesa 9.1.3
This is based on recipes on upstream oe-core, but modified to build only egl/fbdev platform with gallium llvmpipe driver. Change-Id: I5105fb8ca7cc3c3fc2c007c5f058cdaf67da4302 Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
-rw-r--r--recipes/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch65
-rw-r--r--recipes/mesa/mesa/0001-fix-xlib-dependency-from-pipe-loader.patch26
-rw-r--r--recipes/mesa/mesa/0001-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch42
-rw-r--r--recipes/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch358
-rw-r--r--recipes/mesa/mesa/fix-glsl-cross.patch43
-rw-r--r--recipes/mesa/mesa/glapi.patch109
-rw-r--r--recipes/mesa/mesa_9.1.3.bb117
7 files changed, 760 insertions, 0 deletions
diff --git a/recipes/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch b/recipes/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch
new file mode 100644
index 0000000..9f7002a
--- /dev/null
+++ b/recipes/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch
@@ -0,0 +1,65 @@
1From 877b8ea9a79d1d51f8e6b032801731538590d39e Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Tue, 4 Jun 2013 06:04:44 -0700
4Subject: [PATCH] configure: Avoid use of AC_CHECK_FILE for cross compiling
5
6The AC_CHECK_FILE macro can't be used for cross compiling as it will
7result in "error: cannot check for file existence when cross compiling".
8Replace it with the AS_IF macro.
9
10Upstream-Status: Submitted
11http://lists.freedesktop.org/archives/mesa-dev/2013-June/040168.html
12
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 configure.ac | 12 ++++++------
17 1 file changed, 6 insertions(+), 6 deletions(-)
18
19diff --git a/configure.ac b/configure.ac
20index 36065f1..2b4a374 100644
21--- a/configure.ac
22+++ b/configure.ac
23@@ -1694,8 +1694,8 @@ if test "x$enable_gallium_llvm" = xyes; then
24 CLANG_LIBDIR=${LLVM_LIBDIR}
25 fi
26 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
27- AC_CHECK_FILE("$CLANG_RESOURCE_DIR/include/stddef.h",,
28- AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.]))
29+ AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
30+ [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
31 fi
32 else
33 MESA_LLVM=0
34@@ -1912,7 +1912,7 @@ if test "x$MESA_LLVM" != x0; then
35 if test "x$with_llvm_shared_libs" = xyes; then
36 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
37 LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
38- AC_CHECK_FILE("$LLVM_LIBDIR/lib$LLVM_SO_NAME.so", llvm_have_one_so=yes,)
39+ AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
40
41 if test "x$llvm_have_one_so" = xyes; then
42 dnl LLVM was built using auto*, so there is only one shared object.
43@@ -1920,8 +1920,8 @@ if test "x$MESA_LLVM" != x0; then
44 else
45 dnl If LLVM was built with CMake, there will be one shared object per
46 dnl component.
47- AC_CHECK_FILE("$LLVM_LIBDIR/libLLVMTarget.so",,
48- AC_MSG_ERROR([Could not find llvm shared libraries:
49+ AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
50+ [AC_MSG_ERROR([Could not find llvm shared libraries:
51 Please make sure you have built llvm with the --enable-shared option
52 and that your llvm libraries are installed in $LLVM_LIBDIR
53 If you have installed your llvm libraries to a different directory you
54@@ -1932,7 +1932,7 @@ if test "x$MESA_LLVM" != x0; then
55 --enable-opencl
56 If you do not want to build with llvm shared libraries and instead want to
57 use llvm static libraries then remove these options from your configure
58- invocation and reconfigure.]))
59+ invocation and reconfigure.])])
60
61 dnl We don't need to update LLVM_LIBS in this case because the LLVM
62 dnl install uses a shared object for each compoenent and we have
63--
641.8.2.1
65
diff --git a/recipes/mesa/mesa/0001-fix-xlib-dependency-from-pipe-loader.patch b/recipes/mesa/mesa/0001-fix-xlib-dependency-from-pipe-loader.patch
new file mode 100644
index 0000000..a9f2394
--- /dev/null
+++ b/recipes/mesa/mesa/0001-fix-xlib-dependency-from-pipe-loader.patch
@@ -0,0 +1,26 @@
1From 17d94fa96f095571651f0260378785c2a801ff16 Mon Sep 17 00:00:00 2001
2From: Samuli Piippo <samuli.piippo@digia.com>
3Date: Thu, 27 Jun 2013 14:49:54 +0300
4Subject: [PATCH] fix xlib dependency from pipe-loader
5
6---
7 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 2 ++
8 1 file changed, 2 insertions(+)
9
10diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
11index c2b78c6..8c59c83 100644
12--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
13+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
14@@ -31,7 +31,9 @@
15 #include "util/u_dl.h"
16 #include "sw/null/null_sw_winsys.h"
17 #include "target-helpers/inline_sw_helper.h"
18+#ifdef X11
19 #include "state_tracker/xlib_sw_winsys.h"
20+#endif
21
22 struct pipe_loader_sw_device {
23 struct pipe_loader_device base;
24--
251.7.10.4
26
diff --git a/recipes/mesa/mesa/0001-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch b/recipes/mesa/mesa/0001-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
new file mode 100644
index 0000000..b74fddc
--- /dev/null
+++ b/recipes/mesa/mesa/0001-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
@@ -0,0 +1,42 @@
1From 9915636fb8afe75ee2e8e013e4f495a4cb937afb Mon Sep 17 00:00:00 2001
2From: Brian Paul <brianp@vmware.com>
3Date: Wed, 6 Mar 2013 16:57:20 -0700
4Subject: [PATCH] llvmpipe: remove the power of two sizeof(struct cmd_block)
5 assertion
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10It fails on 32-bit systems (I only tested on 64-bit). Power of two
11size isn't required, so just remove the assertion.
12
13Reviewed-by: José Fonseca <jfonseca@vmware.com>
14
15Upstream-Status: Backport
16http://cgit.freedesktop.org/mesa/mesa/commit/?id=9915636fb8afe75ee2e8e013e4f495a4cb937afb
17
18---
19 src/gallium/drivers/llvmpipe/lp_scene.c | 7 -------
20 1 file changed, 7 deletions(-)
21
22diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
23index dd0943e..a0912eb 100644
24--- a/src/gallium/drivers/llvmpipe/lp_scene.c
25+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
26@@ -76,13 +76,6 @@ lp_scene_create( struct pipe_context *pipe )
27 assert(maxCommandBytes < LP_SCENE_MAX_SIZE);
28 /* We'll also need space for at least one other data block */
29 assert(maxCommandPlusData <= LP_SCENE_MAX_SIZE);
30-
31- /* Ideally, the size of a cmd_block object will be a power of two
32- * in order to avoid wasting space when we allocation them from
33- * data blocks (which are power of two also).
34- */
35- assert(sizeof(struct cmd_block) ==
36- util_next_power_of_two(sizeof(struct cmd_block)));
37 }
38 #endif
39
40--
411.8.3
42
diff --git a/recipes/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch b/recipes/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch
new file mode 100644
index 0000000..47ba167
--- /dev/null
+++ b/recipes/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch
@@ -0,0 +1,358 @@
1From d52a7ec5dcdf3936bd727b854831efb90acfd2ba Mon Sep 17 00:00:00 2001
2From: Daniel Stone <daniel@fooishbar.org>
3Date: Fri, 24 May 2013 17:20:27 +0100
4Subject: [PATCH] EGL: Mutate NativeDisplayType depending on config
5
6If we go through ./configure without enabling X11 anywhere, then set the
7fallback types for EGL NativeDisplay and friends, rather than assuming
8X11/Xlib.
9
10Signed-off-by: Daniel Stone <daniel@fooishbar.org>
11---
12 configure.ac | 9 +++
13 include/EGL/eglplatform.h | 146 ------------------------------------------
14 include/EGL/eglplatform.h.in | 146 ++++++++++++++++++++++++++++++++++++++++++
15 3 files changed, 155 insertions(+), 146 deletions(-)
16 delete mode 100644 include/EGL/eglplatform.h
17 create mode 100644 include/EGL/eglplatform.h.in
18
19diff --git a/configure.ac b/configure.ac
20index 4a98996..6fa77da 100644
21--- a/configure.ac
22+++ b/configure.ac
23@@ -1576,12 +1576,20 @@ fi
24
25 EGL_PLATFORMS="$egl_platforms"
26
27+if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
28+ MESA_EGL_NO_X11_HEADERS=0
29+else
30+ MESA_EGL_NO_X11_HEADERS=1
31+fi
32+
33 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
34 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
35 AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
36 AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
37 AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
38
39+AC_SUBST([MESA_EGL_NO_X11_HEADERS])
40+
41 AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
42 AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
43
44@@ -2053,6 +2061,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
45
46 dnl Substitute the config
47 AC_CONFIG_FILES([Makefile
48+ include/EGL/eglplatform.h
49 src/Makefile
50 src/egl/Makefile
51 src/egl/drivers/Makefile
52diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
53deleted file mode 100644
54index 17fdc61..0000000
55--- a/include/EGL/eglplatform.h
56+++ /dev/null
57@@ -1,146 +0,0 @@
58-#ifndef __eglplatform_h_
59-#define __eglplatform_h_
60-
61-/*
62-** Copyright (c) 2007-2009 The Khronos Group Inc.
63-**
64-** Permission is hereby granted, free of charge, to any person obtaining a
65-** copy of this software and/or associated documentation files (the
66-** "Materials"), to deal in the Materials without restriction, including
67-** without limitation the rights to use, copy, modify, merge, publish,
68-** distribute, sublicense, and/or sell copies of the Materials, and to
69-** permit persons to whom the Materials are furnished to do so, subject to
70-** the following conditions:
71-**
72-** The above copyright notice and this permission notice shall be included
73-** in all copies or substantial portions of the Materials.
74-**
75-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
76-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
77-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
78-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
79-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
80-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
81-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
82-*/
83-
84-/* Platform-specific types and definitions for egl.h
85- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
86- *
87- * Adopters may modify khrplatform.h and this file to suit their platform.
88- * You are encouraged to submit all modifications to the Khronos group so that
89- * they can be included in future versions of this file. Please submit changes
90- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
91- * by filing a bug against product "EGL" component "Registry".
92- */
93-
94-#include <KHR/khrplatform.h>
95-
96-/* Macros used in EGL function prototype declarations.
97- *
98- * EGL functions should be prototyped as:
99- *
100- * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
101- * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
102- *
103- * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
104- */
105-
106-#ifndef EGLAPI
107-#define EGLAPI KHRONOS_APICALL
108-#endif
109-
110-#ifndef EGLAPIENTRY
111-#define EGLAPIENTRY KHRONOS_APIENTRY
112-#endif
113-#define EGLAPIENTRYP EGLAPIENTRY*
114-
115-/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
116- * are aliases of window-system-dependent types, such as X Display * or
117- * Windows Device Context. They must be defined in platform-specific
118- * code below. The EGL-prefixed versions of Native*Type are the same
119- * types, renamed in EGL 1.3 so all types in the API start with "EGL".
120- *
121- * Khronos STRONGLY RECOMMENDS that you use the default definitions
122- * provided below, since these changes affect both binary and source
123- * portability of applications using EGL running on different EGL
124- * implementations.
125- */
126-
127-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
128-#ifndef WIN32_LEAN_AND_MEAN
129-#define WIN32_LEAN_AND_MEAN 1
130-#endif
131-#include <windows.h>
132-
133-typedef HDC EGLNativeDisplayType;
134-typedef HBITMAP EGLNativePixmapType;
135-typedef HWND EGLNativeWindowType;
136-
137-#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
138-
139-typedef int EGLNativeDisplayType;
140-typedef void *EGLNativeWindowType;
141-typedef void *EGLNativePixmapType;
142-
143-#elif defined(WL_EGL_PLATFORM)
144-
145-typedef struct wl_display *EGLNativeDisplayType;
146-typedef struct wl_egl_pixmap *EGLNativePixmapType;
147-typedef struct wl_egl_window *EGLNativeWindowType;
148-
149-#elif defined(__GBM__)
150-
151-typedef struct gbm_device *EGLNativeDisplayType;
152-typedef struct gbm_bo *EGLNativePixmapType;
153-typedef void *EGLNativeWindowType;
154-
155-#elif defined(ANDROID) /* Android */
156-
157-struct ANativeWindow;
158-struct egl_native_pixmap_t;
159-
160-typedef struct ANativeWindow *EGLNativeWindowType;
161-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
162-typedef void *EGLNativeDisplayType;
163-
164-#elif defined(__unix__)
165-
166-#ifdef MESA_EGL_NO_X11_HEADERS
167-
168-typedef void *EGLNativeDisplayType;
169-typedef khronos_uint32_t EGLNativePixmapType;
170-typedef khronos_uint32_t EGLNativeWindowType;
171-
172-#else
173-
174-/* X11 (tentative) */
175-#include <X11/Xlib.h>
176-#include <X11/Xutil.h>
177-
178-typedef Display *EGLNativeDisplayType;
179-typedef Pixmap EGLNativePixmapType;
180-typedef Window EGLNativeWindowType;
181-
182-#endif /* MESA_EGL_NO_X11_HEADERS */
183-
184-#else
185-#error "Platform not recognized"
186-#endif
187-
188-/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
189-typedef EGLNativeDisplayType NativeDisplayType;
190-typedef EGLNativePixmapType NativePixmapType;
191-typedef EGLNativeWindowType NativeWindowType;
192-
193-
194-/* Define EGLint. This must be a signed integral type large enough to contain
195- * all legal attribute names and values passed into and out of EGL, whether
196- * their type is boolean, bitmask, enumerant (symbolic constant), integer,
197- * handle, or other. While in general a 32-bit integer will suffice, if
198- * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
199- * integer type.
200- */
201-typedef khronos_int32_t EGLint;
202-
203-#endif /* __eglplatform_h */
204diff --git a/include/EGL/eglplatform.h.in b/include/EGL/eglplatform.h.in
205new file mode 100644
206index 0000000..5126c92
207--- /dev/null
208+++ b/include/EGL/eglplatform.h.in
209@@ -0,0 +1,146 @@
210+#ifndef __eglplatform_h_
211+#define __eglplatform_h_
212+
213+/*
214+** Copyright (c) 2007-2009 The Khronos Group Inc.
215+**
216+** Permission is hereby granted, free of charge, to any person obtaining a
217+** copy of this software and/or associated documentation files (the
218+** "Materials"), to deal in the Materials without restriction, including
219+** without limitation the rights to use, copy, modify, merge, publish,
220+** distribute, sublicense, and/or sell copies of the Materials, and to
221+** permit persons to whom the Materials are furnished to do so, subject to
222+** the following conditions:
223+**
224+** The above copyright notice and this permission notice shall be included
225+** in all copies or substantial portions of the Materials.
226+**
227+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
228+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
229+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
230+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
231+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
232+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
233+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
234+*/
235+
236+/* Platform-specific types and definitions for egl.h
237+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
238+ *
239+ * Adopters may modify khrplatform.h and this file to suit their platform.
240+ * You are encouraged to submit all modifications to the Khronos group so that
241+ * they can be included in future versions of this file. Please submit changes
242+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
243+ * by filing a bug against product "EGL" component "Registry".
244+ */
245+
246+#include <KHR/khrplatform.h>
247+
248+/* Macros used in EGL function prototype declarations.
249+ *
250+ * EGL functions should be prototyped as:
251+ *
252+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
253+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
254+ *
255+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
256+ */
257+
258+#ifndef EGLAPI
259+#define EGLAPI KHRONOS_APICALL
260+#endif
261+
262+#ifndef EGLAPIENTRY
263+#define EGLAPIENTRY KHRONOS_APIENTRY
264+#endif
265+#define EGLAPIENTRYP EGLAPIENTRY*
266+
267+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
268+ * are aliases of window-system-dependent types, such as X Display * or
269+ * Windows Device Context. They must be defined in platform-specific
270+ * code below. The EGL-prefixed versions of Native*Type are the same
271+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
272+ *
273+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
274+ * provided below, since these changes affect both binary and source
275+ * portability of applications using EGL running on different EGL
276+ * implementations.
277+ */
278+
279+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
280+#ifndef WIN32_LEAN_AND_MEAN
281+#define WIN32_LEAN_AND_MEAN 1
282+#endif
283+#include <windows.h>
284+
285+typedef HDC EGLNativeDisplayType;
286+typedef HBITMAP EGLNativePixmapType;
287+typedef HWND EGLNativeWindowType;
288+
289+#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
290+
291+typedef int EGLNativeDisplayType;
292+typedef void *EGLNativeWindowType;
293+typedef void *EGLNativePixmapType;
294+
295+#elif defined(WL_EGL_PLATFORM)
296+
297+typedef struct wl_display *EGLNativeDisplayType;
298+typedef struct wl_egl_pixmap *EGLNativePixmapType;
299+typedef struct wl_egl_window *EGLNativeWindowType;
300+
301+#elif defined(__GBM__)
302+
303+typedef struct gbm_device *EGLNativeDisplayType;
304+typedef struct gbm_bo *EGLNativePixmapType;
305+typedef void *EGLNativeWindowType;
306+
307+#elif defined(ANDROID) /* Android */
308+
309+struct ANativeWindow;
310+struct egl_native_pixmap_t;
311+
312+typedef struct ANativeWindow *EGLNativeWindowType;
313+typedef struct egl_native_pixmap_t *EGLNativePixmapType;
314+typedef void *EGLNativeDisplayType;
315+
316+#elif defined(__unix__)
317+
318+#if @MESA_EGL_NO_X11_HEADERS@
319+
320+typedef void *EGLNativeDisplayType;
321+typedef khronos_uint32_t EGLNativePixmapType;
322+typedef khronos_uint32_t EGLNativeWindowType;
323+
324+#else
325+
326+/* X11 (tentative) */
327+#include <X11/Xlib.h>
328+#include <X11/Xutil.h>
329+
330+typedef Display *EGLNativeDisplayType;
331+typedef Pixmap EGLNativePixmapType;
332+typedef Window EGLNativeWindowType;
333+
334+#endif /* MESA_EGL_NO_X11_HEADERS */
335+
336+#else
337+#error "Platform not recognized"
338+#endif
339+
340+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
341+typedef EGLNativeDisplayType NativeDisplayType;
342+typedef EGLNativePixmapType NativePixmapType;
343+typedef EGLNativeWindowType NativeWindowType;
344+
345+
346+/* Define EGLint. This must be a signed integral type large enough to contain
347+ * all legal attribute names and values passed into and out of EGL, whether
348+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
349+ * handle, or other. While in general a 32-bit integer will suffice, if
350+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
351+ * integer type.
352+ */
353+typedef khronos_int32_t EGLint;
354+
355+#endif /* __eglplatform_h */
356--
3571.7.10.4
358
diff --git a/recipes/mesa/mesa/fix-glsl-cross.patch b/recipes/mesa/mesa/fix-glsl-cross.patch
new file mode 100644
index 0000000..34226ea
--- /dev/null
+++ b/recipes/mesa/mesa/fix-glsl-cross.patch
@@ -0,0 +1,43 @@
1The target libtool is used when building host binaries, which predictably
2doesn't work.
3
4Upstream-Status: Submitted (https://bugs.freedesktop.org/show_bug.cgi?id=44618)
5Signed-off-by: Jonathan Liu <net147@gmail.com>
6Signed-off-by: Ross Burton <ross.burton@intel.com>
7
8diff --git a/src/glsl/builtin_compiler/Makefile.am b/src/glsl/builtin_compiler/Makefile.am
9index e11a17f..8ebe0a2 100644
10--- a/src/glsl/builtin_compiler/Makefile.am
11+++ b/src/glsl/builtin_compiler/Makefile.am
12@@ -64,6 +64,8 @@ AM_CXXFLAGS = $(AM_CFLAGS)
13 include ../Makefile.sources
14
15 noinst_PROGRAMS = builtin_compiler
16+
17+if !CROSS_COMPILING
18 noinst_LTLIBRARIES = libglslcore.la libglcpp.la
19
20 libglcpp_la_SOURCES = \
21@@ -73,6 +75,7 @@ libglcpp_la_SOURCES = \
22 libglslcore_la_SOURCES = \
23 $(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
24 $(LIBGLSL_FILES)
25+endif
26
27 builtin_compiler_SOURCES = \
28 $(top_srcdir)/src/mesa/main/hash_table.c \
29@@ -81,4 +84,14 @@ builtin_compiler_SOURCES = \
30 $(top_srcdir)/src/mesa/program/symbol_table.c \
31 $(BUILTIN_COMPILER_CXX_FILES) \
32 $(GLSL_COMPILER_CXX_FILES)
33+
34+if CROSS_COMPILING
35+builtin_compiler_SOURCES += \
36+ $(LIBGLCPP_GENERATED_FILES) \
37+ $(LIBGLCPP_FILES) \
38+ $(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
39+ $(LIBGLSL_FILES)
40+builtin_compiler_CPPFLAGS = $(AM_CPPFLAGS)
41+else
42 builtin_compiler_LDADD = libglslcore.la libglcpp.la
43+endif
diff --git a/recipes/mesa/mesa/glapi.patch b/recipes/mesa/mesa/glapi.patch
new file mode 100644
index 0000000..74cac0b
--- /dev/null
+++ b/recipes/mesa/mesa/glapi.patch
@@ -0,0 +1,109 @@
1From 5ea43e65498505fc5d11d63668cda165146eb55b Mon Sep 17 00:00:00 2001
2From: Andreas Boll <andreas.boll.dev@gmail.com>
3Date: Thu, 30 May 2013 11:32:43 +0000
4Subject: glapi: Add some missing static_dispatch="false" annotations to es_EXT.xml
5
6This fixes the following build errors on powerpc:
7
8 CC glapi_dispatch.lo
9 In file included from glapi_dispatch.c:90:0:
10 ../../../../../src/mapi/glapi/glapitemp.h:1640:1: error: no previous
11 prototype for 'glReadBufferNV' [-Werror=missing-prototypes]
12 ../../../../../src/mapi/glapi/glapitemp.h:4198:1: error: no previous
13 prototype for 'glDrawBuffersNV' [-Werror=missing-prototypes]
14 ../../../../../src/mapi/glapi/glapitemp.h:6377:1: error: no previous
15 prototype for 'glFlushMappedBufferRangeEXT'
16 [-Werror=missing-prototypes]
17 ../../../../../src/mapi/glapi/glapitemp.h:6389:1: error: no previous
18 prototype for 'glMapBufferRangeEXT' [-Werror=missing-prototypes]
19 ../../../../../src/mapi/glapi/glapitemp.h:6401:1: error: no previous
20 prototype for 'glBindVertexArrayOES' [-Werror=missing-prototypes]
21 ../../../../../src/mapi/glapi/glapitemp.h:6413:1: error: no previous
22 prototype for 'glDeleteVertexArraysOES' [-Werror=missing-prototypes]
23 ../../../../../src/mapi/glapi/glapitemp.h:6433:1: error: no previous
24 prototype for 'glGenVertexArraysOES' [-Werror=missing-prototypes]
25 ../../../../../src/mapi/glapi/glapitemp.h:6445:1: error: no previous
26 prototype for 'glIsVertexArrayOES' [-Werror=missing-prototypes]
27
28NOTE: This is a candidate for the 9.0 and 9.1 branches.
29
30Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
31Reviewed-by: Brian Paul <brianp@vmware.com>
32---
33diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
34index ff378ac..f412333 100644
35--- a/src/mapi/glapi/gen/es_EXT.xml
36+++ b/src/mapi/glapi/gen/es_EXT.xml
37@@ -689,22 +689,25 @@
38
39 <!-- 71. GL_OES_vertex_array_object -->
40 <category name="GL_OES_vertex_array_object" number="71">
41- <function name="BindVertexArrayOES" alias="BindVertexArray" es2="2.0">
42+ <function name="BindVertexArrayOES" alias="BindVertexArray"
43+ static_dispatch="false" es2="2.0">
44 <param name="array" type="GLuint"/>
45 </function>
46
47 <function name="DeleteVertexArraysOES" alias="DeleteVertexArrays"
48- es2="2.0">
49+ static_dispatch="false" es2="2.0">
50 <param name="n" type="GLsizei"/>
51 <param name="arrays" type="const GLuint *" count="n"/>
52 </function>
53
54- <function name="GenVertexArraysOES" alias="GenVertexArrays" es2="2.0">
55+ <function name="GenVertexArraysOES" alias="GenVertexArrays"
56+ static_dispatch="false" es2="2.0">
57 <param name="n" type="GLsizei"/>
58 <param name="arrays" type="GLuint *" output="true" count="n"/>
59 </function>
60
61- <function name="IsVertexArrayOES" alias="IsVertexArray" es2="2.0">
62+ <function name="IsVertexArrayOES" alias="IsVertexArray"
63+ static_dispatch="false" es2="2.0">
64 <param name="array" type="GLuint"/>
65 <return type="GLboolean"/>
66 </function>
67@@ -779,7 +782,8 @@
68 <size name="Get" mode="get"/>
69 </enum>
70
71- <function name="DrawBuffersNV" alias="DrawBuffers" es2="2.0">
72+ <function name="DrawBuffersNV" alias="DrawBuffers"
73+ static_dispatch="false" es2="2.0">
74 <param name="n" type="GLsizei" counter="true"/>
75 <param name="bufs" type="const GLenum *" count="n"/>
76 </function>
77@@ -787,7 +791,8 @@
78
79 <!-- 93. GL_NV_read_buffer -->
80 <category name="GL_NV_read_buffer">
81- <function name="ReadBufferNV" alias="ReadBuffer" es2="2.0">
82+ <function name="ReadBufferNV" alias="ReadBuffer"
83+ static_dispatch="false" es2="2.0">
84 <param name="mode" type="GLenum"/>
85 </function>
86 </category>
87@@ -815,8 +820,8 @@
88 <enum name="MAP_FLUSH_EXPLICIT_BIT_EXT" value="0x0010"/>
89 <enum name="MAP_UNSYNCHRONIZED_BIT_EXT" value="0x0020"/>
90
91- <function name="MapBufferRangeEXT" alias="MapBufferRange" es1="1.0"
92- es2="2.0">
93+ <function name="MapBufferRangeEXT" alias="MapBufferRange"
94+ static_dispatch="false" es1="1.0" es2="2.0">
95 <param name="target" type="GLenum"/>
96 <param name="offset" type="GLintptr"/>
97 <param name="size" type="GLsizeiptr"/>
98@@ -825,7 +830,7 @@
99 </function>
100
101 <function name="FlushMappedBufferRangeEXT" alias="FlushMappedBufferRange"
102- es1="1.0" es2="2.0">
103+ static_dispatch="false" es1="1.0" es2="2.0">
104 <param name="target" type="GLenum"/>
105 <param name="offset" type="GLintptr"/>
106 <param name="length" type="GLsizeiptr"/>
107--
108cgit v0.9.0.2-2-gbebe
109
diff --git a/recipes/mesa/mesa_9.1.3.bb b/recipes/mesa/mesa_9.1.3.bb
new file mode 100644
index 0000000..26a2154
--- /dev/null
+++ b/recipes/mesa/mesa_9.1.3.bb
@@ -0,0 +1,117 @@
1SUMMARY = "A free implementation of the OpenGL API"
2DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
3a system for rendering interactive 3D graphics. \
4A variety of device drivers allows Mesa to be used in many different environments \
5ranging from software emulation to complete hardware acceleration for modern GPUs. \
6Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
7environment."
8
9HOMEPAGE = "http://mesa3d.org"
10BUGTRACKER = "https://bugs.freedesktop.org"
11SECTION = "x11"
12LICENSE = "MIT"
13LIC_FILES_CHKSUM = "file://docs/license.html;md5=42d77d95cba529a3637129be87d6555d"
14
15INC_PR = "r9"
16PE = "2"
17
18export WANT_LLVM_RELEASE = "3.2"
19
20DEPENDS = "expat makedepend-native flex-native bison-native llvm${WANT_LLVM_RELEASE}"
21
22PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl"
23
24inherit autotools pkgconfig pythonnative
25
26SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
27 file://EGL-Mutate-NativeDisplayType-depending-on-config.patch \
28 file://fix-glsl-cross.patch \
29 file://0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch \
30 file://0001-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch \
31 file://0001-fix-xlib-dependency-from-pipe-loader.patch \
32 file://glapi.patch \
33 "
34
35SRC_URI[md5sum] = "952ccd03547ed72333b64e1746cf8ada"
36SRC_URI[sha256sum] = "8d5dac2202d0355bff5cfd183582ec8167d1d1227b7bb7a669acecbeaa52d766"
37
38S = "${WORKDIR}/Mesa-${PV}"
39
40EXTRA_OECONF = " \
41 --enable-opengl \
42 --enable-gles2 \
43 --enable-egl --with-egl-platforms=fbdev \
44 --enable-gallium --enable-gallium-llvm --enable-gallium-egl --with-llvm-shared-libs --with-gallium-drivers="swrast" \
45 --enable-shared-glapi \
46 --disable-glx \
47 --enable-dri --with-dri-drivers="" \
48 --disable-gles1 \
49 --disable-gles3 \
50 --disable-openvg \
51 "
52
53# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
54FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
55
56# Multiple virtual/gl providers being built breaks staging
57EXCLUDE_FROM_WORLD = "1"
58
59# Remove the mesa dependency on mesa-dev, as mesa is empty
60RDEPENDS_${PN}-dev = ""
61
62PACKAGES =+ "libegl-mesa libegl-mesa-dev \
63 libglapi libglapi-dev \
64 libgles2-mesa libgles2-mesa-dev \
65 libegl-gallium \
66 "
67
68do_install_append () {
69 # Drivers never need libtool .la files
70 rm -f ${D}${libdir}/egl/*.la
71 rm -f ${D}${libdir}/gallium-pipe/*.la
72}
73
74# For the packages that make up the OpenGL interfaces, inject variables so that
75# they don't get Debian-renamed (which would remove the -mesa suffix), and
76# RPROVIDEs/RCONFLICTs on the generic libgl name.
77python __anonymous() {
78 for p in (("libegl", "libegl1"), ("libgl", "libgl1"),
79 ("libgles1", "libglesv1-cm1"), ("libgles2", "libglesv2-2"),
80 ("libgles3",)):
81 fullp = p[0] + "-mesa"
82 pkgs = " ".join(p)
83 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
84 d.appendVar("RREPLACES_" + fullp, pkgs)
85 d.appendVar("RPROVIDES_" + fullp, pkgs)
86 d.appendVar("RCONFLICTS_" + fullp, pkgs)
87
88 # For -dev, the first element is both the Debian and original name
89 fullp += "-dev"
90 pkgs = p[0] + "-dev"
91 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
92 d.appendVar("RREPLACES_" + fullp, pkgs)
93 d.appendVar("RPROVIDES_" + fullp, pkgs)
94 d.appendVar("RCONFLICTS_" + fullp, pkgs)
95}
96
97python mesa_populate_packages() {
98 pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
99 do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
100}
101
102PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
103
104PACKAGES_DYNAMIC += "^mesa-driver-.*"
105
106FILES_libegl-mesa = "${libdir}/libEGL.so.*"
107FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
108FILES_libglapi = "${libdir}/libglapi.so.*"
109FILES_libegl-gallium = "${libdir}/egl/egl_gallium.so* ${libdir}/egl/st_GL.so*"
110
111FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
112FILES_libglapi-dev = "${libdir}/libglapi.*"
113FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
114
115FILES_${PN}-dbg += "${libdir}/egl/.debug/* ${libdir}/gallium-pipe/.debug"
116
117