summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2021-04-12 10:04:02 +0200
committerMarge Bot <eric+marge@anholt.net>2021-04-14 07:00:00 +0000
commit8fd912b9ae9bdfbbfc660a28776606ed3c810f52 (patch)
tree0a4a064f82a3fef891464c89249c87d26a30c620 /src/gallium/winsys
parent93183480fc06267d1ab676e3286e76ea422ac7df (diff)
amdgpu,radeon: add full_reset_only param to ctx_query_reset_status
Using this boolean the caller tells if it wants to ignore resets fixed by a soft recovery. When true, amdgpu can skip the call to libdrm if no cs has been rejected (since only full gpu reset cause cs rejections). Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10179>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c11
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 6b9614f3f41..e8263818968 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -334,7 +334,8 @@ static void amdgpu_ctx_destroy(struct radeon_winsys_ctx *rwctx)
}
static enum pipe_reset_status
-amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx, bool *needs_reset)
+amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx, bool full_reset_only,
+ bool *needs_reset)
{
struct amdgpu_ctx *ctx = (struct amdgpu_ctx*)rwctx;
int r;
@@ -346,6 +347,14 @@ amdgpu_ctx_query_reset_status(struct radeon_winsys_ctx *rwctx, bool *needs_reset
if (ctx->ws->info.drm_minor >= 24) {
uint64_t flags;
+ if (full_reset_only &&
+ ctx->initial_num_total_rejected_cs == ctx->ws->num_total_rejected_cs) {
+ /* If the caller is only interested in full reset (= wants to ignore soft
+ * recoveries), we can use the rejected cs count as a quick first check.
+ */
+ return PIPE_NO_RESET;
+ }
+
r = amdgpu_cs_query_reset_state2(ctx->ctx, &flags);
if (r) {
fprintf(stderr, "amdgpu: amdgpu_cs_query_reset_state failed. (%i)\n", r);
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 3a3f28dda8a..a9eaf9688b6 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -87,7 +87,8 @@ static void radeon_drm_ctx_destroy(struct radeon_winsys_ctx *ctx)
}
static enum pipe_reset_status
-radeon_drm_ctx_query_reset_status(struct radeon_winsys_ctx *rctx, bool *needs_reset)
+radeon_drm_ctx_query_reset_status(struct radeon_winsys_ctx *rctx, bool full_reset_only,
+ bool *needs_reset)
{
struct radeon_ctx *ctx = (struct radeon_ctx*)rctx;