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>
!(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;