[server] Fix remote access buffer handling when output not bound
ClosedPublic

Authored by romangg on Sep 11 2018, 12:29 PM.

Details

Summary

If a client has not bound a certain output do not directly return
but try to deliver the buffer to other clients.

If none of them has requested it, send bufferReleased signal
immediately to let compositor know that the buffer should
be cleaned up.

Test Plan

Manually. Autotest planned.

Diff Detail

Repository
R127 KWayland
Branch
remoteBufferClientsUnbindOutput
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 2726
Build 2744: arc lint + arc unit
romangg created this revision.Sep 11 2018, 12:29 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 11 2018, 12:29 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.Sep 11 2018, 12:29 PM
davidedmundson added inline comments.
src/server/remote_access_interface.cpp
216

Would it be better to emit bufferReleased?

Otherwise we're sometimes doing this deletion in the framework, sometimes in kwin

romangg updated this revision to Diff 41400.Sep 11 2018, 12:45 PM
romangg marked an inline comment as done.
  • Emit bufferReleased signal instead of cleaning up directly
romangg added inline comments.Sep 11 2018, 12:46 PM
src/server/remote_access_interface.cpp
216

True, is nicer.

romangg retitled this revision from [server] Fix remote access buffer handlig when output not bound to [server] Fix remote access buffer handling when output not bound.Sep 11 2018, 12:46 PM
romangg edited the summary of this revision. (Show Details)
romangg marked an inline comment as done.Sep 11 2018, 12:54 PM

Both versions solve issue I have and KWin no longer opens dozens of fds and abort when reaches the limit.

davidedmundson accepted this revision.Sep 11 2018, 1:25 PM
This revision is now accepted and ready to land.Sep 11 2018, 1:25 PM
romangg updated this revision to Diff 41422.Sep 11 2018, 3:28 PM

Add autotest. Needed larger refactoring to allow multiple clients with different outputs being bound.

romangg updated this revision to Diff 41423.Sep 11 2018, 3:32 PM
  • Some more cleanup of test.

At several places only one of two signal spies were waiting, what can lead to flickering tests.

Fixed this with an

if (spy.size() == 0) {
    spy.wait();
}

on the second spy. Is there a nicer solution?

This revision was automatically updated to reflect the committed changes.