Commit Graph

1726 Commits

Author SHA1 Message Date
Michel Zou dbceb561b0 meson: call run_command with check=true
This avoids a warning in meson since the default value will change:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300

It's probably best to use the new default (true) that the old (false)

Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15776>
2022-04-25 18:43:50 +00:00
Jason Ekstrand 21a7b0f1ab util/set: Respect found in search_or_add_pre_hashed
Fixes: 491e7decad "util/set: add the found param to search_or_add"
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Jason Ekstrand 96944c8f65 util/blob: Add align helpers
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13184>
2022-04-22 19:38:52 +00:00
Dylan Baker 2766972911 util: remove simple_list
Down to two invasive linked list implementations in Mesa!

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:58 -07:00
Dylan Baker 0ae787f223 util/list.h: add a function to move an item in a list
This allows for a 1:1 replacement of simple_list move_to_head (though
I've tried to make this function more generally useful.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15418>
2022-04-22 09:39:47 -07:00
Yonggang Luo ea7cda93f3 misc: replace `#ifdef\s\s__cplusplus` with `#ifdef\s__cplusplus`
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15762>
2022-04-21 14:43:39 +00:00
Yonggang Luo 9aa094d1b1 misc: Replace `#ifdef\t__cplusplus` with `#ifdef\s\s__cplusplus`
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15762>
2022-04-21 14:43:39 +00:00
Jason Ekstrand 1b8a43a0ba util: Remove util_cpu_detect
util_cpu_detect is an anti-pattern: it relies on callers high up in the call
chain initializing a local implementation detail. As a real example, I added:

...a Mali compiler unit test
...that called bi_imm_f16() to construct an FP16 immediate
...that calls _mesa_float_to_half internally
...that calls util_get_cpu_caps internally, but only on x86_64!
...that relies on util_cpu_detect having been called before.

As a consequence, this unit test:

...crashes on x86_64 with USE_X86_64_ASM set
...passes on every other architecture
...works on my local arm64 workstation and on my test board
...failed CI which runs on x86_64
...needed to have a random util_cpu_detect() call sprinkled in.

This is a bad design decision. It pollutes the tree with magic, it causes
mysterious CI failures especially for non-x86_64 developers, and it is not
justified by a micro-optimization.

Instead, let's call util_cpu_detect directly from util_get_cpu_caps, avoiding
the footgun where it fails to be called.  This cleans up Mesa's design,
simplifies the tree, and avoids a class of a (possibly platform-specific)
failures. To mitigate the added overhead, wrap it all in a (fast) atomic
load check and declare the whole thing as ATTRIBUTE_CONST so the
compiler will CSE calls to util_cpu_detect.

Co-authored-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15580>
2022-04-20 18:44:35 +00:00
Josh Billingsley ee9997e932 driconf: add SD Gundam G Generation Cross Rays
Required to avoid blank white screen on game launch

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15998>
2022-04-17 18:36:14 +00:00
Yonggang Luo 6d263ff5a3 util: Convert util/u_printf.cpp to util/u_printf.c
By doing this to remove the need of C++ runtime when not using llvmpipe

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15659>
2022-04-11 03:31:40 +00:00
Yonggang Luo 1dca31cda6 util: Add tests for u_printf.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15659>
2022-04-11 03:31:40 +00:00
Icecream95 ab3ee60282 util/hash_table: Remove Unicode byte order mark
The mark can confuse utilities which do not support Unicode, and no
other file has the character.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15728>
2022-04-10 23:28:47 +00:00
Erik Faye-Lund ae73a26355 util: limit error-dialogs to win32
These dialogs only exist on Windows, so let's not even expose a util
function for this on other platforms.

The code is only ever called from Windows specific code anyway.

While we're at it, clean up the name a bit as well.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>
2022-04-08 13:15:12 +00:00
Mike Blumenkrantz d32a897f4e driconf: add override for Xwayland
zink needs this to avoid deadlocking on startup

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>
2022-04-07 00:17:40 +00:00
Jason Ekstrand 0ba22b203d util/timespec: Return overflow from timespec_add_[mn]sec()
To avoid altering any currently existing callers, we continue on with
the calculation regardless of overflow.  This also matches the behavior
of GCC's __builtin_add_overflow().

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15651>
2022-04-06 00:38:22 +00:00
Emma Anholt 04cdd41fdc util/log: Add support for logging once.
These are not data-race safe (like many other once patterns in Mesa), so
they might not log exactly once, but it should be good enough for not
spamming the console.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14999>
2022-04-06 00:04:14 +00:00
Emma Anholt 0ee0d54985 util/log: Don't print an extra \n if the format string had one.
You're not supposed to include a '\n' in mesa_log*() messages because
android logging will log what you provide on its own line anyway, so each
mesa_log() should be the body of a log line.  But also, getting everyone
to consistently not do that is hopeless because we're all so trained by
printf().  So, just detect an existing \n and don't add a new one.

Cleans up deqp-vk debug output a bunch from turnip.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15332>
2022-04-05 21:37:46 +00:00
Yonggang Luo be1b30393b util: Getting u_debug.h not depends on pipe/*
Move pipe_debug_type into u_debug.h
Move pipe_debug_callback into u_debug.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo b2ece67f11 util: Rename PIPE_DEBUG_TYPE to UTIL_DEBUG_TYPE
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo ab225a1e36 util: Rename pipe_debug_type to util_debug_type
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo 2ca6ef22f7 util: Rename pipe_debug_callback to util_debug_callback
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Yonggang Luo 523675e995 util: Rename pipe_debug_message to util_debug_message
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>
2022-04-01 01:52:43 +00:00
Pierre-Eric Pelloux-Prayer 9c2605ae42 drirc: enable radeonsi_zerovram for Black Geyser
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6180
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15559>
2022-03-31 10:15:19 +00:00
Yonggang Luo c91e3c6a42 util: Should not use ASSERTED in util_thread_get_time_nano
The parameter is not ASSERTED
Fixes: 0f1b3fc17f ("util: Fixes unused parameter warnings")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15655>
2022-03-29 23:33:21 +00:00
Dave Airlie 783cab811d util/format: add new z24/s8 packing helper to pack z32/s8.
If zink runs on top of a vulkan impl with no 24-bit float support
it needs support to pack into 24-bit for GL.

To avoid having to make a temp copy, add a new helper to convert
and pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15516>
2022-03-26 01:22:15 +00:00
Yonggang Luo 0f1b3fc17f util: Fixes unused parameter warnings
The compiler warning:
```
../src/mesa/util/u_thread.h: In function 'util_thread_get_time_nano':
../src/mesa/util/u_thread.h:239:34: warning: unused parameter 'thread' [-Wunused-parameter]
  239 | util_thread_get_time_nano(thrd_t thread)
      |                           ~~~~~~~^~~~~~
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15553>
2022-03-24 21:56:48 +00:00
Yonggang Luo d9c3601e29 util: trim trailing space for files src/util/**/*
Using the following bash script doing that
```
cd src/util
find . -type f -print0 | xargs -0 -n1 sed -i 's/[ \t]*$//'
```

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15093>
2022-03-21 17:57:15 +00:00
Dylan Baker 4b10a4aaaa util/list.h: Add docstrings for list_add and list_addtail
Which have easily confused parameters: the first argument is the item to
be added, the second is the list to add to; but this could easily be the
other way around.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14983>
2022-03-17 18:25:55 +00:00
Juan A. Suarez Romero 54d0a2cfad util/disk_cache: rename MESA_GLSL_CACHE envvar
Rename MESA_GLSL_CACHE to MESA_SHADER_CACHE, as the on-disk cache can
store not only GLSL but also SPIR-V shaders.

v2:
 - Keep old envvar as deprecated (Mike)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390>
2022-03-17 11:15:53 +01:00
Mike Blumenkrantz 65bf1cbc26 gallium: add flag to draw info to indicate converted draws
this draw mode in particular requires driver-specific conversions
for queries (e.g., number of vertices), so pass that info through

the only limitation is that it doesn't work for dlists,
but I have yet to see a real use case of a statistics query being used with dlists

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15326>
2022-03-16 01:45:48 +00:00
Jonathan Gray e50eb1ce7a util: fix msvc build
Fix msvc build regression after 0536b69133
reported by Prodea Alexandru-Liviu.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6137
Fixes: 0536b69133 ("util: fix build with clang 10 on mips64")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15355>
2022-03-12 11:38:27 +11:00
Connor Abbott 410e746198 util/bitset: Fix off-by-one in __bitset_set_range
Fixes: b3b03e33c9 ("util/bitset: add BITSET_SET_RANGE(..)")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
2022-03-10 17:15:29 +00:00
Pierre-Eric Pelloux-Prayer caeec6262d util/slab: add slab_zalloc
A a variant that clears the allocated object to 0.

Cc: mesa-stable

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15298>
2022-03-09 08:48:59 +00:00
Pierre-Eric Pelloux-Prayer a5a8e19741 radeonsi: enable tc cpu_storage by default
Enable for all applications for all small buffers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15074>
2022-03-07 14:51:15 +01:00
Rob Clark d2e498b6a5 egl+libsync: Add helper to complain about invalid fence fd's
Debugging fd lifetime issues can be hard.  Add a helper for debug builds
to print out an error if an fd is not a fence fd, and sprinkle it around

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15094>
2022-03-04 22:16:20 +00:00
Pierre-Eric Pelloux-Prayer bb6ba8f21f radeonsi/drirc: use force_gl_vendor for Maya
Otherwise OpenCL initialization fails with "unknown vendor id 0".

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15151>
2022-03-01 07:43:26 +01:00
Jonathan Gray 6250a3bc18 util: use correct type in sysctl argument
Fixes build on OpenBSD/macppc powerpc

error: incompatible pointer types passing 'int *' to parameter of type 'size_t *'
    (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]

Fixes: 01bd21eef8 ("gallium: Import Dennis Smit cpu detection code.")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Jonathan Gray 0536b69133 util: fix build with clang 10 on mips64
On mips64, the compiler does not allow use of non-zero argument with
__builtin_frame_address(). However, the returned frame address is only
used when PIPE_ARCH_X86 is defined. The compile error can be avoided
by making #ifdef PIPE_ARCH_X86 cover the getting of frame address too.

The argument checking of __builtin_frame_address() has been present
as a debug assert in clang 8. In clang 10, there is a proper runtime
check for the argument. This is why the build has not failed before.

Fixes: dc94a0506f ("gallium: Do not add -Wframe-address option for gcc <= 4.4.")
from Visa Hankala

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Jonathan Gray f12c107b03 util/u_atomic: fix build on clang archs without 64-bit atomics
Make this build on clang architectures that don't have 64-bit atomic
instructions.  Clang doesn't allow redeclaration (and therefore
redefinition) of the __sync_* builtins.  Use #pragma redefine_extname
to work around that restriction.  Clang also turns __sync_add_and_fetch
into __sync_fetch_and_add (and __sync_sub_and_fetch into
__sync_fetch_and_sub) in certain cases, so provide these functions as
well.

