summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/DisplayDevice.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2020-01-21 14:36:08 -0800
committer Vishnu Nair <vishnun@google.com> 2020-01-21 21:17:50 -0800
commit9b079a2fef76ed1dfa69b158889edd0af5e6e52c (patch)
tree0072ca6810ee57122aa5b56abf52b18032b0f6f1 /services/surfaceflinger/DisplayDevice.cpp
parent0a4b951a590910bab35f20f03d25316426dbf8ae (diff)
Skip client composition requests
Keep track of client compositions requests in CompositionEngine and the buffer used to render the request. If the requests do not change and the buffer matches, reuse the buffer instead of going to client composition. Certain layers properties (buffer format, rounded corner or shadows) will force the device to go into GPU or mixed composition. In mixed composition scenarios, we can avoid redundant client composition requests by reusing the RenderSurface buffers. If the device goes into GPU composition then all the layers will be composited and there will be no performance benefit. Bug: b/136561771, b/144690120 Test: dump SurfaceFlinger --timestats -dump Test: manual testing with mixed and gpu composition scenarios Test: atest libcompositionengine_test libsurfaceflinger_unittest SurfaceFlinger_test Change-Id: I466d5dcded0c9fcfa64bc72fd91dfaddd795f315
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index e2122d1d30..4ae6dadfe8 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -70,6 +70,12 @@ DisplayDevice::DisplayDevice(DisplayDeviceCreationArgs&& args)
args.nativeWindow.get()),
args.nativeWindow, args.displaySurface});
+ if (!mFlinger->mDisableClientCompositionCache &&
+ SurfaceFlinger::maxFrameBufferAcquiredBuffers > 0) {
+ mCompositionDisplay->createClientCompositionCache(
+ static_cast<uint32_t>(SurfaceFlinger::maxFrameBufferAcquiredBuffers));
+ }
+
mCompositionDisplay->createDisplayColorProfile(
compositionengine::DisplayColorProfileCreationArgs{args.hasWideColorGamut,
std::move(args.hdrCapabilities),