Skip to content

Fence deadlines in Xe

Matthew Brost dri-devel intel-gfx intel-xe llvm oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest22 patches 4 repliesIn review
  2. v1 RFC13 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fully implemented deadline manager
- Separate frequency and priority boost windows
- Enable deadlines in Intel display

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22drm/xe: Add dedicated message lockdrivers/gpu/drm/xe/xe_gpu_scheduler.c drivers/gpu/drm/xe/xe_gpu_scheduler.h drivers/gpu/drm/xe/xe_gpu_scheduler_types.h+7 -40 replies
2/22drm/xe: Add EXEC_QUEUE_FLAG_CAP_SYS_NICEdrivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_exec_queue_types.h+5 -01 reply
3/22drm/xe: Store exec queue in hardware fencedrivers/gpu/drm/xe/xe_hw_fence.c drivers/gpu/drm/xe/xe_hw_fence.h drivers/gpu/drm/xe/xe_hw_fence_types.h +3 more+17 -61 reply
4/22drm/xe: Add deadline exec queue vfuncsdrivers/gpu/drm/xe/xe_exec_queue_types.h+9 -01 reply
5/22drm/xe: Export to_xe_hw_fencedrivers/gpu/drm/xe/xe_hw_fence.c drivers/gpu/drm/xe/xe_hw_fence.h+10 -30 replies
6/22drm/xe: Export xe_hw_fence_signaleddrivers/gpu/drm/xe/xe_hw_fence.c drivers/gpu/drm/xe/xe_hw_fence.h+9 -10 replies
7/22drm/xe: Implement deadline managerdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/xe_deadline_mgr.c drivers/gpu/drm/xe/xe_deadline_mgr.h +3 more+451 -00 replies
8/22drm/xe: Initialize deadline manager on exec queuesdrivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_exec_queue_types.h+12 -00 replies
9/22drm/xe: Stub out execlists deadline vfuncs as NOPsdrivers/gpu/drm/xe/xe_execlist.c+15 -00 replies
10/22drm/xe: Make scheduler message lock IRQ-safedrivers/gpu/drm/xe/xe_gpu_scheduler.c drivers/gpu/drm/xe/xe_gpu_scheduler.h drivers/gpu/drm/xe/xe_guc_submit.c+32 -360 replies
11/22drm/xe: Support unstable opcodes for static scheduler messagesdrivers/gpu/drm/xe/xe_gpu_scheduler.c drivers/gpu/drm/xe/xe_gpu_scheduler_types.h drivers/gpu/drm/xe/xe_guc_submit.c+11 -60 replies
12/22drm/xe: Implement GuC submission backend ops for deadlinesdrivers/gpu/drm/xe/xe_guc_exec_queue_types.h drivers/gpu/drm/xe/xe_guc_submit.c drivers/gpu/drm/xe/xe_sched_job.c+126 -120 replies
13/22drm/xe: Enable deadlines on hardware fencesdrivers/gpu/drm/xe/xe_hw_fence.c+13 -00 replies
14/22drm/xe: Fix Kconfig.profile newlinesdrivers/gpu/drm/xe/Kconfig.profile+7 -01 reply
15/22drm/xe: Add deadline Kconfig optionsdrivers/gpu/drm/xe/Kconfig.profile drivers/gpu/drm/xe/xe_deadline_mgr.c+38 -10 replies
16/22drm/xe: Add exec queue deadline trace pointsdrivers/gpu/drm/xe/xe_deadline_mgr.c drivers/gpu/drm/xe/xe_guc_submit.c drivers/gpu/drm/xe/xe_trace.h+30 -40 replies
17/22drm/xe: Add hw fence deadline trace pointsdrivers/gpu/drm/xe/xe_deadline_mgr.c drivers/gpu/drm/xe/xe_trace.h+32 -40 replies
18/22drm/xe: Add timestamp_ms to LRC snapshotdrivers/gpu/drm/xe/xe_lrc.c drivers/gpu/drm/xe/xe_lrc.h+5 -00 replies
19/22drm/xe: Enforce GuC static message definesdrivers/gpu/drm/xe/xe_guc_submit.c+9 -40 replies
20/22drm/xe: Document the deadline managerdrivers/gpu/drm/xe/xe_deadline_mgr.c+80 -00 replies
21/22drm/atomic: Export fence deadline helper for atomic commitsdrivers/gpu/drm/drm_atomic_helper.c include/drm/drm_atomic_helper.h+11 -30 replies
22/22drm/i915/display: Use atomic helper to set plane fence deadlinesdrivers/gpu/drm/i915/display/intel_display.c+2 -00 replies

Reviews trailers per patch

