diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 948cf9ce95e..a589ceefd58 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -550,15 +550,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign /* Initialize the context handle and the command stream. */ sctx->ctx = sctx->ws->ctx_create(sctx->ws, sctx->context_flags); - if (!sctx->ctx && sctx->context_flags & PIPE_CONTEXT_HIGH_PRIORITY) { - /* Context priority should be treated as a hint. If context creation - * fails with the requested priority, for example because the caller - * lacks CAP_SYS_NICE capability or other system resource constraints, - * fallback to normal priority. - */ - sctx->context_flags &= ~PIPE_CONTEXT_HIGH_PRIORITY; - sctx->ctx = sctx->ws->ctx_create(sctx->ws, sctx->context_flags); - } if (!sctx->ctx) { fprintf(stderr, "radeonsi: can't create radeon_winsys_ctx\n"); goto fail; diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp index 3fbd4a76a83..46c187072cb 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.cpp @@ -268,7 +268,15 @@ static struct radeon_winsys_ctx *amdgpu_ctx_create(struct radeon_winsys *rws, un dev = ctx->aws->dev; - r = ac_drm_cs_ctx_create2(dev, amdgpu_priority, &ctx->ctx_handle); + while (1) { + r = ac_drm_cs_ctx_create2(dev, amdgpu_priority, &ctx->ctx_handle); + if (r == -EACCES && amdgpu_priority == AMDGPU_CTX_PRIORITY_HIGH) { + /* Try again with a lower priority. */ + amdgpu_priority = AMDGPU_CTX_PRIORITY_NORMAL; + continue; + } + break; + } if (r) { fprintf(stderr, "amdgpu: amdgpu_cs_ctx_create2 failed. (%i)\n", r); goto error_create;