Fixes: a6a38a038b ("util/u_atomic: provide 64bit atomics where they're missing")
patch from Mark Kettenis

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
2022-02-28 14:28:23 +00:00
Jonathan Gray afece589dc util: fix util_cpu_detect_once() build on OpenBSD
Correct type for sysctl argument to fix the build.

../src/util/u_cpu_detect.c:631:29: error: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
      sysctl(mib, 2, &ncpu, &len, NULL, 0);
                            ^~~~

Fixes: 5623c75e40 ("util: Fix setting nr_cpus on some BSD variants")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
2022-02-26 01:00:29 +00:00
Jonathan Gray 623ff4ec42 util: fix u_print.cpp build on OpenBSD
move include so va_list will be picked up via stdarg.h

In file included from ../src/util/u_printf.cpp:24:
../src/util/u_printf.h:43:41: error: unknown type name 'va_list'; did you mean '__va_list'?
size_t u_printf_length(const char *fmt, va_list untouched_args);
                                        ^~~~~~~
                                        __va_list
/usr/include/machine/_types.h:126:27: note: '__va_list' declared here
typedef __builtin_va_list       __va_list;
                                ^

and add includes to u_printf.h as suggested by Ilia Mirkin
stdarg.h for va_list and stddef.h for size_t

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
2022-02-26 01:00:29 +00:00
Jonathan Gray 7d609431d4 util: unbreak non-linux mips64 build
Put linux specific path inside an ifdef.  Unbreaks mips64 build on
OpenBSD and likely other systems without Elf64_auxv_t.

