drm_hwcomposer: Count all layers with content in SquashFrame
SquashFrame previously didn't run if there was only one overlay
layer in the layer stack. This would cause false failures when
the incoming composition was composed of one or more layers with
a precomposition or squash layer.
To fix this, count all layers which are not disabled, and only
skip squashing if there is just one content layer.
BUG=b/29122961
TEST=Tested on smaug with vertical multi-window YouTube
Change-Id: Icb175b7701928136730442a39c4717a780d34cfd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 279d5a6..92323b6 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -1061,7 +1061,7 @@
// Make sure there is more than one layer to squash.
size_t src_planes_with_layer = std::count_if(
src_planes.begin(), src_planes.end(), [](DrmCompositionPlane &p) {
- return p.type() == DrmCompositionPlane::Type::kLayer;
+ return p.type() != DrmCompositionPlane::Type::kDisable;
});
if (src_planes_with_layer <= 1)
return -EALREADY;