summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2019-04-05 10:32:50 -0700
committer Ady Abraham <adyabr@google.com> 2019-04-08 11:01:12 -0700
commit8f1ee7fdcf5c602aa87a93b727a696bb8e9eddb0 (patch)
tree6674593c7df2539979ca549d7802783caf24d1e4 /services/surfaceflinger/Layer.cpp
parent09bd3920155f0961b303d1cdd0f6027135aff36d (diff)
SurfaceFlinger: handle wallpaper scenario in Scheduler
Use the fact that a layer contains wallpaper in Scheduler's algorithm when picking a refresh rate. Wallpaper should be presented in the lowest active refresh rate to preserve power. Test: systrace during wallpaper Bug: 124065567 Change-Id: Ibb18e62eaf1a6b9b3ab1ec18a3135fb17c8f57fc
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index de05f74a9b..b47497a33a 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -70,7 +70,10 @@ using base::StringAppendF;
std::atomic<int32_t> Layer::sSequence{1};
Layer::Layer(const LayerCreationArgs& args)
- : mFlinger(args.flinger), mName(args.name), mClientRef(args.client) {
+ : mFlinger(args.flinger),
+ mName(args.name),
+ mClientRef(args.client),
+ mWindowType(args.metadata.getInt32(METADATA_WINDOW_TYPE, 0)) {
mCurrentCrop.makeInvalid();
uint32_t layerFlags = 0;
@@ -115,7 +118,7 @@ Layer::Layer(const LayerCreationArgs& args)
mFrameEventHistory.initializeCompositorTiming(compositorTiming);
mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval);
- mSchedulerLayerHandle = mFlinger->mScheduler->registerLayer(mName.c_str());
+ mSchedulerLayerHandle = mFlinger->mScheduler->registerLayer(mName.c_str(), mWindowType);
mFlinger->onLayerCreated();
}
@@ -1300,6 +1303,7 @@ void Layer::miniDumpHeader(std::string& result) {
result.append("-----------------------------\n");
result.append(" Layer name\n");
result.append(" Z | ");
+ result.append(" Window Type | ");
result.append(" Comp Type | ");
result.append(" Transform | ");
result.append(" Disp Frame (LTRB) | ");
@@ -1336,6 +1340,7 @@ void Layer::miniDump(std::string& result, const sp<DisplayDevice>& displayDevice
} else {
StringAppendF(&result, " %10d | ", layerState.z);
}
+ StringAppendF(&result, " %10d | ", mWindowType);
StringAppendF(&result, "%10s | ", toString(getCompositionType(displayDevice)).c_str());
StringAppendF(&result, "%10s | ",
toString(getCompositionLayer() ? compositionState.bufferTransform