Fixes: 88b234d7a7 ("gallivm: add basic mips64 support and set mcpu to mips64r5 on ls3a4000")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15166>
2022-02-26 10:47:43 +11:00
Samuel Pitoiset 53ca85ac2a radv,drirc: move RADV workarounds to 00-radv-defaults.conf
Because we have to maintain two different packages of Mesa, one
specific to RADV and another one for RadeonSI and such, it's a bit
annoying to have to synchronize the drirc entries. Currently, only our
Mesa package installs 00-mesa-defaults.conf which means we have to
backport the drirc RADV changes.

This splits 00-mesa-defaults.conf in two to move the drirc RADV entries
to src/amd/vulkan/00-radv-defaults.conf. Meson will install the file
only if RADV is built.

There is still a caveat for common drirc workarounds like for WSI but
they are rare enough and we could still duplicate them if needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15152>
2022-02-25 15:05:56 +01:00
Qiang Yu f1650bd39b driconf: add Abaqus configs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Qiang Yu 1dac5454ea glx: keep native window glx drawable by driconf option
DRI3 window back buffer is a client resource, so it's destroyed
when context switch drawable for native window.

But some application like Abaqus may leave a dirty back buffer
and reuse it when switch back. So add a driconf option for these
kind of app to keep the entire GLX drawable for native window.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
2022-02-22 07:10:40 +00:00
Connor Abbott c21065c87a util/blob: Clarify rules on blob::data
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15028>
2022-02-19 01:25:46 +00:00
Samuel Pitoiset 80716b6f7e radv: enable radv_disable_aniso_single_level for The Evil Within 1&2
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6033
Fixes: 5ce4017a2b ("radv,aco: do not disable anisotropy filtering for non-mipmap images")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15011>
2022-02-16 17:28:46 +01:00
Pierre-Eric Pelloux-Prayer 3fad6325cd radeonsi: use SI_PROFILE_CLAMP_DIV_BY_ZERO for viewperf
Only one shader from the Creo subtests needs this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14931>
2022-02-16 11:13:25 +00:00
Jesse Natalie a84265938b driconf: Add Heaven entries for Windows .exe
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14965>
2022-02-10 20:19:00 +00:00
Lionel Landwerlin d014efa33e util/utrace: make generated code a tiny bit nicer to look at
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14818>
2022-02-01 09:28:30 +00:00
Lionel Landwerlin d0363baefd util/u_trace: make mako conditional code easier to read
It was difficult to read the conditional code.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14818>
2022-02-01 09:28:30 +00:00
Bas Nieuwenhuizen 51416b1a12 util/fossilize_db: Fix double free in error handling.
If the file ptr is not NULL then foz_destroy will also try to destroy it.

Fixes: eca6bb9540 ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14671>
2022-01-24 01:09:21 +00:00
Pierre-Eric Pelloux-Prayer 4e4a2d0f97 driconf: enable vs_position_always_invariant for Dirt Rally
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5648
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14614>
2022-01-21 10:00:35 +01:00
Dave Airlie 39bfb25627 includes: add windows lean and mean guard.
When we drop gl.h some files pick up windows.h from here
without lean/mean and it causes conflicts.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14605>
2022-01-19 21:54:58 +00:00
Mike Blumenkrantz 171ccdbf1c util: add ptralloc
many times it will be the case that an allocation for a block of data
needs to be done in one alloc() call such that the members of a struct as well
as some extra trailing data are all in the same allocation like

