radv: Search for guilty contexts at radv_check_status
authorAndré Almeida <andrealmeid@igalia.com>
Sun, 23 Apr 2023 20:43:11 +0000 (17:43 -0300)
committerMarge Bot <emma+marge@anholt.net>
Mon, 24 Apr 2023 16:45:40 +0000 (16:45 +0000)
commit41a36561491d0cd65c8813126db9ce41e4aff9c4
tree4b9031f64b787f6e0e4bd48d2650c6a7e9c9182f
parentdc6f7045665e1b543ec19cb27ddfe9173e35fb7c
radv: Search for guilty contexts at radv_check_status

When a GPU hung happens, all contexts are notified. They will receive
INNOCENT_CONTEXT if they are not the context that triggered the reset,
or GUILTY_CONTEXT otherwise.

At radv_check_status(), we return on the first context that was notified
as [GUILTY, INNOCENT]_CONTEXT, without further checks. This can make an
app think that it's innocent if the guilty context is not the first one
on the list of hw_ctx to be checked.

Check every context for a guilty one before returning CONTEXT_INNOCENT.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22648>
src/amd/vulkan/radv_device.c