diff options
| author | 2017-04-21 18:59:49 +0000 | |
|---|---|---|
| committer | 2017-04-21 18:59:50 +0000 | |
| commit | 09e897b415e6c0a384de7c2a9cd8f9227780244c (patch) | |
| tree | 583e9e0436aca4a2e0d059eae3569e3e868d61df | |
| parent | ec3717413332336c7b86545eebcfce8c0681b2dc (diff) | |
| parent | 0cd7619bce422d46a5f2c45ca97734ae467a1b01 (diff) | |
Merge "Defer surfaceflinger composition until data latch" into oc-dev
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 746d3d9913..9cd1214be6 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2371,6 +2371,7 @@ bool SurfaceFlinger::handlePageFlip() bool visibleRegions = false; bool frameQueued = false; + bool newDataLatched = false; // Store the set of layers that need updates. This set must not change as // buffers are being latched, as this could result in a deadlock. @@ -2398,6 +2399,9 @@ bool SurfaceFlinger::handlePageFlip() const Region dirty(layer->latchBuffer(visibleRegions, latchTime)); layer->useSurfaceDamage(); invalidateLayerStack(layer->getLayerStack(), dirty); + if (!dirty.isEmpty()) { + newDataLatched = true; + } } mVisibleRegionsDirty |= visibleRegions; @@ -2410,7 +2414,7 @@ bool SurfaceFlinger::handlePageFlip() } // Only continue with the refresh if there is actually new work to do - return !mLayersWithQueuedFrames.empty(); + return !mLayersWithQueuedFrames.empty() && newDataLatched; } void SurfaceFlinger::invalidateHwcGeometry() |