pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

MesaLib-dfbsd-meson: Fix atomic_add_unless with option to return as Linux does



Module Name:	pkgsrc-wip
Committed By:	David Shao <davshao%gmail.com@localhost>
Pushed By:	dshao
Date:		Wed Mar 6 22:37:35 2019 -0800
Changeset:	9114d2e34b11a4135ec22029deb1b74e7b4aef0d

Modified Files:
	MesaLib-dfbsd-meson/Makefile
	MesaLib-dfbsd-meson/distinfo
	MesaLib-dfbsd-meson/options.mk
	MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
	MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
Added Files:
	MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_iris__bufmgr.c
Removed Files:
	MesaLib-dfbsd-meson/patches/patch-src_util_futex.h

Log Message:
MesaLib-dfbsd-meson: Fix atomic_add_unless with option to return as Linux does

Also update through most of 2019-03-06.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9114d2e34b11a4135ec22029deb1b74e7b4aef0d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 MesaLib-dfbsd-meson/Makefile                       |  8 +++-
 MesaLib-dfbsd-meson/distinfo                       | 14 +++---
 MesaLib-dfbsd-meson/options.mk                     |  9 ++++
 .../patch-src_gallium_drivers_iris_iris__bufmgr.c  | 21 +++++++++
 .../patch-src_mesa_drivers_dri_i965_brw__bufmgr.c  | 21 ++++++++-
 MesaLib-dfbsd-meson/patches/patch-src_util_futex.h | 53 ----------------------
 .../patches/patch-src_util_xmlconfig.c             | 11 +++--
 7 files changed, 69 insertions(+), 68 deletions(-)

diffs:
diff --git a/MesaLib-dfbsd-meson/Makefile b/MesaLib-dfbsd-meson/Makefile
index 0cf2290dc8..73711dd4f7 100644
--- a/MesaLib-dfbsd-meson/Makefile
+++ b/MesaLib-dfbsd-meson/Makefile
@@ -1,7 +1,13 @@
 # $NetBSD: Makefile,v 1.18 2019/02/22 15:40:35 tnn Exp $
 
+# 2019-03-06	st/glsl: start spilling out common st glsl conversion code
+COMMIT_ID=	ecceb076e5c99cea94b853a9600947fe78b3ca74
+
+# 2019-03-05	anv: Implement VK_EXT_inline_uniform_block
+# COMMIT_ID=	43f40dc7cb234e007fe612b67cc765288ddf0533
+
 # 2019-03-02	st/mesa: add support for lowering fp64/int64 for nir drivers
-COMMIT_ID=	cb4e3e3ef6e47811303ad3413a4ab2048696a6f6
+# COMMIT_ID=	cb4e3e3ef6e47811303ad3413a4ab2048696a6f6
 
 # 2019-02-28	scons: Workaround failures with MSVC when using SCons 3.0.[2-4].
 # COMMIT_ID=	838c0485e01f3d3403b430aa6df5b4a1f5262dc3
diff --git a/MesaLib-dfbsd-meson/distinfo b/MesaLib-dfbsd-meson/distinfo
index f8d1c7fde1..14f6e182fb 100644
--- a/MesaLib-dfbsd-meson/distinfo
+++ b/MesaLib-dfbsd-meson/distinfo
@@ -1,9 +1,9 @@
 $NetBSD: distinfo,v 1.16 2019/02/22 15:40:35 tnn Exp $
 
