Add support for detecting and handling graphics resets
Review Request #110524 - Created May 19, 2013 and submitted
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 <firstname.lastname@example.org> 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 <email@example.com> 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.
There's also another reason for having that code: it will fix one of our most often occurring crashes after a hung GPU. Is there a similar extension for EGL available?
FTR: I have lately experienced a hung GPU about once a week. Unfortunately I am not able to trigger it at will, but I should be able to notice whether the code does not work given enough time.