asahi: implement reset queries

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-02-14 10:19:27 -04:00 committed by Marge Bot
parent 5dc0f5ccba
commit 591ce607e0
2 changed files with 12 additions and 0 deletions

View file

@ -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);

View file

@ -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;