summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-graphics/mesa
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@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-demos/0001-mesa-demos-Add-missing-data-files.patch624
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch54
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch424
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch234
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch267
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch41
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch74
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch101
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch73
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb53
-rw-r--r--meta/recipes-graphics/mesa/mesa-gl_10.1.3.bb11
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc189
-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.patch362
-rw-r--r--meta/recipes-graphics/mesa/mesa/0006-fix-out-of-tree-egl.patch48
-rw-r--r--meta/recipes-graphics/mesa/mesa_10.1.3.bb19
-rw-r--r--meta/recipes-graphics/mesa/mesa_git.bb23
18 files changed, 2676 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-demos/0001-mesa-demos-Add-missing-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
new file mode 100644
index 0000000000..93ee9c286d
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
@@ -0,0 +1,624 @@
1From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Mon, 12 May 2014 15:22:32 -0400
4Subject: [PATCH 1/9] mesa-demos: Add missing data files.
5
6Add some data files that are present in the git repository:
7 http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0
8but not in the release tarball
9 ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2
10
11Upstream-Status: Backport
12Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 src/fpglsl/depth-read.glsl | 4 +
16 src/fpglsl/infinite-loop.glsl | 7 +
17 src/glsl/CH11-bumpmaptex.frag | 47 +++++++
18 src/glsl/blinking-teapot.frag | 31 +++++
19 src/glsl/blinking-teapot.vert | 16 +++
20 src/glsl/convolution.frag | 21 +++
21 src/glsl/simplex-noise.glsl | 279 ++++++++++++++++++++++++++++++++++++++++
22 src/glsl/skinning.vert | 24 ++++
23 src/perf/glslstateschange1.frag | 19 +++
24 src/perf/glslstateschange1.vert | 14 ++
25 src/perf/glslstateschange2.frag | 17 +++
26 src/perf/glslstateschange2.vert | 14 ++
27 src/vpglsl/infinite-loop.glsl | 8 ++
28 13 files changed, 501 insertions(+)
29 create mode 100644 src/fpglsl/depth-read.glsl
30 create mode 100644 src/fpglsl/infinite-loop.glsl
31 create mode 100644 src/glsl/CH11-bumpmaptex.frag
32 create mode 100644 src/glsl/blinking-teapot.frag
33 create mode 100644 src/glsl/blinking-teapot.vert
34 create mode 100644 src/glsl/convolution.frag
35 create mode 100644 src/glsl/simplex-noise.glsl
36 create mode 100644 src/glsl/skinning.vert
37 create mode 100644 src/perf/glslstateschange1.frag
38 create mode 100644 src/perf/glslstateschange1.vert
39 create mode 100644 src/perf/glslstateschange2.frag
40 create mode 100644 src/perf/glslstateschange2.vert
41 create mode 100644 src/vpglsl/infinite-loop.glsl
42
43diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl
44new file mode 100644
45index 0000000..86d298e
46--- /dev/null
47+++ b/src/fpglsl/depth-read.glsl
48@@ -0,0 +1,4 @@
49+void main()
50+{
51+ gl_FragColor = gl_FragCoord.zzzz;
52+}
53diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl
54new file mode 100644
55index 0000000..c6dc6ee
56--- /dev/null
57+++ b/src/fpglsl/infinite-loop.glsl
58@@ -0,0 +1,7 @@
59+void main() {
60+ vec4 sum = vec4(0);
61+ for (int i = 1; i != 2; i += 2) {
62+ sum += vec4(0.1, 0.1, 0.1, 0.1);
63+ }
64+ gl_FragColor = sum;
65+}
66diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag
67new file mode 100644
68index 0000000..b5dabb4
69--- /dev/null
70+++ b/src/glsl/CH11-bumpmaptex.frag
71@@ -0,0 +1,47 @@
72+//
73+// Fragment shader for procedural bumps
74+//
75+// Authors: John Kessenich, Randi Rost
76+//
77+// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
78+//
79+// See 3Dlabs-License.txt for license information
80+//
81+// Texture mapping/modulation added by Brian Paul
82+//
83+
84+varying vec3 LightDir;
85+varying vec3 EyeDir;
86+
87+uniform float BumpDensity; // = 16.0
88+uniform float BumpSize; // = 0.15
89+uniform float SpecularFactor; // = 0.5
90+
91+uniform sampler2D Tex;
92+
93+void main()
94+{
95+ vec3 ambient = vec3(0.25);
96+ vec3 litColor;
97+ vec2 c = BumpDensity * gl_TexCoord[0].st;
98+ vec2 p = fract(c) - vec2(0.5);
99+
100+ float d, f;
101+ d = p.x * p.x + p.y * p.y;
102+ f = inversesqrt(d + 1.0);
103+
104+ if (d >= BumpSize)
105+ { p = vec2(0.0); f = 1.0; }
106+
107+ vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz;
108+
109+ vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
110+ litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0));
111+ vec3 reflectDir = reflect(LightDir, normDelta);
112+
113+ float spec = max(dot(EyeDir, reflectDir), 0.0);
114+ spec *= SpecularFactor;
115+ litColor = min(litColor + spec, vec3(1.0));
116+
117+ gl_FragColor = vec4(litColor, 1.0);
118+}
119diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag
120new file mode 100644
121index 0000000..0db060b
122--- /dev/null
123+++ b/src/glsl/blinking-teapot.frag
124@@ -0,0 +1,31 @@
125+#extension GL_ARB_uniform_buffer_object : enable
126+
127+layout(std140) uniform colors0
128+{
129+ float DiffuseCool;
130+ float DiffuseWarm;
131+ vec3 SurfaceColor;
132+ vec3 WarmColor;
133+ vec3 CoolColor;
134+ vec4 some[8];
135+};
136+
137+varying float NdotL;
138+varying vec3 ReflectVec;
139+varying vec3 ViewVec;
140+
141+void main (void)
142+{
143+
144+ vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
145+ vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
146+ vec3 kfinal = mix(kcool, kwarm, NdotL);
147+
148+ vec3 nreflect = normalize(ReflectVec);
149+ vec3 nview = normalize(ViewVec);
150+
151+ float spec = max(dot(nreflect, nview), 0.0);
152+ spec = pow(spec, 32.0);
153+
154+ gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);
155+}
156diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert
157new file mode 100644
158index 0000000..397d733
159--- /dev/null
160+++ b/src/glsl/blinking-teapot.vert
161@@ -0,0 +1,16 @@
162+vec3 LightPosition = vec3(0.0, 10.0, 4.0);
163+
164+varying float NdotL;
165+varying vec3 ReflectVec;
166+varying vec3 ViewVec;
167+
168+void main(void)
169+{
170+ vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex);
171+ vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
172+ vec3 lightVec = normalize(LightPosition - ecPos);
173+ ReflectVec = normalize(reflect(-lightVec, tnorm));
174+ ViewVec = normalize(-ecPos);
175+ NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5;
176+ gl_Position = ftransform();
177+}
178diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag
179new file mode 100644
180index 0000000..e49b8ac
181--- /dev/null
182+++ b/src/glsl/convolution.frag
183@@ -0,0 +1,21 @@
184+
185+const int KernelSize = 9;
186+
187+//texture offsets
188+uniform vec2 Offset[KernelSize];
189+//convolution kernel
190+uniform vec4 KernelValue[KernelSize];
191+uniform sampler2D srcTex;
192+uniform vec4 ScaleFactor;
193+uniform vec4 BaseColor;
194+
195+void main(void)
196+{
197+ int i;
198+ vec4 sum = vec4(0.0);
199+ for (i = 0; i < KernelSize; ++i) {
200+ vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
201+ sum += tmp * KernelValue[i];
202+ }
203+ gl_FragColor = sum * ScaleFactor + BaseColor;
204+}
205diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl
206new file mode 100644
207index 0000000..b6833cb
208--- /dev/null
209+++ b/src/glsl/simplex-noise.glsl
210@@ -0,0 +1,279 @@
211+//
212+// Description : Array and textureless GLSL 2D/3D/4D simplex
213+// noise functions.
214+// Author : Ian McEwan, Ashima Arts.
215+// Maintainer : ijm
216+// Lastmod : 20110223
217+// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
218+// Distributed under the Artistic License 2.0; See LICENCE file.
219+//
220+
221+#define NORMALIZE_GRADIENTS
222+#undef USE_CIRCLE
223+#define COLLAPSE_SORTNET
224+
225+float permute(float x0,vec3 p) {
226+ float x1 = mod(x0 * p.y, p.x);
227+ return floor( mod( (x1 + p.z) *x0, p.x ));
228+ }
229+vec2 permute(vec2 x0,vec3 p) {
230+ vec2 x1 = mod(x0 * p.y, p.x);
231+ return floor( mod( (x1 + p.z) *x0, p.x ));
232+ }
233+vec3 permute(vec3 x0,vec3 p) {
234+ vec3 x1 = mod(x0 * p.y, p.x);
235+ return floor( mod( (x1 + p.z) *x0, p.x ));
236+ }
237+vec4 permute(vec4 x0,vec3 p) {
238+ vec4 x1 = mod(x0 * p.y, p.x);
239+ return floor( mod( (x1 + p.z) *x0, p.x ));
240+ }
241+
242+uniform vec4 pParam;
243+// Example
244+// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.);
245+
246+float taylorInvSqrt(float r)
247+ {
248+ return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r );
249+ }
250+
251+float simplexNoise2(vec2 v)
252+ {
253+ const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.;
254+ 0.366025403784438597); // 0.5*(sqrt(3.0)-1.);
255+ const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312;
256+// First corner
257+ vec2 i = floor(v + dot(v, C.yy) );
258+ vec2 x0 = v - i + dot(i, C.xx);
259+
260+// Other corners
261+ vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ;
262+
263+ // x0 = x0 - 0. + 0. * C
264+ vec2 x1 = x0 - i1 + 1. * C.xx ;
265+ vec2 x2 = x0 - 1. + 2. * C.xx ;
266+
267+// Permutations
268+ i = mod(i, pParam.x);
269+ vec3 p = permute( permute(
270+ i.y + vec3(0., i1.y, 1. ), pParam.xyz)
271+ + i.x + vec3(0., i1.x, 1. ), pParam.xyz);
272+
273+#ifndef USE_CIRCLE
274+// ( N points uniformly over a line, mapped onto a diamond.)
275+ vec3 x = fract(p / pParam.w) ;
276+ vec3 h = 0.5 - abs(x) ;
277+
278+ vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.;
279+ vec3 sh = vec3(lessThan(h,D.xxx));
280+
281+ vec3 a0 = x + sx*sh;
282+ vec2 p0 = vec2(a0.x,h.x);
283+ vec2 p1 = vec2(a0.y,h.y);
284+ vec2 p2 = vec2(a0.z,h.z);
285+
286+#ifdef NORMALISE_GRADIENTS
287+ p0 *= taylorInvSqrt(dot(p0,p0));
288+ p1 *= taylorInvSqrt(dot(p1,p1));
289+ p2 *= taylorInvSqrt(dot(p2,p2));
290+#endif
291+
292+ vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) );
293+#else
294+// N points around a unit circle.
295+ vec3 phi = D.z * mod(p,pParam.w) /pParam.w ;
296+ vec4 a0 = sin(phi.xxyy+D.xyxy);
297+ vec2 a1 = sin(phi.zz +D.xy);
298+ vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) );
299+#endif
300+// mix
301+ vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
302+ m = m*m ;
303+ return 1.66666* 70.*dot(m*m, g);
304+ }
305+
306+float simplexNoise3(vec3 v)
307+ {
308+ const vec2 C = vec2(1./6. , 1./3. ) ;
309+ const vec4 D = vec4(0., 0.5, 1.0, 2.0);
310+
311+// First corner
312+ vec3 i = floor(v + dot(v, C.yyy) );
313+ vec3 x0 = v - i + dot(i, C.xxx) ;
314+
315+// Other corners
316+#ifdef COLLAPSE_SORTNET
317+ vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) );
318+ vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) );
319+
320+ vec3 i1 = g.xyz * l.zxy;
321+ vec3 i2 = max( g.xyz, l.zxy);
322+#else
323+// Keeping this clean - let the compiler optimize.
324+ vec3 q1;
325+ q1.x = max(x0.x, x0.y);
326+ q1.y = min(x0.x, x0.y);
327+ q1.z = x0.z;
328+
329+ vec3 q2;
330+ q2.x = max(q1.x,q1.z);
331+ q2.z = min(q1.x,q1.z);
332+ q2.y = q1.y;
333+
334+ vec3 q3;
335+ q3.y = max(q2.y, q2.z);
336+ q3.z = min(q2.y, q2.z);
337+ q3.x = q2.x;
338+
339+ vec3 i1 = vec3(equal(q3.xxx, x0));
340+ vec3 i2 = i1 + vec3(equal(q3.yyy, x0));
341+#endif
342+
343+ // x0 = x0 - 0. + 0. * C
344+ vec3 x1 = x0 - i1 + 1. * C.xxx;
345+ vec3 x2 = x0 - i2 + 2. * C.xxx;
346+ vec3 x3 = x0 - 1. + 3. * C.xxx;
347+
348+// Permutations
349+ i = mod(i, pParam.x );
350+ vec4 p = permute( permute( permute(
351+ i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz)
352+ + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz)
353+ + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz);
354+
355+// Gradients
356+// ( N*N points uniformly over a square, mapped onto a octohedron.)
357+ float n_ = 1.0/pParam.w ;
358+ vec3 ns = n_ * D.wyz - D.xzx ;
359+
360+ vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N)
361+
362+ vec4 x_ = floor(j * ns.z) ;
363+ vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N)
364+
365+ vec4 x = x_ *ns.x + ns.yyyy;
366+ vec4 y = y_ *ns.x + ns.yyyy;
367+ vec4 h = 1. - abs(x) - abs(y);
368+
369+ vec4 b0 = vec4( x.xy, y.xy );
370+ vec4 b1 = vec4( x.zw, y.zw );
371+
372+ vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.;
373+ vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.;
374+ vec4 sh = vec4(lessThan(h, D.xxxx));
375+
376+ vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
377+ vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
378+
379+ vec3 p0 = vec3(a0.xy,h.x);
380+ vec3 p1 = vec3(a0.zw,h.y);
381+ vec3 p2 = vec3(a1.xy,h.z);
382+ vec3 p3 = vec3(a1.zw,h.w);
383+
384+#ifdef NORMALISE_GRADIENTS
385+ p0 *= taylorInvSqrt(dot(p0,p0));
386+ p1 *= taylorInvSqrt(dot(p1,p1));
387+ p2 *= taylorInvSqrt(dot(p2,p2));
388+ p3 *= taylorInvSqrt(dot(p3,p3));
389+#endif
390+
391+// Mix
392+ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
393+ m = m * m;
394+//used to be 64.
395+ return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
396+ dot(p2,x2), dot(p3,x3) ) );
397+ }
398+
399+vec4 grad4(float j, vec4 ip)
400+ {
401+ const vec4 ones = vec4(1.,1.,1.,-1.);
402+ vec4 p,s;
403+
404+ p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0;
405+ p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
406+ s = vec4(lessThan(p,vec4(0.)));
407+ p.xyz = p.xyz + (s.xyz*2.-1.) * s.www;
408+
409+ return p;
410+ }
411+
412+float simplexNoise4(vec4 v)
413+ {
414+ const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
415+ 0.309016994374947451); // (sqrt(5) - 1)/4 F4
416+// First corner
417+ vec4 i = floor(v + dot(v, C.yyyy) );
418+ vec4 x0 = v - i + dot(i, C.xxxx);
419+
420+// Other corners
421+
422+// Force existance of strict total ordering in sort.
423+ vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.);
424+ vec4 q1;
425+ q1.xy = max(q0.xy,q0.zw); // x:z y:w
426+ q1.zw = min(q0.xy,q0.zw);
427+
428+ vec4 q2;
429+ q2.xz = max(q1.xz,q1.yw); // x:y z:w
430+ q2.yw = min(q1.xz,q1.yw);
431+
432+ vec4 q3;
433+ q3.y = max(q2.y,q2.z); // y:z
434+ q3.z = min(q2.y,q2.z);
435+ q3.xw = q2.xw;
436+
437+ vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0));
438+ vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0));
439+ vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0));
440+
441+ // x0 = x0 - 0. + 0. * C
442+ vec4 x1 = x0 - i1 + 1. * C.xxxx;
443+ vec4 x2 = x0 - i2 + 2. * C.xxxx;
444+ vec4 x3 = x0 - i3 + 3. * C.xxxx;
445+ vec4 x4 = x0 - 1. + 4. * C.xxxx;
446+
447+// Permutations
448+ i = mod(i, pParam.x );
449+ float j0 = permute( permute( permute( permute (
450+ i.w, pParam.xyz) + i.z, pParam.xyz)
451+ + i.y, pParam.xyz) + i.x, pParam.xyz);
452+ vec4 j1 = permute( permute( permute( permute (
453+ i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz)
454+ + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz)
455+ + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz)
456+ + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz);
457+// Gradients
458+// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.)
459+ vec4 ip = pParam ;
460+ ip.xy *= pParam.w ;
461+ ip.x *= pParam.w ;
462+ ip = vec4(1.,1.,1.,2.) / ip ;
463+
464+ vec4 p0 = grad4(j0, ip);
465+ vec4 p1 = grad4(j1.x, ip);
466+ vec4 p2 = grad4(j1.y, ip);
467+ vec4 p3 = grad4(j1.z, ip);
468+ vec4 p4 = grad4(j1.w, ip);
469+
470+#ifdef NORMALISE_GRADIENTS
471+ p0 *= taylorInvSqrt(dot(p0,p0));
472+ p1 *= taylorInvSqrt(dot(p1,p1));
473+ p2 *= taylorInvSqrt(dot(p2,p2));
474+ p3 *= taylorInvSqrt(dot(p3,p3));
475+ p4 *= taylorInvSqrt(dot(p4,p4));
476+#endif
477+
478+// Mix
479+ vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
480+ vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.);
481+ m0 = m0 * m0;
482+ m1 = m1 * m1;
483+ return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
484+ + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
485+
486+ }
487+
488+
489+
490diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert
491new file mode 100644
492index 0000000..28970ee
493--- /dev/null
494+++ b/src/glsl/skinning.vert
495@@ -0,0 +1,24 @@
496+// Vertex weighting/blendin shader
497+// Brian Paul
498+// 4 Nov 2008
499+
500+uniform mat4 mat0, mat1;
501+attribute float weight;
502+
503+void main()
504+{
505+ // simple diffuse shading
506+ // Note that we should really transform the normal vector along with
507+ // the postion below... someday.
508+ vec3 lightVec = vec3(0, 0, 1);
509+ vec3 norm = gl_NormalMatrix * gl_Normal;
510+ float dot = 0.2 + max(0.0, dot(norm, lightVec));
511+ gl_FrontColor = vec4(dot);
512+
513+ // compute sum of weighted transformations
514+ vec4 pos0 = mat0 * gl_Vertex;
515+ vec4 pos1 = mat1 * gl_Vertex;
516+ vec4 pos = mix(pos0, pos1, weight);
517+
518+ gl_Position = gl_ModelViewProjectionMatrix * pos;
519+}
520diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag
521new file mode 100644
522index 0000000..0839436
523--- /dev/null
524+++ b/src/perf/glslstateschange1.frag
525@@ -0,0 +1,19 @@
526+// Multi-texture fragment shader
527+// Brian Paul
528+
529+// Composite second texture over first.
530+// We're assuming the 2nd texture has a meaningful alpha channel.
531+
532+uniform sampler2D tex1;
533+uniform sampler2D tex2;
534+uniform vec4 UniV1;
535+uniform vec4 UniV2;
536+
537+void main()
538+{
539+ vec4 t3;
540+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
541+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
542+ t3 = mix(t1, t2, t2.w);
543+ gl_FragColor = t3 + UniV1 + UniV2;
544+}
545diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert
546new file mode 100644
547index 0000000..cef50db
548--- /dev/null
549+++ b/src/perf/glslstateschange1.vert
550@@ -0,0 +1,14 @@
551+// Multi-texture vertex shader
552+// Brian Paul
553+
554+
555+attribute vec4 TexCoord0, TexCoord1;
556+attribute vec4 VertCoord;
557+
558+void main()
559+{
560+ gl_TexCoord[0] = TexCoord0;
561+ gl_TexCoord[1] = TexCoord1;
562+ // note: may use gl_Vertex or VertCoord here for testing:
563+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
564+}
565diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag
566new file mode 100644
567index 0000000..0df0319
568--- /dev/null
569+++ b/src/perf/glslstateschange2.frag
570@@ -0,0 +1,17 @@
571+// Multi-texture fragment shader
572+// Brian Paul
573+
574+// Composite second texture over first.
575+// We're assuming the 2nd texture has a meaningful alpha channel.
576+
577+uniform sampler2D tex1;
578+uniform sampler2D tex2;
579+uniform vec4 UniV1;
580+uniform vec4 UniV2;
581+
582+void main()
583+{
584+ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
585+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
586+ gl_FragColor = t1 + t2 + UniV1 + UniV2;
587+}
588diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert
589new file mode 100644
590index 0000000..cef50db
591--- /dev/null
592+++ b/src/perf/glslstateschange2.vert
593@@ -0,0 +1,14 @@
594+// Multi-texture vertex shader
595+// Brian Paul
596+
597+
598+attribute vec4 TexCoord0, TexCoord1;
599+attribute vec4 VertCoord;
600+
601+void main()
602+{
603+ gl_TexCoord[0] = TexCoord0;
604+ gl_TexCoord[1] = TexCoord1;
605+ // note: may use gl_Vertex or VertCoord here for testing:
606+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
607+}
608diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl
609new file mode 100644
610index 0000000..bc7ae4b
611--- /dev/null
612+++ b/src/vpglsl/infinite-loop.glsl
613@@ -0,0 +1,8 @@
614+void main() {
615+ gl_Position = gl_Vertex;
616+ vec4 sum = vec4(0);
617+ for (int i = 1; i != 2; i += 2) {
618+ sum += vec4(0.1, 0.1, 0.1, 0.1);
619+ }
620+ gl_FrontColor = sum;
621+}
622--
6232.0.0
624
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
new file mode 100644
index 0000000000..c96af12acf
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
@@ -0,0 +1,54 @@
1From 36829a8d7ad2888515fbee95c2a70b3d636d7538 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Wed, 9 Jul 2014 14:30:33 +0200
4Subject: [PATCH 2/9] Correctly implement with AC_WITH(glut) so that
5 --without-glut works.
6
7---
8 configure.ac | 26 +++++++++++++++-----------
9 1 file changed, 15 insertions(+), 11 deletions(-)
10
11diff --git a/configure.ac b/configure.ac
12index c4ee12b..9445424 100644
13--- a/configure.ac
14+++ b/configure.ac
15@@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
16 DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
17
18 dnl Check for GLUT
19-GLUT_CFLAGS=""
20-GLUT_LIBS=-lglut
21-glut_enabled=yes
22+glut_enabled=no
23 AC_ARG_WITH([glut],
24 [AS_HELP_STRING([--with-glut=DIR],
25 [glut install directory])],
26 [GLUT_CFLAGS="-I$withval/include"
27- GLUT_LIBS="-L$withval/lib -lglut"])
28-AC_CHECK_HEADER([GL/glut.h],
29- [],
30- [glut_enabled=no])
31-AC_CHECK_LIB([glut],
32- [glutInit],
33- [],
34- [glut_enabled=no])
35+ GLUT_LIBS="-L$withval/lib -lglut"],
36+ [GLUT_CFLAGS=""
37+ GLUT_LIBS="-lglut"]
38+ )
39+AS_IF([test "x$with_glut" != xno],
40+ [AC_CHECK_HEADER([GL/glut.h],
41+ [],
42+ [glut_enabled=no])
43+ AC_CHECK_LIB([glut],
44+ [glutInit],
45+ [],
46+ [glut_enabled=no])
47+ glut_enabled=yes
48+])
49
50 dnl Check for FreeGLUT 2.6 or later
51 AC_EGREP_HEADER([glutInitContextProfile],
52--
532.0.0
54
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 0000000000..4b07193a7f
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,424 @@
1From b25e9c675cf560b8b037dc855c6b3b1d09957867 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Wed, 9 Jul 2014 14:23:41 +0200
4Subject: [PATCH 3/9] configure: Allow to disable demos which require GLEW or
5 GLU
6
7* in some systems without X11 support we don't have GLEW, but
8 mesa-demos are still useful
9
10Upstream-Status: Pending
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 configure.ac | 49 ++++++++++++++++++++---------
15 src/Makefile.am | 14 ++++++---
16 src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
17 src/egl/Makefile.am | 8 +++--
18 src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
19 src/egl/opengles2/Makefile.am | 33 ++++++++++---------
20 6 files changed, 135 insertions(+), 86 deletions(-)
21
22diff --git a/configure.ac b/configure.ac
23index 9445424..bc4c8d1 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
27 [AC_DEFINE(HAVE_FREEGLUT)],
28 [])
29
30-dnl Check for GLEW
31-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
32-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
33-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
34+AC_ARG_ENABLE([glew],
35+ [AS_HELP_STRING([--enable-glew],
36+ [build demos which require glew @<:@default=yes@:>@])],
37+ [enable_glew="$enableval"],
38+ [enable_glew=yes]
39+)
40+
41+if test "x$enable_glew" = xyes; then
42+ dnl Check for GLEW
43+ PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
44+ DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
45+ DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
46+fi
47
48 # LIBS was set by AC_CHECK_LIB above
49 LIBS=""
50
51-PKG_CHECK_MODULES(GLU, [glu], [],
52- [AC_CHECK_HEADER([GL/glu.h],
53- [],
54- AC_MSG_ERROR([GLU not found]))
55- AC_CHECK_LIB([GLU],
56- [gluBeginCurve],
57- [GLU_LIBS=-lGLU],
58- AC_MSG_ERROR([GLU required])) ])
59+AC_ARG_ENABLE([glu],
60+ [AS_HELP_STRING([--enable-glu],
61+ [build demos which require glu @<:@default=yes@:>@])],
62+ [enable_glu="$enableval"],
63+ [enable_glu=yes]
64+)
65
66-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
67-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
68+if test "x$enable_glu" = xyes; then
69+ PKG_CHECK_MODULES(GLU, [glu], [],
70+ [AC_CHECK_HEADER([GL/glu.h],
71+ [],
72+ AC_MSG_ERROR([GLU not found]))
73+ AC_CHECK_LIB([GLU],
74+ [gluBeginCurve],
75+ [GLU_LIBS=-lGLU
76+ glu_enabled=yes],
77+ AC_MSG_ERROR([GLU required])) ])
78+
79+ DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
80+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
81+fi
82
83 AC_ARG_ENABLE([egl],
84 [AS_HELP_STRING([--enable-egl],
85@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
86 AC_SUBST([WAYLAND_LIBS])
87
88
89+AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
90+AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
91 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
92 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
93 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
94diff --git a/src/Makefile.am b/src/Makefile.am
95index 1647d64..754c47c 100644
96--- a/src/Makefile.am
97+++ b/src/Makefile.am
98@@ -23,14 +23,18 @@
99 # Eric Anholt <eric@anholt.net>
100
101+if HAVE_GLEW
102+UTIL = util
103+endif
104+
105 SUBDIRS = \
106- util \
107+ $(UTIL) \
108 data \
109 demos \
110 egl \
111 fp \
112 fpglsl \
113 glsl \
114- gs \
115+ gs \
116 objviewer \
117 osdemos \
118 perf \
119@@ -40,8 +39,12 @@ SUBDIRS = \
120 slang \
121 tests \
122 tools \
123- trivial \
124- vp \
125- vpglsl \
126 wgl \
127 xdemos
128+
129+if HAVE_GLEW
130+SUBDIRS += \
131+ vp \
132+ vpglsl \
133+ trivial
134+endif
135diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
136index 41603fa..ab1e3ab 100644
137--- a/src/demos/Makefile.am
138+++ b/src/demos/Makefile.am
139@@ -30,91 +30,100 @@ AM_LDFLAGS = \
140 $(DEMO_LIBS) \
141 $(GLUT_LIBS)
142
143+bin_PROGRAMS =
144+
145 if HAVE_GLUT
146-bin_PROGRAMS = \
147+if HAVE_GLEW
148+bin_PROGRAMS += \
149 arbfplight \
150 arbfslight \
151 arbocclude \
152 arbocclude2 \
153- bounce \
154- clearspd \
155 copypix \
156 cubemap \
157 cuberender \
158 dinoshade \
159- dissolve \
160- drawpix \
161 engine \
162 fbo_firecube \
163 fbotexture \
164- fire \
165 fogcoord \
166 fplight \
167 fslight \
168+ gloss \
169+ isosurf \
170+ multiarb \
171+ paltex \
172+ pointblast \
173+ projtex \
174+ shadowtex \
175+ spriteblast \
176+ stex3d \
177+ textures \
178+ vao_demo \
179+ winpos
180+
181+copypix_LDADD = ../util/libutil.la
182+cubemap_LDADD = ../util/libutil.la
183+cuberender_LDADD = ../util/libutil.la
184+engine_LDADD = ../util/libutil.la
185+fbo_firecube_LDADD = ../util/libutil.la
186+gloss_LDADD = ../util/libutil.la
187+isosurf_LDADD = ../util/libutil.la
188+multiarb_LDADD = ../util/libutil.la
189+projtex_LDADD = ../util/libutil.la
190+textures_LDADD = ../util/libutil.la
191+winpos_LDADD = ../util/libutil.la
192+endif
193+
194+if HAVE_GLU
195+bin_PROGRAMS += \
196+ bounce \
197+ clearspd \
198+ dissolve \
199+ drawpix \
200+ fire \
201 gamma \
202 gearbox \
203 gears \
204 geartrain \
205 glinfo \
206- gloss \
207 gltestperf \
208 ipers \
209- isosurf \
210 lodbias \
211 morph3d \
212- multiarb \
213- paltex \
214 pixeltest \
215- pointblast \
216- projtex \
217 ray \
218 readpix \
219 reflect \
220 renormal \
221- shadowtex \
222 singlebuffer \
223 spectex \
224- spriteblast \
225- stex3d \
226 teapot \
227 terrain \
228 tessdemo \
229 texcyl \
230 texenv \
231- textures \
232 trispd \
233 tunnel2 \
234- tunnel \
235- vao_demo \
236- winpos
237-endif
238+ tunnel
239
240 tunnel_SOURCES = \
241 tunnel.c \
242 tunneldat.h
243
244-copypix_LDADD = ../util/libutil.la
245-cubemap_LDADD = ../util/libutil.la
246-cuberender_LDADD = ../util/libutil.la
247-drawpix_LDADD = ../util/libutil.la
248 dissolve_LDADD = ../util/libutil.la
249-engine_LDADD = ../util/libutil.la
250-fbo_firecube_LDADD = ../util/libutil.la
251+drawpix_LDADD = ../util/libutil.la
252 fire_LDADD = ../util/libutil.la
253-gloss_LDADD = ../util/libutil.la
254 ipers_LDADD = ../util/libutil.la
255-isosurf_LDADD = ../util/libutil.la
256 lodbias_LDADD = ../util/libutil.la
257-multiarb_LDADD = ../util/libutil.la
258-projtex_LDADD = ../util/libutil.la
259 readpix_LDADD = ../util/libutil.la
260 reflect_LDADD = ../util/libutil.la
261 teapot_LDADD = ../util/libutil.la
262 texcyl_LDADD = ../util/libutil.la
263-textures_LDADD = ../util/libutil.la
264 tunnel_LDADD = ../util/libutil.la
265 tunnel2_LDADD = ../util/libutil.la
266-winpos_LDADD = ../util/libutil.la
267+endif
268+endif
269
270 EXTRA_DIST = \
271 README
272diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
273index d64a49e..4fe1ca8 100644
274--- a/src/egl/Makefile.am
275+++ b/src/egl/Makefile.am
276@@ -24,8 +24,12 @@
277
278 SUBDIRS = \
279 eglut \
280- opengl \
281- openvg \
282 opengles1 \
283 opengles2 \
284 oes_vg
285+
286+if HAVE_GLU
287+SUBDIRS += \
288+ opengl \
289+ openvg
290+endif
291diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
292index 7a9828d..3455e75 100644
293--- a/src/egl/opengles1/Makefile.am
294+++ b/src/egl/opengles1/Makefile.am
295@@ -36,28 +36,43 @@ AM_LDFLAGS = \
296 $(EGL_LIBS) \
297 -lm
298
299+noinst_PROGRAMS =
300+
301 if HAVE_EGL
302 if HAVE_GLESV1
303-noinst_PROGRAMS = \
304- bindtex \
305- clear \
306+noinst_PROGRAMS += \
307 drawtex_screen \
308+ gears_screen \
309+ torus_screen \
310+ tri_screen
311+
312+drawtex_screen_SOURCES = drawtex.c
313+gears_screen_SOURCES = gears.c
314+torus_screen_SOURCES = torus.c
315+tri_screen_SOURCES = tri.c
316+
317+drawtex_screen_LDADD = ../eglut/libeglut_screen.la
318+gears_screen_LDADD = ../eglut/libeglut_screen.la
319+torus_screen_LDADD = ../eglut/libeglut_screen.la
320+tri_screen_LDADD = ../eglut/libeglut_screen.la
321+
322+if HAVE_X11
323+noinst_PROGRAMS += \
324+ clear
325+
326+bin_PROGRAMS = \
327+ bindtex \
328 drawtex_x11 \
329 eglfbdev \
330 es1_info \
331- gears_screen \
332 gears_x11 \
333 msaa \
334 pbuffer\
335 render_tex \
336 texture_from_pixmap \
337- torus_screen \
338 torus_x11 \
339- tri_screen \
340 tri_x11 \
341 two_win
342-endif
343-endif
344
345 bindtex_LDADD = $(X11_LIBS)
346 es1_info_LDADD = $(X11_LIBS)
347@@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
348 clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
349 clear_LDFLAGS =
350
351-drawtex_screen_SOURCES = drawtex.c
352-gears_screen_SOURCES = gears.c
353-torus_screen_SOURCES = torus.c
354-tri_screen_SOURCES = tri.c
355-
356 drawtex_x11_SOURCES = drawtex.c
357 gears_x11_SOURCES = gears.c
358 torus_x11_SOURCES = torus.c
359 tri_x11_SOURCES = tri.c
360
361-drawtex_screen_LDADD = ../eglut/libeglut_screen.la
362-gears_screen_LDADD = ../eglut/libeglut_screen.la
363-torus_screen_LDADD = ../eglut/libeglut_screen.la
364-tri_screen_LDADD = ../eglut/libeglut_screen.la
365-
366 drawtex_x11_LDADD = ../eglut/libeglut_x11.la
367 gears_x11_LDADD = ../eglut/libeglut_x11.la
368 torus_x11_LDADD = ../eglut/libeglut_x11.la
369 tri_x11_LDADD = ../eglut/libeglut_x11.la
370+endif
371+endif
372+endif
373diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
374index 41c1b80..74af460 100644
375--- a/src/egl/opengles2/Makefile.am
376+++ b/src/egl/opengles2/Makefile.am
377@@ -36,26 +36,29 @@ AM_LDFLAGS = \
378 if HAVE_EGL
379 if HAVE_GLESV2
380 bin_PROGRAMS = \
381- es2_info \
382- es2gears_screen \
383- es2gears_x11 \
384- es2tri
385+ es2gears_screen
386+
387+es2gears_screen_SOURCES = es2gears.c
388+es2gears_screen_LDADD = ../eglut/libeglut_screen.la
389+
390 if HAVE_WAYLAND
391 bin_PROGRAMS += es2gears_wayland
392-endif
393-endif
394-endif
395
396-es2_info_LDADD = $(X11_LIBS)
397-es2tri_LDADD = $(X11_LIBS)
398+es2gears_wayland_SOURCES = es2gears.c
399+es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
400+endif
401
402-es2gears_screen_SOURCES = es2gears.c
403+if HAVE_X11
404+bin_PROGRAMS += \
405+ es2tri \
406+ es2_info \
407+ es2gears_x11
408
409+es2_info_LDADD = $(X11_LIBS)
410 es2gears_x11_SOURCES = es2gears.c
411-
412-es2gears_screen_LDADD = ../eglut/libeglut_screen.la
413-
414 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
415+es2tri_LDADD = $(X11_LIBS)
416+endif
417+endif
418+endif
419
420-es2gears_wayland_SOURCES = es2gears.c
421-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
422--
4232.0.0
424
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
new file mode 100644
index 0000000000..f77b97f3e5
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
@@ -0,0 +1,234 @@
1From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Fri, 9 May 2014 11:50:24 -0400
4Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files
5
6Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
7Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
8---
9 src/glsl/bezier.c | 2 +-
10 src/glsl/blinking-teapot.c | 4 ++--
11 src/glsl/brick.c | 4 ++--
12 src/glsl/bump.c | 6 +++---
13 src/glsl/convolutions.c | 2 +-
14 src/glsl/mandelbrot.c | 4 ++--
15 src/glsl/multitex.c | 4 ++--
16 src/glsl/simplex-noise.c | 2 +-
17 src/glsl/skinning.c | 4 ++--
18 src/glsl/texdemo1.c | 8 ++++----
19 src/glsl/toyball.c | 4 ++--
20 src/objviewer/objview.c | 12 ++++++------
21 src/perf/glslstateschange.c | 8 ++++----
22 13 files changed, 32 insertions(+), 32 deletions(-)
23
24diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
25index 0b56bc1..e01603d 100644
26--- a/src/glsl/bezier.c
27+++ b/src/glsl/bezier.c
28@@ -13,7 +13,7 @@
29 #include "glut_wrap.h"
30 #include "shaderutil.h"
31
32-static const char *filename = "bezier.geom";
33+static const char *filename = DEMOS_DATA_DIR "bezier.geom";
34
35 static GLuint fragShader;
36 static GLuint vertShader;
37diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
38index e3bf24d..7662b1f 100644
39--- a/src/glsl/blinking-teapot.c
40+++ b/src/glsl/blinking-teapot.c
41@@ -63,8 +63,8 @@ init_opengl (void)
42 exit(1);
43 }
44
45- vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
46- fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
47+ vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
48+ fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
49 prog_id = LinkShaders (vshad_id, fshad_id);
50
51 UseProgram (prog_id);
52diff --git a/src/glsl/brick.c b/src/glsl/brick.c
53index 3021856..fe5f190 100644
54--- a/src/glsl/brick.c
55+++ b/src/glsl/brick.c
56@@ -14,8 +14,8 @@
57 #include "shaderutil.h"
58
59
60-static char *FragProgFile = "CH06-brick.frag";
61-static char *VertProgFile = "CH06-brick.vert";
62+static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
63+static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
64
65 /* program/shader objects */
66 static GLuint fragShader;
67diff --git a/src/glsl/bump.c b/src/glsl/bump.c
68index 59f62cd..3a1b20a 100644
69--- a/src/glsl/bump.c
70+++ b/src/glsl/bump.c
71@@ -15,9 +15,9 @@
72 #include "readtex.h"
73
74
75-static char *FragProgFile = "CH11-bumpmap.frag";
76-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
77-static char *VertProgFile = "CH11-bumpmap.vert";
78+static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
79+static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
80+static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
81 static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
82
83 /* program/shader objects */
84diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
85index a120cfe..9312f00 100644
86--- a/src/glsl/convolutions.c
87+++ b/src/glsl/convolutions.c
88@@ -340,7 +340,7 @@ static void init(void)
89
90 menuInit();
91 readTexture(textureLocation);
92- createProgram("convolution.vert", "convolution.frag");
93+ createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
94
95 glEnable(GL_TEXTURE_2D);
96 glClearColor(1.0, 1.0, 1.0, 1.0);
97diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
98index 31ede1d..ab34a0f 100644
99--- a/src/glsl/mandelbrot.c
100+++ b/src/glsl/mandelbrot.c
101@@ -14,8 +14,8 @@
102 #include "shaderutil.h"
103
104
105-static char *FragProgFile = "CH18-mandel.frag";
106-static char *VertProgFile = "CH18-mandel.vert";
107+static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
108+static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
109
110 /* program/shader objects */
111 static GLuint fragShader;
112diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
113index 262ea50..546bd27 100644
114--- a/src/glsl/multitex.c
115+++ b/src/glsl/multitex.c
116@@ -35,8 +35,8 @@
117
118 static const char *Demo = "multitex";
119
120-static const char *VertFile = "multitex.vert";
121-static const char *FragFile = "multitex.frag";
122+static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
123+static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
124
125 static const char *TexFiles[2] =
126 {
127diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
128index 13fdd5d..885f01e 100644
129--- a/src/glsl/simplex-noise.c
130+++ b/src/glsl/simplex-noise.c
131@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
132 static void
133 Init(void)
134 {
135- const char *filename = "simplex-noise.glsl";
136+ const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
137 char noiseText[10000];
138 FILE *f;
139 int len;
140diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
141index bf38d77..536d475 100644
142--- a/src/glsl/skinning.c
143+++ b/src/glsl/skinning.c
144@@ -20,8 +20,8 @@
145 #define M_PI 3.1415926535
146 #endif
147
148-static char *FragProgFile = "skinning.frag";
149-static char *VertProgFile = "skinning.vert";
150+static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
151+static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
152
153 /* program/shader objects */
154 static GLuint fragShader;
155diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
156index 6cde239..a082342 100644
157--- a/src/glsl/texdemo1.c
158+++ b/src/glsl/texdemo1.c
159@@ -35,11 +35,11 @@
160
161 static const char *Demo = "texdemo1";
162
163-static const char *ReflectVertFile = "reflect.vert";
164-static const char *CubeFragFile = "cubemap.frag";
165+static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
166+static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
167
168-static const char *SimpleVertFile = "simple.vert";
169-static const char *SimpleTexFragFile = "shadowtex.frag";
170+static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
171+static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
172
173 static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
174
175diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
176index 5f27951..4e7e832 100644
177--- a/src/glsl/toyball.c
178+++ b/src/glsl/toyball.c
179@@ -14,8 +14,8 @@
180 #include "shaderutil.h"
181
182
183-static char *FragProgFile = "CH11-toyball.frag";
184-static char *VertProgFile = "CH11-toyball.vert";
185+static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
186+static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
187
188 /* program/shader objects */
189 static GLuint fragShader;
190diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
191index 6def726..78a6acf 100644
192--- a/src/objviewer/objview.c
193+++ b/src/objviewer/objview.c
194@@ -162,12 +162,12 @@ init_model(void)
195 static void
196 init_skybox(void)
197 {
198- SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
199- "alpine_west.rgb",
200- "alpine_up.rgb",
201- "alpine_down.rgb",
202- "alpine_south.rgb",
203- "alpine_north.rgb");
204+ SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
205+ DEMOS_DATA_DIR "alpine_west.rgb",
206+ DEMOS_DATA_DIR "alpine_up.rgb",
207+ DEMOS_DATA_DIR "alpine_down.rgb",
208+ DEMOS_DATA_DIR "alpine_south.rgb",
209+ DEMOS_DATA_DIR "alpine_north.rgb");
210 glmSpecularTexture(Model, SkyboxTex);
211 }
212
213diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
214index 7422b78..dbf8332 100644
215--- a/src/perf/glslstateschange.c
216+++ b/src/perf/glslstateschange.c
217@@ -33,10 +33,10 @@
218 #include "glmain.h"
219 #include "common.h"
220
221-static const char *VertFile1 = "glslstateschange1.vert";
222-static const char *FragFile1 = "glslstateschange1.frag";
223-static const char *VertFile2 = "glslstateschange2.vert";
224-static const char *FragFile2 = "glslstateschange2.frag";
225+static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
226+static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
227+static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
228+static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
229 static struct uniform_info Uniforms1[] = {
230 { "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
231 { "tex2", 1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
232--
2332.0.0
234
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
new file mode 100644
index 0000000000..aac2a37294
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
@@ -0,0 +1,267 @@
1From 453353a221de9c64479f4372565d2cd8591b36cc 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 5/9] Fix build when EGL_MESA_screen_surface extension isn't
5 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---
19 src/egl/eglut/eglut.c | 9 +++++++--
20 src/egl/eglut/eglut_screen.c | 14 ++++++++++++++
21 src/egl/opengl/demo1.c | 2 ++
22 src/egl/opengl/demo2.c | 7 ++++++-
23 src/egl/opengl/demo3.c | 7 ++++++-
24 5 files changed, 35 insertions(+), 4 deletions(-)
25
26diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
27index 2ee6f15..f6a2ad4 100644
28--- a/src/egl/eglut/eglut.c
29+++ b/src/egl/eglut/eglut.c
30@@ -76,8 +76,9 @@ _eglutNow(void)
31 static void
32 _eglutDestroyWindow(struct eglut_window *win)
33 {
34- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
35- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
36+
37+ if (_eglut->surface_type == EGL_WINDOW_BIT ||
38+ _eglut->surface_type == EGL_PIXMAP_BIT)
39 eglDestroySurface(_eglut->dpy, win->surface);
40
41 _eglutNativeFiniWindow(win);
42@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
43 win->config, win->native.u.pixmap, NULL);
44 break;
45 case EGL_PBUFFER_BIT:
46+#ifdef EGL_MESA_screen_surface
47 case EGL_SCREEN_BIT_MESA:
48+#endif
49 win->surface = win->native.u.surface;
50 break;
51 default:
52@@ -289,8 +292,10 @@ eglutDestroyWindow(int win)
53 if (window->index != win)
54 return;
55
56+#ifdef EGL_MESA_screen_surface
57 /* XXX it causes some bug in st/egl KMS backend */
58 if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
59+#endif
60 eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
61
62 _eglutDestroyWindow(_eglut->current);
63diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
64index 021a8f1..094a4e2 100644
65--- a/src/egl/eglut/eglut_screen.c
66+++ b/src/egl/eglut/eglut_screen.c
67@@ -35,26 +35,33 @@
68
69 #define MAX_MODES 100
70
71+#ifdef EGL_MESA_screen_surface
72 static EGLScreenMESA kms_screen;
73 static EGLModeMESA kms_mode;
74 static EGLint kms_width, kms_height;
75+#endif
76
77 void
78 _eglutNativeInitDisplay(void)
79 {
80+#ifdef EGL_MESA_screen_surface
81 _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
82 _eglut->surface_type = EGL_SCREEN_BIT_MESA;
83+#endif
84 }
85
86 void
87 _eglutNativeFiniDisplay(void)
88 {
89+#ifdef EGL_MESA_screen_surface
90 kms_screen = 0;
91 kms_mode = 0;
92 kms_width = 0;
93 kms_height = 0;
94+#endif
95 }
96
97+#ifdef EGL_MESA_screen_surface
98 static void
99 init_kms(void)
100 {
101@@ -94,19 +101,23 @@ init_kms(void)
102 kms_width = width;
103 kms_height = height;
104 }
105+#endif
106
107 void
108 _eglutNativeInitWindow(struct eglut_window *win, const char *title,
109 int x, int y, int w, int h)
110 {
111+#ifdef EGL_MESA_screen_surface
112 EGLint surf_attribs[16];
113 EGLint i;
114+#endif
115 const char *exts;
116
117 exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
118 if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
119 _eglutFatal("EGL_MESA_screen_surface is not supported\n");
120
121+#ifdef EGL_MESA_screen_surface
122 init_kms();
123
124 i = 0;
125@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
126
127 win->native.width = kms_width;
128 win->native.height = kms_height;
129+#endif
130 }
131
132 void
133 _eglutNativeFiniWindow(struct eglut_window *win)
134 {
135+#ifdef EGL_MESA_screen_surface
136 eglShowScreenSurfaceMESA(_eglut->dpy,
137 kms_screen, EGL_NO_SURFACE, 0);
138 eglDestroySurface(_eglut->dpy, win->native.u.surface);
139+#endif
140 }
141
142 void
143diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
144index d892734..3a3564c 100644
145--- a/src/egl/opengl/demo1.c
146+++ b/src/egl/opengl/demo1.c
147@@ -18,6 +18,7 @@
148 static void
149 TestScreens(EGLDisplay dpy)
150 {
151+#ifdef EGL_MESA_screen_surface
152 #define MAX 8
153 EGLScreenMESA screens[MAX];
154 EGLint numScreens;
155@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
156 for (i = 0; i < numScreens; i++) {
157 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
158 }
159+#endif
160 }
161
162 /**
163diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
164index 505b474..bfef59e 100644
165--- a/src/egl/opengl/demo2.c
166+++ b/src/egl/opengl/demo2.c
167@@ -16,6 +16,7 @@
168
169 /*#define FRONTBUFFER*/
170
171+#ifdef EGL_MESA_screen_surface
172 static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
173 GLfloat r, GLfloat g, GLfloat b)
174 {
175@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
176 printf(" Screen %d handle: %d\n", i, (int) screens[i]);
177 }
178 }
179-
180+#endif
181
182 int
183 main(int argc, char *argv[])
184 {
185 int maj, min;
186+#ifdef EGL_MESA_screen_surface
187 EGLContext ctx;
188 EGLSurface pbuffer, screen_surf;
189 EGLConfig configs[10];
190@@ -115,6 +117,7 @@ main(int argc, char *argv[])
191 EGLModeMESA mode;
192 EGLScreenMESA screen;
193 EGLint count;
194+#endif
195
196 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
197 assert(d);
198@@ -132,6 +135,7 @@ main(int argc, char *argv[])
199 exit(1);
200 }
201
202+#ifdef EGL_MESA_screen_surface
203 eglGetConfigs(d, configs, 10, &numConfigs);
204 printf("Got %d EGL configs:\n", numConfigs);
205 for (i = 0; i < numConfigs; i++) {
206@@ -211,6 +215,7 @@ main(int argc, char *argv[])
207 eglDestroySurface(d, pbuffer);
208 eglDestroyContext(d, ctx);
209 eglTerminate(d);
210+#endif
211
212 return 0;
213 }
214diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
215index f84ca23..31b5d8b 100644
216--- a/src/egl/opengl/demo3.c
217+++ b/src/egl/opengl/demo3.c
218@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
219 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
220 };
221
222-
223+#ifdef EGL_MESA_screen_surface
224 static void Init(void)
225 {
226
227@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
228 fclose(f);
229 }
230 }
231+#endif
232
233 int
234 main(int argc, char *argv[])
235 {
236 int maj, min;
237+#ifdef EGL_MESA_screen_surface
238 EGLContext ctx;
239 EGLSurface screen_surf;
240 EGLConfig configs[10];
241@@ -566,6 +568,7 @@ main(int argc, char *argv[])
242 const GLubyte *bitmap;
243 EGLint screenAttribs[32];
244 EGLint i;
245+#endif
246
247 EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
248 assert(d);
249@@ -583,6 +586,7 @@ main(int argc, char *argv[])
250 exit(1);
251 }
252
253+#ifdef EGL_MESA_screen_surface
254 eglGetConfigs(d, configs, 10, &numConfigs);
255 eglGetScreensMESA(d, &screen, 1, &count);
256 eglGetModesMESA(d, screen, &mode, 1, &count);
257@@ -642,6 +646,7 @@ main(int argc, char *argv[])
258 eglDestroySurface(d, screen_surf);
259 eglDestroyContext(d, ctx);
260 eglTerminate(d);
261+#endif
262
263 return 0;
264 }
265--
2662.0.0
267
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
new file mode 100644
index 0000000000..12e0805f15
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
@@ -0,0 +1,41 @@
1From 6a19dba1d275579c73e7763b0554410ff4e1e650 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 6/9] Query display for EGL_MESA_screen_surface extension
5 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---
19 src/egl/opengl/demo1.c | 6 ++++++
20 1 file changed, 6 insertions(+)
21
22diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
23index 3a3564c..06e2138 100644
24--- a/src/egl/opengl/demo1.c
25+++ b/src/egl/opengl/demo1.c
26@@ -110,6 +110,12 @@ main(int argc, char *argv[])
27 printf("EGL version = %d.%d\n", maj, min);
28 printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
29
30+ if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
31+ "EGL_MESA_screen_surface")) {
32+ printf("EGL_MESA_screen_surface is not supported\n");
33+ exit(1);
34+ }
35+
36 eglGetConfigs(d, NULL, 0, &numConfigs);
37 configs = malloc(sizeof(*configs) *numConfigs);
38 eglGetConfigs(d, configs, numConfigs, &numConfigs);
39--
402.0.0
41
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 0000000000..89d2fac4fd
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,74 @@
1From d930b2da57f7c9efb80c8cef8f8adad15bbbc0d3 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:30:52 +0200
4Subject: [PATCH 7/9] Install few more test programs
5
6Upstream-Status: Pending
7
8Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
9---
10 src/egl/opengl/Makefile.am | 2 +-
11 src/egl/opengles1/Makefile.am | 10 ++++------
12 src/egl/openvg/Makefile.am | 2 +-
13 3 files changed, 6 insertions(+), 8 deletions(-)
14
15diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
16index 0c7228f..87b2f1a 100644
17--- a/src/egl/opengl/Makefile.am
18+++ b/src/egl/opengl/Makefile.am
19@@ -50,7 +50,7 @@ endif
20 endif
21
22 if HAVE_EGL
23-noinst_PROGRAMS = \
24+bin_PROGRAMS = \
25 demo1 \
26 demo2 \
27 demo3 \
28diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
29index 3455e75..516e516 100644
30--- a/src/egl/opengles1/Makefile.am
31+++ b/src/egl/opengles1/Makefile.am
32@@ -36,11 +36,11 @@ AM_LDFLAGS = \
33 $(EGL_LIBS) \
34 -lm
35
36-noinst_PROGRAMS =
37+bin_PROGRAMS =
38
39 if HAVE_EGL
40 if HAVE_GLESV1
41-noinst_PROGRAMS += \
42+bin_PROGRAMS += \
43 drawtex_screen \
44 gears_screen \
45 torus_screen \
46@@ -57,10 +57,8 @@ torus_screen_LDADD = ../eglut/libeglut_screen.la
47 tri_screen_LDADD = ../eglut/libeglut_screen.la
48
49 if HAVE_X11
50-noinst_PROGRAMS += \
51- clear
52-
53-bin_PROGRAMS = \
54+bin_PROGRAMS += \
55+ clear \
56 bindtex \
57 drawtex_x11 \
58 eglfbdev \
59diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
60index 7318a43..b545225 100644
61--- a/src/egl/openvg/Makefile.am
62+++ b/src/egl/openvg/Makefile.am
63@@ -49,7 +49,7 @@ endif
64
65 if HAVE_EGL
66 if HAVE_VG
67-noinst_PROGRAMS = \
68+bin_PROGRAMS = \
69 lion_screen \
70 sp_screen \
71 $(EGL_X11_DEMOS)
72--
732.0.0
74
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
new file mode 100644
index 0000000000..a6085754d2
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
@@ -0,0 +1,101 @@
1From 0b6f95f9b8ece22e9856c150e4be29fd86eaf546 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:29:27 +0200
4Subject: [PATCH 8/9] glsl, perf: Add few missing .glsl, .vert, .frag files to
5 EXTRA_DATA
6
7Upstream-Status: Pending
8
9Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
10---
11 src/fpglsl/Makefile.am | 2 ++
12 src/glsl/Makefile.am | 10 ++++++++--
13 src/perf/Makefile.am | 6 ++++++
14 src/vpglsl/Makefile.am | 1 +
15 4 files changed, 17 insertions(+), 2 deletions(-)
16
17diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
18index 47c1039..fd43c91 100644
19--- a/src/fpglsl/Makefile.am
20+++ b/src/fpglsl/Makefile.am
21@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
22 endif
23
24 EXTRA_DIST = \
25+ depth-read.glsl \
26 dowhile2.glsl \
27 dowhile.glsl \
28 forbreak.glsl \
29 for.glsl \
30+ infinite-loop.glsl \
31 mov.glsl \
32 mov-imm.glsl \
33 simpleif.glsl \
34diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
35index 4faa8db..079a29d 100644
36--- a/src/glsl/Makefile.am
37+++ b/src/glsl/Makefile.am
38@@ -37,7 +37,7 @@ AM_LDFLAGS = \
39 if HAVE_GLUT
40 bin_PROGRAMS = \
41 array \
42- bezier \
43+ bezier \
44 bitmap \
45 brick \
46 bump \
47@@ -123,12 +123,16 @@ EXTRA_DIST = \
48 CH06-brick.vert \
49 CH11-bumpmap.frag \
50 CH11-bumpmap.vert \
51+ CH11-bumpmaptex.frag \
52 CH11-toyball.frag \
53 CH11-toyball.vert \
54 CH18-mandel.frag \
55 CH18-mandel.vert \
56- bezier.geom \
57+ bezier.geom \
58 brick.shtest \
59+ blinking-teapot.frag \
60+ blinking-teapot.vert \
61+ convolution.frag \
62 convolution.vert \
63 cubemap.frag \
64 mandelbrot.shtest \
65@@ -138,5 +142,7 @@ EXTRA_DIST = \
66 reflect.vert \
67 shadowtex.frag \
68 simple.vert \
69+ simplex-noise.glsl \
70 skinning.frag \
71+ skinning.vert \
72 toyball.shtest
73diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
74index 5363c58..c5cca8d 100644
75--- a/src/perf/Makefile.am
76+++ b/src/perf/Makefile.am
77@@ -57,3 +57,9 @@ bin_PROGRAMS = \
78 endif
79
80 glslstateschange_LDADD = libperf.la ../util/libutil.la
81+
82+EXTRA_DIST = \
83+ glslstateschange1.frag \
84+ glslstateschange1.vert \
85+ glslstateschange2.frag \
86+ glslstateschange2.vert
87diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
88index 4a85ed4..48b08f4 100644
89--- a/src/vpglsl/Makefile.am
90+++ b/src/vpglsl/Makefile.am
91@@ -44,6 +44,7 @@ EXTRA_DIST = \
92 func2.glsl \
93 ifelse.glsl \
94 if.glsl \
95+ infinite-loop.glsl \
96 mov.glsl \
97 nestedifs.glsl \
98 nestedswizzle.glsl \
99--
1002.0.0
101
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
new file mode 100644
index 0000000000..1262dee237
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
@@ -0,0 +1,73 @@
1From c8c3de5417d6b6c7d7579c528c0cab718f4bfdb6 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 10 Jul 2014 14:48:12 +0200
4Subject: [PATCH 9/9] glsl, perf: Install .glsl, .vert, .frag files
5
6Upstream-Status: Pending
7Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
8---
9 src/fpglsl/Makefile.am | 3 ++-
10 src/glsl/Makefile.am | 3 ++-
11 src/perf/Makefile.am | 3 ++-
12 src/vpglsl/Makefile.am | 3 ++-
13 4 files changed, 8 insertions(+), 4 deletions(-)
14
15diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
16index fd43c91..2bf51de 100644
17--- a/src/fpglsl/Makefile.am
18+++ b/src/fpglsl/Makefile.am
19@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
20 fp-tri
21 endif
22
23-EXTRA_DIST = \
24+demosdatadir=$(datadir)/$(PACKAGE)/
25+dist_demosdata_DATA= \
26 depth-read.glsl \
27 dowhile2.glsl \
28 dowhile.glsl \
29diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
30index 079a29d..f66ec29 100644
31--- a/src/glsl/Makefile.am
32+++ b/src/glsl/Makefile.am
33@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
34 vert_tex_LDADD = ../util/libutil.la
35 vsraytrace_LDADD = ../util/libutil.la
36
37-EXTRA_DIST = \
38+demosdatadir=$(datadir)/$(PACKAGE)/
39+dist_demosdata_DATA= \
40 CH06-brick.frag \
41 CH06-brick.vert \
42 CH11-bumpmap.frag \
43diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
44index c5cca8d..140256d 100644
45--- a/src/perf/Makefile.am
46+++ b/src/perf/Makefile.am
47@@ -58,7 +58,8 @@ endif
48
49 glslstateschange_LDADD = libperf.la ../util/libutil.la
50
51-EXTRA_DIST = \
52+demosdatadir=$(datadir)/$(PACKAGE)/
53+dist_demosdata_DATA= \
54 glslstateschange1.frag \
55 glslstateschange1.vert \
56 glslstateschange2.frag \
57diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
58index 48b08f4..5526867 100644
59--- a/src/vpglsl/Makefile.am
60+++ b/src/vpglsl/Makefile.am
61@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
62 vp-tris
63 endif
64
65-EXTRA_DIST = \
66+demosdatadir=$(datadir)/$(PACKAGE)/
67+dist_demosdata_DATA= \
68 for.glsl \
69 func.glsl \
70 func2.glsl \
71--
722.0.0
73
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
new file mode 100644
index 0000000000..1caa50bc1b
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
@@ -0,0 +1,53 @@
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
12SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
13 file://0001-mesa-demos-Add-missing-data-files.patch \
14 file://0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch \
15 file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
16 file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
17 file://0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch \
18 file://0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch \
19 file://0007-Install-few-more-test-programs.patch \
20 file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
21 file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
22"
23SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
24SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
25
26inherit autotools pkgconfig
27
28PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 glu \
29 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glew', '', d)}"
30
31# The Wayland code doesn't work with Wayland 1.0, so disable it for now
32#${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
33
34EXTRA_OECONF = "--with-system-data-files"
35
36PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm"
37PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
38PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
39PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
40PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
41PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
42PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,"
43PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
44PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libvg"
45PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
46PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
47PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
48PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
49
50do_install_append() {
51 # it can be completely empty when all PACKAGECONFIG options are disabled
52 rmdir --ignore-fail-on-non-empty ${D}${bindir}
53}
diff --git a/meta/recipes-graphics/mesa/mesa-gl_10.1.3.bb b/meta/recipes-graphics/mesa/mesa-gl_10.1.3.bb
new file mode 100644
index 0000000000..2acc21dce5
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-gl_10.1.3.bb
@@ -0,0 +1,11 @@
1require mesa_${PV}.bb
2
3SUMMARY += " (OpenGL only, no EGL/GLES)"
4
5FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
6
7PROVIDES = "virtual/libgl virtual/mesa"
8
9PACKAGECONFIG ??= "dri ${@bb.utils.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..1857f3c220
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,189 @@
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=6a23445982a7a972ac198e93cc1cb3de"
14
15PE = "2"
16
17DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
18
19PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
20
21inherit autotools pkgconfig pythonnative gettext distro_features_check
22
23REQUIRED_DISTRO_FEATURES = "opengl"
24
25EXTRA_OECONF = "--enable-shared-glapi"
26
27PACKAGECONFIG ??= "egl gles dri \
28 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
29 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
30 "
31
32X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
33PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
34PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
35PACKAGECONFIG[wayland] = ",,wayland"
36
37DRIDRIVERS = "swrast"
38DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
39DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
40PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
41PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
42
43EXTRA_OECONF += "--enable-gbm"
44
45PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
46
47EGL_PLATFORMS = "drm"
48EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
49EGL_PLATFORMS .="${@bb.utils.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 = "${@bb.utils.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 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
59GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.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 libglapi libglapi-dev \
82 libgbm libgbm-dev \
83 libgles1-mesa libgles1-mesa-dev \
84 libgles2-mesa libgles2-mesa-dev \
85 libgles3-mesa libgles3-mesa-dev \
86 libwayland-egl libwayland-egl-dev \
87 libegl-gallium libgbm-gallium \
88 libopenvg libopenvg-dev \
89 libxvmcsoftpipe libxvmcsoftpipe-dev \
90 mesa-megadriver \
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 pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
109 for p in (("egl", "libegl", "libegl1"),
110 ("dri", "libgl", "libgl1"),
111 ("gles", "libgles1", "libglesv1-cm1"),
112 ("gles", "libgles2", "libglesv2-2"),
113 ("gles", "libgles3",)):
114 if not p[0] in pkgconfig:
115 continue
116 fullp = p[1] + "-mesa"
117 pkgs = " ".join(p[1:])
118 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
119 d.appendVar("RREPLACES_" + fullp, pkgs)
120 d.appendVar("RPROVIDES_" + fullp, pkgs)
121 d.appendVar("RCONFLICTS_" + fullp, pkgs)
122
123 # For -dev, the first element is both the Debian and original name
124 fullp += "-dev"
125 pkgs = p[1] + "-dev"
126 d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
127 d.appendVar("RREPLACES_" + fullp, pkgs)
128 d.appendVar("RPROVIDES_" + fullp, pkgs)
129 d.appendVar("RCONFLICTS_" + fullp, pkgs)
130}
131
132python mesa_populate_packages() {
133 pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
134 for pkg in pkgs:
135 d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
136 d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
137 d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
138
139 import re
140 dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
141 dri_pkgs = os.listdir(d.getVar('PKGD', True) + dri_drivers_root)
142 lib_name = d.expand("${MLPREFIX}mesa-megadriver")
143 for p in dri_pkgs:
144 m = re.match('^(.*)_dri\.so$', p)
145 if m:
146 pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
147 d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
148 d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
149 d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
150
151 pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
152 do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
153}
154
155PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
156
157PACKAGES_DYNAMIC += "^mesa-driver-.*"
158
159FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
160FILES_${PN} += "${sysconfdir}/drirc"
161FILES_mesa-megadriver = "${libdir}/dri/*"
162FILES_libegl-mesa = "${libdir}/libEGL.so.*"
163FILES_libgbm = "${libdir}/libgbm.so.*"
164FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
165FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
166FILES_libgl-mesa = "${libdir}/libGL.so.*"
167FILES_libglapi = "${libdir}/libglapi.so.*"
168FILES_libosmesa = "${libdir}/libOSMesa.so.*"
169FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
170FILES_libegl-gallium = "${libdir}/egl/egl_gallium.so*"
171FILES_libgbm-gallium = "${libdir}/gbm/gbm_gallium_drm.so*"
172FILES_libopenvg = "${libdir}/libOpenVG.so.*"
173FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
174
175FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
176FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
177FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
178FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
179FILES_libglapi-dev = "${libdir}/libglapi.*"
180FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
181FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
182FILES_libgles3-mesa-dev = "${includedir}/GLES3"
183FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
184FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
185FILES_libopenvg-dev = "${libdir}/libOpenVG.so ${libdir}/libOpenVG.la* \
186 ${includedir}/VG ${libdir}/pkgconfig/vg.pc"
187FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
188
189FILES_${PN}-dbg += "${libdir}/dri/.debug/* ${libdir}/egl/.debug/* ${libdir}/gbm/.debug/* ${libdir}/gallium-pipe/.debug"
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..30a3d98758
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa/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/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_10.1.3.bb b/meta/recipes-graphics/mesa/mesa_10.1.3.bb
new file mode 100644
index 0000000000..abc450a9c5
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_10.1.3.bb
@@ -0,0 +1,19 @@
1require ${BPN}.inc
2
3SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2 \
4 file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
5 file://0006-fix-out-of-tree-egl.patch \
6 "
7
8SRC_URI[md5sum] = "ba6dbe2b9cab0b4de840c996b9b6a3ad"
9SRC_URI[sha256sum] = "b2615e236ef25d0fb94b8420bdd2e2a520b7dd5ca2d4b93306154f7fd4adecc3"
10
11S = "${WORKDIR}/Mesa-${PV}"
12
13#because we cannot rely on the fact that all apps will use pkgconfig,
14#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
15do_install_append() {
16 if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
17 sed -i -e 's/^#ifdef MESA_EGL_NO_X11_HEADERS/#if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
18 fi
19}
diff --git a/meta/recipes-graphics/mesa/mesa_git.bb b/meta/recipes-graphics/mesa/mesa_git.bb
new file mode 100644
index 0000000000..cda310a525
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_git.bb
@@ -0,0 +1,23 @@
1require ${BPN}.inc
2
3DEFAULT_PREFERENCE = "-1"
4
5LIC_FILES_CHKSUM = "file://docs/license.html;md5=6a23445982a7a972ac198e93cc1cb3de"
6
7SRCREV = "0028eb1083e6adc110a23a5f02c993cda217067a"
8PV = "10.1.3+git${SRCPV}"
9
10SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;branch=10.1 \
11 file://0002-pipe_loader_sw-include-xlib_sw_winsys.h-only-when-HA.patch \
12 file://0006-fix-out-of-tree-egl.patch \
13 "
14
15S = "${WORKDIR}/git"
16
17#because we cannot rely on the fact that all apps will use pkgconfig,
18#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
19do_install_append() {
20 if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
21 sed -i -e 's/^#ifdef MESA_EGL_NO_X11_HEADERS/#if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
22 fi
23}