Loading services/surfaceflinger/Layer.cpp +3 −4 Original line number Original line Diff line number Diff line Loading @@ -866,13 +866,12 @@ bool Layer::applyPendingStates(State* stateToCommit) { } } // If we still have pending updates, we need to ensure SurfaceFlinger // If we still have pending updates, we need to ensure SurfaceFlinger // will keep calling doTransaction, and so we set the transaction flags. // will keep calling doTransaction, and so we force a traversal. // However, our pending states won't clear until a frame is available, // However, our pending states won't clear until a frame is available, // and so there is no need to specifically trigger a wakeup. Rather // and so there is no need to specifically trigger a wakeup. // we set the flags and wait for something else to wake us up. if (!mPendingStates.empty()) { if (!mPendingStates.empty()) { setTransactionFlags(eTransactionNeeded); setTransactionFlags(eTransactionNeeded); mFlinger->setTransactionFlagsNoWake(eTraversalNeeded); mFlinger->setTraversalNeeded(); } } mCurrentState.modified = false; mCurrentState.modified = false; Loading services/surfaceflinger/SurfaceFlinger.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2765,7 +2765,8 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) * (perform the transaction for each of them if needed) * (perform the transaction for each of them if needed) */ */ if ((transactionFlags & eTraversalNeeded) || mTraversalNeededMainThread) { if ((transactionFlags & eTraversalNeeded) || mForceTraversal) { mForceTraversal = false; mCurrentState.traverse([&](Layer* layer) { mCurrentState.traverse([&](Layer* layer) { uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); if (!trFlags) return; if (!trFlags) return; Loading @@ -2778,7 +2779,6 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) mInputInfoChanged = true; mInputInfoChanged = true; } } }); }); mTraversalNeededMainThread = false; } } /* /* Loading Loading @@ -3249,8 +3249,8 @@ uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags, return old; return old; } } uint32_t SurfaceFlinger::setTransactionFlagsNoWake(uint32_t flags) { void SurfaceFlinger::setTraversalNeeded() { return mTransactionFlags.fetch_or(flags); mForceTraversal = true; } } bool SurfaceFlinger::flushTransactionQueues() { bool SurfaceFlinger::flushTransactionQueues() { Loading Loading @@ -3450,7 +3450,7 @@ void SurfaceFlinger::applyTransactionState( // so we don't have to wake up again next frame to preform an uneeded traversal. // so we don't have to wake up again next frame to preform an uneeded traversal. if (isMainThread && (transactionFlags & eTraversalNeeded)) { if (isMainThread && (transactionFlags & eTraversalNeeded)) { transactionFlags = transactionFlags & (~eTraversalNeeded); transactionFlags = transactionFlags & (~eTraversalNeeded); mTraversalNeededMainThread = true; mForceTraversal = true; } } if (transactionFlags) { if (transactionFlags) { Loading services/surfaceflinger/SurfaceFlinger.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -627,12 +627,12 @@ private: uint32_t peekTransactionFlags(); uint32_t peekTransactionFlags(); // Can only be called from the main thread or with mStateLock held // Can only be called from the main thread or with mStateLock held uint32_t setTransactionFlags(uint32_t flags); uint32_t setTransactionFlags(uint32_t flags); // Set the transaction flags, but don't trigger a wakeup! We use this cases where // Indicate SF should call doTraversal on layers, but don't trigger a wakeup! We use this cases // there are still pending transactions but we know they won't be ready until a frame // where there are still pending transactions but we know they won't be ready until a frame // arrives from a different layer. So we need to ensure we performTransaction from invalidate // arrives from a different layer. So we need to ensure we performTransaction from invalidate // but there is no need to try and wake up immediately to do it. Rather we rely on // but there is no need to try and wake up immediately to do it. Rather we rely on // onFrameAvailable to wake us up. // onFrameAvailable or another layer update to wake us up. uint32_t setTransactionFlagsNoWake(uint32_t flags); void setTraversalNeeded(); uint32_t setTransactionFlags(uint32_t flags, Scheduler::TransactionStart transactionStart); uint32_t setTransactionFlags(uint32_t flags, Scheduler::TransactionStart transactionStart); void commitTransaction() REQUIRES(mStateLock); void commitTransaction() REQUIRES(mStateLock); void commitOffscreenLayers(); void commitOffscreenLayers(); Loading Loading @@ -1000,7 +1000,7 @@ private: bool mTransactionPending = false; bool mTransactionPending = false; bool mAnimTransactionPending = false; bool mAnimTransactionPending = false; SortedVector<sp<Layer>> mLayersPendingRemoval; SortedVector<sp<Layer>> mLayersPendingRemoval; bool mTraversalNeededMainThread = false; bool mForceTraversal = false; // global color transform states // global color transform states Daltonizer mDaltonizer; Daltonizer mDaltonizer; Loading Loading
services/surfaceflinger/Layer.cpp +3 −4 Original line number Original line Diff line number Diff line Loading @@ -866,13 +866,12 @@ bool Layer::applyPendingStates(State* stateToCommit) { } } // If we still have pending updates, we need to ensure SurfaceFlinger // If we still have pending updates, we need to ensure SurfaceFlinger // will keep calling doTransaction, and so we set the transaction flags. // will keep calling doTransaction, and so we force a traversal. // However, our pending states won't clear until a frame is available, // However, our pending states won't clear until a frame is available, // and so there is no need to specifically trigger a wakeup. Rather // and so there is no need to specifically trigger a wakeup. // we set the flags and wait for something else to wake us up. if (!mPendingStates.empty()) { if (!mPendingStates.empty()) { setTransactionFlags(eTransactionNeeded); setTransactionFlags(eTransactionNeeded); mFlinger->setTransactionFlagsNoWake(eTraversalNeeded); mFlinger->setTraversalNeeded(); } } mCurrentState.modified = false; mCurrentState.modified = false; Loading
services/surfaceflinger/SurfaceFlinger.cpp +5 −5 Original line number Original line Diff line number Diff line Loading @@ -2765,7 +2765,8 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) * (perform the transaction for each of them if needed) * (perform the transaction for each of them if needed) */ */ if ((transactionFlags & eTraversalNeeded) || mTraversalNeededMainThread) { if ((transactionFlags & eTraversalNeeded) || mForceTraversal) { mForceTraversal = false; mCurrentState.traverse([&](Layer* layer) { mCurrentState.traverse([&](Layer* layer) { uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); if (!trFlags) return; if (!trFlags) return; Loading @@ -2778,7 +2779,6 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) mInputInfoChanged = true; mInputInfoChanged = true; } } }); }); mTraversalNeededMainThread = false; } } /* /* Loading Loading @@ -3249,8 +3249,8 @@ uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags, return old; return old; } } uint32_t SurfaceFlinger::setTransactionFlagsNoWake(uint32_t flags) { void SurfaceFlinger::setTraversalNeeded() { return mTransactionFlags.fetch_or(flags); mForceTraversal = true; } } bool SurfaceFlinger::flushTransactionQueues() { bool SurfaceFlinger::flushTransactionQueues() { Loading Loading @@ -3450,7 +3450,7 @@ void SurfaceFlinger::applyTransactionState( // so we don't have to wake up again next frame to preform an uneeded traversal. // so we don't have to wake up again next frame to preform an uneeded traversal. if (isMainThread && (transactionFlags & eTraversalNeeded)) { if (isMainThread && (transactionFlags & eTraversalNeeded)) { transactionFlags = transactionFlags & (~eTraversalNeeded); transactionFlags = transactionFlags & (~eTraversalNeeded); mTraversalNeededMainThread = true; mForceTraversal = true; } } if (transactionFlags) { if (transactionFlags) { Loading
services/surfaceflinger/SurfaceFlinger.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -627,12 +627,12 @@ private: uint32_t peekTransactionFlags(); uint32_t peekTransactionFlags(); // Can only be called from the main thread or with mStateLock held // Can only be called from the main thread or with mStateLock held uint32_t setTransactionFlags(uint32_t flags); uint32_t setTransactionFlags(uint32_t flags); // Set the transaction flags, but don't trigger a wakeup! We use this cases where // Indicate SF should call doTraversal on layers, but don't trigger a wakeup! We use this cases // there are still pending transactions but we know they won't be ready until a frame // where there are still pending transactions but we know they won't be ready until a frame // arrives from a different layer. So we need to ensure we performTransaction from invalidate // arrives from a different layer. So we need to ensure we performTransaction from invalidate // but there is no need to try and wake up immediately to do it. Rather we rely on // but there is no need to try and wake up immediately to do it. Rather we rely on // onFrameAvailable to wake us up. // onFrameAvailable or another layer update to wake us up. uint32_t setTransactionFlagsNoWake(uint32_t flags); void setTraversalNeeded(); uint32_t setTransactionFlags(uint32_t flags, Scheduler::TransactionStart transactionStart); uint32_t setTransactionFlags(uint32_t flags, Scheduler::TransactionStart transactionStart); void commitTransaction() REQUIRES(mStateLock); void commitTransaction() REQUIRES(mStateLock); void commitOffscreenLayers(); void commitOffscreenLayers(); Loading Loading @@ -1000,7 +1000,7 @@ private: bool mTransactionPending = false; bool mTransactionPending = false; bool mAnimTransactionPending = false; bool mAnimTransactionPending = false; SortedVector<sp<Layer>> mLayersPendingRemoval; SortedVector<sp<Layer>> mLayersPendingRemoval; bool mTraversalNeededMainThread = false; bool mForceTraversal = false; // global color transform states // global color transform states Daltonizer mDaltonizer; Daltonizer mDaltonizer; Loading