History

drm/amdkfd: Add wavefront context save state retrieval ioctl

Wavefront context save data is of interest to userspace clients for debugging static wavefront state. The MQD contains two parameters required to parse the control stack and the control stack itself is kept in the MQD from gfx9 onwards. Add an ioctl to fetch the context save area and control stack offsets and to copy the control stack to a userspace address if it is kept in the MQD.

Jay Cornwall committed 9 years ago

Commit 5df099e1 parent 5ade6c99 files · +159 −1Browse files

Showing the changes to include/uapi/linux (1 of 9 files). Show all

Unified · Split

include/uapi/linux/kfd_ioctl.h+12−1
@@ -82,6 +82,14 @@ struct kfd_ioctl_set_cu_mask_args { · 81 unmodified lines
8282 __u64 cu_mask_ptr; /* to KFD */
8383 };
8484
85+struct kfd_ioctl_get_queue_wave_state_args {
86+ uint64_t ctl_stack_address; /* to KFD */
87+ uint32_t ctl_stack_used_size; /* from KFD */
88+ uint32_t save_area_used_size; /* from KFD */
89+ uint32_t queue_id; /* to KFD */
90+ uint32_t pad;
91+};
92+
8593 /* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
8694 #define KFD_IOC_CACHE_POLICY_COHERENT 0
8795 #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
@@ -475,7 +483,10 @@ struct kfd_ioctl_unmap_memory_from_gpu_args { · 387 unmodified lines
475483 #define AMDKFD_IOC_SET_CU_MASK \
476484 AMDKFD_IOW(0x1A, struct kfd_ioctl_set_cu_mask_args)
477485
486+#define AMDKFD_IOC_GET_QUEUE_WAVE_STATE \
487+ AMDKFD_IOWR(0x1B, struct kfd_ioctl_get_queue_wave_state_args)
488+
478489 #define AMDKFD_COMMAND_START 0x01
479−#define AMDKFD_COMMAND_END 0x1B
490+#define AMDKFD_COMMAND_END 0x1C
480491
481492 #endif