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

Commit b048cef2 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix UI freezes

In some situations SF would mark a window as "has a pending update"
but would never process that update because the window is not
visible (fully transparent, hidden by another window, etc...), this
window would then be "stuck" until some other window updated.

Change-Id: Ifa18a9aef3a53f2593b473556702688ae62d9503
parent 2040427e
Loading
Loading
Loading
Loading
+18 −21
Original line number Original line Diff line number Diff line
@@ -419,9 +419,7 @@ void SurfaceFlinger::onMessageReceived(int32_t what)
            // post surfaces (if needed)
            // post surfaces (if needed)
            handlePageFlip();
            handlePageFlip();


            if (!mDirtyRegion.isEmpty()) {
            signalRefresh();
            signalRefresh();
            }
        } break;
        } break;


        case MessageQueue::REFRESH: {
        case MessageQueue::REFRESH: {
@@ -430,7 +428,6 @@ void SurfaceFlinger::onMessageReceived(int32_t what)
            const DisplayHardware& hw(graphicPlane(0).displayHardware());
            const DisplayHardware& hw(graphicPlane(0).displayHardware());
            handleRefresh();
            handleRefresh();


            if (!mDirtyRegion.isEmpty()) {
            if (CC_UNLIKELY(mHwWorkListDirty)) {
            if (CC_UNLIKELY(mHwWorkListDirty)) {
                // build the h/w work list
                // build the h/w work list
                handleWorkList();
                handleWorkList();
@@ -445,18 +442,18 @@ void SurfaceFlinger::onMessageReceived(int32_t what)
                // pretend we did the post
                // pretend we did the post
                hw.compositionComplete();
                hw.compositionComplete();
            }
            }
            } else {

                hw.compositionComplete();
            }
        } break;
        } break;
    }
    }
}
}


void SurfaceFlinger::postFramebuffer()
void SurfaceFlinger::postFramebuffer()
{
{
    // this should never happen. we do the flip anyways so we don't
    // mSwapRegion can be empty here is some cases, for instance if a hidden
    // risk to cause a deadlock with hwc
    // or fully transparent window is updating.
    ALOGW_IF(mSwapRegion.isEmpty(), "mSwapRegion is empty");
    // in that case, we need to flip anyways to not risk a deadlock with
    // h/w composer.

    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    const nsecs_t now = systemTime();
    const nsecs_t now = systemTime();
    mDebugInSwapBuffers = now;
    mDebugInSwapBuffers = now;