From bfbffeb4d15b8a783e2f8aa21daee5fff755913f Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Thu, 21 Jul 2016 14:49:33 -0700 Subject: 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 --- services/surfaceflinger/SurfaceFlinger.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') 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 = mDisplays[displayId]; + mHadClientComposition = mHadClientComposition || + mHwc->hasClientComposition(displayDevice->getHwcDisplayId()); + } // Release any buffers which were replaced this frame for (auto& layer : mLayersWithQueuedFrames) { -- cgit v1.2.3-59-g8ed1b