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

Skip to content
Commit b4ad3600 authored by Alec Mouri's avatar Alec Mouri
Browse files

Tweak wakeup time for OneShotTimer to reduce jank

Power optimizations for OneShotTimer from change
I83f968042395857237875aab8dca0e6b90d392cb accidentally relaxed the
practical timing requirements for OneShotTimer by allowing for waiting
on a semaphore longer than intended - the optimiation amounted to
throttling the number of sem_post calls, and relying on the idle timeout
thread to check if the timer reset on wakeup before either re-entering
the reset loop or entering the idle loop. But that requires adjusting
the timeout for waiting on the semaphore by the idle timeout thread,
which did not happen. So it was possible to delay moving into an idle
state by up to double what a OneShotTimer was configured to do so. The net effect is that when a device wakes up from an idle state, it may delay learning the vsync cadence if the kernel dropped the refresh rate under the scenes, which causes noticeable jank over the first few frames.

This patch resolves this discepancy by shortening the interval that the
idle timeout thread waits on the semphore for, based on the last time
OneShotTimer::reset was called.

Bug: 233713246
Test: UIBench jank tests
Change-Id: I915822ab71ea3595a02ffbebe16e591a622fcd80
parent 5f0d32a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment