summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2026-05-14 07:20:20 +0300
committerDave Airlie <airlied@redhat.com>2026-05-14 07:20:41 +0300
commit565626e74db94686f2389cbdea845891f468f044 (patch)
treeeda46022edf916506c99542224e88cdf50d9ee55 /include
parentf96538285cfdbb3acf5e3356e0bb88c38815790b (diff)
parentd00df389371346d6ac5739d8692405d9d8b11041 (diff)
downloadlinux-565626e74db94686f2389cbdea845891f468f044.tar.xz
Merge tag 'amd-drm-next-7.2-2026-05-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-7.2-2026-05-13: amdgpu: - Userq fixes - DCN 3.2 fix - RAS fixes - GC 12 fixes - Add PTL support for profiler - SMU multi-msg helpers - OLED fix - Misc cleanups - DC aux transfer refactor - Introduce dc_plane_cm and migrate surface update color path - IPS fixes - DCN 4.2 updates - SR-IOV fixes - Add FRL registers for HDMI 2.1 - NBIO 7.11.4 updates - VPE 2.0 support - Aldebaran SMU update amdkfd: - Add profiler API UAPI: - Add profiler IOCTL Userspace: https://github.com/ROCm/rocm-systems/commit/40abc95a6463a61bb318a67efd6d9cc3e5ee8839 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260513232911.41274-1-alexander.deucher@amd.com
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/kfd_ioctl.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h
index e72359370857..9584b5aab727 100644
--- a/include/uapi/linux/kfd_ioctl.h
+++ b/include/uapi/linux/kfd_ioctl.h
@@ -48,9 +48,10 @@
* - 1.20 - Trap handler support for expert scheduling mode available
* - 1.21 - Debugger support to subscribe to LDS out-of-address exceptions
* - 1.22 - Add queue creation with metadata ring base address
+ * - 1.23 - Add profiler control ioctl to enable/disable profiler on a process
*/
#define KFD_IOCTL_MAJOR_VERSION 1
-#define KFD_IOCTL_MINOR_VERSION 22
+#define KFD_IOCTL_MINOR_VERSION 23
struct kfd_ioctl_get_version_args {
__u32 major_version; /* from KFD */
@@ -1558,6 +1559,36 @@ struct kfd_ioctl_dbg_trap_args {
};
};
+#define KFD_IOC_PROFILER_VERSION_NUM 1
+enum kfd_profiler_ops {
+ KFD_IOC_PROFILER_PMC = 0,
+ KFD_IOC_PROFILER_VERSION = 2,
+ KFD_IOC_PROFILER_PTL_CONTROL = 3,
+};
+
+/**
+ * Enables/Disables GPU Specific profiler settings
+ */
+struct kfd_ioctl_pmc_settings {
+ __u32 gpu_id; /* This is the user_gpu_id */
+ __u32 lock; /* Lock GPU for Profiling */
+ __u32 perfcount_enable; /* Force Perfcount Enable for queues on GPU */
+};
+
+struct kfd_ioctl_ptl_control {
+ __u32 gpu_id; /* user_gpu_id */
+ __u32 enable; /* set 1 to enable PTL, set 0 to disable PTL */
+};
+
+struct kfd_ioctl_profiler_args {
+ __u32 op; /* kfd_profiler_op */
+ union {
+ struct kfd_ioctl_pmc_settings pmc;
+ struct kfd_ioctl_ptl_control ptl;
+ __u32 version; /* KFD_IOC_PROFILER_VERSION_NUM */
+ };
+};
+
#define AMDKFD_IOCTL_BASE 'K'
#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
#define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
@@ -1681,7 +1712,10 @@ struct kfd_ioctl_dbg_trap_args {
#define AMDKFD_IOC_CREATE_PROCESS \
AMDKFD_IO(0x27)
+#define AMDKFD_IOC_PROFILER \
+ AMDKFD_IOWR(0x28, struct kfd_ioctl_profiler_args)
+
#define AMDKFD_COMMAND_START 0x01
-#define AMDKFD_COMMAND_END 0x28
+#define AMDKFD_COMMAND_END 0x29
#endif