aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Salido <salidoa@google.com>2017-10-06 21:37:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-10-06 21:37:35 +0000
commit93be6aefeb68bf2b098ac4bd6c75a499862e63c7 (patch)
tree7eb3d2bd745c1e8c895194a4d3f20b7d2260a941
parent8fc5634650ccdeb95dc98e0b421dee3ff6edf154 (diff)
parent556f56cea7c73c9ab06acd49c1509f256c4b51c0 (diff)
downloaddrm_hwcomposer-93be6aefeb68bf2b098ac4bd6c75a499862e63c7.tar.gz
Merge "drm_hwcomposer: make sure primary plane is allocated for squash" into oc-mr1-devoreo-mr1-dev
-rw-r--r--drmdisplaycompositor.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 3d27f13..14b87aa 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -982,10 +982,13 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
goto move_layers_back;
}
- if (comp_plane.type() == DrmCompositionPlane::Type::kDisable) {
+ if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
+ squashed_comp.set_plane(comp_plane.plane());
+ else
dst->AddPlaneDisable(comp_plane.plane());
+
+ if (comp_plane.type() == DrmCompositionPlane::Type::kDisable)
continue;
- }
for (auto i : comp_plane.source_layers()) {
DrmHwcLayer &layer = src_layers[i];
@@ -1004,11 +1007,12 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
squashed_comp.source_layers().push_back(
squashed_comp.source_layers().size());
}
+ }
- if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
- squashed_comp.set_plane(comp_plane.plane());
- else
- dst->AddPlaneDisable(comp_plane.plane());
+ if (squashed_comp.plane() == NULL) {
+ ALOGE("Primary plane not found for squash");
+ ret = -ENOTSUP;
+ goto move_layers_back;
}
ret = dst->SetLayers(dst_layers.data(), dst_layers.size(), false);