Don't wait for extra frame when changing configs.
We just need to submit a frame and check the presentation fence
to make sure that the switch happened.
Bug: 124383894
Bug: 125837936
Test: systrace
Change-Id: I136e2263f11abf92b68b13286e83400f508aa7a3
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 08a9eeb..b44f69d 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -988,15 +988,6 @@
bool SurfaceFlinger::performSetActiveConfig() NO_THREAD_SAFETY_ANALYSIS {
ATRACE_CALL();
- // we may be in the process of changing the active state
- if (mWaitForNextInvalidate) {
- mWaitForNextInvalidate = false;
-
- repaintEverythingForHWC();
- // We do not want to give another frame to HWC while we are transitioning.
- return true;
- }
-
if (mCheckPendingFence) {
if (mPreviousPresentFence != Fence::NO_FENCE &&
(mPreviousPresentFence->getStatus() == Fence::Status::Unsignaled)) {
@@ -1048,7 +1039,6 @@
getHwComposer().setActiveConfig(*displayId, mUpcomingActiveConfig.configId);
// we need to submit an empty frame to HWC to start the process
- mWaitForNextInvalidate = true;
mCheckPendingFence = true;
return false;
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 0c58de4..6a456f5 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -1132,7 +1132,6 @@
// below flags are set by main thread only
bool mDesiredActiveConfigChanged GUARDED_BY(mActiveConfigLock) = false;
- bool mWaitForNextInvalidate = false;
bool mCheckPendingFence = false;
/* ------------------------------------------------------------------------ */