mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
turnip: improve perfetto sync_timestamp
tu_device_get_gpu_timestamp takes >100us on my otherwise idle sc7180. Read the cpu block again after the call returns. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18238>
This commit is contained in:
parent
ce0e13155d
commit
91a0411d2a
1 changed files with 7 additions and 2 deletions
|
|
@ -189,10 +189,15 @@ sync_timestamp(struct tu_device *dev)
|
||||||
if (cpu_ts < next_clock_sync_ns)
|
if (cpu_ts < next_clock_sync_ns)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (tu_device_get_gpu_timestamp(dev, &gpu_ts)) {
|
if (tu_device_get_gpu_timestamp(dev, &gpu_ts)) {
|
||||||
PERFETTO_ELOG("Could not sync CPU and GPU clocks");
|
PERFETTO_ELOG("Could not sync CPU and GPU clocks");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get cpu timestamp again because tu_device_get_gpu_timestamp can take
|
||||||
|
* >100us
|
||||||
|
*/
|
||||||
|
cpu_ts = perfetto::base::GetBootTimeNs().count();
|
||||||
|
|
||||||
uint64_t current_suspend_count = 0;
|
uint64_t current_suspend_count = 0;
|
||||||
/* If we fail to get it we will use a fallback */
|
/* If we fail to get it we will use a fallback */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue