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

Commit b2ac44c6 authored by Valerie Hau's avatar Valerie Hau Committed by Android (Google) Code Review
Browse files

Merge "Clear all pending transactions on screen wakeup"

parents ee69cfb9 ac12ae73
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -3718,6 +3718,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, int


    if (currentMode == HWC_POWER_MODE_OFF) {
    if (currentMode == HWC_POWER_MODE_OFF) {
        // Turn on the display
        // Turn on the display
        // TODO: @vhau temp fix only!  See b/141111965
        mTransactionCompletedThread.clearAllPending();
        getHwComposer().setPowerMode(*displayId, mode);
        getHwComposer().setPowerMode(*displayId, mode);
        if (display->isPrimary() && mode != HWC_POWER_MODE_DOZE_SUSPEND) {
        if (display->isPrimary() && mode != HWC_POWER_MODE_DOZE_SUSPEND) {
            setVsyncEnabledInHWC(*displayId, mHWCVsyncPendingState);
            setVsyncEnabledInHWC(*displayId, mHWCVsyncPendingState);
+9 −0
Original line number Original line Diff line number Diff line
@@ -189,6 +189,15 @@ status_t TransactionCompletedThread::finalizePendingCallbackHandles(
    return NO_ERROR;
    return NO_ERROR;
}
}


void TransactionCompletedThread::clearAllPending() {
    std::lock_guard lock(mMutex);
    if (!mRunning) {
        return;
    }
    mPendingTransactions.clear();
    mConditionVariable.notify_all();
}

status_t TransactionCompletedThread::registerUnpresentedCallbackHandle(
status_t TransactionCompletedThread::registerUnpresentedCallbackHandle(
        const sp<CallbackHandle>& handle) {
        const sp<CallbackHandle>& handle) {
    std::lock_guard lock(mMutex);
    std::lock_guard lock(mMutex);
+2 −0
Original line number Original line Diff line number Diff line
@@ -70,6 +70,8 @@ public:
    // Notifies the TransactionCompletedThread that a pending CallbackHandle has been presented.
    // Notifies the TransactionCompletedThread that a pending CallbackHandle has been presented.
    status_t finalizePendingCallbackHandles(const std::deque<sp<CallbackHandle>>& handles);
    status_t finalizePendingCallbackHandles(const std::deque<sp<CallbackHandle>>& handles);


    void clearAllPending();

    // Adds the Transaction CallbackHandle from a layer that does not need to be relatched and
    // Adds the Transaction CallbackHandle from a layer that does not need to be relatched and
    // presented this frame.
    // presented this frame.
    status_t registerUnpresentedCallbackHandle(const sp<CallbackHandle>& handle);
    status_t registerUnpresentedCallbackHandle(const sp<CallbackHandle>& handle);