Module: Mesa
Branch: main
Commit: 236da520f4251a5122976194ac247a36ce1f19ca
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=236da520f4251a5122976194ac247a36ce1f19ca

Author: José Roberto de Souza <jose.so...@intel.com>
Date:   Fri Sep  1 10:27:05 2023 -0700

intel/common/xe: Re implement xe_gem_read_render_timestamp() with 
xe_gem_read_correlate_cpu_gpu_timestamp()

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 <jose.so...@intel.com>
Reviewed-by: José Roberto de Souza <jose.so...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>

---

 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

Reply via email to