@@ -, +, @@ --- graphics/mesa-dri/Makefile | 2 +- graphics/mesa-dri/Makefile.common | 4 +- graphics/mesa-dri/distinfo | 6 +- graphics/mesa-dri/files/configure.ac | 40 +++++++------- graphics/mesa-dri/files/patch-configure | 64 +++++++++++++++------- ...src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c | 14 +++++ .../patch-src_egl_drivers_dri2_platform__x11.c | 6 +- .../patch-src_gallium_auxiliary_util_u__network.c | 6 +- ...rc_gallium_winsys_svga_drm_vmw__screen__ioctl.c | 14 ----- ...src_intel_compiler_brw__fs__bank__conflicts.cpp | 18 ++++++ .../files/patch-src_intel_tools_aubinator.c | 2 +- .../files/patch-src_intel_vulkan_anv__allocator.c | 55 ++----------------- .../files/patch-src_intel_vulkan_anv__device.c | 6 +- graphics/mesa-dri/files/patch-src_util_futex.h | 48 ++++++++++++++++ graphics/mesa-dri/files/patch-src_util_os__time.c | 22 ++++++++ graphics/mesa-dri/files/patch-src_util_u__endian.h | 11 ---- 16 files changed, 186 insertions(+), 132 deletions(-) create mode 100644 graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c delete mode 100644 graphics/mesa-dri/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c create mode 100644 graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp create mode 100644 graphics/mesa-dri/files/patch-src_util_futex.h create mode 100644 graphics/mesa-dri/files/patch-src_util_os__time.c delete mode 100644 graphics/mesa-dri/files/patch-src_util_u__endian.h --- b/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -66,7 +66,7 @@ EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} .endif -.if ${VULKAN_DRIVERS:MINTEL} +.if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL} . if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld # --build-id isn't supported by old GNU ld.bfd in base USE_BINUTILS= yes --- b/graphics/mesa-dri/Makefile.common +++ b/graphics/mesa-dri/Makefile.common @@ -14,9 +14,9 @@ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 17.3.3 +MESABASEVERSION= 18.0.0 # if there is a subversion, don't include the '-' between 7.11-rc2. -MESASUBVERSION= +MESASUBVERSION= rc3 MASTER_SITES= https://mesa.freedesktop.org/archive/ \ https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \ --- b/graphics/mesa-dri/distinfo +++ b/graphics/mesa-dri/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1516311058 -SHA256 (mesa-17.3.3.tar.xz) = 41bac5de0ef6adc1f41a1ec0f80c19e361298ce02fa81b5f9ba4fdca33a9379b -SIZE (mesa-17.3.3.tar.xz) = 10637708 +TIMESTAMP = 1517225517 +SHA256 (mesa-18.0.0-rc3.tar.xz) = 27c1ade098d9e0afaa7ecaa2d4ce7fe1e84f105b82c0d19926f9694087ea5758 +SIZE (mesa-18.0.0-rc3.tar.xz) = 10964880 --- b/graphics/mesa-dri/files/configure.ac +++ b/graphics/mesa-dri/files/configure.ac @@ -1,5 +1,26 @@ --- configure.ac.orig 2017-04-01 15:33:36 UTC +++ configure.ac +@@ -894,7 +894,7 @@ case "$host_os" in + darwin*) + ;; + *) +- AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=], ++ AC_CHECK_FUNCS([clock_gettime clock_nanosleep], [CLOCK_LIB=], + [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt], + [AC_MSG_ERROR([Could not find clock_gettime])])]) + AC_SUBST([CLOCK_LIB]) +@@ -942,7 +942,10 @@ if test "x$pthread_stubs_possible" = xyes; then + fi + + dnl Check for futex for fast inline simple_mtx_t. +-AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"]) ++AC_CHECK_HEADERS([linux/futex.h sys/umtx.h], ++ [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"],, ++ [#include ++ #include ]) + + dnl SELinux awareness. + AC_ARG_ENABLE([selinux], @@ -1121,7 +1121,7 @@ fi AC_SUBST(LIBSENSORS_LIBS) @@ -9,25 +30,6 @@ dri3_default=yes ;; *) -@@ -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 --- b/graphics/mesa-dri/files/patch-configure +++ b/graphics/mesa-dri/files/patch-configure @@ -1,5 +1,47 @@ ---- configure.orig 2017-12-21 17:31:27 UTC +--- configure.orig 2018-01-23 18:08:55 UTC +++ configure +@@ -21895,12 +21895,13 @@ case "$host_os" in + darwin*) + ;; + *) +- for ac_func in clock_gettime ++ for ac_func in clock_gettime clock_nanosleep + do : +- ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +-if test "x$ac_cv_func_clock_gettime" = xyes; then : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +-#define HAVE_CLOCK_GETTIME 1 ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF + CLOCK_LIB= + else +@@ -22559,11 +22559,20 @@ $as_echo "yes" >&6; } + fi + fi + +-ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default" +-if test "x$ac_cv_header_linux_futex_h" = xyes; then : +- DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H" ++for ac_header in linux/futex.h sys/umtx.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include ++ #include ++" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H" + fi + ++done + + + # Check whether --enable-selinux was given. @@ -23308,7 +23308,7 @@ fi @@ -9,26 +51,6 @@ dri3_default=yes ;; *) -@@ -27028,9 +27028,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. @@ -27096,9 +27106,6 @@ rm -f core conftest.err conftest.$ac_obj CLANG_LIBDIR=${LLVM_LIBDIR} fi --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c @@ -0,0 +1,14 @@ +- Define ETIME if missing + +--- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2018-01-23 18:08:49 UTC ++++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +@@ -33,6 +33,9 @@ + #include "radv_amdgpu_bo.h" + #include "sid.h" + ++#ifndef ETIME ++#define ETIME ETIMEDOUT ++#endif + + enum { + VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024 --- b/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c +++ b/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c @@ -1,10 +1,10 @@ # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627 # ---- src/egl/drivers/dri2/platform_x11.c.orig 2017-12-21 17:31:21 UTC +--- src/egl/drivers/dri2/platform_x11.c.orig 2018-01-23 18:08:49 UTC +++ src/egl/drivers/dri2/platform_x11.c -@@ -1462,7 +1462,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG +@@ -1466,7 +1466,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp - if (!disp->Options.UseFallback) { + if (!disp->Options.ForceSoftware) { #ifdef HAVE_DRI3 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__) + if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false) && !env_var_as_boolean("LIBGL_DRI3_DISABLE", false)) --- b/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c +++ b/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c @@ -1,9 +1,9 @@ ---- src/gallium/auxiliary/util/u_network.c.orig 2016-11-10 22:05:17 UTC +--- src/gallium/auxiliary/util/u_network.c.orig 2018-01-23 18:08:49 UTC +++ src/gallium/auxiliary/util/u_network.c -@@ -6,7 +6,7 @@ - #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) +@@ -9,7 +9,7 @@ # include # include + # include -#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \ +#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \ defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS) --- a/graphics/mesa-dri/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c +++ /dev/null @@ -1,14 +0,0 @@ ---- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig 2016-11-10 22:05:17 UTC -+++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c -@@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio - return region->size; - } - -+#if defined(__DragonFly__) || defined(__FreeBSD__) || \ -+ defined(__NetBSD__) || defined(__OpenBSD__) -+#define ERESTART EINTR -+#endif -+ - uint32 - vmw_ioctl_context_create(struct vmw_winsys_screen *vws) - { --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp @@ -0,0 +1,18 @@ +compiler/brw_fs_bank_conflicts.cpp:719:25: error: scalar initializer cannot be empty + vector_type s_p = {}, s_n = {}; + ^~ +compiler/brw_fs_bank_conflicts.cpp:719:35: error: scalar initializer cannot be empty + vector_type s_p = {}, s_n = {}; + ^~ + +--- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2018-01-23 18:08:50 UTC ++++ src/intel/compiler/brw_fs_bank_conflicts.cpp +@@ -716,7 +716,7 @@ namespace { + const weight_vector_type &conflicts) + { + const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width); +- vector_type s_p = {}, s_n = {}; ++ vector_type s_p = {0}, s_n = {0}; + + for (unsigned r = 0; r < m; r++) { + s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r])); --- b/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c +++ b/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c @@ -3,7 +3,7 @@ # --- src/intel/tools/aubinator.c.orig 2017-10-02 15:49:02 UTC +++ src/intel/tools/aubinator.c -@@ -1237,7 +1237,7 @@ int main(int argc, char *argv[]) +@@ -637,7 +637,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, --- b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c +++ b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c @@ -1,30 +1,19 @@ -- Partially implement sys_futex() via _umtx_op() - Partially implement memfd_create() via mkostemp() - Ignore MAP_POPULATE if unsupported ---- src/intel/vulkan/anv_allocator.c.orig 2017-08-12 16:09:52 UTC +--- src/intel/vulkan/anv_allocator.c.orig 2018-01-23 18:08:50 UTC +++ src/intel/vulkan/anv_allocator.c -@@ -26,12 +26,31 @@ +@@ -25,9 +25,21 @@ #include #include #include +#ifdef __linux__ - #include #include -+#endif - #include - #include -+#ifdef __linux__ - #include +#else +#include +#endif + #include -+#ifdef __FreeBSD__ -+#include -+#include -+#endif -+ +#ifndef MAP_POPULATE +#define MAP_POPULATE 0 +#endif @@ -36,43 +25,7 @@ #include "anv_private.h" #include "util/hash_table.h" -@@ -112,6 +131,8 @@ struct anv_mmap_cleanup { - - #define ANV_MMAP_CLEANUP_INIT ((struct anv_mmap_cleanup){0}) - -+#if defined(__linux__) -+ - static inline long - sys_futex(void *addr1, int op, int val1, - struct timespec *timeout, void *addr2, int val3) -@@ -131,11 +152,56 @@ futex_wait(uint32_t *addr, int32_t value) - return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0); - } - -+#elif defined(__FreeBSD__) -+ -+/* Based on libxshmfence */ -+ -+static inline int -+sys_futex(void *addr, int op, int32_t val) -+{ -+ return _umtx_op(addr, op, (uint32_t)val, NULL, NULL) == -1 ? errno : 0; -+} -+ -+static inline int -+futex_wake(uint32_t *addr, int count) -+{ -+ return sys_futex(addr, UMTX_OP_WAKE, count); -+} -+ -+static inline int -+futex_wait(uint32_t *addr, int32_t value) -+{ -+ return sys_futex(addr, UMTX_OP_WAIT_UINT, value); -+} -+#endif -+ - #ifndef HAVE_MEMFD_CREATE +@@ -113,7 +125,29 @@ struct anv_mmap_cleanup { static inline int memfd_create(const char *name, unsigned int flags) { --- b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c +++ b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c @@ -1,7 +1,7 @@ - Without sysinfo() fall back to sysconf() - Define ETIME if missing ---- src/intel/vulkan/anv_device.c.orig 2017-08-12 16:09:52 UTC +--- src/intel/vulkan/anv_device.c.orig 2018-01-23 18:08:50 UTC +++ src/intel/vulkan/anv_device.c @@ -25,7 +25,9 @@ #include @@ -13,7 +13,7 @@ #include #include #include -@@ -39,6 +41,10 @@ +@@ -40,6 +42,10 @@ #include "genxml/gen7_pack.h" @@ -24,7 +24,7 @@ static void compiler_debug_log(void *data, const char *fmt, ...) { } -@@ -73,10 +79,15 @@ anv_compute_heap_size(int fd, uint64_t *heap_size) +@@ -75,10 +81,15 @@ anv_compute_heap_size(int fd, uint64_t *heap_size) } /* Query the total ram from the system */ --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_util_futex.h @@ -0,0 +1,48 @@ +- Implement futex_wake() and futex_wait() via _umtx_op() + +--- src/util/futex.h.orig 2018-01-23 18:08:50 UTC ++++ src/util/futex.h +@@ -29,10 +29,35 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++# if __FreeBSD__ < 11 ++# include ++# endif ++#include ++#include ++#else + #include + #include ++#endif + #include + ++#if defined(__FreeBSD__) ++static inline int futex_wake(uint32_t *addr, int count) ++{ ++ return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0; ++} ++ ++static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout) ++{ ++ void *uaddr = NULL, *uaddr2 = NULL; ++ if (timeout != NULL) { ++ const struct _umtx_time tmo = { ._clockid = CLOCK_MONOTONIC, ._flags = UMTX_ABSTIME, ._timeout = *timeout }; ++ uaddr = (void *)(uintptr_t)sizeof(tmo); ++ uaddr2 = (void *)&tmo; ++ } ++ return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0; ++} ++#else + static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3) + { + return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); +@@ -50,6 +75,7 @@ static inline int futex_wait(uint32_t *addr, int32_t v + return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL, + FUTEX_BITSET_MATCH_ANY); + } ++#endif + + #endif + --- /dev/null +++ b/graphics/mesa-dri/files/patch-src_util_os__time.c @@ -0,0 +1,22 @@ +- Use monotonic clock for timeouts + +--- src/util/os_time.c.orig 2018-01-23 18:08:50 UTC ++++ src/util/os_time.c +@@ -55,7 +55,7 @@ + int64_t + os_time_get_nano(void) + { +-#if defined(PIPE_OS_LINUX) ++#if defined(PIPE_OS_BSD) || defined(PIPE_OS_LINUX) + + struct timespec tv; + clock_gettime(CLOCK_MONOTONIC, &tv); +@@ -95,7 +95,7 @@ os_time_get_nano(void) + void + os_time_sleep(int64_t usecs) + { +-#if defined(PIPE_OS_LINUX) ++#if defined(HAVE_CLOCK_NANOSLEEP) + struct timespec time; + time.tv_sec = usecs / 1000000; + time.tv_nsec = (usecs % 1000000) * 1000; --- a/graphics/mesa-dri/files/patch-src_util_u__endian.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/util/u_endian.h.orig 2016-11-10 22:05:17 UTC -+++ src/util/u_endian.h -@@ -54,7 +54,7 @@ - # define PIPE_ARCH_BIG_ENDIAN - #endif - --#elif defined(__OpenBSD__) || defined(__NetBSD__) -+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) - #include - #include -