Re: [Mesa-dev] [PATCH 2/2] anv: implement OpenBSD get_available_system_memory()

2019-11-30 Thread Jonathan Gray
On Sun, Dec 01, 2019 at 03:22:01AM +1100, Jonathan Gray wrote: > On Sun, Dec 01, 2019 at 02:21:49AM +1100, Jonathan Gray wrote: > > map linux /proc/meminfo "MemAvailable" to uvm free pages > > On second thought HW_USERMEM64 may be a better fit here. > > "The amount of available non-kernel memory

Re: [Mesa-dev] [PATCH 2/2] anv: implement OpenBSD get_available_system_memory()

2019-11-30 Thread Jonathan Gray
On Sun, Dec 01, 2019 at 02:21:49AM +1100, Jonathan Gray wrote: > map linux /proc/meminfo "MemAvailable" to uvm free pages On second thought HW_USERMEM64 may be a better fit here. "The amount of available non-kernel memory in bytes" Which ends up being physmem - uvmexp.wired (memory that can't be

[Mesa-dev] [PATCH 2/2] anv: implement OpenBSD get_available_system_memory()

2019-11-30 Thread Jonathan Gray
map linux /proc/meminfo "MemAvailable" to uvm free pages Signed-off-by: Jonathan Gray --- src/intel/vulkan/anv_device.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 81e3905ae99..ce93718c106 100644 --- a/src/i

[Mesa-dev] [PATCH 1/2] anv: get total system memory on OpenBSD

2019-11-30 Thread Jonathan Gray
Use sysctl to get total ram on OpenBSD where sysinfo() is not available. Signed-off-by: Jonathan Gray --- src/intel/vulkan/anv_device.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 250f75e9936..81e3905ae99

[Mesa-dev] [PATCH] util/futex: use futex syscall on OpenBSD

2019-11-30 Thread Jonathan Gray
Make use of the futex syscall added in OpenBSD 6.2. Signed-off-by: Jonathan Gray --- src/util/futex.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/util/futex.h b/src/util/futex.h index 268af92882a..cf8dd0206c9 100644 --- a/src/util/futex.h +++ b/src/util/futex.h @@

[Mesa-dev] [PATCH] util/anon_file: add OpenBSD shm_mkstemp() path

2019-11-30 Thread Jonathan Gray
memfd_create() is a linux syscall replace the use of it with shm_mkstemp() on OpenBSD. unconditionally include stdlib.h for mkstemp()/mkostemp() Signed-off-by: Jonathan Gray --- src/util/anon_file.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/anon_fil

[Mesa-dev] [PATCH] util/u_thread: don't restrict u_thread_get_time_nano() to __linux__

2019-11-30 Thread Jonathan Gray
pthread_getcpuclockid() and clock_gettime() are also available on at least OpenBSD, FreeBSD, NetBSD, DragonFly, Cygwin. Signed-off-by: Jonathan Gray --- src/util/u_thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/u_thread.h b/src/util/u_thread.h index 6fc923c