```
struct Test {
  unsigned a[4];
  unsigned c;
};
unsigned *b; //ptr to uint[8]
```

should be allocated as a single block of (13 * sizeof(unsigned)) memory using
C pointer offsets to allocate the memory as

```
| Test | b |
```

with something like

```
struct Test *t = malloc(sizeof(struct Test) + (8 * sizeof(unsigned)));
```

and then set `b` with

```
t->b = ((uint8_t*)t) + sizeof(struct Test);
```

this is annoying, awful to read, and (at least for dum-dums like me) prone to errors,
however, so having some utility functions which can deliver the same
functionality with better readability helps out this case by transforming it to

```
unsigned *b;
void **ptrs[] = {(void*)&b};
size_t sizes[] = {8 * sizeof(unsigned));
struct Test *t = ptralloc(sizeof(struct Test), 1, sizes, ptrs);
```

where `b` is now set to the appropriate offset in memory

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13678>
2022-01-19 04:10:58 +00:00
Lepton Wu d15021435e driconf: Fix unhandled tags in static conf
A rule with executable_regexp tag would match every executable
without this fix and force_glsl_extensions_warn would be always
set to true which breaks some dEQP tests.

Fixes: 5740ac3701 ("xmlconfig: Add static driconfig support")

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14562>
2022-01-14 22:09:50 +00:00
Lionel Landwerlin b70143f4e3 util/u_process: protect entrypoints for c++
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13996>
2022-01-14 20:17:44 +00:00
Samuel Pitoiset 74b0fbe2e9 radv: enable radv_disable_aniso_single_level for Battlefield 1 & V
Both games seem to have a bug. This can also be reproduced with
AMDVLK since PAL enabled anisotropic filtering for single level images.

Fixes: 5ce4017a2b ("radv,aco: do not disable anisotropy filtering for non-mipmap images")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5753
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14471>
2022-01-13 16:17:48 +00:00
Samuel Pitoiset e6173ed1d2 radv: allow to disable anisotropic filtering for single level image with drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14471>
2022-01-13 16:17:48 +00:00
Rhys Perry 9675cef53b radv: set radv_split_fma=true for Proton SotTR
The game seems to expect fma to be unfused. Fixes depth-prepass artifacts.

I haven't tested the D3D12 version, but I think it doesn't work and needs
sparse depth/stencil images.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14458>
2022-01-12 23:50:35 +00:00
Rhys Perry cc802cab7c radv: add RADV_DEBUG=splitfma
This splits application-provided FMA in vertex/geometry/tesselation/mesh
shaders.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14458>
2022-01-12 23:50:35 +00:00
Thomas H.P. Andersen 7daba1fe65 replace 0 with NULL for NULL pointers
This updates many places where 0 is used as NULL pointer.

There are a few warnings left when I build the default
configuration but they either relate to code
outside of mesa or where "None" is used instead.

Found with static analysis (smatch)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12174>
2022-01-10 22:53:32 +00:00
Gert Wollny 5bfe292708 util/primconvert: map only index buffer part that is needed
By putting vertex store and indices all in one buffer the larger part
of the shared buffer might actually only be vertex data we are not
interested in. Hence only map the part of the buffer that contains the
index data for the currently active draw command.

This helps drivers where a mapping operation is expensive, like e.g. virgl.

v2: - add comment about ranged buffer mapping (Pierre-Eric)
    - keep passing direct_draws[i].start to direct_draw_func, it looks
      like the "start" parameter is properly set in
      util_prim_restart_convert_to_direct

v3: Fix ws error (Mike)

Related: #5825

Fixes: f9d12bf50e
   vbo/dlist: use a single buffer object

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14423>
2022-01-07 16:35:43 +00:00
Lionel Landwerlin 8092d58e2e util/u_trace: protect against reentrant calls
With the Iris driver, the first tracepoint triggers the tracepoint for
"begin of command buffer" which leads to 2 tracepoints using the same
idx.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14254>
2022-01-03 18:15:08 +00:00
Marek Olšák 13bdd8da5e driconf: enable glthread for Minecraft-FTB, Stellaris, Battletech
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14368>
2022-01-03 17:45:59 +00:00
Jesse Natalie 5c3dfb4ef5 gallium/aux: Move index offsetting from prim restart to primconvert
Fixes: b34fed64 ("u_prim_restart: Fix index scanning with start offset")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5799
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14346>
2021-12-31 17:29:46 +00:00
Samuel Pitoiset 90994e4db7 radv: add drirc radv_disable_htile_layers and enable it for F1 2021
To workaround some flickering issues in the main menu.
See https://github.com/HansKristian-Work/vkd3d-proton/issues/950

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14354>
2021-12-31 14:27:32 +00:00
Kostiantyn Lazukin e9cc1633a2 util/ra: Fix numeric overflow during bitset allocation
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Kostiantyn Lazukin <kostiantyn.lazukin@globallogic.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5752
Fixes: d4a4cd20d5 ("util/ra: use adjacency matrix for undirected graph")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14224>
2021-12-19 13:10:26 -08:00
Bas Nieuwenhuizen 9e8fa8168b radv: Expose the ETC2 emulation.
As needed on Android (as it is required) and by driconf flag otherwise.
The non-Android case would be on the host side for an Android VM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14071>
2021-12-14 11:30:48 +00:00
Kostiantyn Lazukin d4a4cd20d5 util/ra: use adjacency matrix for undirected graph
Since this graph is actually not oriented, its adjacency matrix can be
represented using less than half bits required by full adjacency matrix.
It reduces memory consumption and number of cache misses. It also simplifies
logic of growing this matrix - no need to touch adjacency bits for previously
allocated number of nodes.

