]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Avoid toggling schedule state to check LRC timestamp in TDR
authorMatthew Brost <matthew.brost@intel.com>
Sat, 10 Jan 2026 01:27:39 +0000 (17:27 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Sat, 10 Jan 2026 21:39:52 +0000 (13:39 -0800)
commitbb63e7257e6341aa1e48da07b13d2d00fd899fb3
tree287c84ebc3925677bbe79a0c50ad4da386bc1dc4
parentefffd56e4bd894e0935eea00e437f233b6cebc0d
drm/xe: Avoid toggling schedule state to check LRC timestamp in TDR

We now have proper infrastructure to accurately check the LRC timestamp
without toggling the scheduling state for non-VFs. For VFs, it is still
possible to get an inaccurate view if the context is on hardware. We
guard against free-running contexts on VFs by banning jobs whose
timestamps are not moving. In addition, VFs have a timeslice quantum
that naturally triggers context switches when more than one VF is
running, thus updating the LRC timestamp.

For multi-queue, it is desirable to avoid scheduling toggling in the TDR
because this scheduling state is shared among many queues. Furthermore,
this change simplifies the GuC state machine. The trade-off for VF cases
seems worthwhile.

v5:
 - Add xe_lrc_timestamp helper (Umesh)
v6:
 - Reduce number of tries on stuck timestamp (VF testing)
 - Convert job timestamp save to a memory copy (VF testing)
v7:
 - Save ctx timestamp to LRC when start VF job (VF testing)

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://patch.msgid.link/20260110012739.2888434-8-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c
drivers/gpu/drm/xe/xe_lrc.c
drivers/gpu/drm/xe/xe_lrc.h
drivers/gpu/drm/xe/xe_ring_ops.c
drivers/gpu/drm/xe/xe_sched_job.c
drivers/gpu/drm/xe/xe_sched_job_types.h