[Mesa-dev] Context restoration after GPU hangs

Chris Wilson chris at chris-wilson.co.uk
Thu Feb 14 12:04:58 UTC 2019


The kernel tries to repair a hanging context by restoring the default
state (or else we have discovered that the context may be unusably
corrupt by the reset). However, this is unsuitable for mesa as it
(rightfully) assumes that the context image contains the state it has
earlier set and so only emits incremental changes (e.g. it setups up
register invariants once at context creation and thenceforth never has
to touch those registers again). If we overwrite mesa's state with the
default state, that too can lead to nasty hangs. Lose-lose. An
alternative is that we tell the kernel not to bother trying to recover
from the hang, but report back to userspace that the context is lost
immediately and leave it to mesa to do its own recovery.

This patch provides the minimum that should do the trick, but there's
probably a lot of stones that need to turned over to find the residual
state that isn't being reset (since BRW_NEW_CONTEXT went out of fashion
;) I'd like to get this concept acked so that we can land the
corresponding kernel patch and make the uAPI official and start putting
it to use.
-Chris




More information about the mesa-dev mailing list