diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 9a1902a6e90..41221cd64c3 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -1416,6 +1416,14 @@ agx_memory_barrier(struct pipe_context *pctx, unsigned flags) agx_flush_all(agx_context(pctx), "Memory barrier"); } +static enum pipe_reset_status +asahi_get_device_reset_status(struct pipe_context *pipe) +{ + struct agx_context *ctx = agx_context(pipe); + + return ctx->any_faults ? PIPE_GUILTY_CONTEXT_RESET : PIPE_NO_RESET; +} + static struct pipe_context * agx_create_context(struct pipe_screen *screen, void *priv, unsigned flags) { @@ -1463,6 +1471,8 @@ agx_create_context(struct pipe_screen *screen, void *priv, unsigned flags) pctx->create_fence_fd = agx_create_fence_fd; pctx->fence_server_sync = agx_fence_server_sync; + pctx->get_device_reset_status = asahi_get_device_reset_status; + agx_init_state_functions(pctx); agx_init_query_functions(pctx); agx_init_streamout_functions(pctx); diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index 7295c6f4fb0..7601fdf47f2 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -628,6 +628,8 @@ struct agx_context { struct agx_compiled_shader *gs_unroll_restart[MESA_PRIM_MAX][3]; struct agx_meta_cache meta; + bool any_faults; + uint32_t syncobj; uint32_t dummy_syncobj; int in_sync_fd;