radeonsi: submit cs to failed context instead of skipping them

Skipping the submission would trigger asserts in debug builds
or cause memory corruption.

Instead the cs is submitted as ususual but the kernel won't submit
it to the hardware (and will return ECANCELED) if the context
is really lost (= not soft-recovered).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2491
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10179>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-04-09 18:08:44 +02:00 committed by Marge Bot
parent bc71f689f1
commit 646c5db06f
1 changed files with 7 additions and 2 deletions

View File

@ -96,8 +96,13 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
!(flags & RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION))
return;
if (ctx->b.get_device_reset_status(&ctx->b) != PIPE_NO_RESET)
return;
/* Calling get_device_reset_status is useful to re-create the
* aux context if needed.
* This cs will be submitted even if a reset is detected; in this
* case it'll treated as a no-op. This ensures that all states
* are properly reset.
*/
ctx->b.get_device_reset_status(&ctx->b);
if (sscreen->debug_flags & DBG(CHECK_VM))
flags &= ~PIPE_FLUSH_ASYNC;