Loading services/surfaceflinger/Scheduler/EventThread.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -335,6 +335,11 @@ void EventThread::onConfigChanged(PhysicalDisplayId displayId, HwcConfigIndexTyp mCondition.notify_all(); } size_t EventThread::getEventThreadConnectionCount() { std::lock_guard<std::mutex> lock(mMutex); return mDisplayEventConnections.size(); } void EventThread::threadMain(std::unique_lock<std::mutex>& lock) { DisplayEventConsumers consumers; Loading services/surfaceflinger/Scheduler/EventThread.h +10 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,12 @@ #pragma once #include <android-base/thread_annotations.h> #include <gui/DisplayEventReceiver.h> #include <gui/IDisplayEventConnection.h> #include <private/gui/BitTube.h> #include <sys/types.h> #include <utils/Errors.h> #include <condition_variable> #include <cstdint> Loading @@ -26,13 +31,6 @@ #include <thread> #include <vector> #include <android-base/thread_annotations.h> #include <gui/DisplayEventReceiver.h> #include <gui/IDisplayEventConnection.h> #include <private/gui/BitTube.h> #include <utils/Errors.h> #include "HwcStrongTypes.h" // --------------------------------------------------------------------------- Loading Loading @@ -134,6 +132,9 @@ public: // Usage of this method assumes that only the primary internal display // supports multiple display configurations. virtual void requestLatestConfig() = 0; // Retrieves the number of event connections tracked by this EventThread. virtual size_t getEventThreadConnectionCount() = 0; }; namespace impl { Loading Loading @@ -168,6 +169,8 @@ public: void setPhaseOffset(nsecs_t phaseOffset) override; size_t getEventThreadConnectionCount() override; private: friend EventThreadTest; Loading services/surfaceflinger/Scheduler/Scheduler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,11 @@ void Scheduler::onConfigChanged(ConnectionHandle handle, PhysicalDisplayId displ mConnections[handle].thread->onConfigChanged(displayId, configId, vsyncPeriod); } size_t Scheduler::getEventThreadConnectionCount(ConnectionHandle handle) { RETURN_IF_INVALID_HANDLE(handle, 0); return mConnections[handle].thread->getEventThreadConnectionCount(); } void Scheduler::dump(ConnectionHandle handle, std::string& result) const { RETURN_IF_INVALID_HANDLE(handle); mConnections.at(handle).thread->dump(result); Loading services/surfaceflinger/Scheduler/Scheduler.h +2 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,8 @@ public: // Notifies the scheduler when the display size has changed. Called from SF's main thread void onPrimaryDisplayAreaChanged(uint32_t displayArea); size_t getEventThreadConnectionCount(ConnectionHandle handle); private: friend class TestableScheduler; Loading services/surfaceflinger/SurfaceFlinger.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -2119,6 +2119,10 @@ void SurfaceFlinger::postComposition() mTimeStats->setPresentFenceGlobal(presentFenceTime); const size_t sfConnections = mScheduler->getEventThreadConnectionCount(mSfConnectionHandle); const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); if (displayDevice && getHwComposer().isConnected(*displayDevice->getId()) && !displayDevice->isPoweredOn()) { return; Loading Loading
services/surfaceflinger/Scheduler/EventThread.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -335,6 +335,11 @@ void EventThread::onConfigChanged(PhysicalDisplayId displayId, HwcConfigIndexTyp mCondition.notify_all(); } size_t EventThread::getEventThreadConnectionCount() { std::lock_guard<std::mutex> lock(mMutex); return mDisplayEventConnections.size(); } void EventThread::threadMain(std::unique_lock<std::mutex>& lock) { DisplayEventConsumers consumers; Loading
services/surfaceflinger/Scheduler/EventThread.h +10 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,12 @@ #pragma once #include <android-base/thread_annotations.h> #include <gui/DisplayEventReceiver.h> #include <gui/IDisplayEventConnection.h> #include <private/gui/BitTube.h> #include <sys/types.h> #include <utils/Errors.h> #include <condition_variable> #include <cstdint> Loading @@ -26,13 +31,6 @@ #include <thread> #include <vector> #include <android-base/thread_annotations.h> #include <gui/DisplayEventReceiver.h> #include <gui/IDisplayEventConnection.h> #include <private/gui/BitTube.h> #include <utils/Errors.h> #include "HwcStrongTypes.h" // --------------------------------------------------------------------------- Loading Loading @@ -134,6 +132,9 @@ public: // Usage of this method assumes that only the primary internal display // supports multiple display configurations. virtual void requestLatestConfig() = 0; // Retrieves the number of event connections tracked by this EventThread. virtual size_t getEventThreadConnectionCount() = 0; }; namespace impl { Loading Loading @@ -168,6 +169,8 @@ public: void setPhaseOffset(nsecs_t phaseOffset) override; size_t getEventThreadConnectionCount() override; private: friend EventThreadTest; Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,11 @@ void Scheduler::onConfigChanged(ConnectionHandle handle, PhysicalDisplayId displ mConnections[handle].thread->onConfigChanged(displayId, configId, vsyncPeriod); } size_t Scheduler::getEventThreadConnectionCount(ConnectionHandle handle) { RETURN_IF_INVALID_HANDLE(handle, 0); return mConnections[handle].thread->getEventThreadConnectionCount(); } void Scheduler::dump(ConnectionHandle handle, std::string& result) const { RETURN_IF_INVALID_HANDLE(handle); mConnections.at(handle).thread->dump(result); Loading
services/surfaceflinger/Scheduler/Scheduler.h +2 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,8 @@ public: // Notifies the scheduler when the display size has changed. Called from SF's main thread void onPrimaryDisplayAreaChanged(uint32_t displayArea); size_t getEventThreadConnectionCount(ConnectionHandle handle); private: friend class TestableScheduler; Loading
services/surfaceflinger/SurfaceFlinger.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -2119,6 +2119,10 @@ void SurfaceFlinger::postComposition() mTimeStats->setPresentFenceGlobal(presentFenceTime); const size_t sfConnections = mScheduler->getEventThreadConnectionCount(mSfConnectionHandle); const size_t appConnections = mScheduler->getEventThreadConnectionCount(mAppConnectionHandle); mTimeStats->recordDisplayEventConnectionCount(sfConnections + appConnections); if (displayDevice && getHwComposer().isConnected(*displayDevice->getId()) && !displayDevice->isPoweredOn()) { return; Loading