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)
This commit is contained in:
parent
8892ec72d2
commit
89ca0fa3f1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=466926
18 changed files with 224 additions and 199 deletions
|
@ -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
|
||||
|
|
|
@ -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=
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
|
@ -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]));
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
commit db8519a369261cdedda50852facc45616d4eba28
|
||||
Author: Greg V <greg@unrelenting.technology>
|
||||
Date: Mon Oct 23 23:20:40 2017 +0300
|
||||
|
||||
loader: use drmGetDeviceNameFromFd2 from libdrm
|
||||
|
||||
Reduce code duplication and automatically benefit from OS-specific
|
||||
fixes to libdrm (e.g. in FreeBSD ports).
|
||||
|
||||
API was introduced with 2.4.74 and we already require 2.4.75 globally.
|
||||
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103283
|
||||
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
|
||||
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
|
||||
|
||||
--- src/loader/loader.c.orig 2017-12-21 17:31:21 UTC
|
||||
+++ src/loader/loader.c
|
||||
@@ -245,30 +245,7 @@ int loader_get_user_preferred_fd(int default_fd, bool
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBDRM)
|
||||
-static int
|
||||
-dev_node_from_fd(int fd, unsigned int *maj, unsigned int *min)
|
||||
-{
|
||||
- struct stat buf;
|
||||
|
||||
- if (fstat(fd, &buf) < 0) {
|
||||
- log_(_LOADER_WARNING, "MESA-LOADER: failed to stat fd %d\n", fd);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (!S_ISCHR(buf.st_mode)) {
|
||||
- log_(_LOADER_WARNING, "MESA-LOADER: fd %d not a character device\n", fd);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- *maj = major(buf.st_rdev);
|
||||
- *min = minor(buf.st_rdev);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
-#if defined(HAVE_LIBDRM)
|
||||
-
|
||||
static int
|
||||
drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
|
||||
{
|
||||
@@ -312,18 +289,7 @@ loader_get_pci_id_for_fd(int fd, int *vendor_id, int *
|
||||
static char *
|
||||
drm_get_device_name_for_fd(int fd)
|
||||
{
|
||||
- unsigned int maj, min;
|
||||
- char buf[0x40];
|
||||
- int n;
|
||||
-
|
||||
- if (dev_node_from_fd(fd, &maj, &min) < 0)
|
||||
- return NULL;
|
||||
-
|
||||
- n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, min);
|
||||
- if (n == -1 || n >= sizeof(buf))
|
||||
- return NULL;
|
||||
-
|
||||
- return strdup(buf);
|
||||
+ return drmGetDeviceNameFromFd2(fd);
|
||||
}
|
||||
#endif
|
||||
|
48
graphics/mesa-dri/files/patch-src_util_futex.h
Normal file
48
graphics/mesa-dri/files/patch-src_util_futex.h
Normal file
|
@ -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
|
||||
|
22
graphics/mesa-dri/files/patch-src_util_os__time.c
Normal file
22
graphics/mesa-dri/files/patch-src_util_os__time.c
Normal file
|
@ -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;
|
|
@ -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 <sys/types.h>
|
||||
#include <machine/endian.h>
|
||||
|
39
graphics/mesa-dri/files/patch-src_util_u__thread.h
Normal file
39
graphics/mesa-dri/files/patch-src_util_u__thread.h
Normal file
|
@ -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;
|
||||
|
Loading…
Reference in a new issue