From 445b8979076749cf0f71cf81ae4fc5d3c853f2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 9 Aug 2022 13:06:37 -0400 Subject: [PATCH] radeonsi: rename stop_exec_on_failure -> allow_context_lost Reviewed-by: Mihai Preda Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 3 +-- src/gallium/include/winsys/radeon_winsys.h | 2 +- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 6 +++--- src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 2 +- src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 5ab79f8aaf7..c70dacd176c 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -475,7 +475,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign struct si_context *sctx = CALLOC_STRUCT(si_context); struct radeon_winsys *ws = sscreen->ws; int shader, i; - bool stop_exec_on_failure = (flags & PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET) != 0; enum radeon_ctx_priority priority; if (!sctx) { @@ -537,7 +536,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign } ws->cs_create(&sctx->gfx_cs, sctx->ctx, sctx->has_graphics ? AMD_IP_GFX : AMD_IP_COMPUTE, - (void *)si_flush_gfx_cs, sctx, stop_exec_on_failure); + (void *)si_flush_gfx_cs, sctx, flags & PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET); /* Initialize private allocators. */ u_suballocator_init(&sctx->allocator_zeroed_memory, &sctx->b, 128 * 1024, 0, diff --git a/src/gallium/include/winsys/radeon_winsys.h b/src/gallium/include/winsys/radeon_winsys.h index 32aa288bc5e..cb9eb4a06ab 100644 --- a/src/gallium/include/winsys/radeon_winsys.h +++ b/src/gallium/include/winsys/radeon_winsys.h @@ -531,7 +531,7 @@ struct radeon_winsys { struct radeon_winsys_ctx *ctx, enum amd_ip_type amd_ip_type, void (*flush)(void *ctx, unsigned flags, struct pipe_fence_handle **fence), - void *flush_ctx, bool stop_exec_on_failure); + void *flush_ctx, bool allow_context_lost); /** * Set or change the CS preamble, which is a sequence of packets that is executed before diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index ec6aa40d2c9..d6e14e6888b 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -959,7 +959,7 @@ amdgpu_cs_create(struct radeon_cmdbuf *rcs, void (*flush)(void *ctx, unsigned flags, struct pipe_fence_handle **fence), void *flush_ctx, - bool stop_exec_on_failure) + bool allow_context_lost) { struct amdgpu_ctx *ctx = (struct amdgpu_ctx*)rwctx; struct amdgpu_cs *cs; @@ -976,7 +976,7 @@ amdgpu_cs_create(struct radeon_cmdbuf *rcs, cs->flush_cs = flush; cs->flush_data = flush_ctx; cs->ip_type = ip_type; - cs->stop_exec_on_failure = stop_exec_on_failure; + cs->allow_context_lost = allow_context_lost; cs->noop = ctx->ws->noop_cs; cs->has_chaining = ctx->ws->info.gfx_level >= GFX7 && (ip_type == AMD_IP_GFX || ip_type == AMD_IP_COMPUTE); @@ -1489,7 +1489,7 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index) bool noop = false; - if (acs->stop_exec_on_failure && acs->ctx->num_rejected_cs) { + if (acs->allow_context_lost && acs->ctx->num_rejected_cs) { r = -ECANCELED; } else { struct drm_amdgpu_cs_chunk chunks[7]; diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 5898871a0a0..25ec27945fc 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -154,7 +154,7 @@ struct amdgpu_cs { /* Flush CS. */ void (*flush_cs)(void *ctx, unsigned flags, struct pipe_fence_handle **fence); void *flush_data; - bool stop_exec_on_failure; + bool allow_context_lost; bool noop; bool has_chaining; diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 51864a31ae5..45342a68095 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -177,7 +177,7 @@ radeon_drm_cs_create(struct radeon_cmdbuf *rcs, void (*flush)(void *ctx, unsigned flags, struct pipe_fence_handle **fence), void *flush_ctx, - bool stop_exec_on_failure) + bool allow_context_lost) { struct radeon_drm_winsys *ws = ((struct radeon_ctx*)ctx)->ws; struct radeon_drm_cs *cs;