Dave Airlie
5a9eba4acd
util/format: add some ZS helpers for vallium
...
The vallium layer has a requirement to insert and extra the 24-bit
unorm value as a unorm value (not as a float etc). Add helpers
to facilitate that.
Reviewed-by: Roland Scheidegger <sroland@vmware.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6082 >
2020-08-17 14:30:50 +10:00
Eric Anholt
5b8d67cb64
util: Move fetch_rgba to a separate function table.
...
Only llvmpipe and translate_generic use it, and only in fallbacks, so if
you're not building that then let's not bloat our binaries with it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Eric Anholt
9cc84369b7
util: Mark the format description getter functions as const.
...
This lets the compiler CSE calls to them on the same format. This is
particularly relevant for the description table lookup calls, which other
inlines might do internally.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Eric Anholt
35b22b5da0
util: Make all 3 fetch_rgba functions occupy the same function slot.
...
A single format either had the float, the sint, or the uint version.
Making the dst be void * lets us store them in the same slot and not have
logic in the callers to call the right one.
-6kb on gallium drivers
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Eric Anholt
80babbbf7e
uitl: Add R1_UNORM to the list of noaccess (no pack/unpack) formats.
...
The functions were just stubs, if you called them you would be terribly
disappointed.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305 >
2020-08-16 21:25:14 +00:00
Mauro Rossi
aa8661141a
android: util/format: fix generated sources rules
...
Changes are necessary after commit 84ed2d098
("util/format: expose generated format packing functions through a header")
because script for format/u_format_pack.h has different commandline
compared to existing pattern
Generated sources rules are ported from meson
Fixes: 84ed2d098 ("util/format: expose generated format packing functions through a header")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com >
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6319 >
2020-08-14 23:29:51 +02:00
Karol Herbst
16f858968f
util/set: add _mesa_set_intersects
...
v2 (Jason Ekstrand): add asserts and iterate over smaller set
Signed-off-by: Karol Herbst <kherbst@redhat.com >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401 >
2020-08-14 20:35:36 +00:00
Jesse Natalie
65d7172d17
util/macros: Add ATTRIBUTE_NOINLINE definition for MSVC
...
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6303 >
2020-08-13 23:18:36 +00:00
Jesse Natalie
58af31186a
u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE
...
Fixes: d0d14f3f ("util: Add unit test for stack backtrace caputure")
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6303 >
2020-08-13 23:18:36 +00:00
Jonathan Marek
84ed2d0980
util/format: expose generated format packing functions through a header
...
Some of the generated functions can be useful without going through the
format table (filling border color struct in turnip). By not calling these
functions through the format table, we should eventually be able to garbage
collect the unused packing functions, and also allows LTOs to happen.
Signed-off-by: Jonathan Marek <jonathan@marek.ca >
Reviewed-by: Eric Anholt <eric@anholt.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093 >
2020-08-13 16:54:06 +00:00
Eric Anholt
33e69203d2
util: Fix up indentation in the generated format tables code.
...
I did this as a separate commit to make the previous one more reviewable.
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826 >
2020-08-12 14:22:24 -07:00
Eric Anholt
9fd0f455af
util: Change a codegenned switch statement to a nice little table.
...
This saves us 13 to 35kb on release drivers in my builds.
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826 >
2020-08-12 14:22:24 -07:00
Eric Anholt
4064a6cd20
util: Split the pack/unpack functions out of the format desc.
...
This gives the compiler a chance to GC pack/unpack functions separate from
the format descriptions. For drivers that use everything, this is
+10-20kb, while for libvulkan_intel it's -1.3MB.
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1048434
Acked-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5826 >
2020-08-12 13:13:39 -07:00
Vinson Lee
96cfc684e6
util: Fix memory leaks in unit test.
...
Fix warnings reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable bt1 going out of scope leaks the storage
it points to.
leaked_storage: Variable bt2 going out of scope leaks the storage
it points to.
Fixes: d0d14f3f64 ("util: Add unit test for stack backtrace caputure")
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6246 >
2020-08-11 14:11:01 -07:00
Eric Engestrom
7fbadfc385
driconf: fix force_gl_vendor description
...
The option is not a toggle to "allow GPU vendor to be overridden", it
*is* the override.
Fixes: dca119f12c ("mesa/gallium: add dric option to allow overriding GL vendor string")
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6207 >
2020-08-08 14:26:08 +00:00
Vinson Lee
2e665458a9
util: Fix SCons build.
...
Fixes: 848e7b947d ("util: Move stack debug functions to src/util")
Signed-off-by: Vinson Lee <vlee@freedesktop.org >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6199 >
2020-08-05 22:55:06 -07:00
Kristian H. Kristensen
5ae7098eba
gallium/android: Rewrite backtrace helper for android
...
The previous implementation kept a hashtable of a Backtrace object per
thread. debug_backtrace_capture is supposed to store a backtrace in
the passed in debug_stack_frame array, but instead overwrote the
per-thread Backtrace object.
This new version works more like the libunwind based capture. We hash
the file and symbol names and store pointers in the debug_stack_frame
struct. This way debug_backtrace_capture doesn't overwrite previous
captures or allocate memory that needs to be freed.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112 >
2020-08-05 18:08:06 +00:00
Kristian H. Kristensen
d0d14f3f64
util: Add unit test for stack backtrace caputure
...
First test never fails, but exercises the code and is useful for
manual inspection. Second test exposes the android implementation
bug.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112 >
2020-08-05 18:08:06 +00:00
Kristian H. Kristensen
848e7b947d
util: Move stack debug functions to src/util
...
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112 >
2020-08-05 18:08:06 +00:00
Marcin Ślusarz
28f2585365
util/format: initialize non-important components to 0
...
Avoids copying random garbage from the stack.
Found by Coverity.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067 >
2020-07-30 10:41:00 +00:00
Marcin Ślusarz
f13042ec7e
util: fix possible buffer overflow in util_get_process_exec_path
...
Found by Coverity.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Fixes: f8f1413070 ("util/u_process: add util_get_process_exec_path")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067 >
2020-07-30 10:41:00 +00:00
Marcin Ślusarz
eac0ba7fc1
util: fix possible fd leaks in os_socket_listen_abstract
...
Found by Coverity.
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com >
Fixes: ef5266ebd5 ("util/os_socket: Add socket related functions.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067 >
2020-07-30 10:41:00 +00:00
Rob Clark
81124d845e
driconf: allowlist/denylist
...
I think this is the one user facing use of blacklist/whitelist. But we
like all of our users, so lets be more inclusive.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5938 >
2020-07-16 21:56:08 +00:00
Eric Anholt
b7418270c3
util: Share a single function pointer for the 4-byte rgba unpack function.
...
Everyone wants the same behavior, and this helps shrink the size of our
format description tables.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:23 +00:00
Eric Anholt
a8e7004dc5
util: Remove the stub pack/unpack functions for YUV formats.
...
If we can't pack/unpack them, the field is supposed to be NULL.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:23 +00:00
Eric Anholt
2da4badfe3
util: Use designated initializers to clean up the format tables' pack/unpack.
...
The generated .c had a bunch of NULLs and notes for what kind of function
was being skipped, when we can just skip them by filling in the fields
with names.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:23 +00:00
Eric Anholt
e7010eeff0
util: Merge util_format_read_4* functions.
...
Everyone wants the same thing: unpack 4-bytes-per-channel data based on the
base type of the format.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:23 +00:00
Eric Anholt
2f4d557a56
util: Merge util_format_write_4* functions.
...
Everyone wants the same thing: pack 4-bytes-per-channel data based on the
base type of the format.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:23 +00:00
Eric Anholt
32bf7229e5
util: Remove unused util_format_planar_is_supported().
...
Nothing calls it, and it should have been left in gallium, anyway.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:22 +00:00
Eric Anholt
18cb8f2322
util: Mark util_format_description() as a const function.
...
It will return the same table every time with no other side effects, so we
want it to be CSEed. Saves 3.5k on my aarch64 GL drivers, almost 9k on
turnip, but weirdly increases my x86 GL driver collection by ~3k.
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728 >
2020-07-07 18:19:22 +00:00
Benjamin Cheng
a573c8cd47
drirc: Add picom to adaptive_sync exclusion list
...
The compton compositor is unmaintained, with a new fork named picom taking
its place. As with the other compositors (including compton), adaptive
sync should not be enabled.
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5740 >
2020-07-04 08:46:12 +00:00
Eric Anholt
b9e163fa67
util: Avoid strict aliasing bugs in xxhash.
...
XXH32 is doing access through u32 *, and with strict aliasing the compiler
gets to assume that those are independent of the u16 writes we did in
fd6_texture_key setup, and based on various tweaks to the code, would
result in bad hashes computed after inlining. The failure was:
../src/util/hash_table.c:326:_mesa_hash_table_search_pre_hashed: Assertion
`ht->key_hash_function == ((void *)0) || hash == ht->key_hash_function(key)'
failed.)
By setting these two flags, we always take the unaligned,
memcpy-the-32-bit-data path. I believe this should be same perf on x86
(which will happily unaligned load 32 bits in the end), while it will be
slower on arm (where you have to a special unaligned load operation iirc).
This should still be far faster than our old hash.
Fixes: edd62619a1 ("freedreno: replace fnv1a hash function with xxhash")
Acked-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5271 >
2020-07-03 23:27:06 +00:00
Samuel Pitoiset
ab9ecb607b
radv,vulkan: add a new x11 wsi drirc workaround for DOOM Eternal
...
DOOM Eternal happily creates a swapchain with 2 images for IMMEDIATE.
This fixes a 10% performance issue with RADV.
Cc: 20.1 <mesa-stable@lists.freedesktop.org >
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/5704 >
2020-07-02 08:31:57 +00:00
Greg V
29e2a3b8f5
gallium,util: undef ALIGN on FreeBSD to prevent name clash
...
Some rare headers like ipc/shm and pthread_np cause
machine/param.h to be included which defines a macro called ALIGN.
Signed-off-by: Matt Turner <mattst88@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559 >
2020-07-01 16:47:05 +00:00
Marek Olšák
012b7aab26
driconf: add workarounds for SPECviewperf13
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459 >
2020-06-23 09:25:24 +00:00
Marek Olšák
ca719c6e30
glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13
...
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459 >
2020-06-23 09:25:24 +00:00
Eric Engestrom
04e8eaf4e8
util: rename xmlpool.h to driconf.h
...
To make it clearer what it is and does.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
2ef983dca6
driconf: drop now unused translation facility
...
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
b1f647a3b4
driconf: drop 9% swedish translation
...
Only 7 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
0a19565592
driconf: drop 8% dutch translation
...
Only 6 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
56d76859fa
driconf: drop 6% french translation
...
Only 4 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
a029eafba3
driconf: drop 26% spanish translation
...
Only 19 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
29ee6f6c6a
driconf: drop 15% german translation
...
Only 11 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Eric Engestrom
ae7759eb21
driconf: drop 28% catalan translation
...
Only 20 of the 72 strings are translated, and there doesn't seem to be
any effort to keep it updated.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440 >
2020-06-22 21:50:12 +00:00
Rhys Perry
c977567db6
radv: enable radv_no_dynamic_bounds for more Path of Exile executables
...
It looks like there's also a standalone version and a 32-bit version.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Cc: <mesa-stable@lists.freedesktop.org >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5574 >
2020-06-20 11:46:12 +01:00
Rhys Perry
19b2ac2bb9
radv: enable radv_no_dynamic_bounds for Path of Exile
...
To workaround game bugs. This also enables it for the D3D11 renderer but
that shouldn't be an issue.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Cc: <mesa-stable@lists.freedesktop.org >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3081
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3084
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3080
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5569 >
2020-06-19 23:53:47 +00:00
Rhys Perry
f4a643f65e
radv: add new drirc option radv_no_dynamic_bounds
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Cc: <mesa-stable@lists.freedesktop.org >
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5569 >
2020-06-19 23:53:47 +00:00
Gurchetan Singh
9760a7ed91
virgl: apply bgra dest swizzle and add Portal 2
...
Apply the destination swizzle on GLES games based on HL2 engine.
Also add Portal 2 since some people are experiencing issues with
that.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5481 >
2020-06-18 10:35:52 +00:00
Eric Engestrom
0e5ea7a363
util: introduce os_dupfd_cloexec() helper
...
Adapted from wayland's wl_os_dupfd_cloexec().
Suggested-by: Kristian H. Kristensen <hoegsberg@google.com >
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369 >
2020-06-18 02:09:56 +00:00
Eric Engestrom
b00e1d9ea7
util/os_file: replace broken windows-detection code with detect_os.h
...
The meson-windows-vs2019 job was going down the `!defined(WIN32)` path,
leading to a broken build once that path contained non-windows code.
Signed-off-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369 >
2020-06-18 02:09:56 +00:00