View | Details | Raw Unified | Return to bug 225415 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/mesa-dri/Makefile (-1 / +1 lines)
Lines 66-72 EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in Link Here
66
BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
66
BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
67
.endif
67
.endif
68
68
69
.if ${VULKAN_DRIVERS:MINTEL}
69
.if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL}
70
. if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
70
. if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
71
# --build-id isn't supported by old GNU ld.bfd in base
71
# --build-id isn't supported by old GNU ld.bfd in base
72
USE_BINUTILS=		yes
72
USE_BINUTILS=		yes
(-)b/graphics/mesa-dri/Makefile.common (-2 / +2 lines)
Lines 14-22 Link Here
14
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
14
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
15
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
15
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
16
16
17
MESABASEVERSION=	17.3.3
17
MESABASEVERSION=	18.0.0
18
# if there is a subversion, don't include the '-' between 7.11-rc2.
18
# if there is a subversion, don't include the '-' between 7.11-rc2.
19
MESASUBVERSION=
19
MESASUBVERSION=		rc2
20
20
21
MASTER_SITES=	https://mesa.freedesktop.org/archive/ \
21
MASTER_SITES=	https://mesa.freedesktop.org/archive/ \
22
		https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
22
		https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
(-)b/graphics/mesa-dri/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1516311058
1
TIMESTAMP = 1516730929
2
SHA256 (mesa-17.3.3.tar.xz) = 41bac5de0ef6adc1f41a1ec0f80c19e361298ce02fa81b5f9ba4fdca33a9379b
2
SHA256 (mesa-18.0.0-rc2.tar.xz) = 0eb88a367aea65226e9c5c2073b35b8f9fa65eb1149bf38ec5e27e61955c5d78
3
SIZE (mesa-17.3.3.tar.xz) = 10637708
3
SIZE (mesa-18.0.0-rc2.tar.xz) = 10962300
(-)b/graphics/mesa-dri/files/configure.ac (-19 / +12 lines)
Lines 1-5 Link Here
1
--- configure.ac.orig	2017-04-01 15:33:36 UTC
1
--- configure.ac.orig	2017-04-01 15:33:36 UTC
2
+++ configure.ac
2
+++ configure.ac
3
@@ -942,7 +942,10 @@ if test "x$pthread_stubs_possible" = xyes; then
4
 fi
5
 
6
 dnl Check for futex for fast inline simple_mtx_t.
7
-AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
8
+AC_CHECK_HEADERS([linux/futex.h sys/umtx.h],
9
+    [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"],,
10
+    [#include <errno.h>
11
+     #include <sys/types.h>])
12
 
13
 dnl SELinux awareness.
14
 AC_ARG_ENABLE([selinux],
3
@@ -1121,7 +1121,7 @@ fi
15
@@ -1121,7 +1121,7 @@ fi
4
 AC_SUBST(LIBSENSORS_LIBS)
16
 AC_SUBST(LIBSENSORS_LIBS)
5
 
17
 
Lines 9-33 Link Here
9
     dri3_default=yes
21
     dri3_default=yes
10
     ;;
22
     ;;
11
 *)
23
 *)
12
@@ -2002,9 +2002,18 @@ if test "x$enable_opencl" = xyes; then
13
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
14
     fi
15
 
16
+    if test "x$acv_mesa_CLANG" = xno; then
17
+
18
+    GCC_VERSION=`$CC -dumpversion`
19
+    if test $? -eq 0; then
20
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
21
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
22
+    fi
23
+
24
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
25
         AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
26
     fi
27
+    fi # end of clang test
28
 
29
     if test "x$have_libclc" = xno; then
30
         AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
31
@@ -2061,8 +2070,6 @@ if test "x$enable_opencl" = xyes; then
24
@@ -2061,8 +2070,6 @@ if test "x$enable_opencl" = xyes; then
32
         CLANG_LIBDIR=${LLVM_LIBDIR}
25
         CLANG_LIBDIR=${LLVM_LIBDIR}
33
     fi
26
     fi
(-)b/graphics/mesa-dri/files/patch-configure (-21 / +25 lines)
Lines 1-5 Link Here
1
--- configure.orig	2017-12-21 17:31:27 UTC
1
--- configure.orig	2018-01-23 18:08:55 UTC
2
+++ configure
2
+++ configure
3
@@ -22559,11 +22559,20 @@ $as_echo "yes" >&6; }
4
 fi
5
 fi
6
 
7
-ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default"
8
-if test "x$ac_cv_header_linux_futex_h" = xyes; then :
9
-  DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
10
+for ac_header in linux/futex.h sys/umtx.h
11
+do :
12
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <errno.h>
14
+     #include <sys/types.h>
15
+"
16
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
17
+  cat >>confdefs.h <<_ACEOF
18
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
19
+_ACEOF
20
+ DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
21
 fi
22
 
23
+done
24
 
25
 
26
 # Check whether --enable-selinux was given.
3
@@ -23308,7 +23308,7 @@ fi
27
@@ -23308,7 +23308,7 @@ fi
4
 
28
 
5
 
29
 
Lines 9-34 Link Here
9
     dri3_default=yes
33
     dri3_default=yes
10
     ;;
34
     ;;
11
 *)
