OSDN Git Service

Don't wait for extra frame when changing configs.
authorAlec Mouri <alecmouri@google.com>
Fri, 22 Feb 2019 22:15:31 +0000 (14:15 -0800)
committerAlec Mouri <alecmouri@google.com>
Thu, 7 Mar 2019 23:16:16 +0000 (15:16 -0800)
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

services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h

index 08a9eeb..b44f69d 100644 (file)
@@ -988,15 +988,6 @@ void SurfaceFlinger::setActiveConfigInternal() {
 
 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 @@ bool SurfaceFlinger::performSetActiveConfig() NO_THREAD_SAFETY_ANALYSIS {
     getHwComposer().setActiveConfig(*displayId, mUpcomingActiveConfig.configId);
 
     // we need to submit an empty frame to HWC to start the process
-    mWaitForNextInvalidate = true;
     mCheckPendingFence = true;
 
     return false;
index 0c58de4..6a456f5 100644 (file)
@@ -1132,7 +1132,6 @@ private:
 
     // below flags are set by main thread only
     bool mDesiredActiveConfigChanged GUARDED_BY(mActiveConfigLock) = false;
-    bool mWaitForNextInvalidate = false;
     bool mCheckPendingFence = false;
 
     /* ------------------------------------------------------------------------ */