Add support for detecting and handling graphics resets

Review Request #110524 - Created May 19, 2013 and submitted

Fredrik Höglund
A graphics reset occurs when the kernel resets the GPU after a hang
has been detected.

After a reset, the contents of buffer objects, framebuffers and textures
may be in an undefined state, so the GL context must be destroyed and
recreated along with all resources.

In the future a reset will also happen when switching GPU's on a laptop
with more than one GPU. This is the main reason why it's important for
kwin to be able to handle this gracefully.

This code should be improved in the future to disable compositing if
multiple resets are detected in a short period of time.

commit 078094f005dd9c0591349d4fa7331a49c1f6a5ed
Author: Fredrik Höglund <>
Date:   Sun May 19 16:45:06 2013 +0200

    kwin: Detect and handle graphics resets
    Reset compositing when the GL context state has been lost as a result
    of a graphics reset.

commit 928764c1744c106bbc2eee3071a162f7b828ee29
Author: Fredrik Höglund <>
Date:   Sun May 19 16:28:48 2013 +0200

    kwin/glx: Add support for GLX_ARB_create_context_robustness
    Request a context with robust buffer access behavior, and set the reset
    notification strategy to GLX_LOSE_CONTEXT_ON_RESET_ARB.
Simulated reset.
Martin Flöser
Martin Flöser
Martin Flöser
Fredrik Höglund
Review request changed

Status: Closed (submitted)