Merge lp:~vanvugt/mir/output-event-refreshrate into lp:mir
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3738 |
Proposed branch: | lp:~vanvugt/mir/output-event-refreshrate |
Merge into: | lp:mir |
Prerequisite: | lp:~vanvugt/mir/not-26-yet |
Diff against target: |
348 lines (+81/-8) 15 files modified
examples/eglapp.c (+3/-2) include/client/mir/events/event_builders.h (+1/-0) include/client/mir_toolkit/events/surface_output_event.h (+11/-0) src/client/event.cpp (+6/-0) src/client/events/event_builders.cpp (+2/-0) src/client/symbols.map (+1/-0) src/common/events/surface_output_event.cpp (+10/-0) src/common/symbols.map (+2/-0) src/include/common/mir/events/surface_output_event.h (+6/-0) src/server/scene/application_session.cpp (+1/-0) src/server/scene/output_properties_cache.cpp (+1/-0) src/server/scene/output_properties_cache.h (+1/-0) src/server/scene/surface_event_source.cpp (+1/-0) tests/acceptance-tests/test_client_surface_events.cpp (+22/-3) tests/unit-tests/scene/test_application_session.cpp (+13/-3) |
To merge this branch: | bzr merge lp:~vanvugt/mir/output-event-refreshrate |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Chris Halse Rogers | Disapprove | ||
Cemil Azizoglu (community) | Approve | ||
Kevin DuBois (community) | Approve | ||
Review via email: mp+307293@code.launchpad.net |
Commit message
Add refresh rate to MirSurfaceOutpu
Description of the change
FAQ:
* Why?
Two reasons at least. First and foremost, in future when libmirclient
is doing its own vsync throttling, just knowing the timestamp of the
last vsync isn't enough. That only gives you the correct phase
information. Even if you observe multiple prior vsyncs that still
won't tell you the maximum refresh rate of the display if your
previous frames were not fast, and we need to know the maximum rate to
calculate the correct minimal vsync interval so the client can catch
up to the full rate of the display.
Secondly, this gives libmirclient the correct frequency information
it needs to do accurate touch resampling and remove the 59Hz hack.
* So clients can do their own vsync now?
Yes and no. You could use the refresh rate right now in a sleep and
implement your own vsync that is immune to nesting lag.
That's great, but it would be without the display vsync timing
(not wired up with IPC yet) to provide the correct phase. So yes,
you can use this refresh rate value for your vsync and solve most of
the lag problem now, but no it's not yet the optimal solution (up to
one frame extra lag) until we also have the vsync phase information
from the server.
* Why not just query the display config?
That would be more heavy-weight than this approach, and less
consistent with the current API. But more importantly we need these
summary mir_surface_
support the possibility that the "output" being described is actually
just a summary of multiple different physical outputs' attributes.
* Is a double precise enough to do our own frame timing?
Well, it's all the accuracy we can get right now. But later when
we've got the vsync phase information too, the precision of the
refresh_rate value won't matter as much because it will get
autocorrected with the phase timestamp on each frame. So then we won't
need much precision from the refresh_rate value in the end.
* The MSC used in conjuction with UST surely provides this info?
Indeed that used to be true for fixed framerate displays, but the old
equation of (delta(
GSync and FreeSync. You need to know the best case refresh rate,
which that equation does not tell you any more.
* What's MSC and UST?
See the 'physical-frame' branch.
* Why add a public client API function?
Strictly speaking it won't be necessary as the refresh rate
information will only be required internally by libmirclient. But
right now it's proving handy for testing to add this one new public
function.
PASSED: Continuous integration, rev:3737 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1859/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2354 /mir-jenkins. ubuntu. com/job/ build-0- fetch/2417 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2409 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2409 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2409 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2383/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2383/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2383/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 2383/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2383/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2383 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2383/artifact/ output/ *zip*/output. zip
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: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1859/rebuild
https:/