radeonsi: call the reset callback if get_device_reset_status returns a failure
[mesa.git] / src / gallium / drivers / radeonsi / si_pipe.c
index 39a4e7bf2b7a5dd695ceec75cf4de4507ea5103d..9ca64b05d63b64aa9202f0e7ba9ef9b888dc090e 100644 (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