mesa/src
Jonathan 897e382d9d gallium/u_threaded: buffer sharedness tracking
This fixes TC's buffer invalidation code for buffers that are shared
between contexts.

TC is unable to notify other TCs in case it replaces a shared buffer's
underlying storage when invalidating, causing those other TCs to use
wrong buffer IDs for busyness tracking, which leads to corruption due
to invalidation fast-paths being triggered when they shouldn't be.

This patch addresses this issue by tracking if a buffer is shared, and
if it is, disabling buffer storage replacement for the affected buffer.
This is achieved by tracking which TC instance first accessed a certain
buffer. If a second instance then accesses it as well, it will realize
that it isn't the only one working on the buffer and mark the buffer
accordingly.

If TC needs to invalidate a buffer for the correctness of an operation
at any point, it will fall back to doing the operation in a synchronous
fashion with this patch if the buffer is shared and currently busy.

It might be possible to later detect that a buffer has become un-shared;
however, this is outside of the scope of this bugfix patch.

v2: Do not disable buffer busyness tracking for shared buffers.

Fixes: e9c41b32 ("gallium/u_threaded: add buffer lists - tracking of buffers referenced by tc")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 8f159a8576)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18349>
2022-09-28 19:03:32 +00:00
..
amd radv: Use a fallback for marketing name when libdrm doesn't know it. 2022-09-26 15:10:22 -07:00
android_stub android_stub: update platform headers to include atrace 2021-10-09 00:42:32 +00:00
asahi agx: Fix float copyprop of neg(neg) case 2022-09-14 20:55:18 -07:00
broadcom broadcom: fix dependencies in static_library() calls 2022-09-15 10:15:56 -07:00
c11 c11: #include <threads.h> when the os/platform provide it 2022-08-19 11:32:29 -07:00
compiler nir/lower_task_shader: Don't fail adding a launch when last instruction is a jump 2022-09-26 15:10:14 -07:00
drm-shim drm-shim: drop gnu99 override 2022-09-26 10:13:53 -07:00
egl meson: replace manual compiler flags with meson arguments 2022-09-14 13:58:58 -07:00
etnaviv util/list: rename LIST_ENTRY() to list_entry() 2022-07-28 10:10:44 +00:00
freedreno ir3/analyze_ubo_ranges: Account for reserved consts 2022-09-26 15:10:13 -07:00
gallium gallium/u_threaded: buffer sharedness tracking 2022-09-28 19:03:32 +00:00
gbm gbm: add GBM_FORMAT_[AX]BGR16161616 2022-07-27 07:27:10 +00:00
getopt
glx glx: Remove usage of USE_ELF_TLS 2022-07-29 23:59:12 +00:00
gtest gtest: Fix maybe-uninitialized compiler warning 2022-06-29 21:02:18 +00:00
hgl
imagination pvr: Fix cdm shared reg usage reported to fw. 2022-07-29 11:37:06 +00:00
imgui
intel intel/nir: disable assert on async stack id 2022-09-28 10:14:58 -07:00
loader loader: Remove usage of USE_ELF_TLS in loader.c 2022-07-29 23:59:12 +00:00
mapi glthread: call _mesa_glthread_DeleteBuffers unconditionally 2022-08-12 09:41:33 -07:00
mesa mesa: set normalized_coords for bindless texture buffer samplers 2022-09-28 10:14:58 -07:00
microsoft microsoft/compiler: Fix PSV struct when numthreads is 0 2022-08-19 11:32:32 -07:00
nouveau nv50/ir: fix OP_UNION resolving when used for vector values 2022-09-15 09:25:40 -07:00
panfrost pan/bi: Consider all dests in helper_block_update 2022-09-14 20:55:17 -07:00
tool meson: replace manual compiler flags with meson arguments 2022-09-14 13:58:58 -07:00
util u_atomic: Add a helper for pointer compare-exchange 2022-09-28 19:03:32 +00:00
virtio venus: ignore pInheritanceInfo if not secondary command buffer 2022-09-15 10:15:55 -07:00
vulkan vulkan/device_select_wayland: fix a memory leak with DRM device handling 2022-09-15 11:12:44 -07:00
meson.build meson: Remove usage of use_elf_tls 2022-07-29 23:59:11 +00:00