Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/xe/query: Increase timestamp width
@ 2024-10-10  3:48 Lucas De Marchi
  2024-10-10  3:48 ` [PATCH 2/3] drm/xe/query: Move timestamp reg to hwe_read_timestamp() Lucas De Marchi
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Lucas De Marchi @ 2024-10-10  3:48 UTC (permalink / raw)
  To: intel-xe; +Cc: Umesh Nerlige Ramappa, Szymon Morek, Lucas De Marchi

Starting with Xe2 the timestamp is a full 64 bit counter, contrary to
the 36 bit that was available before. Although 36 should be sufficient
for any reasonable delta calculation (for Xe2, of about 30min), it's
surprising to userspace to get sommething truncated. Also if the
timestamp being compared to is coming from the GPU and the application
is not careful enough to apply the width there, a delta calculation
would be wrong.

Extend it to full 64-bits for non-media engines starting with Xe2.

Bspec: 60411
Cc: Szymon Morek <szymon.morek@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/xe_query.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 158629971eab3..a1f4cc25bea68 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -164,7 +164,11 @@ query_engine_cycles(struct xe_device *xe,
 			  cpu_clock);
 
 	xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
-	resp.width = 36;
+
+	if (!xe_gt_is_media_type(gt) && GRAPHICS_VER(xe) >= 20)
+		resp.width = 64;
+	else
+		resp.width = 36;
 
 	/* Only write to the output fields of user query */
 	if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-10-10 21:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10  3:48 [PATCH 1/3] drm/xe/query: Increase timestamp width Lucas De Marchi
2024-10-10  3:48 ` [PATCH 2/3] drm/xe/query: Move timestamp reg to hwe_read_timestamp() Lucas De Marchi
2024-10-10 10:03   ` Pottumuttu, Sai Teja
2024-10-10 13:24     ` Lucas De Marchi
2024-10-10 13:31       ` Pottumuttu, Sai Teja
2024-10-10  3:48 ` [PATCH 3/3] drm/xe/query: Tidy up error EFAULT returns Lucas De Marchi
2024-10-10  9:39   ` Pottumuttu, Sai Teja
2024-10-10  3:54 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe/query: Increase timestamp width Patchwork
2024-10-10  3:54 ` ✓ CI.checkpatch: " Patchwork
2024-10-10  3:56 ` ✓ CI.KUnit: " Patchwork
2024-10-10  4:07 ` ✓ CI.Build: " Patchwork
2024-10-10  4:08 ` [PATCH 1/3] " Lucas De Marchi
2024-10-10 17:10   ` Matt Roper
2024-10-10 18:28     ` Lucas De Marchi
2024-10-10 21:34       ` Matt Roper
2024-10-10  4:09 ` ✓ CI.Hooks: success for series starting with [1/3] " Patchwork
2024-10-10  4:11 ` ✓ CI.checksparse: " Patchwork
2024-10-10  4:30 ` ✗ CI.BAT: failure " Patchwork
2024-10-10 17:39 ` ✗ CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox