Skip to content

AMDGPU Doorbell manager

Shashank Sharma amd-gfx 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 8 repliesIn review
  2. v212 patches 15 repliesSuperseded
  3. v116 patches 70 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12drm/amdgpu: create a new file for doorbell managerdrivers/gpu/drm/amd/amdgpu/Makefile drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h +1 more+195 -1700 replies
2/12drm/amdgpu: don't modify num_doorbells for mesdrivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c+15 -190 replies
3/12drm/amdgpu: add UAPI for allocating doorbell memoryinclude/uapi/drm/amdgpu_drm.h+6 -10 replies
4/12drm/amdgpu: accommodate DOMAIN/PL_DOORBELLdrivers/gpu/drm/amd/amdgpu/amdgpu_object.c drivers/gpu/drm/amd/amdgpu/amdgpu_object.h drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h +2 more+30 -20 replies
5/12drm/amdgpu: initialize ttm for doorbellsdrivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+7 -00 replies
6/12drm/amdgpu: create kernel doorbell pagesdrivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +1 more+60 -146 replies
7/12get absolute offset from doorbell indexdrivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c+24 -00 replies
8/12drm/amdgpu: use doorbell manager for kfd kernel doorbellsdrivers/gpu/drm/amd/amdkfd/kfd_device.c drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c drivers/gpu/drm/amd/amdkfd/kfd_priv.h+39 -781 reply
9/12drm/amdgpu: use doorbell manager for kfd process doorbellsdrivers/gpu/drm/amd/amdkfd/kfd_chardev.c drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c +3 more+108 -951 reply
10/12drm/amdgpu: remove unused functions and variablesdrivers/gpu/drm/amd/amdkfd/kfd_doorbell.c drivers/gpu/drm/amd/amdkfd/kfd_priv.h+0 -440 replies
11/12drm/amdgpu: use doorbell mgr for MES kernel doorbellsdrivers/gpu/drm/amd/amdgpu/amdgpu_mes.c drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h+40 -573 replies
12/12drm/amdgpu: cleanup MES process level doorbellsdrivers/gpu/drm/amd/amdgpu/amdgpu_mes.c drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h+1 -630 replies

Reviews trailers per patch

10 of 12 patches have a Reviewed-by or Acked-by.

PatchChristian KoenigAlex DeucherFelix Kuehling
1/12R-b
2/12R-b A-b
3/12R-b
4/12R-b
5/12R-b
6/12
7/12A-b
8/12R-b
9/12A-b R-b
10/12R-b
11/12
12/12R-b

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 v3 thread

Cover letter [PATCH v3 00/12] AMDGPU Doorbell manager

Doorbells in AMDGPU drivers are currently managed by different clients in a scattered way, across may places. The existing clients are:
- AMDGPU graphics driver for kernel level doorbell writes.
- AMDGPU MES module for kernel level doorbell write (MES ring test and aggregated doorbells).
- AMDGPU MES module for MES process doorbells.
- AMDKFD module for KFD/KIQ kernel doorbells.
- AMDKFD module for KFD process doorbells.
- AMDGPU usermode queues for usermode doorbell writes (upcoming).

This patch series introduces doorbell-manager to keep the doorbell handling at a central place. The fundamental changes are:
- Introduce and accommodate a new GEM domain for doorbells.
- Prepare the AMDGPU ttm backend for handling doorbell allocation.
- Create doorbell BOs for kernel-level and process level doorbell opertations, and place it in existing structures.
- Modify the existing graphics, KFD and MES code to use the doorbell-manager functions.
- Remove the existing doorbell management code in KFD/MES.

The idea is that:
- a kernel client can call doorbell manager functions to allocate/free doorbell pages.
- a usermode app can directly allocate a page from the doorbell bar just like a GEM object and use it for different usermode queues.
- There is no direct UAPI change in this series, just an additional flag for GEM_OBJECT_DOORBELL, here:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/287

PS: This series has been sanity tested with kfd_test_suit to ensure
it is not introducing any regressions due to kfd doorbell changes.

Alex Deucher (2):
drm/amdgpu: add UAPI for allocating doorbell memory drm/amdgpu: accommodate DOMAIN/PL_DOORBELL

Shashank Sharma (10):
drm/amdgpu: create a new file for doorbell manager drm/amdgpu: don't modify num_doorbells for mes drm/amdgpu: initialize ttm for doorbells drm/amdgpu: create kernel doorbell pages
get absolute offset from doorbell index drm/amdgpu: use doorbell manager for kfd kernel doorbells drm/amdgpu: use doorbell manager for kfd process doorbells drm/amdgpu: remove unused functions and variables drm/amdgpu: use doorbell mgr for MES kernel doorbells drm/amdgpu: cleanup MES process level doorbells

 drivers/gpu/drm/amd/amdgpu/Makefile           |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 174 +------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h  |  17 +-
 .../gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c  | 230 +++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c       | 148 +++--------
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h       |  16 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c    |  11 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h    |   2 +
 .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h    |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       |  30 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h       |   1 +
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c      |  20 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device.c       |   2 -
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |   8 +-
 drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c     | 232 ++++++++----------
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h         |  27 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  40 +--
 .../amd/amdkfd/kfd_process_queue_manager.c    |  23 +-
 include/uapi/drm/amdgpu_drm.h                 |   7 +-
 19 files changed, 487 insertions(+), 505 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c
Signature · 1 line
2.40.1