radv: Fix threading issue with submission refcounts.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 29 Aug 2020 01:25:02 +0000 (03:25 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 2 Sep 2020 18:00:40 +0000 (18:00 +0000)
commit6b75262941b55960e2f73d93f85020fa6c9c2d2f
treeeaf631f69c5537f85130f6fba7ae4d764f743f42
parente4dadb545fa6cdf52b5a6a7efb5764495e09158c
radv: Fix threading issue with submission refcounts.

If decrement == 0 then:

- it isn't safe to access the submission
- even if it is, checking that the result of the atomic_sub is 0
  doesn't given an unique owner anymore.

So skip it. The submission always starts out with refcount >= 1,
so first one to decrement to 0 still get dibs on executing it.

Fixes: 4aa75bb3bdd "radv: Add wait-before-submit support for timelines."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6478>
src/amd/vulkan/radv_device.c