Move adjacency bits from nodes to graph to reduce the number of allocations.

No changes to shader-db.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kostiantyn Lazukin <kostiantyn.lazukin@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14189>
2021-12-14 09:19:01 +00:00
Caio Oliveira a235e02787 util: Use ralloc for strings in cache test
Also avoid warnings about asprintf result not being checked.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14054>
2021-12-11 08:06:10 +00:00
Caio Oliveira 51351760c2 util: Convert cache test to use gtest
Replace a bunch of helper functions for checking results with ones
from GTest.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14054>
2021-12-11 08:06:10 +00:00
Dave Airlie d051854cca treewide: drop mtypes/macros includes from main
These aren't required in lots of places, so remove them.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14127>
2021-12-08 22:14:45 +00:00
Lionel Landwerlin a3886fa471 util/u_vector: prevent C++ warning on cast from void* to something else
v2: fix windows build

v3: duplicate foreach macro for C/C++

v4: Extract casting macro

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (v3)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13997>
2021-12-07 19:41:06 +00:00
Timothy Arceri 51f71e0483 util: add workaround for SNK HEROINES Tag Team Frenzy
The game makes use of builtin functions that were moved to
compatibility shaders in GLSL 4.20 in its GLSL 4.20 shaders
without declaring the compatibility token.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5706

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14040>
2021-12-07 02:53:04 +00:00
Timothy Arceri f225e0679a util: add dri config option force_compat_shaders
This allows us to force all shaders to offer shader features only
provided to compatibility shaders.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14040>
2021-12-07 02:53:04 +00:00
Timur Kristóf 6cde424945 util: Add util_widen_mask function.
Widens the given bit mask by a multiplier, meaning that it will
replicate each bit by that amount.
For example: 0b101 widened by 2 will become: 0b110011

This is typically used in shader I/O to transform a 64-bit
writemask to a 32-bit writemask.

Moving this function here because it is used in multiple places.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14005>
2021-12-03 18:29:13 +00:00
Lionel Landwerlin 698343edc5 util/u_trace/perfetto: add new env variable to enable perfetto
When using the Vulkan API, command buffers can be recorded way before
perfetto is enabled. This can be problematic if you want already
recorded command buffers to produce traces.

This new environment variable makes perfetto enabled internally so
that command buffers are recorded with timestamps, even though no
perfetto recording happens.

v2: rename to GPU_TRACE_INSTRUMENT (Rob)

v3: Move instrumentation check to generated headers (Danylo)
    Decouple instrumentation enabling from tracing (Danylo)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13911>
2021-12-01 15:14:05 +00:00
Lionel Landwerlin 65697d6141 util/u_trace: add end_of_pipe property to tracepoints
In order to capture the timestamp when things actually end on Intel
GPU HW, we need to know whether the timestamp should be capture at the
top or end of pipeline.

v2: use one line python if/else (Danylo)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13911>
2021-12-01 15:14:05 +00:00
Marek Olšák ba8075031a util: add SHA1 printing and comparison functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13869>
2021-11-26 11:58:27 +00:00
Marek Olšák 94dd401287 driconf: enable glthread for Basemark GPU
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13947>
2021-11-26 10:54:49 +00:00
Marek Olšák 5a970dbac3 driconf: enable glthread for Minecraft
+30% performance

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13947>
2021-11-26 10:54:49 +00:00
Marek Olšák 9c4d92508d driconf: enable glthread for all Unigine benchmarks
It helps.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13947>
2021-11-26 10:54:49 +00:00
Marius Hillenbrand a46d155329 util/cpu_detect, gallium: use cpu_family CPU_S390X instead of separate flag
to also get rid of the additional function that I introduced before.

Fixes: 82b261417e ("util/cpu_detect: Add flag for IBM Z (s390x)")

Signed-off-by: Marius Hillenbrand <mhillen@linux.ibm.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13958>
2021-11-25 12:57:20 +00:00
Lionel Landwerlin 14e45cb21e util/u_trace: refcount payloads
When cloning a chunk of tracepoints, we cannot just copy the elements
of the traces[] array. We also need the payloads associated with
those.

This change introduces a new u_trace_payloaf_buf object that is
refcounted so that we can easily import traces[] elements and their
payloads from one utrace to another.

v2: use u_vector (Danylo)

v3: Delete outdate comment (Danylo)
    Fix assert (Danylo)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0565c993f9 ("u_trace: helpers for tracing tiling GPUs and re-usable VK cmdbuffers")
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13899>
2021-11-24 17:53:08 +00:00
Marek Olšák 6c78ec4eac mesa: add allow_glsl_compat_shaders for shader-db
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13870>
2021-11-24 10:28:15 +00:00
Marius Hillenbrand 82b261417e util/cpu_detect: Add flag for IBM Z (s390x)
As preparation for changing the behavior of LLVMpipe on IBM Z, add a
flag to detect that platform. As it is always known at compile-time, we
do not add it to the struct for cpu flags to avoid inflating that
struct's size.

