--- 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 <stdbool.h> #include <string.h> #include <sys/mman.h> +#ifdef __GLIBC__ #include <sys/sysinfo.h> +#endif #include <unistd.h> #include <fcntl.h> #include <xf86drm.h> @@ -79,10 +81,15 @@ anv_compute_heap_size(int fd, uint64_t *heap_size) } /* Query the total ram from the system */ +#ifdef __GLIBC__ struct sysinfo info; sysinfo(&info); uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit; +#else + uint64_t total_ram = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE); +#endif + /* We don't want to burn too much ram with the GPU. If the user has 4GiB * or less, we use at most half. If they have more than 4GiB, we use 3/4. -- 2.15.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev