Planes aren't actually freed until page-flip
If a plane is lit up on a CRTC and we disable it, that plane isn't actually free for reuse on another CRTC until vblank/page-flip. Currently we don't take this into account which leads to commit fails with EBUSY when multiple outputs are used.
This commit adds a new flag to each plane indicating when its
disabled-ness is only valid after a pending commit completes. It stores
the output on which we need to wait for vblank before reusing this plane
elsewhere. A new liftoff_output_pageflip()
function needs to be
called by the user after vblank so that we can mark these planes as
actually-free.
This commit also fixes a few related issues. Previously, in every commit we would set FB=0 CRTC=0 on all unused planes to make sure they are disabled. But this pulls the plane into the commit (even if it was already disabled so we're not even changing anything!) meaning commits on other CRTCs can't touch it again until vblank. Here I change this logic to only disable commits which are newly disabled and not touch any others.
Fixes #84