Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2018 00:15:05 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r466926 - in head/graphics/mesa-dri: . files
Message-ID:  <201804100015.w3A0F5oM063950@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Tue Apr 10 00:15:05 2018
New Revision: 466926
URL: https://svnweb.freebsd.org/changeset/ports/466926

Log:
  graphics/mesa-{libs,dri}: update to 18.0.0
  
  Changes:	https://www.mesa3d.org/relnotes/18.0.0.html
  PR:		225415
  Tested by:	Greg V, cpm, Kevin Oberman, Juan Ramón Molina Menor
  Reviewed by:	Greg V (Wayland, Vulkan), jkim (umtx)
  Approved by:	maintainer timeout (2 weeks)

Added:
  head/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_util_futex.h   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_util_os__time.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_util_u__thread.h   (contents, props changed)
Deleted:
  head/graphics/mesa-dri/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c
  head/graphics/mesa-dri/files/patch-src_loader_loader.c
  head/graphics/mesa-dri/files/patch-src_util_u__endian.h
Modified:
  head/graphics/mesa-dri/Makefile   (contents, props changed)
  head/graphics/mesa-dri/Makefile.common   (contents, props changed)
  head/graphics/mesa-dri/distinfo   (contents, props changed)
  head/graphics/mesa-dri/files/configure.ac
  head/graphics/mesa-dri/files/patch-configure   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c   (contents, props changed)
  head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c   (contents, props changed)

Modified: head/graphics/mesa-dri/Makefile
==============================================================================
--- head/graphics/mesa-dri/Makefile	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/Makefile	Tue Apr 10 00:15:05 2018	(r466926)
@@ -66,7 +66,7 @@ EXTRA_PATCHES+=	${PATCHDIR}/extra-src_gallium_drivers_
 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

Modified: head/graphics/mesa-dri/Makefile.common
==============================================================================
--- head/graphics/mesa-dri/Makefile.common	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/Makefile.common	Tue Apr 10 00:15:05 2018	(r466926)
@@ -14,7 +14,7 @@
 MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
 MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
 
-MESABASEVERSION=	17.3.8
+MESABASEVERSION=	18.0.0
 # if there is a subversion, don't include the '-' between 7.11-rc2.
 MESASUBVERSION=
 

Modified: head/graphics/mesa-dri/distinfo
==============================================================================
--- head/graphics/mesa-dri/distinfo	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/distinfo	Tue Apr 10 00:15:05 2018	(r466926)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1522776465
-SHA256 (mesa-17.3.8.tar.xz) = 8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1
-SIZE (mesa-17.3.8.tar.xz) = 10660896
+TIMESTAMP = 1522172114
+SHA256 (mesa-18.0.0.tar.xz) = 694e5c3d37717d23258c1f88bc134223c5d1aac70518d2f9134d6df3ee791eea
+SIZE (mesa-18.0.0.tar.xz) = 11056544

Modified: head/graphics/mesa-dri/files/configure.ac
==============================================================================
--- head/graphics/mesa-dri/files/configure.ac	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/configure.ac	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <errno.h>
++     #include <sys/types.h>])
+ 
+ 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

Modified: head/graphics/mesa-dri/files/patch-configure
==============================================================================
--- head/graphics/mesa-dri/files/patch-configure	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-configure	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <errno.h>
++     #include <sys/types.h>
++"
++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

Added: head/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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

Modified: 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	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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))

Modified: head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c
==============================================================================
--- head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <winsock2.h>
  #  include <windows.h>
+ #  include <ws2tcpip.h>
 -#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)

Added: head/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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]));

Modified: head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c
==============================================================================
--- head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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,

Modified: head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c
==============================================================================
--- head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <unistd.h>
  #include <limits.h>
  #include <assert.h>
 +#ifdef __linux__
- #include <linux/futex.h>
  #include <linux/memfd.h>
-+#endif
- #include <sys/time.h>
- #include <sys/mman.h>
-+#ifdef __linux__
- #include <sys/syscall.h>
 +#else
 +#include <fcntl.h>
 +#endif
+ #include <sys/mman.h>
  
-+#ifdef __FreeBSD__
-+#include <errno.h>
-+#include <sys/umtx.h>
-+#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)
  {

Modified: head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c
==============================================================================
--- head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c	Tue Apr 10 00:14:41 2018	(r466925)
+++ head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <stdbool.h>
@@ -13,7 +13,7 @@
  #include <unistd.h>
  #include <fcntl.h>
  #include <xf86drm.h>
-@@ -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 */

Added: head/graphics/mesa-dri/files/patch-src_util_futex.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/patch-src_util_futex.h	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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 <limits.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#if defined(__FreeBSD__)
++#include <errno.h>
++# if __FreeBSD__ < 11
++#  include <machine/atomic.h>
++# endif
++#include <sys/umtx.h>
++#else
+ #include <linux/futex.h>
+ #include <sys/syscall.h>
++#endif
+ #include <sys/time.h>
+ 
++#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 = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };
++      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
+ 

Added: head/graphics/mesa-dri/files/patch-src_util_os__time.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/patch-src_util_os__time.c	Tue Apr 10 00:15:05 2018	(r466926)
@@ -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;

Added: head/graphics/mesa-dri/files/patch-src_util_u__thread.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mesa-dri/files/patch-src_util_u__thread.h	Tue Apr 10 00:15:05 2018	(r466926)
@@ -0,0 +1,39 @@
+- Implement setting thread name
+- Use monotonic clock for timeouts
+
+--- src/util/u_thread.h.orig	2018-02-09 02:18:00 UTC
++++ src/util/u_thread.h
+@@ -34,7 +34,11 @@
+ 
+ #ifdef HAVE_PTHREAD
+ #include <signal.h>
++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#include <pthread_np.h>
++#undef ALIGN /* Avoid conflict on FreeBSD in main/macros.h */
+ #endif
++#endif
+ 
+ 
+ static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
+@@ -65,6 +69,12 @@ static inline void u_thread_setname( const char *name 
+       (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
+       defined(__linux__)
+    pthread_setname_np(pthread_self(), name);
++#  elif defined(__sun)
++   pthread_setname_np(pthread_self(), name);
++#  elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++   pthread_set_name_np(pthread_self(), name);
++#  elif defined(__NetBSD__)
++   pthread_setname_np(pthread_self(), "%s", (void*)name);
+ #  endif
+ #endif
+    (void)name;
+@@ -78,7 +88,7 @@ static inline void u_thread_setname( const char *name 
+ static inline int64_t
+ u_thread_get_time_nano(thrd_t thread)
+ {
+-#if defined(__linux__) && defined(HAVE_PTHREAD)
++#if defined(HAVE_PTHREAD)
+    struct timespec ts;
+    clockid_t cid;
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804100015.w3A0F5oM063950>