Currently, we allocate layers to device composition from bottom to top and save the last DrmPlane from the top to be used by the client target buffer.
However, we don't know much about client layer, so information for layers which we decided to set as ClientComposition, will be lost.
For example, in BlendMode case if we have the following scene, with 2 DrmPlanes available.
z0: LAYER0 AR24 BlendNone.
z1: LAYER1 AR24 BlendPremulti.
z2: LAYER2 AR24 BlendPremulti.
z0: LAYER0 DeviceComposition
z1: LAYER1 ClientComposition
z2: LAYER2 ClientComposition
LAYER1+LAYER2 will be in client target buffer, but we don't know nothing about the blending for client_target_layer. Which Android actually expects to be still BlendPremulti. So, we are kind of stucked we the default value which is BlendNone.
I think there are two ways to solve this issue:
This commit, allocate layers as DeviceComposition from top to bottom and save the bottom for ClientComposition.
A smarter logic for detecting what should be the actual properties of client_layer_target, but I still think it makes more sense to actually have the client_layer_target at the bottom.
Signed-off-by: Alexandru Gheorghe email@example.com