Deal with unreliable VSYNC signals due to scheduler.
We see two sources of scheduler jank when waiting for VSYNC: - A kernfs issue that wakes up threads using a normal priority work queue that may be delayed or have other work on it. - The VSYNC callback from HWC is handled by a normal priority HwBinder thread that may be delayed by other work. Change the VrFlinger frame post thread to use an absolute timer- based dead reckoning loop. VSYNC timestamps from the display driver are reliable, even if the delivery of the value takes time. Predict the VSYNC time into the future based on the last known VSYNC time. If we see that VSYNC has not been signaled by the time we need to post a frame to HWC we assume that the driver and/or HWC was delayed so much that the previous frame is still pending and skip the upcoming frame to avoid double stuffing the driver. Bug: 65064949 Test: Extensive system tests and systraces. See bug for details. Change-Id: Iae6c4173b8eac1d179adc3fc8004d3d475b3f156
Loading
Please register or sign in to comment