Signed-off-by: Marius Hillenbrand <mhillen@linux.ibm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13927>
2021-11-23 17:49:02 +00:00
Alex Xu (Hello71) 8570a2a280 Use initial-exec TLS for glibc only, enable TLS elsewhere
It is not portable to use initial-exec TLS in dlopened libraries. glibc
and FreeBSD allocate extra memory for extra initial-exec variables
specifically for libGL, but other libcs including musl do not.

Keep initial-exec disabled on FreeBSD since it is apparently broken for
some reason:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512
81dbdb15d5

Enable TLS on OpenBSD and Haiku based on the u_thread.h comment that
emutls is better than pthread_getspecific, which seems plausible given
that emutls has strictly more information to work with.

Fixes #966.

Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>
2021-11-20 11:56:34 -05:00
Samuel Pitoiset 04c90f292e util/queue: fix a data race detected by TSAN when finishing the queue
Thread sanitizer complains if it detects that the pthread_barrier
is destroyed when a thread might still blocked on the barrier.

Fix this by destroying the barrier only if pthread_barrier_wait
returns PTHREAD_BARRIER_SERIAL_THREAD which is the value for success.

In practice this shouldn't fix anything serious given that this code
is only called when the disk cache is destroyed.

Original patch from Timothy Arceri.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4342
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13861>
2021-11-19 09:02:23 +01:00
Marek Olšák 83278b5661 glx: add a workaround to glXDestroyWindow for Viewperf2020/Sw
This fixes:
    X Error of failed request:  GLXBadWindow
      Major opcode of failed request:  152 (GLX)
      Minor opcode of failed request:  32 (X_GLXDestroyWindow)
      Serial number of failed request:  9667
      Current serial number in output stream:  9674

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13611>
2021-11-17 21:26:54 +00:00
Connor Abbott b8fc7a08f9 util/dag: Add dag_add_edge_max_data
This will be useful for when the edge data represents a delay of some
sort, like it will with ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13722>
2021-11-17 13:41:47 +00:00
Connor Abbott 508f917d8c util/dag: Make edge data a uintptr_t
Nobody was actually using it as a pointer, and I'm going to introduce a
shared function which relies on it not being a pointer so let's fix this
once and for all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13722>
2021-11-17 13:41:47 +00:00
Jason Ekstrand f3843b11c9 c11/threads: Re-align return values for timed waits
They're supposed to return thrd_timedout (which we mistakenly named
thrd_timeout), not thrd_busy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:02:08 -06:00
Mike Blumenkrantz 97ba2f2fd4 move util/indices to core util
these are useful tools to have outside of gallium

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13741>
2021-11-16 14:12:03 +00:00
Dave Airlie 4b27ebee7f util/vl: move gallium vl_vlc.h and vl_rbsp.h to shared code.
For vulkan video I need these to parse slice headers, so move
them somewhere easier to get at them.

drops pointer_to_uintptr in favour of a cast.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13768>
2021-11-15 21:57:28 +00:00
Qiang Yu aa2f5cd1a3 driconf: support META application
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13686>
2021-11-12 09:01:58 +00:00
Emma Anholt 2e6810a06a util/format: Add G8_B8R8_420_UNORM to match Vulkan.
turnip was playing fast and loose with the name, using the R8_G8B8 format
name but actually setting the descriptors up to read G8_B8R8 like Vulkan
(sensibly) wants.  This caused trouble when trying to make freedreno and
turnip share code.  By having both orderings as format names, we can share
the descriptor code and also confuse readers less.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Emma Anholt 271b6cb981 util: Rename PIPE_FORMAT_G8_B8_R8_420_UNORM.
The only user, turnip, was actually treating it as this layout, matching
vulkan's specification of how the planes map to RGB values.  (Y=G means
that Cb=B and Cr=R).

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13443>
2021-11-11 00:10:57 +00:00
Caio Oliveira 6eb86efe91 util/ra: Fix deserialization of register sets
Set ra_class::regset and ra_class::index  when deserializing.

