Loading services/surfaceflinger/Scheduler/Scheduler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,11 @@ void Scheduler::unregisterDisplay(PhysicalDisplayId displayId) { std::scoped_lock lock(mDisplayLock); mRefreshRateSelectors.erase(displayId); // Do not allow removing the final display. Code in the scheduler expects // there to be at least one display. (This may be relaxed in the future with // headless virtual display.) LOG_ALWAYS_FATAL_IF(mRefreshRateSelectors.empty(), "Cannot unregister all displays!"); promoteLeaderDisplay(); } Loading services/surfaceflinger/tests/unittests/SchedulerTest.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -301,9 +301,6 @@ TEST_F(SchedulerTest, chooseDisplayModesSingleDisplay) { choice = modeChoices.get(kDisplayId1); ASSERT_TRUE(choice); EXPECT_EQ(choice->get(), DisplayModeChoice({120_Hz, kDisplay1Mode120}, globalSignals)); mScheduler->unregisterDisplay(kDisplayId1); EXPECT_FALSE(mScheduler->hasRefreshRateSelectors()); } TEST_F(SchedulerTest, chooseDisplayModesMultipleDisplays) { Loading services/surfaceflinger/tests/unittests/TestableScheduler.h +0 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,6 @@ public: return mRefreshRateSelectors; } bool hasRefreshRateSelectors() const { return !refreshRateSelectors().empty(); } void registerDisplay(PhysicalDisplayId displayId, RefreshRateSelectorPtr selectorPtr) { ftl::FakeGuard guard(kMainThreadContext); Scheduler::registerDisplay(displayId, std::move(selectorPtr)); Loading Loading
services/surfaceflinger/Scheduler/Scheduler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,11 @@ void Scheduler::unregisterDisplay(PhysicalDisplayId displayId) { std::scoped_lock lock(mDisplayLock); mRefreshRateSelectors.erase(displayId); // Do not allow removing the final display. Code in the scheduler expects // there to be at least one display. (This may be relaxed in the future with // headless virtual display.) LOG_ALWAYS_FATAL_IF(mRefreshRateSelectors.empty(), "Cannot unregister all displays!"); promoteLeaderDisplay(); } Loading
services/surfaceflinger/tests/unittests/SchedulerTest.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -301,9 +301,6 @@ TEST_F(SchedulerTest, chooseDisplayModesSingleDisplay) { choice = modeChoices.get(kDisplayId1); ASSERT_TRUE(choice); EXPECT_EQ(choice->get(), DisplayModeChoice({120_Hz, kDisplay1Mode120}, globalSignals)); mScheduler->unregisterDisplay(kDisplayId1); EXPECT_FALSE(mScheduler->hasRefreshRateSelectors()); } TEST_F(SchedulerTest, chooseDisplayModesMultipleDisplays) { Loading
services/surfaceflinger/tests/unittests/TestableScheduler.h +0 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,6 @@ public: return mRefreshRateSelectors; } bool hasRefreshRateSelectors() const { return !refreshRateSelectors().empty(); } void registerDisplay(PhysicalDisplayId displayId, RefreshRateSelectorPtr selectorPtr) { ftl::FakeGuard guard(kMainThreadContext); Scheduler::registerDisplay(displayId, std::move(selectorPtr)); Loading