summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Thomas <steventhomas@google.com> 2017-07-18 00:19:04 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-07-18 00:19:04 +0000
commit87cd11513fa0d3d0800c0f93fd1bc57ba71b0039 (patch)
tree7c998801eaa1bba988608399af3d453484970d77
parent02b37f759462b88e8b892151c1d6d52e98b797b4 (diff)
parentf5a5f6e810fb5064b81d0b5360fe65829eb90980 (diff)
Merge "Fix concurrent writes to the hardware composer" into oc-dr1-dev
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp9
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h7
2 files changed, 9 insertions, 7 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3d619324cb..bd2441f6b1 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1255,17 +1255,14 @@ void SurfaceFlinger::setVsyncEnabled(int disp, int enabled) {
enabled ? HWC2::Vsync::Enable : HWC2::Vsync::Disable);
}
-void SurfaceFlinger::clearHwcLayers(const LayerVector& layers) {
- for (size_t i = 0; i < layers.size(); ++i) {
- layers[i]->clearHwcLayers();
- }
-}
-
// Note: it is assumed the caller holds |mStateLock| when this is called
void SurfaceFlinger::resetHwcLocked() {
disableHardwareVsync(true);
clearHwcLayers(mDrawingState.layersSortedByZ);
clearHwcLayers(mCurrentState.layersSortedByZ);
+ for (size_t disp = 0; disp < mDisplays.size(); ++disp) {
+ clearHwcLayers(mDisplays[disp]->getVisibleLayersSortedByZ());
+ }
// Clear the drawing state so that the logic inside of
// handleTransactionLocked will fire. It will determine the delta between
// mCurrentState and mDrawingState and re-apply all changes when we make the
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 8e47396222..53c3823ce3 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -586,7 +586,12 @@ private:
/* ------------------------------------------------------------------------
* VrFlinger
*/
- void clearHwcLayers(const LayerVector& layers);
+ template<typename T>
+ void clearHwcLayers(const T& layers) {
+ for (size_t i = 0; i < layers.size(); ++i) {
+ layers[i]->clearHwcLayers();
+ }
+ }
void resetHwcLocked();
// Check to see if we should handoff to vr flinger.