Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch
index bd1e863..f908d46 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch
@@ -20,17 +20,18 @@
 
 explictly add EXPAT_LIBS to intel's VULKAN_LIB_DEPS
 
-Upstream-Status: Submitted [mesa-dev@lists.freedesktop.org]
+Upstream-Status: Accepted
+https://cgit.freedesktop.org/mesa/mesa/commit/?id=05fc62d89f59ce19a18bfd4e63a09624910d6caf
 
 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
  src/intel/Makefile.vulkan.am | 1 +
  1 file changed, 1 insertion(+)
 
-diff --git a/src/intel/Makefile.vulkan.am b/src/intel/Makefile.vulkan.am
-index 271b0a5..8fbe2c8 100644
---- a/src/intel/Makefile.vulkan.am
-+++ b/src/intel/Makefile.vulkan.am
+Index: mesa-17.3.6/src/intel/Makefile.vulkan.am
+===================================================================
+--- mesa-17.3.6.orig/src/intel/Makefile.vulkan.am
++++ mesa-17.3.6/src/intel/Makefile.vulkan.am
 @@ -144,6 +144,7 @@ VULKAN_LIB_DEPS = \
  	$(LIBDRM_LIBS) \
  	$(PTHREAD_LIBS) \
@@ -38,7 +39,4 @@
 +	$(EXPAT_LIBS) \
  	-lm
  
- if HAVE_PLATFORM_X11
--- 
-2.7.4
-
+ if HAVE_PLATFORM_ANDROID
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
index eb6ff4f..2444b28 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
@@ -14,12 +14,12 @@
  configure.ac | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
 
-diff --git a/configure.ac b/configure.ac
-index 2c7e636fac..d2b2350739 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2174,12 +2174,7 @@ if test "x$with_platforms" != xauto; then
-     with_egl_platforms=$with_platforms
+Index: mesa-17.3.6/configure.ac
+===================================================================
+--- mesa-17.3.6.orig/configure.ac
++++ mesa-17.3.6/configure.ac
+@@ -1694,12 +1694,7 @@ if test "x$with_platforms" = xauto; then
+     with_platforms=$with_egl_platforms
  fi
  
 -PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
@@ -30,8 +30,5 @@
 -fi
 +AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
  
- # Do per-EGL platform setups and checks
- egl_platforms=`IFS=', '; echo $with_egl_platforms`
--- 
-2.13.0
-
+ PKG_CHECK_EXISTS([wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED], [have_wayland_protocols=yes], [have_wayland_protocols=no])
+ if test "x$have_wayland_protocols" = xyes; then
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch
deleted file mode 100644
index b27a3bc..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 9861437e58fdd0de01193a102608d34e5952953f Mon Sep 17 00:00:00 2001
-From: Christoph Haag <haagch+mesadev@frickel.club>
-Date: Thu, 20 Apr 2017 10:34:18 +0200
-Subject: [PATCH 1/2] ac: fix build after LLVM 5.0 SVN r300718
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take that type
-
-Signed-off-by: Christoph Haag <haagch+mesadev@frickel.club>
-Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-Tested-and-reviewed-by: Mike Lothian <mike@fireburn.co.uk>
----
-Upstream-Status: Backport
-
- src/amd/common/ac_llvm_helper.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp
-index d9ea4b1..11fa809 100644
---- a/src/amd/common/ac_llvm_helper.cpp
-+++ b/src/amd/common/ac_llvm_helper.cpp
-@@ -44,9 +44,13 @@ typedef AttributeSet AttributeList;
- void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
- {
-    llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
-+#if HAVE_LLVM < 0x0500
-    llvm::AttrBuilder B;
-    B.addDereferenceableAttr(bytes);
-    A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1,  B));
-+#else
-+   A->addAttr(llvm::Attribute::getWithDereferenceableBytes(A->getContext(), bytes));
-+#endif
- }
- 
- bool ac_is_sgpr_param(LLVMValueRef arg)
--- 
-2.13.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch
deleted file mode 100644
index 4753c49..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 1f7d752193f02d15d5923cee992e8f46d4c6df1b Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Mon, 28 Aug 2017 13:51:49 +0300
-Subject: [PATCH] configure.ac: Always check for expat
-
-expat was not checked if dri was not built leading to build failure
-in vulkan driver: backport a fix (a combination of multiple commits
-that should end up in 17.3).
-
-Upstream-Status: Backport
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- configure.ac | 15 ++++++---------
- 1 file changed, 6 insertions(+), 9 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index fd346c8aa2..662faecefa 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1777,6 +1777,12 @@ if test "x$with_dri_drivers" = xno; then
-     with_dri_drivers=''
- fi
- 
-+# Check for expat
-+PKG_CHECK_MODULES([EXPAT], [expat])
-+PKG_CHECK_MODULES([EXPAT], [expat],,
-+    [PKG_CHECK_MODULES([EXPAT], [expat21])]
-+)
-+
- dnl If $with_dri_drivers is yes, drivers will be added through
- dnl platform checks. Set DEFINES and LIB_DEPS
- if test "x$enable_dri" = xyes; then
-@@ -1810,15 +1816,6 @@ if test "x$enable_dri" = xyes; then
-         with_dri_drivers="i915 i965 nouveau r200 radeon swrast"
-     fi
- 
--    # Check for expat
--    PKG_CHECK_MODULES([EXPAT], [expat], [],
--        # expat version 2.0 and earlier do not provide expat.pc
--        [AC_CHECK_HEADER([expat.h],[],
--                         [AC_MSG_ERROR([Expat headers required for DRI not found])])
--         AC_CHECK_LIB([expat],[XML_ParserCreate],[],
--                     [AC_MSG_ERROR([Expat library required for DRI not found])])
--         EXPAT_LIBS="-lexpat"])
--
-     # put all the necessary libs together
-     DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
- fi
--- 
-2.14.1
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch
new file mode 100644
index 0000000..6aba785
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch
@@ -0,0 +1,43 @@
+From 4cbecb61682a0ee426faaa03d824fc8fd7aef826 Mon Sep 17 00:00:00 2001
+From: Daniel Stone <daniels@collabora.com>
+Date: Mon, 2 Apr 2018 13:20:34 +0100
+Subject: [PATCH] st/dri: Initialise modifier to INVALID for DRI2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When allocating a buffer for DRI2, set the modifier to INVALID to inform
+the backend that we have no supplied modifiers and it should do its own
+thing. The missed initialisation forced linear, even if the
+implementation had made other decisions.
+
+This resulted in VC4 DRI2 clients failing with:
+  Modifier 0x0 vs. tiling (0x700000000000001) mismatch
+
+Signed-off-by: Daniel Stone <daniels@collabora.com>
+Reported-by: Andreas Müller <schnitzeltony@gmail.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Fixes: 3f8513172ff6 ("gallium/winsys/drm: introduce modifier field to winsys_handle")
+
+Upstream-Status: Backport [1]
+
+[1] https://cgit.freedesktop.org/mesa/mesa/commit/?id=4cbecb61682a0ee426faaa03d824fc8fd7aef826
+---
+ src/gallium/state_trackers/dri/dri2.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
+index 31d17d46c2..58a6757f03 100644
+--- a/src/gallium/state_trackers/dri/dri2.c
++++ b/src/gallium/state_trackers/dri/dri2.c
+@@ -806,6 +806,7 @@ dri2_allocate_textures(struct dri_context *ctx,
+          whandle.handle = buf->name;
+          whandle.stride = buf->pitch;
+          whandle.offset = 0;
++         whandle.modifier = DRM_FORMAT_MOD_INVALID;
+          if (screen->can_share_buffer)
+             whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+          else
+-- 
+2.14.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch
deleted file mode 100644
index ac8caec..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a02a0dfda2712d30ad62b8f0421ec7b8244ba2cb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
-Date: Wed, 10 May 2017 17:26:07 +0900
-Subject: [PATCH 2/2] gallivm: Fix build against LLVM SVN >= r302589
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-deregisterEHFrames doesn't take any parameters anymore.
-
-Reviewed-by: Vedran Miletić <vedran@miletic.net>
-Reviewed-by: Marek Olšák <marek.olsak@amd.com>
----
-Upstream-Status: Backport
-
- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
-index 2a388cb..0e4a531 100644
---- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
-+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
-@@ -342,14 +342,20 @@ class DelegatingJITMemoryManager : public BaseMemoryManager {
-       virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
-          mgr()->registerEHFrames(Addr, LoadAddr, Size);
-       }
--      virtual void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
--         mgr()->deregisterEHFrames(Addr, LoadAddr, Size);
--      }
- #else
-       virtual void registerEHFrames(llvm::StringRef SectionData) {
-          mgr()->registerEHFrames(SectionData);
-       }
- #endif
-+#if HAVE_LLVM >= 0x0500
-+      virtual void deregisterEHFrames() {
-+         mgr()->deregisterEHFrames();
-+      }
-+#elif HAVE_LLVM >= 0x0304
-+      virtual void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
-+         mgr()->deregisterEHFrames(Addr, LoadAddr, Size);
-+      }
-+#endif
-       virtual void *getPointerToNamedFunction(const std::string &Name,
-                                               bool AbortOnFailure=true) {
-          return mgr()->getPointerToNamedFunction(Name, AbortOnFailure);
--- 
-2.13.3
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch
new file mode 100644
index 0000000..0b4aabf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch
@@ -0,0 +1,32 @@
+From 18c3e684a8259a0644214f88c7ead7fa31573fd9 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 29 Dec 2017 10:27:59 -0200
+Subject: [PATCH] Use Python 3 to execute the scripts
+Organization: O.S. Systems Software LTDA.
+
+The MESA build system uses Python 2 but as OE-Core has moved away from
+it, we change it to use Python 3 instead.
+
+Upstream-Status: Inappropriate [ configuration ]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b107f04c2e..055546142d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -114,7 +114,7 @@ AC_PROG_CXX
+ AM_PROG_CC_C_O
+ AM_PROG_AS
+ AX_CHECK_GNU_MAKE
+-AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
++AC_CHECK_PROGS([PYTHON2], [python3.5 python3 python])
+ AC_PROG_SED
+ AC_PROG_MKDIR_P
+ 
+-- 
+2.15.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch
index aa33a1e..fd79991 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch
@@ -1,18 +1,24 @@
-When building llvm from git or svn it embeds the svn/git revision into internal version string
+From: Otavio Salvador <otavio@ossystems.com.br>
+Subject: [PATCH] Properly get LLVM version when using LLVM Git releases
 
-$ /mnt/a/oe/build/tmp/work/corei7-64-bec-linux/mesa/2_17.1.5-r0/recipe-sysroot/usr/lib/llvm5.0/llvm-config-host --version
+$ llvm-config-host --version
 5.0.0git-9a5c333388c
 
-We need to ignore everything after 5.0.0 which is what the cut cmd is doing
+We need to ignore everything after 5.0.0 which is what the cut cmd is
+doing
 
 Upstream-Status: Pending
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
-Index: mesa-17.1.5/configure.ac
-===================================================================
---- mesa-17.1.5.orig/configure.ac
-+++ mesa-17.1.5/configure.ac
-@@ -967,7 +967,7 @@ strip_unwanted_llvm_flags() {
+diff --git a/configure.ac b/configure.ac
+index a02173f244..b107f04c2e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -995,7 +995,7 @@ strip_unwanted_llvm_flags() {
  
  llvm_set_environment_variables() {
      if test "x$LLVM_CONFIG" != xno; then
@@ -21,12 +27,15 @@
          LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
          LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
          LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
-@@ -2560,7 +2560,7 @@ if test "x$enable_llvm" = xyes; then
+@@ -2644,7 +2644,7 @@ detect_old_buggy_llvm() {
+     dnl ourselves.
      dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
-     if test "x$enable_llvm_shared_libs" = xyes; then
-         dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
--        LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
-+        LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version|cut -c1-5`
-         AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
+     dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
+-    LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
++    LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version | cut -c1-5`
+     AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
  
-         if test "x$llvm_have_one_so" = xyes; then
+     if test "x$llvm_have_one_so" = xyes; then
+-- 
+2.15.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
deleted file mode 100644
index 0280ee8..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/replace_glibc_check_with_linux.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-endianness check is OS wide and not specific to libc
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- src/util/u_endian.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/util/u_endian.h b/src/util/u_endian.h
-index b9d563d..2d5eab9 100644
---- a/src/util/u_endian.h
-+++ b/src/util/u_endian.h
-@@ -27,7 +27,7 @@
- #ifndef U_ENDIAN_H
- #define U_ENDIAN_H
- 
--#if defined(__GLIBC__) || defined(ANDROID)
-+#if defined(__linux__)
- #include <endian.h>
- 
- #if __BYTE_ORDER == __LITTLE_ENDIAN
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/vulkan-mkdir.patch b/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/vulkan-mkdir.patch
deleted file mode 100644
index 15ee5ee..0000000
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/files/vulkan-mkdir.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From c78979fd95a1c4f732f7e6edf0f32c524e5955b8 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 12 Jul 2017 17:10:07 +0100
-Subject: [PATCH] src/intel/Makefile.vulkan.am: create target directories when
- required
-
-In out-of-tree builds src/intel/vulkan won't exist, so always create it before
-writing into it.
-
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- src/intel/Makefile.vulkan.am | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/intel/Makefile.vulkan.am b/src/intel/Makefile.vulkan.am
-index 3857a5dc62..26e9cd410c 100644
---- a/src/intel/Makefile.vulkan.am
-+++ b/src/intel/Makefile.vulkan.am
-@@ -44,11 +44,13 @@ EXTRA_DIST += \
- 	vulkan/TODO
- 
- vulkan/dev_icd.json : vulkan/dev_icd.json.in
-+	$(MKDIR_GEN)
- 	$(AM_V_GEN) $(SED) \
- 		-e "s#@build_libdir@#${abs_top_builddir}/${LIB_DIR}#" \
- 		< $(srcdir)/vulkan/dev_icd.json.in > $@
- 
- vulkan/intel_icd.@host_cpu@.json : vulkan/intel_icd.json.in
-+	$(MKDIR_GEN)
- 	$(AM_V_GEN) $(SED) \
- 		-e "s#@install_libdir@#${libdir}#" \
- 		< $(srcdir)/vulkan/intel_icd.json.in > $@
--- 
-2.11.0
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.1.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb
similarity index 100%
rename from import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.1.7.bb
rename to import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
index 4f31ed2..b501b7e 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa.inc
@@ -16,9 +16,15 @@
 
 DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native"
 EXTRANATIVEPATH += "chrpath-native"
-PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
+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 autotools pkgconfig gettext distro_features_check
+inherit autotools pkgconfig python3native gettext distro_features_check
 
 ANY_OF_DISTRO_FEATURES = "opengl vulkan"
 
@@ -34,7 +40,7 @@
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
 		   "
 
@@ -45,7 +51,7 @@
 # "x11" requires "opengl"
 PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
 PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
-PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
 
 DRIDRIVERS = "swrast"
 DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
@@ -59,7 +65,7 @@
 VULKAN_DRIVERS = ""
 VULKAN_DRIVERS_append_x86 = ",intel"
 VULKAN_DRIVERS_append_x86-64 = ",intel"
-PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers"
+PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers, python3-mako-native"
 
 PACKAGECONFIG[opengl] = "--enable-opengl, --disable-opengl"
 
@@ -77,13 +83,13 @@
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}"
 GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
 PACKAGECONFIG[r600] = ""
-GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
+GALLIUMDRIVERS_LLVM33_ENABLED = "${@oe.utils.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]      = "--enable-texture-float --with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
-MESA_LLVM_RELEASE ?= "5.0"
+MESA_LLVM_RELEASE ?= "6.0"
 PACKAGECONFIG[gallium-llvm] = "--enable-llvm --enable-llvm-shared-libs, --disable-llvm, llvm${MESA_LLVM_RELEASE} llvm-native \
                                ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
 export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
@@ -99,9 +105,6 @@
 
 CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS"
 
-# Multiple virtual/gl providers being built breaks staging
-EXCLUDE_FROM_WORLD = "1"
-
 # Remove the mesa dependency on mesa-dev, as mesa is empty
 RDEPENDS_${PN}-dev = ""
 
diff --git a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.1.7.bb b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb
similarity index 66%
rename from import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.1.7.bb
rename to import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb
index 39cfce9..2d3fd3c 100644
--- a/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.1.7.bb
+++ b/import-layers/yocto-poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb
@@ -1,20 +1,18 @@
 require ${BPN}.inc
 
 SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
-           file://replace_glibc_check_with_linux.patch \
            file://disable-asm-on-non-gcc.patch \
+	   file://Use-Python-3-to-execute-the-scripts.patch \
            file://0001-Use-wayland-scanner-in-the-path.patch \
            file://0002-hardware-gloat.patch \
-           file://vulkan-mkdir.patch \
            file://llvm-config-version.patch \
-           file://0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch \
-           file://0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch \
            file://0001-winsys-svga-drm-Include-sys-types.h.patch \
-           file://0001-configure.ac-Always-check-for-expat.patch \
            file://0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch \
+           file://0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch \
            "
-SRC_URI[md5sum] = "e40bb428a263bd28cbf6478dae45b207"
-SRC_URI[sha256sum] = "69f472a874b1122404fa0bd13e2d6bf87eb3b9ad9c21d2f39872a96d83d9e5f5"
+
+SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
+SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
 
 #because we cannot rely on the fact that all apps will use pkgconfig,
 #make eglplatform.h independent of MESA_EGL_NO_X11_HEADER