aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
Commit message (Collapse)AuthorAgeFilesLines
* drirc: Add sddm-greeter to adaptive_sync blacklist.Mario Kleiner2019-02-191-0/+3
| | | | | | | | | This is the sddm login screen. Fixes: a9c36dbf9c56 ("drirc: Initial blacklist for adaptive sync") Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: 19.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
* driconf: add Civ6Sub executable for Civilization 6Marek Olšák2019-02-191-0/+6
| | | | | | | I'm getting Civ6Sub instead of Civ6. Cc: 18.3 19.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* radeonsi: always enable NIR for Civilization 6 to fix corruptionMarek Olšák2019-02-191-0/+3
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104602 Cc: 18.3 19.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* radeonsi: add driconf option radeonsi_enable_nirMarek Olšák2019-02-191-0/+5
| | | | | Cc: 18.3 19.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* drirc/i965: add option to disable 565 configs and visualsTapani Pälli2019-02-151-0/+5
| | | | | | | | | | | We have cases where we would not like to expose these. v2: call the option allow_rgb565_configs for consistency with existing allow_rgb10_configs (Eric, Jason) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* util/tests: compile to something sensible in release buildsEric Engestrom2019-02-1412-0/+24
| | | | | | | | assert()-based tests make no sense without asserts, so make sure asserts are compiled in, even if the rest of the code has asserts turned off. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
* util: move BITFIELD macros to util/macros.hTimothy Arceri2019-02-081-0/+18
| | | | Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* driconf: drop unused macroEric Engestrom2019-02-071-4/+0
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* gallium: Enable ASIMD/NEON on aarch64.Matt Turner2019-01-241-2/+9
| | | | | | | | NEON (now called ASIMD) is available on all aarch64 CPUs. Our code was missing an aarch64 path, leading to util_cpu_caps.has_neon always being false on aarch64. Reviewed-by: Eric Anholt <eric@anholt.net>
* nir: check NIR_SKIP to skip passes by nameCaio Marcelo de Oliveira Filho2019-01-182-0/+16
| | | | | | | | | | | | | | Passes' function names, separated by comma, listed in NIR_SKIP environment variable will be skipped in debug mode. The mechanism is hooked into the _PASS macro, like NIR_PRINT. The extra macro NIR_SKIP is available as a developer convenience, to skip at pointer other than the passes entry points. v2: Fix typo in NIR_SKIP macro. (Bas) Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
* util: Helper to create sets and hashes with pointer keysCaio Marcelo de Oliveira Filho2019-01-144-0/+27
| | | | | | | These combinations are common enough and deserve a shortcut. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Eric Engestrom <eric@engestrom.ch>
* drirc: Initial blacklist for adaptive syncNicholas Kazlauskas2018-12-281-0/+85
| | | | | | | | | | | Applications that don't present at a predictable rate (ie. not games) shouldn't have adapative sync enabled. This list covers some of the common desktop compositors, web browsers and video players. [ Michel Dänzer: Added entry for firefox-esr ] Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
* util: Add adaptive_sync driconf optionNicholas Kazlauskas2018-12-281-0/+5
| | | | | | | | | | | This option lets the user decide whether mesa should notify the window manager / DDX driver that the current application is adaptive sync capable. It's off by default. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
* util: Get program name based on path when possibleNicholas Kazlauskas2018-12-281-1/+22
| | | | | | | | | | | | | | Some programs start with the path and command line arguments in argv[0] (program_invocation_name). Chromium is an example of an application using mesa that does this. This tries to query the real path for the symbolic link /proc/self/exe to find the program name instead. It only uses the realpath if it was a prefix of the invocation to avoid breaking wine programs. Cc: Timothy Arceri <tarceri@itsqueeze.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
* util/hash_table: Add _mesa_hash_table_init functionIan Romanick2018-12-162-13/+34
| | | | | Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* util/slab: Rename slab_mempool typed parameters to mempoolIan Romanick2018-12-142-14/+14
| | | | | | | Now everything with type 'struct slab_child_pool *' is name pool, and everything with type 'struct slab_mempool *' is named mempool. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* util: env_var_as_unsigned() helperRob Clark2018-11-272-0/+22
| | | | | | | So I can drop env2u() helper from freedreno_util.h and get rid of one small ir3 dependency on gallium/freedreno Signed-off-by: Rob Clark <robdclark@gmail.com>
* util: promote u_memory to src/utilDylan Baker2018-11-276-0/+450
| | | | | as well as os_memory* Reviewed-by: Rob Clark <robdclark@gmail.com>
* drirc: enable glthread for Talos PrincipleMarek Olšák2018-11-201-0/+7
| | | | | | | | Ryzen 1700X, Vega 56, 1600x900, 4xAA: improvement +4.4% Immediate mode was needed. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* meson: Add tests to suitesDylan Baker2018-11-206-8/+16
| | | | | | | | | | | | | | | | 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 <gert.wollny@collabora.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
* xmlpool: update translation po filesEric Engestrom2018-11-136-193/+950
| | | | | | | | | | | These files are close to 4 years out of date; a lot's changed since. Let's just check in a recently-regenerated version. Changes generated by running `ninja xmlpool-{pot,update-po,gmo}`. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Acked-by: Emil Velikov <emil.velikov@collabora.com>
* util/ralloc: Make sizeof(linear_header) a multiple of 8Matt Turner2018-11-121-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch sizeof(linear_header) was 20 bytes in a non-debug build on 32-bit platforms. We do some pointer arithmetic to calculate the next available location with ptr = (linear_size_chunk *)((char *)&latest[1] + latest->offset); in linear_alloc_child(). The &latest[1] adds 20 bytes, so an allocation would only be 4-byte aligned. On 32-bit SPARC a 'sttw' instruction (which stores a consecutive pair of 4-byte registers to memory) requires an 8-byte aligned address. Such an instruction is used to store to an 8-byte integer type, like intmax_t which is used in glcpp's expression_value_t struct. As a result of the 4-byte alignment returned by linear_alloc_child() we would generate a SIGBUS (unaligned exception) on SPARC. According to the GNU libc manual malloc() always returns memory that has at least an alignment of 8-bytes [1]. I think our allocator should do the same. So, simple fix with two parts: (1) Increase SUBALLOC_ALIGNMENT to 8 unconditionally. (2) Mark linear_header with an aligned attribute, which will cause its sizeof to be rounded up to that alignment. (We already do this for ralloc_header) With this done, all Mesa's unit tests now pass on SPARC. [1] https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html Fixes: 47e17586924f ("glcpp: use the linear allocator for most objects") Bug: https://bugs.gentoo.org/636326 Reviewed-by: Eric Anholt <eric@anholt.net>
* util/ralloc: Switch from DEBUG to NDEBUGMatt Turner2018-11-121-14/+4
| | | | | | | The debug code is all asserts, so protect it with the same thing that controls assert. Reviewed-by: Eric Anholt <eric@anholt.net>
* util: Fix warning in u_cpu_detect on non-x86Alyssa Rosenzweig2018-11-121-2/+2
| | | | | | | | | regs is only set and used on x86; on other platforms (like ARM), this code causes a trivial warning, solved by moving the regs declaration to the architecture-dependent usage. Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
* autotools: library-dependency when no sse and 32-bitSergii Romantsov2018-11-052-2/+3
| | | | | | | | | | | | | | | 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 <dylan@pnwbakers.com> CC: Lionel G Landwerlin <lionel.g.landwerlin@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560 Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* meson: don't install translation files18.3-branchpointDylan Baker2018-11-011-1/+1
| | | | | | | Tested-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Fixes: 7834926a4f5ca0a60ec3d18c87a1e0a68b615820 ("meson: add support for generating translation mo files")
* util/gen_xmlpool: Make use of python's foreach loopDylan Baker2018-10-311-30/+27
| | | | | | | Instead of using a while loop with indexing. This is much cleaner. This requires some other small changes. Acked-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: Don't use len to test for container emptinessDylan Baker2018-10-311-4/+4
| | | | | | | This is a very common python anti-pattern. Not using length allows us to go through faster C paths, but has the same meaning. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: Don't write via shell redirectionDylan Baker2018-10-315-65/+58
| | | | | | | | | | | | | Using shell redirection to write to a file is more complicated than necessary, and has the potential to run into unicode encoding problems. It's also less code. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108530 v2: - update commit message to say less about LANG=C - use flags instead of positional arguments for the script (Emil) Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: use with statement to open fileDylan Baker2018-10-311-34/+32
| | | | | | Which ensures it is closed at the end of the scope. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: use a main functionDylan Baker2018-10-311-61/+66
| | | | | | Again, just good style Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: Use print function instad of sys.stderr.writeDylan Baker2018-10-311-5/+4
| | | | | | This ensures that stderr is flushed, unlike writing Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: Use more standard styleDylan Baker2018-10-311-29/+29
| | | | | | | | | gen_xmlpool uses a style unlike the rest of mesa, spaces between function/method calls and the parens, strange whitespace to force lining up method calls, and some other whitespace stuff. Since I'm going to be doing some work in the file, I'm going to start cleaning those up. Acked-by: Emil Velikov <emil.velikov@collabora.com>
* util/xmlpool: Update for meson generationDylan Baker2018-10-314-12/+16
| | | | | | | | | | | Meson won't put the .gmo files in the layout that python's gettext.translation() expects, it puts them in the build directory in a flat layout. This modifies android and autotools to do the same (scons doesn't work with translations at all) v3: - Squash 4 patches into this patch Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* meson: add support for generating translation mo filesDylan Baker2018-10-314-1/+8
| | | | | | | | | | | | | | | Meson has handy a handy built-in module for handling gettext called i18n, this module works a bit differently than our autotools build does, namely it doesn't automatically generate translations instead it creates 3 new top level targets to run. These are: xmlpool-pot xmlpool-update-po xmlpool-gmo v2: - Add new files to autotools dist tarball Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util/gen_xmlpool: use argparse for argument handlingDylan Baker2018-10-311-11/+9
| | | | | | | | This is a little cleaner than just looking at sys.argv, but it's also going to allow us to handle the differences in the way meson and autotools handle translations more cleanly. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
* configure: allow building with python3Emil Velikov2018-10-312-2/+2
| | | | | | | | | | | | | | | Pretty much all of the scripts are python2+3 compatible. Check and allow using python3, while adjusting the PYTHON2 refs. Note: - python3.4 is used as it's the earliest supported version - python2 chosen prior to python3 v2: use python2 by default Cc: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
* util: move u_cpu_detect to utilDylan Baker2018-10-304-0/+698
| | | | | | | | | CC: vlee@freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107870 Fixes: 80825abb5d1a7491035880253ffd531c55acae6b ("move u_math to src/util") Tested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* util: Move u_debug to utilsDylan Baker2018-10-304-0/+905
| | | | | Tested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* util: Move os_misc to utilDylan Baker2018-10-304-0/+282
| | | | | | | this is needed by u_debug Tested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* util: s/0/NULL/ for pointerEric Engestrom2018-10-301-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* util: Change remaining uint32 cache ids to sha1David McFarland2018-10-261-6/+10
| | | | | | | | | | | | After discussion with Timothy Arceri. disk_cache_get_function_identifier was using only the first byte of the sha1 build-id. Replace disk_cache_get_function_identifier with implementation from radv_get_build_id. Instead of writing a uint32_t it now writes to a mesa_sha1. All drivers using disk_cache_get_function_identifier are updated accordingly. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Fixes: 83ea8dd99bb1 ("util: add disk_cache_get_function_identifier()")
* util: use C99 declaration in the for-loop set_foreach() macroEric Engestrom2018-10-252-8/+4
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* util: use C99 declaration in the for-loop hash_table_foreach() macroEric Engestrom2018-10-254-10/+5
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
* util: use *unsigned* ints for bit operationsEric Engestrom2018-10-231-1/+1
| | | | | | | | Fixes errors thrown by GCC's Undefined Behaviour sanitizer (ubsan) every time this macro is used. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* util: document a limitation of util_fast_udiv32Marek Olšák2018-10-171-1/+7
| | | | trivial
* util: Add foreach_reverse for dynarrayCaio Marcelo de Oliveira Filho2018-10-151-0/+6
| | | | | | | | | Useful to walk the array removing elements by swapping them with the last element. v2: Change iteration to make sure we never underflow. (Jason) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* util: Add tests for fast integer division by constantsJason Ekstrand2018-10-104-0/+546
| | | | | | | | | 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 <marek.olsak@amd.com>
* util: Add power-of-two divisor support to compute_fast_udiv_infoMarek Olšák2018-10-102-2/+23
| | | | | Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* util: Generalize fast integer division to be variable bit-widthJason Ekstrand2018-10-102-45/+39
| | | | | | | | | | | | | | | There's nothing inherently fixed-width in the code. All that's required to generalize it is to make everything internally 64-bit and pass UINT_BITS in as a parameter to util_compute_fast_[us]div_info. With that, it can now handle 8, 16, 32, and 64-bit integer division by a constant. We also add support for division by 1 and by other powers of 2. This is useful if you want to divide by a uniform value in a shader where you have the opportunity to adjust the uniform on the CPU before passing it in. Reviewed-by: Marek Olšák <marek.olsak@amd.com>