Question: what clock is the vblank timestamp based on? can I relate it to what's returned from clock_gettime?
A quick skim over the code seems to suggest it's the monotonic clock. But when I try to relate it to the monotonic time I get from user space, I sometimes see that the vblank time is in the future. Specifically I get Present Complete Notify from X, and immediately after receiving that I compare the timestamp there to clock_gettime(CLOCK_MONOTONIC)
. I myself often see vblank timestamps ~40us into the future, but from logs I collected from other users, vblank time can be as far as 500us into the future.
What I want to know is whether I can use the vblank timestamps and CLOCK_MONOTONIC
to predict how far in the future the start of the next vblank (and/or scanout) will be. And if yes, how do I account for this difference.
Edited by yshui