wsi/wayland/perfetto: supply presentation clock to perfetto
What does this MR do and why?
wsi/wayland/perfetto: supply presentation clock to perfetto
Perfetto is allowed to choose it's own default clock, and before this we just assumed the presentation times reported by the compositor are the same as perfetto's internal clock, which is not always the case. I got a nasty trace where all the wayland presents were in the wrong location. This fixes that by asking the compositor which clock it uses, then passing that along to perfetto.
A workaround for my compositor was setting use_monotonic_clock=true in the perfetto config, as my compositor (and I suspect most others) use the monotonic clock for presentation timestamps. However, asking the compositor is definitely the most correct solution.
I added a clock param to MESA_TRACE_TIMESTAMP_{BEGIN,END}
, as it's only use that I could see was in wsi_common_wayland, and in general it seems good to be careful about which clock tracing timestamps come from.
I'm new to contributing to mesa and also new to wayland internals, so apologies if I did something a strange way.