From 236da520f4251a5122976194ac247a36ce1f19ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 1 Sep 2023 10:27:05 -0700 Subject: [PATCH] intel/common/xe: Re implement xe_gem_read_render_timestamp() with xe_gem_read_correlate_cpu_gpu_timestamp() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the removal of DRM_IOCTL_XE_MMIO xe_gem_read_render_timestamp() was always returning false but with DRM_XE_DEVICE_QUERY_ENGINE_CYCLES it can be re implemented making use of xe_gem_read_correlate_cpu_gpu_timestamp(). Signed-off-by: José Roberto de Souza Reviewed-by: José Roberto de Souza Part-of: --- src/intel/common/xe/intel_gem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/common/xe/intel_gem.c b/src/intel/common/xe/intel_gem.c index f5aff725379..dfe061ea9bb 100644 --- a/src/intel/common/xe/intel_gem.c +++ b/src/intel/common/xe/intel_gem.c @@ -30,8 +30,11 @@ bool xe_gem_read_render_timestamp(int fd, uint64_t *value) { - /* TODO: re-implement with DRM_XE_QUERY_CS_CYCLES */ - return false; + UNUSED uint64_t cpu; + + return xe_gem_read_correlate_cpu_gpu_timestamp(fd, INTEL_ENGINE_CLASS_RENDER, + 0, CLOCK_MONOTONIC, &cpu, + value, NULL); } bool