drm_hwcomposer: reorder source layers according to zorder
Precomp layers may be added to the back at different points which may
cause elements to be unsorted. Make sure that these are sorted after
provisioning planes to ensure right composition based on zorder.
Signed-off-by: Adrian Salido <salidoa@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index 293160b..0f8084b 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -379,6 +379,9 @@
if (!i.plane())
continue;
+ // make sure that source layers are ordered based on zorder
+ std::sort(i.source_layers().begin(), i.source_layers().end());
+
std::vector<DrmPlane *> *container;
if (i.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
container = primary_planes;