Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ea0f7ea authored by Alec Mouri's avatar Alec Mouri
Browse files

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
parent bb4e3baf
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -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;
+0 −1
Original line number Diff line number Diff line
@@ -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;

    /* ------------------------------------------------------------------------ */