Lines Matching refs:args
133 struct kfd_ioctl_get_version_args *args = data; in kfd_ioctl_get_version() local
135 args->major_version = KFD_IOCTL_MAJOR_VERSION; in kfd_ioctl_get_version()
136 args->minor_version = KFD_IOCTL_MINOR_VERSION; in kfd_ioctl_get_version()
142 struct kfd_ioctl_create_queue_args *args) in set_queue_properties_from_user() argument
144 if (args->queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) { in set_queue_properties_from_user()
149 if (args->queue_priority > KFD_MAX_QUEUE_PRIORITY) { in set_queue_properties_from_user()
154 if ((args->ring_base_address) && in set_queue_properties_from_user()
156 (const void __user *) args->ring_base_address, in set_queue_properties_from_user()
162 if (!is_power_of_2(args->ring_size) && (args->ring_size != 0)) { in set_queue_properties_from_user()
168 (const void __user *) args->read_pointer_address, in set_queue_properties_from_user()
175 (const void __user *) args->write_pointer_address, in set_queue_properties_from_user()
181 if (args->eop_buffer_address && in set_queue_properties_from_user()
183 (const void __user *) args->eop_buffer_address, in set_queue_properties_from_user()
189 if (args->ctx_save_restore_address && in set_queue_properties_from_user()
191 (const void __user *) args->ctx_save_restore_address, in set_queue_properties_from_user()
198 q_properties->queue_percent = args->queue_percentage; in set_queue_properties_from_user()
199 q_properties->priority = args->queue_priority; in set_queue_properties_from_user()
200 q_properties->queue_address = args->ring_base_address; in set_queue_properties_from_user()
201 q_properties->queue_size = args->ring_size; in set_queue_properties_from_user()
202 q_properties->read_ptr = (uint32_t *) args->read_pointer_address; in set_queue_properties_from_user()
203 q_properties->write_ptr = (uint32_t *) args->write_pointer_address; in set_queue_properties_from_user()
204 q_properties->eop_ring_buffer_address = args->eop_buffer_address; in set_queue_properties_from_user()
205 q_properties->eop_ring_buffer_size = args->eop_buffer_size; in set_queue_properties_from_user()
207 args->ctx_save_restore_address; in set_queue_properties_from_user()
208 q_properties->ctx_save_restore_area_size = args->ctx_save_restore_size; in set_queue_properties_from_user()
209 if (args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE || in set_queue_properties_from_user()
210 args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE_AQL) in set_queue_properties_from_user()
212 else if (args->queue_type == KFD_IOC_QUEUE_TYPE_SDMA) in set_queue_properties_from_user()
217 if (args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE_AQL) in set_queue_properties_from_user()
223 q_properties->queue_percent, args->queue_percentage); in set_queue_properties_from_user()
226 q_properties->priority, args->queue_priority); in set_queue_properties_from_user()
229 q_properties->queue_address, args->ring_base_address); in set_queue_properties_from_user()
232 q_properties->queue_size, args->ring_size); in set_queue_properties_from_user()
251 struct kfd_ioctl_create_queue_args *args = data; in kfd_ioctl_create_queue() local
262 err = set_queue_properties_from_user(&q_properties, args); in kfd_ioctl_create_queue()
266 pr_debug("kfd: looking for gpu id 0x%x\n", args->gpu_id); in kfd_ioctl_create_queue()
267 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_create_queue()
269 pr_debug("kfd: gpu id 0x%x was not found\n", args->gpu_id); in kfd_ioctl_create_queue()
290 args->queue_id = queue_id; in kfd_ioctl_create_queue()
294 args->doorbell_offset = (KFD_MMAP_DOORBELL_MASK | args->gpu_id); in kfd_ioctl_create_queue()
295 args->doorbell_offset <<= PAGE_SHIFT; in kfd_ioctl_create_queue()
299 pr_debug("kfd: queue id %d was created successfully\n", args->queue_id); in kfd_ioctl_create_queue()
302 args->ring_base_address); in kfd_ioctl_create_queue()
305 args->read_pointer_address); in kfd_ioctl_create_queue()
308 args->write_pointer_address); in kfd_ioctl_create_queue()
322 struct kfd_ioctl_destroy_queue_args *args = data; in kfd_ioctl_destroy_queue() local
325 args->queue_id, in kfd_ioctl_destroy_queue()
330 retval = pqm_destroy_queue(&p->pqm, args->queue_id); in kfd_ioctl_destroy_queue()
340 struct kfd_ioctl_update_queue_args *args = data; in kfd_ioctl_update_queue() local
343 if (args->queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) { in kfd_ioctl_update_queue()
348 if (args->queue_priority > KFD_MAX_QUEUE_PRIORITY) { in kfd_ioctl_update_queue()
353 if ((args->ring_base_address) && in kfd_ioctl_update_queue()
355 (const void __user *) args->ring_base_address, in kfd_ioctl_update_queue()
361 if (!is_power_of_2(args->ring_size) && (args->ring_size != 0)) { in kfd_ioctl_update_queue()
366 properties.queue_address = args->ring_base_address; in kfd_ioctl_update_queue()
367 properties.queue_size = args->ring_size; in kfd_ioctl_update_queue()
368 properties.queue_percent = args->queue_percentage; in kfd_ioctl_update_queue()
369 properties.priority = args->queue_priority; in kfd_ioctl_update_queue()
372 args->queue_id, p->pasid); in kfd_ioctl_update_queue()
376 retval = pqm_update_queue(&p->pqm, args->queue_id, &properties); in kfd_ioctl_update_queue()
386 struct kfd_ioctl_set_memory_policy_args *args = data; in kfd_ioctl_set_memory_policy() local
392 if (args->default_policy != KFD_IOC_CACHE_POLICY_COHERENT in kfd_ioctl_set_memory_policy()
393 && args->default_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) { in kfd_ioctl_set_memory_policy()
397 if (args->alternate_policy != KFD_IOC_CACHE_POLICY_COHERENT in kfd_ioctl_set_memory_policy()
398 && args->alternate_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) { in kfd_ioctl_set_memory_policy()
402 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_set_memory_policy()
414 default_policy = (args->default_policy == KFD_IOC_CACHE_POLICY_COHERENT) in kfd_ioctl_set_memory_policy()
418 (args->alternate_policy == KFD_IOC_CACHE_POLICY_COHERENT) in kfd_ioctl_set_memory_policy()
425 (void __user *)args->alternate_aperture_base, in kfd_ioctl_set_memory_policy()
426 args->alternate_aperture_size)) in kfd_ioctl_set_memory_policy()
438 struct kfd_ioctl_dbg_register_args *args = data; in kfd_ioctl_dbg_register() local
445 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_register()
492 struct kfd_ioctl_dbg_unregister_args *args = data; in kfd_ioctl_dbg_unrgesiter() local
496 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_unrgesiter()
530 struct kfd_ioctl_dbg_address_watch_args *args = data; in kfd_ioctl_dbg_address_watch() local
541 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_address_watch()
550 cmd_from_user = (void __user *) args->content_ptr; in kfd_ioctl_dbg_address_watch()
554 if ((args->buf_size_in_bytes > MAX_ALLOWED_AW_BUFF_SIZE) || in kfd_ioctl_dbg_address_watch()
555 (args->buf_size_in_bytes <= sizeof(*args) + sizeof(int) * 2) || in kfd_ioctl_dbg_address_watch()
561 args->buf_size_in_bytes - sizeof(*args)); in kfd_ioctl_dbg_address_watch()
582 if (args_idx >= args->buf_size_in_bytes - sizeof(*args)) { in kfd_ioctl_dbg_address_watch()
606 if (args_idx >= args->buf_size_in_bytes - sizeof(args)) { in kfd_ioctl_dbg_address_watch()
629 struct kfd_ioctl_dbg_wave_control_args *args = data; in kfd_ioctl_dbg_wave_control() local
641 computed_buff_size = sizeof(*args) + in kfd_ioctl_dbg_wave_control()
648 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_wave_control()
658 if (args->buf_size_in_bytes != computed_buff_size) { in kfd_ioctl_dbg_wave_control()
660 args->buf_size_in_bytes, computed_buff_size); in kfd_ioctl_dbg_wave_control()
664 cmd_from_user = (void __user *) args->content_ptr; in kfd_ioctl_dbg_wave_control()
672 args->buf_size_in_bytes - sizeof(*args)); in kfd_ioctl_dbg_wave_control()
713 struct kfd_ioctl_get_clock_counters_args *args = data; in kfd_ioctl_get_clock_counters() local
717 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_get_clock_counters()
722 args->gpu_clock_counter = in kfd_ioctl_get_clock_counters()
727 args->cpu_clock_counter = (uint64_t)timespec64_to_ns(&time); in kfd_ioctl_get_clock_counters()
730 args->system_clock_counter = (uint64_t)timespec64_to_ns(&time); in kfd_ioctl_get_clock_counters()
733 args->system_clock_freq = 1000000000; in kfd_ioctl_get_clock_counters()
742 struct kfd_ioctl_get_process_apertures_args *args = data; in kfd_ioctl_get_process_apertures() local
748 args->num_of_nodes = 0; in kfd_ioctl_get_process_apertures()
758 &args->process_apertures[args->num_of_nodes]; in kfd_ioctl_get_process_apertures()
768 "node id %u\n", args->num_of_nodes); in kfd_ioctl_get_process_apertures()
784 args->num_of_nodes++; in kfd_ioctl_get_process_apertures()
786 (args->num_of_nodes < NUM_OF_SUPPORTED_GPUS)); in kfd_ioctl_get_process_apertures()
797 struct kfd_ioctl_create_event_args *args = data; in kfd_ioctl_create_event() local
800 err = kfd_event_create(filp, p, args->event_type, in kfd_ioctl_create_event()
801 args->auto_reset != 0, args->node_id, in kfd_ioctl_create_event()
802 &args->event_id, &args->event_trigger_data, in kfd_ioctl_create_event()
803 &args->event_page_offset, in kfd_ioctl_create_event()
804 &args->event_slot_index); in kfd_ioctl_create_event()
812 struct kfd_ioctl_destroy_event_args *args = data; in kfd_ioctl_destroy_event() local
814 return kfd_event_destroy(p, args->event_id); in kfd_ioctl_destroy_event()
820 struct kfd_ioctl_set_event_args *args = data; in kfd_ioctl_set_event() local
822 return kfd_set_event(p, args->event_id); in kfd_ioctl_set_event()
828 struct kfd_ioctl_reset_event_args *args = data; in kfd_ioctl_reset_event() local
830 return kfd_reset_event(p, args->event_id); in kfd_ioctl_reset_event()
836 struct kfd_ioctl_wait_events_args *args = data; in kfd_ioctl_wait_events() local
840 err = kfd_wait_on_events(p, args->num_events, in kfd_ioctl_wait_events()
841 (void __user *)args->events_ptr, in kfd_ioctl_wait_events()
842 (args->wait_for_all != 0), in kfd_ioctl_wait_events()
843 args->timeout, &wait_result); in kfd_ioctl_wait_events()
845 args->wait_result = wait_result; in kfd_ioctl_wait_events()