From 4a09f976791268bd74be59563bba85779df620e8 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 2 Dec 2022 19:12:27 +0100 Subject: [PATCH] openglbackend: reduce timeout for handling graphics resets With current and broken behavior in Mesa, the timeout will always be reached. GPU resets don't take anywhere near even a second, making the user wait for 10s has no use. --- src/platformsupport/scenes/opengl/openglbackend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/scenes/opengl/openglbackend.cpp b/src/platformsupport/scenes/opengl/openglbackend.cpp index d07a50c1df..9eb7c1c747 100644 --- a/src/platformsupport/scenes/opengl/openglbackend.cpp +++ b/src/platformsupport/scenes/opengl/openglbackend.cpp @@ -101,11 +101,11 @@ bool OpenGLBackend::checkGraphicsReset() QElapsedTimer timer; timer.start(); - // Wait until the reset is completed or max 10 seconds - while (timer.elapsed() < 10000 && KWin::glGetGraphicsResetStatus() != GL_NO_ERROR) { + // Wait until the reset is completed or max one second + while (timer.elapsed() < 1000 && KWin::glGetGraphicsResetStatus() != GL_NO_ERROR) { usleep(50); } - if (timer.elapsed() >= 10000) { + if (timer.elapsed() >= 1000) { qCWarning(KWIN_OPENGL) << "Waiting for glGetGraphicsResetStatus to return GL_NO_ERROR timed out!"; }