AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 00/14] AMDGPU usermode queues
@ 2024-05-02 16:31 Shashank Sharma
  2024-05-02 16:31 ` [PATCH v10 01/14] drm/amdgpu: UAPI for user queue management Shashank Sharma
                   ` (13 more replies)
  0 siblings, 14 replies; 20+ messages in thread
From: Shashank Sharma @ 2024-05-02 16:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: Arvind Yadav, Shashank Sharma

This patch series introduces AMDGPU usermode queues for gfx workloads.
Usermode queues is a method of GPU workload submission into the graphics
hardware without any interaction with kernel/DRM schedulers. In this
method, a userspace graphics application can create its own workqueue and
submit it directly in the GPU HW.

The general idea of how this is supposed to work:
- The application creates the following GPU objetcs:
  - A queue object to hold the workload packets.
  - A read pointer object.
  - A write pointer object.
  - A doorbell page.
  - Shadow bufffer pages.
  - GDS buffer pages (as required).
- The application picks a 32-bit offset in the doorbell page for this
  queue.
- The application uses the usermode_queue_create IOCTL introduced in
  this patch, by passing the GPU addresses of these objects (read ptr,
  write ptr, queue base address, shadow, gds) with doorbell object and
  32-bit doorbell offset in the doorbell page.
- The kernel creates the queue and maps it in the HW.
- The application maps the GPU buffers in process address space.
- The application can start submitting the data in the queue as soon as
  the kernel IOCTL returns.
- After filling the workload data in the queue, the app must write the
  number of dwords added in the queue into the doorbell offset and the
  WPTR buffer, and the GPU will start fetching the data.
- This series adds usermode queue support for all three MES based IPs
  (GFX, SDMA and Compute).

libDRM changes for this series and a sample DRM test program can be
found here:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/287

MESA changes consuming this series can be seen in the MR here:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29010

Alex Deucher (1):
  drm/amdgpu: UAPI for user queue management

Shashank Sharma (13):
  drm/amdgpu: add usermode queue base code
  drm/amdgpu: add new IOCTL for usermode queue
  drm/amdgpu: add helpers to create userqueue object
  drm/amdgpu: create MES-V11 usermode queue for GFX
  drm/amdgpu: create context space for usermode queue
  drm/amdgpu: map usermode queue into MES
  drm/amdgpu: map wptr BO into GART
  drm/amdgpu: generate doorbell index for userqueue
  drm/amdgpu: cleanup leftover queues
  drm/amdgpu: enable GFX-V11 userqueue support
  drm/amdgpu: enable SDMA-V6 usermode queues
  drm/amdgpu: enable compute/gfx usermode queue
  drm/amdgpu: add kernel config for gfx-userqueue

 drivers/gpu/drm/amd/amdgpu/Kconfig            |   8 +
 drivers/gpu/drm/amd/amdgpu/Makefile           |   5 +
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   6 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 296 +++++++++++++++
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c        |   9 +
 .../gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c  | 338 ++++++++++++++++++
 .../gpu/drm/amd/amdgpu/mes_v11_0_userqueue.h  |  30 ++
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c        |   5 +
 .../gpu/drm/amd/include/amdgpu_userqueue.h    |  79 ++++
 include/uapi/drm/amdgpu_drm.h                 | 122 +++++++
 12 files changed, 903 insertions(+)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/mes_v11_0_userqueue.h
 create mode 100644 drivers/gpu/drm/amd/include/amdgpu_userqueue.h

-- 
2.43.2


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

end of thread, other threads:[~2024-05-03  6:53 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 16:31 [PATCH v10 00/14] AMDGPU usermode queues Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 01/14] drm/amdgpu: UAPI for user queue management Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 02/14] drm/amdgpu: add usermode queue base code Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 03/14] drm/amdgpu: add new IOCTL for usermode queue Shashank Sharma
2024-05-02 21:25   ` Alex Deucher
2024-05-03  5:14     ` Sharma, Shashank
2024-05-02 16:31 ` [PATCH v10 04/14] drm/amdgpu: add helpers to create userqueue object Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 05/14] drm/amdgpu: create MES-V11 usermode queue for GFX Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 06/14] drm/amdgpu: create context space for usermode queue Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 07/14] drm/amdgpu: map usermode queue into MES Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 08/14] drm/amdgpu: map wptr BO into GART Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 09/14] drm/amdgpu: generate doorbell index for userqueue Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 10/14] drm/amdgpu: cleanup leftover queues Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 11/14] drm/amdgpu: enable GFX-V11 userqueue support Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 12/14] drm/amdgpu: enable SDMA-V6 usermode queues Shashank Sharma
2024-05-03  6:53   ` Christian König
2024-05-02 16:31 ` [PATCH v10 13/14] drm/amdgpu: enable compute/gfx usermode queue Shashank Sharma
2024-05-03  6:52   ` Christian König
2024-05-02 16:31 ` [PATCH v10 14/14] drm/amdgpu: add kernel config for gfx-userqueue Shashank Sharma
2024-05-03  6:44   ` Christian König

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