dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/3] drm: Extract dma-fence-to-workqueue pattern into common helpers
@ 2026-09-08  8:46 Srinivasan Shanmugam
  2026-09-08  8:46 ` [PATCH v8 1/3] drm: Add drm_work_fence helper Srinivasan Shanmugam
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Srinivasan Shanmugam @ 2026-09-08  8:46 UTC (permalink / raw)
  To: matthew.brost
  Cc: dri-devel, intel-xe, amd-gfx, Srinivasan Shanmugam,
	Christian König

This series extracts the dma-fence-callback-to-workqueue pattern shared
between XE and AMDGPU into common DRM helpers.

Patch 1 introduces drm_work_fence — a generic helper that queues a work
item when a dma-fence signals, for work that cannot run in IRQ context.

Patch 2 introduces drm_user_fence — extends drm_work_fence with
kthread_use_mm() support for drivers that need to write completion
status to userspace memory.

Patch 3 converts XE's open-coded xe_user_fence to use drm_user_fence.

v8:
- Fix copyright: The Linux Foundation → Advanced Micro Devices, Inc.
- Switch EXPORT_SYMBOL_GPL → EXPORT_SYMBOL for MIT-licensed code (Matt)
- Rename drm_work_fence_ops callback: writeback → worker (Matt)
- Rename drm_user_fence_ops callback: worker → writeback (Matt)
- Fix xe_ufence_worker ordering: WRITE_ONCE before copy_to_user,
  add smp_wmb() before wake_up_all (Matt, confirmed via 8ae04fe9ffc93)
- Rename .worker → .writeback in xe_ufence_ops (Matt)
- Drop Patch 4 pending design decision on compare address read method

Suggested-by: Matthew Brost <matthew.brost@intel.com>
Suggested-by: Christian König <christian.koenig@amd.com>

Srinivasan Shanmugam (3):
  drm: Add drm_work_fence helper
  drm: Add drm_user_fence helper
  drm/xe: Convert xe_user_fence to drm_user_fence

 drivers/gpu/drm/Makefile           |   2 +
 drivers/gpu/drm/drm_user_fence.c   |  70 +++++++++++
 drivers/gpu/drm/drm_work_fence.c   | 184 +++++++++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_sync.c       | 154 +++++++++++++-----------
 drivers/gpu/drm/xe/xe_sync.h       |   2 +
 drivers/gpu/drm/xe/xe_sync_types.h |   1 -
 drivers/gpu/drm/xe/xe_vm.c         |   1 +
 include/drm/drm_user_fence.h       | 123 +++++++++++++++++++
 include/drm/drm_work_fence.h       |  69 +++++++++++
 9 files changed, 537 insertions(+), 69 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_user_fence.c
 create mode 100644 drivers/gpu/drm/drm_work_fence.c
 create mode 100644 include/drm/drm_user_fence.h
 create mode 100644 include/drm/drm_work_fence.h

-- 
2.34.1


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

end of thread, other threads:[~2026-09-09  5:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08  8:46 [PATCH v8 0/3] drm: Extract dma-fence-to-workqueue pattern into common helpers Srinivasan Shanmugam
2026-09-08  8:46 ` [PATCH v8 1/3] drm: Add drm_work_fence helper Srinivasan Shanmugam
2026-09-08  8:58   ` sashiko-bot
2026-09-08 20:16     ` Matthew Brost
2026-09-09  3:00       ` SRINIVASAN SHANMUGAM
2026-09-09  5:20         ` SRINIVASAN SHANMUGAM
2026-09-08  8:46 ` [PATCH v8 2/3] drm: Add drm_user_fence helper Srinivasan Shanmugam
2026-09-08  8:58   ` sashiko-bot
2026-09-08  8:46 ` [PATCH v8 3/3] drm/xe: Convert xe_user_fence to drm_user_fence Srinivasan Shanmugam
2026-09-08  9:00   ` sashiko-bot
2026-09-08 20:22   ` Matthew Brost
2026-09-09  3:04     ` SRINIVASAN SHANMUGAM

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