Loading services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,8 @@ bool PowerAdvisor::ensurePowerHintSessionRunning() { &mSessionConfig); if (ret.isOk()) { mHintSession = ret.value(); if (FlagManager::getInstance().adpf_use_fmq_channel_fixed()) { if (FlagManager::getInstance().adpf_use_fmq_channel_fixed() && FlagManager::getInstance().adpf_fmq_sf()) { setUpFmq(); } } Loading services/surfaceflinger/common/FlagManager.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ void FlagManager::dump(std::string& result) const { DUMP_SERVER_FLAG(adpf_use_fmq_channel); /// Trunk stable readonly flags /// DUMP_READ_ONLY_FLAG(adpf_fmq_sf); DUMP_READ_ONLY_FLAG(connected_display); DUMP_READ_ONLY_FLAG(enable_small_area_detection); DUMP_READ_ONLY_FLAG(frame_rate_category_mrr); Loading Loading @@ -220,6 +221,7 @@ FLAG_MANAGER_LEGACY_SERVER_FLAG(use_skia_tracing, PROPERTY_SKIA_ATRACE_ENABLED, "SkiaTracingFeature__use_skia_tracing") /// Trunk stable readonly flags /// FLAG_MANAGER_READ_ONLY_FLAG(adpf_fmq_sf, "") 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") Loading services/surfaceflinger/common/include/common/FlagManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public: bool adpf_use_fmq_channel_fixed() const; /// Trunk stable readonly flags /// bool adpf_fmq_sf() const; bool connected_display() const; bool frame_rate_category_mrr() const; bool enable_small_area_detection() const; Loading services/surfaceflinger/surfaceflinger_flags_new.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ package: "com.android.graphics.surfaceflinger.flags" container: "system" flag { name: "adpf_fmq_sf" namespace: "game" description: "Guards use of the ADPF FMQ system specifically for SurfaceFlinger" bug: "315894228" is_fixed_read_only: true } # adpf_fmq_sf flag { name: "adpf_gpu_sf" namespace: "game" Loading services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ protected: int64_t mSessionId = 123; SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel, true); SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, false); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, false); }; bool PowerAdvisorTest::sessionExists() { Loading Loading @@ -184,6 +185,7 @@ void PowerAdvisorTest::testGpuScenario(GpuTestConfig& config, WorkDuration& ret) SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_gpu_sf, config.adpfGpuFlagOn); SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, config.usesFmq); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, config.usesFmq); mPowerAdvisor->onBootFinished(); bool expectsFmqSuccess = config.usesSharedFmqFlag && !config.fmqFull; if (config.usesFmq) { Loading Loading @@ -789,6 +791,7 @@ TEST_F(PowerAdvisorTest, fmq_sendTargetAndActualDuration_queueFull) { TEST_F(PowerAdvisorTest, fmq_sendHint) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(true, false); auto startTime = uptimeNanos(); Loading @@ -807,6 +810,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint) { TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(false, false); SessionHint hint; Loading @@ -821,6 +825,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) { TEST_F(PowerAdvisorTest, fmq_sendHint_queueFull) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(true, true); ASSERT_EQ(mBackendFmq->availableToRead(), 2uL); Loading Loading
services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,8 @@ bool PowerAdvisor::ensurePowerHintSessionRunning() { &mSessionConfig); if (ret.isOk()) { mHintSession = ret.value(); if (FlagManager::getInstance().adpf_use_fmq_channel_fixed()) { if (FlagManager::getInstance().adpf_use_fmq_channel_fixed() && FlagManager::getInstance().adpf_fmq_sf()) { setUpFmq(); } } Loading
services/surfaceflinger/common/FlagManager.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ void FlagManager::dump(std::string& result) const { DUMP_SERVER_FLAG(adpf_use_fmq_channel); /// Trunk stable readonly flags /// DUMP_READ_ONLY_FLAG(adpf_fmq_sf); DUMP_READ_ONLY_FLAG(connected_display); DUMP_READ_ONLY_FLAG(enable_small_area_detection); DUMP_READ_ONLY_FLAG(frame_rate_category_mrr); Loading Loading @@ -220,6 +221,7 @@ FLAG_MANAGER_LEGACY_SERVER_FLAG(use_skia_tracing, PROPERTY_SKIA_ATRACE_ENABLED, "SkiaTracingFeature__use_skia_tracing") /// Trunk stable readonly flags /// FLAG_MANAGER_READ_ONLY_FLAG(adpf_fmq_sf, "") 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") Loading
services/surfaceflinger/common/include/common/FlagManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public: bool adpf_use_fmq_channel_fixed() const; /// Trunk stable readonly flags /// bool adpf_fmq_sf() const; bool connected_display() const; bool frame_rate_category_mrr() const; bool enable_small_area_detection() const; Loading
services/surfaceflinger/surfaceflinger_flags_new.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ package: "com.android.graphics.surfaceflinger.flags" container: "system" flag { name: "adpf_fmq_sf" namespace: "game" description: "Guards use of the ADPF FMQ system specifically for SurfaceFlinger" bug: "315894228" is_fixed_read_only: true } # adpf_fmq_sf flag { name: "adpf_gpu_sf" namespace: "game" Loading
services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ protected: int64_t mSessionId = 123; SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel, true); SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, false); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, false); }; bool PowerAdvisorTest::sessionExists() { Loading Loading @@ -184,6 +185,7 @@ void PowerAdvisorTest::testGpuScenario(GpuTestConfig& config, WorkDuration& ret) SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_gpu_sf, config.adpfGpuFlagOn); SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, config.usesFmq); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, config.usesFmq); mPowerAdvisor->onBootFinished(); bool expectsFmqSuccess = config.usesSharedFmqFlag && !config.fmqFull; if (config.usesFmq) { Loading Loading @@ -789,6 +791,7 @@ TEST_F(PowerAdvisorTest, fmq_sendTargetAndActualDuration_queueFull) { TEST_F(PowerAdvisorTest, fmq_sendHint) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(true, false); auto startTime = uptimeNanos(); Loading @@ -807,6 +810,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint) { TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(false, false); SessionHint hint; Loading @@ -821,6 +825,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) { TEST_F(PowerAdvisorTest, fmq_sendHint_queueFull) { SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true); SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true); mPowerAdvisor->onBootFinished(); SetUpFmq(true, true); ASSERT_EQ(mBackendFmq->availableToRead(), 2uL); Loading