Draft: Support GPU recovery in gl renderer of drm backend
This MR is trying to support GPU recovery in gl renderer.
Currently, if a GPU reset occurs, the Weston process is likely to be terminated by the GL driver (such as Mesa). Subsequently, the GDM service will attempt to restart Weston. Consequently, all running applications will also be terminated (presumably due to the loss of connection to Weston?). This results in a less than optimal user experience, especially in applications like In-Vehicle Infotainment systems. The proposed/ideal solution is for Weston and some important applications to be able to continue running after a GPU reset.
This MR will try to: 1, Create the EGL robust context to make sure Weston process will not be killed 2, Detect GPU reset event each frame 3, Recreate the EGL context if GPU reset happened 4, Recreate all the GL/EGL related resources to make sure they are valid in the new EGL context.
This MR is experiment and far from the ideal solution, I tested it on Ubuntu 22.04 AMDGPU+mesa platform, it will only make sure Weston is alive after GPU reset. Actually the panel is lost, and you can open a new terminal to run new applications. I want to know if I am in the right direction. If yes, we can continue to refine this MR, while if not, are there any other solutions to support graceful GPU recovery in Weston?