summaryrefslogtreecommitdiff
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
parent3960cddcd115201392efc6ada9a939e20769732d (diff)
downloaddrm_hwcomposer-4f4ef69e539c8f0c7352f12247b7551936736d04.tar.gz
drm_hwcomposer-4f4ef69e539c8f0c7352f12247b7551936736d04.tar.xz
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
-rw-r--r--drmdisplaycomposition.cpp9
-rw-r--r--drmdisplaycomposition.h3
-rw-r--r--drmdisplaycompositor.cpp20
3 files changed, 25 insertions, 7 deletions
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index d2b6211..d5450ff 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -186,6 +186,11 @@ static std::vector<size_t> SetBitsToVector(uint64_t in, size_t *index_map) {
return out;
}
+int DrmDisplayComposition::AddPlaneComposition(DrmCompositionPlane plane) {
+ composition_planes_.emplace_back(std::move(plane));
+ return 0;
+}
+
void DrmDisplayComposition::SeparateLayers(size_t *used_layers,
size_t num_used_layers,
DrmHwcRect<int> *exclude_rects,
@@ -484,6 +489,10 @@ int DrmDisplayComposition::Plan(SquashState *squash,
overlay_planes);
}
+ return FinalizeComposition();
+}
+
+int DrmDisplayComposition::FinalizeComposition() {
return CreateAndAssignReleaseFences();
}
diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h
index 2b24231..6c52664 100644
--- a/drmdisplaycomposition.h
+++ b/drmdisplaycomposition.h
@@ -109,6 +109,7 @@ class DrmDisplayComposition {
uint64_t frame_no);
int SetLayers(DrmHwcLayer *layers, size_t num_layers, bool geometry_changed);
+ int AddPlaneComposition(DrmCompositionPlane plane);
int AddPlaneDisable(DrmPlane *plane);
int SetDpmsMode(uint32_t dpms_mode);
int SetDisplayMode(const DrmMode &display_mode);
@@ -116,6 +117,8 @@ class DrmDisplayComposition {
int Plan(SquashState *squash, std::vector<DrmPlane *> *primary_planes,
std::vector<DrmPlane *> *overlay_planes);
+ int FinalizeComposition();
+
int CreateNextTimelineFence();
int SignalSquashDone() {
return IncreaseTimelineToPoint(timeline_squash_done_);
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;