diff options
author | Marek Olšák <[email protected]> | 2016-07-13 18:31:16 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-14 22:00:54 +0200 |
commit | 85388652f9406c07803f8ef327af11c6028b52d6 (patch) | |
tree | 9fcb49cc3ac91440e5ad27f395320fd37fa09d1f /src/gallium/winsys | |
parent | a7d84f7731b2095ed5dc4f741213fef60a55dcd3 (diff) |
winsys/amdgpu: return an error on IB submission failures
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-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 { |