summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2013-12-12 13:38:32 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2013-12-12 13:50:20 +0100
commite2e6f6fe07049f33cb6348780fa975162752e421 (patch)
treeb1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-graphics/mesa
downloadpoky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-graphics/mesa')
-rw-r--r--meta/recipes-graphics/mesa/libglu_9.0.0.bb27
-rw-r--r--meta/recipes-graphics/mesa/mesa-9.1.6/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch362
-rw-r--r--meta/recipes-graphics/mesa/mesa-9.1.6/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch41
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-build-fix.patch257
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-query.patch35
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/glut.patch46
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_8.1.0.bb40
-rw-r--r--meta/recipes-graphics/mesa/mesa-gl_9.1.6.bb11
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc176
-rw-r--r--meta/recipes-graphics/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch65
-rw-r--r--meta/recipes-graphics/mesa/mesa/0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch52
-rw-r--r--meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch359
-rw-r--r--meta/recipes-graphics/mesa/mesa/0004-glsl-fix-builtin_compiler-cross-compilation.patch54
-rw-r--r--meta/recipes-graphics/mesa/mesa/0005-fix-out-of-tree-builds-gallium.patch42
-rw-r--r--meta/recipes-graphics/mesa/mesa/0006-fix-out-of-tree-egl.patch48
-rw-r--r--meta/recipes-graphics/mesa/mesa_9.1.6.bb16
-rw-r--r--meta/recipes-graphics/mesa/mesa_git.bb20
17 files changed, 1651 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/meta/recipes-graphics/mesa/libglu_9.0.0.bb
new file mode 100644
index 0000000000..06d30f9bfa
--- /dev/null
+++ b/meta/recipes-graphics/mesa/libglu_9.0.0.bb
@@ -0,0 +1,27 @@
1SUMMARY = "The OpenGL utility toolkit"
2DESCRIPTION = "GLU is a utility toolkit used with OpenGL implementations"
3
4HOMEPAGE = "http://mesa3d.org"
5BUGTRACKER = "https://bugs.freedesktop.org"
6SECTION = "x11"
7LICENSE = "MIT"
8LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b356456e7d44471d9 \
9 file://src/libtess/tess.c;endline=29;md5=6b79c570f644363b356456e7d44471d9"
10
11# Epoch as this used to be part of mesa
12PE = "2"
13PR = "0"
14
15SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${PV}.tar.bz2"
16
17SRC_URI[md5sum] = "be9249132ff49275461cf92039083030"
18SRC_URI[sha256sum] = "1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12"
19
20S = "${WORKDIR}/glu-${PV}"
21
22DEPENDS = "virtual/libgl"
23
24inherit autotools pkgconfig
25
26# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
27RDEPENDS_${PN}-dev = ""
diff --git a/meta/recipes-graphics/mesa/mesa-9.1.6/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch b/meta/recipes-graphics/mesa/mesa-9.1.6/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch
new file mode 100644
index 0000000000..30a3d98758
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-9.1.6/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch
@@ -0,0 +1,362 @@
1From 06c1ba29de8a26fffb73ee99f0fc54c704e9fee4 Mon Sep 17 00:00:00 2001
2From: Daniel Stone <daniel@fooishbar.org>
3Date: Fri, 24 May 2013 17:20:27 +0100
4Subject: [PATCH 3/5] 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
10Upstream-Status: Backport (slightly different solution was applied in master
11https://bugs.freedesktop.org/show_bug.cgi?id=64959)
12
13Signed-off-by: Daniel Stone <daniel@fooishbar.org>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 configure.ac | 9 +++
17 include/EGL/eglplatform.h | 146 -------------------------------------------
18 include/EGL/eglplatform.h.in | 146 +++++++++++++++++++++++++++++++++++++++++++
19 3 files changed, 155 insertions(+), 146 deletions(-)
20 delete mode 100644 include/EGL/eglplatform.h
21 create mode 100644 include/EGL/eglplatform.h.in
22
23diff --git a/configure.ac b/configure.ac
24index 2b4a374..d4c7a95 100644
25--- a/configure.ac
26+++ b/configure.ac
27@@ -1565,12 +1565,20 @@ fi
28
29 EGL_PLATFORMS="$egl_platforms"
30
31+if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
32+ MESA_EGL_NO_X11_HEADERS=0
33+else
34+ MESA_EGL_NO_X11_HEADERS=1
35+fi
36+
37 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
38 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
39 AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
40 AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
41 AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
42
43+AC_SUBST([MESA_EGL_NO_X11_HEADERS])
44+
45 AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
46 AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
47
48@@ -2042,6 +2050,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
49
50 dnl Substitute the config
51 AC_CONFIG_FILES([Makefile
52+ include/EGL/eglplatform.h
53 src/Makefile
54 src/egl/Makefile
55 src/egl/drivers/Makefile
56diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
57deleted file mode 100644
58index 17fdc61..0000000
59--- a/include/EGL/eglplatform.h
60+++ /dev/null
61@@ -1,146 +0,0 @@
62-#ifndef __eglplatform_h_
63-#define __eglplatform_h_
64-
65-/*
66-** Copyright (c) 2007-2009 The Khronos Group Inc.
67-**
68-** Permission is hereby granted, free of charge, to any person obtaining a
69-** copy of this software and/or associated documentation files (the
70-** "Materials"), to deal in the Materials without restriction, including
71-** without limitation the rights to use, copy, modify, merge, publish,
72-** distribute, sublicense, and/or sell copies of the Materials, and to
73-** permit persons to whom the Materials are furnished to do so, subject to
74-** the following conditions:
75-**
76-** The above copyright notice and this permission notice shall be included
77-** in all copies or substantial portions of the Materials.
78-**
79-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
80-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
81-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
82-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
83-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
84-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
85-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
86-*/
87-
88-/* Platform-specific types and definitions for egl.h
89- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
90- *
91- * Adopters may modify khrplatform.h and this file to suit their platform.
92- * You are encouraged to submit all modifications to the Khronos group so that
93- * they can be included in future versions of this file. Please submit changes
94- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
95- * by filing a bug against product "EGL" component "Registry".
96- */
97-
98-#include <KHR/khrplatform.h>
99-
100-/* Macros used in EGL function prototype declarations.
101- *
102- * EGL functions should be prototyped as:
103- *
104- * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
105- * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
106- *
107- * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
108- */
109-
110-#ifndef EGLAPI
111-#define EGLAPI KHRONOS_APICALL
112-#endif
113-
114-#ifndef EGLAPIENTRY
115-#define EGLAPIENTRY KHRONOS_APIENTRY
116-#endif
117-#define EGLAPIENTRYP EGLAPIENTRY*
118-
119-/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
120- * are aliases of window-system-dependent types, such as X Display * or
121- * Windows Device Context. They must be defined in platform-specific
122- * code below. The EGL-prefixed versions of Native*Type are the same
123- * types, renamed in EGL 1.3 so all types in the API start with "EGL".
124- *
125- * Khronos STRONGLY RECOMMENDS that you use the default definitions
126- * provided below, since these changes affect both binary and source
127- * portability of applications using EGL running on different EGL
128- * implementations.
129- */
130-
131-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
132-#ifndef WIN32_LEAN_AND_MEAN
133-#define WIN32_LEAN_AND_MEAN 1
134-#endif
135-#include <windows.h>
136-
137-typedef HDC EGLNativeDisplayType;
138-typedef HBITMAP EGLNativePixmapType;
139-typedef HWND EGLNativeWindowType;
140-
141-#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
142-
143-typedef int EGLNativeDisplayType;
144-typedef void *EGLNativeWindowType;
145-typedef void *EGLNativePixmapType;
146-
147-#elif defined(WL_EGL_PLATFORM)
148-
149-typedef struct wl_display *EGLNativeDisplayType;
150-typedef struct wl_egl_pixmap *EGLNativePixmapType;
151-typedef struct wl_egl_window *EGLNativeWindowType;
152-
153-#elif defined(__GBM__)
154-
155-typedef struct gbm_device *EGLNativeDisplayType;
156-typedef struct gbm_bo *EGLNativePixmapType;
157-typedef void *EGLNativeWindowType;
158-
159-#elif defined(ANDROID) /* Android */
160-
161-struct ANativeWindow;
162-struct egl_native_pixmap_t;
163-
164-typedef struct ANativeWindow *EGLNativeWindowType;
165-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
166-typedef void *EGLNativeDisplayType;
167-
168-#elif defined(__unix__)
169-
170-#ifdef MESA_EGL_NO_X11_HEADERS
171-
172-typedef void *EGLNativeDisplayType;
173-typedef khronos_uint32_t EGLNativePixmapType;
174-typedef khronos_uint32_t EGLNativeWindowType;
175-
176-#else
177-
178-/* X11 (tentative) */
179-#include <X11/Xlib.h>
180-#include <X11/Xutil.h>
181-
182-typedef Display *EGLNativeDisplayType;
183-typedef Pixmap EGLNativePixmapType;
184-typedef Window EGLNativeWindowType;
185-
186-#endif /* MESA_EGL_NO_X11_HEADERS */
187-
188-#else
189-#error "Platform not recognized"
190-#endif
191-
192-/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
193-typedef EGLNativeDisplayType NativeDisplayType;
194-typedef EGLNativePixmapType NativePixmapType;
195-typedef EGLNativeWindowType NativeWindowType;
196-
197-
198-/* Define EGLint. This must be a signed integral type large enough to contain
199- * all legal attribute names and values passed into and out of EGL, whether
200- * their type is boolean, bitmask, enumerant (symbolic constant), integer,
201- * handle, or other. While in general a 32-bit integer will suffice, if
202- * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
203- * integer type.
204- */
205-typedef khronos_int32_t EGLint;
206-
207-#endif /* __eglplatform_h */
208diff --git a/include/EGL/eglplatform.h.in b/include/EGL/eglplatform.h.in
209new file mode 100644
210index 0000000..5126c92
211--- /dev/null
212+++ b/include/EGL/eglplatform.h.in
213@@ -0,0 +1,146 @@
214+#ifndef __eglplatform_h_
215+#define __eglplatform_h_
216+
217+/*
218+** Copyright (c) 2007-2009 The Khronos Group Inc.
219+**
220+** Permission is hereby granted, free of charge, to any person obtaining a
221+** copy of this software and/or associated documentation files (the
222+** "Materials"), to deal in the Materials without restriction, including
223+** without limitation the rights to use, copy, modify, merge, publish,
224+** distribute, sublicense, and/or sell copies of the Materials, and to
225+** permit persons to whom the Materials are furnished to do so, subject to
226+** the following conditions:
227+**
228+** The above copyright notice and this permission notice shall be included
229+** in all copies or substantial portions of the Materials.
230+**
231+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
232+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
233+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
234+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
235+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
236+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
237+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
238+*/
239+
240+/* Platform-specific types and definitions for egl.h
241+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
242+ *
243+ * Adopters may modify khrplatform.h and this file to suit their platform.
244+ * You are encouraged to submit all modifications to the Khronos group so that
245+ * they can be included in future versions of this file. Please submit changes
246+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
247+ * by filing a bug against product "EGL" component "Registry".
248+ */
249+
250+#include <KHR/khrplatform.h>
251+
252+/* Macros used in EGL function prototype declarations.
253+ *
254+ * EGL functions should be prototyped as:
255+ *
256+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
257+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
258+ *
259+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
260+ */
261+
262+#ifndef EGLAPI
263+#define EGLAPI KHRONOS_APICALL
264+#endif
265+
266+#ifndef EGLAPIENTRY
267+#define EGLAPIENTRY KHRONOS_APIENTRY
268+#endif
269+#define EGLAPIENTRYP EGLAPIENTRY*
270+
271+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
272+ * are aliases of window-system-dependent types, such as X Display * or
273+ * Windows Device Context. They must be defined in platform-specific
274+ * code below. The EGL-prefixed versions of Native*Type are the same
275+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
276+ *
277+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
278+ * provided below, since these changes affect both binary and source
279+ * portability of applications using EGL running on different EGL
280+ * implementations.
281+ */
282+
283+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
284+#ifndef WIN32_LEAN_AND_MEAN
285+#define WIN32_LEAN_AND_MEAN 1
286+#endif
287+#include <windows.h>
288+
289+typedef HDC EGLNativeDisplayType;
290+typedef HBITMAP EGLNativePixmapType;
291+typedef HWND EGLNativeWindowType;
292+
293+#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
294+
295+typedef int EGLNativeDisplayType;
296+typedef void *EGLNativeWindowType;
297+typedef void *EGLNativePixmapType;
298+
299+#elif defined(WL_EGL_PLATFORM)
300+
301+typedef struct wl_display *EGLNativeDisplayType;
302+typedef struct wl_egl_pixmap *EGLNativePixmapType;
303+typedef struct wl_egl_window *EGLNativeWindowType;
304+
305+#elif defined(__GBM__)
306+
307+typedef struct gbm_device *EGLNativeDisplayType;
308+typedef struct gbm_bo *EGLNativePixmapType;
309+typedef void *EGLNativeWindowType;
310+
311+#elif defined(ANDROID) /* Android */
312+
313+struct ANativeWindow;
314+struct egl_native_pixmap_t;
315+
316+typedef struct ANativeWindow *EGLNativeWindowType;
317+typedef struct egl_native_pixmap_t *EGLNativePixmapType;
318+typedef void *EGLNativeDisplayType;
319+
320+#elif defined(__unix__)
321+
322+#if @MESA_EGL_NO_X11_HEADERS@
323+
324+typedef void *EGLNativeDisplayType;
325+typedef khronos_uint32_t EGLNativePixmapType;
326+typedef khronos_uint32_t EGLNativeWindowType;
327+
328+#else
329+
330+/* X11 (tentative) */
331+#include <X11/Xlib.h>
332+#include <X11/Xutil.h>
333+
334+typedef Display *EGLNativeDisplayType;
335+typedef Pixmap EGLNativePixmapType;
336+typedef Window EGLNativeWindowType;
337+
338+#endif /* MESA_EGL_NO_X11_HEADERS */
339+
340+#else
341+#error "Platform not recognized"
342+#endif
343+
344+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
345+typedef EGLNativeDisplayType NativeDisplayType;
346+typedef EGLNativePixmapType NativePixmapType;
347+typedef EGLNativeWindowType NativeWindowType;
348+
349+
350+/* Define EGLint. This must be a signed integral type large enough to contain
351+ * all legal attribute names and values passed into and out of EGL, whether
352+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
353+ * handle, or other. While in general a 32-bit integer will suffice, if
354+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
355+ * integer type.
356+ */
357+typedef khronos_int32_t EGLint;
358+
359+#endif /* __eglplatform_h */
360--
3611.8.2.1
362
diff --git a/meta/recipes-graphics/mesa/mesa-9.1.6/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch b/meta/recipes-graphics/mesa/mesa-9.1.6/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
new file mode 100644
index 0000000000..d86421b767
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-9.1.6/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
@@ -0,0 +1,41 @@
1From 33098ef45e6035f3348040a25641f95c95266103 Mon Sep 17 00:00:00 2001
2From: Brian Paul <brianp@vmware.com>
3Date: Wed, 6 Mar 2013 16:57:20 -0700
4Subject: [PATCH 5/5] llvmpipe: remove the power of two sizeof(struct
5 cmd_block) 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 src/gallium/drivers/llvmpipe/lp_scene.c | 7 -------
19 1 file changed, 7 deletions(-)
20
21diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
22index e145391..c88bc95 100644
23--- a/src/gallium/drivers/llvmpipe/lp_scene.c
24+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
25@@ -76,13 +76,6 @@ lp_scene_create( struct pipe_context *pipe )
26 assert(maxCommandBytes < LP_SCENE_MAX_SIZE);
27 /* We'll also need space for at least one other data block */
28 assert(maxCommandPlusData <= LP_SCENE_MAX_SIZE);
29-
30- /* Ideally, the size of a cmd_block object will be a power of two
31- * in order to avoid wasting space when we allocation them from
32- * data blocks (which are power of two also).
33- */
34- assert(sizeof(struct cmd_block) ==
35- util_next_power_of_two(sizeof(struct cmd_block)));
36 }
37 #endif
38
39--
401.8.2.1
41
diff --git a/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-build-fix.patch b/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-build-fix.patch
new file mode 100644
index 0000000000..46a3e98cfe
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-build-fix.patch
@@ -0,0 +1,257 @@
1From ab76f645e29b0a603ff95d88f976bc35ab6301ee Mon Sep 17 00:00:00 2001
2From: Frank Binns <frank.binns@imgtec.com>
3Date: Fri, 29 Jun 2012 11:26:04 +0100
4Subject: [PATCH 1/2] mesa-demos: Fix build when EGL_MESA_screen_surface
5 extension isn't present
6
7The EGL demos won't build against EGL implementations that don't support
8the EGL_MESA_screen_surface extension. Fix this, in most cases, by
9wrapping relevant bits of code in #ifdef EGL_MESA_screen_surface.
10
11Signed-off-by: Frank Binns <frank.binns@imgtec.com>
12
13Applied and fixed up in Yocto by...
14
15Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
16
17Upstream-Status: Pending
18
19Index: mesa-demos-8.0.1/src/egl/eglut/eglut.c
20===================================================================
21--- mesa-demos-8.0.1.orig/src/egl/eglut/eglut.c
22+++ mesa-demos-8.0.1/src/egl/eglut/eglut.c
23@@ -51,8 +51,9 @@ _eglutNow(void)
24 static void
25 _eglutDestroyWindow(struct eglut_window *win)
26 {
27- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
28- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
29+
30+ if (_eglut->surface_type == EGL_WINDOW_BIT ||
31+ _eglut->surface_type == EGL_PIXMAP_BIT)
32 eglDestroySurface(_eglut->dpy, win->surface);
33
34 _eglutNativeFiniWindow(win);
35@@ -150,7 +151,9 @@ _eglutCreateWindow(const char *title, in
36 win->config, win->native.u.pixmap, NULL);
37 break;
38 case EGL_PBUFFER_BIT:
39+#ifdef EGL_MESA_screen_surface
40 case EGL_SCREEN_BIT_MESA:
41+#endif
42 win->surface = win->native.u.surface;
43 break;
44 default:
45@@ -264,8 +267,10 @@ eglutDestroyWindow(int win)
46 if (window->index != win)
47 return;
48
49+#ifdef EGL_MESA_screen_surface
50 /* XXX it causes some bug in st/egl KMS backend */
51 if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
52+#endif
53 eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
54
55 _eglutDestroyWindow(_eglut->current);
56Index: mesa-demos-8.0.1/src/egl/eglut/eglut_screen.c
57===================================================================
58--- mesa-demos-8.0.1.orig/src/egl/eglut/eglut_screen.c
59+++ mesa-demos-8.0.1/src/egl/eglut/eglut_screen.c
60@@ -10,26 +10,33 @@
61
62 #define MAX_MODES 100
63
64+#ifdef EGL_MESA_screen_surface
65 static EGLScreenMESA kms_screen;
66 static EGLModeMESA kms_mode;
67 static EGLint kms_width, kms_height;
68+#endif
69
70 void
71 _eglutNativeInitDisplay(void)
72 {
73+#ifdef EGL_MESA_screen_surface
74 _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
75 _eglut->surface_type = EGL_SCREEN_BIT_MESA;
76+#endif
77 }
78
79 void
80 _eglutNativeFiniDisplay(void)
81 {
82+#ifdef EGL_MESA_screen_surface
83 kms_screen = 0;
84 kms_mode = 0;
85 kms_width = 0;
86 kms_height = 0;
87+#endif
88 }
89
90+#ifdef EGL_MESA_screen_surface
91 static void
92 init_kms(void)
93 {
94@@ -69,19 +76,23 @@ init_kms(void)
95 kms_width = width;
96 kms_height = height;
97 }
98+#endif
99
100 void
101 _eglutNativeInitWindow(struct eglut_window *win, const char *title,
102 int x, int y, int w, int h)
103 {
104+#ifdef EGL_MESA_screen_surface
105 EGLint surf_attribs[16];
106 EGLint i;
107+#endif
108 const char *exts;
109
110 exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
111 if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
112 _eglutFatal("EGL_MESA_screen_surface is not supported\n");
113
114+#ifdef EGL_MESA_screen_surface
115 init_kms();
116
117 i = 0;
118@@ -103,14 +114,17 @@ _eglutNativeInitWindow(struct eglut_wind
119
120 win->native.width = kms_width;
121 win->native.height = kms_height;
122+#endif
123 }
124
125 void
126 _eglutNativeFiniWindow(struct eglut_window *win)
127 {
128+#ifdef EGL_MESA_screen_surface
129 eglShowScreenSurfaceMESA(_eglut->dpy,
130 kms_screen, EGL_NO_SURFACE, 0);
131 eglDestroySurface(_eglut->dpy, win->native.u.surface);
132+#endif
133 }
134
135 void
136Index: mesa-demos-8.0.1/src/egl/opengl/demo1.c
137===================================================================
138--- mesa-demos-8.0.1.orig/src/egl/opengl/demo1.c
139+++ mesa-demos-8.0.1/src/egl/opengl/demo1.c
140@@ -18,6 +18,7 @@
141 static void
142 TestScreens(EGLDisplay dpy)
143 {
144+#ifdef EGL_MESA_screen_surface
145 #define MAX 8
146 EGLScreenMESA screens[MAX];
147 EGLint numScreens;
148@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
149 for (i = 0; i < numScreens; i++) {
150 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
151 }
152+#endif
153 }
154
155 /**
156Index: mesa-demos-8.0.1/src/egl/opengl/demo2.c
157===================================================================
158--- mesa-demos-8.0.1.orig/src/egl/opengl/demo2.c
159+++ mesa-demos-8.0.1/src/egl/opengl/demo2.c
160@@ -16,6 +16,7 @@
161
162 /*#define FRONTBUFFER*/
163
164+#ifdef EGL_MESA_screen_surface
165 static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
166 GLfloat r, GLfloat g, GLfloat b)
167 {
168@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
169 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
170 }
171 }
172-
173+#endif
174
175 int
176 main(int argc, char *argv[])
177 {
178 int maj, min;
179+#ifdef EGL_MESA_screen_surface
180 EGLContext ctx;
181 EGLSurface pbuffer, screen_surf;
182 EGLConfig configs[10];
183@@ -115,6 +117,7 @@ main(int argc, char *argv[])
184 EGLModeMESA mode;
185 EGLScreenMESA screen;
186 EGLint count;
187+#endif
188
189 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
190 assert(d);
191@@ -132,6 +135,7 @@ main(int argc, char *argv[])
192 exit(1);
193 }
194
195+#ifdef EGL_MESA_screen_surface
196 eglGetConfigs(d, configs, 10, &numConfigs);
197 printf("Got %d EGL configs:\n", numConfigs);
198 for (i = 0; i < numConfigs; i++) {
199@@ -211,6 +215,7 @@ main(int argc, char *argv[])
200 eglDestroySurface(d, pbuffer);
201 eglDestroyContext(d, ctx);
202 eglTerminate(d);
203+#endif
204
205 return 0;
206 }
207Index: mesa-demos-8.0.1/src/egl/opengl/demo3.c
208===================================================================
209--- mesa-demos-8.0.1.orig/src/egl/opengl/demo3.c
210+++ mesa-demos-8.0.1/src/egl/opengl/demo3.c
211@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
212 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
213 };
214
215-
216+#ifdef EGL_MESA_screen_surface
217 static void Init(void)
218 {
219
220@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GL
221 fclose(f);
222 }
223 }
224+#endif
225
226 int
227 main(int argc, char *argv[])
228 {
229 int maj, min;
230+#ifdef EGL_MESA_screen_surface
231 EGLContext ctx;
232 EGLSurface screen_surf;
233 EGLConfig configs[10];
234@@ -566,6 +568,7 @@ main(int argc, char *argv[])
235 const GLubyte *bitmap;
236 EGLint screenAttribs[32];
237 EGLint i;
238+#endif
239
240 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
241 assert(d);
242@@ -583,6 +586,7 @@ main(int argc, char *argv[])
243 exit(1);
244 }
245
246+#ifdef EGL_MESA_screen_surface
247 eglGetConfigs(d, configs, 10, &numConfigs);
248 eglGetScreensMESA(d, &screen, 1, &count);
249 eglGetModesMESA(d, screen, &mode, 1, &count);
250@@ -642,6 +646,7 @@ main(int argc, char *argv[])
251 eglDestroySurface(d, screen_surf);
252 eglDestroyContext(d, ctx);
253 eglTerminate(d);
254+#endif
255
256 return 0;
257 }
diff --git a/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-query.patch b/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-query.patch
new file mode 100644
index 0000000000..795370819b
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/egl-mesa-screen-surface-query.patch
@@ -0,0 +1,35 @@
1From cf90a5c0c173d017a80cde057da57c365b3b1a40 Mon Sep 17 00:00:00 2001
2From: Frank Binns <frank.binns@imgtec.com>
3Date: Fri, 29 Jun 2012 12:00:26 +0100
4Subject: [PATCH 2/2] mesa-demos: Query display for EGL_MESA_screen_surface
5 extension before using it
6
7This code makes heavy use of the EGL_MESA_screen_surface extension so
8check the display to determine if it's supported by the underlying EGL
9implementation. If it doesn't then bail.
10
11Signed-off-by: Frank Binns <frank.binns@imgtec.com>
12
13Applied and fixed up in Yocto by...
14
15Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
16
17Upstream-Status: Pending
18
19Index: mesa-demos-8.0.1/src/egl/opengl/demo1.c
20===================================================================
21--- mesa-demos-8.0.1.orig/src/egl/opengl/demo1.c
22+++ mesa-demos-8.0.1/src/egl/opengl/demo1.c
23@@ -110,6 +110,12 @@ main(int argc, char *argv[])
24 printf("EGL version = %d.%d\n", maj, min);
25 printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
26
27+ if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
28+ "EGL_MESA_screen_surface")) {
29+ printf("EGL_MESA_screen_surface is not supported\n");
30+ exit(1);
31+ }
32+
33 eglGetConfigs(d, NULL, 0, &numConfigs);
34 configs = malloc(sizeof(*configs) *numConfigs);
35 eglGetConfigs(d, configs, numConfigs, &numConfigs);
diff --git a/meta/recipes-graphics/mesa/mesa-demos/glut.patch b/meta/recipes-graphics/mesa/mesa-demos/glut.patch
new file mode 100644
index 0000000000..84b6d4f7f3
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/glut.patch
@@ -0,0 +1,46 @@
1Correctly implement with AC_WITH(glut) so that --without-glut works.
2
3Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=57013]
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6Index: mesa-demos-8.0.1/configure.ac
7===================================================================
8--- mesa-demos-8.0.1.orig/configure.ac 2010-07-13 19:52:41.000000000 +0100
9+++ mesa-demos-8.0.1/configure.ac 2012-11-12 12:49:54.940054571 +0000
10@@ -65,21 +65,25 @@
11 DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
12
13 dnl Check for GLUT
14-GLUT_CFLAGS=""
15-GLUT_LIBS=-lglut
16-glut_enabled=yes
17+glut_enabled=no
18 AC_ARG_WITH([glut],
19 [AS_HELP_STRING([--with-glut=DIR],
20 [glut install directory])],
21 [GLUT_CFLAGS="-I$withval/include"
22- GLUT_LIBS="-L$withval/lib -lglut"])
23-AC_CHECK_HEADER([GL/glut.h],
24- [],
25- [glut_enabled=no])
26-AC_CHECK_LIB([glut],
27- [glutInit],
28- [],
29- [glut_enabled=no])
30+ GLUT_LIBS="-L$withval/lib -lglut"],
31+ [GLUT_CFLAGS=""
32+ GLUT_LIBS="-lglut"]
33+ )
34+AS_IF([test "x$with_glut" != xno],
35+ [AC_CHECK_HEADER([GL/glut.h],
36+ [],
37+ [glut_enabled=no])
38+ AC_CHECK_LIB([glut],
39+ [glutInit],
40+ [],
41+ [glut_enabled=no])
42+ glut_enabled=yes
43+])
44
45 GLEW_CFLAGS=""
46 GLEW_LIBS="-lGLEW"
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.1.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.1.0.bb
new file mode 100644
index 0000000000..3ac81ef05f
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.1.0.bb
@@ -0,0 +1,40 @@
1SUMMARY = "Mesa demo applications"
2DESCRIPTION = "This package includes the demonstration application, such as glxgears. \
3These applications can be used for Mesa validation and benchmarking."
4HOMEPAGE = "http://mesa3d.org"
5BUGTRACKER = "https://bugs.freedesktop.org"
6SECTION = "x11"
7
8LICENSE = "MIT & PD"
9LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
10 file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
11
12DEPENDS = "virtual/libgl glew"
13
14SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
15 file://glut.patch \
16 file://egl-mesa-screen-surface-build-fix.patch \
17 file://egl-mesa-screen-surface-query.patch"
18
19SRC_URI[md5sum] = "9df33ba69a26bbfbc7c8148602e59542"
20SRC_URI[sha256sum] = "9703fa0646b32a1e68d2abf5628f936f77bf97c69ffcaac90de380820a87a828"
21
22inherit autotools pkgconfig
23
24PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
25 ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
26
27# The Wayland code doesn't work with Wayland 1.0, so disable it for now
28#${@base_contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
29
30PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm"
31PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
32PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
33PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
34PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
35PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
36PACKAGECONFIG[glut] = "--with-glut,--without-glut,"
37PACKAGECONFIG[osmesa] = "--enable-libosmesa,--disable-libosmesa,"
38PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libvg"
39PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
40PACKAGECONFIG[x11] = "--enable-libx11,--disable-libx11,virtual/libx11"
diff --git a/meta/recipes-graphics/mesa/mesa-gl_9.1.6.bb b/meta/recipes-graphics/mesa/mesa-gl_9.1.6.bb
new file mode 100644
index 0000000000..0e9dbb5f4f
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-gl_9.1.6.bb
@@ -0,0 +1,11 @@
1require mesa_${PV}.bb
2
3SUMMARY += " (OpenGL only, no EGL/GLES)"
4
5FILESPATH = "${FILE_DIRNAME}/mesa-${PV}:${FILE_DIRNAME}/mesa"
6
7PROVIDES = "virtual/libgl virtual/mesa"
8
9PACKAGECONFIG ??= "dri ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
10
11EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
new file mode 100644
index 0000000000..afc795c5d2
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,176 @@
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
18DEPENDS = "expat makedepend-native flex-native bison-native"
19
20PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
21
22inherit autotools pkgconfig pythonnative gettext distro_features_check
23
24REQUIRED_DISTRO_FEATURES = "opengl"
25
26EXTRA_OECONF = "--enable-shared-glapi"
27
28PACKAGECONFIG ??= "egl gles dri \
29 ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
30 ${@base_contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
31 "
32
33X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
34PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
35PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
36PACKAGECONFIG[wayland] = ",,wayland"
37
38DRIDRIVERS = "swrast"
39DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
40DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
41PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm udev"
42
43EXTRA_OECONF += "--enable-gbm"
44
45PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
46
47EGL_PLATFORMS = "drm"
48EGL_PLATFORMS .="${@base_contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
49EGL_PLATFORMS .="${@base_contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
50PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
51
52PACKAGECONFIG[openvg] = "--enable-openvg, --disable-openvg"
53
54GALLIUMDRIVERS = "swrast"
55GALLIUMDRIVERS_LLVM33 = "${@base_contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
56GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
57GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
58GALLIUMDRIVERS_append_x86 = "${@base_contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
59GALLIUMDRIVERS_append_x86-64 = "${@base_contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
60# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers
61PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
62PACKAGECONFIG[gallium-egl] = "--enable-gallium-egl, --disable-gallium-egl"
63PACKAGECONFIG[gallium-gbm] = "--enable-gallium-gbm, --disable-gallium-gbm"
64MESA_LLVM_RELEASE ?= "3.3"
65PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --with-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
66 ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
67export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
68
69# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
70FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
71
72# Multiple virtual/gl providers being built breaks staging
73EXCLUDE_FROM_WORLD = "1"
74
75# Remove the mesa dependency on mesa-dev, as mesa is empty
76RDEPENDS_${PN}-dev = ""
77
78PACKAGES =+ "libegl-mesa libegl-mesa-dev \
79 libosmesa libosmesa-dev \
80 libgl-mesa libgl-mesa-dev \
81 libdricore libdricore-dev \
82 libglapi libglapi-dev \
83 libgbm libgbm-dev \
84 libgles1-mesa libgles1-mesa-dev \
85 libgles2-mesa libgles2-mesa-dev \
86 libgles3-mesa libgles3-mesa-dev \
87 libwayland-egl libwayland-egl-dev \
88 libegl-gallium libgbm-gallium \
89 libopenvg libopenvg-dev \
90 libxvmcsoftpipe libxvmcsoftpipe-dev \
91 "
92
93do_install_append () {
94 # Drivers never need libtool .la files
95 rm -f ${D}${libdir}/dri/*.la
96 rm -f ${D}${libdir}/egl/*.la
97 rm -f ${D}${libdir}/gallium-pipe/*.la
98 rm -f ${D}${libdir}/gbm/*.la
99
100 # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
101 rm -f ${D}${sysconfdir}/drirc
102}
103
104# For the packages that make up the OpenGL interfaces, inject variables so that
105# they don't get Debian-renamed (which would remove the -mesa suffix), and
106# RPROVIDEs/RCONFLICTs on the generic libgl name.
107python __anonymous() {
108 for p in (("libegl", "libegl1"), ("libgl", "libgl1"),
109 ("libgles1", "libglesv1-cm1"), ("libgles2", "libglesv2-2"),
110 ("libgles3",)):
111 fullp = p[0] + "-mesa"
112 pkgs = " ".join(p)
113 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
114 d.appendVar("RREPLACES_" + fullp, pkgs)
115 d.appendVar("RPROVIDES_" + fullp, pkgs)
116 d.appendVar("RCONFLICTS_" + fullp, pkgs)
117
118 # For -dev, the first element is both the Debian and original name
119 fullp += "-dev"
120 pkgs = p[0] + "-dev"
121 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
122 d.appendVar("RREPLACES_" + fullp, pkgs)
123 d.appendVar("RPROVIDES_" + fullp, pkgs)
124 d.appendVar("RCONFLICTS_" + fullp, pkgs)
125}
126
127python mesa_populate_packages() {
128 dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
129
130 pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
131 pkgs += do_split_packages(d, dri_drivers_root, '^(.*)_dri\.so$', 'mesa-driver-%s', 'Mesa %s DRI driver', extra_depends='')
132 for pkg in pkgs:
133 d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa-", "mesa-dri-"))
134 d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa-", "mesa-dri-"))
135 d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa-", "mesa-dri-"))
136
137 pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
138 do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
139}
140
141PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
142
143PACKAGES_DYNAMIC += "^mesa-driver-.*"
144
145FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
146
147FILES_libdricore = "${sysconfdir}/drirc ${libdir}/libdricore*.so.*"
148FILES_libegl-mesa = "${libdir}/libEGL.so.*"
149FILES_libgbm = "${libdir}/libgbm.so.*"
150FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
151FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
152FILES_libgl-mesa = "${libdir}/libGL.so.*"
153FILES_libglapi = "${libdir}/libglapi.so.*"
154FILES_libosmesa = "${libdir}/libOSMesa.so.*"
155FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
156FILES_libegl-gallium = "${libdir}/egl/egl_gallium.so*"
157FILES_libgbm-gallium = "${libdir}/gbm/gbm_gallium_drm.so*"
158FILES_libopenvg = "${libdir}/libOpenVG.so.*"
159FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
160
161FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
162FILES_libdricore-dev = "${libdir}/libdricore*.*"
163FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
164FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
165FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
166FILES_libglapi-dev = "${libdir}/libglapi.*"
167FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
168FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
169FILES_libgles3-mesa-dev = "${includedir}/GLES3"
170FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
171FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
172FILES_libopenvg-dev = "${libdir}/libOpenVG.so ${libdir}/libOpenVG.la* \
173 ${includedir}/VG ${libdir}/pkgconfig/vg.pc"
174FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
175
176FILES_${PN}-dbg += "${libdir}/dri/.debug/* ${libdir}/egl/.debug/* ${libdir}/gbm/.debug/* ${libdir}/gallium-pipe/.debug"
diff --git a/meta/recipes-graphics/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch b/meta/recipes-graphics/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch
new file mode 100644
index 0000000000..76b5a18ede
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch
@@ -0,0 +1,65 @@
1From e21ce89f7ae6964f196086ff325d79e4a3b5acd8 Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Tue, 4 Jun 2013 06:04:44 -0700
4Subject: [PATCH 1/4] 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 70c598e..67b8c40 100644
21--- a/configure.ac
22+++ b/configure.ac
23@@ -1630,8 +1630,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@@ -1861,7 +1861,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@@ -1869,8 +1869,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@@ -1881,7 +1881,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/meta/recipes-graphics/mesa/mesa/0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch b/meta/recipes-graphics/mesa/mesa/0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch
new file mode 100644
index 0000000000..2df5e61d21
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch
@@ -0,0 +1,52 @@
1From debac5531f7107d239530ff6e29eeda72b9ec1e9 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sat, 29 Jun 2013 11:20:51 +0200
4Subject: [PATCH 2/4] pipe_loader_sw: include xlib_sw_winsys.h only when
5 HAVE_PIPE_LOADER_XLIB
6
7* HAVE_WINSYS_XLIB was removed in
8 commit b3f1f665b0fef178ae193e6b111f14c9a5ad3b25
9 Author: Matt Turner <mattst88@gmail.com>
10 Date: Sun Jan 20 15:32:08 2013 -0800
11 build: Get rid of GALLIUM_WINSYS_DIRS
12
13* HAVE_PIPE_LOADER_XLIB is set correctly:
14 if test "x$NEED_WINSYS_XLIB" = xyes; then
15 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
16 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la"
17 fi
18
19* fixes build of pipe_loader_sw without libx11 headers available
20
21Upstream-Status: Submitted https://bugs.freedesktop.org/show_bug.cgi?id=66357
22Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
23---
24 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 4 +++-
25 1 file changed, 3 insertions(+), 1 deletion(-)
26
27diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
28index c2b78c6..0da3f4d 100644
29--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
30+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
31@@ -31,7 +31,9 @@
32 #include "util/u_dl.h"
33 #include "sw/null/null_sw_winsys.h"
34 #include "target-helpers/inline_sw_helper.h"
35+#ifdef HAVE_PIPE_LOADER_XLIB
36 #include "state_tracker/xlib_sw_winsys.h"
37+#endif
38
39 struct pipe_loader_sw_device {
40 struct pipe_loader_device base;
41@@ -44,7 +46,7 @@ struct pipe_loader_sw_device {
42 static struct pipe_loader_ops pipe_loader_sw_ops;
43
44 static struct sw_winsys *(*backends[])() = {
45-#ifdef HAVE_WINSYS_XLIB
46+#ifdef HAVE_PIPE_LOADER_XLIB
47 x11_sw_create,
48 #endif
49 null_sw_create
50--
511.8.2.1
52
diff --git a/meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch b/meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch
new file mode 100644
index 0000000000..8a83f4b07b
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch
@@ -0,0 +1,359 @@
1From 8d31ae23683394617c49301b039b3a069b9ea436 Mon Sep 17 00:00:00 2001
2From: Daniel Stone <daniel@fooishbar.org>
3Date: Fri, 24 May 2013 17:20:27 +0100
4Subject: [PATCH 3/4] 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
10Upstream-Status: Backport (slightly different solution was applied in master
11https://bugs.freedesktop.org/show_bug.cgi?id=64959)
12
13Signed-off-by: Daniel Stone <daniel@fooishbar.org>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 configure.ac | 5 ++
17 include/EGL/eglplatform.h | 146 -------------------------------------------
18 include/EGL/eglplatform.h.in | 146 +++++++++++++++++++++++++++++++++++++++++++
19 3 files changed, 151 insertions(+), 146 deletions(-)
20 delete mode 100644 include/EGL/eglplatform.h
21 create mode 100644 include/EGL/eglplatform.h.in
22
23diff --git a/configure.ac b/configure.ac
24index 67b8c40..afc3217 100644
25--- a/configure.ac
26+++ b/configure.ac
27@@ -1499,6 +1499,9 @@ EGL_PLATFORMS="$egl_platforms"
28
29 if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
30 NEED_WINSYS_XLIB=yes
31+ MESA_EGL_NO_X11_HEADERS=0
32+else
33+ MESA_EGL_NO_X11_HEADERS=1
34 fi
35 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
36 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
37@@ -1512,6 +1515,7 @@ AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
38 AC_SUBST([EGL_NATIVE_PLATFORM])
39 AC_SUBST([EGL_PLATFORMS])
40 AC_SUBST([EGL_CFLAGS])
41+AC_SUBST([MESA_EGL_NO_X11_HEADERS])
42
43 AC_ARG_WITH([egl-driver-dir],
44 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
45@@ -1991,6 +1995,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
46
47 dnl Substitute the config
48 AC_CONFIG_FILES([Makefile
49+ include/EGL/eglplatform.h
50 src/Makefile
51 src/egl/Makefile
52 src/egl/drivers/Makefile
53diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
54deleted file mode 100644
55index 17fdc61..0000000
56--- a/include/EGL/eglplatform.h
57+++ /dev/null
58@@ -1,146 +0,0 @@
59-#ifndef __eglplatform_h_
60-#define __eglplatform_h_
61-
62-/*
63-** Copyright (c) 2007-2009 The Khronos Group Inc.
64-**
65-** Permission is hereby granted, free of charge, to any person obtaining a
66-** copy of this software and/or associated documentation files (the
67-** "Materials"), to deal in the Materials without restriction, including
68-** without limitation the rights to use, copy, modify, merge, publish,
69-** distribute, sublicense, and/or sell copies of the Materials, and to
70-** permit persons to whom the Materials are furnished to do so, subject to
71-** the following conditions:
72-**
73-** The above copyright notice and this permission notice shall be included
74-** in all copies or substantial portions of the Materials.
75-**
76-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
77-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
79-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
80-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
81-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
82-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
83-*/
84-
85-/* Platform-specific types and definitions for egl.h
86- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
87- *
88- * Adopters may modify khrplatform.h and this file to suit their platform.
89- * You are encouraged to submit all modifications to the Khronos group so that
90- * they can be included in future versions of this file. Please submit changes
91- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
92- * by filing a bug against product "EGL" component "Registry".
93- */
94-
95-#include <KHR/khrplatform.h>
96-
97-/* Macros used in EGL function prototype declarations.
98- *
99- * EGL functions should be prototyped as:
100- *
101- * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
102- * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
103- *
104- * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
105- */
106-
107-#ifndef EGLAPI
108-#define EGLAPI KHRONOS_APICALL
109-#endif
110-
111-#ifndef EGLAPIENTRY
112-#define EGLAPIENTRY KHRONOS_APIENTRY
113-#endif
114-#define EGLAPIENTRYP EGLAPIENTRY*
115-
116-/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
117- * are aliases of window-system-dependent types, such as X Display * or
118- * Windows Device Context. They must be defined in platform-specific
119- * code below. The EGL-prefixed versions of Native*Type are the same
120- * types, renamed in EGL 1.3 so all types in the API start with "EGL".
121- *
122- * Khronos STRONGLY RECOMMENDS that you use the default definitions
123- * provided below, since these changes affect both binary and source
124- * portability of applications using EGL running on different EGL
125- * implementations.
126- */
127-
128-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
129-#ifndef WIN32_LEAN_AND_MEAN
130-#define WIN32_LEAN_AND_MEAN 1
131-#endif
132-#include <windows.h>
133-
134-typedef HDC EGLNativeDisplayType;
135-typedef HBITMAP EGLNativePixmapType;
136-typedef HWND EGLNativeWindowType;
137-
138-#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
139-
140-typedef int EGLNativeDisplayType;
141-typedef void *EGLNativeWindowType;
142-typedef void *EGLNativePixmapType;
143-
144-#elif defined(WL_EGL_PLATFORM)
145-
146-typedef struct wl_display *EGLNativeDisplayType;
147-typedef struct wl_egl_pixmap *EGLNativePixmapType;
148-typedef struct wl_egl_window *EGLNativeWindowType;
149-
150-#elif defined(__GBM__)
151-
152-typedef struct gbm_device *EGLNativeDisplayType;
153-typedef struct gbm_bo *EGLNativePixmapType;
154-typedef void *EGLNativeWindowType;
155-
156-#elif defined(ANDROID) /* Android */
157-
158-struct ANativeWindow;
159-struct egl_native_pixmap_t;
160-
161-typedef struct ANativeWindow *EGLNativeWindowType;
162-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
163-typedef void *EGLNativeDisplayType;
164-
165-#elif defined(__unix__)
166-
167-#ifdef MESA_EGL_NO_X11_HEADERS
168-
169-typedef void *EGLNativeDisplayType;
170-typedef khronos_uint32_t EGLNativePixmapType;
171-typedef khronos_uint32_t EGLNativeWindowType;
172-
173-#else
174-
175-/* X11 (tentative) */
176-#include <X11/Xlib.h>
177-#include <X11/Xutil.h>
178-
179-typedef Display *EGLNativeDisplayType;
180-typedef Pixmap EGLNativePixmapType;
181-typedef Window EGLNativeWindowType;
182-
183-#endif /* MESA_EGL_NO_X11_HEADERS */
184-
185-#else
186-#error "Platform not recognized"
187-#endif
188-
189-/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
190-typedef EGLNativeDisplayType NativeDisplayType;
191-typedef EGLNativePixmapType NativePixmapType;
192-typedef EGLNativeWindowType NativeWindowType;
193-
194-
195-/* Define EGLint. This must be a signed integral type large enough to contain
196- * all legal attribute names and values passed into and out of EGL, whether
197- * their type is boolean, bitmask, enumerant (symbolic constant), integer,
198- * handle, or other. While in general a 32-bit integer will suffice, if
199- * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
200- * integer type.
201- */
202-typedef khronos_int32_t EGLint;
203-
204-#endif /* __eglplatform_h */
205diff --git a/include/EGL/eglplatform.h.in b/include/EGL/eglplatform.h.in
206new file mode 100644
207index 0000000..5126c92
208--- /dev/null
209+++ b/include/EGL/eglplatform.h.in
210@@ -0,0 +1,146 @@
211+#ifndef __eglplatform_h_
212+#define __eglplatform_h_
213+
214+/*
215+** Copyright (c) 2007-2009 The Khronos Group Inc.
216+**
217+** Permission is hereby granted, free of charge, to any person obtaining a
218+** copy of this software and/or associated documentation files (the
219+** "Materials"), to deal in the Materials without restriction, including
220+** without limitation the rights to use, copy, modify, merge, publish,
221+** distribute, sublicense, and/or sell copies of the Materials, and to
222+** permit persons to whom the Materials are furnished to do so, subject to
223+** the following conditions:
224+**
225+** The above copyright notice and this permission notice shall be included
226+** in all copies or substantial portions of the Materials.
227+**
228+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
229+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
230+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
231+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
232+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
233+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
234+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
235+*/
236+
237+/* Platform-specific types and definitions for egl.h
238+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
239+ *
240+ * Adopters may modify khrplatform.h and this file to suit their platform.
241+ * You are encouraged to submit all modifications to the Khronos group so that
242+ * they can be included in future versions of this file. Please submit changes
243+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
244+ * by filing a bug against product "EGL" component "Registry".
245+ */
246+
247+#include <KHR/khrplatform.h>
248+
249+/* Macros used in EGL function prototype declarations.
250+ *
251+ * EGL functions should be prototyped as:
252+ *
253+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
254+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
255+ *
256+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
257+ */
258+
259+#ifndef EGLAPI
260+#define EGLAPI KHRONOS_APICALL
261+#endif
262+
263+#ifndef EGLAPIENTRY
264+#define EGLAPIENTRY KHRONOS_APIENTRY
265+#endif
266+#define EGLAPIENTRYP EGLAPIENTRY*
267+
268+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
269+ * are aliases of window-system-dependent types, such as X Display * or
270+ * Windows Device Context. They must be defined in platform-specific
271+ * code below. The EGL-prefixed versions of Native*Type are the same
272+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
273+ *
274+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
275+ * provided below, since these changes affect both binary and source
276+ * portability of applications using EGL running on different EGL
277+ * implementations.
278+ */
279+
280+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
281+#ifndef WIN32_LEAN_AND_MEAN
282+#define WIN32_LEAN_AND_MEAN 1
283+#endif
284+#include <windows.h>
285+
286+typedef HDC EGLNativeDisplayType;
287+typedef HBITMAP EGLNativePixmapType;
288+typedef HWND EGLNativeWindowType;
289+
290+#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
291+
292+typedef int EGLNativeDisplayType;
293+typedef void *EGLNativeWindowType;
294+typedef void *EGLNativePixmapType;
295+
296+#elif defined(WL_EGL_PLATFORM)
297+
298+typedef struct wl_display *EGLNativeDisplayType;
299+typedef struct wl_egl_pixmap *EGLNativePixmapType;
300+typedef struct wl_egl_window *EGLNativeWindowType;
301+
302+#elif defined(__GBM__)
303+
304+typedef struct gbm_device *EGLNativeDisplayType;
305+typedef struct gbm_bo *EGLNativePixmapType;
306+typedef void *EGLNativeWindowType;
307+
308+#elif defined(ANDROID) /* Android */
309+
310+struct ANativeWindow;
311+struct egl_native_pixmap_t;
312+
313+typedef struct ANativeWindow *EGLNativeWindowType;
314+typedef struct egl_native_pixmap_t *EGLNativePixmapType;
315+typedef void *EGLNativeDisplayType;
316+
317+#elif defined(__unix__)
318+
319+#if @MESA_EGL_NO_X11_HEADERS@
320+
321+typedef void *EGLNativeDisplayType;
322+typedef khronos_uint32_t EGLNativePixmapType;
323+typedef khronos_uint32_t EGLNativeWindowType;
324+
325+#else
326+
327+/* X11 (tentative) */
328+#include <X11/Xlib.h>
329+#include <X11/Xutil.h>
330+
331+typedef Display *EGLNativeDisplayType;
332+typedef Pixmap EGLNativePixmapType;
333+typedef Window EGLNativeWindowType;
334+
335+#endif /* MESA_EGL_NO_X11_HEADERS */
336+
337+#else
338+#error "Platform not recognized"
339+#endif
340+
341+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
342+typedef EGLNativeDisplayType NativeDisplayType;
343+typedef EGLNativePixmapType NativePixmapType;
344+typedef EGLNativeWindowType NativeWindowType;
345+
346+
347+/* Define EGLint. This must be a signed integral type large enough to contain
348+ * all legal attribute names and values passed into and out of EGL, whether
349+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
350+ * handle, or other. While in general a 32-bit integer will suffice, if
351+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
352+ * integer type.
353+ */
354+typedef khronos_int32_t EGLint;
355+
356+#endif /* __eglplatform_h */
357--
3581.8.2.1
359
diff --git a/meta/recipes-graphics/mesa/mesa/0004-glsl-fix-builtin_compiler-cross-compilation.patch b/meta/recipes-graphics/mesa/mesa/0004-glsl-fix-builtin_compiler-cross-compilation.patch
new file mode 100644
index 0000000000..460a2748bf
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0004-glsl-fix-builtin_compiler-cross-compilation.patch
@@ -0,0 +1,54 @@
1From ab38c97f057f739533a4e1fc9de51ea5f4e6242d Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Sat, 29 Jun 2013 11:37:20 +0200
4Subject: [PATCH 4/4] glsl: fix builtin_compiler cross-compilation
5
6The target libtool is used when building host binaries, which predictably
7doesn't work.
8
9Upstream-Status: Submitted https://bugs.freedesktop.org/show_bug.cgi?id=44618
10Signed-off-by: Jonathan Liu <net147@gmail.com>
11Signed-off-by: Ross Burton <ross.burton@intel.com>
12---
13 src/glsl/builtin_compiler/Makefile.am | 13 +++++++++++++
14 1 file changed, 13 insertions(+)
15
16diff --git a/src/glsl/builtin_compiler/Makefile.am b/src/glsl/builtin_compiler/Makefile.am
17index e11a17f..8ebe0a2 100644
18--- a/src/glsl/builtin_compiler/Makefile.am
19+++ b/src/glsl/builtin_compiler/Makefile.am
20@@ -64,6 +64,8 @@ AM_CXXFLAGS = $(AM_CFLAGS)
21 include ../Makefile.sources
22
23 noinst_PROGRAMS = builtin_compiler
24+
25+if !CROSS_COMPILING
26 noinst_LTLIBRARIES = libglslcore.la libglcpp.la
27
28 libglcpp_la_SOURCES = \
29@@ -73,6 +75,7 @@ libglcpp_la_SOURCES = \
30 libglslcore_la_SOURCES = \
31 $(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
32 $(LIBGLSL_FILES)
33+endif
34
35 builtin_compiler_SOURCES = \
36 $(top_srcdir)/src/mesa/main/hash_table.c \
37@@ -81,4 +84,14 @@ builtin_compiler_SOURCES = \
38 $(top_srcdir)/src/mesa/program/symbol_table.c \
39 $(BUILTIN_COMPILER_CXX_FILES) \
40 $(GLSL_COMPILER_CXX_FILES)
41+
42+if CROSS_COMPILING
43+builtin_compiler_SOURCES += \
44+ $(LIBGLCPP_GENERATED_FILES) \
45+ $(LIBGLCPP_FILES) \
46+ $(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
47+ $(LIBGLSL_FILES)
48+builtin_compiler_CPPFLAGS = $(AM_CPPFLAGS)
49+else
50 builtin_compiler_LDADD = libglslcore.la libglcpp.la
51+endif
52--
531.8.2.1
54
diff --git a/meta/recipes-graphics/mesa/mesa/0005-fix-out-of-tree-builds-gallium.patch b/meta/recipes-graphics/mesa/mesa/0005-fix-out-of-tree-builds-gallium.patch
new file mode 100644
index 0000000000..8c5984fd55
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0005-fix-out-of-tree-builds-gallium.patch
@@ -0,0 +1,42 @@
1Upstream-Status: Submitted
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 9e31e15ebb0adbf3cc0394c30cbc1ccd2b35a27f Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Fri, 28 Jun 2013 11:44:58 +0100
7Subject: [PATCH] build: fix out-of-tree builds in gallium/auxiliary
8
9The rules were writing files to e.g. util/u_indices_gen.py, but in an
10out-of-tree build this directory doesn't exist in the build directory. So,
11create the directories just in case.
12
13Signed-off-by: Ross Burton <ross.burton@intel.com>
14---
15 src/gallium/auxiliary/Makefile.am | 4 ++++
16 1 file changed, 4 insertions(+)
17
18diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
19index f14279b..0c3e7ba 100644
20--- a/src/gallium/auxiliary/Makefile.am
21+++ b/src/gallium/auxiliary/Makefile.am
22@@ -38,13 +38,17 @@ libgallium_la_SOURCES += \
23 endif
24
25 indices/u_indices_gen.c: $(srcdir)/indices/u_indices_gen.py
26+ mkdir --parents indices
27 $(AM_V_GEN) $(PYTHON2) $< > $@
28
29 indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
30+ mkdir --parents indices
31 $(AM_V_GEN) $(PYTHON2) $< > $@
32
33 util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
34+ mkdir --parents util
35 $(AM_V_GEN) $(PYTHON2) $< > $@
36
37 util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
38+ mkdir --parents util
39 $(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@
40--
411.7.10.4
42
diff --git a/meta/recipes-graphics/mesa/mesa/0006-fix-out-of-tree-egl.patch b/meta/recipes-graphics/mesa/mesa/0006-fix-out-of-tree-egl.patch
new file mode 100644
index 0000000000..88a4fb0636
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/0006-fix-out-of-tree-egl.patch
@@ -0,0 +1,48 @@
1Fix out of tree compilation failure due to
20003-EGL-Mutate-NativeDisplayType-depending-on-config.patch.
3
4Upstream-Status: Inappropriate (upstream has different solution to root problem)
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7diff --git a/src/egl/drivers/dri2/Makefile.am b/src/egl/drivers/dri2/Makefile.am
8index 45f7dfa..ed0e777 100644
9--- a/src/egl/drivers/dri2/Makefile.am
10+++ b/src/egl/drivers/dri2/Makefile.am
11@@ -21,6 +21,7 @@
12
13 AM_CFLAGS = \
14 -I$(top_srcdir)/include \
15+ -I$(top_builddir)/include \
16 -I$(top_srcdir)/src/egl/main \
17 -I$(top_srcdir)/src/gbm/main \
18 -I$(top_srcdir)/src/gbm/backends/dri \
19diff --git a/src/egl/drivers/glx/Makefile.am b/src/egl/drivers/glx/Makefile.am
20index 6bf67ea..7b87047 100644
21--- a/src/egl/drivers/glx/Makefile.am
22+++ b/src/egl/drivers/glx/Makefile.am
23@@ -21,6 +21,7 @@
24
25 AM_CFLAGS = \
26 -I$(top_srcdir)/include \
27+ -I$(top_builddir)/include \
28 -I$(top_srcdir)/src/egl/main \
29 $(X11_CFLAGS) \
30 $(DEFINES)
31diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
32index ca5257a..13a5734 100644
33--- a/src/egl/main/Makefile.am
34+++ b/src/egl/main/Makefile.am
35@@ -27,6 +27,7 @@ endif
36
37 AM_CFLAGS = \
38 -I$(top_srcdir)/include \
39+ -I$(top_builddir)/include \
40 -I$(top_srcdir)/src/gbm/main \
41 $(DEFINES) \
42 $(EGL_CFLAGS) \
43@@ -135,4 +136,4 @@ egl_HEADERS = \
44 $(top_srcdir)/include/EGL/eglext.h \
45 $(top_srcdir)/include/EGL/egl.h \
46 $(top_srcdir)/include/EGL/eglmesaext.h \
47- $(top_srcdir)/include/EGL/eglplatform.h
48+ $(top_builddir)/include/EGL/eglplatform.h
diff --git a/meta/recipes-graphics/mesa/mesa_9.1.6.bb b/meta/recipes-graphics/mesa/mesa_9.1.6.bb
new file mode 100644
index 0000000000..b55fa02a7e
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_9.1.6.bb
@@ -0,0 +1,16 @@
1require ${BPN}.inc
2
3SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
4 file://0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch \
5 file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
6 file://0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch \
7 file://0004-glsl-fix-builtin_compiler-cross-compilation.patch \
8 file://0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch \
9 file://0005-fix-out-of-tree-builds-gallium.patch \
10 file://0006-fix-out-of-tree-egl.patch \
11 "
12
13SRC_URI[md5sum] = "443a2a352667294b53d56cb1a74114e9"
14SRC_URI[sha256sum] = "e632dff0acafad0a59dc208d16dedb37f7bd58f94c5d58c4b51912e41d005e3d"
15
16S = "${WORKDIR}/Mesa-${PV}"
diff --git a/meta/recipes-graphics/mesa/mesa_git.bb b/meta/recipes-graphics/mesa/mesa_git.bb
new file mode 100644
index 0000000000..6397ece6fe
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_git.bb
@@ -0,0 +1,20 @@
1require ${BPN}.inc
2
3DEFAULT_PREFERENCE = "-1"
4
5LIC_FILES_CHKSUM = "file://docs/license.html;md5=f69a4626e9efc40fa0d3cc3b02c9eacf"
6
7PR = "${INC_PR}.0"
8SRCREV = "5a925cc5504575c22dbb7d29842d7fc5babcb5c7"
9PV = "9.1.3+git${SRCPV}"
10
11SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa \
12 file://0001-configure-Avoid-use-of-AC_CHECK_FILE-for-cross-compi.patch \
13 file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
14 file://0003-EGL-Mutate-NativeDisplayType-depending-on-config.patch \
15 file://0004-glsl-fix-builtin_compiler-cross-compilation.patch \
16 file://0005-fix-out-of-tree-builds-gallium.patch \
17 file://0006-fix-out-of-tree-egl.patch \
18 "
19
20S = "${WORKDIR}/git"