diff options
| author | 2019-11-20 01:08:59 +0000 | |
|---|---|---|
| committer | 2019-11-20 01:08:59 +0000 | |
| commit | b2ac44c63e54464d46ec3cc9b3ab2592a3ee0cf5 (patch) | |
| tree | 10ea611952746ab4ce2a1353c893042a5dc84189 | |
| parent | ee69cfb9e24bc0f957f7a5f9e43faf19f6d58554 (diff) | |
| parent | ac12ae73c2a2cc7d4fedcc1e187ff9984679df54 (diff) | |
Merge "Clear all pending transactions on screen wakeup"
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 2 | ||||
| -rw-r--r-- | services/surfaceflinger/TransactionCompletedThread.cpp | 9 | ||||
| -rw-r--r-- | services/surfaceflinger/TransactionCompletedThread.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index b4d748d50e..14a2ab1b3e 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3718,6 +3718,8 @@ void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& display, int if (currentMode == HWC_POWER_MODE_OFF) { // Turn on the display + // TODO: @vhau temp fix only! See b/141111965 + mTransactionCompletedThread.clearAllPending(); getHwComposer().setPowerMode(*displayId, mode); if (display->isPrimary() && mode != HWC_POWER_MODE_DOZE_SUSPEND) { setVsyncEnabledInHWC(*displayId, mHWCVsyncPendingState); diff --git a/services/surfaceflinger/TransactionCompletedThread.cpp b/services/surfaceflinger/TransactionCompletedThread.cpp index 8db03db7e8..c15355d338 100644 --- a/services/surfaceflinger/TransactionCompletedThread.cpp +++ b/services/surfaceflinger/TransactionCompletedThread.cpp @@ -189,6 +189,15 @@ status_t TransactionCompletedThread::finalizePendingCallbackHandles( return NO_ERROR; } +void TransactionCompletedThread::clearAllPending() { + std::lock_guard lock(mMutex); + if (!mRunning) { + return; + } + mPendingTransactions.clear(); + mConditionVariable.notify_all(); +} + status_t TransactionCompletedThread::registerUnpresentedCallbackHandle( const sp<CallbackHandle>& handle) { std::lock_guard lock(mMutex); diff --git a/services/surfaceflinger/TransactionCompletedThread.h b/services/surfaceflinger/TransactionCompletedThread.h index 12ea8fe7d0..cd95bfb040 100644 --- a/services/surfaceflinger/TransactionCompletedThread.h +++ b/services/surfaceflinger/TransactionCompletedThread.h @@ -70,6 +70,8 @@ public: // Notifies the TransactionCompletedThread that a pending CallbackHandle has been presented. 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 // presented this frame. status_t registerUnpresentedCallbackHandle(const sp<CallbackHandle>& handle); |