kumquat-buildroot/package/mesa3d/mesa3d.mk

220 lines
6.1 KiB
Makefile
Raw Normal View History

################################################################################
#
# mesa3d
#
################################################################################
2009-02-24 14:29:59 +01:00
package/mesa3d-headers: new package Some OpenGL/EGL/GLES/VG providers do not provide the corresponding headers, and rely on using "the headers provided by the distribution". In our case, we can not rely on such headers, because we are not a distribution, and we have no way to provide those headers (not even speaking about relying on the headers provided by hte host distribution, because they might well not be installed at all). Also, we can not rely on another package to provide those headers, because we can only have one provider enabled in any configuration. The Khronos group provides such headers, and they are the reference headers, but we can not realy use them: - most of them are not packaged: they are not versioned and not provided in a tarball, but as separately downloadable files; - those headers are anyway incomplete: there are headers not provided by Khronos, like GL.h Instead, we rely on mesa3d to provide those headers: mesa3d has all the headers we need. Modifying the existing mesa3d package would not be easy; we'd have to differentiate whther we need only the headers or the full package. The meas3d Config.in and .mk are already quite non-trivial that adding such a feature would render them even more illegible. So, we introduce mea3d-headers as a new package, that is in fact just mesa3d with a much simplified Config.in and .mk, that other OpenXXX providers may select if they do not provide the OpenXXX headers. Note: we're not installing GLES3 headers, because what Buildroot currently calls libgles is in fact libgles2; we have no way to specify that we have libgles3. So, we just install headers for GLES and GLES2. [Thomas: - Wrap Config.in help text to a reasonable length. - Don't rely on mesa3d to provide mesa3d-headers: they should be mutually exclusive. Instead, error out if both packages are selected. - Take into account the update of mesa3d to 10.4.5. - Don't copy each header file individually, use a cp -dpfr call to copy entires header files directories.] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-10 21:01:10 +01:00
# When updating the version, please also update mesa3d-headers
MESA3D_VERSION = 17.2.2
MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
MESA3D_SITE = https://mesa.freedesktop.org/archive
MESA3D_LICENSE = MIT, SGI, Khronos
MESA3D_LICENSE_FILES = docs/license.html
MESA3D_AUTORECONF = YES
MESA3D_INSTALL_STAGING = YES
2009-02-24 14:29:59 +01:00
MESA3D_PROVIDES =
MESA3D_DEPENDENCIES = \
host-bison \
host-flex \
expat \
libdrm \
zlib
# Disable assembly usage.
MESA3D_CONF_OPTS = --disable-asm
# The Sourcery MIPS toolchain has a special (non-upstream) feature to
# have "compact exception handling", which unfortunately breaks with
# mesa3d, so we disable it here by passing -mno-compact-eh.
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS),y)
MESA3D_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -mno-compact-eh"
MESA3D_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -mno-compact-eh"
endif
ifeq ($(BR2_PACKAGE_XORG7),y)
MESA3D_DEPENDENCIES += \
xproto_xf86driproto \
xproto_dri2proto \
xproto_glproto \
xlib_libX11 \
xlib_libXext \
xlib_libXdamage \
xlib_libXfixes \
libxcb
MESA3D_CONF_OPTS += --enable-glx --disable-mangling
# quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
MESA3D_CONF_OPTS += --enable-xa
else
MESA3D_CONF_OPTS += --disable-xa
endif
else
MESA3D_CONF_OPTS += \
--disable-glx \
--disable-xa
endif
# Drivers
#Gallium Drivers
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV) += etnaviv imx
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU) += nouveau
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600) += r600
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA) += svga
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST) += swrast
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4) += vc4
MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL) += virgl
# DRI Drivers
MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915) += i915
MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965) += i965
MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_NOUVEAU) += nouveau
MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
package/mesa3d: add support for Intel Vulkan driver The Vulkan intel driver depends on the i965 dri driver: https://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=12.0#n1653 and a sha1 implementation: https://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=12.0#n1656 The Vulkan driver needs linux/memfd.h https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_allocator.c?h=12.0#n30 which is not available in kernel headers older than 3.18: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/include/uapi/linux/memfd.h?id=refs/tags/v3.18.36 The Vulkan driver makes use of ifunc https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_entrypoints_gen.py?h=12.0#n287 which is not available on uClibc: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config.gcc;h=82cc9a9959b5ab57c0b8779e054b80cdb95f169b;hb=gcc-6-branch#l1485 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e6cdd6b1755033e8f416efaa4334d1294c0a43c6 The Vulkan driver makes use of static_assert https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_private.h?h=12.0#n153 Compiling the Vulkan driver with uClibc and musl fails, therefore this driver is glibc-only. Although the configure script does not check for dri3 support if the Intel Vulkan driver is enabled it needs it nonetheless: https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_wsi_x11.c?h=12.0#n682 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-17 18:27:55 +02:00
# Vulkan Drivers
MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL) += intel
ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
MESA3D_CONF_OPTS += \
--without-gallium-drivers \
--disable-gallium-extra-hud
else
MESA3D_CONF_OPTS += \
--enable-shared-glapi \
--with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
--enable-gallium-extra-hud
endif
ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
MESA3D_CONF_OPTS += \
--without-dri-drivers --disable-dri3
else
ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE)$(BR2_PACKAGE_XPROTO_DRI3PROTO),yy)
MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
MESA3D_CONF_OPTS += --enable-dri3
else
MESA3D_CONF_OPTS += --disable-dri3
endif
ifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y)
MESA3D_DEPENDENCIES += xlib_libXxf86vm
endif
MESA3D_CONF_OPTS += \
--enable-shared-glapi \
--enable-driglx-direct \
--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
endif
package/mesa3d: add support for Intel Vulkan driver The Vulkan intel driver depends on the i965 dri driver: https://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=12.0#n1653 and a sha1 implementation: https://cgit.freedesktop.org/mesa/mesa/tree/configure.ac?h=12.0#n1656 The Vulkan driver needs linux/memfd.h https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_allocator.c?h=12.0#n30 which is not available in kernel headers older than 3.18: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/include/uapi/linux/memfd.h?id=refs/tags/v3.18.36 The Vulkan driver makes use of ifunc https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_entrypoints_gen.py?h=12.0#n287 which is not available on uClibc: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config.gcc;h=82cc9a9959b5ab57c0b8779e054b80cdb95f169b;hb=gcc-6-branch#l1485 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e6cdd6b1755033e8f416efaa4334d1294c0a43c6 The Vulkan driver makes use of static_assert https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_private.h?h=12.0#n153 Compiling the Vulkan driver with uClibc and musl fails, therefore this driver is glibc-only. Although the configure script does not check for dri3 support if the Intel Vulkan driver is enabled it needs it nonetheless: https://cgit.freedesktop.org/mesa/mesa/tree/src/intel/vulkan/anv_wsi_x11.c?h=12.0#n682 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-17 18:27:55 +02:00
ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
MESA3D_CONF_OPTS += \
--without-vulkan-drivers
else
MESA3D_CONF_OPTS += \
--with-vulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
endif
# APIs
ifeq ($(BR2_PACKAGE_MESA3D_OSMESA),y)
MESA3D_CONF_OPTS += --enable-osmesa
else
MESA3D_CONF_OPTS += --disable-osmesa
endif
# Always enable OpenGL:
# - it is needed for GLES (mesa3d's ./configure is a bit weird)
MESA3D_CONF_OPTS += --enable-opengl --enable-dri
# libva and mesa3d have a circular dependency
# we do not need libva support in mesa3d, therefore disable this option
MESA3D_CONF_OPTS += --disable-va
# libGL is only provided for a full xorg stack
ifeq ($(BR2_PACKAGE_XORG7),y)
MESA3D_PROVIDES += libgl
else
define MESA3D_REMOVE_OPENGL_HEADERS
rm -rf $(STAGING_DIR)/usr/include/GL/
endef
MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_HEADERS
endif
ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
MESA3D_PLATFORMS = drm
else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4),y)
MESA3D_PLATFORMS = drm
else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
MESA3D_PLATFORMS = drm
else ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL),y)
MESA3D_PLATFORMS = drm
endif
ifeq ($(BR2_PACKAGE_WAYLAND),y)
MESA3D_DEPENDENCIES += wayland wayland-protocols
MESA3D_PLATFORMS += wayland
endif
ifeq ($(BR2_PACKAGE_XORG7),y)
MESA3D_PLATFORMS += x11
endif
MESA3D_CONF_OPTS += \
--with-platforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
MESA3D_PROVIDES += libegl
MESA3D_CONF_OPTS += \
--enable-gbm \
--enable-egl
else
MESA3D_CONF_OPTS += \
--disable-egl
endif
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
MESA3D_PROVIDES += libgles
MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
else
MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
endif
package/mesa3d: allow to enable OpenGL texture float support While testing on a PC target with an HD6310 graphic card, the OpenGL support was in "compat profile" mode (i.e OpenGL 2.1). Extended renderer info (GLX_MESA_query_renderer): Vendor: X.Org (0x1002) Device: AMD PALM (DRM 2.49.0 / 4.10.4) (0x9802) Version: 17.0.2 Accelerated: yes Video memory: 256MB Unified memory: no Preferred profile: compat (0x2) Max core profile version: 0.0 Max compat profile version: 2.1 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 2.0 OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD PALM (DRM 2.49.0 / 4.10.4) OpenGL version string: 2.1 Mesa 17.0.2 OpenGL shading language version string: 1.30 OpenGL ES profile version string: OpenGL ES 2.0 Mesa 17.0.2 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16 It turn out that texture float support was missing... Extended renderer info (GLX_MESA_query_renderer): Vendor: X.Org (0x1002) Device: AMD PALM (DRM 2.49.0 / 4.10.4) (0x9802) Version: 17.0.2 Accelerated: yes Video memory: 256MB Unified memory: no Preferred profile: core (0x1) Max core profile version: 3.3 Max compat profile version: 3.0 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.0 OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD PALM (DRM 2.49.0 / 4.10.4) OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.0.2 OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL version string: 3.0 Mesa 17.0.2 OpenGL shading language version string: 1.30 OpenGL context flags: (none) Add a new option to let the user disable this feature if it doesn't comply to the SGI license. Add docs/patents.txt to MESA3D_LICENSE_FILES Signed-off-by: Romain Naour <romain.naour@gmail.com> Cc: Bernd Kuhls <bernd.kuhls@t-online.de> [Thomas: - rewrap Config.in help text - add note that not all drivers are affected by the texture float option.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-26 18:28:49 +02:00
ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_TEXTURE_FLOAT),y)
MESA3D_CONF_OPTS += --enable-texture-float
MESA3D_LICENSE_FILES += docs/patents.txt
else
MESA3D_CONF_OPTS += --disable-texture-float
endif
ifeq ($(BR2_PACKAGE_XLIB_LIBXVMC),y)
MESA3D_DEPENDENCIES += xlib_libXvMC
MESA3D_CONF_OPTS += --enable-xvmc
else
MESA3D_CONF_OPTS += --disable-xvmc
endif
ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
MESA3D_CONF_OPTS += --enable-libunwind
MESA3D_DEPENDENCIES += libunwind
else
MESA3D_CONF_OPTS += --disable-libunwind
endif
ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
MESA3D_DEPENDENCIES += libvdpau
MESA3D_CONF_OPTS += --enable-vdpau
else
MESA3D_CONF_OPTS += --disable-vdpau
endif
ifeq ($(BR2_PACKAGE_LM_SENSORS),y)
MESA3D_CONF_OPTS += --enable-lmsensors
MESA3D_DEPENDENCIES += lm-sensors
else
MESA3D_CONF_OPTS += --disable-lmsensors
endif
# Avoid automatic search of llvm-config
MESA3D_CONF_OPTS += --with-llvm-prefix=$(STAGING_DIR)/usr/bin
$(eval $(autotools-package))