History

drm/amdkfd: Replace bitmask with event idx in SMI event msg

Event bitmask is a 64-bit mask with only 1 bit set. Sending this event bitmask in KFD SMI event message is both wasteful of memory and potentially limiting to only 64 events. Instead send event index in SMI event message. Please note this change does not break the ABI for the two event types defined so far. The new index is identical to the mask used before.

Mukul Joshi committed 6 years ago

Commit 522ec6e1 parent 2456c292 files · +20 −14Browse files

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

Unified · Split

include/uapi/linux/kfd_ioctl.h+7−3
@@ -449,9 +449,13 @@ struct kfd_ioctl_import_dmabuf_args { · 448 unmodified lines
449449 /*
450450 * KFD SMI(System Management Interface) events
451451 */
452−/* Event type (defined by bitmask) */
453−#define KFD_SMI_EVENT_VMFAULT 0x0000000000000001
454−#define KFD_SMI_EVENT_THERMAL_THROTTLE 0x0000000000000002
452+enum kfd_smi_event {
453+ KFD_SMI_EVENT_NONE = 0, /* not used */
454+ KFD_SMI_EVENT_VMFAULT = 1, /* event start counting at 1 */
455+ KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
456+};
457+
458+#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
455459
456460 struct kfd_ioctl_smi_events_args {
457461 __u32 gpuid; /* to KFD */