summaryrefslogtreecommitdiff
path: root/drmdisplaycompositor.cpp
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2016-05-03 16:40:59 -0700
committerSean Paul <seanpaul@chromium.org>2016-05-12 14:27:16 -0400
commit4f4ef69e539c8f0c7352f12247b7551936736d04 (patch)
tree4a2688daf8cc45fcea8ae54cf75d197a8edff1ae /drmdisplaycompositor.cpp
parent3960cddcd115201392efc6ada9a939e20769732d (diff)
drm_hwcomposer: Don't use Plan() in SquashAll
Simplify the SquashAll() function by generating the composition without using Plan(). This allows us to specify exactly what we want on the screen without involving the normal plane provisioning code. BUG=b/28117135 TEST=Tested on ryu, squashing still works Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: Ieec9c323941e2a80252b33d14563c4d218d38dfb
Diffstat (limited to 'drmdisplaycompositor.cpp')
-rw-r--r--drmdisplaycompositor.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index acd5436..10a1ffc 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -1054,8 +1054,8 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
return ret;
}
- std::vector<DrmPlane *> primary_planes;
- std::vector<DrmPlane *> fake_overlay_planes;
+ DrmCompositionPlane squashed_comp(DrmCompositionPlane::Type::kPrecomp, NULL,
+ src->crtc());
std::vector<DrmHwcLayer> dst_layers;
for (DrmCompositionPlane &comp_plane : src_planes) {
// Composition planes without DRM planes should never happen
@@ -1082,11 +1082,12 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
// filling the OutputFds.
layer.release_fence = OutputFd();
dst_layers.emplace_back(std::move(layer));
+ squashed_comp.source_layers().push_back(
+ squashed_comp.source_layers().size());
}
- if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY &&
- primary_planes.size() == 0)
- primary_planes.push_back(comp_plane.plane());
+ if (comp_plane.plane()->type() == DRM_PLANE_TYPE_PRIMARY)
+ squashed_comp.set_plane(comp_plane.plane());
else
dst->AddPlaneDisable(comp_plane.plane());
}
@@ -1097,8 +1098,13 @@ int DrmDisplayCompositor::SquashFrame(DrmDisplayComposition *src,
goto move_layers_back;
}
- ret =
- dst->Plan(NULL /* SquashState */, &primary_planes, &fake_overlay_planes);
+ ret = dst->AddPlaneComposition(std::move(squashed_comp));
+ if (ret) {
+ ALOGE("Failed to add squashed plane composition %d", ret);
+ goto move_layers_back;
+ }
+
+ ret = dst->FinalizeComposition();
if (ret) {
ALOGE("Failed to plan for squash all composition %d", ret);
goto move_layers_back;