diff options
-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 02d63c4ecf..360272c7e6 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3773,7 +3773,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. @@ -7757,6 +7756,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 |