Add support for KFD Thermal Throttling SMI event

Add handling for receiving thermal throttling SMI event from the
kernel.
Also, update the event notification test to work with the new event.

Change-Id: Ib89c12b244f90998ccbae0a38b37f25705d156e0
此提交包含在:
Mukul Joshi
2020-08-10 12:50:33 -04:00
提交者 Mukul Joshi
父節點 406859ca8a
當前提交 aff75c955f
共有 4 個檔案被更改,包括 7 行新增 和 4 行删除
+1
查看文件
@@ -544,6 +544,7 @@ struct kfd_ioctl_import_dmabuf_args {
enum kfd_smi_event {
KFD_SMI_EVENT_NONE = 0, /* not used */
KFD_SMI_EVENT_VMFAULT = 1, /* event start counting at 1 */
KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
};
#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
+4 -3
查看文件
@@ -280,8 +280,9 @@ typedef struct {
typedef enum {
RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT, //!< VM page fault
RSMI_EVT_NOTIF_FIRST = RSMI_EVT_NOTIF_VMFAULT,
RSMI_EVT_NOTIF_THERMAL_THROTTLE = KFD_SMI_EVENT_THERMAL_THROTTLE,
RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_VMFAULT
RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_THERMAL_THROTTLE
} rsmi_evt_notification_type_t;
/*
@@ -3228,8 +3229,8 @@ rsmi_event_notification_init(uint32_t dv_ind);
* bit position starting from 1.
* For example, if the mask field is 0x0000000000000003, which means first bit,
* bit 1 (bit position start from 1) and bit 2 are set, which indicate interest
* in receiving RSMI_EVT_NOTIF_VMFAULT (which has a value of 1) and the next
* event in that list which has a value of 2.
* in receiving RSMI_EVT_NOTIF_VMFAULT (which has a value of 1) and
* RSMI_EVT_NOTIF_THERMAL_THROTTLE event (which has a value of 2).
*
* @retval ::RSMI_STATUS_INIT_ERROR is returned if
* ::rsmi_event_notification_init() has not been called before a call to this