summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/mesa')
-rw-r--r--meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch31
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch27
-rw-r--r--meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch43
-rw-r--r--meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch61
-rw-r--r--meta/recipes-graphics/mesa/libglu_9.0.2.bb (renamed from meta/recipes-graphics/mesa/libglu_9.0.0.bb)12
-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-.patch119
-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.patch69
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch20
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch20
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch44
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch62
-rw-r--r--meta/recipes-graphics/mesa/mesa-demos_8.4.0.bb (renamed from meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb)40
-rw-r--r--meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb13
-rw-r--r--meta/recipes-graphics/mesa/mesa-gl_21.2.4.bb16
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc333
-rw-r--r--meta/recipes-graphics/mesa/mesa_10.6.3.bb14
-rw-r--r--meta/recipes-graphics/mesa/mesa_21.2.4.bb5
-rw-r--r--meta/recipes-graphics/mesa/mesa_git.bb22
21 files changed, 616 insertions, 697 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
new file mode 100644
index 0000000000..8bedbac669
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
@@ -0,0 +1,31 @@
+From 8973e297f2f9b17498b9dc0e37a19481d4bb7df9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Oct 2020 11:03:47 -0700
+Subject: [PATCH] futex.h: Define __NR_futex if it does not exist
+
+__NR_futex is not defines by newer architectures e.g. arc, riscv32 as
+they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on
+__NR_futex, since this is used in applications, such applications start
+to fail to build for these newer architectures. This patch defines a
+fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps
+working
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util/futex.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/src/util/futex.h
++++ b/src/util/futex.h
+@@ -34,6 +34,10 @@
+ #include <sys/syscall.h>
+ #include <sys/time.h>
+
++#if !defined(SYS_futex) && defined(SYS_futex_time64)
++# define SYS_futex SYS_futex_time64
++#endif
++
+ static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
+ {
+ return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
diff --git a/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
new file mode 100644
index 0000000000..15485feb71
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
@@ -0,0 +1,27 @@
+From bb2f0bea553d51d659a9bc46f7ae186885405151 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Jan 2020 15:23:47 -0800
+Subject: [PATCH] meson misdetects 64bit atomics on mips/clang
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util/u_atomic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c
+index e4bffa8..58e1ddd 100644
+--- a/src/util/u_atomic.c
++++ b/src/util/u_atomic.c
+@@ -21,7 +21,7 @@
+ * IN THE SOFTWARE.
+ */
+
+-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
++#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
+
+ #include <stdint.h>
+ #include <pthread.h>
+--
+2.24.1
+
diff --git a/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch
new file mode 100644
index 0000000000..b6f86743e1
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch
@@ -0,0 +1,43 @@
+From 38e984073e4c23b6278d1a2ff21e894fda7b93c5 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair@alistair23.me>
+Date: Thu, 14 Nov 2019 13:04:49 -0800
+Subject: [PATCH] meson.build: check for all linux host_os combinations
+
+Make sure that we are also looking for our host_os combinations like
+linux-musl etc. when assuming support for DRM/KMS.
+
+Also delete a duplicate line.
+
+Upstream-Status: Pending
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+Signed-off-by: Alistair Francis <alistair@alistair23.me>
+
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 932eb13..efc6171 100644
+--- a/meson.build
++++ b/meson.build
+@@ -153,7 +153,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2
+ # Only build shared_glapi if at least one OpenGL API is enabled
+ with_shared_glapi = with_shared_glapi and with_any_opengl
+
+-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos'].contains(host_machine.system())
++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly'].contains(host_machine.system()) or host_machine.system().startswith('linux')
+
+ dri_drivers = get_option('dri-drivers')
+ if dri_drivers.contains('auto')
+@@ -970,7 +970,7 @@ if cc.compiles('__uint128_t foo(void) { return 0; }',
+ endif
+
+ # TODO: this is very incomplete
+-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system())
++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system()) or host_machine.system().startswith('linux')
+ pre_args += '-D_GNU_SOURCE'
+ elif host_machine.system() == 'sunos'
+ pre_args += '-D__EXTENSIONS__'
diff --git a/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch b/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch
new file mode 100644
index 0000000000..35ab8d5a72
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0002-meson.build-make-TLS-ELF-optional.patch
@@ -0,0 +1,61 @@
+From 8f2f48b41aa17eec3c4d63685e3296f28e60b980 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair@alistair23.me>
+Date: Thu, 14 Nov 2019 13:08:31 -0800
+Subject: [PATCH] meson.build: make TLS ELF optional
+
+USE_ELF_TLS has replaced GLX_USE_TLS so this patch is the original "make
+TLS GLX optional again" patch updated to the latest mesa.
+
+For details, see:
+https://gitlab.freedesktop.org/mesa/mesa/-/issues/966
+
+This prevents runtime segfault on musl:
+
+Traceback (most recent call last):
+ File "/home/pokybuild/yocto-worker/musl-qemux86/build/meta/lib/oeqa/core/decorator/__init__.py", line 36, in wrapped_f
+ return func(*args, **kwargs)
+ File "/home/pokybuild/yocto-worker/musl-qemux86/build/meta/lib/oeqa/runtime/cases/parselogs.py", line 378, in test_parselogs
+ self.assertEqual(errcount, 0, msg=self.msg)
+AssertionError: 1 != 0 : Log: /home/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/qemux86-poky-linux-musl/core-image-sato-sdk/1.0-r0/target_logs/Xorg.0.log
+-----------------------
+Central error: [ 10.477] (EE) Failed to load /usr/lib/xorg/modules/extensions/libglx.so: Error relocating /usr/lib/libGL.so.1: alphasort: initial-exec TLS resolves to dynamic definition in /usr/lib/libGL.so.1
+***********************
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Alistair Francis <alistair@alistair23.me>
+
+---
+ meson.build | 2 +-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 23618c1..c8cc5e3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -476,7 +476,7 @@ endif
+ use_elf_tls = false
+ if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
+ (not with_platform_android or get_option('platform-sdk-version') >= 29) and
+- (not with_platform_windows or not with_shared_glapi))
++ (not with_platform_windows or not with_shared_glapi) and get_option('elf-tls'))
+ pre_args += '-DUSE_ELF_TLS'
+ use_elf_tls = true
+
+diff --git a/meson_options.txt b/meson_options.txt
+index 29c402c..f70d9b2 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -455,6 +455,12 @@ option(
+ value : true,
+ description : 'Enable direct rendering in GLX and EGL for DRI',
+ )
++option(
++ 'elf-tls',
++ type : 'boolean',
++ value : true,
++ description : 'Enable TLS support in ELF',
++)
+ option(
+ 'prefer-iris',
+ type : 'boolean',
diff --git a/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/meta/recipes-graphics/mesa/libglu_9.0.2.bb
index 010998d926..64fa82e5a8 100644
--- a/meta/recipes-graphics/mesa/libglu_9.0.0.bb
+++ b/meta/recipes-graphics/mesa/libglu_9.0.2.bb
@@ -10,21 +10,19 @@ LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b35645
# Epoch as this used to be part of mesa
PE = "2"
-PR = "0"
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${PV}.tar.bz2"
+SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.gz"
-SRC_URI[md5sum] = "be9249132ff49275461cf92039083030"
-SRC_URI[sha256sum] = "1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12"
+SRC_URI[sha256sum] = "24effdfb952453cc00e275e1c82ca9787506aba0282145fff054498e60e19a65"
S = "${WORKDIR}/glu-${PV}"
DEPENDS = "virtual/libgl"
-inherit autotools pkgconfig distro_features_check
+inherit autotools pkgconfig features_check
# Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES
-REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES = "x11 opengl"
# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
-RDEPENDS_${PN}-dev = ""
+RDEPENDS:${PN}-dev = ""
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
deleted file mode 100644
index c96af12acf..0000000000
--- a/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 36829a8d7ad2888515fbee95c2a70b3d636d7538 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 9 Jul 2014 14:30:33 +0200
-Subject: [PATCH 2/9] Correctly implement with AC_WITH(glut) so that
- --without-glut works.
-
----
- configure.ac | 26 +++++++++++++++-----------
- 1 file changed, 15 insertions(+), 11 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index c4ee12b..9445424 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
- DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
-
- dnl Check for GLUT
--GLUT_CFLAGS=""
--GLUT_LIBS=-lglut
--glut_enabled=yes
-+glut_enabled=no
- AC_ARG_WITH([glut],
- [AS_HELP_STRING([--with-glut=DIR],
- [glut install directory])],
- [GLUT_CFLAGS="-I$withval/include"
-- GLUT_LIBS="-L$withval/lib -lglut"])
--AC_CHECK_HEADER([GL/glut.h],
-- [],
-- [glut_enabled=no])
--AC_CHECK_LIB([glut],
-- [glutInit],
-- [],
-- [glut_enabled=no])
-+ GLUT_LIBS="-L$withval/lib -lglut"],
-+ [GLUT_CFLAGS=""
-+ GLUT_LIBS="-lglut"]
-+ )
-+AS_IF([test "x$with_glut" != xno],
-+ [AC_CHECK_HEADER([GL/glut.h],
-+ [],
-+ [glut_enabled=no])
-+ AC_CHECK_LIB([glut],
-+ [glutInit],
-+ [],
-+ [glut_enabled=no])
-+ glut_enabled=yes
-+])
-
- dnl Check for FreeGLUT 2.6 or later
- AC_EGREP_HEADER([glutInitContextProfile],
---
-2.0.0
-
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
index 6b58c2b776..f6b59a11fe 100644
--- 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
@@ -1,8 +1,7 @@
-From b25e9c675cf560b8b037dc855c6b3b1d09957867 Mon Sep 17 00:00:00 2001
+From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Wed, 9 Jul 2014 14:23:41 +0200
-Subject: [PATCH 3/9] configure: Allow to disable demos which require GLEW or
- GLU
+Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU
* in some systems without X11 support we don't have GLEW, but
mesa-demos are still useful
@@ -10,17 +9,20 @@ Subject: [PATCH 3/9] configure: Allow to disable demos which require GLEW or
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Port to 8.3.0
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
configure.ac | 49 ++++++++++++++++++++---------
- src/Makefile.am | 14 ++++++---
+ src/Makefile.am | 18 ++++++++---
src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
src/egl/Makefile.am | 8 +++--
- src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
- src/egl/opengles2/Makefile.am | 33 ++++++++++---------
- 6 files changed, 135 insertions(+), 86 deletions(-)
+ src/egl/opengles1/Makefile.am | 10 ++++--
+ src/egl/opengles2/Makefile.am | 29 ++++++++---------
+ 6 files changed, 117 insertions(+), 70 deletions(-)
diff --git a/configure.ac b/configure.ac
-index 9445424..bc4c8d1 100644
+index 0525b09..28834cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
@@ -92,10 +94,11 @@ index 9445424..bc4c8d1 100644
AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
diff --git a/src/Makefile.am b/src/Makefile.am
-index 1647d64..754c47c 100644
+index 1647d64..8b89dee 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -23,14 +23,18 @@
+@@ -22,15 +22,19 @@
+ # Authors:
# Eric Anholt <eric@anholt.net>
+if HAVE_GLEW
@@ -116,7 +119,7 @@ index 1647d64..754c47c 100644
objviewer \
osdemos \
perf \
-@@ -40,8 +39,12 @@ SUBDIRS = \
+@@ -40,8 +44,12 @@ SUBDIRS = \
slang \
tests \
tools \
@@ -289,10 +292,10 @@ index d64a49e..4fe1ca8 100644
+ openvg
+endif
diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
-index 7a9828d..3455e75 100644
+index fa397c2..21853e8 100644
--- a/src/egl/opengles1/Makefile.am
+++ b/src/egl/opengles1/Makefile.am
-@@ -36,28 +36,43 @@ AM_LDFLAGS = \
+@@ -36,9 +36,12 @@ AM_LDFLAGS = \
$(EGL_LIBS) \
-lm
@@ -301,42 +304,13 @@ index 7a9828d..3455e75 100644
if HAVE_EGL
if HAVE_GLESV1
-noinst_PROGRAMS = \
-- bindtex \
-- clear \
-+noinst_PROGRAMS += \
- drawtex_screen \
-+ gears_screen \
-+ torus_screen \
-+ tri_screen
-+
-+drawtex_screen_SOURCES = drawtex.c
-+gears_screen_SOURCES = gears.c
-+torus_screen_SOURCES = torus.c
-+tri_screen_SOURCES = tri.c
-+
-+drawtex_screen_LDADD = ../eglut/libeglut_screen.la
-+gears_screen_LDADD = ../eglut/libeglut_screen.la
-+torus_screen_LDADD = ../eglut/libeglut_screen.la
-+tri_screen_LDADD = ../eglut/libeglut_screen.la
-+
+if HAVE_X11
-+noinst_PROGRAMS += \
-+ clear
-+
+bin_PROGRAMS = \
-+ bindtex \
+ bindtex \
+ clear \
drawtex_x11 \
- eglfbdev \
- es1_info \
-- gears_screen \
- gears_x11 \
- msaa \
- pbuffer\
- render_tex \
- texture_from_pixmap \
-- torus_screen \
+@@ -52,8 +55,6 @@ noinst_PROGRAMS = \
torus_x11 \
-- tri_screen \
tri_x11 \
two_win
-endif
@@ -344,26 +318,7 @@ index 7a9828d..3455e75 100644
bindtex_LDADD = $(X11_LIBS)
es1_info_LDADD = $(X11_LIBS)
-@@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
- clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
- clear_LDFLAGS =
-
--drawtex_screen_SOURCES = drawtex.c
--gears_screen_SOURCES = gears.c
--torus_screen_SOURCES = torus.c
--tri_screen_SOURCES = tri.c
--
- drawtex_x11_SOURCES = drawtex.c
- gears_x11_SOURCES = gears.c
- torus_x11_SOURCES = torus.c
- tri_x11_SOURCES = tri.c
-
--drawtex_screen_LDADD = ../eglut/libeglut_screen.la
--gears_screen_LDADD = ../eglut/libeglut_screen.la
--torus_screen_LDADD = ../eglut/libeglut_screen.la
--tri_screen_LDADD = ../eglut/libeglut_screen.la
--
- drawtex_x11_LDADD = ../eglut/libeglut_x11.la
+@@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
gears_x11_LDADD = ../eglut/libeglut_x11.la
torus_x11_LDADD = ../eglut/libeglut_x11.la
tri_x11_LDADD = ../eglut/libeglut_x11.la
@@ -371,35 +326,35 @@ index 7a9828d..3455e75 100644
+endif
+endif
diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
-index 41c1b80..74af460 100644
+index b80ba50..17f8d49 100644
--- a/src/egl/opengles2/Makefile.am
+++ b/src/egl/opengles2/Makefile.am
-@@ -36,26 +36,29 @@ AM_LDFLAGS = \
+@@ -33,27 +33,28 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++bin_PROGRAMS =
++
if HAVE_EGL
if HAVE_GLESV2
- bin_PROGRAMS = \
+-bin_PROGRAMS =
+-if HAVE_X11
+-bin_PROGRAMS += \
- es2_info \
-- es2gears_screen \
- es2gears_x11 \
- es2tri
-+ es2gears_screen
-+
-+es2gears_screen_SOURCES = es2gears.c
-+es2gears_screen_LDADD = ../eglut/libeglut_screen.la
-+
+-endif
if HAVE_WAYLAND
bin_PROGRAMS += es2gears_wayland
-endif
-endif
--endif
-
--es2_info_LDADD = $(X11_LIBS)
--es2tri_LDADD = $(X11_LIBS)
++
+es2gears_wayland_SOURCES = es2gears.c
+es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
-+endif
+ endif
--es2gears_screen_SOURCES = es2gears.c
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
+if HAVE_X11
+bin_PROGRAMS += \
+ es2tri \
@@ -409,8 +364,6 @@ index 41c1b80..74af460 100644
+es2_info_LDADD = $(X11_LIBS)
es2gears_x11_SOURCES = es2gears.c
-
--es2gears_screen_LDADD = ../eglut/libeglut_screen.la
--
es2gears_x11_LDADD = ../eglut/libeglut_x11.la
+es2tri_LDADD = $(X11_LIBS)
+endif
@@ -420,5 +373,5 @@ index 41c1b80..74af460 100644
-es2gears_wayland_SOURCES = es2gears.c
-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
--
-2.0.0
+2.1.4
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
deleted file mode 100644
index aac2a37294..0000000000
--- a/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
+++ /dev/null
@@ -1,267 +0,0 @@
-From 453353a221de9c64479f4372565d2cd8591b36cc Mon Sep 17 00:00:00 2001
-From: Frank Binns <frank.binns@imgtec.com>
-Date: Fri, 29 Jun 2012 11:26:04 +0100
-Subject: [PATCH 5/9] Fix build when EGL_MESA_screen_surface extension isn't
- present
-
-The EGL demos won't build against EGL implementations that don't support
-the EGL_MESA_screen_surface extension. Fix this, in most cases, by
-wrapping relevant bits of code in #ifdef EGL_MESA_screen_surface.
-
-Signed-off-by: Frank Binns <frank.binns@imgtec.com>
-
-Applied and fixed up in Yocto by...
-
-Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
-
-Upstream-Status: Pending
----
- src/egl/eglut/eglut.c | 9 +++++++--
- src/egl/eglut/eglut_screen.c | 14 ++++++++++++++
- src/egl/opengl/demo1.c | 2 ++
- src/egl/opengl/demo2.c | 7 ++++++-
- src/egl/opengl/demo3.c | 7 ++++++-
- 5 files changed, 35 insertions(+), 4 deletions(-)
-
-diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
-index 2ee6f15..f6a2ad4 100644
---- a/src/egl/eglut/eglut.c
-+++ b/src/egl/eglut/eglut.c
-@@ -76,8 +76,9 @@ _eglutNow(void)
- static void
- _eglutDestroyWindow(struct eglut_window *win)
- {
-- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
-- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
-+
-+ if (_eglut->surface_type == EGL_WINDOW_BIT ||
-+ _eglut->surface_type == EGL_PIXMAP_BIT)
- eglDestroySurface(_eglut->dpy, win->surface);
-
- _eglutNativeFiniWindow(win);
-@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
- win->config, win->native.u.pixmap, NULL);
- break;
- case EGL_PBUFFER_BIT:
-+#ifdef EGL_MESA_screen_surface
- case EGL_SCREEN_BIT_MESA:
-+#endif
- win->surface = win->native.u.surface;
- break;
- default:
-@@ -289,8 +292,10 @@ eglutDestroyWindow(int win)
- if (window->index != win)
- return;
-
-+#ifdef EGL_MESA_screen_surface
- /* XXX it causes some bug in st/egl KMS backend */
- if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
-+#endif
- eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
- _eglutDestroyWindow(_eglut->current);
-diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
-index 021a8f1..094a4e2 100644
---- a/src/egl/eglut/eglut_screen.c
-+++ b/src/egl/eglut/eglut_screen.c
-@@ -35,26 +35,33 @@
-
- #define MAX_MODES 100
-
-+#ifdef EGL_MESA_screen_surface
- static EGLScreenMESA kms_screen;
- static EGLModeMESA kms_mode;
- static EGLint kms_width, kms_height;
-+#endif
-
- void
- _eglutNativeInitDisplay(void)
- {
-+#ifdef EGL_MESA_screen_surface
- _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
- _eglut->surface_type = EGL_SCREEN_BIT_MESA;
-+#endif
- }
-
- void
- _eglutNativeFiniDisplay(void)
- {
-+#ifdef EGL_MESA_screen_surface
- kms_screen = 0;
- kms_mode = 0;
- kms_width = 0;
- kms_height = 0;
-+#endif
- }
-
-+#ifdef EGL_MESA_screen_surface
- static void
- init_kms(void)
- {
-@@ -94,19 +101,23 @@ init_kms(void)
- kms_width = width;
- kms_height = height;
- }
-+#endif
-
- void
- _eglutNativeInitWindow(struct eglut_window *win, const char *title,
- int x, int y, int w, int h)
- {
-+#ifdef EGL_MESA_screen_surface
- EGLint surf_attribs[16];
- EGLint i;
-+#endif
- const char *exts;
-
- exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
- if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
- _eglutFatal("EGL_MESA_screen_surface is not supported\n");
-
-+#ifdef EGL_MESA_screen_surface
- init_kms();
-
- i = 0;
-@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
-
- win->native.width = kms_width;
- win->native.height = kms_height;
-+#endif
- }
-
- void
- _eglutNativeFiniWindow(struct eglut_window *win)
- {
-+#ifdef EGL_MESA_screen_surface
- eglShowScreenSurfaceMESA(_eglut->dpy,
- kms_screen, EGL_NO_SURFACE, 0);
- eglDestroySurface(_eglut->dpy, win->native.u.surface);
-+#endif
- }
-
- void
-diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
-index d892734..3a3564c 100644
---- a/src/egl/opengl/demo1.c
-+++ b/src/egl/opengl/demo1.c
-@@ -18,6 +18,7 @@
- static void
- TestScreens(EGLDisplay dpy)
- {
-+#ifdef EGL_MESA_screen_surface
- #define MAX 8
- EGLScreenMESA screens[MAX];
- EGLint numScreens;
-@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
- for (i = 0; i < numScreens; i++) {
- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
- }
-+#endif
- }
-
- /**
-diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
-index 505b474..bfef59e 100644
---- a/src/egl/opengl/demo2.c
-+++ b/src/egl/opengl/demo2.c
-@@ -16,6 +16,7 @@
-
- /*#define FRONTBUFFER*/
-
-+#ifdef EGL_MESA_screen_surface
- static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
- GLfloat r, GLfloat g, GLfloat b)
- {
-@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
- }
- }
--
-+#endif
-
- int
- main(int argc, char *argv[])
- {
- int maj, min;
-+#ifdef EGL_MESA_screen_surface
- EGLContext ctx;
- EGLSurface pbuffer, screen_surf;
- EGLConfig configs[10];
-@@ -115,6 +117,7 @@ main(int argc, char *argv[])
- EGLModeMESA mode;
- EGLScreenMESA screen;
- EGLint count;
-+#endif
-
- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- assert(d);
-@@ -132,6 +135,7 @@ main(int argc, char *argv[])
- exit(1);
- }
-
-+#ifdef EGL_MESA_screen_surface
- eglGetConfigs(d, configs, 10, &numConfigs);
- printf("Got %d EGL configs:\n", numConfigs);
- for (i = 0; i < numConfigs; i++) {
-@@ -211,6 +215,7 @@ main(int argc, char *argv[])
- eglDestroySurface(d, pbuffer);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-+#endif
-
- return 0;
- }
-diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
-index f84ca23..31b5d8b 100644
---- a/src/egl/opengl/demo3.c
-+++ b/src/egl/opengl/demo3.c
-@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
- 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
- };
-
--
-+#ifdef EGL_MESA_screen_surface
- static void Init(void)
- {
-
-@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
- fclose(f);
- }
- }
-+#endif
-
- int
- main(int argc, char *argv[])
- {
- int maj, min;
-+#ifdef EGL_MESA_screen_surface
- EGLContext ctx;
- EGLSurface screen_surf;
- EGLConfig configs[10];
-@@ -566,6 +568,7 @@ main(int argc, char *argv[])
- const GLubyte *bitmap;
- EGLint screenAttribs[32];
- EGLint i;
-+#endif
-
- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
- assert(d);
-@@ -583,6 +586,7 @@ main(int argc, char *argv[])
- exit(1);
- }
-
-+#ifdef EGL_MESA_screen_surface
- eglGetConfigs(d, configs, 10, &numConfigs);
- eglGetScreensMESA(d, &screen, 1, &count);
- eglGetModesMESA(d, screen, &mode, 1, &count);
-@@ -642,6 +646,7 @@ main(int argc, char *argv[])
- eglDestroySurface(d, screen_surf);
- eglDestroyContext(d, ctx);
- eglTerminate(d);
-+#endif
-
- return 0;
- }
---
-2.0.0
-
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
deleted file mode 100644
index 12e0805f15..0000000000
--- a/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 6a19dba1d275579c73e7763b0554410ff4e1e650 Mon Sep 17 00:00:00 2001
-From: Frank Binns <frank.binns@imgtec.com>
-Date: Fri, 29 Jun 2012 12:00:26 +0100
-Subject: [PATCH 6/9] Query display for EGL_MESA_screen_surface extension
- before using it
-
-This code makes heavy use of the EGL_MESA_screen_surface extension so
-check the display to determine if it's supported by the underlying EGL
-implementation. If it doesn't then bail.
-
-Signed-off-by: Frank Binns <frank.binns@imgtec.com>
-
-Applied and fixed up in Yocto by...
-
-Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
-
-Upstream-Status: Pending
----
- src/egl/opengl/demo1.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
-index 3a3564c..06e2138 100644
---- a/src/egl/opengl/demo1.c
-+++ b/src/egl/opengl/demo1.c
-@@ -110,6 +110,12 @@ main(int argc, char *argv[])
- printf("EGL version = %d.%d\n", maj, min);
- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-
-+ if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
-+ "EGL_MESA_screen_surface")) {
-+ printf("EGL_MESA_screen_surface is not supported\n");
-+ exit(1);
-+ }
-+
- eglGetConfigs(d, NULL, 0, &numConfigs);
- configs = malloc(sizeof(*configs) *numConfigs);
- eglGetConfigs(d, configs, numConfigs, &numConfigs);
---
-2.0.0
-
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
index 89d2fac4fd..b27d9eafa5 100644
--- 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
@@ -1,63 +1,35 @@
-From d930b2da57f7c9efb80c8cef8f8adad15bbbc0d3 Mon Sep 17 00:00:00 2001
+From 2e0367a941445a862ab99c54ec85d1357d0f73c0 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 10 Jul 2014 14:30:52 +0200
-Subject: [PATCH 7/9] Install few more test programs
+Subject: [PATCH] Install few more test programs
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
---
- src/egl/opengl/Makefile.am | 2 +-
- src/egl/opengles1/Makefile.am | 10 ++++------
- src/egl/openvg/Makefile.am | 2 +-
- 3 files changed, 6 insertions(+), 8 deletions(-)
+ src/egl/opengl/Makefile.am | 3 +--
+ src/egl/openvg/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
-index 0c7228f..87b2f1a 100644
+index 6d184ff6..ab09d028 100644
--- a/src/egl/opengl/Makefile.am
+++ b/src/egl/opengl/Makefile.am
-@@ -50,7 +50,7 @@ endif
- endif
+@@ -57,8 +57,7 @@ endif
if HAVE_EGL
+ bin_PROGRAMS = \
+- eglinfo
-noinst_PROGRAMS = \
-+bin_PROGRAMS = \
- demo1 \
- demo2 \
- demo3 \
-diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
-index 3455e75..516e516 100644
---- a/src/egl/opengles1/Makefile.am
-+++ b/src/egl/opengles1/Makefile.am
-@@ -36,11 +36,11 @@ AM_LDFLAGS = \
- $(EGL_LIBS) \
- -lm
-
--noinst_PROGRAMS =
-+bin_PROGRAMS =
-
- if HAVE_EGL
- if HAVE_GLESV1
--noinst_PROGRAMS += \
-+bin_PROGRAMS += \
- drawtex_screen \
- gears_screen \
- torus_screen \
-@@ -57,10 +57,8 @@ torus_screen_LDADD = ../eglut/libeglut_screen.la
- tri_screen_LDADD = ../eglut/libeglut_screen.la
-
- if HAVE_X11
--noinst_PROGRAMS += \
-- clear
--
--bin_PROGRAMS = \
-+bin_PROGRAMS += \
-+ clear \
- bindtex \
- drawtex_x11 \
- eglfbdev \
++ eglinfo \
+ peglgears \
+ $(EGL_DRM_DEMOS) \
+ $(EGL_X11_DEMOS) \
diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
-index 7318a43..b545225 100644
+index b0f1212f..5fd1cf83 100644
--- a/src/egl/openvg/Makefile.am
+++ b/src/egl/openvg/Makefile.am
@@ -49,7 +49,7 @@ endif
@@ -66,9 +38,6 @@ index 7318a43..b545225 100644
if HAVE_VG
-noinst_PROGRAMS = \
+bin_PROGRAMS = \
- lion_screen \
- sp_screen \
$(EGL_X11_DEMOS)
---
-2.0.0
-
+ endif
+ endif
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
index a6085754d2..a6d168175f 100644
--- 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
@@ -1,12 +1,13 @@
-From 0b6f95f9b8ece22e9856c150e4be29fd86eaf546 Mon Sep 17 00:00:00 2001
+From 894add34c2b5e6b4ccc78996bf681d7ec7bc9e36 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 10 Jul 2014 14:29:27 +0200
-Subject: [PATCH 8/9] glsl, perf: Add few missing .glsl, .vert, .frag files to
+Subject: [PATCH] glsl, perf: Add few missing .glsl, .vert, .frag files to
EXTRA_DATA
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
---
src/fpglsl/Makefile.am | 2 ++
src/glsl/Makefile.am | 10 ++++++++--
@@ -15,7 +16,7 @@ Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
-index 47c1039..fd43c91 100644
+index 47c1039f..fd43c919 100644
--- a/src/fpglsl/Makefile.am
+++ b/src/fpglsl/Makefile.am
@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
@@ -32,7 +33,7 @@ index 47c1039..fd43c91 100644
mov-imm.glsl \
simpleif.glsl \
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
-index 4faa8db..079a29d 100644
+index 4faa8dbf..079a29d8 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -37,7 +37,7 @@ AM_LDFLAGS = \
@@ -71,13 +72,13 @@ index 4faa8db..079a29d 100644
+ skinning.vert \
toyball.shtest
diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
-index 5363c58..c5cca8d 100644
+index f0031fea..60069396 100644
--- a/src/perf/Makefile.am
+++ b/src/perf/Makefile.am
-@@ -57,3 +57,9 @@ bin_PROGRAMS = \
- endif
+@@ -59,3 +59,9 @@ endif
glslstateschange_LDADD = libperf.la ../util/libutil.la
+ glsl_compile_time_LDADD = ../util/libutil.la
+
+EXTRA_DIST = \
+ glslstateschange1.frag \
@@ -85,7 +86,7 @@ index 5363c58..c5cca8d 100644
+ glslstateschange2.frag \
+ glslstateschange2.vert
diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
-index 4a85ed4..48b08f4 100644
+index 4a85ed40..48b08f48 100644
--- a/src/vpglsl/Makefile.am
+++ b/src/vpglsl/Makefile.am
@@ -44,6 +44,7 @@ EXTRA_DIST = \
@@ -96,6 +97,3 @@ index 4a85ed4..48b08f4 100644
mov.glsl \
nestedifs.glsl \
nestedswizzle.glsl \
---
-2.0.0
-
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
index 1262dee237..8a98ba60d1 100644
--- 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
@@ -1,10 +1,11 @@
-From c8c3de5417d6b6c7d7579c528c0cab718f4bfdb6 Mon Sep 17 00:00:00 2001
+From 477ab6d90a17d8e4d3935be6ce8b8e154db0e3e5 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Thu, 10 Jul 2014 14:48:12 +0200
-Subject: [PATCH 9/9] glsl, perf: Install .glsl, .vert, .frag files
+Subject: [PATCH] glsl, perf: Install .glsl, .vert, .frag files
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
---
src/fpglsl/Makefile.am | 3 ++-
src/glsl/Makefile.am | 3 ++-
@@ -13,7 +14,7 @@ Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
-index fd43c91..2bf51de 100644
+index fd43c919..2bf51de4 100644
--- a/src/fpglsl/Makefile.am
+++ b/src/fpglsl/Makefile.am
@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
@@ -27,7 +28,7 @@ index fd43c91..2bf51de 100644
dowhile2.glsl \
dowhile.glsl \
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
-index 079a29d..f66ec29 100644
+index 079a29d8..f66ec299 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
@@ -41,12 +42,12 @@ index 079a29d..f66ec29 100644
CH06-brick.vert \
CH11-bumpmap.frag \
diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
-index c5cca8d..140256d 100644
+index 60069396..469bdf45 100644
--- a/src/perf/Makefile.am
+++ b/src/perf/Makefile.am
-@@ -58,7 +58,8 @@ endif
-
+@@ -60,7 +60,8 @@ endif
glslstateschange_LDADD = libperf.la ../util/libutil.la
+ glsl_compile_time_LDADD = ../util/libutil.la
-EXTRA_DIST = \
+demosdatadir=$(datadir)/$(PACKAGE)/
@@ -55,7 +56,7 @@ index c5cca8d..140256d 100644
glslstateschange1.vert \
glslstateschange2.frag \
diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
-index 48b08f4..5526867 100644
+index 48b08f48..55268675 100644
--- a/src/vpglsl/Makefile.am
+++ b/src/vpglsl/Makefile.am
@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
@@ -68,6 +69,3 @@ index 48b08f4..5526867 100644
for.glsl \
func.glsl \
func2.glsl \
---
-2.0.0
-
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch b/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
new file mode 100644
index 0000000000..c687647407
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
@@ -0,0 +1,44 @@
+From 3aa84c47e88a4c38446ce1323abf6f2c77389104 Mon Sep 17 00:00:00 2001
+From: Prabhu <prabhu.sundararaj@freescale.com>
+Date: Mon, 16 Nov 2015 17:09:32 -0600
+Subject: [PATCH] mesa-demos: OpenVG demos with single frame need eglSwapBuffer
+
+sp and text demos rendering single frame. to display the
+single frame rendered needed a eglSwapBuffer to diplay to window.
+Hence added eglutPostRedisplay to display the frame
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com>
+---
+ src/egl/openvg/sp.c | 1 +
+ src/egl/openvg/text.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/egl/openvg/sp.c b/src/egl/openvg/sp.c
+index a20c0a3..468e91e 100644
+--- a/src/egl/openvg/sp.c
++++ b/src/egl/openvg/sp.c
+@@ -500,6 +500,7 @@ draw(void)
+ }
+
+ vgFlush();
++ eglutPostRedisplay();
+ }
+
+
+diff --git a/src/egl/openvg/text.c b/src/egl/openvg/text.c
+index f5c6de8..492581c 100644
+--- a/src/egl/openvg/text.c
++++ b/src/egl/openvg/text.c
+@@ -360,6 +360,7 @@ display(void)
+ {
+ vgClear(0, 0, width, height);
+ glyph_string_draw(10.0, 10.0);
++ eglutPostRedisplay();
+ }
+
+
+--
+2.5.1
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch b/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
new file mode 100644
index 0000000000..e7be4dfbe1
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
@@ -0,0 +1,62 @@
+From 322af294390a7f4e1524c5a79312be6cbebce988 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Wed, 11 Nov 2015 17:22:12 +0500
+Subject: [PATCH] only build GLX demos if needed
+
+There are platforms that default to EGL only configurations
+in which case the GLX applications are not required
+at all. Allow the user to control generation of these
+demos as needed through a configure switch.
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+Upstream-Status: Pending
+---
+ configure.ac | 9 +++++++++
+ src/Makefile.am | 6 +++++-
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f8ec7e3..1a4d96d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,11 @@ if test "x$enable_glu" = xyes; then
+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
+ fi
+
++AC_ARG_ENABLE([glx-demos],
++ [AS_HELP_STRING([--enable-glx-demos],
++ [enable GLX demos @<:@default=auto@:>@])],
++ [glx_demos_enabled="$enableval"],
++ [glx_demos_enabled=yes])
+ AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl],
+ [enable EGL library @<:@default=auto@:>@])],
+@@ -325,6 +333,7 @@ AC_SUBST([WAYLAND_LIBS])
+
+ AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLX, test "x$glx_demos_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8b89dee..a4d7e8f 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,8 +44,12 @@ SUBDIRS = \
+ slang \
+ tests \
+ tools \
+- wgl \
++ wgl
++
++if HAVE_GLX
++SUBDIRS += \
+ xdemos
++endif
+
+ if HAVE_GLEW
+ SUBDIRS += \
+--
+1.9.1
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.4.0.bb
index e4516425e2..368af4e915 100644
--- a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.4.0.bb
@@ -9,27 +9,28 @@ LICENSE = "MIT & PD"
LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
- file://0001-mesa-demos-Add-missing-data-files.patch \
- file://0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch \
- file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
- file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
- file://0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch \
- file://0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch \
- file://0007-Install-few-more-test-programs.patch \
- file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
- file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
-"
-SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
-SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
-
-inherit autotools pkgconfig
+SRC_URI = "https://mesa.freedesktop.org/archive/demos/${BPN}-${PV}.tar.bz2 \
+ file://0001-mesa-demos-Add-missing-data-files.patch \
+ file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
+ file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
+ file://0007-Install-few-more-test-programs.patch \
+ file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
+ file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
+ file://0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch \
+ file://0013-only-build-GLX-demos-if-needed.patch \
+ "
+SRC_URI[md5sum] = "6b65a02622765522176d00f553086fa3"
+SRC_URI[sha256sum] = "01e99c94a0184e63e796728af89bfac559795fb2a0d6f506fa900455ca5fff7d"
+
+inherit autotools pkgconfig features_check
+# depends on virtual/egl, virtual/libgl ...
+REQUIRED_DISTRO_FEATURES = "opengl x11"
PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glew glu', '', d)}"
+ x11 glew glu glx"
# The Wayland code doesn't work with Wayland 1.0, so disable it for now
-#${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
+#${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}"
EXTRA_OECONF = "--with-system-data-files"
@@ -39,15 +40,16 @@ PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
-PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,"
+PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,freeglut"
PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg"
PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
+PACKAGECONFIG[glx] = "--enable-glx-demos,--disable-glx-demos"
-do_install_append() {
+do_install:append() {
# it can be completely empty when all PACKAGECONFIG options are disabled
rmdir --ignore-fail-on-non-empty ${D}${bindir}
diff --git a/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb b/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb
deleted file mode 100644
index fc2bca9982..0000000000
--- a/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require mesa_${PV}.bb
-
-SUMMARY += " (OpenGL only, no EGL/GLES)"
-
-FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
-
-PROVIDES = "virtual/libgl virtual/mesa"
-
-S = "${WORKDIR}/mesa-${PV}"
-
-PACKAGECONFIG ??= "dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-
-EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-graphics/mesa/mesa-gl_21.2.4.bb b/meta/recipes-graphics/mesa/mesa-gl_21.2.4.bb
new file mode 100644
index 0000000000..142bb743b1
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-gl_21.2.4.bb
@@ -0,0 +1,16 @@
+require mesa.inc
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+# At least one DRI rendering engine is required to build mesa.
+# When no X11 is available, use osmesa for the rendering engine.
+PACKAGECONFIG ??= "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
+PACKAGECONFIG:class-target = "opengl dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'osmesa gallium', d)}"
+
+# 21.0.0 version fails to build when any driver is enabled in DRIDRIVERS
+# ./mesa-21.0.0/meson.build:519:4: ERROR: Problem encountered: building dri drivers require at least one windowing system
+DRIDRIVERS ?= ""
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index af7a2c47fc..f1a1e57062 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -10,68 +10,180 @@ HOMEPAGE = "http://mesa3d.org"
BUGTRACKER = "https://bugs.freedesktop.org"
SECTION = "x11"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://docs/license.html;md5=6a23445982a7a972ac198e93cc1cb3de"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=17a4ea65de7a9ab42437f3131e616a7f"
PE = "2"
-DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
+SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
+ file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
+ file://0002-meson.build-make-TLS-ELF-optional.patch \
+ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
+ file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
+ "
-PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
+SRC_URI[sha256sum] = "fe6ede82d1ac02339da3c2ec1820a379641902fd351a52cc01153f76eff85b44"
-inherit autotools pkgconfig pythonnative gettext distro_features_check
+UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
-REQUIRED_DISTRO_FEATURES = "opengl"
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install:append() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+ sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+ fi
+}
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
+EXTRANATIVEPATH += "chrpath-native"
+PROVIDES = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
+ virtual/mesa \
+ "
+
+inherit meson pkgconfig python3native gettext features_check
+
+BBCLASSEXTEND = "native nativesdk"
+
+ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan"
+
+PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}"
+
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config"
+export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}"
+export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+
+MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
-EXTRA_OECONF = "--enable-shared-glapi"
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+ _buildtype = d.getVar('MESA_BUILD_TYPE')
+ if _buildtype not in ['release', 'debug']:
+ bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+ if _buildtype == 'debug':
+ return 'debugoptimized'
+ return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
-PACKAGECONFIG ??= "egl gles dri \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
- ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
- "
+EXTRA_OEMESON = " \
+ -Dshared-glapi=enabled \
+ -Dgallium-opencl=disabled \
+ -Dglx-read-only-text=true \
+ -Dplatforms='${@",".join("${PLATFORMS}".split())}' \
+"
-X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
-PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
-PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
-PACKAGECONFIG[wayland] = ",,wayland"
+def strip_comma(s):
+ return s.strip(',')
-DRIDRIVERS = "swrast"
-DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
-DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
-PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
-PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
+PACKAGECONFIG:class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium virgl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
+ elf-tls \
+ "
+PACKAGECONFIG:class-native ?= "gbm gallium egl opengl elf-tls x11"
+PACKAGECONFIG:class-nativesdk ?= "gbm gallium egl opengl elf-tls x11"
-EXTRA_OECONF += "--enable-gbm"
+PACKAGECONFIG:remove:libc-musl = "elf-tls"
-PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
+# "gbm" requires "dri", "opengl"
+PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled"
-EGL_PLATFORMS = "drm"
-EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
-EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
-PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
+X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr"
+# "x11" requires "opengl"
+PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}"
+PACKAGECONFIG[elf-tls] = "-Delf-tls=true, -Delf-tls=false"
+PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=enabled,-Dgallium-xvmc=disabled,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
+
+# "dri" requires "opengl"
+PACKAGECONFIG[dri] = "-Ddri-drivers=${@strip_comma('${DRIDRIVERS}')}, -Ddri-drivers='', xorgproto libdrm"
+PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence"
+
+# Vulkan drivers need dri3 enabled
+# amd could be enabled as well but requires gallium-llvm with llvm >= 3.9
+VULKAN_DRIVERS = ""
+VULKAN_DRIVERS:append:x86:class-target = ",intel"
+VULKAN_DRIVERS:append:x86-64:class-target = ",intel"
+VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
+PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',"
+
+PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
+
+# "gles" requires "opengl"
+PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
+
+# "egl" requires "dri", "opengl"
+PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled"
+
+PACKAGECONFIG[etnaviv] = ""
+PACKAGECONFIG[freedreno] = ""
+PACKAGECONFIG[kmsro] = ""
+PACKAGECONFIG[vc4] = ""
+PACKAGECONFIG[v3d] = ""
GALLIUMDRIVERS = "swrast"
-GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
+# gallium swrast was found to crash Xorg on startup in x32 qemu
+GALLIUMDRIVERS:x86-x32 = ""
+GALLIUMDRIVERS:append:x86:class-target = ",i915,iris,crocus"
+GALLIUMDRIVERS:append:x86-64:class-target = ",i915,iris,crocus"
+
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}"
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}"
+
+# radeonsi requires LLVM
+GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}"
+GALLIUMDRIVERS_LLVM = "r300,nouveau${GALLIUMDRIVERS_RADEONSI}"
+GALLIUMDRIVERS_LLVM:append:x86:class-target = ",svga"
+GALLIUMDRIVERS_LLVM:append:x86-64:class-target = ",svga"
+
PACKAGECONFIG[r600] = ""
-GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
-GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
-GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers
-PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
-MESA_LLVM_RELEASE ?= "3.3"
-PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
- ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
-export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
-PACKAGECONFIG[xa] = "--enable-xa, --disable-xa"
+PACKAGECONFIG[virgl] = ""
+
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}"
+GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}"
+
+PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"
+PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm${MESA_LLVM_RELEASE} llvm-native \
+ elfutils"
+PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
+PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
+
+PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"
+
+PACKAGECONFIG[lima] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}"
+
+PACKAGECONFIG[panfrost] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
+
+PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false"
+
+PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
+
+PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors"
# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
-FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
+FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer"
-# Multiple virtual/gl providers being built breaks staging
-EXCLUDE_FROM_WORLD = "1"
+CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS"
+CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS"
# Remove the mesa dependency on mesa-dev, as mesa is empty
-RDEPENDS_${PN}-dev = ""
+RDEPENDS:${PN}-dev = ""
+
+# Add dependency so that GLES3 header don't need to be added manually
+RDEPENDS:libgles2-mesa-dev += "libgles3-mesa-dev"
PACKAGES =+ "libegl-mesa libegl-mesa-dev \
libosmesa libosmesa-dev \
@@ -81,28 +193,34 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
libgles1-mesa libgles1-mesa-dev \
libgles2-mesa libgles2-mesa-dev \
libgles3-mesa libgles3-mesa-dev \
- libwayland-egl libwayland-egl-dev \
- libxvmcsoftpipe libxvmcsoftpipe-dev \
libxatracker libxatracker-dev \
- mesa-megadriver \
+ mesa-megadriver mesa-vulkan-drivers \
+ mesa-vdpau-drivers \
"
-do_install_append () {
+do_install:append () {
# Drivers never need libtool .la files
rm -f ${D}${libdir}/dri/*.la
rm -f ${D}${libdir}/egl/*.la
rm -f ${D}${libdir}/gallium-pipe/*.la
rm -f ${D}${libdir}/gbm/*.la
-
+
# it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
- rm -f ${D}${sysconfdir}/drirc
+ chrpath --delete ${D}${libdir}/dri/*_dri.so || true
+
+ # libwayland-egl has been moved to wayland 1.15+
+ rm -f ${D}${libdir}/libwayland-egl*
+ rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc
}
# For the packages that make up the OpenGL interfaces, inject variables so that
# they don't get Debian-renamed (which would remove the -mesa suffix), and
# RPROVIDEs/RCONFLICTs on the generic libgl name.
python __anonymous() {
- pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+ pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+ suffix = ""
+ if "-native" in d.getVar("PN"):
+ suffix = "-native"
for p in (("egl", "libegl", "libegl1"),
("dri", "libgl", "libgl1"),
("gles", "libgles1", "libglesv1-cm1"),
@@ -110,76 +228,81 @@ python __anonymous() {
("gles", "libgles3",)):
if not p[0] in pkgconfig:
continue
- fullp = p[1] + "-mesa"
- pkgs = " ".join(p[1:])
- d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
- d.appendVar("RREPLACES_" + fullp, pkgs)
- d.appendVar("RPROVIDES_" + fullp, pkgs)
- d.appendVar("RCONFLICTS_" + fullp, pkgs)
-
+ mlprefix = d.getVar("MLPREFIX")
+ fullp = mlprefix + p[1] + "-mesa" + suffix
+ mlprefix = d.getVar("MLPREFIX")
+ pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:])
+ d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+ d.appendVar("RREPLACES:" + fullp, pkgs)
+ d.appendVar("RPROVIDES:" + fullp, pkgs)
+ d.appendVar("RCONFLICTS:" + fullp, pkgs)
+
+ d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix)
+
# For -dev, the first element is both the Debian and original name
- fullp += "-dev"
- pkgs = p[1] + "-dev"
- d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
- d.appendVar("RREPLACES_" + fullp, pkgs)
- d.appendVar("RPROVIDES_" + fullp, pkgs)
- d.appendVar("RCONFLICTS_" + fullp, pkgs)
+ fullp = mlprefix + p[1] + "-mesa-dev" + suffix
+ pkgs = " " + mlprefix + p[1] + "-dev" + suffix
+ d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1")
+ d.appendVar("RREPLACES:" + fullp, pkgs)
+ d.appendVar("RPROVIDES:" + fullp, pkgs)
+ d.appendVar("RCONFLICTS:" + fullp, pkgs)
}
python mesa_populate_packages() {
pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
for pkg in pkgs:
- d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
- d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
- d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RPROVIDES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RCONFLICTS:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RREPLACES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
import re
- dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
- dri_pkgs = os.listdir(d.getVar('PKGD', True) + dri_drivers_root)
- lib_name = d.expand("${MLPREFIX}mesa-megadriver")
- for p in dri_pkgs:
- m = re.match('^(.*)_dri\.so$', p)
- if m:
- pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
- d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
- d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
- d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
-
- pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
- do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
+ dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
+ if os.path.isdir(dri_drivers_root):
+ dri_pkgs = sorted(os.listdir(dri_drivers_root))
+ lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+ for p in dri_pkgs:
+ m = re.match(r'^(.*)_dri\.so$', p)
+ if m:
+ pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+ d.appendVar("RPROVIDES:%s" % lib_name, pkg_name)
+ d.appendVar("RCONFLICTS:%s" % lib_name, pkg_name)
+ d.appendVar("RREPLACES:%s" % lib_name, pkg_name)
+
+ pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
+ do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
}
-PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
+PACKAGESPLITFUNCS:prepend = "mesa_populate_packages "
PACKAGES_DYNAMIC += "^mesa-driver-.*"
+PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native"
+
+FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d/00-mesa-defaults.conf"
+FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
+FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
+FILES:libegl-mesa = "${libdir}/libEGL.so.*"
+FILES:libgbm = "${libdir}/libgbm.so.*"
+FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
+FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
+FILES:libgl-mesa = "${libdir}/libGL.so.*"
+FILES:libglapi = "${libdir}/libglapi.so.*"
+FILES:libosmesa = "${libdir}/libOSMesa.so.*"
+FILES:libxatracker = "${libdir}/libxatracker.so.*"
-FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
-FILES_${PN} += "${sysconfdir}/drirc"
-FILES_mesa-megadriver = "${libdir}/dri/*"
-FILES_libegl-mesa = "${libdir}/libEGL.so.*"
-FILES_libgbm = "${libdir}/libgbm.so.*"
-FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
-FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
-FILES_libgl-mesa = "${libdir}/libGL.so.*"
-FILES_libglapi = "${libdir}/libglapi.so.*"
-FILES_libosmesa = "${libdir}/libOSMesa.so.*"
-FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
-FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
-FILES_libxatracker = "${libdir}/libxatracker.so.*"
-
-FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
-FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
-FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
-FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
-FILES_libglapi-dev = "${libdir}/libglapi.*"
-FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
-FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
-FILES_libgles3-mesa-dev = "${includedir}/GLES3"
-FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
-FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
-FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
-FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
+FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so"
+FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
+FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES:libglapi-dev = "${libdir}/libglapi.*"
+FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
+FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
+FILES:libgles3-mesa-dev = "${includedir}/GLES3"
+FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
${libdir}/pkgconfig/xatracker.pc"
-FILES_${PN}-dbg += "${libdir}/dri/.debug/* ${libdir}/egl/.debug/* ${libdir}/gbm/.debug/* ${libdir}/gallium-pipe/.debug"
+# Fix upgrade path from mesa to mesa-megadriver
+RREPLACES:mesa-megadriver = "mesa"
+RCONFLICTS:mesa-megadriver = "mesa"
+RPROVIDES:mesa-megadriver = "mesa"
diff --git a/meta/recipes-graphics/mesa/mesa_10.6.3.bb b/meta/recipes-graphics/mesa/mesa_10.6.3.bb
deleted file mode 100644
index 8c55064fd9..0000000000
--- a/meta/recipes-graphics/mesa/mesa_10.6.3.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require ${BPN}.inc
-
-SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "553e525d2f20ed48fca8f1ec3176fd83"
-SRC_URI[sha256sum] = "58592e07c350cd2e8969b73fa83048c657a39fe2f13f3b88f5e5818fe2e4676d"
-
-#because we cannot rely on the fact that all apps will use pkgconfig,
-#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
-do_install_append() {
- if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
- sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
- fi
-}
diff --git a/meta/recipes-graphics/mesa/mesa_21.2.4.bb b/meta/recipes-graphics/mesa/mesa_21.2.4.bb
new file mode 100644
index 0000000000..4cb7e80eb5
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_21.2.4.bb
@@ -0,0 +1,5 @@
+require ${BPN}.inc
+DRIDRIVERS ??= ""
+DRIDRIVERS:append:x86:class-target = ",r100,r200,nouveau,i965"
+DRIDRIVERS:append:x86-64:class-target = ",r100,r200,nouveau,i965"
+
diff --git a/meta/recipes-graphics/mesa/mesa_git.bb b/meta/recipes-graphics/mesa/mesa_git.bb
deleted file mode 100644
index c0345178c4..0000000000
--- a/meta/recipes-graphics/mesa/mesa_git.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-require ${BPN}.inc
-
-DEFAULT_PREFERENCE = "-1"
-
-SRCREV = "ea0d1f575c214c09ba3df12644a960e86e031766"
-PV = "10.5.4+git${SRCPV}"
-
-SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;branch=10.5"
-
-S = "${WORKDIR}/git"
-
-DEPENDS += "python-mako-native"
-
-inherit pythonnative
-
-#because we cannot rely on the fact that all apps will use pkgconfig,
-#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
-do_install_append() {
- if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
- sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
- fi
-}