Mechanism to wait for page-flip before reusing plane on different CRTC
Not sure if this is the same issue described in #34, but it sounded a bit different.
What I'm trying to fix in !85 is a bit more complicated than I initially thought. I think my EBUSYs are happening when a commit on output A frees up a plane and then a commit on output B tries to use the same plane before output A has done a page-flip. As far as I can see there's nothing in libliftoff/wlroots to prevent this
I propose: (better naming suggestions welcome)
- Add to
struct liftoff_plane
a newfree_after_pageflip
field pointing to the output the plane used to be attached to. This gets set inliftoff_output_apply()
when clearing layer-plane mappings. - Add a new
void liftoff_output_pageflip(struct liftoff_output *output)
function which clearsfree_after_pageflip
for any planes matching the output. - Make
liftoff_output_apply()
not use any planes which havefree_after_pageflip
set to an output other than the current one
How does that sound? If we wanted to make the change non-breaking then there could be a new liftoff_output_apply_pending()
with the new behaviour while the existing liftoff_output_apply()
doesn't set free_after_pageflip
.