drm/xe: Save CTX_TIMESTAMP mmio value instead of LRC value
authorUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Fri, 9 May 2025 16:12:01 +0000 (09:12 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 14 May 2025 16:03:29 +0000 (09:03 -0700)
commit66c8f7b435bddb7d8577ac8a57e175a6cb147227
tree2ec91d5ce9edb88979a235f4b0387032823d6647
parent1b36ea2fc6879fed02b675e86867bc422b76f50e
drm/xe: Save CTX_TIMESTAMP mmio value instead of LRC value

For determining actual job execution time, save the current value of the
CTX_TIMESTAMP register rather than the value saved in LRC since the
current register value is the closest to the start time of the job.

v2: Define MI_STORE_REGISTER_MEM to fix compile error
v3: Place MI_STORE_REGISTER_MEM sorted by MI_INSTR (Lucas)

Fixes: 65921374c48f ("drm/xe: Emit ctx timestamp copy in ring ops")
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250509161159.2173069-6-umesh.nerlige.ramappa@intel.com
(cherry picked from commit 38b14233e5deff51db8faec287b4acd227152246)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/instructions/xe_mi_commands.h
drivers/gpu/drm/xe/xe_lrc.c
drivers/gpu/drm/xe/xe_ring_ops.c