Skip to content

kms/impl-device: Don't skip set_needs_flush during a page flip

Daniel van Vugt requested to merge vanvugt/mutter:dont-skip-needs-flush into main

If the deadline timer is disabled (like on nvidia-drm or when MUTTER_DEBUG_KMS_THREAD_TYPE=user), then we need to call meta_kms_device_set_needs_flush on every cursor movement. But some were getting skipped if they coincided with page flips, which resulted in some cursor movements failing to schedule the frame clock. This resulted in unnecessary levels of frame skips when using lower frequency input devices which are less likely to provide another event within the same frame period.

Closes: #3002 (closed)

Before:

Clutter-Message: 18:10:07.830: [         +367602]:[FRAME_TIMINGS]: dispatch jitter 15348µs ( 92%)
Clutter-Message: 18:10:07.846: [         +383568]:[FRAME_TIMINGS]: update2dispatch 55 µs
Clutter-Message: 18:10:07.846: [         +383817]:[FRAME_TIMINGS]: dispatch jitter 15720µs ( 94%)
Clutter-Message: 18:10:07.854: [         +391106]:[FRAME_TIMINGS]: dispatch jitter  8933µs ( 53%)
Clutter-Message: 18:10:07.863: [         +400277]:[FRAME_TIMINGS]: update2dispatch 84 µs
Clutter-Message: 18:10:07.864: [         +401625]:[FRAME_TIMINGS]: dispatch jitter  3250µs ( 19%)
Clutter-Message: 18:10:07.879: [         +416909]:[FRAME_TIMINGS]: update2dispatch 65 µs
Clutter-Message: 18:10:07.880: [         +417158]:[FRAME_TIMINGS]: dispatch jitter  5012µs ( 30%)
Clutter-Message: 18:10:07.888: [         +425060]:[FRAME_TIMINGS]: dispatch jitter  7648µs ( 45%)
Clutter-Message: 18:10:07.896: [         +433608]:[FRAME_TIMINGS]: update2dispatch 82 µs
Clutter-Message: 18:10:07.900: [         +437072]:[FRAME_TIMINGS]: dispatch jitter  4124µs ( 24%)
Clutter-Message: 18:10:07.913: [         +450248]:[FRAME_TIMINGS]: update2dispatch 80 µs
Clutter-Message: 18:10:07.913: [         +450496]:[FRAME_TIMINGS]: dispatch jitter  1420µs (  8%)
Clutter-Message: 18:10:07.930: [         +467007]:[FRAME_TIMINGS]: dispatch jitter  3064µs ( 18%)
Clutter-Message: 18:10:07.946: [         +483094]:[FRAME_TIMINGS]: update2dispatch 247 µs

After:

Clutter-Message: 18:11:51.103: [         +366703]:[FRAME_TIMINGS]: update2dispatch 85 µs
Clutter-Message: 18:11:51.103: [         +366983]:[FRAME_TIMINGS]: dispatch jitter    22µs (  0%)
Clutter-Message: 18:11:51.120: [         +383433]:[FRAME_TIMINGS]: update2dispatch 90 µs
Clutter-Message: 18:11:51.120: [         +383668]:[FRAME_TIMINGS]: dispatch jitter    14µs (  0%)
Clutter-Message: 18:11:51.136: [         +400015]:[FRAME_TIMINGS]: update2dispatch 88 µs
Clutter-Message: 18:11:51.137: [         +400374]:[FRAME_TIMINGS]: dispatch jitter    24µs (  0%)
Clutter-Message: 18:11:51.153: [         +416759]:[FRAME_TIMINGS]: update2dispatch 219 µs
Clutter-Message: 18:11:51.153: [         +416990]:[FRAME_TIMINGS]: dispatch jitter    98µs (  0%)
Clutter-Message: 18:11:51.170: [         +433423]:[FRAME_TIMINGS]: update2dispatch 86 µs
Clutter-Message: 18:11:51.170: [         +433793]:[FRAME_TIMINGS]: dispatch jitter   194µs (  1%)
Clutter-Message: 18:11:51.186: [         +449843]:[FRAME_TIMINGS]: update2dispatch 226 µs
Clutter-Message: 18:11:51.186: [         +450076]:[FRAME_TIMINGS]: dispatch jitter   526µs (  3%)
Clutter-Message: 18:11:51.203: [         +466792]:[FRAME_TIMINGS]: update2dispatch 86 µs
Clutter-Message: 18:11:51.203: [         +467026]:[FRAME_TIMINGS]: dispatch jitter   669µs (  4%)
Clutter-Message: 18:11:51.220: [         +483382]:[FRAME_TIMINGS]: update2dispatch 89 µs
Edited by Daniel van Vugt

Merge request reports