[Mesa-dev] [PATCH 0/5] FreeBSD compatibility patches

2017-10-23 Thread Greg V
This set of patches includes a bunch of simple fixes from FreeBSD ports and a loader patch that fixes Wayland/EGL clients not reading GPU device name correctly on FreeBSD. Greg V (5): anv: add ETIME fallback define loader: use drmGetDeviceNameFromFd2 from libdrm compiler: define endian for

[Mesa-dev] [PATCH 1/5] anv: add ETIME fallback define

2017-10-23 Thread Greg V
FreeBSD only has ETIMEDOUT, not ETIME --- src/intel/vulkan/anv_device.c | 4 src/intel/vulkan/anv_gem.c| 4 src/intel/vulkan/anv_queue.c | 4 3 files changed, 12 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 67028e8da9..fab2a394

[Mesa-dev] [PATCH 5/5] util: use OpenBSD/NetBSD code on FreeBSD/DragonFly

2017-10-23 Thread Greg V
Obtained from: FreeBSD ports --- src/util/u_endian.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/u_endian.h b/src/util/u_endian.h index b9d563dd43..7be33dd3a5 100644 --- a/src/util/u_endian.h +++ b/src/util/u_endian.h @@ -54,7 +54,7 @@ # define PIPE_ARCH_BIG_ENDIA

[Mesa-dev] [PATCH 3/5] compiler: define endian for FreeBSD

2017-10-23 Thread Greg V
Obtained from: FreeBSD ports --- src/mesa/main/compiler.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 43a06b4313..8652aac36c 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -51,6 +51,9 @@ #if defined(__li

[Mesa-dev] [PATCH 2/5] loader: use drmGetDeviceNameFromFd2 from libdrm

2017-10-23 Thread Greg V
Reduce code duplication and automatically benefit from OS-specific fixes to libdrm (e.g. in FreeBSD ports). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103283 --- src/loader/loader.c | 36 +--- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git

[Mesa-dev] [PATCH 4/5] winsys/svga/drm: add ERESTART define for *BSD

2017-10-23 Thread Greg V
Obtained from: FreeBSD ports --- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c index 79f9d950d9..62a2af6d65 100644 --- a/src/gallium/winsys/svg

Re: [Mesa-dev] [PATCH 1/5] anv: add ETIME fallback define

2017-10-25 Thread Greg V
On 10/24/2017 20:16, Dylan Baker wrote: Quoting Greg V (2017-10-23 13:20:39) FreeBSD only has ETIMEDOUT, not ETIME --- src/intel/vulkan/anv_device.c | 4 src/intel/vulkan/anv_gem.c| 4 src/intel/vulkan/anv_queue.c | 4 3 files changed, 12 insertions(+) diff --git a

Re: [Mesa-dev] [PATCH 3/5] compiler: define endian for FreeBSD

2017-10-26 Thread Greg V
On 10/26/2017 17:07, Emil Velikov wrote: On 23 October 2017 at 21:20, Greg V wrote: Obtained from: FreeBSD ports --- src/mesa/main/compiler.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 43a06b4313..8652aac36c 100644 --- a

Re: [Mesa-dev] [PATCH 1/5] anv: add ETIME fallback define

2017-10-26 Thread Greg V
On 10/26/2017 17:02, Emil Velikov wrote: On 24 October 2017 at 18:21, Greg V wrote: On 10/24/2017 20:16, Dylan Baker wrote: Quoting Greg V (2017-10-23 13:20:39) FreeBSD only has ETIMEDOUT, not ETIME --- src/intel/vulkan/anv_device.c | 4 src/intel/vulkan/anv_gem.c| 4

[Mesa-dev] [PATCH 11/14] meson: fix missing dependencies

2018-01-03 Thread Greg V
--- src/gallium/drivers/radeonsi/meson.build | 2 +- src/mesa/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index 58132bf072..8a7045de0d 100644 --- a/src/gall

[Mesa-dev] [PATCH 04/14] anv: add ETIME fallback define

