DispSync: Don't resync if HW vsync is unavailable
Don't attempt to resync to hardware vsync if it's not available (if
the display is blanked), which should prevent unusual sequences of
commands (enable vsync, then unblank) to hardware composer.
Bug: 28177844
Change-Id: I9d6046fb0a346830e98829fd250642f0809d7e31
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c09920c..a69b11b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -800,7 +800,8 @@
if (makeAvailable) {
mHWVsyncAvailable = true;
} else if (!mHWVsyncAvailable) {
- ALOGE("resyncToHardwareVsync called when HW vsync unavailable");
+ // Hardware vsync is not currently available, so abort the resync
+ // attempt for now
return;
}
@@ -834,7 +835,7 @@
void SurfaceFlinger::resyncWithRateLimit() {
static constexpr nsecs_t kIgnoreDelay = ms2ns(500);
if (systemTime() - mLastSwapTime > kIgnoreDelay) {
- resyncToHardwareVsync(true);
+ resyncToHardwareVsync(false);
}
}