mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
intel/ds: use improved timestamp correlation if available
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
This commit is contained in:
parent
b2bf141b6a
commit
feae70f608
1 changed files with 11 additions and 4 deletions
|
|
@ -130,10 +130,17 @@ static void
|
|||
sync_timestamp(IntelRenderpassDataSource::TraceContext &ctx,
|
||||
struct intel_ds_device *device)
|
||||
{
|
||||
uint64_t cpu_ts = perfetto::base::GetBootTimeNs().count();
|
||||
uint64_t gpu_ts;
|
||||
intel_gem_read_render_timestamp(device->fd, device->info.kmd_type,
|
||||
&gpu_ts);
|
||||
uint64_t cpu_ts, gpu_ts;
|
||||
|
||||
if (!intel_gem_read_correlate_cpu_gpu_timestamp(device->fd,
|
||||
device->info.kmd_type,
|
||||
INTEL_ENGINE_CLASS_RENDER, 0,
|
||||
CLOCK_BOOTTIME,
|
||||
&cpu_ts, &gpu_ts, NULL)) {
|
||||
cpu_ts = perfetto::base::GetBootTimeNs().count();
|
||||
intel_gem_read_render_timestamp(device->fd, device->info.kmd_type,
|
||||
&gpu_ts);
|
||||
}
|
||||
gpu_ts = intel_device_info_timebase_scale(&device->info, gpu_ts);
|
||||
|
||||
if (cpu_ts < device->next_clock_sync_ns)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue