SurfaceFlinger: add display power state timer

Coming out of DOZE mode might result in unstable HWVsync which may
confuse FPS detection logic to set the desired refresh rate.
To mitigate that, this change introduces a new timer that will provide
a grace period when coming out of DOZE while in this grace period refresh
rate will stay in PERFORMANCE.

Test: Toggle DOZE by hitting the power button and collect systrace
Bug: 135550670
Change-Id: Ib8ec3c9550336d691dd3868405d20b98aa983302
Merged-In: Ib8ec3c9550336d691dd3868405d20b98aa983302
diff --git a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
index f18f33c..74baf37 100644
--- a/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
+++ b/services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop
@@ -323,6 +323,18 @@
     prop_name: "ro.surface_flinger.set_touch_timer_ms"
 }
 
+# setDisplayPowerTimerMs indicates what is considered a timeout in milliseconds for Scheduler.
+# This value is used by the Scheduler to trigger display power inactivity callbacks that will
+# keep the display in peak refresh rate as long as display power is not in normal mode.
+# Setting this property to 0 means there is no timer.
+prop {
+    api_name: "set_display_power_timer_ms"
+    type: Integer
+    scope: System
+    access: Readonly
+    prop_name: "ro.surface_flinger.set_display_power_timer_ms"
+}
+
 # useSmart90ForVideo indicates whether Scheduler should detect content FPS, and try to adjust the
 # screen refresh rate based on that.
 prop {