Merge lp://staging/~vanvugt/mir/remove-input-resampling-standalone into lp://staging/mir
- remove-input-resampling-standalone
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3949 |
Proposed branch: | lp://staging/~vanvugt/mir/remove-input-resampling-standalone |
Merge into: | lp://staging/mir |
Diff against target: |
522 lines (+48/-274) 7 files modified
examples/fingerpaint.c (+0/-6) examples/target.c (+0/-6) src/client/input/android/android_input_receiver.cpp (+26/-98) src/client/input/android/android_input_receiver.h (+3/-12) tests/acceptance-tests/test_client_input.cpp (+0/-64) tests/acceptance-tests/test_confined_pointer.cpp (+0/-1) tests/unit-tests/client/input/test_android_input_receiver.cpp (+19/-87) |
To merge this branch: | bzr merge lp://staging/~vanvugt/mir/remove-input-resampling-standalone |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Andreas Pokorny (community) | Approve | ||
Alan Griffiths | Abstain | ||
Chris Halse Rogers | Approve | ||
Review via email: mp+314305@code.staging.launchpad.net |
Commit message
Remove input resampling, finally.
Input events now get delivered from the kernel (via AndroidInput which we
can now retire) to clients without any resampling delay. That was [0,16.9]ms or an average of 8.4ms before, but is now around 0.2ms.
This fixes LP: #1570698 and LP: #1576600. Probably LP: #1394369 too.
Description of the change
I had believed until recently that we would need to land client-side vsync
before we could do this. However I have now invented a simpler
prerequisite which allows Mir to drop input resampling immediately:
lp:~vanvugt/unity8/fix-1497105
Mir CI Bot (mir-ci-bot) wrote : | # |
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1616312
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3911
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Chris Halse Rogers (raof) wrote : | # |
The AndroidInputRec
I'm weakly against the change to dispatch multiple events in a single process_
When client-driven dispatch is available clients are going to expect to get a single event out of a single dispatch call.
**** So: ****
*) Rename or remove AndroidInputRec
*) Don't loop in process_
Optional:
*) Maybe rename process_
*) Test that you get at most one event sent per dispatch() on the AndroidInputRec
Daniel van Vugt (vanvugt) wrote : | # |
I knew you would say that. Unfortunately I did try exactly what you suggested as a first choice and it seemed broken (either was no longer readable or the Dispatchable ignored wakeups). Will need to dig deeper now to find out why...
Chris Halse Rogers (raof) wrote : | # |
Curious. MultiplexingDis
edge) triggering, the socket is SEQPACKET, so there's guaranteed to
only be whole events there, and consume() looks like it should only eat
one...
Andreas Pokorny (andreas-pokorny) wrote : | # |
> Curious. MultiplexingDis
> edge) triggering, the socket is SEQPACKET, so there's guaranteed to
> only be whole events there, and consume() looks like it should only eat
> one...
I think thats what the second parameter "consumeBatches" does .. passing false there should help.
Daniel van Vugt (vanvugt) wrote : | # |
No, consumeBatches should always be true now. We don't batch anything and want clients to receive all events immediately.
It was just our tests were overly simplistic and not able to consume wake notifications when they dispatch(), leaving the fd readable indefinitely. So it was just a problem with the tests. But instead of modifying the tests too much I have reworked the semaphore logic to deal with the simplistic test expectations so that dispatch() can also drain wake()'s.
Chris Halse Rogers (raof) wrote : | # |
On 10 Jan. 2017 18:30, Andreas Pokorny <email address hidden> wrote:
>
> > Curious. MultiplexingDis
> > edge) triggering, the socket is SEQPACKET, so there's guaranteed to
> > only be whole events there, and consume() looks like it should only eat
> > one...
>
> I think thats what the second parameter "consumeBatches" does .. passing false there should help.
Actually, I think it no longer matters what value use for consumeBatches - because we pass in a frame time of -1, I'm pretty sure we never generate any batches.
(Relatedly, I think this means we can delete almost all of AndroidInput)
Andreas Pokorny (andreas-pokorny) wrote : | # |
iirc conumeBatches = true means that we read stuff from the socket without handing it out to the caller.. So we need to wake() the consuming thread again.
I am a bit confused now. Is the intention to remove batching and resampling, or just resampling?
Last time I wallowed in that code resampling only affected touch motion and not pointer movement, so this will only affect that X11-Mouse behavior if we also drop batching.
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3915
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Andreas Pokorny (andreas-pokorny) wrote : | # |
Ah this MP also removes the timer fd! So it will affect the frequency of mouse events.
Then using false instead of true for consumeBatches should actually not drain the input channel fd. I assume it would be simpler to just serialize the MirEvent into a buffer in BasicSurface:
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3916
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
CI failures are bug 1655293 and bug 1639941. Is this branch aggravating those?...
Daniel van Vugt (vanvugt) wrote : | # |
Also bug 1646558.
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3917
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3920
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1646375
Chris Halse Rogers (raof) wrote : | # |
LGTM, thanks.
I continue to be surprised that the FD doesn't remain readable if there's still an event left after consume(), and we'll be woken up once more than is strictly necessary, but this is fine.
Chris Halse Rogers (raof) wrote : | # |
+ if (read(wake_fd, &dummy, sizeof(dummy)) != sizeof(dummy) &&
+ errno != EAGAIN)
Hm, now that I look at this again, I think you might be missing && errno != EINTR?
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3925
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1649758
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3927
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1523621
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3928
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel van Vugt (vanvugt) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3929
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Alan Griffiths (alan-griffiths) wrote : | # |
Alan Griffiths (alan-griffiths) wrote : | # |
I don't feel I understand this code well enough to have an opinion. (Would like to hear from Andreas.)
Andreas Pokorny (andreas-pokorny) wrote : | # |
I am in favor of this change - my only opinions here are that we could simplify more... Each further step raises the question - do we want to send input related MirEvents through the "normal" MirConnection fd?
From personal use on the phone I prefer not having the resampling, and also activate a different cpu frequency governor - so from that pov I am not concerned about removing the resampling..
But we can do that in a later MP.
Andreas Pokorny (andreas-pokorny) wrote : | # |
Poor editing of my last review comment, lead to some confusion. By "that" I meant the removal of the remaining android input parts and using the fd of the session.
Mir CI Bot (mir-ci-bot) : | # |
FAILED: Continuous integration, rev:3910 /mir-jenkins. ubuntu. com/job/ mir-ci/ 2569/ /mir-jenkins. ubuntu. com/job/ build-mir/ 3347/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/3414 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 3406 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 3406 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 3406 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 3376 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 3376/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3376 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3376/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 3376/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 3376 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 3376/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 3376 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 3376/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3376 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3376/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 2569/rebuild
https:/