Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9befd7c authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: handle onComposerHalVsyncIdle

Tell Scheduler to force resync on the next resync request
when onComposerHalVsyncIdle callback is called.

Bug: 198106220
Test: manually calling onComposerHalVsyncIdle from backdoor
Change-Id: I6875c0ba44ef4de2c025491830fbb0bb710093bd
parent 3040c435
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,7 @@ public:
    // The period is the vsync period from the current display configuration.
    // The period is the vsync period from the current display configuration.
    void resyncToHardwareVsync(bool makeAvailable, nsecs_t period);
    void resyncToHardwareVsync(bool makeAvailable, nsecs_t period);
    void resync() EXCLUDES(mRefreshRateConfigsLock);
    void resync() EXCLUDES(mRefreshRateConfigsLock);
    void forceNextResync() { mLastResyncTime = 0; }


    // Passes a vsync sample to VsyncController. periodFlushed will be true if
    // Passes a vsync sample to VsyncController. periodFlushed will be true if
    // VsyncController detected that the vsync period changed, and false otherwise.
    // VsyncController detected that the vsync period changed, and false otherwise.
+2 −2
Original line number Original line Diff line number Diff line
@@ -1957,8 +1957,8 @@ void SurfaceFlinger::onComposerHalRefresh(hal::HWDisplayId) {
}
}


void SurfaceFlinger::onComposerHalVsyncIdle(hal::HWDisplayId) {
void SurfaceFlinger::onComposerHalVsyncIdle(hal::HWDisplayId) {
    // TODO(b/198106220): force enable HWVsync to avoid drift problem during
    ATRACE_CALL();
    // idle.
    mScheduler->forceNextResync();
}
}


void SurfaceFlinger::setVsyncEnabled(bool enabled) {
void SurfaceFlinger::setVsyncEnabled(bool enabled) {