diff options
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 1 | ||||
| -rw-r--r-- | include/uapi/linux/kfd_ioctl.h | 172 |
3 files changed, 87 insertions, 88 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index 681b639f5133..0649dd43e780 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | |||
| @@ -183,7 +183,7 @@ static void uninitialize(struct kernel_queue *kq) | |||
| 183 | { | 183 | { |
| 184 | if (kq->queue->properties.type == KFD_QUEUE_TYPE_HIQ) | 184 | if (kq->queue->properties.type == KFD_QUEUE_TYPE_HIQ) |
| 185 | kq->mqd->destroy_mqd(kq->mqd, | 185 | kq->mqd->destroy_mqd(kq->mqd, |
| 186 | NULL, | 186 | kq->queue->mqd, |
| 187 | false, | 187 | false, |
| 188 | QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS, | 188 | QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS, |
| 189 | kq->queue->pipe, | 189 | kq->queue->pipe, |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index 1cae95e2b13a..03bec765b03d 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | |||
| @@ -143,7 +143,6 @@ int pqm_create_queue(struct process_queue_manager *pqm, | |||
| 143 | int num_queues = 0; | 143 | int num_queues = 0; |
| 144 | struct queue *cur; | 144 | struct queue *cur; |
| 145 | 145 | ||
| 146 | memset(&q_properties, 0, sizeof(struct queue_properties)); | ||
| 147 | memcpy(&q_properties, properties, sizeof(struct queue_properties)); | 146 | memcpy(&q_properties, properties, sizeof(struct queue_properties)); |
| 148 | q = NULL; | 147 | q = NULL; |
| 149 | kq = NULL; | 148 | kq = NULL; |
diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index 7b4567bacfc2..26283fefdf5f 100644 --- a/include/uapi/linux/kfd_ioctl.h +++ b/include/uapi/linux/kfd_ioctl.h | |||
| @@ -23,15 +23,15 @@ | |||
| 23 | #ifndef KFD_IOCTL_H_INCLUDED | 23 | #ifndef KFD_IOCTL_H_INCLUDED |
| 24 | #define KFD_IOCTL_H_INCLUDED | 24 | #define KFD_IOCTL_H_INCLUDED |
| 25 | 25 | ||
| 26 | #include <linux/types.h> | 26 | #include <drm/drm.h> |
| 27 | #include <linux/ioctl.h> | 27 | #include <linux/ioctl.h> |
| 28 | 28 | ||
| 29 | #define KFD_IOCTL_MAJOR_VERSION 1 | 29 | #define KFD_IOCTL_MAJOR_VERSION 1 |
| 30 | #define KFD_IOCTL_MINOR_VERSION 1 | 30 | #define KFD_IOCTL_MINOR_VERSION 1 |
| 31 | 31 | ||
| 32 | struct kfd_ioctl_get_version_args { | 32 | struct kfd_ioctl_get_version_args { |
| 33 | uint32_t major_version; /* from KFD */ | 33 | __u32 major_version; /* from KFD */ |
| 34 | uint32_t minor_version; /* from KFD */ | 34 | __u32 minor_version; /* from KFD */ |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | /* For kfd_ioctl_create_queue_args.queue_type. */ | 37 | /* For kfd_ioctl_create_queue_args.queue_type. */ |
| @@ -43,36 +43,36 @@ struct kfd_ioctl_get_version_args { | |||
| 43 | #define KFD_MAX_QUEUE_PRIORITY 15 | 43 | #define KFD_MAX_QUEUE_PRIORITY 15 |
| 44 | 44 | ||
| 45 | struct kfd_ioctl_create_queue_args { | 45 | struct kfd_ioctl_create_queue_args { |
| 46 | uint64_t ring_base_address; /* to KFD */ | 46 | __u64 ring_base_address; /* to KFD */ |
| 47 | uint64_t write_pointer_address; /* from KFD */ | 47 | __u64 write_pointer_address; /* from KFD */ |
| 48 | uint64_t read_pointer_address; /* from KFD */ | 48 | __u64 read_pointer_address; /* from KFD */ |
| 49 | uint64_t doorbell_offset; /* from KFD */ | 49 | __u64 doorbell_offset; /* from KFD */ |
| 50 | 50 | ||
| 51 | uint32_t ring_size; /* to KFD */ | 51 | __u32 ring_size; /* to KFD */ |
| 52 | uint32_t gpu_id; /* to KFD */ | 52 | __u32 gpu_id; /* to KFD */ |
| 53 | uint32_t queue_type; /* to KFD */ | 53 | __u32 queue_type; /* to KFD */ |
| 54 | uint32_t queue_percentage; /* to KFD */ | 54 | __u32 queue_percentage; /* to KFD */ |
| 55 | uint32_t queue_priority; /* to KFD */ | 55 | __u32 queue_priority; /* to KFD */ |
| 56 | uint32_t queue_id; /* from KFD */ | 56 | __u32 queue_id; /* from KFD */ |
| 57 | 57 | ||
| 58 | uint64_t eop_buffer_address; /* to KFD */ | 58 | __u64 eop_buffer_address; /* to KFD */ |
| 59 | uint64_t eop_buffer_size; /* to KFD */ | 59 | __u64 eop_buffer_size; /* to KFD */ |
| 60 | uint64_t ctx_save_restore_address; /* to KFD */ | 60 | __u64 ctx_save_restore_address; /* to KFD */ |
| 61 | uint64_t ctx_save_restore_size; /* to KFD */ | 61 | __u64 ctx_save_restore_size; /* to KFD */ |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | struct kfd_ioctl_destroy_queue_args { | 64 | struct kfd_ioctl_destroy_queue_args { |
| 65 | uint32_t queue_id; /* to KFD */ | 65 | __u32 queue_id; /* to KFD */ |
| 66 | uint32_t pad; | 66 | __u32 pad; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | struct kfd_ioctl_update_queue_args { | 69 | struct kfd_ioctl_update_queue_args { |
| 70 | uint64_t ring_base_address; /* to KFD */ | 70 | __u64 ring_base_address; /* to KFD */ |
| 71 | 71 | ||
| 72 | uint32_t queue_id; /* to KFD */ | 72 | __u32 queue_id; /* to KFD */ |
| 73 | uint32_t ring_size; /* to KFD */ | 73 | __u32 ring_size; /* to KFD */ |
| 74 | uint32_t queue_percentage; /* to KFD */ | 74 | __u32 queue_percentage; /* to KFD */ |
| 75 | uint32_t queue_priority; /* to KFD */ | 75 | __u32 queue_priority; /* to KFD */ |
| 76 | }; | 76 | }; |
| 77 | 77 | ||
| 78 | /* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */ | 78 | /* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */ |
| @@ -80,13 +80,13 @@ struct kfd_ioctl_update_queue_args { | |||
| 80 | #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1 | 80 | #define KFD_IOC_CACHE_POLICY_NONCOHERENT 1 |
| 81 | 81 | ||
| 82 | struct kfd_ioctl_set_memory_policy_args { | 82 | struct kfd_ioctl_set_memory_policy_args { |
| 83 | uint64_t alternate_aperture_base; /* to KFD */ | 83 | __u64 alternate_aperture_base; /* to KFD */ |
| 84 | uint64_t alternate_aperture_size; /* to KFD */ | 84 | __u64 alternate_aperture_size; /* to KFD */ |
| 85 | 85 | ||
| 86 | uint32_t gpu_id; /* to KFD */ | 86 | __u32 gpu_id; /* to KFD */ |
| 87 | uint32_t default_policy; /* to KFD */ | 87 | __u32 default_policy; /* to KFD */ |
| 88 | uint32_t alternate_policy; /* to KFD */ | 88 | __u32 alternate_policy; /* to KFD */ |
| 89 | uint32_t pad; | 89 | __u32 pad; |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | /* | 92 | /* |
| @@ -97,26 +97,26 @@ struct kfd_ioctl_set_memory_policy_args { | |||
| 97 | */ | 97 | */ |
| 98 | 98 | ||
| 99 | struct kfd_ioctl_get_clock_counters_args { | 99 | struct kfd_ioctl_get_clock_counters_args { |
| 100 | uint64_t gpu_clock_counter; /* from KFD */ | 100 | __u64 gpu_clock_counter; /* from KFD */ |
| 101 | uint64_t cpu_clock_counter; /* from KFD */ | 101 | __u64 cpu_clock_counter; /* from KFD */ |
| 102 | uint64_t system_clock_counter; /* from KFD */ | 102 | __u64 system_clock_counter; /* from KFD */ |
| 103 | uint64_t system_clock_freq; /* from KFD */ | 103 | __u64 system_clock_freq; /* from KFD */ |
| 104 | 104 | ||
| 105 | uint32_t gpu_id; /* to KFD */ | 105 | __u32 gpu_id; /* to KFD */ |
| 106 | uint32_t pad; | 106 | __u32 pad; |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | #define NUM_OF_SUPPORTED_GPUS 7 | 109 | #define NUM_OF_SUPPORTED_GPUS 7 |
| 110 | 110 | ||
| 111 | struct kfd_process_device_apertures { | 111 | struct kfd_process_device_apertures { |
| 112 | uint64_t lds_base; /* from KFD */ | 112 | __u64 lds_base; /* from KFD */ |
| 113 | uint64_t lds_limit; /* from KFD */ | 113 | __u64 lds_limit; /* from KFD */ |
| 114 | uint64_t scratch_base; /* from KFD */ | 114 | __u64 scratch_base; /* from KFD */ |
| 115 | uint64_t scratch_limit; /* from KFD */ | 115 | __u64 scratch_limit; /* from KFD */ |
| 116 | uint64_t gpuvm_base; /* from KFD */ | 116 | __u64 gpuvm_base; /* from KFD */ |
| 117 | uint64_t gpuvm_limit; /* from KFD */ | 117 | __u64 gpuvm_limit; /* from KFD */ |
| 118 | uint32_t gpu_id; /* from KFD */ | 118 | __u32 gpu_id; /* from KFD */ |
| 119 | uint32_t pad; | 119 | __u32 pad; |
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | struct kfd_ioctl_get_process_apertures_args { | 122 | struct kfd_ioctl_get_process_apertures_args { |
| @@ -124,8 +124,8 @@ struct kfd_ioctl_get_process_apertures_args { | |||
| 124 | process_apertures[NUM_OF_SUPPORTED_GPUS];/* from KFD */ | 124 | process_apertures[NUM_OF_SUPPORTED_GPUS];/* from KFD */ |
| 125 | 125 | ||
| 126 | /* from KFD, should be in the range [1 - NUM_OF_SUPPORTED_GPUS] */ | 126 | /* from KFD, should be in the range [1 - NUM_OF_SUPPORTED_GPUS] */ |
| 127 | uint32_t num_of_nodes; | 127 | __u32 num_of_nodes; |
| 128 | uint32_t pad; | 128 | __u32 pad; |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | #define MAX_ALLOWED_NUM_POINTS 100 | 131 | #define MAX_ALLOWED_NUM_POINTS 100 |
| @@ -133,25 +133,25 @@ struct kfd_ioctl_get_process_apertures_args { | |||
| 133 | #define MAX_ALLOWED_WAC_BUFF_SIZE 128 | 133 | #define MAX_ALLOWED_WAC_BUFF_SIZE 128 |
| 134 | 134 | ||
| 135 | struct kfd_ioctl_dbg_register_args { | 135 | struct kfd_ioctl_dbg_register_args { |
| 136 | uint32_t gpu_id; /* to KFD */ | 136 | __u32 gpu_id; /* to KFD */ |
| 137 | uint32_t pad; | 137 | __u32 pad; |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | struct kfd_ioctl_dbg_unregister_args { | 140 | struct kfd_ioctl_dbg_unregister_args { |
| 141 | uint32_t gpu_id; /* to KFD */ | 141 | __u32 gpu_id; /* to KFD */ |
| 142 | uint32_t pad; | 142 | __u32 pad; |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | struct kfd_ioctl_dbg_address_watch_args { | 145 | struct kfd_ioctl_dbg_address_watch_args { |
| 146 | uint64_t content_ptr; /* a pointer to the actual content */ | 146 | __u64 content_ptr; /* a pointer to the actual content */ |
| 147 | uint32_t gpu_id; /* to KFD */ | 147 | __u32 gpu_id; /* to KFD */ |
| 148 | uint32_t buf_size_in_bytes; /*including gpu_id and buf_size */ | 148 | __u32 buf_size_in_bytes; /*including gpu_id and buf_size */ |
| 149 | }; | 149 | }; |
| 150 | 150 | ||
| 151 | struct kfd_ioctl_dbg_wave_control_args { | 151 | struct kfd_ioctl_dbg_wave_control_args { |
| 152 | uint64_t content_ptr; /* a pointer to the actual content */ | 152 | __u64 content_ptr; /* a pointer to the actual content */ |
| 153 | uint32_t gpu_id; /* to KFD */ | 153 | __u32 gpu_id; /* to KFD */ |
| 154 | uint32_t buf_size_in_bytes; /*including gpu_id and buf_size */ | 154 | __u32 buf_size_in_bytes; /*including gpu_id and buf_size */ |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | /* Matching HSA_EVENTTYPE */ | 157 | /* Matching HSA_EVENTTYPE */ |
| @@ -172,44 +172,44 @@ struct kfd_ioctl_dbg_wave_control_args { | |||
| 172 | #define KFD_SIGNAL_EVENT_LIMIT 256 | 172 | #define KFD_SIGNAL_EVENT_LIMIT 256 |
| 173 | 173 | ||
| 174 | struct kfd_ioctl_create_event_args { | 174 | struct kfd_ioctl_create_event_args { |
| 175 | uint64_t event_page_offset; /* from KFD */ | 175 | __u64 event_page_offset; /* from KFD */ |
| 176 | uint32_t event_trigger_data; /* from KFD - signal events only */ | 176 | __u32 event_trigger_data; /* from KFD - signal events only */ |
| 177 | uint32_t event_type; /* to KFD */ | 177 | __u32 event_type; /* to KFD */ |
| 178 | uint32_t auto_reset; /* to KFD */ | 178 | __u32 auto_reset; /* to KFD */ |
| 179 | uint32_t node_id; /* to KFD - only valid for certain | 179 | __u32 node_id; /* to KFD - only valid for certain |
| 180 | event types */ | 180 | event types */ |
| 181 | uint32_t event_id; /* from KFD */ | 181 | __u32 event_id; /* from KFD */ |
| 182 | uint32_t event_slot_index; /* from KFD */ | 182 | __u32 event_slot_index; /* from KFD */ |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | struct kfd_ioctl_destroy_event_args { | 185 | struct kfd_ioctl_destroy_event_args { |
| 186 | uint32_t event_id; /* to KFD */ | 186 | __u32 event_id; /* to KFD */ |
| 187 | uint32_t pad; | 187 | __u32 pad; |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | struct kfd_ioctl_set_event_args { | 190 | struct kfd_ioctl_set_event_args { |
| 191 | uint32_t event_id; /* to KFD */ | 191 | __u32 event_id; /* to KFD */ |
| 192 | uint32_t pad; | 192 | __u32 pad; |
| 193 | }; | 193 | }; |
| 194 | 194 | ||
| 195 | struct kfd_ioctl_reset_event_args { | 195 | struct kfd_ioctl_reset_event_args { |
| 196 | uint32_t event_id; /* to KFD */ | 196 | __u32 event_id; /* to KFD */ |
| 197 | uint32_t pad; | 197 | __u32 pad; |
| 198 | }; | 198 | }; |
| 199 | 199 | ||
| 200 | struct kfd_memory_exception_failure { | 200 | struct kfd_memory_exception_failure { |
| 201 | uint32_t NotPresent; /* Page not present or supervisor privilege */ | 201 | __u32 NotPresent; /* Page not present or supervisor privilege */ |
| 202 | uint32_t ReadOnly; /* Write access to a read-only page */ | 202 | __u32 ReadOnly; /* Write access to a read-only page */ |
| 203 | uint32_t NoExecute; /* Execute access to a page marked NX */ | 203 | __u32 NoExecute; /* Execute access to a page marked NX */ |
| 204 | uint32_t pad; | 204 | __u32 pad; |
| 205 | }; | 205 | }; |
| 206 | 206 | ||
| 207 | /* memory exception data*/ | 207 | /* memory exception data*/ |
| 208 | struct kfd_hsa_memory_exception_data { | 208 | struct kfd_hsa_memory_exception_data { |
| 209 | struct kfd_memory_exception_failure failure; | 209 | struct kfd_memory_exception_failure failure; |
| 210 | uint64_t va; | 210 | __u64 va; |
| 211 | uint32_t gpu_id; | 211 | __u32 gpu_id; |
| 212 | uint32_t pad; | 212 | __u32 pad; |
| 213 | }; | 213 | }; |
| 214 | 214 | ||
| 215 | /* Event data*/ | 215 | /* Event data*/ |
| @@ -217,19 +217,19 @@ struct kfd_event_data { | |||
| 217 | union { | 217 | union { |
| 218 | struct kfd_hsa_memory_exception_data memory_exception_data; | 218 | struct kfd_hsa_memory_exception_data memory_exception_data; |
| 219 | }; /* From KFD */ | 219 | }; /* From KFD */ |
| 220 | uint64_t kfd_event_data_ext; /* pointer to an extension structure | 220 | __u64 kfd_event_data_ext; /* pointer to an extension structure |
| 221 | for future exception types */ | 221 | for future exception types */ |
| 222 | uint32_t event_id; /* to KFD */ | 222 | __u32 event_id; /* to KFD */ |
| 223 | uint32_t pad; | 223 | __u32 pad; |
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | struct kfd_ioctl_wait_events_args { | 226 | struct kfd_ioctl_wait_events_args { |
| 227 | uint64_t events_ptr; /* pointed to struct | 227 | __u64 events_ptr; /* pointed to struct |
| 228 | kfd_event_data array, to KFD */ | 228 | kfd_event_data array, to KFD */ |
| 229 | uint32_t num_events; /* to KFD */ | 229 | __u32 num_events; /* to KFD */ |
| 230 | uint32_t wait_for_all; /* to KFD */ | 230 | __u32 wait_for_all; /* to KFD */ |
| 231 | uint32_t timeout; /* to KFD */ | 231 | __u32 timeout; /* to KFD */ |
| 232 | uint32_t wait_result; /* from KFD */ | 232 | __u32 wait_result; /* from KFD */ |
| 233 | }; | 233 | }; |
| 234 | 234 | ||
| 235 | struct kfd_ioctl_set_scratch_backing_va_args { | 235 | struct kfd_ioctl_set_scratch_backing_va_args { |
