From d2b2364313c33cb27a97f1d6e257392cb4710935 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 2 Nov 2018 16:09:13 -0400 Subject: radeonsi: stop command submission with PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested-by: Dieter Nützel --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 6 ++++-- src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gallium/winsys/amdgpu/drm') diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 5986810d4e9..5ec3b470a15 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -923,7 +923,8 @@ amdgpu_cs_create(struct radeon_winsys_ctx *rwctx, enum ring_type ring_type, void (*flush)(void *ctx, unsigned flags, struct pipe_fence_handle **fence), - void *flush_ctx) + void *flush_ctx, + bool stop_exec_on_failure) { struct amdgpu_ctx *ctx = (struct amdgpu_ctx*)rwctx; struct amdgpu_cs *cs; @@ -939,6 +940,7 @@ amdgpu_cs_create(struct radeon_winsys_ctx *rwctx, cs->flush_cs = flush; cs->flush_data = flush_ctx; cs->ring_type = ring_type; + cs->stop_exec_on_failure = stop_exec_on_failure; struct amdgpu_cs_fence_info fence_info; fence_info.handle = cs->ctx->user_fence_bo; @@ -1395,7 +1397,7 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) if (acs->ring_type == RING_GFX) ws->gfx_bo_list_counter += cs->num_real_buffers; - if (acs->ctx->num_rejected_cs) { + if (acs->stop_exec_on_failure && acs->ctx->num_rejected_cs) { r = -ECANCELED; } else { struct drm_amdgpu_cs_chunk chunks[6]; diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 9f5a4fd991a..5de770c89e7 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -129,6 +129,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; struct util_queue_fence flush_completed; struct pipe_fence_handle *next_fence; -- cgit v1.2.3