backend-drm: fix race during system suspend
Depending on system loading, weston-launcher could drop the drm master access before the compositor and all the clients receive the notification. In this case, some commit could be sent to the drm driver too late and get refused with error EACCES. This error condition is not properly managed and causes weston to hang.
Only for atomic modeset, cancel current repaint in case of EACCES. No need to wait for suspend or for any notification; in case the weston reschedules a repaint, it will get EACCES again. At resume, damage-all guarantees a complete repaint.
Legacy modeset suffers from similar problems, but it is not fixed by this change. Since drm_pending_state_apply() never returns error for legacy modeset, this change has no impact on legacy modeset.
Signed-off-by: Antonio Borneo antonio.borneo@st.com Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/117