diff options
author | Treehugger Robot <android-build-prod@system.gserviceaccount.com> | 2021-11-16 09:32:42 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-11-16 09:32:42 +0000 |
commit | 868652a82a5c2ff0aa4fe191a23b5dfe182477fd (patch) | |
tree | 6a9ff6400d18c7f4dc6d64deb7841c993017a213 | |
parent | 449b4f121e9026e34d253492c866d4d1fff1e796 (diff) | |
parent | 5efb835fb155b5b1b881325fec83f73c7e57d496 (diff) |
Merge "sf: Disable secure screen shot for multiple display" into s-keystone-qcom-dev
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 4aea4878e6..4a2f855f85 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3777,7 +3777,6 @@ void SurfaceFlinger::processDisplayRemoved(const wp<IBinder>& displayToken) { } mDisplays.erase(displayToken); - if (display && display->isVirtual()) { static_cast<void>(schedule([display = std::move(display)] { // Destroy the display without holding the mStateLock. @@ -7761,6 +7760,16 @@ status_t SurfaceFlinger::captureScreenCommon(RenderAreaFuture renderAreaFuture, }).get(); } + // Surface flinger captures individual screen shot for each display + // This will lead consumption of high GPU secure memory in case + // of secure video use cases and cause out of memory. + { + Mutex::Autolock lock(mStateLock); + if(mDisplays.size() > 1) { + hasProtectedLayer = false; + } + } + const uint32_t usage = GRALLOC_USAGE_HW_COMPOSER | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE | (hasProtectedLayer && allowProtected && supportsProtected |