Skip to content

[40] kms: Gracefully handle page flipping direct scanouts failing

Jonas Ådahl requested to merge cherry-pick-1d792087 into gnome-40

When drmModePageFlip() or drmModeAtomicCommit() unexpectedly failed (e.g. ENOSPC, which has been seen in the wild), this failure was not handled very gracefully. The page flip listener for the scanout was left in the MetaKmsUpdate, meaning when the primary plane composition was later page flipped, two page flip listeners were added, one for the primary plane, and one for the scanout. This caused the 'page-flipped' event to be handled twice, the second time being fatal.

Handle this by making 'no-discard' listener flag be somewhat reversed, and say 'drop-on-error', and then drop all 'drop-on-error' listeners when a MetaKmsUpdate failed to be processed.

Also for a "preserve" flagged update, don't ever trigger "discard" callbacks just yet, as preserved updates are used again for the primary plane composition, in order to not miss e.g. CRTC gamma updates, or cursor plane updates, which were added separately.

Closes: #1809 (closed) Part-of: !1910 (merged)

(cherry picked from commit 1d792087)

Merge request reports