emersion/libliftoff

Plane collision prevention

Closed this issue · 1 comments

Don't allow overlapping overlay planes. Hardcode primary z-index to 0, overlay
to 1 and cursor to 2.

(Actually this isn't quite right. If z-index isn't present, some overlay planes might be under the primary plane. To mitigate this situation, make sure to only use overlay planes with an object ID > the primary plane's.)

Only do so if zpos is set on layers. Don't send the zpos property to DRM.

During the plane allocation, we need to also check whether the zpos is correct if set on the layer. Layers that aren't scanned out to a plane need to be composited on the primary plane (or somewhere else, see #13). We can only blend layers to the primary plane if there's no layer (1) colliding (2) mapped to a HW plane (3) in-between.

Thus, we can start by filling the primary plane and then planes from further to the primary plane to closer to it. Typically, fill the primary plane, then the cursor plane, then overlay planes that don't collide.

Basic support for zpos has been implemented (#4). Now the algorithm will take zpos into account, but is too strict. If two planes don't intersect, we can ignore the zpos requirements in some cases.

The reminder of this issue is optimizing plane allocation with intersection checks.