summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajat Yadav <rajayada@codeaurora.org>2021-11-08 00:05:58 +0530
committerRajat Yadav <rajayada@codeaurora.org>2021-11-12 20:47:06 +0530
commit5efb835fb155b5b1b881325fec83f73c7e57d496 (patch)
tree60abb309198822f37b83646f518f69b0490f5f1d
parent1606af9a5c48bb3bf50b016b034b8c7b5e3c711f (diff)
sf: Disable secure screen shot for multiple display
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. CRs-Fixed: 2979136 Change-Id: I5de765014183723dcc80e471f15297258eb74bb6
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp11
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