summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2016-07-21 14:49:33 -0700
committer Dan Stoza <stoza@google.com> 2016-07-21 14:49:33 -0700
commitbfbffeb4d15b8a783e2f8aa21daee5fff755913f (patch)
tree26eb681524605a3b4dee0aec23c3ff2de517dfd5
parentec0f717dfd3821cbc648198c6d3b98fcc3b53369 (diff)
HWC2: Check all displays for client composition
SurfaceFlinger currently only checks whether the primary display performed client composition when considering whether to propagate backpressure back to apps. This change expands that check to all displays so that if an external or virtual display is using client composition it disables backpressure propagation as well. Bug: 30022738 Change-Id: I7f7d4e0a1ea7d27ef1f280e2b4ebd5e5bd3bd911
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 4d82c1ca7a..95446f0f6c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1063,7 +1063,13 @@ void SurfaceFlinger::handleMessageRefresh() {
postComposition(refreshStartTime);
mPreviousPresentFence = mHwc->getRetireFence(HWC_DISPLAY_PRIMARY);
- mHadClientComposition = mHwc->hasClientComposition(HWC_DISPLAY_PRIMARY);
+
+ mHadClientComposition = false;
+ for (size_t displayId = 0; displayId < mDisplays.size(); ++displayId) {
+ const sp<DisplayDevice>& displayDevice = mDisplays[displayId];
+ mHadClientComposition = mHadClientComposition ||
+ mHwc->hasClientComposition(displayDevice->getHwcDisplayId());
+ }
// Release any buffers which were replaced this frame
for (auto& layer : mLayersWithQueuedFrames) {