summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2022-11-28 15:15:13 -0800
committer Ady Abraham <adyabr@google.com> 2022-11-28 21:25:59 -0800
commit884bf013f64f41af6daac71c7abc2dfff6ed465e (patch)
treee0e47a700187a28eeb556c6505f5cbc88a67c84b
parentace3d05494a29ab9666c37f8646879635fb9b583 (diff)
SF: use SurfaceFlingerProperties for frame_rate_override_global
This flag is accessed from DisplayManager in addition to SF, so add it to SurfaceFlingerProperties instead of hardcoded flag. Test: atest DisplayModeDirectorTests Bug: 241447632 Change-Id: I1951bc5e17ec0f6304ecb91aa83555b8cce5e73a
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp2
-rw-r--r--services/surfaceflinger/SurfaceFlingerProperties.cpp4
-rw-r--r--services/surfaceflinger/SurfaceFlingerProperties.h2
-rw-r--r--services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop14
-rw-r--r--services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt4
5 files changed, 23 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 111b927507..0570c7314b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2830,7 +2830,7 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(
return Config::FrameRateOverride::AppOverrideNativeRefreshRates;
}
- if (!base::GetBoolProperty("debug.sf.frame_rate_override_global"s, false)) {
+ if (!sysprop::frame_rate_override_global(false)) {
return Config::FrameRateOverride::AppOverride;
}
diff --git a/services/surfaceflinger/SurfaceFlingerProperties.cpp b/services/surfaceflinger/SurfaceFlingerProperties.cpp
index c8c71dfad1..5b7303090d 100644
--- a/services/surfaceflinger/SurfaceFlingerProperties.cpp
+++ b/services/surfaceflinger/SurfaceFlingerProperties.cpp
@@ -371,6 +371,10 @@ bool frame_rate_override_for_native_rates(bool defaultValue) {
return SurfaceFlingerProperties::frame_rate_override_for_native_rates().value_or(defaultValue);
}
+bool frame_rate_override_global(bool defaultValue) {
+ return SurfaceFlingerProperties::frame_rate_override_global().value_or(defaultValue);
+}
+
bool enable_layer_caching(bool defaultValue) {
return SurfaceFlingerProperties::enable_layer_caching().value_or(defaultValue);
}
diff --git a/services/surfaceflinger/SurfaceFlingerProperties.h b/services/surfaceflinger/SurfaceFlingerProperties.h
index 5e316cfa0e..09629cf93e 100644
--- a/services/surfaceflinger/SurfaceFlingerProperties.h
+++ b/services/surfaceflinger/SurfaceFlingerProperties.h
@@ -98,6 +98,8 @@ bool enable_frame_rate_override(bool defaultValue);
bool frame_rate_override_for_native_rates(bool defaultValue);
+bool frame_rate_override_global(bool defaultValue);
+
bool enable_layer_caching(bool defaultValue);
bool enable_sdr_dimming(bool defaultValue);
diff --git a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
index 28da81ff50..8540c3dcfc 100644
--- a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
+++ b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
@@ -447,8 +447,8 @@ prop {
# Limits the frame rate override feature (enable_frame_rate_override) to override the refresh rate
# to native display refresh rates only. Before introducing this flag, native display refresh rates
-# was the default behvaiour. With this flag we can control which behaviour we want explicitly.
-# This flag is intoruduced as a fail-safe machanism and planned to be defaulted to false.
+# was the default behaviour. With this flag we can control which behaviour we want explicitly.
+# This flag is introduced as a fail-safe mechanism and planned to be defaulted to false.
prop {
api_name: "frame_rate_override_for_native_rates"
type: Boolean
@@ -457,6 +457,16 @@ prop {
prop_name: "ro.surface_flinger.frame_rate_override_for_native_rates"
}
+# Enables the frame rate override feature (enable_frame_rate_override) to
+# override the frame rate globally instead of only for individual apps.
+prop {
+ api_name: "frame_rate_override_global"
+ type: Boolean
+ scope: Public
+ access: Readonly
+ prop_name: "ro.surface_flinger.frame_rate_override_global"
+}
+
# Enables Layer Caching
prop {
api_name: "enable_layer_caching"
diff --git a/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt b/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
index 0dfb80e5df..93381333a8 100644
--- a/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
+++ b/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
@@ -65,6 +65,10 @@ props {
prop_name: "ro.surface_flinger.frame_rate_override_for_native_rates"
}
prop {
+ api_name: "frame_rate_override_global"
+ prop_name: "ro.surface_flinger.frame_rate_override_global"
+ }
+ prop {
api_name: "has_HDR_display"
prop_name: "ro.surface_flinger.has_HDR_display"
}