Skip to content

Commit 6bbe47e

Browse files
Midas ChienAndroid (Google) Code Review
authored andcommitted
Merge "Resync on the transaction." into main
2 parents 5058af6 + 5b6bca4 commit 6bbe47e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

services/surfaceflinger/Scheduler/Scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ class Scheduler : public IEventThreadCallback, android::impl::MessageQueue {
209209
ftl::FakeGuard guard(kMainThreadContext);
210210
resyncToHardwareVsyncLocked(id, allowToEnable, modePtr);
211211
}
212+
void resync() override EXCLUDES(mDisplayLock);
212213
void forceNextResync() { mLastResyncTime = 0; }
213214

214215
// Passes a vsync sample to VsyncController. Returns true if
@@ -470,7 +471,6 @@ class Scheduler : public IEventThreadCallback, android::impl::MessageQueue {
470471
bool throttleVsync(TimePoint, uid_t) override;
471472
// Get frame interval
472473
Period getVsyncPeriod(uid_t) override EXCLUDES(mDisplayLock);
473-
void resync() override EXCLUDES(mDisplayLock);
474474
void onExpectedPresentTimePosted(TimePoint expectedPresentTime) override EXCLUDES(mDisplayLock);
475475

476476
std::unique_ptr<EventThread> mRenderEventThread;

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4566,6 +4566,7 @@ void SurfaceFlinger::setTransactionFlags(uint32_t mask, TransactionSchedule sche
45664566
SFTRACE_INT("mTransactionFlags", transactionFlags);
45674567

45684568
if (const bool scheduled = transactionFlags & mask; !scheduled) {
4569+
mScheduler->resync();
45694570
scheduleCommit(frameHint);
45704571
} else if (frameHint == FrameHint::kActive) {
45714572
// Even if the next frame is already scheduled, we should reset the idle timer

0 commit comments

Comments
 (0)