[Mesa-dev] [PATCH 0/3] Add MESA_query_timestamp extension (v2)

Keith Packard keithp at keithp.com
Tue Jul 10 00:35:27 UTC 2018

Here's an updated version of the extension to get GPU timestamps. This
version returns both CPU and GPU timestamps which could (in theory) be
more tightly correlated than just getting the time of one and then the
other sequentially. The idea is that we'd eventually add a suitable
kernel ioctl to get both.

The implementation is complicated by needing to allow WSI layers to
have different timebases; the drivers now get CLOCK_MONOTONIC and GPU
timestamps and then let the current WSI layer convert the
CLOCK_MONOTONIC value into a suitable WSI-relative value. In the
current code, all of the WSI layers are using CLOCK_MONOTONIC and so
they don't actually use this functionality, but it's available in case
it's needed.

Neither radv nor anv bother to try and align the clocks closely; that
would involve some fancy code to fetch the clocks multiple times, and
I'd rather spend time just fixing the kernel rather than adding
kludges in user space.

More information about the mesa-dev mailing list