Better lost context robustness for window systems

Marek Olšák maraeo at
Mon Aug 7 01:05:49 UTC 2023

There is a possibility to have robust contexts for all apps within a
window system when apps themselves are not robust.

If an app is robust, losing a context skips all following API calls.
The app must recreate its context and resources and continue.

When an app is not robust, losing a context results in undefined
behavior, including but not limited to  process termination.

The last case can be improved as follows. The window system can tell
its apps (via egl/wayland, etc.) to create all contexts as robust if
an app doesn't do that. In this case, the reset status isn't returned
to apps, but instead it's returned to the window system.

If the window system receives it, it knows that:
- the app is not robust
- the app lost its context

The window system can do this:
- gray out the window
- inform the user about the situation
- give the user a list of actions to choose from (wait or terminate
the process, report the issue to the distro vendor, etc.)


More information about the mesa-dev mailing list