Merge lp:~vanvugt/mir/latency-acceptance-test-2 into lp:~kdub/mir/latency-acceptance-test
Proposed by
Daniel van Vugt
Status: | Merged |
---|---|
Merged at revision: | 2344 |
Proposed branch: | lp:~vanvugt/mir/latency-acceptance-test-2 |
Merge into: | lp:~kdub/mir/latency-acceptance-test |
Diff against target: |
77 lines (+22/-5) 1 file modified
tests/acceptance-tests/test_latency.cpp (+22/-5) |
To merge this branch: | bzr merge lp:~vanvugt/mir/latency-acceptance-test-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kevin DuBois | Approve | ||
Alberto Aguirre (community) | Approve | ||
Review via email: mp+251555@code.launchpad.net |
This proposal supersedes a proposal from 2015-02-27.
Commit message
Avoid racing for post_count. Update it in a place where the threads are not racing. This way when we sample it in the client thread, it actually represents the client render time more accurately (one higher than previously).
To post a comment you must log in.
68 + auto lag_post_to_eye = hardware_ framebuffers - 1;
You are assuming the hardware and/or driver actually prime an internal queue. That may or may not be the case. We certainly don't prime the display buffer queue within Mir.
I think the most salient point is that the extra latency varies depending on when your flip call lands. Best case you flip right before the start of scanout (so no flip wait) and worst case you just barely missed the deadline so you wait an extra vsync period (basically due to FIFO underflow).
So the latency is bounded by 1 < latency < 2.
This is why it's helpful to know where in the scan-out the hardware currently is - that could help eliminate 1 vsync_period of lag by using the newest frame (the tradeoff being judder) - However, I'm not sure all HW supports such option.
=== ClientLatency, double_buffered)
TEST_F(
===
This is not a report. The test name should indicate some sort of expectation.
== framebuffers - 1; push_back( total_lag) ;
64 + if (it != timestamps.end())
65 + {
66 + auto render_time = it->second;
67 + auto lag_client_to_post = post_count - render_time;
68 + auto lag_post_to_eye = hardware_
69 + auto total_lag = lag_client_to_post + lag_post_to_eye;
70 +
71 + latency.
72 + }
===
Maybe the timestamp should be removed from the map at the end of this scope?
=== LT(expected_ latency- error_margin, observed_latency); GT(expected_ latency+ error_margin, observed_latency);
98 + EXPECT_
99 + EXPECT_
==
I prefer EXPECT_THAT, reads like English that way.