Loading services/surfaceflinger/Scheduler/LayerInfo.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -595,6 +595,12 @@ bool LayerInfo::FrameRate::isVoteValidForMrr(bool isVrrDevice) const { return true; } if (FlagManager::getInstance().view_set_requested_frame_rate_mrr() && category == FrameRateCategory::NoPreference && vote.rate.isValid() && vote.type == FrameRateCompatibility::ExactOrMultiple) { return true; } return false; } Loading services/surfaceflinger/common/FlagManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ void FlagManager::dump(std::string& result) const { DUMP_READ_ONLY_FLAG(connected_display); DUMP_READ_ONLY_FLAG(enable_small_area_detection); DUMP_READ_ONLY_FLAG(frame_rate_category_mrr); DUMP_READ_ONLY_FLAG(view_set_requested_frame_rate_mrr); DUMP_READ_ONLY_FLAG(misc1); DUMP_READ_ONLY_FLAG(vrr_config); DUMP_READ_ONLY_FLAG(hotplug2); Loading Loading @@ -222,6 +223,8 @@ FLAG_MANAGER_LEGACY_SERVER_FLAG(use_skia_tracing, PROPERTY_SKIA_ATRACE_ENABLED, FLAG_MANAGER_READ_ONLY_FLAG(connected_display, "") FLAG_MANAGER_READ_ONLY_FLAG(enable_small_area_detection, "") FLAG_MANAGER_READ_ONLY_FLAG(frame_rate_category_mrr, "debug.sf.frame_rate_category_mrr") FLAG_MANAGER_READ_ONLY_FLAG(view_set_requested_frame_rate_mrr, "debug.sf.view_set_requested_frame_rate_mrr") FLAG_MANAGER_READ_ONLY_FLAG(misc1, "") FLAG_MANAGER_READ_ONLY_FLAG(vrr_config, "debug.sf.enable_vrr_config") FLAG_MANAGER_READ_ONLY_FLAG(hotplug2, "") Loading services/surfaceflinger/common/include/common/FlagManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public: /// Trunk stable readonly flags /// bool connected_display() const; bool frame_rate_category_mrr() const; bool view_set_requested_frame_rate_mrr() const; bool enable_small_area_detection() const; bool misc1() const; bool vrr_config() const; Loading services/surfaceflinger/surfaceflinger_flags_new.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,14 @@ flag { } } # override_trusted_overlay flag { name: "view_set_requested_frame_rate_mrr" namespace: "core_graphics" description: "Enable to use frame rate category NoPreference with fixed frame rate vote on MRR devices" bug: "352206100" is_fixed_read_only: true } # view_set_requested_frame_rate_mrr flag { name: "vrr_bugfix_24q4" namespace: "core_graphics" Loading services/surfaceflinger/tests/unittests/LayerHistoryIntegrationTest.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -892,6 +892,50 @@ TEST_F(LayerHistoryIntegrationTest, oneLayerExplicitCategory) { EXPECT_EQ(FrameRateCategory::High, summarizeLayerHistory(time)[0].frameRateCategory); } TEST_F(LayerHistoryIntegrationTest, oneLayerExplicitVoteWithFixedSourceAndNoPreferenceCategory) { SET_FLAG_FOR_TEST(flags::frame_rate_category_mrr, false); SET_FLAG_FOR_TEST(flags::view_set_requested_frame_rate_mrr, true); auto layer = createLegacyAndFrontedEndLayer(1); setFrameRate(1, (45.6_Hz).getValue(), ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE, ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS); setFrameRateCategory(1, ANATIVEWINDOW_FRAME_RATE_CATEGORY_NO_PREFERENCE); EXPECT_EQ(1u, layerCount()); EXPECT_EQ(0u, activeLayerCount()); nsecs_t time = systemTime(); updateLayerSnapshotsAndLayerHistory(time); for (size_t i = 0; i < PRESENT_TIME_HISTORY_SIZE; i++) { setBufferWithPresentTime(layer, time); time += HI_FPS_PERIOD; } // There are 2 LayerRequirement's due to the frame rate category. ASSERT_EQ(2u, summarizeLayerHistory(time).size()); EXPECT_EQ(1u, activeLayerCount()); EXPECT_EQ(1, frequentLayerCount(time)); // First LayerRequirement is the layer's category specification EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitCategory, summarizeLayerHistory(time)[0].vote); EXPECT_EQ(0_Hz, summarizeLayerHistory(time)[0].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::NoPreference, summarizeLayerHistory(time)[0].frameRateCategory); // Second LayerRequirement is the frame rate specification EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitExactOrMultiple, summarizeLayerHistory(time)[1].vote); EXPECT_EQ(45.6_Hz, summarizeLayerHistory(time)[1].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::Default, summarizeLayerHistory(time)[1].frameRateCategory); // layer became infrequent, but the vote stays time += MAX_ACTIVE_LAYER_PERIOD_NS.count(); ASSERT_EQ(2u, summarizeLayerHistory(time).size()); EXPECT_EQ(1u, activeLayerCount()); EXPECT_EQ(0, frequentLayerCount(time)); EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitCategory, summarizeLayerHistory(time)[0].vote); EXPECT_EQ(0_Hz, summarizeLayerHistory(time)[0].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::NoPreference, summarizeLayerHistory(time)[0].frameRateCategory); } TEST_F(LayerHistoryIntegrationTest, multipleLayers) { auto layer1 = createLegacyAndFrontedEndLayer(1); auto layer2 = createLegacyAndFrontedEndLayer(2); Loading Loading
services/surfaceflinger/Scheduler/LayerInfo.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -595,6 +595,12 @@ bool LayerInfo::FrameRate::isVoteValidForMrr(bool isVrrDevice) const { return true; } if (FlagManager::getInstance().view_set_requested_frame_rate_mrr() && category == FrameRateCategory::NoPreference && vote.rate.isValid() && vote.type == FrameRateCompatibility::ExactOrMultiple) { return true; } return false; } Loading
services/surfaceflinger/common/FlagManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ void FlagManager::dump(std::string& result) const { DUMP_READ_ONLY_FLAG(connected_display); DUMP_READ_ONLY_FLAG(enable_small_area_detection); DUMP_READ_ONLY_FLAG(frame_rate_category_mrr); DUMP_READ_ONLY_FLAG(view_set_requested_frame_rate_mrr); DUMP_READ_ONLY_FLAG(misc1); DUMP_READ_ONLY_FLAG(vrr_config); DUMP_READ_ONLY_FLAG(hotplug2); Loading Loading @@ -222,6 +223,8 @@ FLAG_MANAGER_LEGACY_SERVER_FLAG(use_skia_tracing, PROPERTY_SKIA_ATRACE_ENABLED, FLAG_MANAGER_READ_ONLY_FLAG(connected_display, "") FLAG_MANAGER_READ_ONLY_FLAG(enable_small_area_detection, "") FLAG_MANAGER_READ_ONLY_FLAG(frame_rate_category_mrr, "debug.sf.frame_rate_category_mrr") FLAG_MANAGER_READ_ONLY_FLAG(view_set_requested_frame_rate_mrr, "debug.sf.view_set_requested_frame_rate_mrr") FLAG_MANAGER_READ_ONLY_FLAG(misc1, "") FLAG_MANAGER_READ_ONLY_FLAG(vrr_config, "debug.sf.enable_vrr_config") FLAG_MANAGER_READ_ONLY_FLAG(hotplug2, "") Loading
services/surfaceflinger/common/include/common/FlagManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public: /// Trunk stable readonly flags /// bool connected_display() const; bool frame_rate_category_mrr() const; bool view_set_requested_frame_rate_mrr() const; bool enable_small_area_detection() const; bool misc1() const; bool vrr_config() const; Loading
services/surfaceflinger/surfaceflinger_flags_new.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,14 @@ flag { } } # override_trusted_overlay flag { name: "view_set_requested_frame_rate_mrr" namespace: "core_graphics" description: "Enable to use frame rate category NoPreference with fixed frame rate vote on MRR devices" bug: "352206100" is_fixed_read_only: true } # view_set_requested_frame_rate_mrr flag { name: "vrr_bugfix_24q4" namespace: "core_graphics" Loading
services/surfaceflinger/tests/unittests/LayerHistoryIntegrationTest.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -892,6 +892,50 @@ TEST_F(LayerHistoryIntegrationTest, oneLayerExplicitCategory) { EXPECT_EQ(FrameRateCategory::High, summarizeLayerHistory(time)[0].frameRateCategory); } TEST_F(LayerHistoryIntegrationTest, oneLayerExplicitVoteWithFixedSourceAndNoPreferenceCategory) { SET_FLAG_FOR_TEST(flags::frame_rate_category_mrr, false); SET_FLAG_FOR_TEST(flags::view_set_requested_frame_rate_mrr, true); auto layer = createLegacyAndFrontedEndLayer(1); setFrameRate(1, (45.6_Hz).getValue(), ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE, ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS); setFrameRateCategory(1, ANATIVEWINDOW_FRAME_RATE_CATEGORY_NO_PREFERENCE); EXPECT_EQ(1u, layerCount()); EXPECT_EQ(0u, activeLayerCount()); nsecs_t time = systemTime(); updateLayerSnapshotsAndLayerHistory(time); for (size_t i = 0; i < PRESENT_TIME_HISTORY_SIZE; i++) { setBufferWithPresentTime(layer, time); time += HI_FPS_PERIOD; } // There are 2 LayerRequirement's due to the frame rate category. ASSERT_EQ(2u, summarizeLayerHistory(time).size()); EXPECT_EQ(1u, activeLayerCount()); EXPECT_EQ(1, frequentLayerCount(time)); // First LayerRequirement is the layer's category specification EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitCategory, summarizeLayerHistory(time)[0].vote); EXPECT_EQ(0_Hz, summarizeLayerHistory(time)[0].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::NoPreference, summarizeLayerHistory(time)[0].frameRateCategory); // Second LayerRequirement is the frame rate specification EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitExactOrMultiple, summarizeLayerHistory(time)[1].vote); EXPECT_EQ(45.6_Hz, summarizeLayerHistory(time)[1].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::Default, summarizeLayerHistory(time)[1].frameRateCategory); // layer became infrequent, but the vote stays time += MAX_ACTIVE_LAYER_PERIOD_NS.count(); ASSERT_EQ(2u, summarizeLayerHistory(time).size()); EXPECT_EQ(1u, activeLayerCount()); EXPECT_EQ(0, frequentLayerCount(time)); EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitCategory, summarizeLayerHistory(time)[0].vote); EXPECT_EQ(0_Hz, summarizeLayerHistory(time)[0].desiredRefreshRate); EXPECT_EQ(FrameRateCategory::NoPreference, summarizeLayerHistory(time)[0].frameRateCategory); } TEST_F(LayerHistoryIntegrationTest, multipleLayers) { auto layer1 = createLegacyAndFrontedEndLayer(1); auto layer2 = createLegacyAndFrontedEndLayer(2); Loading