LIBDRM_NOUVEAU_REQUIRED=2.4.66
LIBDRM_FREEDRENO_REQUIRED=2.4.74
LIBDRM_VC4_REQUIRED=2.4.69
+LIBDRM_ETNAVIV_REQUIRED=2.4.74
DRI2PROTO_REQUIRED=2.6
DRI3PROTO_REQUIRED=1.0
PRESENTPROTO_REQUIRED=1.0
LIBOMXIL_BELLAGIO_REQUIRED=0.0
LIBVA_REQUIRED=0.38.0
VDPAU_REQUIRED=1.1
-WAYLAND_REQUIRED=1.2.0
+WAYLAND_REQUIRED=1.11
XCB_REQUIRED=1.9.3
XCBDRI2_REQUIRED=1.8
XCBGLX_REQUIRED=1.8.1
PYTHON_MAKO_REQUIRED=0.8.0
LIBSENSORS_REQUIRED=4.0.0
+dnl LLVM versions
+LLVM_REQUIRED_GALLIUM=3.3.0
+LLVM_REQUIRED_OPENCL=3.6.0
+LLVM_REQUIRED_R600=3.6.0
+LLVM_REQUIRED_RADEONSI=3.6.0
+LLVM_REQUIRED_RADV=3.9.0
+LLVM_REQUIRED_SWR=3.6.0
+
dnl Check for progs
AC_PROG_CPP
AC_PROG_CC
AX_GCC_FUNC_ATTRIBUTE([visibility])
AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
AX_GCC_FUNC_ATTRIBUTE([weak])
+AX_GCC_FUNC_ATTRIBUTE([alias])
AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
dnl was explicitly requested.
case "x$enable_static$enable_shared" in
xyesyes)
- AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
- enable_shared=no
+ AC_MSG_ERROR([Cannot enable both static and shared. Building using --enable-shared is strongly recommended])
;;
xnono)
- AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared])
- enable_shared=yes
+ AC_MSG_ERROR([Cannot disable both static and shared. Building using --enable-shared is strongly recommended])
;;
esac
new_llvm_component=$1
driver_name=$2
- LLVM_COMPONENTS="$LLVM_COMPONENTS $new_llvm_component"
+ if $LLVM_CONFIG --components | grep -iqw $new_llvm_component ; then
+ LLVM_COMPONENTS="${LLVM_COMPONENTS} ${new_llvm_component}"
+ else
+ AC_MSG_ERROR([LLVM component '$new_llvm_component' not enabled in your LLVM build. Required by $driver_name.])
+ fi
}
llvm_add_default_components() {
LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
+ # We need to respect LLVM_CFLAGS when compiling LLVM headers.
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LLVM_CFLAGS"
+
AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
[#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+ AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH],
+ [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
+
+ CFLAGS="$save_CFLAGS"
- LLVM_VERSION_PATCH=`echo $LLVM_VERSION | cut -d. -f3 | egrep -o '^[[0-9]]+'`
+ # Only needed for LLVM < 3.6.0
if test -z "$LLVM_VERSION_PATCH"; then
LLVM_VERSION_PATCH=0
fi
- if test -n "${LLVM_VERSION_MAJOR}"; then
+ if test "$LLVM_VERSION_MINOR" -lt 10; then
LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
else
- LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
+ LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}"
fi
- llvm_add_default_components "gallium"
-
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
MESA_LLVM=1
else
}
llvm_check_version_for() {
- if test "${LLVM_VERSION_INT}${LLVM_VERSION_PATCH}" -lt "${1}0${2}${3}"; then
- AC_MSG_ERROR([LLVM $1.$2.$3 or newer is required for $4])
+ if test "x$MESA_LLVM" = x0; then
+ AC_MSG_ERROR([LLVM $1 or newer is required for $2])
+ return
fi
+
+ llvm_target_version_major=`echo $1 | cut -d. -f1 | egrep -o '^[[0-9]]+'`
+ llvm_target_version_minor=`echo $1 | cut -d. -f2 | egrep -o '^[[0-9]]+'`
+ llvm_target_version_patch=`echo $1 | cut -d. -f3 | egrep -o '^[[0-9]]+'`
+
+ if test "$LLVM_VERSION_MAJOR" -gt "$llvm_target_version_major"; then
+ # major > required major
+ # --> OK
+ return
+ fi
+
+ if test "$LLVM_VERSION_MAJOR" -eq "$llvm_target_version_major"; then
+ if test "$LLVM_VERSION_MINOR" -gt "$llvm_target_version_minor"; then
+ # major = required major and
+ # minor > required minor
+ # --> OK
+ return
+ else
+ if test "$LLVM_VERSION_MINOR" -eq "$llvm_target_version_minor"; then
+ if test "$LLVM_VERSION_PATCH" -ge "$llvm_target_version_patch"; then
+ # major = required major and
+ # minor = required minor and
+ # patch >= required patch
+ # --> OK
+ return
+ fi
+ fi
+ fi
+ fi
+
+ AC_MSG_ERROR([LLVM $1 or newer is required for $2])
}
radeon_llvm_check() {
amdgpu_llvm_target_name='amdgpu'
fi
- llvm_check_version_for $2 $3 $4 $1
+ llvm_check_version_for $*
- llvm_add_target $amdgpu_llvm_target_name $1
+ llvm_add_target $amdgpu_llvm_target_name $2
- llvm_add_component "bitreader" $1
- llvm_add_component "ipo" $1
+ llvm_add_default_components $2
+ llvm_add_component "bitreader" $2
+ llvm_add_component "ipo" $2
NEED_RADEON_LLVM=yes
if test "x$have_libelf" != xyes; then
AM_CONDITIONAL(HAVE_LIBSENSORS, test "x$enable_lmsensors" = xyes)
if test "x$enable_lmsensors" = xyes ; then
DEFINES="${DEFINES} -DHAVE_LIBSENSORS=1"
- LIBSENSORS_LDFLAGS="-lsensors"
+ LIBSENSORS_LIBS="-lsensors"
else
- LIBSENSORS_LDFLAGS=""
+ LIBSENSORS_LIBS=""
fi
-AC_SUBST(LIBSENSORS_LDFLAGS)
+AC_SUBST(LIBSENSORS_LIBS)
case "$host_os" in
linux*)
AC_ARG_WITH([gallium-drivers],
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
[comma delimited Gallium drivers list, e.g.
- "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl"
+ "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4,virgl,etnaviv,imx"
@<:@default=r300,r600,svga,swrast@:>@])],
[with_gallium_drivers="$withval"],
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
fi
if test "x$enable_dri" = xyes; then
- if test "$enable_static" = yes; then
- AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
- fi
+ require_dri_shared_libs_and_glapi "DRI"
# not a hard requirement as swrast does not depend on it
if test "x$have_libdrm" = xyes; then
dnl
dnl libGL configuration per driver
dnl
+if test "x$enable_glx" != xno; then
+ PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
+fi
case "x$enable_glx" in
xxlib | xgallium-xlib)
# Xlib-based GLX
;;
xdri)
# DRI-based GLX
- PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
# find the DRI deps for libGL
dri_modules="x11 xext xdamage xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED"
AC_ARG_ENABLE([glx-tls],
[AS_HELP_STRING([--enable-glx-tls],
- [enable TLS support in GLX @<:@default=disabled@:>@])],
+ [enable TLS support in GLX @<:@default=enabled@:>@])],
[GLX_USE_TLS="$enableval"],
- [GLX_USE_TLS=no])
+ [GLX_USE_TLS=yes])
AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
-AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
- [DEFINES="${DEFINES} -DGLX_USE_TLS"])
+if test "x$GLX_USE_TLS" = xyes; then
+ DEFINES="$DEFINES -DGLX_USE_TLS"
+fi
dnl Read-only text section on x86 hardened platforms
AC_ARG_ENABLE([glx-read-only-text],
# Platform specific settings and drivers to build
case "$host_os" in
linux*)
- DEFINES="$DEFINES -DHAVE_ALIAS"
if test "x$enable_dri3" = xyes; then
DEFINES="$DEFINES -DHAVE_DRI3"
fi
;;
esac
;;
- *freebsd* | dragonfly* | *netbsd* | openbsd*)
- DEFINES="$DEFINES -DHAVE_ALIAS"
- ;;
- gnu*)
- DEFINES="$DEFINES -DHAVE_ALIAS"
- ;;
cygwin*)
if test "x$with_dri_drivers" = "xyes"; then
with_dri_drivers="swrast"
fi
;;
darwin*)
- DEFINES="$DEFINES -DGLX_ALIAS_UNSUPPORTED -DBUILDING_MESA"
+ DEFINES="$DEFINES -DBUILDING_MESA"
if test "x$with_dri_drivers" = "xyes"; then
with_dri_drivers="swrast"
fi
;;
xradeon)
PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
- radeon_llvm_check "radv" "3" "9" "0"
+ radeon_llvm_check $LLVM_REQUIRED_RADV "radv"
HAVE_RADEON_VULKAN=yes;
if test "x$with_sha1" == "x"; then
AC_MSG_ERROR([radv vulkan driver requires SHA1])
AC_SUBST([OSMESA_PC_REQ])
AC_SUBST([OSMESA_PC_LIB_PRIV])
+require_dri_shared_libs_and_glapi() {
+ if test "x$enable_static" = xyes; then
+ AC_MSG_ERROR([$1 cannot be build as static library])
+ fi
+
+ if test "x$enable_dri" != xyes; then
+ # There is only a single backend which won't be build/used otherwise.
+ # XXX: Revisit this as the egl/haiku is a thing.
+ AC_MSG_ERROR([$1 requires --enable-dri])
+ fi
+
+ if test "x$enable_shared_glapi" != xyes; then
+ AC_MSG_ERROR([$1 requires --enable-shared-glapi])
+ fi
+}
+
dnl
dnl gbm configuration
dnl
if test "x$enable_gbm" = xyes; then
- if test "x$enable_dri" = xyes; then
- if test "x$enable_shared_glapi" = xno; then
- AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
- fi
- else
- # Strictly speaking libgbm does not require --enable-dri, although
- # both of its backends do. Thus one can build libgbm without any
- # backends if --disable-dri is set.
- # To avoid unnecessary complexity of checking if at least one backend
- # is available when building, just mandate --enable-dri.
- AC_MSG_ERROR([gbm requires --enable-dri])
- fi
+ require_dri_shared_libs_and_glapi "gbm"
fi
AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
# FINISHME: GBM has a number of dependencies which we should add below
dnl
dnl EGL configuration
dnl
-EGL_CLIENT_APIS=""
if test "x$enable_egl" = xyes; then
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
- if test "$enable_static" != yes; then
- if test "x$enable_dri" = xyes; then
- HAVE_EGL_DRIVER_DRI2=1
- if test "x$enable_shared_glapi" = xno; then
- AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
- fi
- if test "x$enable_dri3" = xyes; then
- HAVE_EGL_DRIVER_DRI3=1
- if test "x$enable_shared_glapi" = xno; then
- AC_MSG_ERROR([egl_dri3 requires --enable-shared-glapi])
- fi
- fi
- else
- # Avoid building an "empty" libEGL. Drop/update this
- # when other backends (haiku?) come along.
- AC_MSG_ERROR([egl requires --enable-dri])
- fi
-
- fi
+ require_dri_shared_libs_and_glapi "egl"
fi
AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
AC_SUBST([EGL_LIB_DEPS])
"x$enable_va" = xyes; then
if test x"$enable_dri3" = xyes; then
PKG_CHECK_MODULES([VL], [xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED
- x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
+ xcb-xfixes x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
else
PKG_CHECK_MODULES([VL], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED])
fi
AC_MSG_ERROR([Clover requires libelf])
fi
- llvm_check_version_for "3" "6" "0" "opencl"
+ llvm_check_version_for $LLVM_REQUIRED_OPENCL "opencl"
+ llvm_add_default_components "opencl"
llvm_add_component "all-targets" "opencl"
llvm_add_component "linker" "opencl"
llvm_add_component "instrumentation" "opencl"
dnl
AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
-case "x$enable_opengl$enable_gles1$enable_gles2" in
-x*yes*)
- EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
- ;;
-esac
-
-AC_SUBST([VG_LIB_DEPS])
-AC_SUBST([EGL_CLIENT_APIS])
-
dnl
dnl EGL Platforms configuration
dnl
AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
AM_CONDITIONAL(HAVE_EGL_PLATFORM_ANDROID, echo "$egl_platforms" | grep -q 'android')
-AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
-
AC_SUBST([EGL_NATIVE_PLATFORM])
AC_SUBST([EGL_CFLAGS])
dnl Gallium helper functions
dnl
gallium_require_llvm() {
- if test "x$enable_gallium_llvm" == "xyes"; then
- llvm_check_version_for "3" "3" "0" "gallium"
+ if test "x$enable_gallium_llvm" = "xyes"; then
+ llvm_check_version_for $LLVM_REQUIRED_GALLIUM "gallium"
else
AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
fi
radeon_gallium_llvm_check() {
if test "x$enable_gallium_llvm" != "xyes"; then
- AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
+ AC_MSG_ERROR([--enable-gallium-llvm is required when building $2])
fi
radeon_llvm_check $*
}
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
require_libdrm "r600"
if test "x$enable_opencl" = xyes; then
- radeon_gallium_llvm_check "r600" "3" "6" "0"
+ radeon_gallium_llvm_check $LLVM_REQUIRED_R600 "r600"
llvm_add_component "asmparser" "r600"
llvm_add_component "bitreader" "r600"
PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
PKG_CHECK_MODULES([AMDGPU], [libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED])
require_libdrm "radeonsi"
- radeon_gallium_llvm_check "radeonsi" "3" "6" "0"
+ radeon_gallium_llvm_check $LLVM_REQUIRED_RADEONSI "radeonsi"
require_basic_egl "radeonsi"
;;
xnouveau)
PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
require_libdrm "freedreno"
;;
+ xetnaviv)
+ HAVE_GALLIUM_ETNAVIV=yes
+ PKG_CHECK_MODULES([ETNAVIV], [libdrm_etnaviv >= $LIBDRM_ETNAVIV_REQUIRED])
+ require_libdrm "etnaviv"
+ ;;
+ ximx)
+ HAVE_GALLIUM_IMX=yes
+ ;;
xswrast)
HAVE_GALLIUM_SOFTPIPE=yes
if test "x$MESA_LLVM" = x1 && test "x$enable_gallium_llvm" == "xyes"; then
fi
;;
xswr)
- llvm_check_version_for "3" "6" "0" "swr"
+ llvm_check_version_for $LLVM_REQUIRED_SWR "swr"
gallium_require_llvm "swr"
swr_require_cxx_feature_flags "C++11" "__cplusplus >= 201103L" \
done
fi
+if test "x$enable_gallium_llvm" == "xyes"; then
+ llvm_check_version_for $LLVM_REQUIRED_GALLIUM "gallium"
+ llvm_add_default_components "gallium"
+fi
+
+dnl We need to validate some needed dependencies for renderonly drivers.
+
+if test "x$HAVE_GALLIUM_ETNAVIV" != xyes -a "x$HAVE_GALLIUM_IMX" == xyes ; then
+ AC_ERROR([Building with imx requires etnaviv])
+fi
+
dnl Set LLVM_LIBS - This is done after the driver configuration so
dnl that drivers can add additional components to LLVM_COMPONENTS.
dnl Previously, gallium drivers were updating LLVM_LIBS directly
"x$HAVE_GALLIUM_RADEONSI" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_ETNAVIV, test "x$HAVE_GALLIUM_ETNAVIV" = xyes)
+AM_CONDITIONAL(HAVE_GALLIUM_IMX, test "x$HAVE_GALLIUM_IMX" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
AM_CONDITIONAL(HAVE_GALLIUM_SWR, test "x$HAVE_GALLIUM_SWR" = xyes)
src/gallium/drivers/svga/Makefile
src/gallium/drivers/swr/Makefile
src/gallium/drivers/trace/Makefile
+ src/gallium/drivers/etnaviv/Makefile
+ src/gallium/drivers/imx/Makefile
src/gallium/drivers/vc4/Makefile
src/gallium/drivers/virgl/Makefile
src/gallium/state_trackers/clover/Makefile
src/gallium/targets/xvmc/Makefile
src/gallium/tests/trivial/Makefile
src/gallium/tests/unit/Makefile
+ src/gallium/winsys/etnaviv/drm/Makefile
+ src/gallium/winsys/imx/drm/Makefile
src/gallium/winsys/freedreno/drm/Makefile
src/gallium/winsys/i915/drm/Makefile
src/gallium/winsys/intel/drm/Makefile
echo " EGL platforms: $egl_platforms"
egl_drivers=""
- if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
+ if test "x$enable_dri" != "xno"; then
egl_drivers="$egl_drivers builtin:egl_dri2"
fi
- if test "x$HAVE_EGL_DRIVER_DRI3" != "x"; then
+ if test "x$enable_dri3" != "xno"; then
egl_drivers="$egl_drivers builtin:egl_dri3"
fi