Index: head/graphics/libosmesa/Makefile =================================================================== --- head/graphics/libosmesa/Makefile (revision 443827) +++ head/graphics/libosmesa/Makefile (revision 443828) @@ -1,35 +1,41 @@ # Created by: gahr # $FreeBSD$ PORTNAME= libosmesa PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= Off-Screen Mesa implementation of the OpenGL API USE_XORG= glproto +# As of version 17.0.5 / 17.1.2, the Gallium variant fails to build due to +# incorrectly ordered linker flags. Fortunately, autoreconf fixes the problem. +# Unfortunately, we must reconf before we know if we're doing a Gallium build. +USES= autoreconf +EXTRA_PATCHES= ${PATCHDIR}/configure.ac + .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" CONFIGURE_ARGS+= --disable-dri --disable-egl --disable-gbm \ --disable-gles2 --with-gallium-drivers=swrast MESA_BUILD_WRKSRC= src/util src/compiler src/mapi src/mesa .if "${MESA_LLVM_VER}" != "" CONFIGURE_ARGS+= --enable-osmesa-gallium MESA_BUILD_WRKSRC+= src/gallium MESA_INSTALL_WRKSRC= src/gallium/state_trackers/osmesa src/gallium/targets/osmesa .else CONFIGURE_ARGS+= --enable-osmesa MESA_INSTALL_WRKSRC= src/mesa/drivers/osmesa .endif .include "${MASTERDIR}/Makefile.targets" post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include/GL ${INSTALL_DATA} ${WRKSRC}/include/GL/osmesa.h \ ${STAGEDIR}${PREFIX}/include/GL .include Index: head/graphics/mesa-dri/Makefile =================================================================== --- head/graphics/mesa-dri/Makefile (revision 443827) +++ head/graphics/mesa-dri/Makefile (revision 443828) @@ -1,84 +1,86 @@ # Created by: Eric Anholt # $FreeBSD$ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ RUN_DEPENDS= ${LOCALBASE}/lib/libtxc_dxtn.so:graphics/s2tc USE_XORG= dri2proto dri3proto glproto presentproto x11 xdamage xext \ xfixes xshmfence xv xvmc OPTIONS_DEFINE= TEXTURE VAAPI VDPAU OPTIONS_DEFAULT=TEXTURE OPTIONS_SUB= yes TEXTURE_DESC= Enable texture-float support (patent encumbered) TEXTURE_CONFIGURE_ENABLE= texture-float VAAPI_CONFIGURE_ENABLE= va VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VAAPI_USE= XORG=xcb VDPAU_CONFIGURE_ENABLE= vdpau VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4 DRI_DRIVERS= SWRAST # classic swrast .if "${MESA_LLVM_VER}" != "" GALLIUM_DRIVERS= SWRAST # llvmpipe .else GALLIUM_DRIVERS= "" .endif .if ${ARCH} == amd64 || ${ARCH} == i386 \ || ${ARCH} == powerpc || ${ARCH} == powerpc64 DRI_DRIVERS+= RADEON R200 GALLIUM_DRIVERS+= R300 R600 -.if "${MESA_LLVM_VER}" != "" # until PPC gets LLVM in base +. if "${MESA_LLVM_VER}" != "" # until PPC gets LLVM in base GALLIUM_DRIVERS+= RADEONSI +. endif .endif -.endif .if ${ARCH} == amd64 || ${ARCH} == i386 DRI_DRIVERS+= I915 I965 GALLIUM_DRIVERS+= SVGA +. if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000 +EXTRA_PATCHES+= ${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c +. endif .elif ${ARCH} == armv6 || ${ARCH} == aarch64 GALLIUM_DRIVERS+= FREEDRENO VC4 -.endif - -.if ${ARCH} == armv6 +. if ${ARCH} == armv6 EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in +. endif .endif CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \ --with-gallium-drivers="${GALLIUM_DRIVERS:tl}" .for _d in ${ALL_DRI_DRIVERS} . if ${DRI_DRIVERS:M${_d}} PLIST_SUB+= ${_d}_DRIVER="" . else PLIST_SUB+= ${_d}_DRIVER="@comment " . endif .endfor .for _gd in ${ALL_GALLIUM_DRIVERS} . if ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}_GDRIVER="" . else PLIST_SUB+= ${_gd}_GDRIVER="@comment " . endif .endfor .include "${MASTERDIR}/Makefile.targets" post-install: @${RM} -r ${STAGEDIR}/etc/OpenCL .include Index: head/graphics/mesa-dri/Makefile.common =================================================================== --- head/graphics/mesa-dri/Makefile.common (revision 443827) +++ head/graphics/mesa-dri/Makefile.common (revision 443828) @@ -1,105 +1,105 @@ # Makefile.common - shared code between MesaLib ports. # # !!! Here be dragons !!! (they seem to be everywhere these days) # # Remember to upgrade the following ports everytime you bump MESAVERSION: # # - graphics/libosmesa # - graphics/mesa-dri # - graphics/mesa-libs # - lang/clover # # $FreeBSD$ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 17.1.1 +MESABASEVERSION= 17.1.2 # if there is a subversion, don't include the '-' between 7.11-rc2. MESASUBVERSION= MASTER_SITES= https://mesa.freedesktop.org/archive/ \ https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \ ftp://ftp.freedesktop.org/pub/mesa/ \ ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/ DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX} MAINTAINER= x11@FreeBSD.org COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs LIB_DEPENDS+= libexpat.so:textproc/expat2 .if ${COMPONENT} != osmesa LIB_DEPENDS+= libdrm.so:graphics/libdrm .endif .if ${COMPONENT} != libs LIB_DEPENDS+= libglapi.so:graphics/mesa-libs .endif .if ${ARCH} == amd64 || ${ARCH} == i386 LIB_DEPENDS+= libunwind.so:devel/libunwind .endif .if ${OPSYS} == DragonFly LIB_DEPENDS+= libelf.so:devel/libelf .endif USES+= compiler:c++11-lib bison gettext-tools gmake libtool \ localbase pathfix pkgconfig python:2,build shebangfix tar:xz USE_LDCONFIG= yes GNU_CONFIGURE= yes # only have one port to check with portscout. .if ${PORTNAME} != mesa-dri PORTSCOUT= ignore:1 .endif python_OLD_CMD= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \ src/gallium/drivers/svga/svgadump/svga_dump.py \ src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \ src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \ src/mesa/main/get_*.py src/util/format_srgb.py \ src/amd/*/*.py src/intel/genxml/gen_pack_header.py MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri PATCHDIR= ${MASTERDIR}/files WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION} DESCR= ${.CURDIR}/pkg-descr PLIST= ${.CURDIR}/pkg-plist PKGHELP= ${.CURDIR}/pkg-help PKGINSTALL= ${.CURDIR}/pkg-install PKGDEINSTALL= ${.CURDIR}/pkg-deinstall INSTALL_TARGET= install-strip .include # need LLVM for libEGL wherever possible, but mixing GCC and LLVM breaks Gallium .if ${CHOSEN_COMPILER_TYPE} == clang \ || (${COMPONENT} == libs && ${ARCH} != sparc64) # no working LLVM MESA_LLVM_VER?= 40 .endif .if "${MESA_LLVM_VER}" != "" BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} .if ${COMPONENT} != libs RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} .endif CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib CONFIGURE_ARGS+= --enable-llvm .else CONFIGURE_ARGS+= --disable-llvm .endif # There are issues that need to be fixed to use TLS model "initial-exec" # So stick with "global-dynamic"'s model for now. kan@ is working on a # patch for rtld. We might want to backport global-dynamic or # pthread_setspecific which it uses now by default. But since this # configure switch is going away ... # https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html CONFIGURE_ARGS+= --disable-glx-tls # we don't care about GLes v1 CONFIGURE_ARGS+= --disable-gles1 Index: head/graphics/mesa-dri/Makefile.targets =================================================================== --- head/graphics/mesa-dri/Makefile.targets (revision 443827) +++ head/graphics/mesa-dri/Makefile.targets (revision 443828) @@ -1,42 +1,48 @@ # $FreeBSD$ # # this file holds common targets post-patch: .if ${OPSYS} == FreeBSD @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure +. if ${COMPONENT} == osmesa + @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure.ac +. endif # Disable use of GCC_ATOMICs on i386 to avoid build failures # Clang in 10.3 fails with cannot compile this atomic library call yet 'p_atomic_add' # Clang in 11.0 fails with undefined reference to `__atomic_fetch_add_8` -.if ${ARCH} == "i386" +. if ${ARCH} == "i386" @${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure +. if ${COMPONENT} == osmesa + @${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure.ac +. endif +. endif .endif -.endif # ${OPSYS} @${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \ ${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c pre-build: mesa-pre-build #custom targets so we can build parts of Mesa mesa-pre-build: # do propper gmake target. @cd ${WRKSRC}/src && ${MAKE_CMD} git_sha1.h libglsl_util.la @cd ${WRKSRC}/src/mesa/drivers/dri/common/ && ${MAKE_CMD} @cd ${WRKSRC}/src/loader && ${MAKE_CMD} # libloader.la .if defined(MESA_BUILD_WRKSRC) do-build: . for dir in ${MESA_BUILD_WRKSRC} (cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};) . endfor .endif .if defined(MESA_INSTALL_WRKSRC) do-install: . for dir in ${MESA_INSTALL_WRKSRC} (cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \ ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) . endfor .endif Index: head/graphics/mesa-dri/distinfo =================================================================== --- head/graphics/mesa-dri/distinfo (revision 443827) +++ head/graphics/mesa-dri/distinfo (revision 443828) @@ -1,3 +1,3 @@ -TIMESTAMP = 1495896958 -SHA256 (mesa-17.1.1.tar.xz) = aed503f94c0c1630a162a3e276f4ee12a86764cee4cb92338ea2dea99a04e7ef -SIZE (mesa-17.1.1.tar.xz) = 9854480 +TIMESTAMP = 1496724371 +SHA256 (mesa-17.1.2.tar.xz) = 0937804f43746339b1f9540d8f9c8b4a1bb3d3eec0e4020eac283b8799798239 +SIZE (mesa-17.1.2.tar.xz) = 9837516 Index: head/graphics/mesa-dri/files/configure.ac =================================================================== --- head/graphics/mesa-dri/files/configure.ac (revision 443827) +++ head/graphics/mesa-dri/files/configure.ac (revision 443828) @@ -1,48 +1,39 @@ --- configure.ac.orig 2017-04-01 15:33:36 UTC +++ configure.ac @@ -1121,7 +1121,7 @@ fi AC_SUBST(LIBSENSORS_LIBS) case "$host_os" in -linux*) +linux* | freebsd*) dri3_default=yes ;; *) -@@ -1631,7 +1631,7 @@ dnl platform checks. Set DEFINES and LIB - if test "x$enable_dri" = xyes; then - # Platform specific settings and drivers to build - case "$host_os" in -- linux*) -+ linux* | freebsd*) - if test "x$enable_dri3" = xyes; then - DEFINES="$DEFINES -DHAVE_DRI3" - fi @@ -2002,9 +2002,18 @@ if test "x$enable_opencl" = xyes; then AC_MSG_ERROR([cannot enable OpenCL without Gallium]) fi + if test "x$acv_mesa_CLANG" = xno; then + + GCC_VERSION=`$CC -dumpversion` + if test $? -eq 0; then + GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` + GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` + fi + if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then AC_MSG_ERROR([gcc >= 4.7 is required to build clover]) fi + fi # end of clang test if test "x$have_libclc" = xno; then AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover. @@ -2061,8 +2070,6 @@ if test "x$enable_opencl" = xyes; then CLANG_LIBDIR=${LLVM_LIBDIR} fi CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} - AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"], - [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])]) fi AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes) AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes) Index: head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c =================================================================== --- head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c (nonexistent) +++ head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c (revision 443828) @@ -0,0 +1,37 @@ +# Partial revert of the following commit because the feature check fails on 10.x +# which disables HW accel on gen4+ (the new check occurs for gen6+ as well) + +From 088449487ebcb72561d73ffb91c96302583445a8 Mon Sep 17 00:00:00 2001 +From: Kenneth Graunke +Date: Wed, 22 Mar 2017 15:20:51 -0700 +Subject: i965: Require Kernel 3.6 for Gen4-5 platforms. + +We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013, +commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable +to require it for Gen4-5 as well, bumping the requirement from 2.6.39. + +This is necessary for glClientWaitSync with a timeout to work, which +is a feature we expose on Gen4-5. Without it, we would fall back to an +infinite wait, which is pretty bad. + +See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+. + +Reviewed-by: Matt Turner + +diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c +index c7f111d..bc998ab 100644 +--- src/mesa/drivers/dri/i965/intel_screen.c ++++ src/mesa/drivers/dri/i965/intel_screen.c +@@ -1274,8 +1274,8 @@ intel_init_bufmgr(struct intel_screen *screen) + + drm_intel_bufmgr_gem_enable_fenced_relocs(screen->bufmgr); + +- if (!intel_get_boolean(screen, I915_PARAM_HAS_WAIT_TIMEOUT)) { +- fprintf(stderr, "[%s: %u] Kernel 3.6 required.\n", __func__, __LINE__); ++ if (!intel_get_boolean(screen, I915_PARAM_HAS_RELAXED_DELTA)) { ++ fprintf(stderr, "[%s: %u] Kernel 2.6.39 required.\n", __func__, __LINE__); + return false; + } + +-- +cgit v0.10.2 Property changes on: head/graphics/mesa-dri/files/extra-src_mesa_drivers_dri_i965_intel__screen.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/mesa-dri/files/patch-configure =================================================================== --- head/graphics/mesa-dri/files/patch-configure (revision 443827) +++ head/graphics/mesa-dri/files/patch-configure (revision 443828) @@ -1,50 +1,41 @@ --- configure.orig 2017-05-10 14:14:06 UTC +++ configure @@ -22709,7 +22709,7 @@ fi case "$host_os" in -linux*) +linux* | freebsd*) dri3_default=yes ;; *) -@@ -24108,7 +24108,7 @@ fi - if test "x$enable_dri" = xyes; then - # Platform specific settings and drivers to build - case "$host_os" in -- linux*) -+ linux* | freebsd*) - if test "x$enable_dri3" = xyes; then - DEFINES="$DEFINES -DHAVE_DRI3" - fi @@ -25972,9 +25972,19 @@ if test "x$enable_opencl" = xyes; then as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5 fi + if test "x$acv_mesa_CLANG" = xno; then + + GCC_VERSION=`$CC -dumpversion` + if test $? -eq 0; then + GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` + GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` + fi + if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5 fi +# end of clang test. + fi if test "x$have_libclc" = xno; then as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover. @@ -26037,9 +26047,6 @@ rm -f core conftest.err conftest.$ac_obj CLANG_LIBDIR=${LLVM_LIBDIR} fi CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} - if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then : - as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5 -fi fi if test "x$enable_opencl" = xyes; then HAVE_CLOVER_TRUE=