Avoid clearing transaction flags too early
Transaction flags were cleared in commitTransactions before
checking if we needed to run the composite stage. This caused
us to miss some updates. In addition, display color matrix is only
updated if the colorMatrixChanged is set so, if we miss an update
device would be in an invalid state until the next update.
Fixes: 300194609
Test: presubmit
Change-Id: Ie397d4c37af6b54ff8d59e1151ddee24811e2d13
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index e08690a..3d08574 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2401,8 +2401,6 @@
mLayerLifecycleManager.commitChanges();
}
- commitTransactions();
-
// enter boot animation on first buffer latch
if (CC_UNLIKELY(mBootStage == BootStage::BOOTLOADER && newDataLatched)) {
ALOGI("Enter boot animation");
@@ -2410,6 +2408,10 @@
}
}
mustComposite |= (getTransactionFlags() & ~eTransactionFlushNeeded) || newDataLatched;
+ if (mustComposite && !mLegacyFrontEndEnabled) {
+ commitTransactions();
+ }
+
return mustComposite;
}