summaryrefslogtreecommitdiffstats
path: root/bsp/meta-freescale/recipes-graphics/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-freescale/recipes-graphics/mesa')
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch84
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch28
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch355
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch17
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend22
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend1
-rw-r--r--bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend40
7 files changed, 547 insertions, 0 deletions
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch
new file mode 100644
index 00000000..19bcca98
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch
@@ -0,0 +1,84 @@
+From 8aba54422d9a77383c150f9f70240b18b6e1918e Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+Date: Thu, 9 Apr 2015 15:47:21 -0500
+Subject: [PATCH] Add OpenVG demos to support wayland.
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+---
+ src/egl/Makefile.am | 6 +++---
+ src/egl/openvg/Makefile.am | 33 +++++++++++++++++++++++++++++----
+ 2 files changed, 32 insertions(+), 7 deletions(-)
+
+Index: mesa-demos-8.2.0/src/egl/Makefile.am
+===================================================================
+--- mesa-demos-8.2.0.orig/src/egl/Makefile.am 2016-05-09 11:45:51.479100180 -0500
++++ mesa-demos-8.2.0/src/egl/Makefile.am 2016-05-09 11:45:51.475100160 -0500
+@@ -26,10 +26,10 @@
+ eglut \
+ opengles1 \
+ opengles2 \
+- oes_vg
++ oes_vg \
++ openvg
+
+ if HAVE_GLU
+ SUBDIRS += \
+- opengl \
+- openvg
++ opengl
+ endif
+Index: mesa-demos-8.2.0/src/egl/openvg/Makefile.am
+===================================================================
+--- mesa-demos-8.2.0.orig/src/egl/openvg/Makefile.am 2016-05-09 11:45:51.479100180 -0500
++++ mesa-demos-8.2.0/src/egl/openvg/Makefile.am 2016-05-09 12:39:30.000000000 -0500
+@@ -47,13 +47,26 @@
+ endif
+ endif
+
++if HAVE_WAYLAND
++EGL_WL_DEMOS = \
++ lion_wayland \
++ sp_wayland
++
++if HAVE_FREETYPE2
++EGL_WL_DEMOS += \
++ vgtext_wayland
++endif
++endif
++
+ if HAVE_EGL
+ if HAVE_VG
+ bin_PROGRAMS = \
+- $(EGL_X11_DEMOS)
++ $(EGL_X11_DEMOS) \
++ $(EGL_WL_DEMOS)
+ endif
+ endif
+
++if HAVE_X11
+ lion_x11_SOURCES = lion.c lion-render.c lion-render.h
+ sp_x11_SOURCES = sp.c
+
+@@ -63,6 +76,20 @@
+ text_SOURCES = text.c
+ text_CFLAGS = $(AM_CFLAGS) @FREETYPE2_CFLAGS@
+ text_LDADD = @FREETYPE2_LIBS@ ../eglut/libeglut_x11.la
++endif
++
++if HAVE_WAYLAND
++lion_wayland_SOURCES = lion.c lion-render.c lion-render.h
++lion_wayland_LDADD = ../eglut/libeglut_wayland.la
++
++sp_wayland_SOURCES = sp.c
++sp_wayland_LDADD = ../eglut/libeglut_wayland.la
++
++vgtext_wayland_SOURCES = text.c
++vgtext_wayland_CFLAGS = $(AM_CFLAGS) @FREETYPE2_CFLAGS@
++vgtext_wayland_LDADD = @FREETYPE2_LIBS@ ../eglut/libeglut_wayland.la
++
++endif
+
+ SUBDIRS = \
+ trivial
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch
new file mode 100644
index 00000000..180a9d84
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch
@@ -0,0 +1,28 @@
+From 010af1952d935352764389636b7165283e6c9e3f Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+Date: Tue, 7 Apr 2015 17:58:45 -0500
+Subject: [PATCH] Additional eglSwapBuffer calling makes wrong throttling
+
+Upstream Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
+---
+ src/egl/eglut/eglut_wayland.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/egl/eglut/eglut_wayland.c b/src/egl/eglut/eglut_wayland.c
+index 968b33f..5664d35 100644
+--- a/src/egl/eglut/eglut_wayland.c
++++ b/src/egl/eglut/eglut_wayland.c
+@@ -155,7 +155,7 @@ draw(void *data, struct wl_callback *callback, uint32_t time)
+
+ if (win->display_cb)
+ win->display_cb();
+- eglSwapBuffers(_eglut->dpy, win->surface);
++ /*eglSwapBuffers(_eglut->dpy, win->surface);*/
+
+ if (callback)
+ wl_callback_destroy(callback);
+--
+2.3.5
+
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
new file mode 100644
index 00000000..d899540f
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
@@ -0,0 +1,355 @@
+From 757649a766f90e745f24df1d191caeef15c71399 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Tue, 4 Jun 2013 09:28:51 -0300
+Subject: [PATCH] Replace glWindowPos2iARB calls with glWindowPos2i
+
+Vivante libGL does not provide the glWindowPos2iARB symbol, but
+glWindowPos2i. Use this instead.
+
+Upstream-Status: Inapropriate [embedded specific]
+
+Reported-by: Jeremy Stashluk <jstashluk@dekaresearch.com>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ src/demos/copypix.c | 4 ++--
+ src/demos/engine.c | 2 +-
+ src/demos/fogcoord.c | 4 ++--
+ src/glsl/shadow_sampler.c | 2 +-
+ src/tests/auxbuffer.c | 2 +-
+ src/tests/copypixrate.c | 2 +-
+ src/tests/drawbuffers.c | 2 +-
+ src/tests/drawbuffers2.c | 2 +-
+ src/tests/fbotest1.c | 2 +-
+ src/tests/fbotest2.c | 4 ++--
+ src/tests/fbotest3.c | 2 +-
+ src/tests/readrate.c | 10 +++++-----
+ src/tests/viewmemory.c | 2 +-
+ src/trivial/clear-fbo-scissor.c | 2 +-
+ src/trivial/clear-fbo-tex.c | 2 +-
+ src/trivial/clear-fbo.c | 2 +-
+ src/trivial/readpixels.c | 2 +-
+ src/trivial/tri-fbo.c | 2 +-
+ src/xdemos/glxsnoop.c | 2 +-
+ src/xdemos/wincopy.c | 4 ++--
+ 20 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/src/demos/copypix.c b/src/demos/copypix.c
+index 286c5a9..041b567 100644
+--- a/src/demos/copypix.c
++++ b/src/demos/copypix.c
+@@ -54,7 +54,7 @@ static void Display( void )
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ /* draw original image */
+- glWindowPos2iARB(dx, dy);
++ glWindowPos2i(dx, dy);
+ glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
+
+ if (Scissor)
+@@ -71,7 +71,7 @@ static void Display( void )
+
+ /* draw copy */
+ glPixelZoom(Xzoom, Yzoom);
+- glWindowPos2iARB(Xpos, Ypos);
++ glWindowPos2i(Xpos, Ypos);
+ glCopyPixels(dx, dy, ImgWidth, ImgHeight, GL_COLOR);
+ glPixelZoom(1, 1);
+
+diff --git a/src/demos/engine.c b/src/demos/engine.c
+index 928fcbb..beace4c 100644
+--- a/src/demos/engine.c
++++ b/src/demos/engine.c
+@@ -971,7 +971,7 @@ Draw(void)
+ glDisable(GL_LIGHTING);
+ glDisable(GL_TEXTURE_2D);
+ glColor3f(1, 1 , 1);
+- glWindowPos2iARB(10, 10);
++ glWindowPos2i(10, 10);
+ PrintString(s);
+ if (lit)
+ glEnable(GL_LIGHTING);
+diff --git a/src/demos/fogcoord.c b/src/demos/fogcoord.c
+index 567eec0..e833009 100644
+--- a/src/demos/fogcoord.c
++++ b/src/demos/fogcoord.c
+@@ -68,14 +68,14 @@ PrintInfo(void)
+
+ sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g",
+ ModeStr, fogStart, fogEnd, fogDensity);
+- glWindowPos2iARB(5, 20);
++ glWindowPos2i(5, 20);
+ PrintString(s);
+
+ sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g",
+ (Arrays ? "Yes" : "No"),
+ (fogCoord ? "Yes" : "No"),
+ camz);
+- glWindowPos2iARB(5, 5);
++ glWindowPos2i(5, 5);
+ PrintString(s);
+ }
+
+diff --git a/src/glsl/shadow_sampler.c b/src/glsl/shadow_sampler.c
+index b830030..eb82d8b 100644
+--- a/src/glsl/shadow_sampler.c
++++ b/src/glsl/shadow_sampler.c
+@@ -85,7 +85,7 @@ Redisplay(void)
+ glPopMatrix();
+
+ glUseProgram(0);
+- glWindowPos2iARB(80, 20);
++ glWindowPos2i(80, 20);
+ PrintString("white black white black");
+
+ {
+diff --git a/src/tests/auxbuffer.c b/src/tests/auxbuffer.c
+index 5fa399a..0cd5f47 100644
+--- a/src/tests/auxbuffer.c
++++ b/src/tests/auxbuffer.c
+@@ -419,7 +419,7 @@ event_loop(Display *dpy, Window win)
+ /* Copy aux buffer image to back color buffer */
+ glReadBuffer(GL_AUX0);
+ glDrawBuffer(GL_BACK);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDisable(GL_DEPTH_TEST);
+ glCopyPixels(0, 0, WinWidth, WinHeight, GL_COLOR);
+ glEnable(GL_DEPTH_TEST);
+diff --git a/src/tests/copypixrate.c b/src/tests/copypixrate.c
+index 2f64e0a..df1f9b0 100644
+--- a/src/tests/copypixrate.c
++++ b/src/tests/copypixrate.c
+@@ -91,7 +91,7 @@ BlitOne(void)
+ else
+ #endif
+ {
+- glWindowPos2iARB(x, y);
++ glWindowPos2i(x, y);
+ glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
+ }
+ }
+diff --git a/src/tests/drawbuffers.c b/src/tests/drawbuffers.c
+index fa2f8a7..cd5033f 100644
+--- a/src/tests/drawbuffers.c
++++ b/src/tests/drawbuffers.c
+@@ -88,7 +88,7 @@ Display(void)
+ glUseProgram(0);
+ glDisable(GL_DEPTH_TEST);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/tests/drawbuffers2.c b/src/tests/drawbuffers2.c
+index 5bcf0b2..84d444b 100644
+--- a/src/tests/drawbuffers2.c
++++ b/src/tests/drawbuffers2.c
+@@ -112,7 +112,7 @@ Display(void)
+ glUseProgram(0);
+ glDisable(GL_DEPTH_TEST);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/tests/fbotest1.c b/src/tests/fbotest1.c
+index 161903c..5930a6d 100644
+--- a/src/tests/fbotest1.c
++++ b/src/tests/fbotest1.c
+@@ -61,7 +61,7 @@ Display( void )
+
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/tests/fbotest2.c b/src/tests/fbotest2.c
+index 6ef7f12..11c867e 100644
+--- a/src/tests/fbotest2.c
++++ b/src/tests/fbotest2.c
+@@ -72,7 +72,7 @@ Display( void )
+
+ glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
+
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glCopyPixels(0, 0, Width, Height, GL_COLOR);
+ }
+ else if (blitPix) {
+@@ -95,7 +95,7 @@ Display( void )
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/tests/fbotest3.c b/src/tests/fbotest3.c
+index 19f684d..e6d7710 100644
+--- a/src/tests/fbotest3.c
++++ b/src/tests/fbotest3.c
+@@ -79,7 +79,7 @@ Display( void )
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glDisable(GL_DEPTH_TEST); /* in case window has depth buffer */
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/tests/readrate.c b/src/tests/readrate.c
+index 3859cf4..81eb8a3 100644
+--- a/src/tests/readrate.c
++++ b/src/tests/readrate.c
+@@ -85,7 +85,7 @@ MeasureFormat(struct format_type *fmt, GLint width, GLint height, GLuint pbo)
+ glEnd();
+
+ #if DRAW
+- glWindowPos2iARB(0,0);
++ glWindowPos2i(0,0);
+ glDrawPixels(width, height,
+ fmt->Format, fmt->Type, Buffer);
+ glFinish();
+@@ -137,21 +137,21 @@ Draw(void)
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+- glWindowPos2iARB(10, y);
++ glWindowPos2i(10, y);
+ sprintf(str, "ReadPixels size: %d x %d", width, height);
+ PrintString(str);
+ y -= 14;
+
+- glWindowPos2iARB(10, y);
++ glWindowPos2i(10, y);
+ PrintString("Press up/down/left/right to change image size.");
+ y -= 14;
+
+- glWindowPos2iARB(10, y);
++ glWindowPos2i(10, y);
+ PrintString("Press 'b' to run benchmark test.");
+ y -= 14;
+
+ if (Benchmark) {
+- glWindowPos2iARB(10, y);
++ glWindowPos2i(10, y);
+ PrintString("Testing...");
+ }
+
+diff --git a/src/tests/viewmemory.c b/src/tests/viewmemory.c
+index 16044b9..3584c33 100644
+--- a/src/tests/viewmemory.c
++++ b/src/tests/viewmemory.c
+@@ -95,7 +95,7 @@ Draw(void)
+
+ glDisable(GL_TEXTURE_2D);
+ glColor3f(0, 1, 0);
+- glWindowPos2iARB(10, 10);
++ glWindowPos2i(10, 10);
+ PrintString(s);
+
+ glutSwapBuffers();
+diff --git a/src/trivial/clear-fbo-scissor.c b/src/trivial/clear-fbo-scissor.c
+index a30935c..5c15200 100644
+--- a/src/trivial/clear-fbo-scissor.c
++++ b/src/trivial/clear-fbo-scissor.c
+@@ -182,7 +182,7 @@ Draw(void)
+
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/trivial/clear-fbo-tex.c b/src/trivial/clear-fbo-tex.c
+index de84f98..f0fbdf6 100644
+--- a/src/trivial/clear-fbo-tex.c
++++ b/src/trivial/clear-fbo-tex.c
+@@ -140,7 +140,7 @@ static void Draw( void )
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+- glWindowPos2iARB(30, 30);
++ glWindowPos2i(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/trivial/clear-fbo.c b/src/trivial/clear-fbo.c
+index 10d830b..3fee3e3 100644
+--- a/src/trivial/clear-fbo.c
++++ b/src/trivial/clear-fbo.c
+@@ -116,7 +116,7 @@ Draw(void)
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+- glWindowPos2iARB(30, 30);
++ glWindowPos2i(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+diff --git a/src/trivial/readpixels.c b/src/trivial/readpixels.c
+index ccce4ed..74e0546 100644
+--- a/src/trivial/readpixels.c
++++ b/src/trivial/readpixels.c
+@@ -71,7 +71,7 @@ static void Draw(void)
+ printf("Pixel(0,0) = %f, %f, %f, %f\n",
+ image[0], image[1], image[2], image[3]);
+ /* draw to right half of window */
+- glWindowPos2iARB(Width, 0);
++ glWindowPos2i(Width, 0);
+ glPixelZoom(Zoom, Zoom);
+ glDrawPixels(Width, Height, GL_RGBA, GL_FLOAT, image);
+ free(image);
+diff --git a/src/trivial/tri-fbo.c b/src/trivial/tri-fbo.c
+index d5800b2..dd1f21a 100644
+--- a/src/trivial/tri-fbo.c
++++ b/src/trivial/tri-fbo.c
+@@ -119,7 +119,7 @@ static void Draw( void )
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+- glWindowPos2iARB(30, 30);
++ glWindowPos2i(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+
+diff --git a/src/xdemos/glxsnoop.c b/src/xdemos/glxsnoop.c
+index 2215cfd..13d2b2d 100644
+--- a/src/xdemos/glxsnoop.c
++++ b/src/xdemos/glxsnoop.c
+@@ -91,7 +91,7 @@ redraw(Display *dpy, Window srcWin, Window dstWin )
+ }
+
+ glXMakeCurrent(dpy, dstWin, Context);
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glDrawBuffer(GL_FRONT);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, image);
+ glFlush();
+diff --git a/src/xdemos/wincopy.c b/src/xdemos/wincopy.c
+index f670983..d010085 100644
+--- a/src/xdemos/wincopy.c
++++ b/src/xdemos/wincopy.c
+@@ -156,11 +156,11 @@ Redraw(void)
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (TestClipping) {
+- glWindowPos2iARB(-2, -2);
++ glWindowPos2i(-2, -2);
+ glCopyPixels(-2, -2, Width[0] + 4, Height[0] + 4, GL_COLOR);
+ }
+ else {
+- glWindowPos2iARB(0, 0);
++ glWindowPos2i(0, 0);
+ glCopyPixels(0, 0, Width[0], Height[0], GL_COLOR);
+ }
+
+--
+1.8.1
+
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch
new file mode 100644
index 00000000..eb541d65
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch
@@ -0,0 +1,17 @@
+mesa-demos: Add extension header to fix build break now that gl1 is removed
+
+Upstream Status: Pending
+
+diff --git a/src/egl/opengles1/clear.c b/src/egl/opengles1/clear.c
+index 9fe1b5291e1905fd6fe572063ed707d59ce45a81..ca9954a21b5f475709dbdef07f90b900962fcbc7 100644
+--- a/src/egl/opengles1/clear.c
++++ b/src/egl/opengles1/clear.c
+@@ -34,7 +34,7 @@
+ #include <stdio.h>
+ #include <EGL/egl.h>
+ #include <GLES/gl.h>
+-
++#include <GLES/glext.h>
+ #include "eglut.h"
+
+ typedef void (GL_APIENTRY *type_ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend
new file mode 100644
index 00000000..94db4157
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-demos_%.bbappend
@@ -0,0 +1,22 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_imxgpu = " file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \
+ file://fix-clear-build-break.patch \
+ file://Additional-eglSwapBuffer-calling-makes-wrong-throttl.patch \
+ file://Add-OpenVG-demos-to-support-wayland.patch"
+
+PACKAGECONFIG_IMX_TO_REMOVE_GLES = ""
+PACKAGECONFIG_IMX_TO_REMOVE_GLES_imxgpu2d = "gles1 gles2"
+PACKAGECONFIG_IMX_TO_REMOVE_GLES_imxgpu3d = ""
+PACKAGECONFIG_IMX_TO_REMOVE = "${PACKAGECONFIG_IMX_TO_REMOVE_GLES}"
+PACKAGECONFIG_IMX_TO_REMOVE_append_imxgpu = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'glu x11', '', d)} \
+"
+PACKAGECONFIG_remove = "${PACKAGECONFIG_IMX_TO_REMOVE}"
+
+PACKAGECONFIG_IMX_TO_APPEND = ""
+PACKAGECONFIG_IMX_TO_APPEND_append_imxgpu = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland vg', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glut', '', d)} \
+"
+PACKAGECONFIG_append = "${PACKAGECONFIG_IMX_TO_APPEND}"
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend
new file mode 100644
index 00000000..465c8932
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa-gl_%.bbappend
@@ -0,0 +1 @@
+COMPATIBLE_MACHINE_imxgpu2d = "(-)"
diff --git a/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend b/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend
new file mode 100644
index 00000000..5ead6251
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/mesa/mesa_%.bbappend
@@ -0,0 +1,40 @@
+PROVIDES_remove_imxgpu = "virtual/egl"
+PROVIDES_remove_imxgpu3d = "virtual/libgl virtual/libgles1 virtual/libgles2"
+
+PACKAGECONFIG_remove_imxgpu = "egl gbm"
+PACKAGECONFIG_remove_imxgpu3d = "gles"
+
+# FIXME: mesa should support 'x11-no-tls' option
+python () {
+ overrides = d.getVar("OVERRIDES", True).split(":")
+ if "imxgpu2d" not in overrides:
+ return
+
+ x11flag = d.getVarFlag("PACKAGECONFIG", "x11", False)
+ d.setVarFlag("PACKAGECONFIG", "x11", x11flag.replace("--enable-glx-tls", "--enable-glx"))
+}
+
+# Enable Etnaviv support
+PACKAGECONFIG_append_use-mainline-bsp = " gallium"
+GALLIUMDRIVERS_append_use-mainline-bsp = ",etnaviv,imx"
+
+BACKEND = \
+ "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \
+ bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', \
+ 'fb', d), d)}"
+
+# FIXME: Dirty hack to allow use of Vivante GPU libGL binary
+do_install_append_imxgpu3d () {
+ rm -f ${D}${libdir}/libGL.* \
+ ${D}${includedir}/GL/gl.h \
+ ${D}${includedir}/GL/glext.h \
+ ${D}${includedir}/GL/glx.h \
+ ${D}${includedir}/GL/glxext.h
+ if [ "${BACKEND}" = "x11" ]; then
+ rm -f ${D}${libdir}/pkgconfig/gl.pc
+ fi
+}
+
+do_install_append_imxgpu () {
+ rm -rf ${D}${includedir}/KHR
+}