summaryrefslogtreecommitdiffstats
path: root/src/util
Commit message (Collapse)AuthorAgeFilesLines
* util: Implement unreachable for MSVC using __assumeIan Romanick2014-11-051-0/+6
| | | | | | | | | Based on the description of __assume at: http://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: initialize locale_t with a static objectChia-I Wu2014-10-301-10/+8
| | | | | | | | | | | | _mesa_strtod and _mesa_strtof may be called from multiple threads. They need to be thread-safe. v2: platform checks are now done in configure.ac Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* configure: check for xlocale.h and strtofChia-I Wu2014-10-301-8/+4
| | | | | | | | With the assumptions that xlocale.h implies newlocale and strtof_l. SCons is updated to define HAVE_XLOCALE_H on linux and darwin. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* util: add _mesa_strtod and _mesa_strtofChia-I Wu2014-10-303-1/+129
| | | | | | | | | Both core mesa and glsl have their own wrappers for strtof_l. Merge and move them to util/. They are compiled with a C++ compiler so that we can make them thread-safe in a following commit. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* util: Use reg_belongs_to_class instead of BITSET_TESTJason Ekstrand2014-10-241-1/+1
| | | | | | | | | This shouldn't be a functional change since reg_belongs_to_class is just a wrapper around BITSET_TEST. It just makes the code a little easier to read. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* util: Add assume() macro.Matt Turner2014-10-231-0/+14
| | | | Reviewed-by: Ian Romanick <[email protected]>
* util: Include in Android buildsTomasz Figa2014-10-031-0/+102
| | | | | | | | | | This patch fixes Android build failures by including src/util directory in compilation. Files inside of this directory are compiled into libmesa_util static library and linked with resulting libGLES_mesa. Signed-off-by: Tomasz Figa <[email protected]> CC: <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* ralloc: Mark ralloc functions with gcc's malloc attribute.Matt Turner2014-09-252-8/+14
| | | | | | | Cuts a few hundred bytes from the DRI drivers, so it must give gcc some extra information. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Replace a priori knowledge of gcc attributes with configure tests.Matt Turner2014-09-251-4/+7
| | | | | | | | Note that I had to add support for testing the packed attribute to m4/ax_gcc_func_attribute.m4. Reviewed-by: Jason Ekstrand <[email protected]> [C bits] Reviewed-by: Ian Romanick <[email protected]>
* mesa: Replace a priori knowledge of gcc builtins with configure tests.Matt Turner2014-09-251-11/+3
| | | | | | | | | | | | | | Presumbly this will let clang and other compilers use the built-ins as well. Notice two changes specifically: - in _mesa_next_pow_two_64(), always use __builtin_clzll and add a static assertion that this is safe. - in macros.h, remove the clang-specific definition since it should be able to detect __builtin_unreachable in configure. Reviewed-by: Jason Ekstrand <[email protected]> [C bits] Reviewed-by: Ian Romanick <[email protected]>
* util: fix SCons buildBrian Paul2014-09-231-0/+3
| | | | after register_allocate.c was moved to util/ directory.
* mesa: Move register_allocate.c to util.Eric Anholt2014-09-234-0/+738
| | | | | | | | | | | | | The r300 gallium driver is using it outside of the Mesa tree, and I wanted to do so for vc4 as well. Rather than make the multiple-definitions problem even more complicated, just move it to more-shared code. v2: Don't forget to delete the symlink in r300 (review by Matt). Delete more r300-helper references (review by Emil) Don't prefix util/ header inclusion with "util/" (review by Emil) Reviewed-by: Matt Turner <[email protected]> (v1) Reviewed-by: Emil Velikov <[email protected]> (v1)
* util: move shared rgtc code to util (v2)Dave Airlie2014-09-174-1/+520
| | | | | | | | | | | This was being shared using a ../../ get out of gallium into mesa, and I swore when I did it I'd fix things when we got a util dir, we did, so I have. v2: move RGTC_DEBUG define Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* util: remove ralloc_testEmil Velikov2014-08-083-105/+5
| | | | | | | | | The tests in an empty stub, which we're currently building twice. If anyone is interested in expanding it (adding actual tests) they can always bring it back. Suggested-by: Kenneth Graunke <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* util: add src/util/format_srgb.c to .gitignoreJuha-Pekka Heikkila2014-08-081-0/+1
| | | | | | | | | format_srgb.c is generated by format_srgb.py python script, having format_srgb.c in git ignore list will silence git complaints about untracked file. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util/tests/hash_table: Link against libmesautil instead of libmesaJason Ekstrand2014-08-051-4/+2
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82159 Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* util: include c99_compat.h in format_srgb.h to get 'inline' definitionBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* util: include c99_compat.h in hash_table.h to get 'inline' definitionBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/main: Use the RGB <-> sRGB conversion functions in libmesautilJason Ekstrand2014-08-041-0/+15
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: Move sRGB <-> RGB handling to libmesautilJason Ekstrand2014-08-045-2/+312
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-046-8/+133
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move the open-addressing linear-probing hash_table to src/util.Kenneth Graunke2014-08-0418-1/+1279
| | | | | | | | | | | | | | | | | This hash table is used in core Mesa, the GLSL compiler, and the i965 driver, which makes it a good candidate for the new src/util module. It's much faster than program/hash_table.[ch] (see commit 6991c2922f5 for data), and José's u_hash_table.c has a comment saying Gallium should probably consider switching to a linear probing hash table at some point. So this seems like the best candidate for a shared data structure. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-047-0/+1095
For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>