Index: head/graphics/mesa-dri/Makefile.common =================================================================== --- head/graphics/mesa-dri/Makefile.common (revision 451656) +++ head/graphics/mesa-dri/Makefile.common (revision 451657) @@ -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.10 +MESABASEVERSION= 17.2.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 451656) +++ head/graphics/mesa-dri/Makefile.targets (revision 451657) @@ -1,48 +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" - @${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|GCC_ATOMIC_BUILTINS_SUPPORTED||' ${WRKSRC}/configure . if ${COMPONENT} == osmesa - @${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure.ac + @${REINPLACE_CMD} -e 's|GCC_ATOMIC_BUILTINS_SUPPORTED||' ${WRKSRC}/configure.ac . endif . endif .endif @${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 451656) +++ head/graphics/mesa-dri/distinfo (revision 451657) @@ -1,3 +1,3 @@ -TIMESTAMP = 1506763439 -SHA256 (mesa-17.1.10.tar.xz) = cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb -SIZE (mesa-17.1.10.tar.xz) = 9872168 +TIMESTAMP = 1507459266 +SHA256 (mesa-17.2.2.tar.xz) = cf522244d6a5a1ecde3fc00e7c96935253fe22f808f064cab98be6f3faa65782 +SIZE (mesa-17.2.2.tar.xz) = 10359156 Index: head/graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in =================================================================== --- head/graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in (revision 451656) +++ head/graphics/mesa-dri/files/extra-src_gallium_drivers_vc4_Makefile.in (revision 451657) @@ -1,13 +1,11 @@ -# enable NEON instructions in the compiler when building the NEON codepath -# ---- src/gallium/drivers/vc4/Makefile.in.orig 2017-05-16 13:55:49 UTC +--- src/gallium/drivers/vc4/Makefile.in.orig 2017-10-02 15:49:15 UTC +++ src/gallium/drivers/vc4/Makefile.in -@@ -669,7 +669,7 @@ libvc4_la_SOURCES = $(C_SOURCES) - libvc4_la_LIBADD = $(SIM_LIB) $(VC4_LIBS) libvc4_neon.la +@@ -677,7 +677,7 @@ noinst_LTLIBRARIES = libvc4.la $(am__app + libvc4_la_SOURCES = $(C_SOURCES) + libvc4_la_LIBADD = $(SIM_LIB) $(am__append_5) + @HAVE_ARM_ASM_TRUE@libvc4_neon_la_SOURCES = $(NEON_C_SOURCES) +-@HAVE_ARM_ASM_TRUE@libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -mfpu=neon ++@HAVE_ARM_ASM_TRUE@libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -march=armv7-a -mfpu=neon libvc4_la_LDFLAGS = $(SIM_LDFLAGS) - libvc4_neon_la_SOURCES = vc4_tiling_lt.c --libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -DVC4_BUILD_NEON -+libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -DVC4_BUILD_NEON -march=armv7-a -mfpu=neon EXTRA_DIST = kernel/README all: all-am - Index: head/graphics/mesa-dri/files/patch-configure =================================================================== --- head/graphics/mesa-dri/files/patch-configure (revision 451656) +++ head/graphics/mesa-dri/files/patch-configure (revision 451657) @@ -1,41 +1,41 @@ ---- configure.orig 2017-05-10 14:14:06 UTC +--- configure.orig 2017-10-02 15:49:13 UTC +++ configure -@@ -22709,7 +22709,7 @@ fi +@@ -22846,7 +22846,7 @@ fi case "$host_os" in -linux*) +linux* | freebsd*) dri3_default=yes ;; *) -@@ -25972,9 +25972,19 @@ if test "x$enable_opencl" = xyes; then +@@ -26399,9 +26399,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 +@@ -26464,9 +26474,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= Index: head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c (revision 451656) +++ head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c (revision 451657) @@ -1,16 +1,16 @@ # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627 # ---- src/egl/drivers/dri2/platform_x11.c.orig 2017-05-10 14:13:57 UTC +--- src/egl/drivers/dri2/platform_x11.c.orig 2017-10-02 15:49:02 UTC +++ src/egl/drivers/dri2/platform_x11.c -@@ -1509,7 +1509,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG +@@ -1490,7 +1490,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG if (!getenv("LIBGL_ALWAYS_SOFTWARE")) { #ifdef HAVE_DRI3 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__) + if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE")) +#else if (!getenv("LIBGL_DRI3_DISABLE")) +#endif initialized = dri2_initialize_x11_dri3(drv, disp); #endif Index: head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c (revision 451656) +++ head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c (revision 451657) @@ -1,118 +1,118 @@ Revert the following commit. FreeBSD and DragonFly don't have the required render nodes. ------- From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 29 Jun 2015 12:36:45 +0100 Subject: pipe-loader: drop support for non-render node devices Render nodes have been around for quite some time. Removing support via the master/primary node allows us to clean up the conditional compilation and simplify the build greatly. For example currently we the pipe-loader, which explicitly links against xcb and friends (for X auth) if found at compile-time. That would cause problems as one will be forced to use X/xcb, even if it's a headless system that is used for opencl. v2: Clarify the linking topic in the commit message. Cc: Tom Stellard Signed-off-by: Emil Velikov Reviewed-by: Francisco Jerez ---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-05-10 14:13:57 UTC +--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-10-02 15:49:02 UTC +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c -@@ -209,6 +209,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa +@@ -214,6 +214,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa } static int +open_drm_minor(int minor) +{ + char path[PATH_MAX]; + snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor); + return open(path, O_RDWR, 0); +} + +static int open_drm_render_node_minor(int minor) { char path[PATH_MAX]; -@@ -220,8 +228,15 @@ open_drm_render_node_minor(int minor) +@@ -225,8 +233,15 @@ open_drm_render_node_minor(int minor) int pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev) { - int i, j, fd; + int i, k, fd, num_render_node_devs; + int j = 0; + + struct { + unsigned vendor_id; + unsigned chip_id; + } render_node_devs[DRM_RENDER_NODE_MAX_NODES]; + /* Look for render nodes first */ for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0; i <= DRM_RENDER_NODE_MAX_MINOR; i++) { struct pipe_loader_device *dev; -@@ -235,6 +250,9 @@ pipe_loader_drm_probe(struct pipe_loader +@@ -240,6 +255,9 @@ pipe_loader_drm_probe(struct pipe_loader continue; } + render_node_devs[j].vendor_id = dev->u.pci.vendor_id; + render_node_devs[j].chip_id = dev->u.pci.chip_id; + if (j < ndev) { devs[j] = dev; } else { -@@ -244,6 +262,46 @@ pipe_loader_drm_probe(struct pipe_loader +@@ -249,6 +267,46 @@ pipe_loader_drm_probe(struct pipe_loader j++; } + num_render_node_devs = j; + + /* Next look for drm devices. */ + for (i = 0; i < DRM_MAX_MINOR; i++) { + struct pipe_loader_device *dev; + boolean duplicate = FALSE; + fd = open_drm_minor(i); + if (fd < 0) + continue; + + if (!pipe_loader_drm_probe_fd(&dev, fd)) { + close(fd); + continue; + } + + /* Check to make sure we aren't already accessing this device via + * render nodes. + */ + for (k = 0; k < num_render_node_devs; k++) { + if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id && + dev->u.pci.chip_id == render_node_devs[k].chip_id) { + close(fd); + dev->ops->release(&dev); + duplicate = TRUE; + break; + } + } + + if (duplicate) + continue; + + if (j < ndev) { + devs[j] = dev; + } else { + dev->ops->release(&dev); + } + + j++; + } + return j; } Index: head/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h =================================================================== --- head/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h (revision 451656) +++ head/graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h (revision 451657) @@ -1,38 +1,38 @@ ---- src/gallium/include/pipe/p_config.h.orig 2016-11-10 22:05:17 UTC +--- src/gallium/include/pipe/p_config.h.orig 2017-10-02 15:49:02 UTC +++ src/gallium/include/pipe/p_config.h -@@ -76,6 +76,13 @@ +@@ -77,6 +77,13 @@ #define PIPE_CC_ICL #endif +#if defined(__sparc__) || defined(__sparc64__) +#define PIPE_ARCH_SPARC +#if defined(__sparc64__) +#define PIPE_ARCH_SPARC_64 +#endif +#endif + /* * Processor architecture -@@ -130,7 +137,7 @@ +@@ -131,7 +138,7 @@ #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64) #define PIPE_ARCH_LITTLE_ENDIAN -#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) +#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64) #define PIPE_ARCH_BIG_ENDIAN #endif -@@ -159,6 +166,12 @@ +@@ -160,6 +167,12 @@ #define PIPE_OS_ANDROID #endif +#if defined(__DragonFly__) +#define PIPE_OS_DRAGONFLY +#define PIPE_OS_BSD +#define PIPE_OS_UNIX +#endif + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define PIPE_OS_FREEBSD #define PIPE_OS_BSD Index: head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c (revision 451656) +++ head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c (revision 451657) @@ -1,14 +1,14 @@ # We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and # hope for the best (this alloc is too big but it's only a test) # ---- src/intel/tools/aubinator.c.orig 2017-05-10 14:13:57 UTC +--- src/intel/tools/aubinator.c.orig 2017-10-02 15:49:02 UTC +++ src/intel/tools/aubinator.c -@@ -1221,7 +1221,7 @@ int main(int argc, char *argv[]) +@@ -1237,7 +1237,7 @@ int main(int argc, char *argv[]) /* mmap a terabyte for our gtt space. */ gtt_size = 1ull << 40; gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0); if (gtt == MAP_FAILED) { fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno)); exit(EXIT_FAILURE); Index: head/graphics/mesa-libs/Makefile =================================================================== --- head/graphics/mesa-libs/Makefile (revision 451656) +++ head/graphics/mesa-libs/Makefile (revision 451657) @@ -1,63 +1,64 @@ # Created by: Eric Anholt # $FreeBSD$ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients USE_XORG= dri2proto dri3proto glproto presentproto x11 xcb xdamage xext \ xfixes xshmfence xxf86vm OPTIONS_DEFINE= WAYLAND OPTIONS_SUB= yes WAYLAND_DESC= Enable support for the Wayland platform in EGL +WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland \ libwayland-server.so:graphics/wayland .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" CONFIGURE_ARGS+= --with-dri-drivers="" --with-gallium-drivers="" # libEGL needs gallium enabled which depends on llvm .if "${MESA_LLVM_VER}" != "" .if ${PORT_OPTIONS:MWAYLAND} CONFIGURE_ARGS+= --with-platforms=x11,drm,wayland .else CONFIGURE_ARGS+= --with-platforms=x11,drm .endif PLIST_SUB+= EGL="" .else CONFIGURE_ARGS+= --disable-egl PLIST_SUB+= EGL="@comment " .if ${PORT_OPTIONS:MWAYLAND} IGNORE= option WAYLAND is only valid on platforms with LLVM .endif .endif MESA_BUILD_WRKSRC= src/mapi MESA_INSTALL_WRKSRC= src/mapi .if ${PORT_OPTIONS:MWAYLAND} -MESA_BUILD_WRKSRC+= src/egl/wayland/wayland-drm src/egl/wayland/wayland-egl +MESA_BUILD_WRKSRC+= src/util src/egl/wayland/wayland-drm src/egl/wayland/wayland-egl MESA_INSTALL_WRKSRC+= src/egl/wayland/wayland-egl .endif MESA_BUILD_WRKSRC+= src/gbm src/glx MESA_INSTALL_WRKSRC+= src/gbm src/glx .if "${MESA_LLVM_VER}" != "" MESA_BUILD_WRKSRC+= src/egl MESA_INSTALL_WRKSRC+= src/egl .endif .include "${MASTERDIR}/Makefile.targets" post-install: @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \ ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS .include