diff options
author | 2023-09-26 16:21:39 -0700 | |
---|---|---|
committer | 2023-11-07 10:23:44 -0800 | |
commit | de329f211707741e7d579fd7f0d3eebf72e8bf6b (patch) | |
tree | 5387298b8347ded8a23eeba023556b8bd3980232 | |
parent | adcd90a317489b3bc26845774a8ef7be9613a429 (diff) |
Enable refreshrate indicator on external display.
- Add flag for it as well.
Bug: 301647974
Test: play with external monitor; adb shell device_config put
core_graphics
com.android.graphics.surfaceflinger.flags.refresh_rate_overlay_on_external_display
true
Change-Id: I530a7a74b2ec7be1c1a35a1310c87e073764c77a
-rw-r--r-- | services/surfaceflinger/FlagManager.cpp | 2 | ||||
-rw-r--r-- | services/surfaceflinger/FlagManager.h | 1 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 3 | ||||
-rw-r--r-- | services/surfaceflinger/surfaceflinger_flags.aconfig | 6 |
4 files changed, 11 insertions, 1 deletions
diff --git a/services/surfaceflinger/FlagManager.cpp b/services/surfaceflinger/FlagManager.cpp index 6d0dbc7978..13b8a6c0cf 100644 --- a/services/surfaceflinger/FlagManager.cpp +++ b/services/surfaceflinger/FlagManager.cpp @@ -110,6 +110,7 @@ void FlagManager::dump(std::string& result) const { /// Trunk stable server flags /// DUMP_SERVER_FLAG(late_boot_misc2); DUMP_SERVER_FLAG(dont_skip_on_early); + DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display); /// Trunk stable readonly flags /// DUMP_READ_ONLY_FLAG(connected_display); @@ -190,6 +191,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(multithreaded_present, "debug.sf.multithreaded_prese /// Trunk stable server flags /// FLAG_MANAGER_SERVER_FLAG(late_boot_misc2, "") +FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "") /// Exceptions /// bool FlagManager::dont_skip_on_early() const { diff --git a/services/surfaceflinger/FlagManager.h b/services/surfaceflinger/FlagManager.h index cefce9bcda..e3e4f80905 100644 --- a/services/surfaceflinger/FlagManager.h +++ b/services/surfaceflinger/FlagManager.h @@ -49,6 +49,7 @@ public: /// Trunk stable server flags /// bool late_boot_misc2() const; bool dont_skip_on_early() const; + bool refresh_rate_overlay_on_external_display() const; /// Trunk stable readonly flags /// bool connected_display() const; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 4d02b44201..4808075a02 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -8413,7 +8413,8 @@ status_t SurfaceFlinger::setSmallAreaDetectionThreshold(int32_t appId, float thr void SurfaceFlinger::enableRefreshRateOverlay(bool enable) { bool setByHwc = getHwComposer().hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG); for (const auto& [id, display] : mPhysicalDisplays) { - if (display.snapshot().connectionType() == ui::DisplayConnectionType::Internal) { + if (display.snapshot().connectionType() == ui::DisplayConnectionType::Internal || + FlagManager::getInstance().refresh_rate_overlay_on_external_display()) { if (const auto device = getDisplayDeviceLocked(id)) { const auto enableOverlay = [&](const bool setByHwc) FTL_FAKE_GUARD( kMainThreadContext) { diff --git a/services/surfaceflinger/surfaceflinger_flags.aconfig b/services/surfaceflinger/surfaceflinger_flags.aconfig index a81f9b80de..bb3c94a4eb 100644 --- a/services/surfaceflinger/surfaceflinger_flags.aconfig +++ b/services/surfaceflinger/surfaceflinger_flags.aconfig @@ -70,3 +70,9 @@ flag { is_fixed_read_only: true } +flag { + name: "refresh_rate_overlay_on_external_display" + namespace: "core_graphics" + description: "enable refresh rate indicator on the external display" + bug: "301647974" +} |