From: Chia-I Wu Date: Tue, 23 Aug 2022 01:15:24 +0000 (-0700) Subject: turnip: improve perfetto sync_timestamp X-Git-Tag: upstream/22.3.5~4267 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91a0411d2ab03d32f3fdd1fa7969ee908dbdda85;p=platform%2Fupstream%2Fmesa.git 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: --- diff --git a/src/freedreno/vulkan/tu_perfetto.cc b/src/freedreno/vulkan/tu_perfetto.cc index 86c5479..a189825 100644 --- a/src/freedreno/vulkan/tu_perfetto.cc +++ b/src/freedreno/vulkan/tu_perfetto.cc @@ -189,10 +189,15 @@ sync_timestamp(struct tu_device *dev) if (cpu_ts < next_clock_sync_ns) 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"); 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; /* If we fail to get it we will use a fallback */