Mir

Merge lp://staging/~vanvugt/mir/flush into lp://staging/mir

Proposed by Daniel van Vugt
Status: Work in progress
Proposed branch: lp://staging/~vanvugt/mir/flush
Merge into: lp://staging/mir
Diff against target: 295 lines (+174/-10)
3 files modified
src/server/compositor/multi_threaded_compositor.cpp (+52/-8)
src/server/compositor/multi_threaded_compositor.h (+8/-2)
tests/unit-tests/compositor/test_multi_threaded_compositor.cpp (+114/-0)
To merge this branch: bzr merge lp://staging/~vanvugt/mir/flush
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alberto Aguirre (community) Needs Information
Alexandros Frantzis (community) Needs Information
Kevin DuBois (community) Needs Fixing
Review via email: mp+230436@code.staging.launchpad.net

Commit message

When restarting the compositor (including waking from sleep), flush
the scene and wait briefly for fresh frames. Then composite as soon as the
client (nested server) provides a new frame or the timeout of 500ms expires,
whichever happens first. This avoids the user seeing any stale frames on
wakeup.

This feature will also be useful in future as clients adjust to
display config changes seamlessly without visibly lagging behind the new
config (like resolution changes when a window is maximized).

Description of the change

This branch was intended to help with LP: #1340510. Although it's now clear that bug is more to do with Unity8/dbus and less to do with Mir. So this improvement to Mir isn't expected to solve LP: #1340510 by itself.

Still, this proposal is useful to have for other potential shells that respond to wakeup more quickly than Unity8 does right now.

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

needs fixing:

166 + void schedule_compositing(int number_composites,
167 + std::chrono::milliseconds delay = std::chrono::milliseconds::zero());

default arguments ( http://unity.ubuntu.com/mir/cppguide/index.html?showone=Default_Arguments#Default_Arguments )

suggestion:
The solution isn't bad, but alternatively, we could have the objects implementing mir::DisplayChanger/mf::DisplayChanger trigger a display composition on wakeup. This could avoid messing with the timeouts.

review: Needs Fixing
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Note that we already have support for dropping older frames when a surface becomes visible (restarting a compositor is a special case of this). The frame dropping supported was added by https://code.launchpad.net/~afrantzis/mir/drop-stale-frames/+merge/227961 as a partial fix for the same bug targetted by this MP.

The existing mechanism ensures that we use the latest client frame instead of rapidly showing stale queued frames. This MP is slightly different in that it tries to force the clients to redraw, then waits for some amount of time hoping that they have produced a newer frame. However, for the time intervals we are using ( > 100ms which is larger than our BufferQueues's framedropping policy timeout), I don't think forcing new frames will make much difference, and I am not sure if the complexity is worth it.

As you note, the real problem is the slow greeter rendering.

review: Needs Information
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> This MP is slightly different in that it

Well not slightly different, rather just "different".

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yeah, I'm undecided about this branch now. The complexity is a bit ugly. I had a simpler version prepared but intentionally didn't propose it thinking more people would prefer this one.

Anyway, now my ABI problems are apparently resolved today I will do some system testing on the phone.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Yeah I though this was already handled by the update to BufferQueue from Alexandros.

Do we need more than that?

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's a handy feature. And it is still required (after Unity8 gets fixed) to fully resolve bug 1340510, based on my own experiments inserting delays into clients. Not sure why Alexandros' existing code wasn't enough...? But either way, this solution scales better than putting too much intelligence in BufferQueue (which is instantiated for every surface).

So yes, I think we will still need something like this. But it's not needed right now.

lp://staging/~vanvugt/mir/flush updated
1843. By Daniel van Vugt

Merge latest development-branch

1844. By Daniel van Vugt

Merge latest development-branch

1845. By Daniel van Vugt

Merge latest development-branch

1846. By Daniel van Vugt

Merge latest development-branch

1847. By Daniel van Vugt

Merge latest development-branch

1848. By Daniel van Vugt

Merge latest development-branch

1849. By Daniel van Vugt

Merge latest development-branch

1850. By Daniel van Vugt

Merge latest development-branch

1851. By Daniel van Vugt

Merge latest development-branch

1852. By Daniel van Vugt

Merge latest development-branch

1853. By Daniel van Vugt

Merge latest development-branch

1854. By Daniel van Vugt

Merge latest development-branch

1855. By Daniel van Vugt

Merge latest development-branch

1856. By Daniel van Vugt

Merge latest development-branch

1857. By Daniel van Vugt

Merge latest development-branch

1858. By Daniel van Vugt

Merge latest development-branch

1859. By Daniel van Vugt

Merge latest development-branch

1860. By Daniel van Vugt

Merge latest development-branch and fix conflicts

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

1860. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1859. By Daniel van Vugt

Merge latest development-branch

1858. By Daniel van Vugt

Merge latest development-branch

1857. By Daniel van Vugt

Merge latest development-branch

1856. By Daniel van Vugt

Merge latest development-branch

1855. By Daniel van Vugt

Merge latest development-branch

1854. By Daniel van Vugt

Merge latest development-branch

1853. By Daniel van Vugt

Merge latest development-branch

1852. By Daniel van Vugt

Merge latest development-branch

1851. By Daniel van Vugt

Merge latest development-branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches