Module: Mesa Branch: main Commit: 71c5db5e11290cf1e37346b9ad8ba07320586857 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=71c5db5e11290cf1e37346b9ad8ba07320586857
Author: Pierre-Eric Pelloux-Prayer <[email protected]> Date: Fri Apr 7 09:28:43 2023 +0200 mesa: don't share reset status across contexts If Driver.GetGraphicsResetStatus exists for one context, other contexts will be able to use it; so there's no need to inherit reset status from the other contexts. This also prevented implementing the spec correctly: we're supposed to report GL_NO_ERROR when the reset is completed (after reporting GL_*_RESET at least once): If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset status is repeatedly returned, the context may be in the process of resetting. With the existing code, the contexts will report INNOCENT_CONTEXT_RESET forever. Reviewed-by: André Almeida <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22290> --- src/mesa/main/robustness.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/mesa/main/robustness.c b/src/mesa/main/robustness.c index 6f0b984d7e0..abe6d0f6afe 100644 --- a/src/mesa/main/robustness.c +++ b/src/mesa/main/robustness.c @@ -133,29 +133,10 @@ _mesa_GetGraphicsResetStatusARB( void ) return GL_NO_ERROR; } - if (ctx->Driver.GetGraphicsResetStatus) { - /* Query the reset status of this context from the driver core. - */ + /* Query the reset status of this context from the driver core. */ + if (ctx->Driver.GetGraphicsResetStatus) status = ctx->Driver.GetGraphicsResetStatus(ctx); - simple_mtx_lock(&ctx->Shared->Mutex); - - /* If this context has not been affected by a GPU reset, check to see if - * some other context in the share group has been affected by a reset. - * If another context saw a reset but this context did not, assume that - * this context was not guilty. - */ - if (status != GL_NO_ERROR) { - ctx->Shared->ShareGroupReset = true; - ctx->Shared->DisjointOperation = true; - } else if (ctx->Shared->ShareGroupReset && !ctx->ShareGroupReset) { - status = GL_INNOCENT_CONTEXT_RESET_ARB; - } - - ctx->ShareGroupReset = ctx->Shared->ShareGroupReset; - simple_mtx_unlock(&ctx->Shared->Mutex); - } - if (status != GL_NO_ERROR) _mesa_set_context_lost_dispatch(ctx);
