From 09bf763bbda713b6ee69fb625c596e279d443309 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Wed, 10 Jun 2020 14:28:50 -0700 Subject: VSR: Only ignore Composer when rate isn't changing This refines the logic added in I79c66faeaed262acd9c5925fe2202a9fb3f10b7b, which started ignoring Composer-provided refresh rates on vsync callbacks when the kernel idle timer is enabled. This behavior is still correct when SF doesn't think that that refresh rate has changed, but when we initiate a change, such as when the only active layer is infrequently updating, then it's okay to rely on the Composer-provided rate. Bug: 158141901 Test: atest libsurfaceflinger_unittest, systrace Change-Id: I16c87005f5cd1ca1810014211d73b4662e7c8c86 --- services/surfaceflinger/Scheduler/VSyncReactor.cpp | 4 +++- .../tests/unittests/VSyncReactorTest.cpp | 23 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/services/surfaceflinger/Scheduler/VSyncReactor.cpp b/services/surfaceflinger/Scheduler/VSyncReactor.cpp index 16d102cac1..c743de07ae 100644 --- a/services/surfaceflinger/Scheduler/VSyncReactor.cpp +++ b/services/surfaceflinger/Scheduler/VSyncReactor.cpp @@ -278,7 +278,9 @@ bool VSyncReactor::periodConfirmed(nsecs_t vsync_timestamp, std::optional