Skip to content

Commit 9d559cd

Browse files
committed
drm/xe/query: Increase timestamp width
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 something 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 starting with Xe2. v2: Expand width=64 to media gt, as it's just a wrong tagging in the spec - empirical tests show it goes beyond 36 bits and match the engines for the main gt Bspec: 60411 Cc: Szymon Morek <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent b8b1163 commit 9d559cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/xe/xe_query.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ query_engine_cycles(struct xe_device *xe,
164164
cpu_clock);
165165

166166
xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
167-
resp.width = 36;
167+
168+
if (GRAPHICS_VER(xe) >= 20)
169+
resp.width = 64;
170+
else
171+
resp.width = 36;
168172

169173
/* Only write to the output fields of user query */
170174
if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))

0 commit comments

Comments
 (0)