From: Samuel Pitoiset Date: Mon, 17 Apr 2023 10:34:11 +0000 (+0200) Subject: radv/amdgpu: remove legacy code for querying context status X-Git-Tag: upstream/23.3.3~9883 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c221bfbd85d2132e3b907ffb8586f466ba1ce34c;p=platform%2Fupstream%2Fmesa.git radv/amdgpu: remove legacy code for querying context status Signed-off-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9d44b14..9a75b2c 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -617,8 +617,6 @@ radv_check_status(struct vk_device *vk_device) return vk_device_set_lost(&device->vk, "GPU hung detected in this process"); if (status == RADV_INNOCENT_CONTEXT_RESET) return vk_device_set_lost(&device->vk, "GPU hung triggered by other process"); - if (status == RADV_UNKNOWN_CONTEXT_RESET) - return vk_device_set_lost(&device->vk, "GPU hung triggered by unknown source"); } } diff --git a/src/amd/vulkan/radv_radeon_winsys.h b/src/amd/vulkan/radv_radeon_winsys.h index d5fdc1c..c269935 100644 --- a/src/amd/vulkan/radv_radeon_winsys.h +++ b/src/amd/vulkan/radv_radeon_winsys.h @@ -106,7 +106,6 @@ enum radv_reset_status { RADV_NO_RESET, RADV_GUILTY_CONTEXT_RESET, RADV_INNOCENT_CONTEXT_RESET, - RADV_UNKNOWN_CONTEXT_RESET, }; struct radeon_cmdbuf { diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index c6f6ac6..1b00755 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -1324,41 +1324,21 @@ radv_amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx) { int ret; struct radv_amdgpu_ctx *ctx = (struct radv_amdgpu_ctx *)rwctx; + uint64_t flags; - if (ctx->ws->info.drm_minor >= 24) { - uint64_t flags; - ret = amdgpu_cs_query_reset_state2(ctx->ctx, &flags); - - if (ret) { - fprintf(stderr, "radv/amdgpu: amdgpu_cs_query_reset_state2 failed. (%i)\n", ret); - return RADV_NO_RESET; - } - - if (flags & AMDGPU_CTX_QUERY2_FLAGS_RESET) { - if (flags & AMDGPU_CTX_QUERY2_FLAGS_GUILTY) { - /* Some job from this context once caused a GPU hang */ - return RADV_GUILTY_CONTEXT_RESET; - } else { - /* Some job from other context caused a GPU hang */ - return RADV_INNOCENT_CONTEXT_RESET; - } - } - } else { - uint32_t result, hangs; - - ret = amdgpu_cs_query_reset_state(ctx->ctx, &result, &hangs); - if (ret) { - fprintf(stderr, "radv/amdgpu: amdgpu_cs_query_reset_state failed. (%i)\n", ret); - return RADV_NO_RESET; - } + ret = amdgpu_cs_query_reset_state2(ctx->ctx, &flags); + if (ret) { + fprintf(stderr, "radv/amdgpu: amdgpu_cs_query_reset_state2 failed. (%i)\n", ret); + return RADV_NO_RESET; + } - switch (result) { - case AMDGPU_CTX_GUILTY_RESET: + if (flags & AMDGPU_CTX_QUERY2_FLAGS_RESET) { + if (flags & AMDGPU_CTX_QUERY2_FLAGS_GUILTY) { + /* Some job from this context once caused a GPU hang */ return RADV_GUILTY_CONTEXT_RESET; - case AMDGPU_CTX_INNOCENT_RESET: + } else { + /* Some job from other context caused a GPU hang */ return RADV_INNOCENT_CONTEXT_RESET; - case AMDGPU_CTX_UNKNOWN_RESET: - return RADV_UNKNOWN_CONTEXT_RESET; } }