Commit Graph

16 Commits

Author SHA1 Message Date
Haixia Shi 179bd77ab6 SF: more DispSync improvements.
Pass the reference time to DispSyncThread. Since the phase offset is calculated
using timestamps relative to the reference time, we must also adjust the phase
offset by the same reference time when computing the next refresh time.

Always reset phase offset to zero when updating the reference time because the
reference time equals the first timestamp.

After beginResync() we need to keep HW vsync enabled until the model is updated.

Bug: 25113115
Change-Id: I8eae227bee91c24a99bf8e57fbebceb98d29c77d
Test: check in systrace that app/sf vsync events have correct phase
2016-07-20 04:16:16 -07:00
Haixia Shi 95cda3b92f SF: use first sample timestamp as reference.
Do not use the absolute 64-bit nsecs_t timestamp directly in phase
and error calculations. Compared to the estimated vsync period, the
timestamp tend to many orders of magnitudes larger, and consequently
the integer modulo operation used to calculate phase and error can
be very sensitive to tiny fluctuation in vsync period.

Bug: 25113115
Test: set kTraceDetailedInfo=true; see Phase and Error are stable in systrace

Change-Id: I687703eec31b1072c606898c0424a96c0a8ca033
2016-07-20 04:16:16 -07:00
Steve Kondik ccf7c200ce input: Adjust priority
* Bring into the desired group to get the best result.

Change-Id: I3bd031074cd7006994736b4c22d0294b6012f662
2015-10-17 13:51:11 -07:00
Lajos Molnar 67d8bd66aa surfaceflinger: add getDisplayStats() method
This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
2014-09-18 17:03:20 -07:00
Andy McFadden 645b1f7ffb Replace "lower power mode" experiment
This replaces the previous low-power mode experiment, which
discarded refresh events, with a new experiment that alters
the refresh period.

(see also I2849e5ea335c0d2509fea1c315392bce7f20451d )

The feature is enabled by specifying a nonzero value for the
"refresh skip count", which indicates the number of periods
to skip.  For example, the command:

  adb shell service call SurfaceFlinger 1016 i32 1

sets a skip count of '1', yielding a 30Hz refresh rate on a device
with a 60Hz display.  Changing the last value to '2' would set the
refresh to 20Hz.  '0' returns to the default behavior.

Bug 15523257

Change-Id: I00039c22a55750e74035644c63800e4bee1c774a
2014-06-11 10:19:08 -07:00
Andy McFadden 5167ec68fe Disable DispSync resync when not needed
If app and SF events aren't using phase offsets, we don't need
to maintain the DispSync model.  We just turn hardware VSYNC on
whenever something wants to draw.  This avoids some edge cases
where we were doing too much resync work.

Also, updated the systrace output.  The "VsyncOn" line was a
combination of SF and app event threads, and would occasionally
be very weird.  Removed VsyncOn, renamed VSYNC to VSYNC-app,
and added VSYNC-sf.

Also, added more details to the --dispsync dumpsys output.

Also, renamed global constants to not look like local variables.

Bug 15516453

Change-Id: I0da10b72f0d9a7b7eb5202d87cc18967f698adbd
2014-06-10 13:12:19 -07:00
Andy McFadden c751e92c56 Add "dumpsys SurfaceFlinger --dispsync"
Dumps the current DispSync state.

Bug 14651879

Change-Id: Ide4e6dbd58b117bc1a6b97b57d10cd92ec86dc84
2014-05-08 16:14:41 -07:00
Andy McFadden 150ecd8c1b Add mutex
Change-Id: I81072031e74a5cca8384e4e8bce4babf2187d8bb
2014-05-08 14:56:50 -07:00
Andy McFadden 41d67d7ab4 Improve SurfaceFlinger PTS estimation
Get the next refresh time from DispSync instead of guessing based
on the current time.

Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
2014-05-02 10:56:54 -07:00
Ruchi Kandoi f52b3c88f1 SurfaceFlinger: Adds the functionality to reduce refresh rate to half of
the default.

Feature added for the low power mode.

Change-Id: I2849e5ea335c0d2509fea1c315392bce7f20451d
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-05-01 18:29:33 +00:00
Mark Salyzyn 92dc3fc52c native frameworks: 64-bit compile issues
- Fix format (print/scanf)
- Suppress unused argument warning messages (bonus)

Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
2014-03-12 13:12:44 -07:00
Jamie Gennis 629b987818 DispSync: remove delay when enabling vsync events
This change fixes a bug that caused an extra frame of latency when enabling
vsync event callbacks in DispSync.  The bug was related to the logic that
prevents the two events from firing with very little time between them due to
updates to the vsync model.

Bug: 11479720
Change-Id: Ie7eaff9e92ffb7b7b6cb4d3d4402c96cbd29af7e
2013-12-02 21:06:09 -08:00
Jesse Hall 44e45cfeb3 Merge "DispSync: don't compensate for wakeup latency" into klp-dev 2013-10-13 20:13:59 +00:00
Jesse Hall 72f69d9f23 Wake up disp sync thread when setting display period
Bug: 10624956
Change-Id: I272c15f319521bfbd1bb70451366c7dd84d60bf9
2013-10-10 14:48:22 -07:00
Jamie Gennis 0d5c60edf1 DispSync: don't compensate for wakeup latency
This change removes the wakeup latency compensation from the software-generated
vsync events.  Choreographer can't handle timestamps in the future, so don't
aim for early wake-ups with the expectation that the actual wake-up will be
late.

Bug: 11153576
2013-10-09 17:56:42 -07:00
Jamie Gennis faf77cce9d SurfaceFlinger: SW-based vsync events
This change adds the DispSync class, which models the hardware vsync event
times to allow vsync event callbacks to be done at an arbitrary phase offset
from the hardware vsync.  This can be used to reduce the minimum latency from
Choreographer wake-up to on-screen image presentation.

Bug: 10624956
Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
2013-10-07 17:59:53 -07:00