Mir

Merge lp:~robertcarr/mir/fix-1249210 into lp:mir

Proposed by Robert Carr
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1211
Proposed branch: lp:~robertcarr/mir/fix-1249210
Merge into: lp:mir
Diff against target: 12 lines (+2/-0)
1 file modified
src/server/frontend/session_mediator.cpp (+2/-0)
To merge this branch: bzr merge lp:~robertcarr/mir/fix-1249210
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+194598@code.launchpad.net

Commit message

Ensure the session mediator releases acquired buffer resources before
attempting to acquire a new buffer on behalf of the client. This fixes
performance regression LP: #1249210.

Description of the change

Ensure the session mediator releases acquired buffer resources before attempting to acquire a new buffer on behalf of the client. This was dropped in 1196.

I'm having trouble understanding why it only triggers half FPS for bypass clients...

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The reason is in surfaces:Surface::advance_buffer()

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

It works! But it would be extra-nice to regression-test this so we don't get caught by the same regressions again.

I guess it would only affect bypass clients because bypass is special; it needs to hold _two_ compositor buffers simultaneously. If we allow clients to hold two buffers simultaneously as well, then we have a need for _four_ buffers when there's only three in the bundle. Hence the client would be forced to wait each frame for the previous page flip to complete. That would explain it...

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

P.S. Prior to the new SwitchingBundle algorithm, we probably would have just crashed immediately with an exception. Only the new algorithm supports multiple simultaneous client buffers.

So a simple way to regression test would be to enforce the requirement that only one client buffer exists at a time. And if not, throw a logic_error. Though I'm not totally in support of throwing, because we'd be losing functionality potentially useful for improving pipelining of client buffers (and hence performance) later.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/frontend/session_mediator.cpp'
2--- src/server/frontend/session_mediator.cpp 2013-11-05 03:39:55 +0000
3+++ src/server/frontend/session_mediator.cpp 2013-11-08 21:42:24 +0000
4@@ -118,6 +118,8 @@
5 {
6 auto& tracker = client_buffer_tracker[surf_id];
7 if (!tracker) tracker = std::make_shared<ClientBufferTracker>(client_buffer_cache_size);
8+
9+ client_buffer_resource[surf_id].reset();
10
11 auto client_buffer = surface.advance_client_buffer();
12 auto id = client_buffer->id();

Subscribers

People subscribed via source and target branches