35
 *)
12
@@ -27028,9 +27028,19 @@ if test "x$enable_opencl" = xyes; then
13
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
14
     fi
15
 
16
+    if test "x$acv_mesa_CLANG" = xno; then
17
+
18
+    GCC_VERSION=`$CC -dumpversion`
19
+    if test $? -eq 0; then
20
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
21
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
22
+    fi
23
+
24
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
25
         as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5
26
     fi
27
+# end of clang test.
28
+    fi
29
 
30
     if test "x$have_libclc" = xno; then
31
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
32
@@ -27096,9 +27106,6 @@ rm -f core conftest.err conftest.$ac_obj
36
@@ -27096,9 +27106,6 @@ rm -f core conftest.err conftest.$ac_obj
33
         CLANG_LIBDIR=${LLVM_LIBDIR}
37
         CLANG_LIBDIR=${LLVM_LIBDIR}
34
     fi
38
     fi
(-)b/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c (+14 lines)
Added Link Here
1
- Define ETIME if missing
2
3
--- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig	2018-01-23 18:08:49 UTC
4
+++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
5
@@ -33,6 +33,9 @@
6
 #include "radv_amdgpu_bo.h"
7
 #include "sid.h"
8
 
9
+#ifndef ETIME
10
+#define ETIME ETIMEDOUT
11
+#endif
12
 
