Investigate how to handle fallback to composition
emersion opened this issue · 2 comments
There are two possible outcomes of the plane allocation:
- Either all layers have been mapped to a plane
- Either some layers need to be composited
For the former, we needn't allocate a plane for the composition layer. For the latter, we need to. In particular, we need a FB ID we can perform atomic test commits with.
- Do we let the user add the composition layer if all layers don't get a plane? This will make it very annoying to use with incremental updates: for each frame, users will need to remove the fallback layer to see if complete direct scan-out is possible, then re-create it.
- Do we need a way for library users to setup a special composition/fallback layer? It will only get enabled if composition is necessary (and is guaranteed to get enabled in this case).
- Do we need a way for library users to setup different sets of layers? For instance, a set of layers without the composition layer, and another set of layers with it. But then how to make sure the composition layer always gets a plane?
Considering adding liftoff_output_set_composition_layer
. This won't allow us to composite on a non-primary plane (see #13), but is probably a good start.
I wasn't a fan of setting the composition layer in the first place, because I was hoping this wasn't necessary. However libliftoff needs to know where layers will be composited to be able to solve zpos conflicts.
Let's start with the simple liftoff_output_set_composition_layer
: https://github.com/emersion/libliftoff/tree/composition-layer. Composition on non-primary planes will need more work.