diff options
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 7 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index 1094c3f61c8..1a094fd8d21 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -900,6 +900,7 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) if (!handles) { pipe_mutex_unlock(ws->global_bo_list_lock); amdgpu_cs_context_cleanup(cs); + cs->error_code = -ENOMEM; return; } @@ -923,10 +924,12 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) fprintf(stderr, "amdgpu: buffer list creation failed (%d)\n", r); cs->request.resources = NULL; amdgpu_fence_signalled(cs->fence); + cs->error_code = r; goto cleanup; } r = amdgpu_cs_submit(acs->ctx->ctx, 0, &cs->request, 1); + cs->error_code = r; if (r) { if (r == -ENOMEM) fprintf(stderr, "amdgpu: Not enough memory for command submission.\n"); @@ -974,6 +977,7 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs, { struct amdgpu_cs *cs = amdgpu_cs(rcs); struct amdgpu_winsys *ws = cs->ctx->ws; + int error_code = 0; rcs->current.max_dw += amdgpu_cs_epilog_dws(cs->ring_type); @@ -1057,6 +1061,7 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs, amdgpu_cs_submit_ib); } else { amdgpu_cs_submit_ib(cs, 0); + error_code = cs->cst->error_code; } } else { amdgpu_cs_context_cleanup(cs->csc); @@ -1069,7 +1074,7 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs, amdgpu_get_new_ib(&ws->base, cs, IB_CONST_PREAMBLE); ws->num_cs_flushes++; - return 0; + return error_code; } static void amdgpu_cs_destroy(struct radeon_winsys_cs *rcs) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index f56b5a5a16e..e80b3337604 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -88,6 +88,9 @@ struct amdgpu_cs_context { unsigned max_dependencies; struct pipe_fence_handle *fence; + + /* the error returned from cs_flush for non-async submissions */ + int error_code; }; struct amdgpu_cs { |