13
 enum {
14
 	VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
(-)b/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c (-3 / +3 lines)
Lines 1-10 Link Here
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
2
#
2
#
3
--- src/egl/drivers/dri2/platform_x11.c.orig	2017-12-21 17:31:21 UTC
3
--- src/egl/drivers/dri2/platform_x11.c.orig	2018-01-23 18:08:49 UTC
4
+++ src/egl/drivers/dri2/platform_x11.c
4
+++ src/egl/drivers/dri2/platform_x11.c
5
@@ -1462,7 +1462,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
5
@@ -1466,7 +1466,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp
6
 
6
 
7
    if (!disp->Options.UseFallback) {
7
    if (!disp->Options.ForceSoftware) {
8
 #ifdef HAVE_DRI3
8
 #ifdef HAVE_DRI3
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
10
+      if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false) && !env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
10
+      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 (-3 / +3 lines)
Lines 1-9 Link Here
1
--- src/gallium/auxiliary/util/u_network.c.orig	2016-11-10 22:05:17 UTC
1
--- src/gallium/auxiliary/util/u_network.c.orig	2018-01-23 18:08:49 UTC
2
+++ src/gallium/auxiliary/util/u_network.c
2
+++ src/gallium/auxiliary/util/u_network.c
3
@@ -6,7 +6,7 @@
3
@@ -9,7 +9,7 @@
4
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
5
 #  include <winsock2.h>
4
 #  include <winsock2.h>
6
 #  include <windows.h>
5
 #  include <windows.h>
6
 #  include <ws2tcpip.h>
7
-#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
7
-#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
8
+#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \
8
+#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \
9
    defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
9
    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 (-14 lines)
Removed Link Here
1
--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
3
@@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio
4
    return region->size;
5
 }
6
 
7
+#if defined(__DragonFly__) || defined(__FreeBSD__) || \
8
+    defined(__NetBSD__) || defined(__OpenBSD__)
9
+#define ERESTART EINTR
10
+#endif
11
+
12
 uint32
13
 vmw_ioctl_context_create(struct vmw_winsys_screen *vws)
14
 {
(-)b/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp (+18 lines)
Added Link Here
1
compiler/brw_fs_bank_conflicts.cpp:719:25: error: scalar initializer cannot be empty
2
      vector_type s_p = {}, s_n = {};
3
                        ^~
4
compiler/brw_fs_bank_conflicts.cpp:719:35: error: scalar initializer cannot be empty
5
      vector_type s_p = {}, s_n = {};
6
                                  ^~
7
8
--- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig	2018-01-23 18:08:50 UTC
9
+++ src/intel/compiler/brw_fs_bank_conflicts.cpp
10
@@ -716,7 +716,7 @@ namespace {
11
                    const weight_vector_type &conflicts)
12
    {
13
       const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
14
-      vector_type s_p = {}, s_n = {};
15
+      vector_type s_p = {0}, s_n = {0};
16
 
17
       for (unsigned r = 0; r < m; r++) {
18
          s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
(-)b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c (-51 / +4 lines)
Lines 1-30 Link Here
1
- Partially implement sys_futex() via _umtx_op()
2
- Partially implement memfd_create() via mkostemp()
1
- Partially implement memfd_create() via mkostemp()
3
- Ignore MAP_POPULATE if unsupported
2
- Ignore MAP_POPULATE if unsupported
4
3
5
--- src/intel/vulkan/anv_allocator.c.orig	2017-08-12 16:09:52 UTC
4
--- src/intel/vulkan/anv_allocator.c.orig	2018-01-23 18:08:50 UTC
6
+++ src/intel/vulkan/anv_allocator.c
5
+++ src/intel/vulkan/anv_allocator.c
7
@@ -26,12 +26,31 @@
6
@@ -25,9 +25,21 @@
8
 #include <unistd.h>
7
 #include <unistd.h>
9
 #include <limits.h>
8
 #include <limits.h>
10
 #include <assert.h>
9
 #include <assert.h>
11
+#ifdef __linux__
10
+#ifdef __linux__
12
 #include <linux/futex.h>
13
 #include <linux/memfd.h>
11
 #include <linux/memfd.h>
14
+#endif
15
 #include <sys/time.h>
16
 #include <sys/mman.h>
17
+#ifdef __linux__
18
 #include <sys/syscall.h>
19
+#else
12
+#else
20
+#include <fcntl.h>
13
+#include <fcntl.h>
21
+#endif
14
+#endif
15
 #include <sys/mman.h>
22
 
16
 
23
+#ifdef __FreeBSD__
24
+#include <errno.h>
25
+#include <sys/umtx.h>
26
+#endif
27
+
28
+#ifndef MAP_POPULATE
17
+#ifndef MAP_POPULATE
29
+#define MAP_POPULATE 0
18
+#define MAP_POPULATE 0
30
+#endif
19
+#endif
Lines 36-78 Link Here
36
 #include "anv_private.h"
25
 #include "anv_private.h"
37
 
26
 
38
 #include "util/hash_table.h"
27
 #include "util/hash_table.h"
39
@@ -112,6 +131,8 @@ struct anv_mmap_cleanup {
28
@@ -113,7 +125,29 @@ struct anv_mmap_cleanup {
40
 
41
 #define ANV_MMAP_CLEANUP_INIT ((struct anv_mmap_cleanup){0})
42
 
43
+#if defined(__linux__)
44
+
45
 static inline long
46
 sys_futex(void *addr1, int op, int val1,
47
           struct timespec *timeout, void *addr2, int val3)
48
@@ -131,11 +152,56 @@ futex_wait(uint32_t *addr, int32_t value)
49
    return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0);
50
 }
51
 
52
+#elif defined(__FreeBSD__)
53
+
54
+/* Based on libxshmfence */
55
+
56
+static inline int
57
+sys_futex(void *addr, int op, int32_t val)
58
+{
59
+   return _umtx_op(addr, op, (uint32_t)val, NULL, NULL) == -1 ? errno : 0;
60
+}
61
+
62
+static inline int
63
+futex_wake(uint32_t *addr, int count)
64
+{
65
+   return sys_futex(addr, UMTX_OP_WAKE, count);
66
+}
67
+
68
+static inline int
69
+futex_wait(uint32_t *addr, int32_t value)
70
+{
71
+   return sys_futex(addr, UMTX_OP_WAIT_UINT, value);
72
+}
73
+#endif
74
+
75
 #ifndef HAVE_MEMFD_CREATE
76
 static inline int
29
 static inline int
77
 memfd_create(const char *name, unsigned int flags)
30
 memfd_create(const char *name, unsigned int flags)
78
 {
31
 {
(-)b/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c (-3 / +3 lines)
Lines 1-7 Link Here
1
- Without sysinfo() fall back to sysconf()
1
- Without sysinfo() fall back to sysconf()
2
- Define ETIME if missing
2
- Define ETIME if missing
3
3
4
--- src/intel/vulkan/anv_device.c.orig	2017-08-12 16:09:52 UTC
4
--- src/intel/vulkan/anv_device.c.orig	2018-01-23 18:08:50 UTC
5
+++ src/intel/vulkan/anv_device.c
5
+++ src/intel/vulkan/anv_device.c
6
@@ -25,7 +25,9 @@
6
@@ -25,7 +25,9 @@
7
 #include <stdbool.h>
7
 #include <stdbool.h>
Lines 13-19 Link Here
13
 #include <unistd.h>
13
 #include <unistd.h>
14
 #include <fcntl.h>
14
 #include <fcntl.h>
15
 #include <xf86drm.h>
15
 #include <xf86drm.h>
16
@@ -39,6 +41,10 @@
16
@@ -40,6 +42,10 @@
17
 
17
 
18
 #include "genxml/gen7_pack.h"
18
 #include "genxml/gen7_pack.h"
19
 
19
 
Lines 24-30 Link Here
24
 static void
24
 static void
25
 compiler_debug_log(void *data, const char *fmt, ...)
25
 compiler_debug_log(void *data, const char *fmt, ...)
26
 { }
26
 { }
27
@@ -73,10 +79,15 @@ anv_compute_heap_size(int fd, uint64_t *heap_size)
27
@@ -75,10 +81,15 @@ anv_compute_heap_size(int fd, uint64_t *heap_size)
28
    }
28
    }
29
 
29
 
30
    /* Query the total ram from the system */
30
    /* Query the total ram from the system */
(-)b/graphics/mesa-dri/files/patch-src_util_futex.h (+51 lines)
Added Link Here
1
- Implement futex_wake() and futex_wait() via _umtx_op()
2
3
--- src/util/futex.h.orig	2018-01-23 18:08:50 UTC
4
+++ src/util/futex.h
5
@@ -29,10 +29,38 @@
6
 #include <limits.h>
7
 #include <stdint.h>
8
 #include <unistd.h>
9
+#ifdef __FreeBSD__
10
+# if __FreeBSD__ < 11
11
+#  include <machine/atomic.h>
12
+# endif
13
+#include <errno.h>
14
+#include <sys/umtx.h>
15
+#else
16
 #include <linux/futex.h>
17
 #include <sys/syscall.h>
18
+#endif
19
 #include <sys/time.h>
20
 
21
+#if defined(__FreeBSD__) /* Based on libxshmfence */
22
+static inline int sys_futex(void *addr, int op, int32_t val)
23
+{
24
+   return _umtx_op(addr, op, (uint32_t)val, NULL, NULL) == -1 ? errno : 0;
25
+}
26
+
27
+static inline int futex_wake(uint32_t *addr, int count)
28
+{
29
+   return sys_futex(addr, UMTX_OP_WAKE, count);
30
+}
31
+
32
+static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
33
+{
34
+   if (!timeout)
35
+      return sys_futex(addr, UMTX_OP_WAIT_UINT, value);
36
+
37
+   struct _umtx_time tm = { ._clockid = CLOCK_REALTIME, ._flags = UMTX_ABSTIME, ._timeout = *timeout };
38
+   return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, (void *)sizeof(tm), &tm) == -1 ? errno : 0;
39
+}
40
+#else
41
 static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
42
 {
43
    return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
44
@@ -50,6 +71,7 @@ static inline int futex_wait(uint32_t *addr, int32_t v
45
    return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
46
                     FUTEX_BITSET_MATCH_ANY);
47
 }
48
+#endif
49
 
50
 #endif
51
 
(-)a/graphics/mesa-dri/files/patch-src_util_u__endian.h (-11 lines)
Removed Link Here
1
--- src/util/u_endian.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/util/u_endian.h
3
@@ -54,7 +54,7 @@
4
 # define PIPE_ARCH_BIG_ENDIAN
5
 #endif
6
 
7
-#elif defined(__OpenBSD__) || defined(__NetBSD__)
8
+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
9
 #include <sys/types.h>
10
 #include <machine/endian.h>
11
 

Return to bug 225415