Only commit planes on the appropriate output
liftoff_output_apply() is meant to only apply to a single output. But currently it sets properties on every plane on the device, including those which are attached to the CRTC of a different output. This means that CRTCs of other outputs will get included in this atomic commit.
The problem this causes is that DRM sends a page-flip event for each
CRTC included in a commit. wlroots will only be expecting a single
page-flip per commit, but when there are multiple connectors/CRTCs
wlroots will unexpectedly get multiple page-flip events per commit.
This causes a use-after-free on page_flip
in handle_page_flip()
(and
in my experience quickly segfaults when libliftoff is used with multiple
monitors).
The fix is simply to only commit planes attached to the output we're meant to be committing. Any planes attached to other outputs are left untouched.