aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: Add ppc64el and s390x cross-build jobsMichel Dänzer2020-02-051-0/+1
| | | | | | | | | | | | | Using LLVM 8 for ppc64el and 7 for s390x (which hits some coroutine related issues with LLVM 8). There are some test failures we need to ignore for now. Also, the timeout needs to be bumped from the default 30s for some tests, because they can take longer under emulation. Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3643>
* util: move fnv1a hash implementation into its own headerAnthony Pesch2020-01-231-0/+1
| | | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
* util: import xxhashAnthony Pesch2020-01-231-0/+1
| | | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3475>
* util/vector: Fix u_vector_foreach when head rolls overC Stout2020-01-171-0/+1
| | | | | | | Also add unit tests for u_vector. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3453> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3453>
* util/format: add trivial srgb<->linear conversion testEric Engestrom2019-12-271-0/+1
| | | | | | | | | This would've caught 8829f9ccb0267d113283 ("u_format: add ETC2 to util_format_srgb/util_format_linear"). Suggested-by: Eric Anholt <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util/os_socket: Add socket related functions.Rafael Antognolli2019-12-131-0/+2
| | | | | | | | v3: - Add os_socket.c/h into Makefile.sources (Lionel) - Add empty non-linux implementation to public functions. Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa/main/util: moving gallium u_mm to util, remove main/mmAlejandro Piñeiro2019-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | Right now there are two copies of mm: * mesa/main/mm.[ch] * gallium/auxiliary/util/u_mm.[ch] At some point they splitted, and from the commit message it was not clear why it was not possible to have only one copy at a common place. Taking into account that was several years ago, Im assuming that it was not possible then. This change would allow to have one copy of the same code, and also being able to use that code out of mesa/main or gallium, if needed. This commit moves u_mm and removes mm, as u_mm has slightly more changes. Reviewed-by: Jose Fonseca <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-141-0/+2
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* util: Use ZSTD for shader cache if possibleDylan Baker2019-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows ZSTD instead of ZLIB to be used for compressing the shader cache. On a 72 core system emulating skl with a full shader-db (with i965): ZSTD: 1915.10s user 229.27s system 5150% cpu 41.632 total (cold cache) 225.40s user 10.87s system 3810% cpu 6.201 total (warm cache) 154M (235M on disk) ZLIB: 2231.33s user 194.24s system 1899% cpu 2:07.72 total (cold cache) 229.15s user 10.63s system 3906% cpu 6.139 total (warm cache) 163M (244M on disk) Tim Arceri sees (8 core ryzen and a full shader-db): ZSTD: 2505.22 user 40.50 system 3:18.73 elapsed 1280% CPU (cold cache) 418.71 user 14.93 system 0:46.53 elapsed 931% CPU (warm cache) 454.3 MB (681.7 MB on disk) ZLIB: 3069.83 user 40.02 system 4:20.13 elapsed 1195% CPU (cold cache) 425.50 user 15.17 system 0:46.80 elapsed 941% CPU (warm cache) 470.3 MB (701.4 MB on disk) Reviewed-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Eric Anholt <[email protected]>
* meson: move idep_xmlconfig_headers to xmlpool/Eric Engestrom2019-10-311-5/+0
| | | | | | | | That's where `xmlpool_options_h` is defined, and this way we can make sure nobody starts making use of it in the future :) Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* meson: split out idep_xmlconfig_headers from idep_xmlconfigEric Engestrom2019-10-311-2/+5
| | | | | | | A bunch of components need the former but not the latter. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* util: Add a util_sparse_array data structureJason Ekstrand2019-10-311-0/+3
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* meson/util: Don't run string_buffer tests on mingwDylan Baker2019-10-101-1/+4
| | | | | | | They succeed with MSVC but not with MinGW. I don't understand why they fail. Acked-by: Kristian H. Kristensen <[email protected]>
* meson: only build timspec test if timespec is availableDylan Baker2019-10-101-1/+3
| | | | | Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* meson: don't build or run mesa-sha1 test on windowsDylan Baker2019-10-101-11/+14
| | | | | | | | | It crashes hard (pop-up window and all). v2: - Change comment to FIXME Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* util/rb_tree: Add the unit testsJason Ekstrand2019-09-201-0/+12
| | | | | | | When I wrote the red-black tree implementation, I wrote tests for it but they never got imported into mesa. Reviewed-by: Lionel Landwerlin <[email protected]>
* Move blob from compiler/ to util/Jason Ekstrand2019-09-191-0/+15
| | | | | | | | There's nothing whatsoever compiler-specific about it other than that's currently where it's used. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* util: add fp64 -> fp32 conversion support for RTNE and RTZ rounding modesSamuel Iglesias Gonsálvez2019-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | In order to be coherent with the pre-existent API for half floats, this new API for double is the one meant to be used when doing double to float conversions. It is no more than a wrapper for the softfloat.h API but we meant to keep that one private. v2: - Fix bug in _mesa_double_to_float_rtz() in the inf/nan detection using the exponent value. v3: - Replace custom f64 -> f32 implementations with the softfloat one (Andres). v4: - Added API usage clarifying comments (Caio). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* util: add softfloat functions to operate with doubles and floatsSamuel Iglesias Gonsálvez2019-09-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented fadd, fsub, fmul and ffma for doubles and ffma for floats, rounding to zero, using a modified implementation from Berkely Softfloat 3e Library. Their implementation correctness has been checked with the Berkeley TestFloat Release 3e tool for x86_64. v2: - Reuse util_last_bit64() in _mesa_count_leading_zeros64() implementation (Connor). v3: - Add a specific ffma for floats version (Connor). - Implement the ffma for doubles version (Andres). - Lots of fixes in fadd, fsub and fmul (Andres). - Improved documentation (Andres). v4: - Added f64 -> f32 conversion function (Andres). - Added f32 -> f16 RTZ conversion function (Andres). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Tested-by: Andres Gomez <[email protected]> Acked-by: Caio Marcelo de Oliveira Filho <[email protected]>
* util: android logging supportRob Clark2019-09-061-1/+13
| | | | | | | | | In particular, it would be nice for failed debug_assert() msgs to show up in logcat. Signed-off-by: Rob Clark <[email protected]> Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* util: add anon_file.h for all memfd/temp file usageGreg V2019-08-071-0/+2
| | | | | | | | | 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/aubinator instead of explicit memfd calls for portability. Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* meson: replace last uses of libxmlconfig with idep_xmlconfigEric Engestrom2019-08-031-2/+2
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* meson: drop unused dep_{thread,dl}Eric Engestrom2019-08-031-1/+1
| | | | | | | | Unused as of last commit. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* meson: replace libmesa_util with idep_mesautilEric Engestrom2019-08-031-7/+11
| | | | | | | | | | | This automates the include_directories and dependencies tracking so that all users of libmesa_util don't need to add them manually. Next commit will remove the ones that were only added for that reason. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* util: add a timespec helperLionel Landwerlin2019-07-291-0/+2
| | | | | | | | Copied from Weston, upon Daniel's suggestion Signed-off-by: Lionel Landwerlin <[email protected]> Suggested-by: Daniel Stone <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* meson: set up a proper internal dependency for xmlconfigEric Engestrom2019-06-271-0/+7
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* util: Add a helper for faster remaindersConnor Abbott2019-05-311-0/+1
| | | | | | | | | | This should be at least as fast as using fast_idiv_by_const, and has the advantage that the precomputation is simple enough to be evaluated at Mesa-compile time for hash tables and sets which have a fixed table of possible divisors. Acked-by: Eric Anholt <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* util/tests: add basic unit tests for bitsetDave Airlie2019-05-031-0/+12
| | | | | | | The last test here currently fails as there is a bug in bitset.h Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* util: add os_read_file() helperEric Engestrom2019-04-301-0/+1
| | | | | | | | readN() taken from igt. os_read_file() inspired by igt_sysfs_get() Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* util: Add a DAG datastructure.Eric Anholt2019-03-111-0/+1
| | | | | | I keep writing this for various schedulers. Acked-by: Timothy Arceri <[email protected]>
* driconf: add DTD to allow the drirc xml (00-mesa-defaults.conf) to be validatedEric Engestrom2019-02-281-1/+15
| | | | | | | | This DTD can be used to validate the drirc xml: $ xmllint --noout --valid 00-mesa-defaults.conf Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: Add tests to suitesDylan Baker2018-11-201-3/+6
| | | | | | | | | | | | | | | | Meson test has a concepts of suites, which allow tests to be grouped together. This allows for a subtest of tests to be run only (say only the tests for nir). A test can be added to more than one suite, but for the most part I've only added a test to a single suite, though I've added a compiler group that includes nir, glsl, and glcpp tests. To use this you'll need to invoke meson test directly, instead of ninja test (which always runs all targets). it can be invoked as: `meson test -C builddir --suite $suitename` (meson test has addition options that are pretty useful). Tested-By: Gert Wollny <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* autotools: library-dependency when no sse and 32-bitSergii Romantsov2018-11-051-1/+1
| | | | | | | | | | | | | | | Building of 32bit Mesa may fail if __SSE__ is not specified. Added missed dependency from libm. v2: avoided dependecy on any flag, just link v3: meson doesn't fail, but have added dependency on libm CC: Dylan Baker <[email protected]> CC: Lionel G Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560 Signed-off-by: Sergii Romantsov <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* util: move u_cpu_detect to utilDylan Baker2018-10-301-0/+2
| | | | | | | | | CC: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107870 Fixes: 80825abb5d1a7491035880253ffd531c55acae6b ("move u_math to src/util") Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move u_debug to utilsDylan Baker2018-10-301-0/+2
| | | | | Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move os_misc to utilDylan Baker2018-10-301-0/+2
| | | | | | | this is needed by u_debug Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Add tests for fast integer division by constantsJason Ekstrand2018-10-101-0/+1
| | | | | | | | | While I generally trust rediculousfish to have done his homework, we've made some adjustments to suit the needs of mesa and it'd be good to test those. Also, there's no better place than unit tests to clearly document the different edge cases of the different methods. Reviewed-by: Marek Olšák <[email protected]>
* util: import public domain code for integer division by a constantMarek Olšák2018-10-101-0/+2
| | | | | | | | | | | | | Compilers can use this to generate optimal code for integer division by a constant. Additionally, an unsigned division by a uniform that is constant but not known at compile time can still be optimized by passing 2-4 division factors to the shader as uniforms and executing one of the fast_udiv* variants. The signed division algorithm doesn't have this capability. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Add a simple big math libraryJason Ekstrand2018-10-101-0/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa/meson: 32bit xmlconfig linkageSergii Romantsov2018-09-101-0/+1
| | | | | | | | | | | | | | | | | | Building of 32bit mesa with meson causes linkage issue: "undefined reference to `util_get_process_name'" Fixed by adding link-with mesa_util for xmlconfig primary. v2: Removed '[]', commit message corrected. v3: Reverted changes in gbm and glx libraries. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107843 Fixes: 2e1e6511f76370870b5cd "util: extract get_process_name from xmlconfig.c" Cc: Marek Olšák <[email protected]> Cc: Dylan Baker <[email protected]> Signed-off-by: Sergii Romantsov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* move u_math to src/utilDylan Baker2018-09-071-0/+2
| | | | | | | | | | | | | | | Currently we have two sets of functions for bit counts, one in gallium and one in core mesa. The ones in core mesa are header only in many cases, since they reduce to "#define _mesa_bitcount popcount", but they provide a fallback implementation. This is important because 32bit msvc doesn't have popcountll, just popcount; so when nir (for example) includes the core mesa header it doesn't (and shouldn't) link with core mesa. To fix this we'll promote the version out of gallium util, then replace the core mesa uses with the util version, since nir (and other non-core mesa users) can and do link with mesautils. Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* driconf: move ${sysconfdir}/drirc to ${datadir}/drirc.d/00-mesa-defaults.confQiang Yu2018-08-171-1/+1
| | | | | | | | | ${sysconfdir} is for store admin config files, so move this mesa default config file to ${datadir}/drirc.d. Signed-off-by: Qiang Yu <[email protected]> Acked-by: Michel Dänzer <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* xmlconfig: read more config files from drirc.d/Qiang Yu2018-08-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Driver and application can put their drirc files in ${datadir}/drirc.d/ with name xxx.conf. Config files will be read and applied in file name alphabetic order. So there are three places for drirc listed in order: 1. /usr/share/drirc.d/ 2. /etc/drirc 3. ~/.drirc v4: fix meson build v3: 1. seperate driParseConfigFiles refine into another patch 2. fix entries[i] mem leak v2: drop /etc/drirc.d Signed-off-by: Qiang Yu <[email protected]> Acked-by: Michel Dänzer <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: Build with Python 3Mathieu Bridon2018-08-101-1/+1
| | | | | | | | | | | | Now that all the build scripts are compatible with both Python 2 and 3, we can flip the switch and tell Meson to use the latter. Since Meson already depends on Python 3 anyway, this means we don't need two different Python stacks to build Mesa. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* util: move process.[ch] to u_process.[ch]Dylan Baker2018-08-011-2/+2
| | | | | | | | | | | | | On windows process.h is a system provided header, and it's required in include/c11/threads_win32.h. This header interferes with searching for that header, and results in windows build warnings with scons, but errors in meson which doesn't allow implicit function declarations. Just rename process to u_process, which follows the style of utils anyway. Fixes: 2e1e6511f76370870b5cde10caa9ca3b6d0dc65f ("util: extract get_process_name from xmlconfig.c") Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util/set: add a basic unit testCaio Marcelo de Oliveira Filho2018-07-121-0/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* util: rb-tree: A simple, invasive, red-black treeJason Ekstrand2018-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is a simple, invasive, liberally licensed red-black tree implementation. It's an invasive data structure similar to the Linux kernel linked-list where the intention is that you embed a rb_node struct the data structure you intend to put into the tree. The implementation is mostly based on the one in "Introduction to Algorithms", third edition, by Cormen, Leiserson, Rivest, and Stein. There were a few other key design points: * It's an invasive data structure similar to the [Linux kernel linked list]. * It uses NULL for leaves instead of a sentinel. This means a few algorithms differ a small bit from the ones in "Introduction to Algorithms". * All search operations are inlined so that the compiler can optimize away the function pointer call. Reviewed-by: Lionel Landwerlin <[email protected]>
* util: extract get_process_name from xmlconfig.cMarek Olšák2018-07-041-0/+2
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* util: Add a randomized test for the virtual memory allocatorScott D Phillips2018-05-311-0/+1
| | | | | | | | | | | | | | | | | The test pseudo-randomly makes allocations and deallocations with the virtual memory allocator and checks that the results are consistent. Specifically, we test that: * no result from the allocator overlaps an already allocated range * allocated memory fulfills the stated alignment requirement * a failed result from the allocator could not have been fulfilled * memory freed to the allocator can later be allocated again v2: - fix if() in test() to actually run fill() v3: - add c++11 build flag (Jason) - test the full 64-bit range (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
* util: Add a virtual memory allocatorJason Ekstrand2018-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | This is simple linear-walk first-fit allocator roughly based on the allocator in the radeon winsys code. This allocator has two primary functional differences: 1) It cleanly returns 0 on allocation failure 2) It allocates addresses top-down instead of bottom-up. The second one is needed for Intel because high addresses (with bit 47 set) need to be canonicalized in order to work properly. If we allocate bottom-up, then high addresses will be very rare (if they ever happen). We'd rather always have high addresses so that the canonicalization code gets better testing. v2: - [scott-ph] remove _heap_validate() if NDEBUG is defined (Jordan) Reviewed-by: Scott D Phillips <[email protected]> Tested-by: Scott D Phillips <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>