radeonsi: call the reset callback if get_device_reset_status returns a failure

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
Marek Olšák 2019-10-16 17:09:29 -04:00
parent 93707457b6
commit 438ede3ca3
3 changed files with 7 additions and 20 deletions

View file

@ -97,7 +97,7 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags,
(!wait_flags || !ctx->gfx_last_ib_is_busy))
return;
if (si_check_device_reset(ctx))
if (ctx->b.get_device_reset_status(&ctx->b) != PIPE_NO_RESET)
return;
if (ctx->screen->debug_flags & DBG(CHECK_VM))

View file

@ -312,8 +312,13 @@ static void si_destroy_context(struct pipe_context *context)
static enum pipe_reset_status si_get_reset_status(struct pipe_context *ctx)
{
struct si_context *sctx = (struct si_context *)ctx;
enum pipe_reset_status status = sctx->ws->ctx_query_reset_status(sctx->ctx);
return sctx->ws->ctx_query_reset_status(sctx->ctx);
if (status != PIPE_NO_RESET && sctx->device_reset_callback.reset) {
sctx->device_reset_callback.reset(sctx->device_reset_callback.data,
status);
}
return status;
}
static void si_set_device_reset_callback(struct pipe_context *ctx,
@ -328,21 +333,6 @@ static void si_set_device_reset_callback(struct pipe_context *ctx,
sizeof(sctx->device_reset_callback));
}
bool si_check_device_reset(struct si_context *sctx)
{
enum pipe_reset_status status;
if (!sctx->device_reset_callback.reset)
return false;
status = sctx->ws->ctx_query_reset_status(sctx->ctx);
if (status == PIPE_NO_RESET)
return false;
sctx->device_reset_callback.reset(sctx->device_reset_callback.data, status);
return true;
}
/* Apitrace profiling:
* 1) qapitrace : Tools -> Profile: Measure CPU & GPU times
* 2) In the middle panel, zoom in (mouse wheel) on some bad draw call

View file

@ -1430,9 +1430,6 @@ void si_initialize_prim_discard_tunables(struct si_context *sctx);
void si_init_perfcounters(struct si_screen *screen);
void si_destroy_perfcounters(struct si_screen *screen);
/* si_pipe.c */
bool si_check_device_reset(struct si_context *sctx);
/* si_query.c */
void si_init_screen_query_functions(struct si_screen *sscreen);
void si_init_query_functions(struct si_context *sctx);