-SHA1 (mesa-cb4e3e3ef6e47811303ad3413a4ab2048696a6f6.tar.xz) = 3dd8d94a5b01dcfa9472f66a096341d5d588a3ca
-RMD160 (mesa-cb4e3e3ef6e47811303ad3413a4ab2048696a6f6.tar.xz) = 60b3f3e02165ce3a6ba72879a729fc45f2625bc7
-SHA512 (mesa-cb4e3e3ef6e47811303ad3413a4ab2048696a6f6.tar.xz) = 9d723565a7a7e70f4237ac390f29a5d64e014dd41b738184b5b77ac70cc6ea5339099a6f66d2acc9dd52213dcef83162f95847e949266ad28e35dc4980ea4410
-Size (mesa-cb4e3e3ef6e47811303ad3413a4ab2048696a6f6.tar.xz) = 10570888 bytes
+SHA1 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 7433e1f7fc41f492abf65b70fffcbf9ff3a45d53
+RMD160 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 47ed0d295f41558cca5f94be5221e57551eb8483
+SHA512 (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 684755bffa39966ddb2c5e8cbf27ddac2d2ee639c7f602030cf75ad1f3eeceadd2b720208c6abf504ea90cbdf3438bc3c2f57445100d16452e93ef593d983fc5
+Size (mesa-ecceb076e5c99cea94b853a9600947fe78b3ca74.tar.xz) = 10584104 bytes
 SHA1 (patch-configure.ac) = cddca44dbf1e2f447dd30a03440104920d6c24ab
 SHA1 (patch-include_GL_internal_dri__interface.h) = 76803a4ab6ff7e596900a0099dd9712093f8bc21
 SHA1 (patch-src_amd_common_ac__debug.c) = 8233367c3b5bc344442ea8d19488fdd1e3791ae9
@@ -18,6 +18,7 @@ SHA1 (patch-src_gallium_auxiliary_drivers_trace_tr__dump.c) = 360e1608508a7bbb41
 SHA1 (patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c) = f913b779404e6bd8ae707a4fd66eb7c1dca9b311
 SHA1 (patch-src_gallium_auxiliary_util_u__format__tests.c) = d878e6f3e9a0a37d4903c0d0551f9fa535635d40
 SHA1 (patch-src_gallium_drivers_freedreno_freedreno__screen.c) = d76bf52c25609d641dbf4021e81282cbdc925976
+SHA1 (patch-src_gallium_drivers_iris_iris__bufmgr.c) = d6ead77d93ade4beada1625cb09c40362fb0b3f0
 SHA1 (patch-src_gallium_drivers_iris_meson.build) = 9b94ae7047763cc4b1be5b39a3d9cac898e10f65
 SHA1 (patch-src_gallium_drivers_nouveau_nouveau__vp3__video.c) = 04f95784c3270c9bb7e95377982e217962481525
 SHA1 (patch-src_gallium_drivers_nouveau_nv50_nv84__video.c) = 1b4239fe053523835ecac006894bdb0cde0ee626
@@ -58,7 +59,7 @@ SHA1 (patch-src_mapi_glapi_gen_gl__gentable.py) = 0b1d4ef3f78a9b3726ef7f9921608a
 SHA1 (patch-src_mapi_u__current.c) = 38d324fcd1c28d155106ccd248edb5eb1aa9ffac
 SHA1 (patch-src_mapi_u__current.h) = 465a992bd34057e9521f0a33e6f2e25cefc145ca
 SHA1 (patch-src_mesa_drivers_dri_i915_intel__screen.c) = e33f51b3502e8c52ff7283aeb807996717f79f4f
-SHA1 (patch-src_mesa_drivers_dri_i965_brw__bufmgr.c) = 09e62d6b9d614fa3d15bd7cc0f05b8bbbdcb92bd
+SHA1 (patch-src_mesa_drivers_dri_i965_brw__bufmgr.c) = 7a6edf46b9364bcdb2dbe8d70a2e6a1d0610dc40
 SHA1 (patch-src_mesa_drivers_dri_i965_brw__performance__query.c) = 9579ab29e0a913aa0516665e72a8573097932312
 SHA1 (patch-src_mesa_drivers_dri_i965_intel__screen.c) = 639d0d2680a98dd5213dfadf608468de6ac54c20
 SHA1 (patch-src_mesa_drivers_dri_swrast_swrast.c) = 3106f350e590f62c8bd29cd85f24f977639dccdb
@@ -71,11 +72,10 @@ SHA1 (patch-src_mesa_x86_common__x86.c) = f8c4b93443ef66d017f6aa114b877565b30f25
 SHA1 (patch-src_util_Makefile.am) = e390cd47b784ad08987b81fdbce537968ad4a624
 SHA1 (patch-src_util_build__id.c) = fee28ddf5c91208492efcfdebf32e0cfef35502d
 SHA1 (patch-src_util_disk__cache.c) = cc0b29780dba5d5b5e43c0798336f16a1f0008de
-SHA1 (patch-src_util_futex.h) = 35097c3b8baf8b969c6ec5ec1feb6f4e0a48237e
 SHA1 (patch-src_util_os__time.c) = 0cdeec38dbb09700f4cfaa075f865e2a617daf31
 SHA1 (patch-src_util_ralloc.c) = d311bfd9ed7e673d72e050668d351c1e6552cdc8
 SHA1 (patch-src_util_strndup.h) = 73f49694ca48ad6b9a9d8346c5b84fddec2463bd
 SHA1 (patch-src_util_u__atomic.h) = 31d4514538ef5ee53012695eb5c66134aaec981e
 SHA1 (patch-src_util_u__queue.c) = ed1ea3f6fc37e9a64894a3e865c48691b6e01b2c
 SHA1 (patch-src_util_u__thread.h) = 1c0d6ea3638e79bb437843e96cfe6786a9616b7b
-SHA1 (patch-src_util_xmlconfig.c) = ad5619e067957b120a70c1c63421c92b356e16ac
+SHA1 (patch-src_util_xmlconfig.c) = fa0cfe2e1348dfb5e91f9c20aae3c43eee1998b5
diff --git a/MesaLib-dfbsd-meson/options.mk b/MesaLib-dfbsd-meson/options.mk
index 03eec4d38a..7b0fae8221 100644
--- a/MesaLib-dfbsd-meson/options.mk
+++ b/MesaLib-dfbsd-meson/options.mk
@@ -19,6 +19,7 @@ PKG_SUPPORTED_OPTIONS+=		revert_threaded_context
 PKG_SUPPORTED_OPTIONS+=		revert_copy_clear
 PKG_SUPPORTED_OPTIONS+=		revert_i965_softpin
 PKG_SUPPORTED_OPTIONS+=		revert_sdma_uploader
+PKG_SUPPORTED_OPTIONS+=		invert_atomic_add_unless
 
 # PKG_SUGGESTED_OPTIONS+=		xvmc
 PKG_SUGGESTED_OPTIONS+=		vdpau vaapi
@@ -70,6 +71,10 @@ PKG_SUGGESTED_OPTIONS+=		revert_i965_softpin
 PKG_SUGGESTED_OPTIONS+=		revert_sdma_uploader
 .endif
 
+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+PKG_SUGGESTED_OPTIONS+=		invert_atomic_add_unless
+.endif
+
 .include "../../mk/bsd.options.mk"
 
 # gallium
@@ -403,3 +408,7 @@ CPPFLAGS+=	-DREVERT_I965_SOFTPIN
 .if !empty(PKG_OPTIONS:Mrevert_sdma_uploader)
 CPPFLAGS+=	-DREVERT_SDMA_UPLOADER
 .endif
+
+.if !empty(PKG_OPTIONS:Minvert_atomic_add_unless)
+CPPFLAGS+=	-DINVERT_ATOMIC_ADD_UNLESS
+.endif
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_iris__bufmgr.c b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_iris__bufmgr.c
new file mode 100644
index 0000000000..35d19a9a3e
--- /dev/null
+++ b/MesaLib-dfbsd-meson/patches/patch-src_gallium_drivers_iris_iris__bufmgr.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+This single patch allows glxgears to run properly on
+an Intel integrated graphics IvyBridge machine on DragonFly.
+libdrm atomic_add_unless() may reverse return value meaning
+https://bugs.freedesktop.org/show_bug.cgi?id=100077
+
+--- src/gallium/drivers/iris/iris_bufmgr.c.orig	2019-03-05 16:06:50.000000000 +0000
++++ src/gallium/drivers/iris/iris_bufmgr.c
+@@ -114,7 +114,11 @@ atomic_add_unless(int *v, int add, int u
+    c = p_atomic_read(v);
+    while (c != unless && (old = p_atomic_cmpxchg(v, c, c + add)) != c)
+       c = old;
++#if defined(INVERT_ATOMIC_ADD_UNLESS)
++   return c != unless;
++#else
+    return c == unless;
++#endif
+ }
+ 
+ /**
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
index 4ee4d0055c..08402a3e67 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c
@@ -1,5 +1,10 @@
 $NetBSD$
 
+This single patch allows glxgears to run properly on
+an Intel integrated graphics IvyBridge machine on DragonFly.
+libdrm atomic_add_unless() may reverse return value meaning
+https://bugs.freedesktop.org/show_bug.cgi?id=100077
+
 From Ravenports
 
 graphics/mesa-dri: Disable soft-spinning of all buffers (#169)
@@ -15,9 +20,21 @@ Discussion in
 
 https://bugs.dragonflybsd.org/issues/3171
 
---- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig	2019-02-02 23:08:03.000000000 +0000
+--- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig	2019-03-05 16:06:50.000000000 +0000
 +++ src/mesa/drivers/dri/i965/brw_bufmgr.c
-@@ -1721,7 +1721,11 @@ brw_bufmgr_init(struct gen_device_info *
+@@ -98,7 +98,11 @@ atomic_add_unless(int *v, int add, int u
+    c = p_atomic_read(v);
+    while (c != unless && (old = p_atomic_cmpxchg(v, c, c + add)) != c)
+       c = old;
++#if defined(INVERT_ATOMIC_ADD_UNLESS)
++   return c != unless;
++#else
+    return c == unless;
++#endif
+ }
+ 
+ /**
+@@ -1721,7 +1725,11 @@ brw_bufmgr_init(struct gen_device_info *
        bufmgr->initial_kflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
  
        /* Allocate VMA in userspace if we have softpin and full PPGTT. */
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_futex.h b/MesaLib-dfbsd-meson/patches/patch-src_util_futex.h
deleted file mode 100644
index 5120686726..0000000000
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_futex.h
+++ /dev/null
@@ -1,53 +0,0 @@
-$NetBSD: patch-src_util_futex.h,v 1.1 2018/10/07 23:49:31 ryoon Exp $
-
-Implement futex_wake() and futex_wait() via _umtx_op()
-
-FreeBSD Bugzilla - Bug 225415: graphics/mesa-dri: update to 18.0.0
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225415
-
---- src/util/futex.h.orig	2018-02-09 02:18:00.000000000 +0000
-+++ 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 *a
-    return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
-                     FUTEX_BITSET_MATCH_ANY);
- }
-+#endif
- 
- #endif
- 
diff --git a/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c b/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
index b429692fea..87def19ed9 100644
--- a/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
+++ b/MesaLib-dfbsd-meson/patches/patch-src_util_xmlconfig.c
@@ -3,11 +3,11 @@ $NetBSD: patch-src_util_xmlconfig.c,v 1.1 2018/10/07 23:49:31 ryoon Exp $
 PR pkg/50202.
 Provide compat strndup for older Darwin.
 
---- src/util/xmlconfig.c.orig	2018-09-07 21:18:07.000000000 +0000
+--- src/util/xmlconfig.c.orig	2019-03-05 18:53:12.177053000 +0000
 +++ src/util/xmlconfig.c
-@@ -39,6 +39,23 @@
- #include "xmlconfig.h"
- #include "u_process.h"
+@@ -47,6 +47,24 @@
+ #define PATH_MAX 4096
+ #endif
  
 +#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1070)
 +static char *
@@ -26,6 +26,7 @@ Provide compat strndup for older Darwin.
 +    return (copy);
 +}
 +#endif
- 
++
  /** \brief Find an option in an option cache with the name as key */
  static uint32_t
+ findOption(const driOptionCache *cache, const char *name)


Home | Main Index | Thread Index | Old Index