summaryrefslogtreecommitdiffstats
path: root/src/util
Commit message (Collapse)AuthorAgeFilesLines
* util: Add fast division helpersMarek Olšák2018-10-101-0/+44
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* util: import public domain code for integer division by a constantMarek Olšák2018-10-104-0/+365
| | | | | | | | | | | | | 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-104-0/+115
| | | | Reviewed-by: Ian Romanick <[email protected]>
* util/u_queue: add UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITYMarek Olšák2018-10-063-1/+17
| | | | | Initial version discussed with Rob Clark under a different patch name. This approach leaves his driver unaffected.
* util: Make xmlconfig.c build on Solaris without d_type in dirent (v2)Alan Coopersmith2018-10-051-0/+8
| | | | | | | | | v2: check for lstat() failing Fixes: 04bdbbcab3c "xmlconfig: read more config files from drirc.d/" Signed-off-by: Alan Coopersmith <[email protected]> Reviewed-by: Roland Mainz <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* drirc: add a workaround for ARMA 3Marek Olšák2018-10-041-0/+4
| | | | Cc: 18.2 <[email protected]>
* util: add disk_cache_get_function_identifier()Timothy Arceri2018-10-031-0/+16
| | | | | | | | | | | | This can be used as a drop in replacement for disk_cache_get_function_timestamp(). Here we use build-id to generate a driver-id rather than build timestamp if available. This should resolve issues such as distros using reproducable builds and flatpak not having real build timestamps. Reviewed-by: Marek Olšák <[email protected]>
* util: rename timestamp param in disk_cache_create()Timothy Arceri2018-10-031-4/+4
| | | | | | | | Only some drivers use a timestamp here. Others use things such as build-id, or even a combination of build-ids from Mesa and LLVM. Reviewed-by: Marek Olšák <[email protected]>
* util: disable cache if we have no build-id and timestamp is zeroTimothy Arceri2018-10-021-0/+9
| | | | | | | | | | Timestamp can be zero for example when Flatpak is used. In this case just disable the cache rather then segfaulting when incompatible cache items are loaded. V2: actually return false when mtime is 0. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* util: Add macro to get number of elements in dynarrayCaio Marcelo de Oliveira Filho2018-09-211-0/+1
| | | | Reviewed-by: Christian Gmeiner <[email protected]>
* Revert "utils/u_math: break dependency on gallium/utils"Dylan Baker2018-09-201-38/+5
| | | | | | This reverts commit 0abce6d7700ee42eb00c787732ec1fdefe250d03. Which broke the windows build.
* utils/u_math: break dependency on gallium/utilsDylan Baker2018-09-201-5/+38
| | | | | | | | | | | | | | Currently u_math needs gallium utils for cpu detection. Most of what u_math uses out of u_cpu_detection is duplicated in src/mesa/x86 (surprise!), so I've just reworked it as much as possible to use the x86/common_x86_features.h macros instead of the gallium ones. The mesa implementation is a header only approach, with no external dependencies. There is one small function that was copied over, as promoting u_cpu_detection is itself a fairly hefty undertaking, as it depends on u_debug, and this fixes the bug for now. bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107870 Tested-by: Vinson Lee <[email protected]>
* mesa: move legacy dri config option texture_depthTimothy Arceri2018-09-187-134/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option fthrottle_modeTimothy Arceri2018-09-187-114/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option def_max_anisotropyTimothy Arceri2018-09-187-29/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option no_neg_lod_biasTimothy Arceri2018-09-187-31/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option round_modeTimothy Arceri2018-09-186-70/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove unused dri option float_depthTimothy Arceri2018-09-187-29/+0
| | | | | | | This seems to have only been used by DRI1 drivers which were removed with e4344161bde2. Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option dither_modeTimothy Arceri2018-09-186-92/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy dri config option color_reductionTimothy Arceri2018-09-187-82/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: move legacy TCL dri config optionsTimothy Arceri2018-09-187-151/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* util: use force_compat_profile for Wolfenstein The Old BloodTimothy Arceri2018-09-181-0/+4
| | | | | | | | | | | This game is looking for some odd extension after creating a core context such as ARB_vertex_program and EXT_framebuffer_object. Rather then enabling these in core this forces the game to use compat. This allows the game to run and seems to work without issues. All other id tech games/engines use a compat profile. Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add force_compat_profile option to driconfigTimothy Arceri2018-09-181-0/+5
| | | | Reviewed-by: Marek Olšák <[email protected]>
* move pthread_setaffinity_np check to the build systemDylan Baker2018-09-171-4/+0
| | | | | | | | | | | | | | | | | Rather than trying to encode all of the rules in a header, lets just put them in the build system where they belong. This fixes the build on FreeBSD, which does have pthraed_setaffinity_np, but it's in a pthread_np.h, not behind _GNU_SOURCE. FreeBSD also implements cpu_set slightly differently, so additional changes would be required to get it working right there anyway. v2: - fix #define in autotools Fixes: 9f1bbbdbbd77d346c74c7abbb31f399151a85713 ("util: try to fix the Android and MacOS build") Cc: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* util: try to fix the Android and MacOS buildMarek Olšák2018-09-101-2/+5
| | | | | | | | Bionic does not have pthread_setaffinity_np. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107869 Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Tapani Pälli <[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]>
* Require Visual Studio 2015.Jose Fonseca2018-09-101-3/+1
| | | | | | | | We no longer need or use Visual Studio 2013. https://ci.appveyor.com/project/jrfonseca/mesa/build/52 Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: pin driver threads to a specific L3 cache on AMD Zen (v2)Marek Olšák2018-09-071-0/+57
| | | | | | v2: use set_context_param Reviewed-by: Brian Paul <[email protected]>
* move u_math to src/utilDylan Baker2018-09-074-0/+893
| | | | | | | | | | | | | | | 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]>
* mesa/util: add missing va_end() after va_copy()Andrii Simiklit2018-09-061-0/+1
| | | | | | | | | | | MSDN: "va_end must be called on each argument list that's initialized with va_start or va_copy before the function returns." Reviewed-by: Eric Engestrom <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107810 Fixes: c6267ebd6c8a "gallium/util: Stop bundling our snprintf implementation." Signed-off-by: Andrii Simiklit <[email protected]>
* mesa/util: don't ignore NULL returned from 'malloc'Andrii Simiklit2018-09-061-1/+1
| | | | | | | | | | We should exit from the function 'util_vasprintf' with error code -1 for case where 'malloc' returns NULL Reviewed-by: Eric Engestrom <[email protected]> Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit <[email protected]>
* mesa/util: don't use the same 'va_list' instance twiceAndrii Simiklit2018-09-061-1/+1
| | | | | | | | The first usage of the 'va_list' instance could change it. Reviewed-by: Eric Engestrom <[email protected]> Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit <[email protected]>
* meson: consolidate langs listsEric Engestrom2018-09-061-3/+9
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* st/mesa, gallium: add a workaround for No Mans SkyTimothy Arceri2018-08-302-0/+6
| | | | | | | | The spec seems clear this is not allowed but the Nvidia binary forces apps to add layout qualifiers so this works around the issue for No Mans Sky until the CTS can be sorted out. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: enable radeonsi_zerovram for No Mans SkyTimothy Arceri2018-08-301-0/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: add radeonsi_zerovram driconfig optionTimothy Arceri2018-08-301-0/+5
| | | | | | | More and more games seem to require this so lets make it a config option. Reviewed-by: Marek Olšák <[email protected]>
* meson: Actually load translation filesDylan Baker2018-08-281-1/+4
| | | | | | | | | Currently we run the script but don't actually load any files, even in a tarball where they exist. Fixes: 3218056e0eb375eeda470058d06add1532acd6d4 ("meson: Build i965 and dri stack") Reviewed-by: Eric Engestrom <[email protected]>
* Revert "configure: allow building with python3"Emil Velikov2018-08-242-2/+2
| | | | | | | | | | | | | | This reverts commit ae7898dfdbe5c8dab7d11c71862353f1ae43feb0. Turns out the python scripts are _not_ fully python 3 compatible. As Ilia reported using get_xmlpool.py with LANG=C produces some weird output - see the link for details. Even though the issue was spotted with the autoconf build, it exposes a genuine problem with the script (and lack of lang handling of the meson build.) https://lists.freedesktop.org/archives/mesa-dev/2018-August/203508.html
* configure: allow building with python3Emil Velikov2018-08-232-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 - python3 chosen prior to python2 Signed-off-by: Emil Velikov <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* util/dynarray: add a clone functionCaio Marcelo de Oliveira Filho2018-08-221-0/+9
| | | | | | | v2: Fix mem_ctx parameter type. (Thomas) Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* util: rb_tree: add safe iteratorsLionel Landwerlin2018-08-221-0/+58
| | | | | | | | v2: Add helper to make iterators more readable (Rafael) Fix rev iterator bug (Rafael) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* util/xmlpool: make indentation coherentEric Engestrom2018-08-211-6/+6
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* mesa: move legacy hyperz option from dri configTimothy Arceri2018-08-217-31/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove unused dri config option disable_shader_bit_encodingTimothy Arceri2018-08-217-29/+0
| | | | | | | This was added as a workaround for Heaven 3.0 but was later removed by 5ead448719f3 to allow Heaven 4.0 to work correctly. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: drop legacy no_rast dri optionTimothy Arceri2018-08-217-29/+0
| | | | | | Add enviroment var overrides to legacy drivers instead. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move legacy dri config option texture_unitsTimothy Arceri2018-08-207-29/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove unused dri config option texture_heapsTimothy Arceri2018-08-207-108/+0
| | | | | | | This seems to have only been used by DRI1 drivers which were removed with e4344161bde2. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move legacy dri config option texture_blend_qualityTimothy Arceri2018-08-207-40/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* util: remove unused S3TC translation for dri configTimothy Arceri2018-08-206-39/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove dri configs unused software-fallback optionsTimothy Arceri2018-08-207-62/+0
| | | | | | | These seems to have only been used by DRI1 drivers which were removed with e4344161bde2. Reviewed-by: Ian Romanick <[email protected]>