diff options
5 files changed, 18 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp index 334c104faf..c914ec3066 100644 --- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp +++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp @@ -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(); } } diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp index a331491be6..8a81c56bc8 100644 --- a/services/surfaceflinger/common/FlagManager.cpp +++ b/services/surfaceflinger/common/FlagManager.cpp @@ -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); @@ -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") diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h index daaf33870d..b097bf9bc9 100644 --- a/services/surfaceflinger/common/include/common/FlagManager.h +++ b/services/surfaceflinger/common/include/common/FlagManager.h @@ -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; diff --git a/services/surfaceflinger/surfaceflinger_flags_new.aconfig b/services/surfaceflinger/surfaceflinger_flags_new.aconfig index e40be515aa..d724dfce5b 100644 --- a/services/surfaceflinger/surfaceflinger_flags_new.aconfig +++ b/services/surfaceflinger/surfaceflinger_flags_new.aconfig @@ -4,6 +4,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" description: "Guards use of the sending ADPF GPU duration hint and load hints from SurfaceFlinger to Power HAL" diff --git a/services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp b/services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp index c879280e57..8375bb9a56 100644 --- a/services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp +++ b/services/surfaceflinger/tests/unittests/PowerAdvisorTest.cpp @@ -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() { @@ -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) { @@ -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(); @@ -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; @@ -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); |