Skip to content

Commit 5b6bca4

Browse files
Rachel LeeMidas Chien
authored andcommitted
Resync on the transaction.
Currently only Choreographer requestNextVsync will resync otherwise. Scheduler::resync already checks to make sure resync won't happen too frequently (750 ms currently). Bug: 266128330 Test: see b/380398647 and its child bugs Flag: EXEMPT bugfix Change-Id: Id3c0fc6a62b45262f4338f8154ad2fa8c0c16a05 (cherry picked from commit a5be328)
1 parent 8a3f409 commit 5b6bca4

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
@@ -205,6 +205,7 @@ class Scheduler : public IEventThreadCallback, android::impl::MessageQueue {
205205
ftl::FakeGuard guard(kMainThreadContext);
206206
resyncToHardwareVsyncLocked(id, allowToEnable, modePtr);
207207
}
208+
void resync() override EXCLUDES(mDisplayLock);
208209
void forceNextResync() { mLastResyncTime = 0; }
209210

210211
// Passes a vsync sample to VsyncController. Returns true if
@@ -466,7 +467,6 @@ class Scheduler : public IEventThreadCallback, android::impl::MessageQueue {
466467
bool throttleVsync(TimePoint, uid_t) override;
467468
// Get frame interval
468469
Period getVsyncPeriod(uid_t) override EXCLUDES(mDisplayLock);
469-
void resync() override EXCLUDES(mDisplayLock);
470470
void onExpectedPresentTimePosted(TimePoint expectedPresentTime) override EXCLUDES(mDisplayLock);
471471

472472
std::unique_ptr<EventThread> mRenderEventThread;

services/surfaceflinger/SurfaceFlinger.cpp

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

45544554
if (const bool scheduled = transactionFlags & mask; !scheduled) {
4555+
mScheduler->resync();
45554556
scheduleCommit(frameHint);
45564557
} else if (frameHint == FrameHint::kActive) {
45574558
// Even if the next frame is already scheduled, we should reset the idle timer

0 commit comments

Comments
 (0)