On 9/23/2026 11:02 PM, Welton, Benjamin wrote:
[Some people who received this message don't often get email from benjamin.welton@amd.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

AMD General

For some background on my end, is this the porting over of the existing profiler work to KGD?
Hello Ben,

Yes, it is a porting from KFD because I don't have any other documents.

However I still made some improvements like separate reservation from PMC enabling operation
to avoid some corner cases.

Thanks
Lingshan

Ben

-----Original Message-----
From: Zhu, James <James.Zhu@amd.com>
Sent: Wednesday, September 23, 2026 7:02 AM
To: amd-gfx@lists.freedesktop.org; Welton, Benjamin <Benjamin.Welton@amd.com>
Subject: Re: [RFC 00/10] amdgpu: implement Performance Monitor Counter support

Hi Ben,

Please review these PMC patches for unified Kernel interface.

Thanks and Best Regards!

James Zhu

On 2026-09-22 05:34, Zhu Lingshan wrote:
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.

This series depends on and used new helper introduced in another
series:
https://lists.freedesktop.org/archives/amd-gfx/2026-August/151692.html

Please help Review

Thanks!

Zhu Lingshan (10):
   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: 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          |   8 +
  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      |   6 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c | 166 +++++++++++++++++++
  drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h |  38 +++++
  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c    |  95 ++++++++++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h    |   2 +
  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c       |  11 ++
  drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c       |  11 ++
  drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c       |  11 ++
  include/uapi/drm/amdgpu_drm.h                |  36 ++++
  13 files changed, 390 insertions(+), 3 deletions(-)
  create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.c
  create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_profiler.h