summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2013-07-22 16:19:41 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-29 13:28:21 +0100
commitdea3e6964949c2d7269570d2f19c74033e54200e (patch)
treea0097c711c926ed26b9ae43b5566273b1ccc6651 /meta/recipes-graphics
parent78d1a23bf3a2737429daa4ee1016b09b3b1494bb (diff)
downloadpoky-dea3e6964949c2d7269570d2f19c74033e54200e.tar.gz
mesa: fix EGL compilation without X11 headers
Extracted from "d7033f4 mesa: upgrade to 9.1.3", already merged in master. Add EGL-Mutate-NativeDisplayType-depending-on-config.patch to build correctly in a non-X11 environment, it replaces fix-egl-compilation-without-x11-headers.patch. The new patch fixes compilation issues for components that include EGL/eglplatform.h file. With the original patch it was required to use -DMESA_EGL_NO_X11_HEADERS when using mesa .h files to get proper C definitions. The new patch was backported (trivial) to mesa 9.0.2 which is in dylan. (From OE-Core rev: e4f5a568ec8df772f2b8c07f2ac946b2e9247ccd) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/mesa/mesa-9.0.2.inc2
-rw-r--r--meta/recipes-graphics/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch361
-rw-r--r--meta/recipes-graphics/mesa/mesa/fix-egl-compilation-without-x11-headers.patch32
3 files changed, 362 insertions, 33 deletions
diff --git a/meta/recipes-graphics/mesa/mesa-9.0.2.inc b/meta/recipes-graphics/mesa/mesa-9.0.2.inc
index b88bc42e05..e2dcfdbd97 100644
--- a/meta/recipes-graphics/mesa/mesa-9.0.2.inc
+++ b/meta/recipes-graphics/mesa/mesa-9.0.2.inc
@@ -2,7 +2,7 @@ SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
2 file://0002-cross-compile.patch \ 2 file://0002-cross-compile.patch \
3 file://cross-glsl.patch \ 3 file://cross-glsl.patch \
4 file://dont-fail-if-libX11-isnt-installed.patch \ 4 file://dont-fail-if-libX11-isnt-installed.patch \
5 file://fix-egl-compilation-without-x11-headers.patch \ 5 file://EGL-Mutate-NativeDisplayType-depending-on-config.patch \
6 " 6 "
7 7
8SRC_URI[md5sum] = "dc45d1192203e418163e0017640e1cfc" 8SRC_URI[md5sum] = "dc45d1192203e418163e0017640e1cfc"
diff --git a/meta/recipes-graphics/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch b/meta/recipes-graphics/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch
new file mode 100644
index 0000000000..98c4095aeb
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/EGL-Mutate-NativeDisplayType-depending-on-config.patch
@@ -0,0 +1,361 @@
1From 7e5846aa52c7cb00b0db9fa393975880371d2620 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
12Conflicts:
13 configure.ac
14---
15 configure.ac | 9 +++
16 include/EGL/eglplatform.h | 146 -------------------------------------------
17 include/EGL/eglplatform.h.in | 146 +++++++++++++++++++++++++++++++++++++++++++
18 3 files changed, 155 insertions(+), 146 deletions(-)
19 delete mode 100644 include/EGL/eglplatform.h
20 create mode 100644 include/EGL/eglplatform.h.in
21
22diff --git a/configure.ac b/configure.ac
23index 682e0a5..a8a485d 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -1577,12 +1577,20 @@ fi
27
28 EGL_PLATFORMS="$egl_platforms"
29
30+if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
31+ MESA_EGL_NO_X11_HEADERS=0
32+else
33+ MESA_EGL_NO_X11_HEADERS=1
34+fi
35+
36 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
37 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
38 AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
39 AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
40 AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
41
42+AC_SUBST([MESA_EGL_NO_X11_HEADERS])
43+
44 AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
45 AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
46
47@@ -1953,6 +1961,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
48 dnl Substitute the config
49 AC_CONFIG_FILES([configs/current
50 Makefile
51+ include/EGL/eglplatform.h
52 src/egl/Makefile
53 src/egl/drivers/Makefile
54 src/egl/drivers/dri2/Makefile
55diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
56deleted file mode 100644
57index 17fdc61..0000000
58--- a/include/EGL/eglplatform.h
59+++ /dev/null
60@@ -1,146 +0,0 @@
61-#ifndef __eglplatform_h_
62-#define __eglplatform_h_
63-
64-/*
65-** Copyright (c) 2007-2009 The Khronos Group Inc.
66-**
67-** Permission is hereby granted, free of charge, to any person obtaining a
68-** copy of this software and/or associated documentation files (the
69-** "Materials"), to deal in the Materials without restriction, including
70-** without limitation the rights to use, copy, modify, merge, publish,
71-** distribute, sublicense, and/or sell copies of the Materials, and to
72-** permit persons to whom the Materials are furnished to do so, subject to
73-** the following conditions:
74-**
75-** The above copyright notice and this permission notice shall be included
76-** in all copies or substantial portions of the Materials.
77-**
78-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
79-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
80-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
81-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
82-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
83-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
84-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
85-*/
86-
87-/* Platform-specific types and definitions for egl.h
88- * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
89- *
90- * Adopters may modify khrplatform.h and this file to suit their platform.
91- * You are encouraged to submit all modifications to the Khronos group so that
92- * they can be included in future versions of this file. Please submit changes
93- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
94- * by filing a bug against product "EGL" component "Registry".
95- */
96-
97-#include <KHR/khrplatform.h>
98-
99-/* Macros used in EGL function prototype declarations.
100- *
101- * EGL functions should be prototyped as:
102- *
103- * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
104- * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
105- *
106- * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
107- */
108-
109-#ifndef EGLAPI
110-#define EGLAPI KHRONOS_APICALL
111-#endif
112-
113-#ifndef EGLAPIENTRY
114-#define EGLAPIENTRY KHRONOS_APIENTRY
115-#endif
116-#define EGLAPIENTRYP EGLAPIENTRY*
117-
118-/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
119- * are aliases of window-system-dependent types, such as X Display * or
120- * Windows Device Context. They must be defined in platform-specific
121- * code below. The EGL-prefixed versions of Native*Type are the same
122- * types, renamed in EGL 1.3 so all types in the API start with "EGL".
123- *
124- * Khronos STRONGLY RECOMMENDS that you use the default definitions
125- * provided below, since these changes affect both binary and source
126- * portability of applications using EGL running on different EGL
127- * implementations.
128- */
129-
130-#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
131-#ifndef WIN32_LEAN_AND_MEAN
132-#define WIN32_LEAN_AND_MEAN 1
133-#endif
134-#include <windows.h>
135-
136-typedef HDC EGLNativeDisplayType;
137-typedef HBITMAP EGLNativePixmapType;
138-typedef HWND EGLNativeWindowType;
139-
140-#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
141-
142-typedef int EGLNativeDisplayType;
143-typedef void *EGLNativeWindowType;
144-typedef void *EGLNativePixmapType;
145-
146-#elif defined(WL_EGL_PLATFORM)
147-
148-typedef struct wl_display *EGLNativeDisplayType;
149-typedef struct wl_egl_pixmap *EGLNativePixmapType;
150-typedef struct wl_egl_window *EGLNativeWindowType;
151-
152-#elif defined(__GBM__)
153-
154-typedef struct gbm_device *EGLNativeDisplayType;
155-typedef struct gbm_bo *EGLNativePixmapType;
156-typedef void *EGLNativeWindowType;
157-
158-#elif defined(ANDROID) /* Android */
159-
160-struct ANativeWindow;
161-struct egl_native_pixmap_t;
162-
163-typedef struct ANativeWindow *EGLNativeWindowType;
164-typedef struct egl_native_pixmap_t *EGLNativePixmapType;
165-typedef void *EGLNativeDisplayType;
166-
167-#elif defined(__unix__)
168-
169-#ifdef MESA_EGL_NO_X11_HEADERS
170-
171-typedef void *EGLNativeDisplayType;
172-typedef khronos_uint32_t EGLNativePixmapType;
173-typedef khronos_uint32_t EGLNativeWindowType;
174-
175-#else
176-
177-/* X11 (tentative) */
178-#include <X11/Xlib.h>
179-#include <X11/Xutil.h>
180-
181-typedef Display *EGLNativeDisplayType;
182-typedef Pixmap EGLNativePixmapType;
183-typedef Window EGLNativeWindowType;
184-
185-#endif /* MESA_EGL_NO_X11_HEADERS */
186-
187-#else
188-#error "Platform not recognized"
189-#endif
190-
191-/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
192-typedef EGLNativeDisplayType NativeDisplayType;
193-typedef EGLNativePixmapType NativePixmapType;
194-typedef EGLNativeWindowType NativeWindowType;
195-
196-
197-/* Define EGLint. This must be a signed integral type large enough to contain
198- * all legal attribute names and values passed into and out of EGL, whether
199- * their type is boolean, bitmask, enumerant (symbolic constant), integer,
200- * handle, or other. While in general a 32-bit integer will suffice, if
201- * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
202- * integer type.
203- */
204-typedef khronos_int32_t EGLint;
205-
206-#endif /* __eglplatform_h */
207diff --git a/include/EGL/eglplatform.h.in b/include/EGL/eglplatform.h.in
208new file mode 100644
209index 0000000..5126c92
210--- /dev/null
211+++ b/include/EGL/eglplatform.h.in
212@@ -0,0 +1,146 @@
213+#ifndef __eglplatform_h_
214+#define __eglplatform_h_
215+
216+/*
217+** Copyright (c) 2007-2009 The Khronos Group Inc.
218+**
219+** Permission is hereby granted, free of charge, to any person obtaining a
220+** copy of this software and/or associated documentation files (the
221+** "Materials"), to deal in the Materials without restriction, including
222+** without limitation the rights to use, copy, modify, merge, publish,
223+** distribute, sublicense, and/or sell copies of the Materials, and to
224+** permit persons to whom the Materials are furnished to do so, subject to
225+** the following conditions:
226+**
227+** The above copyright notice and this permission notice shall be included
228+** in all copies or substantial portions of the Materials.
229+**
230+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
231+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
232+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
233+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
234+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
235+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
236+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
237+*/
238+
239+/* Platform-specific types and definitions for egl.h
240+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
241+ *
242+ * Adopters may modify khrplatform.h and this file to suit their platform.
243+ * You are encouraged to submit all modifications to the Khronos group so that
244+ * they can be included in future versions of this file. Please submit changes
245+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
246+ * by filing a bug against product "EGL" component "Registry".
247+ */
248+
249+#include <KHR/khrplatform.h>
250+
251+/* Macros used in EGL function prototype declarations.
252+ *
253+ * EGL functions should be prototyped as:
254+ *
255+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
256+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
257+ *
258+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
259+ */
260+
261+#ifndef EGLAPI
262+#define EGLAPI KHRONOS_APICALL
263+#endif
264+
265+#ifndef EGLAPIENTRY
266+#define EGLAPIENTRY KHRONOS_APIENTRY
267+#endif
268+#define EGLAPIENTRYP EGLAPIENTRY*
269+
270+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
271+ * are aliases of window-system-dependent types, such as X Display * or
272+ * Windows Device Context. They must be defined in platform-specific
273+ * code below. The EGL-prefixed versions of Native*Type are the same
274+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
275+ *
276+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
277+ * provided below, since these changes affect both binary and source
278+ * portability of applications using EGL running on different EGL
279+ * implementations.
280+ */
281+
282+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
283+#ifndef WIN32_LEAN_AND_MEAN
284+#define WIN32_LEAN_AND_MEAN 1
285+#endif
286+#include <windows.h>
287+
288+typedef HDC EGLNativeDisplayType;
289+typedef HBITMAP EGLNativePixmapType;
290+typedef HWND EGLNativeWindowType;
291+
292+#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
293+
294+typedef int EGLNativeDisplayType;
295+typedef void *EGLNativeWindowType;
296+typedef void *EGLNativePixmapType;
297+
298+#elif defined(WL_EGL_PLATFORM)
299+
300+typedef struct wl_display *EGLNativeDisplayType;
301+typedef struct wl_egl_pixmap *EGLNativePixmapType;
302+typedef struct wl_egl_window *EGLNativeWindowType;
303+
304+#elif defined(__GBM__)
305+
306+typedef struct gbm_device *EGLNativeDisplayType;
307+typedef struct gbm_bo *EGLNativePixmapType;
308+typedef void *EGLNativeWindowType;
309+
310+#elif defined(ANDROID) /* Android */
311+
312+struct ANativeWindow;
313+struct egl_native_pixmap_t;
314+
315+typedef struct ANativeWindow *EGLNativeWindowType;
316+typedef struct egl_native_pixmap_t *EGLNativePixmapType;
317+typedef void *EGLNativeDisplayType;
318+
319+#elif defined(__unix__)
320+
321+#if @MESA_EGL_NO_X11_HEADERS@
322+
323+typedef void *EGLNativeDisplayType;
324+typedef khronos_uint32_t EGLNativePixmapType;
325+typedef khronos_uint32_t EGLNativeWindowType;
326+
327+#else
328+
329+/* X11 (tentative) */
330+#include <X11/Xlib.h>
331+#include <X11/Xutil.h>
332+
333+typedef Display *EGLNativeDisplayType;
334+typedef Pixmap EGLNativePixmapType;
335+typedef Window EGLNativeWindowType;
336+
337+#endif /* MESA_EGL_NO_X11_HEADERS */
338+
339+#else
340+#error "Platform not recognized"
341+#endif
342+
343+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
344+typedef EGLNativeDisplayType NativeDisplayType;
345+typedef EGLNativePixmapType NativePixmapType;
346+typedef EGLNativeWindowType NativeWindowType;
347+
348+
349+/* Define EGLint. This must be a signed integral type large enough to contain
350+ * all legal attribute names and values passed into and out of EGL, whether
351+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
352+ * handle, or other. While in general a 32-bit integer will suffice, if
353+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
354+ * integer type.
355+ */
356+typedef khronos_int32_t EGLint;
357+
358+#endif /* __eglplatform_h */
359--
3601.8.1.2
361
diff --git a/meta/recipes-graphics/mesa/mesa/fix-egl-compilation-without-x11-headers.patch b/meta/recipes-graphics/mesa/mesa/fix-egl-compilation-without-x11-headers.patch
deleted file mode 100644
index 6436b592b4..0000000000
--- a/meta/recipes-graphics/mesa/mesa/fix-egl-compilation-without-x11-headers.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Upstream-Status: Submitted
2
3Picked from mesa-dev mailing list: http://marc.info/?l=mesa3d-dev&m=133053004130468
4
5From: Benjamin Franzke <benjaminfranzke@googlemail.com>
6Date: Wed, 29 Feb 2012 15:36:23 +0100
7Subject: [PATCH] configure: Fix egl compilation without x11 headers
8
9We dont want eglplatform.h to typedef egl native types
10to x11 types, when x11 headers are not available.
11---
12 configure.ac | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/configure.ac b/configure.ac
16index b384b44..8eb8459 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -1262,6 +1262,10 @@ if test "x$enable_egl" = xyes; then
20
21 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
22
23+ if test "$have_x" != yes; then
24+ DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
25+ fi
26+
27 if test "$enable_static" != yes; then
28 # build egl_glx when libGL is built
29 if test "x$enable_glx" = xyes; then
30--
311.7.10.4
32