Fixes: 95d41a3525 ("ra: Use struct ra_class in the public API.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>
2021-11-10 22:57:57 +00:00
Caio Oliveira ac416ce07b util/ra: Add simple test for register set serialization
Marked as DISABLED since it currently fails.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13728>
2021-11-10 22:57:57 +00:00
Ryan Houdek 0ae1231879 util/xmlconfig: Allow DT_UNKNOWN files
Some filesystems don't fill in d_type in dirent. Resulting in
DT_UNKNOWN. Pass this entry through to the next step and use stat on the
full filepath to determine if it is a file.

sshfs is known to not fill d_type.
This resolves an issue where driconf living on an sshfs path wasn't
working.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13697>
2021-11-09 23:25:32 +00:00
Bas Nieuwenhuizen aad80e47d8 util: Add support for clang::fallthrough.
Looks like the __attribute__ version doesn't work for C++ in the
Android build. Only found now because we don't enable
-Wimplicit-fallthrough by default project wide for C++. Only
ACO enables it.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
2021-11-09 20:51:14 +00:00
Jesse Natalie df92a13a27 util/libsync: Fix timeout handling if poll() wakes up early
Check how long poll waited, and use a smaller timeout on the next
iteration through the loop.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12268>
2021-11-09 04:05:55 +00:00
Caio Oliveira 75161e6f3d util: Change blob_test to use macro from mesa-gtest-extras.h
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13672>
2021-11-08 17:42:18 +00:00
Marek Olšák 10ee261c38 driconf: disallow 10-bit pbuffers for viewperf2020/maya due to X errors
Cc: 21.2 21.3 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13472>
2021-11-08 14:00:45 +00:00
Kostiantyn Lazukin 78b613db23 util/u_trace: Replace Flag with IntEnum to support python3.5
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5586

Fixes: cefaa73909

Signed-off-by: Kostiantyn Lazukin <kostiantyn.lazukin@globallogic.com>

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13643>
2021-11-05 11:54:30 +00:00
Marek Olšák 3f997bccc6 radeonsi: increase tc_max_cpu_storage_size
Viewperf benefits. The number is only slightly above the size we need.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13603>
2021-11-04 17:36:26 +00:00
Pierre-Eric Pelloux-Prayer ff981a7e79 drirc: add options for BETA CAE Ansa application.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13364>
2021-11-04 14:16:55 +00:00
Pierre-Eric Pelloux-Prayer f5dc334b6d drirc: add mesa_extension_override option
This allows specific per-application override.
The existing MESA_EXTENSION_OVERRIDE env variable is kept.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13364>
2021-11-04 14:16:55 +00:00
Pierre-Eric Pelloux-Prayer a21c0f531e mesa: enable force_direct_glx_context for DiscoveryStudio2020
This app uses Qt4.8 which uses an indirect context to save a GL scene to
a pixmap.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13246>
2021-11-04 13:59:00 +01:00
Pierre-Eric Pelloux-Prayer fc3ef76eec glx/drirc: add a force_direct_glx_context option
Some applications may request an indirect context but this feature is
disabled by default on Xorg and thus context creation will fail.

This commit adds a drirc setting to force the creation of direct glx
context, regardless of what the app is requesting.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13246>
2021-11-04 13:59:00 +01:00
Marek Olšák 118f2952b6 driconf: set vblank_mode=0 for viewperf2020
It doesn't disable vsync. Reported internally.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13612>
2021-11-04 11:04:35 +00:00
Marek Olšák 81d35c8d48 util: add a util_bitcount variant that selects POPCNT through C++ template arg
Moved from radeonsi. st/mesa will use it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13512>
2021-11-03 23:22:31 +00:00
Jesse Natalie ffd4157b1c util/hash_table: Clear special 0/1 entries for u64 hash table too
Fixes: e532a47f ("util/hash_table: do not leak u64 struct key")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13390>
2021-11-02 11:02:18 -07:00
Gert Wollny 634e2353a0 virgl: Add driconf tweak to force-enable reading back R8_SRGB textures
In the menu of CS:GO R8_SRGB textures are uploaded and read back, and
since R8_SRGB can't be read back on GLES, because it is not a rendertarget
format and glGetTexImage and siblings don't exists, we can't default to
enabling reading back this format. This leads to an emulation of the
glGetTexImage calls issued by CS:GO, and this slows down the menus a lot
(below 1 fps on Intel XE hosts).

So add this driconf tweak and enable it for CS:GO to work around the issue.
It can be done safely, because in this case we actually can use the data
that is stored on the host in the backing IOV.

This tweak lets the CS:GO menu run at around 60 FPS when run with virgl
on a Intel XE host when it would run with less than 1 FPS without the tweak.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13572>
2021-11-02 10:22:52 +00:00
Qiang Yu 4098607870 xmlconfig_test: add unit test for executable_regexp
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13304>
2021-11-02 02:21:00 +00:00
Qiang Yu c7f481c615 drirc: add Mari application workaround
To allow using non-constant sampler array index. This prevent
Mari render fail for any scene.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13304>
2021-11-02 02:21:00 +00:00
Qiang Yu 9a24de9aa7 driconf: add executable_regexp application attribute
For matching executable with variable names like Mari which
append version string to its executable like: Mari4.5v2, Mari4.7v4.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13304>
2021-11-02 02:21:00 +00:00
Marek Olšák a4e0b02f85 mesa: skip strlen when hashing strings for ProgramResourceHash
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13507>
2021-10-29 07:19:20 -04:00
Greg V 98dbd01a96 util: make util_get_process_exec_path work on FreeBSD w/o procfs
sysctl is the correct way of getting the current executable's path.
procfs is not mounted by default.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598>
2021-10-29 06:06:05 +00:00
Greg V 1d9eda1b57 util: __getProgramName: remove check for ancient FreeBSD versions, simplify ifdefs
FreeBSD 5.0 was released in 2003.
We really do not need to check that we're on >= 4.4.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598>
2021-10-29 06:06:05 +00:00
Pierre-Eric Pelloux-Prayer cf76247f38 drirc: enable do_dce_before_clip_cull_analysis for ANSA
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12897>
2021-10-28 18:01:04 +00:00
Pierre-Eric Pelloux-Prayer 95ded68984 glsl/drirc: add an option for gl_ClipVertex / gl_CullDistance checks
The GLSL spec says it's an error if a shader statically writes to these
2 variables.

Until this commit, Mesa refused to link a shader if it had an unused
function writing to one of these variables while another (used) function
wrote to the other.

This commit adds an option to perform dead function elimination after
the intra-stage linking step but before performing these checks.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12897>
2021-10-28 18:01:04 +00:00
Thomas Wagner 4856586ac6 util: use anonymous file for memory fd creation
The original implementation in os_memory_fd.c always uses memfds.
Replace this by using the already existing os_create_anonymous_file in
order to support older systems or systems without memfd.

Fixes: 1166ee9caf ("gallium: add utility and interface for memory fd allocations")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13331>
2021-10-27 15:26:52 +00:00
Marek Olšák c14d755f3d glthread: add an option to make glCheckFramebufferStatus a no-op
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13403>
2021-10-27 01:24:03 +00:00
Matt Turner e0a74c7cad util/format: Add PIPE_FORMAT_Y8_UNORM as an "other" layout format
freedreno has a different layout for tiled Y8 planes from normal R8
textures, so we need to be able to talk about them separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
2021-10-22 11:25:30 +00:00
Emma Anholt 68f8bbb37e util: Move freedreno's snorm-to-unorm to util/, adding remaining cases.
I want it in turnip too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13379>
2021-10-21 08:46:31 +00:00
Caio Marcelo de Oliveira Filho 9a32a7fdfe util: Move test sources to tests/ directory
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho abf2af64ac util: Convert sparse array multithread test to use gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 213c9e944c util: Convert roundeven_test to use gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 83449f61ba util: Convert rb_tree_test to gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 0d36ea7d58 util: Convert mesa-sha1_test to use gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 89eebca057 util: Convert blob_test to use gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho d4c536d3d9 util: Convert u_atomic_test to use gtest
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 1d78a31bec util: Move tests in single file directories to tests/
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Caio Marcelo de Oliveira Filho 2209f5794d util: Consolidate existing gtests in a single binary
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13425>
2021-10-20 21:40:31 -07:00
Marek Olšák d29e507adc radeonsi: don't set inline_uniforms for viewperf because it's enabled by default
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13400>
2021-10-19 16:53:30 +00:00
Marek Olšák 9f2a97e9df radeonsi: add an option to use CPU storage uploads for threaded context
It's only enabled for viewperf for now.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13400>
2021-10-19 16:53:29 +00:00
Marek Olšák cbcdcd42fc radeonsi: enable shader culling on Navi1x consumer SKUs as well
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13393>
2021-10-18 18:08:59 +00:00
Danylo Piliaiev 3350957f3c drirc: Apply vk_dont_care_as_load workaround to Forsaken Remastered
Game has one renderpass which loads attachment with DONT_CARE, does
nothing, and writes it back.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5437

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13367>
2021-10-18 17:26:41 +00:00
Danylo Piliaiev 3d69800a0b driconf: add vk_dont_care_as_load workaround option
It's easy to make a mistake of using VK_ATTACHMENT_LOAD_OP_DONT_CARE
when LOAD_OP_LOAD should be used since all desktop GPUs do the same
thing (nothing) for both of them.

However tiler GPUs do actually care about them.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13367>
2021-10-18 17:26:41 +00:00
Dylan Baker e73096bd6d meson: use gtest protocol for gtest based tests when possible
With the `gtest` protocol meson will add some extra arguments to the
test to generate better junit results, which may be useful. This
protocol is only available in meson 0.55.0+, so keep using the default
`exitcode` protocol for meson older than that.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8484>
2021-10-16 03:22:24 +00:00
Adam Jackson ea038747df dri: Remove the allow_fp16_configs option, always allow them
There's no danger of accidentally using these, the default pixel format
is integer and if you want float you need to have explicitly asked for
it in eglChooseConfig.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13182>
2021-10-13 16:36:27 +00:00
Timur Kristóf 411c081e97 drirc: Apply radv_invariant_geom workaround to World War Z games.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5433
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13312>
2021-10-13 08:55:33 +00:00
Timur Kristóf bbce747a0d drirc: Apply radv_invariant_geom workaround to Resident Evil Village.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5071
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13312>
2021-10-13 08:55:33 +00:00
Timur Kristóf 574c6612ae drirc: Fix indentation.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13312>
2021-10-13 08:55:33 +00:00
Marek Olšák 8c6e18bc51 util,gallium: put count in pipe_resource & sampler_view on its own cache line
This adds 60 bytes to both structures. It eliminates "False Sharing"
for atomic operations (see wikipedia).

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11618>
2021-10-13 03:26:20 +00:00
Daniel Schürmann b34a3459f8 driconf: set vk_x11_strict_image_count for Wolfenstein: Youngblood
Otherwise, the game refuses to start on xwayland.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13289>
2021-10-13 02:44:48 +00:00
Chia-I Wu 8cce6281e6 util/vector: make util_vector_init harder to misuse
Make u_vector_init a wrapper to u_vector_init_pot.  Let both take
(element_count, element_size) as parameters.

Motivated by eed0fc4caf ("vulkan/wsi/wayland: fix an invalid
u_vector_init call")

v2: rename u_vector_init_pot to u_vector_init_pow2

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13201>
2021-10-08 00:15:11 +00:00
Thomas Wagner 1166ee9caf gallium: add utility and interface for memory fd allocations
Add utility functions to allocate aligned memory backed by
mem_fd objects. Add interface to Gallium for same allocation.
It will be used in later commits for external memory support
in Vulkan/OpenGL.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Heinrich Fink <hfink@snap.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12345>
2021-10-06 13:49:08 +00:00