summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andy Yu <chingtangyu@google.com> 2023-10-19 15:25:24 -0700
committer Andy Yu <chingtangyu@google.com> 2023-10-20 10:04:13 -0700
commitf06ef956d159e98b9ec8874dc15b07707a570885 (patch)
tree5613e00e8ff3fb2fbf6bb90daf83a5e9beb82942
parent64edb6c4b8e5491de46bf7b58643c0d91ee4e652 (diff)
SF: Add a sysprop for game default frame rate
Bug: 286084594 Test: SurfaceFlinger unit tests Change-Id: Icc3ed7642e45c8c28b063cbe1799e09c00a05e35
-rw-r--r--services/surfaceflinger/SurfaceFlingerProperties.cpp4
-rw-r--r--services/surfaceflinger/SurfaceFlingerProperties.h2
-rw-r--r--services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop12
-rw-r--r--services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt5
4 files changed, 23 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlingerProperties.cpp b/services/surfaceflinger/SurfaceFlingerProperties.cpp
index 66c8f33fe5..a7650783b4 100644
--- a/services/surfaceflinger/SurfaceFlingerProperties.cpp
+++ b/services/surfaceflinger/SurfaceFlingerProperties.cpp
@@ -371,5 +371,9 @@ bool clear_slots_with_set_layer_buffer(bool defaultValue) {
return SurfaceFlingerProperties::clear_slots_with_set_layer_buffer().value_or(defaultValue);
}
+int32_t game_default_frame_rate_override(int32_t defaultValue) {
+ return SurfaceFlingerProperties::game_default_frame_rate_override().value_or(defaultValue);
+}
+
} // namespace sysprop
} // namespace android
diff --git a/services/surfaceflinger/SurfaceFlingerProperties.h b/services/surfaceflinger/SurfaceFlingerProperties.h
index a08042009b..65ebe2af21 100644
--- a/services/surfaceflinger/SurfaceFlingerProperties.h
+++ b/services/surfaceflinger/SurfaceFlingerProperties.h
@@ -101,6 +101,8 @@ bool ignore_hdr_camera_layers(bool defaultValue);
bool clear_slots_with_set_layer_buffer(bool defaultValue);
+int32_t game_default_frame_rate_override(int32_t defaultValue);
+
} // namespace sysprop
} // namespace android
#endif // SURFACEFLINGERPROPERTIES_H_
diff --git a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
index be29be4ef4..0ad5ac9956 100644
--- a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
+++ b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
@@ -495,3 +495,15 @@ prop {
access: Readonly
prop_name: "ro.surface_flinger.clear_slots_with_set_layer_buffer"
}
+
+# Controls the default frame rate override of game applications. Ideally, game applications set
+# desired frame rate via setFrameRate() API. However, to cover the scenario when the game didn't
+# have a set frame rate, we introduce the default frame rate. The priority of this override is the
+# lowest among setFrameRate() and game intervention override.
+prop {
+ api_name: "game_default_frame_rate_override"
+ type: Integer
+ scope: Public
+ access: Readonly
+ prop_name: "ro.surface_flinger.game_default_frame_rate_override"
+}
diff --git a/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt b/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
index ba88acc2fb..00173009f5 100644
--- a/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
+++ b/services/surfaceflinger/sysprop/api/SurfaceFlingerProperties-current.txt
@@ -65,6 +65,11 @@ props {
prop_name: "ro.surface_flinger.force_hwc_copy_for_virtual_displays"
}
prop {
+ api_name: "game_default_frame_rate_override"
+ type: Integer
+ prop_name: "ro.surface_flinger.game_default_frame_rate_override"
+ }
+ prop {
api_name: "has_HDR_display"
prop_name: "ro.surface_flinger.has_HDR_display"
}