Skip to content

amdgpu: implement Performance Monitor Counter support

Zhu Lingshan amd-gfx 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/213 patches 1 replyIn review
  2. v2 posting 1/213 patches 0 repliesSuperseded
  3. v112 patches 2 repliesSuperseded

Changes in v2 from the cover letter

1) remove per-IP set_mqd_perfcount, use init_mqd with modify == true instead
2) squash amdgpu_userq_xa_find into the caller patch
3) keep CWSR registers when modify mqd for GFX12
4) minor improvements

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13drm/amdgpu: implement PMC ioctl frameworkdrivers/gpu/drm/amd/amdgpu/Makefile drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c +2 more+116 -10 replies
2/13drm/amdgpu: add device-wide PMC configdrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+12 -00 replies
3/13drm/amdgpu: introduce PMC ioctl handlerdrivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c+34 -10 replies
4/13drm/amdgpu: implement reservation mechanism for PMCdrivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h+78 -10 replies
5/13drm/amdgpu: set device-wide PMC enablement indicatordrivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h+34 -10 replies
6/13drm/amdgpu/gfx11: set mqd->perfcount from mqd_propdrivers/gpu/drm/amd/amdgpu/amdgpu_mes.h drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+3 -00 replies
7/13drm/amdgpu/gfx12: set mqd->perfcount from mqd_propdrivers/gpu/drm/amd/amdgpu/gfx_v12_0.c+1 -00 replies
8/13drm/amdgpu/gfx12.1: set mqd->perfcount from mqd_propdrivers/gpu/drm/amd/amdgpu/gfx_v12_1.c+1 -00 replies
9/13drm/amdgpu/gfx11: set pmc_supported for GFX11 familydrivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+2 -00 replies
10/13drm/amdgpu/gfx12: set pmc_supported for GFX12 familydrivers/gpu/drm/amd/amdgpu/gfx_v12_0.c+1 -00 replies
11/13drm/amdgpu/gfx12: keep CWSR registers when modify mqddrivers/gpu/drm/amd/amdgpu/gfx_v12_0.c+5 -20 replies
12/13drm/amdgpu: implement device PMC handlerdrivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h+140 -10 replies
13/13drm/amdgpu: set userq perf state before publish itdrivers/gpu/drm/amd/amdgpu/amdgpu_userq.c+28 -20 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBenjamin WeltonAlex Deucher
SeriesR-b
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 RESEND 00/13] amdgpu: implement Performance Monitor Counter support

(Add Benjamin's Reviewed-by tag and resend)

This series implements PMC support for amdgpu. Including two parts:
1) PMC Enablement
2) Profiler Reservation

The user space should take the reservation, then set PMC.

Changes from v1:
1) remove per-IP set_mqd_perfcount, use init_mqd with modify == true instead
2) squash amdgpu_userq_xa_find into the caller patch
3) keep CWSR registers when modify mqd for GFX12
4) minor improvements

Zhu Lingshan (13):
drm/amdgpu: implement PMC ioctl framework drm/amdgpu: add device-wide PMC config drm/amdgpu: introduce PMC ioctl handler drm/amdgpu: implement reservation mechanism for PMC drm/amdgpu: set device-wide PMC enablement indicator drm/amdgpu/gfx11: set mqd->perfcount from mqd_prop drm/amdgpu/gfx12: set mqd->perfcount from mqd_prop drm/amdgpu/gfx12.1: set mqd->perfcount from mqd_prop drm/amdgpu/gfx11: set pmc_supported for GFX11 family drm/amdgpu/gfx12: set pmc_supported for GFX12 family drm/amdgpu/gfx12: keep CWSR registers when modify mqd drm/amdgpu: implement device PMC handler drm/amdgpu: set userq perf state before publish it

 drivers/gpu/drm/amd/amdgpu/Makefile          |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu.h          |   9 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c   |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c      |   4 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h      |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c | 183 +++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h |  38 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c    | 164 ++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h    |   2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c       |   3 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c       |   9 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c       |   1 +
 include/uapi/drm/amdgpu_drm.h                |  36 ++++
 13 files changed, 451 insertions(+), 5 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h
Signature · 1 line
2.53.0