2018-01-03 Thread Greg V
FreeBSD only has ETIMEDOUT, not ETIME --- src/intel/vulkan/anv_device.c | 4 src/intel/vulkan/anv_gem.c| 4 src/intel/vulkan/anv_queue.c | 4 3 files changed, 12 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 680f5a752d..6f77d33f

[Mesa-dev] [PATCH 08/14] meson: fix BSD build

2018-01-03 Thread Greg V
--- meson.build | 43 ++- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index d9f7ea9b2c..af62baf437 100644 --- a/meson.build +++ b/meson.build @@ -199,12 +199,13 @@ if with_dri_i915 or with_gallium_i915 dep_lib

[Mesa-dev] [PATCH 09/14] meson: do not redeclare pkg-config dependencies (yet)

2018-01-03 Thread Greg V
get_pkgconfig_variable('cflags') always returns an empty list. This only worked on Linux because the libraries were in the standard include path. --- meson.build | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index af62b

[Mesa-dev] [PATCH 03/14] radv: add ETIME fallback define

2018-01-03 Thread Greg V
FreeBSD only has ETIMEDOUT, not ETIME --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index 4578a9b548..84ceee2f5d 100644 --- a/src/amd/vulkan/win

[Mesa-dev] [PATCH 01/14] util: fix ElfW macro

2018-01-03 Thread Greg V
Elf64_Nhdr exists, Elf_Nhdr does not. Obtained from: FreeBSD ports --- src/util/build_id.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/build_id.c b/src/util/build_id.c index 536c74360e..cb35e90b09 100644 --- a/src/util/build_id.c +++ b/src/util/build_id.c @@

[Mesa-dev] [PATCH 13/14] swr: fix clang 5 null cast warning

2018-01-03 Thread Greg V
--- src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h index 6c801c7ff6..abb0c53ec4 100644 -

[Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-03 Thread Greg V
so my implementation uses TinyXML2, which is a new dependency. And I couldn't even figure out how to link to it with all the libtool stuff. Had to test it with LD_PRELOAD :D This will be much easier to do with Meson. Greg V (14): util: fix ElfW macro vc4, vc5: add ETIME fallback define

[Mesa-dev] [PATCH 07/14] anv: FreeBSD support in the allocator

2018-01-03 Thread Greg V
Use umtx for futex, and SHM_ANON for memfd. Also use temp files as memfd fallback for other OSes. Obtained from: FreeBSD ports --- src/intel/vulkan/anv_allocator.c | 56 1 file changed, 56 insertions(+) diff --git a/src/intel/vulkan/anv_allocator.c b/src

[Mesa-dev] [PATCH 10/14] meson: handle LLVM 'x.x.xgit-revision' versions

2018-01-03 Thread Greg V
When LLVM is built inside of a git repo (even way below, e.g. /usr/ports/.git exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version becomes something like 5.0.0git-f8ab206b2176. Don't blow up on these versions. --- meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git

[Mesa-dev] [PATCH 05/14] anv: use POSIX sysconf to get memory info on non-glibc systems

2018-01-03 Thread Greg V
--- src/intel/vulkan/anv_device.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 6f77d33f93..2d3062d103 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -25,7 +25,9 @@ #include #incl

[Mesa-dev] [PATCH 12/14] swr: build on FreeBSD/DragonFlyBSD

2018-01-03 Thread Greg V
(Needs CPU topology detection to actually work) --- src/gallium/drivers/swr/rasterizer/common/os.h | 3 ++- src/gallium/drivers/swr/rasterizer/core/threads.cpp | 4 ++-- src/gallium/drivers/swr/swr_fence.cpp | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/

[Mesa-dev] [PATCH 06/14] anv: remove unused Linux-specific include

2018-01-03 Thread Greg V
--- src/intel/vulkan/anv_queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index b1662c1720..5da652df68 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -27,7 +27,6 @@ #include #include -#incl

[Mesa-dev] [PATCH 14/14] meson: glsl: add missing nir header dependency

2018-01-03 Thread Greg V
--- src/compiler/glsl/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build index 6aaa9bab05..9e7589c325 100644 --- a/src/compiler/glsl/meson.build +++ b/src/compiler/glsl/meson.build @@ -200,7 +200,7 @@ files_

[Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define

2018-01-03 Thread Greg V
FreeBSD only has ETIMEDOUT, not ETIME --- src/gallium/drivers/vc4/vc4_bufmgr.c | 4 src/gallium/drivers/vc5/vc5_bufmgr.c | 4 2 files changed, 8 insertions(+) diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c index 274c4c3120..cbc1e1ae1b 100644 --

Re: [Mesa-dev] [PATCH 09/14] meson: do not redeclare pkg-config dependencies (yet)

2018-01-08 Thread Greg V
On 01/06/2018 01:27, Dylan Baker wrote: We absolutely can't merge this as-is, it will break all of the these since they'll end up linking the backend and frontend, which we're not supposed to do. The bug you linked to has nothing to do with the problem you describe either, that issue is that `de

Re: [Mesa-dev] [PATCH 11/14] meson: fix missing dependencies

2018-01-08 Thread Greg V
On 01/06/2018 01:36, Dylan Baker wrote: Quoting Greg V (2017-12-31 08:55:25) --- src/gallium/drivers/radeonsi/meson.build | 2 +- src/mesa/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/meson.build b/src

Re: [Mesa-dev] [PATCH 08/14] meson: fix BSD build

2018-01-08 Thread Greg V
On 01/06/2018 01:06, Dylan Baker wrote: Quoting Greg V (2017-12-31 08:55:22) +is_like_linux = host_machine.system() == 'linux' or host_machine.system().contains('bsd') # FIXME: illumos? This won't cover dragonflybsd, which is just 'dragonfly' I think

[Mesa-dev] [PATCH v2 1/4] meson: fix BSD build

2018-01-18 Thread Greg V
Reviewed-by: Dylan Baker --- meson.build | 44 +++- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index f3179c3806..32cd5dffa4 100644 --- a/meson.build +++ b/meson.build @@ -202,18 +202,20 @@ if with_dri_i915 or w

Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-18 Thread Greg V
On 01/17/2018 00:59, Dylan Baker wrote: Just wanted to see how things were going on this, especially for the meson bits as I'd like to get them merged before the 18.0 merge window closes. Sorry for the delay, was distracted by other things :) Edited the meson patches and re-sent them to the list

[Mesa-dev] [PATCH v2 3/4] meson: fix getting cflags from pkg-config

2018-01-18 Thread Greg V
get_pkgconfig_variable('cflags') always returns an empty list, it's a function for getting *custom* variables. Meson does not yet support asking for cflags, so explicitly invoke pkg-config for now. --- meson.build | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meso

[Mesa-dev] [PATCH v2 2/4] meson: handle LLVM 'x.x.xgit-revision' versions

2018-01-18 Thread Greg V
When LLVM is built inside of a git repo (even way below, e.g. /usr/ports/.git exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version becomes something like 5.0.0git-f8ab206b2176. New meson versions already handle this, but we support older versions too. Reviewed-by: Dylan Baker

[Mesa-dev] [PATCH v2 4/4] meson: fix missing dependencies

2018-01-18 Thread Greg V
--- meson.build | 4 src/gallium/drivers/radeonsi/meson.build | 2 +- src/mesa/meson.build | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 7dbc9d6518..a301a62f3c 100644 --- a/meson.build ++

Re: [Mesa-dev] [PATCH 01/14] util: fix ElfW macro

2018-01-18 Thread Greg V
On 01/18/2018 19:57, Emil Velikov wrote: On 31 December 2017 at 16:55, Greg V wrote: Elf64_Nhdr exists, Elf_Nhdr does not. Can you please add a typedef in FreeBSD sources, pretty please? I'm not a committer :) raised an issue in bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.c

Re: [Mesa-dev] [PATCH 12/14] swr: build on FreeBSD/DragonFlyBSD

2018-01-18 Thread Greg V
On 01/18/2018 21:01, Emil Velikov wrote: On 31 December 2017 at 16:55, Greg V wrote: (Needs CPU topology detection to actually work) IMHO it might be better to drop the patch, until its actually working. There's little point in building it if one cannot use it. What do you think? Ye

Re: [Mesa-dev] [PATCH 00/14] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-18 Thread Greg V
On 01/18/2018 21:18, Emil Velikov wrote: Hi Greg, On 31 December 2017 at 16:55, Greg V wrote: Hello everyone and happy new year! :) This set of patches makes the Meson build work on FreeBSD, including RADV, ANV, wayland-egl, VAAPI, VDPAU. Huge thanks for beating these into shape and

[Mesa-dev] [PATCH v2 2/5] util: emulate futex on FreeBSD using umtx

2018-01-19 Thread Greg V
Obtained from: FreeBSD ports --- src/util/futex.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/util/futex.h b/src/util/futex.h index 4402893069..425e34a2cd 100644 --- a/src/util/futex.h +++ b/src/util/futex.h @@ -51,6 +51,28 @@ static inline int futex_wait(uint32

[Mesa-dev] [PATCH v2 0/5] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-19 Thread Greg V
Rebased, updated and improved patches. Now with util headers for anonymous fds (memfd/SHM_ANON/mkostemp) and physical memory size, reducing code duplication across the codebase. A few other meson patches were sent as https://patchwork.freedesktop.org/series/36714/ Greg V (5): meson: fix

Re: [Mesa-dev] [PATCH 02/14] vc4, vc5: add ETIME fallback define

2018-01-19 Thread Greg V
On 01/18/2018 22:49, Dylan Baker wrote: Quoting Emil Velikov (2018-01-18 10:40:40) On 18 January 2018 at 17:13, Dylan Baker wrote: I'm not sure how Emil feels about this (and the related patches) but I think it might be better to handle this at the build system level, for meson it would look s

[Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-19 Thread Greg V
h \ diff --git a/src/util/anon_file.h b/src/util/anon_file.h new file mode 100644 index 00..fa8642dc98 --- /dev/null +++ b/src/util/anon_file.h @@ -0,0 +1,169 @@ +/* + * Copyright © 2012 Collabora, Ltd. + * Copyright © 2018 Greg V + * + * Permission is hereby granted, free of charge, t

Re: [Mesa-dev] [PATCH 11/14] meson: fix missing dependencies

2018-01-19 Thread Greg V
On 01/18/2018 20:58, Emil Velikov wrote: On 6 January 2018 at 01:50, Dylan Baker wrote: On January 5, 2018 5:00:59 PM PST, Greg V wrote: On 01/06/2018 01:36, Dylan Baker wrote: Quoting Greg V (2017-12-31 08:55:25) --- ../src/gallium/include/state_tracker/vdpau_dmabuf.h:37:10: fatal

[Mesa-dev] [PATCH v2 5/5] anv: add MAP_POPULATE fallback define for portability

2018-01-19 Thread Greg V
FreeBSD does not have MAP_POPULATE --- src/intel/vulkan/anv_allocator.c | 4 1 file changed, 4 insertions(+) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index aa669359d7..1fe00f9ef6 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_

[Mesa-dev] [PATCH v2 1/5] meson: fix missing dependencies

2018-01-19 Thread Greg V
--- src/gallium/drivers/radeonsi/meson.build | 2 +- src/mesa/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index 97c7a41244..f41c0b4f18 100644 --- a/src/ga

[Mesa-dev] [PATCH v2 4/5] util: add phys_memory.h for all memory measurements

2018-01-19 Thread Greg V
x27;mesa-sha1.h', 'os_time.c', 'os_time.h', + 'phys_memory.h', 'sha1/sha1.c', 'sha1/sha1.h', 'ralloc.c', diff --git a/src/util/phys_memory.h b/src/util/phys_memory.h new file mode 100644 index 00..f0822b4fec ---

[Mesa-dev] [PATCH 1/3] meson: Use system_has_kms_drm in default driver selection

2018-03-06 Thread Greg V
--- meson.build | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index d68460231c..e71f4ddd73 100644 --- a/meson.build +++ b/meson.build @@ -87,6 +87,8 @@ if (with_gles1 or with_gles2) and not with_opengl error('building OpenGL ES without

[Mesa-dev] [PATCH 0/3] Meson patches for FreeBSD

2018-03-06 Thread Greg V
Hi! Here's a few more patches that let me successfully build, package and install fully working Meson-built Mesa-git on my FreeBSD box. Greg V (3): meson: Use system_has_kms_drm in default driver selection meson: use relative paths in megadriver symlinks meson: make GLX_USE_TLS opt

[Mesa-dev] [PATCH 2/3] meson: use relative paths in megadriver symlinks

2018-03-06 Thread Greg V
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble when packaging the libraries. --- bin/install_megadrivers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_megadrivers.py b/bin/inst

[Mesa-dev] [PATCH 3/3] meson: make GLX_USE_TLS optional

2018-03-06 Thread Greg V
FreeBSD builds Mesa with --disable-glx-tls in autotools because: https://github.com/dumbbell/test-tls-initial-exec Add the equivalent option to Meson. --- meson.build | 5 - meson_options.txt | 6 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.

Re: [Mesa-dev] [PATCH 1/3] meson: Use system_has_kms_drm in default driver selection

2018-03-08 Thread Greg V
On 3/8/2018 9:41 PM, Dylan Baker wrote: Do vulkan drivers work on all of the BSDs? I don't think anyone tried them on anything other than FreeBSD, but why add extra conditionals? Building them by default makes them more noticeable for e.g. package maintainers :) ___

Re: [Mesa-dev] [PATCH v2 1/4] meson: fix BSD build

2018-01-21 Thread Greg V
On 01/19/2018 16:30, Eric Engestrom wrote: On Wednesday, 2018-01-17 23:54:15 +0300, Greg V wrote: Reviewed-by: Dylan Baker A couple questions and a nit-pick for the error messages, but with that: Reviewed-by: Eric Engestrom @@ -225,7 +227,7 @@ with_platform_surfaceless = false

[Mesa-dev] [PATCH v3 00/12] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-24 Thread Greg V
e to build on FreeBSD/DragonFly as is (with this patch only). ETIME discussion on FreeBSD bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225324 Greg V (12): meson: fix missing dependencies meson: fix BSD build meson: glsl: add missing nir header dependency meson: fix gett

[Mesa-dev] [PATCH v3 02/12] meson: fix BSD build

2018-01-24 Thread Greg V
Reviewed-by: Dylan Baker Reviewed-by: Eric Engestrom --- meson.build | 54 -- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/meson.build b/meson.build index 4edfc24bfb..33c1b5c91b 100644 --- a/meson.build +++ b/meson.build @@ -

[Mesa-dev] [PATCH v3 03/12] meson: glsl: add missing nir header dependency

2018-01-24 Thread Greg V
--- src/compiler/glsl/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build index b0c0de810a..36edcdc535 100644 --- a/src/compiler/glsl/meson.build +++ b/src/compiler/glsl/meson.build @@ -202,7 +202,7 @@ files_

[Mesa-dev] [PATCH v3 01/12] meson: fix missing dependencies

2018-01-24 Thread Greg V
Reviewed-by: Emil Velikov --- src/gallium/drivers/radeonsi/meson.build | 2 +- src/mesa/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index 97c7a41244..9a6

Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Greg V
On 01/24/2018 15:16, Emil Velikov wrote: On 24 January 2018 at 11:58, Greg V wrote: +#ifndef __FreeBSD__ mkstemp does exist on FreeBSD, right? If so you can drop this guard and simplify the one in os_create_anonymous_file(). The guard is there because this function (create_tmpfile_cloexec

[Mesa-dev] [PATCH v3 09/12] anv: remove unused Linux-specific include

2018-01-24 Thread Greg V
--- src/intel/vulkan/anv_queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index c6b2e01c62..29583982ef 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -27,7 +27,6 @@ #include #include -#incl

[Mesa-dev] [PATCH v3 06/12] util: add phys_memory.h for all memory measurements

2018-01-24 Thread Greg V
x27;mesa-sha1.h', 'os_time.c', 'os_time.h', + 'phys_memory.h', 'sha1/sha1.c', 'sha1/sha1.h', 'ralloc.c', diff --git a/src/util/phys_memory.h b/src/util/phys_memory.h new file mode 100644 index 00..f0822b4fec ---

Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Greg V
On 01/19/2018 20:38, Emil Velikov wrote: On 18 January 2018 at 22:54, Greg V wrote: Move the Weston os_create_anonymous_file code from egl/wayland into util, add support for Linux memfd and FreeBSD SHM_ANON, use that code in anv instead of explicit memfd calls for portability. --- Looks quite

[Mesa-dev] [PATCH v3 04/12] meson: fix getting cflags from pkg-config

2018-01-24 Thread Greg V
get_pkgconfig_variable('cflags') always returns an empty list, it's a function for getting *custom* variables. Meson does not yet support asking for cflags, so explicitly invoke pkg-config for now. --- meson.build | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meso

[Mesa-dev] [PATCH v3 12/12] clover: fix build with LLVM 5

2018-01-24 Thread Greg V
The error was: no matching constructor for initialization of 'std::vector' --- src/gallium/state_trackers/clover/llvm/metadata.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/llvm/metadata.hpp b/src/gallium/state_trackers/clover/llvm/metad

[Mesa-dev] [PATCH v3 05/12] meson: handle LLVM 'x.x.xgit-revision' versions

2018-01-24 Thread Greg V
When LLVM is built inside of a git repo (even way below, e.g. /usr/ports/.git exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version becomes something like 5.0.0git-f8ab206b2176. New meson versions already handle this, but we support older versions too. Reviewed-by: Dylan Baker

[Mesa-dev] [PATCH v3 07/12] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Greg V
urn 0; assert(fd != 0); - if (ftruncate(fd, size) == -1) - return 0; - return fd; } diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources index effc2c72cb..8ef7b7ab87 100644 --- a/src/util/Makefile.sources +++ b/src/util/Makefile.sources @@ -1,4 +1,5 @@ MESA_UTIL_F

[Mesa-dev] [PATCH v3 11/12] swr: support FreeBSD/DragonFlyBSD

2018-01-24 Thread Greg V
--- src/gallium/drivers/swr/rasterizer/common/os.h | 3 ++- src/gallium/drivers/swr/rasterizer/core/threads.cpp | 4 ++-- src/gallium/drivers/swr/swr_fence.cpp | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h

[Mesa-dev] [PATCH v3 10/12] anv: add MAP_POPULATE fallback define for portability

2018-01-24 Thread Greg V
FreeBSD does not have MAP_POPULATE --- src/intel/vulkan/anv_allocator.c | 4 1 file changed, 4 insertions(+) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 7e7e88ad77..6a8d73a437 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_

[Mesa-dev] [PATCH v3 08/12] util: emulate futex on FreeBSD using umtx

2018-01-24 Thread Greg V
Obtained from: FreeBSD ports Acked-by: Emil Velikov --- src/util/futex.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/util/futex.h b/src/util/futex.h index 4402893069..425e34a2cd 100644 --- a/src/util/futex.h +++ b/src/util/futex.h @@ -51,6 +51,28 @@ static inli

Re: [Mesa-dev] [PATCH v3 00/12] BSD portability (Meson, ANV, RADV, VC4/5, SWR)

2018-01-26 Thread Greg V
On 01/25/2018 15:07, Emil Velikov wrote: On 24 January 2018 at 18:02, Greg V wrote: meson: updated with suggestions from review. anon_file: added a debug_name argument for anv, removed posix_fallocate and retry loops that were copy-pasted from weston, etc. SWR: since there's an enviro