Merge lp://qastaging/~vanvugt/mir/double into lp://qastaging/mir
- double
- Merge into development-branch
Status: | Work in progress |
---|---|
Proposed branch: | lp://qastaging/~vanvugt/mir/double |
Merge into: | lp://qastaging/mir |
Diff against target: |
850 lines (+446/-53) 4 files modified
src/server/compositor/buffer_queue.cpp (+122/-22) src/server/compositor/buffer_queue.h (+7/-2) tests/integration-tests/surface_composition.cpp (+8/-1) tests/unit-tests/compositor/test_buffer_queue.cpp (+309/-28) |
To merge this branch: | bzr merge lp://qastaging/~vanvugt/mir/double |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel van Vugt | Needs Fixing | ||
Alexandros Frantzis (community) | Needs Fixing | ||
Alberto Aguirre | Pending | ||
Review via email: mp+227701@code.qastaging.launchpad.net |
Commit message
Reintroduce double buffering! (LP: #1240909)
Default to double buffering where possible, to minimize visible lag and
resource usage. The queue will be expanded automatically to triple buffers
if you enable framedropping, or if it is observed that the client is not
keeping up with the compositor.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1725
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1726. By Daniel van Vugt
-
Merge latest development-branch
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1726
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
The failure is bug 1348095. Unrelated to this proposal.
- 1727. By Daniel van Vugt
-
Merge latest development-branch
- 1728. By Daniel van Vugt
-
Merge latest development-branch
- 1729. By Daniel van Vugt
-
Merge latest development-branch and fix conflicts.
- 1730. By Daniel van Vugt
-
Merge latest development-branch
- 1731. By Daniel van Vugt
-
Fix failing test case, merged from devel:
gives_compositor_the_newest_ buffer_ after_dropping_ old_buffers - 1732. By Daniel van Vugt
-
Make tests which require 3 buffers more consistent
- 1733. By Daniel van Vugt
-
Fix failing test: TEST_F(StaleFrames, are_dropped_
when_restarting _compositor)
It was designed to assume three unique buffers available by default. Remove
that assumption. - 1734. By Daniel van Vugt
-
Lower the resize delay to 100 frames so slow clients only take ~1.5s to
be detected as slow and change to triple buffers.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1734
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
Not a thorough review yet, looks good overall on a first pass.
86 + if (client_behind && missed_frames < queue_resize_
87 + {
88 + ++missed_frames;
89 + if (missed_frames >= queue_resize_
90 + extra_buffers = 1;
91 + }
92 +
93 + if (!client_behind && missed_frames > 0)
102 + if (missed_frames < queue_resize_
103 + --missed_frames;
It would be nice to have tests for the expected behavior of this piece of code.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1734
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
There are already tests for that portion of logic:
TEST_
TEST_
TEST_
Although it's always possible to add more.
Alexandros Frantzis (afrantzis) wrote : | # |
> Although it's always possible to add more.
One test that is missing (at least not tested explicitly) is to verify that: "If the ceiling is hit, keep it there with the extra buffer allocated so we don't shrink again and cause yet more missed frames."
- 1735. By Daniel van Vugt
-
Merge latest development-branch
- 1736. By Daniel van Vugt
-
Merge latest development-branch
- 1737. By Daniel van Vugt
-
Add unit test: BufferQueueTest
.switch_ to_triple_ buffers_ is_permanent This verifies we don't accidentally ping-pong between 2 and 3 buffers.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1737
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
> * A client that's keeping up will be in-phase with composition. That
> * means it will stay, or quickly equalize at a point where there are
> * no client buffers still held when composition finishes.
This criterion only works well when the client is actually trying to keep up with the compositor (i.e. 60Hz). Clients that refresh less often on purpose or only when reacting to user input will become triple-buffered if the compositor is triggered by another source and they are not updating fast enough.
This happens, for example, if we run both mir_demo_
We probably need additional logic/heurestics to make this work properly (haven't thought through what that logic might be, though).
- 1738. By Daniel van Vugt
-
Merge latest development-branch
- 1739. By Daniel van Vugt
-
Add a regression test for the idle-vs-slow client problem Alexandros
described. Presently failing. - 1740. By Daniel van Vugt
-
Move the "missed frames" decision to a point where it won't be skewed by
multiple compositors (multi-monitor). - 1741. By Daniel van Vugt
-
Prototype a detection of "idle" clients. Other questionable tests still
failing. - 1742. By Daniel van Vugt
-
Simplify
- 1743. By Daniel van Vugt
-
More readable.
- 1744. By Daniel van Vugt
-
Fix failing test: BufferQueueTest
.queue_ size_scales_ for_slow_ clients
It needed some enhancement to not be detected as an "idle" client by the
new logic. - 1745. By Daniel van Vugt
-
Fix test case: BufferQueueTest
.switch_ to_triple_ buffers_ is_permanent
The new idle detection logic was not seeing any client activity and so
deemed it not trying to keep up. So added some "slow client" activity. - 1746. By Daniel van Vugt
-
Simplified idle detection
- 1747. By Daniel van Vugt
-
Fix comment typo
- 1748. By Daniel van Vugt
-
Add another regression test which shows premature expansion for really
slow clients. - 1749. By Daniel van Vugt
-
Fixed: Mis-detection of a really slow client (low self-determined frame rate)
as failing to keep up. Regression test now passes. - 1750. By Daniel van Vugt
-
Remove debug code
Daniel van Vugt (vanvugt) wrote : | # |
Excellent point Alexandros. That's now fixed with extra tests for the scenarios you describe.
Unfortunately I just realized that there's another situation that probably needs fixing: A system with a single slow-ticking client (like a clock) won't ever know that the compositor is capable of running any faster than the client is, and so will classify the client as slow --> triple buffers prematurely.
Daniel van Vugt (vanvugt) wrote : | # |
I'm now tempted to divide this proposal in two:
1. Basic test case fixes to support future double buffering; and
2. Heuristic switching between double and triple buffering (work in progress).
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1750
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1751. By Daniel van Vugt
-
Merge latest development-branch
- 1752. By Daniel van Vugt
-
Merge latest development-branch
- 1753. By Daniel van Vugt
-
Slightly simpler and more straight forward detection of slow vs idle clients.
- 1754. By Daniel van Vugt
-
Shrink the diff
- 1755. By Daniel van Vugt
-
More comments
- 1756. By Daniel van Vugt
-
Add a regression test for the slow-ticking-
client- mostly- idle-desktop case. - 1757. By Daniel van Vugt
-
test_buffer_
queue.cpp: De-duplicate buffer counting logic - 1758. By Daniel van Vugt
-
Fix indentation in new tests
- 1759. By Daniel van Vugt
-
test_buffer_
queue.cpp: Major simplification - reuse a common function to
measure unique buffers. - 1760. By Daniel van Vugt
-
Tidy up tests
- 1761. By Daniel van Vugt
-
Remove unnecessary sleeps from new tests
- 1762. By Daniel van Vugt
-
Go back to the old algorithm, keep the new tests.
- 1763. By Daniel van Vugt
-
A slightly more elegant measure of client_lag
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1762
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1764. By Daniel van Vugt
-
Merge latest development-branch
- 1765. By Daniel van Vugt
-
Merge latest development-branch
- 1766. By Daniel van Vugt
-
Merge latest development-branch
- 1767. By Daniel van Vugt
-
Merge latest development-branch
- 1768. By Daniel van Vugt
-
Merge latest development-branch
- 1769. By Daniel van Vugt
-
Merge latest development-branch
- 1770. By Daniel van Vugt
-
Merge latest development-branch
- 1771. By Daniel van Vugt
-
Merge latest development-branch and fix conflicts.
- 1772. By Daniel van Vugt
-
Merge latest development-branch
- 1773. By Daniel van Vugt
-
Merge latest development-branch
- 1774. By Daniel van Vugt
-
Merge latest development-branch
- 1775. By Daniel van Vugt
-
Merge latest development-branch
- 1776. By Daniel van Vugt
-
Merge latest development-branch
- 1777. By Daniel van Vugt
-
Merge latest development-branch
- 1778. By Daniel van Vugt
-
Merge (rebase on) 'double-
integration- tests' to shrink the diff of
this branch to its new parent. - 1779. By Daniel van Vugt
-
Merge latest development-branch
- 1780. By Daniel van Vugt
-
Merge latest development-branch and fix conflicts.
- 1781. By Daniel van Vugt
-
Merge latest development-branch
- 1782. By Daniel van Vugt
-
Merge latest development-branch
- 1783. By Daniel van Vugt
-
Merge latest development-branch
- 1784. By Daniel van Vugt
-
Merge latest development-branch
- 1785. By Daniel van Vugt
-
Merge latest development-branch and fix a conflict.
- 1786. By Daniel van Vugt
-
Merge latest development-branch
- 1787. By Daniel van Vugt
-
Merge latest development-branch
- 1788. By Daniel van Vugt
-
Merge latest development-branch
- 1789. By Daniel van Vugt
-
Merge latest trunk
- 1790. By Daniel van Vugt
-
Merge latest trunk
- 1791. By Daniel van Vugt
-
Merge latest trunk
- 1792. By Daniel van Vugt
-
Merge latest trunk
- 1793. By Daniel van Vugt
-
Merge latest trunk
- 1794. By Daniel van Vugt
-
Merge latest trunk
- 1795. By Daniel van Vugt
-
Merge latest trunk
- 1796. By Daniel van Vugt
-
Merge latest trunk
- 1797. By Daniel van Vugt
-
Prototype fix for the crashing integration test
- 1798. By Daniel van Vugt
-
A simpler fix for the crashing test -- don't try to release the same
old_buffer multiple times. - 1799. By Daniel van Vugt
-
Even simpler
Unmerged revisions
- 1799. By Daniel van Vugt
-
Even simpler
- 1798. By Daniel van Vugt
-
A simpler fix for the crashing test -- don't try to release the same
old_buffer multiple times. - 1797. By Daniel van Vugt
-
Prototype fix for the crashing integration test
- 1796. By Daniel van Vugt
-
Merge latest trunk
- 1795. By Daniel van Vugt
-
Merge latest trunk
- 1794. By Daniel van Vugt
-
Merge latest trunk
- 1793. By Daniel van Vugt
-
Merge latest trunk
- 1792. By Daniel van Vugt
-
Merge latest trunk
- 1791. By Daniel van Vugt
-
Merge latest trunk
- 1790. By Daniel van Vugt
-
Merge latest trunk
Fun fact: Adding the heuristic for detecting slow clients fixes: st.slow_ client_ framerate_ matches_ compositor
BufferQueueTe
without any time-fudging required any more. Turns out it was a very good test.