diff options
author | Jussi Kukkonen <jussi.kukkonen@intel.com> | 2017-08-28 15:46:35 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-30 11:14:26 +0100 |
commit | d935a1a3f0c11d180b3080801fa836b3ad12651f (patch) | |
tree | 30b7a3344e83cc1652617815c5f148f13cc1d69f /meta/recipes-graphics/mesa | |
parent | f9c451b71ad0093b4c2abedf7f3d714c5a3af5a5 (diff) | |
download | poky-d935a1a3f0c11d180b3080801fa836b3ad12651f.tar.gz |
mesa: Support building without opengl
mesa can build certain things without opengl: most importantly vulkan
drivers.
Add comments on the dependencies between the packageconfigs. Also add
a few dependencies to packageconfigs. Modify default packageconfig to
do the reasonable thing based on distro features.
Add a backported patch to fix the build with --disable-opengl. Fix
do_install_append() so it works even if dri drivers are not built.
(From OE-Core rev: 48d39cf43b59c96d4deca783ec66686f5c8cd3e7)
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/mesa')
-rw-r--r-- | meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch | 51 | ||||
-rw-r--r-- | meta/recipes-graphics/mesa/mesa.inc | 23 | ||||
-rw-r--r-- | meta/recipes-graphics/mesa/mesa_17.1.7.bb | 1 |
3 files changed, 68 insertions, 7 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch b/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch new file mode 100644 index 0000000000..4753c49d22 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-configure.ac-Always-check-for-expat.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 1f7d752193f02d15d5923cee992e8f46d4c6df1b Mon Sep 17 00:00:00 2001 | ||
2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
3 | Date: Mon, 28 Aug 2017 13:51:49 +0300 | ||
4 | Subject: [PATCH] configure.ac: Always check for expat | ||
5 | |||
6 | expat was not checked if dri was not built leading to build failure | ||
7 | in vulkan driver: backport a fix (a combination of multiple commits | ||
8 | that should end up in 17.3). | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
12 | --- | ||
13 | configure.ac | 15 ++++++--------- | ||
14 | 1 file changed, 6 insertions(+), 9 deletions(-) | ||
15 | |||
16 | diff --git a/configure.ac b/configure.ac | ||
17 | index fd346c8aa2..662faecefa 100644 | ||
18 | --- a/configure.ac | ||
19 | +++ b/configure.ac | ||
20 | @@ -1777,6 +1777,12 @@ if test "x$with_dri_drivers" = xno; then | ||
21 | with_dri_drivers='' | ||
22 | fi | ||
23 | |||
24 | +# Check for expat | ||
25 | +PKG_CHECK_MODULES([EXPAT], [expat]) | ||
26 | +PKG_CHECK_MODULES([EXPAT], [expat],, | ||
27 | + [PKG_CHECK_MODULES([EXPAT], [expat21])] | ||
28 | +) | ||
29 | + | ||
30 | dnl If $with_dri_drivers is yes, drivers will be added through | ||
31 | dnl platform checks. Set DEFINES and LIB_DEPS | ||
32 | if test "x$enable_dri" = xyes; then | ||
33 | @@ -1810,15 +1816,6 @@ if test "x$enable_dri" = xyes; then | ||
34 | with_dri_drivers="i915 i965 nouveau r200 radeon swrast" | ||
35 | fi | ||
36 | |||
37 | - # Check for expat | ||
38 | - PKG_CHECK_MODULES([EXPAT], [expat], [], | ||
39 | - # expat version 2.0 and earlier do not provide expat.pc | ||
40 | - [AC_CHECK_HEADER([expat.h],[], | ||
41 | - [AC_MSG_ERROR([Expat headers required for DRI not found])]) | ||
42 | - AC_CHECK_LIB([expat],[XML_ParserCreate],[], | ||
43 | - [AC_MSG_ERROR([Expat library required for DRI not found])]) | ||
44 | - EXPAT_LIBS="-lexpat"]) | ||
45 | - | ||
46 | # put all the necessary libs together | ||
47 | DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" | ||
48 | fi | ||
49 | -- | ||
50 | 2.14.1 | ||
51 | |||
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 3bb3cf401f..4f31ed255c 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
@@ -20,7 +20,7 @@ PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/ | |||
20 | 20 | ||
21 | inherit autotools pkgconfig gettext distro_features_check | 21 | inherit autotools pkgconfig gettext distro_features_check |
22 | 22 | ||
23 | REQUIRED_DISTRO_FEATURES = "opengl" | 23 | ANY_OF_DISTRO_FEATURES = "opengl vulkan" |
24 | 24 | ||
25 | PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \ | 25 | PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \ |
26 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)}" | 26 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)}" |
@@ -32,20 +32,25 @@ EXTRA_OECONF = "--enable-shared-glapi \ | |||
32 | --with-llvm-prefix=${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE} \ | 32 | --with-llvm-prefix=${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE} \ |
33 | --with-platforms='${PLATFORMS}'" | 33 | --with-platforms='${PLATFORMS}'" |
34 | 34 | ||
35 | PACKAGECONFIG ??= "gbm egl gles dri \ | 35 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \ |
36 | ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11 vulkan', d)} \ | 36 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri', '', d)} \ |
37 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ | 37 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} \ |
38 | " | 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ |
39 | " | ||
40 | |||
41 | # "gbm" requires "dri", "opengl" | ||
39 | PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" | 42 | PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" |
40 | 43 | ||
41 | X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes" | 44 | X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes" |
45 | # "x11" requires "opengl" | ||
42 | PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" | 46 | PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" |
43 | PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" | 47 | PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" |
44 | PACKAGECONFIG[wayland] = ",,wayland-native wayland" | 48 | PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm" |
45 | 49 | ||
46 | DRIDRIVERS = "swrast" | 50 | DRIDRIVERS = "swrast" |
47 | DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" | 51 | DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" |
48 | DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" | 52 | DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" |
53 | # "dri" requires "opengl" | ||
49 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" | 54 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" |
50 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" | 55 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" |
51 | 56 | ||
@@ -56,8 +61,12 @@ VULKAN_DRIVERS_append_x86 = ",intel" | |||
56 | VULKAN_DRIVERS_append_x86-64 = ",intel" | 61 | VULKAN_DRIVERS_append_x86-64 = ",intel" |
57 | PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers" | 62 | PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers" |
58 | 63 | ||
64 | PACKAGECONFIG[opengl] = "--enable-opengl, --disable-opengl" | ||
65 | |||
66 | # "gles" requires "opengl" | ||
59 | PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" | 67 | PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" |
60 | 68 | ||
69 | # "egl" requires "dri", "opengl" | ||
61 | PACKAGECONFIG[egl] = "--enable-egl, --disable-egl" | 70 | PACKAGECONFIG[egl] = "--enable-egl, --disable-egl" |
62 | 71 | ||
63 | PACKAGECONFIG[etnaviv] = "" | 72 | PACKAGECONFIG[etnaviv] = "" |
@@ -121,7 +130,7 @@ do_install_append () { | |||
121 | 130 | ||
122 | # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used | 131 | # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used |
123 | rm -f ${D}${sysconfdir}/drirc | 132 | rm -f ${D}${sysconfdir}/drirc |
124 | chrpath --delete ${D}${libdir}/dri/*_dri.so | 133 | chrpath --delete ${D}${libdir}/dri/*_dri.so || true |
125 | } | 134 | } |
126 | 135 | ||
127 | # For the packages that make up the OpenGL interfaces, inject variables so that | 136 | # For the packages that make up the OpenGL interfaces, inject variables so that |
diff --git a/meta/recipes-graphics/mesa/mesa_17.1.7.bb b/meta/recipes-graphics/mesa/mesa_17.1.7.bb index 494cdc6d83..a50f32c025 100644 --- a/meta/recipes-graphics/mesa/mesa_17.1.7.bb +++ b/meta/recipes-graphics/mesa/mesa_17.1.7.bb | |||
@@ -10,6 +10,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ | |||
10 | file://0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch \ | 10 | file://0001-ac-fix-build-after-LLVM-5.0-SVN-r300718.patch \ |
11 | file://0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch \ | 11 | file://0002-gallivm-Fix-build-against-LLVM-SVN-r302589.patch \ |
12 | file://0001-winsys-svga-drm-Include-sys-types.h.patch \ | 12 | file://0001-winsys-svga-drm-Include-sys-types.h.patch \ |
13 | file://0001-configure.ac-Always-check-for-expat.patch \ | ||
13 | " | 14 | " |
14 | SRC_URI[md5sum] = "e40bb428a263bd28cbf6478dae45b207" | 15 | SRC_URI[md5sum] = "e40bb428a263bd28cbf6478dae45b207" |
15 | SRC_URI[sha256sum] = "69f472a874b1122404fa0bd13e2d6bf87eb3b9ad9c21d2f39872a96d83d9e5f5" | 16 | SRC_URI[sha256sum] = "69f472a874b1122404fa0bd13e2d6bf87eb3b9ad9c21d2f39872a96d83d9e5f5" |