Skip to content

Commit

Permalink
winsys/amdgpu: Hook up guilt to amdgpu_ctx_set_sw_reset_status
Browse files Browse the repository at this point in the history
Certain return values have certain meanings indicating context loss and
guilt. Hook those up here.

Signed-off-by: Joshua Ashton <[email protected]>
  • Loading branch information
misyltoad committed Jan 18, 2024
1 parent 9ca7d77 commit 08f7fb3
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,22 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index)

cleanup:
if (unlikely(r)) {
amdgpu_ctx_set_sw_reset_status((struct radeon_winsys_ctx*)acs->ctx,
PIPE_GUILTY_CONTEXT_RESET,
"amdgpu: The CS has been rejected (%i).\n", r);
if (r == -ECANCELED) {
amdgpu_ctx_set_sw_reset_status((struct radeon_winsys_ctx*)acs->ctx, PIPE_INNOCENT_CONTEXT_RESET,
"amdgpu: The CS has cancelled because the context is lost. This context is innocent.\n");
} else if (r == -ENODATA) {
amdgpu_ctx_set_sw_reset_status((struct radeon_winsys_ctx*)acs->ctx, PIPE_GUILTY_CONTEXT_RESET,
"amdgpu: The CS has cancelled because the context is lost. This context is guilty of a soft recovery.\n");
} else if (r == -ETIME) {
amdgpu_ctx_set_sw_reset_status((struct radeon_winsys_ctx*)acs->ctx, PIPE_GUILTY_CONTEXT_RESET,
"amdgpu: The CS has cancelled because the context is lost. This context is guilty of a hard recovery.\n");
} else {
amdgpu_ctx_set_sw_reset_status((struct radeon_winsys_ctx*)acs->ctx,
PIPE_UNKNOWN_CONTEXT_RESET,
"amdgpu: The CS has been rejected, "
"see dmesg for more information (%i).\n",
r);
}
}

/* If there was an error, signal the fence, because it won't be signalled
Expand Down

0 comments on commit 08f7fb3

Please sign in to comment.