Merge lp://qastaging/~vanvugt/mir/ddouble into lp://qastaging/mir
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2673 |
Proposed branch: | lp://qastaging/~vanvugt/mir/ddouble |
Merge into: | lp://qastaging/mir |
Diff against target: |
486 lines (+277/-45) 3 files modified
src/server/compositor/buffer_queue.cpp (+96/-19) src/server/compositor/buffer_queue.h (+14/-0) tests/unit-tests/compositor/test_buffer_queue.cpp (+167/-26) |
To merge this branch: | bzr merge lp://qastaging/~vanvugt/mir/ddouble |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cemil Azizoglu (community) | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Alberto Aguirre (community) | Abstain | ||
Kevin DuBois (community) | Abstain | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Alan Griffiths | Abstain | ||
Review via email: mp+258351@code.qastaging.launchpad.net |
Commit message
Introducing dynamic buffer queue scaling to minimize lag.
(LP: #1240909)
Actually the size of the queue doesn't really change with this branch.
What it does do is reliably detect when a client is staying ahead of
the compositor and throttle it so that no more than one future frame
is ever pre-rendered. Hence you get the same single-frame latency as
double buffering. But the moment the client fails to keep up, it will
get to use all three buffers again.
Description of the change
Background reading and imagery to help you understand the improvement:
https:/
Fun facts:
* For manual testing you can see the switching in action if you set MIR_CLIENT_
* Strange and wonderful things happen with input resampling. Event-driven clients that use the default 59Hz resampling rate (e.g. mir_demo_
* Additional manual testing has been done on a couple of phones (I backported this branch). Everything remains smooth. Unity8 is fast enough on some devices to qualify for double buffering. Unity8-dash is generally not fast enough on any device to qualify. You can see the stats on a live phone with:
restart unity8 MIR_CLIENT_
tail -f ~/.cache/
* In raw numbers this branch at least reduces end-to-end lag on the phone from 5 frames to 4 (when unity8 qualifies for double buffering). And if your app (not unity8-dash) is fast enough to keep up too, it's then only 3 frames lag. So this branch reduces Unity8/USC total graphics latency by 20-40%, but more consistent results closer to 40% will depend on Unity8/dash performance improving in future. Also keep in mind on common mobile devices the touchscreen hardware itself may represent most of the latency. So even a 100% reduction in graphics latency could likely still feel slightly laggy to the user. And thus a 40% improvement is actually less than 40% of the total lag you perceive.
* A "slow" client that gets triple buffers is actually one that's achieving between 50% and 100% of the compositor frame rate. 100% or more is obviously fast and gets double buffers. Less obvious is that really slow clients doing less than 50% frame rate (e.g. a clock) actually keep the system idle enough that the third buffer doesn't get touched so you might see really slow clients only report 1 or 2 buffers in action even though we allow them 3.
PASSED: Continuous integration, rev:2151 jenkins. qa.ubuntu. com/job/ mir-ci/ 3731/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/2331 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/2330 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/2279 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1728 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1728/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 2279 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 2279/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/5172 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 20217
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3731/ rebuild
http://