Loading services/surfaceflinger/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ filegroup { "SurfaceFlingerDefaultFactory.cpp", "SurfaceInterceptor.cpp", "SurfaceTracing.cpp", "TransactionCompletedThread.cpp", "TransactionCallbackInvoker.cpp", ], } Loading services/surfaceflinger/BufferStateLayer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ void BufferStateLayer::releasePendingBuffer(nsecs_t dequeueReadyTime) { JankData(surfaceFrame->getToken(), surfaceFrame->getJankType().value())); } mFlinger->getTransactionCompletedThread().finalizePendingCallbackHandles( mFlinger->getTransactionCallbackInvoker().finalizePendingCallbackHandles( mDrawingState.callbackHandles, jankData); mDrawingState.callbackHandles = {}; Loading Loading @@ -455,14 +455,14 @@ bool BufferStateLayer::setTransactionCompletedListeners( // Notify the transaction completed thread that there is a pending latched callback // handle mFlinger->getTransactionCompletedThread().registerPendingCallbackHandle(handle); mFlinger->getTransactionCallbackInvoker().registerPendingCallbackHandle(handle); // Store so latched time and release fence can be set mCurrentState.callbackHandles.push_back(handle); } else { // If this layer will NOT need to be relatched and presented this frame // Notify the transaction completed thread this handle is done mFlinger->getTransactionCompletedThread().registerUnpresentedCallbackHandle(handle); mFlinger->getTransactionCallbackInvoker().registerUnpresentedCallbackHandle(handle); } } Loading services/surfaceflinger/Layer.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ #include "Scheduler/Seamlessness.h" #include "SurfaceFlinger.h" #include "SurfaceTracing.h" #include "TransactionCompletedThread.h" #include "TransactionCallbackInvoker.h" using namespace android::surfaceflinger; Loading services/surfaceflinger/SurfaceFlinger.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -2195,8 +2195,8 @@ void SurfaceFlinger::postComposition() { } }); mTransactionCompletedThread.addPresentFence(mPreviousPresentFences[0]); mTransactionCompletedThread.sendCallbacks(); mTransactionCallbackInvoker.addPresentFence(mPreviousPresentFences[0]); mTransactionCallbackInvoker.sendCallbacks(); if (display && display->isPrimary() && display->getPowerMode() == hal::PowerMode::ON && presentFenceTime->isValid()) { Loading Loading @@ -3555,8 +3555,8 @@ void SurfaceFlinger::applyTransactionState(const FrameTimelineInfo& frameTimelin // that listeners with SurfaceControls will start registration during setClientStateLocked // below. for (const auto& listener : listenerCallbacks) { mTransactionCompletedThread.startRegistration(listener); mTransactionCompletedThread.endRegistration(listener); mTransactionCallbackInvoker.startRegistration(listener); mTransactionCallbackInvoker.endRegistration(listener); } std::unordered_set<ListenerCallbacks, ListenerCallbacksHash> listenerCallbacksWithSurfaces; Loading @@ -3575,12 +3575,12 @@ void SurfaceFlinger::applyTransactionState(const FrameTimelineInfo& frameTimelin } for (const auto& listenerCallback : listenerCallbacksWithSurfaces) { mTransactionCompletedThread.endRegistration(listenerCallback); mTransactionCallbackInvoker.endRegistration(listenerCallback); } // If the state doesn't require a traversal and there are callbacks, send them now if (!(clientStateFlags & eTraversalNeeded) && hasListenerCallbacks) { mTransactionCompletedThread.sendCallbacks(); mTransactionCallbackInvoker.sendCallbacks(); } transactionFlags |= clientStateFlags; Loading Loading @@ -3695,7 +3695,7 @@ uint32_t SurfaceFlinger::setClientStateLocked( for (auto& listener : s.listeners) { // note that startRegistration will not re-register if the listener has // already be registered for a prior surface control mTransactionCompletedThread.startRegistration(listener); mTransactionCallbackInvoker.startRegistration(listener); listenerCallbacks.insert(listener); } Loading @@ -3708,7 +3708,7 @@ uint32_t SurfaceFlinger::setClientStateLocked( } if (layer == nullptr) { for (auto& [listener, callbackIds] : s.listeners) { mTransactionCompletedThread.registerUnpresentedCallbackHandle( mTransactionCallbackInvoker.registerUnpresentedCallbackHandle( new CallbackHandle(listener, callbackIds, s.surface)); } return 0; Loading services/surfaceflinger/SurfaceFlinger.h +4 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ #include "SurfaceFlingerFactory.h" #include "SurfaceTracing.h" #include "TracedOrdinal.h" #include "TransactionCompletedThread.h" #include "TransactionCallbackInvoker.h" #include <atomic> #include <cstdint> Loading Loading @@ -319,8 +319,8 @@ public: void removeFromOffscreenLayers(Layer* layer); TransactionCompletedThread& getTransactionCompletedThread() { return mTransactionCompletedThread; TransactionCallbackInvoker& getTransactionCallbackInvoker() { return mTransactionCallbackInvoker; } // Converts from a binder handle to a Layer Loading Loading @@ -1161,7 +1161,7 @@ private: std::atomic<uint32_t> mHwcFrameMissedCount = 0; std::atomic<uint32_t> mGpuFrameMissedCount = 0; TransactionCompletedThread mTransactionCompletedThread; TransactionCallbackInvoker mTransactionCallbackInvoker; // Restrict layers to use two buffers in their bufferqueues. bool mLayerTripleBufferingDisabled = false; Loading Loading
services/surfaceflinger/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ filegroup { "SurfaceFlingerDefaultFactory.cpp", "SurfaceInterceptor.cpp", "SurfaceTracing.cpp", "TransactionCompletedThread.cpp", "TransactionCallbackInvoker.cpp", ], } Loading
services/surfaceflinger/BufferStateLayer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ void BufferStateLayer::releasePendingBuffer(nsecs_t dequeueReadyTime) { JankData(surfaceFrame->getToken(), surfaceFrame->getJankType().value())); } mFlinger->getTransactionCompletedThread().finalizePendingCallbackHandles( mFlinger->getTransactionCallbackInvoker().finalizePendingCallbackHandles( mDrawingState.callbackHandles, jankData); mDrawingState.callbackHandles = {}; Loading Loading @@ -455,14 +455,14 @@ bool BufferStateLayer::setTransactionCompletedListeners( // Notify the transaction completed thread that there is a pending latched callback // handle mFlinger->getTransactionCompletedThread().registerPendingCallbackHandle(handle); mFlinger->getTransactionCallbackInvoker().registerPendingCallbackHandle(handle); // Store so latched time and release fence can be set mCurrentState.callbackHandles.push_back(handle); } else { // If this layer will NOT need to be relatched and presented this frame // Notify the transaction completed thread this handle is done mFlinger->getTransactionCompletedThread().registerUnpresentedCallbackHandle(handle); mFlinger->getTransactionCallbackInvoker().registerUnpresentedCallbackHandle(handle); } } Loading
services/surfaceflinger/Layer.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ #include "Scheduler/Seamlessness.h" #include "SurfaceFlinger.h" #include "SurfaceTracing.h" #include "TransactionCompletedThread.h" #include "TransactionCallbackInvoker.h" using namespace android::surfaceflinger; Loading
services/surfaceflinger/SurfaceFlinger.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -2195,8 +2195,8 @@ void SurfaceFlinger::postComposition() { } }); mTransactionCompletedThread.addPresentFence(mPreviousPresentFences[0]); mTransactionCompletedThread.sendCallbacks(); mTransactionCallbackInvoker.addPresentFence(mPreviousPresentFences[0]); mTransactionCallbackInvoker.sendCallbacks(); if (display && display->isPrimary() && display->getPowerMode() == hal::PowerMode::ON && presentFenceTime->isValid()) { Loading Loading @@ -3555,8 +3555,8 @@ void SurfaceFlinger::applyTransactionState(const FrameTimelineInfo& frameTimelin // that listeners with SurfaceControls will start registration during setClientStateLocked // below. for (const auto& listener : listenerCallbacks) { mTransactionCompletedThread.startRegistration(listener); mTransactionCompletedThread.endRegistration(listener); mTransactionCallbackInvoker.startRegistration(listener); mTransactionCallbackInvoker.endRegistration(listener); } std::unordered_set<ListenerCallbacks, ListenerCallbacksHash> listenerCallbacksWithSurfaces; Loading @@ -3575,12 +3575,12 @@ void SurfaceFlinger::applyTransactionState(const FrameTimelineInfo& frameTimelin } for (const auto& listenerCallback : listenerCallbacksWithSurfaces) { mTransactionCompletedThread.endRegistration(listenerCallback); mTransactionCallbackInvoker.endRegistration(listenerCallback); } // If the state doesn't require a traversal and there are callbacks, send them now if (!(clientStateFlags & eTraversalNeeded) && hasListenerCallbacks) { mTransactionCompletedThread.sendCallbacks(); mTransactionCallbackInvoker.sendCallbacks(); } transactionFlags |= clientStateFlags; Loading Loading @@ -3695,7 +3695,7 @@ uint32_t SurfaceFlinger::setClientStateLocked( for (auto& listener : s.listeners) { // note that startRegistration will not re-register if the listener has // already be registered for a prior surface control mTransactionCompletedThread.startRegistration(listener); mTransactionCallbackInvoker.startRegistration(listener); listenerCallbacks.insert(listener); } Loading @@ -3708,7 +3708,7 @@ uint32_t SurfaceFlinger::setClientStateLocked( } if (layer == nullptr) { for (auto& [listener, callbackIds] : s.listeners) { mTransactionCompletedThread.registerUnpresentedCallbackHandle( mTransactionCallbackInvoker.registerUnpresentedCallbackHandle( new CallbackHandle(listener, callbackIds, s.surface)); } return 0; Loading
services/surfaceflinger/SurfaceFlinger.h +4 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ #include "SurfaceFlingerFactory.h" #include "SurfaceTracing.h" #include "TracedOrdinal.h" #include "TransactionCompletedThread.h" #include "TransactionCallbackInvoker.h" #include <atomic> #include <cstdint> Loading Loading @@ -319,8 +319,8 @@ public: void removeFromOffscreenLayers(Layer* layer); TransactionCompletedThread& getTransactionCompletedThread() { return mTransactionCompletedThread; TransactionCallbackInvoker& getTransactionCallbackInvoker() { return mTransactionCallbackInvoker; } // Converts from a binder handle to a Layer Loading Loading @@ -1161,7 +1161,7 @@ private: std::atomic<uint32_t> mHwcFrameMissedCount = 0; std::atomic<uint32_t> mGpuFrameMissedCount = 0; TransactionCompletedThread mTransactionCompletedThread; TransactionCallbackInvoker mTransactionCallbackInvoker; // Restrict layers to use two buffers in their bufferqueues. bool mLayerTripleBufferingDisabled = false; Loading