Merge lp:~kdub/mir/report-vsync into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Kevin DuBois on 2015-03-04 |
| Approved revision: | 2374 |
| Merged at revision: | 2361 |
| Proposed branch: | lp:~kdub/mir/report-vsync |
| Merge into: | lp:mir |
| Diff against target: |
782 lines (+228/-89) 26 files modified
src/include/platform/mir/graphics/display_report.h (+2/-0) src/platforms/android/server/display.cpp (+9/-1) src/platforms/android/server/display.h (+2/-0) src/platforms/android/server/fb_device.cpp (+3/-1) src/platforms/android/server/fb_device.h (+3/-1) src/platforms/android/server/hwc_blanking_control.cpp (+4/-3) src/platforms/android/server/hwc_configuration.h (+6/-2) src/platforms/mesa/server/display.cpp (+1/-1) src/platforms/mesa/server/kms_page_flipper.cpp (+19/-10) src/platforms/mesa/server/kms_page_flipper.h (+5/-2) src/server/report/logging/display_report.cpp (+26/-1) src/server/report/logging/display_report.h (+24/-13) src/server/report/logging/logging_report_factory.cpp (+1/-1) src/server/report/lttng/display_report.cpp (+2/-6) src/server/report/lttng/display_report.h (+10/-11) src/server/report/lttng/display_report_tp.h (+9/-0) src/server/report/null/display_report.cpp (+1/-0) src/server/report/null/display_report.h (+1/-0) tests/include/mir_test_doubles/mock_display_report.h (+1/-2) tests/include/mir_test_doubles/stub_display_builder.h (+5/-4) tests/unit-tests/graphics/android/test_display.cpp (+26/-4) tests/unit-tests/graphics/android/test_display_hotplug.cpp (+3/-3) tests/unit-tests/graphics/android/test_hwc_configuration.cpp (+13/-7) tests/unit-tests/graphics/mesa/test_display.cpp (+5/-4) tests/unit-tests/graphics/mesa/test_kms_page_flipper.cpp (+20/-1) tests/unit-tests/logging/test_display_report.cpp (+27/-11) |
| To merge this branch: | bzr merge lp:~kdub/mir/report-vsync |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Approve on 2015-03-04 | |
| Robert Carr (community) | Approve on 2015-03-04 | ||
| Alan Griffiths | Approve on 2015-03-04 | ||
| Andreas Pokorny (community) | Approve on 2015-03-04 | ||
| Alexandros Frantzis (community) | Approve on 2015-03-04 | ||
| Daniel van Vugt | 2015-03-02 | Abstain on 2015-03-03 | |
|
Review via email:
|
|||
Commit Message
graphics: add a report_vsync method for android and mesa in mg::DisplayReport with logging, null, and lttng implementations of function.
Description of the Change
graphics: add a report_vsync method for android and mesa in mg::DisplayReport with logging, null, and lttng implementations of function.
| Daniel van Vugt (vanvugt) wrote : | # |
Suggest "needs fixing", but not strictly.
(1) The name arguably needs fixing because "vsync" is not an event. The two events are (a) vblank and then (about 50-60 microseconds later); (b) page flip completed. Although not all platforms will implement it as a "page flip" so the generic term we invented "post" could be used.
(2) These two equivalent reporting points would be less confusing if unified:
180 /* If the page flip we are waiting for has arrived we are done. */
181 if (page_flip_
182 + {
183 + report-
184 return;
185 + }
186
187 /* ...otherwise we become the worker */
188 worker_tid = std::this_
189 @@ -140,6 +146,7 @@
190 */
191 pf_cv.notify_all();
192 }
193 + report-
You can do this by making ::page_flip_handler call a new `KMSPageFlipper
This is fresh in my mind as I spent much of the past few days hacking this code :)
| Daniel van Vugt (vanvugt) wrote : | # |
(1) Whoops, don't call it "post". "post" is the push event at the back of the DisplayBuffer's queue, whereas you're actually measuring the pop from the front. So yeah call it "vsync" if not "scan-out" etc.
| Alan Griffiths (alan-griffiths) wrote : | # |
45 + display_
The report interfaces shouldn't force any unnecessary object creation. (Like creating a string here.) In practice we've got an int - so can't we pass that and stream that to output only if reporting?
- 2367. By Kevin DuBois on 2015-03-03
-
improve vsync notification by having the page_flip_handler call the report object
- 2368. By Kevin DuBois on 2015-03-03
-
merge mir
- 2369. By Kevin DuBois on 2015-03-03
-
small whitespace cleanups
- 2370. By Kevin DuBois on 2015-03-03
-
accept an int instead of a string as the report_vsync parameter
| Kevin DuBois (kdub) wrote : | # |
@Daniel,
1) seems like were keeping report_vsync() then?
2) good idea, we now call the report from the pageflip callback.
@Alan, corrected to take an int as a display id.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2370
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 2371. By Kevin DuBois on 2015-03-03
-
correct when the notification happens to correct valgrind error
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2371
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
Looks like a transient error:
subprocess.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2371
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Daniel van Vugt (vanvugt) wrote : | # |
(3) You don't need to pass pending_page_flips into the callback any more. Just do the erase in notify_page_flip instead...
156 + page_flip_
157 page_flip_
~~
180 - pending_
181 + pending_
(4) The timing is slightly off, but it's probably negligible. The report will be called after the actual page flip happened, because we're calling it from our wait function which could be anything up to a frame later than when the flip "vsync" occurred. To get accurate timings into the report, use the (presently unused) timestamp parameters in the page flip callback (which is a kernel timestamp relative to CLOCK_MONOTONIC). Although the complexity this creates might be worse than any inaccuracies in the current approach. It's also platform-specific unless you convert between clocks. So maybe not...
| Alan Griffiths (alan-griffiths) wrote : | # |
OK
One thought though...
239 +void mrl::DisplayRep
240 +{
241 + logger-
242 +}
...is the raw "vsync event on [...]" log message useful or should the report be collating statistical information?
| Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
> (3) You don't need to pass pending_page_flips into the callback any more.
+1 but not a blocker
| Andreas Pokorny (andreas-pokorny) wrote : | # |
looks good, yes and agree.. that might be to much spam to be interesting. I think it might also be fine to just omit it for now, until we figure out what information might be worth interpreting.
- 2372. By Kevin DuBois on 2015-03-04
-
erase the pending_page_flips from within a member function of KMSPageFlipper
- 2373. By Kevin DuBois on 2015-03-04
-
collate the incoming vsync data for the DisplayReport
| Kevin DuBois (kdub) wrote : | # |
(3) is a good improvement, added to this branch
(4) true, although I think it would be neglible as well (I'm interested in hundreds-
Also collated the vsync data so it would be reported at most once per second.
| Kevin DuBois (kdub) wrote : | # |
> (3) is a good improvement, added to this branch
> (4) true, although I think it would be neglible as well (I'm interested in
> hundreds-
>
> Also collated the vsync data so it would be reported at most once per second.
example output:
[1425479039.147480] graphics: 42 vsync events on [0] over 1004ms
[1425479040.148487] graphics: 60 vsync events on [0] over 1001ms
[1425479041.149372] graphics: 60 vsync events on [0] over 1000ms
| Alan Griffiths (alan-griffiths) wrote : | # |
263 + event_map[
264 + if (now > last_report + report_interval)
265 + {
266 + for(auto const& event : event_map)
267 + logger-
268 + std::to_
269 + std::to_
270 + std::to_
271 + component());
272 + event_map.clear();
273 + last_report = now;
274 + }
Needs a mutex & lock
- 2374. By Kevin DuBois on 2015-03-04
-
guard the collated vsync reporting with a lock
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2373
http://
Executed test runs:
None: http://
None: http://
Click here to trigger a rebuild:
http://
| Kevin DuBois (kdub) wrote : | # |
^^manually cancelled
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2374
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://

PASSED: Continuous integration, rev:2366 jenkins. qa.ubuntu. com/job/ mir-ci/ 3109/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/1479 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/1478 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/1433 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1106 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1106/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1433 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1433/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/4453 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 18490
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3109/ rebuild
http://