summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/Scheduler/Scheduler.h1
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index 9c32b1f421..f6c81c0ba2 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -169,6 +169,7 @@ public:
// The period is the vsync period from the current display configuration.
void resyncToHardwareVsync(bool makeAvailable, nsecs_t period);
void resync() EXCLUDES(mRefreshRateConfigsLock);
+ void forceNextResync() { mLastResyncTime = 0; }
// Passes a vsync sample to VsyncController. periodFlushed will be true if
// VsyncController detected that the vsync period changed, and false otherwise.
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 46d90c8d7f..91b479b783 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1957,8 +1957,8 @@ void SurfaceFlinger::onComposerHalRefresh(hal::HWDisplayId) {
}
void SurfaceFlinger::onComposerHalVsyncIdle(hal::HWDisplayId) {
- // TODO(b/198106220): force enable HWVsync to avoid drift problem during
- // idle.
+ ATRACE_CALL();
+ mScheduler->forceNextResync();
}
void SurfaceFlinger::setVsyncEnabled(bool enabled) {