4 of 22 patches have a Reviewed-by or Acked-by.

PatchNiranjana VishwanathapuraPhilipp StannerRodrigo Vivi
1/22R-b A-b
2/22
3/22R-b
4/22R-b
5/22
6/22
7/22
8/22
9/22
10/22
11/22
12/22
13/22
14/22R-b
15/22
16/22
17/22
18/22
19/22
20/22
21/22
22/22

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/22] Fence deadlines in Xe

This series introduces deadline support for exported scheduler fences. When a deadline is set on a fence, the driver attempts to complete the work within a configurable window (default 3 ms, via Kconfig) ahead of the deadline.

As the deadline approaches, the exec queue first receives a frequency boost. If the queue has CAP_SYS_ADMIN privileges, a later stage also applies a priority boost. This tiered approach allows work to run at the same baseline priority as the application, only increasing priority when a deadline is at risk of being missed.

The primary use case is compositors that target a stable frame cadence while avoiding a permanently elevated scheduling priority.

Lightly tested with an IGT and running display; behavior appears correct.

VLK-82801

IGT: https://patchwork.freedesktop.org/series/159616/

v2:
- Fully implemented deadline manager
- Separate frequency and priority boost windows
- Enable deadlines in Intel display

Matt

Matthew Brost (22):
drm/xe: Add dedicated message lock
drm/xe: Add EXEC_QUEUE_FLAG_CAP_SYS_NICE
drm/xe: Store exec queue in hardware fence
drm/xe: Add deadline exec queue vfuncs
drm/xe: Export to_xe_hw_fence
drm/xe: Export xe_hw_fence_signaled
drm/xe: Implement deadline manager
drm/xe: Initialize deadline manager on exec queues drm/xe: Stub out execlists deadline vfuncs as NOPs drm/xe: Make scheduler message lock IRQ-safe
drm/xe: Support unstable opcodes for static scheduler messages drm/xe: Implement GuC submission backend ops for deadlines drm/xe: Enable deadlines on hardware fences
drm/xe: Fix Kconfig.profile newlines
drm/xe: Add deadline Kconfig options
drm/xe: Add exec queue deadline trace points
drm/xe: Add hw fence deadline trace points
drm/xe: Add timestamp_ms to LRC snapshot
drm/xe: Enforce GuC static message defines
drm/xe: Document the deadline manager
drm/atomic: Export fence deadline helper for atomic commits drm/i915/display: Use atomic helper to set plane fence deadlines

 drivers/gpu/drm/drm_atomic_helper.c          |  11 +-
 drivers/gpu/drm/i915/display/intel_display.c |   2 +
 drivers/gpu/drm/xe/Kconfig.profile           |  29 ++
 drivers/gpu/drm/xe/Makefile                  |   1 +
 drivers/gpu/drm/xe/xe_deadline_mgr.c         | 463 +++++++++++++++++++
 drivers/gpu/drm/xe/xe_deadline_mgr.h         |  26 ++
 drivers/gpu/drm/xe/xe_deadline_mgr_types.h   |  52 +++
 drivers/gpu/drm/xe/xe_exec_queue.c           |  11 +
 drivers/gpu/drm/xe/xe_exec_queue_types.h     |  15 +
 drivers/gpu/drm/xe/xe_execlist.c             |  15 +
 drivers/gpu/drm/xe/xe_gpu_scheduler.c        |  43 +-
 drivers/gpu/drm/xe/xe_gpu_scheduler.h        |  17 +-
 drivers/gpu/drm/xe/xe_gpu_scheduler_types.h  |   4 +-
 drivers/gpu/drm/xe/xe_guc_exec_queue_types.h |   2 +-
 drivers/gpu/drm/xe/xe_guc_submit.c           | 170 +++++--
 drivers/gpu/drm/xe/xe_hw_fence.c             |  38 +-
 drivers/gpu/drm/xe/xe_hw_fence.h             |   7 +-
 drivers/gpu/drm/xe/xe_hw_fence_types.h       |  19 +
 drivers/gpu/drm/xe/xe_lrc.c                  |  10 +-
 drivers/gpu/drm/xe/xe_lrc.h                  |   4 +-
 drivers/gpu/drm/xe/xe_sched_job.c            |   5 +-
 drivers/gpu/drm/xe/xe_trace.h                |  42 +-
 include/drm/drm_atomic_helper.h              |   3 +
 23 files changed, 918 insertions(+), 71 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_deadline_mgr.c
 create mode 100644 drivers/gpu/drm/xe/xe_deadline_mgr.h
 create mode 100644 drivers/gpu/drm/xe/xe_deadline_mgr_types.h
Signature · 1 line
2.34.1